diff --git a/admin-dev/tabs/AdminGenerator.php b/admin-dev/tabs/AdminGenerator.php index c04956669..e018e2c1b 100644 --- a/admin-dev/tabs/AdminGenerator.php +++ b/admin-dev/tabs/AdminGenerator.php @@ -179,7 +179,7 @@ class AdminGenerator extends AdminTab $tab = array(); // Directories - $tab['Directories'] = array('classes/', 'config/', 'download/', 'mails/', 'modules/', 'translations/', 'tools/', 'lang-'.Language::getIsoById(Configuration::get('PS_LANG_DEFAULT')).'/'); + $tab['Directories'] = array('classes/', 'config/', 'download/', 'mails/', 'modules/', 'translations/', 'tools/', Language::getIsoById(Configuration::get('PS_LANG_DEFAULT')).'/'); // Files $tab['Files'] = array('addresses.php', 'address.php', 'authentication.php', 'cart.php', 'discount.php', 'footer.php', diff --git a/admin-dev/tabs/AdminGroups.php b/admin-dev/tabs/AdminGroups.php index ba1e6c41c..70b27773e 100644 --- a/admin-dev/tabs/AdminGroups.php +++ b/admin-dev/tabs/AdminGroups.php @@ -147,6 +147,7 @@ class AdminGroups extends AdminTab foreach ($categories AS $category) echo ' '; echo ' * +

'.$this->l('Only products that have this category as default category will be affected').'.

