diff --git a/admin-dev/themes/template/employees/form.tpl b/admin-dev/themes/template/employees/form.tpl index 2c1993e90..026447ff8 100644 --- a/admin-dev/themes/template/employees/form.tpl +++ b/admin-dev/themes/template/employees/form.tpl @@ -23,299 +23,47 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) * International Registered Trademark & Property of PrestaShop SA *} -{if $firstCall} - - -{/if} -{if isset($fields.title)}

{$fields.title}

{/if} -
- {if $form_id} - - {/if} -
- {foreach $fields as $key => $field} - {if $key == 'legend'} - - {if isset($field.image)}{$field.title}{/if} - {$field.title} - - {elseif $key == 'input'} - {foreach $field as $input} - {if $input.name == 'id_state'} -
- {/if} - {if isset($input.label)} - - {/if} - {if $input.type == 'hidden'} - +{block name="start_field_block"} +
+ {if $input.type == 'select_theme'} + - {if isset($input.hint)}{$input.hint} {/if} -
- {/foreach} - {if count($languages) > 1} -
- -
-
- {l s='Choose language:'}

- {foreach $languages as $language} - {$language.name} - {/foreach} -
- {/if} - {else} - - {if isset($input.hint)}{$input.hint} {/if} - {/if} - {elseif $input.type == 'select'} - - {if isset($input.hint)}{$input.hint} {/if} - {elseif $input.type == 'radio'} - {foreach $input.values as $value} - - - {if isset($input.br) && $input.br}
{/if} - {/foreach} - {elseif $input.type == 'textarea'} - {if isset($input.lang) && isset($input.attributeLang)} - {foreach $languages as $language} -
- -
- {/foreach} - {if count($languages) > 1} -
- -
-
- {l s='Choose language:'}

- {foreach $languages as $language} - {$language.name} - {/foreach} -
- {/if} - {else} - - {/if} - {elseif $input.type == 'checkbox'} - {foreach $input.values.query as $value} - {assign var=id_checkbox value=$input.name|cat:'_'|cat:$value[$input.values.id]} - -
- {/foreach} - {elseif $input.type == 'file'} - - - {elseif $input.type == 'password'} - - {elseif $input.type == 'group'} - {assign var=groups value=$input.values} - {include file='helper/form/form_group.tpl'} - {elseif $input.type == 'shop' OR $input.type == 'group_shop'} - - {include file='helper/form/form_shop.tpl'} - {elseif $input.type == 'asso_shop' && isset($asso_shop) && $asso_shop} - -
- {$asso_shop} -
- {elseif $input.type == 'color'} - - - {/if} - {if isset($input.required) && $input.required} *{/if} - {if isset($input.p)} -

- {if is_array($input.p)} - {foreach $input.p as $p} - {if is_array($p)} - {$p.text}
- {else} - {$p}
- {/if} - {/foreach} - {else} - {$input.p} - {/if} -

- {/if} - {if isset($languages)}
{/if} -
+ {if $fields_value[$input.name] == $option}selected="selected"{/if} {/if} - {if $input.name == 'id_state'} - - {/if} - {/foreach} - {elseif $key == 'submit'} -
- -
- {/if} - {/foreach} - {if $required_fields} -
* {l s ='Required field'}
- {/if} -
-
- -

-{if $firstCall && !$no_back} - {if $back} - {l s='Back'} - {else} - {l s='Back to list'} + >{$option|escape:'htmlall':'UTF-8'} + {/foreach} + + {if isset($input.hint)}{$input.hint} {/if} {/if} -
-{/if} +{/block} + +{block name=script} + $(document).ready(function(){ + $('select[name=id_profile]').change(function(){ + ifSuperAdmin($(this)); + }); + + ifSuperAdmin($('select[name=id_profile]')); + }); + + function ifSuperAdmin(el) + { + var val = $(el).val(); + if(val == {$smarty.const._PS_ADMIN_PROFILE_}) + { + $('.assoShop input[type=checkbox]').attr('disabled', 'disabled'); + $('.assoShop input[type=checkbox]').attr('checked', 'checked'); + } + else + $('.assoShop input[type=checkbox]').attr('disabled', ''); + } +{/block} diff --git a/controllers/admin/AdminEmployeesController.php b/controllers/admin/AdminEmployeesController.php index bf7da3f21..ec4a48a63 100644 --- a/controllers/admin/AdminEmployeesController.php +++ b/controllers/admin/AdminEmployeesController.php @@ -172,7 +172,7 @@ class AdminEmployeesControllerCore extends AdminController ) ), array( - 'type' => 'select', + 'type' => 'select_theme', 'label' => $this->l('Theme:'), 'name' => 'bo_theme', 'options' => array('query' => $this->themes),