diff --git a/admin-dev/functions.php b/admin-dev/functions.php index 6876171cc..923f44b78 100644 --- a/admin-dev/functions.php +++ b/admin-dev/functions.php @@ -501,7 +501,7 @@ function runAdminTab($ajaxMode = false) '.translate('Back Office').' '.$bread.''; - if (!$ajaxMode && Shop::isMultiShopActivated() && Context::shop() != Shop::CONTEXT_ALL) + if (!$ajaxMode && Shop::isFeatureActive() && Context::shop() != Shop::CONTEXT_ALL) { echo '
'; if (Context::shop() == Shop::CONTEXT_GROUP) @@ -516,7 +516,7 @@ function runAdminTab($ajaxMode = false) { if($ajaxMode) { - // the differences with index.php is here + // the differences with index.php is here $adminObj->ajaxPreProcess(); $action = Tools::getValue('action'); // no need to use displayConf() here @@ -532,8 +532,8 @@ function runAdminTab($ajaxMode = false) $adminObj->{'displayAjax'.$action}(); else $adminObj->displayAjax(); - - + + } else { diff --git a/admin-dev/header.inc.php b/admin-dev/header.inc.php index 2ab4e6ad6..37f820aae 100644 --- a/admin-dev/header.inc.php +++ b/admin-dev/header.inc.php @@ -137,7 +137,7 @@ echo ' { var hints = $(\'.translatable span.hint\'); '; - if (Shop::isMultiShopActivated()) + if (Shop::isFeatureActive()) { if (Context::shop() == Shop::CONTEXT_ALL) $youEditFieldFor = translate('A modification of this field will be applied for all shops'); @@ -268,7 +268,7 @@ foreach (QuickAccess::getQuickAccesses(Context::getContext()->language->id) AS $ echo '
'; - if (Shop::isMultiShopActivated()) + if (Shop::isFeatureActive()) echo '
'.translate('Select your shop:').' '.generateShopList().'
'; echo '
 
'; diff --git a/admin-dev/init.php b/admin-dev/init.php index 4b2ea2607..c3c99a4b9 100644 --- a/admin-dev/init.php +++ b/admin-dev/init.php @@ -82,7 +82,7 @@ if (empty($context->employee->bo_theme) OR !file_exists($path.$context->employee } // Change shop context ? -if (Shop::isMultiShopActivated() && Tools::getValue('setShopContext') !== false) +if (Shop::isFeatureActive() && Tools::getValue('setShopContext') !== false) { $context->cookie->shopContext = Tools::getValue('setShopContext'); $url = parse_url($_SERVER['REQUEST_URI']); diff --git a/admin-dev/tabs/AdminAttributes.php b/admin-dev/tabs/AdminAttributes.php index db52d4148..cc29816f2 100644 --- a/admin-dev/tabs/AdminAttributes.php +++ b/admin-dev/tabs/AdminAttributes.php @@ -1,6 +1,6 @@ displayWarning($this->l('This feature has been disabled, you can active this feature at this page:').' '.$this->l('Performances').''); return; } - + parent::displayForm(); if (!($obj = $this->loadObject(true))) @@ -88,13 +88,13 @@ class AdminAttributes extends AdminTab
*
'; - if (Shop::isMultiShopActivated()) + if (Shop::isFeatureActive()) { echo '
'; $this->displayAssoShop('group_shop'); @@ -140,11 +140,11 @@ class AdminAttributes extends AdminTab { if (!Combination::isFeatureActive()) return; - - + + Module::hookExec('postProcessAttribute', array('errors' => &$this->_errors)); // send _errors as reference to allow postProcessFeatureValue to stop saving process - + if (Tools::getValue('submitDel'.$this->table)) { if ($this->tabAccess['delete'] === '1') @@ -170,7 +170,7 @@ class AdminAttributes extends AdminTab { $sql = 'SELECT `position`+1 FROM `'._DB_PREFIX_.'attribute` - WHERE id_attribute_group = '.(int)Tools::getValue('id_attribute_group').' + WHERE id_attribute_group = '.(int)Tools::getValue('id_attribute_group').' ORDER BY position DESC'; // set the position of the new attribute in $_POST for postProcess() method $_POST['position'] = DB::getInstance()->getValue($sql); @@ -184,7 +184,7 @@ class AdminAttributes extends AdminTab else parent::postProcess(); } - + } diff --git a/admin-dev/tabs/AdminAttributesGroups.php b/admin-dev/tabs/AdminAttributesGroups.php index 11e8f9e7c..0b3959fe2 100644 --- a/admin-dev/tabs/AdminAttributesGroups.php +++ b/admin-dev/tabs/AdminAttributesGroups.php @@ -1,6 +1,6 @@ displayWarning($this->l('This feature has been disabled, you can active this feature at this page:').' '.$this->l('Performances').''); } - + public function postProcess() - { + { if (!Combination::isFeatureActive()) return; - + $this->adminAttributes->tabAccess = Profile::getProfileAccess(Context::getContext()->employee->id_profile, $this->id); if (Tools::isSubmit('submitAddattribute') || Tools::isSubmit('submitDelattribute')) $this->adminAttributes->postProcess($this->token); @@ -104,7 +104,7 @@ class AdminAttributesGroups extends AdminTab if ($id_attribute_group <= 0) { $sql = 'SELECT `position`+1 - FROM `'._DB_PREFIX_.'attribute_group` + FROM `'._DB_PREFIX_.'attribute_group` ORDER BY position DESC'; // set the position of the new group attribute in $_POST for postProcess() method $_POST['position'] = DB::getInstance()->getValue($sql); @@ -139,7 +139,7 @@ class AdminAttributesGroups extends AdminTab if (!sizeof($this->_list)) echo ''.$this->l('No elements found').''; - + //$this->displayListContent($this->token); @@ -173,7 +173,7 @@ class AdminAttributesGroups extends AdminTab echo ' '; - + if ($this->_orderBy == 'position' AND $this->_orderWay != 'DESC') { echo ''.$this->l('Performances').''); return; } - + parent::displayForm(); if (!($obj = $this->loadObject(true))) @@ -259,7 +259,7 @@ class AdminAttributesGroups extends AdminTab

'.$this->l('Choose the type of the attribute group').'

'; - if (Shop::isMultiShopActivated()) + if (Shop::isFeatureActive()) { echo '
'; $this->displayAssoShop('group_shop'); @@ -274,10 +274,10 @@ class AdminAttributesGroups extends AdminTab '; } - + /** * displayListAttributes - * + * * Display a list of attributes from a group */ public function displayListAttributes($id, $irow, $tr) diff --git a/admin-dev/tabs/AdminCMS.php b/admin-dev/tabs/AdminCMS.php index 8e133f68c..622d6dc01 100644 --- a/admin-dev/tabs/AdminCMS.php +++ b/admin-dev/tabs/AdminCMS.php @@ -1,6 +1,6 @@ edit = true; $this->view = true; $this->delete = true; - + $this->fieldsDisplay = array( 'id_cms' => array('title' => $this->l('ID'), 'align' => 'center', 'width' => 25), 'link_rewrite' => array('title' => $this->l('URL'), 'width' => 200), @@ -47,19 +47,19 @@ class AdminCMS extends AdminTab 'position' => array('title' => $this->l('Position'), 'width' => 40,'filter_key' => 'position', 'align' => 'center', 'position' => 'position'), 'active' => array('title' => $this->l('Enabled'), 'width' => 25, 'align' => 'center', 'active' => 'status', 'type' => 'bool', 'orderby' => false) ); - + $this->_category = AdminCMSContent::getCurrentCMSCategory(); $this->_join = ' LEFT JOIN `'._DB_PREFIX_.'cms_category` c ON (c.`id_cms_category` = a.`id_cms_category`)'; $this->_select = 'a.position '; $this->_filter = 'AND c.id_cms_category = '.(int)($this->_category->id); - + parent::__construct(); } - + private function _displayDraftWarning($active) { - return + return '

@@ -72,11 +72,11 @@ class AdminCMS extends AdminTab

'; } - + public function displayForm($isMainTab = true) { parent::displayForm(); - + $obj = $this->loadObject(true); $divLangName = 'meta_title¤meta_description¤meta_keywords¤ccontent¤link_rewrite'; @@ -85,7 +85,7 @@ class AdminCMS extends AdminTab '.($obj->id ? '' : '').' '.$this->_displayDraftWarning($obj->active).'
'.$this->l('CMS page').''; - + // META TITLE echo '
@@ -101,10 +101,10 @@ class AdminCMS extends AdminTab echo '
*
'; - + $this->displayFlags($this->_languages, $this->_defaultFormLanguage, $divLangName, 'meta_title'); echo '
 
'; - + // META DESCRIPTION echo '
'; @@ -114,7 +114,7 @@ class AdminCMS extends AdminTab
'; $this->displayFlags($this->_languages, $this->_defaultFormLanguage, $divLangName, 'meta_description'); echo '
 
'; - + // META KEYWORDS echo '
'; @@ -124,7 +124,7 @@ class AdminCMS extends AdminTab
'; $this->displayFlags($this->_languages, $this->_defaultFormLanguage, $divLangName, 'meta_keywords'); echo '
 
'; - + // LINK REWRITE echo '
'; @@ -134,7 +134,7 @@ class AdminCMS extends AdminTab
'; $this->displayFlags($this->_languages, $this->_defaultFormLanguage, $divLangName, 'link_rewrite'); echo '
 
'; - + // CONTENT echo '
'; @@ -151,7 +151,7 @@ class AdminCMS extends AdminTab getFieldValue($obj, 'active') ? 'checked="checked" ' : '').'/>
'; - if (Shop::isMultiShopActivated()) + if (Shop::isFeatureActive()) { echo '
'; $this->displayAssoShop(); @@ -169,7 +169,7 @@ class AdminCMS extends AdminTab $isoTinyMCE = (file_exists(_PS_ROOT_DIR_.'/js/tiny_mce/langs/'.$this->context->language->iso_code.'.js') ? $this->context->language->iso_code : 'en'); $ad = dirname($_SERVER["PHP_SELF"]); echo ' - '; } - + public function display($token = NULL) { - + if (($id_cms_category = (int)Tools::getValue('id_cms_category'))) self::$currentIndex .= '&id_cms_category='.$id_cms_category; $this->getList($this->context->language->id, !$this->context->cookie->__get($this->table.'Orderby') ? 'position' : NULL, !$this->context->cookie->__get($this->table.'Orderway') ? 'ASC' : NULL); @@ -194,9 +194,9 @@ class AdminCMS extends AdminTab $this->displayList($token); echo '
'; } - + public function displayList($token = NULL) - { + { /* Display list header (filtering, pagination and column names) */ $this->displayListHeader($token); if (!sizeof($this->_list)) @@ -279,7 +279,7 @@ class AdminCMS extends AdminTab $admin_dir = dirname($_SERVER['PHP_SELF']); $admin_dir = substr($admin_dir, strrpos($admin_dir,'/') + 1); $token = Tools::encrypt('PreviewCMS'.$cms->id); - + $preview_url .= $object->active ? '' : '&adtoken='.$token.'&ad='.$admin_dir; } Tools::redirectAdmin($preview_url); @@ -301,7 +301,7 @@ class AdminCMS extends AdminTab $admin_dir = dirname($_SERVER['PHP_SELF']); $admin_dir = substr($admin_dir, strrpos($admin_dir,'/') + 1); $token = Tools::encrypt('PreviewCMS'.$cms->id); - + $preview_url .= $object->active ? '' : '&adtoken='.$token.'&ad='.$admin_dir; } Tools::redirectAdmin($preview_url); diff --git a/admin-dev/tabs/AdminCarriers.php b/admin-dev/tabs/AdminCarriers.php index b478e5359..881862ca4 100644 --- a/admin-dev/tabs/AdminCarriers.php +++ b/admin-dev/tabs/AdminCarriers.php @@ -101,9 +101,9 @@ class AdminCarriers extends AdminTab $(document).ready(function(){ // At the loading ($("input[name=\'is_free\']:checked").val() == 0) ? $("#shipping_costs_div").show(): $("#shipping_costs_div").hide(); - + $("input[name=\'is_free\']").live("change", function(){ - ($("input[name=\'is_free\']:checked").val() == 0) ? $("#shipping_costs_div").show(): $("#shipping_costs_div").hide(); + ($("input[name=\'is_free\']:checked").val() == 0) ? $("#shipping_costs_div").show(): $("#shipping_costs_div").hide(); }); }); @@ -144,13 +144,13 @@ class AdminCarriers extends AdminTab if (is_array($carrier_zones)) foreach ($carrier_zones as $carrier_zone) $carrier_zones_ids[] = $carrier_zone['id_zone']; - + $zones = Zone::getZones(false); foreach ($zones as $zone) echo '
'; - + echo '

'.$this->l('The zone in which this carrier is to be used').'

@@ -255,7 +255,7 @@ class AdminCarriers extends AdminTab echo ''; } echo ''; - if (Shop::isMultiShopActivated()) + if (Shop::isFeatureActive()) { echo '
'; $this->displayAssoShop(); diff --git a/admin-dev/tabs/AdminCountries.php b/admin-dev/tabs/AdminCountries.php index c1b501bce..b8cb72fb0 100644 --- a/admin-dev/tabs/AdminCountries.php +++ b/admin-dev/tabs/AdminCountries.php @@ -80,9 +80,9 @@ class AdminCountries extends AdminTab $tmp_addr_format = new AddressFormat(); $tmp_addr_format->id_country = $id_country; } - + $tmp_addr_format->format = Tools::getValue('address_layout'); - + if (strlen($tmp_addr_format->format) > 0) { if ($tmp_addr_format->checkFormatFields()) @@ -93,7 +93,7 @@ class AdminCountries extends AdminTab foreach($errorList as $numError => $error) $this->_errors[] = $error; } - + if (!$save_status) $this->_errors[] = Tools::displayError('Invalid address layout'.Db::getInstance()->getMsgError()); @@ -109,10 +109,10 @@ class AdminCountries extends AdminTab { $html = ''; } - + public function displayForm($isMainTab = true) { parent::displayForm(); - + $defaultLayout = ''; - + $defaultLayoutTab = array( array('firstname', 'lastname'), array('company'), @@ -146,19 +146,19 @@ class AdminCountries extends AdminTab array('postcode', 'city'), array('Country:name'), array('phone')); - + if (!($obj = $this->loadObject(true))) return; - + foreach ($defaultLayoutTab as $line) $defaultLayout .= implode(' ', $line)."\r\n"; echo '
'.($obj->id ? '' : '').' @@ -267,7 +267,7 @@ class AdminCountries extends AdminTab $address_layout = AddressFormat::getAddressCountryFormat($obj->id); if ($value = Tools::getValue('address_layout')) $address_layout = $value; - + echo '

'.$this->l('Geographical zone where country is located').'

@@ -334,7 +334,7 @@ class AdminCountries extends AdminTab getFieldValue($obj, 'display_tax_label') AND $obj->id) ? 'checked="checked" ' : '').'/> '; - if (Shop::isMultiShopActivated()) + if (Shop::isFeatureActive()) { echo '
'; $this->displayAssoShop(); diff --git a/admin-dev/tabs/AdminCustomers.php b/admin-dev/tabs/AdminCustomers.php index 92f7c10d6..2ef20ef63 100644 --- a/admin-dev/tabs/AdminCustomers.php +++ b/admin-dev/tabs/AdminCustomers.php @@ -316,7 +316,7 @@ class AdminCustomers extends AdminTab '.$this->l('Registration date:').' '.Tools::displayDate($customer->date_add, $this->context->language->id, true).'
'.$this->l('Last visit:').' '.($customerStats['last_visit'] ? Tools::displayDate($customerStats['last_visit'], $this->context->language->id, true) : $this->l('never')).'
'.($countBetterCustomers != '-' ? $this->l('Rank: #').' '.(int)$countBetterCustomers.'
' : '') - .(Shop::isMultiShopActivated() ? '
'.$this->l('Shop:').' '.Shop::getInstance($customer->id_shop)->name : '').' + .(Shop::isFeatureActive() ? '
'.$this->l('Shop:').' '.Shop::getInstance($customer->id_shop)->name : '').'
@@ -691,13 +691,13 @@ class AdminCustomers extends AdminTab '.$this->l('Date').' '.$this->l('Name').' - '.((Shop::isMultiShopActivated())? ''.$this->l('Shop').'' : '').' + '.((Shop::isFeatureActive())? ''.$this->l('Shop').'' : '').' '; foreach ($referrers as $referrer) echo ' '.Tools::displayDate($referrer['date_add'], $this->context->language->id, true).' '.$referrer['name'].' - '.((Shop::isMultiShopActivated())? ''.$referrer['shop_name'].'' : '').' + '.((Shop::isFeatureActive())? ''.$referrer['shop_name'].'' : '').' '; echo '
 
'; } @@ -849,7 +849,7 @@ class AdminCustomers extends AdminTab echo '

'.$this->l('No group created').'

'; echo '
'; - if (Shop::isMultiShopActivated()) + if (Shop::isFeatureActive()) { $shops = Shop::getShops(); echo ' diff --git a/admin-dev/tabs/AdminDiscounts.php b/admin-dev/tabs/AdminDiscounts.php index 64fc5ed85..5f49c14f3 100644 --- a/admin-dev/tabs/AdminDiscounts.php +++ b/admin-dev/tabs/AdminDiscounts.php @@ -1,6 +1,6 @@ context = Context::getContext(); + $this->context = Context::getContext(); $this->table = 'discount'; $this->className = 'Discount'; $this->lang = true; @@ -42,12 +42,12 @@ class AdminDiscounts extends AdminTab $this->_join = 'LEFT JOIN `'._DB_PREFIX_.'currency` c ON (c.`id_currency` = a.`id_currency`) LEFT JOIN `'._DB_PREFIX_.'discount_type` dt ON (dt.`id_discount_type` = a.`id_discount_type`) LEFT JOIN `'._DB_PREFIX_.'discount_type_lang` dtl ON (dt.`id_discount_type` = dtl.`id_discount_type` AND dtl.`id_lang` = '.(int)$this->context->language->id.')'; - + $typesArray = array(); $types = Discount::getDiscountTypes($this->context->language->id); foreach ($types AS $type) $typesArray[$type['id_discount_type']] = $type['name']; - + $this->fieldsDisplay = array( 'id_discount' => array('title' => $this->l('ID'), 'align' => 'center', 'width' => 25), 'name' => array('title' => $this->l('Code'), 'width' => 85, 'prefix' => '', 'suffix' => '', 'filter_key' => 'a!name'), @@ -71,11 +71,11 @@ class AdminDiscounts extends AdminTab parent::__construct(); } - + protected function copyFromPost(&$object, $table) - { + { parent::copyFromPost($object, $table); - + $object->cumulable = (!isset($_POST['cumulable']) ? false : true); $object->cumulable_reduction = (!isset($_POST['cumulable_reduction']) ? false : true); } @@ -92,7 +92,7 @@ class AdminDiscounts extends AdminTab if (Tools::getValue('id_discount_type') == 0) $this->_errors[] = Tools::displayError('Please set a type for this voucher.'); if (Tools::getValue('id_discount_type') == Discount::AMOUNT AND Tools::getValue('id_currency') == 0) - $this->_errors[] = Tools::displayError('Please set a currency for this voucher.'); + $this->_errors[] = Tools::displayError('Please set a currency for this voucher.'); if ((Tools::getValue('id_discount_type') == Discount::PERCENT || Tools::getValue('id_discount_type') == 2) && !Tools::getValue('value')) $this->_errors[] = Tools::displayError('Please set a amount for this voucher.'); if (!Validate::isBool_Id(Tools::getValue('id_target'))) @@ -173,7 +173,7 @@ class AdminDiscounts extends AdminTab '{lastname}' => $customer->lastname, '{email}' => $customer->email, '{voucher_num}' => $object->name); - + @Mail::Send((int)Configuration::get('PS_LANG_DEFAULT'), 'voucher_new', Mail::l('New voucher'), $data, $customer->email, $customer->firstname.' '.$customer->lastname); } } @@ -181,7 +181,7 @@ class AdminDiscounts extends AdminTab { $customer = null; $customers = $group->getCustomers(); - + if ($customers) foreach ($customers as $customer) { @@ -190,11 +190,11 @@ class AdminDiscounts extends AdminTab '{lastname}' => $customer['lastname'], '{email}' => $customer['email'], '{voucher_num}' => $object->name); - + @Mail::Send((int)Configuration::get('PS_LANG_DEFAULT'), 'voucher_new', Mail::l('New voucher'), $data, $customer['email'], $customer['firstname'].' '.$customer['lastname']); } } - + Tools::redirectAdmin(self::$currentIndex.'&'.$this->identifier.'='.$object->id.'&conf=3&token='.$token); } } @@ -211,10 +211,10 @@ class AdminDiscounts extends AdminTab public function displayForm($isMainTab = true) { parent::displayForm(); - + if (!($obj = $this->loadObject(true))) return; - + echo '

'; includeDatepicker(array('date_from', 'date_to'), true); - echo ' + echo '
* @@ -472,7 +472,7 @@ class AdminDiscounts extends AdminTab

'.$this->l('Enable or disable voucher').'

'; - if (Shop::isMultiShopActivated()) + if (Shop::isFeatureActive()) { echo '
'; $this->displayAssoShop(); diff --git a/admin-dev/tabs/AdminEmployees.php b/admin-dev/tabs/AdminEmployees.php index 7678962f6..2e88c8059 100644 --- a/admin-dev/tabs/AdminEmployees.php +++ b/admin-dev/tabs/AdminEmployees.php @@ -176,7 +176,7 @@ class AdminEmployees extends AdminTab echo ''; echo ' *
'; - if (Shop::isMultiShopActivated()) + if (Shop::isFeatureActive()) { echo ' '; } - + public function display() { if (!Tools::isSubmit('viewreferrer')) echo $this->displayJavascript(); - + if ($this->enableCalendar()) { echo ' @@ -195,7 +195,7 @@ class AdminReferrers extends AdminTab parent::display(); echo '
 
'; } - + public function postProcess() { if ($this->enableCalendar()) @@ -213,14 +213,14 @@ class AdminReferrers extends AdminTab Referrer::refreshCache(); if (Tools::isSubmit('submitRefreshIndex')) Referrer::refreshIndex(); - + return parent::postProcess(); } - + public function displayForm($isMainTab = true) { parent::displayForm(); - + if (!($obj = $this->loadObject(true))) return; foreach (array('http_referer_like', 'http_referer_regexp', 'request_uri_like', 'request_uri_regexp') as $field) @@ -262,7 +262,7 @@ class AdminReferrers extends AdminTab

'.$this->l('Percent of the sales.').'

'; - if (Shop::isMultiShopActivated()) + if (Shop::isFeatureActive()) { echo '
'; $this->displayAssoShop(); @@ -370,7 +370,7 @@ class AdminReferrers extends AdminTab
'; } - + public function viewreferrer() { $referrer = new Referrer((int)(Tools::getValue('id_referrer'))); @@ -399,7 +399,7 @@ class AdminReferrers extends AdminTab echo ' } ) } - + function fillProducts(filter) { var form = document.layers ? document.forms.product : document.product; @@ -407,7 +407,7 @@ class AdminReferrers extends AdminTab $.getJSON("'.dirname(self::$currentIndex).'/ajax.php", {ajaxReferrers:1,ajaxFillProducts:1,id_employee:'.(int)$this->context->employee->id.',token:"'.Tools::getValue('token').'",id_lang:'.(int)$this->context->language->id.',filter:filter}, function(j) { - + form.selectProduct.length = j.length + 1; for (var i = 0; i < j.length; i++) { @@ -436,7 +436,7 @@ class AdminReferrers extends AdminTab updateConversionRate(0); '; } - + public function displayListContent($token = NULL) { $irow = 0; diff --git a/admin-dev/tabs/AdminScenes.php b/admin-dev/tabs/AdminScenes.php index 93e0adc45..a258bfa59 100644 --- a/admin-dev/tabs/AdminScenes.php +++ b/admin-dev/tabs/AdminScenes.php @@ -193,7 +193,7 @@ class AdminScenes extends AdminTab 'Uncheck All' => $this->l('Uncheck All') ); - if (Shop::isMultiShopActivated()) + if (Shop::isFeatureActive()) { echo '
'; $this->displayAssoShop(); @@ -215,7 +215,7 @@ class AdminScenes extends AdminTab { echo '
'.$this->l('Please add a picture to continue mapping the image...').'

'; echo '
'; - if (Shop::isMultiShopActivated()) + if (Shop::isFeatureActive()) { echo '
'; $this->displayAssoShop(); diff --git a/admin-dev/tabs/AdminSuppliers.php b/admin-dev/tabs/AdminSuppliers.php index f33efce66..8801a5032 100644 --- a/admin-dev/tabs/AdminSuppliers.php +++ b/admin-dev/tabs/AdminSuppliers.php @@ -1,6 +1,6 @@ delete = true; $this->_select = 'COUNT(p.`id_product`) AS products'; $this->_join = 'LEFT JOIN `'._DB_PREFIX_.'product` p ON (a.`id_supplier` = p.`id_supplier`)'; - + $this->fieldImageSettings = array('name' => 'logo', 'dir' => 'su'); - + $this->fieldsDisplay = array( 'id_supplier' => array('title' => $this->l('ID'), 'align' => 'center', 'width' => 25), 'name' => array('title' => $this->l('Name'), 'width' => 120), @@ -46,16 +46,16 @@ class AdminSuppliers extends AdminTab 'products' => array('title' => $this->l('Number of products'), 'align' => 'right', 'filter_type' => 'int', 'tmpTableFilter' => true), 'active' => array('title' => $this->l('Enabled'), 'width' => 25, 'align' => 'center', 'active' => 'status', 'type' => 'bool', 'orderby' => false) ); - + parent::__construct(); } - + public function viewsupplier() { if (!($supplier = $this->loadObject())) - return; + return; echo '

'.$supplier->name.'

'; - + $products = $supplier->getProductsLite($this->context->language->id); echo '

'.$this->l('Total products:').' '.sizeof($products).'

'; foreach ($products AS $product) @@ -118,11 +118,11 @@ class AdminSuppliers extends AdminTab } } } - + public function displayForm($isMainTab = true) { parent::displayForm(); - + if (!($supplier = $this->loadObject(true))) return; @@ -144,7 +144,7 @@ class AdminSuppliers extends AdminTab '.$this->l('Invalid characters:').' <>;=#{} 

'.$this->l('Will appear in supplier list').'

-
'; +
'; $this->displayFlags($this->_languages, $this->_defaultFormLanguage, $langtags, 'description'); echo '
@@ -193,7 +193,7 @@ class AdminSuppliers extends AdminTab getFieldValue($supplier, 'active') ? 'checked="checked" ' : '').'/> '; - if (Shop::isMultiShopActivated()) + if (Shop::isFeatureActive()) { echo '
'; $this->displayAssoShop('group_shop'); @@ -207,7 +207,7 @@ class AdminSuppliers extends AdminTab '; } - + public function afterImageUpload() { /* Generate image with differents size */ diff --git a/admin-dev/tabs/AdminZones.php b/admin-dev/tabs/AdminZones.php index c86db428a..4fa3ad8ba 100644 --- a/admin-dev/tabs/AdminZones.php +++ b/admin-dev/tabs/AdminZones.php @@ -1,6 +1,6 @@ lang = false; $this->edit = true; $this->delete = true; - + $this->fieldsDisplay = array( 'id_zone' => array('title' => $this->l('ID'), 'align' => 'center', 'width' => 25), 'name' => array('title' => $this->l('Zone'), 'width' => 150), 'active' => array('title' => $this->l('Enabled'), 'align' => 'center', 'active' => 'status', 'type' => 'bool', 'orderby' => false) ); - + parent::__construct(); } - + public function displayForm($isMainTab = true) { parent::displayForm(); - + if (!($obj = $this->loadObject(true))) return; echo ' @@ -70,7 +70,7 @@ class AdminZones extends AdminTab

'.$this->l('Allow or disallow shipping to this zone').'

'; - if (Shop::isMultiShopActivated()) + if (Shop::isFeatureActive()) { echo '
'; $this->displayAssoShop('group_shop'); diff --git a/classes/AdminController.php b/classes/AdminController.php index 96570f03d..ed49f3be7 100644 --- a/classes/AdminController.php +++ b/classes/AdminController.php @@ -225,7 +225,7 @@ class AdminControllerCore extends Controller if ($controller == 'AdminHome') $_POST['token'] = $this->token; - if (!Shop::isMultiShopActivated()) + if (!Shop::isFeatureActive()) $this->shopLinkType = ''; // Get the name of the folder containing the custom tpl files @@ -824,7 +824,7 @@ class AdminControllerCore extends Controller public function initHeader() { // Shop context - if (Shop::isMultiShopActivated()) + if (Shop::isFeatureActive()) { if (Context::shop() == Shop::CONTEXT_ALL) { @@ -854,7 +854,7 @@ class AdminControllerCore extends Controller } // Multishop - $is_multishop = Shop::isMultiShopActivated();// && Context::shop() != Shop::CONTEXT_ALL; + $is_multishop = Shop::isFeatureActive();// && Context::shop() != Shop::CONTEXT_ALL; /*if ($is_multishop) { if (Context::shop() == Shop::CONTEXT_GROUP) @@ -959,8 +959,8 @@ class AdminControllerCore extends Controller 'search_type' => Tools::getValue('bo_search_type'), 'bo_query' => Tools::safeOutput(Tools::stripslashes(Tools::getValue('bo_query'))), 'quick_access' => $quick_access, - 'multi_shop' => Shop::isMultiShopActivated(), - 'shop_list' => (Shop::isMultiShopActivated() ? generateShopList() : null), //@TODO refacto + 'multi_shop' => Shop::isFeatureActive(), + 'shop_list' => (Shop::isFeatureActive() ? generateShopList() : null), //@TODO refacto 'tab' => $tab, 'current_parent_id' => (int)Tab::getCurrentParentId(), 'tabs' => $tabs, @@ -1208,7 +1208,7 @@ class AdminControllerCore extends Controller $this->context->currency = new Currency(Configuration::get('PS_CURRENCY_DEFAULT')); // Change shop context ? - if (Shop::isMultiShopActivated() && Tools::getValue('setShopContext') !== false) + if (Shop::isFeatureActive() && Tools::getValue('setShopContext') !== false) { $this->context->cookie->shopContext = Tools::getValue('setShopContext'); $url = parse_url($_SERVER['REQUEST_URI']); @@ -1449,7 +1449,7 @@ class AdminControllerCore extends Controller $this->_group .= ', a.'.pSQL($this->identifier); $test_join = !preg_match('#`?'.preg_quote(_DB_PREFIX_.$this->table.'_'.$filter_key).'`? *sa#', $this->_join); - if (Shop::isMultiShopActivated() && Context::shop() != Shop::CONTEXT_ALL && $test_join) + if (Shop::isFeatureActive() && Context::shop() != Shop::CONTEXT_ALL && $test_join) { $filter_shop = ' JOIN `'._DB_PREFIX_.$this->table.'_'.$filter_key.'` sa '; $filter_shop .= 'ON (sa.'.$this->identifier.' = a.'.$this->identifier.' AND sa.id_'.$filter_key.' IN ('.implode(', ', $idenfier_shop).'))'; @@ -1729,7 +1729,7 @@ class AdminControllerCore extends Controller protected function updateAssoShop($id_object = false) { - if (!Shop::isMultiShopActivated()) + if (!Shop::isFeatureActive()) return; $shop_asso = Shop::getAssoTables(); @@ -1835,7 +1835,7 @@ class AdminControllerCore extends Controller if (isset($options['visibility']) && $options['visibility'] > Context::getContext()->shop->getContextType()) continue; - if (Shop::isMultiShopActivated() && isset($_POST['configUseDefault'][$key])) + if (Shop::isFeatureActive() && isset($_POST['configUseDefault'][$key])) { Configuration::deleteFromContext($key); continue; diff --git a/classes/AdminTab.php b/classes/AdminTab.php index 33309f5e3..3d59c4697 100644 --- a/classes/AdminTab.php +++ b/classes/AdminTab.php @@ -226,7 +226,7 @@ abstract class AdminTabCore // $className = 'AdminCatalog'; $this->token = Tools::getAdminToken($className.(int)$this->id.(int)$this->context->employee->id); - if (!Shop::isMultiShopActivated()) + if (!Shop::isFeatureActive()) $this->shopLinkType = ''; } @@ -898,7 +898,7 @@ abstract class AdminTabCore protected function updateAssoShop($id_object = false) { - if (!Shop::isMultiShopActivated()) + if (!Shop::isFeatureActive()) return ; if(!$assos = self::getAssoShop($this->table, $id_object)) @@ -985,7 +985,7 @@ abstract class AdminTabCore if (isset($options['visibility']) && $options['visibility'] > Context::getContext()->shop->getContextType()) continue; - if (Shop::isMultiShopActivated() && isset($_POST['configUseDefault'][$key])) + if (Shop::isFeatureActive() && isset($_POST['configUseDefault'][$key])) { Configuration::deleteFromContext($key); continue; @@ -1337,7 +1337,7 @@ abstract class AdminTabCore else if (!preg_match('#(\s|,)\s*a\.`?'.pSQL($this->identifier).'`?(\s|,|$)#', $this->_group)) $this->_group .= ', a.'.pSQL($this->identifier); - if (Shop::isMultiShopActivated() && Context::shop() != Shop::CONTEXT_ALL && !preg_match('#`?'.preg_quote(_DB_PREFIX_.$this->table.'_'.$filterKey).'`? *sa#', $this->_join)) + if (Shop::isFeatureActive() && Context::shop() != Shop::CONTEXT_ALL && !preg_match('#`?'.preg_quote(_DB_PREFIX_.$this->table.'_'.$filterKey).'`? *sa#', $this->_join)) $filterShop = 'JOIN `'._DB_PREFIX_.$this->table.'_'.$filterKey.'` sa ON (sa.'.$this->identifier.' = a.'.$this->identifier.' AND sa.id_'.$filterKey.' IN ('.implode(', ', $idenfierShop).'))'; } @@ -1871,7 +1871,7 @@ abstract class AdminTabCore // Check if var is invisible (can't edit it in current shop context), or disable (use default value for multishop) $isDisabled = $isInvisible = false; - if (Shop::isMultiShopActivated()) + if (Shop::isFeatureActive()) { if (isset($field['visibility']) && $field['visibility'] > $this->context->shop->getContextType()) { @@ -1907,7 +1907,7 @@ abstract class AdminTabCore $this->$method($key, $field, $value); // Multishop default value - if (Shop::isMultiShopActivated() && Context::shop() != Shop::CONTEXT_ALL && !$isInvisible) + if (Shop::isFeatureActive() && Context::shop() != Shop::CONTEXT_ALL && !$isInvisible) echo '