@@ -334,6 +335,7 @@ class AdminGroups extends AdminTab $id_group_reductions = Tools::getValue('gr_id_group_reduction'); $reductions = Tools::getValue('gr_reduction'); if ($id_group_reductions) + { foreach ($id_group_reductions AS $key => $id_group_reduction) if (!Validate::isUnsignedId($id_group_reductions[$key]) OR !Validate::isPrice($reductions[$key])) $this->_errors[] = Tools::displayError(); @@ -344,6 +346,7 @@ class AdminGroups extends AdminTab if (!$groupReduction->update()) $this->_errors[] = Tools::displayError('Cannot update group reductions'); } + } if (!sizeof($this->_errors)) parent::postProcess(); } diff --git a/admin-dev/tabs/AdminLanguages.php b/admin-dev/tabs/AdminLanguages.php index cabfd348d..8abe35e0e 100644 --- a/admin-dev/tabs/AdminLanguages.php +++ b/admin-dev/tabs/AdminLanguages.php @@ -93,7 +93,6 @@ class AdminLanguages extends AdminTab } unlink($tmpName); } - } /** @@ -122,6 +121,13 @@ class AdminLanguages extends AdminTab return !sizeof($this->_errors) ? true : false; } + protected function copyFromPost(&$object, $table) + { + if($object->id AND ($object->iso_code != $_POST['iso_code'])) + if(Validate::isLanguageIsoCode($_POST['iso_code'])) + $object->moveToIso($_POST['iso_code']); + parent::copyFromPost($object, $table); + } public function postProcess() { diff --git a/classes/Group.php b/classes/Group.php index 5887ace1a..033a70d69 100644 --- a/classes/Group.php +++ b/classes/Group.php @@ -160,6 +160,8 @@ class GroupCore extends ObjectModel { Db::getInstance()->Execute('DELETE FROM `'._DB_PREFIX_.'customer_group` WHERE `id_group` = '.(int)($this->id)); Db::getInstance()->Execute('DELETE FROM `'._DB_PREFIX_.'category_group` WHERE `id_group` = '.(int)($this->id)); + Db::getInstance()->Execute('DELETE FROM `'._DB_PREFIX_.'group_reduction` WHERE `id_group` = '.(int)($this->id)); + Db::getInstance()->Execute('DELETE FROM `'._DB_PREFIX_.'product_group_reduction_cache` WHERE `id_group` = '.(int)($this->id)); Discount::deleteByIdGroup((int)($this->id)); return true; } diff --git a/classes/GroupReduction.php b/classes/GroupReduction.php index d8b5e6bb2..8da11f4e2 100644 --- a/classes/GroupReduction.php +++ b/classes/GroupReduction.php @@ -61,10 +61,9 @@ class GroupReductionCore extends ObjectModel public function delete() { $resource = Db::getInstance(_PS_USE_SQL_SLAVE_)->ExecuteS(' - SELECT cp.`id_product` - FROM `'._DB_PREFIX_.'category_product` cp - INNER JOIN `'._DB_PREFIX_.'product` p ON (p.`id_product` = cp.`id_product`) - WHERE cp.`id_category` = '.(int)($this->id_category) + SELECT p.`id_product` + FROM `'._DB_PREFIX_.'product` p + WHERE p.`id_category_default` = '.(int)($this->id_category) , false); while ($row = Db::getInstance()->nextRow($resource)) @@ -73,7 +72,7 @@ class GroupReductionCore extends ObjectModel if (Db::getInstance()->Execute($query) === false) return false; } - return ($this->_clearCache() AND parent::delete()); + return (parent::delete()); } protected function _clearCache() @@ -84,10 +83,9 @@ class GroupReductionCore extends ObjectModel protected function _setCache() { $resource = Db::getInstance(_PS_USE_SQL_SLAVE_)->ExecuteS(' - SELECT cp.`id_product` - FROM `'._DB_PREFIX_.'category_product` cp - INNER JOIN `'._DB_PREFIX_.'product` p ON (p.`id_product` = cp.`id_product`) - WHERE cp.`id_category` = '.(int)($this->id_category) + SELECT p.`id_product` + FROM `'._DB_PREFIX_.'product` p + WHERE p.`id_category_default` = '.(int)($this->id_category) , false); $query = 'INSERT INTO `'._DB_PREFIX_.'product_group_reduction_cache` (`id_product`, `id_group`, `reduction`) VALUES '; @@ -106,15 +104,16 @@ class GroupReductionCore extends ObjectModel protected function _updateCache() { $resource = Db::getInstance(_PS_USE_SQL_SLAVE_)->ExecuteS(' - SELECT cp.`id_product` - FROM `'._DB_PREFIX_.'category_product` cp - INNER JOIN `'._DB_PREFIX_.'product` p ON (p.`id_product` = cp.`id_product`) - WHERE cp.`id_category` = '.(int)($this->id_category) + SELECT p.`id_product` + FROM `'._DB_PREFIX_.'product` p + WHERE p.`id_category_default` = '.(int)($this->id_category) , false); while ($row = Db::getInstance()->nextRow($resource)) { - $query = 'UPDATE `'._DB_PREFIX_.'product_group_reduction_cache` SET `reduction` = '.(float)($this->reduction).' WHERE `id_product` = '.(int)($row['id_product']).' AND `id_group` = '.(int)($this->id_group); + $query = 'UPDATE `'._DB_PREFIX_.'product_group_reduction_cache` + SET `reduction` = '.(float)($this->reduction).' + WHERE `id_product` = '.(int)($row['id_product']).' AND `id_group` = '.(int)($this->id_group); if (Db::getInstance()->Execute($query) === false) return false; } @@ -134,13 +133,17 @@ class GroupReductionCore extends ObjectModel public static function getValueForProduct($id_product, $id_group) { if (!isset(self::$reductionCache[$id_product.'-'.$id_group])) - self::$reductionCache[$id_product.'-'.$id_group] = Db::getInstance()->getValue('SELECT `reduction` FROM `'._DB_PREFIX_.'product_group_reduction_cache` WHERE `id_product` = '.(int)($id_product).' AND `id_group` = '.(int)($id_group)); + self::$reductionCache[$id_product.'-'.$id_group] = Db::getInstance()->getValue('SELECT `reduction` + FROM `'._DB_PREFIX_.'product_group_reduction_cache` + WHERE `id_product` = '.(int)($id_product).' AND `id_group` = '.(int)($id_group)); return self::$reductionCache[$id_product.'-'.$id_group]; } public static function doesExist($id_group, $id_category) { - return (bool)Db::getInstance(_PS_USE_SQL_SLAVE_)->getValue('SELECT `id_group` FROM `'._DB_PREFIX_.'group_reduction` WHERE `id_group` = '.(int)($id_group).' AND `id_category` = '.(int)($id_category)); + return (bool)Db::getInstance(_PS_USE_SQL_SLAVE_)->getValue('SELECT `id_group` + FROM `'._DB_PREFIX_.'group_reduction` + WHERE `id_group` = '.(int)($id_group).' AND `id_category` = '.(int)($id_category)); } public function getGroupByCategoryId($id_category) @@ -170,12 +173,13 @@ class GroupReductionCore extends ObjectModel ); if (Db::getInstance()->NumRows() == 0) - { - $query = 'INSERT INTO `'._DB_PREFIX_.'product_group_reduction_cache` (`id_product`, `id_group`, `reduction`) VALUES '; - $query .= '('.(int)($id_product).', '.(int)($id_group).', '.(float)($reduction).')'; - } + $query = 'INSERT INTO `'._DB_PREFIX_.'product_group_reduction_cache` (`id_product`, `id_group`, `reduction`) + VALUES ('.(int)($id_product).', '.(int)($id_group).', '.(float)($reduction).')'; else - $query = 'UPDATE `'._DB_PREFIX_.'product_group_reduction_cache` SET `reduction` = '.(float)($reduction).' WHERE `id_product` = '.(int)($id_product).' AND `id_group` = '.(int)($id_group); + $query = 'UPDATE `'._DB_PREFIX_.'product_group_reduction_cache` + SET `reduction` = '.(float)($reduction).' + WHERE `id_product` = '.(int)($id_product).' AND `id_group` = '.(int)($id_group); + return (Db::getInstance()->Execute($query)); } @@ -209,6 +213,4 @@ class GroupReductionCore extends ObjectModel return false; return true; } -} - - +} \ No newline at end of file diff --git a/classes/Language.php b/classes/Language.php index 2ee600125..4f97b137a 100644 --- a/classes/Language.php +++ b/classes/Language.php @@ -61,6 +61,13 @@ class LanguageCore extends ObjectModel 'objectsNodeName' => 'languages', ); + protected $translationsFilesAndVars = array( + 'fields' => '_FIELDS', + 'errors' => '_ERRORS', + 'admin' => '_LANGADM', + 'pdf' => '_LANGPDF', + ); + public function __construct($id = NULL, $id_lang = NULL) { parent::__construct($id); @@ -79,25 +86,53 @@ class LanguageCore extends ObjectModel return $fields; } + /** + * Generate traslations files + * + */ + private function _generateFiles($newIso){ + $iso_code = $newIso?$newIso:$this->iso_code; + + if (!file_exists(_PS_TRANSLATIONS_DIR_.$iso_code)) + mkdir(_PS_TRANSLATIONS_DIR_.$iso_code); + foreach ($this->translationsFilesAndVars as $file => $var) + if (!file_exists(_PS_TRANSLATIONS_DIR_.$iso_code.'/'.$file.'.php')) + file_put_contents(_PS_TRANSLATIONS_DIR_.$iso_code.'/'.$file.'.php', ''); + } + + /** + * Move translations files after editiing language iso code + */ + public function moveToIso($newIso) + { + if($newIso == $this->iso_code) + return true; + + if (file_exists(_PS_TRANSLATIONS_DIR_.$this->iso_code)) + rename(_PS_TRANSLATIONS_DIR_.$this->iso_code, _PS_TRANSLATIONS_DIR_.$newIso); + + if (file_exists(_PS_MAIL_DIR_.$this->iso_code)) + rename(_PS_MAIL_DIR_.$this->iso_code, _PS_MAIL_DIR_.$newIso); + + foreach (Module::getModulesDirOnDisk() as $moduleDir) { + if (file_exists(_PS_MODULE_DIR_.$moduleDir.'/mails/'.$this->iso_code)) + rename(_PS_MODULE_DIR_.$moduleDir.'/mails/'.$this->iso_code, _PS_MODULE_DIR_.$moduleDir.'/mails/'.$newIso); + + if (file_exists(_PS_MODULE_DIR_.$moduleDir.'/'.$this->iso_code.'.php')) + rename(_PS_MODULE_DIR_.$moduleDir.'/'.$this->iso_code.'.php', _PS_MODULE_DIR_.$moduleDir.'/'.$newIso.'.php'); + } + } + public function add($autodate = true, $nullValues = false) { if (!parent::add($autodate)) return false; - $translationsFiles = array( - 'fields' => '_FIELDS', - 'errors' => '_ERRORS', - 'admin' => '_LANGADM', - 'pdf' => '_LANGPDF', - ); - if (!file_exists(_PS_TRANSLATIONS_DIR_.$this->iso_code)) - mkdir(_PS_TRANSLATIONS_DIR_.$this->iso_code); - foreach ($translationsFiles as $file => $var) - if (!file_exists(_PS_TRANSLATIONS_DIR_.$this->iso_code.'/'.$file.'.php')) - file_put_contents(_PS_TRANSLATIONS_DIR_.$this->iso_code.'/'.$file.'.php', ''); + // create empty files if they not exists + $this->_generateFiles(); $resUpdateSQL = $this->loadUpdateSQL(); // If url_rewrite is not enabled, we don't need to regenerate .htaccess @@ -565,6 +600,8 @@ class LanguageCore extends ObjectModel public function update($nullValues = false) { + + if (!parent::update($nullValues)) return false; diff --git a/classes/LocalizationPack.php b/classes/LocalizationPack.php index c5ae9506b..a7c78d92f 100644 --- a/classes/LocalizationPack.php +++ b/classes/LocalizationPack.php @@ -347,7 +347,7 @@ class LocalizationPackCore { if ($lang_pack = Tools::jsonDecode(Tools::file_get_contents('http://www.prestashop.com/download/lang_packs/get_language_pack.php?version='._PS_VERSION_.'&iso_lang='.$attributes['iso_code']))) { - if ($content = file_get_contents('http://www.prestashop.com/download/lang_packs/gzip/'.$lang_pack->version.'/'.$attributes['iso_code'].'.gzip')) + if ($content = Tools::file_get_contents('http://www.prestashop.com/download/lang_packs/gzip/'.$lang_pack->version.'/'.$attributes['iso_code'].'.gzip')) { $file = _PS_TRANSLATIONS_DIR_.$attributes['iso_code'].'.gzip'; if (file_put_contents($file, $content)) diff --git a/classes/PaymentModule.php b/classes/PaymentModule.php index 87d01a417..7f0d58a73 100644 --- a/classes/PaymentModule.php +++ b/classes/PaymentModule.php @@ -296,7 +296,7 @@ abstract class PaymentModuleCore extends Module $shrunk = false; foreach ($discounts AS $discount) { - $objDiscount = new Discount((int)$discount['id_discount'], $order->id_lang); + $objDiscount = new Discount((int)$discount['id_discount']); $value = $objDiscount->getValue(sizeof($discounts), $cart->getOrderTotal(true, Cart::ONLY_PRODUCTS), $order->total_shipping, $cart->id); if ($objDiscount->id_discount_type == 2 AND in_array($objDiscount->behavior_not_exhausted, array(1,2))) $shrunk = true; @@ -314,6 +314,9 @@ abstract class PaymentModuleCore extends Module $voucher->add(); $params['{voucher_amount}'] = Tools::displayPrice($voucher->value, $currency, false); $params['{voucher_num}'] = $voucher->name; + $params['{firstname}'] = $customer->firstname; + $params['{lastname}'] = $customer->lastname; + $params['{id_order}'] = $order->id; @Mail::Send((int)$order->id_lang, 'voucher', Mail::l('New voucher regarding your order #').$order->id, $params, $customer->email, $customer->firstname.' '.$customer->lastname); } } diff --git a/classes/Product.php b/classes/Product.php index 1c50e13c2..3f37e41ed 100644 --- a/classes/Product.php +++ b/classes/Product.php @@ -686,7 +686,7 @@ class ProductCore extends ObjectModel if (!$this->addToCategories($categories)) return false; - if (!$this->setGroupReduction($categories)) + if (!$this->setGroupReduction()) return false; return true; @@ -3427,26 +3427,17 @@ class ProductCore extends ObjectModel /** * Set Group reduction if needed - * @param string $productCategories Categories the product belongs to */ - public function setGroupReduction($categories) + public function setGroupReduction() { - if (sizeof($categories) > 1) // Use category_default id if more than 1 category - $row = GroupReduction::getGroupByCategoryId((int)$this->id_category_default); - else - $row = GroupReduction::getGroupByCategoryId((int)array_pop($categories)); - - if (!$row) + $row = GroupReduction::getGroupByCategoryId($this->id_category_default); + if (!$row) // Remove { - // Then Remove if (!GroupReduction::deleteProductReduction($this->id)) return false; } - else - { - if (!GroupReduction::setProductReduction($this->id, $row['id_group'], $category, $row['reduction'])) // Add or Edit + else if (!GroupReduction::setProductReduction($this->id, $row['id_group'], $this->id_category_default, (float)$row['reduction'])) return false; - } return true; } } diff --git a/install-dev/img/bg_field.png b/install-dev/img/bg_field.png new file mode 100644 index 000000000..e1f4ecc10 Binary files /dev/null and b/install-dev/img/bg_field.png differ diff --git a/install-dev/img/bg_li_stepList.png b/install-dev/img/bg_li_stepList.png index c0efe40a8..98615f41d 100755 Binary files a/install-dev/img/bg_li_stepList.png and b/install-dev/img/bg_li_stepList.png differ diff --git a/install-dev/index.php b/install-dev/index.php index 37d58979c..aeb8f4440 100644 --- a/install-dev/index.php +++ b/install-dev/index.php @@ -433,13 +433,13 @@ if ($lm->getIncludeTradFilename())

@@ -802,7 +802,7 @@ if ($lm->getIncludeTradFilename()) echo ' -
+ @@ -1214,13 +1214,13 @@ if ($lm->getIncludeTradFilename())

  • -
  • +
  • -
  • /config
  • +
  • /config
  • /tools/smarty/compile
  • /tools/smarty/cache
  • /tools/smarty_v2/compile
  • @@ -1228,7 +1228,7 @@ if ($lm->getIncludeTradFilename())
  • /sitemap.xml
  • /log
  • -
  • /img
  • +
  • /img
  • /mails
  • /modules
  • /themes/prestashop/lang
  • diff --git a/install-dev/view.css b/install-dev/view.css index c015fdd8e..53df865f1 100644 --- a/install-dev/view.css +++ b/install-dev/view.css @@ -203,7 +203,7 @@ select { div.field { padding:10px 0; - border-bottom:1px solid #ccc; + background:url(img/bg_field.png) repeat-x 0 100% transparent; } div.field label { display:inline-block; @@ -220,10 +220,13 @@ div.field { display:inline-block; width:200px; font-size:11px; + font-family:Georgia; font-style:italic; color:#999; } +#uploadedImage {border:1px solid #ccc;} + .okBlock { padding:20px 20px 20px 38px; background:#b7e2a7 url(img/pict_ok.png) no-repeat 15px 21px; @@ -376,11 +379,13 @@ ul#footer a:link, ul#footer a:active, ul#footer a:visited { } .sheet .contentTitle .stepList li { float:left; + margin:0 0 0 5px; height:42px; width:42px; text-indent:-5000px; background:transparent url(img/bg_li_stepList.png) no-repeat 0 0; } + .sheet .contentTitle .stepList li.ok {background-position:0 -50px;} .sheet .contentTitle .stepList li.ko {background-position:0 -100px;} .sheet .contentTitle h1 {text-shadow:0 1px 0 #fff;} @@ -409,16 +414,21 @@ ul#langList {list-style-type:none;} }*/ ul#required, -ul#optional {list-style-type:none;} +ul#optional { + list-style-type: none; + margin: 0; +} ul#required li, ul#optional li { padding:6px 8px 4px 8px; + font-size:12px; background:#f8f8f8; } ul#required li.title, ul#optional li.title { margin-top: 20px; padding:4px 8px; + font-size:13px; background:#f8f8f8 url(img/bg_li_title.png) repeat-x 0 0; } ul#required li.required , @@ -428,11 +438,11 @@ ul#optional {list-style-type:none;} } ul#required li.ok, ul#optional li.ok{ - background:#f8f8f8 url(img/pict_ok.png) no-repeat 100% 10px; + background:#f8f8f8 url(img/pict_ok.png) no-repeat 99% 10px } ul#required li.fail, ul#optional li.fail { - background:#f8f8f8 url(img/pict_error.png) no-repeat 100% 8px; + background:#f8f8f8 url(img/pict_error.png) no-repeat 99% 8px; } /* ETAPE 3 - DB ************************************************************* */ @@ -443,15 +453,22 @@ ul#optional {list-style-type:none;} #formCheckSQL p, #mailSMTPParam p { - /* - USELESS padding:10px 0; - border-top:1px solid #fff; - border-bottom:1px solid #ccc;*/ + background:url(img/bg_field.png) repeat-x 0 100% transparent; } #formCheckSQL p.first {border-top:none;} #formCheckSQL p.last {border-bottom:none;} -/*USELESS #formCheckSQL p#dbResultCheck {border:none;}*/ +#formCheckSQL p#dbResultCheck {background:none;} +#formCheckSQL p#dbResultCheck.errorBlock { + background: url("img/pict_error.png") no-repeat scroll 15px 21px #FFEBE8; + border: 1px solid #CC0000; + padding: 20px 20px 20px 38px; +} +#formCheckSQL p#dbResultCheck.okBlock { + padding:20px 20px 20px 38px; + background:#b7e2a7 url(img/pict_ok.png) no-repeat 15px 21px; + border:1px solid #85c10c; +} #formCheckSQL p label, #mailSMTPParam p label { display:inline-block; @@ -477,7 +494,7 @@ ul#optional {list-style-type:none;} #mailPart .userInfos { padding-left:18px; - font: 11px Georgia, Arial, Sans-serif italic; + font:italic 11px Georgia, Arial, Sans-serif italic; color:#999; } @@ -509,7 +526,6 @@ ul#optional {list-style-type:none;} .moduleTable { padding: 5px; width: 650px; - background:#fff; border: 1px solid #CCC; border-bottom:none; } diff --git a/modules/authorizeaim/authorizeaim.php b/modules/authorizeaim/authorizeaim.php index abc43ae39..d042fc378 100755 --- a/modules/authorizeaim/authorizeaim.php +++ b/modules/authorizeaim/authorizeaim.php @@ -25,7 +25,7 @@ * International Registered Trademark & Property of PrestaShop SA */ -if (!defined('_CAN_LOAD_FILES_')) +if (!defined('_PS_VERSION_')) exit; class authorizeAIM extends PaymentModule diff --git a/modules/bankwire/bankwire.php b/modules/bankwire/bankwire.php index f59d800a3..99d36be89 100644 --- a/modules/bankwire/bankwire.php +++ b/modules/bankwire/bankwire.php @@ -25,7 +25,7 @@ * International Registered Trademark & Property of PrestaShop SA */ -if (!defined('_CAN_LOAD_FILES_')) +if (!defined('_PS_VERSION_')) exit; class BankWire extends PaymentModule diff --git a/modules/birthdaypresent/birthdaypresent.php b/modules/birthdaypresent/birthdaypresent.php index 3789eeab7..2988da372 100644 --- a/modules/birthdaypresent/birthdaypresent.php +++ b/modules/birthdaypresent/birthdaypresent.php @@ -25,7 +25,7 @@ * International Registered Trademark & Property of PrestaShop SA */ -if (!defined('_CAN_LOAD_FILES_')) +if (!defined('_PS_VERSION_')) exit; class BirthdayPresent extends Module diff --git a/modules/blockadvertising/blockadvertising.php b/modules/blockadvertising/blockadvertising.php index 83e015595..08c47ee08 100644 --- a/modules/blockadvertising/blockadvertising.php +++ b/modules/blockadvertising/blockadvertising.php @@ -25,7 +25,7 @@ * International Registered Trademark & Property of PrestaShop SA */ -if (!defined('_CAN_LOAD_FILES_')) +if (!defined('_PS_VERSION_')) exit; class BlockAdvertising extends Module diff --git a/modules/blockbestsellers/blockbestsellers.php b/modules/blockbestsellers/blockbestsellers.php index 8db005a4a..979ac15bd 100644 --- a/modules/blockbestsellers/blockbestsellers.php +++ b/modules/blockbestsellers/blockbestsellers.php @@ -25,7 +25,7 @@ * International Registered Trademark & Property of PrestaShop SA */ -if (!defined('_CAN_LOAD_FILES_')) +if (!defined('_PS_VERSION_')) exit; class BlockBestSellers extends Module diff --git a/modules/blockcart/blockcart.php b/modules/blockcart/blockcart.php index 3e631d471..324bc0658 100644 --- a/modules/blockcart/blockcart.php +++ b/modules/blockcart/blockcart.php @@ -25,7 +25,7 @@ * International Registered Trademark & Property of PrestaShop SA */ -if (!defined('_CAN_LOAD_FILES_')) +if (!defined('_PS_VERSION_')) exit; class BlockCart extends Module diff --git a/modules/blockcategories/blockcategories.php b/modules/blockcategories/blockcategories.php index ce7a75be9..50a7aeead 100644 --- a/modules/blockcategories/blockcategories.php +++ b/modules/blockcategories/blockcategories.php @@ -25,7 +25,7 @@ * International Registered Trademark & Property of PrestaShop SA */ -if (!defined('_CAN_LOAD_FILES_')) +if (!defined('_PS_VERSION_')) exit; class BlockCategories extends Module diff --git a/modules/blockcms/blockcms.php b/modules/blockcms/blockcms.php index 48da22861..388a306d8 100755 --- a/modules/blockcms/blockcms.php +++ b/modules/blockcms/blockcms.php @@ -24,7 +24,8 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) * International Registered Trademark & Property of PrestaShop SA */ -if (!defined('_CAN_LOAD_FILES_')) + +if (!defined('_PS_VERSION_')) exit; class BlockCms extends Module @@ -110,8 +111,14 @@ class BlockCms extends Module LEFT JOIN `'._DB_PREFIX_.'cms_block_lang` cbl ON (cbl.`id_cms_block` = cb.`id_cms_block`) WHERE cb.`id_cms_block` = '.(int)$id_cms_block); + $store_display_update = array(0, $size = count($cmsBlocks), $display = Configuration::get('PS_STORES_DISPLAY_FOOTER')); foreach ($cmsBlocks AS $cmsBlock) + { $cmsBlocks['name'][(int)$cmsBlock['id_lang']] = $cmsBlock['name']; + if ($store_display_update['0'] < $store_display_update['1']) + $cmsBlocks[$store_display_update['0']]['display_store'] = $store_display_update['2']; + ++$store_display_update['0']; + } return $cmsBlocks; } @@ -589,6 +596,10 @@ class BlockCms extends Module INSERT INTO `'._DB_PREFIX_.'cms_block_lang` (`id_cms_block`, `id_lang`, `name`) VALUES('.(int)$id_cms_block.', '.(int)$language['id_lang'].', "'.pSQL(Tools::getValue('block_name_'.$language['id_lang'])).'")'); + + Db::getInstance()->Execute(' + UPDATE `'._DB_PREFIX_.'cms_block + SET `display_store` = '.Configuration::get('PS_STORES_DISPLAY_FOOTER')); } elseif (Tools::isSubmit('editBlockCMS')) { @@ -619,6 +630,8 @@ class BlockCms extends Module `display_store` = '.(int)(Tools::getValue('PS_STORES_DISPLAY_CMS')).' WHERE `id_cms_block` = '.(int)($id_cms_block)); + Configuration::updateValue('PS_STORES_DISPLAY_FOOTER', (int)(Tools::getValue('PS_STORES_DISPLAY_CMS'))); + foreach ($languages as $language) Db::getInstance()->Execute(' UPDATE `'._DB_PREFIX_.'cms_block_lang` diff --git a/modules/blockcurrencies/blockcurrencies.php b/modules/blockcurrencies/blockcurrencies.php index b7dd0366e..20817b01a 100644 --- a/modules/blockcurrencies/blockcurrencies.php +++ b/modules/blockcurrencies/blockcurrencies.php @@ -25,7 +25,7 @@ * International Registered Trademark & Property of PrestaShop SA */ -if (!defined('_CAN_LOAD_FILES_')) +if (!defined('_PS_VERSION_')) exit; class BlockCurrencies extends Module diff --git a/modules/blockcustomerprivacy/blockcustomerprivacy.php b/modules/blockcustomerprivacy/blockcustomerprivacy.php index d3b8a1e88..eb037bf1a 100644 --- a/modules/blockcustomerprivacy/blockcustomerprivacy.php +++ b/modules/blockcustomerprivacy/blockcustomerprivacy.php @@ -25,7 +25,7 @@ * International Registered Trademark & Property of PrestaShop SA */ -if (!defined('_CAN_LOAD_FILES_')) +if (!defined('_PS_VERSION_')) exit; class blockcustomerprivacy extends Module @@ -157,4 +157,4 @@ class blockcustomerprivacy extends Module )); return $this->display(__FILE__, 'blockcustomerprivacy.tpl'); } -} \ No newline at end of file +} diff --git a/modules/blocklanguages/blocklanguages.php b/modules/blocklanguages/blocklanguages.php index 0c340f47a..91ba7d20b 100644 --- a/modules/blocklanguages/blocklanguages.php +++ b/modules/blocklanguages/blocklanguages.php @@ -25,7 +25,7 @@ * International Registered Trademark & Property of PrestaShop SA */ -if (!defined('_CAN_LOAD_FILES_')) +if (!defined('_PS_VERSION_')) exit; class BlockLanguages extends Module diff --git a/modules/blocklayered/blocklayered.js b/modules/blocklayered/blocklayered.js index fb3560db6..2d333da2c 100644 --- a/modules/blocklayered/blocklayered.js +++ b/modules/blocklayered/blocklayered.js @@ -170,9 +170,9 @@ function reloadContent(params_plus) reloadContent(); return false; }); + ajaxCart.overrideButtonsInThePage(); } }); - ajaxQueries.push(ajaxQuery); } diff --git a/modules/blocklayered/blocklayered.php b/modules/blocklayered/blocklayered.php index 1ca703b1e..c4ee21e5a 100644 --- a/modules/blocklayered/blocklayered.php +++ b/modules/blocklayered/blocklayered.php @@ -25,7 +25,7 @@ * International Registred Trademark & Property of PrestaShop SA */ -if (!defined('_CAN_LOAD_FILES_')) +if (!defined('_PS_VERSION_')) exit; class BlockLayered extends Module @@ -1491,4 +1491,4 @@ if (!isset($doneCategories[(int)$id_category]['p'])) else return $share_url; } -} \ No newline at end of file +} diff --git a/modules/blocklink/blocklink.php b/modules/blocklink/blocklink.php index ea2460d76..91c3c3bbd 100644 --- a/modules/blocklink/blocklink.php +++ b/modules/blocklink/blocklink.php @@ -25,7 +25,7 @@ * International Registered Trademark & Property of PrestaShop SA */ -if (!defined('_CAN_LOAD_FILES_')) +if (!defined('_PS_VERSION_')) exit; class BlockLink extends Module @@ -35,56 +35,56 @@ class BlockLink extends Module public function __construct() { - $this->name = 'blocklink'; - $this->tab = 'front_office_features'; - $this->version = '1.5'; + $this->name = 'blocklink'; + $this->tab = 'front_office_features'; + $this->version = '1.5'; $this->author = 'PrestaShop'; $this->need_instance = 0; parent::__construct(); - $this->displayName = $this->l('Link block'); - $this->description = $this->l('Adds a block with additional links.'); + $this->displayName = $this->l('Link block'); + $this->description = $this->l('Adds a block with additional links.'); $this->confirmUninstall = $this->l('Are you sure you want to delete all your links ?'); } public function install() { - if (!parent::install() OR - !$this->registerHook('leftColumn') OR - !Db::getInstance()->Execute(' - CREATE TABLE '._DB_PREFIX_.'blocklink ( - `id_blocklink` int(2) NOT NULL AUTO_INCREMENT, - `url` varchar(255) NOT NULL, - `new_window` TINYINT(1) NOT NULL, - PRIMARY KEY(`id_blocklink`)) - ENGINE='._MYSQL_ENGINE_.' default CHARSET=utf8') OR - !Db::getInstance()->Execute(' - CREATE TABLE '._DB_PREFIX_.'blocklink_lang ( - `id_blocklink` int(2) NOT NULL, - `id_lang` int(2) NOT NULL, - `text` varchar(64) NOT NULL, - PRIMARY KEY(`id_blocklink`, `id_lang`)) - ENGINE='._MYSQL_ENGINE_.' default CHARSET=utf8') OR - !Configuration::updateValue('PS_BLOCKLINK_TITLE', array('1' => 'Block link', '2' => 'Bloc lien'))) - return false; - return true; + if (!parent::install() OR + !$this->registerHook('leftColumn') OR + !Db::getInstance()->Execute(' + CREATE TABLE '._DB_PREFIX_.'blocklink ( + `id_blocklink` int(2) NOT NULL AUTO_INCREMENT, + `url` varchar(255) NOT NULL, + `new_window` TINYINT(1) NOT NULL, + PRIMARY KEY(`id_blocklink`)) + ENGINE='._MYSQL_ENGINE_.' default CHARSET=utf8') OR + !Db::getInstance()->Execute(' + CREATE TABLE '._DB_PREFIX_.'blocklink_lang ( + `id_blocklink` int(2) NOT NULL, + `id_lang` int(2) NOT NULL, + `text` varchar(64) NOT NULL, + PRIMARY KEY(`id_blocklink`, `id_lang`)) + ENGINE='._MYSQL_ENGINE_.' default CHARSET=utf8') OR + !Configuration::updateValue('PS_BLOCKLINK_TITLE', array('1' => 'Block link', '2' => 'Bloc lien'))) + return false; + return true; } public function uninstall() { - if (!parent::uninstall() OR - !Db::getInstance()->Execute('DROP TABLE '._DB_PREFIX_.'blocklink') OR - !Db::getInstance()->Execute('DROP TABLE '._DB_PREFIX_.'blocklink_lang') OR - !Configuration::deleteByName('PS_BLOCKLINK_TITLE') OR - !Configuration::deleteByName('PS_BLOCKLINK_URL')) - return false; - return true; + if (!parent::uninstall() OR + !Db::getInstance()->Execute('DROP TABLE '._DB_PREFIX_.'blocklink') OR + !Db::getInstance()->Execute('DROP TABLE '._DB_PREFIX_.'blocklink_lang') OR + !Configuration::deleteByName('PS_BLOCKLINK_TITLE') OR + !Configuration::deleteByName('PS_BLOCKLINK_URL')) + return false; + return true; } public function hookLeftColumn($params) { - $links = $this->getLinks(); + $links = $this->getLinks(); $this->context->smarty->assign(array( 'blocklink_links' => $links, @@ -92,7 +92,7 @@ class BlockLink extends Module 'url' => Configuration::get('PS_BLOCKLINK_URL'), 'lang' => 'text_'.$this->context->language->id )); - if (!$links) + if (!$links) return false; return $this->display(__FILE__, 'blocklink.tpl'); } @@ -104,14 +104,14 @@ class BlockLink extends Module public function getLinks() { - $result = array(); - /* Get id and url */ - if (!$links = Db::getInstance()->ExecuteS('SELECT `id_blocklink`, `url`, `new_window` FROM '._DB_PREFIX_.'blocklink'.((int)(Configuration::get('PS_BLOCKLINK_ORDERWAY')) == 1 ? ' ORDER BY `id_blocklink` DESC' : ''))) - return false; - $i = 0; - foreach ($links AS $link) - { - $result[$i]['id'] = $link['id_blocklink']; + $result = array(); + /* Get id and url */ + if (!$links = Db::getInstance()->ExecuteS('SELECT `id_blocklink`, `url`, `new_window` FROM '._DB_PREFIX_.'blocklink'.((int)(Configuration::get('PS_BLOCKLINK_ORDERWAY')) == 1 ? ' ORDER BY `id_blocklink` DESC' : ''))) + return false; + $i = 0; + foreach ($links AS $link) + { + $result[$i]['id'] = $link['id_blocklink']; $result[$i]['url'] = $link['url']; $result[$i]['newWindow'] = $link['new_window']; /* Get multilingual text */ @@ -121,58 +121,58 @@ class BlockLink extends Module $result[$i]['text_'.$text['id_lang']] = $text['text']; $i++; } - return $result; + return $result; } public function addLink() { - /* Url registration */ - if (!Db::getInstance()->Execute('INSERT INTO '._DB_PREFIX_.'blocklink VALUES (NULL, \''.pSQL($_POST['url']).'\', '.((isset($_POST['newWindow']) AND $_POST['newWindow']) == 'on' ? 1 : 0).')') OR !$lastId = Db::getInstance()->Insert_ID()) - return false; - /* Multilingual text */ - $languages = Language::getLanguages(); - $defaultLanguage = (int)(Configuration::get('PS_LANG_DEFAULT')); - if (!$languages) - return false; - foreach ($languages AS $language) - if (!empty($_POST['text_'.$language['id_lang']])) - { - if (!Db::getInstance()->Execute('INSERT INTO '._DB_PREFIX_.'blocklink_lang VALUES ('.(int)($lastId).', '.(int)($language['id_lang']).', \''.pSQL($_POST['text_'.$language['id_lang']]).'\')')) - return false; - } - else - if (!Db::getInstance()->Execute('INSERT INTO '._DB_PREFIX_.'blocklink_lang VALUES ('.(int)($lastId).', '.(int)($language['id_lang']).', \''.pSQL($_POST['text_'.$defaultLanguage]).'\')')) - return false; - return true; + /* Url registration */ + if (!Db::getInstance()->Execute('INSERT INTO '._DB_PREFIX_.'blocklink VALUES (NULL, \''.pSQL($_POST['url']).'\', '.((isset($_POST['newWindow']) AND $_POST['newWindow']) == 'on' ? 1 : 0).')') OR !$lastId = Db::getInstance()->Insert_ID()) + return false; + /* Multilingual text */ + $languages = Language::getLanguages(); + $defaultLanguage = (int)(Configuration::get('PS_LANG_DEFAULT')); + if (!$languages) + return false; + foreach ($languages AS $language) + if (!empty($_POST['text_'.$language['id_lang']])) + { + if (!Db::getInstance()->Execute('INSERT INTO '._DB_PREFIX_.'blocklink_lang VALUES ('.(int)($lastId).', '.(int)($language['id_lang']).', \''.pSQL($_POST['text_'.$language['id_lang']]).'\')')) + return false; + } + else + if (!Db::getInstance()->Execute('INSERT INTO '._DB_PREFIX_.'blocklink_lang VALUES ('.(int)($lastId).', '.(int)($language['id_lang']).', \''.pSQL($_POST['text_'.$defaultLanguage]).'\')')) + return false; + return true; } public function updateLink() { - /* Url registration */ - if (!Db::getInstance()->Execute('UPDATE '._DB_PREFIX_.'blocklink SET `url`=\''.pSQL($_POST['url']).'\', `new_window`='.(isset($_POST['newWindow']) ? 1 : 0).' WHERE `id_blocklink`='.(int)($_POST['id']))) - return false; - /* Multilingual text */ - $languages = Language::getLanguages(); - $defaultLanguage = (int)(Configuration::get('PS_LANG_DEFAULT')); - if (!$languages) + /* Url registration */ + if (!Db::getInstance()->Execute('UPDATE '._DB_PREFIX_.'blocklink SET `url`=\''.pSQL($_POST['url']).'\', `new_window`='.(isset($_POST['newWindow']) ? 1 : 0).' WHERE `id_blocklink`='.(int)($_POST['id']))) + return false; + /* Multilingual text */ + $languages = Language::getLanguages(); + $defaultLanguage = (int)(Configuration::get('PS_LANG_DEFAULT')); + if (!$languages) return false; if (!Db::getInstance()->Execute('DELETE FROM '._DB_PREFIX_.'blocklink_lang WHERE `id_blocklink` = '.(int)($_POST['id']))) return false ; - foreach ($languages AS $language) - if (!empty($_POST['text_'.$language['id_lang']])) + foreach ($languages AS $language) + if (!empty($_POST['text_'.$language['id_lang']])) { - if (!Db::getInstance()->Execute('INSERT INTO '._DB_PREFIX_.'blocklink_lang VALUES ('.(int)($_POST['id']).', '.(int)($language['id_lang']).', \''.pSQL($_POST['text_'.$language['id_lang']]).'\')')) - return false; + if (!Db::getInstance()->Execute('INSERT INTO '._DB_PREFIX_.'blocklink_lang VALUES ('.(int)($_POST['id']).', '.(int)($language['id_lang']).', \''.pSQL($_POST['text_'.$language['id_lang']]).'\')')) + return false; } - else + else if (!Db::getInstance()->Execute('INSERT INTO '._DB_PREFIX_.'blocklink_lang VALUES ('.(int)($_POST['id']).', '.$language['id_lang'].', \''.pSQL($_POST['text_'.$defaultLanguage]).'\')')) - return false; - return true; + return false; + return true; } public function deleteLink() { - return Db::getInstance()->Execute('DELETE FROM '._DB_PREFIX_.'blocklink WHERE `id_blocklink`='.(int)($_GET['id'])); + return Db::getInstance()->Execute('DELETE FROM '._DB_PREFIX_.'blocklink WHERE `id_blocklink`='.(int)($_GET['id'])); } public function updateTitle() @@ -181,92 +181,98 @@ class BlockLink extends Module $result = array(); foreach ($languages AS $language) $result[$language['id_lang']] = $_POST['title_'.$language['id_lang']]; - if (!Configuration::updateValue('PS_BLOCKLINK_TITLE', $result)) - return false; - return Configuration::updateValue('PS_BLOCKLINK_URL', $_POST['title_url']); + if (!Configuration::updateValue('PS_BLOCKLINK_TITLE', $result)) + return false; + return Configuration::updateValue('PS_BLOCKLINK_URL', $_POST['title_url']); } public function getContent() { - $this->_html = '

    '.$this->displayName.'

    + $this->_html = '

    '.$this->displayName.'

    '; - /* Add a link */ - if (isset($_POST['submitLinkAdd'])) + /* Add a link */ + if (isset($_POST['submitLinkAdd'])) { - if (empty($_POST['text_'.Configuration::get('PS_LANG_DEFAULT')]) OR empty($_POST['url'])) - $this->_html .= $this->displayError($this->l('You must fill in all fields')); - elseif (!Validate::isUrl(str_replace('http://', '', $_POST['url']))) - $this->_html .= $this->displayError($this->l('Bad URL')); - else - if ($this->addLink()) + if (empty($_POST['text_'.Configuration::get('PS_LANG_DEFAULT')]) OR empty($_POST['url'])) + $this->_html .= $this->displayError($this->l('You must fill in all fields')); + elseif (!Validate::isUrl(str_replace('http://', '', $_POST['url']))) + $this->_html .= $this->displayError($this->l('Bad URL')); + else + if ($this->addLink()) $this->_html .= $this->displayConfirmation($this->l('The link has been added.')); - else - $this->_html .= $this->displayError($this->l('An error occurred during link creation.')); + else + $this->_html .= $this->displayError($this->l('An error occurred during link creation.')); } - /* Update a link */ - elseif (isset($_POST['submitLinkUpdate'])) - { - if (empty($_POST['text_'.Configuration::get('PS_LANG_DEFAULT')]) OR empty($_POST['url'])) - $this->_html .= $this->displayError($this->l('You must fill in all fields')); - elseif (!Validate::isUrl(str_replace('http://', '', $_POST['url']))) - $this->_html .= $this->displayError($this->l('Bad URL')); - else - if (empty($_POST['id']) OR !is_numeric($_POST['id']) OR !$this->updateLink()) - $this->_html .= $this->displayError($this->l('An error occurred during link updating.')); - else - $this->_html .= $this->displayConfirmation($this->l('The link has been updated.')); - } - /* Update the block title */ - elseif (isset($_POST['submitTitle'])) - { - if (empty($_POST['title_'.Configuration::get('PS_LANG_DEFAULT')])) - $this->_html .= $this->displayError($this->l('"title" field cannot be empty.')); - elseif (!empty($_POST['title_url']) AND !Validate::isUrl(str_replace('http://', '', $_POST['title_url']))) - $this->_html .= $this->displayError($this->l('The \'title\' field is invalid')); - elseif (!Validate::isGenericName($_POST['title_'.Configuration::get('PS_LANG_DEFAULT')])) - $this->_html .= $this->displayError($this->l('The \'title\' field is invalid')); - elseif (!$this->updateTitle()) - $this->_html .= $this->displayError($this->l('An error occurred during title updating.')); - else - $this->_html .= $this->displayConfirmation($this->l('The block title has been updated.')); - } - /* Delete a link*/ - elseif (isset($_GET['id'])) - { - if (!is_numeric($_GET['id']) OR !$this->deleteLink()) - $this->_html .= $this->displayError($this->l('An error occurred during link deletion.')); - else - $this->_html .= $this->displayConfirmation($this->l('The link has been deleted.')); - } - if (isset($_POST['submitOrderWay'])) + /* Update a link */ + elseif (isset($_POST['submitLinkUpdate'])) { - if (Configuration::updateValue('PS_BLOCKLINK_ORDERWAY', (int)Tools::getValue('orderWay'))) + + if (empty($_POST['text_'.Configuration::get('PS_LANG_DEFAULT')]) OR empty($_POST['url'])) + $this->_html .= $this->displayError($this->l('You must fill in all fields')); + elseif (!Validate::isUrl(str_replace('http://', '', $_POST['url']))) + $this->_html .= $this->displayError($this->l('Bad URL')); + else + if (empty($_POST['id']) OR !is_numeric($_POST['id']) OR !$this->updateLink()) + $this->_html .= $this->displayError($this->l('An error occurred during link updating.')); + else + $this->_html .= $this->displayConfirmation($this->l('The link has been updated.')); + } + + /* Update the block title */ + elseif (isset($_POST['submitTitle'])) + { + + if (empty($_POST['title_'.Configuration::get('PS_LANG_DEFAULT')])) + $this->_html .= $this->displayError($this->l('"title" field cannot be empty.')); + elseif (!empty($_POST['title_url']) AND !Validate::isUrl(str_replace('http://', '', $_POST['title_url']))) + $this->_html .= $this->displayError($this->l('The \'title\' field is invalid')); + elseif (!Validate::isGenericName($_POST['title_'.Configuration::get('PS_LANG_DEFAULT')])) + $this->_html .= $this->displayError($this->l('The \'title\' field is invalid')); + elseif (!$this->updateTitle()) + $this->_html .= $this->displayError($this->l('An error occurred during title updating.')); + else + $this->_html .= $this->displayConfirmation($this->l('The block title has been updated.')); + } + + /* Delete a link*/ + elseif (isset($_GET['id'])) + { + + if (!is_numeric($_GET['id']) OR !$this->deleteLink()) + $this->_html .= $this->displayError($this->l('An error occurred during link deletion.')); + else + $this->_html .= $this->displayConfirmation($this->l('The link has been deleted.')); + } + + if (isset($_POST['submitOrderWay'])) + { + if (Configuration::updateValue('PS_BLOCKLINK_ORDERWAY', (int)(Tools::getValue('orderWay')))) $this->_html .= $this->displayConfirmation($this->l('Sort order updated')); else $this->_html .= $this->displayError($this->l('An error occurred during sort order set-up.')); } - $this->_displayForm(); - $this->_list(); + $this->_displayForm(); + $this->_list(); - return $this->_html; - } + return $this->_html; + } private function _displayForm() { /* Language */ - $defaultLanguage = (int)(Configuration::get('PS_LANG_DEFAULT')); + $defaultLanguage = (int)(Configuration::get('PS_LANG_DEFAULT')); $languages = Language::getLanguages(false); $divLangName = 'text¤title'; /* Title */ - $title_url = Configuration::get('PS_BLOCKLINK_URL'); + $title_url = Configuration::get('PS_BLOCKLINK_URL'); - $this->_html .= ' + $this->_html .= ' -
    +
    '.$this->l('Add a new link').'
    @@ -287,7 +293,7 @@ class BlockLink extends Module
    - +
    @@ -327,29 +333,29 @@ class BlockLink extends Module private function _list() { - $links = $this->getLinks(); - $languages = Language::getLanguages(); - if ($links) + $links = $this->getLinks(); + $languages = Language::getLanguages(); + if ($links) { - $this->_html .= ' + $this->_html .= ' '; + $this->_html .= ''; } - $this->_html .= ' -

    '.$this->l('Link list').'

    + $this->_html .= ' +

    '.$this->l('Link list').'

    @@ -375,9 +381,20 @@ class BlockLink extends Module '; + $i = 0; + $nb = count($languages); + $idLng = 0; + while($i < $nb) + { + if ($languages[$i]['id_lang'] == (int)Configuration::get('PS_LANG_DEFAULT')) + { + $idLng = $i; + } + $i++; + } $this->_html .= '
    '.$this->l('ID').'
    '; } -} +} \ No newline at end of file diff --git a/modules/blockmanufacturer/blockmanufacturer.php b/modules/blockmanufacturer/blockmanufacturer.php index 363259862..2da14cbc0 100644 --- a/modules/blockmanufacturer/blockmanufacturer.php +++ b/modules/blockmanufacturer/blockmanufacturer.php @@ -25,7 +25,7 @@ * International Registered Trademark & Property of PrestaShop SA */ -if (!defined('_CAN_LOAD_FILES_')) +if (!defined('_PS_VERSION_')) exit; class BlockManufacturer extends Module diff --git a/modules/blockmyaccount/blockmyaccount.php b/modules/blockmyaccount/blockmyaccount.php index 40a50f7a4..1e463b4c9 100644 --- a/modules/blockmyaccount/blockmyaccount.php +++ b/modules/blockmyaccount/blockmyaccount.php @@ -25,7 +25,7 @@ * International Registered Trademark & Property of PrestaShop SA */ -if (!defined('_CAN_LOAD_FILES_')) +if (!defined('_PS_VERSION_')) exit; class BlockMyAccount extends Module diff --git a/modules/blocknewproducts/blocknewproducts.php b/modules/blocknewproducts/blocknewproducts.php index 7437e7034..7d30f3ba6 100644 --- a/modules/blocknewproducts/blocknewproducts.php +++ b/modules/blocknewproducts/blocknewproducts.php @@ -25,7 +25,7 @@ * International Registered Trademark & Property of PrestaShop SA */ -if (!defined('_CAN_LOAD_FILES_')) +if (!defined('_PS_VERSION_')) exit; class BlockNewProducts extends Module diff --git a/modules/blocknewsletter/blocknewsletter.php b/modules/blocknewsletter/blocknewsletter.php index 94b3390e5..60c59d376 100644 --- a/modules/blocknewsletter/blocknewsletter.php +++ b/modules/blocknewsletter/blocknewsletter.php @@ -25,7 +25,7 @@ * International Registered Trademark & Property of PrestaShop SA */ -if (!defined('_CAN_LOAD_FILES_')) +if (!defined('_PS_VERSION_')) exit; class Blocknewsletter extends Module diff --git a/modules/blockpaymentlogo/blockpaymentlogo.php b/modules/blockpaymentlogo/blockpaymentlogo.php index 0c6d28c87..82bebdbd3 100644 --- a/modules/blockpaymentlogo/blockpaymentlogo.php +++ b/modules/blockpaymentlogo/blockpaymentlogo.php @@ -25,7 +25,7 @@ * International Registered Trademark & Property of PrestaShop SA */ -if (!defined('_CAN_LOAD_FILES_')) +if (!defined('_PS_VERSION_')) exit; class BlockPaymentLogo extends Module diff --git a/modules/blockpermanentlinks/blockpermanentlinks.php b/modules/blockpermanentlinks/blockpermanentlinks.php index 73b973537..b761cf40a 100644 --- a/modules/blockpermanentlinks/blockpermanentlinks.php +++ b/modules/blockpermanentlinks/blockpermanentlinks.php @@ -25,7 +25,7 @@ * International Registered Trademark & Property of PrestaShop SA */ -if (!defined('_CAN_LOAD_FILES_')) +if (!defined('_PS_VERSION_')) exit; class BlockPermanentLinks extends Module diff --git a/modules/blockrss/blockrss.php b/modules/blockrss/blockrss.php index 4b11557f4..6a12ed143 100644 --- a/modules/blockrss/blockrss.php +++ b/modules/blockrss/blockrss.php @@ -25,7 +25,7 @@ * International Registered Trademark & Property of PrestaShop SA */ -if (!defined('_CAN_LOAD_FILES_')) +if (!defined('_PS_VERSION_')) exit; include_once(_PS_CLASS_DIR_.'../tools/pear/PEAR.php'); diff --git a/modules/blocksearch/blocksearch.php b/modules/blocksearch/blocksearch.php index ee2346f21..368bbbcab 100644 --- a/modules/blocksearch/blocksearch.php +++ b/modules/blocksearch/blocksearch.php @@ -25,7 +25,7 @@ * International Registered Trademark & Property of PrestaShop SA */ -if (!defined('_CAN_LOAD_FILES_')) +if (!defined('_PS_VERSION_')) exit; class BlockSearch extends Module diff --git a/modules/blockspecials/blockspecials.php b/modules/blockspecials/blockspecials.php index 0ba1c874a..8b2a0ff62 100644 --- a/modules/blockspecials/blockspecials.php +++ b/modules/blockspecials/blockspecials.php @@ -24,7 +24,8 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) * International Registered Trademark & Property of PrestaShop SA */ -if (!defined('_CAN_LOAD_FILES_')) + +if (!defined('_PS_VERSION_')) exit; class BlockSpecials extends Module diff --git a/modules/blockstore/blockstore.php b/modules/blockstore/blockstore.php index 6bc6ee8d0..eb6dc6878 100644 --- a/modules/blockstore/blockstore.php +++ b/modules/blockstore/blockstore.php @@ -25,7 +25,7 @@ * International Registered Trademark & Property of PrestaShop SA */ -if (!defined('_CAN_LOAD_FILES_')) +if (!defined('_PS_VERSION_')) exit; class BlockStore extends Module diff --git a/modules/blocksupplier/blocksupplier.php b/modules/blocksupplier/blocksupplier.php index 55ff162d8..f949bd8d0 100644 --- a/modules/blocksupplier/blocksupplier.php +++ b/modules/blocksupplier/blocksupplier.php @@ -25,7 +25,7 @@ * International Registered Trademark & Property of PrestaShop SA */ -if (!defined('_CAN_LOAD_FILES_')) +if (!defined('_PS_VERSION_')) exit; class BlockSupplier extends Module diff --git a/modules/blocktags/blocktags.php b/modules/blocktags/blocktags.php index df6360d93..b881c904e 100644 --- a/modules/blocktags/blocktags.php +++ b/modules/blocktags/blocktags.php @@ -25,7 +25,7 @@ * International Registered Trademark & Property of PrestaShop SA */ -if (!defined('_CAN_LOAD_FILES_')) +if (!defined('_PS_VERSION_')) exit; define('BLOCKTAGS_MAX_LEVEL', 3); diff --git a/modules/blockuserinfo/blockuserinfo.php b/modules/blockuserinfo/blockuserinfo.php index 205114b6d..e509d9c64 100644 --- a/modules/blockuserinfo/blockuserinfo.php +++ b/modules/blockuserinfo/blockuserinfo.php @@ -25,7 +25,7 @@ * International Registered Trademark & Property of PrestaShop SA */ -if (!defined('_CAN_LOAD_FILES_')) +if (!defined('_PS_VERSION_')) exit; class BlockUserInfo extends Module diff --git a/modules/blockviewed/blockviewed.php b/modules/blockviewed/blockviewed.php index 3dca50196..bcb042146 100644 --- a/modules/blockviewed/blockviewed.php +++ b/modules/blockviewed/blockviewed.php @@ -25,7 +25,7 @@ * International Registered Trademark & Property of PrestaShop SA */ -if (!defined('_CAN_LOAD_FILES_')) +if (!defined('_PS_VERSION_')) exit; class BlockViewed extends Module diff --git a/modules/blockwishlist/WishList.php b/modules/blockwishlist/WishList.php index 436d529af..efee4927d 100644 --- a/modules/blockwishlist/WishList.php +++ b/modules/blockwishlist/WishList.php @@ -25,7 +25,7 @@ * International Registered Trademark & Property of PrestaShop SA */ -if (!defined('_CAN_LOAD_FILES_')) +if (!defined('_PS_VERSION_')) exit; class WishList extends ObjectModel diff --git a/modules/blockwishlist/blockwishlist.php b/modules/blockwishlist/blockwishlist.php index a4c6b3cff..b9db4373e 100644 --- a/modules/blockwishlist/blockwishlist.php +++ b/modules/blockwishlist/blockwishlist.php @@ -25,7 +25,7 @@ * International Registered Trademark & Property of PrestaShop SA */ -if (!defined('_CAN_LOAD_FILES_')) +if (!defined('_PS_VERSION_')) exit; class BlockWishList extends Module diff --git a/modules/canadapost/canadapost.php b/modules/canadapost/canadapost.php index f990679b6..ecc3a9522 100755 --- a/modules/canadapost/canadapost.php +++ b/modules/canadapost/canadapost.php @@ -24,7 +24,8 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) * International Registered Trademark & Property of PrestaShop SA */ -if (!defined('_CAN_LOAD_FILES_')) + +if (!defined('_PS_VERSION_')) exit; class CanadaPost extends CarrierModule diff --git a/modules/carriercompare/carriercompare.php b/modules/carriercompare/carriercompare.php index 3d6156e59..27455e26b 100755 --- a/modules/carriercompare/carriercompare.php +++ b/modules/carriercompare/carriercompare.php @@ -25,7 +25,7 @@ * International Registered Trademark & Property of PrestaShop SA */ -if (!defined('_CAN_LOAD_FILES_')) +if (!defined('_PS_VERSION_')) exit; class CarrierCompare extends Module diff --git a/modules/cashondelivery/cashondelivery.php b/modules/cashondelivery/cashondelivery.php index 60af84b3d..1f1415d23 100644 --- a/modules/cashondelivery/cashondelivery.php +++ b/modules/cashondelivery/cashondelivery.php @@ -25,7 +25,7 @@ * International Registered Trademark & Property of PrestaShop SA */ -if (!defined('_CAN_LOAD_FILES_')) +if (!defined('_PS_VERSION_')) exit; class CashOnDelivery extends PaymentModule diff --git a/modules/cashticket/cashticket.php b/modules/cashticket/cashticket.php index 5fc6e9cc2..d403ac0bc 100644 --- a/modules/cashticket/cashticket.php +++ b/modules/cashticket/cashticket.php @@ -24,7 +24,8 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) * International Registered Trademark & Property of PrestaShop SA */ -if (!defined('_CAN_LOAD_FILES_')) + +if (!defined('_PS_VERSION_')) exit; if (!in_array('PrepaidServices', get_declared_classes())) include_once(_PS_MODULE_DIR_.'cashticket/PrepaidServices.php'); diff --git a/modules/cheque/cheque.php b/modules/cheque/cheque.php index f702ac5d5..07461b107 100644 --- a/modules/cheque/cheque.php +++ b/modules/cheque/cheque.php @@ -25,7 +25,7 @@ * International Registered Trademark & Property of PrestaShop SA */ -if (!defined('_CAN_LOAD_FILES_')) +if (!defined('_PS_VERSION_')) exit; class Cheque extends PaymentModule diff --git a/modules/criteo/criteo.php b/modules/criteo/criteo.php index 5bb2a5419..7165a5860 100755 --- a/modules/criteo/criteo.php +++ b/modules/criteo/criteo.php @@ -25,7 +25,7 @@ * International Registered Trademark & Property of PrestaShop SA */ -if (!defined('_CAN_LOAD_FILES_')) +if (!defined('_PS_VERSION_')) exit; class Criteo extends Module diff --git a/modules/crossselling/crossselling.php b/modules/crossselling/crossselling.php index fc887aadf..a51800c1d 100755 --- a/modules/crossselling/crossselling.php +++ b/modules/crossselling/crossselling.php @@ -25,7 +25,7 @@ * International Registered Trademark & Property of PrestaShop SA */ -if (!defined('_CAN_LOAD_FILES_')) +if (!defined('_PS_VERSION_')) exit; class CrossSelling extends Module @@ -146,4 +146,4 @@ class CrossSelling extends Module } return $this->display(__FILE__, 'crossselling.tpl'); } -} \ No newline at end of file +} diff --git a/modules/dateofdelivery/dateofdelivery.php b/modules/dateofdelivery/dateofdelivery.php index 1c4c1f886..320ad6abb 100644 --- a/modules/dateofdelivery/dateofdelivery.php +++ b/modules/dateofdelivery/dateofdelivery.php @@ -24,7 +24,8 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) * International Registered Trademark & Property of PrestaShop SA */ -if (!defined('_CAN_LOAD_FILES_')) + +if (!defined('_PS_VERSION_')) exit; class DateOfDelivery extends Module @@ -515,4 +516,4 @@ class DateOfDelivery extends Module $date_maximal_string ); } -} \ No newline at end of file +} diff --git a/modules/dejala/dejala.php b/modules/dejala/dejala.php index ef284e82f..46c2ead50 100644 --- a/modules/dejala/dejala.php +++ b/modules/dejala/dejala.php @@ -1,6 +1,31 @@ +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision$ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ -if (!defined('_CAN_LOAD_FILES_')) +if (!defined('_PS_VERSION_')) exit; require_once(_PS_MODULE_DIR_ . "dejala/dejalaconfig.php"); diff --git a/modules/dejala/dejalacart.php b/modules/dejala/dejalacart.php index c3ad1fac3..e726a8b2d 100644 --- a/modules/dejala/dejalacart.php +++ b/modules/dejala/dejalacart.php @@ -5,8 +5,10 @@ * DejalaCart class, dejalacart.php * Manage cart information related to dejala.fr carrier **/ -if (!defined('_CAN_LOAD_FILES_')) + +if (!defined('_PS_VERSION_')) exit; + class DejalaCart extends ObjectModel { public $id; diff --git a/modules/dibs/dibs.php b/modules/dibs/dibs.php index 63c2fb1a9..e73ecb2e2 100644 --- a/modules/dibs/dibs.php +++ b/modules/dibs/dibs.php @@ -24,7 +24,8 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) * International Registered Trademark & Property of PrestaShop SA */ -if (!defined('_CAN_LOAD_FILES_')) + +if (!defined('_PS_VERSION_')) exit; class dibs extends PaymentModule diff --git a/modules/ebay/eBayRequest.php b/modules/ebay/eBayRequest.php index bfe22e9b1..eab2ec0ce 100755 --- a/modules/ebay/eBayRequest.php +++ b/modules/ebay/eBayRequest.php @@ -89,7 +89,7 @@ class eBayRequest $this->apiUrl = 'https://api.ebay.com/ws/api.dll'; $this->apiCall = $apiCall; - $this->compatibilityLevel = 719; + $this->compatibilityLevel = 741; $this->runame = 'Prestashop-Prestash-70a5-4-pepwa'; @@ -355,7 +355,7 @@ class eBayRequest /******************************************************************/ - /** Add Product Methods *******************************************/ + /** Add / Update / End Product Methods ****************************/ /******************************************************************/ @@ -374,7 +374,7 @@ class eBayRequest $requestXml .= ' fr_FR'."\n"; $requestXml .= ' High'."\n"; $requestXml .= ' '."\n"; - $requestXml .= ' prestashop-'.$datas['id_product'].(isset($datas['reference']) ? '-'.$datas['reference'] : '').''; + $requestXml .= ' prestashop-'.$datas['id_product'].''; $requestXml .= ' '.substr($datas['name'], 0, 55).''."\n"; if (isset($datas['pictures'])) { @@ -503,7 +503,7 @@ class eBayRequest $requestXml .= ' High'."\n"; $requestXml .= ' '."\n"; $requestXml .= ' '.$datas['itemID'].''."\n"; - $requestXml .= ' prestashop-'.$datas['id_product'].(isset($datas['reference']) ? '-'.$datas['reference'] : '').''; + $requestXml .= ' prestashop-'.$datas['id_product'].''; $requestXml .= ' '.$datas['quantity'].''."\n"; $requestXml .= ' '.$datas['price'].''."\n"; if (Configuration::get('EBAY_SYNC_OPTION_RESYNC') != 1) @@ -579,6 +579,86 @@ class eBayRequest + function endFixedPriceItem($datas = array()) + { + // Check data + if (!$datas) + return false; + + // Set Api Call + $this->apiCall = 'EndFixedPriceItem'; + + // Build the request Xml string + $requestXml = ''."\n"; + $requestXml .= ''."\n"; + $requestXml .= ' fr_FR'."\n"; + $requestXml .= ' High'."\n"; + $requestXml .= ' '.$datas['itemID'].''."\n"; + $requestXml .= ' prestashop-'.$datas['id_product'].''; + $requestXml .= ' NotAvailable'."\n"; + $requestXml .= ' '."\n"; + $requestXml .= ' '.Configuration::get('EBAY_API_TOKEN').''."\n"; + $requestXml .= ' '."\n"; + $requestXml .= ' High'."\n"; + $requestXml .= ''."\n"; + + + // Send the request and get response + $responseXml = $this->makeRequest($requestXml); + if (stristr($responseXml, 'HTTP 404') || $responseXml == '') + { + $this->error = 'Error sending '.$this->apiCall.' request'; + return false; + } + + // Loading XML tree in array + $this->response = simplexml_load_string($responseXml); + + + // Checking Errors + $this->error = ''; + $this->errorCode = ''; + if (isset($this->response->Errors) && isset($this->response->Ack) && (string)$this->response->Ack != 'Success' && (string)$this->response->Ack != 'Warning') + foreach ($this->response->Errors as $e) + { + // if product no longer on eBay, we log the error code + if ((int)$e->ErrorCode == 291) + $this->errorCode = (int)$e->ErrorCode; + + // We log error message + if ($e->SeverityCode == 'Error') + { + if ($this->error != '') + $this->error .= '
    '; + $this->error .= (string)$e->LongMessage; + if (isset($e->ErrorParameters->Value)) + $this->error .= '
    '.(string)$e->ErrorParameters->Value; + } + } + + // Checking Success + $this->itemID = 0; + if (isset($this->response->Ack) && ((string)$this->response->Ack == 'Success' || (string)$this->response->Ack == 'Warning')) + { + $this->fees = 0; + $this->itemID = (string)$this->response->ItemID; + if (isset($this->response->Fees->Fee)) + foreach ($this->response->Fees->Fee as $f) + $this->fees += (float)$f->Fee; + } + elseif ($this->error == '') + $this->error = 'Sorry, technical problem, try again later.'; + + if (!empty($this->error)) + return false; + + return true; + } + + + + + @@ -653,7 +733,7 @@ class eBayRequest foreach ($datas['variations'] as $key => $variation) { $requestXml .= ' '."\n"; - $requestXml .= ' prestashop-'.$key.(isset($variation['reference']) ? '-'.$variation['reference'] : '').''."\n"; + $requestXml .= ' prestashop-'.$key.''."\n"; $requestXml .= ' '.$variation['price'].''."\n"; $requestXml .= ' '.$variation['quantity'].''."\n"; $requestXml .= ' '."\n"; @@ -929,6 +1009,18 @@ class eBayRequest } + + + + + + + + + + + + /******************************************************************/ /** Order Methods *************************************************/ /******************************************************************/ @@ -1068,6 +1160,9 @@ class eBayRequest 'shippingServiceCost' => (string)$order->ShippingServiceSelected->ShippingServiceCost, 'email' => (string)$order->TransactionArray->Transaction[0]->Buyer->Email, 'product_list' => $itemList, + 'payment_method' => (string)$order->CheckoutStatus->PaymentMethod, + 'id_order_seller' => (string)$order->ShippingDetails->SellingManagerSalesRecordNumber, + 'date_add' => substr((string)$order->CreatedTime, 0, 10).' '.substr((string)$order->CreatedTime, 11, 8), //'object' => $order ); } diff --git a/modules/ebay/ebay.php b/modules/ebay/ebay.php index 6dfd6a261..aeccb8fc5 100755 --- a/modules/ebay/ebay.php +++ b/modules/ebay/ebay.php @@ -25,6 +25,9 @@ * International Registered Trademark & Property of PrestaShop SA */ +// Security +if (!defined('_PS_VERSION_')) + exit; // Loading eBay Class Request if (file_exists(dirname(__FILE__).'/eBayRequest.php')) @@ -420,9 +423,12 @@ class Ebay extends Module // Validate order $paiement = new eBayPayment(); - $paiement->validateOrder(intval($cartAdd->id), Configuration::get('PS_OS_PAYMENT'), floatval($cartAdd->getOrderTotal(true, 3)), 'Paypal eBay', NULL, array(), intval($cartAdd->id_currency)); + $paiement->validateOrder(intval($cartAdd->id), Configuration::get('PS_OS_PAYMENT'), floatval($cartAdd->getOrderTotal(true, 3)), 'eBay '.$order['payment_method'].' '.$order['id_order_seller'], NULL, array(), intval($cartAdd->id_currency)); $id_order = $paiement->currentOrder; + // Fix on date + Db::getInstance()->autoExecute(_DB_PREFIX_.'orders', array('date_add' => pSQL($order['date_add'])), 'UPDATE', '`id_order` = '.(int)$id_order); + // Fix on sending e-mail Db::getInstance()->autoExecute(_DB_PREFIX_.'customer', array('email' => pSQL($order['email'])), 'UPDATE', '`id_customer` = '.(int)$id_customer); @@ -1514,8 +1520,19 @@ class Ebay extends Module $itemID = Db::getInstance()->getValue('SELECT `id_product_ref` FROM `'._DB_PREFIX_.'ebay_product` WHERE `id_product` = '.(int)$product->id.' AND `id_attribute` = '.(int)$datasTmp['id_attribute']); if ($itemID) { - // Update + // Get Item ID $datasTmp['itemID'] = $itemID; + + // Delete or Update + if ($datasTmp['quantity'] < 1) + { + // Delete + if ($ebay->endFixedPriceItem($datasTmp)) + Db::getInstance()->Execute('DELETE FROM `'._DB_PREFIX_.'ebay_product` WHERE `id_product_ref` = \''.pSQL($datasTmp['itemID']).'\''); + } + else + { + // Update if ($ebay->reviseFixedPriceItem($datasTmp)) Db::getInstance()->autoExecute(_DB_PREFIX_.'ebay_product', array('date_upd' => pSQL($date)), 'UPDATE', '`id_product_ref` = '.(int)$itemID); @@ -1529,6 +1546,7 @@ class Ebay extends Module Db::getInstance()->autoExecute(_DB_PREFIX_.'ebay_product', array('id_country' => 8, 'id_product' => (int)$product->id, 'id_attribute' => (int)$datasTmp['id_attribute'], 'id_product_ref' => pSQL($ebay->itemID), 'date_add' => pSQL($date), 'date_upd' => pSQL($date)), 'INSERT'); } } + } else { // Add @@ -1562,8 +1580,19 @@ class Ebay extends Module if ($itemID) { - // Update + // Get Item ID $datas['itemID'] = $itemID; + + // Delete or Update + if ($datas['quantity'] < 1) + { + // Delete + if ($ebay->endFixedPriceItem($datas)) + Db::getInstance()->Execute('DELETE FROM `'._DB_PREFIX_.'ebay_product` WHERE `id_product_ref` = \''.pSQL($datas['itemID']).'\''); + } + else + { + // Update if ($ebay->reviseFixedPriceItem($datas)) Db::getInstance()->autoExecute(_DB_PREFIX_.'ebay_product', array('date_upd' => pSQL($date)), 'UPDATE', '`id_product_ref` = '.(int)$itemID); @@ -1577,6 +1606,7 @@ class Ebay extends Module Db::getInstance()->autoExecute(_DB_PREFIX_.'ebay_product', array('id_country' => 8, 'id_product' => (int)$product->id, 'id_attribute' => 0, 'id_product_ref' => pSQL($ebay->itemID), 'date_add' => pSQL($date), 'date_upd' => pSQL($date)), 'INSERT'); } } + } else { // Add diff --git a/modules/editorial/editorial.php b/modules/editorial/editorial.php index f9264ac78..9fc562876 100644 --- a/modules/editorial/editorial.php +++ b/modules/editorial/editorial.php @@ -25,7 +25,7 @@ * International Registered Trademark & Property of PrestaShop SA */ -if (!defined('_CAN_LOAD_FILES_')) +if (!defined('_PS_VERSION_')) exit; class Editorial extends Module diff --git a/modules/ekomi/ekomi.php b/modules/ekomi/ekomi.php index 0e646210f..fa7f98f3d 100755 --- a/modules/ekomi/ekomi.php +++ b/modules/ekomi/ekomi.php @@ -24,7 +24,8 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) * International Registered Trademark & Property of PrestaShop SA */ -if (!defined('_CAN_LOAD_FILES_')) + +if (!defined('_PS_VERSION_')) exit; class Ekomi extends Module diff --git a/modules/envoimoinscher/envoimoinscher.php b/modules/envoimoinscher/envoimoinscher.php index fcb8272d2..3150aa7c6 100755 --- a/modules/envoimoinscher/envoimoinscher.php +++ b/modules/envoimoinscher/envoimoinscher.php @@ -24,7 +24,8 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) * International Registered Trademark & Property of PrestaShop SA */ -if (!defined('_CAN_LOAD_FILES_')) + +if (!defined('_PS_VERSION_')) exit; class Envoimoinscher extends Module diff --git a/modules/fedexcarrier/fedexcarrier.php b/modules/fedexcarrier/fedexcarrier.php index 250c29c49..87f686911 100644 --- a/modules/fedexcarrier/fedexcarrier.php +++ b/modules/fedexcarrier/fedexcarrier.php @@ -24,7 +24,8 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) * International Registered Trademark & Property of PrestaShop SA */ -if (!defined('_CAN_LOAD_FILES_')) + +if (!defined('_PS_VERSION_')) exit; class FedexCarrier extends CarrierModule diff --git a/modules/feeder/feeder.php b/modules/feeder/feeder.php index 38cd75b67..1cf0b68a4 100644 --- a/modules/feeder/feeder.php +++ b/modules/feeder/feeder.php @@ -25,7 +25,7 @@ * International Registered Trademark & Property of PrestaShop SA */ -if (!defined('_CAN_LOAD_FILES_')) +if (!defined('_PS_VERSION_')) exit; class Feeder extends Module diff --git a/modules/fianetfraud/fianetfraud.php b/modules/fianetfraud/fianetfraud.php index 487fee8e0..477f93425 100644 --- a/modules/fianetfraud/fianetfraud.php +++ b/modules/fianetfraud/fianetfraud.php @@ -24,7 +24,8 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) * International Registered Trademark & Property of PrestaShop SA */ -if (!defined('_CAN_LOAD_FILES_')) + +if (!defined('_PS_VERSION_')) exit; if ((basename(__FILE__) == 'fianetfraud.php')) diff --git a/modules/fianetsceau/fianetsceau.php b/modules/fianetsceau/fianetsceau.php index aa15f3c57..2d4295561 100644 --- a/modules/fianetsceau/fianetsceau.php +++ b/modules/fianetsceau/fianetsceau.php @@ -24,7 +24,8 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) * International Registered Trademark & Property of PrestaShop SA */ -if (!defined('_CAN_LOAD_FILES_')) + +if (!defined('_PS_VERSION_')) exit; class FianetSceau extends Module diff --git a/modules/followup/followup.php b/modules/followup/followup.php index 8f4323739..cd6b94802 100644 --- a/modules/followup/followup.php +++ b/modules/followup/followup.php @@ -25,7 +25,7 @@ * International Registered Trademark & Property of PrestaShop SA */ -if (!defined('_CAN_LOAD_FILES_')) +if (!defined('_PS_VERSION_')) exit; class Followup extends Module diff --git a/modules/gadsense/gadsense.php b/modules/gadsense/gadsense.php index ae7f0644d..d1e088f0b 100644 --- a/modules/gadsense/gadsense.php +++ b/modules/gadsense/gadsense.php @@ -25,7 +25,7 @@ * International Registered Trademark & Property of PrestaShop SA */ -if (!defined('_CAN_LOAD_FILES_')) +if (!defined('_PS_VERSION_')) exit; class GAdsense extends Module diff --git a/modules/ganalytics/ganalytics.php b/modules/ganalytics/ganalytics.php index 7e20c45f0..493d7e970 100644 --- a/modules/ganalytics/ganalytics.php +++ b/modules/ganalytics/ganalytics.php @@ -1,6 +1,31 @@ +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision$ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ -if (!defined('_CAN_LOAD_FILES_')) +if (!defined('_PS_VERSION_')) exit; class GAnalytics extends Module diff --git a/modules/gcheckout/gcheckout.php b/modules/gcheckout/gcheckout.php index 97ceb607f..16fe8fb1f 100644 --- a/modules/gcheckout/gcheckout.php +++ b/modules/gcheckout/gcheckout.php @@ -25,7 +25,7 @@ * International Registered Trademark & Property of PrestaShop SA */ -if (!defined('_CAN_LOAD_FILES_')) +if (!defined('_PS_VERSION_')) exit; class GCheckout extends PaymentModule diff --git a/modules/graphartichow/graphartichow.php b/modules/graphartichow/graphartichow.php index 731f3af96..0e3dbdeaf 100644 --- a/modules/graphartichow/graphartichow.php +++ b/modules/graphartichow/graphartichow.php @@ -25,7 +25,7 @@ * International Registered Trademark & Property of PrestaShop SA */ -if (!defined('_CAN_LOAD_FILES_')) +if (!defined('_PS_VERSION_')) exit; class GraphArtichow extends ModuleGraphEngine diff --git a/modules/graphgooglechart/graphgooglechart.php b/modules/graphgooglechart/graphgooglechart.php index 7f4aeba49..bf2491ae0 100644 --- a/modules/graphgooglechart/graphgooglechart.php +++ b/modules/graphgooglechart/graphgooglechart.php @@ -25,7 +25,7 @@ * International Registered Trademark & Property of PrestaShop SA */ -if (!defined('_CAN_LOAD_FILES_')) +if (!defined('_PS_VERSION_')) exit; class GraphGoogleChart extends ModuleGraphEngine diff --git a/modules/graphvisifire/graphvisifire.php b/modules/graphvisifire/graphvisifire.php index 3753cfc5f..265826370 100644 --- a/modules/graphvisifire/graphvisifire.php +++ b/modules/graphvisifire/graphvisifire.php @@ -25,7 +25,7 @@ * International Registered Trademark & Property of PrestaShop SA */ -if (!defined('_CAN_LOAD_FILES_')) +if (!defined('_PS_VERSION_')) exit; class GraphVisifire extends ModuleGraphEngine diff --git a/modules/graphxmlswfcharts/graphxmlswfcharts.php b/modules/graphxmlswfcharts/graphxmlswfcharts.php index d3eac49b3..32fd307f1 100644 --- a/modules/graphxmlswfcharts/graphxmlswfcharts.php +++ b/modules/graphxmlswfcharts/graphxmlswfcharts.php @@ -35,7 +35,7 @@ * @version 1.4 */ -if (!defined('_CAN_LOAD_FILES_')) +if (!defined('_PS_VERSION_')) exit; class GraphXmlSwfCharts extends ModuleGraphEngine diff --git a/modules/gridhtml/gridhtml.php b/modules/gridhtml/gridhtml.php index 798c4266f..aae22e449 100644 --- a/modules/gridhtml/gridhtml.php +++ b/modules/gridhtml/gridhtml.php @@ -25,7 +25,7 @@ * International Registered Trademark & Property of PrestaShop SA */ -if (!defined('_CAN_LOAD_FILES_')) +if (!defined('_PS_VERSION_')) exit; class GridHtml extends ModuleGridEngine diff --git a/modules/gsitemap/gsitemap.php b/modules/gsitemap/gsitemap.php index 28598844f..c072fb9e7 100644 --- a/modules/gsitemap/gsitemap.php +++ b/modules/gsitemap/gsitemap.php @@ -25,7 +25,7 @@ * International Registered Trademark & Property of PrestaShop SA */ -if (!defined('_CAN_LOAD_FILES_')) +if (!defined('_PS_VERSION_')) exit; class Gsitemap extends Module diff --git a/modules/hipay/hipay.php b/modules/hipay/hipay.php index 3bb14c6cf..375a83402 100644 --- a/modules/hipay/hipay.php +++ b/modules/hipay/hipay.php @@ -25,7 +25,7 @@ * International Registered Trademark & Property of PrestaShop SA */ -if (!defined('_CAN_LOAD_FILES_')) +if (!defined('_PS_VERSION_')) exit; class Hipay extends PaymentModule diff --git a/modules/homefeatured/homefeatured.php b/modules/homefeatured/homefeatured.php index 052860a8a..4d627c40a 100644 --- a/modules/homefeatured/homefeatured.php +++ b/modules/homefeatured/homefeatured.php @@ -25,7 +25,7 @@ * International Registered Trademark & Property of PrestaShop SA */ -if (!defined('_CAN_LOAD_FILES_')) +if (!defined('_PS_VERSION_')) exit; class HomeFeatured extends Module diff --git a/modules/iadvize/iadvize.php b/modules/iadvize/iadvize.php index ef8fc5bae..9d0cace82 100755 --- a/modules/iadvize/iadvize.php +++ b/modules/iadvize/iadvize.php @@ -24,7 +24,8 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) * International Registered Trademark & Property of PrestaShop SA */ -if (!defined('_CAN_LOAD_FILES_')) + +if (!defined('_PS_VERSION_')) exit; class iAdvize extends Module @@ -156,4 +157,4 @@ class iAdvize extends Module '."\n"; } -} \ No newline at end of file +} diff --git a/modules/importerosc/importerosc.php b/modules/importerosc/importerosc.php index a25b417db..bea3ecf98 100644 --- a/modules/importerosc/importerosc.php +++ b/modules/importerosc/importerosc.php @@ -1,5 +1,31 @@ +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision$ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +if (!defined('_PS_VERSION_')) exit; class importerosc extends ImportModule diff --git a/modules/livezilla/livezilla.php b/modules/livezilla/livezilla.php index f4a69c8ee..c95876edf 100644 --- a/modules/livezilla/livezilla.php +++ b/modules/livezilla/livezilla.php @@ -25,7 +25,7 @@ * International Registered Trademark & Property of PrestaShop SA */ -if (!defined('_CAN_LOAD_FILES_')) +if (!defined('_PS_VERSION_')) exit; class LiveZilla extends Module @@ -118,4 +118,4 @@ class LiveZilla extends Module { return $this->displayBlock(); } -} \ No newline at end of file +} diff --git a/modules/loyalty/LoyaltyModule.php b/modules/loyalty/LoyaltyModule.php index 7ee697c40..7f3880e87 100644 --- a/modules/loyalty/LoyaltyModule.php +++ b/modules/loyalty/LoyaltyModule.php @@ -25,7 +25,7 @@ * International Registered Trademark & Property of PrestaShop SA */ -if (!defined('_CAN_LOAD_FILES_')) +if (!defined('_PS_VERSION_')) exit; class LoyaltyModule extends ObjectModel @@ -240,4 +240,4 @@ class LoyaltyModule extends ObjectModel VALUES ('.(int)($this->id).', '.(int)($this->id_loyalty_state).', '.(int)($this->points).', NOW())'); } -} \ No newline at end of file +} diff --git a/modules/loyalty/LoyaltyStateModule.php b/modules/loyalty/LoyaltyStateModule.php index b85756eed..d21190bf4 100644 --- a/modules/loyalty/LoyaltyStateModule.php +++ b/modules/loyalty/LoyaltyStateModule.php @@ -25,7 +25,7 @@ * International Registered Trademark & Property of PrestaShop SA */ -if (!defined('_CAN_LOAD_FILES_')) +if (!defined('_PS_VERSION_')) exit; class LoyaltyStateModule extends ObjectModel @@ -90,4 +90,4 @@ class LoyaltyStateModule extends ObjectModel return true; } -} \ No newline at end of file +} diff --git a/modules/loyalty/loyalty.php b/modules/loyalty/loyalty.php index e79f619ee..c9cce2823 100644 --- a/modules/loyalty/loyalty.php +++ b/modules/loyalty/loyalty.php @@ -25,7 +25,7 @@ * International Registered Trademark & Property of PrestaShop SA */ -if (!defined('_CAN_LOAD_FILES_')) +if (!defined('_PS_VERSION_')) exit; /* diff --git a/modules/mailalerts/mailalerts.php b/modules/mailalerts/mailalerts.php index 5850032af..8ec622440 100644 --- a/modules/mailalerts/mailalerts.php +++ b/modules/mailalerts/mailalerts.php @@ -25,7 +25,7 @@ * International Registered Trademark & Property of PrestaShop SA */ -if (!defined('_CAN_LOAD_FILES_')) +if (!defined('_PS_VERSION_')) exit; class MailAlerts extends Module @@ -580,4 +580,4 @@ class MailAlerts extends Module WHERE `id_product_attribute` = '.(int)$params['id_product_attribute'].' AND `id_product` = '.(int)$params['id_product']); } -} \ No newline at end of file +} diff --git a/modules/mondialrelay/mondialrelay.php b/modules/mondialrelay/mondialrelay.php index 6fa63c725..0167541d0 100755 --- a/modules/mondialrelay/mondialrelay.php +++ b/modules/mondialrelay/mondialrelay.php @@ -25,7 +25,7 @@ * International Registered Trademark & Property of PrestaShop SA */ -if (!defined('_CAN_LOAD_FILES_')) +if (!defined('_PS_VERSION_')) exit; require_once(_PS_MODULE_DIR_.'mondialrelay/classes/MondialRelayClass.php'); diff --git a/modules/moneybookers/moneybookers.php b/modules/moneybookers/moneybookers.php index c910912af..6dde13c06 100644 --- a/modules/moneybookers/moneybookers.php +++ b/modules/moneybookers/moneybookers.php @@ -25,7 +25,7 @@ * International Registered Trademark & Property of PrestaShop SA */ -if (!defined('_CAN_LOAD_FILES_')) +if (!defined('_PS_VERSION_')) exit; class MoneyBookers extends PaymentModule diff --git a/modules/newsletter/newsletter.php b/modules/newsletter/newsletter.php index 7611ab37c..b0da5d4d5 100644 --- a/modules/newsletter/newsletter.php +++ b/modules/newsletter/newsletter.php @@ -25,7 +25,7 @@ * International Registered Trademark & Property of PrestaShop SA */ -if (!defined('_CAN_LOAD_FILES_')) +if (!defined('_PS_VERSION_')) exit; class Newsletter extends Module diff --git a/modules/ogone/ogone.php b/modules/ogone/ogone.php index 20b3608ec..764301afe 100644 --- a/modules/ogone/ogone.php +++ b/modules/ogone/ogone.php @@ -25,6 +25,9 @@ * International Registered Trademark & Property of PrestaShop SA */ +if (!defined('_PS_VERSION_')) + exit; + class Ogone extends PaymentModule { private $_ignoreKeyList = array('secure_key'); @@ -213,4 +216,4 @@ class Ogone extends PaymentModule $pcc->add(); } } -} \ No newline at end of file +} diff --git a/modules/pagesnotfound/pagesnotfound.php b/modules/pagesnotfound/pagesnotfound.php index efeb80ce9..7cc5b2707 100644 --- a/modules/pagesnotfound/pagesnotfound.php +++ b/modules/pagesnotfound/pagesnotfound.php @@ -25,7 +25,7 @@ * International Registered Trademark & Property of PrestaShop SA */ -if (!defined('_CAN_LOAD_FILES_')) +if (!defined('_PS_VERSION_')) exit; class Pagesnotfound extends Module diff --git a/modules/paypal/paypal.php b/modules/paypal/paypal.php index e0c93c3e8..e7bae5a40 100644 --- a/modules/paypal/paypal.php +++ b/modules/paypal/paypal.php @@ -24,7 +24,8 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) * International Registered Trademark & Property of PrestaShop SA */ -if (!defined('_CAN_LOAD_FILES_')) + +if (!defined('_PS_VERSION_')) exit; define('_PAYPAL_INTEGRAL_', 0); diff --git a/modules/paysafecard/paysafecard.php b/modules/paysafecard/paysafecard.php index 0e67f2ea4..0f5075bf7 100644 --- a/modules/paysafecard/paysafecard.php +++ b/modules/paysafecard/paysafecard.php @@ -24,7 +24,8 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) * International Registered Trademark & Property of PrestaShop SA */ -if (!defined('_CAN_LOAD_FILES_')) + +if (!defined('_PS_VERSION_')) exit; include_once(_PS_MODULE_DIR_.'paysafecard/PrepaidServices.php'); diff --git a/modules/prestafraud/prestafraud.php b/modules/prestafraud/prestafraud.php index 433520787..651d04cd8 100644 --- a/modules/prestafraud/prestafraud.php +++ b/modules/prestafraud/prestafraud.php @@ -25,7 +25,8 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) * International Registred Trademark & Property of PrestaShop SA */ -if (!defined('_CAN_LOAD_FILES_')) + +if (!defined('_PS_VERSION_')) exit; class PrestaFraud extends Module diff --git a/modules/productcomments/ProductComment.php b/modules/productcomments/ProductComment.php index f55c85810..575cfb39c 100644 --- a/modules/productcomments/ProductComment.php +++ b/modules/productcomments/ProductComment.php @@ -26,7 +26,7 @@ * International Registered Trademark & Property of PrestaShop SA */ -if (!defined('_CAN_LOAD_FILES_')) +if (!defined('_PS_VERSION_')) exit; class ProductComment extends ObjectModel diff --git a/modules/productcomments/productcomments.php b/modules/productcomments/productcomments.php index 21d2e4b97..cf2c82986 100644 --- a/modules/productcomments/productcomments.php +++ b/modules/productcomments/productcomments.php @@ -25,7 +25,7 @@ * International Registered Trademark & Property of PrestaShop SA */ -if (!defined('_CAN_LOAD_FILES_')) +if (!defined('_PS_VERSION_')) exit; class ProductComments extends Module diff --git a/modules/productscategory/productscategory.php b/modules/productscategory/productscategory.php index ae5d60e3c..63a177099 100644 --- a/modules/productscategory/productscategory.php +++ b/modules/productscategory/productscategory.php @@ -25,7 +25,7 @@ * International Registered Trademark & Property of PrestaShop SA */ -if (!defined('_CAN_LOAD_FILES_')) +if (!defined('_PS_VERSION_')) exit; class productsCategory extends Module @@ -177,4 +177,4 @@ class productsCategory extends Module $this->context->controller->addCSS($this->_path.'productscategory.css', 'all'); $this->context->controller->addJS(array($this->_path.'productscategory.js', _PS_JS_DIR_.'jquery/jquery.serialScroll-1.2.2-min.js')); } -} \ No newline at end of file +} diff --git a/modules/producttooltip/producttooltip.php b/modules/producttooltip/producttooltip.php index c2f7c50ab..a4ef68b26 100644 --- a/modules/producttooltip/producttooltip.php +++ b/modules/producttooltip/producttooltip.php @@ -25,7 +25,7 @@ * International Registered Trademark & Property of PrestaShop SA */ -if (!defined('_CAN_LOAD_FILES_')) +if (!defined('_PS_VERSION_')) exit; class ProductToolTip extends Module diff --git a/modules/referralprogram/ReferralProgramModule.php b/modules/referralprogram/ReferralProgramModule.php index 52a53e214..c2c1e98c5 100644 --- a/modules/referralprogram/ReferralProgramModule.php +++ b/modules/referralprogram/ReferralProgramModule.php @@ -25,7 +25,7 @@ * International Registered Trademark & Property of PrestaShop SA */ -if (!defined('_CAN_LOAD_FILES_')) +if (!defined('_PS_VERSION_')) exit; class ReferralProgramModule extends ObjectModel diff --git a/modules/referralprogram/referralprogram.php b/modules/referralprogram/referralprogram.php index d6dc30f79..044c7dfcf 100644 --- a/modules/referralprogram/referralprogram.php +++ b/modules/referralprogram/referralprogram.php @@ -25,7 +25,7 @@ * International Registered Trademark & Property of PrestaShop SA */ -if (!defined('_CAN_LOAD_FILES_')) +if (!defined('_PS_VERSION_')) exit; class ReferralProgram extends Module diff --git a/modules/reverso/reverso.php b/modules/reverso/reverso.php index 04a2ddbc9..056d91ce1 100644 --- a/modules/reverso/reverso.php +++ b/modules/reverso/reverso.php @@ -25,7 +25,7 @@ * International Registered Trademark & Property of PrestaShop SA */ -if (!defined('_CAN_LOAD_FILES_')) +if (!defined('_PS_VERSION_')) exit; class Reverso extends Module diff --git a/modules/secuvad/secuvad.php b/modules/secuvad/secuvad.php index d6bae3ba2..31b1a840f 100644 --- a/modules/secuvad/secuvad.php +++ b/modules/secuvad/secuvad.php @@ -24,7 +24,8 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) * International Registered Trademark & Property of PrestaShop SA */ -if (!defined('_CAN_LOAD_FILES_')) + +if (!defined('_PS_VERSION_')) exit; class Secuvad extends Module diff --git a/modules/sekeywords/sekeywords.php b/modules/sekeywords/sekeywords.php index 12cc0ebdd..7332642c8 100644 --- a/modules/sekeywords/sekeywords.php +++ b/modules/sekeywords/sekeywords.php @@ -25,7 +25,7 @@ * International Registered Trademark & Property of PrestaShop SA */ -if (!defined('_CAN_LOAD_FILES_')) +if (!defined('_PS_VERSION_')) exit; class SEKeywords extends ModuleGraph diff --git a/modules/sendtoafriend/sendtoafriend.php b/modules/sendtoafriend/sendtoafriend.php index 0e94cb49f..b0b74e167 100644 --- a/modules/sendtoafriend/sendtoafriend.php +++ b/modules/sendtoafriend/sendtoafriend.php @@ -25,7 +25,7 @@ * International Registered Trademark & Property of PrestaShop SA */ -if (!defined('_CAN_LOAD_FILES_')) +if (!defined('_PS_VERSION_')) exit; class sendToAFriend extends Module diff --git a/modules/shopimporter/shopimporter.php b/modules/shopimporter/shopimporter.php index 1267bf092..314eead39 100644 --- a/modules/shopimporter/shopimporter.php +++ b/modules/shopimporter/shopimporter.php @@ -1,4 +1,32 @@ +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision$ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +if (!defined('_PS_VERSION_')) + exit; class shopimporter extends ImportModule { diff --git a/modules/socolissimo/socolissimo.php b/modules/socolissimo/socolissimo.php index 53c4fff77..5c8db8dc6 100644 --- a/modules/socolissimo/socolissimo.php +++ b/modules/socolissimo/socolissimo.php @@ -25,7 +25,7 @@ * International Registered Trademark & Property of PrestaShop SA */ -if (!defined('_CAN_LOAD_FILES_')) +if (!defined('_PS_VERSION_')) exit; class Socolissimo extends CarrierModule diff --git a/modules/statsbestcategories/statsbestcategories.php b/modules/statsbestcategories/statsbestcategories.php index a7a98d9d3..45aa3b9c8 100644 --- a/modules/statsbestcategories/statsbestcategories.php +++ b/modules/statsbestcategories/statsbestcategories.php @@ -25,7 +25,7 @@ * International Registered Trademark & Property of PrestaShop SA */ -if (!defined('_CAN_LOAD_FILES_')) +if (!defined('_PS_VERSION_')) exit; class StatsBestCategories extends ModuleGrid diff --git a/modules/statsbestcustomers/statsbestcustomers.php b/modules/statsbestcustomers/statsbestcustomers.php index 4cd7e1a77..6789a0680 100644 --- a/modules/statsbestcustomers/statsbestcustomers.php +++ b/modules/statsbestcustomers/statsbestcustomers.php @@ -25,7 +25,7 @@ * International Registered Trademark & Property of PrestaShop SA */ -if (!defined('_CAN_LOAD_FILES_')) +if (!defined('_PS_VERSION_')) exit; class StatsBestCustomers extends ModuleGrid diff --git a/modules/statsbestmanufacturers/statsbestmanufacturers.php b/modules/statsbestmanufacturers/statsbestmanufacturers.php index 4d14972da..1e7e5a333 100755 --- a/modules/statsbestmanufacturers/statsbestmanufacturers.php +++ b/modules/statsbestmanufacturers/statsbestmanufacturers.php @@ -25,10 +25,9 @@ * International Registered Trademark & Property of PrestaShop SA */ -if (!defined('_CAN_LOAD_FILES_')) +if (!defined('_PS_VERSION_')) exit; - class StatsBestManufacturers extends ModuleGrid { private $_html = null; diff --git a/modules/statsbestproducts/statsbestproducts.php b/modules/statsbestproducts/statsbestproducts.php index dcf7cdfbe..14fd9c737 100644 --- a/modules/statsbestproducts/statsbestproducts.php +++ b/modules/statsbestproducts/statsbestproducts.php @@ -25,7 +25,7 @@ * International Registered Trademark & Property of PrestaShop SA */ -if (!defined('_CAN_LOAD_FILES_')) +if (!defined('_PS_VERSION_')) exit; class StatsBestProducts extends ModuleGrid diff --git a/modules/statsbestsuppliers/statsbestsuppliers.php b/modules/statsbestsuppliers/statsbestsuppliers.php index ac482433b..bb8e028c4 100644 --- a/modules/statsbestsuppliers/statsbestsuppliers.php +++ b/modules/statsbestsuppliers/statsbestsuppliers.php @@ -25,7 +25,7 @@ * International Registered Trademark & Property of PrestaShop SA */ -if (!defined('_CAN_LOAD_FILES_')) +if (!defined('_PS_VERSION_')) exit; class StatsBestSuppliers extends ModuleGrid diff --git a/modules/statsbestvouchers/statsbestvouchers.php b/modules/statsbestvouchers/statsbestvouchers.php index 027095298..e7f6bc9c5 100644 --- a/modules/statsbestvouchers/statsbestvouchers.php +++ b/modules/statsbestvouchers/statsbestvouchers.php @@ -25,7 +25,7 @@ * International Registered Trademark & Property of PrestaShop SA */ -if (!defined('_CAN_LOAD_FILES_')) +if (!defined('_PS_VERSION_')) exit; class StatsBestVouchers extends ModuleGrid @@ -129,4 +129,4 @@ class StatsBestVouchers extends ModuleGrid $this->_values = Db::getInstance(_PS_USE_SQL_SLAVE_)->ExecuteS($this->_query); $this->_totalCount = Db::getInstance(_PS_USE_SQL_SLAVE_)->getValue('SELECT FOUND_ROWS()'); } -} \ No newline at end of file +} diff --git a/modules/statscarrier/statscarrier.php b/modules/statscarrier/statscarrier.php index 86bfde698..bf2e0c6a3 100644 --- a/modules/statscarrier/statscarrier.php +++ b/modules/statscarrier/statscarrier.php @@ -25,7 +25,7 @@ * International Registered Trademark & Property of PrestaShop SA */ -if (!defined('_CAN_LOAD_FILES_')) +if (!defined('_PS_VERSION_')) exit; class StatsCarrier extends ModuleGraph diff --git a/modules/statscatalog/statscatalog.php b/modules/statscatalog/statscatalog.php index eea5e793b..d9e46c2e1 100644 --- a/modules/statscatalog/statscatalog.php +++ b/modules/statscatalog/statscatalog.php @@ -25,7 +25,7 @@ * International Registered Trademark & Property of PrestaShop SA */ -if (!defined('_CAN_LOAD_FILES_')) +if (!defined('_PS_VERSION_')) exit; class StatsCatalog extends Module diff --git a/modules/statscheckup/statscheckup.php b/modules/statscheckup/statscheckup.php index 7a3ee18f6..8869355ba 100644 --- a/modules/statscheckup/statscheckup.php +++ b/modules/statscheckup/statscheckup.php @@ -25,7 +25,7 @@ * International Registered Trademark & Property of PrestaShop SA */ -if (!defined('_CAN_LOAD_FILES_')) +if (!defined('_PS_VERSION_')) exit; class StatsCheckUp extends Module diff --git a/modules/statsdata/statsdata.php b/modules/statsdata/statsdata.php index ac28cee6a..be00b9b8e 100644 --- a/modules/statsdata/statsdata.php +++ b/modules/statsdata/statsdata.php @@ -25,7 +25,7 @@ * International Registered Trademark & Property of PrestaShop SA */ -if (!defined('_CAN_LOAD_FILES_')) +if (!defined('_PS_VERSION_')) exit; class StatsData extends Module diff --git a/modules/statsequipment/statsequipment.php b/modules/statsequipment/statsequipment.php index 5815d0b0b..44f0f2232 100644 --- a/modules/statsequipment/statsequipment.php +++ b/modules/statsequipment/statsequipment.php @@ -25,7 +25,7 @@ * International Registered Trademark & Property of PrestaShop SA */ -if (!defined('_CAN_LOAD_FILES_')) +if (!defined('_PS_VERSION_')) exit; class StatsEquipment extends ModuleGraph diff --git a/modules/statsforecast/statsforecast.php b/modules/statsforecast/statsforecast.php index eace61d6d..9d31c364e 100644 --- a/modules/statsforecast/statsforecast.php +++ b/modules/statsforecast/statsforecast.php @@ -24,7 +24,8 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) * International Registered Trademark & Property of PrestaShop SA */ -if (!defined('_CAN_LOAD_FILES_')) + +if (!defined('_PS_VERSION_')) exit; class StatsForecast extends Module diff --git a/modules/statsgeolocation/statsgeolocation.php b/modules/statsgeolocation/statsgeolocation.php index c41201197..f4d7f165b 100644 --- a/modules/statsgeolocation/statsgeolocation.php +++ b/modules/statsgeolocation/statsgeolocation.php @@ -25,7 +25,7 @@ * International Registered Trademark & Property of PrestaShop SA */ -if (!defined('_CAN_LOAD_FILES_')) +if (!defined('_PS_VERSION_')) exit; class StatsGeoLocation extends Module diff --git a/modules/statslive/statslive.php b/modules/statslive/statslive.php index 5c46a9da5..c10b5b48b 100644 --- a/modules/statslive/statslive.php +++ b/modules/statslive/statslive.php @@ -25,7 +25,7 @@ * International Registered Trademark & Property of PrestaShop SA */ -if (!defined('_CAN_LOAD_FILES_')) +if (!defined('_PS_VERSION_')) exit; class StatsLive extends Module diff --git a/modules/statsnewsletter/statsnewsletter.php b/modules/statsnewsletter/statsnewsletter.php index d746cd6f1..a07cba51d 100644 --- a/modules/statsnewsletter/statsnewsletter.php +++ b/modules/statsnewsletter/statsnewsletter.php @@ -25,7 +25,7 @@ * International Registered Trademark & Property of PrestaShop SA */ -if (!defined('_CAN_LOAD_FILES_')) +if (!defined('_PS_VERSION_')) exit; class StatsNewsletter extends ModuleGraph diff --git a/modules/statsorigin/statsorigin.php b/modules/statsorigin/statsorigin.php index bc9caf281..cfc87150b 100644 --- a/modules/statsorigin/statsorigin.php +++ b/modules/statsorigin/statsorigin.php @@ -25,7 +25,7 @@ * International Registered Trademark & Property of PrestaShop SA */ -if (!defined('_CAN_LOAD_FILES_')) +if (!defined('_PS_VERSION_')) exit; class StatsOrigin extends ModuleGraph diff --git a/modules/statspersonalinfos/statspersonalinfos.php b/modules/statspersonalinfos/statspersonalinfos.php index e35e7f1e4..2aabd35b3 100644 --- a/modules/statspersonalinfos/statspersonalinfos.php +++ b/modules/statspersonalinfos/statspersonalinfos.php @@ -25,7 +25,7 @@ * International Registered Trademark & Property of PrestaShop SA */ -if (!defined('_CAN_LOAD_FILES_')) +if (!defined('_PS_VERSION_')) exit; class StatsPersonalInfos extends ModuleGraph diff --git a/modules/statsproduct/statsproduct.php b/modules/statsproduct/statsproduct.php index 41c5b3fa1..2128ba129 100644 --- a/modules/statsproduct/statsproduct.php +++ b/modules/statsproduct/statsproduct.php @@ -25,7 +25,7 @@ * International Registered Trademark & Property of PrestaShop SA */ -if (!defined('_CAN_LOAD_FILES_')) +if (!defined('_PS_VERSION_')) exit; class StatsProduct extends ModuleGraph diff --git a/modules/statsregistrations/statsregistrations.php b/modules/statsregistrations/statsregistrations.php index f7e71c3a1..21dd82340 100644 --- a/modules/statsregistrations/statsregistrations.php +++ b/modules/statsregistrations/statsregistrations.php @@ -25,7 +25,7 @@ * International Registered Trademark & Property of PrestaShop SA */ -if (!defined('_CAN_LOAD_FILES_')) +if (!defined('_PS_VERSION_')) exit; class StatsRegistrations extends ModuleGraph diff --git a/modules/statssales/statssales.php b/modules/statssales/statssales.php index d0c2d9bb5..3527ad753 100644 --- a/modules/statssales/statssales.php +++ b/modules/statssales/statssales.php @@ -25,7 +25,7 @@ * International Registered Trademark & Property of PrestaShop SA */ -if (!defined('_CAN_LOAD_FILES_')) +if (!defined('_PS_VERSION_')) exit; class StatsSales extends ModuleGraph @@ -252,4 +252,4 @@ class StatsSales extends ModuleGraph $this->_legend[] = $row['name']; } } -} \ No newline at end of file +} diff --git a/modules/statssearch/statssearch.php b/modules/statssearch/statssearch.php index d63a1cd16..dc6544dfc 100644 --- a/modules/statssearch/statssearch.php +++ b/modules/statssearch/statssearch.php @@ -25,7 +25,7 @@ * International Registered Trademark & Property of PrestaShop SA */ -if (!defined('_CAN_LOAD_FILES_')) +if (!defined('_PS_VERSION_')) exit; class StatsSearch extends ModuleGraph diff --git a/modules/statsstock/statsstock.php b/modules/statsstock/statsstock.php index 9be33268b..766813815 100644 --- a/modules/statsstock/statsstock.php +++ b/modules/statsstock/statsstock.php @@ -25,7 +25,7 @@ * International Registered Trademark & Property of PrestaShop SA */ -if (!defined('_CAN_LOAD_FILES_')) +if (!defined('_PS_VERSION_')) exit; class StatsStock extends Module diff --git a/modules/statsvisits/statsvisits.php b/modules/statsvisits/statsvisits.php index ac462386f..d9fa96cd4 100644 --- a/modules/statsvisits/statsvisits.php +++ b/modules/statsvisits/statsvisits.php @@ -25,8 +25,7 @@ * International Registered Trademark & Property of PrestaShop SA */ - -if (!defined('_CAN_LOAD_FILES_')) +if (!defined('_PS_VERSION_')) exit; class StatsVisits extends ModuleGraph diff --git a/modules/themeinstallator/themeinstallator.php b/modules/themeinstallator/themeinstallator.php index df1f7e331..0fcb67b89 100644 --- a/modules/themeinstallator/themeinstallator.php +++ b/modules/themeinstallator/themeinstallator.php @@ -24,7 +24,8 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) * International Registered Trademark & Property of PrestaShop SA */ -if (!defined('_CAN_LOAD_FILES_')) + +if (!defined('_PS_VERSION_')) exit; class ThemeInstallator extends Module diff --git a/modules/trackingfront/trackingfront.php b/modules/trackingfront/trackingfront.php index 433cad766..ce18c718b 100644 --- a/modules/trackingfront/trackingfront.php +++ b/modules/trackingfront/trackingfront.php @@ -25,7 +25,7 @@ * International Registered Trademark & Property of PrestaShop SA */ -if (!defined('_CAN_LOAD_FILES_')) +if (!defined('_PS_VERSION_')) exit; class TrackingFront extends Module diff --git a/modules/treepodia/config.xml b/modules/treepodia/config.xml index 78d283dc3..0c1548148 100755 --- a/modules/treepodia/config.xml +++ b/modules/treepodia/config.xml @@ -2,11 +2,11 @@ treepodia - + 1 1 - + \ No newline at end of file diff --git a/modules/treepodia/treepodia.php b/modules/treepodia/treepodia.php index c7176fbd4..34b7e6b9d 100644 --- a/modules/treepodia/treepodia.php +++ b/modules/treepodia/treepodia.php @@ -24,7 +24,8 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) * International Registered Trademark & Property of PrestaShop SA */ -if (!defined('_CAN_LOAD_FILES_')) + +if (!defined('_PS_VERSION_')) exit; class SimpleXMLExtended extends SimpleXMLElement @@ -46,7 +47,7 @@ class Treepodia extends Module { $this->name = 'treepodia'; $this->tab = 'front_office_features'; - $this->version = '1.4'; + $this->version = '1.5'; $this->displayName = 'Treepodia'; parent::__construct(); @@ -82,9 +83,11 @@ class Treepodia extends Module private function _getShopURL() { - $host = ((Configuration::get('PS_SSL_ENABLED') OR (!empty($_SERVER['HTTPS']) AND strtolower($_SERVER['HTTPS']) != 'off')) ? Tools::getShopDomainSsl() : Tools::getShopDomain()).__PS_BASE_URI__; - if (substr($host, 0, 4) != 'http') - $host = ((Configuration::get('PS_SSL_ENABLED') OR (!empty($_SERVER['HTTPS']) AND strtolower($_SERVER['HTTPS']) != 'off')) ? 'https://'.$host : 'http://'.$host); + if (!($domain = Configuration::get('PS_SHOP_DOMAIN'))) + $domain = $_SERVER['HTTP_HOST']; + + $host = ((Configuration::get('PS_SSL_ENABLED') OR (!empty($_SERVER['HTTPS']) AND strtolower($_SERVER['HTTPS']) != 'off')) ? 'https://'.$domain : 'http://'.$domain).__PS_BASE_URI__; + return $host; } diff --git a/modules/trustedshops/trustedshops.php b/modules/trustedshops/trustedshops.php index 7e8de2f63..cc0b38b80 100644 --- a/modules/trustedshops/trustedshops.php +++ b/modules/trustedshops/trustedshops.php @@ -24,7 +24,8 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) * International Registered Trademark & Property of PrestaShop SA */ -if (!defined('_CAN_LOAD_FILES_')) + +if (!defined('_PS_VERSION_')) exit; require (_PS_MODULE_DIR_.'trustedshops/lib/AbsTrustedShops.php'); diff --git a/modules/twenga/config.xml b/modules/twenga/config.xml index 15a72ab00..10533bb67 100644 --- a/modules/twenga/config.xml +++ b/modules/twenga/config.xml @@ -9,4 +9,4 @@ 1 1 - + \ No newline at end of file diff --git a/modules/twenga/twenga.php b/modules/twenga/twenga.php index fbfc6f6f1..49fdcfb6e 100644 --- a/modules/twenga/twenga.php +++ b/modules/twenga/twenga.php @@ -33,7 +33,8 @@ * @author Nans Pellicari - Prestashop * @version 1.3 */ -if (!defined('_CAN_LOAD_FILES_')) + +if (!defined('_PS_VERSION_')) exit; class Twenga extends PaymentModule diff --git a/modules/upscarrier/upscarrier.php b/modules/upscarrier/upscarrier.php index 1d0eeb7df..e353684df 100644 --- a/modules/upscarrier/upscarrier.php +++ b/modules/upscarrier/upscarrier.php @@ -24,7 +24,8 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) * International Registered Trademark & Property of PrestaShop SA */ -if (!defined('_CAN_LOAD_FILES_')) + +if (!defined('_PS_VERSION_')) exit; class UpsCarrier extends CarrierModule diff --git a/modules/uspscarrier/uspscarrier.php b/modules/uspscarrier/uspscarrier.php index 6e040a33b..f15e33486 100644 --- a/modules/uspscarrier/uspscarrier.php +++ b/modules/uspscarrier/uspscarrier.php @@ -24,7 +24,8 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) * International Registered Trademark & Property of PrestaShop SA */ -if (!defined('_CAN_LOAD_FILES_')) + +if (!defined('_PS_VERSION_')) exit; class UspsCarrier extends CarrierModule diff --git a/modules/vatnumber/vatnumber.php b/modules/vatnumber/vatnumber.php index 9a9247849..2fcca79c5 100755 --- a/modules/vatnumber/vatnumber.php +++ b/modules/vatnumber/vatnumber.php @@ -24,7 +24,8 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) * International Registered Trademark & Property of PrestaShop SA */ -if (!defined('_CAN_LOAD_FILES_')) + +if (!defined('_PS_VERSION_')) exit; class VatNumber extends Module diff --git a/modules/watermark/watermark.php b/modules/watermark/watermark.php index 788385d99..b7885841f 100644 --- a/modules/watermark/watermark.php +++ b/modules/watermark/watermark.php @@ -25,7 +25,7 @@ * International Registered Trademark & Property of PrestaShop SA */ -if (!defined('_CAN_LOAD_FILES_')) +if (!defined('_PS_VERSION_')) exit; class Watermark extends Module diff --git a/translations/fr/admin.php b/translations/fr/admin.php index 797c08942..0482b5410 100644 --- a/translations/fr/admin.php +++ b/translations/fr/admin.php @@ -1000,6 +1000,7 @@ $_LANGADM['AdminGroups817b35caca2afa11b6c1efc428315470'] = 'Groupe de boutiques $_LANGADM['AdminGroups19f823c6453c2b1ffd09cb715214813d'] = 'Champs requis'; $_LANGADM['AdminGroupsc53a3dc4f27d93e065c2c5be5a78b74f'] = 'Nouvelle réduction de groupe'; $_LANGADM['AdminGroups56a8a9eb05f9014da51a4f9b57322ac7'] = 'Catégorie :'; +$_LANGADM['AdminGroups60c4a9a7f56f6b9669f84977ebd0f93d'] = 'Seuls les produits qui ont cette catégorie par défaut seront ajoutés'; $_LANGADM['AdminGroups567183b8b1122180690be51cc6df2b74'] = 'Réduction (en %) :'; $_LANGADM['AdminGroups1fe63847218648baf13474e3d25747bb'] = 'Ajouter'; $_LANGADM['AdminGroupsdaab80c5dadc81fa2d019c562f805994'] = 'Sexe';