// fix update form.tpl in AdminGroupShopController

git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@9910 b9a71923-0436-4b27-9f14-aed3839534dd
This commit is contained in:
lLefevre committed 2011-11-06 12:28:54 +00:00
1 parent f0fe2c860a
commit b9c0cebc09
4 files changed
+113 -266

No files matched your search

+1 -1
View File
@@ -170,4 +170,4 @@ form.defaultForm{ background-color:#ebedf4; border:1px solid #ccced7; min-heig
/*FOOTER*/ /*FOOTER*/
#footer {height:40px;background:#ECEADE url(footer-bg.png) repeat-x scroll left bottom;border:1px solid #999999;font-size:12px;clear:both;font-size:0.9em;color:#666666} #footer {height:40px;background:#ECEADE url(footer-bg.png) repeat-x scroll left bottom;border:1px solid #999999;font-size:12px;clear:both;font-size:0.9em;color:#666666}
div.fix-toolbar {border-bottom: 1px solid #E0E0E0;position:fixed;top:0;opacity:0.9;} div.fix-toolbar {border-bottom: 1px solid #E0E0E0;position:fixed;top:0;opacity:0.9;z-index:1;}
+103 -162
View File
@@ -1,162 +1,103 @@
{* {*
* 2007-2011 PrestaShop * 2007-2011 PrestaShop
* *
* NOTICE OF LICENSE * NOTICE OF LICENSE
* *
* This source file is subject to the Academic Free License (AFL 3.0) * This source file is subject to the Academic Free License (AFL 3.0)
* that is bundled with this package in the file LICENSE.txt. * that is bundled with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL: * It is also available through the world-wide-web at this URL:
* http://opensource.org/licenses/afl-3.0.php * http://opensource.org/licenses/afl-3.0.php
* If you did not receive a copy of the license and are unable to * 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 * obtain it through the world-wide-web, please send an email
* to license@prestashop.com so we can send you a copy immediately. * to license@prestashop.com so we can send you a copy immediately.
* *
* DISCLAIMER * DISCLAIMER
* *
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer * 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 * versions in the future. If you wish to customize PrestaShop for your
* needs please refer to http://www.prestashop.com for more information. * needs please refer to http://www.prestashop.com for more information.
* *
* @author PrestaShop SA <contact@prestashop.com> * @author PrestaShop SA <contact@prestashop.com>
* @copyright 2007-2011 PrestaShop SA * @copyright 2007-2011 PrestaShop SA
* @version Release: $Revision: 8971 $ * @version Release: $Revision: 8971 $
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
* International Registered Trademark & Property of PrestaShop SA * International Registered Trademark & Property of PrestaShop SA
*} *}
{extends file="helper/form/form.tpl"}
{if $firstCall}
<script type="text/javascript"> {block name=script}
var vat_number = {$vat_number};
var module_dir = '{$module_dir}'; $(document).ready(function() {
$('input[name=share_order]').attr('disabled', true);
$(document).ready(function() {ldelim} $('input[name=share_customer]').click(function()
var id_language = {$defaultFormLanguage}; {
var languages = new Array(); var disabled = ($('input[name=share_customer]').attr('checked')) ? false : true;
{foreach $languages as $k => $language} $('input[name=share_order]').attr('disabled', disabled);
languages[{$k}] = {ldelim} if (disabled)
id_lang: {$language.id_lang}, $('#share_order_off').attr('checked', true);
iso_code: '{$language.iso_code}', });
name: '{$language.name}'
{rdelim}; $('#useImportData').click(function() {
{/foreach} $('#importList').slideToggle('slow');
displayFlags(languages, id_language, {$allowEmployeeFormLang}); });
});
$('input[name=share_order]').attr('disabled', true);
$('input[name=share_customer]').click(function() {/block}
{
var disabled = ($('input[name=share_customer]').attr('checked')) ? false : true; {block name="label"}
$('input[name=share_order]').attr('disabled', disabled);
if (disabled) {if $input.type == 'text' && $input.name == 'name'}
$('#share_order_off').attr('checked', true); <div class="hint" name="help_box" style="display:block;">{l s ='You can\'t edit GroupShop when you have more than one Shop'}</div><br />
}); {/if}
$('#useImportData').click(function() { {if isset($input.label)}
$('#importList').slideToggle('slow'); <label>{$input.label} </label>
}); {/if}
{rdelim});
</script> {/block}
<script type="text/javascript" src="../js/form.js"></script>
{/if} {block name="other_fieldsets"}
{if isset($form_import)}
<form action="{$current}&submitAdd{$table}=1&token={$token}" method="post"> <br /><br />
{if $form_id} <fieldset>
<input type="hidden" name="id_{$table}" value="{$form_id}" /> {foreach $form_import as $key => $field}
{/if} {if $key == 'legend'}
<fieldset> <legend>
{foreach $fields as $key => $field} {if isset($field.image)}<img src="{$field.image}" alt="{$field.title}" />{/if}
{if $key == 'legend'} {$field.title}
<legend> </legend>
{if isset($field.image)}<img src="{$field.image}" alt="{$field.title}" />{/if} {elseif $key == 'label'}
{$field.title} <label>{$field}</label>
</legend> {/if}
<div class="hint" name="help_box" style="display:block;">{l s ='You can\'t edit GroupShop when you have more than one Shop'}</div><br /> <div class="clear"></div>
{elseif $key == 'input'} {if $key == 'checkbox'}
{foreach $field as $input} <div class="margin-form">
{if $input.name == 'id_state'} <label><input type="{$field.type}" value="{$field.value}" name="{$field.name}" id="{$field.name}" {if $checked} checked="checked"{/if}/> {$field.label}</label>
<div id="contains_states" {if $contains_states}style="display:none;"{/if}> {elseif $key == 'select'}
{/if} <select name="{$field.name}" id="{$field.name}">
<label>{$input.label} </label> {foreach $field.options.query AS $key => $option}
<div class="margin-form"> <option value="{$key}" {if $key == $defaultGroup}selected="selected"{/if}>
{if $input.type == 'text'} {$option.name}
<input type="text" </option>
name="{$input.name}" {/foreach}
id="{$input.name}" </select>
value="{$fields_value[$input.name]}" {elseif $key == 'allcheckbox'}
{if isset($input.size)}size="{$input.size}"{/if} <div id="importList" {if !$checked}style="display:none"{/if}>
{if isset($input.maxlength)}maxlength="{$input.maxlength}"{/if} <ul>
{if isset($input.class)}class="{$input.class}"{/if} {foreach $field.values as $key => $label}
{if isset($input.readonly) && $input.readonly}readonly="readonly"{/if} /> <li><label><input type="checkbox" name="importData[{$key}]" checked="checked" /> {$label}</label></li>
{elseif $input.type == 'select'} {/foreach}
<select name="{$input.name}" id="{$input.name}" {if isset($input.onchange)}onchange="{$input.onchange}"{/if}> </ul>
{if isset($input.options.optiongroup)} </div>
{foreach $input.options.optiongroup.query AS $optiongroup} {elseif $key == 'p'}
<optgroup label="{$optiongroup[$input.options.optiongroup.label]}"> <p>{$field}</p>
{foreach $optiongroup[$input.options.options.query] as $option} </div>
<option value="{$option[$input.options.options.id]}" {elseif $key == 'submit'}
{if $fields_value[$input.name] == $option[$input.options.options.id]}selected="selected"{/if}>{$option[$input.options.options.name]}</option> <div class="margin-form">
{/foreach} <input type="submit" value="{$field.title}" name="submitAdd{$table}" {if isset($field.class)}class="{$field.class}"{/if} />
</optgroup> </div>
{/foreach} {/if}
{else} {/foreach}
{foreach $input.options.query AS $option} </fieldset>
<option value="{$option[$input.options.id]}" {/if}
{if $fields_value[$input.name] == $option[$input.options.id]}selected="selected"{/if}>{$option[$input.options.name]}</option> {/block}
{/foreach}
{/if}
</select>
{elseif $input.type == 'radio'}
{foreach $input.values as $value}
<input type="radio"
name="{$input.name}"
id="{$value.id}"
value="{$value.value}"
{if $disabled[$input.name]}disabled="disabled"{/if}
{if $fields_value[$input.name] == $value.value}checked="checked"{/if} />
<label {if isset($input.class)}class="{$input.class}"{/if} for="{$value.id}">
{if isset($input.is_bool) && $input.is_bool == true}
{if $value.value == 1}
<img src="../img/admin/enabled.gif" alt="{$value.label}" title="{$value.label}" />
{else}
<img src="../img/admin/disabled.gif" alt="{$value.label}" title="{$value.label}" />
{/if}
{else}
{$value.label}
{/if}
</label>
{/foreach}
{elseif $input.type == 'textarea'}
<textarea name="{$input.name}" id="{$input.name}" cols="{$input.cols}" rows="{$input.rows}">{$fields_value[$input.name]}</textarea>
{elseif $input.type == 'checkbox'}
{/if}
{if isset($input.required) && $input.required} <sup>*</sup>{/if}
{if isset($input.p)}
<p class="clear">
{if is_array($input.p)}
{foreach $input.p as $p}
{if is_array($p)}
<span id="{$p.id}">{$p.text}</span><br />
{else}
{$p}<br />
{/if}
{/foreach}
{else}
{$input.p}
{/if}
</p>
{/if}
</div>
{if $input.name == 'id_state'}
</div>
{/if}
{/foreach}
{elseif $key == 'submit'}
<div class="margin-form">
<input type="submit" value="{$field.title}" name="submitAdd{$table}" {if isset($field.class)}class="{$field.class}"{/if} />
</div>
{/if}
{/foreach}
{if $required_fields}
<div class="small"><sup>*</sup> {l s ='Required field'}</div>
{/if}
</fieldset>
@@ -1,80 +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 <contact@prestashop.com>
* @copyright 2007-2011 PrestaShop SA
* @version Release: $Revision: 8971 $
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
* International Registered Trademark & Property of PrestaShop SA
*}
<br />
<fieldset>
{foreach $fields as $key => $field}
{if $key == 'legend'}
<legend>
{if isset($field.image)}<img src="{$field.image}" alt="{$field.title}" />{/if}
{$field.title}
</legend>
{elseif $key == 'label'}
<label>{$field}</label>
{/if}
{if $key == 'checkbox'}
<div class="margin-form">
<label><input type="{$field.type}" value="{$field.value}" name="{$field.name}" id="{$field.name}" {if $checked} checked="checked"{/if}/> {$field.label}</label>
{elseif $key == 'select'}
<select name="{$field.name}" id="{$field.name}">
{foreach $field.options.query AS $key => $option}
<option value="{$key}" {if $key == $defaultGroup}selected="selected"{/if}>
{$option.name}
</option>
{/foreach}
</select>
{elseif $key == 'allcheckbox'}
<div id="importList" {if !$checked}style="display:none"{/if}>
<ul>
{foreach $field.values as $key => $label}
<li><label><input type="checkbox" name="importData[{$key}]" checked="checked" /> {$label}</label></li>
{/foreach}
</ul>
</div>
{elseif $key == 'p'}
<p>{$field}</p>
</div>
{elseif $key == 'submit'}
<div class="margin-form">
<input type="submit" value="{$field.title}" name="submitAdd{$table}" {if isset($field.class)}class="{$field.class}"{/if} />
</div>
{/if}
{/foreach}
{if $required_fields}
<div class="small"><sup>*</sup> {l s ='Required field'}</div>
{/if}
</fieldset>
</form>
<br /><br />
{if $firstCall}
{if $back}
<a href="{$back}"><img src="../img/admin/arrow2.gif" />{l s='Back'}</a>
{else}
<a href="{$current}&token={$token}"><img src="../img/admin/arrow2.gif" />{l s='Back to list'}</a>
{/if}
<br />
{/if}
+9 -23
View File
@@ -144,14 +144,6 @@ class AdminGroupShopControllerCore extends AdminController
else else
$disabled = false; $disabled = false;
$this->context->smarty->assign(array(
'disabled' => $disabled,
'checked' => (Tools::getValue('addgroup_shop') !== false) ? true : false,
'defaultGroup' => Shop::getInstance(Configuration::get('PS_SHOP_DEFAULT'))->getGroupID()
));
$this->content .= parent::initForm();
$import_data = array( $import_data = array(
'attribute_group' => $this->l('Attribute groups'), 'attribute_group' => $this->l('Attribute groups'),
'attribute' => $this->l('Attributes'), 'attribute' => $this->l('Attributes'),
@@ -187,23 +179,17 @@ class AdminGroupShopControllerCore extends AdminController
'type' => 'checkbox', 'type' => 'checkbox',
'values' => $import_data 'values' => $import_data
), ),
'p' => $this->l('Use this option to associate data (products, modules, etc.) the same way as the selected shop'), 'p' => $this->l('Use this option to associate data (products, modules, etc.) the same way as the selected shop')
'submit' => array(
'title' => $this->l(' Save '),
'class' => 'button'
)
); );
$helper = new HelperForm(); $this->tpl_form_vars = array(
// Check if form template has been overriden 'disabled' => $disabled,
if (file_exists($this->context->smarty->template_dir[0].'/'.$this->tpl_folder.'form_import.tpl')) 'checked' => (Tools::getValue('addgroup_shop') !== false) ? true : false,
$helper->tpl = $this->tpl_folder.'form_import.tpl'; 'defaultGroup' => Shop::getInstance(Configuration::get('PS_SHOP_DEFAULT'))->getGroupID(),
$helper->currentIndex = self::$currentIndex; 'form_import' => $this->fields_import_form
$helper->token = $this->token; );
$helper->table = $this->table;
$helper->id = $obj->id; return parent::initForm();
$helper->fields_value = $this->getFieldsValue($obj);
$this->content .= $helper->generateForm($this->fields_import_form);
} }
public function postProcess() public function postProcess()