// fix update form.tpl in AdminTaxRulesGroupsController

This commit is contained in:
lLefevre
2011-11-07 13:03:04 +00:00
parent 659a9a6319
commit 8747306424
8 changed files with 50 additions and 40 deletions
+14 -14
View File
@@ -64,21 +64,21 @@
<script type="text/javascript" src="../js/form.js"></script> <script type="text/javascript" src="../js/form.js"></script>
{/if} {/if}
<div class="toolbar-placeholder"> {if $show_toolbar}
<div class="toolbarBox {if $toolbar_fix}toolbarHead{/if}"> <div class="toolbar-placeholder">
{if $show_toolbar} <div class="toolbarBox {if $toolbar_fix}toolbarHead{/if}">
{include file="toolbar.tpl" toolbar_btn=$toolbar_btn} {include file="toolbar.tpl" toolbar_btn=$toolbar_btn}
<div class="pageTitle"> <div class="pageTitle">
<h3> <h3>
{block name=pageTitle} {block name=pageTitle}
<span id="current_obj" style="font-weight: normal;">{$title|default:'&nbsp;'}</span> <span id="current_obj" style="font-weight: normal;">{$title|default:'&nbsp;'}</span>
{/block} {/block}
</h3> </h3>
</div> </div>
{/if} <div class="leadin">{block name="leadin"}{/block}</div>
<div class="leadin">{block name="leadin"}{/block}</div> </div>
</div> </div>
</div> {/if}
{if isset($fields.title)}<h2>{$fields.title}</h2>{/if} {if isset($fields.title)}<h2>{$fields.title}</h2>{/if}
<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" action="{$current}&{$submit_action}=1&token={$token}" method="post" enctype="multipart/form-data">
@@ -60,17 +60,19 @@
{/if}{* End if simple_header *} {/if}{* End if simple_header *}
{if $show_toolbar} {if $show_toolbar}
<div class="toolbar-placeholder"> <div class="toolbar-placeholder">
<div class="toolbarBox {if $toolbar_fix}toolbarHead{/if}"> <div class="toolbarBox {if $toolbar_fix}toolbarHead{/if}">
{include file="toolbar.tpl" toolbar_btn=$toolbar_btn} {include file="toolbar.tpl" toolbar_btn=$toolbar_btn}
<div class="pageTitle"> <div class="pageTitle">
<h3>{block name=pageTitle} <h3>{block name=pageTitle}
<span id="current_obj" style="font-weight: normal;">{$title|default:'&nbsp;'}</span> <span id="current_obj" style="font-weight: normal;">{$title|default:'&nbsp;'}</span>
{/block}</h3> {/block}
</h3>
</div>
</div>
</div> </div>
</div>
</div>
{/if} {/if}
<div class="leadin">{block name="leadin"}{/block}</div> <div class="leadin">{block name="leadin"}{/block}</div>
<a name="{$table}">&nbsp;</a> <a name="{$table}">&nbsp;</a>
@@ -24,20 +24,20 @@
* International Registered Trademark & Property of PrestaShop SA * International Registered Trademark & Property of PrestaShop SA
*} *}
<div class="toolbar-placeholder"> {if $show_toolbar}
<div class="toolbarBox {if $toolbar_fix}toolbarHead{/if}"> <div class="toolbar-placeholder">
{if $show_toolbar} <div class="toolbarBox {if $toolbar_fix}toolbarHead{/if}">
{include file="toolbar.tpl" toolbar_btn=$toolbar_btn} {include file="toolbar.tpl" toolbar_btn=$toolbar_btn}
<div class="pageTitle"> <div class="pageTitle">
<h3> <h3>
{block name=pageTitle} {block name=pageTitle}
<span id="current_obj" style="font-weight: normal;">{$title|default:'&nbsp;'}</span> <span id="current_obj" style="font-weight: normal;">{$title|default:'&nbsp;'}</span>
{/block} {/block}
</h3> </h3>
</div> </div>
{/if} <div class="leadin">{block name="leadin"}{/block}</div>
<div class="leadin">{block name="leadin"}{/block}</div> </div>
</div> </div>
</div> {/if}
{block name="override_tpl"}{/block} {block name="override_tpl"}{/block}
@@ -24,6 +24,7 @@
* International Registered Trademark & Property of PrestaShop SA * International Registered Trademark & Property of PrestaShop SA
*} *}
{extends file="../helper/form/form.tpl"} {extends file="../helper/form/form.tpl"}
{block name="label"} {block name="label"}
{if $input.type == 'select' && $input.name == 'country[]'} {if $input.type == 'select' && $input.name == 'country[]'}
<div id="add_new_tax_rule" style="display:none"> <div id="add_new_tax_rule" style="display:none">
@@ -64,10 +65,12 @@
populateStates($(this).val(), ''); populateStates($(this).val(), '');
}); });
$('.toolbar_btn').click(function() { $('#desc-tax_rules_group-new').click(function() {
initForm(); initForm();
$('#add_new_tax_rule').slideToggle(); $('#add_new_tax_rule').show();
return false; return false;
}, function() {
$('#add_new_tax_rule').hide();
}); });
}); });
@@ -24,6 +24,7 @@
* International Registered Trademark & Property of PrestaShop SA * International Registered Trademark & Property of PrestaShop SA
*} *}
{extends file="../helper/form/form.tpl"} {extends file="../helper/form/form.tpl"}
{block name="label"} {block name="label"}
{if $input.type == 'select' && $input.name == 'country[]'} {if $input.type == 'select' && $input.name == 'country[]'}
<div id="add_new_tax_rule" style="display:none"> <div id="add_new_tax_rule" style="display:none">
@@ -52,10 +53,8 @@
{block name="end_field_block"} {block name="end_field_block"}
{if $input.type == 'submit'} {if $input.type == 'submit'}
</div> </div>
</div>
{else}
</div>
{/if} {/if}
</div>
{/block} {/block}
{block name="script"} {block name="script"}
@@ -134,6 +134,7 @@ class AdminAttributesGroupsControllerCore extends AdminController
$helper->no_link = true; $helper->no_link = true;
$helper->shopLinkType = ''; $helper->shopLinkType = '';
$helper->identifier = $this->identifier; $helper->identifier = $this->identifier;
$helper->toolbar_fix = false;
$helper->orderBy = 'position'; $helper->orderBy = 'position';
$helper->orderWay = 'ASC'; $helper->orderWay = 'ASC';
$helper->currentIndex = self::$currentIndex; $helper->currentIndex = self::$currentIndex;
@@ -195,6 +195,8 @@ class AdminTabsControllerCore extends AdminController
$helper->shopLinkType = ''; $helper->shopLinkType = '';
$helper->identifier = $this->identifier; $helper->identifier = $this->identifier;
$helper->imageType = $this->imageType; $helper->imageType = $this->imageType;
$helper->toolbar_fix = false;
$helper->show_toolbar = false;
$helper->orderBy = 'position'; $helper->orderBy = 'position';
$helper->orderWay = 'ASC'; $helper->orderWay = 'ASC';
$helper->currentIndex = self::$currentIndex; $helper->currentIndex = self::$currentIndex;
@@ -78,7 +78,6 @@ class AdminTaxRulesGroupControllerCore extends AdminController
$this->lang = false; $this->lang = false;
$this->simple_header = true; $this->simple_header = true;
$this->toolbar_btn = null; $this->toolbar_btn = null;
$this->no_back = false;
$this->list_no_link = true; $this->list_no_link = true;
$this->fieldsDisplay = array( $this->fieldsDisplay = array(
@@ -132,6 +131,8 @@ class AdminTaxRulesGroupControllerCore extends AdminController
ON (a.`id_tax` = t.`id_tax`)'; ON (a.`id_tax` = t.`id_tax`)';
$this->_where = 'AND `id_tax_rules_group` = '.(int)$id_group; $this->_where = 'AND `id_tax_rules_group` = '.(int)$id_group;
$this->show_toolbar = false;
return parent::initList(); return parent::initList();
} }
@@ -194,10 +195,10 @@ class AdminTaxRulesGroupControllerCore extends AdminController
'desc' => $this->l('Add new tax rule') 'desc' => $this->l('Add new tax rule')
); );
$content = parent::initForm(); $content = parent::initForm();
$this->tpl_folder = 'tax_rules/';
$content .= $this->initRuleForm(); $content .= $this->initRuleForm();
// We change the variable $ tpl_folder to avoid the overhead calling the file in list_action_edit.tpl in intList (); // We change the variable $ tpl_folder to avoid the overhead calling the file in list_action_edit.tpl in intList ();
$this->tpl_folder = 'tax_rules/';
$content .= $this->initRulesList((int)$obj->id); $content .= $this->initRulesList((int)$obj->id);
} }
@@ -332,12 +333,14 @@ class AdminTaxRulesGroupControllerCore extends AdminController
$this->getlanguages(); $this->getlanguages();
$helper = new HelperForm(); $helper = new HelperForm();
$helper->override_tpl = $this->tpl_folder; $helper->override_folder = $this->tpl_folder;
$helper->currentIndex = self::$currentIndex; $helper->currentIndex = self::$currentIndex;
$helper->token = $this->token; $helper->token = $this->token;
$helper->table = 'tax_rule'; $helper->table = 'tax_rule';
$helper->identifier = 'id_tax_rule'; $helper->identifier = 'id_tax_rule';
$helper->id = $obj->id; $helper->id = $obj->id;
$helper->toolbar_fix = true;
$helper->show_toolbar = false;
$helper->languages = $this->_languages; $helper->languages = $this->_languages;
$helper->default_form_language = $this->default_form_language; $helper->default_form_language = $this->default_form_language;
$helper->allow_employee_form_lang = $this->allow_employee_form_lang; $helper->allow_employee_form_lang = $this->allow_employee_form_lang;