diff --git a/admin-dev/tabs/AdminGroups.php b/admin-dev/tabs/AdminGroups.php index 75045f5e0..f138578c1 100644 --- a/admin-dev/tabs/AdminGroups.php +++ b/admin-dev/tabs/AdminGroups.php @@ -65,7 +65,7 @@ class AdminGroups extends AdminTab $categories = Category::getSimpleCategories($this->context->language->id); echo ' -
+ '.($obj->id ? '' : '').'
'.$this->l('Group').' @@ -130,11 +130,14 @@ class AdminGroups extends AdminTab $this->displayAssoShop('group_shop'); echo ''; } + echo '
* '.$this->l('Required field').'
-
+ '; + $this->displayFormRestrictions($obj->id); + echo '

'; if ($obj->id) @@ -163,9 +166,142 @@ class AdminGroups extends AdminTab
* '.$this->l('Required field').'
'; + } } + /** + * display form client groups restrictions + */ + protected function displayFormRestrictions($id = false) + { + $modules = Module::getModulesInstalled(); + $authorized_modules = ''; + $auth_modules = array(); + $unauth_modules = array(); + + if ($id) + $authorized_modules = Module::getAuthorizedModules($id); + else + $id = ''; + + if (is_array($authorized_modules)) + { + foreach ($modules as $module) + { + $authorized = false; + foreach ($authorized_modules as $auth_module) + if ($module['name'] == $auth_module['name']) + $authorized = true; + + if ($authorized) + $auth_modules[] = $module; + else + $unauth_modules[] = $module; + } + } + else + $auth_modules = $modules; + + echo ' +
+ +
'.$this->l('Modules restrictions').' + + + + + +
+

'.$this->l('Unauthorized modules:').'

+

+ + '.$this->l('Select All').' + + + '.$this->l('Authorize').' >> + +
+

'.$this->l('Authorized modules:').'

+

+ + '.$this->l('Select All').' + + + << '.$this->l('Unauthorize').' + + +
+
 
+
+ +
+
'; + } + public function viewgroup() { $this->context = Context::getContext(); @@ -334,6 +470,12 @@ class AdminGroups extends AdminTab else $this->_errors[] = Tools::displayError('You do not have permission to add here.'); } + + if (Tools::isSubmit('submitRestrictions')) + { + $this->updateRestrictions(); + } + if (Tools::isSubmit('submitAddgroup')) { if ($this->tabAccess['add'] === '1') @@ -359,7 +501,7 @@ class AdminGroups extends AdminTab $this->_errors[] = Tools::displayError('Cannot update group reductions'); } } - if (!sizeof($this->_errors)) + if (!count($this->_errors)) parent::postProcess(); } } @@ -390,4 +532,19 @@ class AdminGroups extends AdminTab else parent::postProcess(); } + + /** + * Update (or create) restrictions for modules by group + */ + protected function updateRestrictions() + { + $id_group = Tools::getValue('id_group'); + $unauth_modules = Tools::getValue('unauthorized_modules'); + $auth_modules = Tools::getValue('authorized_modules'); + Group::truncateModulesRestrictions($id_group); + if (is_array($auth_modules)) + Group::addModulesRestrictions($id_group, $auth_modules, 1); + if (is_array($unauth_modules)) + Group::addModulesRestrictions($id_group, $unauth_modules, 0); + } } diff --git a/admin-dev/tabs/authentication.tpl b/admin-dev/tabs/authentication.tpl new file mode 100644 index 000000000..24b7e6b71 --- /dev/null +++ b/admin-dev/tabs/authentication.tpl @@ -0,0 +1,512 @@ +{* +* 2007-2011 PrestaShop +* +* NOTICE OF LICENSE +* +* This source file is subject to the Academic Free License (AFL 3.0) +* that is bundled with this package in the file LICENSE.txt. +* It is also available through the world-wide-web at this URL: +* http://opensource.org/licenses/afl-3.0.php +* If you did not receive a copy of the license and are unable to +* obtain it through the world-wide-web, please send an email +* to license@prestashop.com so we can send you a copy immediately. +* +* DISCLAIMER +* +* Do not edit or add to this file if you wish to upgrade PrestaShop to newer +* versions in the future. If you wish to customize PrestaShop for your +* needs please refer to http://www.prestashop.com for more information. +* +* @author PrestaShop SA +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 7471 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*} + +{* +** Compatibility code for Prestashop older than 1.4.2 using a recent theme +** Ignore list isn't require here +** $address exist in every PrestaShop version +*} + +{* Will be deleted for 1.5 version and more *} +{* Smarty code compatibility v2 *} +{* If ordered_adr_fields doesn't exist, it's a PrestaShop older than 1.4.2 *} +{if !isset($dlv_all_fields)} + {$dlv_all_fields.0 = 'company'} + {$dlv_all_fields.1 = 'firstname'} + {$dlv_all_fields.2 = 'lastname'} + {$dlv_all_fields.3 = 'address1'} + {$dlv_all_fields.4 = 'address2'} + {$dlv_all_fields.5 = 'postcode'} + {$dlv_all_fields.6 = 'city'} + {$dlv_all_fields.7 = 'country'} + {$dlv_all_fields.8 = 'state'} +{/if} + +{capture name=path}{l s='Login'}{/capture} +{include file="$tpl_dir./breadcrumb.tpl"} + + + +

{if !isset($email_create)}{l s='Log in'}{else}{l s='Create your account'}{/if}

+{assign var='current_step' value='login'} +{include file="$tpl_dir./order-steps.tpl"} + +{include file="$tpl_dir./errors.tpl"} +{assign var='stateExist' value=false} +{if !isset($email_create)} +
+
+

{l s='Create your account'}

+

{l s='Enter your e-mail address to create an account'}.

+

+ + +

+

+ {if isset($back)}{/if} + + +

+
+
+
+
+

{l s='Already registered ?'}

+

+ + +

+

+ + +

+

+ {if isset($back)}{/if} + +

+

{l s='Forgot your password?'}

+
+
+ {if isset($inOrderProcess) && $inOrderProcess && $PS_GUEST_CHECKOUT_ENABLED} +
+
+

{l s='Instant Checkout'}

+
+ +

+ + + * +

+

+ {l s='Title'} + {foreach from=$genders key=k item=gender} + id}checked="checked"{/if} /> + + {/foreach} +

+

+ + + + * +

+

+ + + + * +

+

+ {l s='Date of Birth'} + + {* + {l s='January'} + {l s='February'} + {l s='March'} + {l s='April'} + {l s='May'} + {l s='June'} + {l s='July'} + {l s='August'} + {l s='September'} + {l s='October'} + {l s='November'} + {l s='December'} + *} + + +

+ {if isset($newsletter) && $newsletter} +

+ + +

+

+ + +

+ {/if} +

{l s='Delivery address'}

+ {foreach from=$dlv_all_fields item=field_name} + {if $field_name eq "company"} +

+ + +

+ {elseif $field_name eq "vat_number"} + + {elseif $field_name eq "address1"} +

+ + + * +

+ {elseif $field_name eq "postcode"} +

+ + + * +

+ {elseif $field_name eq "city"} +

+ + + * +

+ + {elseif $field_name eq "Country:name" || $field_name eq "country"} +

+ + + * +

+ {elseif $field_name eq "State:name" || $field_name eq 'state'} + {assign var='stateExist' value=true} + +

+ + + * +

+ {elseif $field_name eq "phone"} +

+ + * +

+ {/if} + {/foreach} + {if $stateExist eq false} +

+ + + * +

+ {/if} + + + +
+
+ +

+ *{l s='Required field'} + +

+
+ {/if} +{else} +
+ {$HOOK_CREATE_ACCOUNT_TOP} + + {if isset($PS_REGISTRATION_PROCESS_TYPE) && $PS_REGISTRATION_PROCESS_TYPE} + + + {/if} + {$HOOK_CREATE_ACCOUNT_FORM} +

+ + + {if isset($back)}{/if} + + *{l s='Required field'} +

