summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Schmitzer <noreply@maennchen1.de>2021-03-04 05:51:48 +0000
committerDaniel Schmitzer <noreply@maennchen1.de>2021-03-04 05:51:48 +0000
commit6964588935e0b0e7a3ac43b402fc581643c7bacc (patch)
tree33d183daca73babc892f88bfea2c87ccce906f9d
parent9f46ad9d1cb992055a57ad2eca68450bbd1ec549 (diff)
- Abo
git-svn-id: https://[internal]/wordpress/plugins/wpsg4@7851 0d5edaf7-2b12-4e95-93f4-047927463d4b
-rw-r--r--views/mods/mod_abo/produkt_addedit_content.phtml39
-rw-r--r--views/mods/mod_abo/settings_edit.phtml45
-rw-r--r--views/mods/mod_productvariants/admin_edit.phtml27
-rw-r--r--views/produkt/images.phtml2
-rw-r--r--views/produkt/images_list.phtml2
5 files changed, 90 insertions, 25 deletions
diff --git a/views/mods/mod_abo/produkt_addedit_content.phtml b/views/mods/mod_abo/produkt_addedit_content.phtml
index 055659f..e06f94a 100644
--- a/views/mods/mod_abo/produkt_addedit_content.phtml
+++ b/views/mods/mod_abo/produkt_addedit_content.phtml
@@ -5,6 +5,7 @@
*/
$arPaymentSelect = [
+ '-1' => __('Standard', 'wpsg'),
'origin' => __('Wie ursprüngliche Zahlungsart', 'wpsg')
];
@@ -55,7 +56,7 @@
<?php echo wpsg_drawForm_Input('wpsg_mod_abo_price', wpsg_translate(__('Abo Preis (#1#)', 'wpsg'), (($this->get_option('wpsg_preisangaben') == WPSG_NETTO)?__('Netto', 'wpsg'):__('Brutto', 'wpsg'))), wpsg_ff($this->view['product']['wpsg_mod_abo_price']), array('unit' => $this->get_option('wpsg_currency'), 'help' => 'wpsg_mod_abo_price')); ?>
<?php echo wpsg_drawForm_Input('wpsg_mod_abo_durration', __('Abo Dauer (Tage)', 'wpsg'), $this->view['product']['wpsg_mod_abo_durration'], array('help' => 'wpsg_mod_abo_durration')); ?>
- <?php echo wpsg_drawForm_Input('wpsg_mod_abo_url', __('URL Benachrichtigung', 'wpsg'), $this->view['product']['wpsg_mod_abo_url'], array('hint' => wpsg_translate(__('nohspc_Wird hier nichts angegeben, so wird die URL aus der <a href="#1#">Modulkonfiguration</a> bei Ablauf/Verlängerung benachrichtigt.', 'wpsg'), WPSG_URL_WP.'wp-admin/admin.php?page=wpsg-Admin&action=module&modul=wpsg_mod_abo'), 'help' => 'wpsg_mod_abo_url')); ?>
+ <?php echo wpsg_drawForm_Input('wpsg_mod_abo_url', __('URL Benachrichtigung', 'wpsg'), $this->view['product']['wpsg_mod_abo_url'], array('hint' => wpsg_translate(__('Wird hier nichts angegeben, so wird die URL aus der <a href="#1#">Modulkonfiguration</a> bei Ablauf/Verlängerung benachrichtigt.', 'wpsg'), WPSG_URL_WP.'wp-admin/admin.php?page=wpsg-Admin&action=module&modul=wpsg_mod_abo'), 'help' => 'wpsg_mod_abo_url')); ?>
<div class="wpsg_clear"></div>
@@ -117,7 +118,7 @@
<br />
- <div class="wpsg_mod_abo_expiremode wpsg_mod_abo_expiremode_<?php echo wpsg_mod_abo::EXPIRE_AUTO; ?>" style="display:none;">
+ <div id="wpsg_mod_abo_expiremode_auto_layer" 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')); ?>
@@ -133,14 +134,34 @@
'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_customer', __('Kunde kann im Frontend', 'wpsg'), [
- wpsg_mod_abo::CONFIG => __('Standard', 'wpsg'),
- wpsg_mod_abo::CUSTOMER_AUTO_NOTHING => __('Nichts', 'wpsg'),
- wpsg_mod_abo::CUSTOMER_AUTO_DIRECT => __('Verlängerung direkt stoppen', 'wpsg'),
- wpsg_mod_abo::CUSTOMER_AUTO_MAIL => __('Verlängerung über Mail an Administrator stoppen', 'wpsg')
- ], $this->view['product']['wpsg_mod_abo_autoexpire_customer'], array('help' => 'wpsg_mod_abo_autoexpire_customer')); ?>
-
</div>
+
+ <script>
+
+ let wpsg_mod_abo_expiremode_auto_layer = document.getElementById('wpsg_mod_abo_expiremode_auto_layer');
+ let wpsg_mod_abo_expiremode = document.getElementById('wpsg_mod_abo_expiremode');
+ let wpsg_mod_abo_premode = document.getElementById('wpsg_mod_abo_premode');
+
+ function displayAutoRenewOptions() {
+
+ if (wpsg_mod_abo_expiremode.value === '<?php echo wpsg_mod_abo::EXPIRE_AUTO; ?>' || wpsg_mod_abo_premode.value === '<?php echo wpsg_mod_abo::EXPIRE_AUTO; ?>') {
+
+ wpsg_mod_abo_expiremode_auto_layer.style.display = 'block';
+
+ } else {
+
+ wpsg_mod_abo_expiremode_auto_layer.style.display = 'none';
+
+ }
+
+ }
+
+ wpsg_mod_abo_expiremode.addEventListener('change', displayAutoRenewOptions);
+ wpsg_mod_abo_premode.addEventListener('change', displayAutoRenewOptions);
+
+ displayAutoRenewOptions();
+
+ </script>
<script>
diff --git a/views/mods/mod_abo/settings_edit.phtml b/views/mods/mod_abo/settings_edit.phtml
index 598a7f8..59e854a 100644
--- a/views/mods/mod_abo/settings_edit.phtml
+++ b/views/mods/mod_abo/settings_edit.phtml
@@ -69,7 +69,7 @@
<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'); ?>;">
+<div id="wpsg_mod_abo_expiremode_auto_layer" style="display:none;">
<?php /* TODO: Mehrfachauswahl von Zahlungsarten */ ?>
<?php echo wpsg_drawForm_Select('wpsg_mod_abo_autoexpire_payment', __('Zahlungsart für automatische Verlängerung', 'wpsg'), $arPaymentSelect, $this->get_option('wpsg_mod_abo_autoexpire_payment'), array('help' => 'wpsg_mod_abo_autoexpire_payment')); ?>
@@ -86,20 +86,47 @@
<br />
- <?php echo wpsg_drawForm_Select('wpsg_mod_abo_autoexpire_customer', __('Kunde kann im Frontend', 'wpsg'), Array(
- wpsg_mod_abo::CUSTOMER_AUTO_NOTHING => __('Nichts', 'wpsg'),
- wpsg_mod_abo::CUSTOMER_AUTO_DIRECT => __('Verlängerung direkt stoppen', 'wpsg'),
- wpsg_mod_abo::CUSTOMER_AUTO_MAIL => __('Verlängerung über Mail an Administrator stoppen', 'wpsg')
- ), $this->get_option('wpsg_mod_abo_autoexpire_customer'), array('help' => 'wpsg_mod_abo_autoexpire_customer')); ?>
-
</div>
+<script>
+
+ let wpsg_mod_abo_expiremode_auto_layer = document.getElementById('wpsg_mod_abo_expiremode_auto_layer');
+ let wpsg_mod_abo_expiremode = document.getElementById('wpsg_mod_abo_expiremode');
+ let wpsg_mod_abo_premode = document.getElementById('wpsg_mod_abo_premode');
+
+ function displayAutoRenewOptions() {
+
+ if (wpsg_mod_abo_expiremode.value === '<?php echo wpsg_mod_abo::EXPIRE_AUTO; ?>' || wpsg_mod_abo_premode.value === '<?php echo wpsg_mod_abo::EXPIRE_AUTO; ?>') {
+
+ wpsg_mod_abo_expiremode_auto_layer.style.display = 'block';
+
+ } else {
+
+ wpsg_mod_abo_expiremode_auto_layer.style.display = 'none';
+
+ }
+
+ }
+
+ wpsg_mod_abo_expiremode.addEventListener('change', displayAutoRenewOptions);
+ wpsg_mod_abo_premode.addEventListener('change', displayAutoRenewOptions);
+
+ displayAutoRenewOptions();
+
+</script>
+
+<?php echo wpsg_drawForm_Select('wpsg_mod_abo_autoexpire_customer', __('Kunde kann im Frontend', 'wpsg'), Array(
+ wpsg_mod_abo::CUSTOMER_AUTO_NOTHING => __('Nichts', 'wpsg'),
+ wpsg_mod_abo::CUSTOMER_AUTO_DIRECT => __('Verlängerung direkt stoppen', 'wpsg'),
+ wpsg_mod_abo::CUSTOMER_AUTO_MAIL => __('Verlängerung über Mail an Administrator stoppen', 'wpsg')
+), $this->get_option('wpsg_mod_abo_autoexpire_customer'), array('help' => 'wpsg_mod_abo_autoexpire_customer')); ?>
+
<?php echo wpsg_drawForm_Input(false, __('CRON URL', 'wpsg'), site_url().'/?wpsg_cron=1', ['readonly' => true]); ?>
<?php echo wpsg_drawForm_Text(__('Letzter Cron Aufruf', 'wpsg'), wpsg_formatTimestamp($this->get_option('wpsg_mod_abo_cron_lastrun'))); ?>
<br />
-<script type="text/javascript">/* <![CDATA[ */
+<script>
jQuery(document).ready(function() {
@@ -112,4 +139,4 @@
} );
-/* ]]> */</script>
+</script>
diff --git a/views/mods/mod_productvariants/admin_edit.phtml b/views/mods/mod_productvariants/admin_edit.phtml
index cf5a021..0546aa3 100644
--- a/views/mods/mod_productvariants/admin_edit.phtml
+++ b/views/mods/mod_productvariants/admin_edit.phtml
@@ -199,18 +199,27 @@
<tr class="wpsg_mod_productvariants_productimage_row">
<td class="col_active">&nbsp;</td>
- <?php
+ <?php
+
+ $has_global_images = false;
if (wpsg_isSizedInt($this->view['product_id'])) {
- $arAttachmentIDs = $this->imagehandler->getAttachmentIDs($this->view['product_id'], $vari['id'], true);
+ $global_images = wpsg_explode(',', $this->db->fetchOne("SELECT `images` FROM `".WPSG_TBL_VARIANTS_VARI."` WHERE `id` = '".wpsg_q($vari['id'])."' "));
+
+ if (wpsg_isSizedArray($global_images)) {
+
+ $arAttachmentIDs = $global_images;
+ $has_global_images = true;
+
+ } else $arAttachmentIDs = $this->imagehandler->getAttachmentIDs($this->view['product_id'], $vari['id'], true, false);
} else {
$arAttachmentIDs = $vari['images'];
}
-
+
?>
<td class="ui-sortable" colspan="<?php echo $colspan; ?>" id="wpsg_images_productimage_<?php echo $this->view['variant']['id']; ?>_<?php echo $vari['id']; ?>" >
@@ -221,9 +230,17 @@
<?php if (wpsg_isSizedInt($this->view['product_id'])) { ?>
- <a href="#" class="<?php echo ((in_array($attachment_id, explode(",", $vari['images_set'])))?'mark':''); ?> pic" id="<?php echo $attachment_id; ?>" onclick="return wpsg_vp_vari_setPic(this, <?php echo $this->view['variant']['id']; ?>, <?php echo $vari['id'] ?>, '<?php echo $attachment_id; ?>', <?php echo $this->view['product_id']; ?>);">
+ <?php if ($has_global_images) { ?>
+
<?php echo wp_get_attachment_image($attachment_id, array(25, 25), true); ?>
- </a>
+
+ <?php } else { ?>
+
+ <a href="#" class="<?php echo ((in_array($attachment_id, explode(",", $vari['images_set'])) && !$has_global_images)?'mark':''); ?> pic" id="<?php echo $attachment_id; ?>" onclick="return wpsg_vp_vari_setPic(this, <?php echo $this->view['variant']['id']; ?>, <?php echo $vari['id'] ?>, '<?php echo $attachment_id; ?>', <?php echo $this->view['product_id']; ?>);">
+ <?php echo wp_get_attachment_image($attachment_id, array(25, 25), true); ?>
+ </a>
+
+ <?php } ?>
<?php } else { ?>
diff --git a/views/produkt/images.phtml b/views/produkt/images.phtml
index a1f3927..5e11aac 100644
--- a/views/produkt/images.phtml
+++ b/views/produkt/images.phtml
@@ -71,7 +71,7 @@
jQuery('#wpsg_produktbilder_remove').modal('hide');
jQuery('#produktbilder_target_MT').html('<img src="<?php echo WPSG_URL; ?>views/gfx/ajax-loader.gif" alt="<?php echo __('Bitte warten ...', 'wpsg'); ?>" />');
-
+
jQuery.ajax( {
url: '<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Produkt&action=ajax&cmd=removeImage&noheader=1&edit_id=<?php echo $this->view['data']['id']; ?>',
async: true,
diff --git a/views/produkt/images_list.phtml b/views/produkt/images_list.phtml
index 2695327..550045b 100644
--- a/views/produkt/images_list.phtml
+++ b/views/produkt/images_list.phtml
@@ -13,7 +13,7 @@
<div id="produktbild_div_<?php echo $attachment_id; ?>" class="wpsg_mod_produktbilder_admin_bild">
<a id="produktbild_<?php echo $attachment_id; ?>" onclick="return wpsg_remove_bild_MT('<?php echo $attachment_id; ?>');" href="#" title="<?php echo __('Dieses Bild löschen.', 'wpsg'); ?>">
-
+
<div class="box_img_wrap wpsg_be_imagelist_image">
<?php echo wp_get_attachment_image($attachment_id, 'medium'); ?>