[*] FO BO MO : rename function isMultiShopActivated by isFeatureActive
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@9444 b9a71923-0436-4b27-9f14-aed3839534dd
This commit is contained in:
@@ -501,7 +501,7 @@ function runAdminTab($ajaxMode = false)
|
|||||||
<a href="?token='.Tools::getAdminToken($tab.intval(Tab::getIdFromClassName($tab)).(int)Context::getContext()->employee->id).'">'.translate('Back Office').'</a>
|
<a href="?token='.Tools::getAdminToken($tab.intval(Tab::getIdFromClassName($tab)).(int)Context::getContext()->employee->id).'">'.translate('Back Office').'</a>
|
||||||
'.$bread.'</div>';
|
'.$bread.'</div>';
|
||||||
|
|
||||||
if (!$ajaxMode && Shop::isMultiShopActivated() && Context::shop() != Shop::CONTEXT_ALL)
|
if (!$ajaxMode && Shop::isFeatureActive() && Context::shop() != Shop::CONTEXT_ALL)
|
||||||
{
|
{
|
||||||
echo '<div class="multishop_info">';
|
echo '<div class="multishop_info">';
|
||||||
if (Context::shop() == Shop::CONTEXT_GROUP)
|
if (Context::shop() == Shop::CONTEXT_GROUP)
|
||||||
|
|||||||
@@ -137,7 +137,7 @@ echo '
|
|||||||
{
|
{
|
||||||
var hints = $(\'.translatable span.hint\');
|
var hints = $(\'.translatable span.hint\');
|
||||||
';
|
';
|
||||||
if (Shop::isMultiShopActivated())
|
if (Shop::isFeatureActive())
|
||||||
{
|
{
|
||||||
if (Context::shop() == Shop::CONTEXT_ALL)
|
if (Context::shop() == Shop::CONTEXT_ALL)
|
||||||
$youEditFieldFor = translate('A modification of this field will be applied for all shops');
|
$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 ' </select>
|
echo ' </select>
|
||||||
</div>';
|
</div>';
|
||||||
|
|
||||||
if (Shop::isMultiShopActivated())
|
if (Shop::isFeatureActive())
|
||||||
echo '<div id="header_shoplist">'.translate('Select your shop:').' '.generateShopList().'</div>';
|
echo '<div id="header_shoplist">'.translate('Select your shop:').' '.generateShopList().'</div>';
|
||||||
|
|
||||||
echo '<div class="flatclear"> </div>';
|
echo '<div class="flatclear"> </div>';
|
||||||
|
|||||||
+1
-1
@@ -82,7 +82,7 @@ if (empty($context->employee->bo_theme) OR !file_exists($path.$context->employee
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Change shop context ?
|
// Change shop context ?
|
||||||
if (Shop::isMultiShopActivated() && Tools::getValue('setShopContext') !== false)
|
if (Shop::isFeatureActive() && Tools::getValue('setShopContext') !== false)
|
||||||
{
|
{
|
||||||
$context->cookie->shopContext = Tools::getValue('setShopContext');
|
$context->cookie->shopContext = Tools::getValue('setShopContext');
|
||||||
$url = parse_url($_SERVER['REQUEST_URI']);
|
$url = parse_url($_SERVER['REQUEST_URI']);
|
||||||
|
|||||||
@@ -94,7 +94,7 @@ class AdminAttributes extends AdminTab
|
|||||||
echo '
|
echo '
|
||||||
</select><sup> *</sup>
|
</select><sup> *</sup>
|
||||||
</div>';
|
</div>';
|
||||||
if (Shop::isMultiShopActivated())
|
if (Shop::isFeatureActive())
|
||||||
{
|
{
|
||||||
echo '<label>'.$this->l('GroupShop association:').'</label><div class="margin-form">';
|
echo '<label>'.$this->l('GroupShop association:').'</label><div class="margin-form">';
|
||||||
$this->displayAssoShop('group_shop');
|
$this->displayAssoShop('group_shop');
|
||||||
|
|||||||
@@ -259,7 +259,7 @@ class AdminAttributesGroups extends AdminTab
|
|||||||
</select>
|
</select>
|
||||||
<p>'.$this->l('Choose the type of the attribute group').'</p>
|
<p>'.$this->l('Choose the type of the attribute group').'</p>
|
||||||
</div>';
|
</div>';
|
||||||
if (Shop::isMultiShopActivated())
|
if (Shop::isFeatureActive())
|
||||||
{
|
{
|
||||||
echo '<label>'.$this->l('GroupShop association:').'</label><div class="margin-form">';
|
echo '<label>'.$this->l('GroupShop association:').'</label><div class="margin-form">';
|
||||||
$this->displayAssoShop('group_shop');
|
$this->displayAssoShop('group_shop');
|
||||||
|
|||||||
@@ -151,7 +151,7 @@ class AdminCMS extends AdminTab
|
|||||||
<input type="radio" name="active" id="active_off" onclick="toggleDraftWarning(true);" value="0" '.(!$this->getFieldValue($obj, 'active') ? 'checked="checked" ' : '').'/>
|
<input type="radio" name="active" id="active_off" onclick="toggleDraftWarning(true);" value="0" '.(!$this->getFieldValue($obj, 'active') ? 'checked="checked" ' : '').'/>
|
||||||
<label class="t" for="active_off"> <img src="../img/admin/disabled.gif" alt="'.$this->l('Disabled').'" title="'.$this->l('Disabled').'" /></label>
|
<label class="t" for="active_off"> <img src="../img/admin/disabled.gif" alt="'.$this->l('Disabled').'" title="'.$this->l('Disabled').'" /></label>
|
||||||
</div>';
|
</div>';
|
||||||
if (Shop::isMultiShopActivated())
|
if (Shop::isFeatureActive())
|
||||||
{
|
{
|
||||||
echo '<label>'.$this->l('Shop association:').'</label><div class="margin-form">';
|
echo '<label>'.$this->l('Shop association:').'</label><div class="margin-form">';
|
||||||
$this->displayAssoShop();
|
$this->displayAssoShop();
|
||||||
|
|||||||
@@ -255,7 +255,7 @@ class AdminCarriers extends AdminTab
|
|||||||
echo '</div>';
|
echo '</div>';
|
||||||
}
|
}
|
||||||
echo '</div>';
|
echo '</div>';
|
||||||
if (Shop::isMultiShopActivated())
|
if (Shop::isFeatureActive())
|
||||||
{
|
{
|
||||||
echo '<label>'.$this->l('Shop association:').'</label><div class="margin-form">';
|
echo '<label>'.$this->l('Shop association:').'</label><div class="margin-form">';
|
||||||
$this->displayAssoShop();
|
$this->displayAssoShop();
|
||||||
|
|||||||
@@ -334,7 +334,7 @@ class AdminCountries extends AdminTab
|
|||||||
<input type="radio" name="display_tax_label" id="display_tax_label_off" value="0" '.((!$this->getFieldValue($obj, 'display_tax_label') AND $obj->id) ? 'checked="checked" ' : '').'/>
|
<input type="radio" name="display_tax_label" id="display_tax_label_off" value="0" '.((!$this->getFieldValue($obj, 'display_tax_label') AND $obj->id) ? 'checked="checked" ' : '').'/>
|
||||||
<label class="t" for="display_tax_label_off"> <img src="../img/admin/disabled.gif" alt="" title="" />'.$this->l('No').'</label>
|
<label class="t" for="display_tax_label_off"> <img src="../img/admin/disabled.gif" alt="" title="" />'.$this->l('No').'</label>
|
||||||
</div>';
|
</div>';
|
||||||
if (Shop::isMultiShopActivated())
|
if (Shop::isFeatureActive())
|
||||||
{
|
{
|
||||||
echo '<label>'.$this->l('Shop association:').'</label><div class="margin-form">';
|
echo '<label>'.$this->l('Shop association:').'</label><div class="margin-form">';
|
||||||
$this->displayAssoShop();
|
$this->displayAssoShop();
|
||||||
|
|||||||
@@ -316,7 +316,7 @@ class AdminCustomers extends AdminTab
|
|||||||
'.$this->l('Registration date:').' '.Tools::displayDate($customer->date_add, $this->context->language->id, true).'<br />
|
'.$this->l('Registration date:').' '.Tools::displayDate($customer->date_add, $this->context->language->id, true).'<br />
|
||||||
'.$this->l('Last visit:').' '.($customerStats['last_visit'] ? Tools::displayDate($customerStats['last_visit'], $this->context->language->id, true) : $this->l('never')).'<br />
|
'.$this->l('Last visit:').' '.($customerStats['last_visit'] ? Tools::displayDate($customerStats['last_visit'], $this->context->language->id, true) : $this->l('never')).'<br />
|
||||||
'.($countBetterCustomers != '-' ? $this->l('Rank: #').' '.(int)$countBetterCustomers.'<br />' : '')
|
'.($countBetterCustomers != '-' ? $this->l('Rank: #').' '.(int)$countBetterCustomers.'<br />' : '')
|
||||||
.(Shop::isMultiShopActivated() ? '<br />'.$this->l('Shop:').' '.Shop::getInstance($customer->id_shop)->name : '').'
|
.(Shop::isFeatureActive() ? '<br />'.$this->l('Shop:').' '.Shop::getInstance($customer->id_shop)->name : '').'
|
||||||
</fieldset>
|
</fieldset>
|
||||||
<fieldset style="width:300px;float:left;margin-left:50px">
|
<fieldset style="width:300px;float:left;margin-left:50px">
|
||||||
<div style="float: right">
|
<div style="float: right">
|
||||||
@@ -691,13 +691,13 @@ class AdminCustomers extends AdminTab
|
|||||||
<tr>
|
<tr>
|
||||||
<th style="width: 200px">'.$this->l('Date').'</th>
|
<th style="width: 200px">'.$this->l('Date').'</th>
|
||||||
<th style="width: 200px">'.$this->l('Name').'</th>
|
<th style="width: 200px">'.$this->l('Name').'</th>
|
||||||
'.((Shop::isMultiShopActivated())? '<th style="width: 200px">'.$this->l('Shop').'</th>' : '').'
|
'.((Shop::isFeatureActive())? '<th style="width: 200px">'.$this->l('Shop').'</th>' : '').'
|
||||||
</tr>';
|
</tr>';
|
||||||
foreach ($referrers as $referrer)
|
foreach ($referrers as $referrer)
|
||||||
echo '<tr>
|
echo '<tr>
|
||||||
<td>'.Tools::displayDate($referrer['date_add'], $this->context->language->id, true).'</td>
|
<td>'.Tools::displayDate($referrer['date_add'], $this->context->language->id, true).'</td>
|
||||||
<td>'.$referrer['name'].'</td>
|
<td>'.$referrer['name'].'</td>
|
||||||
'.((Shop::isMultiShopActivated())? '<td>'.$referrer['shop_name'].'</td>' : '').'
|
'.((Shop::isFeatureActive())? '<td>'.$referrer['shop_name'].'</td>' : '').'
|
||||||
</tr>';
|
</tr>';
|
||||||
echo '</table><div class="clear"> </div>';
|
echo '</table><div class="clear"> </div>';
|
||||||
}
|
}
|
||||||
@@ -849,7 +849,7 @@ class AdminCustomers extends AdminTab
|
|||||||
echo '<p>'.$this->l('No group created').'</p>';
|
echo '<p>'.$this->l('No group created').'</p>';
|
||||||
echo '
|
echo '
|
||||||
</div>';
|
</div>';
|
||||||
if (Shop::isMultiShopActivated())
|
if (Shop::isFeatureActive())
|
||||||
{
|
{
|
||||||
$shops = Shop::getShops();
|
$shops = Shop::getShops();
|
||||||
echo '
|
echo '
|
||||||
|
|||||||
@@ -472,7 +472,7 @@ class AdminDiscounts extends AdminTab
|
|||||||
<label class="t" for="active_off"> <img src="../img/admin/disabled.gif" alt="'.$this->l('Disabled').'" title="'.$this->l('Disabled').'" /></label>
|
<label class="t" for="active_off"> <img src="../img/admin/disabled.gif" alt="'.$this->l('Disabled').'" title="'.$this->l('Disabled').'" /></label>
|
||||||
<p>'.$this->l('Enable or disable voucher').'</p>
|
<p>'.$this->l('Enable or disable voucher').'</p>
|
||||||
</div>';
|
</div>';
|
||||||
if (Shop::isMultiShopActivated())
|
if (Shop::isFeatureActive())
|
||||||
{
|
{
|
||||||
echo '<label>'.$this->l('Shop association:').'</label><div class="margin-form">';
|
echo '<label>'.$this->l('Shop association:').'</label><div class="margin-form">';
|
||||||
$this->displayAssoShop();
|
$this->displayAssoShop();
|
||||||
|
|||||||
@@ -176,7 +176,7 @@ class AdminEmployees extends AdminTab
|
|||||||
echo '<option value="'.$profile['id_profile'].'"'.($profile['id_profile'] === $this->getFieldValue($obj, 'id_profile') ? ' selected="selected"' : '').'>'.$profile['name'].'</option>';
|
echo '<option value="'.$profile['id_profile'].'"'.($profile['id_profile'] === $this->getFieldValue($obj, 'id_profile') ? ' selected="selected"' : '').'>'.$profile['name'].'</option>';
|
||||||
echo '</select> <sup>*</sup>
|
echo '</select> <sup>*</sup>
|
||||||
</div>';
|
</div>';
|
||||||
if (Shop::isMultiShopActivated())
|
if (Shop::isFeatureActive())
|
||||||
{
|
{
|
||||||
echo '
|
echo '
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
@@ -265,7 +265,7 @@ class AdminEmployees extends AdminTab
|
|||||||
$assos = self::getAssoShop($this->table);
|
$assos = self::getAssoShop($this->table);
|
||||||
|
|
||||||
if (count($assos[0]) == 0 && $this->table = 'employee')
|
if (count($assos[0]) == 0 && $this->table = 'employee')
|
||||||
if (Shop::isMultiShopActivated() && _PS_ADMIN_PROFILE_ != $_POST['id_profile'])
|
if (Shop::isFeatureActive() && _PS_ADMIN_PROFILE_ != $_POST['id_profile'])
|
||||||
$this->_errors[] = Tools::displayError('The employee must be associated with at least one shop');
|
$this->_errors[] = Tools::displayError('The employee must be associated with at least one shop');
|
||||||
}
|
}
|
||||||
return parent::postProcess();
|
return parent::postProcess();
|
||||||
|
|||||||
@@ -204,7 +204,7 @@ class AdminFeatures extends AdminTab
|
|||||||
echo '
|
echo '
|
||||||
<div class="clear"></div>
|
<div class="clear"></div>
|
||||||
</div>';
|
</div>';
|
||||||
if (Shop::isMultiShopActivated())
|
if (Shop::isFeatureActive())
|
||||||
{
|
{
|
||||||
echo '<label>'.$this->l('GroupShop association:').'</label><div class="margin-form">';
|
echo '<label>'.$this->l('GroupShop association:').'</label><div class="margin-form">';
|
||||||
$this->displayAssoShop('group_shop');
|
$this->displayAssoShop('group_shop');
|
||||||
|
|||||||
@@ -124,7 +124,7 @@ class AdminGroups extends AdminTab
|
|||||||
<p>'.$this->l('How the prices are displayed on order summary for this customer group (tax included or excluded).').'</p>
|
<p>'.$this->l('How the prices are displayed on order summary for this customer group (tax included or excluded).').'</p>
|
||||||
</div>
|
</div>
|
||||||
<div class="clear"> </div>';
|
<div class="clear"> </div>';
|
||||||
if (Shop::isMultiShopActivated())
|
if (Shop::isFeatureActive())
|
||||||
{
|
{
|
||||||
echo '<label>'.$this->l('GroupShop association:').'</label><div class="margin-form">';
|
echo '<label>'.$this->l('GroupShop association:').'</label><div class="margin-form">';
|
||||||
$this->displayAssoShop('group_shop');
|
$this->displayAssoShop('group_shop');
|
||||||
|
|||||||
@@ -791,7 +791,7 @@ class AdminImport extends AdminTab
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
// Associate product to shop
|
// Associate product to shop
|
||||||
if (Shop::isMultiShopActivated() && $product->shop)
|
if (Shop::isFeatureActive() && $product->shop)
|
||||||
{
|
{
|
||||||
$product->shop = explode(',', $product->shop);
|
$product->shop = explode(',', $product->shop);
|
||||||
$shops = array();
|
$shops = array();
|
||||||
@@ -1067,7 +1067,7 @@ class AdminImport extends AdminTab
|
|||||||
$customer->passwd = md5(_COOKIE_KEY_.$customer->passwd);
|
$customer->passwd = md5(_COOKIE_KEY_.$customer->passwd);
|
||||||
|
|
||||||
// Associate product to shop
|
// Associate product to shop
|
||||||
if (Shop::isMultiShopActivated() && $customer->id_shop)
|
if (Shop::isFeatureActive() && $customer->id_shop)
|
||||||
{
|
{
|
||||||
if (!is_numeric($customer->id_shop))
|
if (!is_numeric($customer->id_shop))
|
||||||
$customer->id_shop = Shop::getIdByName($customer->id_shop);
|
$customer->id_shop = Shop::getIdByName($customer->id_shop);
|
||||||
@@ -1259,7 +1259,7 @@ class AdminImport extends AdminTab
|
|||||||
if ($res)
|
if ($res)
|
||||||
{
|
{
|
||||||
// Associate supplier to group shop
|
// Associate supplier to group shop
|
||||||
if (Shop::isMultiShopActivated() && $manufacturer->shop)
|
if (Shop::isFeatureActive() && $manufacturer->shop)
|
||||||
{
|
{
|
||||||
$manufacturer->shop = explode(',', $manufacturer->shop);
|
$manufacturer->shop = explode(',', $manufacturer->shop);
|
||||||
$shops = array();
|
$shops = array();
|
||||||
@@ -1316,7 +1316,7 @@ class AdminImport extends AdminTab
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
// Associate supplier to group shop
|
// Associate supplier to group shop
|
||||||
if (Shop::isMultiShopActivated() && $supplier->shop)
|
if (Shop::isFeatureActive() && $supplier->shop)
|
||||||
{
|
{
|
||||||
$supplier->shop = explode(',', $supplier->shop);
|
$supplier->shop = explode(',', $supplier->shop);
|
||||||
$shops = array();
|
$shops = array();
|
||||||
|
|||||||
@@ -388,7 +388,7 @@ class AdminLanguages extends AdminTab
|
|||||||
<p>'.$this->l('Allow or disallow this language to be selected by the customer').'</p>
|
<p>'.$this->l('Allow or disallow this language to be selected by the customer').'</p>
|
||||||
</div>
|
</div>
|
||||||
<p id="resultCheckLangPack"><img src="'._PS_IMG_.'admin/ajax-loader.gif" alt="" /> '.$this->l('Check if a language pack is available for this ISO code...').'</p>';
|
<p id="resultCheckLangPack"><img src="'._PS_IMG_.'admin/ajax-loader.gif" alt="" /> '.$this->l('Check if a language pack is available for this ISO code...').'</p>';
|
||||||
if (Shop::isMultiShopActivated())
|
if (Shop::isFeatureActive())
|
||||||
{
|
{
|
||||||
echo '<label>'.$this->l('Shop association:').'</label><div class="margin-form">';
|
echo '<label>'.$this->l('Shop association:').'</label><div class="margin-form">';
|
||||||
$this->displayAssoShop();
|
$this->displayAssoShop();
|
||||||
|
|||||||
@@ -185,7 +185,7 @@ class AdminManufacturers extends AdminTab
|
|||||||
<input type="radio" name="active" id="active_off" value="0" '.(!$this->getFieldValue($manufacturer, 'active') ? 'checked="checked" ' : '').'/>
|
<input type="radio" name="active" id="active_off" value="0" '.(!$this->getFieldValue($manufacturer, 'active') ? 'checked="checked" ' : '').'/>
|
||||||
<label class="t" for="active_off"> <img src="../img/admin/disabled.gif" alt="'.$this->l('Disabled').'" title="'.$this->l('Disabled').'" /></label>
|
<label class="t" for="active_off"> <img src="../img/admin/disabled.gif" alt="'.$this->l('Disabled').'" title="'.$this->l('Disabled').'" /></label>
|
||||||
</div>';
|
</div>';
|
||||||
if (Shop::isMultiShopActivated())
|
if (Shop::isFeatureActive())
|
||||||
{
|
{
|
||||||
echo '<label>'.$this->l('GroupShop association:').'</label><div class="margin-form">';
|
echo '<label>'.$this->l('GroupShop association:').'</label><div class="margin-form">';
|
||||||
$this->displayAssoShop('group_shop');
|
$this->displayAssoShop('group_shop');
|
||||||
|
|||||||
@@ -344,7 +344,7 @@ class AdminModules extends AdminTab
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
// If we install a module, force temporary global context for multishop
|
// If we install a module, force temporary global context for multishop
|
||||||
if (Shop::isMultiShopActivated() && Context::shop() != Shop::CONTEXT_ALL)
|
if (Shop::isFeatureActive() && Context::shop() != Shop::CONTEXT_ALL)
|
||||||
{
|
{
|
||||||
Context::getContext()->tmpOldShop = clone(Context::getContext()->shop);
|
Context::getContext()->tmpOldShop = clone(Context::getContext()->shop);
|
||||||
Context::getContext()->shop = new Shop();
|
Context::getContext()->shop = new Shop();
|
||||||
@@ -371,7 +371,7 @@ class AdminModules extends AdminTab
|
|||||||
</tr>';
|
</tr>';
|
||||||
|
|
||||||
// Display checkbox in toolbar if multishop
|
// Display checkbox in toolbar if multishop
|
||||||
if (Shop::isMultiShopActivated())
|
if (Shop::isFeatureActive())
|
||||||
{
|
{
|
||||||
$activateOnclick = 'onclick="location.href = \''.$this->getCurrentUrl('enable').'&enable=\'+(($(this).attr(\'checked\')) ? 1 : 0)"';
|
$activateOnclick = 'onclick="location.href = \''.$this->getCurrentUrl('enable').'&enable=\'+(($(this).attr(\'checked\')) ? 1 : 0)"';
|
||||||
$toolbar .= '<tr>
|
$toolbar .= '<tr>
|
||||||
@@ -399,7 +399,7 @@ class AdminModules extends AdminTab
|
|||||||
elseif ($echo === false)
|
elseif ($echo === false)
|
||||||
$module_errors[] = $name;
|
$module_errors[] = $name;
|
||||||
|
|
||||||
if (Shop::isMultiShopActivated() && Context::shop() != Shop::CONTEXT_ALL && isset(Context::getContext()->tmpOldShop))
|
if (Shop::isFeatureActive() && Context::shop() != Shop::CONTEXT_ALL && isset(Context::getContext()->tmpOldShop))
|
||||||
{
|
{
|
||||||
Context::getContext()->shop = clone(Context::getContext()->tmpOldShop);
|
Context::getContext()->shop = clone(Context::getContext()->tmpOldShop);
|
||||||
unset(Context::getContext()->tmpOldShop);
|
unset(Context::getContext()->tmpOldShop);
|
||||||
@@ -1035,12 +1035,12 @@ class AdminModules extends AdminTab
|
|||||||
$return = '';
|
$return = '';
|
||||||
$href = self::$currentIndex.'&token='.$this->token.'&module_name='.urlencode($module->name).'&tab_module='.$module->tab;
|
$href = self::$currentIndex.'&token='.$this->token.'&module_name='.urlencode($module->name).'&tab_module='.$module->tab;
|
||||||
if ($module->id)
|
if ($module->id)
|
||||||
$return .= '<a class="action_module" '.($module->active && method_exists($module, 'onclickOption')? 'onclick="'.$module->onclickOption('desactive', $href).'"' : '').' href="'.self::$currentIndex.'&token='.$this->token.'&module_name='.urlencode($module->name).'&'.($module->active ? 'enable=0' : 'enable=1').'&tab_module='.$module->tab.'" '.((Shop::isMultiShopActivated()) ? 'title="'.htmlspecialchars($module->active ? $this->l('Disable this module') : $this->l('Enable this module for all shops')).'"' : '').'>'.($module->active ? $this->l('Disable') : $this->l('Enable')).'</a> ';
|
$return .= '<a class="action_module" '.($module->active && method_exists($module, 'onclickOption')? 'onclick="'.$module->onclickOption('desactive', $href).'"' : '').' href="'.self::$currentIndex.'&token='.$this->token.'&module_name='.urlencode($module->name).'&'.($module->active ? 'enable=0' : 'enable=1').'&tab_module='.$module->tab.'" '.((Shop::isFeatureActive()) ? 'title="'.htmlspecialchars($module->active ? $this->l('Disable this module') : $this->l('Enable this module for all shops')).'"' : '').'>'.($module->active ? $this->l('Disable') : $this->l('Enable')).'</a> ';
|
||||||
|
|
||||||
if ($module->id AND $module->active)
|
if ($module->id AND $module->active)
|
||||||
$return .= '<a class="action_module" '.(method_exists($module, 'onclickOption')? 'onclick="'.$module->onclickOption('reset', $href).'"' : '').' href="'.self::$currentIndex.'&token='.$this->token.'&module_name='.urlencode($module->name).'&reset&tab_module='.$module->tab.'">'.$this->l('Reset').'</a> ';
|
$return .= '<a class="action_module" '.(method_exists($module, 'onclickOption')? 'onclick="'.$module->onclickOption('reset', $href).'"' : '').' href="'.self::$currentIndex.'&token='.$this->token.'&module_name='.urlencode($module->name).'&reset&tab_module='.$module->tab.'">'.$this->l('Reset').'</a> ';
|
||||||
|
|
||||||
if ($module->id AND (method_exists($module, 'getContent') OR (isset($module->is_configurable) AND $module->is_configurable) OR Shop::isMultiShopActivated()))
|
if ($module->id AND (method_exists($module, 'getContent') OR (isset($module->is_configurable) AND $module->is_configurable) OR Shop::isFeatureActive()))
|
||||||
$return .= '<a class="action_module" '.(method_exists($module, 'onclickOption')? 'onclick="'.$module->onclickOption('configure', $href).'"' : '').' href="'.self::$currentIndex.'&configure='.urlencode($module->name).'&token='.$this->token.'&tab_module='.$module->tab.'&module_name='.urlencode($module->name).'">'.$this->l('Configure').'</a> ';
|
$return .= '<a class="action_module" '.(method_exists($module, 'onclickOption')? 'onclick="'.$module->onclickOption('configure', $href).'"' : '').' href="'.self::$currentIndex.'&configure='.urlencode($module->name).'&token='.$this->token.'&tab_module='.$module->tab.'&module_name='.urlencode($module->name).'">'.$this->l('Configure').'</a> ';
|
||||||
|
|
||||||
$hrefDelete = self::$currentIndex.'&deleteModule='.urlencode($module->name).'&token='.$this->token.'&tab_module='.$module->tab.'&module_name='.urlencode($module->name);
|
$hrefDelete = self::$currentIndex.'&deleteModule='.urlencode($module->name).'&token='.$this->token.'&tab_module='.$module->tab.'&module_name='.urlencode($module->name);
|
||||||
|
|||||||
@@ -261,12 +261,12 @@ class AdminModulesPositions extends AdminTab
|
|||||||
</form>
|
</form>
|
||||||
|
|
||||||
<fieldset style="width:250px;float:right"><legend>'.$this->l('Live edit').'</legend>';
|
<fieldset style="width:250px;float:right"><legend>'.$this->l('Live edit').'</legend>';
|
||||||
if (Shop::isMultiShopActivated() && $this->context->shop->getContextType() != Shop::CONTEXT_SHOP)
|
if (Shop::isFeatureActive() && $this->context->shop->getContextType() != Shop::CONTEXT_SHOP)
|
||||||
echo '<p>'.$this->l('You have to select a shop to use live edit').'</p>';
|
echo '<p>'.$this->l('You have to select a shop to use live edit').'</p>';
|
||||||
else
|
else
|
||||||
echo '<p>'.$this->l('By clicking here you will be redirected to the front office of your shop to move and delete modules directly.').'</p>
|
echo '<p>'.$this->l('By clicking here you will be redirected to the front office of your shop to move and delete modules directly.').'</p>
|
||||||
<br>
|
<br>
|
||||||
<a href="'.$this->context->link->getPageLink('index', false, null, 'live_edit&ad='.$admin_dir.'&liveToken='.sha1($admin_dir._COOKIE_KEY_).((Shop::isMultiShopActivated()) ? '&id_shop='.Context::getContext()->shop->getID() : '')).'" target="_blank" class="button">'.$this->l('Run LiveEdit').'</a>';
|
<a href="'.$this->context->link->getPageLink('index', false, null, 'live_edit&ad='.$admin_dir.'&liveToken='.sha1($admin_dir._COOKIE_KEY_).((Shop::isFeatureActive()) ? '&id_shop='.Context::getContext()->shop->getID() : '')).'" target="_blank" class="button">'.$this->l('Run LiveEdit').'</a>';
|
||||||
echo '</fieldset>';
|
echo '</fieldset>';
|
||||||
|
|
||||||
// Print hook list
|
// Print hook list
|
||||||
@@ -276,7 +276,7 @@ class AdminModulesPositions extends AdminTab
|
|||||||
|
|
||||||
echo '<div id="unhook_button_position_top"><input class="button floatr" type="submit" name="unhookform" value="'.$this->l('Unhook the selection').'"/></div>';
|
echo '<div id="unhook_button_position_top"><input class="button floatr" type="submit" name="unhookform" value="'.$this->l('Unhook the selection').'"/></div>';
|
||||||
|
|
||||||
$canMove = (Shop::isMultiShopActivated() && $this->context->shop->getContextType() != Shop::CONTEXT_SHOP) ? false : true;
|
$canMove = (Shop::isFeatureActive() && $this->context->shop->getContextType() != Shop::CONTEXT_SHOP) ? false : true;
|
||||||
if (!$canMove)
|
if (!$canMove)
|
||||||
echo '<br /><div><b>'.$this->l('If you want to order / move following data, please go in shop context (select a shop in shop list)').'</b></div>';
|
echo '<br /><div><b>'.$this->l('If you want to order / move following data, please go in shop context (select a shop in shop list)').'</b></div>';
|
||||||
foreach ($hooks AS $hook)
|
foreach ($hooks AS $hook)
|
||||||
|
|||||||
@@ -681,7 +681,7 @@ class AdminOrders extends AdminTab
|
|||||||
<br />
|
<br />
|
||||||
<fieldset style="width: 400px">
|
<fieldset style="width: 400px">
|
||||||
<legend><img src="../img/admin/details.gif" /> '.$this->l('Order details').'</legend>';
|
<legend><img src="../img/admin/details.gif" /> '.$this->l('Order details').'</legend>';
|
||||||
if (Shop::isMultiShopActivated())
|
if (Shop::isFeatureActive())
|
||||||
{
|
{
|
||||||
echo '<label>'.$this->l('Shop:').' </label>
|
echo '<label>'.$this->l('Shop:').' </label>
|
||||||
<div style="margin: 2px 0 1em 190px;">'.Shop::getInstance($order->id_shop)->name.'</div>';
|
<div style="margin: 2px 0 1em 190px;">'.Shop::getInstance($order->id_shop)->name.'</div>';
|
||||||
|
|||||||
@@ -893,7 +893,7 @@ class AdminProducts extends AdminTab
|
|||||||
if (isset($result['success']))
|
if (isset($result['success']))
|
||||||
{
|
{
|
||||||
$shops = false;
|
$shops = false;
|
||||||
if (Shop::isMultiShopActivated())
|
if (Shop::isFeatureActive())
|
||||||
$shops = Shop::getShops();
|
$shops = Shop::getShops();
|
||||||
$obj = new Product((int)Tools::getValue('id_product'));
|
$obj = new Product((int)Tools::getValue('id_product'));
|
||||||
$countImages = (int)Db::getInstance()->getValue('SELECT COUNT(id_product) FROM '._DB_PREFIX_.'image WHERE id_product = '.(int)$obj->id);
|
$countImages = (int)Db::getInstance()->getValue('SELECT COUNT(id_product) FROM '._DB_PREFIX_.'image WHERE id_product = '.(int)$obj->id);
|
||||||
@@ -2504,7 +2504,7 @@ class AdminProducts extends AdminTab
|
|||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr id="shop_association">
|
<tr id="shop_association">
|
||||||
<td style="vertical-align:top;text-align:right;padding-right:10px;font-weight:bold;'.(!Shop::isMultiShopActivated() ? 'display:none;' : '').'">'.$this->l('Shop association:').'</td><td style="padding-bottom:5px;">';
|
<td style="vertical-align:top;text-align:right;padding-right:10px;font-weight:bold;'.(!Shop::isFeatureActive() ? 'display:none;' : '').'">'.$this->l('Shop association:').'</td><td style="padding-bottom:5px;">';
|
||||||
$this->displayAssoShop();
|
$this->displayAssoShop();
|
||||||
echo '</td>
|
echo '</td>
|
||||||
</tr>
|
</tr>
|
||||||
@@ -3435,7 +3435,7 @@ class AdminProducts extends AdminTab
|
|||||||
return '';
|
return '';
|
||||||
global $attributeJs, $images;
|
global $attributeJs, $images;
|
||||||
$shops = false;
|
$shops = false;
|
||||||
if (Shop::isMultiShopActivated())
|
if (Shop::isFeatureActive())
|
||||||
$shops = Shop::getShops();
|
$shops = Shop::getShops();
|
||||||
|
|
||||||
$countImages = (int)Db::getInstance()->getValue('SELECT COUNT(id_product) FROM '._DB_PREFIX_.'image WHERE id_product = '.(int)$obj->id);
|
$countImages = (int)Db::getInstance()->getValue('SELECT COUNT(id_product) FROM '._DB_PREFIX_.'image WHERE id_product = '.(int)$obj->id);
|
||||||
@@ -3935,7 +3935,7 @@ class AdminProducts extends AdminTab
|
|||||||
|
|
||||||
public function getLineTableImage($image, $imagesTotal, $token, $shops)
|
public function getLineTableImage($image, $imagesTotal, $token, $shops)
|
||||||
{
|
{
|
||||||
if (Shop::isMultiShopActivated())
|
if (Shop::isFeatureActive())
|
||||||
$imgObj = new Image((int)$image['id_image']);
|
$imgObj = new Image((int)$image['id_image']);
|
||||||
$image_obj = new Image($image['id_image']);
|
$image_obj = new Image($image['id_image']);
|
||||||
$img_path = $image_obj->getExistingImgPath();
|
$img_path = $image_obj->getExistingImgPath();
|
||||||
@@ -3953,7 +3953,7 @@ class AdminProducts extends AdminTab
|
|||||||
<a '.($image['position'] == $imagesTotal ? ' style="display: none;"' : '').' href="'.self::$currentIndex.'&id_image='.$image['id_image'].'&imgPosition='.($image['position'] + 1).'&imgDirection=1&token='.($token ? $token : $this->token).'"><img src="../img/admin/down.gif" alt="" border="0"></a>';
|
<a '.($image['position'] == $imagesTotal ? ' style="display: none;"' : '').' href="'.self::$currentIndex.'&id_image='.$image['id_image'].'&imgPosition='.($image['position'] + 1).'&imgDirection=1&token='.($token ? $token : $this->token).'"><img src="../img/admin/down.gif" alt="" border="0"></a>';
|
||||||
$html .= '
|
$html .= '
|
||||||
</td>';
|
</td>';
|
||||||
if (Shop::isMultiShopActivated())
|
if (Shop::isFeatureActive())
|
||||||
foreach ($shops as $shop)
|
foreach ($shops as $shop)
|
||||||
$html .= '
|
$html .= '
|
||||||
<td class="center"><input type="checkbox" class="image_shop" name="'.(int)$image['id_image'].'" value="'.(int)$shop['id_shop'].'" '.($imgObj->isAssociatedToShop($shop['id_shop']) ? 'checked="1"' : '').' /></td>';
|
<td class="center"><input type="checkbox" class="image_shop" name="'.(int)$image['id_image'].'" value="'.(int)$shop['id_shop'].'" '.($imgObj->isAssociatedToShop($shop['id_shop']) ? 'checked="1"' : '').' /></td>';
|
||||||
|
|||||||
@@ -262,7 +262,7 @@ class AdminReferrers extends AdminTab
|
|||||||
<input type="text" size="8" name="percent_fee" value="'.number_format((float)($this->getFieldValue($obj, 'percent_fee')), 2).'" />
|
<input type="text" size="8" name="percent_fee" value="'.number_format((float)($this->getFieldValue($obj, 'percent_fee')), 2).'" />
|
||||||
<p>'.$this->l('Percent of the sales.').'</p>
|
<p>'.$this->l('Percent of the sales.').'</p>
|
||||||
</div>';
|
</div>';
|
||||||
if (Shop::isMultiShopActivated())
|
if (Shop::isFeatureActive())
|
||||||
{
|
{
|
||||||
echo '<label>'.$this->l('Shop association:').'</label><div class="margin-form">';
|
echo '<label>'.$this->l('Shop association:').'</label><div class="margin-form">';
|
||||||
$this->displayAssoShop();
|
$this->displayAssoShop();
|
||||||
|
|||||||
@@ -193,7 +193,7 @@ class AdminScenes extends AdminTab
|
|||||||
'Uncheck All' => $this->l('Uncheck All')
|
'Uncheck All' => $this->l('Uncheck All')
|
||||||
);
|
);
|
||||||
|
|
||||||
if (Shop::isMultiShopActivated())
|
if (Shop::isFeatureActive())
|
||||||
{
|
{
|
||||||
echo '<label>'.$this->l('Shop association:').'</label><div class="margin-form">';
|
echo '<label>'.$this->l('Shop association:').'</label><div class="margin-form">';
|
||||||
$this->displayAssoShop();
|
$this->displayAssoShop();
|
||||||
@@ -215,7 +215,7 @@ class AdminScenes extends AdminTab
|
|||||||
{
|
{
|
||||||
echo '<br/><span class="bold">'.$this->l('Please add a picture to continue mapping the image...').'</span><br/><br/>';
|
echo '<br/><span class="bold">'.$this->l('Please add a picture to continue mapping the image...').'</span><br/><br/>';
|
||||||
echo '</div>';
|
echo '</div>';
|
||||||
if (Shop::isMultiShopActivated())
|
if (Shop::isFeatureActive())
|
||||||
{
|
{
|
||||||
echo '<label>'.$this->l('Shop association:').'</label><div class="margin-form">';
|
echo '<label>'.$this->l('Shop association:').'</label><div class="margin-form">';
|
||||||
$this->displayAssoShop();
|
$this->displayAssoShop();
|
||||||
|
|||||||
@@ -193,7 +193,7 @@ class AdminSuppliers extends AdminTab
|
|||||||
<input type="radio" name="active" id="active_off" value="0" '.(!$this->getFieldValue($supplier, 'active') ? 'checked="checked" ' : '').'/>
|
<input type="radio" name="active" id="active_off" value="0" '.(!$this->getFieldValue($supplier, 'active') ? 'checked="checked" ' : '').'/>
|
||||||
<label class="t" for="active_off"> <img src="../img/admin/disabled.gif" alt="'.$this->l('Disabled').'" title="'.$this->l('Disabled').'" /></label>
|
<label class="t" for="active_off"> <img src="../img/admin/disabled.gif" alt="'.$this->l('Disabled').'" title="'.$this->l('Disabled').'" /></label>
|
||||||
</div>';
|
</div>';
|
||||||
if (Shop::isMultiShopActivated())
|
if (Shop::isFeatureActive())
|
||||||
{
|
{
|
||||||
echo '<label>'.$this->l('GroupShop association:').'</label><div class="margin-form">';
|
echo '<label>'.$this->l('GroupShop association:').'</label><div class="margin-form">';
|
||||||
$this->displayAssoShop('group_shop');
|
$this->displayAssoShop('group_shop');
|
||||||
|
|||||||
@@ -70,7 +70,7 @@ class AdminZones extends AdminTab
|
|||||||
<label class="t" for="active_off"> <img src="../img/admin/disabled.gif" alt="'.$this->l('Disabled').'" title="'.$this->l('Disabled').'" /></label>
|
<label class="t" for="active_off"> <img src="../img/admin/disabled.gif" alt="'.$this->l('Disabled').'" title="'.$this->l('Disabled').'" /></label>
|
||||||
<p>'.$this->l('Allow or disallow shipping to this zone').'</p>
|
<p>'.$this->l('Allow or disallow shipping to this zone').'</p>
|
||||||
</div>';
|
</div>';
|
||||||
if (Shop::isMultiShopActivated())
|
if (Shop::isFeatureActive())
|
||||||
{
|
{
|
||||||
echo '<label>'.$this->l('GroupShop association:').'</label><div class="margin-form">';
|
echo '<label>'.$this->l('GroupShop association:').'</label><div class="margin-form">';
|
||||||
$this->displayAssoShop('group_shop');
|
$this->displayAssoShop('group_shop');
|
||||||
|
|||||||
@@ -225,7 +225,7 @@ class AdminControllerCore extends Controller
|
|||||||
if ($controller == 'AdminHome')
|
if ($controller == 'AdminHome')
|
||||||
$_POST['token'] = $this->token;
|
$_POST['token'] = $this->token;
|
||||||
|
|
||||||
if (!Shop::isMultiShopActivated())
|
if (!Shop::isFeatureActive())
|
||||||
$this->shopLinkType = '';
|
$this->shopLinkType = '';
|
||||||
|
|
||||||
// Get the name of the folder containing the custom tpl files
|
// Get the name of the folder containing the custom tpl files
|
||||||
@@ -824,7 +824,7 @@ class AdminControllerCore extends Controller
|
|||||||
public function initHeader()
|
public function initHeader()
|
||||||
{
|
{
|
||||||
// Shop context
|
// Shop context
|
||||||
if (Shop::isMultiShopActivated())
|
if (Shop::isFeatureActive())
|
||||||
{
|
{
|
||||||
if (Context::shop() == Shop::CONTEXT_ALL)
|
if (Context::shop() == Shop::CONTEXT_ALL)
|
||||||
{
|
{
|
||||||
@@ -854,7 +854,7 @@ class AdminControllerCore extends Controller
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Multishop
|
// Multishop
|
||||||
$is_multishop = Shop::isMultiShopActivated();// && Context::shop() != Shop::CONTEXT_ALL;
|
$is_multishop = Shop::isFeatureActive();// && Context::shop() != Shop::CONTEXT_ALL;
|
||||||
/*if ($is_multishop)
|
/*if ($is_multishop)
|
||||||
{
|
{
|
||||||
if (Context::shop() == Shop::CONTEXT_GROUP)
|
if (Context::shop() == Shop::CONTEXT_GROUP)
|
||||||
@@ -959,8 +959,8 @@ class AdminControllerCore extends Controller
|
|||||||
'search_type' => Tools::getValue('bo_search_type'),
|
'search_type' => Tools::getValue('bo_search_type'),
|
||||||
'bo_query' => Tools::safeOutput(Tools::stripslashes(Tools::getValue('bo_query'))),
|
'bo_query' => Tools::safeOutput(Tools::stripslashes(Tools::getValue('bo_query'))),
|
||||||
'quick_access' => $quick_access,
|
'quick_access' => $quick_access,
|
||||||
'multi_shop' => Shop::isMultiShopActivated(),
|
'multi_shop' => Shop::isFeatureActive(),
|
||||||
'shop_list' => (Shop::isMultiShopActivated() ? generateShopList() : null), //@TODO refacto
|
'shop_list' => (Shop::isFeatureActive() ? generateShopList() : null), //@TODO refacto
|
||||||
'tab' => $tab,
|
'tab' => $tab,
|
||||||
'current_parent_id' => (int)Tab::getCurrentParentId(),
|
'current_parent_id' => (int)Tab::getCurrentParentId(),
|
||||||
'tabs' => $tabs,
|
'tabs' => $tabs,
|
||||||
@@ -1208,7 +1208,7 @@ class AdminControllerCore extends Controller
|
|||||||
$this->context->currency = new Currency(Configuration::get('PS_CURRENCY_DEFAULT'));
|
$this->context->currency = new Currency(Configuration::get('PS_CURRENCY_DEFAULT'));
|
||||||
|
|
||||||
// Change shop context ?
|
// Change shop context ?
|
||||||
if (Shop::isMultiShopActivated() && Tools::getValue('setShopContext') !== false)
|
if (Shop::isFeatureActive() && Tools::getValue('setShopContext') !== false)
|
||||||
{
|
{
|
||||||
$this->context->cookie->shopContext = Tools::getValue('setShopContext');
|
$this->context->cookie->shopContext = Tools::getValue('setShopContext');
|
||||||
$url = parse_url($_SERVER['REQUEST_URI']);
|
$url = parse_url($_SERVER['REQUEST_URI']);
|
||||||
@@ -1449,7 +1449,7 @@ class AdminControllerCore extends Controller
|
|||||||
$this->_group .= ', a.'.pSQL($this->identifier);
|
$this->_group .= ', a.'.pSQL($this->identifier);
|
||||||
|
|
||||||
$test_join = !preg_match('#`?'.preg_quote(_DB_PREFIX_.$this->table.'_'.$filter_key).'`? *sa#', $this->_join);
|
$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 = ' 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).'))';
|
$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)
|
protected function updateAssoShop($id_object = false)
|
||||||
{
|
{
|
||||||
if (!Shop::isMultiShopActivated())
|
if (!Shop::isFeatureActive())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
$shop_asso = Shop::getAssoTables();
|
$shop_asso = Shop::getAssoTables();
|
||||||
@@ -1835,7 +1835,7 @@ class AdminControllerCore extends Controller
|
|||||||
if (isset($options['visibility']) && $options['visibility'] > Context::getContext()->shop->getContextType())
|
if (isset($options['visibility']) && $options['visibility'] > Context::getContext()->shop->getContextType())
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if (Shop::isMultiShopActivated() && isset($_POST['configUseDefault'][$key]))
|
if (Shop::isFeatureActive() && isset($_POST['configUseDefault'][$key]))
|
||||||
{
|
{
|
||||||
Configuration::deleteFromContext($key);
|
Configuration::deleteFromContext($key);
|
||||||
continue;
|
continue;
|
||||||
|
|||||||
@@ -226,7 +226,7 @@ abstract class AdminTabCore
|
|||||||
// $className = 'AdminCatalog';
|
// $className = 'AdminCatalog';
|
||||||
$this->token = Tools::getAdminToken($className.(int)$this->id.(int)$this->context->employee->id);
|
$this->token = Tools::getAdminToken($className.(int)$this->id.(int)$this->context->employee->id);
|
||||||
|
|
||||||
if (!Shop::isMultiShopActivated())
|
if (!Shop::isFeatureActive())
|
||||||
$this->shopLinkType = '';
|
$this->shopLinkType = '';
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -898,7 +898,7 @@ abstract class AdminTabCore
|
|||||||
|
|
||||||
protected function updateAssoShop($id_object = false)
|
protected function updateAssoShop($id_object = false)
|
||||||
{
|
{
|
||||||
if (!Shop::isMultiShopActivated())
|
if (!Shop::isFeatureActive())
|
||||||
return ;
|
return ;
|
||||||
|
|
||||||
if(!$assos = self::getAssoShop($this->table, $id_object))
|
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())
|
if (isset($options['visibility']) && $options['visibility'] > Context::getContext()->shop->getContextType())
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if (Shop::isMultiShopActivated() && isset($_POST['configUseDefault'][$key]))
|
if (Shop::isFeatureActive() && isset($_POST['configUseDefault'][$key]))
|
||||||
{
|
{
|
||||||
Configuration::deleteFromContext($key);
|
Configuration::deleteFromContext($key);
|
||||||
continue;
|
continue;
|
||||||
@@ -1337,7 +1337,7 @@ abstract class AdminTabCore
|
|||||||
else if (!preg_match('#(\s|,)\s*a\.`?'.pSQL($this->identifier).'`?(\s|,|$)#', $this->_group))
|
else if (!preg_match('#(\s|,)\s*a\.`?'.pSQL($this->identifier).'`?(\s|,|$)#', $this->_group))
|
||||||
$this->_group .= ', a.'.pSQL($this->identifier);
|
$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).'))';
|
$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)
|
// Check if var is invisible (can't edit it in current shop context), or disable (use default value for multishop)
|
||||||
$isDisabled = $isInvisible = false;
|
$isDisabled = $isInvisible = false;
|
||||||
if (Shop::isMultiShopActivated())
|
if (Shop::isFeatureActive())
|
||||||
{
|
{
|
||||||
if (isset($field['visibility']) && $field['visibility'] > $this->context->shop->getContextType())
|
if (isset($field['visibility']) && $field['visibility'] > $this->context->shop->getContextType())
|
||||||
{
|
{
|
||||||
@@ -1907,7 +1907,7 @@ abstract class AdminTabCore
|
|||||||
$this->$method($key, $field, $value);
|
$this->$method($key, $field, $value);
|
||||||
|
|
||||||
// Multishop default value
|
// Multishop default value
|
||||||
if (Shop::isMultiShopActivated() && Context::shop() != Shop::CONTEXT_ALL && !$isInvisible)
|
if (Shop::isFeatureActive() && Context::shop() != Shop::CONTEXT_ALL && !$isInvisible)
|
||||||
echo '<div class="preference_default_multishop">
|
echo '<div class="preference_default_multishop">
|
||||||
<label>
|
<label>
|
||||||
<input type="checkbox" name="configUseDefault['.$key.']" value="1" '.(($isDisabled) ? 'checked="checked"' : '').' onclick="checkMultishopDefaultValue(this, \''.$key.'\')" /> '.$this->l('Use default value').'
|
<input type="checkbox" name="configUseDefault['.$key.']" value="1" '.(($isDisabled) ? 'checked="checked"' : '').' onclick="checkMultishopDefaultValue(this, \''.$key.'\')" /> '.$this->l('Use default value').'
|
||||||
@@ -2336,7 +2336,7 @@ abstract class AdminTabCore
|
|||||||
|
|
||||||
protected function displayAssoShop($type = 'shop')
|
protected function displayAssoShop($type = 'shop')
|
||||||
{
|
{
|
||||||
if (!Shop::isMultiShopActivated() || (!$this->_object && $this->context->shop->getContextType() != Shop::CONTEXT_ALL))
|
if (!Shop::isFeatureActive() || (!$this->_object && $this->context->shop->getContextType() != Shop::CONTEXT_ALL))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if ($type != 'shop' && $type != 'group_shop')
|
if ($type != 'shop' && $type != 'group_shop')
|
||||||
|
|||||||
@@ -425,7 +425,7 @@ class ConfigurationCore extends ObjectModel
|
|||||||
|| (Context::shop() == Shop::CONTEXT_GROUP && Configuration::hasContext($key, null, Shop::CONTEXT_GROUP))) ? true : false;
|
|| (Context::shop() == Shop::CONTEXT_GROUP && Configuration::hasContext($key, null, Shop::CONTEXT_GROUP))) ? true : false;
|
||||||
}
|
}
|
||||||
|
|
||||||
return (Shop::isMultiShopActivated() && Context::shop() != Shop::CONTEXT_ALL && $testContext);
|
return (Shop::isFeatureActive() && Context::shop() != Shop::CONTEXT_ALL && $testContext);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -67,7 +67,7 @@ class HelperOptionsCore extends Helper
|
|||||||
|
|
||||||
// Check if var is invisible (can't edit it in current shop context), or disable (use default value for multishop)
|
// Check if var is invisible (can't edit it in current shop context), or disable (use default value for multishop)
|
||||||
$isDisabled = $isInvisible = false;
|
$isDisabled = $isInvisible = false;
|
||||||
if (Shop::isMultiShopActivated())
|
if (Shop::isFeatureActive())
|
||||||
{
|
{
|
||||||
if (isset($field['visibility']) && $field['visibility'] > $this->context->shop->getContextType())
|
if (isset($field['visibility']) && $field['visibility'] > $this->context->shop->getContextType())
|
||||||
{
|
{
|
||||||
@@ -105,7 +105,7 @@ class HelperOptionsCore extends Helper
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Multishop default value
|
// Multishop default value
|
||||||
$field['multishop_default'] = (Shop::isMultiShopActivated() && Context::shop() != Shop::CONTEXT_ALL && !$isInvisible);
|
$field['multishop_default'] = (Shop::isFeatureActive() && Context::shop() != Shop::CONTEXT_ALL && !$isInvisible);
|
||||||
|
|
||||||
// Assign the modifications back to parent array
|
// Assign the modifications back to parent array
|
||||||
$category_data['fields'][$key] = $field;
|
$category_data['fields'][$key] = $field;
|
||||||
|
|||||||
@@ -248,7 +248,7 @@ abstract class ObjectModelCore
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!Shop::isMultishopActivated())
|
if (!Shop::isFeatureActive())
|
||||||
{
|
{
|
||||||
if (isset($assos[$this->table]) && $assos[$this->table]['type'] == 'shop')
|
if (isset($assos[$this->table]) && $assos[$this->table]['type'] == 'shop')
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -728,7 +728,7 @@ class ShopCore extends ObjectModel
|
|||||||
/**
|
/**
|
||||||
* @return bool Return true if there is more than one shop
|
* @return bool Return true if there is more than one shop
|
||||||
*/
|
*/
|
||||||
public static function isMultiShopActivated()
|
public static function isFeatureActive()
|
||||||
{
|
{
|
||||||
static $total = null;
|
static $total = null;
|
||||||
|
|
||||||
|
|||||||
@@ -79,7 +79,7 @@ class Gsitemap extends Module
|
|||||||
Configuration::updateValue('GSITEMAP_ALL_CMS', (int)Tools::getValue('GSITEMAP_ALL_CMS'));
|
Configuration::updateValue('GSITEMAP_ALL_CMS', (int)Tools::getValue('GSITEMAP_ALL_CMS'));
|
||||||
Configuration::updateValue('GSITEMAP_ALL_PRODUCTS', (int)Tools::getValue('GSITEMAP_ALL_PRODUCTS'));
|
Configuration::updateValue('GSITEMAP_ALL_PRODUCTS', (int)Tools::getValue('GSITEMAP_ALL_PRODUCTS'));
|
||||||
|
|
||||||
if (Shop::isMultiShopActivated())
|
if (Shop::isFeatureActive())
|
||||||
$res = $this->generateSitemapIndex();
|
$res = $this->generateSitemapIndex();
|
||||||
else
|
else
|
||||||
$res = $this->generateSitemap(Configuration::get('PS_SHOP_DEFAULT'), GSITEMAP_FILE);
|
$res = $this->generateSitemap(Configuration::get('PS_SHOP_DEFAULT'), GSITEMAP_FILE);
|
||||||
|
|||||||
Reference in New Issue
Block a user