diff --git a/admin-dev/themes/template/attributes/form.tpl b/admin-dev/themes/template/attributes/form.tpl index 5ab708bbe..2ee73b654 100644 --- a/admin-dev/themes/template/attributes/form.tpl +++ b/admin-dev/themes/template/attributes/form.tpl @@ -24,13 +24,14 @@ * International Registered Trademark & Property of PrestaShop SA *} {extends file="helper/form/form.tpl"} + {block name=script} - var attributesGroups = {ldelim}{$strAttributesGroups}{rdelim}; - $('#id_attribute_group').change(function() { - var val = $(this).val(); - if (attributesGroups[val]) - $('#colorAttributeProperties').show(); - else - $('#colorAttributeProperties').hide(); - }); + var attributesGroups = {ldelim}{$strAttributesGroups}{rdelim}; + $('#id_attribute_group').change(function() { + var val = $(this).val(); + if (attributesGroups[val]) + $('#colorAttributeProperties').show(); + else + $('#colorAttributeProperties').hide(); + }); {/block} diff --git a/admin-dev/themes/template/carriers/form.tpl b/admin-dev/themes/template/carriers/form.tpl index 7496c634a..13fb01b44 100644 --- a/admin-dev/themes/template/carriers/form.tpl +++ b/admin-dev/themes/template/carriers/form.tpl @@ -23,273 +23,29 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) * International Registered Trademark & Property of PrestaShop SA *} +{extends file="helper/form/form.tpl"} -{if $firstCall} - - -{/if} - -
- {if $form_id} - +{block name="label"} + {if $input.type == 'select' && $input.name == 'id_tax_rules_group'} +
{/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 $input.name == 'id_tax_rules_group'}
{/if} - {if isset($input.label)} - {if $input.name == 'is_module' && $fields_value['is_module'] == 0} - {else} - - {/if} - {/if} -
- {if $input.type == 'text'} - {if isset($input.lang) && isset($input.attributeLang)} - {foreach $languages as $language} -
- - {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 == 'hidden'} - {if $input.name == 'is_module'} - {if $fields_value['is_module'] != 0} -

- {l s='This carrier is bound to this module '} : {$fields_value['external_module_name']}

- - - {if $fields_value['shipping_external'] != 0} -

- {l s='The shipping costs are calculated outside of your shop'}

- - {/if} - {if $fields_value['need_range'] != 0} -

- {l s='This carrier uses PrestaShop range to calculate shipping costs'}

- - {/if} - {/if} - {else} - - {/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 == '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} -
- {/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 == 'range_behavior'}
{/if} - {if $input.name == 'id_state'}
{/if} - {/foreach} - {elseif $key == 'submit'} -
- -
- {/if} - {/foreach} - {if $required_fields} -
* {l s ='Required field'}
- {/if} -
- - -

-{if $firstCall} - {if $back} - {l s='Back'} - {else} - {l s='Back to list'} + {if isset($input.label)} + {/if} -
-{/if} +{/block} + +{block name="end_field_block"} + {if $input.type == 'select' && $input.name == 'range_behavior'} +
+ {/if} + +{/block} diff --git a/controllers/admin/AdminCarriersController.php b/controllers/admin/AdminCarriersController.php index b61a7226c..68cb1997d 100644 --- a/controllers/admin/AdminCarriersController.php +++ b/controllers/admin/AdminCarriersController.php @@ -132,6 +132,31 @@ class AdminCarriersControllerCore extends AdminController public function initList() { + $this->displayInformation( + ' '.$this->l('How to create a new carrier?').' +
+ ' + ); $this->_select = 'b.*'; $this->_join = 'LEFT JOIN `'._DB_PREFIX_.'carrier_lang` b ON a.id_carrier = b.id_carrier'; $this->_where = 'AND b.id_lang = '.$this->context->language->id; @@ -324,7 +349,6 @@ class AdminCarriersControllerCore extends AdminController ), array( 'type' => 'hidden', - 'label' => $this->l('Module:'), 'name' => 'is_module' ), array( @@ -357,6 +381,11 @@ class AdminCarriersControllerCore extends AdminController 'class' => 'button' ); + if (!($obj = $this->loadObject(true))) + return; + + $this->getFieldsValues($obj); + return parent::initForm(); } @@ -503,48 +532,6 @@ class AdminCarriersControllerCore extends AdminController } } - public function initContent() - { - if (!($obj = $this->loadObject(true))) - return; - - if ($this->display != 'edit' && $this->display != 'add') - $this->display = 'list'; - - $this->getFieldsValues($obj); - - parent::initContent(); - - if ($this->display == 'list') - { - $this->displayInformation( - ' '.$this->l('How to create a new carrier?').' -
- ' - ); - } - } - public function beforeDelete($object) { return $object->isUsed();