// Hide checkbox in configuration multishop when employee manage only 1 shop #PSCFV-2649
This commit is contained in:
1 parent
05173238ef
commit
4eff1b110b
3 files changed
+7
-5
No files matched your search
@@ -68,7 +68,7 @@
|
|||||||
<input type="hidden" name="{$key}" value="{$field['value']}" />
|
<input type="hidden" name="{$key}" value="{$field['value']}" />
|
||||||
{else}
|
{else}
|
||||||
<div style="clear: both; padding-top:15px;" id="conf_id_{$key}" {if $field['is_invisible']} class="isInvisible"{/if}>
|
<div style="clear: both; padding-top:15px;" id="conf_id_{$key}" {if $field['is_invisible']} class="isInvisible"{/if}>
|
||||||
{if $field['multishop_default'] && empty($field['no_multishop_checkbox'])}
|
{if !$categoryData['hide_multishop_checkbox'] && $field['multishop_default'] && empty($field['no_multishop_checkbox'])}
|
||||||
<div class="preference_default_multishop">
|
<div class="preference_default_multishop">
|
||||||
<input type="checkbox" name="multishopOverrideOption[{$key}]" value="1" {if !$field['is_disabled']}checked="checked"{/if} onclick="checkMultishopDefaultValue(this, '{$key}')" />
|
<input type="checkbox" name="multishopOverrideOption[{$key}]" value="1" {if !$field['is_disabled']}checked="checked"{/if} onclick="checkMultishopDefaultValue(this, '{$key}')" />
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -836,6 +836,7 @@ class AdminControllerCore extends Controller
|
|||||||
|
|
||||||
$languages = Language::getLanguages(false);
|
$languages = Language::getLanguages(false);
|
||||||
|
|
||||||
|
$hide_multishop_checkbox = (Shop::getTotalShops(false, null) < 2) ? true : false;
|
||||||
foreach ($this->fields_options as $category_data)
|
foreach ($this->fields_options as $category_data)
|
||||||
{
|
{
|
||||||
if (!isset($category_data['fields']))
|
if (!isset($category_data['fields']))
|
||||||
@@ -862,7 +863,7 @@ class AdminControllerCore extends Controller
|
|||||||
foreach ($fields as $field => $values)
|
foreach ($fields as $field => $values)
|
||||||
{
|
{
|
||||||
// We don't validate fields with no visibility
|
// We don't validate fields with no visibility
|
||||||
if (Shop::isFeatureActive() && isset($values['visibility']) && ($values['visibility'] > Shop::getContext()))
|
if (!$hide_multishop_checkbox && Shop::isFeatureActive() && isset($values['visibility']) && $values['visibility'] > Shop::getContext())
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
// Check if field is required
|
// Check if field is required
|
||||||
@@ -897,10 +898,10 @@ class AdminControllerCore extends Controller
|
|||||||
{
|
{
|
||||||
foreach ($fields as $key => $options)
|
foreach ($fields as $key => $options)
|
||||||
{
|
{
|
||||||
if (Shop::isFeatureActive() && isset($options['visibility']) && $options['visibility'] > Shop::getContext())
|
if (!$hide_multishop_checkbox && Shop::isFeatureActive() && isset($options['visibility']) && $options['visibility'] > Shop::getContext())
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if (Shop::isFeatureActive() && Shop::getContext() != Shop::CONTEXT_ALL && empty($options['no_multishop_checkbox']) && empty($_POST['multishopOverrideOption'][$key]))
|
if (!$hide_multishop_checkbox && Shop::isFeatureActive() && Shop::getContext() != Shop::CONTEXT_ALL && empty($options['no_multishop_checkbox']) && empty($_POST['multishopOverrideOption'][$key]))
|
||||||
{
|
{
|
||||||
Configuration::deleteFromContext($key);
|
Configuration::deleteFromContext($key);
|
||||||
continue;
|
continue;
|
||||||
|
|||||||
@@ -52,6 +52,7 @@ class HelperOptionsCore extends Helper
|
|||||||
$languages = Language::getLanguages(false);
|
$languages = Language::getLanguages(false);
|
||||||
|
|
||||||
$use_multishop = false;
|
$use_multishop = false;
|
||||||
|
$hide_multishop_checkbox = (Shop::getTotalShops(false, null) < 2) ? true : false;
|
||||||
foreach ($option_list as $category => $category_data)
|
foreach ($option_list as $category => $category_data)
|
||||||
{
|
{
|
||||||
if (!is_array($category_data))
|
if (!is_array($category_data))
|
||||||
@@ -66,7 +67,7 @@ class HelperOptionsCore extends Helper
|
|||||||
$category_data['hide_multishop_checkbox'] = true;
|
$category_data['hide_multishop_checkbox'] = true;
|
||||||
foreach ($category_data['fields'] as $key => $field)
|
foreach ($category_data['fields'] as $key => $field)
|
||||||
{
|
{
|
||||||
if (empty($field['no_multishop_checkbox']))
|
if (empty($field['no_multishop_checkbox']) && !$hide_multishop_checkbox)
|
||||||
$category_data['hide_multishop_checkbox'] = false;
|
$category_data['hide_multishop_checkbox'] = false;
|
||||||
|
|
||||||
// Set field value unless explicitly denied
|
// Set field value unless explicitly denied
|
||||||
|
|||||||
Reference in new issue
Block a user