From 7eddca6d15bbdb5aec176e2c75569a7d0d225be8 Mon Sep 17 00:00:00 2001 From: Cosmin Hutanu Date: Mon, 30 Sep 2013 13:06:19 +0300 Subject: [PATCH 1/7] update localization pack for romania - added states --- localization/ro.xml | 44 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) diff --git a/localization/ro.xml b/localization/ro.xml index f786be3af..8afbecbe0 100644 --- a/localization/ro.xml +++ b/localization/ro.xml @@ -161,6 +161,50 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + From 99f325dc3c2e216a563cd7493cd53b0c199b1299 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Gaillard?= Date: Wed, 2 Oct 2013 11:24:08 +0200 Subject: [PATCH 2/7] // validation of carrierwizard --- classes/controller/AdminController.php | 7 +++++- .../admin/AdminCarrierWizardController.php | 24 +++++++------------ 2 files changed, 14 insertions(+), 17 deletions(-) diff --git a/classes/controller/AdminController.php b/classes/controller/AdminController.php index 56338546b..44e60ee5e 100644 --- a/classes/controller/AdminController.php +++ b/classes/controller/AdminController.php @@ -2427,7 +2427,12 @@ class AdminControllerCore extends Controller $class_name = $this->className; $object = new $class_name(); - $definition = ObjectModel::getDefinition($class_name); + + if (method_exists($this, 'getValidationRules')) + $definition = $this->getValidationRules(); + else + $definition = ObjectModel::getDefinition($class_name); + $default_language = new Language((int)Configuration::get('PS_LANG_DEFAULT')); foreach ($definition['fields'] as $field => $def) diff --git a/controllers/admin/AdminCarrierWizardController.php b/controllers/admin/AdminCarrierWizardController.php index dc9ee01fd..9a2b76ea5 100644 --- a/controllers/admin/AdminCarrierWizardController.php +++ b/controllers/admin/AdminCarrierWizardController.php @@ -619,7 +619,7 @@ class AdminCarrierWizardControllerCore extends AdminController } } else - $this->validateRules('AdminCarrierWizardControllerCore'); + $this->validateRules(); } if (count($this->errors)) @@ -874,7 +874,7 @@ class AdminCarrierWizardControllerCore extends AdminController return $return; } - public static function getValidationRules() + public function getValidationRules() { $step_number = Tools::getValue('step_number'); @@ -894,20 +894,12 @@ class AdminCarrierWizardControllerCore extends AdminController array_splice($step_fields, 1, 0, $multistore_field); } - $rules = Carrier::getValidationRules('Carrier'); - - foreach ($rules as $key_r => $rule) - foreach ($rule as $key_f => $field) - { - if (in_array($key_r, array('required', 'requiredLang'))) - { - if(!in_array($field, $step_fields[$step_number])) - unset($rules[$key_r][$key_f]); - } - else if(!in_array($key_f, $step_fields[$step_number])) - unset($rules[$key_r][$key_f]); - } - return $rules; + $definition = ObjectModel::getDefinition('Carrier'); + foreach ($definition['fields'] as $field => $def) + if (!in_array($field, $step_fields[$step_number])) + unset($definition['fields'][$field]); + + return $definition; } public static function displayFieldName($field) From eb7655e318b128b2dd5ba833b630d617e3bcf5ff Mon Sep 17 00:00:00 2001 From: thoma202 Date: Wed, 2 Oct 2013 11:58:35 +0200 Subject: [PATCH 3/7] [+] Added hook in maintenance page --- classes/controller/FrontController.php | 3 +++ install-dev/data/xml/hook.xml | 3 +++ themes/default/maintenance.tpl | 3 +++ 3 files changed, 9 insertions(+) diff --git a/classes/controller/FrontController.php b/classes/controller/FrontController.php index 9725e99f1..688b85379 100644 --- a/classes/controller/FrontController.php +++ b/classes/controller/FrontController.php @@ -575,6 +575,9 @@ class FrontControllerCore extends Controller header('HTTP/1.1 503 temporarily overloaded'); $this->context->smarty->assign($this->initLogoAndFavicon()); + $this->context->smarty->assign(array( + 'HOOK_MAINTENANCE' => Hook::exec('displayMaintenance', array()), + )); $template_dir = ($this->context->getMobileDevice() == true ? _PS_THEME_MOBILE_DIR_ : _PS_THEME_DIR_); $this->smartyOutputContent($template_dir.'maintenance.tpl'); diff --git a/install-dev/data/xml/hook.xml b/install-dev/data/xml/hook.xml index 005284227..068532dfd 100644 --- a/install-dev/data/xml/hook.xml +++ b/install-dev/data/xml/hook.xml @@ -13,6 +13,9 @@ actionValidateOrderNew orders + + displayMaintenanceMaintenance PageThis hook displays new elements on the maintenance page + actionPaymentConfirmationPayment confirmationThis hook displays new elements after the payment is validated diff --git a/themes/default/maintenance.tpl b/themes/default/maintenance.tpl index 72cc8ae03..3a47a7269 100644 --- a/themes/default/maintenance.tpl +++ b/themes/default/maintenance.tpl @@ -40,11 +40,14 @@
+