+ +
+{/if} \ No newline at end of file diff --git a/cache/class_index.php b/cache/class_index.php index 292714675..7603d57fa 100644 --- a/cache/class_index.php +++ b/cache/class_index.php @@ -304,6 +304,8 @@ 'AdminHomeController' => 'override/controllers/admin/AdminHomeController.php', 'AdminRequestSqlControllerCore' => 'controllers/admin/AdminRequestSqlController.php', 'AdminRequestSqlController' => '', + 'AdminSearchEnginesControllerCore' => 'controllers/admin/AdminSearchEnginesController.php', + 'AdminSearchEnginesController' => '', 'AdminShopUrlControllerCore' => 'controllers/admin/AdminShopUrlController.php', 'AdminShopUrlController' => '', 'AdminStatesControllerCore' => 'controllers/admin/AdminStatesController.php', diff --git a/classes/AdminTab.php b/classes/AdminTab.php index e6dd8dc70..263336df5 100644 --- a/classes/AdminTab.php +++ b/classes/AdminTab.php @@ -277,7 +277,7 @@ abstract class AdminTabCore if ($this->includeSubTab('display', array('submitAdd2', 'add', 'update', 'view'))){} // Include current tab - elseif ((Tools::getValue('submitAdd'.$this->table) AND sizeof($this->_errors)) OR isset($_GET['add'.$this->table])) + elseif ((Tools::getValue('submitAdd'.$this->table) && count($this->_errors)) || isset($_GET['add'.$this->table])) { if ($this->tabAccess['add'] === '1') { @@ -290,7 +290,7 @@ abstract class AdminTabCore } elseif (isset($_GET['update'.$this->table])) { - if ($this->tabAccess['edit'] === '1' OR ($this->table == 'employee' AND $this->context->employee->id == Tools::getValue('id_employee'))) + if ($this->tabAccess['edit'] === '1' || ($this->table == 'employee' && $this->context->employee->id == Tools::getValue('id_employee'))) { $this->displayForm(); if ($this->tabAccess['view']) @@ -315,11 +315,11 @@ abstract class AdminTabCore public function displayRequiredFields() { - if (!$this->tabAccess['add'] OR !$this->tabAccess['delete'] === '1' OR !$this->requiredDatabase) + if (!$this->tabAccess['add'] || !$this->tabAccess['delete'] === '1' || !$this->requiredDatabase) return; $rules = call_user_func_array(array($this->className, 'getValidationRules'), array($this->className)); $required_class_fields = array($this->identifier); - foreach ($rules['required'] AS $required) + foreach ($rules['required'] as $required) $required_class_fields[] = $required; echo '
@@ -338,13 +338,13 @@ abstract class AdminTabCore $res = $object->getFieldsRequiredDatabase(); $required_fields = array(); - foreach ($res AS $row) + foreach ($res as $row) $required_fields[(int)$row['id_required_field']] = $row['field_name']; $table_fields = Db::getInstance()->ExecuteS('SHOW COLUMNS FROM '.pSQL(_DB_PREFIX_.$this->table)); $irow = 0; - foreach ($table_fields AS $field) + foreach ($table_fields as $field) { if (in_array($field['Field'], $required_class_fields)) continue; @@ -360,7 +360,7 @@ abstract class AdminTabCore public function includeSubTab($methodname, $actions = array()) { - if (!isset($this->_includeTab) OR !is_array($this->_includeTab)) + if (!isset($this->_includeTab) || !is_array($this->_includeTab)) return false; $key = 0; $inc = false; @@ -368,7 +368,7 @@ abstract class AdminTabCore { /* New tab loading */ $classname = 'Admin'.$subtab; - if ($module = Db::getInstance()->getValue('SELECT `module` FROM `'._DB_PREFIX_.'tab` WHERE `class_name` = \''.pSQL($classname).'\'') AND file_exists(_PS_MODULE_DIR_.'/'.$module.'/'.$classname.'.php')) + if ($module = Db::getInstance()->getValue('SELECT `module` FROM `'._DB_PREFIX_.'tab` WHERE `class_name` = \''.pSQL($classname).'\'') && file_exists(_PS_MODULE_DIR_.'/'.$module.'/'.$classname.'.php')) include_once(_PS_MODULE_DIR_.'/'.$module.'/'.$classname.'.php'); elseif (file_exists(_PS_ADMIN_DIR_.'/tabs/'.$classname.'.php')) include_once('tabs/'.$classname.'.php'); @@ -378,8 +378,8 @@ abstract class AdminTabCore $adminTab->token = $this->token; /* Extra variables addition */ - if (!empty($extraVars) AND is_array($extraVars)) - foreach ($extraVars AS $varKey => $varValue) + if (!empty($extraVars) && is_array($extraVars)) + foreach ($extraVars as $varKey => $varValue) $adminTab->$varKey = $varValue; /* Actions management */ @@ -393,7 +393,7 @@ abstract class AdminTabCore $ok_inc = true; break; case 'submitAdd2': - if (Tools::getValue('submitAdd'.$adminTab->table) AND sizeof($adminTab->_errors)) + if (Tools::getValue('submitAdd'.$adminTab->table) && count($adminTab->_errors)) $ok_inc = true; break; case 'submitDel': @@ -412,18 +412,18 @@ abstract class AdminTabCore } } $inc = false; - if ((isset($ok_inc) AND $ok_inc) OR !sizeof($actions)) + if ((isset($ok_inc) && $ok_inc) || !count($actions)) { if (!$adminTab->viewAccess()) { echo Tools::displayError('Access denied'); return false; } - if (!sizeof($actions)) - if (($methodname == 'displayErrors' AND sizeof($adminTab->_errors)) OR $methodname != 'displayErrors') + if (!count($actions)) + if (($methodname == 'displayErrors' && count($adminTab->_errors)) || $methodname != 'displayErrors') echo (isset($this->_includeTabTitle[$key]) ? '

'.$this->_includeTabTitle[$key].'

' : ''); if ($adminTab->_includeVars) - foreach ($adminTab->_includeVars AS $var => $value) + foreach ($adminTab->_includeVars as $var => $value) $adminTab->$var = $this->$value; $adminTab->$methodname(); $inc = true; @@ -446,7 +446,7 @@ abstract class AdminTabCore /* Class specific validation rules */ $rules = call_user_func(array($className, 'getValidationRules'), $className); - if ((sizeof($rules['requiredLang']) OR sizeof($rules['sizeLang']) OR sizeof($rules['validateLang']))) + if ((count($rules['requiredLang']) || count($rules['sizeLang']) || count($rules['validateLang']))) { /* Language() instance determined by default language */ $defaultLanguage = new Language((int)(Configuration::get('PS_LANG_DEFAULT'))); @@ -456,49 +456,49 @@ abstract class AdminTabCore } /* Checking for required fields */ - foreach ($rules['required'] AS $field) - if (($value = Tools::getValue($field)) == false AND (string)$value != '0') - if (!Tools::getValue($this->identifier) OR ($field != 'passwd' AND $field != 'no-picture')) + foreach ($rules['required'] as $field) + if (($value = Tools::getValue($field)) == false && (string)$value != '0') + if (!Tools::getValue($this->identifier) || ($field != 'passwd' && $field != 'no-picture')) $this->_errors[] = $this->l('the field').' '.call_user_func(array($className, 'displayFieldName'), $field, $className).' '.$this->l('is required'); /* Checking for multilingual required fields */ - foreach ($rules['requiredLang'] AS $fieldLang) - if (($empty = Tools::getValue($fieldLang.'_'.$defaultLanguage->id)) === false OR $empty !== '0' AND empty($empty)) + foreach ($rules['requiredLang'] as $fieldLang) + if (($empty = Tools::getValue($fieldLang.'_'.$defaultLanguage->id)) === false || $empty !== '0' && empty($empty)) $this->_errors[] = $this->l('the field').' '.call_user_func(array($className, 'displayFieldName'), $fieldLang, $className).' '.$this->l('is required at least in').' '.$defaultLanguage->name; /* Checking for maximum fields sizes */ - foreach ($rules['size'] AS $field => $maxLength) - if (Tools::getValue($field) !== false AND Tools::strlen(Tools::getValue($field)) > $maxLength) + foreach ($rules['size'] as $field => $maxLength) + if (Tools::getValue($field) !== false && Tools::strlen(Tools::getValue($field)) > $maxLength) $this->_errors[] = $this->l('the field').' '.call_user_func(array($className, 'displayFieldName'), $field, $className).' '.$this->l('is too long').' ('.$maxLength.' '.$this->l('chars max').')'; /* Checking for maximum multilingual fields size */ - foreach ($rules['sizeLang'] AS $fieldLang => $maxLength) - foreach ($languages AS $language) - if (Tools::getValue($fieldLang.'_'.$language['id_lang']) !== false AND Tools::strlen(Tools::getValue($fieldLang.'_'.$language['id_lang'])) > $maxLength) + foreach ($rules['sizeLang'] as $fieldLang => $maxLength) + foreach ($languages as $language) + if (Tools::getValue($fieldLang.'_'.$language['id_lang']) !== false && Tools::strlen(Tools::getValue($fieldLang.'_'.$language['id_lang'])) > $maxLength) $this->_errors[] = $this->l('the field').' '.call_user_func(array($className, 'displayFieldName'), $fieldLang, $className).' ('.$language['name'].') '.$this->l('is too long').' ('.$maxLength.' '.$this->l('chars max, html chars including').')'; /* Overload this method for custom checking */ $this->_childValidation(); /* Checking for fields validity */ - foreach ($rules['validate'] AS $field => $function) - if (($value = Tools::getValue($field)) !== false AND ($field != 'passwd')) + foreach ($rules['validate'] as $field => $function) + if (($value = Tools::getValue($field)) !== false && ($field != 'passwd')) if (!Validate::$function($value)) $this->_errors[] = $this->l('the field').' '.call_user_func(array($className, 'displayFieldName'), $field, $className).' '.$this->l('is invalid'); /* Checking for passwd_old validity */ if (($value = Tools::getValue('passwd')) != false) { - if ($className == 'Employee' AND !Validate::isPasswdAdmin($value)) + if ($className == 'Employee' && !Validate::isPasswdAdmin($value)) $this->_errors[] = $this->l('the field').' '.call_user_func(array($className, 'displayFieldName'), 'passwd', $className).' '.$this->l('is invalid'); - elseif ($className == 'Customer' AND !Validate::isPasswd($value)) + elseif ($className == 'Customer' && !Validate::isPasswd($value)) $this->_errors[] = $this->l('the field').' '.call_user_func(array($className, 'displayFieldName'), 'passwd', $className).' '.$this->l('is invalid'); } /* Checking for multilingual fields validity */ - foreach ($rules['validateLang'] AS $fieldLang => $function) - foreach ($languages AS $language) - if (($value = Tools::getValue($fieldLang.'_'.$language['id_lang'])) !== false AND !empty($value)) + foreach ($rules['validateLang'] as $fieldLang => $function) + foreach ($languages as $language) + if (($value = Tools::getValue($fieldLang.'_'.$language['id_lang'])) !== false && !empty($value)) if (!Validate::$function($value)) $this->_errors[] = $this->l('the field').' '.call_user_func(array($className, 'displayFieldName'), $fieldLang, $className).' ('.$language['name'].') '.$this->l('is invalid'); } @@ -522,16 +522,16 @@ abstract class AdminTabCore if (key_exists('dir', $this->fieldImageSettings)) { $dir = $this->fieldImageSettings['dir'].'/'; - if (file_exists(_PS_IMG_DIR_.$dir.$id.'.'.$this->imageType) AND !unlink(_PS_IMG_DIR_.$dir.$id.'.'.$this->imageType)) + if (file_exists(_PS_IMG_DIR_.$dir.$id.'.'.$this->imageType) && !unlink(_PS_IMG_DIR_.$dir.$id.'.'.$this->imageType)) return false; } - if (file_exists(_PS_TMP_IMG_DIR_.$this->table.'_'.$id.'.'.$this->imageType) AND !unlink(_PS_TMP_IMG_DIR_.$this->table.'_'.$id.'.'.$this->imageType)) + if (file_exists(_PS_TMP_IMG_DIR_.$this->table.'_'.$id.'.'.$this->imageType) && !unlink(_PS_TMP_IMG_DIR_.$this->table.'_'.$id.'.'.$this->imageType)) return false; - if (file_exists(_PS_TMP_IMG_DIR_.$this->table.'_mini_'.$id.'.'.$this->imageType) AND !unlink(_PS_TMP_IMG_DIR_.$this->table.'_mini_'.$id.'.'.$this->imageType)) + if (file_exists(_PS_TMP_IMG_DIR_.$this->table.'_mini_'.$id.'.'.$this->imageType) && !unlink(_PS_TMP_IMG_DIR_.$this->table.'_mini_'.$id.'.'.$this->imageType)) return false; $types = ImageType::getImagesTypes(); - foreach ($types AS $imageType) - if (file_exists(_PS_IMG_DIR_.$dir.$id.'-'.stripslashes($imageType['name']).'.'.$this->imageType) AND !unlink(_PS_IMG_DIR_.$dir.$id.'-'.stripslashes($imageType['name']).'.'.$this->imageType)) + foreach ($types as $imageType) + if (file_exists(_PS_IMG_DIR_.$dir.$id.'-'.stripslashes($imageType['name']).'.'.$this->imageType) && !unlink(_PS_IMG_DIR_.$dir.$id.'-'.stripslashes($imageType['name']).'.'.$this->imageType)) return false; return true; } @@ -581,10 +581,10 @@ abstract class AdminTabCore { if ($this->tabAccess['delete'] === '1') { - if (Validate::isLoadedObject($object = $this->loadObject()) AND isset($this->fieldImageSettings)) + if (Validate::isLoadedObject($object = $this->loadObject()) && isset($this->fieldImageSettings)) { // check if request at least one object with noZeroObject - if (isset($object->noZeroObject) AND sizeof(call_user_func(array($this->className, $object->noZeroObject))) <= 1) + if (isset($object->noZeroObject) && count(call_user_func(array($this->className, $object->noZeroObject))) <= 1) $this->_errors[] = Tools::displayError('You need at least one object.').' '.$this->table.'
'.Tools::displayError('You cannot delete all of the items.'); else { @@ -612,14 +612,14 @@ abstract class AdminTabCore } /* Change object statuts (active, inactive) */ - elseif ((isset($_GET['status'.$this->table]) OR isset($_GET['status'])) AND Tools::getValue($this->identifier)) + elseif ((isset($_GET['status'.$this->table]) || isset($_GET['status'])) && Tools::getValue($this->identifier)) { if ($this->tabAccess['edit'] === '1') { if (Validate::isLoadedObject($object = $this->loadObject())) { if ($object->toggleStatus()) - Tools::redirectAdmin(self::$currentIndex.'&conf=5'.((($id_category = (int)(Tools::getValue('id_category'))) AND Tools::getValue('id_product')) ? '&id_category='.$id_category : '').'&token='.$token); + Tools::redirectAdmin(self::$currentIndex.'&conf=5'.((($id_category = (int)(Tools::getValue('id_category'))) && Tools::getValue('id_product')) ? '&id_category='.$id_category : '').'&token='.$token); else $this->_errors[] = Tools::displayError('An error occurred while updating status.'); } @@ -640,7 +640,7 @@ abstract class AdminTabCore $this->_errors[] = Tools::displayError('Failed to update the position.'); else Tools::redirectAdmin(self::$currentIndex.'&'.$this->table.'Orderby=position&'.$this->table.'Orderway=asc&conf=5'.(($id_category = (int)(Tools::getValue($this->identifier))) ? ('&'.$this->identifier.'='.$id_category) : '').'&token='.$token); - Tools::redirectAdmin(self::$currentIndex.'&'.$this->table.'Orderby=position&'.$this->table.'Orderway=asc&conf=5'.((($id_category = (int)(Tools::getValue('id_category'))) AND Tools::getValue('id_product')) ? '&id_category='.$id_category : '').'&token='.$token); + Tools::redirectAdmin(self::$currentIndex.'&'.$this->table.'Orderby=position&'.$this->table.'Orderway=asc&conf=5'.((($id_category = (int)(Tools::getValue('id_category'))) && Tools::getValue('id_product')) ? '&id_category='.$id_category : '').'&token='.$token); } /* Delete multiple objects */ elseif (Tools::getValue('submitDel'.$this->table)) @@ -650,9 +650,9 @@ abstract class AdminTabCore if (isset($_POST[$this->table.'Box'])) { $object = new $this->className(); - if (isset($object->noZeroObject) AND + if (isset($object->noZeroObject) && // Check if all object will be deleted - (sizeof(call_user_func(array($this->className, $object->noZeroObject))) <= 1 OR sizeof($_POST[$this->table.'Box']) == sizeof(call_user_func(array($this->className, $object->noZeroObject))))) + (count(call_user_func(array($this->className, $object->noZeroObject))) <= 1 || count($_POST[$this->table.'Box']) == count(call_user_func(array($this->className, $object->noZeroObject))))) $this->_errors[] = Tools::displayError('You need at least one object.').' '.$this->table.'
'.Tools::displayError('You cannot delete all of the items.'); else { @@ -663,7 +663,7 @@ abstract class AdminTabCore { $toDelete = new $this->className($id); $toDelete->deleted = 1; - $result = $result AND $toDelete->update(); + $result = $result && $toDelete->update(); } } else @@ -686,20 +686,20 @@ abstract class AdminTabCore { /* Checking fields validity */ $this->validateRules(); - if (!sizeof($this->_errors)) + if (!count($this->_errors)) { $id = (int)(Tools::getValue($this->identifier)); /* Object update */ - if (isset($id) AND !empty($id)) + if (isset($id) && !empty($id)) { - if ($this->tabAccess['edit'] === '1' OR ($this->table == 'employee' AND $this->context->employee->id == Tools::getValue('id_employee') AND Tools::isSubmit('updateemployee'))) + if ($this->tabAccess['edit'] === '1' || ($this->table == 'employee' && $this->context->employee->id == Tools::getValue('id_employee') && Tools::isSubmit('updateemployee'))) { $object = new $this->className($id); if (Validate::isLoadedObject($object)) { /* Specific to objects which must not be deleted */ - if ($this->deleted AND $this->beforeDelete($object)) + if ($this->deleted && $this->beforeDelete($object)) { // Create new one with old objet values $objectNew = new $this->className($object->id); @@ -729,8 +729,10 @@ abstract class AdminTabCore if (!$result) $this->_errors[] = Tools::displayError('An error occurred while updating object.').' '.$this->table.' ('.Db::getInstance()->getMsgError().')'; - elseif ($this->postImage($object->id) AND !sizeof($this->_errors)) + elseif ($this->postImage($object->id) && !count($this->_errors)) { + if ($this->table == 'group') + $this->updateRestrictions($object->id); $parent_id = (int)(Tools::getValue('id_parent', 1)); // Specific back redirect if ($back = Tools::getValue('back')) @@ -762,14 +764,15 @@ abstract class AdminTabCore { $object = new $this->className(); $this->copyFromPost($object, $this->table); -// d($object); if (!$object->add()) $this->_errors[] = Tools::displayError('An error occurred while creating object.').' '.$this->table.' ('.Db::getInstance()->getMsgError().')'; - elseif (($_POST[$this->identifier] = $object->id /* voluntary */) AND $this->postImage($object->id) AND !sizeof($this->_errors) AND $this->_redirect) + elseif (($_POST[$this->identifier] = $object->id /* voluntary */) && $this->postImage($object->id) && !count($this->_errors) && $this->_redirect) { $parent_id = (int)(Tools::getValue('id_parent', 1)); $this->afterAdd($object); $this->updateAssoShop($object->id); + if ($this->table == 'group') + $this->updateRestrictions($object->id); // Save and stay on same form if (Tools::isSubmit('submitAdd'.$this->table.'AndStay')) Tools::redirectAdmin(self::$currentIndex.'&'.$this->identifier.'='.$object->id.'&conf=3&update'.$this->table.'&token='.$token); @@ -791,7 +794,7 @@ abstract class AdminTabCore elseif (isset($_POST['submitReset'.$this->table])) { $filters = $this->context->cookie->getFamily($this->table.'Filter_'); - foreach ($filters AS $cookieKey => $filter) + foreach ($filters as $cookieKey => $filter) if (strncmp($cookieKey, $this->table.'Filter_', 7 + Tools::strlen($this->table)) == 0) { $key = substr($cookieKey, 7 + Tools::strlen($this->table)); @@ -817,13 +820,13 @@ abstract class AdminTabCore } /* Manage list filtering */ - elseif (Tools::isSubmit('submitFilter'.$this->table) OR $this->context->cookie->{'submitFilter'.$this->table} !== false) + elseif (Tools::isSubmit('submitFilter'.$this->table) || $this->context->cookie->{'submitFilter'.$this->table} !== false) { $_POST = array_merge($this->context->cookie->getFamily($this->table.'Filter_'), (isset($_POST) ? $_POST : array())); - foreach ($_POST AS $key => $value) + foreach ($_POST as $key => $value) { /* Extracting filters from $_POST on key filter_ */ - if ($value != NULL AND !strncmp($key, $this->table.'Filter_', 7 + Tools::strlen($this->table))) + if ($value != NULL && !strncmp($key, $this->table.'Filter_', 7 + Tools::strlen($this->table))) { $key = Tools::substr($key, 7 + Tools::strlen($this->table)); /* Table alias could be specified using a ! eg. alias!field */ @@ -832,7 +835,7 @@ abstract class AdminTabCore if ($field = $this->filterToField($key, $filter)) { $type = (array_key_exists('filter_type', $field) ? $field['filter_type'] : (array_key_exists('type', $field) ? $field['type'] : false)); - if (($type == 'date' OR $type == 'datetime') AND is_string($value)) + if (($type == 'date' || $type == 'datetime') && is_string($value)) $value = unserialize($value); $key = isset($tmpTab[1]) ? $tmpTab[0].'.`'.bqSQL($tmpTab[1]).'`' : '`'.bqSQL($tmpTab[0]).'`'; if (array_key_exists('tmpTableFilter', $field)) @@ -845,7 +848,7 @@ abstract class AdminTabCore /* Only for date filtering (from, to) */ if (is_array($value)) { - if (isset($value[0]) AND !empty($value[0])) + if (isset($value[0]) && !empty($value[0])) { if (!Validate::isDate($value[0])) $this->_errors[] = Tools::displayError('\'from:\' date format is invalid (YYYY-MM-DD)'); @@ -853,7 +856,7 @@ abstract class AdminTabCore $sqlFilter .= ' AND '.$key.' >= \''.pSQL(Tools::dateFrom($value[0])).'\''; } - if (isset($value[1]) AND !empty($value[1])) + if (isset($value[1]) && !empty($value[1])) { if (!Validate::isDate($value[1])) $this->_errors[] = Tools::displayError('\'to:\' date format is invalid (YYYY-MM-DD)'); @@ -864,20 +867,20 @@ abstract class AdminTabCore else { $sqlFilter .= ' AND '; - if ($type == 'int' OR $type == 'bool') - $sqlFilter .= (($key == $this->identifier OR $key == '`'.$this->identifier.'`' OR $key == '`active`') ? 'a.' : '').pSQL($key).' = '.(int)($value).' '; + if ($type == 'int' || $type == 'bool') + $sqlFilter .= (($key == $this->identifier || $key == '`'.$this->identifier.'`' || $key == '`active`') ? 'a.' : '').pSQL($key).' = '.(int)($value).' '; elseif ($type == 'decimal') - $sqlFilter .= (($key == $this->identifier OR $key == '`'.$this->identifier.'`') ? 'a.' : '').pSQL($key).' = '.(float)($value).' '; + $sqlFilter .= (($key == $this->identifier || $key == '`'.$this->identifier.'`') ? 'a.' : '').pSQL($key).' = '.(float)($value).' '; elseif ($type == 'select') - $sqlFilter .= (($key == $this->identifier OR $key == '`'.$this->identifier.'`') ? 'a.' : '').pSQL($key).' = \''.pSQL($value).'\' '; + $sqlFilter .= (($key == $this->identifier || $key == '`'.$this->identifier.'`') ? 'a.' : '').pSQL($key).' = \''.pSQL($value).'\' '; else - $sqlFilter .= (($key == $this->identifier OR $key == '`'.$this->identifier.'`') ? 'a.' : '').pSQL($key).' LIKE \'%'.pSQL($value).'%\' '; + $sqlFilter .= (($key == $this->identifier || $key == '`'.$this->identifier.'`') ? 'a.' : '').pSQL($key).' LIKE \'%'.pSQL($value).'%\' '; } } } } } - elseif(Tools::isSubmit('submitFields') AND $this->requiredDatabase AND $this->tabAccess['add'] === '1' AND $this->tabAccess['delete'] === '1') + elseif(Tools::isSubmit('submitFields') && $this->requiredDatabase && $this->tabAccess['add'] === '1' && $this->tabAccess['delete'] === '1') { if (!is_array($fields = Tools::getValue('fieldsBox'))) $fields = array(); @@ -905,7 +908,7 @@ abstract class AdminTabCore return ; $assos = array(); - foreach ($_POST AS $k => $row) + foreach ($_POST as $k => $row) { if (!preg_match('/^checkBox'.Tools::toCamelCase($type, true).'Asso_'.$this->table.'_([0-9]+)?_([0-9]+)$/Ui', $k, $res)) continue; @@ -914,7 +917,7 @@ abstract class AdminTabCore } Db::getInstance()->Execute('DELETE FROM '._DB_PREFIX_.$this->table.'_'.$type.($id_object ? ' WHERE `'.$this->identifier.'`='.(int)$id_object : '')); - foreach ($assos AS $asso) + foreach ($assos as $asso) Db::getInstance()->Execute('INSERT INTO '._DB_PREFIX_.$this->table.'_'.$type.' (`'.pSQL($this->identifier).'`, id_'.$type.') VALUES('.(int)$asso['id_object'].', '.(int)$asso['id_'.$type].')'); } @@ -936,36 +939,36 @@ abstract class AdminTabCore $fields = $categoryData['fields']; /* Check required fields */ - foreach ($fields AS $field => $values) - if (isset($values['required']) AND $values['required'] && !isset($_POST['configUseDefault'][$field])) - if (isset($values['type']) AND $values['type'] == 'textLang') + foreach ($fields as $field => $values) + if (isset($values['required']) && $values['required'] && !isset($_POST['configUseDefault'][$field])) + if (isset($values['type']) && $values['type'] == 'textLang') { foreach ($languages as $language) - if (($value = Tools::getValue($field.'_'.$language['id_lang'])) == false AND (string)$value != '0') + if (($value = Tools::getValue($field.'_'.$language['id_lang'])) == false && (string)$value != '0') $this->_errors[] = Tools::displayError('field').' '.$values['title'].' '.Tools::displayError('is required.'); } - elseif (($value = Tools::getValue($field)) == false AND (string)$value != '0') + elseif (($value = Tools::getValue($field)) == false && (string)$value != '0') $this->_errors[] = Tools::displayError('field').' '.$values['title'].' '.Tools::displayError('is required.'); /* Check fields validity */ - foreach ($fields AS $field => $values) - if (isset($values['type']) AND $values['type'] == 'textLang') + foreach ($fields as $field => $values) + if (isset($values['type']) && $values['type'] == 'textLang') { foreach ($languages as $language) - if (Tools::getValue($field.'_'.$language['id_lang']) AND isset($values['validation'])) + if (Tools::getValue($field.'_'.$language['id_lang']) && isset($values['validation'])) if (!Validate::$values['validation'](Tools::getValue($field.'_'.$language['id_lang']))) $this->_errors[] = Tools::displayError('field').' '.$values['title'].' '.Tools::displayError('is invalid.'); } - elseif (Tools::getValue($field) AND isset($values['validation'])) + elseif (Tools::getValue($field) && isset($values['validation'])) if (!Validate::$values['validation'](Tools::getValue($field))) $this->_errors[] = Tools::displayError('field').' '.$values['title'].' '.Tools::displayError('is invalid.'); /* Default value if null */ - foreach ($fields AS $field => $values) - if (!Tools::getValue($field) AND isset($values['default'])) + foreach ($fields as $field => $values) + if (!Tools::getValue($field) && isset($values['default'])) $_POST[$field] = $values['default']; - if (1||!sizeof($this->_errors)) + if (1||!count($this->_errors)) { foreach ($fields as $key => $options) { @@ -1046,7 +1049,7 @@ abstract class AdminTabCore protected function uploadImage($id, $name, $dir, $ext = false, $width = NULL, $height = NULL) { - if (isset($_FILES[$name]['tmp_name']) AND !empty($_FILES[$name]['tmp_name'])) + if (isset($_FILES[$name]['tmp_name']) && !empty($_FILES[$name]['tmp_name'])) { // Delete old image if (Validate::isLoadedObject($object = $this->loadObject())) @@ -1059,7 +1062,7 @@ abstract class AdminTabCore $max_size = isset($this->maxImageSize) ? $this->maxImageSize : 0; if ($error = checkImage($_FILES[$name], Tools::getMaxUploadSize($max_size))) $this->_errors[] = $error; - elseif (!$tmpName = tempnam(_PS_TMP_IMG_DIR_, 'PS') OR !move_uploaded_file($_FILES[$name]['tmp_name'], $tmpName)) + elseif (!$tmpName = tempnam(_PS_TMP_IMG_DIR_, 'PS') || !move_uploaded_file($_FILES[$name]['tmp_name'], $tmpName)) return false; else { @@ -1067,7 +1070,7 @@ abstract class AdminTabCore // Copy new image if (!imageResize($tmpName, _PS_IMG_DIR_.$dir.$id.'.'.$this->imageType, (int)$width, (int)$height, ($ext ? $ext : $this->imageType))) $this->_errors[] = Tools::displayError('An error occurred while uploading image.'); - if (sizeof($this->_errors)) + if (count($this->_errors)) return false; if ($this->afterImageUpload()) { @@ -1085,7 +1088,7 @@ abstract class AdminTabCore protected function uploadIco($name, $dest) { - if (isset($_FILES[$name]['tmp_name']) AND !empty($_FILES[$name]['tmp_name'])) + if (isset($_FILES[$name]['tmp_name']) && !empty($_FILES[$name]['tmp_name'])) { /* Check ico validity */ if ($error = checkIco($_FILES[$name])) @@ -1095,7 +1098,7 @@ abstract class AdminTabCore elseif(!copy($_FILES[$name]['tmp_name'], $dest)) $this->_errors[] = Tools::displayError('an error occurred while uploading favicon: '.$_FILES[$name]['tmp_name'].' to '.$dest); } - return !sizeof($this->_errors) ? true : false; + return !count($this->_errors) ? true : false; } /** @@ -1106,13 +1109,13 @@ abstract class AdminTabCore */ protected function postImage($id) { - if (isset($this->fieldImageSettings['name']) AND isset($this->fieldImageSettings['dir'])) + if (isset($this->fieldImageSettings['name']) && isset($this->fieldImageSettings['dir'])) return $this->uploadImage($id, $this->fieldImageSettings['name'], $this->fieldImageSettings['dir'].'/'); elseif (!empty($this->fieldImageSettings)) - foreach ($this->fieldImageSettings AS $image) - if (isset($image['name']) AND isset($image['dir'])) + foreach ($this->fieldImageSettings as $image) + if (isset($image['name']) && isset($image['dir'])) $this->uploadImage($id, $image['name'], $image['dir'].'/'); - return !sizeof($this->_errors) ? true : false; + return !count($this->_errors) ? true : false; } /** @@ -1124,25 +1127,25 @@ abstract class AdminTabCore protected function copyFromPost(&$object, $table) { /* Classical fields */ - foreach ($_POST AS $key => $value) - if (key_exists($key, $object) AND $key != 'id_'.$table) + foreach ($_POST as $key => $value) + if (key_exists($key, $object) && $key != 'id_'.$table) { /* Do not take care of password field if empty */ - if ($key == 'passwd' AND Tools::getValue('id_'.$table) AND empty($value)) + if ($key == 'passwd' && Tools::getValue('id_'.$table) && empty($value)) continue; /* Automatically encrypt password in MD5 */ - if ($key == 'passwd' AND !empty($value)) + if ($key == 'passwd' && !empty($value)) $value = Tools::encrypt($value); $object->{$key} = $value; } /* Multilingual fields */ $rules = call_user_func(array(get_class($object), 'getValidationRules'), get_class($object)); - if (sizeof($rules['validateLang'])) + if (count($rules['validateLang'])) { $languages = Language::getLanguages(false); - foreach ($languages AS $language) - foreach (array_keys($rules['validateLang']) AS $field) + foreach ($languages as $language) + foreach (array_keys($rules['validateLang']) as $field) if (isset($_POST[$field.'_'.(int)($language['id_lang'])])) $object->{$field}[(int)($language['id_lang'])] = $_POST[$field.'_'.(int)($language['id_lang'])]; } @@ -1153,7 +1156,7 @@ abstract class AdminTabCore */ public function displayErrors() { - if ($nbErrors = count($this->_errors) AND $this->_includeContainer) + if ($nbErrors = count($this->_errors) && $this->_includeContainer) { echo ' @@ -1448,24 +1451,24 @@ abstract class AdminTabCore '; } - echo 'identifier,$this->identifiersDnd) ? ' id="'.(((int)(Tools::getValue($this->identifiersDnd[$this->identifier], 1))) ? substr($this->identifier,3,strlen($this->identifier)) : '').'"' : '' ).' class="table'.((array_key_exists($this->identifier,$this->identifiersDnd) AND ($this->_orderBy != 'position 'AND $this->_orderWay != 'DESC')) ? ' tableDnD' : '' ).'" cellpadding="0" cellspacing="0"> + echo 'identifier,$this->identifiersDnd) ? ' id="'.(((int)(Tools::getValue($this->identifiersDnd[$this->identifier], 1))) ? substr($this->identifier,3,strlen($this->identifier)) : '').'"' : '' ).' class="table'.((array_key_exists($this->identifier,$this->identifiersDnd) && ($this->_orderBy != 'position 'AND $this->_orderWay != 'DESC')) ? ' tableDnD' : '' ).'" cellpadding="0" cellspacing="0"> '; if ($this->delete) echo ' '; echo ' '; - foreach ($this->fieldsDisplay AS $key => $params) + foreach ($this->fieldsDisplay as $key => $params) { echo ' '.$params['title']; - if (!isset($params['orderby']) OR $params['orderby']) + if (!isset($params['orderby']) || $params['orderby']) { // Cleaning links if (Tools::getValue($this->table.'Orderby') && Tools::getValue($this->table.'Orderway')) self::$currentIndex = preg_replace('/&'.$this->table.'Orderby=([a-z _]*)&'.$this->table.'Orderway=([a-z]*)/i', '', self::$currentIndex); echo '
- - '; + + '; } echo ' '; } @@ -1476,7 +1479,7 @@ abstract class AdminTabCore } /* Check if object can be modified, deleted or detailed */ - if ($this->edit OR $this->delete OR ($this->view AND $this->view !== 'noActionColumn')) + if ($this->edit || $this->delete || ($this->view && $this->view !== 'noActionColumn')) echo ' '.$this->l('Actions').''; echo ' @@ -1489,7 +1492,7 @@ abstract class AdminTabCore $keyPress = 'onkeypress="formSubmit(event, \'submitFilterButton_'.$this->table.'\');"'; /* Filters (input, select, date or bool) */ - foreach ($this->fieldsDisplay AS $key => $params) + foreach ($this->fieldsDisplay as $key => $params) { $width = (isset($params['width']) ? ' style="width: '.(int)($params['width']).'px;"' : ''); echo ''; @@ -1497,7 +1500,7 @@ abstract class AdminTabCore $params['type'] = 'text'; $value = Tools::getValue($this->table.'Filter_'.(array_key_exists('filter_key', $params) ? $params['filter_key'] : $key)); - if (isset($params['search']) AND !$params['search']) + if (isset($params['search']) && !$params['search']) { echo '--'; continue; @@ -1509,7 +1512,7 @@ abstract class AdminTabCore '; break; @@ -1517,7 +1520,7 @@ abstract class AdminTabCore case 'datetime': if (is_string($value)) $value = unserialize($value); - if (!Validate::isCleanHtml($value[0]) OR !Validate::isCleanHtml($value[1])) + if (!Validate::isCleanHtml($value[0]) || !Validate::isCleanHtml($value[1])) $value = ''; $name = $this->table.'Filter_'.(isset($params['filter_key']) ? $params['filter_key'] : $key); $nameId = str_replace('!', '__', $name); @@ -1531,11 +1534,11 @@ abstract class AdminTabCore if (isset($params['filter_key'])) { echo ''; break; @@ -1555,7 +1558,7 @@ abstract class AdminTabCore echo '--'; } - if ($this->edit OR $this->delete OR ($this->view AND $this->view !== 'noActionColumn')) + if ($this->edit || $this->delete || ($this->view && $this->view !== 'noActionColumn')) echo '--'; echo ' @@ -1573,7 +1576,7 @@ abstract class AdminTabCore { $this->displayTop(); - if ($this->edit AND (!isset($this->noAdd) OR !$this->noAdd)) + if ($this->edit && (!isset($this->noAdd) || !$this->noAdd)) $this->displayAddButton(); /* Append when we get a syntax error in SQL query */ @@ -1585,8 +1588,8 @@ abstract class AdminTabCore /* Display list header (filtering, pagination and column names) */ $this->displayListHeader(); - if (!sizeof($this->_list)) - echo ''.$this->l('No items found').''; + if (!count($this->_list)) + echo ''.$this->l('No items found').''; /* Show the content of the table */ $this->displayListContent(); @@ -1609,7 +1612,7 @@ abstract class AdminTabCore $id_category = 1; // default categ $irow = 0; - if ($this->_list AND isset($this->fieldsDisplay['position'])) + if ($this->_list && isset($this->fieldsDisplay['position'])) { $positions = array_map(create_function('$elem', 'return (int)$elem[\'position\'];'), $this->_list); sort($positions); @@ -1620,34 +1623,34 @@ abstract class AdminTabCore if (preg_match('/cms/Ui', $this->identifier)) $isCms = true; $keyToGet = 'id_'.($isCms ? 'cms_' : '').'category'.(in_array($this->identifier, array('id_category', 'id_cms_category')) ? '_parent' : ''); - foreach ($this->_list AS $tr) + foreach ($this->_list as $tr) { $id = $tr[$this->identifier]; - echo 'identifier,$this->identifiersDnd) ? ' id="tr_'.(($id_category = (int)(Tools::getValue('id_'.($isCms ? 'cms_' : '').'category', '1'))) ? $id_category : '').'_'.$id.'_'.$tr['position'].'"' : '').($irow++ % 2 ? ' class="alt_row"' : '').' '.((isset($tr['color']) AND $this->colorOnBackground) ? 'style="background-color: '.$tr['color'].'"' : '').'> + echo 'identifier,$this->identifiersDnd) ? ' id="tr_'.(($id_category = (int)(Tools::getValue('id_'.($isCms ? 'cms_' : '').'category', '1'))) ? $id_category : '').'_'.$id.'_'.$tr['position'].'"' : '').($irow++ % 2 ? ' class="alt_row"' : '').' '.((isset($tr['color']) && $this->colorOnBackground) ? 'style="background-color: '.$tr['color'].'"' : '').'> '; - if ($this->delete AND (!isset($this->_listSkipDelete) OR !in_array($id, $this->_listSkipDelete))) + if ($this->delete && (!isset($this->_listSkipDelete) || !in_array($id, $this->_listSkipDelete))) echo ''; echo ''; - foreach ($this->fieldsDisplay AS $key => $params) + foreach ($this->fieldsDisplay as $key => $params) { $tmp = explode('!', $key); $key = isset($tmp[1]) ? $tmp[1] : $tmp[0]; echo ' - noLink) OR !$this->noLink)) + noLink) || !$this->noLink)) echo ' onclick="document.location = \''.self::$currentIndex.'&'.$this->identifier.'='.$id.($this->view? '&view' : '&update').$this->table.'&token='.($token!=NULL ? $token : $this->token).'\'">'.(isset($params['prefix']) ? $params['prefix'] : ''); else echo '>'; - if (isset($params['active']) AND isset($tr[$key])) + if (isset($params['active']) && isset($tr[$key])) $this->_displayEnableLink($token, $id, $tr[$key], $params['active'], Tools::getValue('id_category'), Tools::getValue('id_product')); - elseif (isset($params['activeVisu']) AND isset($tr[$key])) + elseif (isset($params['activeVisu']) && isset($tr[$key])) echo ''.($tr[$key] ? $this->l('Enabled') : $this->l('Disabled')).''; elseif (isset($params['position'])) { - if ($this->_orderBy == 'position' AND $this->_orderWay != 'DESC') + if ($this->_orderBy == 'position' && $this->_orderWay != 'DESC') { - echo ' table.'_mini_'.$item_id.'.'.$this->imageType, 45, $this->imageType); } - elseif (isset($params['icon']) AND (isset($params['icon'][$tr[$key]]) OR isset($params['icon']['default']))) + elseif (isset($params['icon']) && (isset($params['icon'][$tr[$key]]) || isset($params['icon']['default']))) echo ''.$tr[$key]).''; elseif (isset($params['price'])) echo Tools::displayPrice($tr[$key], (isset($params['currency']) ? Currency::getCurrencyInstance($tr['id_currency']) : $this->context->currency), false); elseif (isset($params['float'])) echo rtrim(rtrim($tr[$key], '0'), '.'); - elseif (isset($params['type']) AND $params['type'] == 'date') + elseif (isset($params['type']) && $params['type'] == 'date') echo Tools::displayDate($tr[$key], $this->context->language->id); - elseif (isset($params['type']) AND $params['type'] == 'datetime') + elseif (isset($params['type']) && $params['type'] == 'datetime') echo Tools::displayDate($tr[$key], $this->context->language->id, true); elseif (isset($tr[$key])) { @@ -1710,14 +1713,14 @@ abstract class AdminTabCore echo ''.$name.''; } - if ($this->edit OR $this->delete OR ($this->view AND $this->view !== 'noActionColumn')) + if ($this->edit || $this->delete || ($this->view && $this->view !== 'noActionColumn')) { echo ''; if ($this->view) $this->_displayViewLink($token, $id); if ($this->edit) $this->_displayEditLink($token, $id); - if ($this->delete AND (!isset($this->_listSkipDelete) OR !in_array($id, $this->_listSkipDelete))) + if ($this->delete && (!isset($this->_listSkipDelete) || !in_array($id, $this->_listSkipDelete))) $this->_displayDeleteLink($token, $id); if ($this->duplicate) $this->_displayDuplicate($token, $id); @@ -1736,7 +1739,7 @@ abstract class AdminTabCore protected function _displayEnableLink($token, $id, $value, $active, $id_category = NULL, $id_product = NULL) { echo ' + ((int)$id_category && (int)$id_product ? '&id_category='.$id_category : '').'&token='.($token!=NULL ? $token : $this->token).'"> '.($value ? $this->l('Enabled') : $this->l('Disabled')).''; } @@ -1796,7 +1799,7 @@ abstract class AdminTabCore '; - if (isset($this->_includeTab) AND sizeof($this->_includeTab)) + if (isset($this->_includeTab) && count($this->_includeTab)) echo '

'; } @@ -1943,7 +1946,7 @@ abstract class AdminTabCore public function displayOptionTypeSelect($key, $field, $value) { echo ''; } @@ -2028,7 +2031,7 @@ abstract class AdminTabCore ';*/ $i = 0; - foreach ($field['list'] AS $theme) + foreach ($field['list'] as $theme) { echo ''; echo ''; @@ -2038,7 +2041,7 @@ abstract class AdminTabCore echo ''.Tools::strtolower($theme['name']).''; echo ''; echo ''; - if (isset($field['max']) AND ($i +1 ) % $field['max'] == 0) + if (isset($field['max']) && ($i +1 ) % $field['max'] == 0) echo ''; $i++; } @@ -2156,11 +2159,11 @@ abstract class AdminTabCore */ protected function getFieldValue($obj, $key, $id_lang = NULL, $id_shop = null) { - if (!$id_shop AND $obj->isLangMultishop()) + if (!$id_shop && $obj->isLangMultishop()) $id_shop = Context::getContext()->shop->getID(); if ($id_lang) - $defaultValue = ($obj->id AND isset($obj->{$key}[$id_lang])) ? $obj->{$key}[$id_lang] : ''; + $defaultValue = ($obj->id && isset($obj->{$key}[$id_lang])) ? $obj->{$key}[$id_lang] : ''; else $defaultValue = isset($obj->{$key}) ? $obj->{$key} : ''; @@ -2178,7 +2181,7 @@ abstract class AdminTabCore $useLangFromCookie = false; $this->_languages = Language::getLanguages(false); if ($allowEmployeeFormLang) - foreach ($this->_languages AS $lang) + foreach ($this->_languages as $lang) if ($this->context->cookie->employee_form_lang == $lang['id_lang']) $useLangFromCookie = true; if (!$useLangFromCookie) @@ -2194,7 +2197,7 @@ abstract class AdminTabCore $(document).ready(function() { id_language = '.$this->_defaultFormLanguage.'; languages = new Array();'; - foreach ($this->_languages AS $k => $language) + foreach ($this->_languages as $k => $language) echo ' languages['.$k.'] = { id_lang: '.(int)$language['id_lang'].', @@ -2267,7 +2270,7 @@ abstract class AdminTabCore public function checkToken() { $token = Tools::getValue('token'); - return (!empty($token) AND $token === $this->token); + return (!empty($token) && $token === $this->token); } /** @@ -2282,7 +2285,7 @@ abstract class AdminTabCore */ public function displayFlags($languages, $default_language, $ids, $id, $return = false, $use_vars_instead_of_ids = false) { - if (sizeof($languages) == 1) + if (count($languages) == 1) return false; $output = '
@@ -2304,8 +2307,8 @@ abstract class AdminTabCore protected function filterToField($key, $filter) { - foreach ($this->fieldsDisplay AS $field) - if (array_key_exists('filter_key', $field) AND $field['filter_key'] == $key) + foreach ($this->fieldsDisplay as $field) + if (array_key_exists('filter_key', $field) && $field['filter_key'] == $key) return $field; if (array_key_exists($filter, $this->fieldsDisplay)) return $this->fieldsDisplay[$filter]; @@ -2314,7 +2317,7 @@ abstract class AdminTabCore protected function warnDomainName() { - if ($_SERVER['HTTP_HOST'] != Configuration::get('PS_SHOP_DOMAIN') AND $_SERVER['HTTP_HOST'] != Configuration::get('PS_SHOP_DOMAIN_SSL')) + if ($_SERVER['HTTP_HOST'] != Configuration::get('PS_SHOP_DOMAIN') && $_SERVER['HTTP_HOST'] != Configuration::get('PS_SHOP_DOMAIN_SSL')) $this->displayWarning($this->l('Your are currently connected with the following domain name:').' '.$_SERVER['HTTP_HOST'].'
'. $this->l('This one is different from the main shop domain name set in "Preferences > SEO & URLs":').' '.Configuration::get('PS_SHOP_DOMAIN').'
'. @@ -2332,7 +2335,7 @@ abstract class AdminTabCore $assos = array(); $sql = 'SELECT id_'.$type.', `'.pSQL($this->identifier).'` FROM `'._DB_PREFIX_.pSQL($this->table).'_'.$type.'`'; - foreach (Db::getInstance()->ExecuteS($sql) AS $row) + foreach (Db::getInstance()->ExecuteS($sql) as $row) $assos[$row['id_'.$type]][] = $row[$this->identifier]; $html = <<Execute('DELETE FROM `'._DB_PREFIX_.'category_group` WHERE `id_group` = '.(int)$this->id); Db::getInstance()->Execute('DELETE FROM `'._DB_PREFIX_.'group_reduction` WHERE `id_group` = '.(int)$this->id); Db::getInstance()->Execute('DELETE FROM `'._DB_PREFIX_.'product_group_reduction_cache` WHERE `id_group` = '.(int)$this->id); + $this->truncateRestrictionsModules($this->id); Discount::deleteByIdGroup((int)$this->id); // Refresh cache of feature detachable @@ -225,6 +226,67 @@ class GroupCore extends ObjectModel WHERE `id_group` != 1 '); } + + /** + * Truncate all modules restrictions for the group + * @param integer id_group + * @return boolean result + */ + public static function truncateModulesRestrictions($id_group) + { + return Db::getInstance()->Execute(' + DELETE FROM `'._DB_PREFIX_.'group_module_restriction` + WHERE `id_group` = '.(int)$id_group); + } + + /** + * Truncate all restrictions by module + * @param integer id_module + * @return boolean result + */ + public static function truncateRestrictionsByModule($id_module) + { + return Db::getInstance()->Execute(' + DELETE FROM `'._DB_PREFIX_.'group_module_restriction` + WHERE `id_module` = '.(int)$id_module); + } + + /** + * Adding restrictions modules to the group with id $id_group + * @param integer id_group + * @param array modules + * @param integer authorized + */ + public static function addModulesRestrictions($id_group, $modules, $authorized) + { + if (!is_array($modules)) + return false; + else + { + $sql = 'INSERT INTO `'._DB_PREFIX_.'group_module_restriction` (`id_group`, `id_module`, `authorized`) VALUES '; + foreach ($modules as $mod) + $sql .= '("'.(int)$id_group.'", "'.(int)Module::getModuleIdByName($mod).'", "'.(int)$authorized.'"),'; + // removing last comma to avoid SQL error + $sql = substr($sql, 0, strlen($sql) - 1); + Db::getInstance()->Execute($sql); + } + } + + /** + * Add restrictions for a new module + * We authorize every groups to the new module + * @param integer id_module + */ + public static function addRestrictionsForModule($id_module) + { + $groups = Group::getGroups(Context::getContext()->language->id); + $sql = 'INSERT INTO `'._DB_PREFIX_.'group_module_restriction` (`id_group`, `id_module`, `authorized`) VALUES '; + foreach ($groups as $g) + $sql .= '("'.(int)$g['id_group'].'", "'.(int)$id_module.'", "1"),'; + // removing last comma to avoid SQL error + $sql = substr($sql, 0, strlen($sql) - 1); + Db::getInstance()->Execute($sql); + } } diff --git a/classes/Module.php b/classes/Module.php index cee3755c3..8c2993669 100644 --- a/classes/Module.php +++ b/classes/Module.php @@ -181,6 +181,8 @@ abstract class ModuleCore WHERE id_tab = (SELECT `id_tab` FROM '._DB_PREFIX_.'tab WHERE class_name = \'AdminModules\' LIMIT 1) AND a.`view` = 0 )'); + // Adding Restrictions for client groups + Group::addRestrictionsForModule($this->id); return true; } @@ -211,6 +213,9 @@ abstract class ModuleCore Db::getInstance()->Execute('DELETE FROM `'._DB_PREFIX_.'module_access` WHERE `id_module` = '.(int)$this->id); + // Remove restrictions for client groups + Group::truncateRestrictionsByModule($this->id); + return Db::getInstance()->Execute(' DELETE FROM `'._DB_PREFIX_.'module` WHERE `id_module` = '.(int)$this->id); @@ -579,7 +584,7 @@ abstract class ModuleCore $memory_limit = Tools::getMemoryLimit(); - foreach ($modules_dir AS $module) + foreach ($modules_dir as $module) { // Memory usage checking if (function_exists('memory_get_usage') && $memory_limit !== -1) @@ -600,7 +605,7 @@ abstract class ModuleCore $needNewConfigFile = (filemtime($configFile) < filemtime(_PS_MODULE_DIR_.$module.'/'.$module.'.php')); else $needNewConfigFile = true; - if ($useConfig AND $xml_exist) + if ($useConfig && $xml_exist) { libxml_use_internal_errors(true); $xml_module = simplexml_load_file($configFile); @@ -608,7 +613,7 @@ abstract class ModuleCore $errors[] = '['.$module.'] '.Tools::displayError('Error found in config file:').' '.htmlentities($error->message); libxml_clear_errors(); - if (!count($errors) AND (int)$xml_module->need_instance == 0 AND !$needNewConfigFile) + if (!count($errors) && (int)$xml_module->need_instance == 0 && !$needNewConfigFile) { $file = _PS_MODULE_DIR_.$module.'/'.Context::getContext()->language->iso_code.'.php'; if (Tools::file_exists_cache($file) AND include_once($file)) @@ -761,7 +766,7 @@ abstract class ModuleCore return Db::getInstance()->ExecuteS($sql); } - /* + /** * Execute modules for specified hook * * @param string $hook_name Hook Name @@ -771,13 +776,13 @@ abstract class ModuleCore public static function hookExec($hook_name, $hookArgs = array(), $id_module = NULL) { $context = Context::getContext(); - if ((!empty($id_module) AND !Validate::isUnsignedId($id_module)) OR !Validate::isHookName($hook_name)) + if ((!empty($id_module) && !Validate::isUnsignedId($id_module)) || !Validate::isHookName($hook_name)) die(Tools::displayError()); $live_edit = false; - if (!isset($hookArgs['cookie']) OR !$hookArgs['cookie']) + if (!isset($hookArgs['cookie']) || !$hookArgs['cookie']) $hookArgs['cookie'] = $context->cookie; - if (!isset($hookArgs['cart']) OR !$hookArgs['cart']) + if (!isset($hookArgs['cart']) || !$hookArgs['cart']) $hookArgs['cart'] = $context->cart; $hook_name = strtolower($hook_name); @@ -785,15 +790,26 @@ abstract class ModuleCore { $db = Db::getInstance(_PS_USE_SQL_SLAVE_); $list = $context->shop->getListOfID(); + if (isset($context->customer)) + $groups = $context->customer->getGroups(); $sql = 'SELECT h.`name` as hook, m.`id_module`, h.`id_hook`, m.`name` as module, h.`live_edit` FROM `'._DB_PREFIX_.'module` m LEFT JOIN `'._DB_PREFIX_.'hook_module` hm - ON hm.`id_module` = m.`id_module` + ON hm.`id_module` = m.`id_module`'; + if (isset($context->customer)) + $sql .= ' + LEFT JOIN `'._DB_PREFIX_.'group_module_restriction` gmr + ON gmr.`id_module` = m.`id_module`'; + $sql .= ' LEFT JOIN `'._DB_PREFIX_.'hook` h ON hm.`id_hook` = h.`id_hook` WHERE (SELECT COUNT(*) FROM '._DB_PREFIX_.'module_shop ms WHERE ms.id_module = m.id_module AND ms.id_shop IN('.implode(', ', $list).')) = '.count($list).' - AND hm.id_shop IN('.implode(', ', $list).') + AND hm.id_shop IN('.implode(', ', $list).')'; + if (isset($context->customer)) + $sql .= ' + AND (gmr.`authorized` = 1 AND gmr.`id_group` IN('.implode(', ', $groups).'))'; + $sql .= ' GROUP BY hm.id_hook, hm.id_module ORDER BY hm.`position`'; $result = $db->ExecuteS($sql, false); @@ -814,9 +830,9 @@ abstract class ModuleCore $altern = 0; $output = ''; - foreach (self::$_hookModulesCache[$hook_name] AS $array) + foreach (self::$_hookModulesCache[$hook_name] as $array) { - if ($id_module AND $id_module != $array['id_module']) + if ($id_module && $id_module != $array['id_module']) continue; if (!($moduleInstance = Module::getInstanceByName($array['module']))) continue; @@ -824,7 +840,7 @@ abstract class ModuleCore $exceptions = $moduleInstance->getExceptions($array['id_hook']); if (in_array(Dispatcher::getInstance()->getController(), $exceptions)) continue; - if (isset($context->employee) AND !$moduleInstance->getPermission('view', $context->employee)) + if (isset($context->employee) && !$moduleInstance->getPermission('view', $context->employee)) continue; if (is_callable(array($moduleInstance, 'hook'.$hook_name))) @@ -832,7 +848,7 @@ abstract class ModuleCore $hookArgs['altern'] = ++$altern; $display = call_user_func(array($moduleInstance, 'hook'.$hook_name), $hookArgs); - if ($array['live_edit'] && ((Tools::isSubmit('live_edit') AND Tools::getValue('ad') AND (Tools::getValue('liveToken') == sha1(Tools::getValue('ad')._COOKIE_KEY_))))) + if ($array['live_edit'] && ((Tools::isSubmit('live_edit') && Tools::getValue('ad') && (Tools::getValue('liveToken') == sha1(Tools::getValue('ad')._COOKIE_KEY_))))) { $live_edit = true; $output .= ' @@ -882,6 +898,8 @@ abstract class ModuleCore $context = Context::getContext(); $id_customer = $context->customer->id; $billing = new Address((int)$context->cart->id_address_invoice); + if (isset($context->customer)) + $groups = $context->customer->getGroups(); $list = Context::getContext()->shop->getListOfID(); $sql = 'SELECT DISTINCT h.`id_hook`, m.`name`, hm.`position` @@ -890,13 +908,21 @@ abstract class ModuleCore INNER JOIN `'._DB_PREFIX_.'module_group` mg ON (m.`id_module` = mg.`id_module`) INNER JOIN `'._DB_PREFIX_.'customer_group` cg on (cg.`id_group` = mg.`id_group` AND cg.`id_customer` = '.(int)$context->customer->id.') LEFT JOIN `'._DB_PREFIX_.'hook_module` hm ON hm.`id_module` = m.`id_module` - LEFT JOIN `'._DB_PREFIX_.'hook` h ON hm.`id_hook` = h.`id_hook` + LEFT JOIN `'._DB_PREFIX_.'hook` h ON hm.`id_hook` = h.`id_hook`'; + if (isset($context->customer)) + $sql .= ' + LEFT JOIN `'._DB_PREFIX_.'group_module_restriction` gmr ON gmr.`id_module` = m.`id_module`'; + $sql .= ' WHERE h.`name` = \'payment\' AND mc.id_country = '.(int)($billing->id_country).' AND mc.id_shop = '.(int)$context->shop->getID(true).' AND mg.id_shop = '.(int)$context->shop->getID(true).' AND (SELECT COUNT(*) FROM '._DB_PREFIX_.'module_shop ms WHERE ms.id_module = m.id_module AND ms.id_shop IN('.implode(', ', $list).')) = '.count($list).' - AND hm.id_shop IN('.implode(', ', $list).') + AND hm.id_shop IN('.implode(', ', $list).')'; + if (isset($context->customer)) + $sql .= ' + AND (gmr.`authorized` = 1 AND gmr.`id_group` IN('.implode(', ', $groups).'))'; + $sql .= ' GROUP BY hm.id_hook, hm.id_module ORDER BY hm.`position`, m.`name` DESC'; $result = Db::getInstance(_PS_USE_SQL_SLAVE_)->ExecuteS($sql); @@ -1276,5 +1302,29 @@ abstract class ModuleCore } return (bool)$cache_permissions[$employee->id_profile][$id_module][$variable]; } + + /** + * get Unauthorized modules for a client group + * @param integer group_id + */ + public static function getAuthorizedModules($group_id) + { + return Db::getInstance()->ExecuteS(' + SELECT m.id_module, m.name FROM `'._DB_PREFIX_.'group_module_restriction` gmr + LEFT JOIN `'._DB_PREFIX_.'module` m ON (m.`id_module` = gmr.`id_module`) + WHERE gmr.`id_group` = '.(int) $group_id.' + AND gmr.`authorized` = 1 + '); + } + + /** + * get id module by name + * @param string name + * @return integer id + */ + public static function getModuleIdByName($name) + { + return Db::getInstance()->getValue('SELECT id_module FROM `'._DB_PREFIX_.'module` WHERE name = "'.pSQL($name).'"'); + } } diff --git a/install-dev/sql/db.sql b/install-dev/sql/db.sql index f06a5c38d..cd70eccc6 100644 --- a/install-dev/sql/db.sql +++ b/install-dev/sql/db.sql @@ -1954,3 +1954,10 @@ PRIMARY KEY (`id_discount`, `id_shop`), KEY `id_shop` (`id_shop`) ) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8; +CREATE TABLE `PREFIX_group_module_restriction` ( + `id_group` INT(11) UNSIGNED NOT NULL , + `id_module` INT(11) UNSIGNED NOT NULL , + `authorized` tinyint(1) NOT NULL DEFAULT '0', +PRIMARY KEY (`id_group`,`id_module`) +) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8; + diff --git a/translations/fr/admin.php b/translations/fr/admin.php index 5bba9207d..f9872d6bf 100644 --- a/translations/fr/admin.php +++ b/translations/fr/admin.php @@ -20,20 +20,6 @@ $_LANGADM['AdminAccess05fe96d753968b151a15b748140e4467'] = 'Les permissions du p $_LANGADM['AdminAccessbf17ac149e2e7a530c677e9bd51d3fd2'] = 'Modules'; $_LANGADM['AdminAccessf1206f9fadc5ce41694f69129aecac26'] = 'Configurer'; $_LANGADM['AdminAccess501faad2df9c231576549a068fcf61ca'] = 'Pas de modules installés'; -$_LANGADM['AdminAliases9ab81f57823f6aeb02362291f23883e6'] = 'Alias'; -$_LANGADM['AdminAliases13348442cc6a27032d2b4aa28b75a5d3'] = 'Rechercher'; -$_LANGADM['AdminAliasesec53a8c4f07baed5d8825072c89799be'] = 'Statut'; -$_LANGADM['AdminAliasesa66ec6983e578c3ac4663171b39d168b'] = 'les 2 champs sont requis'; -$_LANGADM['AdminAliases792fd33273f5b3dbbcc6bd5de52b7e20'] = 'n\'est pas un résultat valide'; -$_LANGADM['AdminAliases9d2e974b83d9090b463dbcb2ef32ab51'] = 'n\'est pas un alias valide'; -$_LANGADM['AdminAliasesa1f687d813c4e0c415cb5137fcb156c1'] = 'Alias :'; -$_LANGADM['AdminAliasesb5d71393255d0337cc587ba074b18b06'] = 'Entrez chaque alias séparé par une virgule (\',\')'; -$_LANGADM['AdminAliases6f4d4902bdc97012907f5d8c9ee1611a'] = '(ex : \'prestashop,preztashop,prestasohp\')'; -$_LANGADM['AdminAliases3e053943605d9e4bf7dd7588ea19e9d2'] = 'Caractères interdits :'; -$_LANGADM['AdminAliases5aac38deec604d81565722cc5a2a6be1'] = 'Résultat :'; -$_LANGADM['AdminAliases01d2aac5d20787a1e873f2bdc79b514a'] = 'Recherche ce mot à la place.'; -$_LANGADM['AdminAliases38fb7d24e0d60a048f540ecb18e13376'] = 'Enregistrer'; -$_LANGADM['AdminAliases19f823c6453c2b1ffd09cb715214813d'] = 'Champs requis'; $_LANGADM['AdminAttachmentsb718adec73e04ce3ec720dd11a06a308'] = 'ID'; $_LANGADM['AdminAttachments49ee3087348e8d44e1feda1917443987'] = 'Nom'; $_LANGADM['AdminAttachments0b27918290ff5323bea1e3b78a9cf04e'] = 'Fichier'; @@ -997,27 +983,6 @@ $_LANGADM['AdminGeolocation49ee3087348e8d44e1feda1917443987'] = 'Nom'; $_LANGADM['AdminGeolocationa79a12d2d7ab4c5524e33e62a568d77c'] = 'Liste des adresses IP autorisées'; $_LANGADM['AdminGeolocation5e23ef5156fb0aca3cb2cc23fed2e267'] = 'Vous pouvez ajouter plusieurs adresse IP, ces adresses auront toujours la possibilité de voir votre boutique (par exemple: les adresses IP des Google bot).'; $_LANGADM['AdminGeolocation911bac7fe508d2b815eab0612120b564'] = 'Adresses IP autorisées:'; -$_LANGADM['AdminGroupShopb718adec73e04ce3ec720dd11a06a308'] = 'ID'; -$_LANGADM['AdminGroupShope25b163360646e8f71af8a8ee0fad1a3'] = 'Pays'; -$_LANGADM['AdminGroupShop00d23a76e43b46dae9ec7aa9dcbebb32'] = 'Activé'; -$_LANGADM['AdminGroupShop791a9f4aec774fbe5591d239f3cf0113'] = 'Groupe de boutiques'; -$_LANGADM['AdminGroupShopfa2428e247e092ba7b8380481f5d2c23'] = 'Vous ne pouvez pas éditer ce groupe de boutiques lorque que vous avez plus d\'une boutique'; -$_LANGADM['AdminGroupShop677c9a43ef87f39833e514afc74569be'] = 'Nom du groupe de boutiques'; -$_LANGADM['AdminGroupShop5b55607ff39362e86c0693626a6cc20f'] = 'Partager les clients'; -$_LANGADM['AdminGroupShopb9f5c797ebbf55adccdd8539a65a0241'] = 'Désactivé'; -$_LANGADM['AdminGroupShop934514d7bd6af6a23fca1b985ec2d640'] = 'Partager les comptes clients entre les différentes boutiques de ce groupe'; -$_LANGADM['AdminGroupShop97dd1ad98c5cdd8fae3bbe74174979f0'] = 'Stock partagé'; -$_LANGADM['AdminGroupShop468c3f9dcd67b3f768d2161908d820eb'] = 'Stock partagé entre les magasins de ce groupe'; -$_LANGADM['AdminGroupShopa23a8100bb34ea482c8fb134da89710e'] = 'Partager les commandes'; -$_LANGADM['AdminGroupShop6cbbf7ff5d60b20ff3b8dcb3484eafdb'] = 'Partager les commandes et les paniers entre les différentes boutiques de ce groupe (vous ne pouvez partager les commandes que si vous partagez les clients et les stocks)'; -$_LANGADM['AdminGroupShop24a23d787190f2c4812ff9ab11847a72'] = 'Statut:'; -$_LANGADM['AdminGroupShop37c0e2b9736bc4cc2005f7be3fd66fe5'] = 'Activer ou désactiver la boutique'; -$_LANGADM['AdminGroupShop38fb7d24e0d60a048f540ecb18e13376'] = 'Enregistrer'; -$_LANGADM['AdminGroupShop19f823c6453c2b1ffd09cb715214813d'] = 'Champ obligatoire'; -$_LANGADM['AdminGroupShop775a3ab6add326ef93f2382f49f9e500'] = 'Groupes d\'attributs'; -$_LANGADM['AdminGroupShop287234a1ff35a314b5b6bc4e5828e745'] = 'Attributs'; -$_LANGADM['AdminGroupShopdad1f8d794ee0dd7753fe75e73b78f31'] = 'Zones'; -$_LANGADM['AdminGroupShop817b32b9fa482c23e9413b150b5e6d47'] = 'Ajouter un nouveau groupe de boutiques'; $_LANGADM['AdminGroupsb718adec73e04ce3ec720dd11a06a308'] = 'ID'; $_LANGADM['AdminGroups49ee3087348e8d44e1feda1917443987'] = 'Nom'; $_LANGADM['AdminGroups104d9898c04874d0fbac36e125fa1369'] = 'Réduction'; @@ -1048,6 +1013,14 @@ $_LANGADM['AdminGroups56a8a9eb05f9014da51a4f9b57322ac7'] = 'Catégorie :'; $_LANGADM['AdminGroups60c4a9a7f56f6b9669f84977ebd0f93d'] = 'Seuls les produits qui ont cette catégorie par défaut seront ajoutés'; $_LANGADM['AdminGroups567183b8b1122180690be51cc6df2b74'] = 'Réduction (en %) :'; $_LANGADM['AdminGroups1fe63847218648baf13474e3d25747bb'] = 'Ajouter'; +$_LANGADM['AdminGroups016269c0d83a19a19a2ee0a4294740b4'] = 'Tout déselectionner'; +$_LANGADM['AdminGroups45e96c0a422ce8a1a6ec1bd5eb9625c6'] = 'Tout sélectionner'; +$_LANGADM['AdminGroupsa47b91fe1f53e018f1cfd3cbf093bee7'] = 'Restrictions des modules'; +$_LANGADM['AdminGroups8c4284091367c3213217fd939c84a15d'] = 'Modules non autorisés :'; +$_LANGADM['AdminGroups7f83df9cd29577d544efd9ff66d7118a'] = 'Autoriser'; +$_LANGADM['AdminGroups40382ca2b15ff499eb4e5c101424bc81'] = 'Modules autorisés :'; +$_LANGADM['AdminGroups968e7b7e746e504c627990e6a1cfca21'] = 'Ne pas autoriser'; +$_LANGADM['AdminGroupsb32029c03a7163e885f3d31457d6554e'] = 'Mettre à jour les restrictions'; $_LANGADM['AdminGroupsdaab80c5dadc81fa2d019c562f805994'] = 'Sexe'; $_LANGADM['AdminGroups1ec5f5ec77c51a968271b2ca9862907d'] = 'e-mail'; $_LANGADM['AdminGroups9c37b7b6ff829e977df287900543ea54'] = 'Date de naissance'; @@ -2566,8 +2539,8 @@ $_LANGADM['AdminScenesb56c3bda503a8dc4be356edb0cc31793'] = 'Tout replier'; $_LANGADM['AdminScenes5ffd7a335dd836b3373f5ec570a58bdc'] = 'Tout étendre'; $_LANGADM['AdminScenes5e9df908eafa83cb51c0a3720e8348c7'] = 'Tout cocher'; $_LANGADM['AdminScenes9747d23c8cc358c5ef78c51e59cd6817'] = 'Tout décocher'; -$_LANGADM['AdminScenes8c38776925f7cf41c090646a43157024'] = 'Catégories :'; $_LANGADM['AdminScenesf16b5952df8d25ea30b25ff95ee8fedf'] = 'Boutiques associées'; +$_LANGADM['AdminScenes8c38776925f7cf41c090646a43157024'] = 'Catégories :'; $_LANGADM['AdminScenesdf41d831253828e9852a25c72393fde8'] = 'Enregistrez la scène'; $_LANGADM['AdminScenesf5dae0e1b3d4bc66fadd2840b4f79227'] = 'Veuillez ajouter une image pour continuer'; $_LANGADM['AdminScenes19f823c6453c2b1ffd09cb715214813d'] = 'Champs requis'; @@ -2634,13 +2607,6 @@ $_LANGADM['AdminSearchConfad24ffca4f9e9c0c7e80fe1512df6db9'] = 'Pertinence'; $_LANGADM['AdminSearchConfb528cee25edcbf2257878a5aead21a1d'] = 'Le \"poids\" d\'un mot représente son importance et sa pertinence pour le classement des produits lorsque un utilisateur fait une recherche.'; $_LANGADM['AdminSearchConf157ce71733eb58af6770c47cfbab1732'] = 'Un mot avec un poids de 8 aura 4 fois plus de valeur qu\'un mot avec un poids de 2.'; $_LANGADM['AdminSearchConfc0e9eaafe9282fe99cb85cf791a2dd8e'] = 'Ainsi, il est conseillé de mettre un poids bien supérieur pour les mots qui figurent dans le nom ou la référence du produit plutôt que ceux de la description ou de la catégorie, pour que la recherche soit la plus précise et pertinente possible.'; -$_LANGADM['AdminSearchEnginesb718adec73e04ce3ec720dd11a06a308'] = 'ID'; -$_LANGADM['AdminSearchEngines9aa1b03934893d7134a660af4204f2a9'] = 'Serveur'; -$_LANGADM['AdminSearchEnginesb864759d534539519ceaa2c03a39d4c2'] = 'Variable GET'; -$_LANGADM['AdminSearchEnginesb6f05e5ddde1ec63d992d61144452dfa'] = 'Réferrant'; -$_LANGADM['AdminSearchEngines52e1c423b768c6e9850d70f3a41aca1d'] = 'Variable $_GET'; -$_LANGADM['AdminSearchEngines38fb7d24e0d60a048f540ecb18e13376'] = 'Enregistrer'; -$_LANGADM['AdminSearchEngines19f823c6453c2b1ffd09cb715214813d'] = 'Champs requis'; $_LANGADM['AdminShipping1d8ca7f442e6d4ad3da5cb61b84284fc'] = 'Frais de manutention'; $_LANGADM['AdminShippingc9722f74f95451816de0f8ca3259ae44'] = 'Frais de port offerts à partir de'; $_LANGADM['AdminShipping780c462e85ba4399a5d42e88f69a15ca'] = 'Facturation'; @@ -2706,31 +2672,6 @@ $_LANGADM['AdminShop99104e1966b34f0320d33c5892946a82'] = 'Importer les informati $_LANGADM['AdminShop8409f0f4c1b13db73d10a0f148b67dda'] = 'Importer les informations de la boutique'; $_LANGADM['AdminShopff8be7dc0dfd076e494b88721b257237'] = 'Utilisez cette option pour associer les données (produits, modules etc) de la même façon que la boutique sélectionnée'; $_LANGADM['AdminShop652342e19bf26f8d1b350e60aad3e3bf'] = 'Ajouter une nouvelle boutique'; -$_LANGADM['AdminShopUrlb718adec73e04ce3ec720dd11a06a308'] = 'ID'; -$_LANGADM['AdminShopUrleae639a70006feff484a39363c977e24'] = 'Domaine'; -$_LANGADM['AdminShopUrl7e01d4a0c1fa89814ea68649a506eeee'] = 'Domaine SSL'; -$_LANGADM['AdminShopUrl3840cd8f73026713059f0ed0562c5493'] = 'Uri'; -$_LANGADM['AdminShopUrle93c33bd1341ab74195430daeb63db13'] = 'Nom de la boutique'; -$_LANGADM['AdminShopUrl676e457154510d142765d535fbf11df0'] = 'URL principale'; -$_LANGADM['AdminShopUrl00d23a76e43b46dae9ec7aa9dcbebb32'] = 'Activé'; -$_LANGADM['AdminShopUrl809ba9a802624b3958a53090a72d9c7a'] = 'URL de la boutique'; -$_LANGADM['AdminShopUrl102c89334ecf0958f2065978d05748fd'] = 'URI physique'; -$_LANGADM['AdminShopUrl5a70b8f93f7c6992c283ee62cdfb78ab'] = 'Dossier du magasin sur votre serveur. Laissez ce champ vide si votre magasin n\'est pas installé dans un sous dossier.'; -$_LANGADM['AdminShopUrl8ba460441234cdf94377a0818485f414'] = 'URI virtuelle'; -$_LANGADM['AdminShopUrlb483b64288977921afe330ac8e387e9b'] = 'Ce dossier virtuel ne doit pas exister sur votre serveur, et sera utilisé pour associer une URL à votre magasin.'; -$_LANGADM['AdminShopUrlf6e7829277b67d5a8805d6728a810362'] = 'L\'URL rewriting doit être activé sur votre serveur pour utiliser cette fonctionalité.'; -$_LANGADM['AdminShopUrl6c2f1301971c801a2d1390c39680116f'] = 'L\'URL de votre magasin sera'; -$_LANGADM['AdminShopUrl9f82518d468b9fee614fcc92f76bb163'] = 'Boutique'; -$_LANGADM['AdminShopUrl9efaaad2d5b51cd643529cd6872e169a'] = 'URL principale:'; -$_LANGADM['AdminShopUrlb9f5c797ebbf55adccdd8539a65a0241'] = 'Désactivé'; -$_LANGADM['AdminShopUrl3648bf7fbf02a7ae9cdfecf803561031'] = 'Si vous choisissez cette URL comme URL principale pour cette boutique, toutes les autres URL de cette boutiques seront redirigées vers celle ci (vous ne pouvez avoir qu\'une URL principale par magasin).'; -$_LANGADM['AdminShopUrl134a0349fbc36ef37c862a7321e5e142'] = 'Puisque la boutique sélectionné ne possède aucune URL principale, l\'URL que vous créez sera automatiquement mise en tant qu\'URL principale'; -$_LANGADM['AdminShopUrl681a2f774a1323b8c265610dc0a0d5cb'] = 'La boutique sélectionnée a déjà une URL principale, si vous choisissez l\'URL courante comme étant principale pour cette boutique, l\'ancienne URL principale sera remise en tant qu\'URL normale'; -$_LANGADM['AdminShopUrl24a23d787190f2c4812ff9ab11847a72'] = 'Statut:'; -$_LANGADM['AdminShopUrlad02fa652079de031f48cc5cf9396598'] = 'Activer ou désactiver l\'URL'; -$_LANGADM['AdminShopUrl38fb7d24e0d60a048f540ecb18e13376'] = 'Enregistrer'; -$_LANGADM['AdminShopUrl19f823c6453c2b1ffd09cb715214813d'] = 'Champ obligatoire'; -$_LANGADM['AdminShopUrl241da03b3b26160119804f9067f45a1c'] = 'Ajouter une nouvelle URL de magasin'; $_LANGADM['AdminSlipb718adec73e04ce3ec720dd11a06a308'] = 'ID'; $_LANGADM['AdminSlip6fde42aa0857eb92fc0d0c3fb1c6c8b7'] = 'ID Commande'; $_LANGADM['AdminSlip446faa7da2d42ba4ffeda73cb119dd91'] = 'Date d\'émission'; @@ -2749,26 +2690,6 @@ $_LANGADM['AdminSlip4351cfebe4b61d8aa5efa1d020710005'] = 'Voir'; $_LANGADM['AdminSlip0071aa279bd1583754a544277740f047'] = 'Supprimer l\'objet'; $_LANGADM['AdminSlipd1457b72c3fb323a2671125aef3eab5d'] = ' ?'; $_LANGADM['AdminSlipf2a6c498fb90ee345d997f888fce3b18'] = 'Supprimer'; -$_LANGADM['AdminStatesb718adec73e04ce3ec720dd11a06a308'] = 'ID'; -$_LANGADM['AdminStates49ee3087348e8d44e1feda1917443987'] = 'Nom'; -$_LANGADM['AdminStatesad68f9bafd9bf2dcf3865dac55662fd5'] = 'Code ISO'; -$_LANGADM['AdminStatesb3ff996fe5c77610359114835baf9b38'] = 'Zone'; -$_LANGADM['AdminStatesb8464cdd84b5f068ad72bf5c4f32163d'] = 'Etats'; -$_LANGADM['AdminStates4e140ba723a03baa6948340bf90e2ef6'] = 'Nom :'; -$_LANGADM['AdminStates457885792537d3f4a056e776fa721a3d'] = 'Nom de l\'état à afficher dans les adresses et les factures'; -$_LANGADM['AdminStates3af4c1797da60fd50670ddbb669fc0aa'] = 'Code ISO :'; -$_LANGADM['AdminStates2dcd278c8503e295e186209fffd676f7'] = 'Code ISO de 1 à 4 lettres (vérifiez sur Wikipedia si vous ne savez pas)'; -$_LANGADM['AdminStatesf64be5eef68442a8f50cf535b92ad3e4'] = 'Pays :'; -$_LANGADM['AdminStates19ce4359133c8a012b572413ea8b58ea'] = 'Pays dans lequel l\'état, la région ou la ville sont situés'; -$_LANGADM['AdminStatese6e42855066e7a3ae050b2c698021b14'] = 'Zone :'; -$_LANGADM['AdminStates29b8e6e52c0384bf57dcc6b975d8b39c'] = 'Zone géographique où cet état est localisé'; -$_LANGADM['AdminStatesec92dbe75bbcc2fbf4cad6302df97c19'] = 'Utilisée pour le transport'; -$_LANGADM['AdminStates24a23d787190f2c4812ff9ab11847a72'] = 'Statut :'; -$_LANGADM['AdminStates00d23a76e43b46dae9ec7aa9dcbebb32'] = 'Activé'; -$_LANGADM['AdminStatesb9f5c797ebbf55adccdd8539a65a0241'] = 'Désactivé'; -$_LANGADM['AdminStatesd42225935a374f1249f2a45ebed00772'] = 'Activé ou désactivé'; -$_LANGADM['AdminStates38fb7d24e0d60a048f540ecb18e13376'] = 'Enregistrer'; -$_LANGADM['AdminStates19f823c6453c2b1ffd09cb715214813d'] = 'Champs requis'; $_LANGADM['AdminStatsConf6e7b34fa59e1bd229b207892956dc41c'] = 'Jamais'; $_LANGADM['AdminStatsConfd2ce009594dcc60befa6a4e6cbeb71fc'] = 'Semaine'; $_LANGADM['AdminStatsConf7cbb885aa1164b390a0bc050a64e1812'] = 'Mois';