diff --git a/admin-dev/ajax-tab.php b/admin-dev/ajax-tab.php index bb03c332a..77a09f2b8 100755 --- a/admin-dev/ajax-tab.php +++ b/admin-dev/ajax-tab.php @@ -38,4 +38,4 @@ if (!isset($_REQUEST['controller']) && isset($_REQUEST['tab'])) $_REQUEST['controller'] = strtolower($_REQUEST['tab']); Dispatcher::getInstance()->setControllerDirectories(array(_PS_ADMIN_DIR_.'/tabs/', _PS_ADMIN_CONTROLLER_DIR_)); -Dispatcher::getInstance()->dispatch(); +Dispatcher::getInstance()->dispatch(); \ No newline at end of file diff --git a/admin-dev/ajax.php b/admin-dev/ajax.php index 8f6e91323..2a85ae73a 100644 --- a/admin-dev/ajax.php +++ b/admin-dev/ajax.php @@ -559,9 +559,13 @@ if (Tools::isSubmit('helpAccess')) if (Tools::isSubmit('getHookableList')) { + if (!strlen(Tools::getValue('hooks_list'))) + die('{"hasError" : true, "errors" : ["Live Edit : no module on this page"]}'); + $modules_list = explode(',', Tools::getValue('modules_list')); $hooks_list = explode(',', Tools::getValue('hooks_list')); $hookableList = array(); + foreach ($modules_list as $module) { $module = trim($module); @@ -581,6 +585,7 @@ if (Tools::isSubmit('getHookableList')) } } + $hookableList['hasError'] = false; die(Tools::jsonEncode($hookableList)); } diff --git a/admin-dev/tabs/AdminCarriers.php b/admin-dev/tabs/AdminCarriers.php index 5dcb53289..c1ebf4ee3 100644 --- a/admin-dev/tabs/AdminCarriers.php +++ b/admin-dev/tabs/AdminCarriers.php @@ -275,11 +275,11 @@ class AdminCarriers extends AdminTab private function changeGroups($id_carrier, $delete = true) { if ($delete) - Db::getInstance()->Execute('DELETE FROM '._DB_PREFIX_.'carrier_group WHERE id_carrier='.(int)($id_carrier)); + Db::getInstance()->Execute('DELETE FROM '._DB_PREFIX_.'carrier_group WHERE id_carrier = '.(int)$id_carrier); $groups = Db::getInstance()->ExecuteS('SELECT id_group FROM `'._DB_PREFIX_.'group`'); foreach ($groups as $group) if (Tools::getIsset('groupBox') && in_array($group['id_group'], Tools::getValue('groupBox'))) - Db::getInstance()->Execute('INSERT INTO '._DB_PREFIX_.'carrier_group (id_group, id_carrier) VALUES('.(int)($group['id_group']).','.(int)($id_carrier).')'); + Db::getInstance()->Execute('INSERT INTO '._DB_PREFIX_.'carrier_group (id_group, id_carrier) VALUES('.(int)$group['id_group'].','.(int)$id_carrier.')'); } public function postProcess() @@ -300,7 +300,7 @@ class AdminCarriers extends AdminTab $object = new $this->className($id); if (Validate::isLoadedObject($object)) { - Db::getInstance()->Execute('DELETE FROM '._DB_PREFIX_.'carrier_group WHERE id_carrier='.(int)($id)); + Db::getInstance()->Execute('DELETE FROM '._DB_PREFIX_.'carrier_group WHERE id_carrier = '.(int)$id); $object->deleted = 1; $object->update(); $objectNew = new $this->className(); @@ -348,6 +348,18 @@ class AdminCarriers extends AdminTab } } } + elseif ((isset($_GET['status'.$this->table]) OR isset($_GET['status'])) AND Tools::getValue($this->identifier)) + { + if ($this->tabAccess['edit'] === '1') + { + if (Tools::getValue('id_carrier') == Configuration::get('PS_CARRIER_DEFAULT')) + $this->_errors[] = Tools::displayError('You can\'t disable the default carrier, please change your default carrier first.'); + else + parent::postProcess(); + } + else + $this->_errors[] = Tools::displayError('You do not have permission to edit here.'); + } else { if ((Tools::isSubmit('submitDel'.$this->table) && in_array(Configuration::get('PS_CARRIER_DEFAULT'), Tools::getValue('carrierBox'))) @@ -383,5 +395,4 @@ class AdminCarriers extends AdminTab $this->_list[$key]['name'] = Configuration::get('PS_SHOP_NAME'); parent::displayListContent($token); } -} - +} \ No newline at end of file diff --git a/admin-dev/tabs/AdminCategories.php b/admin-dev/tabs/AdminCategories.php index 69b19409d..659933ef3 100644 --- a/admin-dev/tabs/AdminCategories.php +++ b/admin-dev/tabs/AdminCategories.php @@ -1,6 +1,6 @@ array('title' => $this->l('Description'), 'width' => 500, 'maxlength' => 90, 'callback' => 'getDescriptionClean', 'orderby' => false), 'position' => array('title' => $this->l('Position'), 'width' => 40,'filter_key' => 'position', 'align' => 'center', 'position' => 'position'), 'active' => array('title' => $this->l('Displayed'), 'active' => 'status', 'align' => 'center', 'type' => 'bool', 'orderby' => false)); - + $this->_category = AdminCatalog::getCurrentCategory(); $this->_filter = 'AND `id_parent` = '.(int)($this->_category->id); $this->_select = 'position '; @@ -76,6 +76,7 @@ class AdminCategories extends AdminTab echo '

