From bbc6c6bdc488cea2fa6853df597c530757fcea40 Mon Sep 17 00:00:00 2001 From: rMalie Date: Wed, 5 Oct 2011 15:21:55 +0000 Subject: [PATCH] // Merge -> revision 9061 --- admin-dev/ajax-tab.php | 2 +- admin-dev/ajax.php | 5 + admin-dev/tabs/AdminCarriers.php | 21 +- admin-dev/tabs/AdminCategories.php | 13 +- admin-dev/tabs/AdminLanguages.php | 54 ++- admin-dev/tabs/AdminProducts.php | 6 +- classes/AdminTab.php | 6 + classes/Carrier.php | 23 + classes/Category.php | 6 + classes/Group.php | 19 + classes/Language.php | 94 ++-- classes/Module.php | 7 + classes/ObjectModel.php | 9 +- classes/Order.php | 7 +- classes/PDF.php | 5 +- classes/PaymentModule.php | 4 +- classes/Search.php | 41 +- classes/Tab.php | 44 +- classes/Tools.php | 13 +- classes/Validate.php | 12 + controllers/front/CartController.php | 4 +- controllers/front/ParentOrderController.php | 31 +- install-dev/sql/db.sql | 2 + install-dev/sql/db_settings_lite.sql | 22 +- install-dev/sql/upgrade/1.4.5.0.sql | 11 + install-dev/view.css | 2 +- js/hookLiveEdit.js | 10 + modules/autoupgrade/Tools14.php | 66 +++ modules/hipay/hipay.php | 14 +- .../mondialrelay/classes/MRGetRelayPoint.php | 5 + modules/mondialrelay/config.xml | 2 +- modules/mondialrelay/fr.php | 1 + modules/mondialrelay/mondialrelay.php | 2 +- modules/paypal/config.xml | 2 +- modules/paypal/paypal.php | 15 +- modules/referralprogram/referralprogram.php | 54 ++- modules/sendtoafriend/sendtoafriend.tpl | 65 +++ modules/shopimporter/shopimporter.php | 2 +- modules/statssearch/statssearch.php | 6 +- modules/uspscarrier/config.xml | 6 +- modules/uspscarrier/log/.htaccess | 1 + modules/uspscarrier/log/index.php | 13 + modules/uspscarrier/sql-install.php | 26 +- modules/uspscarrier/uspscarrier.php | 411 +++++++++--------- themes/.htaccess | 2 +- themes/prestashop/css/addresses.css | 2 + .../img/address_alias_full_width.gif | Bin 0 -> 1260 bytes themes/prestashop/js/order-opc.js | 54 ++- themes/prestashop/order-address.tpl | 10 +- themes/prestashop/order-carrier.tpl | 4 + themes/prestashop/order-detail.tpl | 4 +- themes/prestashop/order-opc-new-account.tpl | 1 + translations/fr/admin.php | 10 +- 53 files changed, 795 insertions(+), 456 deletions(-) create mode 100644 modules/sendtoafriend/sendtoafriend.tpl create mode 100644 modules/uspscarrier/log/.htaccess create mode 100755 modules/uspscarrier/log/index.php create mode 100644 themes/prestashop/img/address_alias_full_width.gif 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}
-
    +
      isVirtual()}style="display:none;"{/if}>
    • {l s='Invoice'}
    • {foreach from=$inv_adr_fields name=inv_loop item=field_item} {if $field_item eq "company" && isset($address_invoice->company)}
    • {$address_invoice->company|escape:'htmlall':'UTF-8'}
    • @@ -100,7 +100,7 @@ {/foreach}
    -
      +
      • {l s='Delivery'}
      • {foreach from=$dlv_adr_fields name=dlv_loop item=field_item} {if $field_item eq "company" && isset($address_delivery->company)}
      • {$address_delivery->company|escape:'htmlall':'UTF-8'}
      • diff --git a/themes/prestashop/order-opc-new-account.tpl b/themes/prestashop/order-opc-new-account.tpl index bbdb2d623..4f2fec152 100644 --- a/themes/prestashop/order-opc-new-account.tpl +++ b/themes/prestashop/order-opc-new-account.tpl @@ -60,6 +60,7 @@
        • {l s='Personalized and secure access'}
        • {l s='Fast and easy check out'}
        • +
        • {l s='Separate billing and shipping addresses'}

        diff --git a/translations/fr/admin.php b/translations/fr/admin.php index d0f835725..5bba9207d 100644 --- a/translations/fr/admin.php +++ b/translations/fr/admin.php @@ -1152,6 +1152,8 @@ $_LANGADM['AdminImport7a1920d61156abc05a60135aefe8bc67'] = 'Défaut'; $_LANGADM['AdminImport9b93b45649ec5961b8cc84e905964683'] = 'Position de l\'image'; $_LANGADM['AdminImport9c163d2934fbdd2775356db804d451fc'] = 'Position de l\'image produit à utiliser pour cette déclinaison. Si vous remplissez ce champ, laissez le champ \"URL de l\'image\" vide.'; $_LANGADM['AdminImport427b6d816d7fdd86cabe48d8180a3cc9'] = 'URL de l\'image'; +$_LANGADM['AdminImport14913d7e9d486e77b5c8d085e3797f94'] = 'Supprimer les images existantes (0 = non, 1 = oui)'; +$_LANGADM['AdminImporte6691747add3b37b9c381b8d9476fd4c'] = 'Si vous ne spécifiez pas cette colonne et vous spécifier la colonne images, toutes les images du produit seront remplacé par celle spécifié dans le fichier d\'import'; $_LANGADM['AdminImportb718adec73e04ce3ec720dd11a06a308'] = 'Identifiant'; $_LANGADM['AdminImportfd0dcc6233b026d257763713c133cf72'] = 'Actif (0/1)'; $_LANGADM['AdminImport2688a544cd5ac33f27ab78c8d8c3acaa'] = 'Nom *'; @@ -1182,8 +1184,6 @@ $_LANGADM['AdminImportf2149c422ab7577f063b69a2884d17f0'] = 'Disponible'; $_LANGADM['AdminImportb1a2a959c20b1bd847895e73a5fddbc9'] = 'Date d\'ajout d\'un produit'; $_LANGADM['AdminImporte1a5e653bc356ed6745d6814d50213eb'] = 'Afficher le prix'; $_LANGADM['AdminImport4d2589e1bcd4263cb99927b59f0f88d2'] = 'URLs des images (x,y,z...)'; -$_LANGADM['AdminImport14913d7e9d486e77b5c8d085e3797f94'] = 'Supprimer les images existantes (0 = non, 1 = oui)'; -$_LANGADM['AdminImporte6691747add3b37b9c381b8d9476fd4c'] = 'Si vous ne spécifiez pas cette colonne et vous spécifier la colonne images, toutes les images du produit seront remplacé par celle spécifié dans le fichier d\'import'; $_LANGADM['AdminImportecde3e896afb64e9a48781b8363b9a03'] = 'Caractéristique(Nom:Valeur:Position)'; $_LANGADM['AdminImport93b145201f52e9210402f4281ff8c188'] = 'Position de la caractéristique'; $_LANGADM['AdminImport71d0ceacdf562024f2d4c3a76d3b63e4'] = 'Uniquement disponible en ligne'; @@ -1342,6 +1342,8 @@ $_LANGADM['AdminLanguages8c2857a9ad1d8f31659e35e904e20fa6'] = 'Logo'; $_LANGADM['AdminLanguages49ee3087348e8d44e1feda1917443987'] = 'Nom'; $_LANGADM['AdminLanguagesad68f9bafd9bf2dcf3865dac55662fd5'] = 'Code ISO'; $_LANGADM['AdminLanguagese59a41e120686e63cbb743f003bea4e6'] = 'Code language'; +$_LANGADM['AdminLanguages534fd46732986cba0efeda8701592427'] = 'Format de date'; +$_LANGADM['AdminLanguagesc11566e30920ed4786e534e5332d5b87'] = 'Format de date (complet)'; $_LANGADM['AdminLanguages00d23a76e43b46dae9ec7aa9dcbebb32'] = 'Activé'; $_LANGADM['AdminLanguages950baf75b9fd48b9cb4a3d30ffeda4ef'] = 'Préférences langues'; $_LANGADM['AdminLanguages7c89197a7b81992ee832cb5a89fa6d9d'] = 'Langue par défaut:'; @@ -1365,6 +1367,10 @@ $_LANGADM['AdminLanguages3af4c1797da60fd50670ddbb669fc0aa'] = 'Code ISO :'; $_LANGADM['AdminLanguages6b7af0b6d91545318696c648d6b466ac'] = 'Code ISO sur 2 lettres (ex : fr, en, de)'; $_LANGADM['AdminLanguages01a3b3d8af14e844c49a3a5acc870c6b'] = 'Code language:'; $_LANGADM['AdminLanguages8bc0a3b0cb05ff731e0fb30f35264898'] = 'Code language complet (ex : en-us, pt-br)'; +$_LANGADM['AdminLanguages104f1a7d59077b514d4105fcee0e42ff'] = 'Format de date :'; +$_LANGADM['AdminLanguages9d03b9a48a9f2f06a9698d1f9484011b'] = 'Format de date, sans les heures (ex : Y-m-d, d/m/Y)'; +$_LANGADM['AdminLanguages3253758a8726c828bbbdc0cc8de30410'] = 'Format de date (complet) :'; +$_LANGADM['AdminLanguages4728927eaacb4a87f8661de4a791589b'] = 'Format de date, avec les heures (ex : Y-m-d H:i:s, d/m/Y H:i)'; $_LANGADM['AdminLanguagesc907a021c935ae6144fa2ccadfe9360d'] = 'Drapeau :'; $_LANGADM['AdminLanguages581e03e07411d053e8c0f275f90fcabc'] = 'Charger le drapeau du pays à partir de votre ordinateur'; $_LANGADM['AdminLanguages70212b3d97d23361e0ec0bc567d7ea30'] = 'Image \"Aucune image\" :';