logo

+ {$HOOK_MAINTENANCE}

{l s='In order to perform website maintenance, our online store will be temporarily offline.'}

{l s='We apologize for the inconvenience and ask that you please try again later.'}

+  
From 3e0c5e71f4020c8cb8fd8b12a20c8253ce57f01f Mon Sep 17 00:00:00 2001 From: Eric Le Lay Date: Wed, 2 Oct 2013 16:28:45 +0200 Subject: [PATCH 4/7] classname uppercase issue --- classes/Cart.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/classes/Cart.php b/classes/Cart.php index d19fb0ab0..481922f55 100644 --- a/classes/Cart.php +++ b/classes/Cart.php @@ -1260,7 +1260,7 @@ class CartCore extends ObjectModel return true; } - public static function getTotalCart($id_cart, $use_tax_display = false, $type = CART::BOTH) + public static function getTotalCart($id_cart, $use_tax_display = false, $type = Cart::BOTH) { $cart = new Cart($id_cart); if (!Validate::isLoadedObject($cart)) From 43a60f1b5746fbdfc41d868f474ab6b38aec6c79 Mon Sep 17 00:00:00 2001 From: Jerome Nadaud Date: Thu, 3 Oct 2013 11:06:08 +0200 Subject: [PATCH 5/7] [-] BO : FixBug #PSCFV-9044 - Missing state in new order, and now you can edit customer addresses --- .../template/controllers/orders/form.tpl | 32 ++++++++++++++++--- classes/controller/AdminController.php | 2 +- .../admin/AdminAddressesController.php | 3 ++ 3 files changed, 32 insertions(+), 5 deletions(-) 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'))) { From 6610bd20673ab0e3bf59be0eb08b630970c489fb Mon Sep 17 00:00:00 2001 From: gRoussac Date: Thu, 3 Oct 2013 11:15:03 +0200 Subject: [PATCH 6/7] [-] BO : Could noty save ImportMatchs --- js/adminImport.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/js/adminImport.js b/js/adminImport.js index 3fcf221d5..1939392a6 100644 --- a/js/adminImport.js +++ b/js/adminImport.js @@ -37,12 +37,12 @@ $(document).ready(function(){ matchFields += '&'+$(this).attr('id')+'='+$(this).attr('value'); }); $.ajax({ - type: 'GET', + type: 'POST', url: 'index.php', async: false, cache: false, dataType : "json", - data: 'ajax=1&action=saveImportMatchs&skip='+$('input[name=skip]').attr('value')+'&newImportMatchs='+newImportMatchs+matchFields+'&tab=AdminImport&token='+token, + data: 'ajax=1&action=saveImportMatchs&tab=AdminImport&token=' + token + '&skip=' + $('input[name=skip]').attr('value') + '&newImportMatchs=' + newImportMatchs + matchFields, success: function(jsonData) { $('#valueImportMatchs').append(''); @@ -62,12 +62,12 @@ $(document).ready(function(){ var idToLoad = $('select#valueImportMatchs option:selected').attr('id'); $.ajax({ - type: 'GET', + type: 'POST', url: 'index.php', async: false, cache: false, dataType : "json", - data: 'ajax=1&action=loadImportMatchs&idImportMatchs='+idToLoad+'&tab=AdminImport&token='+token, + data: 'ajax=1&action=loadImportMatchs&tab=AdminImport&token=' + token + '&idImportMatchs=' + idToLoad, success: function(jsonData) { var matchs = jsonData.matchs.split('|') @@ -87,12 +87,12 @@ $(document).ready(function(){ var idToDelete = $('select#valueImportMatchs option:selected').attr('id'); $.ajax({ - type: 'GET', + type: 'POST', url: 'index.php', async: false, cache: false, dataType : "json", - data: 'ajax=1&action=deleteImportMatchs&idImportMatchs='+idToDelete+'&tab=AdminImport&token='+token, + data: 'ajax=1&action=deleteImportMatchs&tab=AdminImport&token=' + token + '&idImportMatchs=' + idToDelete , success: function(jsonData) { $('select#valueImportMatchs option[id=\''+idToDelete+'\']').remove(); From 8f09d49ffcb036a076cfc1a3db98b39fdc387e94 Mon Sep 17 00:00:00 2001 From: tucoinfo Date: Thu, 3 Oct 2013 12:19:10 +0200 Subject: [PATCH 7/7] [*] FO : add variable $nofollow to mobile theme header.tpl Copied from normal theme which already manages the NoFollow variable --- themes/default/mobile/header.tpl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/themes/default/mobile/header.tpl b/themes/default/mobile/header.tpl index ae6fb32d5..e7d6a54cd 100644 --- a/themes/default/mobile/header.tpl +++ b/themes/default/mobile/header.tpl @@ -36,7 +36,7 @@ {/if} - +