diff options
| author | Daniel Schmitzer <noreply@maennchen1.de> | 2017-12-18 11:03:23 +0000 |
|---|---|---|
| committer | Daniel Schmitzer <noreply@maennchen1.de> | 2017-12-18 11:03:23 +0000 |
| commit | d67a2847c17e077b641a316af40f13ffc71f37dc (patch) | |
| tree | 97e13a66be4da9727f2c8cb2053d8aa4a82f4530 /views | |
| parent | 0fda8e4e52c31a8d3e725463842d56da6db49db6 (diff) | |
- AboModul Erweiterung
- Start / Stop im Backend
- Automatische Verlängerung
git-svn-id: https://[internal]/wordpress/plugins/wpsg4@6830 0d5edaf7-2b12-4e95-93f4-047927463d4b
Diffstat (limited to 'views')
| -rw-r--r-- | views/admin/form/checkbox.phtml | 4 | ||||
| -rw-r--r-- | views/css/admin.css | 6 | ||||
| -rw-r--r-- | views/mods/mod_abo/order_view.phtml | 44 | ||||
| -rw-r--r-- | views/mods/mod_abo/settings_edit.phtml | 49 | ||||
| -rw-r--r-- | views/order/index.phtml | 26 |
5 files changed, 119 insertions, 10 deletions
diff --git a/views/admin/form/checkbox.phtml b/views/admin/form/checkbox.phtml index 8a574f2..12e184a 100644 --- a/views/admin/form/checkbox.phtml +++ b/views/admin/form/checkbox.phtml @@ -36,6 +36,10 @@ <?php } ?>
<?php } ?>
+ <?php if (wpsg_isSizedString($this->view['field_config']['hint'])) { ?>
+ <div class="hint info"><?php echo $this->view['field_config']['hint']; ?></div>
+ <?php } ?>
+
</div>
</label>
diff --git a/views/css/admin.css b/views/css/admin.css index e7d9fa1..f80cd80 100644 --- a/views/css/admin.css +++ b/views/css/admin.css @@ -217,7 +217,7 @@ table.wpsgitrecht_table { width:100%; } .wpsg_order .wpsg_status_link_wrap { min-height:50px; float:left; display:inline-block; }
.wpsg_order .col_checkbox { width:20px; }
.wpsg_order .col_checkbox input { margin-top:-2px; }
-.wpsg_order .col_nr { width:200px; }
+.wpsg_order .col_nr { width:250px; }
.wpsg_order .col_nr .actions a { font-size:0.9em; }
.wpsg_order .col_nr .glyphicon { margin-top:5px; font-size:1.2em; margin-right:5px; text-decoration:none; }
.wpsg_order .col_nr .glyphicon.shippingadress { color:red; }
@@ -257,6 +257,10 @@ table.wpsgitrecht_table { width:100%; } /* Formularanpassungen */
.form-checkbox label { font-size:12px; line-height:200%; }
+/* Modul AboProdukte */
+.wpsg_mod_abo_expired { color:red; }
+.wpsg_mod_abo_future_expire { color:green; }
+
/* Modul Produktbilder (wpsg_mod_produktbilder) */
#produktbilder_target img { }
.wpsg_mod_produktbilder_admin_bild a { position:relative; display:inline-block; float:left; margin-right:5px; margin-bottom:5px; }
diff --git a/views/mods/mod_abo/order_view.phtml b/views/mods/mod_abo/order_view.phtml new file mode 100644 index 0000000..8ae8a65 --- /dev/null +++ b/views/mods/mod_abo/order_view.phtml @@ -0,0 +1,44 @@ +<?php
+
+ /**
+ * Template für die Anzeige des Abo Statuses in der Hauptbestellung
+ */
+
+
+?>
+
+<?php foreach ($this->view['arOrderedAboProducts'] as $oOrderProduct) { ?>
+
+ <?php echo wpsg_drawForm_AdminboxStart($oOrderProduct->getProduct()->getProductName()); ?>
+
+ <?php echo wpsg_drawForm_TextStart(); ?>
+
+ <?php $abo_product_status = $this->callMod('wpsg_mod_abo', 'getAboProductStatus', Array($_REQUEST['edit_id'], $oOrderProduct->getProductKey())); ?>
+
+ <?php if ($abo_product_status['status'] === wpsg_mod_abo::STATUS_ACTIVE) { ?>
+
+ <?php echo __('Aktiv', 'wpsg'); ?>
+
+ [ <a href="<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Order&action=ajax&mod=wpsg_mod_abo&edit_id=<?php echo $_REQUEST['edit_id'] ?>&product_key=<?php echo $oOrderProduct->getProductKey(); ?>&do=stop&noheader=1"><?php echo __('Anhalten'); ?></a> ]
+
+ <?php } else if ($abo_product_status['status'] === wpsg_mod_abo::STATUS_STOPPED) { ?>
+
+ <?php echo __('Angehalten', 'wpsg'); ?>
+
+ [ <a href="<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Order&action=ajax&mod=wpsg_mod_abo&edit_id=<?php echo $_REQUEST['edit_id'] ?>&product_key=<?php echo $oOrderProduct->getProductKey(); ?>&do=run&noheader=1"><?php echo __('Fortsetzen'); ?></a> ]
+
+ <?php } ?>
+
+ <?php echo wpsg_drawForm_TextEnd(__('Verlängerung')); ?>
+
+ <?php $tExpire = strtotime($this->callMod('wpsg_mod_abo', 'getOrderAboExpiration', Array($_REQUEST['edit_id']))); echo wpsg_drawForm_Text(__('Abo läuft bis'), wpsg_formatTimestamp($tExpire), false, Array('class_content_wrap' => (($tExpire > time())?'wpsg_mod_abo_future_expire':'wpsg_mod_abo_expired'))); ?>
+
+ <?php /* echo wpsg_drawForm_TextStart(); ?>
+
+ <?php echo wpsg_translate(_('Erstkauf am #1#', 'wpsg'), $this->view['data']['cdate']); ?>
+
+ <?php echo wpsg_drawForm_TextEnd(__('Verlauf', 'wpsg')); */ ?>
+
+ <?php echo wpsg_drawForm_AdminboxEnd(); ?>
+
+<?php } ?>
\ No newline at end of file diff --git a/views/mods/mod_abo/settings_edit.phtml b/views/mods/mod_abo/settings_edit.phtml index 8dcb052..bd57d0e 100644 --- a/views/mods/mod_abo/settings_edit.phtml +++ b/views/mods/mod_abo/settings_edit.phtml @@ -3,10 +3,53 @@ /**
* Template für die Einstellungen des Abo Moduls
*/
-
+
+ $arPaymentSelect = Array();
+ foreach ($this->arPayment as $p) { $arPaymentSelect[$p['id']] = $p['name']; }
+
?>
<?php echo wpsg_drawForm_Input('wpsg_mod_abo_url', __('Standard URL für Ablauf/Verlängerung', 'wpsg'), $this->get_option('wpsg_mod_abo_url'), array ('help' => 'wpsg_mod_abo_url')); ?>
<br />
<?php echo wpsg_drawForm_Checkbox('wpsg_mod_abo_wpsgmodabofirstbuy', __('Mail bei erstem Kauf eines Abos', 'wpsg'), $this->get_option('wpsg_mod_abo_wpsgmodabofirstbuy'), array('hint' => wpsg_translate(__('nohspc_Mail wird bei Bezahlung der Abo Bestellung zusätzlich versendet. (mail_firstbuy.phtml) -> <a href="#1#">Konfiguration</a>', 'wpsg'), WPSG_URL_WP.'wp-admin/admin.php?page=wpsg-Admin&subaction=emailconf#wpsgmodabofirstbuy'), 'help' => 'wpsg_mod_abo_wpsgmodabofirstbuy',)); ?>
-<?php echo wpsg_drawForm_Checkbox('wpsg_mod_abo_wpsgmodaboexpiration', __('Mail bei Auslauf eines Abos', 'wpsg'), $this->get_option('wpsg_mod_abo_wpsgmodaboexpiration'), array('hint' => wpsg_translate(__('nohspc_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_Checkbox('wpsg_mod_abo_wpsgmodabrebuy', __('Mail bei Kauf einer Verlängerung', 'wpsg'), $this->get_option('wpsg_mod_abo_wpsgmodabrebuy'), array('hint' => wpsg_translate(__('nohspc_Mail wird bei Bezahlung einer Abo Verlängerung versendet. (mail_rebuy.phtml) -> <a href="#1#">Konfiguration</a>', 'wpsg'), WPSG_URL_WP.'wp-admin/admin.php?page=wpsg-Admin&subaction=emailconf#wpsgmodabrebuy'), 'help' => 'wpsg_mod_abo_wpsgmodabrebuy',)); ?>
\ No newline at end of file +<?php echo wpsg_drawForm_Checkbox('wpsg_mod_abo_wpsgmodabrebuy', __('Mail bei Kauf einer Verlängerung', 'wpsg'), $this->get_option('wpsg_mod_abo_wpsgmodabrebuy'), array('hint' => wpsg_translate(__('nohspc_Mail wird bei Bezahlung einer Abo Verlängerung versendet. (mail_rebuy.phtml) -> <a href="#1#">Konfiguration</a>', 'wpsg'), WPSG_URL_WP.'wp-admin/admin.php?page=wpsg-Admin&subaction=emailconf#wpsgmodabrebuy'), 'help' => 'wpsg_mod_abo_wpsgmodabrebuy',)); ?>
+
+<br />
+
+<?php echo wpsg_drawForm_Select('wpsg_mod_abo_expiremode', __('Nach Ablauf des Abos', 'wpsg'), Array(
+ wpsg_mod_abo::EXPIRE_MAIL => _('Mail versenden', 'wpsg'),
+ wpsg_mod_abo::EXPIRE_AUTO => _('Automatisch verlängern', 'wpsg')
+), $this->get_option('wpsg_mod_abo_expiremode'), array('help' => 'wpsg_mod_abo_expiremode')); ?>
+
+<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'); ?>;">
+
+ <?php echo wpsg_drawForm_Checkbox('wpsg_mod_abo_wpsgmodaboexpiration', __('Mail bei Auslauf eines Abos', 'wpsg'), $this->get_option('wpsg_mod_abo_wpsgmodaboexpiration'), array('hint' => wpsg_translate(__('nohspc_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_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 echo wpsg_drawForm_Select('wpsg_mod_abo_autoexpire_payment', __('Zahlungsart für automatische Verlängerung'), $arPaymentSelect, $this->get_option('wpsg_mod_abo_autoexpire_payment'), array()); ?>
+ <?php echo wpsg_drawForm_Checkbox('wpsg_mod_abo_autoexpire_customermail', __('Mail an Kunden'), $this->get_option('wpsg_mod_abo_autoexpire_customermail')); ?>
+ <?php echo wpsg_drawForm_Checkbox('wpsg_mod_abo_autoexpire_adminmail', __('Mail an Administrator'), $this->get_option('wpsg_mod_abo_autoexpire_adminmail')); ?>
+ <?php echo wpsg_drawForm_Select('wpsg_mod_abo_autoexpire_customer', __('Kunde kann im Frontend'), 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()); ?>
+
+</div>
+
+<script type="text/javascript">/* <![CDATA[ */
+
+ jQuery(document).ready(function() {
+
+ jQuery('#wpsg_mod_abo_expiremode').on('change', function() {
+
+ jQuery('.wpsg_mod_expiremode').hide();
+ jQuery('.wpsg_mod_expiremode_' + jQuery(this).val()).show();
+
+ } );
+
+ } );
+
+/* ]]> */</script>
diff --git a/views/order/index.phtml b/views/order/index.phtml index 223f688..7c8f463 100644 --- a/views/order/index.phtml +++ b/views/order/index.phtml @@ -171,20 +171,34 @@ <?php } ?>
<?php if ($this->hasMod('wpsg_mod_abo')) { ?>
- <?php if ($this->callMod('wpsg_mod_abo', 'isAboOrder', array($oOrder->id)) === 1) { ?>
- <?php echo $this->callMod('wpsg_mod_abo', 'getOrderAboExpiration', array($oOrder->id)) ?>
- <?php } else if ($this->callMod('wpsg_mod_abo', 'isAboOrder', array($oOrder->id)) === 2) { ?>
+
+ <?php if (in_array(strval($this->callMod('wpsg_mod_abo', 'isAboOrder', array($oOrder->id))), array(1))) { ?>
+
+ <?php $abo_expiration = strtotime($this->callMod('wpsg_mod_abo', 'getOrderAboExpiration', array($oOrder->id))); ?>
+
+ <?php echo __('Abo:', 'wpsg'); ?>
+
+ <?php if ($abo_expiration > time()) { ?>
+ <span class="wpsg_mod_abo_future_expire"><?php echo wpsg_formatTimestamp($abo_expiration); ?></span>
+ <?php } else { ?>
+ <span class="wpsg_mod_abo_expired"><?php echo wpsg_formatTimestamp($abo_expiration); ?></span>
+ <?php } ?>
+
+ <?php } ?>
+
+ <?php if ($this->callMod('wpsg_mod_abo', 'isAboOrder', array($oOrder->id)) === 2) { ?>
+
<?php
$origin_order_id = $this->callMod('wpsg_mod_abo', 'getOriginOrder', array($oOrder->id));
$origin_order_data = $this->cache->loadOrder($origin_order_id);
?>
- <?php echo $this->callMod('wpsg_mod_abo', 'getOrderAboExpiration', array($origin_order_data['id'])) ?><br />
<?php echo wpsg_translate(__('Verlängerung zu Bestellung <a href="#1#">#2#</a>', 'wpsg'), WPSG_URL_WP.'wp-admin/admin.php?page=wpsg-Order&action=view&edit_id='.$origin_order_id, $origin_order_data['onr']); ?>
+
<?php } ?>
- </td>
- <?php } ?>
+
+ <?php } ?>
</td>
<td class="col_customer">
|
