From 00ee8ad4efbe570378fb2b1ebb4279acfb0fc2bd Mon Sep 17 00:00:00 2001 From: misthero Date: Wed, 26 Jun 2013 10:32:54 +0200 Subject: [PATCH 1/5] Update AdminCustomerThreadsController.php $contact->name can be an array throwing a warning Warning: preg_match() expects parameter 2 to be string when answering to a customer --- controllers/admin/AdminCustomerThreadsController.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/controllers/admin/AdminCustomerThreadsController.php b/controllers/admin/AdminCustomerThreadsController.php index 697d5dedb..57eff11a0 100644 --- a/controllers/admin/AdminCustomerThreadsController.php +++ b/controllers/admin/AdminCustomerThreadsController.php @@ -404,7 +404,7 @@ class AdminCustomerThreadsControllerCore extends AdminController $contact = new Contact((int)$ct->id_contact); if (Validate::isLoadedObject($contact)) { - $from_name = $contact->name; + $from_name = $contact->name[(int)$ct->id_lang]; $from_email = $contact->email; } else @@ -805,4 +805,4 @@ class AdminCustomerThreadsControllerCore extends AdminController die('{"hasError" : false, "errors" : ["'.$str_errors.$str_error_delete.'"]}'); } } -} \ No newline at end of file +} From 7f1b44f45105c8a7cfd100cd0165d0e9ff04baec Mon Sep 17 00:00:00 2001 From: gRoussac Date: Wed, 26 Jun 2013 18:27:02 +0200 Subject: [PATCH 2/5] [-] INSTALLER : Remove warnings --- .../upgrade/php/p1540_add_missing_columns.php | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/install-dev/upgrade/php/p1540_add_missing_columns.php b/install-dev/upgrade/php/p1540_add_missing_columns.php index b63af1a71..95a3b6ab1 100644 --- a/install-dev/upgrade/php/p1540_add_missing_columns.php +++ b/install-dev/upgrade/php/p1540_add_missing_columns.php @@ -43,12 +43,14 @@ function p1540_add_missing_columns() if ($id_module) { $list_fields = Db::getInstance()->executeS('SHOW FIELDS FROM `'._DB_PREFIX_.'layered_product_attribute`'); - foreach ($list_fields as $k => $field) - $list_fields[$k] = $field['Field']; - - if (!in_array('id_shop', $list_fields)) - if (!Db::getInstance()->execute('ALTER TABLE `'._DB_PREFIX_.'layered_product_attribute` ADD `id_shop` INT( 10 ) UNSIGNED NOT NULL DEFAULT "1" AFTER `id_attribute_group`')) - $errors[] = Db::getInstance()->getMsgError(); + if(is_array($list_fields)) + { + foreach ($list_fields as $k => $field) + $list_fields[$k] = $field['Field']; + if (!in_array('id_shop', $list_fields)) + if (!Db::getInstance()->execute('ALTER TABLE `'._DB_PREFIX_.'layered_product_attribute` ADD `id_shop` INT( 10 ) UNSIGNED NOT NULL DEFAULT "1" AFTER `id_attribute_group`')) + $errors[] = Db::getInstance()->getMsgError(); + } } $key_exists = Db::getInstance()->executeS('SHOW INDEX FROM `'._DB_PREFIX_.'stock_available` WHERE KEY_NAME = "product_sqlstock"');; From 453bb826ef2081175700b258b0ca799f3de605f6 Mon Sep 17 00:00:00 2001 From: Vincent Augagneur Date: Thu, 27 Jun 2013 10:19:22 +0200 Subject: [PATCH 3/5] [-] BO : fixed bug #PSCFV-9586 - Unable to sort CMS page in back office --- controllers/admin/AdminCmsController.php | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/controllers/admin/AdminCmsController.php b/controllers/admin/AdminCmsController.php index 71497c56e..c46c61b88 100644 --- a/controllers/admin/AdminCmsController.php +++ b/controllers/admin/AdminCmsController.php @@ -220,11 +220,28 @@ class AdminCmsControllerCore extends AdminController $this->displayListFooter($token); } - public function postProcess() + /** + * Modifying initial getList method to display position feature (drag and drop) + */ + public function getList($id_lang, $order_by = null, $order_way = null, $start = 0, $limit = null, $id_lang_shop = false) { if (Tools::isSubmit($this->table.'Orderby') || Tools::isSubmit($this->table.'Orderway')) $this->filter = true; + if ($order_by && $this->context->cookie->__get($this->table.'Orderby')) + $order_by = $this->context->cookie->__get($this->table.'Orderby'); + else + $order_by = 'position'; + + if (is_null($order_way)) + $order_way = Tools::getValue($this->table.'Orderway', 'ASC'); + + parent::getList($id_lang, $order_by, $order_way, $start, $limit, $id_lang_shop); + } + + public function postProcess() + { + if (Tools::isSubmit('viewcms') && ($id_cms = (int)Tools::getValue('id_cms')) && ($cms = new CMS($id_cms, $this->context->language->id)) && Validate::isLoadedObject($cms)) { $redir = $this->context->link->getCMSLink($cms); From 13b7bc959ecd4ebf94952ec57893de53641dbda1 Mon Sep 17 00:00:00 2001 From: gRoussac Date: Thu, 27 Jun 2013 10:56:50 +0200 Subject: [PATCH 4/5] [*] BO : Fix #PSCFV-8504 carrier on invoice and delivery slip --- classes/pdf/HTMLTemplateDeliverySlip.php | 7 +++++-- classes/pdf/HTMLTemplateInvoice.php | 6 ++++-- pdf/delivery-slip.tpl | 9 +++++++-- pdf/invoice.tpl | 5 +++++ 4 files changed, 21 insertions(+), 6 deletions(-) diff --git a/classes/pdf/HTMLTemplateDeliverySlip.php b/classes/pdf/HTMLTemplateDeliverySlip.php index 6ca63012f..e6cf7faf0 100755 --- a/classes/pdf/HTMLTemplateDeliverySlip.php +++ b/classes/pdf/HTMLTemplateDeliverySlip.php @@ -60,13 +60,16 @@ class HTMLTemplateDeliverySlipCore extends HTMLTemplate $invoice_address = new Address((int)$this->order->id_address_invoice); $formatted_invoice_address = AddressFormat::generateAddress($invoice_address, array(), '
', ' '); } - + + $carrier = new Carrier($this->order->id_carrier); + $carrier->name = ($carrier->name == '0' ? Configuration::get('PS_SHOP_NAME') : $carrier->name); $this->smarty->assign(array( 'order' => $this->order, 'order_details' => $this->order_invoice->getProducts(), 'delivery_address' => $formatted_delivery_address, 'invoice_address' => $formatted_invoice_address, - 'order_invoice' => $this->order_invoice + 'order_invoice' => $this->order_invoice, + 'carrier' => $carrier )); return $this->smarty->fetch($this->getTemplate('delivery-slip')); diff --git a/classes/pdf/HTMLTemplateInvoice.php b/classes/pdf/HTMLTemplateInvoice.php index 86c475833..b66d092a4 100755 --- a/classes/pdf/HTMLTemplateInvoice.php +++ b/classes/pdf/HTMLTemplateInvoice.php @@ -89,7 +89,8 @@ class HTMLTemplateInvoiceCore extends HTMLTemplate $tax_exempt = Configuration::get('VATNUMBER_MANAGEMENT') && !empty($address->vat_number) && $address->id_country != Configuration::get('VATNUMBER_COUNTRY'); - + $carrier = new Carrier($this->order->id_carrier); + $this->smarty->assign(array( 'tax_exempt' => $tax_exempt, 'use_one_after_another_method' => $this->order_invoice->useOneAfterAnotherTaxComputationMethod(), @@ -98,7 +99,8 @@ class HTMLTemplateInvoiceCore extends HTMLTemplate 'ecotax_tax_breakdown' => $this->order_invoice->getEcoTaxTaxesBreakdown(), 'wrapping_tax_breakdown' => $this->order_invoice->getWrappingTaxesBreakdown(), 'order' => $this->order, - 'order_invoice' => $this->order_invoice + 'order_invoice' => $this->order_invoice, + 'carrier' => $carrier )); return $this->smarty->fetch($this->getTemplate('invoice.tax-tab')); diff --git a/pdf/delivery-slip.tpl b/pdf/delivery-slip.tpl index affc1273e..b64100eb2 100755 --- a/pdf/delivery-slip.tpl +++ b/pdf/delivery-slip.tpl @@ -71,7 +71,7 @@ -
+ {l s='Order Number:' pdf='true'}
{$order->getUniqReference()}
@@ -93,9 +93,14 @@ {/foreach}

