From f7f6175191dfd80ff5244360a449b0195bbbe881 Mon Sep 17 00:00:00 2001 From: PrestaEdit Date: Fri, 31 May 2013 14:58:19 +0200 Subject: [PATCH 01/38] [*] BO: hook displayAdminForm / add param fieldset --- admin-dev/themes/default/template/helpers/form/form.tpl | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/admin-dev/themes/default/template/helpers/form/form.tpl b/admin-dev/themes/default/template/helpers/form/form.tpl index 96d43a781..e737e5b43 100644 --- a/admin-dev/themes/default/template/helpers/form/form.tpl +++ b/admin-dev/themes/default/template/helpers/form/form.tpl @@ -343,13 +343,13 @@ {/if} {/if} {/foreach} - {hook h='displayAdminForm'} + {hook h='displayAdminForm' fieldset=$f} {if isset($name_controller)} {capture name=hookName assign=hookName}display{$name_controller|ucfirst}Form{/capture} - {hook h=$hookName} + {hook h=$hookName fieldset=$f} {elseif isset($smarty.get.controller)} {capture name=hookName assign=hookName}display{$smarty.get.controller|ucfirst|htmlentities}Form{/capture} - {hook h=$hookName} + {hook h=$hookName fieldset=$f} {/if} {elseif $key == 'submit'}
From 58e5ea606c78cb4b06033d894005b6461c9e2314 Mon Sep 17 00:00:00 2001 From: PrestaEdit Date: Sat, 1 Jun 2013 00:46:24 +0300 Subject: [PATCH 02/38] [~] Controller: AdminTranslationsController / Back translations Files login.php and password.php are now redirect to an AdminController. No need to check it anymore. --- controllers/admin/AdminTranslationsController.php | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/controllers/admin/AdminTranslationsController.php b/controllers/admin/AdminTranslationsController.php index eaa19d4a1..142d81a26 100644 --- a/controllers/admin/AdminTranslationsController.php +++ b/controllers/admin/AdminTranslationsController.php @@ -983,8 +983,6 @@ class AdminTranslationsControllerCore extends AdminController 'header.inc.php', 'footer.inc.php', 'index.php', - 'login.php', - 'password.php', 'functions.php' ) ) @@ -2755,4 +2753,4 @@ class AdminTranslationsControllerCore extends AdminController return true; return false; } -} \ No newline at end of file +} From bd432641a03a25923bccb413ff094f615ad6da77 Mon Sep 17 00:00:00 2001 From: BigZ Date: Fri, 12 Jul 2013 02:32:52 +0200 Subject: [PATCH 03/38] update documents listing to display proper prefix In order details, generic prefix was displayed in right column instead of shop specific prefix --- .../themes/default/template/controllers/orders/_documents.tpl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/admin-dev/themes/default/template/controllers/orders/_documents.tpl b/admin-dev/themes/default/template/controllers/orders/_documents.tpl index 45b9123bd..47671da59 100644 --- a/admin-dev/themes/default/template/controllers/orders/_documents.tpl +++ b/admin-dev/themes/default/template/controllers/orders/_documents.tpl @@ -68,9 +68,9 @@ {/if} {if get_class($document) eq 'OrderInvoice'} {if isset($document->is_delivery)} - #{Configuration::get('PS_DELIVERY_PREFIX', $current_id_lang)}{'%06d'|sprintf:$document->delivery_number} + #{Configuration::get('PS_DELIVERY_PREFIX', $current_id_lang, null, $order->id_shop)}{'%06d'|sprintf:$document->delivery_number} {else} - {$document->getInvoiceNumberFormatted($current_id_lang)} + {$document->getInvoiceNumberFormatted($current_id_lang, $order->id_shop)} {/if} {elseif get_class($document) eq 'OrderSlip'} #{Configuration::get('PS_CREDIT_SLIP_PREFIX', $current_id_lang)}{'%06d'|sprintf:$document->id} From e28a1e793ad299919c958d48282827c5b82a8b94 Mon Sep 17 00:00:00 2001 From: BigZ Date: Fri, 12 Jul 2013 03:01:33 +0200 Subject: [PATCH 04/38] Invoice prefix wasn't used in filename As invoice_prefix uses lang and shop ids they have to be passed has parameters --- classes/pdf/HTMLTemplateInvoice.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/classes/pdf/HTMLTemplateInvoice.php b/classes/pdf/HTMLTemplateInvoice.php index b66d092a4..8116eb03c 100755 --- a/classes/pdf/HTMLTemplateInvoice.php +++ b/classes/pdf/HTMLTemplateInvoice.php @@ -139,7 +139,7 @@ class HTMLTemplateInvoiceCore extends HTMLTemplate */ public function getFilename() { - return Configuration::get('PS_INVOICE_PREFIX').sprintf('%06d', $this->order_invoice->number).'.pdf'; + return Configuration::get('PS_INVOICE_PREFIX', Context::getContext()->language->id, null, $this->order->id_shop).sprintf('%06d', $this->order_invoice->number).'.pdf'; } } From 25b5d2857b11521560a90d32572a728f79dc2f58 Mon Sep 17 00:00:00 2001 From: BigZ Date: Fri, 12 Jul 2013 03:03:21 +0200 Subject: [PATCH 05/38] develivery slip should use prefix as develivery_prefix uses lang and shop id, those variables has to be passed as parameters --- classes/pdf/HTMLTemplateDeliverySlip.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/classes/pdf/HTMLTemplateDeliverySlip.php b/classes/pdf/HTMLTemplateDeliverySlip.php index e6cf7faf0..b5ea014fe 100755 --- a/classes/pdf/HTMLTemplateDeliverySlip.php +++ b/classes/pdf/HTMLTemplateDeliverySlip.php @@ -90,7 +90,7 @@ class HTMLTemplateDeliverySlipCore extends HTMLTemplate */ public function getFilename() { - return Configuration::get('PS_DELIVERY_PREFIX').sprintf('%06d', $this->order->invoice_number).'.pdf'; + return Configuration::get('PS_DELIVERY_PREFIX', Context::getContext()->language->id, null, $this->order->id_shop).sprintf('%06d', $this->order->invoice_number).'.pdf'; } } From f1049c021a462a9ee8773584aeb0468c04438bf5 Mon Sep 17 00:00:00 2001 From: BigZ Date: Fri, 12 Jul 2013 03:43:03 +0200 Subject: [PATCH 06/38] get correct prefix for invoices One must use the shop id when getting invoices prefix --- .../default/template/controllers/orders/helpers/view/view.tpl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/admin-dev/themes/default/template/controllers/orders/helpers/view/view.tpl b/admin-dev/themes/default/template/controllers/orders/helpers/view/view.tpl index 4c592b9a1..c43c3c0fc 100755 --- a/admin-dev/themes/default/template/controllers/orders/helpers/view/view.tpl +++ b/admin-dev/themes/default/template/controllers/orders/helpers/view/view.tpl @@ -325,7 +325,7 @@ {displayPrice price=$payment->amount currency=$payment->id_currency} {if $invoice = $payment->getOrderInvoice($order->id)} - {$invoice->getInvoiceNumberFormatted($current_id_lang)} + {$invoice->getInvoiceNumberFormatted($current_id_lang, $order->id_shop)} {else} {l s='No invoice'} {/if} @@ -404,7 +404,7 @@ From 1c960da57a228c9a58b9515ccf91dc39644e87bd Mon Sep 17 00:00:00 2001 From: Axome Date: Fri, 12 Jul 2013 11:22:42 +0200 Subject: [PATCH 07/38] [*] BO : Not increment stock if statut change fom Error to Canceled Not increment stock if statut change fom Error => Canceled or Canceled => Error (stock should stay the same). Add a code simplification too --- classes/order/OrderHistory.php | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/classes/order/OrderHistory.php b/classes/order/OrderHistory.php index b12bcd91a..d78c5318c 100644 --- a/classes/order/OrderHistory.php +++ b/classes/order/OrderHistory.php @@ -161,6 +161,9 @@ class OrderHistoryCore extends ObjectModel $manager = null; if (Configuration::get('PS_ADVANCED_STOCK_MANAGEMENT')) $manager = StockManagerFactory::getManager(); + + $errorOrCanceledStatuses = array(Configuration::get('PS_OS_ERROR'), Configuration::get('PS_OS_CANCELED')); + // foreach products of the order if (Validate::isLoadedObject($old_os)) foreach ($order->getProductsDetail() as $product) @@ -171,7 +174,7 @@ class OrderHistoryCore extends ObjectModel ProductSale::addProductSale($product['product_id'], $product['product_quantity']); // @since 1.5.0 - Stock Management if (!Pack::isPack($product['product_id']) && - ($old_os->id == Configuration::get('PS_OS_ERROR') || $old_os->id == Configuration::get('PS_OS_CANCELED')) && + in_array($old_os->id, $errorOrCanceledStatuses) && !StockAvailable::dependsOnStock($product['id_product'], (int)$order->id_shop)) StockAvailable::updateQuantity($product['product_id'], $product['product_attribute_id'], -(int)$product['product_quantity'], $order->id_shop); } @@ -182,13 +185,14 @@ class OrderHistoryCore extends ObjectModel // @since 1.5.0 - Stock Management if (!Pack::isPack($product['product_id']) && - ($new_os->id == Configuration::get('PS_OS_ERROR') || $new_os->id == Configuration::get('PS_OS_CANCELED')) && + in_array($new_os->id, $errorOrCanceledStatuses) && !StockAvailable::dependsOnStock($product['id_product'])) StockAvailable::updateQuantity($product['product_id'], $product['product_attribute_id'], (int)$product['product_quantity'], $order->id_shop); } // if waiting for payment => payment error/canceled elseif (!$new_os->logable && !$old_os->logable && - ($new_os->id == Configuration::get('PS_OS_ERROR') || $new_os->id == Configuration::get('PS_OS_CANCELED')) && + in_array($new_os->id, $errorOrCanceledStatuses) && + !in_array($old_os->id, $errorOrCanceledStatuses) && !StockAvailable::dependsOnStock($product['id_product'])) StockAvailable::updateQuantity($product['product_id'], $product['product_attribute_id'], (int)$product['product_quantity'], $order->id_shop); // @since 1.5.0 : if the order is being shipped and this products uses the advanced stock management : From 6f9e415ca7dbacdd7ae135de8b6de51d3e76bac8 Mon Sep 17 00:00:00 2001 From: gRoussac Date: Fri, 12 Jul 2013 12:03:32 +0200 Subject: [PATCH 08/38] // missing image --- img/admin/external_link.png | Bin 0 -> 305 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 img/admin/external_link.png diff --git a/img/admin/external_link.png b/img/admin/external_link.png new file mode 100644 index 0000000000000000000000000000000000000000..8951d24d429e6a4eb6da29d69c1d107287da35df GIT binary patch literal 305 zcmeAS@N?(olHy`uVBq!ia0vp^+#t-s1SHkYJtzcHjKx9jP7LeL$-D$|SkfJR9T^xl z_H+M9WCij$3p^r=85sBugD~Uq{1qucL8%hgh?3y^w370~qEv=}#LT=BJwMkFg)(D3 zQ$0figD*u3fvOgGx;Tbt1SeaR{ESOEZWP0zahhStzrzRK+t=6s`SthZ?f&ia_u18d ze|hk9d0pjX0j-8hw{A5SuuR$a^^2(!YsmNO@&%#}FSYsO96}Skm@hv4eg6EtI;POZ zmC_zeOZ#K18A2HgrDCKONo&+TxD>mBtK+oc((<{xSwk78)cyGMcda_dVZ}?)esS%q v8ax)iWb;~YTO_%JNg~UEOFV1tURDM*<@d%FLa+FNZe{Rv^>bP0l+XkKbKY;X literal 0 HcmV?d00001 From b880bc3a18682b74dac8417d05f2f5fd3974ec56 Mon Sep 17 00:00:00 2001 From: gRoussac Date: Fri, 12 Jul 2013 12:09:34 +0200 Subject: [PATCH 09/38] [*] PDF : Free shipping in invoice PDF display X2 thanks @axometeam --- pdf/invoice.tpl | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/pdf/invoice.tpl b/pdf/invoice.tpl index 44c7cc1b0..1f48322ce 100755 --- a/pdf/invoice.tpl +++ b/pdf/invoice.tpl @@ -164,7 +164,7 @@ {foreach $order_detail.customizedDatas as $customizationPerAddress} {foreach $customizationPerAddress as $customizationId => $customization} - +
@@ -198,11 +198,8 @@ {assign var="shipping_discount_tax_incl" value="0"} {foreach $cart_rules as $cart_rule} - {if $cart_rule.free_shipping} - {assign var="shipping_discount_tax_incl" value=$order_invoice->total_shipping_tax_incl} - {/if} {cycle values='#FFF,#DDD' assign=bgcolor} - + {$cart_rule.name} {if $tax_excluded_display} @@ -237,7 +234,7 @@ {if $order_invoice->total_discount_tax_incl > 0} {l s='Total Vouchers' pdf='true'} - -{displayPrice currency=$order->id_currency price=($order_invoice->total_discount_tax_incl + $shipping_discount_tax_incl)} + -{displayPrice currency=$order->id_currency price=($order_invoice->total_discount_tax_incl)} {/if} From 24d124f19031dee166e10973db20bd3c8412cef2 Mon Sep 17 00:00:00 2001 From: gRoussac Date: Fri, 12 Jul 2013 14:17:49 +0200 Subject: [PATCH 10/38] [*] MODULE : Multi-shop compatibility in newsletter module tanks @axometeam --- modules/newsletter/newsletter.php | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/modules/newsletter/newsletter.php b/modules/newsletter/newsletter.php index 4c2a2b815..e125305b9 100644 --- a/modules/newsletter/newsletter.php +++ b/modules/newsletter/newsletter.php @@ -144,6 +144,8 @@ class Newsletter extends Module AND a.`id_customer` = c.`id_customer` AND a.`id_country` = '.(int)Tools::getValue('COUNTRY').') >= 1'); + if (Context::getContext()->cookie->shopContext) + $dbquery->where('c.id_shop = '.(int)Context::getContext()->shop->id); $rq = Db::getInstance(_PS_USE_SQL_SLAVE_)->executeS($dbquery->build()); @@ -154,10 +156,14 @@ class Newsletter extends Module private function _getBlockNewsletter() { - $rq = Db::getInstance(_PS_USE_SQL_SLAVE_)->executeS(' - SELECT `id`, `email`, `newsletter_date_add`, `ip_registration_newsletter` + $rqSql = 'SELECT `id`, `email`, `newsletter_date_add`, `ip_registration_newsletter` FROM `'._DB_PREFIX_.'newsletter` - WHERE `active` = 1'); + WHERE `active` = 1'; + + if (Context::getContext()->cookie->shopContext) + $rqSql .= ' AND `id_shop` = '.(int)Context::getContext()->shop->id; + + $rq = Db::getInstance(_PS_USE_SQL_SLAVE_)->executeS($rqSql); $header = array('id_customer', 'email', 'newsletter_date_add', 'ip_address', 'http_referer'); $result = (is_array($rq) ? array_merge(array($header), $rq) : $header); From 8588978e0308204eda5de901f8b4d56da286141a Mon Sep 17 00:00:00 2001 From: gRoussac Date: Fri, 12 Jul 2013 15:03:52 +0200 Subject: [PATCH 11/38] [*] FO : getCatImageLink doesn't work without type thanks @axometeam --- classes/Link.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/classes/Link.php b/classes/Link.php index 9c5658ade..e5019b07a 100644 --- a/classes/Link.php +++ b/classes/Link.php @@ -482,7 +482,10 @@ class LinkCore public function getCatImageLink($name, $id_category, $type = null) { - $uri_path = ($this->allow == 1) ? (__PS_BASE_URI__.'c/'.$id_category.($type ? '-'.$type : '').'/'.$name.'.jpg') : (_THEME_CAT_DIR_.$id_category.($type ? '-'.$type : '').'.jpg'); + if($this->allow == 1 && $type) + $uri_path = __PS_BASE_URI__.'c/'.$id_category.'-'.$type.'/'.$name.'.jpg'; + else + $uri_path = _THEME_CAT_DIR_.$id_category.($type ? '-'.$type : '').'.jpg'; return $this->protocol_content.Tools::getMediaServer($uri_path).$uri_path; } From f82e748fc8fe9cd17bbd6d694e49b5557fafcaf9 Mon Sep 17 00:00:00 2001 From: Damien Metzger Date: Fri, 12 Jul 2013 15:38:18 +0200 Subject: [PATCH 12/38] [*] MO : you can now exclude IP addresses from the online visitors module #PSCFV-9056 --- modules/statslive/statslive.php | 59 ++++++++++++++++++++++++--------- 1 file changed, 44 insertions(+), 15 deletions(-) diff --git a/modules/statslive/statslive.php b/modules/statslive/statslive.php index e935f54d5..efc222eb5 100644 --- a/modules/statslive/statslive.php +++ b/modules/statslive/statslive.php @@ -57,18 +57,37 @@ class StatsLive extends Module */ private function getCustomersOnline() { - $sql = 'SELECT u.id_customer, u.firstname, u.lastname, pt.name as page - FROM `'._DB_PREFIX_.'connections` c - LEFT JOIN `'._DB_PREFIX_.'connections_page` cp ON c.id_connections = cp.id_connections - LEFT JOIN `'._DB_PREFIX_.'page` p ON p.id_page = cp.id_page - LEFT JOIN `'._DB_PREFIX_.'page_type` pt ON p.id_page_type = pt.id_page_type - INNER JOIN `'._DB_PREFIX_.'guest` g ON c.id_guest = g.id_guest - INNER JOIN `'._DB_PREFIX_.'customer` u ON u.id_customer = g.id_customer - WHERE cp.`time_end` IS NULL - '.Shop::addSqlRestriction(false, 'c').' - AND TIME_TO_SEC(TIMEDIFF(NOW(), cp.`time_start`)) < 900 - GROUP BY c.id_connections - ORDER BY u.firstname, u.lastname'; + if ($maintenance_ips = Configuration::get('PS_MAINTENANCE_IP')) + $maintenance_ips = implode(',', array_map('ip2long', array_map('trim', explode(',', $maintenance_ips)))); + + if (Configuration::get('PS_STATSDATA_CUSTOMER_PAGESVIEWS')) + { + $sql = 'SELECT u.id_customer, u.firstname, u.lastname, pt.name as page + FROM `'._DB_PREFIX_.'connections` c + LEFT JOIN `'._DB_PREFIX_.'connections_page` cp ON c.id_connections = cp.id_connections + LEFT JOIN `'._DB_PREFIX_.'page` p ON p.id_page = cp.id_page + LEFT JOIN `'._DB_PREFIX_.'page_type` pt ON p.id_page_type = pt.id_page_type + INNER JOIN `'._DB_PREFIX_.'guest` g ON c.id_guest = g.id_guest + INNER JOIN `'._DB_PREFIX_.'customer` u ON u.id_customer = g.id_customer + WHERE cp.`time_end` IS NULL + '.Shop::addSqlRestriction(false, 'c').' + AND TIME_TO_SEC(TIMEDIFF(NOW(), cp.`time_start`)) < 900 + '.($maintenance_ips ? 'AND c.ip_address NOT IN ('.preg_replace('/[^,0-9]/', '', $maintenance_ips).')' : '').' + GROUP BY u.id_customer + ORDER BY u.firstname, u.lastname'; + } + else + { + $sql = 'SELECT u.id_customer, u.firstname, u.lastname, "-" as page + FROM `'._DB_PREFIX_.'connections` c + INNER JOIN `'._DB_PREFIX_.'guest` g ON c.id_guest = g.id_guest + INNER JOIN `'._DB_PREFIX_.'customer` u ON u.id_customer = g.id_customer + WHERE TIME_TO_SEC(TIMEDIFF(NOW(), c.`date_add`)) < 900 + '.Shop::addSqlRestriction(false, 'c').' + '.($maintenance_ips ? 'AND c.ip_address NOT IN ('.preg_replace('/[^,0-9]/', '', $maintenance_ips).')' : '').' + GROUP BY u.id_customer + ORDER BY u.firstname, u.lastname'; + } $results = Db::getInstance(_PS_USE_SQL_SLAVE_)->executeS($sql); return array($results, Db::getInstance()->NumRows()); } @@ -80,6 +99,9 @@ class StatsLive extends Module */ private function getVisitorsOnline() { + if ($maintenance_ips = Configuration::get('PS_MAINTENANCE_IP')) + $maintenance_ips = implode(',', array_map('ip2long', array_map('trim', explode(',', $maintenance_ips)))); + if (Configuration::get('PS_STATSDATA_CUSTOMER_PAGESVIEWS')) { $sql = 'SELECT c.id_guest, c.ip_address, c.date_add, c.http_referer, pt.name as page @@ -91,18 +113,20 @@ class StatsLive extends Module WHERE (g.id_customer IS NULL OR g.id_customer = 0) '.Shop::addSqlRestriction(false, 'c').' AND cp.`time_end` IS NULL - AND TIME_TO_SEC(TIMEDIFF(NOW(), cp.`time_start`)) < 900 + AND TIME_TO_SEC(TIMEDIFF(NOW(), cp.`time_start`)) < 900 + '.($maintenance_ips ? 'AND c.ip_address NOT IN ('.preg_replace('/[^,0-9]/', '', $maintenance_ips).')' : '').' GROUP BY c.id_connections ORDER BY c.date_add DESC'; } else { - $sql = 'SELECT c.id_guest, c.ip_address, c.date_add, c.http_referer + $sql = 'SELECT c.id_guest, c.ip_address, c.date_add, c.http_referer, "-" as page FROM `'._DB_PREFIX_.'connections` c INNER JOIN `'._DB_PREFIX_.'guest` g ON c.id_guest = g.id_guest WHERE (g.id_customer IS NULL OR g.id_customer = 0) '.Shop::addSqlRestriction(false, 'c').' AND TIME_TO_SEC(TIMEDIFF(NOW(), c.`date_add`)) < 900 + '.($maintenance_ips ? 'AND c.ip_address NOT IN ('.preg_replace('/[^,0-9]/', '', $maintenance_ips).')' : '').' ORDER BY c.date_add DESC'; } @@ -168,7 +192,12 @@ class StatsLive extends Module } else $this->html .= $this->l('There are no visitors online.'); - $this->html .= ''; + $this->html .= ' +
+
'.$this->l('Notice').' + '.$this->l('Maintenance IP(s) are excluded from the online visitors.').'
+ '.$this->l('Add or remove an IP address.').' +
'; return $this->html; } From 38b32f7e1a5bf41e446c71b58b112e5ce24b0830 Mon Sep 17 00:00:00 2001 From: Damien Metzger Date: Fri, 12 Jul 2013 15:56:54 +0200 Subject: [PATCH 13/38] [-] MO : fixed disappearing form in sekeyword #PSCFV-9743 --- modules/sekeywords/sekeywords.php | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/modules/sekeywords/sekeywords.php b/modules/sekeywords/sekeywords.php index 942f9f053..24be726ad 100644 --- a/modules/sekeywords/sekeywords.php +++ b/modules/sekeywords/sekeywords.php @@ -105,8 +105,14 @@ class SEKeywords extends ModuleGraph $result = Db::getInstance(_PS_USE_SQL_SLAVE_)->executeS($this->_query.ModuleGraph::getDateBetween().$this->_query2); $total = count($result); $this->html = '

