// update advanced parameters and administration tabs

This commit is contained in:
Sarah Lorenzini committed 2013-08-02 17:44:26 +02:00
1 parent 60f567d2ff
commit 94a43f2991
7 files changed
+290 -301

No files matched your search

@@ -172,246 +172,250 @@
<div class="leadin">{block name="leadin"}{/block}</div> <div class="leadin">{block name="leadin"}{/block}</div>
{/if} {/if}
<div class="productTabs"> <div class="productTabs col-lg-2">
<ul class="tab"> <div class="tab list-group">
{foreach $profiles as $profile} {foreach $profiles as $profile}
<li class="tab-row"> <a class="list-group-item nav-profile {if $profile.id_profile == $current_profile}selected{/if}" id="profile-{$profile.id_profile}" href="{$current}&token={$token}&id_profile={$profile.id_profile}">{$profile.name}</a>
<a class="nav-profile {if $profile.id_profile == $current_profile}selected{/if}" id="profile-{$profile.id_profile}" href="{$current}&token={$token}&id_profile={$profile.id_profile}">{$profile.name}</a>
</li>
{/foreach} {/foreach}
</ul> </div>
</div> </div>
<form id="{$table}_form" class="defaultForm" action="{$current}&{$submit_action}=1&token={$token}" method="post" enctype="multipart/form-data"> <form id="{$table}_form" class="defaultForm form-horizontal col-lg-10" action="{$current}&{$submit_action}=1&token={$token}" method="post" enctype="multipart/form-data">
{if $form_id} <fieldset>
<input type="hidden" name="{$identifier}" id="{$identifier}" value="{$form_id}" /> {if $form_id}
{/if} <input type="hidden" name="{$identifier}" id="{$identifier}" value="{$form_id}" />
{assign var=tabsize value=count($tabs)}
{foreach $tabs AS $tab}
{if $tab.id_tab > $tabsize}
{assign var=tabsize value=$tab.id_tab}
{/if} {/if}
{/foreach}
{foreach $profiles as $profile} {assign var=tabsize value=count($tabs)}
{foreach $tabs AS $tab}
<div class="profile-{$profile.id_profile} tab-profile" style="display:{if $profile.id_profile == $current_profile}block{else}none{/if}"> {if $tab.id_tab > $tabsize}
{assign var=tabsize value=$tab.id_tab}
{if $profile.id_profile != $admin_profile}
<table class="table float" cellspacing="0" style="margin-right:50px" id="table_{$profile.id_profile}">
<tr>
<th class="center">
{l s='Menus'}
</th>
<th class="center">
<input type="checkbox" name="1" id="viewall"
{if $access_edit == 1}
rel="-1||{$profile.id_profile}||view||{$tabsize}||{count($tabs)}" class="ajaxPower"
{else}
disabled="disabled"
{/if} />
{l s='View'}
</th>
<th class="center">
<input type="checkbox" name="1" id="addall"
{if $access_edit == 1}
rel="-1||{$profile.id_profile}||add||{$tabsize}||{count($tabs)}" class="ajaxPower"
{else}
disabled="disabled"
{/if} />
{l s='Add'}
</th>
<th class="center">
<input type="checkbox" name="1" id="editall"
{if $access_edit == 1}
rel="-1||{$profile.id_profile}||edit||{$tabsize}||{count($tabs)}" class="ajaxPower"
{else}
disabled="disabled"
{/if} />
{l s='Edit'}
</th>
<th class="center">
<input type="checkbox" name="1" id="deleteall"
{if $access_edit == 1}
rel="-1||{$profile.id_profile}||delete||{$tabsize}||{count($tabs)}" class="ajaxPower"
{else}
disabled="disabled"
{/if} />
{l s='Delete'}
</th>
<th class="center">
<input type="checkbox" name="1" id="allall"
{if $access_edit == 1}
rel="-1||{$profile.id_profile}||all||{$tabsize}||{count($tabs)}" class="ajaxPower"
{else}
disabled="disabled"
{/if} />
{l s='All'}
</th>
</tr>
{if !count($tabs)}
<tr>
<td colspan="6">{l s='No menu'}</td>
</tr>
{else}
{foreach $tabs AS $tab}
{assign var=access value=$accesses[$profile.id_profile]}
{if !$tab.id_parent OR $tab.id_parent == -1}
{assign var=is_child value=false}
{assign var=result_accesses value=0}
<tr{if !$is_child} class="parent"{/if}>
<td{if !$is_child} class="bold"{/if}>{if $is_child} &raquo; {/if}<strong>{$tab.name}</strong></td>
{foreach $perms as $perm}
{if $access_edit == 1}
<td>
<input type="checkbox"
id="{$perm}{$access[$tab.id_tab]['id_tab']}"
rel="{$access[$tab.id_tab]['id_tab']}||{$profile.id_profile}||{$perm}||{$tabsize}||{count($tabs)}"
class="ajaxPower {$perm} {$access[$tab.id_tab]['id_tab']}"
{if $access[$tab.id_tab][$perm] == 1}checked="checked"{/if}/>
</td>
{else}
<td>
<input type="checkbox"
disabled="disabled"
{if $access[$tab.id_tab][$perm] == 1}checked="checked"{/if}/>
</td>
{/if}
{assign var=result_accesses value=$result_accesses + $access[$tab.id_tab][$perm]}
{/foreach}
<td>
<input type="checkbox"
id='all{$access[$tab.id_tab]['id_tab']}'
{if $access_edit == 1}
rel="{$access[$tab.id_tab]['id_tab']}||{$profile.id_profile}||all||{$tabsize}||{count($tabs)}"
class="ajaxPower all {$access[$tab.id_tab]['id_tab']}"
{else}
class="all {$access[$tab.id_tab]['id_tab']}"
disabled="disabled"
{/if}
{if $result_accesses == 4}checked="checked"{/if}/>
</td>
</tr>
{foreach $tabs AS $child}
{if $child.id_parent === $tab.id_tab}
{if isset($access[$child.id_tab])}
{assign var=is_child value=true}
{assign var=result_accesses value=0}
<tr class="child-{$child.id_parent}">
<td{if !$is_child} class="bold"{/if}>{if $is_child} &raquo; {/if}{$child.name}</td>
{foreach $perms as $perm}
{if $access_edit == 1}
<td>
<input type="checkbox"
id="{$perm}{$access[$child.id_tab]['id_tab']}"
rel="{$access[$child.id_tab]['id_tab']}||{$profile.id_profile}||{$perm}||{$tabsize}||{count($tabs)}"
class="ajaxPower {$perm} {$access[$child.id_tab]['id_tab']}"
{if $access[$child.id_tab][$perm] == 1}checked="checked"{/if}/>
</td>
{else}
<td>
<input type="checkbox"
disabled="disabled"
{if $access[$child.id_tab][$perm] == 1}checked="checked"{/if}/>
</td>
{/if}
{assign var=result_accesses value=$result_accesses + $access[$child.id_tab][$perm]}
{/foreach}
<td>
<input type="checkbox"
id='all{$access[$child.id_tab]['id_tab']}'
{if $access_edit == 1}
rel="{$access[$child.id_tab]['id_tab']}||{$profile.id_profile}||all||{$tabsize}||{count($tabs)}"
class="ajaxPower all {$access[$child.id_tab]['id_tab']}"
{else}
class="all {$access[$child.id_tab]['id_tab']}"
disabled="disabled"
{/if}
{if $result_accesses == 4}checked="checked"{/if}/>
</td>
</tr>
{/if}
{/if}
{/foreach}
{/if}
{/foreach}
{/if}
</table>
<table class="table" cellspacing="0" style="margin-left:20px" id="table_module_{$profile.id_profile}">
<tr>
<th>{l s='Modules'}</th>
<th class="center">
<input type="checkbox"
id="ajax-ma-view-master"
{if $access_edit == 1}
class="changeModuleAccess" rel="-1||view||{$profile.id_profile}"
{else}
disabled="disabled"
{/if} /> {l s='View'}
</th>
<th class="center">
<input type="checkbox"
id="ajax-ma-configure-master"
{if $access_edit == 1}
class="changeModuleAccess" rel="-1||configure||{$profile.id_profile}"
{else}
disabled="disabled"
{/if} /> {l s='Configure'}</th>
</tr>
{if !count($modules)}
<tr>
<td colspan="3">{l s='No modules are installed'}</td>
</tr>
{else}
{foreach $modules[$profile.id_profile] AS $module}
<tr>
<td>&raquo; {$module.name}</td>
<td>
<input type="checkbox"
value="1"
{if $module.view == true}checked="checked"{/if}
{if $access_edit == 1}
class="ajax-ma-view changeModuleAccess"
rel="{$module.id_module}||view||{$profile.id_profile}"
{else}
class="ajax-ma-view"
disabled="disabled"
{/if}
/>
</td>
<td>
<input type="checkbox"
value="1"
{if $module.configure == true}checked="checked"{/if}
{if $access_edit == 1}
class="ajax-ma-configure changeModuleAccess"
rel="{$module.id_module}||configure||{$profile.id_profile}"
{else}
class="ajax-ma-configure"
disabled="disabled"
{/if}
/>
</td>
</tr>
{/foreach}
{/if}
</table>
<div class="clear">&nbsp;</div>
{else}
{l s='Administrator permissions cannot be modified.'}
{/if} {/if}
{/foreach}
</div> {foreach $profiles as $profile}
{/foreach} <div class="profile-{$profile.id_profile} tab-profile" style="display:{if $profile.id_profile == $current_profile}block{else}none{/if}">
{if $profile.id_profile != $admin_profile}
<table class="table" id="table_{$profile.id_profile}">
<thead>
<tr>
<th>
{l s='Menus'}
</th>
<th>
<input type="checkbox" name="1" id="viewall"
{if $access_edit == 1}
rel="-1||{$profile.id_profile}||view||{$tabsize}||{count($tabs)}" class="ajaxPower"
{else}
disabled="disabled"
{/if} />
{l s='View'}
</th>
<th>
<input type="checkbox" name="1" id="addall"
{if $access_edit == 1}
rel="-1||{$profile.id_profile}||add||{$tabsize}||{count($tabs)}" class="ajaxPower"
{else}
disabled="disabled"
{/if} />
{l s='Add'}
</th>
<th>
<input type="checkbox" name="1" id="editall"
{if $access_edit == 1}
rel="-1||{$profile.id_profile}||edit||{$tabsize}||{count($tabs)}" class="ajaxPower"
{else}
disabled="disabled"
{/if} />
{l s='Edit'}
</th>
<th>
<input type="checkbox" name="1" id="deleteall"
{if $access_edit == 1}
rel="-1||{$profile.id_profile}||delete||{$tabsize}||{count($tabs)}" class="ajaxPower"
{else}
disabled="disabled"
{/if} />
{l s='Delete'}
</th>
<th>
<input type="checkbox" name="1" id="allall"
{if $access_edit == 1}
rel="-1||{$profile.id_profile}||all||{$tabsize}||{count($tabs)}" class="ajaxPower"
{else}
disabled="disabled"
{/if} />
{l s='All'}
</th>
</tr>
</thead>
<tbody>
{if !count($tabs)}
<tr>
<td colspan="6">{l s='No menu'}</td>
</tr>
{else}
{foreach $tabs AS $tab}
{assign var=access value=$accesses[$profile.id_profile]}
{if !$tab.id_parent OR $tab.id_parent == -1}
{assign var=is_child value=false}
{assign var=result_accesses value=0}
<tr{if !$is_child} class="parent"{/if}>
<td{if !$is_child} class="bold"{/if}>{if $is_child} &raquo; {/if}<strong>{$tab.name}</strong></td>
{foreach $perms as $perm}
{if $access_edit == 1}
<td>
<input type="checkbox"
id="{$perm}{$access[$tab.id_tab]['id_tab']}"
rel="{$access[$tab.id_tab]['id_tab']}||{$profile.id_profile}||{$perm}||{$tabsize}||{count($tabs)}"
class="ajaxPower {$perm} {$access[$tab.id_tab]['id_tab']}"
{if $access[$tab.id_tab][$perm] == 1}checked="checked"{/if}/>
</td>
{else}
<td>
<input type="checkbox"
disabled="disabled"
{if $access[$tab.id_tab][$perm] == 1}checked="checked"{/if}/>
</td>
{/if}
{assign var=result_accesses value=$result_accesses + $access[$tab.id_tab][$perm]}
{/foreach}
<td>
<input type="checkbox"
id='all{$access[$tab.id_tab]['id_tab']}'
{if $access_edit == 1}
rel="{$access[$tab.id_tab]['id_tab']}||{$profile.id_profile}||all||{$tabsize}||{count($tabs)}"
class="ajaxPower all {$access[$tab.id_tab]['id_tab']}"
{else}
class="all {$access[$tab.id_tab]['id_tab']}"
disabled="disabled"
{/if}
{if $result_accesses == 4}checked="checked"{/if}/>
</td>
</tr>
{foreach $tabs AS $child}
{if $child.id_parent === $tab.id_tab}
{if isset($access[$child.id_tab])}
{assign var=is_child value=true}
{assign var=result_accesses value=0}
<tr class="child-{$child.id_parent}">
<td{if !$is_child} class="bold"{/if}>{if $is_child} &raquo; {/if}{$child.name}</td>
{foreach $perms as $perm}
{if $access_edit == 1}
<td>
<input type="checkbox"
id="{$perm}{$access[$child.id_tab]['id_tab']}"
rel="{$access[$child.id_tab]['id_tab']}||{$profile.id_profile}||{$perm}||{$tabsize}||{count($tabs)}"
class="ajaxPower {$perm} {$access[$child.id_tab]['id_tab']}"
{if $access[$child.id_tab][$perm] == 1}checked="checked"{/if}/>
</td>
{else}
<td>
<input type="checkbox"
disabled="disabled"
{if $access[$child.id_tab][$perm] == 1}checked="checked"{/if}/>
</td>
{/if}
{assign var=result_accesses value=$result_accesses + $access[$child.id_tab][$perm]}
{/foreach}
<td>
<input type="checkbox"
id='all{$access[$child.id_tab]['id_tab']}'
{if $access_edit == 1}
rel="{$access[$child.id_tab]['id_tab']}||{$profile.id_profile}||all||{$tabsize}||{count($tabs)}"
class="ajaxPower all {$access[$child.id_tab]['id_tab']}"
{else}
class="all {$access[$child.id_tab]['id_tab']}"
disabled="disabled"
{/if}
{if $result_accesses == 4}checked="checked"{/if}/>
</td>
</tr>
{/if}
{/if}
{/foreach}
{/if}
{/foreach}
{/if}
</tbody>
</table>
<table class="table" id="table_module_{$profile.id_profile}">
<thead>
<tr>
<th>{l s='Modules'}</th>
<th>
<input type="checkbox"
id="ajax-ma-view-master"
{if $access_edit == 1}
class="changeModuleAccess" rel="-1||view||{$profile.id_profile}"
{else}
disabled="disabled"
{/if} /> {l s='View'}
</th>
<th>
<input type="checkbox"
id="ajax-ma-configure-master"
{if $access_edit == 1}
class="changeModuleAccess" rel="-1||configure||{$profile.id_profile}"
{else}
disabled="disabled"
{/if} /> {l s='Configure'}</th>
</tr>
</thead>
<tbody>
{if !count($modules)}
<tr>
<td colspan="3">{l s='No modules are installed'}</td>
</tr>
{else}
{foreach $modules[$profile.id_profile] AS $module}
<tr>
<td>&raquo; {$module.name}</td>
<td>
<input type="checkbox"
value="1"
{if $module.view == true}checked="checked"{/if}
{if $access_edit == 1}
class="ajax-ma-view changeModuleAccess"
rel="{$module.id_module}||view||{$profile.id_profile}"
{else}
class="ajax-ma-view"
disabled="disabled"
{/if}
/>
</td>
<td>
<input type="checkbox"
value="1"
{if $module.configure == true}checked="checked"{/if}
{if $access_edit == 1}
class="ajax-ma-configure changeModuleAccess"
rel="{$module.id_module}||configure||{$profile.id_profile}"
{else}
class="ajax-ma-configure"
disabled="disabled"
{/if}
/>
</td>
</tr>
{/foreach}
{/if}
</tbody>
</table>
{else}
{l s='Administrator permissions cannot be modified.'}
{/if}
</div>
{/foreach}
</fieldset>
</form> </form>
@@ -31,6 +31,7 @@ class AdminAccessControllerCore extends AdminController
public function __construct() public function __construct()
{ {
$this->bootstrap = true;
$this->table = 'access'; $this->table = 'access';
$this->className = 'Profile'; $this->className = 'Profile';
$this->multishop_context = Shop::CONTEXT_ALL; $this->multishop_context = Shop::CONTEXT_ALL;
@@ -29,6 +29,7 @@ class AdminAdminPreferencesControllerCore extends AdminController
public function __construct() public function __construct()
{ {
$this->bootstrap = true;
$this->className = 'Configuration'; $this->className = 'Configuration';
$this->table = 'configuration'; $this->table = 'configuration';
@@ -47,7 +48,7 @@ class AdminAdminPreferencesControllerCore extends AdminController
'fields' => array( 'fields' => array(
'PRESTASTORE_LIVE' => array( 'PRESTASTORE_LIVE' => array(
'title' => $this->l('Automatically check for module updates'), 'title' => $this->l('Automatically check for module updates'),
'desc' => $this->l('New modules and updates are displayed on the modules page.'), 'hint' => $this->l('New modules and updates are displayed on the modules page.'),
'validation' => 'isBool', 'validation' => 'isBool',
'cast' => 'intval', 'cast' => 'intval',
'type' => 'bool', 'type' => 'bool',
@@ -55,7 +56,7 @@ class AdminAdminPreferencesControllerCore extends AdminController
), ),
'PS_COOKIE_CHECKIP' => array( 'PS_COOKIE_CHECKIP' => array(
'title' => $this->l('Check the IP address on the cookie'), 'title' => $this->l('Check the IP address on the cookie'),
'desc' => $this->l('Check the IP address of the cookie in order to prevent your cookie from being stolen.'), 'hint' => $this->l('Check the IP address of the cookie in order to prevent your cookie from being stolen.'),
'validation' => 'isBool', 'validation' => 'isBool',
'cast' => 'intval', 'cast' => 'intval',
'type' => 'bool', 'type' => 'bool',
@@ -64,7 +65,7 @@ class AdminAdminPreferencesControllerCore extends AdminController
), ),
'PS_COOKIE_LIFETIME_FO' => array( 'PS_COOKIE_LIFETIME_FO' => array(
'title' => $this->l('Lifetime of Front Office cookies'), 'title' => $this->l('Lifetime of Front Office cookies'),
'desc' => $this->l('Indicate the number of hours'), 'hint' => $this->l('Indicate the number of hours'),
'validation' => 'isInt', 'validation' => 'isInt',
'cast' => 'intval', 'cast' => 'intval',
'type' => 'text', 'type' => 'text',
@@ -73,7 +74,7 @@ class AdminAdminPreferencesControllerCore extends AdminController
), ),
'PS_COOKIE_LIFETIME_BO' => array( 'PS_COOKIE_LIFETIME_BO' => array(
'title' => $this->l('Lifetime of Back Office cookies'), 'title' => $this->l('Lifetime of Back Office cookies'),
'desc' => $this->l('Indicate the number of hours'), 'hint' => $this->l('Indicate the number of hours'),
'validation' => 'isInt', 'validation' => 'isInt',
'cast' => 'intval', 'cast' => 'intval',
'type' => 'text', 'type' => 'text',
@@ -89,8 +90,11 @@ class AdminAdminPreferencesControllerCore extends AdminController
'fields' => array( 'fields' => array(
'PS_ATTACHMENT_MAXIMUM_SIZE' => array( 'PS_ATTACHMENT_MAXIMUM_SIZE' => array(
'title' => $this->l('Maximum size for attachment'), 'title' => $this->l('Maximum size for attachment'),
'desc' => $this->l('Set the maximum size allowed for attachment files (in MegaBytes).').' '.$this->l('Maximum:').' '. 'hint' => $this->l('Set the maximum size allowed for attachment files (in MegaBytes).'),
/***** TO DO - ajouter cette ligne dans le hint ?
.' '.$this->l('Maximum:').' '.
((int)str_replace('M', '', ini_get('post_max_size')) > (int)str_replace('M', '', ini_get('upload_max_filesize')) ? ini_get('upload_max_filesize') : ini_get('post_max_size')), ((int)str_replace('M', '', ini_get('post_max_size')) > (int)str_replace('M', '', ini_get('upload_max_filesize')) ? ini_get('upload_max_filesize') : ini_get('post_max_size')),
*****/
'validation' => 'isInt', 'validation' => 'isInt',
'cast' => 'intval', 'cast' => 'intval',
'type' => 'text', 'type' => 'text',
@@ -99,7 +103,7 @@ class AdminAdminPreferencesControllerCore extends AdminController
), ),
'PS_LIMIT_UPLOAD_FILE_VALUE' => array( 'PS_LIMIT_UPLOAD_FILE_VALUE' => array(
'title' => $this->l('File value upload limit'), 'title' => $this->l('File value upload limit'),
'desc' => $this->l('Define the limit upload for a downloadable product. This value has to be less than or equal to the maximum file upload allotted by your server. ').sprintf('(%s MB).', $upload_mb), 'hint' => $this->l('Define the limit upload for a downloadable product. This value has to be less than or equal to the maximum file upload allotted by your server. ').sprintf('(%s MB).', $upload_mb),
'validation' => 'isInt', 'validation' => 'isInt',
'cast' => 'intval', 'cast' => 'intval',
'type' => 'text', 'type' => 'text',
@@ -108,7 +112,7 @@ class AdminAdminPreferencesControllerCore extends AdminController
), ),
'PS_LIMIT_UPLOAD_IMAGE_VALUE' => array( 'PS_LIMIT_UPLOAD_IMAGE_VALUE' => array(
'title' => $this->l('Image value upload limit'), 'title' => $this->l('Image value upload limit'),
'desc' => $this->l('Define the limit upload for an image. This value has to be less than or equal to the maximum file upload allotted by your server. ').sprintf('(%s MB).', $upload_mb), 'hint' => $this->l('Define the limit upload for an image. This value has to be less than or equal to the maximum file upload allotted by your server. ').sprintf('(%s MB).', $upload_mb),
'validation' => 'isInt', 'validation' => 'isInt',
'cast' => 'intval', 'cast' => 'intval',
'type' => 'text', 'type' => 'text',
@@ -123,7 +127,7 @@ class AdminAdminPreferencesControllerCore extends AdminController
'fields' => array( 'fields' => array(
'PS_HELPBOX' => array( 'PS_HELPBOX' => array(
'title' => $this->l('Back Office help boxes'), 'title' => $this->l('Back Office help boxes'),
'desc' => $this->l('Allow yellow help boxes to be displayed under the form fields in the Back Office.'), 'hint' => $this->l('Allow yellow help boxes to be displayed under the form fields in the Back Office.'),
'validation' => 'isBool', 'validation' => 'isBool',
'cast' => 'intval', 'cast' => 'intval',
'type' => 'bool', 'type' => 'bool',
@@ -131,7 +135,7 @@ class AdminAdminPreferencesControllerCore extends AdminController
), ),
'PS_HIDE_OPTIMIZATION_TIPS' => array( 'PS_HIDE_OPTIMIZATION_TIPS' => array(
'title' => $this->l('Hide optimization tips'), 'title' => $this->l('Hide optimization tips'),
'desc' => $this->l('Hide optimization tips on the Back Office homepage'), 'hint' => $this->l('Hide optimization tips on the Back Office homepage'),
'validation' => 'isBool', 'validation' => 'isBool',
'cast' => 'intval', 'cast' => 'intval',
'type' => 'bool' 'type' => 'bool'
@@ -144,21 +148,21 @@ class AdminAdminPreferencesControllerCore extends AdminController
'fields' => array( 'fields' => array(
'PS_SHOW_NEW_ORDERS' => array( 'PS_SHOW_NEW_ORDERS' => array(
'title' => $this->l('Show notifications for new orders'), 'title' => $this->l('Show notifications for new orders'),
'desc' => $this->l('This will display notifications when new orders are made in your shop.'), 'hint' => $this->l('This will display notifications when new orders are made in your shop.'),
'validation' => 'isBool', 'validation' => 'isBool',
'cast' => 'intval', 'cast' => 'intval',
'type' => 'bool' 'type' => 'bool'
), ),
'PS_SHOW_NEW_CUSTOMERS' => array( 'PS_SHOW_NEW_CUSTOMERS' => array(
'title' => $this->l('Show notifications for new customers'), 'title' => $this->l('Show notifications for new customers'),
'desc' => $this->l('This will display notifications every time a new customer registers in your shop.'), 'hint' => $this->l('This will display notifications every time a new customer registers in your shop.'),
'validation' => 'isBool', 'validation' => 'isBool',
'cast' => 'intval', 'cast' => 'intval',
'type' => 'bool' 'type' => 'bool'
), ),
'PS_SHOW_NEW_MESSAGES' => array( 'PS_SHOW_NEW_MESSAGES' => array(
'title' => $this->l('Show notifications for new messages'), 'title' => $this->l('Show notifications for new messages'),
'desc' => $this->l('This will display notifications when new messages are posted in your shop.'), 'hint' => $this->l('This will display notifications when new messages are posted in your shop.'),
'validation' => 'isBool', 'validation' => 'isBool',
'cast' => 'intval', 'cast' => 'intval',
'type' => 'bool' 'type' => 'bool'
+15 -23
View File
@@ -39,6 +39,7 @@ class AdminEmployeesControllerCore extends AdminController
public function __construct() public function __construct()
{ {
$this->bootstrap = true;
$this->table = 'employee'; $this->table = 'employee';
$this->className = 'Employee'; $this->className = 'Employee';
$this->lang = false; $this->lang = false;
@@ -85,16 +86,15 @@ class AdminEmployeesControllerCore extends AdminController
'fields' => array( 'fields' => array(
'PS_PASSWD_TIME_BACK' => array( 'PS_PASSWD_TIME_BACK' => array(
'title' => $this->l('Password regeneration'), 'title' => $this->l('Password regeneration'),
'desc' => $this->l('Security: Minimum time to wait between two password changes.'), 'hint' => $this->l('Security: Minimum time to wait between two password changes.'),
'cast' => 'intval', 'cast' => 'intval',
'size' => 5,
'type' => 'text', 'type' => 'text',
'suffix' => ' '.$this->l('minutes'), 'suffix' => ' '.$this->l('minutes'),
'visibility' => Shop::CONTEXT_ALL 'visibility' => Shop::CONTEXT_ALL
), ),
'PS_BO_ALLOW_EMPLOYEE_FORM_LANG' => array( 'PS_BO_ALLOW_EMPLOYEE_FORM_LANG' => array(
'title' => $this->l('Memorize the language used in Admin panel forms'), 'title' => $this->l('Memorize the language used in Admin panel forms'),
'desc' => $this->l('Allow employees to select a specific language for the Admin panel form.'), 'hint' => $this->l('Allow employees to select a specific language for the Admin panel form.'),
'cast' => 'intval', 'cast' => 'intval',
'type' => 'select', 'type' => 'select',
'identifier' => 'value', 'identifier' => 'value',
@@ -165,21 +165,19 @@ class AdminEmployeesControllerCore extends AdminController
$this->fields_form = array( $this->fields_form = array(
'legend' => array( 'legend' => array(
'title' => $this->l('Employees'), 'title' => $this->l('Employees'),
'image' => '../img/admin/nav-user.gif' 'icon' => 'icon-user'
), ),
'input' => array( 'input' => array(
array( array(
'type' => 'text', 'type' => 'text',
'label' => $this->l('First Name:'), 'label' => $this->l('First Name:'),
'name' => 'firstname', 'name' => 'firstname',
'size' => 33,
'required' => true 'required' => true
), ),
array( array(
'type' => 'text', 'type' => 'text',
'label' => $this->l('Last Name:'), 'label' => $this->l('Last Name:'),
'name' => 'lastname', 'name' => 'lastname',
'size' => 33,
'required' => true 'required' => true
), ),
array( array(
@@ -187,8 +185,7 @@ class AdminEmployeesControllerCore extends AdminController
'label' => $this->l('Password:'), 'label' => $this->l('Password:'),
'name' => 'passwd', 'name' => 'passwd',
'required' => true, 'required' => true,
'size' => 33, 'hint' => ($obj->id ?
'desc' => ($obj->id ?
$this->l('Leave this field blank if you do not want to change your password.') : $this->l('Leave this field blank if you do not want to change your password.') :
$this->l('Minimum of eight characters (use only letters and numbers)').' -_') $this->l('Minimum of eight characters (use only letters and numbers)').' -_')
), ),
@@ -196,7 +193,6 @@ class AdminEmployeesControllerCore extends AdminController
'type' => 'text', 'type' => 'text',
'label' => $this->l('Email address:'), 'label' => $this->l('Email address:'),
'name' => 'email', 'name' => 'email',
'size' => 33,
'required' => true 'required' => true
), ),
array( array(
@@ -204,22 +200,20 @@ class AdminEmployeesControllerCore extends AdminController
'label' => $this->l('Admin panel color:'), 'label' => $this->l('Admin panel color:'),
'name' => 'bo_color', 'name' => 'bo_color',
'class' => 'color mColorPickerInput', 'class' => 'color mColorPickerInput',
'size' => 20, 'hint' => $this->l('Admin panel background will be displayed in this color (HTML colors only).').' "lightblue", "#CC6600")'
'desc' => $this->l('Admin panel background will be displayed in this color (HTML colors only).').' "lightblue", "#CC6600")'
), ),
array( array(
'type' => 'default_tab', 'type' => 'default_tab',
'label' => $this->l('Default page:'), 'label' => $this->l('Default page:'),
'name' => 'default_tab', 'name' => 'default_tab',
'desc' => $this->l('This page will be displayed just after login'), 'hint' => $this->l('This page will be displayed just after login'),
'options' => $this->tabs_list 'options' => $this->tabs_list
), ),
array( array(
'type' => 'text', 'type' => 'text',
'label' => $this->l('Back Office width'), 'label' => $this->l('Back Office width'),
'name' => 'bo_width', 'name' => 'bo_width',
'size' => 10, 'hint' => $this->l('Back Office width, in pixels. The value "0" means that the Back Office width will be flexible.')
'desc' => $this->l('Back Office width, in pixels. The value "0" means that the Back Office width will be flexible.')
), ),
array( array(
'type' => 'select', 'type' => 'select',
@@ -237,15 +231,14 @@ class AdminEmployeesControllerCore extends AdminController
'label' => $this->l('Theme:'), 'label' => $this->l('Theme:'),
'name' => 'bo_theme', 'name' => 'bo_theme',
'options' => array('query' => $this->themes), 'options' => array('query' => $this->themes),
'desc' => $this->l('Back Office theme') 'hint' => $this->l('Back Office theme')
), ),
array( array(
'type' => 'radio', 'type' => 'switch',
'label' => $this->l('Show screencast at login:'), 'label' => $this->l('Show screencast at login:'),
'name' => 'bo_show_screencast', 'name' => 'bo_show_screencast',
'desc' => $this->l('Display the welcome video in the Admin panel dashboard at log in.'), 'hint' => $this->l('Display the welcome video in the Admin panel dashboard at log in.'),
'required' => false, 'required' => false,
'class' => 't',
'is_bool' => true, 'is_bool' => true,
'values' => array( 'values' => array(
array( array(
@@ -266,11 +259,10 @@ class AdminEmployeesControllerCore extends AdminController
if ((int)$this->tabAccess['edit'] && !$this->restrict_edition) if ((int)$this->tabAccess['edit'] && !$this->restrict_edition)
{ {
$this->fields_form['input'][] = array( $this->fields_form['input'][] = array(
'type' => 'radio', 'type' => 'switch',
'label' => $this->l('Status:'), 'label' => $this->l('Status:'),
'name' => 'active', 'name' => 'active',
'required' => false, 'required' => false,
'class' => 't',
'is_bool' => true, 'is_bool' => true,
'values' => array( 'values' => array(
array( array(
@@ -284,7 +276,7 @@ class AdminEmployeesControllerCore extends AdminController
'label' => $this->l('Disabled') 'label' => $this->l('Disabled')
) )
), ),
'desc' => $this->l('Allow or disallow this employee to log into the Admin panel.') 'hint' => $this->l('Allow or disallow this employee to log into the Admin panel.')
); );
// if employee is not SuperAdmin (id_profile = 1), don't make it possible to select the admin profile // if employee is not SuperAdmin (id_profile = 1), don't make it possible to select the admin profile
@@ -317,7 +309,7 @@ class AdminEmployeesControllerCore extends AdminController
$this->fields_form['input'][] = array( $this->fields_form['input'][] = array(
'type' => 'shop', 'type' => 'shop',
'label' => $this->l('Shop association:'), 'label' => $this->l('Shop association:'),
'desc' => $this->l('Select the shops the employee is allowed to access'), 'hint' => $this->l('Select the shops the employee is allowed to access'),
'name' => 'checkBoxShopAsso', 'name' => 'checkBoxShopAsso',
); );
} }
@@ -325,7 +317,7 @@ class AdminEmployeesControllerCore extends AdminController
$this->fields_form['submit'] = array( $this->fields_form['submit'] = array(
'title' => $this->l('Save '), 'title' => $this->l('Save '),
'class' => 'button' 'class' => 'btn btn-default'
); );
$this->fields_value['passwd'] = false; $this->fields_value['passwd'] = false;
@@ -28,6 +28,7 @@ class AdminProfilesControllerCore extends AdminController
{ {
public function __construct() public function __construct()
{ {
$this->bootstrap = true;
$this->context = Context::getContext(); $this->context = Context::getContext();
$this->table = 'profile'; $this->table = 'profile';
$this->className = 'Profile'; $this->className = 'Profile';
@@ -45,8 +46,7 @@ class AdminProfilesControllerCore extends AdminController
$this->fields_list = array( $this->fields_list = array(
'id_profile' => array( 'id_profile' => array(
'title' => $this->l('ID'), 'title' => $this->l('ID'),
'align' => 'center', 'align' => 'center'
'width' => 25
), ),
'name' => array('title' => $this->l('Name')) 'name' => array('title' => $this->l('Name'))
); );
@@ -56,21 +56,20 @@ class AdminProfilesControllerCore extends AdminController
$this->fields_form = array( $this->fields_form = array(
'legend' => array( 'legend' => array(
'title' => $this->l('Profile'), 'title' => $this->l('Profile'),
'image' => '../img/admin/profiles.png' 'icon' => 'icon-group'
), ),
'input' => array( 'input' => array(
array( array(
'type' => 'text', 'type' => 'text',
'label' => $this->l('Name:'), 'label' => $this->l('Name:'),
'name' => 'name', 'name' => 'name',
'size' => 33,
'required' => true, 'required' => true,
'lang' => true, 'lang' => true,
) )
), ),
'submit' => array( 'submit' => array(
'title' => $this->l('Save '), 'title' => $this->l('Save '),
'class' => 'button' 'class' => 'btn btn-default'
) )
); );
@@ -28,6 +28,7 @@ class AdminQuickAccessesControllerCore extends AdminController
{ {
public function __construct() public function __construct()
{ {
$this->bootstrap = true;
$this->table = 'quick_access'; $this->table = 'quick_access';
$this->className = 'QuickAccess'; $this->className = 'QuickAccess';
$this->lang = true; $this->lang = true;
@@ -45,20 +46,16 @@ class AdminQuickAccessesControllerCore extends AdminController
$this->fields_list = array( $this->fields_list = array(
'id_quick_access' => array( 'id_quick_access' => array(
'title' => $this->l('ID'), 'title' => $this->l('ID'),
'align' => 'center', 'align' => 'center'
'width' => 25
), ),
'name' => array( 'name' => array(
'title' => $this->l('Name'), 'title' => $this->l('Name')
'width' => 200
), ),
'link' => array( 'link' => array(
'title' => $this->l('Link'), 'title' => $this->l('Link')
'width' => 300
), ),
'new_window' => array( 'new_window' => array(
'title' => $this->l('New window'), 'title' => $this->l('New window'),
'width' => 70,
'align' => 'center', 'align' => 'center',
'type' => 'bool', 'type' => 'bool',
'activeVisu' => 'new_window' 'activeVisu' => 'new_window'
@@ -68,7 +65,7 @@ class AdminQuickAccessesControllerCore extends AdminController
$this->fields_form = array( $this->fields_form = array(
'legend' => array( 'legend' => array(
'title' => $this->l('Quick Access menu'), 'title' => $this->l('Quick Access menu'),
'image' => '../img/admin/quick.gif' 'icon' => 'icon-align-justify'
), ),
'input' => array( 'input' => array(
array( array(
@@ -76,26 +73,23 @@ class AdminQuickAccessesControllerCore extends AdminController
'label' => $this->l('Name:'), 'label' => $this->l('Name:'),
'name' => 'name', 'name' => 'name',
'lang' => true, 'lang' => true,
'size' => 33,
'maxlength' => 32, 'maxlength' => 32,
'required' => true, 'required' => true,
'hint' => $this->l('Forbidden characters:').' <>;=#{}' 'hint' => $this->l('Forbidden characters:').' &lt;&gt;;=#{}'
), ),
array( array(
'type' => 'text', 'type' => 'text',
'label' => $this->l('URL:'), 'label' => $this->l('URL:'),
'name' => 'link', 'name' => 'link',
'size' => 60,
'maxlength' => 128, 'maxlength' => 128,
'required' => true, 'required' => true,
'desc' => $this->l('If it\'s a URL that comes from your Back Office, you must NOT use a security token.') 'hint' => $this->l('If it\'s a URL that comes from your Back Office, you must NOT use a security token.')
), ),
array( array(
'type' => 'radio', 'type' => 'switch',
'label' => $this->l('Open in new window:'), 'label' => $this->l('Open in new window:'),
'name' => 'new_window', 'name' => 'new_window',
'required' => false, 'required' => false,
'class' => 't',
'values' => array( 'values' => array(
array( array(
'id' => 'new_window_on', 'id' => 'new_window_on',
+9 -14
View File
@@ -30,6 +30,7 @@ class AdminTabsControllerCore extends AdminController
public function __construct() public function __construct()
{ {
$this->bootstrap = true;
$this->context = Context::getContext(); $this->context = Context::getContext();
$this->multishop_context = Shop::CONTEXT_ALL; $this->multishop_context = Shop::CONTEXT_ALL;
$this->table = 'tab'; $this->table = 'tab';
@@ -45,12 +46,10 @@ class AdminTabsControllerCore extends AdminController
$this->fields_list = array( $this->fields_list = array(
'id_tab' => array( 'id_tab' => array(
'title' => $this->l('ID'), 'title' => $this->l('ID')
'width' => 25
), ),
'name' => array( 'name' => array(
'title' => $this->l('Name'), 'title' => $this->l('Name')
'width' => 200
), ),
'logo' => array( 'logo' => array(
'title' => $this->l('Icon'), 'title' => $this->l('Icon'),
@@ -64,7 +63,6 @@ class AdminTabsControllerCore extends AdminController
), ),
'active' => array( 'active' => array(
'title' => $this->l('Enabled'), 'title' => $this->l('Enabled'),
'width' => 70,
'align' => 'center', 'align' => 'center',
'active' => 'status', 'active' => 'status',
'type' => 'bool', 'type' => 'bool',
@@ -72,7 +70,6 @@ class AdminTabsControllerCore extends AdminController
), ),
'position' => array( 'position' => array(
'title' => $this->l('Position'), 'title' => $this->l('Position'),
'width' => 40,
'filter_key' => 'a!position', 'filter_key' => 'a!position',
'position' => 'position' 'position' => 'position'
) )
@@ -104,7 +101,7 @@ class AdminTabsControllerCore extends AdminController
$this->fields_form = array( $this->fields_form = array(
'legend' => array( 'legend' => array(
'title' => $this->l('Menus'), 'title' => $this->l('Menus'),
'image' => '../img/admin/tab.gif' 'icon' => 'icon-list-ul'
), ),
'input' => array( 'input' => array(
array( array(
@@ -117,9 +114,8 @@ class AdminTabsControllerCore extends AdminController
'label' => $this->l('Name:'), 'label' => $this->l('Name:'),
'name' => 'name', 'name' => 'name',
'lang' => true, 'lang' => true,
'size' => 33,
'required' => true, 'required' => true,
'hint' => $this->l('Invalid characters:').' <>;=#{}' 'hint' => $this->l('Invalid characters:').' &lt;&gt;;=#{}'
), ),
array( array(
'type' => 'text', 'type' => 'text',
@@ -136,14 +132,13 @@ class AdminTabsControllerCore extends AdminController
'type' => 'file', 'type' => 'file',
'label' => $this->l('Icon:'), 'label' => $this->l('Icon:'),
'name' => 'icon', 'name' => 'icon',
'desc' => $this->l('Upload a logo from your computer (.gif, .jpg, .jpeg or .png).') 'hint' => $this->l('Upload a logo from your computer (.gif, .jpg, .jpeg or .png).')
), ),
array( array(
'type' => 'radio', 'type' => 'switch',
'label' => $this->l('Status:'), 'label' => $this->l('Status:'),
'name' => 'active', 'name' => 'active',
'required' => false, 'required' => false,
'class' => 't',
'is_bool' => true, 'is_bool' => true,
'values' => array( 'values' => array(
array( array(
@@ -157,12 +152,12 @@ class AdminTabsControllerCore extends AdminController
'label' => $this->l('Disabled') 'label' => $this->l('Disabled')
) )
), ),
'desc' => $this->l('Show or hide menu.') 'hint' => $this->l('Show or hide menu.')
), ),
), ),
'submit' => array( 'submit' => array(
'title' => $this->l(' Save '), 'title' => $this->l(' Save '),
'class' => 'button' 'class' => 'btn btn-default'
) )
); );