// WIP customer

This commit is contained in:
Kevin Granger committed 2013-07-29 16:16:10 +02:00
1 parent 2ac6ada03d
commit ae225dce4c
6 files changed
+154 -131

No files matched your search

@@ -40,7 +40,11 @@
{block name="field"} {block name="field"}
{if $input.type == 'text_customer'} {if $input.type == 'text_customer'}
{if isset($customer)} {if isset($customer)}
<div class="margin-form"><a style="display: block; padding-top: 4px;" href="?tab=AdminCustomers&id_customer={$customer->id}&viewcustomer&token={$tokenCustomer}">{$customer->lastname} {$customer->firstname} ({$customer->email})</a></div> <div>
<a href="?tab=AdminCustomers&id_customer={$customer->id}&viewcustomer&token={$tokenCustomer}">
{$customer->lastname} {$customer->firstname} ({$customer->email})
</a>
</div>
<input type="hidden" name="id_customer" value="{$customer->id}" /> <input type="hidden" name="id_customer" value="{$customer->id}" />
<input type="hidden" name="email" value="{$customer->email}" /> <input type="hidden" name="email" value="{$customer->email}" />
{else} {else}
@@ -79,8 +83,10 @@
} }
}); });
</script> </script>
<div class="margin-form"> <div class="margin-form">
<input type="text" size="33" name="email" value="{$fields_value[$input.name]|escape:'htmlall':'UTF-8'}" style="text-transform: lowercase;" /> <sup>*</sup> <input type="text" name="email" value="{$fields_value[$input.name]|escape:'htmlall':'UTF-8'}"/>
<sup>*</sup>
</div> </div>
{/if} {/if}
{else} {else}
@@ -69,9 +69,9 @@
<div class="row"> <div class="row">
<div id="conf_id_{$key}" {if $field['is_invisible']} class="isInvisible"{/if}> <div id="conf_id_{$key}" {if $field['is_invisible']} class="isInvisible"{/if}>
{if !$categoryData['hide_multishop_checkbox'] && $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 col-lg-6"> <div class="preference_default_multishop col-lg-9">
<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>
{/if} {/if}
{block name="label"} {block name="label"}
{if isset($field['title']) && isset($field['desc'])} {if isset($field['title']) && isset($field['desc'])}
@@ -88,7 +88,7 @@
{block name="input"} {block name="input"}
{if $field['type'] == 'select'} {if $field['type'] == 'select'}
<div class="col-lg-6"> <div class="col-lg-9">
{if $field['list']} {if $field['list']}
<select name="{$key}"{if isset($field['js'])} onchange="{$field['js']}"{/if} id="{$key}" {if isset($field['size'])} size="{$field['size']}"{/if}> <select name="{$key}"{if isset($field['js'])} onchange="{$field['js']}"{/if} id="{$key}" {if isset($field['size'])} size="{$field['size']}"{/if}>
{foreach $field['list'] AS $k => $option} {foreach $field['list'] AS $k => $option}
@@ -120,7 +120,7 @@
{elseif $field['type'] == 'radio'} {elseif $field['type'] == 'radio'}
{foreach $field['choices'] AS $k => $v} {foreach $field['choices'] AS $k => $v}
<div class="col-lg-6"> <div class="col-lg-9">
<p class="radio"> <p class="radio">
<input type="radio" name="{$key}" id="{$key}_{$k}" value="{$k}"{if $k == $field['value']} checked="checked"{/if}{if isset($field['js'][$k])} {$field['js'][$k]}{/if}/> <input type="radio" name="{$key}" id="{$key}_{$k}" value="{$k}"{if $k == $field['value']} checked="checked"{/if}{if isset($field['js'][$k])} {$field['js'][$k]}{/if}/>
<label class="col-lg-3" for="{$key}_{$k}"> {$v}</label> <label class="col-lg-3" for="{$key}_{$k}"> {$v}</label>
@@ -129,7 +129,7 @@
{/foreach} {/foreach}
{elseif $field['type'] == 'checkbox'} {elseif $field['type'] == 'checkbox'}
{foreach $field['choices'] AS $k => $v} {foreach $field['choices'] AS $k => $v}
<div class="col-lg-6"> <div class="col-lg-9">
<p class="checkbox"> <p class="checkbox">
<input type="checkbox" name="{$key}" id="{$key}{$k}_on" value="{$k|intval}"{if $k == $field['value']} checked="checked"{/if}{if isset($field['js'][$k])} {$field['js'][$k]}{/if}/> <input type="checkbox" name="{$key}" id="{$key}{$k}_on" value="{$k|intval}"{if $k == $field['value']} checked="checked"{/if}{if isset($field['js'][$k])} {$field['js'][$k]}{/if}/>
<label class="col-lg-3" for="{$key}{$k}_on"> {$v}</label> <label class="col-lg-3" for="{$key}{$k}_on"> {$v}</label>
@@ -137,52 +137,98 @@
</div> </div>
{/foreach} {/foreach}
{elseif $field['type'] == 'text'} {elseif $field['type'] == 'text'}
<div class="col-lg-6"> <div class="col-lg-9">
<input type="{$field['type']}"{if isset($field['id'])} id="{$field['id']}"{/if} size="{if isset($field['size'])}{$field['size']|intval}{else}5{/if}" name="{$key}" value="{$field['value']|escape:'htmlall':'UTF-8'}" {if isset($field['autocomplete']) && !$field['autocomplete']}autocomplete="off"{/if}/> <input type="{$field['type']}"{if isset($field['id'])} id="{$field['id']}"{/if} size="{if isset($field['size'])}{$field['size']|intval}{else}5{/if}" name="{$key}" value="{$field['value']|escape:'htmlall':'UTF-8'}" {if isset($field['autocomplete']) && !$field['autocomplete']}autocomplete="off"{/if}/>
{if isset($field['suffix'])}&nbsp;{$field['suffix']|strval}{/if} {if isset($field['suffix'])}&nbsp;{$field['suffix']|strval}{/if}
</div> </div>
{elseif $field['type'] == 'password'} {elseif $field['type'] == 'password'}
<div class="col-lg-6"> <div class="col-lg-9">
<input type="{$field['type']}"{if isset($field['id'])} id="{$field['id']}"{/if} size="{if isset($field['size'])}{$field['size']|intval}{else}5{/if}" name="{$key}" value="" {if isset($field['autocomplete']) && !$field['autocomplete']}autocomplete="off"{/if} /> <input type="{$field['type']}"{if isset($field['id'])} id="{$field['id']}"{/if} size="{if isset($field['size'])}{$field['size']|intval}{else}5{/if}" name="{$key}" value="" {if isset($field['autocomplete']) && !$field['autocomplete']}autocomplete="off"{/if} />
{if isset($field['suffix'])}&nbsp;{$field['suffix']|strval}{/if} {if isset($field['suffix'])}&nbsp;{$field['suffix']|strval}{/if}
</div> </div>
{elseif $field['type'] == 'textarea'} {elseif $field['type'] == 'textarea'}
<div class="col-lg-6"> <div class="col-lg-9">
<textarea name={$key} cols="{$field['cols']}" rows="{$field['rows']}">{$field['value']|escape:'htmlall':'UTF-8'}</textarea> <textarea name={$key} cols="{$field['cols']}" rows="{$field['rows']}">{$field['value']|escape:'htmlall':'UTF-8'}</textarea>
</div> </div>
{elseif $field['type'] == 'file'} {elseif $field['type'] == 'file'}
{if isset($field['thumb']) && $field['thumb']} {if isset($field['thumb']) && $field['thumb']}
<div class="col-lg-6"> <div class="col-lg-9">
<img src="{$field['thumb']}" alt="{$field['title']}" title="{$field['title']}" /> <img src="{$field['thumb']}" alt="{$field['title']}" title="{$field['title']}" />
</div> </div>
{/if} {/if}
<div class="col-lg-6"> <div class="col-lg-9">
<input type="file" name="{$key}" /> <input type="file" name="{$key}" />
</div> </div>
{elseif $field['type'] == 'color'} {elseif $field['type'] == 'color'}
<div class="col-lg-6"> <div class="col-lg-9">
<input type="color" size="{$field['size']}" data-hex="true" {if isset($input.class)}class="{$field['class']}" {else}class="color mColorPickerInput"{/if} name="{$field['name']}" class="{if isset($field['class'])}{$field['class']}{/if}" value="{$field['value']|escape:'htmlall':'UTF-8'}" /> <input type="color" size="{$field['size']}" data-hex="true" {if isset($input.class)}class="{$field['class']}" {else}class="color mColorPickerInput"{/if} name="{$field['name']}" class="{if isset($field['class'])}{$field['class']}{/if}" value="{$field['value']|escape:'htmlall':'UTF-8'}" />
</div> </div>
{elseif $field['type'] == 'price'} {elseif $field['type'] == 'price'}
<div class="col-lg-6"> <div class="col-lg-9">
{$currency_left_sign}<input type="text" size="{if isset($field['size'])}{$field['size']|intval}{else}5{/if}" name="{$key}" value="{$field['value']|escape:'htmlall':'UTF-8'}" />{$currency_right_sign} {l s='(tax excl.)'} {$currency_left_sign}<input type="text" size="{if isset($field['size'])}{$field['size']|intval}{else}5{/if}" name="{$key}" value="{$field['value']|escape:'htmlall':'UTF-8'}" />{$currency_right_sign} {l s='(tax excl.)'}
</div> </div>
{elseif $field['type'] == 'textLang' || $field['type'] == 'textareaLang' || $field['type'] == 'selectLang'} {elseif $field['type'] == 'textLang' || $field['type'] == 'textareaLang' || $field['type'] == 'selectLang'}
{if $field['type'] == 'textLang'} {if $field['type'] == 'textLang'}
{foreach $field['languages'] AS $id_lang => $value} <div class="col-lg-9">
<div id="{$key}_{$id_lang}" style="display: {if $id_lang == $current_id_lang}block{else}none{/if};" class="col-lg-1"> <div class="row">
<input type="text" size="{if isset($field['size'])}{$field['size']|intval}{else}5{/if}" name="{$key}_{$id_lang}" value="{$value|escape:'htmlall':'UTF-8'}" /> {foreach $field['languages'] AS $id_lang => $value}
<div class="input-group col-lg-12 translatable-field lang-{$id_lang}" {if $id_lang != $current_id_lang}style="display:none;"{/if}>
<input type="text"
name="{$key}_{$id_lang}"
value="{$value|escape:'htmlall':'UTF-8'}"
{if isset($input.class)}class="{$input.class}"{/if}
/>
<div class="input-group-btn">
<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown">
<img src="{$base_url}/img/l/{$id_lang|intval}.jpg" alt="">
<!-- name -->
<span class="caret"></span>
</button>
<ul class="dropdown-menu">
{foreach $languages as $language}
<li>
<a href="javascript:hideOtherLanguage({$language.id_lang});"><img src="{$base_url}/img/l/{$language.id_lang|intval}.jpg" alt=""> {$language.name}</a>
</li>
{/foreach}
</ul>
</div>
</div>
{/foreach}
</div> </div>
{/foreach} </div>
{elseif $field['type'] == 'textareaLang'} {elseif $field['type'] == 'textareaLang'}
{foreach $field['languages'] AS $id_lang => $value} <div class="col-lg-9">
<div id="{$key}_{$id_lang}" style="display: {if $id_lang == $current_id_lang}block{else}none{/if};" class="col-lg-6"> {foreach $field['languages'] AS $id_lang => $value}
<textarea rows="{$field['rows']}" cols="{$field['cols']|intval}" name="{$key}_{$id_lang}">{$value|replace:'\r\n':"\n"}</textarea> <div class="row translatable-field lang-{$id_lang}" {if $id_lang != $current_id_lang}style="display:none;"{/if}>
</div> <div id="{$key}_{$id_lang}" class="col-lg-10" >
{/foreach} <textarea name="{$key}_{$id_lang}">{$value|replace:'\r\n':"\n"}</textarea>
</div>
<div class="input-group-btn col-lg-2">
<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown">
<img src="{$base_url}/img/l/{$id_lang|intval}.jpg" alt="">
<!-- name -->
<span class="caret"></span>
</button>
<ul class="dropdown-menu">
{foreach $languages as $language}
<li>
<a href="javascript:hideOtherLanguage({$language.id_lang});"><img src="{$base_url}/img/l/{$language.id_lang|intval}.jpg" alt=""> {$language.name}</a>
</li>
{/foreach}
</ul>
</div>
</div>
{/foreach}
</div>
{elseif $field['type'] == 'selectLang'} {elseif $field['type'] == 'selectLang'}
{foreach $languages as $language} {foreach $languages as $language}
<div id="{$key}_{$language.id_lang}" style="display: {if $language.id_lang == $current_id_lang}block{else}none{/if};" class="col-lg-6"> <div id="{$key}_{$language.id_lang}" style="display: {if $language.id_lang == $current_id_lang}block{else}none{/if};" class="col-lg-9">
<select name="{$key}_{$language.iso_code|upper}"> <select name="{$key}_{$language.iso_code|upper}">
{foreach $field['list'] AS $k => $v} {foreach $field['list'] AS $k => $v}
<option value="{if isset($v.cast)}{$v.cast[$v[$field.identifier]]}{else}{$v[$field.identifier]}{/if}" <option value="{if isset($v.cast)}{$v.cast[$v[$field.identifier]]}{else}{$v[$field.identifier]}{/if}"
@@ -192,22 +238,25 @@
{/foreach} {/foreach}
</select> </select>
</div> </div>
{/foreach} {/foreach}
{/if} {/if}
{if count($languages) > 1}
{* TO DO - ajouter les langues*} <!--
<div class="displayed_flag"> {if count($languages) > 1}
<img src="../img/l/{$current_id_lang}.jpg" class="pointer" id="language_current_{$key}" onclick="toggleLanguageFlags(this);" /> <div class="displayed_flag">
</div> <img src="../img/l/{$current_id_lang}.jpg" class="pointer" id="language_current_{$key}" onclick="toggleLanguageFlags(this);" />
<div id="languages_{$key}" class="language_flags"> </div>
{l s='Choose language:'}<br /><br /> <div id="languages_{$key}" class="language_flags">
{foreach $languages as $language}
<img src="../img/l/{$language.id_lang}.jpg" class="pointer" alt="{$language.name}" title="{$language.name}" onclick="changeLanguage('{$key}', '{if isset($custom_key)}{$custom_key}{else}{$key}{/if}', {$language.id_lang}, '{$language.iso_code}');" /> {l s='Choose language:'}
{/foreach}
</div> {foreach $languages as $language}
{/if} <img src="../img/l/{$language.id_lang}.jpg" class="pointer" alt="{$language.name}" title="{$language.name}" onclick="changeLanguage('{$key}', '{if isset($custom_key)}{$custom_key}{else}{$key}{/if}', {$language.id_lang}, '{$language.iso_code}');" />
{/foreach}
</div>
{/if}
-->
{/if} {/if}
{if isset($field['required']) && $field['required'] && $field['type'] != 'radio'} {if isset($field['required']) && $field['required'] && $field['type'] != 'radio'}
+17 -31
View File
@@ -31,6 +31,7 @@ class AdminAddressesControllerCore extends AdminController
public function __construct() public function __construct()
{ {
$this->bootstrap = true;
$this->required_database = true; $this->required_database = true;
$this->required_fields = array('company','address2', 'postcode', 'other', 'phone', 'phone_mobile', 'vat_number', 'dni'); $this->required_fields = array('company','address2', 'postcode', 'other', 'phone', 'phone_mobile', 'vat_number', 'dni');
$this->table = 'address'; $this->table = 'address';
@@ -54,13 +55,13 @@ class AdminAddressesControllerCore extends AdminController
$this->countries_array[$country['id_country']] = $country['name']; $this->countries_array[$country['id_country']] = $country['name'];
$this->fields_list = array( $this->fields_list = array(
'id_address' => array('title' => $this->l('ID'), 'align' => 'center', 'width' => 25), 'id_address' => array('title' => $this->l('ID'), 'align' => 'center'),
'firstname' => array('title' => $this->l('First Name'), 'width' => 120, 'filter_key' => 'a!firstname'), 'firstname' => array('title' => $this->l('First Name'), 'filter_key' => 'a!firstname'),
'lastname' => array('title' => $this->l('Last Name'), 'width' => 140, 'filter_key' => 'a!lastname'), 'lastname' => array('title' => $this->l('Last Name'), 'filter_key' => 'a!lastname'),
'address1' => array('title' => $this->l('Address')), 'address1' => array('title' => $this->l('Address')),
'postcode' => array('title' => $this->l('Zip/Postal Code'), 'align' => 'right', 'width' => 80), 'postcode' => array('title' => $this->l('Zip/Postal Code'), 'align' => 'right'),
'city' => array('title' => $this->l('City'), 'width' => 150), 'city' => array('title' => $this->l('City')),
'country' => array('title' => $this->l('Country'), 'width' => 100, 'type' => 'select', 'list' => $this->countries_array, 'filter_key' => 'cl!id_country')); 'country' => array('title' => $this->l('Country'), 'type' => 'select', 'list' => $this->countries_array, 'filter_key' => 'cl!id_country'));
parent::__construct(); parent::__construct();
@@ -87,29 +88,26 @@ class AdminAddressesControllerCore extends AdminController
$this->fields_form = array( $this->fields_form = array(
'legend' => array( 'legend' => array(
'title' => $this->l('Addresses'), 'title' => $this->l('Addresses'),
'image' => '../img/admin/contact.gif' 'icon' => 'icon-envelope-alt'
), ),
'input' => array( 'input' => array(
array( array(
'type' => 'text_customer', 'type' => 'text_customer',
'label' => $this->l('Customer'), 'label' => $this->l('Customer'),
'name' => 'id_customer', 'name' => 'id_customer',
'size' => 33,
'required' => false, 'required' => false,
), ),
array( array(
'type' => 'text', 'type' => 'text',
'label' => $this->l('Identification Number'), 'label' => $this->l('Identification Number'),
'name' => 'dni', 'name' => 'dni',
'size' => 30,
'required' => false, 'required' => false,
'desc' => $this->l('DNI / NIF / NIE') 'hint' => $this->l('DNI / NIF / NIE')
), ),
array( array(
'type' => 'text', 'type' => 'text',
'label' => $this->l('Address alias'), 'label' => $this->l('Address alias'),
'name' => 'alias', 'name' => 'alias',
'size' => 33,
'required' => true, 'required' => true,
'hint' => $this->l('Invalid characters:').' <>;=#{}' 'hint' => $this->l('Invalid characters:').' <>;=#{}'
), ),
@@ -117,30 +115,26 @@ class AdminAddressesControllerCore extends AdminController
'type' => 'text', 'type' => 'text',
'label' => $this->l('Home phone'), 'label' => $this->l('Home phone'),
'name' => 'phone', 'name' => 'phone',
'size' => 33,
'required' => false, 'required' => false,
), ),
array( array(
'type' => 'text', 'type' => 'text',
'label' => $this->l('Mobile phone'), 'label' => $this->l('Mobile phone'),
'name' => 'phone_mobile', 'name' => 'phone_mobile',
'size' => 33,
'required' => false, 'required' => false,
'desc' => Configuration::get('PS_ONE_PHONE_AT_LEAST')? sprintf($this->l('You must register at least one phone number %s'), '<sup>*</sup>') : '' 'hint' => Configuration::get('PS_ONE_PHONE_AT_LEAST')? sprintf($this->l('You must register at least one phone number %s')) : ''
), ),
array( array(
'type' => 'textarea', 'type' => 'textarea',
'label' => $this->l('Other'), 'label' => $this->l('Other'),
'name' => 'other', 'name' => 'other',
'cols' => 36,
'rows' => 4,
'required' => false, 'required' => false,
'hint' => $this->l('Forbidden characters:').' <>;=#{}<span class="hint-pointer">&nbsp;</span>' 'hint' => $this->l('Forbidden characters:').' <>;=#{}<span class="hint-pointer">&nbsp;</span>'
), ),
), ),
'submit' => array( 'submit' => array(
'title' => $this->l('Save '), 'title' => $this->l('Save '),
'class' => 'button' 'class' => 'btn btn-primary'
) )
); );
$id_customer = (int)Tools::getValue('id_customer'); $id_customer = (int)Tools::getValue('id_customer');
@@ -172,15 +166,13 @@ class AdminAddressesControllerCore extends AdminController
'type' => 'text', 'type' => 'text',
'label' => $this->l('Company'), 'label' => $this->l('Company'),
'name' => 'company', 'name' => 'company',
'size' => 33,
'required' => false, 'required' => false,
'hint' => $this->l('Invalid characters:').' <>;=#{}<span class="hint-pointer">&nbsp;</span>' 'hint' => $this->l('Invalid characters:').' &lt;&gt;;=#{}'
); );
$temp_fields[] = array( $temp_fields[] = array(
'type' => 'text', 'type' => 'text',
'label' => $this->l('VAT number'), 'label' => $this->l('VAT number'),
'name' => 'vat_number', 'name' => 'vat_number'
'size' => 33,
); );
} }
else if ($addr_field_item == 'lastname') else if ($addr_field_item == 'lastname')
@@ -197,9 +189,8 @@ class AdminAddressesControllerCore extends AdminController
'type' => 'text', 'type' => 'text',
'label' => $this->l('Last Name'), 'label' => $this->l('Last Name'),
'name' => 'lastname', 'name' => 'lastname',
'size' => 33,
'required' => true, 'required' => true,
'hint' => $this->l('Invalid characters:').' 0-9!<>,;?=+()@#"�{}_$%:<span class="hint-pointer">&nbsp;</span>', 'hint' => $this->l('Invalid characters:').' 0-9!&lt;&gt;,;?=+()@#"�{}_$%:',
'default_value' => $default_value, 'default_value' => $default_value,
); );
} }
@@ -217,9 +208,8 @@ class AdminAddressesControllerCore extends AdminController
'type' => 'text', 'type' => 'text',
'label' => $this->l('First Name'), 'label' => $this->l('First Name'),
'name' => 'firstname', 'name' => 'firstname',
'size' => 33,
'required' => true, 'required' => true,
'hint' => $this->l('Invalid characters:').' 0-9!<>,;?=+()@#"�{}_$%:<span class="hint-pointer">&nbsp;</span>', 'hint' => $this->l('Invalid characters:').' 0-9!&lt;&gt;,;?=+()@#"�{}_$%:',
'default_value' => $default_value, 'default_value' => $default_value,
); );
} }
@@ -229,7 +219,6 @@ class AdminAddressesControllerCore extends AdminController
'type' => 'text', 'type' => 'text',
'label' => $this->l('Address'), 'label' => $this->l('Address'),
'name' => 'address1', 'name' => 'address1',
'size' => 33,
'required' => true, 'required' => true,
); );
} }
@@ -239,7 +228,6 @@ class AdminAddressesControllerCore extends AdminController
'type' => 'text', 'type' => 'text',
'label' => $this->l('Address').' (2)', 'label' => $this->l('Address').' (2)',
'name' => 'address2', 'name' => 'address2',
'size' => 33,
'required' => false, 'required' => false,
); );
} }
@@ -249,7 +237,6 @@ class AdminAddressesControllerCore extends AdminController
'type' => 'text', 'type' => 'text',
'label' => $this->l('Zip/Postal Code'), 'label' => $this->l('Zip/Postal Code'),
'name' => 'postcode', 'name' => 'postcode',
'size' => 33,
'required' => true, 'required' => true,
); );
} }
@@ -259,7 +246,6 @@ class AdminAddressesControllerCore extends AdminController
'type' => 'text', 'type' => 'text',
'label' => $this->l('City'), 'label' => $this->l('City'),
'name' => 'city', 'name' => 'city',
'size' => 33,
'required' => true, 'required' => true,
); );
} }
@@ -274,7 +260,7 @@ class AdminAddressesControllerCore extends AdminController
'options' => array( 'options' => array(
'query' => Country::getCountries($this->context->language->id), 'query' => Country::getCountries($this->context->language->id),
'id' => 'id_country', 'id' => 'id_country',
'name' => 'name', 'name' => 'name'
) )
); );
$temp_fields[] = array( $temp_fields[] = array(
@@ -285,7 +271,7 @@ class AdminAddressesControllerCore extends AdminController
'options' => array( 'options' => array(
'query' => array(), 'query' => array(),
'id' => 'id_state', 'id' => 'id_state',
'name' => 'name', 'name' => 'name'
) )
); );
} }
+12 -15
View File
@@ -28,6 +28,7 @@ class AdminContactsControllerCore extends AdminController
{ {
public function __construct() public function __construct()
{ {
$this->bootstrap = true;
$this->table = 'contact'; $this->table = 'contact';
$this->className = 'Contact'; $this->className = 'Contact';
$this->lang = true; $this->lang = true;
@@ -36,10 +37,10 @@ class AdminContactsControllerCore extends AdminController
$this->bulk_actions = array('delete' => array('text' => $this->l('Delete selected'), 'confirm' => $this->l('Delete selected items?'))); $this->bulk_actions = array('delete' => array('text' => $this->l('Delete selected'), 'confirm' => $this->l('Delete selected items?')));
$this->fields_list = array( $this->fields_list = array(
'id_contact' => array('title' => $this->l('ID'), 'align' => 'center', 'width' => 25), 'id_contact' => array('title' => $this->l('ID'), 'align' => 'center'),
'name' => array('title' => $this->l('Title'), 'width' => 130), 'name' => array('title' => $this->l('Title')),
'email' => array('title' => $this->l('Email address'), 'width' => 130), 'email' => array('title' => $this->l('Email address')),
'description' => array('title' => $this->l('Description'), 'width' => 150), 'description' => array('title' => $this->l('Description')),
); );
parent::__construct(); parent::__construct();
@@ -50,34 +51,32 @@ class AdminContactsControllerCore extends AdminController
$this->fields_form = array( $this->fields_form = array(
'legend' => array( 'legend' => array(
'title' => $this->l('Contacts'), 'title' => $this->l('Contacts'),
'image' => '../img/admin/contact.gif' 'icon' => 'icon-envelope-alt'
), ),
'input' => array( 'input' => array(
array( array(
'type' => 'text', 'type' => 'text',
'label' => $this->l('Title'), 'label' => $this->l('Title'),
'name' => 'name', 'name' => 'name',
'size' => 33,
'required' => true, 'required' => true,
'lang' => true, 'lang' => true,
'desc' => $this->l('Contact name (e.g. Customer Support)'), 'hint' => $this->l('Contact name (e.g. Customer Support)'),
), ),
array( array(
'type' => 'text', 'type' => 'text',
'label' => $this->l('Email address'), 'label' => $this->l('Email address'),
'name' => 'email', 'name' => 'email',
'size' => 33,
'required' => false, 'required' => false,
'desc' => $this->l('Emails will be sent to this address'), 'hint' => $this->l('Emails will be sent to this address'),
), ),
array( array(
'type' => 'radio', 'type' => 'switch',
'label' => $this->l('Save messages?'), 'label' => $this->l('Save messages?'),
'name' => 'customer_service', 'name' => 'customer_service',
'required' => false, 'required' => false,
'class' => 't', 'class' => 't',
'is_bool' => true, 'is_bool' => true,
'desc' => $this->l('If enabled, all messages will be saved in the "Customer Service" page under the "Customer" menu.'), 'hint' => $this->l('If enabled, all messages will be saved in the "Customer Service" page under the "Customer" menu.'),
'values' => array( 'values' => array(
array( array(
'id' => 'customer_service_on', 'id' => 'customer_service_on',
@@ -97,14 +96,12 @@ class AdminContactsControllerCore extends AdminController
'name' => 'description', 'name' => 'description',
'required' => false, 'required' => false,
'lang' => true, 'lang' => true,
'cols' => 36, 'hint' => $this->l('Further information regarding this contact'),
'rows' => 5,
'desc' => $this->l('Further information regarding this contact'),
), ),
), ),
'submit' => array( 'submit' => array(
'title' => $this->l('Save '), 'title' => $this->l('Save '),
'class' => 'button' 'class' => 'btn btn-primary'
) )
); );
+24 -33
View File
@@ -34,6 +34,7 @@ class AdminCustomersControllerCore extends AdminController
public function __construct() public function __construct()
{ {
$this->bootstrap = true;
$this->required_database = true; $this->required_database = true;
$this->required_fields = array('newsletter','optin'); $this->required_fields = array('newsletter','optin');
$this->table = 'customer'; $this->table = 'customer';
@@ -78,12 +79,10 @@ class AdminCustomersControllerCore extends AdminController
$this->fields_list = array( $this->fields_list = array(
'id_customer' => array( 'id_customer' => array(
'title' => $this->l('ID'), 'title' => $this->l('ID'),
'align' => 'center', 'align' => 'center'
'width' => 20
), ),
'id_gender' => array( 'id_gender' => array(
'title' => $this->l('Title'), 'title' => $this->l('Title'),
'width' => 70,
'align' => 'center', 'align' => 'center',
'icon' => $genders_icon, 'icon' => $genders_icon,
'orderby' => false, 'orderby' => false,
@@ -92,35 +91,28 @@ class AdminCustomersControllerCore extends AdminController
'filter_key' => 'a!id_gender', 'filter_key' => 'a!id_gender',
), ),
'lastname' => array( 'lastname' => array(
'title' => $this->l('Last name'), 'title' => $this->l('Last name')
'width' => 'auto'
), ),
'firstname' => array( 'firstname' => array(
'title' => $this->l('First Name'), 'title' => $this->l('First Name')
'width' => 'auto'
), ),
'email' => array( 'email' => array(
'title' => $this->l('Email address'), 'title' => $this->l('Email address')
'width' => 140,
), ),
'age' => array( 'age' => array(
'title' => $this->l('Age'), 'title' => $this->l('Age'),
'width' => 20,
'search' => false, 'search' => false,
'align' => 'center' 'align' => 'center'
), ),
'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',
'orderby' => false, 'orderby' => false
'filter_key' => 'a!active',
), ),
'newsletter' => array( 'newsletter' => array(
'title' => $this->l('News.'), 'title' => $this->l('News.'),
'width' => 70,
'align' => 'center', 'align' => 'center',
'type' => 'bool', 'type' => 'bool',
'callback' => 'printNewsIcon', 'callback' => 'printNewsIcon',
@@ -128,7 +120,6 @@ class AdminCustomersControllerCore extends AdminController
), ),
'optin' => array( 'optin' => array(
'title' => $this->l('Opt.'), 'title' => $this->l('Opt.'),
'width' => 70,
'align' => 'center', 'align' => 'center',
'type' => 'bool', 'type' => 'bool',
'callback' => 'printOptinIcon', 'callback' => 'printOptinIcon',
@@ -136,13 +127,11 @@ class AdminCustomersControllerCore extends AdminController
), ),
'date_add' => array( 'date_add' => array(
'title' => $this->l('Registration'), 'title' => $this->l('Registration'),
'width' => 150,
'type' => 'date', 'type' => 'date',
'align' => 'right' 'align' => 'right'
), ),
'connect' => array( 'connect' => array(
'title' => $this->l('Last visit'), 'title' => $this->l('Last visit'),
'width' => 100,
'type' => 'datetime', 'type' => 'datetime',
'search' => false, 'search' => false,
'havingFilter' => true 'havingFilter' => true
@@ -264,7 +253,7 @@ class AdminCustomersControllerCore extends AdminController
$this->fields_form = array( $this->fields_form = array(
'legend' => array( 'legend' => array(
'title' => $this->l('Customer'), 'title' => $this->l('Customer'),
'image' => '../img/admin/tab-customers.gif' 'icon' => 'icon-user'
), ),
'input' => array( 'input' => array(
array( array(
@@ -304,7 +293,7 @@ class AdminCustomersControllerCore extends AdminController
'name' => 'passwd', 'name' => 'passwd',
'size' => 33, 'size' => 33,
'required' => ($obj->id ? false : true), 'required' => ($obj->id ? false : true),
'desc' => ($obj->id ? $this->l('Leave this field blank if there\'s no change') : $this->l('Minimum of five characters (only letters and numbers).').' -_') 'hint' => ($obj->id ? $this->l('Leave this field blank if there\'s no change') : $this->l('Minimum of five characters (only letters and numbers).').' -_')
), ),
array( array(
'type' => 'birthday', 'type' => 'birthday',
@@ -317,7 +306,7 @@ class AdminCustomersControllerCore extends AdminController
) )
), ),
array( array(
'type' => 'radio', 'type' => 'switch',
'label' => $this->l('Status:'), 'label' => $this->l('Status:'),
'name' => 'active', 'name' => 'active',
'required' => false, 'required' => false,
@@ -335,10 +324,10 @@ class AdminCustomersControllerCore extends AdminController
'label' => $this->l('Disabled') 'label' => $this->l('Disabled')
) )
), ),
'desc' => $this->l('Enable or disable customer login') 'hint' => $this->l('Enable or disable customer login')
), ),
array( array(
'type' => 'radio', 'type' => 'switch',
'label' => $this->l('Newsletter:'), 'label' => $this->l('Newsletter:'),
'name' => 'newsletter', 'name' => 'newsletter',
'required' => false, 'required' => false,
@@ -356,10 +345,10 @@ class AdminCustomersControllerCore extends AdminController
'label' => $this->l('Disabled') 'label' => $this->l('Disabled')
) )
), ),
'desc' => $this->l('Customers will receive your newsletter via email.') 'hint' => $this->l('Customers will receive your newsletter via email.')
), ),
array( array(
'type' => 'radio', 'type' => 'switch',
'label' => $this->l('Opt in:'), 'label' => $this->l('Opt in:'),
'name' => 'optin', 'name' => 'optin',
'required' => false, 'required' => false,
@@ -377,7 +366,7 @@ class AdminCustomersControllerCore extends AdminController
'label' => $this->l('Disabled') 'label' => $this->l('Disabled')
) )
), ),
'desc' => $this->l('Customer will receive your ads via email.') 'hint' => $this->l('Customer will receive your ads via email.')
), ),
) )
); );
@@ -395,12 +384,12 @@ class AdminCustomersControllerCore extends AdminController
$this->fields_form['input'] = array_merge($this->fields_form['input'], $this->fields_form['input'] = array_merge($this->fields_form['input'],
array( array(
array( array(
'type' => 'group', 'type' => 'group',
'label' => $this->l('Group access:'), 'label' => $this->l('Group access:'),
'name' => 'groupBox', 'name' => 'groupBox',
'values' => $groups, 'values' => $groups,
'required' => true, 'required' => true,
'desc' => $this->l('Select all the groups that you would like to apply to this customer.') 'hint' => $this->l('Select all the groups that you would like to apply to this customer.')
), ),
array( array(
'type' => 'select', 'type' => 'select',
@@ -411,8 +400,10 @@ class AdminCustomersControllerCore extends AdminController
'id' => 'id_group', 'id' => 'id_group',
'name' => 'name' 'name' => 'name'
), ),
'hint' => $this->l('The group will be as applied by default.'), 'hint' => array(
'desc' => $this->l('Apply the discount\'s price of this group.') $this->l('The group will be as applied by default.'),
$this->l('Apply the discount\'s price of this group.')
)
) )
) )
); );
+7 -13
View File
@@ -28,6 +28,7 @@ class AdminGendersControllerCore extends AdminController
{ {
public function __construct() public function __construct()
{ {
$this->bootstrap = true;
$this->table = 'gender'; $this->table = 'gender';
$this->className = 'Gender'; $this->className = 'Gender';
$this->lang = true; $this->lang = true;
@@ -52,17 +53,14 @@ class AdminGendersControllerCore extends AdminController
$this->fields_list = array( $this->fields_list = array(
'id_gender' => array( 'id_gender' => 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' => 'auto',
'filter_key' => 'b!name' 'filter_key' => 'b!name'
), ),
'type' => array( 'type' => array(
'title' => $this->l('Type'), 'title' => $this->l('Type'),
'width' => 100,
'orderby' => false, 'orderby' => false,
'type' => 'select', 'type' => 'select',
'list' => array( 'list' => array(
@@ -72,15 +70,14 @@ class AdminGendersControllerCore extends AdminController
), ),
'filter_key' => 'a!type', 'filter_key' => 'a!type',
'callback' => 'displayGenderType', 'callback' => 'displayGenderType',
'callback_object' => $this, 'callback_object' => $this
), ),
'image' => array( 'image' => array(
'title' => $this->l('Image'), 'title' => $this->l('Image'),
'align' => 'center', 'align' => 'center',
'image' => 'genders', 'image' => 'genders',
'orderby' => false, 'orderby' => false,
'search' => false, 'search' => false
'width' => 40
) )
); );
@@ -92,7 +89,7 @@ class AdminGendersControllerCore extends AdminController
$this->fields_form = array( $this->fields_form = array(
'legend' => array( 'legend' => array(
'title' => $this->l('Titles'), 'title' => $this->l('Titles'),
'image' => '../img/admin/tab-genders.gif' 'icon' => 'icon-male'
), ),
'input' => array( 'input' => array(
array( array(
@@ -100,7 +97,6 @@ class AdminGendersControllerCore extends AdminController
'label' => $this->l('Name:'), 'label' => $this->l('Name:'),
'name' => 'name', 'name' => 'name',
'lang' => true, 'lang' => true,
'size' => 33,
'hint' => $this->l('Invalid characters:').' 0-9!<>,;?=+()@#"�{}_$%:', 'hint' => $this->l('Invalid characters:').' 0-9!<>,;?=+()@#"�{}_$%:',
'required' => true 'required' => true
), ),
@@ -138,15 +134,13 @@ class AdminGendersControllerCore extends AdminController
'type' => 'text', 'type' => 'text',
'label' => $this->l('Image Width:'), 'label' => $this->l('Image Width:'),
'name' => 'img_width', 'name' => 'img_width',
'size' => 4, 'hint' => $this->l('Image width in pixels. Enter "0" to use the original size.')
'desc' => $this->l('Image width in pixels. Enter "0" to use the original size.')
), ),
array( array(
'type' => 'text', 'type' => 'text',
'label' => $this->l('Image Height:'), 'label' => $this->l('Image Height:'),
'name' => 'img_height', 'name' => 'img_height',
'size' => 4, 'hint' => $this->l('Image height in pixels. Enter "0" to use the original size.')
'desc' => $this->l('Image height in pixels. Enter "0" to use the original size.')
) )
), ),
'submit' => array( 'submit' => array(