// small changes on orders view
This commit is contained in:
@@ -48,6 +48,7 @@
|
|||||||
var txt_add_product_no_product_price = "{l s='Error: Product price must be set' js=1}";
|
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 txt_confirm = "{l s='Are you sure?' js=1}";
|
||||||
var statesShipped = new Array();
|
var statesShipped = new Array();
|
||||||
|
var has_voucher = {if count($discounts)}1{else}0{/if};
|
||||||
{foreach from=$states item=state}
|
{foreach from=$states item=state}
|
||||||
{if (!$currentState->shipped && $state['shipped'])}
|
{if (!$currentState->shipped && $state['shipped'])}
|
||||||
statesShipped.push({$state['id_order_state']});
|
statesShipped.push({$state['id_order_state']});
|
||||||
@@ -927,7 +928,7 @@
|
|||||||
</table>
|
</table>
|
||||||
|
|
||||||
{if $can_edit}
|
{if $can_edit}
|
||||||
<div class="row-margin-bottom">
|
<div class="row-margin-bottom order_action">
|
||||||
{if !$order->hasBeenDelivered()}
|
{if !$order->hasBeenDelivered()}
|
||||||
<button type="button" id="add_product" class="btn btn-default">
|
<button type="button" id="add_product" class="btn btn-default">
|
||||||
<i class="icon-plus-sign"></i>
|
<i class="icon-plus-sign"></i>
|
||||||
@@ -952,8 +953,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-lg-6">
|
<div class="col-lg-6">
|
||||||
|
<div class="panel panel-vouchers" style="{if !sizeof($discounts)}display:none;{/if}">
|
||||||
<div class="panel">
|
|
||||||
{if (sizeof($discounts) || $can_edit)}
|
{if (sizeof($discounts) || $can_edit)}
|
||||||
<table class="table">
|
<table class="table">
|
||||||
<thead>
|
<thead>
|
||||||
|
|||||||
+10
-10
@@ -324,20 +324,17 @@ function init()
|
|||||||
$('#add_product').click(function() {
|
$('#add_product').click(function() {
|
||||||
$('.cancel_product_change_link:visible').trigger('click');
|
$('.cancel_product_change_link:visible').trigger('click');
|
||||||
$('.add_product_fields').show();
|
$('.add_product_fields').show();
|
||||||
$('.edit_product_fields').hide();
|
$('.edit_product_fields, .standard_refund_fields, .partial_refund_fields, .order_action').hide();
|
||||||
$('.standard_refund_fields').hide();
|
|
||||||
$('.partial_refund_fields').hide();
|
|
||||||
$('tr#new_product').slideDown('fast', function () {
|
$('tr#new_product').slideDown('fast', function () {
|
||||||
$('tr#new_product td').fadeIn('fast');
|
$('tr#new_product td').fadeIn('fast');
|
||||||
});
|
});
|
||||||
$(this).hide();
|
|
||||||
$.scrollTo('tr#new_product', 1200, {offset: -100});
|
$.scrollTo('tr#new_product', 1200, {offset: -100});
|
||||||
return false;
|
return false;
|
||||||
});
|
});
|
||||||
|
|
||||||
$('#cancelAddProduct').unbind('click');
|
$('#cancelAddProduct').unbind('click');
|
||||||
$('#cancelAddProduct').click(function() {
|
$('#cancelAddProduct').click(function() {
|
||||||
$('#add_product').show();
|
$('.order_action').show();
|
||||||
$('tr#new_product td').fadeOut('fast');
|
$('tr#new_product td').fadeOut('fast');
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -517,7 +514,7 @@ function init()
|
|||||||
|
|
||||||
$('.standard_refund_fields').hide();
|
$('.standard_refund_fields').hide();
|
||||||
$('.partial_refund_fields').hide();
|
$('.partial_refund_fields').hide();
|
||||||
$('#add_product').show();
|
$('.order_action').show();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
jAlert(data.error);
|
jAlert(data.error);
|
||||||
@@ -801,15 +798,17 @@ function init()
|
|||||||
|
|
||||||
$('#add_voucher').unbind('click');
|
$('#add_voucher').unbind('click');
|
||||||
$('#add_voucher').click(function() {
|
$('#add_voucher').click(function() {
|
||||||
$(this).hide();
|
$('.order_action').hide();
|
||||||
$('#voucher_form').show();
|
$('.panel-vouchers,#voucher_form').show();
|
||||||
return false;
|
return false;
|
||||||
});
|
});
|
||||||
|
|
||||||
$('#cancel_add_voucher').unbind('click');
|
$('#cancel_add_voucher').unbind('click');
|
||||||
$('#cancel_add_voucher').click(function() {
|
$('#cancel_add_voucher').click(function() {
|
||||||
$('#voucher_form').hide();
|
$('#voucher_form').hide();
|
||||||
$('#add_voucher').show();
|
if (!has_voucher)
|
||||||
|
$('.panel-vouchers').hide();
|
||||||
|
$('.order_action').show();
|
||||||
return false;
|
return false;
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -900,7 +899,8 @@ $(document).ready(function() {
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
flagRefund = 'partial';
|
flagRefund = 'partial';
|
||||||
$('.standard_refund_fields').hide();
|
$('.standard_refund_fields, .product_action, .order_action').hide();
|
||||||
|
$('.product_action').hide();
|
||||||
$('.partial_refund_fields').fadeIn();
|
$('.partial_refund_fields').fadeIn();
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
Reference in New Issue
Block a user