summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Schmitzer <noreply@maennchen1.de>2021-01-20 10:40:09 +0000
committerDaniel Schmitzer <noreply@maennchen1.de>2021-01-20 10:40:09 +0000
commitd75554fdc6126617502f4b04f20c7e18057e8bf4 (patch)
treec49b1e5c0e24b56bff9ac4ac3343d8bf3d3d5aed
parent3f68836c301ceb4ac48f9efeacf2de3d6672496c (diff)
- Abo automatisch X - Tage vorher verlängern
git-svn-id: https://[internal]/wordpress/plugins/wpsg4@7823 0d5edaf7-2b12-4e95-93f4-047927463d4b
-rw-r--r--views/mods/mod_abo/produkt_addedit_content.phtml84
-rw-r--r--views/mods/mod_abo/settings_edit.phtml78
-rw-r--r--views/mods/mod_relatedproducts/list.phtml2
-rw-r--r--views/produkt/addedit_payship.phtml10
4 files changed, 92 insertions, 82 deletions
diff --git a/views/mods/mod_abo/produkt_addedit_content.phtml b/views/mods/mod_abo/produkt_addedit_content.phtml
index 32d2855..0bd79e7 100644
--- a/views/mods/mod_abo/produkt_addedit_content.phtml
+++ b/views/mods/mod_abo/produkt_addedit_content.phtml
@@ -67,18 +67,56 @@
wpsg_mod_abo::EXPIRE_AUTO => __('Automatisch verlängern', 'wpsg')
), $this->view['product']['wpsg_mod_abo_expiremode'], array('help' => 'wpsg_mod_abo_expiremode')); ?>
+ <?php
+
+ $strLabelPreModeDefault = '';
+
+ if ($this->get_option('wpsg_mod_abo_premode') == wpsg_mod_abo::EXPIRE_MAIL) $strLabelPreModeDefault = ' / '.__('Mail versenden', 'wpsg');
+ else if ($this->get_option('wpsg_mod_abo_premode') === wpsg_mod_abo::EXPIRE_AUTO) $strLabelPreModeDefault = ' / '.__('Automatisch verlängern', 'wpsg');
+
+ ?>
+
+ <?php echo wpsg_drawForm_Select('wpsg_mod_abo_premode', __('X - Tage vor Ablauf des Abos', 'wpsg'), [
+ wpsg_mod_abo::CONFIG => __('Standard', 'wpsg').$strLabelPreModeDefault,
+ wpsg_mod_abo::EXPIRE_MAIL => __('Mail versenden', 'wpsg'),
+ wpsg_mod_abo::EXPIRE_AUTO => __('Automatisch verlängern', 'wpsg')
+ ], $this->view['product']['wpsg_mod_abo_premode'], ['help' => 'wpsg_mod_abo_premode']); ?>
+
+ <div id="wpsg_mod_abo_premode_greater0" style="display:none;">
+
+ <?php echo wpsg_drawForm_Input('wpsg_mod_abo_autoexpire_informationtime', __('Zeitspanne zum Versenden der Informationsmail in Tagen', 'wpsg'), $this->view['product']['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_abo_expiremode wpsg_mod_abo_expiremode_<?php echo wpsg_mod_abo::EXPIRE_MAIL; ?>" style="display:none;">
-
- <?php echo wpsg_drawForm_Select('wpsg_mod_abo_wpsgmodaboexpiration', __('Mail bei Auslauf eines Abos', 'wpsg'), [
- wpsg_mod_abo::CONFIG => __('Standard', 'wpsg'),
- '0' => __('Nein', 'wpsg'),
- '1' => __('Ja', 'wpsg')
- ], $this->view['product']['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',)); ?>
- </div>
-
<div class="wpsg_mod_abo_expiremode wpsg_mod_abo_expiremode_<?php echo wpsg_mod_abo::EXPIRE_AUTO; ?>" style="display:none;">
<?php echo wpsg_drawForm_Select('wpsg_mod_abo_autoexpire_payment', __('Zahlungsart für automatische Verlängerung', 'wpsg'), $arPaymentSelect, $this->view['product']['wpsg_mod_abo_autoexpire_payment'], array('help' => 'wpsg_mod_abo_autoexpire_payment')); ?>
@@ -95,23 +133,6 @@
'1' => __('Ja', 'wpsg')
], $this->view['product']['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'), [
- wpsg_mod_abo::CONFIG => __('Standard', 'wpsg'),
- '0' => __('Nein', 'wpsg'),
- '1' => __('Ja', 'wpsg')
- ], $this->view['product']['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_information wpsg_mod_abo_autoexpire_information_1" style="display:none;">
-
- <?php echo wpsg_drawForm_Input('wpsg_mod_abo_autoexpire_informationtime', __('Zeitspanne zum Versenden der Informationsmail in Tagen', 'wpsg'), $this->view['product']['wpsg_mod_abo_autoexpire_informationtime'], [
- 'help' => 'wpsg_mod_abo_autoexpire_informationtime'
- ]); ?>
-
- </div>
-
<?php echo wpsg_drawForm_Select('wpsg_mod_abo_autoexpire_customer', __('Kunde kann im Frontend', 'wpsg'), [
wpsg_mod_abo::CONFIG => __('Standard', 'wpsg'),
wpsg_mod_abo::CUSTOMER_AUTO_NOTHING => __('Nichts', 'wpsg'),
@@ -128,15 +149,8 @@
jQuery('.wpsg_mod_abo_expiremode').hide();
jQuery('.wpsg_mod_abo_expiremode_' + jQuery(this).val()).show();
- }).change();
-
- jQuery('#wpsg_mod_abo_autoexpire_information').on('change', function() {
+ }).trigger('change');
- jQuery('.wpsg_mod_abo_autoexpire_information').hide();
- jQuery('.wpsg_mod_abo_autoexpire_information_' + jQuery(this).val()).show();
-
- }).change();
-
</script>
</div>
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>
diff --git a/views/mods/mod_relatedproducts/list.phtml b/views/mods/mod_relatedproducts/list.phtml
index 9299683..2f56561 100644
--- a/views/mods/mod_relatedproducts/list.phtml
+++ b/views/mods/mod_relatedproducts/list.phtml
@@ -19,7 +19,7 @@
<script type="text/javascript">
- jQuery('#relatedproducts_list a.wpsg_icon_remove').bind('click', function() {
+ jQuery('#relatedproducts_list a.wpsg_icon_remove').on('click', function() {
var rel_id = jQuery(this).parents('span').attr('id').replace(/wpsg_rp_/, '');
diff --git a/views/produkt/addedit_payship.phtml b/views/produkt/addedit_payship.phtml
index e50f852..96429a2 100644
--- a/views/produkt/addedit_payship.phtml
+++ b/views/produkt/addedit_payship.phtml
@@ -25,12 +25,14 @@
<script>
- jQuery('#wpsg_paymentmethods_select').bind('change', function() {
+ jQuery('#wpsg_paymentmethods_select').on('change', function() {
if (jQuery(this).val() == '1') jQuery('.wpsg_paymentmethods_select').show();
else jQuery('.wpsg_paymentmethods_select').hide();
- } ).change();
+ } ).trigger('change');
+
+
</script>
@@ -51,12 +53,12 @@
<script>
- jQuery('#wpsg_shippingmethods_select').bind('change', function() {
+ jQuery('#wpsg_shippingmethods_select').on('change', function() {
if (jQuery(this).val() == '1') jQuery('.wpsg_shippingmethods_select').show();
else jQuery('.wpsg_shippingmethods_select').hide();
- } ).change();
+ } ).trigger('change');
</script>