[*] BO : improve duplicate shop form
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@13752 b9a71923-0436-4b27-9f14-aed3839534dd
This commit is contained in:
@@ -78,43 +78,47 @@
|
||||
{block name="other_fieldsets"}
|
||||
{if isset($form_import)}
|
||||
<br /><br />
|
||||
<fieldset>
|
||||
<fieldset><legend>{l s='Import data from another shop'}</legend>
|
||||
{foreach $form_import 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'}
|
||||
{if $key == 'radio'}
|
||||
<label>{$field.label} :</label>
|
||||
<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 == $defaultShop}selected="selected"{/if}>
|
||||
{$option.name}
|
||||
</option>
|
||||
{/foreach}
|
||||
</select>
|
||||
{elseif $key == 'allcheckbox'}
|
||||
<div id="importList" style="clear:both;{if !$checked}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>
|
||||
<label class="t" for="{$field.name}_on"><img src="../img/admin/enabled.gif" alt="{l s='Yes'}" title="{l s='Yes'}" /></label>
|
||||
<input type="radio" name="{$field.name}" id="{$field.name}_on" value="1" {if $field.value } checked="checked" {/if} />
|
||||
<label class="t" for="{$field.name}_on"> {l s='Yes'}</label>
|
||||
<label class="t" for="{$field.name}_off"><img src="../img/admin/disabled.gif" alt="{l s='No'}" title="{l s='No'}" style="margin-left: 10px;" /></label>
|
||||
<input type="radio" name="{$field.name}" id="{$field.name}_off" value="0" {if !$field.value } checked="checked" {/if}/>
|
||||
<label class="t" for="{$field.name}_off"> {l s='No'}</label>
|
||||
</div>
|
||||
{elseif $key == 'select'}
|
||||
<div id="shop_list" {if !$checked}display:none{/if}>
|
||||
<label>{$field.label} :</label>
|
||||
<div class="margin-form">
|
||||
<select name="{$field.name}" id="{$field.name}" >
|
||||
{foreach $field.options.query AS $key => $option}
|
||||
<option value="{$key}" {if $key == $defaultShop}selected="selected"{/if}>
|
||||
{$option.name}
|
||||
</option>
|
||||
{/foreach}
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
{elseif $key == 'allcheckbox'}
|
||||
<div id="data_list" {if !$checked}display:none{/if}>
|
||||
<label>{$field.label} :</label>
|
||||
<div class="margin-form">
|
||||
<ul>
|
||||
{foreach $field.values as $key => $label}
|
||||
<li><input type="checkbox" name="importData[{$key}]" checked="checked" /> {$label}</li>
|
||||
{/foreach}
|
||||
</ul>
|
||||
</div>
|
||||
</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}
|
||||
{/if}
|
||||
{/foreach}
|
||||
</fieldset>
|
||||
{/if}
|
||||
@@ -123,8 +127,11 @@
|
||||
{block name=script}
|
||||
|
||||
$(document).ready(function() {
|
||||
$('#useImportData').click(function() {
|
||||
$('#importList').slideToggle('slow');
|
||||
$('input[name=useImportData]').click(function() {
|
||||
if ($(this).attr('id') == 'useImportData_on')
|
||||
$('#shop_list, #data_list').slideDown('slow');
|
||||
else
|
||||
$('#shop_list, #data_list').slideUp('slow');
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user