'.$this->displayName.'

-

'. - ($total == 1 ? sprintf($this->l('%d keyword matches your query.'), $total) : sprintf($this->l('%d keywords match your query.'), $total)).'

'; +

'.($total == 1 ? sprintf($this->l('%d keyword matches your query.'), $total) : sprintf($this->l('%d keywords match your query.'), $total)).'

'; + + $form = '
+ '.$this->l('Filter by keyword').' + '.$this->l('And min occurrences').' + +
'; + if ($result && $total) { $table = ' @@ -125,16 +131,11 @@ class SEKeywords extends ModuleGraph $table .= '
'; $this->html .= '
'.$this->engine(array('type' => 'pie')).'

-

'.$this->l('CSV Export').'


-
- '.$this->l('Filter by keyword').' - '.$this->l('And min occurrences').' - -
-
'.$table; +

'.$this->l('CSV Export').'


+ '.$form.'
'.$table; } else - $this->html .= '

'.$this->l('No keywords').'

'; + $this->html .= '

'.$form.''.$this->l('No keywords').'

'; $this->html .= '

'.$this->l('Guide').'

From 4e0723b3ccfbf4ad3853d8bfeee0fbfc88642cc5 Mon Sep 17 00:00:00 2001 From: Damien Metzger Date: Fri, 12 Jul 2013 16:28:47 +0200 Subject: [PATCH 14/38] [-] BO : fixed charts and grids in multishop #PSCFV-8978 --- admin-dev/drawer.php | 47 ++++++++++++++++++++++++++++++++++++++++++-- admin-dev/grider.php | 47 ++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 92 insertions(+), 2 deletions(-) diff --git a/admin-dev/drawer.php b/admin-dev/drawer.php index c52ea4547..22baa705c 100644 --- a/admin-dev/drawer.php +++ b/admin-dev/drawer.php @@ -37,7 +37,6 @@ $height = Tools::getValue('height'); $id_employee = Tools::getValue('id_employee'); $id_lang = Tools::getValue('id_lang'); - if (!isset($cookie->id_employee) || !$cookie->id_employee || $cookie->id_employee != $id_employee) die(Tools::displayError()); @@ -47,6 +46,51 @@ if (!Validate::isModuleName($module)) if (!Tools::file_exists_cache($module_path = dirname(__FILE__).'/../modules/'.$module.'/'.$module.'.php')) die(Tools::displayError()); +$shop_id = ''; +Shop::setContext(Shop::CONTEXT_ALL); +if (Context::getContext()->cookie->shopContext) +{ + $split = explode('-', Context::getContext()->cookie->shopContext); + if (count($split) == 2) + { + if ($split[0] == 'g') + { + if (Context::getContext()->employee->hasAuthOnShopGroup($split[1])) + Shop::setContext(Shop::CONTEXT_GROUP, $split[1]); + else + { + $shop_id = Context::getContext()->employee->getDefaultShopID(); + Shop::setContext(Shop::CONTEXT_SHOP, $shop_id); + } + } + else if (Shop::getShop($split[1]) && Context::getContext()->employee->hasAuthOnShop($split[1])) + { + $shop_id = $split[1]; + Shop::setContext(Shop::CONTEXT_SHOP, $shop_id); + } + else + { + $shop_id = Context::getContext()->employee->getDefaultShopID(); + Shop::setContext(Shop::CONTEXT_SHOP, $shop_id); + } + } +} + +// Check multishop context and set right context if need +if (Shop::getContext()) +{ + if (Shop::getContext() == Shop::CONTEXT_SHOP && !Shop::CONTEXT_SHOP) + Shop::setContext(Shop::CONTEXT_GROUP, Shop::getContextShopGroupID()); + if (Shop::getContext() == Shop::CONTEXT_GROUP && !Shop::CONTEXT_GROUP) + Shop::setContext(Shop::CONTEXT_ALL); +} + +// Replace existing shop if necessary +if (!$shop_id) + Context::getContext()->shop = new Shop(Configuration::get('PS_SHOP_DEFAULT')); +elseif (Context::getContext()->shop->id != $shop_id) + Context::getContext()->shop = new Shop($shop_id); + require_once($module_path); $graph = new $module(); @@ -57,4 +101,3 @@ if ($option) $graph->create($render, $type, $width, $height, $layers); $graph->draw(); - diff --git a/admin-dev/grider.php b/admin-dev/grider.php index 6e97baf68..a8506a94d 100644 --- a/admin-dev/grider.php +++ b/admin-dev/grider.php @@ -50,6 +50,53 @@ if (!Validate::isModuleName($module)) if (!Tools::file_exists_cache($module_path = dirname(__FILE__).'/../modules/'.$module.'/'.$module.'.php')) die(Tools::displayError()); + +$shop_id = ''; +Shop::setContext(Shop::CONTEXT_ALL); +if (Context::getContext()->cookie->shopContext) +{ + $split = explode('-', Context::getContext()->cookie->shopContext); + if (count($split) == 2) + { + if ($split[0] == 'g') + { + if (Context::getContext()->employee->hasAuthOnShopGroup($split[1])) + Shop::setContext(Shop::CONTEXT_GROUP, $split[1]); + else + { + $shop_id = Context::getContext()->employee->getDefaultShopID(); + Shop::setContext(Shop::CONTEXT_SHOP, $shop_id); + } + } + else if (Shop::getShop($split[1]) && Context::getContext()->employee->hasAuthOnShop($split[1])) + { + $shop_id = $split[1]; + Shop::setContext(Shop::CONTEXT_SHOP, $shop_id); + } + else + { + $shop_id = Context::getContext()->employee->getDefaultShopID(); + Shop::setContext(Shop::CONTEXT_SHOP, $shop_id); + } + } +} + +// Check multishop context and set right context if need +if (Shop::getContext()) +{ + if (Shop::getContext() == Shop::CONTEXT_SHOP && !Shop::CONTEXT_SHOP) + Shop::setContext(Shop::CONTEXT_GROUP, Shop::getContextShopGroupID()); + if (Shop::getContext() == Shop::CONTEXT_GROUP && !Shop::CONTEXT_GROUP) + Shop::setContext(Shop::CONTEXT_ALL); +} + +// Replace existing shop if necessary +if (!$shop_id) + Context::getContext()->shop = new Shop(Configuration::get('PS_SHOP_DEFAULT')); +elseif (Context::getContext()->shop->id != $shop_id) + Context::getContext()->shop = new Shop($shop_id); + + require_once($module_path); $grid = new $module(); From 9c44faf295b73e5fcc0ce54fef9c3292babe4bf8 Mon Sep 17 00:00:00 2001 From: gRoussac Date: Fri, 12 Jul 2013 16:59:11 +0200 Subject: [PATCH 15/38] [-] FO : Fix bug #PSCFV-9754 do not use back url on cart summary link in steps --- themes/default/order-steps.tpl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/themes/default/order-steps.tpl b/themes/default/order-steps.tpl index edb3a549b..91c653bbf 100644 --- a/themes/default/order-steps.tpl +++ b/themes/default/order-steps.tpl @@ -37,7 +37,7 @@
  • {if $current_step=='payment' || $current_step=='shipping' || $current_step=='address' || $current_step=='login'} - + 1. {l s='Summary'} {else} From e23854d143fc20d0c931520df6f93e45ba3baec1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Gaillard?= Date: Fri, 12 Jul 2013 17:49:38 +0200 Subject: [PATCH 16/38] // Add currency ID on default modules cache id --- classes/module/Module.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/classes/module/Module.php b/classes/module/Module.php index 4f7281ba4..6067612b6 100644 --- a/classes/module/Module.php +++ b/classes/module/Module.php @@ -1612,7 +1612,7 @@ abstract class ModuleCore { if ($name === null) $name = $this->name; - return $name.'|'.(int)Tools::usingSecureMode().'|'.(int)$this->context->shop->id.'|'.(int)Group::getCurrent()->id.'|'.(int)$this->context->language->id; + return $name.'|'.(int)Tools::usingSecureMode().'|'.(int)$this->context->shop->id.'|'.(int)Group::getCurrent()->id.'|'.(int)$this->context->language->id.'|'.(int)$this->context->currency->id; } public function display($file, $template, $cacheId = null, $compileId = null) From e34289b0b715eaf9bbdb94716335506c9f444a98 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Gaillard?= Date: Fri, 12 Jul 2013 18:53:22 +0200 Subject: [PATCH 17/38] // fix product warehouses --- js/admin-products.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/js/admin-products.js b/js/admin-products.js index a7f47dd46..dbe4cfd4a 100644 --- a/js/admin-products.js +++ b/js/admin-products.js @@ -1414,7 +1414,7 @@ product_tabs['Warehouses'] = new function(){ // Resize the accordion once the page is visible because of the bug with accordions initialized // inside a display:none block not having the correct size. $('#warehouse_accordion').parents('.product-tab-content').bind('displayed', function(){ - $('#warehouse_accordion').accordion("resize"); + $('#warehouse_accordion').accordion("refresh"); }); }; } From 6ea4a2c5531f8c42b0feb93be4f6fbf026ea54ec Mon Sep 17 00:00:00 2001 From: gRoussac Date: Mon, 15 Jul 2013 10:08:16 +0200 Subject: [PATCH 18/38] [-] FO : Fix bug #PSCFV-9662 udpate payments means after delete thanks @maofree --- themes/default/js/cart-summary.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/themes/default/js/cart-summary.js b/themes/default/js/cart-summary.js index 8c43483c9..218faf25a 100644 --- a/themes/default/js/cart-summary.js +++ b/themes/default/js/cart-summary.js @@ -377,6 +377,8 @@ function deleteProductFromSummary(id) updateHookShoppingCartExtra(jsonData.HOOK_SHOPPING_CART_EXTRA); if (typeof(getCarrierListAndUpdate) !== 'undefined' && jsonData.summary.products.length > 0) getCarrierListAndUpdate(); + if (typeof(updatePaymentMethodsDisplay) !== 'undefined') + updatePaymentMethodsDisplay(); } }, error: function(XMLHttpRequest, textStatus, errorThrown) { From cf7f72fc30704197292df29f5385b4a22e1d7f74 Mon Sep 17 00:00:00 2001 From: Damien Metzger Date: Mon, 15 Jul 2013 10:11:27 +0200 Subject: [PATCH 19/38] // Fixed AdminMarketing position in upgrade --- install-dev/upgrade/sql/1.5.5.0.sql | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/install-dev/upgrade/sql/1.5.5.0.sql b/install-dev/upgrade/sql/1.5.5.0.sql index d901a9386..fe1c1da49 100644 --- a/install-dev/upgrade/sql/1.5.5.0.sql +++ b/install-dev/upgrade/sql/1.5.5.0.sql @@ -20,4 +20,8 @@ CHANGE `module_name` `module_name` VARCHAR(64) NULL DEFAULT NULL; /* PHP:add_module_to_hook(blockmyaccount, actionModuleUnRegisterHookAfter); */; /* PHP:add_module_to_hook(blockmyaccountfooter, actionModuleUnRegisterHookAfter); */; -ALTER TABLE `PREFIX_log` ADD `id_employee` INT(10) UNSIGNED NULL AFTER `object_id`; \ No newline at end of file +ALTER TABLE `PREFIX_log` ADD `id_employee` INT(10) UNSIGNED NULL AFTER `object_id`; + +@id_parent = (SELECT IFNULL(id_tab, 1) FROM `PREFIX_tab` WHERE `class_name` = 'AdminPriceRule' LIMIT 1); +UPDATE `PREFIX_tab` SET id_parent = @id_parent WHERE `id_parent` = 1 AND `class_name` = 'AdminMarketing' LIMIT 1; + From db7f0da74615718e754141ba2d323902200c4c5d Mon Sep 17 00:00:00 2001 From: Damien Metzger Date: Mon, 15 Jul 2013 10:48:48 +0200 Subject: [PATCH 20/38] // Improved display in pscleaner --- modules/pscleaner/pscleaner.php | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/modules/pscleaner/pscleaner.php b/modules/pscleaner/pscleaner.php index 35e6f62de..67ea6595c 100644 --- a/modules/pscleaner/pscleaner.php +++ b/modules/pscleaner/pscleaner.php @@ -49,7 +49,19 @@ class PSCleaner extends Module { $html = '

    '.$this->l('Be really careful with this tool - There is no possible rollback!').'

    '; if (Tools::isSubmit('submitCheckAndFix')) - $html .= $this->displayConfirmation((count($logs = self::checkAndFix()) ? '
    '.print_r($logs, true).'
    ' : $this->l('Nothing that need to be cleaned')).'

    '); + { + $logs = self::checkAndFix(); + if (count($logs)) + { + $conf = $this->l('The following queries successfuly fixed broken data:').'
      '; + foreach ($logs as $query => $entries) + $conf .= '
    • '.Tools::htmlentitiesUTF8($query).'
      '.sprintf($this->l('%d line(s)'), $entries).'
    • '; + $conf .= '
    '; + } + else + $conf = $this->l('Nothing that need to be cleaned'); + $html .= $this->displayConfirmation($conf); + } if (Tools::isSubmit('submitTruncateCatalog')) { self::truncate('catalog'); @@ -330,7 +342,7 @@ class PSCleaner extends Module if ($affected_rows = $db->Affected_Rows()) $logs[$query] = $affected_rows; } - + Category::regenerateEntireNtree(); // @Todo: Remove attachment files, images... @@ -522,8 +534,6 @@ class PSCleaner extends Module protected function clearAllCaches() { - $this->_clearCache('blockcategories.tpl'); - $this->_clearCache('blockcategories_footer.tpl'); - $this->_clearCache('blocktopmenu.tpl'); + Context::getContext()->smarty->clearAllCache(); } } From ee1187d8215188dd25e365613088113b7e2a455f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Gaillard?= Date: Mon, 15 Jul 2013 11:00:35 +0200 Subject: [PATCH 21/38] [-] BO: Delete specific price after combination deletion && fix SpecificPrice::getByProductId() sql query --- classes/Combination.php | 9 ++++++++- classes/SpecificPrice.php | 2 +- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/classes/Combination.php b/classes/Combination.php index 27148b7b3..47b8e2eca 100644 --- a/classes/Combination.php +++ b/classes/Combination.php @@ -102,7 +102,14 @@ class CombinationCore extends ObjectModel // Removes the product from StockAvailable, for the current shop StockAvailable::removeProductFromStockAvailable((int)$this->id_product, (int)$this->id); - + + if ($specific_prices = SpecificPrice::getByProductId((int)$this->id_product, (int)$this->id)) + foreach ($specific_prices as $specific_price) + { + $price = new SpecificPrice((int)$specific_price['id_specific_price']); + $price->delete(); + } + if (!$this->hasMultishopEntries() && !$this->deleteAssociations()) return false; return true; diff --git a/classes/SpecificPrice.php b/classes/SpecificPrice.php index f47f1a5c4..27475c771 100644 --- a/classes/SpecificPrice.php +++ b/classes/SpecificPrice.php @@ -135,7 +135,7 @@ class SpecificPriceCore extends ObjectModel SELECT * FROM `'._DB_PREFIX_.'specific_price` WHERE `id_product` = '.(int)$id_product. - ($id_product_attribute ? 'AND id_product_attribute = '.(int)$id_product_attribute : '').' + ($id_product_attribute ? ' AND id_product_attribute = '.(int)$id_product_attribute : '').' AND id_cart = '.(int)$id_cart); } From e30e15d76d405be7d87069be2cd16e35eb006a05 Mon Sep 17 00:00:00 2001 From: gRoussac Date: Mon, 15 Jul 2013 12:29:51 +0200 Subject: [PATCH 22/38] [-] INSTALER: Fix bug #PSCFV-9762 marketing tab disapear after upgrade --- install-dev/upgrade/php/add_new_tab.php | 7 ++++++- install-dev/upgrade/sql/1.5.4.0.sql | 2 +- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/install-dev/upgrade/php/add_new_tab.php b/install-dev/upgrade/php/add_new_tab.php index 009244a3e..246bb0ac7 100644 --- a/install-dev/upgrade/php/add_new_tab.php +++ b/install-dev/upgrade/php/add_new_tab.php @@ -24,8 +24,13 @@ * International Registered Trademark & Property of PrestaShop SA */ -function add_new_tab($className, $name, $id_parent, $returnId = false) +function add_new_tab($className, $name, $id_parent, $returnId = false, $parentTab) { + if (isset($parentTab) && !empty($parentTab) && (is_null($id_parent) || empty($id_parent))) + $id_parent = (int)Db::getInstance()->getValue('SELECT `id_tab` FROM `'._DB_PREFIX_.'tab` WHERE `class_name` = \''.pSQL($parentTab).'\''); + if (!$id_parent) + return false; + $array = array(); foreach (explode('|', $name) AS $item) { diff --git a/install-dev/upgrade/sql/1.5.4.0.sql b/install-dev/upgrade/sql/1.5.4.0.sql index 75da0cf64..9f486c66c 100644 --- a/install-dev/upgrade/sql/1.5.4.0.sql +++ b/install-dev/upgrade/sql/1.5.4.0.sql @@ -31,7 +31,7 @@ CREATE TABLE `PREFIX_tab_module_preference` ( UNIQUE KEY `employee_module` (`id_employee`, `id_tab`, `module`) ) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8; -/* PHP:add_new_tab(AdminMarketing, es:Marketing|it:Marketing|en:Marketing|de:Marketing|fr:Marketing, 1); */; +/* PHP:add_new_tab(AdminMarketing, es:Marketing|it:Marketing|en:Marketing|de:Marketing|fr:Marketing, 0, false, AdminPriceRule); */; /* PHP:p1540_add_missing_columns(); */; From f1dcf02caf601fe4be4a98bc5cf4043fae05ddb5 Mon Sep 17 00:00:00 2001 From: gRoussac Date: Mon, 15 Jul 2013 14:25:58 +0200 Subject: [PATCH 23/38] //fix warnings #PSCFV-9786 --- controllers/front/IdentityController.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/controllers/front/IdentityController.php b/controllers/front/IdentityController.php index 048a1d07a..7f0eb50b4 100644 --- a/controllers/front/IdentityController.php +++ b/controllers/front/IdentityController.php @@ -57,13 +57,14 @@ class IdentityControllerCore extends FrontController { $email = trim(Tools::getValue('email')); $this->customer->birthday = (empty($_POST['years']) ? '' : (int)$_POST['years'].'-'.(int)$_POST['months'].'-'.(int)$_POST['days']); - $_POST['old_passwd'] = trim($_POST['old_passwd']); + if (isset($_POST['old_passwd'])) + $_POST['old_passwd'] = trim($_POST['old_passwd']); if (!Validate::isEmail($email)) $this->errors[] = Tools::displayError('This email address is not valid'); elseif ($this->customer->email != $email && Customer::customerExists($email, true)) $this->errors[] = Tools::displayError('An account using this email address has already been registered.'); - elseif (empty($_POST['old_passwd']) || (Tools::encrypt($_POST['old_passwd']) != $this->context->cookie->passwd)) + elseif ((!isset($_POST['old_passwd']) || empty($_POST['old_passwd'])) || (Tools::encrypt($_POST['old_passwd']) != $this->context->cookie->passwd)) $this->errors[] = Tools::displayError('The password you entered is incorrect.'); elseif ($_POST['passwd'] != $_POST['confirmation']) $this->errors[] = Tools::displayError('The password and confirmation do not match.'); From 1a056d5e339c1b228f23022da0f07ff29cfa3703 Mon Sep 17 00:00:00 2001 From: gRoussac Date: Mon, 15 Jul 2013 14:47:38 +0200 Subject: [PATCH 24/38] =?UTF-8?q?[-]=20BO=20:=20Fix=20bug=20#PSCFV-9310=20?= =?UTF-8?q?bad=20type=20for=20input=20in=20helper=20thankx=20@Piotr=20Mo?= =?UTF-8?q?=C4=87ko?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../default/template/controllers/payment/restrictions.tpl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/admin-dev/themes/default/template/controllers/payment/restrictions.tpl b/admin-dev/themes/default/template/controllers/payment/restrictions.tpl index 9cfb18625..80e705eb4 100644 --- a/admin-dev/themes/default/template/controllers/payment/restrictions.tpl +++ b/admin-dev/themes/default/template/controllers/payment/restrictions.tpl @@ -64,7 +64,7 @@ {$type = 'checkbox'} {/if} {if $type != 'null'} - + {else} -- {/if} From ca4a73ddf47bd75b2e05b8464b681e0f80f4ec1c Mon Sep 17 00:00:00 2001 From: gRoussac Date: Mon, 15 Jul 2013 15:34:34 +0200 Subject: [PATCH 25/38] // avoid copy paste mistake with trailing space --- controllers/front/PasswordController.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/controllers/front/PasswordController.php b/controllers/front/PasswordController.php index 1a7959887..e36d84a9a 100644 --- a/controllers/front/PasswordController.php +++ b/controllers/front/PasswordController.php @@ -36,7 +36,7 @@ class PasswordControllerCore extends FrontController { if (Tools::isSubmit('email')) { - if (!($email = Tools::getValue('email')) || !Validate::isEmail($email)) + if (!($email = trim(Tools::getValue('email'))) || !Validate::isEmail($email)) $this->errors[] = Tools::displayError('Invalid email address.'); else { From 4b8a756add8307feed966ba2d63dbb7596ce7a7b Mon Sep 17 00:00:00 2001 From: PrestaEdit Date: Mon, 15 Jul 2013 16:34:51 +0200 Subject: [PATCH 26/38] [-] Class: Media / Correct jquery_ui_dependencies fileName Even if not used... --- classes/Media.php | 57 ++++++++++++++++++++++++----------------------- 1 file changed, 29 insertions(+), 28 deletions(-) diff --git a/classes/Media.php b/classes/Media.php index a769218e2..baab74b52 100755 --- a/classes/Media.php +++ b/classes/Media.php @@ -30,36 +30,37 @@ class MediaCore 'ui.core' => array('fileName' => 'jquery.ui.core.min.js', 'dependencies' => array(), 'theme' => true), 'ui.widget' => array('fileName' => 'jquery.ui.widget.min.js', 'dependencies' => array(), 'theme' => false), 'ui.mouse' => array('fileName' => 'jquery.ui.mouse.min.js', 'dependencies' => array('ui.core', 'ui.widget'), 'theme' => false), - 'ui.position' => array('fileName' => 'jquery.ui.mouse.min.js', 'dependencies' => array(), 'theme' => false), - 'ui.draggable' => array('fileName' => 'jquery.ui.mouse.min.js', 'dependencies' => array('ui.core', 'ui.widget', 'ui.mouse'), 'theme' => false), - 'ui.droppable' => array('fileName' => 'jquery.ui.mouse.min.js', 'dependencies' => array('ui.core', 'ui.widget', 'ui.mouse', 'ui.draggable'), 'theme' => false), - 'ui.resizable' => array('fileName' => 'jquery.ui.mouse.min.js', 'dependencies' => array('ui.core', 'ui.widget', 'ui.mouse'), 'theme' => true), - 'ui.selectable' => array('fileName' => 'jquery.ui.mouse.min.js', 'dependencies' => array('ui.core', 'ui.widget', 'ui.mouse'), 'theme' => true), - 'ui.sortable' => array('fileName' => 'jquery.ui.mouse.min.js', 'dependencies' => array('ui.core', 'ui.widget', 'ui.mouse'), 'theme' => true), - 'ui.accordion' => array('fileName' => 'jquery.ui.mouse.min.js', 'dependencies' => array('ui.core', 'ui.widget'), 'theme' => true), - 'ui.autocomplete' => array('fileName' => 'jquery.ui.mouse.min.js', 'dependencies' => array('ui.core', 'ui.widget', 'ui.position'), 'theme' => true), - 'ui.button' => array('fileName' => 'jquery.ui.mouse.min.js', 'dependencies' => array('ui.core', 'ui.widget'), 'theme' => true), - 'ui.dialog' => array('fileName' => 'jquery.ui.mouse.min.js', 'dependencies' => array('ui.core', 'ui.widget', 'ui.position'), 'theme' => true), - 'ui.slider' => array('fileName' => 'jquery.ui.mouse.min.js', 'dependencies' => array('ui.core', 'ui.widget', 'ui.mouse'), 'theme' => true), - 'ui.tabs' => array('fileName' => 'jquery.ui.mouse.min.js', 'dependencies' => array('ui.core', 'ui.widget'), 'theme' => true), - 'ui.datepicker' => array('fileName' => 'jquery.ui.mouse.min.js', 'dependencies' => array('ui.core'), 'theme' => true), - 'ui.progressbar' => array('fileName' => 'jquery.ui.mouse.min.js', 'dependencies' => array('ui.core', 'ui.widget'), 'theme' => true), - 'effects.core' => array('fileName' => 'jquery.ui.mouse.min.js', 'dependencies' => array(), 'theme' => false), - 'effects.blind' => array('fileName' => 'jquery.ui.mouse.min.js', 'dependencies' => array('effects.core'), 'theme' => false), - 'effects.bounce' => array('fileName' => 'jquery.ui.mouse.min.js', 'dependencies' => array('effects.core'), 'theme' => false), - 'effects.clip' => array('fileName' => 'jquery.ui.mouse.min.js', 'dependencies' => array('effects.core'), 'theme' => false), - 'effects.drop' => array('fileName' => 'jquery.ui.mouse.min.js', 'dependencies' => array('effects.core'), 'theme' => false), - 'effects.explode' => array('fileName' => 'jquery.ui.mouse.min.js', 'dependencies' => array('effects.core'), 'theme' => false), - 'effects.fade' => array('fileName' => 'jquery.ui.mouse.min.js', 'dependencies' => array('effects.core'), 'theme' => false), - 'effects.fold' => array('fileName' => 'jquery.ui.mouse.min.js', 'dependencies' => array('effects.core'), 'theme' => false), - 'effects.highlight' => array('fileName' => 'jquery.ui.mouse.min.js', 'dependencies' => array('effects.core'), 'theme' => false), - 'effects.pulsate' => array('fileName' => 'jquery.ui.mouse.min.js', 'dependencies' => array('effects.core'), 'theme' => false), - 'effects.scale' => array('fileName' => 'jquery.ui.mouse.min.js', 'dependencies' => array('effects.core'), 'theme' => false), - 'effects.shake' => array('fileName' => 'jquery.ui.mouse.min.js', 'dependencies' => array('effects.core'), 'theme' => false), - 'effects.slide' => array('fileName' => 'jquery.ui.mouse.min.js', 'dependencies' => array('effects.core'), 'theme' => false), - 'effects.transfer' => array('fileName' => 'jquery.ui.mouse.min.js', 'dependencies' => array('effects.core'), 'theme' => false) + 'ui.position' => array('fileName' => 'jquery.ui.position.min.js', 'dependencies' => array(), 'theme' => false), + 'ui.draggable' => array('fileName' => 'jquery.ui.draggable.min.js', 'dependencies' => array('ui.core', 'ui.widget', 'ui.mouse'), 'theme' => false), + 'ui.droppable' => array('fileName' => 'jquery.ui.droppable.min.js', 'dependencies' => array('ui.core', 'ui.widget', 'ui.mouse', 'ui.draggable'), 'theme' => false), + 'ui.resizable' => array('fileName' => 'jquery.ui.resizable.min.js', 'dependencies' => array('ui.core', 'ui.widget', 'ui.mouse'), 'theme' => true), + 'ui.selectable' => array('fileName' => 'jquery.ui.selectable.min.js', 'dependencies' => array('ui.core', 'ui.widget', 'ui.mouse'), 'theme' => true), + 'ui.sortable' => array('fileName' => 'jquery.ui.sortable.min.js', 'dependencies' => array('ui.core', 'ui.widget', 'ui.mouse'), 'theme' => true), + 'ui.accordion' => array('fileName' => 'jquery.ui.accordion.min.js', 'dependencies' => array('ui.core', 'ui.widget'), 'theme' => true), + 'ui.autocomplete' => array('fileName' => 'jquery.ui.autocomplete.min.js', 'dependencies' => array('ui.core', 'ui.widget', 'ui.position'), 'theme' => true), + 'ui.button' => array('fileName' => 'jquery.ui.button.min.js', 'dependencies' => array('ui.core', 'ui.widget'), 'theme' => true), + 'ui.dialog' => array('fileName' => 'jquery.ui.dialog.min.js', 'dependencies' => array('ui.core', 'ui.widget', 'ui.position'), 'theme' => true), + 'ui.slider' => array('fileName' => 'jquery.ui.slider.min.js', 'dependencies' => array('ui.core', 'ui.widget', 'ui.mouse'), 'theme' => true), + 'ui.tabs' => array('fileName' => 'jquery.ui.tabs.min.js', 'dependencies' => array('ui.core', 'ui.widget'), 'theme' => true), + 'ui.datepicker' => array('fileName' => 'jquery.ui.datepicker.min.js', 'dependencies' => array('ui.core'), 'theme' => true), + 'ui.progressbar' => array('fileName' => 'jquery.ui.progressbar.min.js', 'dependencies' => array('ui.core', 'ui.widget'), 'theme' => true), + 'effects.core' => array('fileName' => 'jquery.effects.core.min.js', 'dependencies' => array(), 'theme' => false), + 'effects.blind' => array('fileName' => 'jquery.effects.blind.min.js', 'dependencies' => array('effects.core'), 'theme' => false), + 'effects.bounce' => array('fileName' => 'jquery.effects.bounce.min.js', 'dependencies' => array('effects.core'), 'theme' => false), + 'effects.clip' => array('fileName' => 'jquery.effects.clip.min.js', 'dependencies' => array('effects.core'), 'theme' => false), + 'effects.drop' => array('fileName' => 'jquery.effects.drop.min.js', 'dependencies' => array('effects.core'), 'theme' => false), + 'effects.explode' => array('fileName' => 'jquery.effects.explode.min.js', 'dependencies' => array('effects.core'), 'theme' => false), + 'effects.fade' => array('fileName' => 'jquery.effects.fade.min.js', 'dependencies' => array('effects.core'), 'theme' => false), + 'effects.fold' => array('fileName' => 'jquery.effects.fold.min.js', 'dependencies' => array('effects.core'), 'theme' => false), + 'effects.highlight' => array('fileName' => 'jquery.effects.highlight.min.js', 'dependencies' => array('effects.core'), 'theme' => false), + 'effects.pulsate' => array('fileName' => 'jquery.effects.pulsate.min.js', 'dependencies' => array('effects.core'), 'theme' => false), + 'effects.scale' => array('fileName' => 'jquery.effects.scale.min.js', 'dependencies' => array('effects.core'), 'theme' => false), + 'effects.shake' => array('fileName' => 'jquery.effects.shake.min.js', 'dependencies' => array('effects.core'), 'theme' => false), + 'effects.slide' => array('fileName' => 'jquery.effects.slide.min.js', 'dependencies' => array('effects.core'), 'theme' => false), + 'effects.transfer' => array('fileName' => 'jquery.effects.transfer.min.js', 'dependencies' => array('effects.core'), 'theme' => false) ); + public static function minifyHTML($html_content) { if (strlen($html_content) > 0) From 01bad90b29a87039c618ae9ba704c41dfb58d36f Mon Sep 17 00:00:00 2001 From: gRoussac Date: Mon, 15 Jul 2013 16:36:54 +0200 Subject: [PATCH 27/38] // Welcome 2013 --- classes/Media.php | 4 ++-- docs/CHANGELOG.txt | 6 +++--- install-dev/langs/pl/img/index.php | 4 ++-- install-dev/langs/pl/index.php | 4 ++-- install-dev/langs/ru/img/index.php | 4 ++-- install-dev/langs/ru/index.php | 4 ++-- 6 files changed, 13 insertions(+), 13 deletions(-) diff --git a/classes/Media.php b/classes/Media.php index a769218e2..317f3872c 100755 --- a/classes/Media.php +++ b/classes/Media.php @@ -1,6 +1,6 @@ -@copyright 2007-2012 PrestaShop SA +@copyright 2007-2013 PrestaShop SA @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) International Registred Trademark & Property of PrestaShop SA @@ -7578,4 +7578,4 @@ Release Notes for PrestaShop 1.5 [+] SQL : add the replication SQL -Release Notes for PrestaShop 1.3 +Release Notes for PrestaShop 1.3 \ No newline at end of file diff --git a/install-dev/langs/pl/img/index.php b/install-dev/langs/pl/img/index.php index f9382edba..5ddf5bce0 100644 --- a/install-dev/langs/pl/img/index.php +++ b/install-dev/langs/pl/img/index.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @copyright 2007-2013 PrestaShop SA * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) * International Registered Trademark & Property of PrestaShop SA */ diff --git a/install-dev/langs/pl/index.php b/install-dev/langs/pl/index.php index 04675e9e1..8fdf0d3e3 100644 --- a/install-dev/langs/pl/index.php +++ b/install-dev/langs/pl/index.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @copyright 2007-2013 PrestaShop SA * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) * International Registered Trademark & Property of PrestaShop SA */ diff --git a/install-dev/langs/ru/img/index.php b/install-dev/langs/ru/img/index.php index f9382edba..5ddf5bce0 100644 --- a/install-dev/langs/ru/img/index.php +++ b/install-dev/langs/ru/img/index.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @copyright 2007-2013 PrestaShop SA * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) * International Registered Trademark & Property of PrestaShop SA */ diff --git a/install-dev/langs/ru/index.php b/install-dev/langs/ru/index.php index 04675e9e1..8fdf0d3e3 100644 --- a/install-dev/langs/ru/index.php +++ b/install-dev/langs/ru/index.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @copyright 2007-2013 PrestaShop SA * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) * International Registered Trademark & Property of PrestaShop SA */ From f9c5bf0bf278b30c4564fa495fb5c6f1131f66e5 Mon Sep 17 00:00:00 2001 From: gRoussac Date: Mon, 15 Jul 2013 17:29:08 +0200 Subject: [PATCH 28/38] [-] Fix bug #PSCFV-9633 again could not see delete href in block cart --- modules/blockcart/ajax-cart.js | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/modules/blockcart/ajax-cart.js b/modules/blockcart/ajax-cart.js index ba49d6c75..3c2658756 100644 --- a/modules/blockcart/ajax-cart.js +++ b/modules/blockcart/ajax-cart.js @@ -348,13 +348,12 @@ var ajaxCart = { }); }); } - var removeLinks = $('#cart_block_product_' + domIdProduct).find('.ajax_cart_block_remove_link'); + + var removeLinks = $('#' + domIdProduct).find('.ajax_cart_block_remove_link'); if (!product.hasCustomizedDatas && !removeLinks.length) - { - $('#cart_block_product_' + domIdProduct + ' span.remove_link').html(' '); - } + $('#' + domIdProduct + ' span.remove_link').html(' '); if (product.is_gift) - $('#cart_block_product_' + domIdProduct + ' span.remove_link').html(''); + $('#' + domIdProduct + ' span.remove_link').html(''); }, doesCustomizationStillExist : function (product, customizationId) @@ -448,7 +447,7 @@ var ajaxCart = { var name = (this.name.length > 12 ? this.name.substring(0, 10) + '...' : this.name); content += '' + name + ''; - if (this.is_gift != undefined && this.is_gift == 1) + if (typeof(this.is_gift) == 'undefined' || this.is_gift == 0) content += ' '; else content += ''; From c253a8edf4216ba56708c3370bc361b7a9c27a96 Mon Sep 17 00:00:00 2001 From: soware Date: Mon, 15 Jul 2013 12:45:00 -0300 Subject: [PATCH 29/38] Update AdminStockManagementController.php Hi, I altered these values to make default on the radio button. I think is better because is a value more frequent in stock management form. --- controllers/admin/AdminStockManagementController.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/controllers/admin/AdminStockManagementController.php b/controllers/admin/AdminStockManagementController.php index cb14e032d..22319e557 100644 --- a/controllers/admin/AdminStockManagementController.php +++ b/controllers/admin/AdminStockManagementController.php @@ -1060,8 +1060,8 @@ class AdminStockManagementControllerCore extends AdminController { $helper->fields_value['id_warehouse_from'] = Tools::getValue('id_warehouse_from', ''); $helper->fields_value['id_warehouse_to'] = Tools::getValue('id_warehouse_to', ''); - $helper->fields_value['usable_from'] = Tools::getValue('usable_from', ''); - $helper->fields_value['usable_to'] = Tools::getValue('usable_to', ''); + $helper->fields_value['usable_from'] = Tools::getValue('usable_from', '1'); + $helper->fields_value['usable_to'] = Tools::getValue('usable_to', '1'); } $this->content .= $helper->generateForm($this->fields_form); From a3039024e7d30ea5196c9450470ff526ae3b7d75 Mon Sep 17 00:00:00 2001 From: Damien Metzger Date: Mon, 15 Jul 2013 18:07:33 +0200 Subject: [PATCH 30/38] // Code cleaning --- controllers/admin/AdminProductsController.php | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/controllers/admin/AdminProductsController.php b/controllers/admin/AdminProductsController.php index f9d9a803a..9958f4234 100644 --- a/controllers/admin/AdminProductsController.php +++ b/controllers/admin/AdminProductsController.php @@ -160,7 +160,11 @@ class AdminProductsControllerCore extends AdminController if (Validate::isLoadedObject($this->_category) && empty($this->_filter)) $join_category = true; - $this->_join .= 'LEFT JOIN `'._DB_PREFIX_.'image` i ON (i.`id_product` = a.`id_product` '.(!Shop::isFeatureActive() ? ' AND i.cover=1' : '').')'; + $this->_join .= ' + LEFT JOIN `'._DB_PREFIX_.'image` i ON (i.`id_product` = a.`id_product` '.(!Shop::isFeatureActive() ? ' AND i.cover=1' : '').') + LEFT JOIN `'._DB_PREFIX_.'stock_available` sav ON (sav.`id_product` = a.`id_product` AND sav.`id_product_attribute` = 0 + '.StockAvailable::addSqlShopRestriction(null, null, 'sav').') '; + if (Shop::isFeatureActive()) { $alias = 'sa'; @@ -188,12 +192,13 @@ class AdminProductsControllerCore extends AdminController $this->_join .= 'LEFT JOIN `'._DB_PREFIX_.'category_lang` cl ON ('.$alias.'.`id_category_default` = cl.`id_category` AND b.`id_lang` = cl.`id_lang` AND cl.id_shop = 1)'; } - $this->_select .= 'MAX('.$alias_image.'.id_image) id_image,'; + $this->_select .= 'MAX('.$alias_image.'.id_image) id_image, cl.name `name_category`, '.$alias.'.`price`, 0 AS price_final, sav.`quantity` as sav_quantity, '.$alias.'.`active`'; - $this->_join .= ($join_category ? 'INNER JOIN `'._DB_PREFIX_.'category_product` cp ON (cp.`id_product` = a.`id_product` AND cp.`id_category` = '.(int)$this->_category->id.')' : '').' - LEFT JOIN `'._DB_PREFIX_.'stock_available` sav ON (sav.`id_product` = a.`id_product` AND sav.`id_product_attribute` = 0 - '.StockAvailable::addSqlShopRestriction(null, null, 'sav').') '; - $this->_select .= 'cl.name `name_category` '.($join_category ? ', cp.`position`' : '').', '.$alias.'.`price`, 0 AS price_final, sav.`quantity` as sav_quantity, '.$alias.'.`active`'; + if ($join_category) + { + $this->_join .= ' INNER JOIN `'._DB_PREFIX_.'category_product` cp ON (cp.`id_product` = a.`id_product` AND cp.`id_category` = '.(int)$this->_category->id.') '; + $this->_select .= ' cp.`position`, '; + } $this->_group = 'GROUP BY '.$alias.'.id_product'; From d9c2ec37d43f28aab2ff9a31a6f85e153532dbf5 Mon Sep 17 00:00:00 2001 From: Damien Metzger Date: Mon, 15 Jul 2013 18:13:07 +0200 Subject: [PATCH 31/38] // Code cleaning --- controllers/admin/AdminProductsController.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/controllers/admin/AdminProductsController.php b/controllers/admin/AdminProductsController.php index 9958f4234..a221df3fb 100644 --- a/controllers/admin/AdminProductsController.php +++ b/controllers/admin/AdminProductsController.php @@ -275,7 +275,7 @@ class AdminProductsControllerCore extends AdminController 'orderby' => false ); - if ((int)$this->id_current_category) + if ($join_category && (int)$this->id_current_category) $this->fields_list['position'] = array( 'title' => $this->l('Position'), 'width' => 70, From b67ffb1a50138336f57fd5987df4feb29360bade Mon Sep 17 00:00:00 2001 From: Fabio Chelly Date: Mon, 15 Jul 2013 19:36:32 +0200 Subject: [PATCH 32/38] [-] MO loyalty : categories are now taken into account when creating discount vouchers #PNM-1492 #PNM-1191 #PNM-1223 --- modules/loyalty/controllers/front/default.php | 37 +++++++++++++++++-- 1 file changed, 33 insertions(+), 4 deletions(-) diff --git a/modules/loyalty/controllers/front/default.php b/modules/loyalty/controllers/front/default.php index 9195706c4..64e152db0 100644 --- a/modules/loyalty/controllers/front/default.php +++ b/modules/loyalty/controllers/front/default.php @@ -106,10 +106,39 @@ class LoyaltyDefaultModuleFrontController extends ModuleFrontController $cart_rule->name[(int)$language['id_lang']] = $text ? strval($text) : strval($default_text); } - if (is_array($categories) && count($categories)) - $cart_rule->add(true, false, $categories); - else - $cart_rule->add(); + + $contains_categories = is_array($categories) && count($categories); + if ($contains_categories) + $cart_rule->product_restriction = 1; + $cart_rule->add(); + + //Restrict cartRules with categories + if ($contains_categories) + { + + //Creating rule group + $id_cart_rule = (int)$cart_rule->id; + $sql = "INSERT INTO "._DB_PREFIX_."cart_rule_product_rule_group (id_cart_rule, quantity) VALUES ('$id_cart_rule', 1)"; + Db::getInstance()->execute($sql); + $id_group = (int)Db::getInstance()->Insert_ID(); + + //Creating product rule + $sql = "INSERT INTO "._DB_PREFIX_."cart_rule_product_rule (id_product_rule_group, type) VALUES ('$id_group', 'categories')"; + Db::getInstance()->execute($sql); + $id_product_rule = (int)Db::getInstance()->Insert_ID(); + + //Creating restrictions + $values = array(); + foreach ($categories as $category) { + $category = (int)$category; + $values[] = "('$id_product_rule', '$category')"; + } + $values = implode(',', $values); + $sql = "INSERT INTO "._DB_PREFIX_."cart_rule_product_rule_value (id_product_rule, id_item) VALUES $values"; + Db::getInstance()->execute($sql); + } + + // Register order(s) which contributed to create this voucher if (!LoyaltyModule::registerDiscount($cart_rule)) From e48b2a411ea882eefcbbd4e871862b82e669eecf Mon Sep 17 00:00:00 2001 From: gRoussac Date: Mon, 15 Jul 2013 22:01:41 +0200 Subject: [PATCH 33/38] [-] INSTALLER : Errors in upgrader --- install-dev/upgrade/php/add_new_tab.php | 6 ++---- install-dev/upgrade/sql/1.5.5.0.sql | 3 +-- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/install-dev/upgrade/php/add_new_tab.php b/install-dev/upgrade/php/add_new_tab.php index 246bb0ac7..602b2477a 100644 --- a/install-dev/upgrade/php/add_new_tab.php +++ b/install-dev/upgrade/php/add_new_tab.php @@ -24,12 +24,10 @@ * International Registered Trademark & Property of PrestaShop SA */ -function add_new_tab($className, $name, $id_parent, $returnId = false, $parentTab) +function add_new_tab($className, $name, $id_parent, $returnId = false, $parentTab = null) { - if (isset($parentTab) && !empty($parentTab) && (is_null($id_parent) || empty($id_parent))) + if (!is_null($parentTab) && !empty($parentTab)) $id_parent = (int)Db::getInstance()->getValue('SELECT `id_tab` FROM `'._DB_PREFIX_.'tab` WHERE `class_name` = \''.pSQL($parentTab).'\''); - if (!$id_parent) - return false; $array = array(); foreach (explode('|', $name) AS $item) diff --git a/install-dev/upgrade/sql/1.5.5.0.sql b/install-dev/upgrade/sql/1.5.5.0.sql index fe1c1da49..934492867 100644 --- a/install-dev/upgrade/sql/1.5.5.0.sql +++ b/install-dev/upgrade/sql/1.5.5.0.sql @@ -22,6 +22,5 @@ CHANGE `module_name` `module_name` VARCHAR(64) NULL DEFAULT NULL; ALTER TABLE `PREFIX_log` ADD `id_employee` INT(10) UNSIGNED NULL AFTER `object_id`; -@id_parent = (SELECT IFNULL(id_tab, 1) FROM `PREFIX_tab` WHERE `class_name` = 'AdminPriceRule' LIMIT 1); +SET @id_parent = (SELECT IFNULL(id_tab, 1) FROM `PREFIX_tab` WHERE `class_name` = 'AdminPriceRule' LIMIT 1); UPDATE `PREFIX_tab` SET id_parent = @id_parent WHERE `id_parent` = 1 AND `class_name` = 'AdminMarketing' LIMIT 1; - From 97b16d272614a59150f630a7ed6d34d3bfee162e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Nadaud?= Date: Tue, 16 Jul 2013 09:59:47 +0200 Subject: [PATCH 34/38] [-] BO : Fix Bug #PSCFV-9550 Bad URL redirection --- controllers/admin/AdminShopUrlController.php | 36 ++++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/controllers/admin/AdminShopUrlController.php b/controllers/admin/AdminShopUrlController.php index f7fd28c78..05d3ca9d1 100644 --- a/controllers/admin/AdminShopUrlController.php +++ b/controllers/admin/AdminShopUrlController.php @@ -394,6 +394,42 @@ class AdminShopUrlControllerCore extends AdminController if ($this->redirect_shop_url) $this->redirect_after = $object->getBaseURI().basename(_PS_ADMIN_DIR_).'/'.$this->context->link->getAdminLink('AdminShopUrl'); } + + /** + * @param string $token + * @param integer $id + * @param string $name + * @return mixed + */ + public function displayDeleteLink($token = null, $id, $name = null) + { + $tpl = $this->createTemplate('helpers/list/list_action_delete.tpl'); + + if (!array_key_exists('Delete', self::$cache_lang)) + self::$cache_lang['Delete'] = $this->l('Delete', 'Helper'); + + if (!array_key_exists('DeleteItem', self::$cache_lang)) + self::$cache_lang['DeleteItem'] = $this->l('Delete selected item?', 'Helper'); + + if (!array_key_exists('Name', self::$cache_lang)) + self::$cache_lang['Name'] = $this->l('Name:', 'Helper'); + + if (!is_null($name)) + $name = '\n\n'.self::$cache_lang['Name'].' '.$name; + + $data = array( + $this->identifier => $id, + 'href' => Tools::safeOutput(self::$currentIndex.'&'.$this->identifier.'='.$id.'&delete'.$this->table.'&id_shop='.$this->id_shop.'&token='.($token != null ? $token : $this->token)), + 'action' => self::$cache_lang['Delete'], + ); + + if ($this->specificConfirmDelete !== false) + $data['confirm'] = !is_null($this->specificConfirmDelete) ? '\r'.$this->specificConfirmDelete : self::$cache_lang['DeleteItem'].$name; + + $tpl->assign(array_merge($this->tpl_delete_link_vars, $data)); + + return $tpl->fetch(); + } } From 672f2d9dd1a1f2899ebd0c1e0c63e8954dfc827b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Nadaud?= Date: Tue, 16 Jul 2013 10:18:54 +0200 Subject: [PATCH 35/38] [-] BO : Fix bug #PSCFV-9395 Missing vertical separation between flags --- js/admin.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/js/admin.js b/js/admin.js index d5ef76b71..eeb866364 100644 --- a/js/admin.js +++ b/js/admin.js @@ -211,7 +211,7 @@ function displayFlags(languages, defaultLanguageID, employee_cookie) $.each(languages, function(key, language) { var img = $('') .addClass('pointer') - .css('margin', '0 2px') + .css('margin', '2px 2px') .attr('src', '../img/l/' + language['id_lang'] + '.jpg') .attr('alt', language['name']) .click(function() { From 3d283000a05abcd2e16c05e1c21c079c3ba994b9 Mon Sep 17 00:00:00 2001 From: Damien Metzger Date: Tue, 16 Jul 2013 10:27:39 +0200 Subject: [PATCH 36/38] // Fixed misplaced comma --- classes/controller/AdminController.php | 4 ++-- controllers/admin/AdminProductsController.php | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/classes/controller/AdminController.php b/classes/controller/AdminController.php index db328b8de..48366d2c4 100644 --- a/classes/controller/AdminController.php +++ b/classes/controller/AdminController.php @@ -2204,9 +2204,9 @@ class AdminControllerCore extends Controller } else $this->_listsql .= ($this->lang ? 'b.*,' : '').' a.*'; - + $this->_listsql .= ' - '.(isset($this->_select) ? ', '.$this->_select : '').$select_shop.' + '.(isset($this->_select) ? ', '.rtrim($this->_select, ', ') : '').$select_shop.' FROM `'._DB_PREFIX_.$sql_table.'` a '.$lang_join.' '.(isset($this->_join) ? $this->_join.' ' : '').' diff --git a/controllers/admin/AdminProductsController.php b/controllers/admin/AdminProductsController.php index a221df3fb..9ca3c4fba 100644 --- a/controllers/admin/AdminProductsController.php +++ b/controllers/admin/AdminProductsController.php @@ -76,7 +76,7 @@ class AdminProductsControllerCore extends AdminController $this->allow_export = true; // @since 1.5 : translations for tabs - $this->available_tabs_lang = array ( + $this->available_tabs_lang = array( 'Informations' => $this->l('Information'), 'Pack' => $this->l('Pack'), 'VirtualProduct' => $this->l('Virtual Product'), @@ -192,7 +192,7 @@ class AdminProductsControllerCore extends AdminController $this->_join .= 'LEFT JOIN `'._DB_PREFIX_.'category_lang` cl ON ('.$alias.'.`id_category_default` = cl.`id_category` AND b.`id_lang` = cl.`id_lang` AND cl.id_shop = 1)'; } - $this->_select .= 'MAX('.$alias_image.'.id_image) id_image, cl.name `name_category`, '.$alias.'.`price`, 0 AS price_final, sav.`quantity` as sav_quantity, '.$alias.'.`active`'; + $this->_select .= 'MAX('.$alias_image.'.id_image) id_image, cl.name `name_category`, '.$alias.'.`price`, 0 AS price_final, sav.`quantity` as sav_quantity, '.$alias.'.`active`, '; if ($join_category) { From d2ff50ddb7c98b831ec646ce90c0c15d2e3f23d2 Mon Sep 17 00:00:00 2001 From: gRoussac Date: Tue, 16 Jul 2013 10:50:27 +0200 Subject: [PATCH 37/38] [*] CORE : Fix bug #PSCFV-9811 doc on display404Error --- classes/Tools.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/classes/Tools.php b/classes/Tools.php index fab8c7385..558f13c52 100644 --- a/classes/Tools.php +++ b/classes/Tools.php @@ -2127,6 +2127,9 @@ exit; } } + /** + * @deprecated as of 1.5 use Controller::getController('PageNotFoundController')->run(); + */ public static function display404Error() { header('HTTP/1.1 404 Not Found'); From 8d39f3250650ca08e189572c404da7c19267e81a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Gaillard?= Date: Tue, 16 Jul 2013 11:52:05 +0200 Subject: [PATCH 38/38] [-] BO: Fix tax rule edition - unique tax rule can't be edited --- classes/tax/TaxRulesGroup.php | 4 ++-- controllers/admin/AdminTaxRulesGroupController.php | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/classes/tax/TaxRulesGroup.php b/classes/tax/TaxRulesGroup.php index 02391e134..1ef0dac0f 100644 --- a/classes/tax/TaxRulesGroup.php +++ b/classes/tax/TaxRulesGroup.php @@ -113,11 +113,11 @@ class TaxRulesGroupCore extends ObjectModel ); } - public function hasUniqueTaxRuleForCountry($id_country, $id_state) + public function hasUniqueTaxRuleForCountry($id_country, $id_state, $id_tax_rule = false) { $rules = TaxRule::getTaxRulesByGroupId((int)Context::getContext()->language->id, (int)$this->id); foreach ($rules as $rule) - if ($rule['id_country'] == $id_country && $id_state == $rule['id_state'] && !$rule['behavior']) + if ($rule['id_country'] == $id_country && $id_state == $rule['id_state'] && !$rule['behavior'] && (int)$id_tax_rule != $rule['id_tax_rule']) return true; return false; diff --git a/controllers/admin/AdminTaxRulesGroupController.php b/controllers/admin/AdminTaxRulesGroupController.php index ac37c2d72..63772700d 100644 --- a/controllers/admin/AdminTaxRulesGroupController.php +++ b/controllers/admin/AdminTaxRulesGroupController.php @@ -404,7 +404,7 @@ class AdminTaxRulesGroupControllerCore extends AdminController { foreach ($this->selected_states as $id_state) { - if ($tax_rules_group->hasUniqueTaxRuleForCountry($id_country, $id_state)) + if ($tax_rules_group->hasUniqueTaxRuleForCountry($id_country, $id_state, $id_rule)) { $this->errors[] = Tools::displayError('A tax rule already exists for this country/state with tax only behavior'); continue;