summaryrefslogtreecommitdiff
path: root/views
diff options
context:
space:
mode:
Diffstat (limited to 'views')
-rw-r--r--views/mods/mod_abo/index.phtml2
-rw-r--r--views/mods/mod_abo/order_view.phtml18
-rw-r--r--views/mods/mod_abo/page_abo.phtml2
-rw-r--r--views/order/index.phtml43
-rw-r--r--views/order/view_orderlog.phtml14
5 files changed, 50 insertions, 29 deletions
diff --git a/views/mods/mod_abo/index.phtml b/views/mods/mod_abo/index.phtml
index d188f46..7a4ea06 100644
--- a/views/mods/mod_abo/index.phtml
+++ b/views/mods/mod_abo/index.phtml
@@ -250,7 +250,7 @@
<?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 $abo_expiration = strtotime($this->callMod('wpsg_mod_abo', 'getOrderAboExpiration', array($oOrder->id, $oOrderProduct->getId()))); ?>
<?php if ($abo_expiration > time()) { ?>
diff --git a/views/mods/mod_abo/order_view.phtml b/views/mods/mod_abo/order_view.phtml
index 0dca512..c329a0b 100644
--- a/views/mods/mod_abo/order_view.phtml
+++ b/views/mods/mod_abo/order_view.phtml
@@ -12,7 +12,7 @@
try {
- $oAbo = wpsg_abo::getFromOrderAndProduct($view['oOrder']->getId(), $oOrderProduct->getId());
+ $oAbo = wpsg_abo::getFromOrderAndOrderProduct($view['oOrder']->getId(), $oOrderProduct->getId());
?>
@@ -22,14 +22,14 @@
'</a>'
); ?>
- <?php $tExpire = strtotime($this->callMod('wpsg_mod_abo', 'getOrderAboExpiration', Array($_REQUEST['edit_id'], $oOrderProduct->getProductKey()))); ?>
- <?php echo wpsg_drawForm_Text(__('Laufzeit', 'wpsg'), wpsg_formatTimestamp($tExpire), 'wpsg_mod_abo_duration', Array('class_content_wrap' => 'wpsg_abo_state wpsg_abo_state_class_'.$oAbo->getState())); ?>
+ <?php $tExpire = strtotime($this->callMod('wpsg_mod_abo', 'getOrderAboExpiration', Array($_REQUEST['edit_id'], $oOrderProduct->getId()))); ?>
+ <?php echo wpsg_drawForm_Text(__('Laufzeit', 'wpsg'), wpsg_formatTimestamp($tExpire), 'wpsg_mod_abo_duration_'.$oOrderProduct->getProductIndex(), Array('class_content_wrap' => 'wpsg_abo_state wpsg_abo_state_class_'.$oAbo->getState())); ?>
<script>
moment.locale('de');
- jQuery('#wpsg_mod_abo_duration').editable({
+ jQuery('#wpsg_mod_abo_duration_<?php echo $oOrderProduct->getProductIndex(); ?>').editable({
type: 'combodate',
display: function(value) {
@@ -42,13 +42,13 @@
url: '<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Admin&action=module&modul=wpsg_mod_abo&subaction=admin_inlineEdit&noheader=1',
data: {
field: 'duration',
- product_key: '<?php echo $oOrderProduct->getProductKey(); ?>',
+ order_product_id: '<?php echo $oOrderProduct->getId(); ?>',
order_id: '<?php echo $view['oOrder']->getId() ?>',
date: newValue.format()
},
success: function(response) {
-
- jQuery('.wpsg_abo_state').attr("class", "col-sm-6 wpsg_abo_state_class_" + response.state)
+
+ jQuery('#wpsg_mod_abo_duration_<?php echo $oOrderProduct->getProductIndex(); ?>').parent().parent().attr("class", "col-sm-6 wpsg_abo_state_class_" + response.state)
}
})
@@ -69,7 +69,7 @@
<?php echo wpsg_drawForm_Text(wpsg_translate(__('Preis (#1# Tage):', 'wpsg'), $oOrderProduct->getProduct()->wpsg_mod_abo_durration), wpsg_ff($oOrderProduct->getProduct()->wpsg_mod_abo_price, $this->get_option('wpsg_currency'))); ?>
<?php
- $strURL = $this->callMod('wpsg_mod_abo', 'getRebuyLink', [$view['oOrder']->getId(), $oOrderProduct->getProductKey()]);
+ $strURL = $this->callMod('wpsg_mod_abo', 'getRebuyLink', [$view['oOrder']->getId(), $oOrderProduct->getId()]);
$strURL = '<a href="'.$strURL.'">'.$strURL.'</a>';
echo wpsg_drawForm_Text(__('URL für den Kauf einer Verlängerung', 'wpsg'), $strURL);
@@ -78,7 +78,7 @@
<?php echo wpsg_drawForm_TextStart(); ?>
- <?php $abo_product_status = $this->callMod('wpsg_mod_abo', 'getAboProductStatus', Array($_REQUEST['edit_id'], $oOrderProduct->getProductKey())); ?>
+ <?php $abo_product_status = $this->callMod('wpsg_mod_abo', 'getAboProductStatus', Array($_REQUEST['edit_id'], $oOrderProduct->getId())); ?>
<?php if ($abo_product_status['status'] === wpsg_mod_abo::STATUS_ACTIVE) { ?>
diff --git a/views/mods/mod_abo/page_abo.phtml b/views/mods/mod_abo/page_abo.phtml
index a562ef9..32ba7ba 100644
--- a/views/mods/mod_abo/page_abo.phtml
+++ b/views/mods/mod_abo/page_abo.phtml
@@ -64,7 +64,7 @@
<span class="label"><?php echo __('Laufzeit (Endzeitpunkt):', 'wpsg'); ?></span>
<span class="value">
- <?php $exp = $this->callMod('wpsg_mod_abo', 'getOrderAboExpiration', array($oOrder->id, $oOrderProduct->getProductKey())); ?>
+ <?php $exp = $this->callMod('wpsg_mod_abo', 'getOrderAboExpiration', array($oOrder->id, $oOrderProduct->getId())); ?>
<?php if ($oAbo->getState() === wpsg_abo::STATE_RUNNING) { ?>
<span class="duration_running"><?php echo $exp; ?></span>
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().'&nbsp;/&nbsp;'.$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">