// Fix default shop associations in helper shop #PSTEST-746
This commit is contained in:
@@ -82,7 +82,7 @@ function check_all_shop() {
|
|||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
{foreach $input.values as $groupID => $groupData}
|
{foreach $input.values as $groupID => $groupData}
|
||||||
{if ($input.type == 'group_shop' && (isset($fields_value.shop[$groupID]) || !$form_id))}
|
{if ($input.type == 'group_shop' && isset($fields_value.shop[$groupID]))}
|
||||||
{assign var=groupChecked value=true}
|
{assign var=groupChecked value=true}
|
||||||
{else}
|
{else}
|
||||||
{assign var=groupChecked value=false}
|
{assign var=groupChecked value=false}
|
||||||
@@ -104,7 +104,7 @@ function check_all_shop() {
|
|||||||
{if $input.type == 'shop'}
|
{if $input.type == 'shop'}
|
||||||
{assign var=j value=0}
|
{assign var=j value=0}
|
||||||
{foreach $groupData['shops'] as $shopID => $shopData}
|
{foreach $groupData['shops'] as $shopID => $shopData}
|
||||||
{if (isset($fields_value.shop[$shopID]) || !$form_id)}
|
{if (isset($fields_value.shop[$shopID]))}
|
||||||
{assign var=checked value=true}
|
{assign var=checked value=true}
|
||||||
{else}
|
{else}
|
||||||
{assign var=checked value=false}
|
{assign var=checked value=false}
|
||||||
|
|||||||
@@ -334,6 +334,26 @@ class HelperCore
|
|||||||
foreach (Db::getInstance()->executeS($sql) as $row)
|
foreach (Db::getInstance()->executeS($sql) as $row)
|
||||||
$assos[$row['id_'.$type]] = $row['id_'.$type];
|
$assos[$row['id_'.$type]] = $row['id_'.$type];
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
switch (Context::shop())
|
||||||
|
{
|
||||||
|
case Shop::CONTEXT_SHOP :
|
||||||
|
$assos[$this->context->shop->id] = $this->context->shop->id;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case Shop::CONTEXT_GROUP :
|
||||||
|
foreach (Shop::getShops(false, $this->context->shop->getGroupID(), true) as $id_shop)
|
||||||
|
$assos[$id_shop] = $id_shop;
|
||||||
|
break;
|
||||||
|
|
||||||
|
default :
|
||||||
|
foreach (Shop::getShops(false, null, true) as $id_shop)
|
||||||
|
$assos[$id_shop] = $id_shop;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
$tpl = $this->createTemplate('helpers/assoshop.tpl');
|
$tpl = $this->createTemplate('helpers/assoshop.tpl');
|
||||||
$tpl->assign(array(
|
$tpl->assign(array(
|
||||||
'input' => array(
|
'input' => array(
|
||||||
|
|||||||
Reference in New Issue
Block a user