diff --git a/admin-dev/themes/default/template/controllers/stores/helpers/options/options.tpl b/admin-dev/themes/default/template/controllers/stores/helpers/options/options.tpl index 5fc5f3b05..bac61db89 100644 --- a/admin-dev/themes/default/template/controllers/stores/helpers/options/options.tpl +++ b/admin-dev/themes/default/template/controllers/stores/helpers/options/options.tpl @@ -30,9 +30,9 @@ function ajaxStoreStates(id_state_selected) { $.ajax({ - url: "ajax.php", + url: "index.php", cache: false, - data: "ajaxStates=1&id_country="+$('#PS_SHOP_COUNTRY_ID').val() + "&id_state=" + $('#PS_SHOP_STATE_ID').val(), + data: "ajax=1&tab=AdminStates&token={getAdminToken tab='AdminStates'}&action=states&id_country="+$('#PS_SHOP_COUNTRY_ID').val() + "&id_state=" + $('#PS_SHOP_STATE_ID').val(), success: function(html) { if (html == 'false') diff --git a/admin-dev/themes/default/template/controllers/tax_rules/helpers/form/form.tpl b/admin-dev/themes/default/template/controllers/tax_rules/helpers/form/form.tpl index fd3c1f170..a200c2207 100644 --- a/admin-dev/themes/default/template/controllers/tax_rules/helpers/form/form.tpl +++ b/admin-dev/themes/default/template/controllers/tax_rules/helpers/form/form.tpl @@ -62,7 +62,7 @@ $.ajax({ url: "index.php", cache: false, - data: "ajax=1&tab=AdminTaxRulesGroup&token={getAdminToken tab='AdminTaxRulesGroup'}&action=states&id_country="+id_country+"&id_state="+id_state+"&empty_value={l s='All'}", + data: "ajax=1&tab=AdminStates&token={getAdminToken tab='AdminStates'}&action=states&id_country="+id_country+"&id_state="+id_state+"&empty_value={l s='All'}", success: function(html){ if (html == "false") { diff --git a/admin-dev/themes/default/template/footer.tpl b/admin-dev/themes/default/template/footer.tpl index 66fefae89..5f2212a0d 100644 --- a/admin-dev/themes/default/template/footer.tpl +++ b/admin-dev/themes/default/template/footer.tpl @@ -35,12 +35,12 @@
{if $iso_is_fr} - Questions / Renseignements / Formations : +33 (0)1.40.18.30.04 de 09h à 18h + Questions / Renseignements / Formations : +33 (0)1.40.18.30.04 {/if} - | {l s='Contact'} - | {l s='Bug Tracker'} - | {l s='Forum'} - | {l s='Addons'} + | {l s='Contact'} + | {l s='Bug Tracker'} + | {l s='Forum'} + | {l s='Addons'}
diff --git a/admin-dev/themes/default/template/helpers/form/form.tpl b/admin-dev/themes/default/template/helpers/form/form.tpl index 84424ff6f..ee9ee638a 100644 --- a/admin-dev/themes/default/template/helpers/form/form.tpl +++ b/admin-dev/themes/default/template/helpers/form/form.tpl @@ -455,6 +455,7 @@ }); }); + state_token = '{getAdminToken tab='AdminStates'}'; {block name="script"}{/block} {/if} diff --git a/classes/Autoload.php b/classes/Autoload.php index 11436fda4..585ad858e 100644 --- a/classes/Autoload.php +++ b/classes/Autoload.php @@ -139,7 +139,7 @@ class Autoload $filename_tmp = tempnam(dirname($filename), basename($filename.'.')); if($filename_tmp !== FALSE and file_put_contents($filename_tmp, $content, LOCK_EX) !== FALSE) { - rename($filename_tmp, $filename); + @rename($filename_tmp, $filename); @chmod($filename, 0664); } else diff --git a/classes/Image.php b/classes/Image.php index f2b749bf1..5050f98c9 100644 --- a/classes/Image.php +++ b/classes/Image.php @@ -120,15 +120,19 @@ class ImageCore extends ObjectModel * * @param integer $id_lang Language ID * @param integer $id_product Product ID + * @param integer $id_product_attribute Product Attribute ID * @return array Images */ - public static function getImages($id_lang, $id_product) + public static function getImages($id_lang, $id_product, $id_product_attribute = NULL) { + $attribute_filter = ($id_product_attribute ? ' AND ai.`id_product_attribute` = '.(int)$id_product_attribute : ''); + return Db::getInstance()->executeS(' SELECT * FROM `'._DB_PREFIX_.'image` i LEFT JOIN `'._DB_PREFIX_.'image_lang` il ON (i.`id_image` = il.`id_image`) - WHERE i.`id_product` = '.(int)$id_product.' AND il.`id_lang` = '.(int)$id_lang.' + LEFT JOIN `'._DB_PREFIX_.'product_attribute_image` ai ON (i.`id_image` = ai.`id_image`) + WHERE i.`id_product` = '.(int)$id_product.' AND il.`id_lang` = '.(int)$id_lang . $attribute_filter.' ORDER BY i.`position` ASC'); } diff --git a/classes/Product.php b/classes/Product.php index d46ab18c2..74e65ee20 100644 --- a/classes/Product.php +++ b/classes/Product.php @@ -347,7 +347,7 @@ class ProductCore extends ObjectModel ), 'id_tax_rules_group' => array( 'xlink_resource' => array( - 'resourceName' => 'tax_rules_group' + 'resourceName' => 'tax_rule_groups' ) ), 'position_in_category' => array( diff --git a/classes/cache/CacheApc.php b/classes/cache/CacheApc.php index e32c04ad6..275bc8f4b 100644 --- a/classes/cache/CacheApc.php +++ b/classes/cache/CacheApc.php @@ -34,9 +34,12 @@ class CacheApcCore extends Cache public function __construct() { $this->keys = array(); - $cache_info = apc_cache_info('user'); + $cache_info = apc_cache_info((extension_loaded('apcu') === true )? '' : 'user' ); foreach ($cache_info['cache_list'] as $entry) - $this->keys[$entry['info']] = $entry['ttl']; + if ( extension_loaded('apcu') === true ) + $this->keys[$entry['key']] = $entry['ttl']; + else + $this->keys[$entry['info']] = $entry['ttl']; } /** diff --git a/classes/controller/AdminController.php b/classes/controller/AdminController.php index 409b17273..0508ecaab 100644 --- a/classes/controller/AdminController.php +++ b/classes/controller/AdminController.php @@ -387,7 +387,7 @@ class AdminControllerCore extends Controller $filter = ''; foreach ($this->fields_list AS $field => $t) { - if ($val = htmlspecialchars(Tools::getValue($this->table.'Filter_'.$field), ENT_QUOTES, 'UTF-8')) + if ($val = Tools::getValue($this->table.'Filter_'.$field)) { if(!is_array($val) && !empty($val)) $filter .= ($filter ? ', ' : $this->l(' filter by ')).$t['title'].' : '; @@ -395,13 +395,13 @@ class AdminControllerCore extends Controller if (isset($t['type']) && $t['type'] == 'bool') $filter .= ((bool)$val) ? $this->l('yes') : $this->l('no'); elseif(is_string($val)) - $filter .= $val; + $filter .= htmlspecialchars($val, ENT_QUOTES, 'UTF-8'); elseif(is_array($val)) { $tmp = ''; foreach($val as $v) if(is_string($v) && !empty($v)) - $tmp .= ' - '.$v; + $tmp .= ' - '.htmlspecialchars($v, ENT_QUOTES, 'UTF-8'); if(Tools::strlen($tmp)) { $tmp = ltrim($tmp, ' - '); @@ -1535,6 +1535,16 @@ class AdminControllerCore extends Controller protected function addToolBarModulesListButton() { + + if (!$this->isFresh(Module::CACHE_FILE_DEFAULT_COUNTRY_MODULES_LIST, 86400)) + file_put_contents(_PS_ROOT_DIR_.Module::CACHE_FILE_DEFAULT_COUNTRY_MODULES_LIST, Tools::addonsRequest('native')); + + $country_module_list_xml = simplexml_load_file(_PS_ROOT_DIR_.Module::CACHE_FILE_DEFAULT_COUNTRY_MODULES_LIST); + $country_module_list = array(); + foreach ($country_module_list_xml->module as $k => $m) + $country_module_list[] = (string)$m->name; + $this->tab_modules_list['slider_list'] = array_intersect($this->tab_modules_list['slider_list'], $country_module_list); + if (is_array($this->tab_modules_list['slider_list']) && count($this->tab_modules_list['slider_list'])) $this->toolbar_btn['modules-list'] = array( 'href' => '#', diff --git a/classes/module/Module.php b/classes/module/Module.php index f6b2fd8fd..2c95d60bf 100644 --- a/classes/module/Module.php +++ b/classes/module/Module.php @@ -1726,7 +1726,15 @@ abstract class ModuleCore '.(int)$this->need_instance.''.(isset($this->limited_countries) ? "\n\t".''.(count($this->limited_countries) == 1 ? $this->limited_countries[0] : '').'' : '').' '; if (is_writable(_PS_MODULE_DIR_.$this->name.'/')) - file_put_contents(_PS_MODULE_DIR_.$this->name.'/config.xml', $xml); + { + $file = _PS_MODULE_DIR_.$this->name.'/config.xml'; + if (!@file_put_contents($file, $xml)) + if (!is_writable($file)) + { + @unlink($file); + @file_put_contents($file, $xml); + } + } } /** diff --git a/classes/webservice/WebserviceRequest.php b/classes/webservice/WebserviceRequest.php index 39ca28043..546370998 100644 --- a/classes/webservice/WebserviceRequest.php +++ b/classes/webservice/WebserviceRequest.php @@ -1260,40 +1260,40 @@ class WebserviceRequestCore if (!isset($this->urlFragments['display'])) $this->fieldsToDisplay = 'full'; - // Check if Object is accessible for this/those id_shop - $assoc = Shop::getAssoTable($this->resourceConfiguration['retrieveData']['table']); - if ($assoc !== false) - { - $check_shop_group = false; - - $sql = 'SELECT 1 - FROM `'.bqSQL(_DB_PREFIX_.$this->resourceConfiguration['retrieveData']['table']); - if ($assoc['type'] != 'fk_shop') - $sql .= '_'.$assoc['type']; - else - { - $def = ObjectModel::getDefinition($this->resourceConfiguration['retrieveData']['className']); - if (isset($def['fields']) && isset($def['fields']['id_shop_group'])) - $check_shop_group = true; - } - $sql .= '`'; - - foreach (self::$shopIDs as $id_shop) - $OR[] = ' (id_shop = '.(int)$id_shop.($check_shop_group ? ' OR (id_shop = 0 AND id_shop_group='.(int)Shop::getGroupFromShop((int)$id_shop).')' : '').') '; - - $check = ' WHERE ('.implode('OR', $OR).') AND `'.bqSQL($this->resourceConfiguration['fields']['id']['sqlId']).'` = '.(int)$this->urlSegment[1]; - if (!Db::getInstance()->getValue($sql.$check)) - $this->setError(403, 'Bad id_shop : You are not allowed to access this '.$this->resourceConfiguration['retrieveData']['className'].' ('.(int)$this->urlSegment[1].')', 131); - } - //get entity details $object = new $this->resourceConfiguration['retrieveData']['className']((int)$this->urlSegment[1]); if ($object->id) { $objects[] = $object; - return $objects; + // Check if Object is accessible for this/those id_shop + $assoc = Shop::getAssoTable($this->resourceConfiguration['retrieveData']['table']); + if ($assoc !== false) + { + $check_shop_group = false; + + $sql = 'SELECT 1 + FROM `'.bqSQL(_DB_PREFIX_.$this->resourceConfiguration['retrieveData']['table']); + if ($assoc['type'] != 'fk_shop') + $sql .= '_'.$assoc['type']; + else + { + $def = ObjectModel::getDefinition($this->resourceConfiguration['retrieveData']['className']); + if (isset($def['fields']) && isset($def['fields']['id_shop_group'])) + $check_shop_group = true; + } + $sql .= '`'; + + foreach (self::$shopIDs as $id_shop) + $OR[] = ' (id_shop = '.(int)$id_shop.($check_shop_group ? ' OR (id_shop = 0 AND id_shop_group='.(int)Shop::getGroupFromShop((int)$id_shop).')' : '').') '; + + $check = ' WHERE ('.implode('OR', $OR).') AND `'.bqSQL($this->resourceConfiguration['fields']['id']['sqlId']).'` = '.(int)$this->urlSegment[1]; + if (!Db::getInstance()->getValue($sql.$check)) + $this->setError(404, 'This '.$this->resourceConfiguration['retrieveData']['className'].' ('.(int)$this->urlSegment[1].') does not exists on this shop', 131); + else + return $objects; + } } - elseif (!count($this->errors)) + if (!count($this->errors)) { $this->objOutput->setStatus(404); $this->_outputEnabled = false; diff --git a/controllers/admin/AdminManufacturersController.php b/controllers/admin/AdminManufacturersController.php index 2931ecd96..ebdb2ad1d 100644 --- a/controllers/admin/AdminManufacturersController.php +++ b/controllers/admin/AdminManufacturersController.php @@ -256,7 +256,7 @@ class AdminManufacturersControllerCore extends AdminController 'lang' => true, 'cols' => 60, 'rows' => 10, - 'class' => 'rte', + 'autoload_rte' => 'rte', //Enable TinyMCE editor for short description 'hint' => $this->l('Invalid characters:').' <>;=#{}' ), array( @@ -266,7 +266,7 @@ class AdminManufacturersControllerCore extends AdminController 'lang' => true, 'cols' => 60, 'rows' => 10, - 'class' => 'rte', + 'autoload_rte' => 'rte', //Enable TinyMCE editor for description 'hint' => $this->l('Invalid characters:').' <>;=#{}' ), array( @@ -730,4 +730,4 @@ class AdminManufacturersControllerCore extends AdminController { return true; } -} \ No newline at end of file +} diff --git a/controllers/admin/AdminModulesPositionsController.php b/controllers/admin/AdminModulesPositionsController.php index 72536b180..30d16107b 100644 --- a/controllers/admin/AdminModulesPositionsController.php +++ b/controllers/admin/AdminModulesPositionsController.php @@ -302,14 +302,13 @@ class AdminModulesPositionsControllerCore extends AdminController public function getLiveEditUrl($live_edit_params) { - $lang = ''; + $lang = ''; $admin_dir = dirname($_SERVER['PHP_SELF']); $admin_dir = substr($admin_dir, strrpos($admin_dir, '/') + 1); $dir = str_replace($admin_dir, '', dirname($_SERVER['SCRIPT_NAME'])); if (Configuration::get('PS_REWRITING_SETTINGS') && count(Language::getLanguages(true)) > 1) $lang = Language::getIsoById($this->context->employee->id_lang).'/'; $url = Tools::getCurrentUrlProtocolPrefix().Tools::getHttpHost().$dir.$lang.Dispatcher::getInstance()->createUrl('index', (int)$this->context->language->id, $live_edit_params); - return $url; } diff --git a/controllers/admin/AdminProductsController.php b/controllers/admin/AdminProductsController.php index a78cbff35..b95d88942 100644 --- a/controllers/admin/AdminProductsController.php +++ b/controllers/admin/AdminProductsController.php @@ -863,6 +863,12 @@ class AdminProductsControllerCore extends AdminController { $combination = new Combination((int)$id_product_attribute); $combination->setAttributes(Tools::getValue('attribute_combination_list')); + + // images could be deleted before + $id_images = Tools::getValue('id_image_attr'); + if (!empty($id_images)) + $combination->setImages($id_images); + $product->checkDefaultAttributes(); if (Tools::getValue('attribute_default')) { diff --git a/controllers/admin/AdminStatesController.php b/controllers/admin/AdminStatesController.php index 6b2dc99d0..7c90eceb3 100644 --- a/controllers/admin/AdminStatesController.php +++ b/controllers/admin/AdminStatesController.php @@ -236,6 +236,34 @@ class AdminStatesControllerCore extends AdminController else parent::postProcess(); } -} + protected function displayAjaxStates() + { + if ($this->tabAccess['view'] === '1') + { + $states = Db::getInstance()->executeS(' + SELECT s.id_state, s.name + FROM '._DB_PREFIX_.'state s + LEFT JOIN '._DB_PREFIX_.'country c ON (s.`id_country` = c.`id_country`) + WHERE s.id_country = '.(int)(Tools::getValue('id_country')).' AND s.active = 1 AND c.`contains_states` = 1 + ORDER BY s.`name` ASC'); + if (is_array($states) AND !empty($states)) + { + $list = ''; + if (Tools::getValue('no_empty') != true) + { + $empty_value = (Tools::isSubmit('empty_value')) ? Tools::getValue('empty_value') : '----------'; + $list = ''."\n"; + } + + foreach ($states AS $state) + $list .= ''."\n"; + } + else + $list = 'false'; + + die($list); + } + } +} \ No newline at end of file diff --git a/controllers/admin/AdminSuppliersController.php b/controllers/admin/AdminSuppliersController.php index 22e30efb4..bfe5618a3 100644 --- a/controllers/admin/AdminSuppliersController.php +++ b/controllers/admin/AdminSuppliersController.php @@ -94,7 +94,8 @@ class AdminSuppliersControllerCore extends AdminController 'rows' => 10, 'lang' => true, 'hint' => $this->l('Invalid characters:').' <>;=#{}', - 'desc' => $this->l('Will appear in the supplier list') + 'desc' => $this->l('Will appear in the supplier list'), + 'autoload_rte' => 'rte' //Enable TinyMCE editor for short description ), array( 'type' => 'text', diff --git a/controllers/admin/AdminTaxRulesGroupController.php b/controllers/admin/AdminTaxRulesGroupController.php index 8563d1c63..c36597348 100644 --- a/controllers/admin/AdminTaxRulesGroupController.php +++ b/controllers/admin/AdminTaxRulesGroupController.php @@ -519,35 +519,5 @@ class AdminTaxRulesGroupControllerCore extends AdminController die(Tools::jsonEncode($output)); } } - - protected function displayAjaxStates() - { - if ($this->tabAccess['view'] === '1') - { - $states = Db::getInstance()->executeS(' - SELECT s.id_state, s.name - FROM '._DB_PREFIX_.'state s - LEFT JOIN '._DB_PREFIX_.'country c ON (s.`id_country` = c.`id_country`) - WHERE s.id_country = '.(int)(Tools::getValue('id_country')).' AND s.active = 1 AND c.`contains_states` = 1 - ORDER BY s.`name` ASC'); - - if (is_array($states) AND !empty($states)) - { - $list = ''; - if (Tools::getValue('no_empty') != true) - { - $empty_value = (Tools::isSubmit('empty_value')) ? Tools::getValue('empty_value') : '----------'; - $list = ''."\n"; - } - - foreach ($states AS $state) - $list .= ''."\n"; - } - else - $list = 'false'; - - die($list); - } - } } diff --git a/controllers/front/ManufacturerController.php b/controllers/front/ManufacturerController.php index dbc2f3b2a..4cc8d6b62 100644 --- a/controllers/front/ManufacturerController.php +++ b/controllers/front/ManufacturerController.php @@ -134,4 +134,12 @@ class ManufacturerControllerCore extends FrontController else $this->context->smarty->assign('nbManufacturers', 0); } -} \ No newline at end of file + + /** + * Get instance of current manufacturer + */ + public function getManufacturer() + { + return $this->manufacturer; + } +} diff --git a/install-dev/data/xml/configuration.xml b/install-dev/data/xml/configuration.xml index 62ec8b354..828538b0e 100644 --- a/install-dev/data/xml/configuration.xml +++ b/install-dev/data/xml/configuration.xml @@ -689,7 +689,7 @@ Country 7700 - 1.5.0.9 + 1.5.5.0 m @@ -701,7 +701,7 @@ Country localhost - 1.5.0.9 + 1.5.5.0 PrestaShop diff --git a/install-dev/langs/br/data/tab.xml b/install-dev/langs/br/data/tab.xml index e7a311c62..d0dd5591e 100644 --- a/install-dev/langs/br/data/tab.xml +++ b/install-dev/langs/br/data/tab.xml @@ -74,8 +74,8 @@ - - + + diff --git a/install-dev/langs/de/data/tab.xml b/install-dev/langs/de/data/tab.xml index 77e9e2a2c..237e792eb 100644 --- a/install-dev/langs/de/data/tab.xml +++ b/install-dev/langs/de/data/tab.xml @@ -74,8 +74,8 @@ - - + + diff --git a/install-dev/langs/en/data/tab.xml b/install-dev/langs/en/data/tab.xml index 8a8a26d53..4eaf19c75 100644 --- a/install-dev/langs/en/data/tab.xml +++ b/install-dev/langs/en/data/tab.xml @@ -12,7 +12,7 @@ - + @@ -48,7 +48,7 @@ - + diff --git a/install-dev/langs/es/data/tab.xml b/install-dev/langs/es/data/tab.xml index a6b338ef1..6d0c59194 100644 --- a/install-dev/langs/es/data/tab.xml +++ b/install-dev/langs/es/data/tab.xml @@ -74,8 +74,8 @@ - - + + diff --git a/install-dev/langs/fr/data/tab.xml b/install-dev/langs/fr/data/tab.xml index af30db6ef..db545d6b9 100644 --- a/install-dev/langs/fr/data/tab.xml +++ b/install-dev/langs/fr/data/tab.xml @@ -74,8 +74,8 @@ - - + + diff --git a/install-dev/langs/it/data/tab.xml b/install-dev/langs/it/data/tab.xml index 7680fd02a..d92e19771 100644 --- a/install-dev/langs/it/data/tab.xml +++ b/install-dev/langs/it/data/tab.xml @@ -74,8 +74,8 @@ - - + + diff --git a/install-dev/langs/nl/data/tab.xml b/install-dev/langs/nl/data/tab.xml index a574d957d..ddb0ba5fa 100644 --- a/install-dev/langs/nl/data/tab.xml +++ b/install-dev/langs/nl/data/tab.xml @@ -12,7 +12,7 @@ - + @@ -48,7 +48,7 @@ - + diff --git a/install-dev/langs/pl/data/tab.xml b/install-dev/langs/pl/data/tab.xml index 6e8b4ea69..5594c813a 100644 --- a/install-dev/langs/pl/data/tab.xml +++ b/install-dev/langs/pl/data/tab.xml @@ -74,8 +74,8 @@ - - + + diff --git a/install-dev/langs/ru/data/tab.xml b/install-dev/langs/ru/data/tab.xml index 61a47ddd3..61e2c4856 100644 --- a/install-dev/langs/ru/data/tab.xml +++ b/install-dev/langs/ru/data/tab.xml @@ -74,8 +74,8 @@ - - + + diff --git a/install-dev/upgrade/php/block_category_1521.php b/install-dev/upgrade/php/block_category_1521.php index c6b1846f7..a132475ed 100644 --- a/install-dev/upgrade/php/block_category_1521.php +++ b/install-dev/upgrade/php/block_category_1521.php @@ -31,6 +31,6 @@ function block_category_1521() (`id_configuration` ,`id_shop_group` ,`id_shop` ,`name` ,`value` ,`date_add` ,`date_upd`) VALUES (NULL, NULL, NULL, \'BLOCK_CATEG_MAX_DEPTH\', 4, NOW(), NOW())'); else if ($maxdepth = (int)Db::getInstance()->getValue('SELECT FROM `'._DB_PREFIX_.'configuration` WHERE `value` IS NOT NULL AND `value` <> 0')) - Db::getInstance()->Execute('UPDATE `'._DB_PREFIX_.'configuration` SET `value` = '.($maxdepth + 1).' WHERE `name` LIKE\'BLOCK_CATEG_MAX_DEPTH\''); + Db::getInstance()->Execute('UPDATE `'._DB_PREFIX_.'configuration` SET `value` = '.($maxdepth + 1).' WHERE `name` LIKE \'BLOCK_CATEG_MAX_DEPTH\''); } \ No newline at end of file diff --git a/install-dev/upgrade/php/fix_download_product_feature_active.php b/install-dev/upgrade/php/fix_download_product_feature_active.php index 354b3e5f5..c8ffc103f 100644 --- a/install-dev/upgrade/php/fix_download_product_feature_active.php +++ b/install-dev/upgrade/php/fix_download_product_feature_active.php @@ -27,5 +27,5 @@ function fix_download_product_feature_active() { if (Db::getInstance()->getValue('SELECT COUNT(id_product_download) FROM `'._DB_PREFIX_.'product_download` WHERE `active` = 1 ;') > 0) - Configuration::updateGlobaleValue('PS_VIRTUAL_PROD_FEATURE_ACTIVE'); + Db::getInstance()->execute('UPDATE `'._DB_PREFIX_.'configuration` SET `value` = 1 WHERE `name` LIKE \'PS_VIRTUAL_PROD_FEATURE_ACTIVE\''); } \ No newline at end of file diff --git a/js/form.js b/js/form.js index a8c1c5738..c1432c34e 100644 --- a/js/form.js +++ b/js/form.js @@ -26,9 +26,9 @@ function ajaxStates (id_state_selected) { $.ajax({ - url: "ajax.php", + url: "index.php", cache: false, - data: "ajaxStates=1&no_empty=1&id_country="+$('#id_country').val() + "&id_state=" + $('#id_state').val(), + data: "token="+state_token+"&ajax=1&action=states&tab=AdminStates&no_empty=1&id_country="+$('#id_country').val() + "&id_state=" + $('#id_state').val(), success: function(html) { if (html == 'false') @@ -59,4 +59,4 @@ function ajaxStates (id_state_selected) } }); } -} \ No newline at end of file +} diff --git a/modules/blockcart/ajax-cart.js b/modules/blockcart/ajax-cart.js index b0de33fd0..97448ffef 100644 --- a/modules/blockcart/ajax-cart.js +++ b/modules/blockcart/ajax-cart.js @@ -214,26 +214,46 @@ var ajaxCart = { $element = $('#bigpic'); var $picture = $element.clone(); var pictureOffsetOriginal = $element.offset(); + pictureOffsetOriginal.right = $(window).innerWidth() - pictureOffsetOriginal.left - $element.width(); - if ($picture.size()) - $picture.css({'position': 'absolute', 'top': pictureOffsetOriginal.top, 'left': pictureOffsetOriginal.left}); + if ($picture.length) + { + $picture.css({ + position: 'absolute', + top: pictureOffsetOriginal.top, + right: pictureOffsetOriginal.right + }); + } var pictureOffset = $picture.offset(); - if ($('#cart_block')[0] && $('#cart_block').offset().top && $('#cart_block').offset().left) - var cartBlockOffset = $('#cart_block').offset(); - else - var cartBlockOffset = $('#shopping_cart').offset(); + var cartBlock = $('#cart_block'); + if (!$('#cart_block')[0] || !$('#cart_block').offset().top || !$('#cart_block').offset().left) + cartBlock = $('#shopping_cart'); + var cartBlockOffset = cartBlock.offset(); + cartBlockOffset.right = $(window).innerWidth() - cartBlockOffset.left - cartBlock.width(); // Check if the block cart is activated for the animation - if (cartBlockOffset != undefined && $picture.size()) + if (cartBlockOffset != undefined && $picture.length) { $picture.appendTo('body'); - $picture.css({ 'position': 'absolute', 'top': $picture.css('top'), 'left': $picture.css('left'), 'z-index': 4242 }) - .animate({ 'width': $element.attr('width')*0.66, 'height': $element.attr('height')*0.66, 'opacity': 0.2, 'top': cartBlockOffset.top + 30, 'left': cartBlockOffset.left + 15 }, 1000) - .fadeOut(100, function() { - ajaxCart.updateCartInformation(jsonData, addedFromProductPage); - $(this).remove(); - }); + $picture + .css({ + position: 'absolute', + top: pictureOffsetOriginal.top, + right: pictureOffsetOriginal.right, + zIndex: 4242 + }) + .animate({ + width: $element.attr('width')*0.66, + height: $element.attr('height')*0.66, + opacity: 0.2, + top: cartBlockOffset.top + 30, + right: cartBlockOffset.right + 15 + }, 1000) + .fadeOut(100, function() { + ajaxCart.updateCartInformation(jsonData, addedFromProductPage); + $(this).remove(); + }); } else ajaxCart.updateCartInformation(jsonData, addedFromProductPage); diff --git a/modules/blocknewproducts/blocknewproducts.php b/modules/blocknewproducts/blocknewproducts.php index d5ca90eda..ae04a77ee 100644 --- a/modules/blocknewproducts/blocknewproducts.php +++ b/modules/blocknewproducts/blocknewproducts.php @@ -111,7 +111,10 @@ class BlockNewProducts extends Module { if (!$this->isCached('blocknewproducts.tpl', $this->getCacheId())) { - if (!Configuration::get('PS_BLOCK_NEWPRODUCTS_DISPLAY') && !($newProducts = Product::getNewProducts((int)$params['cookie']->id_lang, 0, (int)Configuration::get('NEW_PRODUCTS_NBR')))) + if (!Configuration::get('PS_BLOCK_NEWPRODUCTS_DISPLAY')) + return; + $newProducts = Product::getNewProducts((int) $params['cookie']->id_lang, 0, (int) Configuration::get('NEW_PRODUCTS_NBR')); + if (!$newProducts) return; $this->smarty->assign(array( @@ -151,4 +154,4 @@ class BlockNewProducts extends Module { $this->_clearCache('blocknewproducts.tpl'); } -} \ No newline at end of file +} diff --git a/modules/blocktopmenu/blocktopmenu.php b/modules/blocktopmenu/blocktopmenu.php index 724ea4da3..a5eb3b3c5 100644 --- a/modules/blocktopmenu/blocktopmenu.php +++ b/modules/blocktopmenu/blocktopmenu.php @@ -221,6 +221,8 @@ class Blocktopmenu extends Module // BEGIN SUPPLIER $this->_html .= ''; + // Option to show all Suppliers + $this->_html .= ''; $suppliers = Supplier::getSuppliers(false, $id_lang); foreach ($suppliers as $supplier) $this->_html .= ''; @@ -228,6 +230,8 @@ class Blocktopmenu extends Module // BEGIN Manufacturer $this->_html .= ''; + // Option to show all Manufacturers + $this->_html .= ''; $manufacturers = Manufacturer::getManufacturers(false, $id_lang); foreach ($manufacturers as $manufacturer) $this->_html .= ''; @@ -472,12 +476,22 @@ class Blocktopmenu extends Module $this->_html .= ''.PHP_EOL; break; + // Case to handle the option to show all Manufacturers + case 'ALLMAN': + $this->_html .= ''.PHP_EOL; + break; + case 'MAN': $manufacturer = new Manufacturer((int)$id, (int)$id_lang); if (Validate::isLoadedObject($manufacturer)) $this->_html .= ''.PHP_EOL; break; + // Case to handle the option to show all Suppliers + case 'ALLSUP': + $this->_html .= ''.PHP_EOL; + break; + case 'SUP': $supplier = new Supplier((int)$id, (int)$id_lang); if (Validate::isLoadedObject($supplier)) @@ -549,6 +563,16 @@ class Blocktopmenu extends Module } break; + // Case to handle the option to show all Manufacturers + case 'ALLMAN': + $link = new Link; + $this->_menu .= '
  • '.$this->l('All manufacturers').'
      '.PHP_EOL; + $manufacturers = Manufacturer::getManufacturers(); + foreach ($manufacturers as $key => $manufacturer) + $this->_menu .= '
    • '.$manufacturer['name'].'
    • '.PHP_EOL; + $this->_menu .= '
    '; + break; + case 'MAN': $selected = ($this->page_name == 'manufacturer' && (Tools::getValue('id_manufacturer') == $id)) ? ' class="sfHover"' : ''; $manufacturer = new Manufacturer((int)$id, (int)$id_lang); @@ -563,6 +587,16 @@ class Blocktopmenu extends Module } break; + // Case to handle the option to show all Suppliers + case 'ALLSUP': + $link = new Link; + $this->_menu .= '
  • '.$this->l('All suppliers').'
      '.PHP_EOL; + $suppliers = Supplier::getSuppliers(); + foreach ($suppliers as $key => $supplier) + $this->_menu .= '
    • '.$supplier['name'].'
    • '.PHP_EOL; + $this->_menu .= '
    '; + break; + case 'SUP': $selected = ($this->page_name == 'supplier' && (Tools::getValue('id_supplier') == $id)) ? ' class="sfHover"' : ''; $supplier = new Supplier((int)$id, (int)$id_lang); @@ -896,4 +930,4 @@ class Blocktopmenu extends Module } -} \ No newline at end of file +} diff --git a/modules/shopimporter/shopimporter.php b/modules/shopimporter/shopimporter.php index 00f07a70a..1383d09da 100644 --- a/modules/shopimporter/shopimporter.php +++ b/modules/shopimporter/shopimporter.php @@ -434,7 +434,7 @@ class shopimporter extends ImportModule if ((sizeof($rules['requiredLang']) || sizeof($rules['sizeLang']) || sizeof($rules['validateLang']) || Tools::isSubmit('syncLang') || Tools::isSubmit('syncCurrency'))) { $moduleName = Tools::getValue('moduleName'); - if (Validate::isModuleName($moduleName) && Validate::file_exists('../../modules/'.$moduleName.'/'.$moduleName.'.php')) + if (Validate::isModuleName($moduleName) && file_exists('../../modules/'.$moduleName.'/'.$moduleName.'.php')) { require_once('../../modules/'.$moduleName.'/'.$moduleName.'.php'); $importModule = new $moduleName(); diff --git a/translations/br.gzip b/translations/br.gzip index f1dee49a1..8c1772ee4 100644 Binary files a/translations/br.gzip and b/translations/br.gzip differ diff --git a/translations/de.gzip b/translations/de.gzip index 0ba30b609..bafdfd1b9 100644 Binary files a/translations/de.gzip and b/translations/de.gzip differ diff --git a/translations/en.gzip b/translations/en.gzip index d4c0f9654..a43fe55a1 100644 Binary files a/translations/en.gzip and b/translations/en.gzip differ diff --git a/translations/es.gzip b/translations/es.gzip index 4aa6cb88a..1dffffe1c 100644 Binary files a/translations/es.gzip and b/translations/es.gzip differ diff --git a/translations/fr.gzip b/translations/fr.gzip index f2f864c50..733390e04 100644 Binary files a/translations/fr.gzip and b/translations/fr.gzip differ diff --git a/translations/it.gzip b/translations/it.gzip index bac0effcf..96285a813 100644 Binary files a/translations/it.gzip and b/translations/it.gzip differ diff --git a/translations/nl.gzip b/translations/nl.gzip index 686fc298e..bb17d5865 100644 Binary files a/translations/nl.gzip and b/translations/nl.gzip differ diff --git a/translations/pl.gzip b/translations/pl.gzip index 7792315b0..f38d6f128 100644 Binary files a/translations/pl.gzip and b/translations/pl.gzip differ diff --git a/translations/ru.gzip b/translations/ru.gzip index 5ceb1636b..1af1cb113 100644 Binary files a/translations/ru.gzip and b/translations/ru.gzip differ