summaryrefslogtreecommitdiff
path: root/views/mods
diff options
context:
space:
mode:
authorDaniel Schmitzer <noreply@maennchen1.de>2020-11-16 10:45:53 +0000
committerDaniel Schmitzer <noreply@maennchen1.de>2020-11-16 10:45:53 +0000
commit6cfdc4f806651c18ab97a742eae41eca11cfa176 (patch)
tree55b6823973d656d7afde49281510f144b5566f74 /views/mods
parent7e630a709f5ff9fecb09eaa6a704a537976efb31 (diff)
- Abo Punkt "Aboverwaltung: neue Spalte "Status" (laufend, in Verlängerung, abgelaufen) -> bei Ablauf auto. Statuswechsel auf "abgelaufen""
git-svn-id: https://[internal]/wordpress/plugins/wpsg4@7807 0d5edaf7-2b12-4e95-93f4-047927463d4b
Diffstat (limited to 'views/mods')
-rw-r--r--views/mods/mod_abo/index.phtml63
-rw-r--r--views/mods/mod_abo/order_view.phtml25
2 files changed, 57 insertions, 31 deletions
diff --git a/views/mods/mod_abo/index.phtml b/views/mods/mod_abo/index.phtml
index ec73c52..aaf9cb3 100644
--- a/views/mods/mod_abo/index.phtml
+++ b/views/mods/mod_abo/index.phtml
@@ -36,7 +36,13 @@
<?php echo wpsg_drawForm_Input('filter[s]', __('Suchfeld', 'wpsg'), wpsg_getStr($this->view['arFilter']['s'])); ?>
<?php echo wpsg_drawForm_Input('filter[k_id]', __('Kunde (ID)', 'wpsg'), wpsg_getStr($this->view['arFilter']['k_id'])); ?>
- <?php echo wpsg_drawForm_Select('filter[status]', __('Abostatus', 'wpsg'), wpsg_array_merge(array('-1' => __('Alle', 'wpsg')), $this->arStatus), @$this->view['arFilter']['status']); ?>
+
+ <?php
+
+ $arStateSelect = [];
+ foreach ($this->view['arState'] as $state_key => $state_data) $arStateSelect[$state_key] = $state_data['label'];
+
+ echo wpsg_drawForm_Select('filter[status]', __('Abostatus', 'wpsg'), wpsg_array_merge(array('-1' => __('Alle', 'wpsg')), $arStateSelect), @$this->view['arFilter']['state']); ?>
<?php echo wpsg_drawForm_TextStart(); ?>
<div class="row">
@@ -96,8 +102,8 @@
<div class="pagination_wrap wpsg_status_link_wrap">
<ul class="pagination">
- <?php foreach ($this->view['arStatus'] as $status_key => $status_info) { ?>
- <li class="<?php echo ((wpsg_getStr($this->view['arFilter']['status']) == $status_key)?'active':''); ?>"><a href="#" onclick="return wpsg_setFilterStatus('<?php echo $status_key; ?>');"><?php echo wpsg_translate(__('#1# <span>(#2#)<span>', 'wpsg'), $status_info['label'], $status_info['count']); ?></a></li>
+ <?php foreach ($this->view['arState'] as $status_key => $status_info) { ?>
+ <li class="<?php echo ((wpsg_getStr($this->view['arFilter']['state']) == $status_key)?'active':''); ?>"><a href="#" onclick="return wpsg_setFilterStatus('<?php echo $status_key; ?>');"><?php echo wpsg_translate(__('#1# <span>(#2#)<span>', 'wpsg'), $status_info['label'], $status_info['count']); ?></a></li>
<?php } ?>
</ul>
@@ -122,64 +128,55 @@
<th class="col_shipping wpsg_order" data-order="shipping"><?php echo __('Versandart', 'wpsg'); ?></th>
<th class="col_products wpsg_order" data-order="products"><?php echo __('Abonnement', 'wpsg'); ?></th>
<th class="col_sum wpsg_order" data-order="amount"><?php echo __('Bestellwert', 'wpsg'); ?></th>
- <th class="col_state wpsg_order" data-order="time"><?php echo __('Laufzeit', 'wpsg'); ?></th>
+ <th class="col_time wpsg_order" data-order="time"><?php echo __('Laufzeit', 'wpsg'); ?></th>
+ <th class="col_state wpsg_order" data-order="time"><?php echo __('Status', 'wpsg'); ?></th>
</tr>
</thead>
<tbody>
- <?php foreach ($this->view['arData'] as $oOrder) { ?>
+ <?php foreach ($this->view['arData'] as $oAbo) { $oOrder = $oAbo->getOrder(); ?>
<tr>
<td class="col_checkbox">
- <input class="col_set_checkbox" name="wpsg_multido[<?php echo $oOrder->id; ?>]" type="checkbox" />
+ <input class="col_set_checkbox" name="wpsg_multido[<?php echo $oAbo->id; ?>]" type="checkbox" />
</td>
<td class="col_nr">
- <?php echo $oOrder->getNr(); ?> <span class="wpsg_grey"><?php echo wpsg_formatTimestamp(strtotime($oOrder->cdate), false); ?></span><br />
+ <?php echo $oAbo->getNr(); ?> <span class="wpsg_grey"><?php echo wpsg_formatTimestamp(strtotime($oAbo->__get('cdate')), false); ?></span><br />
<div class="actions">
+
<span class="view"><a title="<?php echo __("Dieses Abonnement ansehen", "wpsg"); ?>" href="<?php
echo wpsg_admin_url('Order', 'view', ['edit_id' => $oOrder->id]);
?>"><?php echo __("Ansehen", "wpsg"); ?></a></span>
|
- <?php if ($this->view['arFilter']['status'] != wpsg_ShopController::STATUS_GEKUENDIGTEABOS) { ?>
- <?php /*<span class="storno"><a onclick="return confirm('<?php echo __('Sind Sie sich sicher, dass Sie dieses Abonnement kündigen möchten?', 'wpsg'); ?>');" title="<?php echo __("Dieses Abonnement kündigen", "wpsg"); ?>" href="<?php
-
- echo wpsg_admin_url('Order', 'resign', ['edit_id' => $oOrder->id], ['noheader' => '1']);
-
- ?>"><?php echo __("Kündigen", "wpsg"); ?></a></span>
- | */ ?>
- <?php } ?>
<span class="delete"><a onclick="return confirm('<?php echo __('Sind Sie sich sicher, dass Sie dieses Abonnement löschen möchten?', 'wpsg'); ?>');" title="<?php echo __('Dieses Abonnement löschen', 'wpsg'); ?>" href="<?php
echo wpsg_admin_url('Order', 'delete', ['edit_id' => $oOrder->id], ['abo' => '1', 'noheader' => '1']);
?>"><?php echo __('Löschen', 'wpsg'); ?></a></span>
+
</div>
- <?php if (trim($oOrder->admincomment) != "") { ?>
- <a title="<?php echo __("Kommentar (Admin): ", "wpsg").htmlspecialchars($oOrder->admincomment); ?>" onclick="return false;" class="glyphicon glyphicon-question-sign admincomment" href="#"></a>
+ <?php if (trim($oAbo->getOrder()->admincomment) != "") { ?>
+ <a title="<?php echo __("Kommentar (Admin): ", "wpsg").htmlspecialchars($oAbo->getOrder()->admincomment); ?>" onclick="return false;" class="glyphicon glyphicon-question-sign admincomment" href="#"></a>
<?php } ?>
- <?php if (trim($oOrder->comment) != "") { ?>
- <a title="<?php echo __("Kommentar (Kunde): ", "wpsg").htmlspecialchars($oOrder->comment); ?>" onclick="return false;" class="glyphicon glyphicon-question-sign customercomment" href="#"></a>
- <?php } ?>
-
- <?php if ($oOrder->hasShippingAdress()) { ?>
- <a title="<?php echo __("Lieferadresse beachten", "wpsg"); ?>" onclick="return false;" class="glyphicon glyphicon-map-marker shippingadress" href="#"></a>
- <?php } ?>
+ <?php if (trim($oAbo->getOrder()->comment) != "") { ?>
+ <a title="<?php echo __("Kommentar (Kunde): ", "wpsg").htmlspecialchars($oAbo->getOrder()->comment); ?>" onclick="return false;" class="glyphicon glyphicon-question-sign customercomment" href="#"></a>
+ <?php } ?>
</td>
<td class="col_customer">
- <?php $firma = $oOrder->getInvoiceCompany(); if (wpsg_isSizedString($firma)) { ?>
+ <?php $firma = $oAbo->getOrder()->getInvoiceCompany(); if (wpsg_isSizedString($firma)) { ?>
<?php echo $firma; ?><br />
<?php } ?>
- <?php echo $oOrder->getInvoiceTitle(); ?> <?php echo $oOrder->getInvoiceFirstname(); ?> <?php echo $oOrder->getInvoiceName(); ?>
+ <?php echo $oAbo->getOrder()->getInvoiceTitle(); ?> <?php echo $oOrder->getInvoiceFirstname(); ?> <?php echo $oAbo->getOrder()->getInvoiceName(); ?>
<br />
- <span class="wpsg_grey"><?php echo $oOrder->getInvoiceStreet(); ?><br />
- <?php echo ltrim($oOrder->getInvoiceZip().' '.$oOrder->getInvoiceCity()); ?> <?php echo $oOrder->getInvoiceCountryKuerzel(); ?>
+ <span class="wpsg_grey"><?php echo $oAbo->getOrder()->getInvoiceStreet(); ?><br />
+ <?php echo ltrim($oAbo->getOrder()->getInvoiceZip().' '.$oAbo->getOrder()->getInvoiceCity()); ?> <?php echo $oAbo->getOrder()->getInvoiceCountryKuerzel(); ?>
</span>
</td>
<td class="col_payment">
@@ -255,6 +252,16 @@
<?php } ?>
</td>
+
+ <td class="col_state">
+
+ <?php $state = $oAbo->getState(); ?>
+
+ <?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 } ?>
+
+ </td>
</tr>
diff --git a/views/mods/mod_abo/order_view.phtml b/views/mods/mod_abo/order_view.phtml
index 8ae6340..52ea434 100644
--- a/views/mods/mod_abo/order_view.phtml
+++ b/views/mods/mod_abo/order_view.phtml
@@ -8,12 +8,16 @@
?>
-<?php foreach ($this->view['arOrderedAboProducts'] as $oOrderProduct) { ?>
+<?php foreach ($this->view['arOrderedAboProducts'] as $oOrderProduct) {
+
+ $oAbo = wpsg_abo::getFromOrderAndProduct($view['oOrder']->getId(), $oOrderProduct->getId());
+
+ ?>
<?php echo wpsg_drawForm_AdminboxStart($oOrderProduct->getProduct()->getProductName()); ?>
<?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' => (($tExpire > time())?'wpsg_mod_abo_future_expire':'wpsg_mod_abo_expired'))); ?>
+ <?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())); ?>
<script>
@@ -21,6 +25,11 @@
jQuery('#wpsg_mod_abo_duration').editable({
type: 'combodate',
+ display: function(value) {
+
+ jQuery(this).html(value.format('DD.MM.YYYY HH:mm:ss'));
+
+ },
success: function(response, newValue) {
jQuery.ajax({
@@ -32,7 +41,9 @@
date: newValue.format()
},
success: function(response) {
-
+
+ jQuery('.wpsg_abo_state').attr("class", "col-sm-6 wpsg_abo_state_class_" + response.state)
+
}
})
@@ -50,6 +61,14 @@
</script>
<?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 = '<a href="'.$strURL.'">'.$strURL.'</a>';
+
+ echo wpsg_drawForm_Text(__('URL für den Kauf einer Verlängerung', 'wpsg'), $strURL);
+
+ ?>
<?php echo wpsg_drawForm_TextStart(); ?>