diff --git a/admin-dev/themes/template/addresses/form.tpl b/admin-dev/themes/template/addresses/form.tpl index 1f234ac48..54283a25b 100644 --- a/admin-dev/themes/template/addresses/form.tpl +++ b/admin-dev/themes/template/addresses/form.tpl @@ -24,157 +24,57 @@ * International Registered Trademark & Property of PrestaShop SA *} -{if $firstCall} - - -{/if} +{extends file="../helper/form/form.tpl"} -
- {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_customer'} - {if isset($customer)} - - - - - {else} - -
- * -
- {/if} - {else} - {if $input.name == 'vat_number'} - {if $vat == 'is_applicable'} -
- {else if $vat == 'management'} -
- {else} -
- {/if} - {else if $input.name == 'id_state'} -
- {/if} - -
- {if $input.type == 'text'} - - {elseif $input.type == 'select'} - - {elseif $input.type == 'radio'} - {foreach $input.values as $value} - - - {/foreach} - {elseif $input.type == 'textarea'} - - {elseif $input.type == 'checkbox'} - - {/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 $input.name == 'id_state' || $input.name == 'vat_number'} -
- {/if} - {/if} - {/foreach} - {elseif $key == 'submit'} -
- -
+{block name="label"} +{* {if $input.type == 'text_customer'} + {if isset($customer)} + + {else} + + {/if} + {else if isset($input.label)} + + {/if} *} +{/block} + +{block name="start_field_block"} + {if $input.type == 'text_customer'} + {if isset($customer)} + + + + + {else} + +
+ * +
+ {/if} + {else} + {if $input.name == 'vat_number'} + {if $vat == 'is_applicable'} +
+ {else if $vat == 'management'} +
+ {else} +
{/if} - {/foreach} - {if $required_fields} -
* {l s ='Required field'}
+ {else if $input.name == 'id_state'} +
{/if} -
-
- -

-{if $firstCall} - {if $back} - {l s='Back'} - {else} - {l s='Back to list'} + +
{/if} -
-{/if} \ No newline at end of file +{/block} + +{block name="end_field_block"} + {* close div margin-form *} + {if $input.type != 'text_customer'} +
+ {/if} + {* close hidden div *} + {if $input.name == 'vat_number' || $input.name == 'id_state'} + + {/if} +{/block} diff --git a/admin-dev/themes/template/helper/form/form.tpl b/admin-dev/themes/template/helper/form/form.tpl index ab8d9d74f..9fdcde429 100644 --- a/admin-dev/themes/template/helper/form/form.tpl +++ b/admin-dev/themes/template/helper/form/form.tpl @@ -71,13 +71,17 @@ {if $input.name == 'id_state'}
{/if} + {block name="label"} {if isset($input.label)} - + {/if} + {/block} {if $input.type == 'hidden'} {else} -
+ {block name="start_field_block"} +
+ {/block} {if $input.type == 'text'} {if isset($input.lang) && isset($input.attributeLang)} {foreach $languages as $language} @@ -256,7 +260,7 @@

{/if} {if isset($languages)}
{/if} -
+ {block name="end_field_block"}
{/block} {/if} {if $input.name == 'id_state'}
diff --git a/controllers/admin/AdminAddressesController.php b/controllers/admin/AdminAddressesController.php index 94552b2f9..aaacbf10c 100644 --- a/controllers/admin/AdminAddressesController.php +++ b/controllers/admin/AdminAddressesController.php @@ -38,13 +38,13 @@ class AdminAddressesControllerCore extends AdminController $this->table = 'address'; $this->className = 'Address'; $this->lang = false; - $this->bulk_actions = array('delete' => array('text' => $this->l('Delete selected'), 'confirm' => $this->l('Delete selected items?'))); $this->requiredDatabase = true; $this->addressType = 'customer'; $this->context = Context::getContext(); $this->addRowAction('edit'); $this->addRowAction('delete'); + $this->bulk_actions = array('delete' => array('text' => $this->l('Delete selected'), 'confirm' => $this->l('Delete selected items?'))); if (!Tools::getValue('realedit')) $this->deleted = true; @@ -84,11 +84,11 @@ class AdminAddressesControllerCore extends AdminController ), 'input' => array( array( - 'type' => 'text', + 'type' => 'text_customer', 'label' => $this->l('Customer'), 'name' => 'id_customer', 'size' => 33, - 'required' => true, + 'required' => false, ), array( 'type' => 'text', @@ -104,7 +104,7 @@ class AdminAddressesControllerCore extends AdminController 'name' => 'alias', 'size' => 33, 'required' => true, - 'p' => ''.$this->l('Invalid characters:').' <>;=#{} ' + 'hint' => $this->l('Invalid characters:').' <>;=#{}' ), array( 'type' => 'text', @@ -261,6 +261,7 @@ class AdminAddressesControllerCore extends AdminController 'name' => 'id_state', 'required' => false, 'options' => array( + 'query' => array(), 'id' => 'id_state', 'name' => 'name' )