summaryrefslogtreecommitdiff
path: root/views/mods/mod_abo/settings_edit.phtml
diff options
context:
space:
mode:
Diffstat (limited to 'views/mods/mod_abo/settings_edit.phtml')
-rw-r--r--views/mods/mod_abo/settings_edit.phtml78
1 files changed, 36 insertions, 42 deletions
diff --git a/views/mods/mod_abo/settings_edit.phtml b/views/mods/mod_abo/settings_edit.phtml
index 1f50701..0717229 100644
--- a/views/mods/mod_abo/settings_edit.phtml
+++ b/views/mods/mod_abo/settings_edit.phtml
@@ -27,17 +27,47 @@
wpsg_mod_abo::EXPIRE_AUTO => __('Automatisch verlängern', 'wpsg')
), $this->get_option('wpsg_mod_abo_expiremode'), array('help' => 'wpsg_mod_abo_expiremode')); ?>
-<br />
+<?php echo wpsg_drawForm_Select('wpsg_mod_abo_premode', __('X - Tage vor Ablauf des Abos', 'wpsg'), [
+ wpsg_mod_abo::EXPIRE_NONE => __('Nichts', 'wpsg'),
+ wpsg_mod_abo::EXPIRE_MAIL => __('Mail versenden', 'wpsg'),
+ wpsg_mod_abo::EXPIRE_AUTO => __('Automatisch verlängern', 'wpsg')
+], $this->get_option('wpsg_mod_abo_premode'), ['help' => 'wpsg_mod_abo_premode']); ?>
-<div class="wpsg_mod_expiremode wpsg_mod_expiremode_<?php echo wpsg_mod_abo::EXPIRE_MAIL; ?>" style="display:<?php echo (($this->get_option('wpsg_mod_abo_expiremode') == wpsg_mod_abo::EXPIRE_MAIL || $this->get_option('wpsg_mod_abo_expiremode') === false)?'block':'none'); ?>;">
+<div id="wpsg_mod_abo_premode_greater0" style="display:none;">
- <?php echo wpsg_drawForm_Select('wpsg_mod_abo_wpsgmodaboexpiration', __('Mail bei Auslauf eines Abos', 'wpsg'), [
- '0' => __('Nein', 'wpsg'),
- '1' => __('Ja', 'wpsg')
- ], $this->get_option('wpsg_mod_abo_wpsgmodaboexpiration'), array('hint' => wpsg_translate(__('Mail wird bei Auslauf eines Abos versendet. (mail_expiration.phtml) -> <a href="#1#">Konfiguration</a>', 'wpsg'), WPSG_URL_WP.'wp-admin/admin.php?page=wpsg-Admin&subaction=emailconf#wpsgmodaboexpiration'), 'help' => 'wpsg_mod_abo_wpsgmodaboexpiration',)); ?>
+ <?php echo wpsg_drawForm_Input('wpsg_mod_abo_autoexpire_informationtime', __('Zeitspanne zum Versenden der Informationsmail in Tagen', 'wpsg'), $this->get_option('wpsg_mod_abo_autoexpire_informationtime'), [
+ 'help' => 'wpsg_mod_abo_autoexpire_informationtime'
+ ]); ?>
</div>
+<script>
+
+ let wpsg_mod_abo_premodeSELECT = document.getElementById('wpsg_mod_abo_premode');
+ let wpsg_mod_abo_premode_greater0DIV = document.getElementById('wpsg_mod_abo_premode_greater0');
+
+ wpsg_mod_abo_premodeSELECT.addEventListener('change', () => {
+
+ console.log(parseInt(wpsg_mod_abo_premodeSELECT.value));
+
+ if (parseInt(wpsg_mod_abo_premodeSELECT.value) > 0 || (parseInt(wpsg_mod_abo_premodeSELECT.value) === -1 && <?php echo ((intval($this->get_option('wpsg_mod_abo_premode')) > 0)?'true':'false'); ?>)) {
+
+ wpsg_mod_abo_premode_greater0DIV.style.display = 'block';
+
+ } else {
+
+ wpsg_mod_abo_premode_greater0DIV.style.display = 'none';
+
+ }
+
+ });
+
+ wpsg_mod_abo_premodeSELECT.dispatchEvent(new Event('change'));
+
+</script>
+
+<br />
+
<div class="wpsg_mod_expiremode wpsg_mod_expiremode_<?php echo wpsg_mod_abo::EXPIRE_AUTO; ?>" style="display:<?php echo (($this->get_option('wpsg_mod_abo_expiremode') == wpsg_mod_abo::EXPIRE_AUTO)?'block':'none'); ?>;">
<?php /* TODO: Mehrfachauswahl von Zahlungsarten */ ?>
@@ -53,20 +83,6 @@
'1' => __('Ja', 'wpsg')
], $this->get_option('wpsg_mod_abo_autoexpire_adminmail'), ['help' => 'wpsg_mod_abo_autoexpire_adminmail']); ?>
- <?php echo wpsg_drawForm_Select('wpsg_mod_abo_autoexpire_information', __('Mail vor automatischer Verlängerung versenden', 'wpsg'), [
- '0' => __('Nein', 'wpsg'),
- '1' => __('Ja', 'wpsg')
- ], $this->get_option('wpsg_mod_abo_autoexpire_information'), [
- 'help' => 'wpsg_mod_abo_autoexpire_information',
- 'hint' => wpsg_translate(__('Mail wird X-Tage vor einer automatischen Verlängerung versendet. (mail_autoinformation.phtml) -> <a href="#1#">Konfiguration</a>', 'wpsg'), WPSG_URL_WP.'wp-admin/admin.php?page=wpsg-Admin&subaction=emailconf#wpsgmodabautoinfo')
- ]); ?>
-
- <div class="wpsg_mod_abo_autoexpire_informationactiv" style="display:none;">
-
- <?php echo wpsg_drawForm_Input('wpsg_mod_abo_autoexpire_informationtime', __('Zeitspanne zum Versenden der Informationsmail in Tagen', 'wpsg'), $this->get_option('wpsg_mod_abo_autoexpire_informationtime'), array('help' => 'wpsg_mod_abo_autoexpire_informationtime')); ?>
-
- </div>
-
<br />
<?php echo wpsg_drawForm_Select('wpsg_mod_abo_autoexpire_customer', __('Kunde kann im Frontend', 'wpsg'), Array(
@@ -82,21 +98,6 @@
<br />
-<?php /* TODO: Prüfung auf Mehrfachbestellung global */ /* Option: Mehrfachbestellung möglich ?>
-<?php echo wpsg_drawForm_Checkbox('wpsg_mod_abo_moreorder', __('Mehrfachbestellung möglich', 'wpsg'), $this->get_option('wpsg_mod_abo_moreorder'), array ('help' => 'wpsg_mod_abo_moreorder')); ?>
-
-<div class="wpsg_mod_expiremode_moreorder_activ" style="display:none;">
-
- <?php echo wpsg_drawForm_Input('wpsg_mod_abo_moreorder_text', __('Hinweistext', 'wpsg'), $this->get_option('wpsg_mod_abo_moreorder_text'), array('help' => 'wpsg_mod_abo_moreorder_text'));?>
-
-</div>
-
-<div class="wpsg_mod_expiremode_moreorder_deactiv">
-
- <?php echo wpsg_drawForm_Input('wpsg_mod_abo_nomoreorder_text', __('Hinweistext', 'wpsg'), $this->get_option('wpsg_mod_abo_nomoreorder_text'), array('help' => 'wpsg_mod_abo_nomoreorder_text'));?>
-
-</div>
-*/?>
<script type="text/javascript">/* <![CDATA[ */
jQuery(document).ready(function() {
@@ -108,13 +109,6 @@
} );
- jQuery('#wpsg_mod_abo_autoexpire_information').bind('change', function() {
-
- if (jQuery(this).val() === '1') jQuery('.wpsg_mod_abo_autoexpire_informationactiv').show();
- else jQuery('.wpsg_mod_abo_autoexpire_informationactiv').hide();
-
- } ).change();
-
} );
/* ]]> */</script>