// MERGE product_multistore branch : product fields are now editable per shop

git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@14682 b9a71923-0436-4b27-9f14-aed3839534dd
This commit is contained in:
rMalie
2012-04-17 13:32:12 +00:00
parent d4d1c35cb9
commit 0c2dd0cd2f
134 changed files with 3185 additions and 1789 deletions
@@ -29,30 +29,30 @@ $().ready(function() {
// Click on "all shop"
$('.input_all_shop').live('click', function() {
var checked = $(this).attr('checked');
$('.input_group_shop:not(:disabled)').attr('checked', checked);
$('.input_shop_group:not(:disabled)').attr('checked', checked);
$('.input_shop:not(:disabled)').attr('checked', checked);
});
// Click on a group shop
$('.input_group_shop').live('click', function() {
$('.input_shop_group').live('click', function() {
$('.input_shop[value='+$(this).val()+']').attr('checked', $(this).attr('checked'));
check_all_shop();
});
// Click on a shop
$('.input_shop').live('click', function() {
check_group_shop_status($(this).val());
check_shop_group_status($(this).val());
check_all_shop();
});
// Initialize checkbox
$('.input_group_shop').each(function(k, v) {
check_group_shop_status($(v).val());
$('.input_shop_group').each(function(k, v) {
check_shop_group_status($(v).val());
check_all_shop();
});
});
function check_group_shop_status(id_group) {
function check_shop_group_status(id_group) {
var groupChecked = true;
var total = 0;
$('.input_shop[value='+id_group+']').each(function(k, v) {
@@ -62,12 +62,12 @@ function check_group_shop_status(id_group) {
});
if (total > 0)
$('.input_group_shop[value='+id_group+']').attr('checked', groupChecked);
$('.input_shop_group[value='+id_group+']').attr('checked', groupChecked);
}
function check_all_shop() {
var allChecked = true;
$('.input_group_shop:not(:disabled)').each(function(k, v) {
$('.input_shop_group:not(:disabled)').each(function(k, v) {
if (!$(v).attr('checked'))
allChecked = false;
});
@@ -78,26 +78,22 @@ function check_all_shop() {
<div class="assoShop">
<table class="table" cellpadding="0" cellspacing="0" width="100%">
<tr>
<th>{if $input.type == 'group_shop'}{l s='Group shop'}{else}{l s='Shop'}{/if}</th>
<th>{l s='Shop'}</th>
</tr>
<tr {if $input.type == 'group_shop'}class="alt_row"{/if}>
<tr>
<td>
<label class="t"><input class="input_all_shop" type="checkbox" /> <b>{if $input.type == 'group_shop'}{l s='All group shops'}{else}{l s='All shops'}{/if}</b></label>
<label class="t"><input class="input_all_shop" type="checkbox" /> <b>{l s='All shops'}</b></label>
</td>
</tr>
{foreach $input.values as $groupID => $groupData}
{if ($input.type == 'group_shop' && isset($fields_value.shop[$groupID]))}
{assign var=groupChecked value=true}
{else}
{assign var=groupChecked value=false}
{/if}
<tr {if $input.type == 'shop'}class="alt_row"{/if}>
<td>
<img style="vertical-align:middle;" alt="" src="../img/admin/lv2_b.gif" />
<label class="t">
<input class="input_group_shop"
<input class="input_shop_group"
type="checkbox"
name="checkBoxGroupShopAsso_{$table}[{$form_id}][{$groupID}]"
name="checkBoxShopGroupAsso_{$table}[{$form_id}][{$groupID}]"
value="{$groupID}"
{if $groupChecked} checked="checked"{/if} />
<b>{l s='Group:'} {$groupData['name']}</b>
@@ -284,7 +284,7 @@
{elseif $input.type == 'group'}
{assign var=groups value=$input.values}
{include file='helpers/form/form_group.tpl'}
{elseif $input.type == 'shop' OR $input.type == 'group_shop'}
{elseif $input.type == 'shop'}
{$input.html}
{elseif $input.type == 'categories'}
{include file='helpers/form/form_category.tpl' categories=$input.values}
@@ -58,11 +58,21 @@
<p>{$categoryData['info']}</p>
{/if}
{if $use_multishop}
<input type="checkbox" style="vertical-align: text-top" checked="checked" onclick="checkAllMultishopDefaultValue(this)" /> <b>{l s='Uncheck / check all'}</b> {l s='(uncheck boxes if you want to set a custom value for this shop or group shop context)'}
<div class="separation"></div>
{/if}
{foreach $categoryData['fields'] AS $key => $field}
{if $field['type'] == 'hidden'}
<input type="hidden" name="{$key}" value="{$field['value']}" />
{else}
<div style="clear: both; padding-top:15px;" id="conf_id_{$key}" {if $field['is_invisible']} class="isInvisible"{/if}>
{if ($field['multishop_default'])}
<div class="preference_default_multishop">
<input type="checkbox" name="configUseDefault[{$key}]" value="1" {if $field['is_disabled']} checked="checked"{/if} onclick="checkMultishopDefaultValue(this, '{$key}')" />
</div>
{/if}
{block name="label"}
{if isset($field['title'])}
<label class="conf_title">
@@ -170,13 +180,6 @@
{/if}
{if isset($field['hint'])}<span class="hint" name="help_box">{$field['hint']}<span class="hint-pointer">&nbsp;</span></span>{/if}
{/block}{* end block input *}
{if ($field['multishop_default'])}
<div class="preference_default_multishop">
<label>
<input type="checkbox" name="configUseDefault[{$key}]" value="1" {if $field['is_disabled']} checked="checked"{/if} onclick="checkMultishopDefaultValue(this, '{$key}')" /> {l s='Use default value'}
</label>
</div>
{/if}
{if isset($field['desc'])}<p class="preference_description">{$field['desc']}</p>{/if}
{if $field['is_invisible']}<p class="warn">{l s='You can\'t change the value of this configuration field in the context of this shop'}</p>{/if}
</div>