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/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) 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); 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 +} 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"');; 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}