From 5e02cdcbe3ea8c2b738bf67251a5b9836b73f3cd Mon Sep 17 00:00:00 2001 From: hartmut Date: Wed, 28 Jun 2017 11:55:09 +0000 Subject: Korrekturen BE Bestellverwaltung git-svn-id: https://[internal]/wordpress/plugins/wpsg4@6350 0d5edaf7-2b12-4e95-93f4-047927463d4b --- views/order/view.phtml | 46 ++--- views/order/view_general.phtml | 3 +- views/order/view_orderdata.phtml | 359 ++++++++++++++++++++------------------- 3 files changed, 213 insertions(+), 195 deletions(-) diff --git a/views/order/view.phtml b/views/order/view.phtml index 4f822b8..4ede53a 100644 --- a/views/order/view.phtml +++ b/views/order/view.phtml @@ -22,7 +22,7 @@ - + writeBackendMessage(); ?> @@ -37,7 +37,7 @@ - +  
@@ -45,11 +45,11 @@
hasMod('wpsg_mod_gutschein')) { ?> - view['basket'])) && ($this->view['basket']['gs']['value'] == 0))) { ?> + view['basket'])) && ($this->view['basket']['gs']['value'] == 0))) { ?>  
- + hasMod('wpsg_mod_discount')) { ?> @@ -59,11 +59,11 @@
- +  
- +
@@ -87,11 +87,11 @@ /** * Sendet eine eMail - */ + */ function wpsg_sendMail(oid) { jQuery('#wpsg_produkte_table').html('<?php echo __('Bitte warten ...', 'wpsg'); ?>'); - + jQuery.ajax( { url: 'wp-admin/admin.php?page=wpsg-Admin&subaction=sendMail&do=send&edit_id=' + oid + '&noheader=1', success: function(data) { @@ -99,18 +99,18 @@ location.href = location.href; } } ); - + return false; - + } // function wpsg_sendMail() /** * Fügt einen neuen Rabatt hinzu (nur wenn keiner da ist) - */ + */ function wpsg_addDiscount(oid) { jQuery('#wpsg_produkte_table').html('<?php echo __('Bitte warten ...', 'wpsg'); ?>'); - + jQuery.ajax( { url: 'wp-admin/admin.php?page=wpsg-Admin&subaction=discountData&do=add&edit_id=' + oid + '&noheader=1', success: function(data) { @@ -118,19 +118,19 @@ jQuery('#LinkRabattNeu').hide(); } } ); - + return false; - - } // function wpsg_addRabatt() + + } // function wpsg_addDiscount() /** * Fügt einen neuen Gutschein hinzu (nur wenn keiner da ist) - */ + */ function wpsg_addVoucher(oid) { jQuery('#wpsg_produkte_table').html('<?php echo __('Bitte warten ...', 'wpsg'); ?>'); - + jQuery.ajax( { url: 'wp-admin/admin.php?page=wpsg-Admin&subaction=voucherData&do=add&edit_id=' + oid + '&noheader=1', success: function(data) { @@ -141,24 +141,24 @@ //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') { + if (tab == 'orderdata') { wpsg_view_orderdata_show(); } else { wpsg_view_orderdata_hide(); @@ -175,13 +175,13 @@ if (co === undefined) { jQuery("[wpsg-data-target='general']").trigger("click"); } else { - jQuery("[wpsg-data-target='" + co + "']").trigger("click"); + 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'); - + } ); /* ]]> */ diff --git a/views/order/view_general.phtml b/views/order/view_general.phtml index 0610b1d..80e1e30 100644 --- a/views/order/view_general.phtml +++ b/views/order/view_general.phtml @@ -23,7 +23,8 @@
- + callMods('order_view_switchStatus', array(&$this->view['data']['id'])); ?> + diff --git a/views/order/view_orderdata.phtml b/views/order/view_orderdata.phtml index 26891ba..40a9910 100644 --- a/views/order/view_orderdata.phtml +++ b/views/order/view_orderdata.phtml @@ -49,10 +49,10 @@ callMods('order_view_row', array(&$p, $i)); ?> - view['basket']['gs'])) && ($this->view['basket']['gs']['value'] > 0)) { ?> - '.$this->view['basket']['gs']['code'].''; $val = '-'.wpsg_ff($this->view['basket']['sum']['gs']); $link2 = ''.$val.''; - + ?> view['basket']['gs']['code'] != '')? '('.$link1.')':'' ?> @@ -79,8 +79,8 @@ view['basket']['sum']['gs'], $this->get_option('wpsg_currency')); ?> - view['basket']['sum']['preis_rabatt']) && $this->view['basket']['sum']['preis_rabatt'] > 0) { + view['basket']['sum']['preis_rabatt']) && $this->view['basket']['sum']['preis_rabatt'] > 0) { $o_id = $_REQUEST['edit_id']; $prval = '-'.wpsg_ff($this->view['basket']['sum']['preis_rabatt']); $link2 = ''.$prval.''; @@ -100,7 +100,7 @@ get_option('wpsg_kleinunternehmer') == '1') { ?> getURL(wpsg_ShopController::URL_VERSANDKOSTEN).'" target="_blank">'.__('Versandkosten', 'wpsg').''); ?> - getFrontendTaxview() == WPSG_NETTO) + getFrontendTaxview() == WPSG_NETTO) //if ($this->view['basket']['price_frontend'] == WPSG_NETTO) if ($this->get_option('wpsg_preisangaben') == WPSG_NETTO) { ?> @@ -118,14 +118,14 @@ - view['oOrder']; $o_id = $_REQUEST['edit_id']; $oOrder = wpsg_order::getInstance($o_id); $sid = $oOrder->getShippingID(); echo __(' ('.$this->arShipping[$sid]['name'].')', 'wpsg'); ?> - @@ -144,7 +144,7 @@ echo __(' ('.$this->arPayment[$pid]['name'].')', 'wpsg'); ?> - @@ -180,7 +180,7 @@ get_option('wpsg_kleinunternehmer') == '1') { ?> get_option('wpsg_kleinunternehmer_text'); ?> - view['basket']['price_frontend'] == WPSG_NETTO) { if ($this->get_option('wpsg_preisangaben') == WPSG_NETTO) { echo wpsg_translate(__('zuzüglich MwSt. (#1#)', 'wpsg'), $mwst['name']); @@ -204,11 +204,11 @@ view['basket'])) && ($this->view['basket']['gs']['value'] > 0)) { ?> jQuery('#gsname_').wpsg_editable('wp-admin/admin.php?page=wpsg-Admin&subaction=voucherData&do=editname&noheader=1', { - submitdata: { + submitdata: { field: 'code', gs_id: '', edit_id: '' - }, + }, submit : '', placeholder: '', indicator: '', @@ -219,14 +219,14 @@ }); jQuery('#gsvalue_').wpsg_editable('wp-admin/admin.php?page=wpsg-Admin&subaction=voucherData&do=editvalue&noheader=1', { - submitdata: { + submitdata: { field: 'value', gs_id: '', edit_id: '', noMwSt: 'view['basket']['noMwSt']; ?>', mwst: 'view['basket']['mwst']); echo key($this->view['basket']['mwst']); ?>', price_frontend: 'view['basket']['price_frontend']; ?>' - }, + }, submit : '', placeholder: '', indicator: '', @@ -243,13 +243,13 @@ view['basket']['sum']['preis_rabatt']) && $this->view['basket']['sum']['preis_rabatt'] > 0) { ?> jQuery('#discountvalue_').wpsg_editable('wp-admin/admin.php?page=wpsg-Admin&subaction=discountData&do=editvalue&noheader=1', { - submitdata: { + submitdata: { field: 'value', edit_id: '', noMwSt: 'view['basket']['noMwSt']; ?>', mwst: 'view['basket']['mwst']); echo key($this->view['basket']['mwst']); ?>', price_frontend: 'view['basket']['price_frontend']; ?>' - }, + }, submit : '', placeholder: '', indicator: '', @@ -261,7 +261,7 @@ - + /** * Wird aufgerufen wenn ein Gutschein gelöscht werden soll */ @@ -279,7 +279,7 @@ jQuery('#LinkGutscheinNeu').show(); } } ); - + return false; } @@ -292,7 +292,7 @@ if (!confirm('')) return false; jQuery('#wpsg_produkte_table').html('<?php echo __('Bitte warten ...', 'wpsg'); ?>'); - + jQuery.ajax( { url: 'wp-admin/admin.php?page=wpsg-Admin&subaction=discountData&do=remove&edit_id=' + o_id +'&noheader=1', success: function(data) { @@ -300,7 +300,7 @@ jQuery('#LinkRabattNeu').show(); } } ); - + return false; } @@ -317,7 +317,7 @@ jQuery('#LinkRabattNeu').show(); jQuery('#LinkProduktNeu').show(); jQuery('#LinkSendMail').show(); - + if (gs_id > 0) { jQuery('#LinkGutscheinNeu').hide(); } if (prval != 0) { jQuery('#LinkRabattNeu').hide(); } } @@ -328,7 +328,7 @@ jQuery('#LinkProduktNeu').hide(); jQuery('#LinkSendMail').hide(); } - + var Modul2 = { eigenschaft : "wert", methode : function () { @@ -339,7 +339,7 @@ }; //Modul2.methode(); - + var WPSG_BE_Pay_Ship = { paymentinfos: 0, @@ -354,38 +354,38 @@ i, n; //jQuery('#wpsg_payment_dialog .modal-body').html('<?php echo __('Bitte warten ...', 'wpsg'); ?>'); - + jQuery('#wpsg_payment_dialog').modal( { } ); - + this.paymentinfos = arPayment, JSON_FORCE_OBJECT); ?>; this.oid = oid; this.pidold = id; - + jQuery('#zahlungsartid').empty(); jQuery.each(this.paymentinfos, function(i,n) { console.log('element: ', n.name); - if (id == n.id) { + if (id == n.id) { jQuery('#zahlungsartid').append(""); } else { jQuery('#zahlungsartid').append(""); } }); jQuery('#zahlungsartid').val(id); - + //this.preis = this.paymentinfos[id].preis; //this.preis = jQuery('#wpsg_cell_payment_value').val(); this.preis = jQuery('#wpsg_cell_payment_value').html(); this.preisold = this.preis; - if (this.preis == false) { this.preis = '0,00'; } + if (this.preis == false) { this.preis = '0,00'; } jQuery('#zahlungsartvalue').val(this.preis); - + return false; }, // function changePayment(id, oid) /** * Löschen der Zahlungsdaten im Backend - */ + */ deletePayment: function(id, oid) { var pid, @@ -394,7 +394,7 @@ pid = jQuery('#zahlungsartid').val(); pval = jQuery('#zahlungsartvalue').val(); //alert('delete : ' + pid + ' / ' + pval); - + url1 = 'wp-admin/admin.php?page=wpsg-Admin&subaction=paymentData&do=delete&edit_id=' + this.oid + '&p_id=' + pid + '&noheader=1'; jQuery.ajax( { url: '' + url1, @@ -405,14 +405,14 @@ jQuery('#wpsg_produkte_table').replaceWith(data); } } ); - + return false; - + }, // function deletePayment() /** * Ändern der Zahlungsdaten im Backend - */ + */ dialogPaymentOK: function() { var pid, @@ -422,13 +422,13 @@ pid = jQuery('#zahlungsartid').val(); pval = jQuery('#zahlungsartvalue').val(); //alert('OK neu: ' + this.pidold + ' / ' + pid + ' / ' + pval); - if ((this.pidold == pid) && (this.preisold == pval)) { + if ((this.pidold == pid) && (this.preisold == pval)) { jQuery('#wpsg_payment_dialog').modal('hide'); //jQuery('#wpsg_payment_dialog').modal('close'); return false; } //alert('OK neu: ' + pid + ' / ' + pval); - + url1 = 'wp-admin/admin.php?page=wpsg-Admin&subaction=paymentData&do=change&edit_id=' + this.oid + '&p_id=' + pid + '&p_value=' + pval + '&noheader=1'; jQuery.ajax( { url: '' + url1, @@ -443,14 +443,14 @@ jQuery('#wpsg_produkte_table').replaceWith(data); } } ); - + return false; - + }, // function dialogPaymentOK() /** * Ändern der Zahlungsdaten im Backend - */ + */ dialogPaymentChange: function() { var pid, @@ -468,36 +468,36 @@ i, n; //jQuery('#wpsg_shipping_dialog .modal-body').html('<?php echo __('Bitte warten ...', 'wpsg'); ?>'); - + jQuery('#wpsg_shipping_dialog').modal( { } ); - + this.shippinginfos = arShipping, JSON_FORCE_OBJECT); ?>; this.oid = oid; this.sidold = id; - + jQuery('#versandartid').empty(); jQuery.each(this.shippinginfos, function(i,n) { console.log('element: ', n.name); - if (id == n.id) { + if (id == n.id) { jQuery('#versandartid').append(""); } else { jQuery('#versandartid').append(""); } }); jQuery('#versandartid').val(id); - + this.preis = jQuery('#wpsg_cell_shipping_value').html(); this.preisold = this.preis; - if (this.preis == false) { this.preis = '0,00'; } + if (this.preis == false) { this.preis = '0,00'; } jQuery('#versandartvalue').val(this.preis); - + return false; }, // function changeShipping(id, oid) /** * Löschen der Versanddaten im Backend - */ + */ deleteShipping: function(id, oid) { var sid, @@ -506,7 +506,7 @@ sid = jQuery('#versandartid').val(); sval = jQuery('#versandartvalue').val(); //alert('delete : ' + sid + ' / ' + sval); - + url1 = 'wp-admin/admin.php?page=wpsg-Admin&subaction=shippingData&do=delete&edit_id=' + this.oid + '&s_id=' + sid + '&noheader=1'; jQuery.ajax( { url: '' + url1, @@ -517,14 +517,14 @@ jQuery('#wpsg_produkte_table').replaceWith(data); } } ); - + return false; - + }, // function deleteShipping() /** * Ändern der Versanddaten im Backend - */ + */ dialogShippingOK: function() { var sid, @@ -534,13 +534,13 @@ sid = jQuery('#versandartid').val(); sval = jQuery('#versandartvalue').val(); //alert('OK neu: ' + this.sidold + ' / ' + sid + ' / ' + sval); - if ((this.sidold == sid) && (this.preisold == sval)) { + if ((this.sidold == sid) && (this.preisold == sval)) { jQuery('#wpsg_shipping_dialog').modal('hide'); //jQuery('#wpsg_shipping_dialog').modal('close'); return false; } //alert('OK neu: ' + sid + ' / ' + sval); - + url1 = 'wp-admin/admin.php?page=wpsg-Admin&subaction=shippingData&do=change&edit_id=' + this.oid + '&s_id=' + sid + '&s_value=' + sval + '&noheader=1'; jQuery.ajax( { url: '' + url1, @@ -555,14 +555,14 @@ jQuery('#wpsg_produkte_table').replaceWith(data); } } ); - + return false; - + }, // function dialogShippingOK() /** * Ändern der Versanddaten im Backend - */ + */ dialogShippingChange: function() { var sid, @@ -573,16 +573,16 @@ }, // dialogShippingChange() - + changePayment2: function (id, oid) { alert('TEST OK neu2'); } // function changePayment2(id, oid) - + }; // WPSG_BE_Pay_Ship //WPSG_BE_Pay_Ship.changePayment2(1, 2); - + var WPSG_BE_Product = { @@ -605,18 +605,18 @@ */ removeProduct: function (op_id, o_id) { - + if (!confirm('')) return false; - + jQuery('#wpsg_produkte_table').html('<?php echo __('Bitte warten ...', 'wpsg'); ?>'); - + jQuery.ajax( { url: 'wp-admin/admin.php?page=wpsg-Admin&subaction=productData&do=remove&edit_id=' + o_id + '&op_id=' + op_id + '&noheader=1', success: function (data) { jQuery('#wpsg_produkte_table').replaceWith(data); } } ); - + return false; }, // function removeProduct @@ -628,26 +628,85 @@ this.op_id = 0; this.p_id = p_id; this.o_id = o_id; - + //alert('TEST'); jQuery('#wpsg_product_dialog').modal( { } ); - + this.modus = 1; // neues Produkt jQuery('#wpsg_product_data').hide(); - + jQuery('#productid').empty(); jQuery.each(this.allproductinfos, function (i,n) { jQuery('#productid').append(""); }); jQuery('#productid').val(p_id); - - + + return false; }, // function addProduct + /** + * Bearbeiten der Produkt-Daten + */ + editProduct: function (op_id, p_id, o_id) + { + var + i, + id, + menge, + key, + mid, + n; + + this.modus = 0; // bearbeiten + this.op_id = op_id; + this.p_id = p_id; + this.o_id = o_id; + //jQuery('#wpsg_produkte_table').html('<?php echo __('Bitte warten ...', 'wpsg'); ?>'); + + jQuery('#wpsg_product_dialog').modal( { } ); + jQuery('#wpsg_product_data').show(); + + this.pidold = p_id; + + jQuery('#productid').empty(); + jQuery.each(this.allproductinfos, function (i,n) { + console.log('element: ', n.name); + if (p_id == n.id) { + jQuery('#productid').append(""); + mid = n.mwst_key; + } else { + jQuery('#productid').append(""); + } + }); + jQuery('#productid').val(p_id); + + jQuery('#productmwst').empty(); + for (key in this.mwstinfos) { + if (p_id == key) { + jQuery('#productmwst').append(""); + } else { + jQuery('#productmwst').append(""); + } + } + jQuery('#productmwst').val(mid); + + id = this.findIndex(op_id); + this.preis = this.productinfos[id].preis; + + this.preisold = this.preis; + if (this.preis == false) { this.preis = '0,00'; } + jQuery('#productvalue').val(this.preis); + menge = this.productinfos[id].menge; + jQuery('#productmenge').val(menge); + + return false; + + }, // function editProduct() + /** * Ändern der Produktdaten im Backend - */ + */ dialogProductOK: function () { var pid, @@ -661,13 +720,13 @@ pme = jQuery('#productmenge').val(); pmwst = jQuery('#productmwst').val(); //alert('OK neu: ' + this.pidold + ' / ' + pid + ' / ' + pval); - //if ((this.pidold == pid) && (this.preisold == pval)) { - if ((pid == null)) { + //if ((this.pidold == pid) && (this.preisold == pval)) { + if ((pid == null)) { jQuery('#wpsg_product_dialog').modal('hide'); return false; } //alert('OK neu: ' + pid + ' / ' + pval); - + if (this.modus == 0) { url1 = 'wp-admin/admin.php?page=wpsg-Admin&subaction=productData&do=change&edit_id=' + this.o_id + '&op_id=' + this.op_id + '&p_id=' + pid + '&noheader=1'; jQuery.ajax( { @@ -704,76 +763,18 @@ } ); } return false; - - }, // function dialogProduktOK() - - /** - * Bearbeiten der Produkt-Daten - */ - editProduct: function (op_id, p_id, o_id) - { - var - i, - id, - menge, - key, - mid, - n; - - this.modus = 0; // bearbeiten - this.op_id = op_id; - this.p_id = p_id; - this.o_id = o_id; - //jQuery('#wpsg_produkte_table').html('<?php echo __('Bitte warten ...', 'wpsg'); ?>'); - - jQuery('#wpsg_product_dialog').modal( { } ); - jQuery('#wpsg_product_data').show(); - - this.pidold = p_id; - - jQuery('#productid').empty(); - jQuery.each(this.allproductinfos, function (i,n) { - console.log('element: ', n.name); - if (p_id == n.id) { - jQuery('#productid').append(""); - mid = n.mwst_key; - } else { - jQuery('#productid').append(""); - } - }); - jQuery('#productid').val(p_id); - - jQuery('#productmwst').empty(); - for (key in this.mwstinfos) { - if (p_id == key) { - jQuery('#productmwst').append(""); - } else { - jQuery('#productmwst').append(""); - } - } - jQuery('#productmwst').val(mid); - - id = this.findIndex(op_id); - this.preis = this.productinfos[id].preis; - this.preisold = this.preis; - if (this.preis == false) { this.preis = '0,00'; } - jQuery('#productvalue').val(this.preis); - menge = this.productinfos[id].menge; - jQuery('#productmenge').val(menge); - - return false; - - }, // function editProduct() + }, // function dialogProduktOK() /** * Ändern des Produktes im Backend - */ + */ dialogProductChange: function() { var pid, id, aid, + mid, pval; pid = jQuery('#productid').val(); aid = this.findAllIndex(pid); @@ -785,36 +786,48 @@ jQuery('#productmenge').val(1); pval = this.allproductinfos[aid].mwst_key; jQuery('#productmwst').val(pval); + + jQuery('#productmwst').empty(); + for (key in this.mwstinfos) { + if (pval == key) { + jQuery('#productmwst').append(""); + } else { + jQuery('#productmwst').append(""); + } + } + jQuery('#productmwst').val(pval); + + jQuery('#wpsg_product_data').show(); } }, // dialogProductChange() /** * Suchen des Indexes in allproductinfos an Hand der id - */ + */ findAllIndex: function(id) { var pid, pval; for (key in this.allproductinfos) { if (id == this.allproductinfos[key].id) { - return key; + return key; } } return false; }, // findAllIndex() - + /** * Suchen des Indexes in productinfos an Hand der order_product_id - */ + */ findIndex: function(id) { var pid, pval; for (key in this.productinfos) { if (id == this.productinfos[key].order_product_id) { - return key; + return key; } } return false; @@ -826,12 +839,12 @@ alert('TEST OK neu2'); } // function changeProduct2(id, oid) - + }; // WPSG_BE_Product //WPSG_BE_Product.changeProduct2(1, 2); - - /* ]]> */ - + + /* ]]> */ + @@ -845,6 +858,10 @@
- + - + -- cgit v1.2.3