diff --git a/admin-dev/themes/default/template/controllers/orders/form.tpl b/admin-dev/themes/default/template/controllers/orders/form.tpl index e8de6bf14..c1fd0afff 100755 --- a/admin-dev/themes/default/template/controllers/orders/form.tpl +++ b/admin-dev/themes/default/template/controllers/orders/form.tpl @@ -925,11 +925,33 @@ var addresses_invoice_options = ''; var address_invoice_detail = ''; var address_delivery_detail = ''; + var delivery_address_edit_link = ''; + var invoice_address_edit_link = ''; + $.each(addresses, function() { if (this.id_address == id_address_invoice) - address_invoice_detail = this.company+' '+this.firstname+' '+this.lastname+'
'+this.address1+'
'+this.address2+'
'+this.postcode+' '+this.city+' '+this.country; + { + address_invoice_detail = this.company+' '+this.firstname+' '+this.lastname+'
'+this.address1+'
'+this.address2+'
'+this.postcode+' '+this.city; + + if (this.state != null) + address_invoice_detail += ' '+this.state; + + address_invoice_detail += '
'+this.country; + + invoice_address_edit_link = "{$link->getAdminLink('AdminAddresses')}&id_address="+this.id_address+"&updateaddress&realedit=1&liteDisplaying=1&submitFormAjax=1#"; + } + if(this.id_address == id_address_delivery) - address_delivery_detail = this.company+' '+this.firstname+' '+this.lastname+'
'+this.address1+'
'+this.address2+'
'+this.postcode+' '+this.city+' '+this.country; + { + address_delivery_detail = this.company+' '+this.firstname+' '+this.lastname+'
'+this.address1+'
'+this.address2+'
'+this.postcode+' '+this.city; + + if (this.state != null) + address_delivery_detail += ' '+this.state; + + address_delivery_detail += '
'+this.country; + + delivery_address_edit_link = "{$link->getAdminLink('AdminAddresses')}&id_address="+this.id_address+"&updateaddress&realedit=1&liteDisplaying=1&submitFormAjax=1#"; + } addresses_delivery_options += ''; addresses_invoice_options += ''; @@ -949,6 +971,8 @@ $('#id_address_invoice').html(addresses_invoice_options); $('#address_delivery_detail').html(address_delivery_detail); $('#address_invoice_detail').html(address_invoice_detail); + $('#edit_delivery_address').attr('href', delivery_address_edit_link); + $('#edit_invoice_address').attr('href', invoice_address_edit_link); } function updateAddresses() @@ -1159,14 +1183,14 @@

{l s='Delivery'}

+  

{l s='Invoice'}

+  
diff --git a/classes/controller/AdminController.php b/classes/controller/AdminController.php index 44e60ee5e..9031a3558 100644 --- a/classes/controller/AdminController.php +++ b/classes/controller/AdminController.php @@ -841,7 +841,7 @@ class AdminControllerCore extends Controller $this->redirect_after = self::$currentIndex.'&'.$this->identifier.'='.$parent_id.'&conf=4&token='.$this->token; // Default behavior (save and back) - if (empty($this->redirect_after)) + if (empty($this->redirect_after) && $this->redirect_after !== false) $this->redirect_after = self::$currentIndex.($parent_id ? '&'.$this->identifier.'='.$object->id : '').'&conf=4&token='.$this->token; } Logger::addLog(sprintf($this->l('%s edition'), $this->className), 1, null, $this->className, (int)$object->id, true, (int)$this->context->employee->id); diff --git a/controllers/admin/AdminAddressesController.php b/controllers/admin/AdminAddressesController.php index 7d0e0c6be..ee6d31605 100644 --- a/controllers/admin/AdminAddressesController.php +++ b/controllers/admin/AdminAddressesController.php @@ -299,6 +299,9 @@ class AdminAddressesControllerCore extends AdminController public function processSave() { + if (Tools::getValue('submitFormAjax')) + $this->redirect_after = false; + // Transform e-mail in id_customer for parent processing if (Validate::isEmail(Tools::getValue('email'))) {