From 2ff25db67bebd59cb6fd0de3bf97f492e77a7d36 Mon Sep 17 00:00:00 2001 From: lLefevre Date: Mon, 7 Nov 2011 10:45:23 +0000 Subject: [PATCH] // fix bug toolbar_fix in AdminStoresController --- .../themes/template/helper/form/form.tpl | 1 + admin-dev/themes/template/stores/form.tpl | 323 ++++-------------- admin-dev/themes/template/stores/options.tpl | 159 --------- controllers/admin/AdminStoresController.php | 13 +- 4 files changed, 69 insertions(+), 427 deletions(-) delete mode 100644 admin-dev/themes/template/stores/options.tpl diff --git a/admin-dev/themes/template/helper/form/form.tpl b/admin-dev/themes/template/helper/form/form.tpl index e665fbf4a..e24b659e6 100644 --- a/admin-dev/themes/template/helper/form/form.tpl +++ b/admin-dev/themes/template/helper/form/form.tpl @@ -319,6 +319,7 @@ {if isset($field.class)}class="{$field.class}"{/if} /> {/if} + {block name="other_input"}{/block} {/foreach} {if $required_fields}
* {l s ='Required field'}
diff --git a/admin-dev/themes/template/stores/form.tpl b/admin-dev/themes/template/stores/form.tpl index 8ca20e966..c51982ff0 100644 --- a/admin-dev/themes/template/stores/form.tpl +++ b/admin-dev/themes/template/stores/form.tpl @@ -1,5 +1,5 @@ {* -* 2007-2011 PrestaShop +* 2007-2011 PrestaShop * * NOTICE OF LICENSE * @@ -23,274 +23,73 @@ * @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="start_field_block"} +
+ {if $input.type == 'latitude'} + / + {/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.type == 'text'} - {if $input.name == 'latitude'} - / - - {else} - {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} - {/if} - {elseif $input.type == 'select'} - - {elseif $input.type == 'radio'} - {foreach $input.values as $value} - - - {/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'} - - {elseif $input.type == 'file'} - - - {/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 $input.name == 'active'} -
- {/if} - {/if} - {if isset($languages)}
{/if} -
- {if $input.name == 'id_state'} -
- {/if} - {/foreach} - {elseif $key == 'rightCols'} -
- {foreach $field as $input} - {if $input.type == 'file'} - -
- -

{$input.p}

- {if isset($fields_value.image) && $fields_value.image} -
- {$fields_value.image} -

{l s='File size'} {$fields_value.size}kb

- - {l s='Delete'} {l s='Delete'} - -
- {/if} -
- {/if} - - - - - - - - +{/block} - {foreach $fields_value.days as $k => $value} - - - - - {/foreach} -
{l s='Hours:'}
 {l s='Sample: 10:00AM - 9:30PM'}
{$value}
-
- {/foreach} -
- {elseif $key == 'submit'} -
-
- +{block name="other_input"} + {if $key == 'rightCols'} + {foreach $field as $input} + {if $input.type == 'file'} + +
+ +

{$input.p}

+ {if isset($fields_value.image) && $fields_value.image} +
+ {$fields_value.image} +

{l s='File size'} {$fields_value.size}kb

+ + {l s='Delete'} {l s='Delete'} + +
+ {/if}
{/if} - {/foreach} - {if $required_fields} -
* {l s ='Required field'}
- {/if} -
- + + + + + + + + -

-{if $firstCall} - {if $back} - {l s='Back'} - {else} - {l s='Back to list'} + {foreach $fields_value.days as $k => $value} + + + + + {/foreach} +
{l s='Hours:'}
 {l s='Sample: 10:00AM - 9:30PM'}
{$value}
+
+ {/foreach} {/if} -
-{/if} \ No newline at end of file +{/block} + diff --git a/admin-dev/themes/template/stores/options.tpl b/admin-dev/themes/template/stores/options.tpl deleted file mode 100644 index 791ef8ba2..000000000 --- a/admin-dev/themes/template/stores/options.tpl +++ /dev/null @@ -1,159 +0,0 @@ -{* -* 2007-2011 PrestaShop -* -* NOTICE OF LICENSE -* -* This source file is subject to the Academic Free License (AFL 3.0) -* that is bundled with this package in the file LICENSE.txt. -* It is also available through the world-wide-web at this URL: -* http://opensource.org/licenses/afl-3.0.php -* If you did not receive a copy of the license and are unable to -* obtain it through the world-wide-web, please send an email -* to license@prestashop.com so we can send you a copy immediately. -* -* DISCLAIMER -* -* Do not edit or add to this file if you wish to upgrade PrestaShop to newer -* versions in the future. If you wish to customize PrestaShop for your -* needs please refer to http://www.prestashop.com for more information. -* -* @author PrestaShop SA -* @copyright 2007-2011 PrestaShop SA -* @version Release: $Revision: 9369 $ -* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) -* International Registered Trademark & Property of PrestaShop SA -*} -
- -
-{foreach $option_list AS $category => $categoryData} - {if isset($categoryData['top'])}{$categoryData['top']}{/if} -
- {* Options category title *} - - - {if isset($categoryData['title'])}{$categoryData['title']}{else}{l s='Options'}{/if} - - - {* Category description *} - {if (isset($categoryData['description']) && $categoryData['description'])} -
{$categoryData['description']}
- {/if} - - {foreach $categoryData['fields'] AS $key => $field} -
- {if $field['title']} - - {/if} -
- - {if $field['type'] == 'select'} - - {elseif $field['type'] == 'bool'} - - - - - - - {elseif $field['type'] == 'radio'} - {foreach $field['choices'] AS $k => $v} - -
- {/foreach} -
- {*{elseif $field['type'] == 'checkbox'} - {foreach $field['choices'] AS $k => $v} - -
- {/foreach} -
- *} - {elseif $field['type'] == 'text'} - - {if isset($field['suffix'])} {$field['suffix']|strval}{/if} - {elseif $field['type'] == 'password'} - - {if isset($field['suffix'])} {$field['suffix']|strval}{/if} - {elseif $field['type'] == 'textarea'} - - {elseif $field['type'] == 'file'} - {if isset($field['thumb']) && $field['thumb'] && $field['thumb']['pos'] == 'before'} - {$field['title']}
- {/if} - - {* {elseif $field['type'] == 'image'} - - - $i = 0; - foreach ($field['list'] as $theme) - { - '; - if (isset($field['max']) && ($i +1 ) % $field['max'] == 0) - echo ''; - $i++; - } - echo ''; - echo '
- '; - echo ''; - echo '
'; - echo ''; - echo '
'; - *} - {elseif $field['type'] == 'textLang'} - {foreach $field['languages'] AS $id_lang => $value} -
- -
- {/foreach} - {$field['flags']} - {elseif $field['type'] == 'textareaLang'} - {foreach $field['languages'] AS $id_lang => $value} -
'; - -
- {/foreach} - {$field['flags']} -
- - - {/if} - {if isset($field['method'])}$field['method']{/if} - - {if ($field['multishop_default'])} -
- -
- {/if} - {if isset($field['desc'])}

{$field['desc']}

{/if} - {if $field['is_invisible']}

{l s='You can\'t change the value of this configuration field in this shop context'}

{/if} -
- {/foreach} - -
- -
- {if $field['required']} -
* {l s='Required field'}
- {/if} -

- {if isset($categoryData['bottom'])}{$categoryData['bottom']}{/if} -{/foreach} -

-

- - {l s='You can also replace the icon representing your store in Google Maps. Go to the Preferences tab, and then the Appearance subtab.'} -

diff --git a/controllers/admin/AdminStoresController.php b/controllers/admin/AdminStoresController.php index 69c0ed5da..dc5be3a5c 100644 --- a/controllers/admin/AdminStoresController.php +++ b/controllers/admin/AdminStoresController.php @@ -32,8 +32,6 @@ class AdminStoresControllerCore extends AdminController $this->table = 'store'; $this->className = 'Store'; $this->lang = false; - $this->addRowAction('edit'); - $this->addRowAction('delete'); $this->requiredDatabase = true; $this->context = Context::getContext(); @@ -41,8 +39,6 @@ class AdminStoresControllerCore extends AdminController if (!Tools::getValue('realedit')) $this->deleted = false; - $this->bulk_actions = array('delete' => array('text' => $this->l('Delete selected'), 'confirm' => $this->l('Delete selected items?'))); - $this->fieldImageSettings = array( 'name' => 'image', 'dir' => 'st' @@ -118,6 +114,11 @@ class AdminStoresControllerCore extends AdminController public function initList() { + $this->addRowAction('edit'); + $this->addRowAction('delete'); + + $this->bulk_actions = array('delete' => array('text' => $this->l('Delete selected'), 'confirm' => $this->l('Delete selected items?'))); + $this->_select = 'cl.`name` country, st.`name` state'; $this->_join = ' LEFT JOIN `'._DB_PREFIX_.'country_lang` cl @@ -155,7 +156,7 @@ class AdminStoresControllerCore extends AdminController ), array( 'type' => 'text', - 'label' => $this->l('Address:'), + 'label' => $this->l('Address (2):'), 'name' => 'address2', 'size' => 33 ), @@ -195,7 +196,7 @@ class AdminStoresControllerCore extends AdminController ) ), array( - 'type' => 'text', + 'type' => 'latitude', 'label' => $this->l('Latitude / Longitude:'), 'name' => 'latitude', 'required' => true,