From 8662ef12b4dc77b08b753d3e917d37b45f975d0e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Gaillard?= Date: Wed, 23 Oct 2013 11:59:28 +0200 Subject: [PATCH] // small changes on orders view --- .../controllers/orders/helpers/view/view.tpl | 6 +++--- js/admin_order.js | 20 +++++++++---------- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/admin-dev/themes/default/template/controllers/orders/helpers/view/view.tpl b/admin-dev/themes/default/template/controllers/orders/helpers/view/view.tpl index aac5778cd..5ff56fcaf 100755 --- a/admin-dev/themes/default/template/controllers/orders/helpers/view/view.tpl +++ b/admin-dev/themes/default/template/controllers/orders/helpers/view/view.tpl @@ -48,6 +48,7 @@ var txt_add_product_no_product_price = "{l s='Error: Product price must be set' js=1}"; var txt_confirm = "{l s='Are you sure?' js=1}"; var statesShipped = new Array(); + var has_voucher = {if count($discounts)}1{else}0{/if}; {foreach from=$states item=state} {if (!$currentState->shipped && $state['shipped'])} statesShipped.push({$state['id_order_state']}); @@ -927,7 +928,7 @@ {if $can_edit} -
+
{if !$order->hasBeenDelivered()}
- -
+
{if (sizeof($discounts) || $can_edit)} diff --git a/js/admin_order.js b/js/admin_order.js index 2f9ea14bf..802413ad1 100644 --- a/js/admin_order.js +++ b/js/admin_order.js @@ -324,20 +324,17 @@ function init() $('#add_product').click(function() { $('.cancel_product_change_link:visible').trigger('click'); $('.add_product_fields').show(); - $('.edit_product_fields').hide(); - $('.standard_refund_fields').hide(); - $('.partial_refund_fields').hide(); + $('.edit_product_fields, .standard_refund_fields, .partial_refund_fields, .order_action').hide(); $('tr#new_product').slideDown('fast', function () { $('tr#new_product td').fadeIn('fast'); }); - $(this).hide(); $.scrollTo('tr#new_product', 1200, {offset: -100}); return false; }); $('#cancelAddProduct').unbind('click'); $('#cancelAddProduct').click(function() { - $('#add_product').show(); + $('.order_action').show(); $('tr#new_product td').fadeOut('fast'); }); @@ -517,7 +514,7 @@ function init() $('.standard_refund_fields').hide(); $('.partial_refund_fields').hide(); - $('#add_product').show(); + $('.order_action').show(); } else jAlert(data.error); @@ -801,15 +798,17 @@ function init() $('#add_voucher').unbind('click'); $('#add_voucher').click(function() { - $(this).hide(); - $('#voucher_form').show(); + $('.order_action').hide(); + $('.panel-vouchers,#voucher_form').show(); return false; }); $('#cancel_add_voucher').unbind('click'); $('#cancel_add_voucher').click(function() { $('#voucher_form').hide(); - $('#add_voucher').show(); + if (!has_voucher) + $('.panel-vouchers').hide(); + $('.order_action').show(); return false; }); @@ -900,7 +899,8 @@ $(document).ready(function() { else { flagRefund = 'partial'; - $('.standard_refund_fields').hide(); + $('.standard_refund_fields, .product_action, .order_action').hide(); + $('.product_action').hide(); $('.partial_refund_fields').fadeIn(); } return false;