'.(!$this->_listTotal ? ($this->l('There are no subcategories')) : ($this->_listTotal.' '.($this->_listTotal > 1 ? $this->l('subcategories') : $this->l('subcategory')))).' '.$this->l('in category').' "'.stripslashes($this->_category->getName()).'"

'; if ($this->tabAccess['add'] === '1') echo ' '.$this->l('Add a new subcategory').''; + echo '
'; $this->displayList($token); echo '
'; @@ -215,9 +216,9 @@ class AdminCategories extends AdminTab
'; // Translations are not automatic for the moment ;) $trads = array( - 'Home' => $this->l('Home'), - 'selected' => $this->l('selected'), - 'Collapse All' => $this->l('Collapse All'), + 'Home' => $this->l('Home'), + 'selected' => $this->l('selected'), + 'Collapse All' => $this->l('Collapse All'), 'Expand All' => $this->l('Expand All') ); echo Helper::renderAdminCategorieTree($trads, array(isset($obj->id_parent) ? $obj->id_parent : Tools::getValue('id_parent', 1)), 'id_parent', true); @@ -237,7 +238,7 @@ class AdminCategories extends AdminTab echo '

'.$this->l('Upload category logo from your computer').'

-

+

'; foreach ($this->_languages AS $language) diff --git a/admin-dev/tabs/AdminLanguages.php b/admin-dev/tabs/AdminLanguages.php index 802704dde..8033ac0d5 100644 --- a/admin-dev/tabs/AdminLanguages.php +++ b/admin-dev/tabs/AdminLanguages.php @@ -1,6 +1,6 @@ lang = false; $this->edit = true; $this->delete = true; - + $this->fieldImageSettings = array(array('name' => 'flag', 'dir' => 'l'), array('name' => 'no-picture', 'dir' => 'p')); - + $this->fieldsDisplay = array( 'id_lang' => array('title' => $this->l('ID'), 'align' => 'center', 'width' => 25), 'flag' => array('title' => $this->l('Logo'), 'align' => 'center', 'image' => 'l', 'orderby' => false, 'search' => false), 'name' => array('title' => $this->l('Name'), 'width' => 120), 'iso_code' => array('title' => $this->l('ISO code'), 'width' => 70, 'align' => 'center'), 'language_code' => array('title' => $this->l('Language code'), 'width' => 70, 'align' => 'center'), + 'date_format_lite' => array('title' => $this->l('Date format')), + 'date_format_full' => array('title' => $this->l('Date format (full)')), 'active' => array('title' => $this->l('Enabled'), 'align' => 'center', 'active' => 'status', 'type' => 'bool'), ); - + $this->optionsList = array( 'general' => array( 'title' => $this->l('Languages options'), @@ -57,7 +59,7 @@ class AdminLanguages extends AdminTab parent::__construct(); } - + /** * Copy a no-product image * @@ -79,7 +81,7 @@ class AdminLanguages extends AdminTab if (!imageResize($tmpName, _PS_IMG_DIR_.'m/'.$language.'.jpg')) $this->_errors[] = Tools::displayError('An error occurred while copying no-picture image to your manufacturer folder'); else - { + { $imagesTypes = ImageType::getImagesTypes('products'); foreach ($imagesTypes AS $k => $imageType) { @@ -94,11 +96,11 @@ class AdminLanguages extends AdminTab unlink($tmpName); } } - + /** * deleteNoPictureImages will delete all default image created for the language id_language - * - * @param string $id_language + * + * @param string $id_language * @return boolean true if no error */ private function deleteNoPictureImages($id_language) @@ -133,7 +135,7 @@ class AdminLanguages extends AdminTab { if (isset($_GET['delete'.$this->table])) { - if ($this->tabAccess['delete'] === '1') + if ($this->tabAccess['delete'] === '1') { if (Validate::isLoadedObject($object = $this->loadObject()) AND isset($this->fieldImageSettings)) { @@ -242,26 +244,26 @@ class AdminLanguages extends AdminTab else return parent::postProcess(); } - + public function beforeUpdateOptions() { $lang = new Language((int)Tools::getValue('PS_LANG_DEFAULT')); if (!$lang->active) $this->_errors[] = Tools::displayError('You cannot set this language as default language because it\'s disabled'); } - + public function displayList() { $this->displayWarning($this->l('When you delete a language, all related translations in the database will be deleted.')); parent::displayList(); $languages = Language::getLanguages(false); } - + public function displayListContent($token=NULL) { $irow = 0; if ($this->_list) - + foreach ($this->_list AS $tr) { $id = $tr[$this->identifier]; @@ -314,11 +316,11 @@ class AdminLanguages extends AdminTab echo ''; } } - + public function displayForm($isMainTab = true) { parent::displayForm(); - + if (!($obj = $this->loadObject(true))) return; @@ -337,18 +339,28 @@ class AdminLanguages extends AdminTab
- * + *
- * + *

'.$this->l('2-letter ISO code (e.g., fr, en, de)').'

- * + *

'.$this->l('Full language code (e.g., en-us, pt-br)').'

+ +
+ * +

'.$this->l('Date format, lite (e.g., Y-m-d, d/m/Y)').'

+
+ +
+ * +

'.$this->l('Date format, full (e.g., Y-m-d H:i:s, d/m/Y H:i)').'

+
* @@ -389,7 +401,7 @@ class AdminLanguages extends AdminTab
* '.$this->l('Required field').'
'; - + if ($obj->id AND !$obj->checkFiles()) { echo ' @@ -420,7 +432,7 @@ class AdminLanguages extends AdminTab '; } } - + public function displayFilesList($files) { foreach ($files as $key => $file) diff --git a/admin-dev/tabs/AdminProducts.php b/admin-dev/tabs/AdminProducts.php index f6bd01920..f15f0ec91 100644 --- a/admin-dev/tabs/AdminProducts.php +++ b/admin-dev/tabs/AdminProducts.php @@ -3340,15 +3340,15 @@ class AdminProducts extends AdminTab
'; foreach ($accessories as $accessory) - echo $accessory['name'].(!empty($accessory['reference']) ? ' ('.$accessory['reference'].')' : '').'
'; + echo htmlentities($accessory['name'], ENT_COMPAT, 'UTF-8').(!empty($accessory['reference']) ? ' ('.$accessory['reference'].')' : '').'
'; echo '
+{else} + {/if} {if !$virtual_cart && $giftAllowed && $cart->gift == 1} diff --git a/themes/prestashop/order-detail.tpl b/themes/prestashop/order-detail.tpl index ecf582c73..10468b1f4 100644 --- a/themes/prestashop/order-detail.tpl +++ b/themes/prestashop/order-detail.tpl @@ -87,7 +87,7 @@

{l s='Message:'} {$order->gift_message|nl2br}

{/if}
-