// Merge -> revision 9124

This commit is contained in:
rMalie
2011-10-07 09:54:43 +00:00
parent 22d560688d
commit d46fbbc039
56 changed files with 1682 additions and 1656 deletions
+4 -4
View File
@@ -561,11 +561,11 @@ if (Tools::isSubmit('getHookableList'))
{ {
if (!strlen(Tools::getValue('hooks_list'))) if (!strlen(Tools::getValue('hooks_list')))
die('{"hasError" : true, "errors" : ["Live Edit : no module on this page"]}'); die('{"hasError" : true, "errors" : ["Live Edit : no module on this page"]}');
$modules_list = explode(',', Tools::getValue('modules_list')); $modules_list = explode(',', Tools::getValue('modules_list'));
$hooks_list = explode(',', Tools::getValue('hooks_list')); $hooks_list = explode(',', Tools::getValue('hooks_list'));
$hookableList = array(); $hookableList = array();
foreach ($modules_list as $module) foreach ($modules_list as $module)
{ {
$module = trim($module); $module = trim($module);
@@ -718,7 +718,7 @@ if (Tools::isSubmit('getAdminHomeElement'))
if (Tools::isSubmit('getChildrenCategories') && Tools::getValue('id_category_parent')) if (Tools::isSubmit('getChildrenCategories') && Tools::getValue('id_category_parent'))
{ {
$children_categories = Category::getChildrenWithNbSelectedSubCat(Tools::getValue('id_category_parent'), Tools::getValue('selectedCat', array()), Context::getContext()->language->id); $children_categories = Category::getChildrenWithNbSelectedSubCat(Tools::getValue('id_category_parent'), Tools::getValue('selectedCat'), Context::getContext()->language->id);
die(Tools::jsonEncode($children_categories)); die(Tools::jsonEncode($children_categories));
} }
@@ -937,7 +937,7 @@ if (Tools::isSubmit('getParentCategoriesId') AND $id_category = Tools::getValue(
$output = array(); $output = array();
foreach($results as $result) foreach($results as $result)
$output[] = $result; $output[] = $result;
die(Tools::jsonEncode($output)); die(Tools::jsonEncode($output));
} }
+3 -3
View File
@@ -107,7 +107,7 @@ class AdminStores extends AdminTab
$_POST[$kp] = trim($vp); $_POST[$kp] = trim($vp);
/* If the selected country does not contain states */ /* If the selected country does not contain states */
$id_state = (int)(Tools::getValue('id_state')); $id_state = (int)Tools::getValue('id_state');
if ($id_country = Tools::getValue('id_country') AND $country = new Country((int)($id_country)) AND !(int)($country->contains_states) AND $id_state) if ($id_country = Tools::getValue('id_country') AND $country = new Country((int)($id_country)) AND !(int)($country->contains_states) AND $id_state)
$this->_errors[] = Tools::displayError('You have selected a state for a country that does not contain states.'); $this->_errors[] = Tools::displayError('You have selected a state for a country that does not contain states.');
@@ -115,8 +115,8 @@ class AdminStores extends AdminTab
if ((int)($country->contains_states) AND !$id_state) if ((int)($country->contains_states) AND !$id_state)
$this->_errors[] = Tools::displayError('An address located in a country containing states must have a state selected.'); $this->_errors[] = Tools::displayError('An address located in a country containing states must have a state selected.');
$latitude = (float)(Tools::getValue('latitude')); $latitude = (float)Tools::getValue('latitude');
$longitude = (float)(Tools::getValue('longitude')); $longitude = (float)Tools::getValue('longitude');
if(empty($latitude) OR empty($longitude)) if(empty($latitude) OR empty($longitude))
$this->_errors[] = Tools::displayError('Latitude and longitude are required.'); $this->_errors[] = Tools::displayError('Latitude and longitude are required.');
+79 -79
View File
@@ -1,10 +1,10 @@
<?php return array ( <?php return array (
'AbstractLoggerCore' => 'classes/AbstractLogger.php', 'AbstractLoggerCore' => 'classes/AbstractLogger.php',
'AbstractLogger' => 'override/classes/AbstractLogger.php', 'AbstractLogger' => 'override/classes/AbstractLogger.php',
'AddressFormatCore' => 'classes/AddressFormat.php',
'AddressFormat' => 'override/classes/AddressFormat.php',
'AddressCore' => 'classes/Address.php', 'AddressCore' => 'classes/Address.php',
'Address' => 'override/classes/Address.php', 'Address' => 'override/classes/Address.php',
'AddressFormatCore' => 'classes/AddressFormat.php',
'AddressFormat' => 'override/classes/AddressFormat.php',
'AdminControllerCore' => 'classes/AdminController.php', 'AdminControllerCore' => 'classes/AdminController.php',
'AdminController' => 'override/classes/AdminController.php', 'AdminController' => 'override/classes/AdminController.php',
'AdminTabCore' => 'classes/AdminTab.php', 'AdminTabCore' => 'classes/AdminTab.php',
@@ -13,33 +13,33 @@
'Alias' => 'override/classes/Alias.php', 'Alias' => 'override/classes/Alias.php',
'AttachmentCore' => 'classes/Attachment.php', 'AttachmentCore' => 'classes/Attachment.php',
'Attachment' => 'override/classes/Attachment.php', 'Attachment' => 'override/classes/Attachment.php',
'AttributeGroupCore' => 'classes/AttributeGroup.php',
'AttributeGroup' => 'override/classes/AttributeGroup.php',
'AttributeCore' => 'classes/Attribute.php', 'AttributeCore' => 'classes/Attribute.php',
'Attribute' => 'override/classes/Attribute.php', 'Attribute' => 'override/classes/Attribute.php',
'AttributeGroupCore' => 'classes/AttributeGroup.php',
'AttributeGroup' => 'override/classes/AttributeGroup.php',
'Autoload' => 'classes/Autoload.php', 'Autoload' => 'classes/Autoload.php',
'BackupCore' => 'classes/Backup.php', 'BackupCore' => 'classes/Backup.php',
'Backup' => 'override/classes/Backup.php', 'Backup' => 'override/classes/Backup.php',
'BlowfishCore' => 'classes/Blowfish.php', 'BlowfishCore' => 'classes/Blowfish.php',
'Blowfish' => 'override/classes/Blowfish.php', 'Blowfish' => 'override/classes/Blowfish.php',
'CacheFSCore' => 'classes/CacheFS.php', 'CMSCore' => 'classes/CMS.php',
'CacheFS' => 'override/classes/CacheFS.php', 'CMS' => 'override/classes/CMS.php',
'CMSCategoryCore' => 'classes/CMSCategory.php',
'CMSCategory' => 'override/classes/CMSCategory.php',
'CacheCore' => 'classes/Cache.php', 'CacheCore' => 'classes/Cache.php',
'Cache' => 'override/classes/Cache.php', 'Cache' => 'override/classes/Cache.php',
'CarrierModuleCore' => 'classes/CarrierModule.php', 'CacheFSCore' => 'classes/CacheFS.php',
'CarrierModule' => 'override/classes/CarrierModule.php', 'CacheFS' => 'override/classes/CacheFS.php',
'CarrierCore' => 'classes/Carrier.php', 'CarrierCore' => 'classes/Carrier.php',
'Carrier' => 'override/classes/Carrier.php', 'Carrier' => 'override/classes/Carrier.php',
'CarrierModuleCore' => 'classes/CarrierModule.php',
'CarrierModule' => 'override/classes/CarrierModule.php',
'CartCore' => 'classes/Cart.php', 'CartCore' => 'classes/Cart.php',
'Cart' => 'override/classes/Cart.php', 'Cart' => 'override/classes/Cart.php',
'CategoryCore' => 'classes/Category.php', 'CategoryCore' => 'classes/Category.php',
'Category' => 'override/classes/Category.php', 'Category' => 'override/classes/Category.php',
'ChartCore' => 'classes/Chart.php', 'ChartCore' => 'classes/Chart.php',
'Chart' => 'override/classes/Chart.php', 'Chart' => 'override/classes/Chart.php',
'CMSCategoryCore' => 'classes/CMSCategory.php',
'CMSCategory' => 'override/classes/CMSCategory.php',
'CMSCore' => 'classes/CMS.php',
'CMS' => 'override/classes/CMS.php',
'CombinationCore' => 'classes/Combination.php', 'CombinationCore' => 'classes/Combination.php',
'Combination' => 'override/classes/Combination.php', 'Combination' => 'override/classes/Combination.php',
'CompareProductCore' => 'classes/CompareProduct.php', 'CompareProductCore' => 'classes/CompareProduct.php',
@@ -56,10 +56,10 @@
'Contact' => 'override/classes/Contact.php', 'Contact' => 'override/classes/Contact.php',
'ContextCore' => 'classes/Context.php', 'ContextCore' => 'classes/Context.php',
'Context' => 'override/classes/Context.php', 'Context' => 'override/classes/Context.php',
'ControllerFactoryCore' => 'classes/ControllerFactory.php',
'ControllerFactory' => 'override/classes/ControllerFactory.php',
'ControllerCore' => 'classes/Controller.php', 'ControllerCore' => 'classes/Controller.php',
'Controller' => 'override/classes/Controller.php', 'Controller' => 'override/classes/Controller.php',
'ControllerFactoryCore' => 'classes/ControllerFactory.php',
'ControllerFactory' => 'override/classes/ControllerFactory.php',
'CookieCore' => 'classes/Cookie.php', 'CookieCore' => 'classes/Cookie.php',
'Cookie' => 'override/classes/Cookie.php', 'Cookie' => 'override/classes/Cookie.php',
'CountryCore' => 'classes/Country.php', 'CountryCore' => 'classes/Country.php',
@@ -68,26 +68,16 @@
'County' => 'override/classes/County.php', 'County' => 'override/classes/County.php',
'CurrencyCore' => 'classes/Currency.php', 'CurrencyCore' => 'classes/Currency.php',
'Currency' => 'override/classes/Currency.php', 'Currency' => 'override/classes/Currency.php',
'CustomerMessageCore' => 'classes/CustomerMessage.php',
'CustomerMessage' => 'override/classes/CustomerMessage.php',
'CustomerCore' => 'classes/Customer.php', 'CustomerCore' => 'classes/Customer.php',
'Customer' => 'override/classes/Customer.php', 'Customer' => 'override/classes/Customer.php',
'CustomerMessageCore' => 'classes/CustomerMessage.php',
'CustomerMessage' => 'override/classes/CustomerMessage.php',
'CustomerThreadCore' => 'classes/CustomerThread.php', 'CustomerThreadCore' => 'classes/CustomerThread.php',
'CustomerThread' => 'override/classes/CustomerThread.php', 'CustomerThread' => 'override/classes/CustomerThread.php',
'CustomizationCore' => 'classes/Customization.php', 'CustomizationCore' => 'classes/Customization.php',
'Customization' => 'override/classes/Customization.php', 'Customization' => 'override/classes/Customization.php',
'DateRangeCore' => 'classes/DateRange.php', 'DateRangeCore' => 'classes/DateRange.php',
'DateRange' => 'override/classes/DateRange.php', 'DateRange' => 'override/classes/DateRange.php',
'DbMySQLiCore' => 'classes/db/DbMySQLi.php',
'DbMySQLi' => 'override/classes/db/DbMySQLi.php',
'DbPDOCore' => 'classes/db/DbPDO.php',
'DbPDO' => 'override/classes/db/DbPDO.php',
'DbCore' => 'classes/db/Db.php',
'Db' => 'override/classes/db/Db.php',
'DbQueryCore' => 'classes/db/DbQuery.php',
'DbQuery' => 'override/classes/db/DbQuery.php',
'MySQLCore' => 'classes/db/MySQL.php',
'MySQL' => 'override/classes/db/MySQL.php',
'DeliveryCore' => 'classes/Delivery.php', 'DeliveryCore' => 'classes/Delivery.php',
'Delivery' => 'override/classes/Delivery.php', 'Delivery' => 'override/classes/Delivery.php',
'DiscountCore' => 'classes/Discount.php', 'DiscountCore' => 'classes/Discount.php',
@@ -96,14 +86,6 @@
'Dispatcher' => 'override/classes/Dispatcher.php', 'Dispatcher' => 'override/classes/Dispatcher.php',
'EmployeeCore' => 'classes/Employee.php', 'EmployeeCore' => 'classes/Employee.php',
'Employee' => 'override/classes/Employee.php', 'Employee' => 'override/classes/Employee.php',
'PrestashopDatabaseExceptionCore' => 'classes/exception/PrestashopDatabaseException.php',
'PrestashopDatabaseException' => 'override/classes/exception/PrestashopDatabaseException.php',
'PrestashopExceptionCore' => 'classes/exception/PrestashopException.php',
'PrestashopException' => 'override/classes/exception/PrestashopException.php',
'PrestashopModuleExceptionCore' => 'classes/exception/PrestashopModuleException.php',
'PrestashopModuleException' => 'override/classes/exception/PrestashopModuleException.php',
'PrestashopPaymentExceptionCore' => 'classes/exception/PrestashopPaymentException.php',
'PrestashopPaymentException' => 'override/classes/exception/PrestashopPaymentException.php',
'FeatureCore' => 'classes/Feature.php', 'FeatureCore' => 'classes/Feature.php',
'Feature' => 'override/classes/Feature.php', 'Feature' => 'override/classes/Feature.php',
'FeatureValueCore' => 'classes/FeatureValue.php', 'FeatureValueCore' => 'classes/FeatureValue.php',
@@ -124,10 +106,10 @@
'Guest' => 'override/classes/Guest.php', 'Guest' => 'override/classes/Guest.php',
'HelpAccessCore' => 'classes/HelpAccess.php', 'HelpAccessCore' => 'classes/HelpAccess.php',
'HelpAccess' => 'override/classes/HelpAccess.php', 'HelpAccess' => 'override/classes/HelpAccess.php',
'HelperListCore' => 'classes/HelperList.php',
'HelperList' => '',
'HelperCore' => 'classes/Helper.php', 'HelperCore' => 'classes/Helper.php',
'Helper' => 'override/classes/Helper.php', 'Helper' => 'override/classes/Helper.php',
'HelperListCore' => 'classes/HelperList.php',
'HelperList' => '',
'HookCore' => 'classes/Hook.php', 'HookCore' => 'classes/Hook.php',
'Hook' => 'override/classes/Hook.php', 'Hook' => 'override/classes/Hook.php',
'ImageCore' => 'classes/Image.php', 'ImageCore' => 'classes/Image.php',
@@ -144,32 +126,34 @@
'LocalizationPack' => 'override/classes/LocalizationPack.php', 'LocalizationPack' => 'override/classes/LocalizationPack.php',
'LoggerCore' => 'classes/Logger.php', 'LoggerCore' => 'classes/Logger.php',
'Logger' => 'override/classes/Logger.php', 'Logger' => 'override/classes/Logger.php',
'MCachedCore' => 'classes/MCached.php',
'MCached' => 'override/classes/MCached.php',
'MailCore' => 'classes/Mail.php', 'MailCore' => 'classes/Mail.php',
'Mail' => 'override/classes/Mail.php', 'Mail' => 'override/classes/Mail.php',
'ManufacturerCore' => 'classes/Manufacturer.php', 'ManufacturerCore' => 'classes/Manufacturer.php',
'Manufacturer' => 'override/classes/Manufacturer.php', 'Manufacturer' => 'override/classes/Manufacturer.php',
'MCachedCore' => 'classes/MCached.php',
'MCached' => 'override/classes/MCached.php',
'MediaCore' => 'classes/Media.php', 'MediaCore' => 'classes/Media.php',
'Media' => '', 'Media' => '',
'MessageCore' => 'classes/Message.php', 'MessageCore' => 'classes/Message.php',
'Message' => 'override/classes/Message.php', 'Message' => 'override/classes/Message.php',
'MetaCore' => 'classes/Meta.php', 'MetaCore' => 'classes/Meta.php',
'Meta' => 'override/classes/Meta.php', 'Meta' => 'override/classes/Meta.php',
'ModuleGraphEngineCore' => 'classes/ModuleGraphEngine.php',
'ModuleGraphEngine' => 'override/classes/ModuleGraphEngine.php',
'ModuleGraphCore' => 'classes/ModuleGraph.php',
'ModuleGraph' => 'override/classes/ModuleGraph.php',
'ModuleGridEngineCore' => 'classes/ModuleGridEngine.php',
'ModuleGridEngine' => 'override/classes/ModuleGridEngine.php',
'ModuleGridCore' => 'classes/ModuleGrid.php',
'ModuleGrid' => 'override/classes/ModuleGrid.php',
'ModuleCore' => 'classes/Module.php', 'ModuleCore' => 'classes/Module.php',
'Module' => 'override/classes/Module.php', 'Module' => 'override/classes/Module.php',
'ModuleGraphCore' => 'classes/ModuleGraph.php',
'ModuleGraph' => 'override/classes/ModuleGraph.php',
'ModuleGraphEngineCore' => 'classes/ModuleGraphEngine.php',
'ModuleGraphEngine' => 'override/classes/ModuleGraphEngine.php',
'ModuleGridCore' => 'classes/ModuleGrid.php',
'ModuleGrid' => 'override/classes/ModuleGrid.php',
'ModuleGridEngineCore' => 'classes/ModuleGridEngine.php',
'ModuleGridEngine' => 'override/classes/ModuleGridEngine.php',
'NotificationCore' => 'classes/Notification.php', 'NotificationCore' => 'classes/Notification.php',
'Notification' => 'override/classes/Notification.php', 'Notification' => 'override/classes/Notification.php',
'ObjectModelCore' => 'classes/ObjectModel.php', 'ObjectModelCore' => 'classes/ObjectModel.php',
'ObjectModel' => 'override/classes/ObjectModel.php', 'ObjectModel' => 'override/classes/ObjectModel.php',
'OrderCore' => 'classes/Order.php',
'Order' => 'override/classes/Order.php',
'OrderDetailCore' => 'classes/OrderDetail.php', 'OrderDetailCore' => 'classes/OrderDetail.php',
'OrderDetail' => 'override/classes/OrderDetail.php', 'OrderDetail' => 'override/classes/OrderDetail.php',
'OrderDiscountCore' => 'classes/OrderDiscount.php', 'OrderDiscountCore' => 'classes/OrderDiscount.php',
@@ -178,8 +162,6 @@
'OrderHistory' => 'override/classes/OrderHistory.php', 'OrderHistory' => 'override/classes/OrderHistory.php',
'OrderMessageCore' => 'classes/OrderMessage.php', 'OrderMessageCore' => 'classes/OrderMessage.php',
'OrderMessage' => 'override/classes/OrderMessage.php', 'OrderMessage' => 'override/classes/OrderMessage.php',
'OrderCore' => 'classes/Order.php',
'Order' => 'override/classes/Order.php',
'OrderReturnCore' => 'classes/OrderReturn.php', 'OrderReturnCore' => 'classes/OrderReturn.php',
'OrderReturn' => 'override/classes/OrderReturn.php', 'OrderReturn' => 'override/classes/OrderReturn.php',
'OrderReturnStateCore' => 'classes/OrderReturnState.php', 'OrderReturnStateCore' => 'classes/OrderReturnState.php',
@@ -188,6 +170,8 @@
'OrderSlip' => 'override/classes/OrderSlip.php', 'OrderSlip' => 'override/classes/OrderSlip.php',
'OrderStateCore' => 'classes/OrderState.php', 'OrderStateCore' => 'classes/OrderState.php',
'OrderState' => 'override/classes/OrderState.php', 'OrderState' => 'override/classes/OrderState.php',
'PDFCore' => 'classes/PDF.php',
'PDF' => 'override/classes/PDF.php',
'PackCore' => 'classes/Pack.php', 'PackCore' => 'classes/Pack.php',
'Pack' => 'override/classes/Pack.php', 'Pack' => 'override/classes/Pack.php',
'PageCore' => 'classes/Page.php', 'PageCore' => 'classes/Page.php',
@@ -196,12 +180,10 @@
'PaymentCC' => 'override/classes/PaymentCC.php', 'PaymentCC' => 'override/classes/PaymentCC.php',
'PaymentModuleCore' => 'classes/PaymentModule.php', 'PaymentModuleCore' => 'classes/PaymentModule.php',
'PaymentModule' => 'override/classes/PaymentModule.php', 'PaymentModule' => 'override/classes/PaymentModule.php',
'PDFCore' => 'classes/PDF.php',
'PDF' => 'override/classes/PDF.php',
'ProductDownloadCore' => 'classes/ProductDownload.php',
'ProductDownload' => 'override/classes/ProductDownload.php',
'ProductCore' => 'classes/Product.php', 'ProductCore' => 'classes/Product.php',
'Product' => 'override/classes/Product.php', 'Product' => 'override/classes/Product.php',
'ProductDownloadCore' => 'classes/ProductDownload.php',
'ProductDownload' => 'override/classes/ProductDownload.php',
'ProductSaleCore' => 'classes/ProductSale.php', 'ProductSaleCore' => 'classes/ProductSale.php',
'ProductSale' => 'override/classes/ProductSale.php', 'ProductSale' => 'override/classes/ProductSale.php',
'ProfileCore' => 'classes/Profile.php', 'ProfileCore' => 'classes/Profile.php',
@@ -220,26 +202,20 @@
'Rijndael' => 'override/classes/Rijndael.php', 'Rijndael' => 'override/classes/Rijndael.php',
'SceneCore' => 'classes/Scene.php', 'SceneCore' => 'classes/Scene.php',
'Scene' => 'override/classes/Scene.php', 'Scene' => 'override/classes/Scene.php',
'SearchEngineCore' => 'classes/SearchEngine.php',
'SearchEngine' => 'override/classes/SearchEngine.php',
'SearchCore' => 'classes/Search.php', 'SearchCore' => 'classes/Search.php',
'Search' => 'override/classes/Search.php', 'Search' => 'override/classes/Search.php',
'GroupShopCore' => 'classes/shop/GroupShop.php', 'SearchEngineCore' => 'classes/SearchEngine.php',
'GroupShop' => 'override/classes/shop/GroupShop.php', 'SearchEngine' => 'override/classes/SearchEngine.php',
'ShopCore' => 'classes/shop/Shop.php',
'Shop' => 'override/classes/shop/Shop.php',
'ShopUrlCore' => 'classes/shop/ShopUrl.php',
'ShopUrl' => 'override/classes/shop/ShopUrl.php',
'SpecificPriceCore' => 'classes/SpecificPrice.php', 'SpecificPriceCore' => 'classes/SpecificPrice.php',
'SpecificPrice' => 'override/classes/SpecificPrice.php', 'SpecificPrice' => 'override/classes/SpecificPrice.php',
'StateCore' => 'classes/State.php', 'StateCore' => 'classes/State.php',
'State' => 'override/classes/State.php', 'State' => 'override/classes/State.php',
'StockCore' => 'classes/Stock.php',
'Stock' => 'override/classes/Stock.php',
'StockMvtCore' => 'classes/StockMvt.php', 'StockMvtCore' => 'classes/StockMvt.php',
'StockMvt' => 'override/classes/StockMvt.php', 'StockMvt' => 'override/classes/StockMvt.php',
'StockMvtReasonCore' => 'classes/StockMvtReason.php', 'StockMvtReasonCore' => 'classes/StockMvtReason.php',
'StockMvtReason' => 'override/classes/StockMvtReason.php', 'StockMvtReason' => 'override/classes/StockMvtReason.php',
'StockCore' => 'classes/Stock.php',
'Stock' => 'override/classes/Stock.php',
'StoreCore' => 'classes/Store.php', 'StoreCore' => 'classes/Store.php',
'Store' => 'override/classes/Store.php', 'Store' => 'override/classes/Store.php',
'SubDomainCore' => 'classes/SubDomain.php', 'SubDomainCore' => 'classes/SubDomain.php',
@@ -250,21 +226,6 @@
'Tab' => 'override/classes/Tab.php', 'Tab' => 'override/classes/Tab.php',
'TagCore' => 'classes/Tag.php', 'TagCore' => 'classes/Tag.php',
'Tag' => 'override/classes/Tag.php', 'Tag' => 'override/classes/Tag.php',
'TaxCalculatorCore' => 'classes/tax/TaxCalculator.php',
'TaxCalculator' => 'override/classes/tax/TaxCalculator.php',
'TaxManagerFactoryCore' => 'classes/tax/TaxManagerFactory.php',
'TaxManagerFactory' => 'override/classes/tax/TaxManagerFactory.php',
'TaxManagerInterface' => 'classes/tax/TaxManagerInterface.php',
'TaxManagerModuleCore' => 'classes/tax/TaxManagerModule.php',
'TaxManagerModule' => 'override/classes/tax/TaxManagerModule.php',
'TaxCore' => 'classes/tax/Tax.php',
'Tax' => 'override/classes/tax/Tax.php',
'TaxRuleCore' => 'classes/tax/TaxRule.php',
'TaxRule' => 'override/classes/tax/TaxRule.php',
'TaxRulesGroupCore' => 'classes/tax/TaxRulesGroup.php',
'TaxRulesGroup' => 'override/classes/tax/TaxRulesGroup.php',
'TaxRulesTaxManagerCore' => 'classes/tax/TaxRulesTaxManager.php',
'TaxRulesTaxManager' => 'override/classes/tax/TaxRulesTaxManager.php',
'ThemeCore' => 'classes/Theme.php', 'ThemeCore' => 'classes/Theme.php',
'Theme' => 'override/classes/Theme.php', 'Theme' => 'override/classes/Theme.php',
'ToolsCore' => 'classes/Tools.php', 'ToolsCore' => 'classes/Tools.php',
@@ -275,6 +236,47 @@
'Upgrader' => 'override/classes/Upgrader.php', 'Upgrader' => 'override/classes/Upgrader.php',
'ValidateCore' => 'classes/Validate.php', 'ValidateCore' => 'classes/Validate.php',
'Validate' => 'override/classes/Validate.php', 'Validate' => 'override/classes/Validate.php',
'ZoneCore' => 'classes/Zone.php',
'Zone' => 'override/classes/Zone.php',
'DbCore' => 'classes/db/Db.php',
'Db' => 'override/classes/db/Db.php',
'DbMySQLiCore' => 'classes/db/DbMySQLi.php',
'DbMySQLi' => 'override/classes/db/DbMySQLi.php',
'DbPDOCore' => 'classes/db/DbPDO.php',
'DbPDO' => 'override/classes/db/DbPDO.php',
'DbQueryCore' => 'classes/db/DbQuery.php',
'DbQuery' => 'override/classes/db/DbQuery.php',
'MySQLCore' => 'classes/db/MySQL.php',
'MySQL' => 'override/classes/db/MySQL.php',
'PrestashopDatabaseExceptionCore' => 'classes/exception/PrestashopDatabaseException.php',
'PrestashopDatabaseException' => 'override/classes/exception/PrestashopDatabaseException.php',
'PrestashopExceptionCore' => 'classes/exception/PrestashopException.php',
'PrestashopException' => 'override/classes/exception/PrestashopException.php',
'PrestashopModuleExceptionCore' => 'classes/exception/PrestashopModuleException.php',
'PrestashopModuleException' => 'override/classes/exception/PrestashopModuleException.php',
'PrestashopPaymentExceptionCore' => 'classes/exception/PrestashopPaymentException.php',
'PrestashopPaymentException' => 'override/classes/exception/PrestashopPaymentException.php',
'GroupShopCore' => 'classes/shop/GroupShop.php',
'GroupShop' => 'override/classes/shop/GroupShop.php',
'ShopCore' => 'classes/shop/Shop.php',
'Shop' => 'override/classes/shop/Shop.php',
'ShopUrlCore' => 'classes/shop/ShopUrl.php',
'ShopUrl' => 'override/classes/shop/ShopUrl.php',
'TaxCore' => 'classes/tax/Tax.php',
'Tax' => 'override/classes/tax/Tax.php',
'TaxCalculatorCore' => 'classes/tax/TaxCalculator.php',
'TaxCalculator' => 'override/classes/tax/TaxCalculator.php',
'TaxManagerFactoryCore' => 'classes/tax/TaxManagerFactory.php',
'TaxManagerFactory' => 'override/classes/tax/TaxManagerFactory.php',
'TaxManagerInterface' => 'classes/tax/TaxManagerInterface.php',
'TaxManagerModuleCore' => 'classes/tax/TaxManagerModule.php',
'TaxManagerModule' => 'override/classes/tax/TaxManagerModule.php',
'TaxRuleCore' => 'classes/tax/TaxRule.php',
'TaxRule' => 'override/classes/tax/TaxRule.php',
'TaxRulesGroupCore' => 'classes/tax/TaxRulesGroup.php',
'TaxRulesGroup' => 'override/classes/tax/TaxRulesGroup.php',
'TaxRulesTaxManagerCore' => 'classes/tax/TaxRulesTaxManager.php',
'TaxRulesTaxManager' => 'override/classes/tax/TaxRulesTaxManager.php',
'WebserviceExceptionCore' => 'classes/webservice/WebserviceException.php', 'WebserviceExceptionCore' => 'classes/webservice/WebserviceException.php',
'WebserviceException' => 'override/classes/webservice/WebserviceException.php', 'WebserviceException' => 'override/classes/webservice/WebserviceException.php',
'WebserviceKeyCore' => 'classes/webservice/WebserviceKey.php', 'WebserviceKeyCore' => 'classes/webservice/WebserviceKey.php',
@@ -291,8 +293,6 @@
'WebserviceSpecificManagementInterface' => 'classes/webservice/WebserviceSpecificManagementInterface.php', 'WebserviceSpecificManagementInterface' => 'classes/webservice/WebserviceSpecificManagementInterface.php',
'WebserviceSpecificManagementSearchCore' => 'classes/webservice/WebserviceSpecificManagementSearch.php', 'WebserviceSpecificManagementSearchCore' => 'classes/webservice/WebserviceSpecificManagementSearch.php',
'WebserviceSpecificManagementSearch' => 'override/classes/webservice/WebserviceSpecificManagementSearch.php', 'WebserviceSpecificManagementSearch' => 'override/classes/webservice/WebserviceSpecificManagementSearch.php',
'ZoneCore' => 'classes/Zone.php',
'Zone' => 'override/classes/Zone.php',
'FB' => 'override/classes/fb.php', 'FB' => 'override/classes/fb.php',
'AdminAddressesControllerCore' => 'controllers/admin/AdminAddressesController.php', 'AdminAddressesControllerCore' => 'controllers/admin/AdminAddressesController.php',
'AdminAddressesController' => '', 'AdminAddressesController' => '',
+44 -43
View File
@@ -73,11 +73,11 @@ class CategoryCore extends ObjectModel
/** @var string Object last modification date */ /** @var string Object last modification date */
public $date_upd; public $date_upd;
protected $langMultiShop = true; protected $langMultiShop = true;
public $groupBox; public $groupBox;
protected static $_links = array(); protected static $_links = array();
protected $tables = array ('category', 'category_lang'); protected $tables = array ('category', 'category_lang');
@@ -132,12 +132,12 @@ class CategoryCore extends ObjectModel
$fields['date_upd'] = pSQL($this->date_upd); $fields['date_upd'] = pSQL($this->date_upd);
return $fields; return $fields;
} }
/** /**
* Allows to display the category description without HTML tags and slashes * Allows to display the category description without HTML tags and slashes
* *
* @return string * @return string
*/ */
public static function getDescriptionClean($description) public static function getDescriptionClean($description)
{ {
return strip_tags(stripslashes($description)); return strip_tags(stripslashes($description));
@@ -176,8 +176,8 @@ class CategoryCore extends ObjectModel
/** /**
* update category positions in parent * update category positions in parent
* *
* @param mixed $nullValues * @param mixed $nullValues
* @return void * @return void
*/ */
public function update($nullValues = false) public function update($nullValues = false)
@@ -332,7 +332,7 @@ class CategoryCore extends ObjectModel
self::regenerateEntireNtree(); self::regenerateEntireNtree();
Module::hookExec('categoryDeletion', array('category' => $this)); Module::hookExec('categoryDeletion', array('category' => $this));
/* Delete Categories in GroupReduction */ /* Delete Categories in GroupReduction */
foreach ($toDelete AS $category) foreach ($toDelete AS $category)
if (GroupReduction::getGroupReductionByCategoryId((int)$category)) if (GroupReduction::getGroupReductionByCategoryId((int)$category))
@@ -420,8 +420,8 @@ class CategoryCore extends ObjectModel
{ {
Db::getInstance(_PS_USE_SQL_SLAVE_)->Execute(' Db::getInstance(_PS_USE_SQL_SLAVE_)->Execute('
UPDATE '._DB_PREFIX_.'category UPDATE '._DB_PREFIX_.'category
SET level_depth = '.($level['level_depth'] + 1).' SET level_depth = '.(int)($level['level_depth'] + 1).'
WHERE id_category = '.$sub_category['id_category']); WHERE id_category = '.(int)$sub_category['id_category']);
/* Recursive call */ /* Recursive call */
$this->recalculateLevelDepth($sub_category['id_category']); $this->recalculateLevelDepth($sub_category['id_category']);
} }
@@ -522,7 +522,7 @@ class CategoryCore extends ObjectModel
if (!$context) if (!$context)
$context = Context::getContext(); $context = Context::getContext();
if (!$checkAccess OR !$this->checkAccess($context->customer->id)) if (!$checkAccess OR !$this->checkAccess($context->customer->id))
return false; return false;
if ($p < 1) $p = 1; if ($p < 1) $p = 1;
@@ -531,7 +531,7 @@ class CategoryCore extends ObjectModel
else else
/* Fix for all modules which are now using lowercase values for 'orderBy' parameter */ /* Fix for all modules which are now using lowercase values for 'orderBy' parameter */
$orderBy = strtolower($orderBy); $orderBy = strtolower($orderBy);
if (empty($orderWay)) if (empty($orderWay))
$orderWay = 'ASC'; $orderWay = 'ASC';
if ($orderBy == 'id_product' OR $orderBy == 'date_add') if ($orderBy == 'id_product' OR $orderBy == 'date_add')
@@ -635,7 +635,7 @@ class CategoryCore extends ObjectModel
* @param int $id_parent * @param int $id_parent
* @param int $id_lang * @param int $id_lang
* @param bool $active * @param bool $active
* @return array * @return array
*/ */
public static function getChildren($id_parent, $id_lang, $active = true) public static function getChildren($id_parent, $id_lang, $active = true)
{ {
@@ -653,7 +653,7 @@ class CategoryCore extends ObjectModel
} }
/** return an array of all children of the current category /** return an array of all children of the current category
* *
* @return array rows of table category * @return array rows of table category
* @todo return hydrateCollection * @todo return hydrateCollection
*/ */
@@ -667,27 +667,28 @@ class CategoryCore extends ObjectModel
/** /**
* This method allow to return children categories with the number of sub children selected for a product * This method allow to return children categories with the number of sub children selected for a product
* *
* @param int $id_parent * @param int $id_parent
* @param int $id_product * @param int $id_product
* @param int $id_lang * @param int $id_lang
* @return array * @return array
*/ */
public static function getChildrenWithNbSelectedSubCat($id_parent, $selectedCat, $id_lang, Shop $shop = null) public static function getChildrenWithNbSelectedSubCat($id_parent, $selectedCat, $id_lang, Shop $shop = null)
{ {
if (!$shop) if (!$shop)
$shop = Context::getContext()->shop; $shop = Context::getContext()->shop;
$selectedCat = explode(',', str_replace(' ', '', $selectedCat));
$sql = 'SELECT c.`id_category`, c.`level_depth`, cl.`name`, IF(( $sql = 'SELECT c.`id_category`, c.`level_depth`, cl.`name`, IF((
SELECT COUNT(*) SELECT COUNT(*)
FROM `'._DB_PREFIX_.'category` c2 FROM `'._DB_PREFIX_.'category` c2
WHERE c2.`id_parent` = c.`id_category` WHERE c2.`id_parent` = c.`id_category`
) > 0, 1, 0) AS has_children, '.($selectedCat ? '( ) > 0, 1, 0) AS has_children, '.($selectedCat ? '(
SELECT count(c3.`id_category`) SELECT count(c3.`id_category`)
FROM `'._DB_PREFIX_.'category` c3 FROM `'._DB_PREFIX_.'category` c3
WHERE c3.`nleft` > c.`nleft` WHERE c3.`nleft` > c.`nleft`
AND c3.`nright` < c.`nright` AND c3.`nright` < c.`nright`
AND c3.`id_category` IN ('.pSQL($selectedCat).') AND c3.`id_category` IN ('.implode(',', array_map('intval', $selectedCat)).')
)' : '0').' AS nbSelectedSubCat )' : '0').' AS nbSelectedSubCat
FROM `'._DB_PREFIX_.'category` c FROM `'._DB_PREFIX_.'category` c
LEFT JOIN `'._DB_PREFIX_.'category_lang` cl ON c.`id_category` = cl.`id_category`'.$shop->sqlLang('cl').' LEFT JOIN `'._DB_PREFIX_.'category_lang` cl ON c.`id_category` = cl.`id_category`'.$shop->sqlLang('cl').'
@@ -696,7 +697,7 @@ class CategoryCore extends ObjectModel
ORDER BY `position` ASC'; ORDER BY `position` ASC';
return Db::getInstance(_PS_USE_SQL_SLAVE_)->ExecuteS($sql); return Db::getInstance(_PS_USE_SQL_SLAVE_)->ExecuteS($sql);
} }
/** /**
* Copy products from a category to another * Copy products from a category to another
* *
@@ -894,7 +895,7 @@ class CategoryCore extends ObjectModel
$groups[] = $group['id_group']; $groups[] = $group['id_group'];
return $groups; return $groups;
} }
public function addGroupsIfNoExist($id_group) public function addGroupsIfNoExist($id_group)
{ {
$groups = $this->getGroups(); $groups = $this->getGroups();
@@ -909,8 +910,8 @@ class CategoryCore extends ObjectModel
/** /**
* checkAccess return true if id_customer is in a group allowed to see this category. * checkAccess return true if id_customer is in a group allowed to see this category.
* *
* @param mixed $id_customer * @param mixed $id_customer
* @access public * @access public
* @return boolean true if access allowed for customer $id_customer * @return boolean true if access allowed for customer $id_customer
*/ */
@@ -966,7 +967,7 @@ class CategoryCore extends ObjectModel
foreach ($res AS $category) foreach ($res AS $category)
if ((int)($category['id_category']) == (int)($this->id)) if ((int)($category['id_category']) == (int)($this->id))
$movedCategory = $category; $movedCategory = $category;
if (!isset($movedCategory) || !isset($position)) if (!isset($movedCategory) || !isset($position))
return false; return false;
// < and > statements rather than BETWEEN operator // < and > statements rather than BETWEEN operator
@@ -992,8 +993,8 @@ class CategoryCore extends ObjectModel
* cleanPositions keep order of category in $id_category_parent, * cleanPositions keep order of category in $id_category_parent,
* but remove duplicate position. Should not be used if positions * but remove duplicate position. Should not be used if positions
* are clean at the beginning ! * are clean at the beginning !
* *
* @param mixed $id_category_parent * @param mixed $id_category_parent
* @return boolean true if succeed * @return boolean true if succeed
*/ */
public static function cleanPositions($id_category_parent) public static function cleanPositions($id_category_parent)
@@ -1018,7 +1019,7 @@ class CategoryCore extends ObjectModel
} }
/** this function return the number of category + 1 having $id_category_parent as parent. /** this function return the number of category + 1 having $id_category_parent as parent.
* *
* @todo rename that function to make it understandable (getNewLastPosition for example) * @todo rename that function to make it understandable (getNewLastPosition for example)
* @param int $id_category_parent the parent category * @param int $id_category_parent the parent category
* @return int * @return int
@@ -1027,7 +1028,7 @@ class CategoryCore extends ObjectModel
{ {
return (Db::getInstance()->getValue('SELECT MAX(position)+1 FROM `'._DB_PREFIX_.'category` WHERE `id_parent` = '.(int)($id_category_parent))); return (Db::getInstance()->getValue('SELECT MAX(position)+1 FROM `'._DB_PREFIX_.'category` WHERE `id_parent` = '.(int)($id_category_parent)));
} }
public static function getUrlRewriteInformations($id_category) public static function getUrlRewriteInformations($id_category)
{ {
return Db::getInstance()->ExecuteS(' return Db::getInstance()->ExecuteS('
@@ -1038,10 +1039,10 @@ class CategoryCore extends ObjectModel
AND l.`active` = 1' AND l.`active` = 1'
); );
} }
/** /**
* Return nleft and nright fields for a given category * Return nleft and nright fields for a given category
* *
* @since 1.5.0 * @since 1.5.0
* @param int $id * @param int $id
* @return array * @return array
@@ -1072,7 +1073,7 @@ class CategoryCore extends ObjectModel
return false; return false;
return ($this->nleft >= $interval['nleft'] && $this->nright <= $interval['nright']); return ($this->nleft >= $interval['nleft'] && $this->nright <= $interval['nright']);
} }
public function getChildrenWs() public function getChildrenWs()
{ {
$result = Db::getInstance(_PS_USE_SQL_SLAVE_)->ExecuteS(' $result = Db::getInstance(_PS_USE_SQL_SLAVE_)->ExecuteS('
@@ -1083,7 +1084,7 @@ class CategoryCore extends ObjectModel
ORDER BY `position` ASC'); ORDER BY `position` ASC');
return $result; return $result;
} }
public function getProductsWs() public function getProductsWs()
{ {
$result = Db::getInstance(_PS_USE_SQL_SLAVE_)->ExecuteS(' $result = Db::getInstance(_PS_USE_SQL_SLAVE_)->ExecuteS('
@@ -1093,10 +1094,10 @@ class CategoryCore extends ObjectModel
ORDER BY `position` ASC'); ORDER BY `position` ASC');
return $result; return $result;
} }
/** /**
* Search for another category with the same parent and the same position * Search for another category with the same parent and the same position
* *
* @return array first category found * @return array first category found
*/ */
public function getDuplicatePosition() public function getDuplicatePosition()
@@ -1108,7 +1109,7 @@ class CategoryCore extends ObjectModel
AND `position` = '.(int)($this->position).' AND `position` = '.(int)($this->position).'
AND c.`id_category` != '.(int)($this->id)); AND c.`id_category` != '.(int)($this->id));
} }
public function getWsNbProductsRecursive() public function getWsNbProductsRecursive()
{ {
$result = Db::getInstance(_PS_USE_SQL_SLAVE_)->ExecuteS(' $result = Db::getInstance(_PS_USE_SQL_SLAVE_)->ExecuteS('
@@ -1121,12 +1122,12 @@ class CategoryCore extends ObjectModel
return -1; return -1;
return $result[0]['nb_product_recursive']; return $result[0]['nb_product_recursive'];
} }
/** /**
* *
* @param Array $ids_category * @param Array $ids_category
* @param int $id_lang * @param int $id_lang
* @return Array * @return Array
*/ */
public static function getCategoryInformations($ids_category, $id_lang = null) public static function getCategoryInformations($ids_category, $id_lang = null)
{ {
@@ -1135,19 +1136,19 @@ class CategoryCore extends ObjectModel
if (!is_array($ids_category) || !sizeof($ids_category)) if (!is_array($ids_category) || !sizeof($ids_category))
return; return;
$categories = array(); $categories = array();
$results = Db::getInstance(_PS_USE_SQL_SLAVE_)->ExecuteS(' $results = Db::getInstance(_PS_USE_SQL_SLAVE_)->ExecuteS('
SELECT c.`id_category`, cl.`name`, cl.`link_rewrite`, cl.`id_lang` SELECT c.`id_category`, cl.`name`, cl.`link_rewrite`, cl.`id_lang`
FROM `'._DB_PREFIX_.'category` c FROM `'._DB_PREFIX_.'category` c
LEFT JOIN `'._DB_PREFIX_.'category_lang` cl ON (c.`id_category` = cl.`id_category`'.Context::getContext()->shop->sqlLang('cl').') LEFT JOIN `'._DB_PREFIX_.'category_lang` cl ON (c.`id_category` = cl.`id_category`'.Context::getContext()->shop->sqlLang('cl').')
WHERE cl.`id_lang` = '.(int)$id_lang.' WHERE cl.`id_lang` = '.(int)$id_lang.'
AND c.`id_category` IN ('.implode(',', array_map('intval', $ids_category)).') AND c.`id_category` IN ('.implode(',', array_map('intval', $ids_category)).')
'); ');
foreach($results as $category) foreach($results as $category)
$categories[$category['id_category']] = $category; $categories[$category['id_category']] = $category;
return $categories; return $categories;
} }
} }
+1 -1
View File
@@ -412,7 +412,7 @@ class FrontControllerCore extends Controller
protected function canonicalRedirection($canonicalURL = '') protected function canonicalRedirection($canonicalURL = '')
{ {
if (!$canonicalURL || !Configuration::get('PS_CANONICAL_REDIRECT')) if (!$canonicalURL || !Configuration::get('PS_CANONICAL_REDIRECT') || strtoupper($_SERVER['REQUEST_METHOD']) != 'GET')
return; return;
$matchUrl = (($this->ssl && Configuration::get('PS_SSL_ENABLED')) ? 'https://' : 'http://').$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI']; $matchUrl = (($this->ssl && Configuration::get('PS_SSL_ENABLED')) ? 'https://' : 'http://').$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI'];
+1 -1
View File
@@ -339,7 +339,7 @@ class SearchCore
protected static function getProductsToIndex($nbLanguages, $limit = 50) protected static function getProductsToIndex($nbLanguages, $limit = 50)
{ {
// Adjust the limit to get only "whole" products, in every languages (and at least one) // Adjust the limit to get only "whole" products, in every languages (and at least one)
$limit = min(1, round($limit / $nbLanguages) * $nbLanguages); $limit = max(1, round($limit / $nbLanguages) * $nbLanguages);
return Db::getInstance()->ExecuteS(' return Db::getInstance()->ExecuteS('
SELECT p.id_product, pl.id_lang, pl.name pname, p.reference, p.ean13, p.upc, pl.description_short, pl.description, cl.name cname, m.name mname SELECT p.id_product, pl.id_lang, pl.name pname, p.reference, p.ean13, p.upc, pl.description_short, pl.description, cl.name cname, m.name mname
FROM '._DB_PREFIX_.'product p FROM '._DB_PREFIX_.'product p
+7
View File
@@ -120,6 +120,13 @@ class StoreCore extends ObjectModel
return $fields; return $fields;
} }
public function __construct($id_store = NULL, $id_lang = NULL)
{
parent::__construct($id_store, $id_lang);
$this->id_image = ($this->id AND file_exists(_PS_STORE_IMG_DIR_.(int)$this->id.'.jpg')) ? (int)$this->id : false;
$this->image_dir = _PS_STORE_IMG_DIR_;
}
public function getWsHours() public function getWsHours()
{ {
return implode(';', unserialize($this->hours)); return implode(';', unserialize($this->hours));
+5 -9
View File
@@ -1,6 +1,6 @@
<?php <?php
/* /*
* 2007-2011 PrestaShop * 2007-2011 PrestaShop
* *
* NOTICE OF LICENSE * NOTICE OF LICENSE
* *
@@ -25,20 +25,16 @@
* International Registered Trademark & Property of PrestaShop SA * International Registered Trademark & Property of PrestaShop SA
*/ */
/**
* @author Lucas Cherifi - Nans Pellicari - Anatole Korczak - PrestaShop Team
*/
class WebserviceExceptionCore extends Exception class WebserviceExceptionCore extends Exception
{ {
protected $status; protected $status;
protected $wrong_value; protected $wrong_value;
protected $available_values; protected $available_values;
protected $type; protected $type;
const SIMPLE = 0; const SIMPLE = 0;
const DID_YOU_MEAN = 1; const DID_YOU_MEAN = 1;
public function __construct($message, $code) public function __construct($message, $code)
{ {
$exception_code = $code; $exception_code = $code;
@@ -52,12 +48,12 @@ class WebserviceExceptionCore extends Exception
} }
public function getType() public function getType()
{ {
return $this->type; return $this->type;
} }
public function setType($type) public function setType($type)
{ {
$this->type = $type; $this->type = $type;
return $this; return $this;
} }
public function setStatus($status) public function setStatus($status)
{ {
@@ -27,7 +27,6 @@
/** /**
* @todo : Create typed exception for more finer errors check * @todo : Create typed exception for more finer errors check
* @author Lucas Cherifi - Nans Pellicari - Anatole Korczak - PrestaShop Team
*/ */
class WebserviceOutputBuilderCore class WebserviceOutputBuilderCore
{ {
@@ -1,6 +1,6 @@
<?php <?php
/* /*
* 2007-2011 PrestaShop * 2007-2011 PrestaShop
* *
* NOTICE OF LICENSE * NOTICE OF LICENSE
* *
@@ -25,10 +25,6 @@
* International Registered Trademark & Property of PrestaShop SA * International Registered Trademark & Property of PrestaShop SA
*/ */
/**
* @author Lucas Cherifi - Nans Pellicari - Anatole Korczak - PrestaShop Team
*/
interface WebserviceOutputInterface interface WebserviceOutputInterface
{ {
public function __construct($languages = array()); public function __construct($languages = array());
+9 -13
View File
@@ -1,6 +1,6 @@
<?php <?php
/* /*
* 2007-2011 PrestaShop * 2007-2011 PrestaShop
* *
* NOTICE OF LICENSE * NOTICE OF LICENSE
* *
@@ -25,29 +25,25 @@
* International Registered Trademark & Property of PrestaShop SA * International Registered Trademark & Property of PrestaShop SA
*/ */
/**
* @author Lucas Cherifi - Nans Pellicari - Anatole Korczak - PrestaShop Team
*/
class WebserviceOutputXMLCore implements WebserviceOutputInterface class WebserviceOutputXMLCore implements WebserviceOutputInterface
{ {
public $docUrl = ''; public $docUrl = '';
public $languages = array(); public $languages = array();
protected $wsUrl; protected $wsUrl;
protected $schemaToDisplay; protected $schemaToDisplay;
public function setSchemaToDisplay($schema) public function setSchemaToDisplay($schema)
{ {
if (is_string($schema)) if (is_string($schema))
$this->schemaToDisplay = $schema; $this->schemaToDisplay = $schema;
return $this; return $this;
} }
public function getSchemaToDisplay() public function getSchemaToDisplay()
{ {
return $this->schemaToDisplay; return $this->schemaToDisplay;
} }
public function setWsUrl($url) public function setWsUrl($url)
{ {
$this->wsUrl = $url; $this->wsUrl = $url;
@@ -98,10 +94,10 @@ class WebserviceOutputXMLCore implements WebserviceOutputInterface
foreach ($this->languages as $language) foreach ($this->languages as $language)
{ {
$more_attr = ''; $more_attr = '';
if (isset($field['synopsis_details']) || (isset($field['value']) AND is_array($field['value']))) if (isset($field['synopsis_details']) || (isset($field['value']) AND is_array($field['value'])))
{ {
$more_attr .= ' xlink:href="'.$this->getWsUrl().'languages/'.$language.'"'; $more_attr .= ' xlink:href="'.$this->getWsUrl().'languages/'.$language.'"';
if (isset($field['synopsis_details']) && $this->schemaToDisplay != 'blank') if (isset($field['synopsis_details']) && $this->schemaToDisplay != 'blank')
$more_attr .= ' format="isUnsignedId" '; $more_attr .= ' format="isUnsignedId" ';
} }
$node_content .= '<language id="'.$language.'"'.$more_attr.'>'; $node_content .= '<language id="'.$language.'"'.$more_attr.'>';
@@ -121,11 +117,11 @@ class WebserviceOutputXMLCore implements WebserviceOutputInterface
$ret .= ' xlink:href="'.$this->getWsUrl().$field['xlink_resource']['resourceName'].'/'. $ret .= ' xlink:href="'.$this->getWsUrl().$field['xlink_resource']['resourceName'].'/'.
(isset($field['xlink_resource']['subResourceName']) ? $field['xlink_resource']['subResourceName'].'/'.$field['object_id'].'/' : '').$field['value'].'"'; (isset($field['xlink_resource']['subResourceName']) ? $field['xlink_resource']['subResourceName'].'/'.$field['object_id'].'/' : '').$field['value'].'"';
} }
if (isset($field['getter']) && $this->schemaToDisplay != 'blank') if (isset($field['getter']) && $this->schemaToDisplay != 'blank')
$ret .= ' not_filterable="true"'; $ret .= ' not_filterable="true"';
if ($field['value'] != '') if ($field['value'] != '')
$node_content .= '<![CDATA['.$field['value'].']]>'; $node_content .= '<![CDATA['.$field['value'].']]>';
} }
if (isset($field['synopsis_details']) && !empty($field['synopsis_details']) && $this->schemaToDisplay !== 'blank') if (isset($field['synopsis_details']) && !empty($field['synopsis_details']) && $this->schemaToDisplay !== 'blank')
@@ -1,6 +1,6 @@
<?php <?php
/* /*
* 2007-2011 PrestaShop * 2007-2011 PrestaShop
* *
* NOTICE OF LICENSE * NOTICE OF LICENSE
* *
@@ -25,21 +25,17 @@
* International Registered Trademark & Property of PrestaShop SA * International Registered Trademark & Property of PrestaShop SA
*/ */
/**
* @author Lucas Cherifi - Nans Pellicari - Anatole Korczak - PrestaShop Team
*/
class WebserviceSpecificManagementImagesCore implements WebserviceSpecificManagementInterface class WebserviceSpecificManagementImagesCore implements WebserviceSpecificManagementInterface
{ {
protected $objOutput; protected $objOutput;
protected $output; protected $output;
protected $wsObject; protected $wsObject;
/** /**
* @var string The extension of the image to display * @var string The extension of the image to display
*/ */
protected $imgExtension = 'jpg'; protected $imgExtension = 'jpg';
/** /**
* @var array The type of images (general, categories, manufacturers, suppliers, stores...) * @var array The type of images (general, categories, manufacturers, suppliers, stores...)
*/ */
@@ -56,64 +52,64 @@ class WebserviceSpecificManagementImagesCore implements WebserviceSpecificManage
'suppliers' => array(), 'suppliers' => array(),
'stores' => array() 'stores' => array()
); );
/** /**
* @var string The image type (product, category, general,...) * @var string The image type (product, category, general,...)
*/ */
private $imageType = NULL; private $imageType = NULL;
/** /**
* @var int The maximum size supported when uploading images, in bytes * @var int The maximum size supported when uploading images, in bytes
*/ */
private $imgMaxUploadSize = 3000000; private $imgMaxUploadSize = 3000000;
/** /**
* @var array The list of supported mime types * @var array The list of supported mime types
*/ */
protected $acceptedImgMimeTypes = array('image/gif', 'image/jpg', 'image/jpeg', 'image/pjpeg', 'image/png', 'image/x-png'); protected $acceptedImgMimeTypes = array('image/gif', 'image/jpg', 'image/jpeg', 'image/pjpeg', 'image/png', 'image/x-png');
/** /**
* @var string The product image declination id * @var string The product image declination id
*/ */
protected $productImageDeclinationId = NULL; protected $productImageDeclinationId = NULL;
/** /**
* @var boolean If the current image management has to manage a "default" image (i.e. "No product available") * @var boolean If the current image management has to manage a "default" image (i.e. "No product available")
*/ */
protected $defaultImage = false; protected $defaultImage = false;
/** /**
* @var string The file path of the image to display. If not null, the image will be displayed, even if the XML output was not empty * @var string The file path of the image to display. If not null, the image will be displayed, even if the XML output was not empty
*/ */
public $imgToDisplay = null; public $imgToDisplay = null;
public $imageResource = null; public $imageResource = null;
// ------------------------------------------------ // ------------------------------------------------
// GETTERS & SETTERS // GETTERS & SETTERS
// ------------------------------------------------ // ------------------------------------------------
public function setObjectOutput(WebserviceOutputBuilderCore $obj) public function setObjectOutput(WebserviceOutputBuilderCore $obj)
{ {
$this->objOutput = $obj; $this->objOutput = $obj;
return $this; return $this;
} }
public function getObjectOutput() public function getObjectOutput()
{ {
return $this->objOutput; return $this->objOutput;
} }
public function setWsObject(WebserviceRequestCore $obj) public function setWsObject(WebserviceRequestCore $obj)
{ {
$this->wsObject = $obj; $this->wsObject = $obj;
return $this; return $this;
} }
public function getWsObject() public function getWsObject()
{ {
return $this->wsObject; return $this->wsObject;
} }
/* /*
* This method need $this->imgToDisplay to be set if output don't needs to be XML * This method need $this->imgToDisplay to be set if output don't needs to be XML
*/ */
@@ -142,23 +138,23 @@ class WebserviceSpecificManagementImagesCore implements WebserviceSpecificManage
} }
} }
} }
public function manage() public function manage()
{ {
$this->manageImages(); $this->manageImages();
return $this->wsObject->getOutputEnabled(); return $this->wsObject->getOutputEnabled();
} }
/** /**
* Management of images URL segment * Management of images URL segment
* *
* @return boolean * @return boolean
*/ */
private function manageImages() private function manageImages()
{ {
/* /*
* available cases api/... : * available cases api/... :
* *
* images ("types_list") (N-1) * images ("types_list") (N-1)
* GET (xml) * GET (xml)
* images/general ("general_list") (N-2) * images/general ("general_list") (N-2)
@@ -166,9 +162,9 @@ class WebserviceSpecificManagementImagesCore implements WebserviceSpecificManage
* images/general/[header,+] ("general") (N-3) * images/general/[header,+] ("general") (N-3)
* GET (bin) * GET (bin)
* PUT (bin) * PUT (bin)
* *
* *
* images/[categories,+] ("normal_list") (N-2) ([categories,+] = categories, manufacturers, ...) * images/[categories,+] ("normal_list") (N-2) ([categories,+] = categories, manufacturers, ...)
* GET (xml) * GET (xml)
* images/[categories,+]/[1,+] ("normal") (N-3) * images/[categories,+]/[1,+] ("normal") (N-3)
* GET (bin) * GET (bin)
@@ -186,7 +182,7 @@ class WebserviceSpecificManagementImagesCore implements WebserviceSpecificManage
* DELETE * DELETE
* images/[categories,+]/default/[en,+]/[small,+] ("normal_default_i18n_resized") (N-5) * images/[categories,+]/default/[en,+]/[small,+] ("normal_default_i18n_resized") (N-5)
* GET (bin) * GET (bin)
* *
* images/product ("product_list") (N-2) * images/product ("product_list") (N-2)
* GET (xml) (list of image) * GET (xml) (list of image)
* images/product/[1,+] ("product_description") (N-3) * images/product/[1,+] ("product_description") (N-3)
@@ -214,10 +210,10 @@ class WebserviceSpecificManagementImagesCore implements WebserviceSpecificManage
* DELETE * DELETE
* images/product/default/[en,+]/[small,+] ("product_default_i18n_resized") (N-5) * images/product/default/[en,+]/[small,+] ("product_default_i18n_resized") (N-5)
* GET (bin) * GET (bin)
* *
*/ */
/* Declinated /* Declinated
*ok GET (bin) *ok GET (bin)
*ok images/product ("product_list") (N-2) *ok images/product ("product_list") (N-2)
@@ -247,18 +243,18 @@ class WebserviceSpecificManagementImagesCore implements WebserviceSpecificManage
* DELETE * DELETE
*ok images/product/default/[en,+]/[small,+] ("product_default_i18n_resized") (N-5) *ok images/product/default/[en,+]/[small,+] ("product_default_i18n_resized") (N-5)
*ok GET (bin) *ok GET (bin)
* *
* */ * */
// Pre configuration... // Pre configuration...
if(isset($this->wsObject->urlSegment)) if(isset($this->wsObject->urlSegment))
for ($i = 1; $i < 6; $i++) for ($i = 1; $i < 6; $i++)
if (count($this->wsObject->urlSegment) == $i) if (count($this->wsObject->urlSegment) == $i)
$this->wsObject->urlSegment[$i] = ''; $this->wsObject->urlSegment[$i] = '';
$this->imageType = $this->wsObject->urlSegment[1]; $this->imageType = $this->wsObject->urlSegment[1];
switch ($this->wsObject->urlSegment[1]) switch ($this->wsObject->urlSegment[1])
{ {
// general images management : like header's logo, invoice logo, etc... // general images management : like header's logo, invoice logo, etc...
@@ -287,12 +283,12 @@ class WebserviceSpecificManagementImagesCore implements WebserviceSpecificManage
} }
return $this->manageDeclinatedImages($directory); return $this->manageDeclinatedImages($directory);
break; break;
// product image management : many image for one entity (product) // product image management : many image for one entity (product)
case 'products': case 'products':
return $this->manageProductImages(); return $this->manageProductImages();
break; break;
// images root node management : many image for one entity (product) // images root node management : many image for one entity (product)
case '': case '':
$this->output .= $this->objOutput->getObjectRender()->renderNodeHeader('image_types', array()); $this->output .= $this->objOutput->getObjectRender()->renderNodeHeader('image_types', array());
@@ -308,7 +304,7 @@ class WebserviceSpecificManagementImagesCore implements WebserviceSpecificManage
$this->output .= $this->objOutput->getObjectRender()->renderNodeFooter('image_types', array()); $this->output .= $this->objOutput->getObjectRender()->renderNodeFooter('image_types', array());
return true; return true;
break; break;
default: default:
$exception = new WebserviceException(sprintf('Image of type "%s" does not exists', $this->wsObject->urlSegment[1]), array(48, 400)); $exception = new WebserviceException(sprintf('Image of type "%s" does not exists', $this->wsObject->urlSegment[1]), array(48, 400));
throw $exception->setDidYouMean($this->wsObject->urlSegment[1], array_keys($this->imageTypes)); throw $exception->setDidYouMean($this->wsObject->urlSegment[1], array_keys($this->imageTypes));
@@ -316,7 +312,7 @@ class WebserviceSpecificManagementImagesCore implements WebserviceSpecificManage
} }
/** /**
* Management of general images * Management of general images
* *
* @return boolean * @return boolean
*/ */
private function manageGeneralImages() private function manageGeneralImages()
@@ -332,7 +328,7 @@ class WebserviceSpecificManagementImagesCore implements WebserviceSpecificManage
else else
throw new WebserviceException('This method is not allowed with general image resources.', array(49, 405)); throw new WebserviceException('This method is not allowed with general image resources.', array(49, 405));
break; break;
// Set the image path on display in relation to the mail image // Set the image path on display in relation to the mail image
case 'mail': case 'mail':
if (in_array($this->wsObject->method, array('GET','HEAD','PUT'))) if (in_array($this->wsObject->method, array('GET','HEAD','PUT')))
@@ -343,7 +339,7 @@ class WebserviceSpecificManagementImagesCore implements WebserviceSpecificManage
else else
throw new WebserviceException('This method is not allowed with general image resources.', array(50, 405)); throw new WebserviceException('This method is not allowed with general image resources.', array(50, 405));
break; break;
// Set the image path on display in relation to the invoice image // Set the image path on display in relation to the invoice image
case 'invoice': case 'invoice':
if (in_array($this->wsObject->method, array('GET','HEAD','PUT'))) if (in_array($this->wsObject->method, array('GET','HEAD','PUT')))
@@ -354,7 +350,7 @@ class WebserviceSpecificManagementImagesCore implements WebserviceSpecificManage
else else
throw new WebserviceException('This method is not allowed with general image resources.', array(51, 405)); throw new WebserviceException('This method is not allowed with general image resources.', array(51, 405));
break; break;
// Set the image path on display in relation to the icon store image // Set the image path on display in relation to the icon store image
case 'store_icon': case 'store_icon':
if (in_array($this->wsObject->method, array('GET','HEAD','PUT'))) if (in_array($this->wsObject->method, array('GET','HEAD','PUT')))
@@ -365,7 +361,7 @@ class WebserviceSpecificManagementImagesCore implements WebserviceSpecificManage
else else
throw new WebserviceException('This method is not allowed with general image resources.', array(52, 405)); throw new WebserviceException('This method is not allowed with general image resources.', array(52, 405));
break; break;
// List the general image types // List the general image types
case '': case '':
$this->output .= $this->objOutput->getObjectRender()->renderNodeHeader('general_image_types', array()); $this->output .= $this->objOutput->getObjectRender()->renderNodeHeader('general_image_types', array());
@@ -381,7 +377,7 @@ class WebserviceSpecificManagementImagesCore implements WebserviceSpecificManage
$this->output .= $this->objOutput->getObjectRender()->renderNodeFooter('general_image_types', array()); $this->output .= $this->objOutput->getObjectRender()->renderNodeFooter('general_image_types', array());
return true; return true;
break; break;
// If the image type does not exist... // If the image type does not exist...
default: default:
$exception = new WebserviceException(sprintf('General image of type "%s" does not exists', $this->wsObject->urlSegment[2]), array(53, 400)); $exception = new WebserviceException(sprintf('General image of type "%s" does not exists', $this->wsObject->urlSegment[2]), array(53, 400));
@@ -396,7 +392,7 @@ class WebserviceSpecificManagementImagesCore implements WebserviceSpecificManage
return true; return true;
break; break;
case 'PUT': case 'PUT':
if ($this->writePostedImageOnDisk($path, NULL, NULL)) if ($this->writePostedImageOnDisk($path, NULL, NULL))
{ {
if ($this->wsObject->urlSegment[2] == 'header') if ($this->wsObject->urlSegment[2] == 'header')
@@ -413,7 +409,7 @@ class WebserviceSpecificManagementImagesCore implements WebserviceSpecificManage
break; break;
} }
} }
private function manageDefaultDeclinatedImages($directory, $normal_image_sizes) private function manageDefaultDeclinatedImages($directory, $normal_image_sizes)
{ {
$this->defaultImage = true; $this->defaultImage = true;
@@ -427,7 +423,7 @@ class WebserviceSpecificManagementImagesCore implements WebserviceSpecificManage
$defaultLang = $lang['iso_code']; $defaultLang = $lang['iso_code'];
$langs[] = $lang['iso_code']; $langs[] = $lang['iso_code'];
} }
// Display list of languages // Display list of languages
if($this->wsObject->urlSegment[3] == '' && $this->wsObject->method == 'GET') if($this->wsObject->urlSegment[3] == '' && $this->wsObject->method == 'GET')
{ {
@@ -442,7 +438,7 @@ class WebserviceSpecificManagementImagesCore implements WebserviceSpecificManage
); );
$this->output .= $this->objOutput->getObjectRender()->renderNodeHeader('language', array(), $more_attr, false); $this->output .= $this->objOutput->getObjectRender()->renderNodeHeader('language', array(), $more_attr, false);
} }
$this->output .= $this->objOutput->getObjectRender()->renderNodeFooter('languages', array()); $this->output .= $this->objOutput->getObjectRender()->renderNodeFooter('languages', array());
return true; return true;
} }
@@ -458,19 +454,19 @@ class WebserviceSpecificManagementImagesCore implements WebserviceSpecificManage
return $this->manageDeclinatedImagesCRUD($filename_exists, $filename, $normal_image_sizes, $directory);// @todo : [feature] @see todo#1 return $this->manageDeclinatedImagesCRUD($filename_exists, $filename, $normal_image_sizes, $directory);// @todo : [feature] @see todo#1
} }
} }
private function manageListDeclinatedImages($directory, $normal_image_sizes) private function manageListDeclinatedImages($directory, $normal_image_sizes)
{ {
// Check if method is allowed // Check if method is allowed
if ($this->wsObject->method != 'GET') if ($this->wsObject->method != 'GET')
throw new WebserviceException('This method is not allowed for listing category images.', array(55, 405)); throw new WebserviceException('This method is not allowed for listing category images.', array(55, 405));
$this->output .= $this->objOutput->getObjectRender()->renderNodeHeader('image_types', array()); $this->output .= $this->objOutput->getObjectRender()->renderNodeHeader('image_types', array());
foreach ($normal_image_sizes as $image_size) foreach ($normal_image_sizes as $image_size)
$this->output .= $this->objOutput->getObjectRender()->renderNodeHeader('image_type', array(), array('id' => $image_size['id_image_type'], 'name' => $image_size['name'], 'xlink_resource'=>$this->wsObject->wsUrl.'image_types/'.$image_size['id_image_type']), false); $this->output .= $this->objOutput->getObjectRender()->renderNodeHeader('image_type', array(), array('id' => $image_size['id_image_type'], 'name' => $image_size['name'], 'xlink_resource'=>$this->wsObject->wsUrl.'image_types/'.$image_size['id_image_type']), false);
$this->output .= $this->objOutput->getObjectRender()->renderNodeFooter('image_types', array()); $this->output .= $this->objOutput->getObjectRender()->renderNodeFooter('image_types', array());
$this->output .= $this->objOutput->getObjectRender()->renderNodeHeader('images', array()); $this->output .= $this->objOutput->getObjectRender()->renderNodeHeader('images', array());
if ($this->imageType == 'products') if ($this->imageType == 'products')
{ {
$ids = array(); $ids = array();
@@ -505,7 +501,7 @@ class WebserviceSpecificManagementImagesCore implements WebserviceSpecificManage
$this->output .= $this->objOutput->getObjectRender()->renderNodeFooter('images', array()); $this->output .= $this->objOutput->getObjectRender()->renderNodeFooter('images', array());
return true; return true;
} }
private function manageEntityDeclinatedImages($directory, $normal_image_sizes) private function manageEntityDeclinatedImages($directory, $normal_image_sizes)
{ {
$normal_image_size_names = array(); $normal_image_size_names = array();
@@ -515,20 +511,20 @@ class WebserviceSpecificManagementImagesCore implements WebserviceSpecificManage
$object_id = $this->wsObject->urlSegment[2]; $object_id = $this->wsObject->urlSegment[2];
if (!Validate::isUnsignedId($object_id)) if (!Validate::isUnsignedId($object_id))
throw new WebserviceException('The image id is invalid. Please set a valid id or the "default" value', array(60, 400)); throw new WebserviceException('The image id is invalid. Please set a valid id or the "default" value', array(60, 400));
// For the product case // For the product case
if ($this->imageType == 'products') if ($this->imageType == 'products')
{ {
// Get available image ids // Get available image ids
$available_image_ids = array(); $available_image_ids = array();
// New Behavior // New Behavior
$languages = Language::getLanguages(); $languages = Language::getLanguages();
foreach ($languages as $language) foreach ($languages as $language)
foreach (Image::getImages($language['id_lang'], $object_id) as $image) foreach (Image::getImages($language['id_lang'], $object_id) as $image)
$available_image_ids[] = $image['id_image']; $available_image_ids[] = $image['id_image'];
// Old Behavior // Old Behavior
$nodes = scandir($directory); $nodes = scandir($directory);
foreach ($nodes as $node) foreach ($nodes as $node)
@@ -539,7 +535,7 @@ class WebserviceSpecificManagementImagesCore implements WebserviceSpecificManage
if (isset($matches[1])) if (isset($matches[1]))
$available_image_ids[] = $matches[1]; $available_image_ids[] = $matches[1];
} }
// If an image id is specified // If an image id is specified
if ($this->wsObject->urlSegment[3] != '') if ($this->wsObject->urlSegment[3] != '')
{ {
@@ -552,7 +548,7 @@ class WebserviceSpecificManagementImagesCore implements WebserviceSpecificManage
throw new WebserviceException('This image id does not exist', array(57, 400)); throw new WebserviceException('This image id does not exist', array(57, 400));
else else
{ {
// Check for new image system // Check for new image system
$image_id = $this->wsObject->urlSegment[3]; $image_id = $this->wsObject->urlSegment[3];
$path = implode('/', str_split((string)$image_id)); $path = implode('/', str_split((string)$image_id));
@@ -586,7 +582,7 @@ class WebserviceSpecificManagementImagesCore implements WebserviceSpecificManage
$this->wsObject->setOutputEnabled(false); $this->wsObject->setOutputEnabled(false);
} }
} }
} }
// for all other cases // for all other cases
else else
@@ -595,16 +591,16 @@ class WebserviceSpecificManagementImagesCore implements WebserviceSpecificManage
$image_size = $this->wsObject->urlSegment[3]; $image_size = $this->wsObject->urlSegment[3];
$filename = $directory.$object_id.'-'.$image_size.'.jpg'; $filename = $directory.$object_id.'-'.$image_size.'.jpg';
} }
// in case of declinated images list of a product is get // in case of declinated images list of a product is get
if ($this->output != '') if ($this->output != '')
return true; return true;
// If a size was given try to display it // If a size was given try to display it
elseif (isset($image_size) && $image_size != '') elseif (isset($image_size) && $image_size != '')
{ {
// Check the given size // Check the given size
if ($this->imageType == 'products' && $image_size == 'bin') if ($this->imageType == 'products' && $image_size == 'bin')
$filename = $directory.$object_id.'-'.$image_id.'.jpg'; $filename = $directory.$object_id.'-'.$image_id.'.jpg';
@@ -615,7 +611,7 @@ class WebserviceSpecificManagementImagesCore implements WebserviceSpecificManage
} }
if (!file_exists($filename)) if (!file_exists($filename))
throw new WebserviceException('This image does not exist on disk', array(59, 500)); throw new WebserviceException('This image does not exist on disk', array(59, 500));
// Display the resized specific image // Display the resized specific image
$this->imgToDisplay = $filename; $this->imgToDisplay = $filename;
return true; return true;
@@ -634,7 +630,7 @@ class WebserviceSpecificManagementImagesCore implements WebserviceSpecificManage
/** /**
* Management of normal images (as categories, suppliers, manufacturers and stores) * Management of normal images (as categories, suppliers, manufacturers and stores)
* *
* @param string $directory the file path of the root of the images folder type * @param string $directory the file path of the root of the images folder type
* @return boolean * @return boolean
*/ */
@@ -656,17 +652,17 @@ class WebserviceSpecificManagementImagesCore implements WebserviceSpecificManage
return $this->manageEntityDeclinatedImages($directory, $normal_image_sizes); return $this->manageEntityDeclinatedImages($directory, $normal_image_sizes);
break; break;
} }
} }
private function manageProductImages() private function manageProductImages()
{ {
$this->manageDeclinatedImages(_PS_PROD_IMG_DIR_); $this->manageDeclinatedImages(_PS_PROD_IMG_DIR_);
} }
/** /**
* Management of normal images CRUD * Management of normal images CRUD
* *
* @param boolean $filename_exists if the filename exists * @param boolean $filename_exists if the filename exists
* @param string $filename the image path * @param string $filename the image path
* @param array $imageSizes The * @param array $imageSizes The
@@ -726,14 +722,14 @@ class WebserviceSpecificManagementImagesCore implements WebserviceSpecificManage
throw new WebserviceException('Unable to save this image', array(66, 500)); throw new WebserviceException('Unable to save this image', array(66, 500));
} }
break; break;
default : default :
throw new WebserviceException('This method is not allowed', array(67, 405)); throw new WebserviceException('This method is not allowed', array(67, 405));
} }
} }
/** /**
* Delete the image on disk * Delete the image on disk
* *
* @param string $filePath the image file path * @param string $filePath the image file path
* @param array $imageTypes The differents sizes * @param array $imageTypes The differents sizes
* @param string $parentPath The parent path * @param string $parentPath The parent path
@@ -770,10 +766,10 @@ class WebserviceSpecificManagementImagesCore implements WebserviceSpecificManage
return false; return false;
} }
} }
/** /**
* Write the image on disk * Write the image on disk
* *
* @param string $basePath * @param string $basePath
* @param string $newPath * @param string $newPath
* @param int $destWidth * @param int $destWidth
@@ -802,10 +798,10 @@ class WebserviceSpecificManagementImagesCore implements WebserviceSpecificManage
$sourceImage = imagecreatefromjpeg($basePath); $sourceImage = imagecreatefromjpeg($basePath);
break; break;
} }
$widthDiff = $destWidth / $sourceWidth; $widthDiff = $destWidth / $sourceWidth;
$heightDiff = $destHeight / $sourceHeight; $heightDiff = $destHeight / $sourceHeight;
if ($widthDiff > 1 AND $heightDiff > 1) if ($widthDiff > 1 AND $heightDiff > 1)
{ {
$nextWidth = $sourceWidth; $nextWidth = $sourceWidth;
@@ -826,10 +822,10 @@ class WebserviceSpecificManagementImagesCore implements WebserviceSpecificManage
$destHeight = ((int)(Configuration::get('PS_IMAGE_GENERATION_METHOD')) == 0 ? $destHeight : $nextHeight); $destHeight = ((int)(Configuration::get('PS_IMAGE_GENERATION_METHOD')) == 0 ? $destHeight : $nextHeight);
} }
} }
$borderWidth = (int)(($destWidth - $nextWidth) / 2); $borderWidth = (int)(($destWidth - $nextWidth) / 2);
$borderHeight = (int)(($destHeight - $nextHeight) / 2); $borderHeight = (int)(($destHeight - $nextHeight) / 2);
// Build the image // Build the image
if ( if (
!($destImage = imagecreatetruecolor($destWidth, $destHeight)) || !($destImage = imagecreatetruecolor($destWidth, $destHeight)) ||
@@ -839,7 +835,7 @@ class WebserviceSpecificManagementImagesCore implements WebserviceSpecificManage
!imagecolortransparent($destImage, $white) !imagecolortransparent($destImage, $white)
) )
throw new WebserviceException(sprintf('Unable to build the image "%s".', str_replace(_PS_ROOT_DIR_, '[SHOP_ROOT_DIR]', $newPath)), array(69, 500)); throw new WebserviceException(sprintf('Unable to build the image "%s".', str_replace(_PS_ROOT_DIR_, '[SHOP_ROOT_DIR]', $newPath)), array(69, 500));
// Write it on disk // Write it on disk
$imaged = false; $imaged = false;
switch ($this->imgExtension) switch ($this->imgExtension)
@@ -858,7 +854,7 @@ class WebserviceSpecificManagementImagesCore implements WebserviceSpecificManage
imagedestroy($destImage); imagedestroy($destImage);
if (!$imaged) if (!$imaged)
throw new WebserviceException(sprintf('Unable to write the image "%s".', str_replace(_PS_ROOT_DIR_, '[SHOP_ROOT_DIR]', $newPath)), array(70, 500)); throw new WebserviceException(sprintf('Unable to write the image "%s".', str_replace(_PS_ROOT_DIR_, '[SHOP_ROOT_DIR]', $newPath)), array(70, 500));
// Write image declinations if present // Write image declinations if present
if ($imageTypes) if ($imageTypes)
{ {
@@ -881,10 +877,10 @@ class WebserviceSpecificManagementImagesCore implements WebserviceSpecificManage
} }
return $newPath; return $newPath;
} }
/** /**
* Write the posted image on disk * Write the posted image on disk
* *
* @param string $sreceptionPath * @param string $sreceptionPath
* @param int $destWidth * @param int $destWidth
* @param int $destHeight * @param int $destHeight
@@ -918,14 +914,14 @@ class WebserviceSpecificManagementImagesCore implements WebserviceSpecificManage
$mime_type = $file['type']; $mime_type = $file['type'];
if (($pos = strpos($mime_type, ';')) !== false) if (($pos = strpos($mime_type, ';')) !== false)
$mime_type = substr($mime_type, 0, $pos); $mime_type = substr($mime_type, 0, $pos);
// Check mime content type // Check mime content type
if(!$mime_type || !in_array($mime_type, $this->acceptedImgMimeTypes)) if(!$mime_type || !in_array($mime_type, $this->acceptedImgMimeTypes))
throw new WebserviceException('This type of image format not recognized, allowed formats are: '.implode('", "', $this->acceptedImgMimeTypes), array(73, 400)); throw new WebserviceException('This type of image format not recognized, allowed formats are: '.implode('", "', $this->acceptedImgMimeTypes), array(73, 400));
// Check error while uploading // Check error while uploading
elseif ($file['error']) elseif ($file['error'])
throw new WebserviceException('Error while uploading image. Please change your server\'s settings', array(74, 400)); throw new WebserviceException('Error while uploading image. Please change your server\'s settings', array(74, 400));
// Try to copy image file to a temporary file // Try to copy image file to a temporary file
if (!$tmpName = tempnam(_PS_TMP_IMG_DIR_, 'PS') OR !move_uploaded_file($_FILES['image']['tmp_name'], $tmpName)) if (!$tmpName = tempnam(_PS_TMP_IMG_DIR_, 'PS') OR !move_uploaded_file($_FILES['image']['tmp_name'], $tmpName))
throw new WebserviceException('Error while copying image to the temporary directory', array(75, 400)); throw new WebserviceException('Error while copying image to the temporary directory', array(75, 400));
@@ -965,19 +961,19 @@ class WebserviceSpecificManagementImagesCore implements WebserviceSpecificManage
if (!Validate::isLoadedObject($product)) if (!Validate::isLoadedObject($product))
throw new WebserviceException('Product '.(int)$this->wsObject->urlSegment[2].' doesn\'t exists', array(76, 400)); throw new WebserviceException('Product '.(int)$this->wsObject->urlSegment[2].' doesn\'t exists', array(76, 400));
} }
// copy image // copy image
if (!isset($file['tmp_name'])) if (!isset($file['tmp_name']))
return false; return false;
if ($error = checkImage($file, $this->imgMaxUploadSize)) if ($error = checkImage($file, $this->imgMaxUploadSize))
throw new WebserviceException('Bad image : '.$error, array(76, 400)); throw new WebserviceException('Bad image : '.$error, array(76, 400));
if ($this->imageType == 'products') if ($this->imageType == 'products')
{ {
$image = new Image($image->id); $image = new Image($image->id);
if (!(Configuration::get('PS_OLD_FILESYSTEM') && file_exists(_PS_PROD_IMG_DIR_.$product->id.'-'.$image->id.'.jpg'))) if (!(Configuration::get('PS_OLD_FILESYSTEM') && file_exists(_PS_PROD_IMG_DIR_.$product->id.'-'.$image->id.'.jpg')))
$image->createImgFolder(); $image->createImgFolder();
if (!$tmpName = tempnam(_PS_TMP_IMG_DIR_, 'PS') OR !move_uploaded_file($file['tmp_name'], $tmpName)) if (!$tmpName = tempnam(_PS_TMP_IMG_DIR_, 'PS') OR !move_uploaded_file($file['tmp_name'], $tmpName))
throw new WebserviceException('An error occurred during the image upload', array(76, 400)); throw new WebserviceException('An error occurred during the image upload', array(76, 400));
elseif (!imageResize($tmpName, _PS_PROD_IMG_DIR_.$image->getExistingImgPath().'.'.$image->image_format)) elseif (!imageResize($tmpName, _PS_PROD_IMG_DIR_.$image->getExistingImgPath().'.'.$image->image_format))
@@ -1,6 +1,6 @@
<?php <?php
/* /*
* 2007-2011 PrestaShop * 2007-2011 PrestaShop
* *
* NOTICE OF LICENSE * NOTICE OF LICENSE
* *
@@ -25,22 +25,18 @@
* International Registered Trademark & Property of PrestaShop SA * International Registered Trademark & Property of PrestaShop SA
*/ */
/**
* @author Lucas Cherifi - Nans Pellicari - Anatole Korczak - PrestaShop Team
*/
interface WebserviceSpecificManagementInterface interface WebserviceSpecificManagementInterface
{ {
public function setObjectOutput(WebserviceOutputBuilderCore $obj); public function setObjectOutput(WebserviceOutputBuilderCore $obj);
public function getObjectOutput(); public function getObjectOutput();
public function setWsObject(WebserviceRequestCore $obj); public function setWsObject(WebserviceRequestCore $obj);
public function getWsObject(); public function getWsObject();
public function manage(); public function manage();
/** /**
* This must be return an array with specific values as WebserviceRequest expects. * This must be return an array with specific values as WebserviceRequest expects.
* *
* @return array * @return array
*/ */
public function getContent(); public function getContent();
@@ -1,6 +1,6 @@
<?php <?php
/* /*
* 2007-2011 PrestaShop * 2007-2011 PrestaShop
* *
* NOTICE OF LICENSE * NOTICE OF LICENSE
* *
@@ -25,32 +25,28 @@
* International Registered Trademark & Property of PrestaShop SA * International Registered Trademark & Property of PrestaShop SA
*/ */
/**
* @author Lucas Cherifi - Nans Pellicari - Anatole Korczak - PrestaShop Team
*/
class WebserviceSpecificManagementSearchCore implements WebserviceSpecificManagementInterface class WebserviceSpecificManagementSearchCore implements WebserviceSpecificManagementInterface
{ {
protected $objOutput; protected $objOutput;
protected $output; protected $output;
protected $wsObject; protected $wsObject;
// ------------------------------------------------ // ------------------------------------------------
// GETTERS & SETTERS // GETTERS & SETTERS
// ------------------------------------------------ // ------------------------------------------------
public function setObjectOutput(WebserviceOutputBuilderCore $obj) public function setObjectOutput(WebserviceOutputBuilderCore $obj)
{ {
$this->objOutput = $obj; $this->objOutput = $obj;
return $this; return $this;
} }
public function setWsObject(WebserviceRequestCore $obj) public function setWsObject(WebserviceRequestCore $obj)
{ {
$this->wsObject = $obj; $this->wsObject = $obj;
return $this; return $this;
} }
public function getWsObject() public function getWsObject()
{ {
return $this->wsObject; return $this->wsObject;
@@ -59,36 +55,36 @@ class WebserviceSpecificManagementSearchCore implements WebserviceSpecificManage
{ {
return $this->objOutput; return $this->objOutput;
} }
public function setUrlSegment($segments) public function setUrlSegment($segments)
{ {
$this->urlSegment = $segments; $this->urlSegment = $segments;
return $this; return $this;
} }
public function getUrlSegment() public function getUrlSegment()
{ {
return $this->urlSegment; return $this->urlSegment;
} }
/** /**
* Management of search * Management of search
* *
*/ */
public function manage() public function manage()
{ {
if (!isset($this->wsObject->urlFragments['query']) || !isset($this->wsObject->urlFragments['language'])) if (!isset($this->wsObject->urlFragments['query']) || !isset($this->wsObject->urlFragments['language']))
throw new WebserviceException('You have to set both the \'language\' and \'query\' parameters to get a result', array(100, 400)); throw new WebserviceException('You have to set both the \'language\' and \'query\' parameters to get a result', array(100, 400));
$objects_products = array(); $objects_products = array();
$objects_categories = array(); $objects_categories = array();
$objects_products['empty'] = new Product(); $objects_products['empty'] = new Product();
$objects_categories['empty'] = new Category(); $objects_categories['empty'] = new Category();
$this->_resourceConfiguration = $objects_products['empty']->getWebserviceParameters(); $this->_resourceConfiguration = $objects_products['empty']->getWebserviceParameters();
if (!$this->wsObject->setFieldsToDisplay()) if (!$this->wsObject->setFieldsToDisplay())
return false; return false;
$results = Search::find($this->wsObject->urlFragments['language'], $this->wsObject->urlFragments['query'], 1, 1, 'position', 'desc', true, false); $results = Search::find($this->wsObject->urlFragments['language'], $this->wsObject->urlFragments['query'], 1, 1, 'position', 'desc', true, false);
$categories = array(); $categories = array();
foreach ($results AS $result) foreach ($results AS $result)
@@ -109,13 +105,13 @@ class WebserviceSpecificManagementSearchCore implements WebserviceSpecificManage
// $this->_resourceConfiguration = $objects_categories['empty']->getWebserviceParameters(); // $this->_resourceConfiguration = $objects_categories['empty']->getWebserviceParameters();
// if (!$this->setFieldsToDisplay()) // if (!$this->setFieldsToDisplay())
// return false; // return false;
$this->output .= $this->objOutput->getContent($objects_categories, null, $this->wsObject->fieldsToDisplay, $this->wsObject->depth, WebserviceOutputBuilder::VIEW_LIST, false); $this->output .= $this->objOutput->getContent($objects_categories, null, $this->wsObject->fieldsToDisplay, $this->wsObject->depth, WebserviceOutputBuilder::VIEW_LIST, false);
} }
/** /**
* This must be return an array with specific values as WebserviceRequest expects. * This must be return an array with specific values as WebserviceRequest expects.
* *
* @return array * @return array
*/ */
public function getContent() public function getContent()
+28 -28
View File
@@ -73,7 +73,7 @@ if (file_exists(INSTALL_PATH.'/../config/settings.inc.php'))
{ {
require_once(INSTALL_PATH.'/../config/settings.inc.php'); require_once(INSTALL_PATH.'/../config/settings.inc.php');
$oldversion =_PS_VERSION_; $oldversion =_PS_VERSION_;
// fix : complete version number if there is not all 4 numbers // fix : complete version number if there is not all 4 numbers
// for example replace 1.4.3 by 1.4.3.0 // for example replace 1.4.3 by 1.4.3.0
// consequences : file 1.4.3.0.sql will be skipped if oldversion = 1.4.3 // consequences : file 1.4.3.0.sql will be skipped if oldversion = 1.4.3
@@ -86,7 +86,7 @@ if (file_exists(INSTALL_PATH.'/../config/settings.inc.php'))
$oldversion = implode('.', $arrayVersion); $oldversion = implode('.', $arrayVersion);
// end of fix // end of fix
$tooOld = (version_compare($oldversion, MINIMUM_VERSION_TO_UPDATE) == -1); $tooOld = (version_compare($oldversion, MINIMUM_VERSION_TO_UPDATE) == -1);
$sameVersions = (version_compare($oldversion, INSTALL_VERSION) == 0); $sameVersions = (version_compare($oldversion, INSTALL_VERSION) == 0);
$installOfOldVersion = (version_compare($oldversion, INSTALL_VERSION) == 1); $installOfOldVersion = (version_compare($oldversion, INSTALL_VERSION) == 1);
@@ -230,7 +230,7 @@ if ($lm->getIncludeTradFilename())
{ {
$.ajax({ $.ajax({
url: 'model.php?method=getVersionFromDb&language='+id_lang, url: 'model.php?method=getVersionFromDb&language='+id_lang,
success: function (xml) success: function (xml)
{ {
var action = $(xml).find('action'); var action = $(xml).find('action');
if (action.attr('result') == 'ko') if (action.attr('result') == 'ko')
@@ -276,7 +276,7 @@ if ($lm->getIncludeTradFilename())
</ul> </ul>
<div id="PrestaShopLogo">PrestaShop</div> <div id="PrestaShopLogo">PrestaShop</div>
<div id="infosSup"> <div id="infosSup">
<div class="installerVersion" id="installerVersion-<?php echo $lm->getIsoCodeSelectedLang()?>">PrestaShop <?php echo INSTALL_VERSION.'<br />'.lang('Installer'); ?></div> <div class="installerVersion" id="installerVersion-<?php echo $lm->getIsoCodeSelectedLang()?>">PrestaShop <?php echo INSTALL_VERSION.'<br />'.lang('Installer'); ?></div>
<div class="updaterVersion" id="updaterVersion-<?php echo $lm->getIsoCodeSelectedLang()?>">PrestaShop <?php echo INSTALL_VERSION.'<br />'.lang('Updater'); ?></div> <div class="updaterVersion" id="updaterVersion-<?php echo $lm->getIsoCodeSelectedLang()?>">PrestaShop <?php echo INSTALL_VERSION.'<br />'.lang('Updater'); ?></div>
@@ -306,7 +306,7 @@ if ($lm->getIncludeTradFilename())
<div class="sheet shown" id="sheet_lang"> <div class="sheet shown" id="sheet_lang">
<div class="contentTitle"> <div class="contentTitle">
<h1><?php echo lang('Welcome')?></h1> <h1><?php echo lang('Welcome')?></h1>
<ul id="stepList_1" class="stepList clearfix"> <ul id="stepList_1" class="stepList clearfix">
<li>Etape 1</li> <li>Etape 1</li>
<li>Etape 2</li> <li>Etape 2</li>
@@ -315,7 +315,7 @@ if ($lm->getIncludeTradFilename())
<li>Etape 5</li> <li>Etape 5</li>
</ul> </ul>
</div> </div>
<h2 id="welcome-title"><?php echo lang('Welcome to the PrestaShop '.INSTALL_VERSION.' Installer.'); ?></h2> <h2 id="welcome-title"><?php echo lang('Welcome to the PrestaShop '.INSTALL_VERSION.' Installer.'); ?></h2>
<script type="text/javascript">$('#welcome-title').html(Step1Title);</script> <script type="text/javascript">$('#welcome-title').html(Step1Title);</script>
<p><?php echo lang('Please allow 5-15 minutes to complete the installation process.')?></p> <p><?php echo lang('Please allow 5-15 minutes to complete the installation process.')?></p>
@@ -381,7 +381,7 @@ if ($lm->getIncludeTradFilename())
<p><strong>14. Definition of "You" in This License.</strong> "You" throughout this License, whether in upper or lower case, means an individual or a legal entity exercising rights under, and complying with all of the terms of, this License. For legal entities, "You" includes any entity that controls, is controlled by, or is under common control with you. For purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity.</p> <p><strong>14. Definition of "You" in This License.</strong> "You" throughout this License, whether in upper or lower case, means an individual or a legal entity exercising rights under, and complying with all of the terms of, this License. For legal entities, "You" includes any entity that controls, is controlled by, or is under common control with you. For purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity.</p>
<p><strong>15. Right to Use.</strong> You may use the Original Work in all ways not otherwise restricted or conditioned by this License or by law, and Licensor promises not to interfere with or be responsible for such uses by You.</p> <p><strong>15. Right to Use.</strong> You may use the Original Work in all ways not otherwise restricted or conditioned by this License or by law, and Licensor promises not to interfere with or be responsible for such uses by You.</p>
<p><strong>16. Modification of This License.</strong> This License is Copyright &copy; 2005 Lawrence Rosen. Permission is granted to copy, distribute, or communicate this License without modification. Nothing in this License permits You to modify this License as applied to the Original Work or to Derivative Works. However, You may modify the text of this License and copy, distribute or communicate your modified version (the "Modified License") and apply it to other original works of authorship subject to the following conditions: (i) You may not indicate in any way that your Modified License is the "Open Software License" or "OSL" and you may not use those names in the name of your Modified License; (ii) You must replace the notice specified in the first paragraph above with the notice "Licensed under Open Software License ("OSL") v. 3.0" or with a notice of your own that is not confusingly similar to the notice in this License; and (iii) You may not claim that your original works are open source software unless your Modified License has been approved by Open Source Initiative (OSI) and You comply with its license review and certification process.</p> <p><strong>16. Modification of This License.</strong> This License is Copyright &copy; 2005 Lawrence Rosen. Permission is granted to copy, distribute, or communicate this License without modification. Nothing in this License permits You to modify this License as applied to the Original Work or to Derivative Works. However, You may modify the text of this License and copy, distribute or communicate your modified version (the "Modified License") and apply it to other original works of authorship subject to the following conditions: (i) You may not indicate in any way that your Modified License is the "Open Software License" or "OSL" and you may not use those names in the name of your Modified License; (ii) You must replace the notice specified in the first paragraph above with the notice "Licensed under Open Software License ("OSL") v. 3.0" or with a notice of your own that is not confusingly similar to the notice in this License; and (iii) You may not claim that your original works are open source software unless your Modified License has been approved by Open Source Initiative (OSI) and You comply with its license review and certification process.</p>
<h3>Modules and Themes: Academic Free License ("AFL") v. 3.0</h3> <h3>Modules and Themes: Academic Free License ("AFL") v. 3.0</h3>
<p>This Academic Free License (the "License") applies to any original work of authorship (the "Original Work") whose owner (the "Licensor") has placed the following licensing notice adjacent to the copyright notice for the Original Work:</p> <p>This Academic Free License (the "License") applies to any original work of authorship (the "Original Work") whose owner (the "Licensor") has placed the following licensing notice adjacent to the copyright notice for the Original Work:</p>
<h4>Licensed under the Academic Free License version 3.0</h4> <h4>Licensed under the Academic Free License version 3.0</h4>
@@ -488,7 +488,7 @@ if ($lm->getIncludeTradFilename())
<li>Etape 5</li> <li>Etape 5</li>
</ul> </ul>
</div> </div>
<div id="dbPart"> <div id="dbPart">
<h2><?php echo lang('Configure your database by filling out the following fields:')?></h2> <h2><?php echo lang('Configure your database by filling out the following fields:')?></h2>
<p><?php echo lang('You have to create a database, help available in readme_en.txt'); ?></p> <p><?php echo lang('You have to create a database, help available in readme_en.txt'); ?></p>
@@ -517,7 +517,7 @@ if ($lm->getIncludeTradFilename())
</select> </select>
</p> </p>
<p class="last"> <p class="last">
<label for="db_prefix"><?php echo lang('Tables prefix:')?></label> <label for="db_prefix"><?php echo lang('Tables prefix:')?></label>
<input class="text" type="text" id="db_prefix" value="ps_"/> <input class="text" type="text" id="db_prefix" value="ps_"/>
</p> </p>
<p class="aligned"> <p class="aligned">
@@ -537,7 +537,7 @@ if ($lm->getIncludeTradFilename())
</form> </form>
<p id="dbCreateResultCheck"></p> <p id="dbCreateResultCheck"></p>
</div> </div>
<div id="mailPart"> <div id="mailPart">
<h2><?php echo lang('E-mail delivery set-up')?></h2> <h2><?php echo lang('E-mail delivery set-up')?></h2>
@@ -579,7 +579,7 @@ if ($lm->getIncludeTradFilename())
</form> </form>
</div> </div>
<p> <p>
<input class="text" id="testEmail" type="text" size="15" value="<?php echo lang('enter@your.email'); ?>" /> &nbsp; <input class="text" id="testEmail" type="text" size="15" value="<?php echo lang('enter@your.email'); ?>" /> &nbsp;
<input id="btVerifyMail" class="button" type="submit" value="<?php echo lang('Send me a test email!'); ?>" /> <input id="btVerifyMail" class="button" type="submit" value="<?php echo lang('Send me a test email!'); ?>" />
</p> </p>
@@ -664,7 +664,7 @@ if ($lm->getIncludeTradFilename())
<p id="alignedLogo"><img id="uploadedImage" src="<?php echo PS_BASE_URI ?>img/logo.jpg" alt="Logo" /></p> <p id="alignedLogo"><img id="uploadedImage" src="<?php echo PS_BASE_URI ?>img/logo.jpg" alt="Logo" /></p>
</span> </span>
<p class="userInfos aligned"><?php echo lang('recommended dimensions: 230px X 75px'); ?></p> <p class="userInfos aligned"><?php echo lang('recommended dimensions: 230px X 75px'); ?></p>
<span id="inputFileLogo" class="contentinput"> <span id="inputFileLogo" class="contentinput">
<input type="file" onchange="uploadLogo()" name="fileToUpload" id="fileToUpload"/> <input type="file" onchange="uploadLogo()" name="fileToUpload" id="fileToUpload"/>
</span> </span>
@@ -725,7 +725,7 @@ if ($lm->getIncludeTradFilename())
<input type="checkbox" id="infosNotification" class="aligned" style="vertical-align: middle;" /><label for="infosNotification"><?php echo lang('Receive notifications by e-mail'); ?></label><br/> <input type="checkbox" id="infosNotification" class="aligned" style="vertical-align: middle;" /><label for="infosNotification"><?php echo lang('Receive notifications by e-mail'); ?></label><br/>
<span id="resultInfosNotification" class="result aligned"></span> <span id="resultInfosNotification" class="result aligned"></span>
</span> </span>
<p class="userInfos aligned"><?php echo lang('If you check this box and your mail configuration is wrong, your installation might be blocked. If so, please uncheck the box to go to the next step.'); ?></p> <p class="userInfos aligned"><?php echo lang('If you check this box and your mail configuration is wrong, your installation might be blocked. If so, please uncheck the box to go to the next step.'); ?></p>
</div> </div>
</div> </div>
@@ -757,7 +757,7 @@ if ($lm->getIncludeTradFilename())
$("select#infosTimezone").val(timezone); $("select#infosTimezone").val(timezone);
} }
}); });
autoCheckField("#infosCountry", "#resultInfosCountry", "required"); autoCheckField("#infosCountry", "#resultInfosCountry", "required");
autoCheckField("#infosTimezone", "#resultInfosTimezone", "required"); autoCheckField("#infosTimezone", "#resultInfosTimezone", "required");
}); });
@@ -797,7 +797,7 @@ if ($lm->getIncludeTradFilename())
foreach ($p->prechecked AS $country_iso_code) foreach ($p->prechecked AS $country_iso_code)
$modulesPrechecked[trim($p->key)][trim($country_iso_code)] = 1; $modulesPrechecked[trim($p->key)][trim($country_iso_code)] = 1;
} }
if (sizeof($modulesHelpInstall)) if (sizeof($modulesHelpInstall))
{ {
echo ' echo '
@@ -946,7 +946,7 @@ if ($lm->getIncludeTradFilename())
<?php }} ?> <?php }} ?>
</select> </select>
</div> </div>
</div> </div>
</form> </form>
@@ -957,10 +957,10 @@ if ($lm->getIncludeTradFilename())
</div> </div>
<div class="sheet clearfix" id="sheet_end"> <div class="sheet clearfix" id="sheet_end">
<div class="contentTitle"> <div class="contentTitle">
<h1><?php echo lang('PrestaShop is ready!'); ?></h1> <h1><?php echo lang('PrestaShop is ready!'); ?></h1>
<ul id="stepList_5" class="stepList clearfix"> <ul id="stepList_5" class="stepList clearfix">
<li class="ok">Etape 1 ok</li> <li class="ok">Etape 1 ok</li>
<li class="ok">Etape 2 ok</li> <li class="ok">Etape 2 ok</li>
@@ -994,7 +994,7 @@ if ($lm->getIncludeTradFilename())
</table> </table>
<h3 class="infosBlock"><?php echo lang('WARNING: For more security, you must delete the \'install\' folder and readme files(readme_fr.txt, readme_en.txt, readme_es.txt, readme_de.txt, readme_it.txt, CHANGELOG).'); ?></h3> <h3 class="infosBlock"><?php echo lang('WARNING: For more security, you must delete the \'install\' folder and readme files(readme_fr.txt, readme_en.txt, readme_es.txt, readme_de.txt, readme_it.txt, CHANGELOG).'); ?></h3>
<div id="boBlock" class="blockInfoEnd clearfix"> <div id="boBlock" class="blockInfoEnd clearfix">
<img src="img/visu_boBlock.png" /> <img src="img/visu_boBlock.png" />
<h3><?php echo lang('Back Office'); ?></h3> <h3><?php echo lang('Back Office'); ?></h3>
@@ -1007,7 +1007,7 @@ if ($lm->getIncludeTradFilename())
<p class="description"><?php echo lang('Find your store as your future customers will see!'); ?></p> <p class="description"><?php echo lang('Find your store as your future customers will see!'); ?></p>
<a href="../" id="access" class="FO" target="_blank"><span><?php echo lang('Discover your store'); ?></span></a> <a href="../" id="access" class="FO" target="_blank"><span><?php echo lang('Discover your store'); ?></span></a>
</div> </div>
<div id="resultEnd"></div> <div id="resultEnd"></div>
</div> </div>
<?php <?php
@@ -1023,7 +1023,7 @@ if ($lm->getIncludeTradFilename())
<div class="sheet clearfix" id="sheet_disclaimer"> <div class="sheet clearfix" id="sheet_disclaimer">
<div class="contentTitle"> <div class="contentTitle">
<h1><?php echo lang('Disclaimer'); ?></h1> <h1><?php echo lang('Disclaimer'); ?></h1>
<ul id="stepList_6" class="stepList clearfix"> <ul id="stepList_6" class="stepList clearfix">
<li class="ok">Etape 1</li> <li class="ok">Etape 1</li>
<li>Etape 2</li> <li>Etape 2</li>
@@ -1054,7 +1054,7 @@ if ($lm->getIncludeTradFilename())
url: 'xml/getNonNativeModules.php', url: 'xml/getNonNativeModules.php',
async: true, async: true,
dataType: "json", dataType: "json",
success: function (json) success: function (json)
{ {
if (json.length == 0) if (json.length == 0)
$('#nonNativeModules').hide(); $('#nonNativeModules').hide();
@@ -1073,7 +1073,7 @@ if ($lm->getIncludeTradFilename())
}); });
}); });
</script> </script>
<div id="nonNativeModules" style="font-weight: bold; background-color: #ffdeb7; color: #000; padding: 10px; border: 1px solid #999; margin-top: 10px;"> <div id="nonNativeModules" style="font-weight: bold; background-color: #ffdeb7; color: #000; padding: 10px; border: 1px solid #999; margin-top: 10px;">
<p><img src="../img/admin/warning.gif" alt="" style="vertical-align: middle;" /> <?php echo lang('It\'s dangerous to keep non-native modules activated during the update. If you really want to take this risk, uncheck the following box.'); ?></p> <p><img src="../img/admin/warning.gif" alt="" style="vertical-align: middle;" /> <?php echo lang('It\'s dangerous to keep non-native modules activated during the update. If you really want to take this risk, uncheck the following box.'); ?></p>
@@ -1083,13 +1083,13 @@ if ($lm->getIncludeTradFilename())
<?php echo lang('Ok, please desactivate the following modules, I will reactivate them later:'); ?> <?php echo lang('Ok, please desactivate the following modules, I will reactivate them later:'); ?>
</label> </label>
<ul id="nonNativeModulesLi"> <ul id="nonNativeModulesLi">
</ul> </ul>
</div> </div>
<?php <?php
endif; endif;
function sortnatversion($a, $b) function sortnatversion($a, $b)
{ {
return strnatcmp($a['version'], $b['version']); return strnatcmp($a['version'], $b['version']);
@@ -1286,9 +1286,9 @@ if ($lm->getIncludeTradFilename())
<li>Etape 4</li> <li>Etape 4</li>
</ul> </ul>
</div> </div>
<h3><?php echo lang('One or more errors have occurred, you can find more informations below or in the log/installation.log file.'); ?></h3> <h3><?php echo lang('One or more errors have occurred, you can find more informations below or in the log/installation.log file.'); ?></h3>
<p id="resultUpdate" class="errorBlock"></p> <p id="resultUpdate" class="errorBlock"></p>
<br /> <br />
<p id="detailsError" class="infosBlock"><?php echo lang('No more informations'); ?></p> <p id="detailsError" class="infosBlock"><?php echo lang('No more informations'); ?></p>
@@ -1330,7 +1330,7 @@ if ($lm->getIncludeTradFilename())
<div class="infosBlock"> <div class="infosBlock">
<?php echo lang('WARNING: For more security, you must delete the \'install\' folder and readme files (readme_fr.txt, readme_en.txt, readme_es.txt, readme_de.txt, readme_it.txt, CHANGELOG).'); ?> <?php echo lang('WARNING: For more security, you must delete the \'install\' folder and readme files (readme_fr.txt, readme_en.txt, readme_es.txt, readme_de.txt, readme_it.txt, CHANGELOG).'); ?>
</div> </div>
<div id="foBlock" class="blockInfoEnd clearfix"> <div id="foBlock" class="blockInfoEnd clearfix">
<img src="img/visu_foBlock.png" /> <img src="img/visu_foBlock.png" />
<h3><?php echo lang('Front Office'); ?></h3> <h3><?php echo lang('Front Office'); ?></h3>
@@ -33,7 +33,7 @@ function alter_productcomments_guest_index()
return; return;
DB::getInstance()->Execute(' DB::getInstance()->Execute('
ALTER TABLE `'._DB_PREFIX_.'product_comment` DROP INDEX `id_guest`, ALTER TABLE `'._DB_PREFIX_.'product_comment`
ADD INDEX `id_guest` USING BTREE(`id_guest`);'); DROP INDEX `id_guest`, ADD INDEX `id_guest` (`id_guest`);');
} }
+3 -3
View File
@@ -587,9 +587,9 @@ INSERT INTO `PREFIX_meta_lang` (`id_lang`, `id_meta`, `title`, `url_rewrite`) VA
(3, (SELECT `id_meta` FROM `PREFIX_meta` WHERE `page` = 'order'), 'Carrito', 'carrito'); (3, (SELECT `id_meta` FROM `PREFIX_meta` WHERE `page` = 'order'), 'Carrito', 'carrito');
INSERT INTO `PREFIX_meta` (`page`) VALUES ('search'); INSERT INTO `PREFIX_meta` (`page`) VALUES ('search');
INSERT INTO `PREFIX_meta_lang` (`id_lang`, `id_meta`, `title`, `url_rewrite`) VALUES INSERT INTO `PREFIX_meta_lang` (`id_lang`, `id_meta`, `title`, `url_rewrite`) VALUES
(1, (SELECT `id_meta` FROM `PREFIX_meta` WHERE `page` = 'search'), 'Search', 'search'), (1, (SELECT `id_meta` FROM `PREFIX_meta` WHERE `page` = 'search' LIMIT 1), 'Search', 'search'),
(2, (SELECT `id_meta` FROM `PREFIX_meta` WHERE `page` = 'search'), 'Recherche', 'recherche'), (2, (SELECT `id_meta` FROM `PREFIX_meta` WHERE `page` = 'search' LIMIT 1), 'Recherche', 'recherche'),
(3, (SELECT `id_meta` FROM `PREFIX_meta` WHERE `page` = 'search'), 'Buscar', 'buscar'); (3, (SELECT `id_meta` FROM `PREFIX_meta` WHERE `page` = 'search' LIMIT 1), 'Buscar', 'buscar');
INSERT INTO `PREFIX_meta` (`page`) VALUES ('stores'); INSERT INTO `PREFIX_meta` (`page`) VALUES ('stores');
INSERT INTO `PREFIX_meta_lang` (`id_lang`, `id_meta`, `title`, `url_rewrite`) VALUES INSERT INTO `PREFIX_meta_lang` (`id_lang`, `id_meta`, `title`, `url_rewrite`) VALUES
(1, (SELECT `id_meta` FROM `PREFIX_meta` WHERE `page` = 'stores'), 'Stores', 'stores'), (1, (SELECT `id_meta` FROM `PREFIX_meta` WHERE `page` = 'stores'), 'Stores', 'stores'),
+5
View File
@@ -48,3 +48,8 @@ UPDATE `PREFIX_lang` SET `date_format_lite` = 'd.m.Y' WHERE `iso_code` = 'de';
UPDATE `PREFIX_lang` SET `date_format_full` = 'd.m.Y H:i:s' WHERE `iso_code` = 'de'; UPDATE `PREFIX_lang` SET `date_format_full` = 'd.m.Y H:i:s' WHERE `iso_code` = 'de';
UPDATE `PREFIX_lang` SET `date_format_lite` = 'm/d/Y' WHERE `iso_code` = 'en'; UPDATE `PREFIX_lang` SET `date_format_lite` = 'm/d/Y' WHERE `iso_code` = 'en';
UPDATE `PREFIX_lang` SET `date_format_full` = 'm/d/Y H:i:s' WHERE `iso_code` = 'en'; UPDATE `PREFIX_lang` SET `date_format_full` = 'm/d/Y H:i:s' WHERE `iso_code` = 'en';
ALTER IGNORE TABLE `PREFIX_specific_price_priority` ADD UNIQUE (
`id_product`
);
+3 -3
View File
@@ -7,11 +7,11 @@
<language iso_code="it" /> <language iso_code="it" />
</languages> </languages>
<taxes> <taxes>
<tax id="1" name="IVA IT 20%" rate="20" /> <tax id="1" name="IVA IT 21%" rate="21" />
<tax id="2" name="IVA IT 10%" rate="10" /> <tax id="2" name="IVA IT 10%" rate="10" />
<tax id="3" name="IVA IT 4%" rate="4" /> <tax id="3" name="IVA IT 4%" rate="4" />
<taxRulesGroup name="IT Standard Rate (20%)"> <taxRulesGroup name="IT Standard Rate (21%)">
<taxRule iso_code_country="be" id_tax="1" /> <taxRule iso_code_country="be" id_tax="1" />
<taxRule iso_code_country="bg" id_tax="1" /> <taxRule iso_code_country="bg" id_tax="1" />
<taxRule iso_code_country="cz" id_tax="1" /> <taxRule iso_code_country="cz" id_tax="1" />
@@ -280,4 +280,4 @@
<unit type="base_distance" value="m" /> <unit type="base_distance" value="m" />
<unit type="long_distance" value="km" /> <unit type="long_distance" value="km" />
</units> </units>
</localizationPack> </localizationPack>
+1
View File
@@ -269,6 +269,7 @@ class AdminSelfUpgrade extends AdminSelfTab
{ {
$allowed = (ConfigurationTest::test_fopen() && $this->rootWritable); $allowed = (ConfigurationTest::test_fopen() && $this->rootWritable);
$allowed &= !Configuration::get('PS_SHOP_ENABLE'); $allowed &= !Configuration::get('PS_SHOP_ENABLE');
$allowed &= $this->upgrader->autoupgrade;
$allowed &= (Configuration::get('PS_AUTOUP_KEEP_TRAD') !== false); $allowed &= (Configuration::get('PS_AUTOUP_KEEP_TRAD') !== false);
return $allowed; return $allowed;
+1
View File
@@ -284,6 +284,7 @@ function reloadContent(params_plus)
reloadContent(); reloadContent();
return false; return false;
}); });
if (typeof(ajaxCart) != "undefined")
ajaxCart.overrideButtonsInThePage(); ajaxCart.overrideButtonsInThePage();
if (typeof(reloadProductComparison) == 'function') if (typeof(reloadProductComparison) == 'function')
+38 -37
View File
@@ -95,8 +95,8 @@ class BlockLayered extends Module
Db::getInstance()->Execute('DROP TABLE IF EXISTS '._DB_PREFIX_.'layered_friendly_url'); Db::getInstance()->Execute('DROP TABLE IF EXISTS '._DB_PREFIX_.'layered_friendly_url');
Db::getInstance()->Execute('DROP TABLE IF EXISTS '._DB_PREFIX_.'layered_indexable_attribute_group'); Db::getInstance()->Execute('DROP TABLE IF EXISTS '._DB_PREFIX_.'layered_indexable_attribute_group');
Db::getInstance()->Execute('DROP TABLE IF EXISTS '._DB_PREFIX_.'layered_indexable_feature'); Db::getInstance()->Execute('DROP TABLE IF EXISTS '._DB_PREFIX_.'layered_indexable_feature');
Db::getInstance()->Execute('DROP TABLE IF EXISTS '._DB_PREFIX_.'layered_indexable_attribute_group_lang'); Db::getInstance()->Execute('DROP TABLE IF EXISTS '._DB_PREFIX_.'layered_indexable_attribute_group_lang_value');
Db::getInstance()->Execute('DROP TABLE IF EXISTS '._DB_PREFIX_.'layered_indexable_feature_lang'); Db::getInstance()->Execute('DROP TABLE IF EXISTS '._DB_PREFIX_.'layered_indexable_feature_lang_value');
Db::getInstance()->Execute('DROP TABLE IF EXISTS '._DB_PREFIX_.'layered_category'); Db::getInstance()->Execute('DROP TABLE IF EXISTS '._DB_PREFIX_.'layered_category');
Db::getInstance()->Execute('DROP TABLE IF EXISTS '._DB_PREFIX_.'layered_filter'); Db::getInstance()->Execute('DROP TABLE IF EXISTS '._DB_PREFIX_.'layered_filter');
Db::getInstance()->Execute('DROP TABLE IF EXISTS '._DB_PREFIX_.'layered_product_attribute'); Db::getInstance()->Execute('DROP TABLE IF EXISTS '._DB_PREFIX_.'layered_product_attribute');
@@ -143,9 +143,9 @@ class BlockLayered extends Module
INSERT INTO `'._DB_PREFIX_.'layered_indexable_attribute_group` INSERT INTO `'._DB_PREFIX_.'layered_indexable_attribute_group`
SELECT id_attribute_group, 1 FROM `'._DB_PREFIX_.'attribute_group`'); SELECT id_attribute_group, 1 FROM `'._DB_PREFIX_.'attribute_group`');
Db::getInstance()->Execute('DROP TABLE IF EXISTS `'._DB_PREFIX_.'layered_indexable_attribute_group_lang`'); Db::getInstance()->Execute('DROP TABLE IF EXISTS `'._DB_PREFIX_.'layered_indexable_attribute_group_lang_value`');
Db::getInstance()->Execute(' Db::getInstance()->Execute('
CREATE TABLE `'._DB_PREFIX_.'layered_indexable_attribute_group_lang` ( CREATE TABLE `'._DB_PREFIX_.'layered_indexable_attribute_group_lang_value` (
`id_attribute_group` INT NOT NULL, `id_attribute_group` INT NOT NULL,
`id_lang` INT NOT NULL, `id_lang` INT NOT NULL,
`url_name` VARCHAR(20), `url_name` VARCHAR(20),
@@ -153,9 +153,9 @@ class BlockLayered extends Module
PRIMARY KEY (`id_attribute_group`, `id_lang`)) ENGINE = '._MYSQL_ENGINE_); PRIMARY KEY (`id_attribute_group`, `id_lang`)) ENGINE = '._MYSQL_ENGINE_);
// Attributes // Attributes
Db::getInstance()->Execute('DROP TABLE IF EXISTS `'._DB_PREFIX_.'layered_indexable_attribute_lang`'); Db::getInstance()->Execute('DROP TABLE IF EXISTS `'._DB_PREFIX_.'layered_indexable_attribute_lang_value`');
Db::getInstance()->Execute(' Db::getInstance()->Execute('
CREATE TABLE `'._DB_PREFIX_.'layered_indexable_attribute_lang` ( CREATE TABLE `'._DB_PREFIX_.'layered_indexable_attribute_lang_value` (
`id_attribute` INT NOT NULL, `id_attribute` INT NOT NULL,
`id_lang` INT NOT NULL, `id_lang` INT NOT NULL,
`url_name` VARCHAR(20), `url_name` VARCHAR(20),
@@ -175,9 +175,9 @@ class BlockLayered extends Module
INSERT INTO `'._DB_PREFIX_.'layered_indexable_feature` INSERT INTO `'._DB_PREFIX_.'layered_indexable_feature`
SELECT id_feature, 1 FROM `'._DB_PREFIX_.'feature`'); SELECT id_feature, 1 FROM `'._DB_PREFIX_.'feature`');
Db::getInstance()->Execute('DROP TABLE IF EXISTS `'._DB_PREFIX_.'layered_indexable_feature_lang`'); Db::getInstance()->Execute('DROP TABLE IF EXISTS `'._DB_PREFIX_.'layered_indexable_feature_lang_value`');
Db::getInstance()->Execute(' Db::getInstance()->Execute('
CREATE TABLE `'._DB_PREFIX_.'layered_indexable_feature_lang` ( CREATE TABLE `'._DB_PREFIX_.'layered_indexable_feature_lang_value` (
`id_feature` INT NOT NULL, `id_feature` INT NOT NULL,
`id_lang` INT NOT NULL, `id_lang` INT NOT NULL,
`url_name` VARCHAR(20) NOT NULL, `url_name` VARCHAR(20) NOT NULL,
@@ -185,9 +185,9 @@ class BlockLayered extends Module
PRIMARY KEY (`id_feature`, `id_lang`)) ENGINE = '._MYSQL_ENGINE_); PRIMARY KEY (`id_feature`, `id_lang`)) ENGINE = '._MYSQL_ENGINE_);
// Features values // Features values
Db::getInstance()->Execute('DROP TABLE IF EXISTS `'._DB_PREFIX_.'layered_indexable_feature_value_lang`'); Db::getInstance()->Execute('DROP TABLE IF EXISTS `'._DB_PREFIX_.'layered_indexable_feature_value_lang_value`');
Db::getInstance()->Execute(' Db::getInstance()->Execute('
CREATE TABLE `'._DB_PREFIX_.'layered_indexable_feature_value_lang` ( CREATE TABLE `'._DB_PREFIX_.'layered_indexable_feature_value_lang_value` (
`id_feature_value` INT NOT NULL, `id_feature_value` INT NOT NULL,
`id_lang` INT NOT NULL, `id_lang` INT NOT NULL,
`url_name` VARCHAR(20), `url_name` VARCHAR(20),
@@ -261,9 +261,9 @@ class BlockLayered extends Module
INNER JOIN '._DB_PREFIX_.'attribute a ON (a.id_attribute_group = ag.id_attribute_group) INNER JOIN '._DB_PREFIX_.'attribute a ON (a.id_attribute_group = ag.id_attribute_group)
INNER JOIN '._DB_PREFIX_.'attribute_lang al ON (al.id_attribute = a.id_attribute) INNER JOIN '._DB_PREFIX_.'attribute_lang al ON (al.id_attribute = a.id_attribute)
LEFT JOIN '._DB_PREFIX_.'layered_indexable_attribute_group liag ON (liag.id_attribute_group = a.id_attribute_group) LEFT JOIN '._DB_PREFIX_.'layered_indexable_attribute_group liag ON (liag.id_attribute_group = a.id_attribute_group)
LEFT JOIN '._DB_PREFIX_.'layered_indexable_attribute_group_lang liagl LEFT JOIN '._DB_PREFIX_.'layered_indexable_attribute_group_lang_value liagl
ON (liagl.id_attribute_group = ag.id_attribute_group AND liagl.id_lang = '.(int)$filter['id_lang'].') ON (liagl.id_attribute_group = ag.id_attribute_group AND liagl.id_lang = '.(int)$filter['id_lang'].')
LEFT JOIN '._DB_PREFIX_.'layered_indexable_attribute_lang lial LEFT JOIN '._DB_PREFIX_.'layered_indexable_attribute_lang_value lial
ON (lial.id_attribute = a.id_attribute AND lial.id_lang = '.(int)$filter['id_lang'].') ON (lial.id_attribute = a.id_attribute AND lial.id_lang = '.(int)$filter['id_lang'].')
WHERE a.id_attribute_group = '.(int)$filter['id_value'].' AND agl.id_lang = al.id_lang AND agl.id_lang = '.(int)$filter['id_lang']); WHERE a.id_attribute_group = '.(int)$filter['id_value'].' AND agl.id_lang = al.id_lang AND agl.id_lang = '.(int)$filter['id_lang']);
foreach ($attributes as $attribute) foreach ($attributes as $attribute)
@@ -291,9 +291,9 @@ class BlockLayered extends Module
LEFT JOIN '._DB_PREFIX_.'layered_indexable_feature lif ON (lif.id_feature = fl.id_feature) LEFT JOIN '._DB_PREFIX_.'layered_indexable_feature lif ON (lif.id_feature = fl.id_feature)
INNER JOIN '._DB_PREFIX_.'feature_value fv ON (fv.id_feature = fl.id_feature) INNER JOIN '._DB_PREFIX_.'feature_value fv ON (fv.id_feature = fl.id_feature)
INNER JOIN '._DB_PREFIX_.'feature_value_lang fvl ON (fvl.id_feature_value = fv.id_feature_value) INNER JOIN '._DB_PREFIX_.'feature_value_lang fvl ON (fvl.id_feature_value = fv.id_feature_value)
LEFT JOIN '._DB_PREFIX_.'layered_indexable_feature_lang lifl LEFT JOIN '._DB_PREFIX_.'layered_indexable_feature_lang_value lifl
ON (lifl.id_feature = fl.id_feature AND lifl.id_lang = '.(int)$filter['id_lang'].') ON (lifl.id_feature = fl.id_feature AND lifl.id_lang = '.(int)$filter['id_lang'].')
LEFT JOIN '._DB_PREFIX_.'layered_indexable_feature_value_lang lifvl LEFT JOIN '._DB_PREFIX_.'layered_indexable_feature_value_lang_value lifvl
ON (lifvl.id_feature_value = fvl.id_feature_value AND lifvl.id_lang = '.(int)$filter['id_lang'].') ON (lifvl.id_feature_value = fvl.id_feature_value AND lifvl.id_lang = '.(int)$filter['id_lang'].')
WHERE fl.id_feature = '.(int)$filter['id_value'].' AND fvl.id_lang = fl.id_lang AND fvl.id_lang = '.(int)$filter['id_lang']); WHERE fl.id_feature = '.(int)$filter['id_value'].' AND fvl.id_lang = fl.id_lang AND fvl.id_lang = '.(int)$filter['id_lang']);
foreach ($features as $feature) foreach ($features as $feature)
@@ -477,13 +477,13 @@ class BlockLayered extends Module
Db::getInstance()->Execute('DELETE FROM '._DB_PREFIX_.'layered_indexable_feature WHERE id_feature = '.(int)$params['id_feature']); Db::getInstance()->Execute('DELETE FROM '._DB_PREFIX_.'layered_indexable_feature WHERE id_feature = '.(int)$params['id_feature']);
Db::getInstance()->Execute('INSERT INTO '._DB_PREFIX_.'layered_indexable_feature VALUES ('.(int)$params['id_feature'].', '.(int)Tools::getValue('layered_indexable').')'); Db::getInstance()->Execute('INSERT INTO '._DB_PREFIX_.'layered_indexable_feature VALUES ('.(int)$params['id_feature'].', '.(int)Tools::getValue('layered_indexable').')');
Db::getInstance()->Execute('DELETE FROM '._DB_PREFIX_.'layered_indexable_feature_lang WHERE id_feature = '.(int)$params['id_feature']); // don't care about the id_lang Db::getInstance()->Execute('DELETE FROM '._DB_PREFIX_.'layered_indexable_feature_lang_value WHERE id_feature = '.(int)$params['id_feature']); // don't care about the id_lang
foreach (Language::getLanguages(false) as $language) foreach (Language::getLanguages(false) as $language)
{ {
// Data are validated by method "hookPostProcessFeature" // Data are validated by method "hookPostProcessFeature"
$id_lang = (int)$language['id_lang']; $id_lang = (int)$language['id_lang'];
Db::getInstance()->Execute('INSERT INTO '._DB_PREFIX_.'layered_indexable_feature_lang Db::getInstance()->Execute('INSERT INTO '._DB_PREFIX_.'layered_indexable_feature_lang_value
VALUES ('.(int)$params['id_feature'].', '.$id_lang.', \''.Tools::link_rewrite(Tools::getValue('url_name_'.$id_lang)).'\', VALUES ('.(int)$params['id_feature'].', '.$id_lang.', \''.pSQL(Tools::link_rewrite(Tools::getValue('url_name_'.$id_lang))).'\',
\''.pSQL(Tools::safeOutput(Tools::getValue('meta_title_'.$id_lang), true)).'\')'); \''.pSQL(Tools::safeOutput(Tools::getValue('meta_title_'.$id_lang), true)).'\')');
} }
} }
@@ -493,13 +493,13 @@ class BlockLayered extends Module
if (!$params['id_feature_value']) if (!$params['id_feature_value'])
return; return;
Db::getInstance()->Execute('DELETE FROM '._DB_PREFIX_.'layered_indexable_feature_value_lang WHERE id_feature_value = '.(int)$params['id_feature_value']); // don't care about the id_lang Db::getInstance()->Execute('DELETE FROM '._DB_PREFIX_.'layered_indexable_feature_value_lang_value WHERE id_feature_value = '.(int)$params['id_feature_value']); // don't care about the id_lang
foreach (Language::getLanguages(false) as $language) foreach (Language::getLanguages(false) as $language)
{ {
// Data are validated by method "hookPostProcessFeatureValue" // Data are validated by method "hookPostProcessFeatureValue"
$id_lang = (int)$language['id_lang']; $id_lang = (int)$language['id_lang'];
Db::getInstance()->Execute('INSERT INTO '._DB_PREFIX_.'layered_indexable_feature_value_lang Db::getInstance()->Execute('INSERT INTO '._DB_PREFIX_.'layered_indexable_feature_value_lang_value
VALUES ('.(int)$params['id_feature_value'].', '.$id_lang.', \''.Tools::link_rewrite(Tools::getValue('url_name_'.$id_lang)).'\', VALUES ('.(int)$params['id_feature_value'].', '.$id_lang.', \''.pSQL(Tools::link_rewrite(Tools::getValue('url_name_'.$id_lang))).'\',
\''.pSQL(Tools::safeOutput(Tools::getValue('meta_title_'.$id_lang), true)).'\')'); \''.pSQL(Tools::safeOutput(Tools::getValue('meta_title_'.$id_lang), true)).'\')');
} }
} }
@@ -508,7 +508,7 @@ class BlockLayered extends Module
{ {
if (!$params['id_feature_value']) if (!$params['id_feature_value'])
return; return;
Db::getInstance()->Execute('DELETE FROM '._DB_PREFIX_.'layered_indexable_feature_value_lang WHERE id_feature_value = '.(int)$params['id_feature_value']); Db::getInstance()->Execute('DELETE FROM '._DB_PREFIX_.'layered_indexable_feature_value_lang_value WHERE id_feature_value = '.(int)$params['id_feature_value']);
} }
public function hookPostProcessFeatureValue($params) public function hookPostProcessFeatureValue($params)
@@ -523,7 +523,7 @@ class BlockLayered extends Module
$langValue = array(); $langValue = array();
$result = Db::getInstance(_PS_USE_SQL_SLAVE_)->ExecuteS( $result = Db::getInstance(_PS_USE_SQL_SLAVE_)->ExecuteS(
'SELECT url_name, meta_title, id_lang FROM '._DB_PREFIX_.'layered_indexable_feature_value_lang 'SELECT url_name, meta_title, id_lang FROM '._DB_PREFIX_.'layered_indexable_feature_value_lang_value
WHERE id_feature_value = '.(int)$params['id_feature_value']); WHERE id_feature_value = '.(int)$params['id_feature_value']);
if ($result) if ($result)
foreach ($result as $data) foreach ($result as $data)
@@ -565,13 +565,13 @@ class BlockLayered extends Module
if (!$params['id_attribute']) if (!$params['id_attribute'])
return; return;
Db::getInstance()->Execute('DELETE FROM '._DB_PREFIX_.'layered_indexable_attribute_lang WHERE id_attribute = '.(int)$params['id_attribute']); // don't care about the id_lang Db::getInstance()->Execute('DELETE FROM '._DB_PREFIX_.'layered_indexable_attribute_lang_value WHERE id_attribute = '.(int)$params['id_attribute']); // don't care about the id_lang
foreach (Language::getLanguages(false) as $language) foreach (Language::getLanguages(false) as $language)
{ {
// Data are validated by method "hookPostProcessAttribute" // Data are validated by method "hookPostProcessAttribute"
$id_lang = (int)$language['id_lang']; $id_lang = (int)$language['id_lang'];
Db::getInstance()->Execute('INSERT INTO '._DB_PREFIX_.'layered_indexable_attribute_lang Db::getInstance()->Execute('INSERT INTO '._DB_PREFIX_.'layered_indexable_attribute_lang_value
VALUES ('.(int)$params['id_attribute'].', '.$id_lang.', \''.Tools::link_rewrite(Tools::getValue('url_name_'.$id_lang)).'\', VALUES ('.(int)$params['id_attribute'].', '.$id_lang.', \''.pSQL(Tools::link_rewrite(Tools::getValue('url_name_'.$id_lang))).'\',
\''.pSQL(Tools::safeOutput(Tools::getValue('meta_title_'.$id_lang), true)).'\')'); \''.pSQL(Tools::safeOutput(Tools::getValue('meta_title_'.$id_lang), true)).'\')');
} }
} }
@@ -580,7 +580,7 @@ class BlockLayered extends Module
{ {
if (!$params['id_attribute']) if (!$params['id_attribute'])
return; return;
Db::getInstance()->Execute('DELETE FROM '._DB_PREFIX_.'layered_indexable_attribute_lang WHERE id_attribute = '.(int)$params['id_attribute']); Db::getInstance()->Execute('DELETE FROM '._DB_PREFIX_.'layered_indexable_attribute_lang_value WHERE id_attribute = '.(int)$params['id_attribute']);
} }
public function hookPostProcessAttribute($params) public function hookPostProcessAttribute($params)
@@ -595,7 +595,7 @@ class BlockLayered extends Module
$langValue = array(); $langValue = array();
$result = Db::getInstance(_PS_USE_SQL_SLAVE_)->ExecuteS( $result = Db::getInstance(_PS_USE_SQL_SLAVE_)->ExecuteS(
'SELECT url_name, meta_title, id_lang FROM '._DB_PREFIX_.'layered_indexable_attribute_lang 'SELECT url_name, meta_title, id_lang FROM '._DB_PREFIX_.'layered_indexable_attribute_lang_value
WHERE id_attribute = '.(int)$params['id_attribute']); WHERE id_attribute = '.(int)$params['id_attribute']);
if ($result) if ($result)
foreach ($result as $data) foreach ($result as $data)
@@ -652,13 +652,13 @@ class BlockLayered extends Module
Db::getInstance()->Execute('DELETE FROM '._DB_PREFIX_.'layered_indexable_attribute_group WHERE id_attribute_group = '.(int)$params['id_attribute_group']); Db::getInstance()->Execute('DELETE FROM '._DB_PREFIX_.'layered_indexable_attribute_group WHERE id_attribute_group = '.(int)$params['id_attribute_group']);
Db::getInstance()->Execute('INSERT INTO '._DB_PREFIX_.'layered_indexable_attribute_group VALUES ('.(int)$params['id_attribute_group'].', '.(int)Tools::getValue('layered_indexable').')'); Db::getInstance()->Execute('INSERT INTO '._DB_PREFIX_.'layered_indexable_attribute_group VALUES ('.(int)$params['id_attribute_group'].', '.(int)Tools::getValue('layered_indexable').')');
Db::getInstance()->Execute('DELETE FROM '._DB_PREFIX_.'layered_indexable_attribute_group_lang WHERE id_attribute_group = '.(int)$params['id_attribute_group']); // don't care about the id_lang Db::getInstance()->Execute('DELETE FROM '._DB_PREFIX_.'layered_indexable_attribute_group_lang_value WHERE id_attribute_group = '.(int)$params['id_attribute_group']); // don't care about the id_lang
foreach (Language::getLanguages(false) as $language) foreach (Language::getLanguages(false) as $language)
{ {
// Data are validated by method "hookPostProcessAttributeGroup" // Data are validated by method "hookPostProcessAttributeGroup"
$id_lang = (int)$language['id_lang']; $id_lang = (int)$language['id_lang'];
Db::getInstance()->Execute('INSERT INTO '._DB_PREFIX_.'layered_indexable_attribute_group_lang Db::getInstance()->Execute('INSERT INTO '._DB_PREFIX_.'layered_indexable_attribute_group_lang_value
VALUES ('.(int)$params['id_attribute_group'].', '.$id_lang.', \''.Tools::link_rewrite(Tools::getValue('url_name_'.$id_lang)).'\', VALUES ('.(int)$params['id_attribute_group'].', '.$id_lang.', \''.pSQL(Tools::link_rewrite(Tools::getValue('url_name_'.$id_lang))).'\',
\''.pSQL(Tools::safeOutput(Tools::getValue('meta_title_'.$id_lang), true)).'\')'); \''.pSQL(Tools::safeOutput(Tools::getValue('meta_title_'.$id_lang), true)).'\')');
} }
} }
@@ -690,7 +690,7 @@ class BlockLayered extends Module
return; return;
Db::getInstance()->Execute('DELETE FROM '._DB_PREFIX_.'layered_indexable_attribute_group WHERE id_attribute_group = '.(int)$params['id_attribute_group']); Db::getInstance()->Execute('DELETE FROM '._DB_PREFIX_.'layered_indexable_attribute_group WHERE id_attribute_group = '.(int)$params['id_attribute_group']);
Db::getInstance()->Execute('DELETE FROM '._DB_PREFIX_.'layered_indexable_attribute_group_lang WHERE id_attribute_group = '.(int)$params['id_attribute_group']); Db::getInstance()->Execute('DELETE FROM '._DB_PREFIX_.'layered_indexable_attribute_group_lang_value WHERE id_attribute_group = '.(int)$params['id_attribute_group']);
} }
public function hookAttributeGroupForm($params) public function hookAttributeGroupForm($params)
@@ -702,7 +702,7 @@ class BlockLayered extends Module
$langValue = array(); $langValue = array();
$result = Db::getInstance(_PS_USE_SQL_SLAVE_)->ExecuteS( $result = Db::getInstance(_PS_USE_SQL_SLAVE_)->ExecuteS(
'SELECT url_name, meta_title, id_lang FROM '._DB_PREFIX_.'layered_indexable_attribute_group_lang 'SELECT url_name, meta_title, id_lang FROM '._DB_PREFIX_.'layered_indexable_attribute_group_lang_value
WHERE id_attribute_group = '.(int)$params['id_attribute_group']); WHERE id_attribute_group = '.(int)$params['id_attribute_group']);
if ($result) if ($result)
foreach ($result as $data) foreach ($result as $data)
@@ -761,7 +761,7 @@ class BlockLayered extends Module
$langValue = array(); $langValue = array();
$result = Db::getInstance(_PS_USE_SQL_SLAVE_)->ExecuteS( $result = Db::getInstance(_PS_USE_SQL_SLAVE_)->ExecuteS(
'SELECT url_name, meta_title, id_lang FROM '._DB_PREFIX_.'layered_indexable_feature_lang 'SELECT url_name, meta_title, id_lang FROM '._DB_PREFIX_.'layered_indexable_feature_lang_value
WHERE id_feature = '.(int)$params['id_feature']); WHERE id_feature = '.(int)$params['id_feature']);
if ($result) if ($result)
foreach ($result as $data) foreach ($result as $data)
@@ -2084,9 +2084,9 @@ class BlockLayered extends Module
AND agl.id_lang = '.(int)$cookie->id_lang.' AND agl.id_lang = '.(int)$cookie->id_lang.'
LEFT JOIN '._DB_PREFIX_.'category_product cp ON (cp.id_product = p.id_product) LEFT JOIN '._DB_PREFIX_.'category_product cp ON (cp.id_product = p.id_product)
INNER JOIN '._DB_PREFIX_.'category c ON (c.id_category = cp.id_category AND c.nleft >= '.(int)$parent->nleft.' AND c.nright <= '.(int)$parent->nright.') INNER JOIN '._DB_PREFIX_.'category c ON (c.id_category = cp.id_category AND c.nleft >= '.(int)$parent->nleft.' AND c.nright <= '.(int)$parent->nright.')
LEFT JOIN '._DB_PREFIX_.'layered_indexable_attribute_group_lang liagl LEFT JOIN '._DB_PREFIX_.'layered_indexable_attribute_group_lang_value liagl
ON (liagl.id_attribute_group = lpa.id_attribute_group AND liagl.id_lang = '.(int)$cookie->id_lang.') ON (liagl.id_attribute_group = lpa.id_attribute_group AND liagl.id_lang = '.(int)$cookie->id_lang.')
LEFT JOIN '._DB_PREFIX_.'layered_indexable_attribute_lang lial LEFT JOIN '._DB_PREFIX_.'layered_indexable_attribute_lang_value lial
ON (lial.id_attribute = lpa.id_attribute AND lial.id_lang = '.(int)$cookie->id_lang.') '; ON (lial.id_attribute = lpa.id_attribute AND lial.id_lang = '.(int)$cookie->id_lang.') ';
$sqlQuery['where'] = 'WHERE a.id_attribute_group = '.(int)$filter['id_value'].' '; $sqlQuery['where'] = 'WHERE a.id_attribute_group = '.(int)$filter['id_value'].' ';
$sqlQuery['group'] = ' $sqlQuery['group'] = '
@@ -2107,9 +2107,9 @@ class BlockLayered extends Module
LEFT JOIN '._DB_PREFIX_.'feature_lang fl ON (fl.id_feature = fp.id_feature AND fl.id_lang = '.(int)$cookie->id_lang.') LEFT JOIN '._DB_PREFIX_.'feature_lang fl ON (fl.id_feature = fp.id_feature AND fl.id_lang = '.(int)$cookie->id_lang.')
INNER JOIN '._DB_PREFIX_.'feature_value fv ON (fv.id_feature_value = fp.id_feature_value AND (fv.custom IS NULL OR fv.custom = 0)) INNER JOIN '._DB_PREFIX_.'feature_value fv ON (fv.id_feature_value = fp.id_feature_value AND (fv.custom IS NULL OR fv.custom = 0))
LEFT JOIN '._DB_PREFIX_.'feature_value_lang fvl ON (fvl.id_feature_value = fp.id_feature_value AND fvl.id_lang = '.(int)$cookie->id_lang.') LEFT JOIN '._DB_PREFIX_.'feature_value_lang fvl ON (fvl.id_feature_value = fp.id_feature_value AND fvl.id_lang = '.(int)$cookie->id_lang.')
LEFT JOIN '._DB_PREFIX_.'layered_indexable_feature_lang lifl LEFT JOIN '._DB_PREFIX_.'layered_indexable_feature_lang_value lifl
ON (lifl.id_feature = fp.id_feature AND lifl.id_lang = '.(int)$cookie->id_lang.') ON (lifl.id_feature = fp.id_feature AND lifl.id_lang = '.(int)$cookie->id_lang.')
LEFT JOIN '._DB_PREFIX_.'layered_indexable_feature_value_lang lifvl LEFT JOIN '._DB_PREFIX_.'layered_indexable_feature_value_lang_value lifvl
ON (lifvl.id_feature_value = fp.id_feature_value AND lifvl.id_lang = '.(int)$cookie->id_lang.') '; ON (lifvl.id_feature_value = fp.id_feature_value AND lifvl.id_lang = '.(int)$cookie->id_lang.') ';
$sqlQuery['where'] = 'WHERE p.`active` = 1 AND fp.id_feature = '.(int)$filter['id_value'].' '; $sqlQuery['where'] = 'WHERE p.`active` = 1 AND fp.id_feature = '.(int)$filter['id_value'].' ';
$sqlQuery['group'] = 'GROUP BY fv.id_feature_value '; $sqlQuery['group'] = 'GROUP BY fv.id_feature_value ';
@@ -2244,6 +2244,7 @@ class BlockLayered extends Module
$conditionArray[$key]['checked'] = true; $conditionArray[$key]['checked'] = true;
if (isset($products) && $products) if (isset($products) && $products)
foreach ($products as $product) foreach ($products as $product)
if(isset($conditionArray[$product['condition']]))
$conditionArray[$product['condition']]['nbr']++; $conditionArray[$product['condition']]['nbr']++;
$filterBlocks[] = array('type_lite' => 'condition', 'type' => 'condition', 'id_key' => 0, 'name' => $this->l('Condition'), 'values' => $conditionArray); $filterBlocks[] = array('type_lite' => 'condition', 'type' => 'condition', 'id_key' => 0, 'name' => $this->l('Condition'), 'values' => $conditionArray);
break; break;
+9 -1
View File
@@ -53,7 +53,7 @@ class CanadaPost extends CarrierModule
{ {
$this->name = 'canadapost'; $this->name = 'canadapost';
$this->tab = 'shipping_logistics'; $this->tab = 'shipping_logistics';
$this->version = '0.1'; $this->version = '0.5';
$this->author = 'PrestaShop'; $this->author = 'PrestaShop';
$this->limited_countries = array('ca'); $this->limited_countries = array('ca');
@@ -1390,6 +1390,14 @@ class CanadaPost extends CarrierModule
{ {
// Init var // Init var
$address = new Address($params->id_address_delivery); $address = new Address($params->id_address_delivery);
if (!Validate::isLoadedObject($address))
{
// If address is not loaded, we take data from shipping estimator module (if installed)
global $cookie;
$address->id_country = $cookie->id_country;
$address->id_state = $cookie->id_state;
$address->postcode = $cookie->postcode;
}
$recipient_country = Db::getInstance()->getRow('SELECT `iso_code` FROM `'._DB_PREFIX_.'country` WHERE `id_country` = '.(int)($address->id_country)); $recipient_country = Db::getInstance()->getRow('SELECT `iso_code` FROM `'._DB_PREFIX_.'country` WHERE `id_country` = '.(int)($address->id_country));
$recipient_state = Db::getInstance()->getRow('SELECT `iso_code` FROM `'._DB_PREFIX_.'state` WHERE `id_state` = '.(int)($address->id_state)); $recipient_state = Db::getInstance()->getRow('SELECT `iso_code` FROM `'._DB_PREFIX_.'state` WHERE `id_state` = '.(int)($address->id_state));
$shipper_country = Db::getInstance()->getRow('SELECT `iso_code` FROM `'._DB_PREFIX_.'country` WHERE `id_country` = '.(int)(Configuration::get('CP_CARRIER_COUNTRY'))); $shipper_country = Db::getInstance()->getRow('SELECT `iso_code` FROM `'._DB_PREFIX_.'country` WHERE `id_country` = '.(int)(Configuration::get('CP_CARRIER_COUNTRY')));
+1 -1
View File
@@ -2,7 +2,7 @@
<module> <module>
<name>canadapost</name> <name>canadapost</name>
<displayName><![CDATA[Canada Post Carrier]]></displayName> <displayName><![CDATA[Canada Post Carrier]]></displayName>
<version><![CDATA[0.1]]></version> <version><![CDATA[0.5]]></version>
<description><![CDATA[Offer your customers, different delivery methods with Canada Post]]></description> <description><![CDATA[Offer your customers, different delivery methods with Canada Post]]></description>
<author><![CDATA[PrestaShop]]></author> <author><![CDATA[PrestaShop]]></author>
<tab><![CDATA[shipping_logistics]]></tab> <tab><![CDATA[shipping_logistics]]></tab>
+1 -1
View File
@@ -39,7 +39,7 @@ switch (Tools::getValue('method'))
die(Tools::jsonEncode($carrierCompare->getStatesByIdCountry((int)Tools::getValue('id_country')))); die(Tools::jsonEncode($carrierCompare->getStatesByIdCountry((int)Tools::getValue('id_country'))));
break; break;
case 'getCarriers': case 'getCarriers':
die(Tools::jsonEncode($carrierCompare->getCarriersListByIdZone((int)Tools::getValue('id_country'), (int)Tools::getValue('id_state', 0)))); die(Tools::jsonEncode($carrierCompare->getCarriersListByIdZone((int)Tools::getValue('id_country'), (int)Tools::getValue('id_state', 0), Tools::safeOutput(Tools::getValue('zipcode', 0)))));
break; break;
case 'saveSelection': case 'saveSelection':
$errors = $carrierCompare->saveSelection((int)Tools::getValue('id_country'), (int)Tools::getValue('id_state', 0), Tools::getValue('zipcode', 0), (int)Tools::getValue('id_carrier', 0)); $errors = $carrierCompare->saveSelection((int)Tools::getValue('id_country'), (int)Tools::getValue('id_state', 0), Tools::getValue('zipcode', 0), (int)Tools::getValue('id_carrier', 0));
+2 -2
View File
@@ -51,7 +51,7 @@ function updateCarriersList()
$.ajax({ $.ajax({
type: 'POST', type: 'POST',
url: baseDir + 'modules/carriercompare/ajax.php', url: baseDir + 'modules/carriercompare/ajax.php',
data: 'method=getCarriers&id_country=' + $('#id_country').val()+'&id_state=' + $('#id_state').val(), data: 'method=getCarriers&id_country=' + $('#id_country').val() + '&id_state=' + $('#id_state').val() + '&zipcode=' + $('#zipcode').val(),
dataType: 'json', dataType: 'json',
success: function(json) { success: function(json) {
$('#carriers_list').children().remove(); $('#carriers_list').children().remove();
@@ -135,4 +135,4 @@ $(document).ready(function() {
}); });
updateStateByIdCountry(); updateStateByIdCountry();
updateCarriersList(); updateCarriersList();
}); });
+11 -4
View File
@@ -34,7 +34,7 @@ class CarrierCompare extends Module
{ {
$this->name = 'carriercompare'; $this->name = 'carriercompare';
$this->tab = 'shipping_logistics'; $this->tab = 'shipping_logistics';
$this->version = '1.0'; $this->version = '1.1';
$this->author = 'PrestaShop'; $this->author = 'PrestaShop';
$this->need_instance = 0; $this->need_instance = 0;
@@ -96,8 +96,15 @@ class CarrierCompare extends Module
/* /*
** Get carriers by country id, called by the ajax process ** Get carriers by country id, called by the ajax process
*/ */
public function getCarriersListByIdZone($id_country, $id_state = 0) public function getCarriersListByIdZone($id_country, $id_state = 0, $zipcode = 0)
{ {
// cookie saving/updating
$this->context->cookie->id_country = $id_country;
if ($id_state != 0)
$this->context->cookie->id_state = $id_state;
if ($zipcode != 0)
$this->context->cookie->postcode = $zipcode;
$id_zone = 0; $id_zone = 0;
if ($id_state != 0) if ($id_state != 0)
$id_zone = State::getIdZone($id_state); $id_zone = State::getIdZone($id_state);
@@ -106,7 +113,7 @@ class CarrierCompare extends Module
$carriers = Carrier::getCarriersForOrder((int)$id_zone); $carriers = Carrier::getCarriersForOrder((int)$id_zone);
return (sizeof($carriers) ? $carriers : array()); return (count($carriers) ? $carriers : array());
} }
public function saveSelection($id_country, $id_state, $zipcode, $id_carrier) public function saveSelection($id_country, $id_state, $zipcode, $id_carrier)
@@ -128,7 +135,7 @@ class CarrierCompare extends Module
return $errors; return $errors;
$ids_carrier = array(); $ids_carrier = array();
foreach (self::getCarriersListByIdZone($id_country, $id_state) as $carrier) foreach (self::getCarriersListByIdZone($id_country, $id_state, $zipcode) as $carrier)
$ids_carrier[] = $carrier['id_carrier']; $ids_carrier[] = $carrier['id_carrier'];
if (!in_array($id_carrier, $ids_carrier)) if (!in_array($id_carrier, $ids_carrier))
$errors[] = $this->l('This carrier ID isn\'t available for your selection'); $errors[] = $this->l('This carrier ID isn\'t available for your selection');
+3 -3
View File
@@ -67,7 +67,7 @@
<p> <p>
<label for="zipcode">{l s='Zipcode' mod='carriercompare'}</label> <label for="zipcode">{l s='Zipcode' mod='carriercompare'}</label>
<input type="text" name="zipcode" id="zipcode" value="{$zipcode|escape:'htmlall':'UTF-8'}"/> <input type="text" name="zipcode" id="zipcode" value="{$zipcode|escape:'htmlall':'UTF-8'}"/> ({l s='Needed for certain carriers' mod='carriercompare'})
</p> </p>
<div id="availableCarriers" style="display: none;"> <div id="availableCarriers" style="display: none;">
@@ -88,8 +88,8 @@
<p class="warning center" id="noCarrier" style="display: none;">{l s='No carrier is available for this selection' mod='carriercompare'}</p> <p class="warning center" id="noCarrier" style="display: none;">{l s='No carrier is available for this selection' mod='carriercompare'}</p>
<p class="center"> <p class="center">
<input class="exclusive_large" id="carriercompare_submit" type="submit" name="carriercompare_submit" value="{l s='Update my shipping option' mod='carriercompare'}"/> <input class="exclusive_large" id="carriercompare_submit" type="submit" name="carriercompare_submit" value="{l s='Refresh' mod='carriercompare'}"/>
</p> </p>
</fieldset> </fieldset>
</form> </form>
{/if} {/if}
+1 -1
View File
@@ -2,7 +2,7 @@
<module> <module>
<name>carriercompare</name> <name>carriercompare</name>
<displayName><![CDATA[Shipping Estimation]]></displayName> <displayName><![CDATA[Shipping Estimation]]></displayName>
<version><![CDATA[1.0]]></version> <version><![CDATA[1.1]]></version>
<description><![CDATA[Module to compare carrier possibilities before using the checkout process]]></description> <description><![CDATA[Module to compare carrier possibilities before using the checkout process]]></description>
<author><![CDATA[PrestaShop]]></author> <author><![CDATA[PrestaShop]]></author>
<tab><![CDATA[shipping_logistics]]></tab> <tab><![CDATA[shipping_logistics]]></tab>
+1 -1
View File
@@ -2,7 +2,7 @@
<module> <module>
<name>fedexcarrier</name> <name>fedexcarrier</name>
<displayName><![CDATA[Fedex Carrier]]></displayName> <displayName><![CDATA[Fedex Carrier]]></displayName>
<version><![CDATA[1.2.3]]></version> <version><![CDATA[1.2.4]]></version>
<description><![CDATA[Offer your customers, different delivery methods with Fedex]]></description> <description><![CDATA[Offer your customers, different delivery methods with Fedex]]></description>
<author><![CDATA[PrestaShop]]></author> <author><![CDATA[PrestaShop]]></author>
<tab><![CDATA[shipping_logistics]]></tab> <tab><![CDATA[shipping_logistics]]></tab>
+10 -2
View File
@@ -56,7 +56,7 @@ class FedexCarrier extends CarrierModule
{ {
$this->name = 'fedexcarrier'; $this->name = 'fedexcarrier';
$this->tab = 'shipping_logistics'; $this->tab = 'shipping_logistics';
$this->version = '1.2.3'; $this->version = '1.2.4';
$this->author = 'PrestaShop'; $this->author = 'PrestaShop';
$this->limited_countries = array('us'); $this->limited_countries = array('us');
@@ -594,7 +594,7 @@ class FedexCarrier extends CarrierModule
</div> </div>
</fieldset> </fieldset>
<div class="margin-form"><input class="button" name="submitSave" type="submit"></div> <div class="margin-form"><input class="button" name="submitSave" type="submit" value="'.$this->l('Configure').'"></div>
</form> </form>
<script> <script>
@@ -1563,6 +1563,14 @@ class FedexCarrier extends CarrierModule
{ {
// Init var // Init var
$address = new Address($params->id_address_delivery); $address = new Address($params->id_address_delivery);
if (!Validate::isLoadedObject($address))
{
// If address is not loaded, we take data from shipping estimator module (if installed)
global $cookie;
$address->id_country = $cookie->id_country;
$address->id_state = $cookie->id_state;
$address->postcode = $cookie->postcode;
}
$recipient_country = Db::getInstance()->getRow('SELECT `iso_code` FROM `'._DB_PREFIX_.'country` WHERE `id_country` = '.(int)($address->id_country)); $recipient_country = Db::getInstance()->getRow('SELECT `iso_code` FROM `'._DB_PREFIX_.'country` WHERE `id_country` = '.(int)($address->id_country));
$recipient_state = Db::getInstance()->getRow('SELECT `iso_code` FROM `'._DB_PREFIX_.'state` WHERE `id_state` = '.(int)($address->id_state)); $recipient_state = Db::getInstance()->getRow('SELECT `iso_code` FROM `'._DB_PREFIX_.'state` WHERE `id_state` = '.(int)($address->id_state));
$shipper_country = Db::getInstance()->getRow('SELECT `iso_code` FROM `'._DB_PREFIX_.'country` WHERE `id_country` = '.(int)(Configuration::get('FEDEX_CARRIER_COUNTRY'))); $shipper_country = Db::getInstance()->getRow('SELECT `iso_code` FROM `'._DB_PREFIX_.'country` WHERE `id_country` = '.(int)(Configuration::get('FEDEX_CARRIER_COUNTRY')));
@@ -63,7 +63,7 @@ class MRManagement extends MondialRelay
SET `id_method` = '.(int)$this->_params['id_mr_method'].', '; SET `id_method` = '.(int)$this->_params['id_mr_method'].', ';
if (is_array($this->_params['relayPointInfo'])) if (is_array($this->_params['relayPointInfo']))
foreach($this->_params['relayPointInfo'] as $nameKey => $value) foreach($this->_params['relayPointInfo'] as $nameKey => $value)
$query .= '`MR_Selected_'.pSQL($nameKey).'` = "'.pSQL($value).'", '; $query .= '`MR_Selected_'.MRTools::bqSQL($nameKey).'` = "'.pSQL($value).'", ';
else // Clean the existing relay point data else // Clean the existing relay point data
$query .= ' $query .= '
MR_Selected_Num = NULL, MR_Selected_Num = NULL,
@@ -82,11 +82,11 @@ class MRManagement extends MondialRelay
(`id_customer`, `id_method`, `id_cart`, '; (`id_customer`, `id_method`, `id_cart`, ';
if (is_array($this->_params['relayPointInfo'])) if (is_array($this->_params['relayPointInfo']))
foreach($this->_params['relayPointInfo'] as $nameKey => $value) foreach($this->_params['relayPointInfo'] as $nameKey => $value)
$query .= '`MR_Selected_'.pSQL($nameKey).'`, '; $query .= '`MR_Selected_'.MRTools::bqSQL($nameKey).'`, ';
$query = rtrim($query, ', ').') VALUES ( $query = rtrim($query, ', ').') VALUES (
'.$this->_params['id_customer'].', '.(int)$this->_params['id_customer'].',
'.$this->_params['id_mr_method'].', '.(int)$this->_params['id_mr_method'].',
'.$this->_params['id_cart'].', '; '.(int)$this->_params['id_cart'].', ';
if (is_array($this->_params['relayPointInfo'])) if (is_array($this->_params['relayPointInfo']))
foreach($this->_params['relayPointInfo'] as $nameKey => $value) foreach($this->_params['relayPointInfo'] as $nameKey => $value)
$query .= '"'.pSQL($value).'", '; $query .= '"'.pSQL($value).'", ';
+14
View File
@@ -30,6 +30,9 @@
*/ */
class MRTools class MRTools
{ {
/*
** Replace all accented chars to normal
*/
static public function replaceAccentedCharacters($string) static public function replaceAccentedCharacters($string)
{ {
if (function_exists('iconv')) if (function_exists('iconv'))
@@ -46,6 +49,17 @@ class MRTools
return $cleanedString; return $cleanedString;
} }
/*
** Fix security and compatibility for PS < 1.4.5
*/
static function bqSQL($string)
{
return str_replace('`', '\`', pSQL($string));
}
/*
** Check zip code by country
*/
static public function checkZipcodeByCountry($zipcode, $params) static public function checkZipcodeByCountry($zipcode, $params)
{ {
$id_country = $params['id_country']; $id_country = $params['id_country'];
File diff suppressed because it is too large Load Diff
+1 -1
View File
@@ -59,7 +59,7 @@ class MondialRelay extends Module
{ {
$this->name = 'mondialrelay'; $this->name = 'mondialrelay';
$this->tab = 'shipping_logistics'; $this->tab = 'shipping_logistics';
$this->version = '1.7.5'; $this->version = '1.7.5.1';
parent::__construct(); parent::__construct();
+4 -2
View File
@@ -138,9 +138,11 @@ class ProductComment extends ObjectModel
.($last ? 'LIMIT 1' : '') .($last ? 'LIMIT 1' : '')
); );
if ($last) if (!$results)
return false;
elseif ($last)
return array_shift($results); return array_shift($results);
else
return $results; return $results;
} }
+2 -2
View File
@@ -950,10 +950,10 @@ class shopimporter extends ImportModule
INNER JOIN INNER JOIN
'._DB_PREFIX_.'category c2 '._DB_PREFIX_.'category c2
ON ON
c.id_parent = c2.id_category_'.pSQL($moduleName).' c.id_parent = c2.`id_category_'.bqSQL($moduleName).'`
SET SET
c.id_parent = c2.id_category c.id_parent = c2.id_category
WHERE c.id_category_'.pSQL($moduleName).' != 0'); WHERE c.`id_category_'.bqSQL($moduleName).'` != 0');
$category = new Category(); $category = new Category();
$cats = $category->getSimpleCategories((int)Configuration::get('PS_LANG_DEFAULT')); $cats = $category->getSimpleCategories((int)Configuration::get('PS_LANG_DEFAULT'));
foreach($cats as $cat) foreach($cats as $cat)
+1 -1
View File
@@ -87,7 +87,7 @@ class StatsSearch extends ModuleGraph
function hookSearch($params) function hookSearch($params)
{ {
$sql = 'INSERT INTO `'._DB_PREFIX_.'statssearch` (`id_shop`, `id_group_shop`, `keywords`, `results`, `date_add`) $sql = 'INSERT INTO `'._DB_PREFIX_.'statssearch` (`id_shop`, `id_group_shop`, `keywords`, `results`, `date_add`)
VALUES ('.$this->context->shop->getID().', '.$this->context->shop->getGroupID().', \''.pSQL($params['expr']).'\', '.(int)($params['total']).', NOW())'; VALUES ('.$this->context->shop->getID(true).', '.$this->context->shop->getGroupID().', \''.pSQL($params['expr']).'\', '.(int)$params['total'].', NOW())';
Db::getInstance()->Execute($sql); Db::getInstance()->Execute($sql);
} }
-4
View File
@@ -25,10 +25,6 @@
* International Registered Trademark & Property of PrestaShop SA * International Registered Trademark & Property of PrestaShop SA
**/ **/
/**
* @author Nans Pellicari - Prestashop
* @version 1.3
*/
include_once('../../config/config.inc.php'); include_once('../../config/config.inc.php');
include_once('../../init.php'); include_once('../../init.php');
include_once(dirname(__FILE__).'/twenga.php'); include_once(dirname(__FILE__).'/twenga.php');
-4
View File
@@ -25,10 +25,6 @@
* International Registered Trademark & Property of PrestaShop SA * International Registered Trademark & Property of PrestaShop SA
**/ **/
/**
* @author Nans Pellicari - Prestashop
* @version 1.3
*/
class PrestashopStats class PrestashopStats
{ {
/** /**
-1
View File
@@ -35,7 +35,6 @@
* - compare an array of values to check if required fields are set. * - compare an array of values to check if required fields are set.
* - use the twenga API method and throw exceptions if error or exceptions occurred. * - use the twenga API method and throw exceptions if error or exceptions occurred.
* - Transform the xml response into PHP values. * - Transform the xml response into PHP values.
* @author Nans Pellicari - Prestashop
* @version 1.3 * @version 1.3
*/ */
abstract class TwengaFields abstract class TwengaFields
@@ -25,10 +25,6 @@
* International Registered Trademark & Property of PrestaShop SA * International Registered Trademark & Property of PrestaShop SA
**/ **/
/**
* @author Nans Pellicari - Prestashop
* @version 1.3
*/
class TwengaFieldsGetSubscriptionLink extends TwengaFields class TwengaFieldsGetSubscriptionLink extends TwengaFields
{ {
public function __construct() public function __construct()
@@ -25,10 +25,6 @@
* International Registered Trademark & Property of PrestaShop SA * International Registered Trademark & Property of PrestaShop SA
**/ **/
/**
* @author Nans Pellicari - Prestashop
* @version 1.3
*/
class TwengaFieldsGetTrackingScript extends TwengaFields class TwengaFieldsGetTrackingScript extends TwengaFields
{ {
public function __construct() public function __construct()
@@ -24,9 +24,5 @@
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
* International Registered Trademark & Property of PrestaShop SA * International Registered Trademark & Property of PrestaShop SA
**/ **/
/**
* @author Nans Pellicari - Prestashop
* @version 1.3
*/
class TwengaFieldsOrderCancel extends TwengaFieldsOrderValidate class TwengaFieldsOrderCancel extends TwengaFieldsOrderValidate
{} {}
@@ -25,9 +25,5 @@
* International Registered Trademark & Property of PrestaShop SA * International Registered Trademark & Property of PrestaShop SA
**/ **/
/**
* @author Nans Pellicari - Prestashop
* @version 1.3
*/
class TwengaFieldsOrderExist extends TwengaFieldsOrderValidate class TwengaFieldsOrderExist extends TwengaFieldsOrderValidate
{} {}
@@ -25,10 +25,6 @@
* International Registered Trademark & Property of PrestaShop SA * International Registered Trademark & Property of PrestaShop SA
**/ **/
/**
* @author Nans Pellicari - Prestashop
* @version 1.3
*/
class TwengaFieldsOrderValidate extends TwengaFields class TwengaFieldsOrderValidate extends TwengaFields
{ {
public function __construct() public function __construct()
@@ -25,9 +25,5 @@
* International Registered Trademark & Property of PrestaShop SA * International Registered Trademark & Property of PrestaShop SA
**/ **/
/**
* @author Nans Pellicari - Prestashop
* @version 1.3
*/
class TwengaFieldsSiteActivate extends TwengaFieldsSiteExist class TwengaFieldsSiteActivate extends TwengaFieldsSiteExist
{} {}
@@ -25,10 +25,6 @@
* International Registered Trademark & Property of PrestaShop SA * International Registered Trademark & Property of PrestaShop SA
**/ **/
/**
* @author Nans Pellicari - Prestashop
* @version 1.3
*/
class TwengaFieldsSiteExist extends TwengaFields class TwengaFieldsSiteExist extends TwengaFields
{ {
public function __construct() public function __construct()
-1
View File
@@ -29,7 +29,6 @@
* This Class allow to use Twenga API. * This Class allow to use Twenga API.
* See details for more infos. * See details for more infos.
* *
* @author Nans Pellicari - Prestashop
* @version 1.3 * @version 1.3
*/ */
class TwengaObj class TwengaObj
+4 -5
View File
@@ -30,7 +30,6 @@
* 1. subscribe to their Ready to Sell engine, * 1. subscribe to their Ready to Sell engine,
* 2. activate a tracking for order process if user has been used twenga engine, * 2. activate a tracking for order process if user has been used twenga engine,
* 3. submit a xml feed of shop products to Twenga. * 3. submit a xml feed of shop products to Twenga.
* @author Nans Pellicari - Prestashop
* @version 1.3 * @version 1.3
*/ */
@@ -524,16 +523,16 @@ class Twenga extends PaymentModule
*/ */
public static function getCurrentCountryName() public static function getCurrentCountryName()
{ {
$id_lang = ((isset(Context::getContext()->language->id)) ? Context::getContext()->language->id : $id_lang = ((Context::getContext()->language) ? Context::getContext()->language->id :
((isset($_POST['id_lang'])) ? $_POST['id_lang'] : NULL)); ((isset($_POST['id_lang'])) ? (int)$_POST['id_lang'] : null));
if ($id_lang === NULL) if ($id_lang === NULL)
return 'Undefined id_lang'; return 'Undefined id_lang';
$country = Db::getInstance()->ExecuteS(' $country = Db::getInstance()->ExecuteS('
SELECT c.name as name SELECT c.name as name
FROM '._DB_PREFIX_.'country_lang as c FROM '._DB_PREFIX_.'country_lang as c
WHERE c.id_lang = '.$id_lang.' WHERE c.id_lang = '.(int)$id_lang.'
AND c.id_country = '. Configuration::get('PS_COUNTRY_DEFAULT')); AND c.id_country = '.(int)Configuration::get('PS_COUNTRY_DEFAULT'));
if (!isset($country[0]['name'])) if (!isset($country[0]['name']))
$country[0]['name'] = 'Undefined'; $country[0]['name'] = 'Undefined';
+1 -1
View File
@@ -2,7 +2,7 @@
<module> <module>
<name>upscarrier</name> <name>upscarrier</name>
<displayName><![CDATA[UPS Carrier]]></displayName> <displayName><![CDATA[UPS Carrier]]></displayName>
<version><![CDATA[1.2.1]]></version> <version><![CDATA[1.2.2]]></version>
<description><![CDATA[Offer your customers, different delivery methods with UPS]]></description> <description><![CDATA[Offer your customers, different delivery methods with UPS]]></description>
<author><![CDATA[PrestaShop]]></author> <author><![CDATA[PrestaShop]]></author>
<tab><![CDATA[shipping_logistics]]></tab> <tab><![CDATA[shipping_logistics]]></tab>
+9 -1
View File
@@ -55,7 +55,7 @@ class UpsCarrier extends CarrierModule
{ {
$this->name = 'upscarrier'; $this->name = 'upscarrier';
$this->tab = 'shipping_logistics'; $this->tab = 'shipping_logistics';
$this->version = '1.2.1'; $this->version = '1.2.2';
$this->author = 'PrestaShop'; $this->author = 'PrestaShop';
$this->limited_countries = array('us'); $this->limited_countries = array('us');
@@ -1539,6 +1539,14 @@ class UpsCarrier extends CarrierModule
{ {
// Init var // Init var
$address = new Address($params->id_address_delivery); $address = new Address($params->id_address_delivery);
if (!Validate::isLoadedObject($address))
{
// If address is not loaded, we take data from shipping estimator module (if installed)
global $cookie;
$address->id_country = $cookie->id_country;
$address->id_state = $cookie->id_state;
$address->postcode = $cookie->postcode;
}
$recipient_country = Db::getInstance()->getRow('SELECT `iso_code` FROM `'._DB_PREFIX_.'country` WHERE `id_country` = '.(int)($address->id_country)); $recipient_country = Db::getInstance()->getRow('SELECT `iso_code` FROM `'._DB_PREFIX_.'country` WHERE `id_country` = '.(int)($address->id_country));
$recipient_state = Db::getInstance()->getRow('SELECT `iso_code` FROM `'._DB_PREFIX_.'state` WHERE `id_state` = '.(int)($address->id_state)); $recipient_state = Db::getInstance()->getRow('SELECT `iso_code` FROM `'._DB_PREFIX_.'state` WHERE `id_state` = '.(int)($address->id_state));
$shipper_country = Db::getInstance()->getRow('SELECT `iso_code` FROM `'._DB_PREFIX_.'country` WHERE `id_country` = '.(int)(Configuration::get('UPS_CARRIER_COUNTRY'))); $shipper_country = Db::getInstance()->getRow('SELECT `iso_code` FROM `'._DB_PREFIX_.'country` WHERE `id_country` = '.(int)(Configuration::get('UPS_CARRIER_COUNTRY')));
+1 -1
View File
@@ -2,7 +2,7 @@
<module> <module>
<name>uspscarrier</name> <name>uspscarrier</name>
<displayName><![CDATA[U.S.P.S. Rate Calulator]]></displayName> <displayName><![CDATA[U.S.P.S. Rate Calulator]]></displayName>
<version><![CDATA[1.2]]></version> <version><![CDATA[1.2.1]]></version>
<description><![CDATA[Calculates shipping rates for United States Postal Service for Domestic shipping within the USA.]]></description> <description><![CDATA[Calculates shipping rates for United States Postal Service for Domestic shipping within the USA.]]></description>
<author><![CDATA[PrestaShop]]></author> <author><![CDATA[PrestaShop]]></author>
<tab><![CDATA[shipping_logistics]]></tab> <tab><![CDATA[shipping_logistics]]></tab>
+9 -1
View File
@@ -53,7 +53,7 @@ class UspsCarrier extends CarrierModule
{ {
$this->name = 'uspscarrier'; $this->name = 'uspscarrier';
$this->tab = 'shipping_logistics'; $this->tab = 'shipping_logistics';
$this->version = '1.2'; $this->version = '1.2.1';
$this->author = 'PrestaShop'; $this->author = 'PrestaShop';
$this->limited_countries = array('us'); $this->limited_countries = array('us');
@@ -1557,6 +1557,14 @@ class UspsCarrier extends CarrierModule
{ {
// Init var // Init var
$address = new Address($params->id_address_delivery); $address = new Address($params->id_address_delivery);
if (!Validate::isLoadedObject($address))
{
// If address is not loaded, we take data from shipping estimator module (if installed)
global $cookie;
$address->id_country = $cookie->id_country;
$address->id_state = $cookie->id_state;
$address->postcode = $cookie->postcode;
}
$recipient_country = Db::getInstance()->getRow('SELECT `iso_code` FROM `'._DB_PREFIX_.'country` WHERE `id_country` = '.(int)($address->id_country)); $recipient_country = Db::getInstance()->getRow('SELECT `iso_code` FROM `'._DB_PREFIX_.'country` WHERE `id_country` = '.(int)($address->id_country));
$recipient_state = Db::getInstance()->getRow('SELECT `iso_code` FROM `'._DB_PREFIX_.'state` WHERE `id_state` = '.(int)($address->id_state)); $recipient_state = Db::getInstance()->getRow('SELECT `iso_code` FROM `'._DB_PREFIX_.'state` WHERE `id_state` = '.(int)($address->id_state));
$shipper_country = Db::getInstance()->getRow('SELECT `iso_code` FROM `'._DB_PREFIX_.'country` WHERE `id_country` = '.(int)(Configuration::get('USPS_CARRIER_COUNTRY'))); $shipper_country = Db::getInstance()->getRow('SELECT `iso_code` FROM `'._DB_PREFIX_.'country` WHERE `id_country` = '.(int)(Configuration::get('USPS_CARRIER_COUNTRY')));
+5 -4
View File
@@ -1,5 +1,5 @@
{* {*
* 2007-2011 PrestaShop * 2007-2011 PrestaShop
* *
* NOTICE OF LICENSE * NOTICE OF LICENSE
* *
@@ -33,14 +33,15 @@
<h3>{l s='To find a product, please type its name in the field below'}</h3> <h3>{l s='To find a product, please type its name in the field below'}</h3>
<form action="{$link->getPageLink('search')}', " method="post" class="std"> <form action="{$link->getPageLink('search')}" method="get" class="std">
<fieldset> <fieldset>
<p> <p>
<label for="search">{l s='Search our product catalog:'}</label> <label for="search">{l s='Search our product catalog:'}</label>
<input id="search_query" name="search_query" type="text" /> <input id="search_query" class="page404_input" name="search_query" type="text" />
<input type="submit" name="Submit" value="OK" class="button_small" /> <input type="submit" name="Submit" value="{l s='Search'}" class="page404_input button_small" />
</p> </p>
</fieldset> </fieldset>
<div class="clear"></div>
</form> </form>
<p><a href="{$base_dir}" title="{l s='Home'}"><img src="{$img_dir}icon/home.gif" alt="{l s='Home'}" class="icon" /></a><a href="{$base_dir}" title="{l s='Home'}">{l s='Home'}</a></p> <p><a href="{$base_dir}" title="{l s='Home'}"><img src="{$img_dir}icon/home.gif" alt="{l s='Home'}" class="icon" /></a><a href="{$base_dir}" title="{l s='Home'}">{l s='Home'}</a></p>
+1
View File
@@ -1507,3 +1507,4 @@ div.star_hover a, div.star a:hover { background-position: 0 -32px }
border: 2px solid #D0D3D8; border: 2px solid #D0D3D8;
} }
.page404_input { float: left; }