[*] BO: Set defaults payment order state on BackOffice order

git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@14694 b9a71923-0436-4b27-9f14-aed3839534dd
This commit is contained in:
rGaillard
2012-04-17 15:56:38 +00:00
parent 7d533b3189
commit d07623cbc2
2 changed files with 17 additions and 0 deletions
@@ -35,6 +35,10 @@
var id_lang = '';
var txt_show_carts = '{l s='Show carts and orders for this customer'}';
var txt_hide_carts = '{l s='Hide carts and orders for this customer'}';
var defaults_order_state = new Array();
{foreach from=$defaults_order_state key='module' item='id_order_state'}
defaults_order_state['{$module}'] = '{$id_order_state}';
{/foreach}
$(document).ready(function() {
$('#customer').typeWatch({
captureLength: 1,
@@ -48,6 +52,12 @@
wait: 100,
callback: function(){ searchProducts(); }
});
$('#payment_module_name').change(function() {
var id_order_state = defaults_order_state[this.value];
if (typeof(id_order_state) == 'undefined')
id_order_state = defaults_order_state['other'];
$('#id_order_state').val(id_order_state);
});
$("#id_address_delivery").change(function() {
updateAddresses();
});
@@ -85,6 +95,7 @@
return false;
});
$('#show_old_carts').click();
$('#payment_module_name').change();
$.ajaxSetup({ type:"post" });
$("#voucher").autocomplete('{$link->getAdminLink('AdminCartRules')}', {
minChars: 3,
@@ -155,6 +155,11 @@ class AdminOrdersControllerCore extends AdminController
unset($this->toolbar_btn['save']);
$this->addJqueryPlugin(array('autocomplete', 'fancybox', 'typewatch'));
$cart = new Cart((int)Tools::getValue('id_cart'));
$defaults_order_state = array('cheque' => (int)Configuration::get('PS_OS_CHEQUE'),
'bankwire' => (int)Configuration::get('PS_OS_BANKWIRE'),
'cashondelivery' => (int)Configuration::get('PS_OS_PREPARATION'),
'other' => (int)Configuration::get('PS_OS_PAYMENT'));
$this->context->smarty->assign(array(
'recyclable_pack' => (int)Configuration::get('PS_RECYCLABLE_PACK'),
'gift_wrapping' => (int)Configuration::get('PS_GIFT_WRAPPING'),
@@ -163,6 +168,7 @@ class AdminOrdersControllerCore extends AdminController
'langs' => Language::getLanguages(true, Context::getContext()->shop->id),
'payment_modules' => PaymentModule::getInstalledPaymentModules(),
'order_states' => OrderState::getOrderStates((int)Context::getContext()->language->id),
'defaults_order_state' => $defaults_order_state,
'show_toolbar' => $this->show_toolbar,
'toolbar_btn' => $this->toolbar_btn,
'toolbar_scroll' => $this->toolbar_scroll,