diff --git a/admin-dev/themes/default/template/controllers/performance/helpers/form/form.tpl b/admin-dev/themes/default/template/controllers/performance/helpers/form/form.tpl index 517808419..ffe93c246 100644 --- a/admin-dev/themes/default/template/controllers/performance/helpers/form/form.tpl +++ b/admin-dev/themes/default/template/controllers/performance/helpers/form/form.tpl @@ -31,7 +31,7 @@ {/if} {$smarty.block.parent} - {if $input.type == 'radio' && $input.name == 'smarty_cache'} + {if in_array($input.type, array('radio', 'switch')) && $input.name == 'smarty_cache'} {l s='Clear Smarty cache & Autoload cache'} {/if} {/block} diff --git a/classes/Autoload.php b/classes/Autoload.php index dc780e1b8..d08140942 100644 --- a/classes/Autoload.php +++ b/classes/Autoload.php @@ -83,8 +83,7 @@ class Autoload return; // regenerate the class index if the requested file doesn't exists - if (!isset($this->index[$classname]) - || ($this->index[$classname] && !is_file($this->root_dir.$this->index[$classname])) + if ((isset($this->index[$classname]) && $this->index[$classname] && !is_file($this->root_dir.$this->index[$classname])) || (isset($this->index[$classname.'Core']) && $this->index[$classname.'Core'] && !is_file($this->root_dir.$this->index[$classname.'Core']))) $this->generateIndex(); @@ -139,7 +138,7 @@ class Autoload else { $filename_tmp = tempnam(dirname($filename), basename($filename.'.')); - if ($filename_tmp !== false AND file_put_contents($filename_tmp, $content, LOCK_EX) !== false) + if ($filename_tmp !== false && file_put_contents($filename_tmp, $content, LOCK_EX) !== false) { if (!@rename($filename_tmp, $filename)) unlink($filename_tmp); diff --git a/install-dev/fixtures/apple/data/access.xml b/install-dev/fixtures/apple/data/access.xml index e3bcb6357..030ca35fe 100644 --- a/install-dev/fixtures/apple/data/access.xml +++ b/install-dev/fixtures/apple/data/access.xml @@ -9,107 +9,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -413,7 +312,6 @@ - diff --git a/install-dev/fixtures/apple/data/profile.xml b/install-dev/fixtures/apple/data/profile.xml index e936c897e..abdc58077 100644 --- a/install-dev/fixtures/apple/data/profile.xml +++ b/install-dev/fixtures/apple/data/profile.xml @@ -2,7 +2,6 @@ - diff --git a/install-dev/fixtures/apple/langs/bn/data/profile.xml b/install-dev/fixtures/apple/langs/bn/data/profile.xml index 02aa4d76c..04e65582f 100644 --- a/install-dev/fixtures/apple/langs/bn/data/profile.xml +++ b/install-dev/fixtures/apple/langs/bn/data/profile.xml @@ -1,8 +1,5 @@ - - Administrator - Logistician diff --git a/install-dev/fixtures/apple/langs/br/data/profile.xml b/install-dev/fixtures/apple/langs/br/data/profile.xml index c8c8e0b73..7e5557062 100644 --- a/install-dev/fixtures/apple/langs/br/data/profile.xml +++ b/install-dev/fixtures/apple/langs/br/data/profile.xml @@ -1,8 +1,5 @@ - - Administrador - Logistician diff --git a/install-dev/fixtures/apple/langs/de/data/profile.xml b/install-dev/fixtures/apple/langs/de/data/profile.xml index 37cd3994a..9f65fe224 100644 --- a/install-dev/fixtures/apple/langs/de/data/profile.xml +++ b/install-dev/fixtures/apple/langs/de/data/profile.xml @@ -1,8 +1,5 @@ - - Administrator - Logistiker diff --git a/install-dev/fixtures/apple/langs/en/data/profile.xml b/install-dev/fixtures/apple/langs/en/data/profile.xml index 02aa4d76c..04e65582f 100644 --- a/install-dev/fixtures/apple/langs/en/data/profile.xml +++ b/install-dev/fixtures/apple/langs/en/data/profile.xml @@ -1,8 +1,5 @@ - - Administrator - Logistician diff --git a/install-dev/fixtures/apple/langs/es/data/profile.xml b/install-dev/fixtures/apple/langs/es/data/profile.xml index 9ebcbf405..04e65582f 100644 --- a/install-dev/fixtures/apple/langs/es/data/profile.xml +++ b/install-dev/fixtures/apple/langs/es/data/profile.xml @@ -1,8 +1,5 @@ - - Administrador - Logistician diff --git a/install-dev/fixtures/apple/langs/fr/data/profile.xml b/install-dev/fixtures/apple/langs/fr/data/profile.xml index b67308e5e..5a143e305 100644 --- a/install-dev/fixtures/apple/langs/fr/data/profile.xml +++ b/install-dev/fixtures/apple/langs/fr/data/profile.xml @@ -1,8 +1,5 @@ - - Administrateur - Logisticien diff --git a/install-dev/fixtures/apple/langs/id/data/profile.xml b/install-dev/fixtures/apple/langs/id/data/profile.xml index 02aa4d76c..04e65582f 100644 --- a/install-dev/fixtures/apple/langs/id/data/profile.xml +++ b/install-dev/fixtures/apple/langs/id/data/profile.xml @@ -1,8 +1,5 @@ - - Administrator - Logistician diff --git a/install-dev/fixtures/apple/langs/it/data/profile.xml b/install-dev/fixtures/apple/langs/it/data/profile.xml index c620bd11f..995942c7a 100644 --- a/install-dev/fixtures/apple/langs/it/data/profile.xml +++ b/install-dev/fixtures/apple/langs/it/data/profile.xml @@ -1,8 +1,5 @@ - - Administrator - Logista diff --git a/install-dev/fixtures/apple/langs/nl/data/profile.xml b/install-dev/fixtures/apple/langs/nl/data/profile.xml index 02aa4d76c..04e65582f 100644 --- a/install-dev/fixtures/apple/langs/nl/data/profile.xml +++ b/install-dev/fixtures/apple/langs/nl/data/profile.xml @@ -1,8 +1,5 @@ - - Administrator - Logistician diff --git a/install-dev/fixtures/apple/langs/pl/data/profile.xml b/install-dev/fixtures/apple/langs/pl/data/profile.xml index 7ace46cf1..26f6ba2d2 100644 --- a/install-dev/fixtures/apple/langs/pl/data/profile.xml +++ b/install-dev/fixtures/apple/langs/pl/data/profile.xml @@ -1,8 +1,5 @@ - - Administrator - Logistyk diff --git a/install-dev/fixtures/apple/langs/ru/data/profile.xml b/install-dev/fixtures/apple/langs/ru/data/profile.xml index 02aa4d76c..04e65582f 100644 --- a/install-dev/fixtures/apple/langs/ru/data/profile.xml +++ b/install-dev/fixtures/apple/langs/ru/data/profile.xml @@ -1,8 +1,5 @@ - - Administrator - Logistician diff --git a/install-dev/fixtures/apple/langs/tw/data/profile.xml b/install-dev/fixtures/apple/langs/tw/data/profile.xml index 02aa4d76c..04e65582f 100644 --- a/install-dev/fixtures/apple/langs/tw/data/profile.xml +++ b/install-dev/fixtures/apple/langs/tw/data/profile.xml @@ -1,8 +1,5 @@ - - Administrator - Logistician diff --git a/modules/dashproducts/dashproducts.php b/modules/dashproducts/dashproducts.php index 3ccb8a294..35551876f 100644 --- a/modules/dashproducts/dashproducts.php +++ b/modules/dashproducts/dashproducts.php @@ -51,26 +51,26 @@ class Dashproducts extends Module { return $this->display(__FILE__, 'dashboard_zone_two.tpl'); } - + public function hookDashboardData($params) { $table_recent_orders = $this->getTableRecentOrders(); $table_best_sellers = $this->getTableBestSellers($params['date_from'], $params['date_to']); $table_most_viewed = $this->getTableMostViewed($params['date_from'], $params['date_to']); $table_top_10_most_search = $this->getTableTop10MostSearch($params['date_from'], $params['date_to']); - $table_top_5_search = $this->getTableTop5Search(); - + //$table_top_5_search = $this->getTableTop5Search(); + return array( 'data_table' => array( 'table_recent_orders' => $table_recent_orders, 'table_best_sellers' => $table_best_sellers, 'table_most_viewed' => $table_most_viewed, 'table_top_10_most_search' => $table_top_10_most_search, - 'table_top_5_search' => $table_top_5_search + //'table_top_5_search' => $table_top_5_search ) ); } - + public function getTableRecentOrders() { $header = array( @@ -80,7 +80,7 @@ class Dashproducts extends Module array('title' => $this->l('Date'), 'class' => 'text-center'), array('title' => $this->l('Action'), 'class' => 'text-center'), ); - + $orders = Order::getOrdersWithInformations(10); $body = array(); @@ -122,10 +122,9 @@ class Dashproducts extends Module } return array('header' => $header, 'body' => $body); } - + public function getTableBestSellers($date_from, $date_to) { - $header = array( array( 'id' => 'image', @@ -158,7 +157,7 @@ class Dashproducts extends Module 'class' => 'text-center', ) ); - + $products = Db::getInstance()->ExecuteS(' SELECT product_id, @@ -174,7 +173,7 @@ class Dashproducts extends Module GROUP BY product_id ORDER BY total DESC LIMIT 10'); - + $body = array(); foreach ($products as $product) { @@ -218,7 +217,7 @@ class Dashproducts extends Module } return array('header' => $header, 'body' => $body); } - + public function getTableMostViewed($date_from, $date_to) { $header = array( @@ -301,7 +300,7 @@ class Dashproducts extends Module return array('header' => $header, 'body' => $body); } - + public function getTableTop10MostSearch($date_from, $date_to) { $header = array( @@ -321,7 +320,7 @@ class Dashproducts extends Module 'class' => 'text-center' ) ); - + $terms = $this->getMostSearchTerms($date_from, $date_to); $body = array(); if (is_array($terms) && count($terms)) @@ -348,7 +347,7 @@ class Dashproducts extends Module return array('header' => $header, 'body' => $body); } - + public function getTableTop5Search() { $header = array( @@ -375,7 +374,7 @@ class Dashproducts extends Module return (int)Db::getInstance(_PS_USE_SQL_SLAVE_)->getValue($sql); } - + public function getTotalProductAddedCart($date_from, $date_to, $id_product) { $sql = 'SELECT count(`id_product`) as count @@ -386,7 +385,7 @@ class Dashproducts extends Module return Db::getInstance(_PS_USE_SQL_SLAVE_)->getValue($sql); } - + public function getTotalProductPurchased($date_from, $date_to, $id_product) { $sql = 'SELECT count(`product_id`) as count @@ -399,7 +398,7 @@ class Dashproducts extends Module return Db::getInstance(_PS_USE_SQL_SLAVE_)->getValue($sql); } - + public function getTotalViewed($date_from, $date_to) { $gapi = Module::isInstalled('gapi') ? Module::getInstanceByName('gapi') : false; @@ -428,7 +427,7 @@ class Dashproducts extends Module AND dr.`time_start` BETWEEN "'.pSQL($date_from).'" AND "'.pSQL($date_to).'" AND dr.`time_end` BETWEEN "'.pSQL($date_from).'" AND "'.pSQL($date_to).'"'); } - + public function getMostSearchTerms($date_from, $date_to, $limit = 10) { return Db::getInstance(_PS_USE_SQL_SLAVE_)->executeS(' diff --git a/modules/dashproducts/views/templates/hook/dashboard_zone_two.tpl b/modules/dashproducts/views/templates/hook/dashboard_zone_two.tpl index d78e3b5ce..f36be59cb 100644 --- a/modules/dashproducts/views/templates/hook/dashboard_zone_two.tpl +++ b/modules/dashproducts/views/templates/hook/dashboard_zone_two.tpl @@ -91,7 +91,7 @@