diff options
| author | Daniel Schmitzer <noreply@maennchen1.de> | 2020-11-23 08:25:58 +0000 |
|---|---|---|
| committer | Daniel Schmitzer <noreply@maennchen1.de> | 2020-11-23 08:25:58 +0000 |
| commit | 4ff7abd50d825caef5acc1a7eaa7966eac112764 (patch) | |
| tree | 528bb99386340ab0b0df001f510889fe0d55e11e /views/order | |
| parent | 5a45aad049c6ba0327a22fd1b2a780405de385a1 (diff) | |
- K
git-svn-id: https://[internal]/wordpress/plugins/wpsg4@7812 0d5edaf7-2b12-4e95-93f4-047927463d4b
Diffstat (limited to 'views/order')
| -rw-r--r-- | views/order/index.phtml | 43 | ||||
| -rw-r--r-- | views/order/view_orderlog.phtml | 14 |
2 files changed, 39 insertions, 18 deletions
diff --git a/views/order/index.phtml b/views/order/index.phtml index ee56a66..afd03b7 100644 --- a/views/order/index.phtml +++ b/views/order/index.phtml @@ -350,7 +350,18 @@ <?php $oOrderProducts = $oOrder->getOrderProducts(); ?>
- <?php foreach ($oOrderProducts as $oOrderProduct) { $product_id = $oOrderProduct->getProductId(); ?>
+ <?php foreach ($oOrderProducts as $oOrderProduct) {
+
+ $product_id = $oOrderProduct->getProductId();
+ $oAbo = null;
+
+ if ($this->hasMod('wpsg_mod_abo')) {
+
+ try { $oAbo = wpsg_abo::getFromOrderAndOrderProduct($oOrder->getId(), $oOrderProduct->getId()); } catch (\Exception $e) { }
+
+ }
+
+ ?>
<?php echo wpsg_translate(__('#1# x <a href="#2#">#3#</a> für je #4#', 'wpsg'),
$oOrderProduct->getCount(),
@@ -359,23 +370,21 @@ wpsg_ff($oOrderProduct->getOneAmount(), $this->get_option('wpsg_currency'))
); ?><br />
- <?php if ($this->hasMod('wpsg_mod_abo')) { ?>
-
- <?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, $oOrderProduct->getProductKey()))); ?>
-
- <?php echo __('Abo Laufzeit:', '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 if ($oAbo !== null) { ?>
+
+ <?php
+
+ $state = $oAbo->getState();
+
+ echo __('Abo Laufzeit:', 'wpsg');
+
+ ?>
- <br />
-
- <?php } ?>
+ <?php if ($state === wpsg_abo::STATE_INEXTENSION) { ?><span style="color:orange;"><?php echo $oAbo->getStateLabel(); ?></span>
+ <?php } else if ($state === wpsg_abo::STATE_RUNNING) { ?><span style="color:green;"><?php echo $oAbo->getStateLabel(); ?></span>
+ <?php } else if ($state === wpsg_abo::STATE_EXTEND) { ?><span style="color:red;"><?php echo $oAbo->getStateLabel(); ?></span><?php } ?>
+
+ <br />
<?php } ?>
diff --git a/views/order/view_orderlog.phtml b/views/order/view_orderlog.phtml index 035fed7..b1272d5 100644 --- a/views/order/view_orderlog.phtml +++ b/views/order/view_orderlog.phtml @@ -14,7 +14,19 @@ <div class="panel panel-default">
<div class="panel-heading" data-toggle="collapse" href="#collapse<?php echo $k; ?>" style="cursor:pointer;">
<h4 class="panel-title" style="float:right;"><?php echo wpsg_formatTimestamp($ol['cdate']); ?></h4>
- <h4 class="panel-title"><?php echo $ol['title']; ?></h4>
+ <h4 class="panel-title"><?php
+
+ if (preg_match('/OrderID:\040(\d+)?/', $ol['mailtext'], $m)) {
+
+ $oAboExtendOrder = wpsg_order::getInstance(intval($m[1]));
+
+ $title = '<a href="'.wpsg_admin_url('Order', 'view', ['edit_id' => $oAboExtendOrder->getId()]).'">Bestellung '.$oAboExtendOrder->getNr().' / '.$oAboExtendOrder->getStateLabel().'</a>';
+
+ } else $title = $ol['title'];
+
+ echo $title;
+
+ ?></h4>
</div>
<div id="collapse<?php echo $k; ?>" class="panel-collapse collapse">
<div class="panel-body">
|