+ {if isset($carrier)} + {l s='Carrier:' pdf='true'}
+ {$carrier->name}
+
+ {/if} - + diff --git a/pdf/invoice.tpl b/pdf/invoice.tpl index c2b20cc7d..1a051ab22 100755 --- a/pdf/invoice.tpl +++ b/pdf/invoice.tpl @@ -92,6 +92,11 @@ {/foreach}
{l s='ITEMS TO BE DELIVERED' pdf='true'}

+ {if isset($carrier)} + {l s='Carrier:' pdf='true'}
+ {$carrier->name}
+
+ {/if} From 6368409ec68208af42eb188f3cbfa185e1f1e6e3 Mon Sep 17 00:00:00 2001 From: Damien Metzger Date: Thu, 27 Jun 2013 15:30:01 +0200 Subject: [PATCH 5/5] [-] BO : fixed addslashes on tpl translations (compatibility between "slashes" and "js" parameters) #PSCFV-9427 --- config/smartyadmin.config.inc.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/smartyadmin.config.inc.php b/config/smartyadmin.config.inc.php index f2916819e..9f5654082 100644 --- a/config/smartyadmin.config.inc.php +++ b/config/smartyadmin.config.inc.php @@ -36,7 +36,7 @@ function smartyTranslate($params, &$smarty) { $htmlentities = !isset($params['js']); $pdf = isset($params['pdf']); - $addslashes = isset($params['slashes']); + $addslashes = (isset($params['slashes']) || isset($params['js'])); $sprintf = isset($params['sprintf']) ? $params['sprintf'] : false; if ($pdf)