summaryrefslogtreecommitdiff
path: root/views
diff options
context:
space:
mode:
authorDaniel Schmitzer <noreply@maennchen1.de>2018-10-05 08:48:34 +0000
committerDaniel Schmitzer <noreply@maennchen1.de>2018-10-05 08:48:34 +0000
commit1f1c7b8f3123863dd2a667d880d68dfc08687ede (patch)
tree7ad9b2b3ea536d8c7367186d435b34a6594aec7a /views
parentd1fe4168aaa7a4f0fca3774c3fc3dac8c98d741d (diff)
- BE Verwaltung
git-svn-id: https://[internal]/wordpress/plugins/wpsg4@7179 0d5edaf7-2b12-4e95-93f4-047927463d4b
Diffstat (limited to 'views')
-rw-r--r--views/order/backendEdit/addDiscount.phtml5
-rw-r--r--views/order/backendEdit/addVoucher.phtml66
-rw-r--r--views/order/product_table.phtml111
-rw-r--r--views/order/view.phtml124
-rw-r--r--views/order/view_orderdata.phtml622
5 files changed, 446 insertions, 482 deletions
diff --git a/views/order/backendEdit/addDiscount.phtml b/views/order/backendEdit/addDiscount.phtml
index 68873e7..399b8bc 100644
--- a/views/order/backendEdit/addDiscount.phtml
+++ b/views/order/backendEdit/addDiscount.phtml
@@ -9,8 +9,6 @@
/** @var wpsg_calculation $oCalculation */
$oCalculation = $this->view['oCalculation'];
- $arTax = $oCalculation->getTaxLabelArray();
-
if ($this->getBackendTaxView() === WPSG_NETTO) $strBN = 'NETTO';
else $strBN = 'BRUTTO';
@@ -21,8 +19,7 @@
<form id="wpsg_be_discount_form">
<?php echo wpsg_drawForm_Input('be_discount_amount', wpsg_translate(__('Rabattwert in #1# (#2#) oder % ', 'wpsg'), $this->get_option('wpsg_currency'), $strBN), @$arCalculation['discount'][0]['set']); ?>
- <?php echo wpsg_drawForm_Select('be_discount_tax', __('Steuersatz', 'wpsg'), $arTax, @$arCalculation['discount'][0]['tax_key']); ?>
-
+
</form>
<script>
diff --git a/views/order/backendEdit/addVoucher.phtml b/views/order/backendEdit/addVoucher.phtml
new file mode 100644
index 0000000..7b90086
--- /dev/null
+++ b/views/order/backendEdit/addVoucher.phtml
@@ -0,0 +1,66 @@
+<?php
+
+ /**
+ * User: Daschmi (daschmi@daschmi.de)
+ * Date: 05.10.2018
+ * Time: 08:24
+ */
+
+ namespace wpsg;
+
+ /** @var wpsg_calculation $oCalculation */
+ $oCalculation = $this->view['oCalculation'];
+
+ if ($this->getBackendTaxView() === WPSG_NETTO) $strBN = 'NETTO';
+ else $strBN = 'BRUTTO';
+
+ $arCalculation = $oCalculation->getCalculationArray();
+
+ $strVal = ((isset($arCalculation['voucher'][0]['set']))?$arCalculation['voucher'][0]['set']:0);
+
+ if (strpos($strVal, '%') !== false) $strVal = wpsg_ff(wpsg_tf($strVal), '%');
+ else $strVal = wpsg_ff(wpsg_tf($strVal), $this->get_option('wpsg_currency'));
+
+?>
+
+<form id="wpsg_be_voucher_form">
+
+ <div class="autocomplete_wrap">
+ <?php echo wpsg_drawForm_Input('be_voucher_search', __('Gutscheinsuche', 'wpsg'), ''); ?>
+ </div>
+
+ <br />
+
+ <?php echo wpsg_drawForm_Input('be_voucher_code', __('Code (Optional)', 'wpsg'), @$arCalculation['voucher'][0]['code']); ?>
+ <?php echo wpsg_drawForm_Input('be_voucher_id', __('Guschein ID (Optional)', 'wpsg'), @$arCalculation['voucher'][0]['id']); ?>
+ <?php echo wpsg_drawForm_Input('be_voucher_amount', wpsg_translate(__('Gutscheinwert in #1# (#2#) oder % ', 'wpsg'), $this->get_option('wpsg_currency'), $strBN), $strVal); ?>
+
+</form>
+
+<script>
+
+ jQuery('#wpsg_be_voucher_form').on('submit', function() { return false; } );
+ jQuery('#be_voucher_search').focus();
+
+ jQuery(document).ready(function() {
+
+ jQuery('#be_voucher_search').autocomplete( {
+ source: '<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Order&action=view&subaction=editVoucher&do=search&noheader=1&edit_id=<?php echo $_REQUEST['edit_id']; ?>',
+ minLength: 2,
+ appendTo: ".autocomplete_wrap",
+ select: function(event, ui) {
+
+ jQuery('#be_voucher_code').val(ui.item.code);
+ jQuery('#be_voucher_id').val(ui.item.id);
+ jQuery('#be_voucher_amount').val(ui.item.gs_value);
+
+ jQuery('#be_voucher_search').val('');
+
+ return false;
+
+ }
+ } );
+
+ } );
+
+</script>
diff --git a/views/order/product_table.phtml b/views/order/product_table.phtml
index a6732f4..e30270d 100644
--- a/views/order/product_table.phtml
+++ b/views/order/product_table.phtml
@@ -1,19 +1,5 @@
<?php
-
-/*
- $oC = new \wpsg\wpsg_calculation();
- $oC->setCountry(\wpsg_country::getInstance(1));
-
- $oC->addProduct('1', 0, '100', '1','c');
- //$oC->addProduct('1', 1, '100', '1','b');
- $oC->setShipping('1', '0', '0');
- $oC->setPayment('1', '0', 'c_1');
-
- $oC->addDiscount('10%','c_1');
-
- $ar = $oC->getCalculationArray();
-wpsg_debug($ar);*/
-
+
/**
* Template für die Produkttabelle im Backend der Bestellverwaltung
*/
@@ -21,7 +7,7 @@ wpsg_debug($ar);*/
$arCalculation = $this->view['oCalculation']->getCalculationArray($this->getBackendTaxView());
$arTax = $this->view['oCalculation']->getTaxLabelArray();
$arTaxShort = $this->view['oCalculation']->getTaxLabelArray(true);
-
+
$this->view['colspan'] = 3;
if ($this->get_option('wpsg_showMwstAlways') == '1' || sizeof($arCalculation['tax']) > 1) $this->view['colspan'] ++;
@@ -32,6 +18,7 @@ wpsg_debug($ar);*/
<style>
.wpsg_row_small td { font-size:0.8em; }
+ #wpsg-bs .wpsg_row_small .wpsg-glyphlink-td > span { margin-top:0px; }
</style>
@@ -77,37 +64,49 @@ wpsg_debug($ar);*/
<?php $this->callMods('order_view_row', array(&$p, $i)); ?>
<tr><td colspan="<?php echo $this->view['colspan'] + 1; ?>" style="line-height:2px; height:2px; background-color:#999999; padding:0px;"></td></tr>
<?php } ?>
- <?php /* $gs_id = 0;
- if ((isset($this->view['basket']['gs'])) && ($this->view['basket']['gs']['value'] > 0)) { ?>
- <tr class="wpsg_<?php echo (($i % 2 == 0)?'odd':'even'); ?> wpsg_gutschein">
- <?php
- $gs_id = 0;
- if (array_key_exists('gs_id', $_REQUEST))
- {
- $gs_id = wpsg_getInt($_REQUEST['gs_id']);
- }
- else
- {
- $gs_id = wpsg_getInt($this->view['data']['gs_id']);
- }
- $o_id = $_REQUEST['edit_id'];
- $link1 = '<span id="gsname_'.$gs_id.'" class="editable editable-click" data-original-title="" title="">'.$this->view['basket']['gs']['code'].'</span>';
- $val = '-'.wpsg_ff($this->view['basket']['sum']['gs']);
- $link2 = '<span id="gsvalue_'.$gs_id.'" class="editable editable-click" data-original-title="" title="">'.$val.'</span>';
+
+ <?php /* Gutscheine */ ?>
+ <?php if (wpsg_isSizedArray($arCalculation['voucher'])) { ?>
- ?>
- <td class="wpsg_cell_name"><?php echo __('Gutschein', 'wpsg'); ?> <?php echo ($this->view['basket']['gs']['code'] != '')? '('.$link1.')':'' ?>
- <a href="#" class="wpsg-glyphlink-td" title="<?php echo __('Gutschein löschen', 'wpsg'); ?>" onclick="return wpsg_removeVoucher(<?php echo $gs_id; ?>, <?php echo $o_id; ?>);"><span class="glyphicon glyphicon-trash"></span></a>
- </td>
- <td class="wpsg_cell_preis"><?php echo $link2.' '.$this->get_option('wpsg_currency'); ?></td>
- <?php if (sizeof($this->view['basket']['mwst']) > 1 || $this->get_option('wpsg_showMwstAlways') == '1') { ?>
- <td class="wpsg_cell_mwst"><?php echo __('anteilig', 'wpsg'); ?></td>
- <?php } ?>
- <td class="wpsg_cell_menge">1</td>
- <td class="wpsg_cell_gesamtpreis"><?php echo '-'.wpsg_ff($this->view['basket']['sum']['gs'], $this->get_option('wpsg_currency')); ?></td>
- </tr>
- <?php } ?>
- */ ?>
+ <?php foreach ($arCalculation['voucher'] as $v) { ?>
+
+ <tr class="wpsg_row_discount wpsg_row_small">
+ <td colspan="" class="wpsg_cell_mwst_label">
+
+ <div>
+ <?php echo __('Gutschein', 'wpsg'); ?>
+
+ <?php if ($this->getBackendTaxView() === WPSG_BRUTTO) { ?>
+ <?php echo __('(inkl. MwSt.)', 'wpsg'); ?>
+ <?php } else { ?>
+ <?php echo __('(zzgl. MwSt.)', 'wpsg'); ?>
+ <?php } ?>
+
+ <a href="#" class="wpsg-glyphlink-td" title="<?php echo __('Gutschein bearbeiten', 'wpsg'); ?>" onclick="return WPSG_BE_Voucher.editVoucher();"><span class="glyphicon glyphicon-pencil"></span></a>
+ <a href="#" class="wpsg-glyphlink-td" title="<?php echo __('Gutschein löschen', 'wpsg'); ?>" onclick="return WPSG_BE_Voucher.removeVoucher();"><span class="glyphicon glyphicon-trash"></span></a>
+ </div>
+ <div>
+ Code: <?php echo $v['code']; ?>
+ </div>
+
+ </td>
+ <td class="wpsg_cell_preis">
+ <?php echo wpsg_ff($v['set'], $this->get_option('wpsg_currency'), true); ?>
+ </td>
+ <?php if (sizeof($arCalculation['tax']) > 1 || $this->get_option('wpsg_showMwstAlways') == '1') { ?>
+ <td class="wpsg_cell_mwst"><?php echo $arTaxShort[$v['tax_key']]; ?></td>
+ <?php } ?>
+ <td>1</td>
+ <td class="wpsg_cell_mwst_value wpsg_cell_gesamtpreis">
+ <?php echo wpsg_ff($arCalculation['sum']['voucher_display']); ?> <?php echo $this->get_option('wpsg_currency'); ?>
+ </td>
+ </tr>
+
+ <?php } ?>
+ <tr><td colspan="<?php echo $this->view['colspan'] + 1; ?>" style="line-height:2px; height:2px; background-color:#999999; padding:0px;"></td></tr>
+
+ <?php } ?>
+
<tr class="wpsg_row_summe">
<td colspan="<?php echo $this->view['colspan']; ?>" class="wpsg_cell_summe_label">
@@ -196,12 +195,16 @@ wpsg_debug($ar);*/
<?php foreach ($arCalculation['discount'] as $d) { ?>
<tr class="wpsg_row_discount wpsg_row_small">
<td colspan="" class="wpsg_cell_mwst_label">
- <?php echo __('Rabatt', 'wpsg'); ?>
- <?php if ($this->getBackendTaxView() === WPSG_BRUTTO) { ?>
- <?php echo __('(inkl. MwSt.)', 'wpsg'); ?>
- <?php } else { ?>
- <?php echo __('(zzgl. MwSt.)', 'wpsg'); ?>
- <?php } ?>
+ <?php echo __('Rabatt', 'wpsg'); ?>
+ <?php if ($this->getBackendTaxView() === WPSG_BRUTTO) { ?>
+ <?php echo __('(inkl. MwSt.)', 'wpsg'); ?>
+ <?php } else { ?>
+ <?php echo __('(zzgl. MwSt.)', 'wpsg'); ?>
+ <?php } ?>
+
+ <a href="#" class="wpsg-glyphlink-td" title="<?php echo __('Rabatt bearbeiten', 'wpsg'); ?>" onclick="return WPSG_BE_Discount.editDiscount();"><span class="glyphicon glyphicon-pencil"></span></a>
+ <a href="#" class="wpsg-glyphlink-td" title="<?php echo __('Rabatt löschen', 'wpsg'); ?>" onclick="return WPSG_BE_Discount.removeDiscount();"><span class="glyphicon glyphicon-trash"></span></a>
+
</td>
<td class="wpsg_cell_preis">
<?php echo wpsg_ff($d['set'], $this->get_option('wpsg_currency'), true); ?>
@@ -247,6 +250,4 @@ wpsg_debug($ar);*/
</tr>
<?php } } ?>
<?php } ?>
-</table>
-
-<?php wpsg_debug($arCalculation); ?> \ No newline at end of file
+</table> \ No newline at end of file
diff --git a/views/order/view.phtml b/views/order/view.phtml
index 3a3c6d0..8248b86 100644
--- a/views/order/view.phtml
+++ b/views/order/view.phtml
@@ -48,34 +48,37 @@
<?php $i = 0; foreach ($this->view['arSubAction'] as $k => $v) { $i ++; ?>
<a class="list-group-item <?php echo ((wpsg_getStr($_COOKIE['wpsg_order_view_tab'], 'general') == $k)?'active':''); ?>" wpsg-data-target="<?php echo $k; ?>" href="#"><?php echo $v['title']; ?></a>
<?php } ?>
+
</div>
- <a href="" id="LinkProduktNeu" onclick="return WPSG_BE_Product.addProduct();"><span class="glyphicon glyphicon-plus"></span>
- <?php echo __("Neues Produkt", "wpsg"); ?>
- </a><div class="wpsg_clear"></div>
-
- <?php if ($this->hasMod('wpsg_mod_gutschein')) { ?>
- <?php if (((array_key_exists('gs', $this->view['basket'])) && ($this->view['basket']['gs']['value'] == 0))) { ?>
- <a href="" id="LinkGutscheinNeu" onclick="return wpsg_addVoucher(<?php echo $_REQUEST['edit_id']; ?>);"><span class="glyphicon glyphicon-plus"></span>
- <?php echo __("Gutschein bearbeiten", "wpsg"); ?>
- </a><div class="wpsg_clear"></div>
- <?php } ?>
- <?php } ?>
-
- <div class="wpsg_clear"></div>
- <?php if ($this->hasMod('wpsg_mod_discount')) { ?>
- <a href="" id="LinkRabattNeu" onclick="return WPSG_BE_Discount.editDiscount(<?php echo $_REQUEST['edit_id']; ?>);"><span class="glyphicon glyphicon-plus"></span>
- <?php echo __("Rabatt bearbeiten", "wpsg"); ?>
+ <div class="tag_actions orderdata_action">
+
+ <a href="" id="LinkProduktNeu" onclick="return WPSG_BE_Product.addProduct();"><span class="glyphicon glyphicon-plus"></span>
+ <?php echo __("Neues Produkt", "wpsg"); ?>
</a><div class="wpsg_clear"></div>
- <?php } ?>
-
+
+ <?php if ($this->hasMod('wpsg_mod_gutschein')) { ?>
+ <a href="" id="LinkGutscheinNeu" onclick="return WPSG_BE_Voucher.editVoucher(<?php echo $_REQUEST['edit_id']; ?>);"><span class="glyphicon glyphicon-plus"></span>
+ <?php echo __("Gutschein bearbeiten", "wpsg"); ?>
+ </a><div class="wpsg_clear"></div>
+ <?php } ?>
+
+ <div class="wpsg_clear"></div>
+ <?php if ($this->hasMod('wpsg_mod_discount')) { ?>
+ <a href="" id="LinkRabattNeu" onclick="return WPSG_BE_Discount.editDiscount(<?php echo $_REQUEST['edit_id']; ?>);"><span class="glyphicon glyphicon-plus"></span>
+ <?php echo __("Rabatt bearbeiten", "wpsg"); ?>
+ </a><div class="wpsg_clear"></div>
+ <?php } ?>
- <a href="" id="LinkSendMail" onclick="return wpsg_sendMail(<?php echo $_REQUEST['edit_id']; ?>);"><span class="glyphicon glyphicon-envelope"></span>
- <?php echo __("Bestellbestätigung", "wpsg"); ?><br /><?php echo __("erneut versenden", "wpsg"); ?>
- </a><br />
+ <a href="" id="LinkSendMail" onclick="return WPSG_BE_Mail.sendCustomerMail(<?php echo $_REQUEST['edit_id']; ?>);"><span class="glyphicon glyphicon-envelope"></span>
+ <?php echo __("Bestellbestätigung", "wpsg"); ?><br /><?php echo __("erneut versenden", "wpsg"); ?>
+ </a><br />
+
+ </div>
<div id='wpsg_kv_list'>
</div>
+
</div>
<div class="wpsg_admin_content form-horizontal">
@@ -92,9 +95,8 @@
</div>
-<script type="text/javascript">/* <![CDATA[ */
-
-
+<script type="text/javascript">
+
/**
* Sendet eine eMail
*/
@@ -114,68 +116,17 @@
} // function wpsg_sendMail()
- /**
- * Fügt einen neuen Rabatt hinzu (nur wenn keiner da ist)
- */
- function wpsg_addDiscount(oid)
- {
- jQuery('#wpsg_produkte_table').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-Order&subaction=discountData&do=add&edit_id=' + oid + '&noheader=1',
- success: function(data) {
-
- jQuery('#wpsg_produkte_table').replaceWith(data);
- jQuery('#LinkRabattNeu').hide();
-
- }
- } );
-
- return false;
-
- } // function wpsg_addDiscount()
-
-
- /**
- * Fügt einen neuen Gutschein hinzu (nur wenn keiner da ist)
- */
- function wpsg_addVoucher(oid)
- {
- jQuery('#wpsg_produkte_table').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-Order&subaction=voucherData&do=add&edit_id=' + oid + '&noheader=1',
- success: function(data) {
- jQuery('#wpsg_produkte_table').replaceWith(data);
- jQuery('#LinkGutscheinNeu').hide();
- //jQuery('#wpsg_kv_list').html(data);
- //location.href = location.href;
- //jQuery('#wpsg_kv_list').html('');
- }
- } );
-
- return false;
-
- } // function wpsg_addVoucher()
-
-
-
jQuery(document).ready(function() {
- wpsg_view_orderdata_hide();
-
jQuery('#wpsg_order_view_tabs a.list-group-item').bind('click', function() {
jQuery('#wpsg_order_view_tabs a').removeClass('active');
jQuery('.wpsg_order_view_tab_content').hide();
- tab = jQuery(this).attr('wpsg-data-target');
- if (tab == 'orderdata') {
- wpsg_view_orderdata_show();
- } else {
- wpsg_view_orderdata_hide();
- }
- jQuery(this).addClass('active');
+ jQuery('.tag_actions').hide(); //ordertab_action
+ jQuery('.' + jQuery(this).attr('wpsg-data-target') + '_action').show();
+
+ jQuery(this).addClass('active');
jQuery('#tab' + jQuery(this).attr('wpsg-data-target')).show();
jQuery.cookie('wpsg_order_view_tab', jQuery(this).attr('wpsg-data-target'));
@@ -183,17 +134,18 @@
} );
- co = jQuery.cookie('wpsg_order_view_tab');
+ var co = jQuery.cookie('wpsg_order_view_tab');
+
if (co === undefined) {
+
jQuery("[wpsg-data-target='general']").trigger("click");
+
} else {
+
jQuery("[wpsg-data-target='" + co + "']").trigger("click");
+
}
- //jQuery('#wpsg_order_view_tabs a').removeClass('active');
- //jQuery('.wpsg_order_view_tab_content').hide();
- //jQuery('#tabgeneral').show();
- //jQuery("[wpsg-data-target='general']").addClass('active');
-
+
} );
-/* ]]> */</script>
+</script>
diff --git a/views/order/view_orderdata.phtml b/views/order/view_orderdata.phtml
index 74d8fba..84c6dc2 100644
--- a/views/order/view_orderdata.phtml
+++ b/views/order/view_orderdata.phtml
@@ -8,357 +8,305 @@
?>
<div id="wpsg_produkte_table">
-<?php echo wpsg_drawForm_AdminboxStart(__('Bestelldaten', 'wpsg')); ?>
- <div id="wpsg_product_table_wrap">
+
+ <?php echo wpsg_drawForm_AdminboxStart(__('Bestelldaten', 'wpsg')); ?>
+
+ <div id="wpsg_product_table_wrap">
<?php $this->render(WPSG_PATH_VIEW.'order/product_table.phtml'); ?>
</div>
-<script type="text/javascript">/* <![CDATA[ */
-
-<?php if ($this->hasMod('wpsg_mod_gutschein')) { ?>
- <?php if ((array_key_exists('gs', $this->view['basket'])) && ($this->view['basket']['gs']['value'] > 0)) { ?>
-
- jQuery('#gsname_<?php echo $gs_id; ?>').wpsg_editable('<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Order&subaction=voucherData&do=editname&noheader=1', {
- submitdata: {
- field: 'code',
- gs_id: '<?php echo $gs_id; ?>',
- edit_id: '<?php echo $o_id; ?>'
- },
- submit : '<?php echo __('Speichern', 'wpsg'); ?>',
- placeholder: '<?php echo __('Zum Bearbeiten anklicken ...', 'wpsg'); ?>',
- indicator: '<?php echo __('Speicher ...', 'wpsg'); ?>',
- tooltip: '<?php echo __('Zum Bearbeiten anklicken ...', 'wpsg'); ?>',
- callback: function(data, config) {
- jQuery('#wpsg_produkte_table').replaceWith(data);
- }
- });
-
- jQuery('#gsvalue_<?php echo $gs_id; ?>').wpsg_editable('<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Order&subaction=voucherData&do=editvalue&noheader=1', {
- submitdata: {
- field: 'value',
- gs_id: '<?php echo $gs_id; ?>',
- edit_id: '<?php echo $o_id; ?>',
- noMwSt: '<?php echo $this->view['basket']['noMwSt']; ?>',
- mwst: '<?php reset($this->view['basket']['mwst']); echo key($this->view['basket']['mwst']); ?>',
- price_frontend: '<?php echo $this->view['basket']['price_frontend']; ?>'
- },
- submit : '<?php echo __('Speichern', 'wpsg'); ?>',
- placeholder: '<?php echo __('Zum Bearbeiten anklicken ...', 'wpsg'); ?>',
- indicator: '<?php echo __('Speicher ...', 'wpsg'); ?>',
- tooltip: '<?php echo __('Zum Bearbeiten anklicken ...', 'wpsg'); ?>',
- callback: function(data, config) {
- jQuery('#wpsg_produkte_table').replaceWith(data);
- wpsg_be_act_orderdata();
- }
- });
-
- <?php } ?>
-<?php } ?>
-
-<?php if ($this->hasMod('wpsg_mod_discount')) { ?>
- <?php if (isset($this->view['basket']['sum']['preis_rabatt']) && $this->view['basket']['sum']['preis_rabatt'] > 0) { ?>
-
- jQuery('#discountvalue_<?php echo $o_id; ?>').wpsg_editable('<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Order&subaction=discountData&do=editvalue&noheader=1', {
- submitdata: {
- field: 'value',
- edit_id: '<?php echo $o_id; ?>',
- noMwSt: '<?php echo $this->view['basket']['noMwSt']; ?>',
- mwst: '<?php reset($this->view['basket']['mwst']); echo key($this->view['basket']['mwst']); ?>',
- price_frontend: '<?php echo $this->view['basket']['price_frontend']; ?>'
- },
- submit : '<?php echo __('Speichern', 'wpsg'); ?>',
- placeholder: '<?php echo __('Zum Bearbeiten anklicken ...', 'wpsg'); ?>',
- indicator: '<?php echo __('Speicher ...', 'wpsg'); ?>',
- tooltip: '<?php echo __('Zum Bearbeiten anklicken ...', 'wpsg'); ?>',
- callback: function(data, config) {
- jQuery('#wpsg_produkte_table').replaceWith(data);
- wpsg_be_act_orderdata();
- }
- });
-
- <?php } ?>
-<?php } ?>
-
- /**
- * Wird aufgerufen wenn ein Gutschein gelöscht werden soll
- */
- function wpsg_removeVoucher(gs_id, o_id)
- {
-
- if (!confirm('<?php echo __('Sind Sie sich sicher, dass sie diesen Gutschein löschen möchten?', 'wpsg'); ?>')) return false;
-
- jQuery('#wpsg_produkte_table').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-Order&subaction=voucherData&do=remove&gs_id=' + gs_id + '&edit_id=' + o_id +'&noheader=1',
- success: function(data) {
- jQuery('#wpsg_produkte_table').replaceWith(data);
- jQuery('#LinkGutscheinNeu').show();
- wpsg_be_act_orderdata();
- }
- } );
-
- return false;
- }
-
- /**
- * Wird aufgerufen wenn ein Rabatt gelöscht werden soll
- */
- function wpsg_removeDiscount(o_id)
- {
-
- if (!confirm('<?php echo __('Sind Sie sich sicher, dass sie diesen Rabatt löschen möchten?', 'wpsg'); ?>')) return false;
-
- jQuery('#wpsg_produkte_table').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-Order&subaction=discountData&do=remove&edit_id=' + o_id +'&noheader=1',
- success: function(data) {
- jQuery('#wpsg_produkte_table').replaceWith(data);
- jQuery('#LinkRabattNeu').show();
- wpsg_be_act_orderdata();
+ <script type="text/javascript">
+
+ var WPSG_BE_Pay_Ship = {
+
+ changeShippingPayment: function (id, oid) {
+
+ jQuery('#wpsg_shipping_dialog .modal-body').html('<img src="<?php echo WPSG_URL; ?>views/gfx/ajax-loader.gif" alt="<?php echo __('Bitte warten ...', 'wpsg'); ?>" />');
+ jQuery('#wpsg_shipping_dialog').modal( { } ).modal('show');
+
+ jQuery.ajax( {
+ url: '<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Order&action=view&subaction=editPayShipping&edit_id=<?php echo $_REQUEST['edit_id']; ?>&noheader=1',
+ success: function(data) {
+
+ jQuery('#wpsg_shipping_dialog .modal-body').html(data);
+
+ }
+ } );
+
+ return false;
+
+ }, // function changeShipping(id, oid)
+
+ /**
+ * Ändern der Versanddaten im Backend
+ */
+ updateShippingPayment: function() {
+
+ var data = {
+ submit: '1',
+ shipping_key: jQuery('#edit_shipping_type').val(),
+ shipping_price: jQuery('#edit_shipping_price').val(),
+ payment_key: jQuery('#edit_payment_type').val(),
+ payment_price: jQuery('#edit_payment_price').val()
+ };
+
+ jQuery('#wpsg_shipping_dialog').modal('hide');
+
+ jQuery('#wpsg_product_table_wrap').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-Order&action=updateOrder&subaction=editPayShipping&edit_id=<?php echo $_REQUEST['edit_id']; ?>&noheader=1',
+ data: data,
+ success: function(data) {
+
+ jQuery('#wpsg_product_table_wrap').html(data.product_table);
+
+ }
+ } );
+
+ return false;
+
+ } // function dialogShippingOK()
+
+ }
+
+ var WPSG_BE_Product = {
+
+ addProduct: function() {
+
+ jQuery('#wpsg_product_dialog .modal-body').html('<img src="<?php echo WPSG_URL; ?>views/gfx/ajax-loader.gif" alt="<?php echo __('Bitte warten ...', 'wpsg'); ?>" />');
+ jQuery('#wpsg_product_dialog').modal( { } ).modal('show');
+ jQuery('#wpsg_product_dialog .btn-primary').prop('disabled', true);
+
+ jQuery.ajax( {
+ url: '<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Order&action=view&subaction=addProduct&edit_id=<?php echo $_REQUEST['edit_id']; ?>&noheader=1',
+ success: function(data) {
+
+ jQuery('#wpsg_product_dialog .modal-body').html(data);
+
+ }
+ } );
+
+ return false;
+
+ },
+
+ remvoeProduct: function(order_product_id) {
+
+ jQuery('#wpsg_product_table_wrap').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-Order&action=view&subaction=removeProduct&noheader=1&edit_id=<?php echo $_REQUEST['edit_id']; ?>',
+ data: {
+ order_product_id: order_product_id
+ },
+ success: function(data) {
+
+ jQuery('#wpsg_product_table_wrap').html(data.product_table);
+
+ }
+ } );
+
+ return false;
+
+ },
+
+ editProduct: function(order_product_id) {
+
+ jQuery('#wpsg_product_dialog .modal-body').html('<img src="<?php echo WPSG_URL; ?>views/gfx/ajax-loader.gif" alt="<?php echo __('Bitte warten ...', 'wpsg'); ?>" />');
+ jQuery('#wpsg_product_dialog').modal( { } ).modal('show');
+ jQuery('#wpsg_product_dialog .btn-primary').prop('disabled', true);
+
+ jQuery.ajax( {
+ url: '<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Order&action=view&subaction=addProduct&edit_id=<?php echo $_REQUEST['edit_id']; ?>&noheader=1',
+ data: {
+ order_product_id: order_product_id
+ },
+ success: function(data) {
+
+ jQuery('#wpsg_product_dialog .modal-body').html(data);
+
+ }
+ } );
+
+ return false;
+
+ },
+
+ saveProduct: function() {
+
+ jQuery('#wpsg_product_dialog').modal('hide');
+ jQuery('#wpsg_product_table_wrap').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-Order&action=view&subaction=addProduct&do=submit&edit_id=<?php echo $_REQUEST['edit_id']; ?>&noheader=1',
+ data: jQuery('#wpsg_product_add_form').serialize(),
+ success: function(data) {
+
+ jQuery('#wpsg_product_table_wrap').html(data.product_table);
+
+ }
+ } );
+
+ return false;
+
}
- } );
-
- return false;
- }
-
- function wpsg_be_act_orderdata() {
-
- var o_id = 0;
- //alert('wpsg_be_act_orderdata');
- jQuery.ajax( {
- url: '<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Order&subaction=orderData&do=actual&edit_id=' + o_id +'&noheader=1',
- success: function(data) {
- data = JSON.parse(data);
- jQuery('#wpsg_be_orderamount').html(data.preis);
- odata = data.vname + ' ' + data.name + ' / ' + data.preis;
- jQuery('#wpsg_be_orderdata').html(odata);
+
+ }
+
+ var WPSG_BE_Voucher = {
+
+ editVoucher: function() {
+
+ jQuery('#wpsg_voucher_dialog .modal-body').html('<img src="<?php echo WPSG_URL; ?>views/gfx/ajax-loader.gif" alt="<?php echo __('Bitte warten ...', 'wpsg'); ?>" />');
+ jQuery('#wpsg_voucher_dialog').modal( { } ).modal('show');
+
+ jQuery.ajax( {
+ url: '<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Order&action=view&subaction=editVoucher&edit_id=<?php echo $_REQUEST['edit_id']; ?>&noheader=1',
+ success: function(data) {
+
+ jQuery('#wpsg_voucher_dialog .modal-body').html(data);
+
+ }
+ } );
+
+ return false;
+
+ },
+
+ removeVoucher: function() {
+
+ jQuery('#wpsg_product_table_wrap').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-Order&action=view&subaction=editVoucher&do=remove&edit_id=<?php echo $_REQUEST['edit_id']; ?>&noheader=1',
+ success: function(data) {
+
+ jQuery('#wpsg_product_table_wrap').html(data.product_table);
+
+ }
+ } );
+
+ return false;
+
+ },
+
+ saveVoucher: function() {
+
+ jQuery('#wpsg_voucher_dialog').modal('hide');
+ jQuery('#wpsg_product_table_wrap').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-Order&action=view&subaction=editVoucher&do=submit&edit_id=<?php echo $_REQUEST['edit_id']; ?>&noheader=1',
+ data: jQuery('#wpsg_be_voucher_form').serialize(),
+ success: function(data) {
+
+ jQuery('#wpsg_product_table_wrap').html(data.product_table);
+
+ }
+ } );
+
+ return false;
}
- } );
-
-
- return false;
+
+ }
+
+ var WPSG_BE_Discount = {
- }
+ editDiscount: function() {
+
+ jQuery('#wpsg_discount_dialog .modal-body').html('<img src="<?php echo WPSG_URL; ?>views/gfx/ajax-loader.gif" alt="<?php echo __('Bitte warten ...', 'wpsg'); ?>" />');
+ jQuery('#wpsg_discount_dialog').modal( { } ).modal('show');
+
+ jQuery.ajax( {
+ url: '<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Order&action=view&subaction=editDiscount&edit_id=<?php echo $_REQUEST['edit_id']; ?>&noheader=1',
+ success: function(data) {
- jQuery(document).ready(function() {
+ jQuery('#wpsg_discount_dialog .modal-body').html(data);
+
+ }
+ } );
+
+ return false;
+
+ },
+ removeDiscount: function() {
+
+ jQuery('#wpsg_product_table_wrap').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-Order&action=view&subaction=editDiscount&do=remove&edit_id=<?php echo $_REQUEST['edit_id']; ?>&noheader=1',
+ success: function(data) {
+
+ jQuery('#wpsg_product_table_wrap').html(data.product_table);
+
+ }
+ } );
+
+ return false;
+
+ },
+
+ saveDiscount: function() {
+
+ jQuery('#wpsg_discount_dialog').modal('hide');
+ jQuery('#wpsg_product_table_wrap').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-Order&action=view&subaction=editDiscount&do=submit&edit_id=<?php echo $_REQUEST['edit_id']; ?>&noheader=1',
+ data: jQuery('#wpsg_be_discount_form').serialize(),
+ success: function(data) {
+
+ jQuery('#wpsg_product_table_wrap').html(data.product_table);
+
+ }
+ } );
+
+ return false;
+
+ }
+
+ }
- //wpsg_view_orderdata_show();
-
- } );
-
- function wpsg_view_orderdata_show() {
-
- jQuery('#LinkGutscheinNeu').show();
- jQuery('#LinkRabattNeu').show();
- jQuery('#LinkProduktNeu').show();
- jQuery('#LinkSendMail').show();
-
- //if (gs_id > 0) { jQuery('#LinkGutscheinNeu').hide(); }
- //if (prval != 0) { jQuery('#LinkRabattNeu').hide(); }
- }
-
- function wpsg_view_orderdata_hide() {
- jQuery('#LinkGutscheinNeu').hide();
- jQuery('#LinkRabattNeu').hide();
- jQuery('#LinkProduktNeu').hide();
- jQuery('#LinkSendMail').hide();
- }
-
- var Modul2 = {
- eigenschaft : "wert",
- methode : function () {
- alert("Modul-Eigenschaft (über window.Modul): " + Modul2.eigenschaft);
- // Alternativ:
- alert("Modul-Eigenschaft (über this): " + this.eigenschaft);
- }
- };
- //Modul2.methode();
-
-
- var WPSG_BE_Pay_Ship = {
-
- changeShippingPayment: function (id, oid) {
-
- jQuery('#wpsg_shipping_dialog .modal-body').html('<img src="<?php echo WPSG_URL; ?>views/gfx/ajax-loader.gif" alt="<?php echo __('Bitte warten ...', 'wpsg'); ?>" />');
- jQuery('#wpsg_shipping_dialog').modal( { } ).modal('show');
-
- jQuery.ajax( {
- url: '<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Order&action=view&subaction=editPayShipping&edit_id=<?php echo $_REQUEST['edit_id']; ?>&noheader=1',
- success: function(data) {
-
- jQuery('#wpsg_shipping_dialog .modal-body').html(data);
-
- }
- } );
-
- return false;
-
- }, // function changeShipping(id, oid)
-
- /**
- * Ändern der Versanddaten im Backend
- */
- updateShippingPayment: function() {
-
- var data = {
- submit: '1',
- shipping_key: jQuery('#edit_shipping_type').val(),
- shipping_price: jQuery('#edit_shipping_price').val(),
- payment_key: jQuery('#edit_payment_type').val(),
- payment_price: jQuery('#edit_payment_price').val()
- };
-
- jQuery('#wpsg_shipping_dialog').modal('hide');
-
- jQuery('#wpsg_product_table_wrap').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-Order&action=updateOrder&subaction=editPayShipping&edit_id=<?php echo $_REQUEST['edit_id']; ?>&noheader=1',
- data: data,
- success: function(data) {
-
- jQuery('#wpsg_product_table_wrap').html(data.product_table);
-
- }
- } );
-
- return false;
-
- } // function dialogShippingOK()
-
- }; // WPSG_BE_Pay_Ship
-
- var WPSG_BE_Product = {
-
- addProduct: function() {
-
- jQuery('#wpsg_product_dialog .modal-body').html('<img src="<?php echo WPSG_URL; ?>views/gfx/ajax-loader.gif" alt="<?php echo __('Bitte warten ...', 'wpsg'); ?>" />');
- jQuery('#wpsg_product_dialog').modal( { } ).modal('show');
- jQuery('#wpsg_product_dialog .btn-primary').prop('disabled', true);
-
- jQuery.ajax( {
- url: '<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Order&action=view&subaction=addProduct&edit_id=<?php echo $_REQUEST['edit_id']; ?>&noheader=1',
- success: function(data) {
-
- jQuery('#wpsg_product_dialog .modal-body').html(data);
-
- }
- } );
-
- return false;
-
- },
-
- remvoeProduct: function(order_product_id) {
-
- jQuery('#wpsg_product_table_wrap').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-Order&action=view&subaction=removeProduct&noheader=1&edit_id=<?php echo $_REQUEST['edit_id']; ?>',
- data: {
- order_product_id: order_product_id
- },
- success: function(data) {
-
- jQuery('#wpsg_product_table_wrap').html(data.product_table);
-
- }
- } );
-
- return false;
-
- },
-
- editProduct: function(order_product_id) {
-
- jQuery('#wpsg_product_dialog .modal-body').html('<img src="<?php echo WPSG_URL; ?>views/gfx/ajax-loader.gif" alt="<?php echo __('Bitte warten ...', 'wpsg'); ?>" />');
- jQuery('#wpsg_product_dialog').modal( { } ).modal('show');
- jQuery('#wpsg_product_dialog .btn-primary').prop('disabled', true);
-
- jQuery.ajax( {
- url: '<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Order&action=view&subaction=addProduct&edit_id=<?php echo $_REQUEST['edit_id']; ?>&noheader=1',
- data: {
- order_product_id: order_product_id
- },
- success: function(data) {
-
- jQuery('#wpsg_product_dialog .modal-body').html(data);
-
- }
- } );
-
- return false;
-
- },
-
- saveProduct: function() {
-
- jQuery('#wpsg_product_dialog').modal('hide');
- jQuery('#wpsg_product_table_wrap').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-Order&action=view&subaction=addProduct&do=submit&edit_id=<?php echo $_REQUEST['edit_id']; ?>&noheader=1',
- data: jQuery('#wpsg_product_add_form').serialize(),
- success: function(data) {
-
- jQuery('#wpsg_product_table_wrap').html(data.product_table);
-
- }
- } );
-
- return false;
-
- }
-
- }
-
- var WPSG_BE_Discount = {
-
- editDiscount: function() {
-
- jQuery('#wpsg_discount_dialog .modal-body').html('<img src="<?php echo WPSG_URL; ?>views/gfx/ajax-loader.gif" alt="<?php echo __('Bitte warten ...', 'wpsg'); ?>" />');
- jQuery('#wpsg_discount_dialog').modal( { } ).modal('show');
-
- jQuery.ajax( {
- url: '<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Order&action=view&subaction=editDiscount&edit_id=<?php echo $_REQUEST['edit_id']; ?>&noheader=1',
- success: function(data) {
-
- jQuery('#wpsg_discount_dialog .modal-body').html(data);
-
- }
- } );
-
- return false;
-
- },
-
- saveDiscount: function() {
-
- jQuery('#wpsg_discount_dialog').modal('hide');
- jQuery('#wpsg_product_table_wrap').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-Order&action=view&subaction=editDiscount&do=submit&edit_id=<?php echo $_REQUEST['edit_id']; ?>&noheader=1',
- data: jQuery('#wpsg_be_discount_form').serialize(),
- success: function(data) {
+ var WPSG_BE_Mail = {
+
+ sendCustomerMail: function(order_id) {
- jQuery('#wpsg_product_table_wrap').html(data.product_table);
+ jQuery.ajax( {
+ url: '<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Order&action=view&subaction=sendMail&do=customer&edit_id=<?php echo $_REQUEST['edit_id']; ?>&noheader=1',
+ data: jQuery('#wpsg_be_discount_form').serialize(),
+ success: function(data) { alert(data); }
+ } );
- }
- } );
+ return false;
+
+ }
+
+ }
+
+ </script>
+
+ <?php wpsg_drawForm_AdminboxEnd(); ?>
- return false;
-
- }
-
- }
-
- /* ]]> */</script>
+</div>
+<!-- Modaldialog für Gutscheine -->
+<div class="modal fade" id="wpsg_voucher_dialog" tabindex="-1" role="dialog">
+ <div class="modal-dialog" role="document">
+ <div class="modal-content">
+ <div class="modal-header">
+ <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
+ <h4 class="modal-title" id="myModalLabel"><?php echo __('Gutschein hinzufügen/bearbeiten', 'wpsg'); ?></h4>
+ </div>
+ <div class="modal-body"></div>
+ <div class="modal-footer">
+ <button type="button" class="btn btn-default" data-dismiss="modal">Abbrechen</button>
+ <button type="button" class="btn btn-primary" data-dismiss="modal" onclick="return WPSG_BE_Voucher.saveVoucher();">OK</button>
+ </div>
+ </div>
+ </div>
</div>
<!-- Modaldialog für Rabatt -->