// Fix bugs in AdminProductsController

This commit is contained in:
lLefevre
2011-12-09 13:37:08 +00:00
parent 8774d945d4
commit 540858527b
18 changed files with 2068 additions and 1813 deletions
+7 -8
View File
@@ -42,7 +42,7 @@
{if count($errors)} {* @todo what is ??? AND $this->_includeContainer *}
<div class="error">
<span style="float:right"><a id="hideError" href=""><img alt="X" src="../img/admin/close.png" /></a></span><img src="../img/admin/error2.png" />
<span style="float:right"><a id="hideError" href=""><img alt="X" src="../img/admin/close.png" /></a></span>
{if count($errors) == 1}
{$errors[0]}
{else}
@@ -78,17 +78,16 @@
<span style="float:right">
<a id="hideWarn" href=""><img alt="X" src="../img/admin/close.png" /></a>
</span>
<img src="../img/admin/warn2.png" />
{if count($warnings) > 1}
{l s='There are'} {count($warnings)} {l s='warnings'}
<span style="margin-left:20px;" id="labelSeeMore">
<a id="linkSeeMore" href="#" style="text-decoration:underline">{l s='Click here to see more'}</a>
<a id="linkHide" href="#" style="text-decoration:underline;display:none">{l s='Hide warning'}</a>
</span>
{else}
{l s='There is'} {count($warnings)} {l s='warning'}
{l s='There is'} {count($warnings)} {l s='warning'} :
{/if}
<span style="margin-left:20px;" id="labelSeeMore">
<a id="linkSeeMore" href="#" style="text-decoration:underline">{l s='Click here to see more'}</a>
<a id="linkHide" href="#" style="text-decoration:underline;display:none">{l s='Hide warning'}</a>
</span>
<ul style="display:none;" id="seeMore">
<ul style="display:{if count($warnings) > 1}none{else}block{/if};" id="seeMore">
{foreach $warnings as $warning}
<li>{$warning}</li>
{/foreach}
@@ -23,27 +23,32 @@
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
* International Registered Trademark & Property of PrestaShop SA
*}
<h4>{l s='Accounting'}</h4>
<div class="separation"></div>
{if !empty($error)}
<div class="hint" style="display:block">{$error}</div>
{else}
<fieldset>
<legend>{l s='Account number'}</legend>
<div class="hint" style="display:block">
{l s='Configure the account number of the product for each zone, if a field is empty, it will use the default one of the shop set in the Accounting Management tab'}
</div>
<br />
{foreach from=$productAccountNumberList['zones'] key=id_zone item=currentZone}
<label>{$currentZone['name']}</label>
<div class="margin-form">
<input type="text" name="zone_{$id_zone}" value="{$currentZone['account_number']}" />
</div>
{/foreach}
</form>
<div style="text-align:left; font-size:11px;">
<i>{l s='Theses fields are used for the accounting export'}</i>
</div>
<div class="separation"></div>
</fieldset>
{if isset($product->id)}
<h4>{l s='Accounting'}</h4>
<div class="separation"></div>
{if !empty($error)}
<div class="hint" style="display:block">{$error}</div>
{else}
<fieldset>
<legend>{l s='Account number'}</legend>
<div class="hint" style="display:block">
{l s='Configure the account number of the product for each zone, if a field is empty, it will use the default one of the shop set in the Accounting Management tab'}
</div>
<br />
{foreach from=$productAccountNumberList['zones'] key=id_zone item=currentZone}
<label>{$currentZone['name']}</label>
<div class="margin-form">
<input type="text" name="zone_{$id_zone}" value="{$currentZone['account_number']}" />
</div>
{/foreach}
</form>
<div style="text-align:left; font-size:11px;">
<i>{l s='Theses fields are used for the accounting export'}</i>
</div>
<div class="separation"></div>
</fieldset>
{/if}
{/if}
@@ -23,7 +23,9 @@
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
* International Registered Trademark & Property of PrestaShop SA
*}
{if $obj->id}<input type="hidden" name="id_{$table}" value="{$obj->id}" />{/if}
{if isset($obj->id)}
<h4>{l s='Attachment'}</h4>
<div class="separation"></div>
<fieldset>
@@ -56,38 +58,40 @@
</div>
<div class="small"><sup>*</sup> {l s='Required field'}</div>
</fieldset>
<div class="clear">&nbsp;</div>
<table>
<tr>
<td>
<p>{l s='Attachments for this product:'}</p>
<select multiple id="selectAttachment1" name="attachments[]" style="width:300px;height:160px;">
{foreach $attach1 as $attach}
<option value="{$attach.id_attachment}">{$attach.name}</option>
{/foreach}
</select><br /><br />
<a href="#" id="removeAttachment" style="text-align:center;display:block;border:1px solid #aaa;text-decoration:none;background-color:#fafafa;color:#123456;margin:2px;padding:2px">
{l s='Remove'} &gt;&gt;
</a>
</td>
<td style="padding-left:20px;">
<p>{l s='Available attachments:'}</p>
<select multiple id="selectAttachment2" style="width:300px;height:160px;">
{foreach $attach2 as $attach}
<option value="{$attach.id_attachment}">{$attach.name}</option>
{/foreach}
</select><br /><br />
<a href="#" id="addAttachment" style="text-align:center;display:block;border:1px solid #aaa;text-decoration:none;background-color:#fafafa;color:#123456;margin:2px;padding:2px">
&lt;&lt; {l s='Add'}
</a>
</div>
</td>
</tr>
</table>
<div class="clear">&nbsp;</div>
<input type="submit" name="submitAttachments" id="submitAttachments" value="{l s='Update attachments'}" class="button" />
<div class="clear">&nbsp;</div>
<table>
<tr>
<td>
<p>{l s='Attachments for this product:'}</p>
<select multiple id="selectAttachment1" name="attachments[]" style="width:300px;height:160px;">
{foreach $attach1 as $attach}
<option value="{$attach.id_attachment}">{$attach.name}</option>
{/foreach}
</select><br /><br />
<a href="#" id="removeAttachment" style="text-align:center;display:block;border:1px solid #aaa;text-decoration:none;background-color:#fafafa;color:#123456;margin:2px;padding:2px">
{l s='Remove'} &gt;&gt;
</a>
</td>
<td style="padding-left:20px;">
<p>{l s='Available attachments:'}</p>
<select multiple id="selectAttachment2" style="width:300px;height:160px;">
{foreach $attach2 as $attach}
<option value="{$attach.id_attachment}">{$attach.name}</option>
{/foreach}
</select><br /><br />
<a href="#" id="addAttachment" style="text-align:center;display:block;border:1px solid #aaa;text-decoration:none;background-color:#fafafa;color:#123456;margin:2px;padding:2px">
&lt;&lt; {l s='Add'}
</a>
</div>
</td>
</tr>
</table>
<div class="clear">&nbsp;</div>
<input type="submit" name="submitAttachments" id="submitAttachments" value="{l s='Update attachments'}" class="button" />
<script type="text/javascript">
displayFlags(languages, id_language, allowEmployeeFormLang);
</script>
<script type="text/javascript">
displayFlags(languages, id_language, allowEmployeeFormLang);
</script>
{/if}
@@ -24,26 +24,15 @@
* International Registered Trademark & Property of PrestaShop SA
*}
<script type="text/javascript">
$(document).ready(function(){
$('#id_mvt_reason').change(function(){
{if isset($product->id)}
<script type="text/javascript">
$(document).ready(function(){
$('#id_mvt_reason').change(function(){
updateMvtStatus($(this).val());
});
updateMvtStatus($(this).val());
});
updateMvtStatus($(this).val());
if ( $("input[name=is_virtual_file]:checked").val() == 1)
{
$("#virtual_good_attributes").show();
$("#is_virtual_file_product").show();
}
else
{
$("#virtual_good_attributes").hide();
$("#is_virtual_file_product").hide();
}
$("input[name=is_virtual_file]").live("change", function() {
if($(this).val() == "1")
if ( $("input[name=is_virtual_file]:checked").val() == 1)
{
$("#virtual_good_attributes").show();
$("#is_virtual_file_product").show();
@@ -53,283 +42,296 @@
$("#virtual_good_attributes").hide();
$("#is_virtual_file_product").hide();
}
$("input[name=is_virtual_file]").live("change", function() {
if($(this).val() == "1")
{
$("#virtual_good_attributes").show();
$("#is_virtual_file_product").show();
}
else
{
$("#virtual_good_attributes").hide();
$("#is_virtual_file_product").hide();
}
});
});
});
</script>
<script type="text/javascript">
var attrs = new Array();
var modifyattributegroup = "{l s='Modify this attribute combination' js=1}";
attrs[0] = new Array(0, "---");
{foreach from=$attributeJs key=idgrp item=group}
attrs[{$idgrp}] = new Array(0
, '---'
{foreach from=$group key=idattr item=attrname}
, "{$idattr}", "{$attrname|addslashes}"
</script>
<script type="text/javascript">
var attrs = new Array();
var modifyattributegroup = "{l s='Modify this attribute combination' js=1}";
attrs[0] = new Array(0, "---");
{foreach from=$attributeJs key=idgrp item=group}
attrs[{$idgrp}] = new Array(0
, '---'
{foreach from=$group key=idattr item=attrname}
, "{$idattr}", "{$attrname|addslashes}"
{/foreach}
);
{/foreach}
);
{/foreach}
</script>
<h4>{l s='Add or modify combinations for this product'}</h4>
<div class="separation"></div> {l s='or go to'}
&nbsp;<a class="button bt-icon" href="index.php?tab=AdminAttributeGenerator&id_product={$product->id}&attributegenerator&token={$token_generator}" onclick="return confirm('{l s='Are you sure you want to delete entered product information?'}');"><img src="../img/admin/appearance.gif" alt="combinations_generator" class="middle" title="{l s='Product combinations generator'}" /><span>{l s='Product combinations generator'}</span></a>
<div class="separation"></div>
<div id="add_new_combination" style="display: none;">
<table cellpadding="5" style="width:100%">
<tr>
<td style="width:150px;vertical-align:top;text-align:right;padding-right:10px;font-weight:bold;" valign="top">
{l s='Group:'}
</td>
<td style="padding-bottom:5px;">
<select name="attribute_group" id="attribute_group" style="width: 200px;" onchange="populate_attrs();">
{if isset($attributes_groups)}
{foreach from=$attributes_groups key=k item=attribute_group}
<option value="{$attribute_group.id_attribute_group}">{$attribute_group.name|htmlentitiesUTF8}&nbsp;&nbsp;</option>
{/foreach}
{/if}
</select>
</td>
</tr>
<tr>
<td style="width:150px;vertical-align:top;text-align:right;padding-right:10px;font-weight:bold;" valign="top">
{l s='Attribute:'}
</td>
<td style="padding-bottom:5px;">
<select name="attribute" id="attribute" style="width: 200px;">
<option value="0">---</option>
</select>
<script type="text/javascript">
$(document).ready(function(){
populate_attrs();
});
</script>
</td>
</tr>
<tr>
<td style="width:150px;vertical-align:top;text-align:right;padding-right:10px;font-weight:bold;" valign="top">
<input style="width: 140px; margin-bottom: 10px;" type="button" value="{l s='Add'}" class="button" onclick="add_attr();"/><br />
<input style="width: 140px;" type="button" value="{l s='Delete'}" class="button" onclick="del_attr()"/></td>
<td align="left">
<select id="product_att_list" name="attribute_combinaison_list[]" multiple="multiple" size="4" style="width: 320px;"></select>
</td>
</tr>
<tr>
<td colspan="2">
<div class="separation"></div>
</td>
</tr>
<tr>
<td style="width:150px;vertical-align:top;text-align:right;padding-right:10px;font-weight:bold;">{l s='Reference:'}</td>
<td style="padding-bottom:5px;">
<input size="55" type="text" id="attribute_reference" name="attribute_reference" value="" style="width: 130px; margin-right: 44px;" />
{l s='EAN13:'}<input size="55" maxlength="13" type="text" id="attribute_ean13" name="attribute_ean13" value="" style="width: 110px; margin-left: 10px; margin-right: 44px;" />
{l s='UPC:'}<input size="55" maxlength="12" type="text" id="attribute_upc" name="attribute_upc" value="" style="width: 110px; margin-left: 10px; margin-right: 44px;" />
<span class="hint" name="help_box">{l s='Special characters allowed:'} .-_#<span class="hint-pointer">&nbsp;</span></span>
</td>
</tr>
<tr>
<td colspan="2">
<div class="separation"></div>
</td>
</tr>
</table>
<table cellpadding="5" id="virtual_good_attributes" style="width:100%;display:none;">
<tr>
<td colspan="2">
<div style="padding:5px;width:50%;float:left;margin-right:20px;border-right:1px solid #E0D0B1">
<p>{l s='Your server\'s maximum upload file size is'}:&nbsp;{$upload_max_filesize}</p>
<label id="virtual_product_file_attribute_label" for="virtual_product_file_attribute" class="t">{l s='Upload a file'}</label>
<p><input id="virtual_product_file_attribute" name="virtual_product_file_attribute" onchange="uploadFile2();" maxlength="'.$this->maxFileSize.'" type="file"></p>
<div id="upload-confirmation2">
<p id="gethtmlink" style="display: none;">{l s='This is the link'} :&nbsp;{$product->productDownload->getHtmlLink(false, true)}
<a id="make_downloadable_product_attribute" onclick="return confirm('{l s='Delete this file' slashes=1 js=1}')" href="index.php?tab=AdminProducts&id_product={$product->productDownload->id_product}&id_category={$id_category}&token={$token}&deleteVirtualProductAttribute=true" class="red">{l s='Delete this file'}</a>
</p>
</div>
<a id="delete_downloadable_product_attribute" style="display:none;" onclick="return confirm('{l s='Delete this file' slashes=1 js=1}')" href="index.php?tab=AdminProducts&id_product={$product->id}&id_category={$id_category}&token={$token}&deleteVirtualProductAttribute=true" class="red">{l s='Delete this file'}</a>
{if $up_filename}
<input type="hidden" id="virtual_product_filename_attribute" name="virtual_product_filename_attribute" value="{$up_filename}" />
{/if}
<p class="block">
<label for="virtual_product_name" class="t">{l s='Filename'}</label>
<input id="virtual_product_name_attribute" name="virtual_product_name_attribute" style="width:200px" value="" type="text">
<span class="hint" name="help_box" style="display:none;">{l s='The full filename with its extension (e.g., Book.pdf)'}</span>
</p>
</div>
<div id="virtual_good_more_attribute" style="padding:5px;width:40%;float:left;margin-left:10px">
<p class="block">
<label for="virtual_product_nb_downloable" class="t">{l s='Number of downloads'}</label>
<input type="text" id="virtual_product_nb_downloable_attribute" name="virtual_product_nb_downloable_attribute" value="" class="" size="6" />
<span class="hint" name="help_box" style="display:none">{l s='Number of authorized downloads per customer'}</span>
</p>
<p class="block">
<label for="virtual_product_expiration_date_attribute" class="t">{l s='Expiration date'}</label>
<input type="text" id="virtual_product_expiration_date_attribute" name="virtual_product_expiration_date_attribute" value="" size="11" maxlength="10" autocomplete="off" /> {l s='Format: YYYY-MM-DD'}
<span class="hint" name="help_box" style="display:none">{l s='No expiration date if you leave this blank'}</span>
</p>
<p class="block">
<label for="virtual_product_nb_days" class="t">{l s='Number of days'}</label>
<input type="text" id="virtual_product_nb_days_attribute" name="virtual_product_nb_days_attribute" value="" class="" size="4" /><sup> *</sup>
<span class="hint" name="help_box" style="display:none">{l s='How many days this file can be accessed by customers'} - <em>({l s='set to zero for unlimited access'} ) </em></span>
</p>
<p class="block">
<label for="virtual_product_is_shareable_attribute" class="t">{l s='is shareable'}</label>
<input type="checkbox" id="virtual_product_is_shareable_attribute" name="virtual_product_is_shareable" value="1" />
<span class="hint" name="help_box" style="display:none">{l s='Specify if the file can be shared'}</span>
</p>
</div>
</td>
</tr>
<tr>
<td colspan="2">
<div class="separation"></div>
</td>
</tr>
</table>
<table>
<tr>
<td style="width:150px;vertical-align:top;text-align:right;padding-right:10px;font-weight:bold;">
{l s='Wholesale price:'}
</td>
<td style="padding-bottom:5px;">
{if $currency->format % 2 != 0}{$currency->sign}{/if}
<input type="text" size="6" name="attribute_wholesale_price" id="attribute_wholesale_price" value="0.00" onKeyUp="if (isArrowKey(event)) return ;this.value = this.value.replace(/,/g, '.');" />
{if $currency->format % 2 == 0} {$currency->sign} {/if}({l s='overrides Wholesale price on Information tab'})
</td>
</tr>
<tr>
<td style="width:150px;vertical-align:top;text-align:right;padding-right:10px;font-weight:bold;">{l s='Impact on price:'}</td>
<td colspan="2" style="padding-bottom:5px;">
<select name="attribute_price_impact" id="attribute_price_impact" style="width: 140px;" onchange="check_impact(); calcImpactPriceTI();">
<option value="0">{l s='None'}</option>
<option value="1">{l s='Increase'}</option>
<option value="-1">{l s='Reduction'}</option>
</select>
<span id="span_impact">&nbsp;&nbsp;{l s='of'}&nbsp;&nbsp;{if $currency->format % 2 != 0}{$currency->sign} {/if}
<input type="text" size="6" name="attribute_price" id="attribute_price" value="0.00" onKeyUp="if (isArrowKey(event)) return ;this.value = this.value.replace(/,/g, '.'); calcImpactPriceTI();"/>{if $currency->format % 2 == 0} {$currency->sign}{/if}
{if $country_display_tax_label}
{l s='(tax excl.)'}
<span {if $tax_exclude_option}style="display:none"{/if}> {l s='or'}
{if $currency->format % 2 != 0}{$currency->sign} {/if}
<input type="text" size="6" name="attribute_priceTI" id="attribute_priceTI" value="0.00" onKeyUp="if (isArrowKey(event)) return ;this.value = this.value.replace(/,/g, '.'); calcImpactPriceTE();"/>
{if $currency->format % 2 == 0} {$currency->sign}{/if} {l s='(tax incl.)'}
</span> {l s='final product price will be set to'}
{if $currency->format % 2 != 0}{$currency->sign} {/if}
<span id="attribute_new_total_price">0.00</span>
{if $currency->format % 2 == 0}{$currency->sign} {/if}
{/if}
</span>
</td>
</tr>
<tr>
<td style="width:150px;vertical-align:top;text-align:right;padding-right:10px;font-weight:bold;">{l s='Impact on weight:'}</td>
<td colspan="2" style="padding-bottom:5px;">
<select name="attribute_weight_impact" id="attribute_weight_impact" style="width: 140px;" onchange="check_weight_impact();">
<option value="0">{l s='None'}</option>
<option value="1">{l s='Increase'}</option>
<option value="-1">{l s='Reduction'}</option>
</select>
<span id="span_weight_impact">&nbsp;&nbsp;{l s='of'}&nbsp;&nbsp;
<input type="text" size="6" name="attribute_weight" id="attribute_weight" value="0.00" onKeyUp="if (isArrowKey(event)) return ;this.value = this.value.replace(/,/g, '.');" />
{$ps_weight_unit}
</span>
</td>
</tr>
<tr id="tr_unit_impact">
<td style="width:150px;vertical-align:top;text-align:right;padding-right:10px;font-weight:bold;">{l s='Impact on unit price :'}</td>
<td colspan="2" style="padding-bottom:5px;">
<select name="attribute_unit_impact" id="attribute_unit_impact" style="width: 140px;" onchange="check_unit_impact();">
<option value="0">{l s='None'}</option>
<option value="1">{l s='Increase'}</option>
<option value="-1">{l s='Reduction'}</option>
</select>
<span id="span_weight_impact">&nbsp;&nbsp;{l s='of'}&nbsp;&nbsp;&nbsp;&nbsp;
{if $currency->format % 2 != 0} {$currency->sign} {/if}
<input type="text" size="6" name="attribute_unity" id="attribute_unity" value="0.00" onKeyUp="if (isArrowKey(event)) return ;this.value = this.value.replace(/,/g, '.');" />{if $currency->format % 2 == 0} {$currency->sign}{/if} / <span id="unity_third">{$field_value_unity}</span>
</span>
</td>
</tr>
{if $ps_use_ecotax}
</script>
<h4>{l s='Add or modify combinations for this product'}</h4>
<div class="separation"></div> {l s='or go to'}
&nbsp;<a class="button bt-icon" href="index.php?tab=AdminAttributeGenerator&id_product={$product->id}&attributegenerator&token={$token_generator}" onclick="return confirm('{l s='Are you sure you want to delete entered product information?'}');"><img src="../img/admin/appearance.gif" alt="combinations_generator" class="middle" title="{l s='Product combinations generator'}" /><span>{l s='Product combinations generator'}</span></a>
<div class="separation"></div>
<div id="add_new_combination" style="display: none;">
<table cellpadding="5" style="width:100%">
<tr>
<td style="width:150px;vertical-align:top;text-align:right;padding-right:10px;font-weight:bold;">
{l s='Eco-tax:'}
<td style="width:150px;vertical-align:top;text-align:right;padding-right:10px;font-weight:bold;" valign="top">
{l s='Group:'}
</td>
<td style="padding-bottom:5px;">{if $currency->format % 2 != 0}{$currency->sign}{/if}
<input type="text" size="3" name="attribute_ecotax" id="attribute_ecotax" value="0.00" onKeyUp="if (isArrowKey(event)) return ;this.value = this.value.replace(/,/g, '.');" />
{if $currency->format % 2 == 0} {$currency->sign}{/if}
({l s='overrides Eco-tax on Information tab'})
<td style="padding-bottom:5px;">
<select name="attribute_group" id="attribute_group" style="width: 200px;" onchange="populate_attrs();">
{if isset($attributes_groups)}
{foreach from=$attributes_groups key=k item=attribute_group}
<option value="{$attribute_group.id_attribute_group}">{$attribute_group.name|htmlentitiesUTF8}&nbsp;&nbsp;</option>
{/foreach}
{/if}
</select>
</td>
</tr>
{/if}
<tr>
<td style="width:150px;vertical-align:top;text-align:right;padding-right:10px;font-weight:bold;" class="col-left">
<label>{l s='Minimum quantity:'}</label>
</td>
<td style="padding-bottom:5px;">
<input size="3" maxlength="6" name="minimal_quantity" id="minimal_quantity" type="text" value="{$minimal_quantity}" />
<p>{l s='The minimum quantity to buy this product (set to 1 to disable this feature)'}</p>
</td>
</tr>
<tr>
<td style="width:150px;vertical-align:top;text-align:right;padding-right:10px;font-weight:bold;" class="col-left" style="width:150px">
<label>{l s='Available date:'}</label>
</td>
<td style="padding-bottom:5px;">
<input class="datepicker" id="available_date" name="available_date" value="{$available_date}" style="text-align: center;" type="text" />
<p>{l s='The available date when this product is out of stock'}</p>
<script type="text/javascript">
<tr>
<td style="width:150px;vertical-align:top;text-align:right;padding-right:10px;font-weight:bold;" valign="top">
{l s='Attribute:'}
</td>
<td style="padding-bottom:5px;">
<select name="attribute" id="attribute" style="width: 200px;">
<option value="0">---</option>
</select>
<script type="text/javascript">
$(document).ready(function(){
$(".datepicker").datepicker({
prevText: '',
nextText: ''
});
populate_attrs();
});
</script>
</td>
</tr>
<tr>
<td colspan="2">
<div class="separation"></div>
</td>
</tr>
<tr>
<td style="width:150px">{l s='Image:'}</td>
<td style="padding-bottom:5px;">
<ul id="id_image_attr">
{foreach from=$images key=k item=image}
<li style="float: left; width: {$imageWidth}px;">
<input type="checkbox" name="id_image_attr[]" value="{$image.id_image}" id="id_image_attr_{$image.id_image}" />
<label for="id_image_attr_{$image.id_image}" style="float: none;">
<img src="{$smarty.const._THEME_PROD_DIR_}{$image.obj->getExistingImgPath()}-small.jpg" alt="{$image.legend|htmlentitiesUTF8}" title="{$image.legend|htmlentitiesUTF8}" />
</label>
</li>
{/foreach}
</ul>
<img id="pic" alt="" title="" style="display: none; width: 100px; height: 100px; float: left; border: 1px dashed #BBB; margin-left: 20px;" />
</td>
</tr>
<tr>
<td style="width:150px">{l s='Default:'}<br /><br /></td>
<td style="padding-bottom:5px;">
<input type="checkbox" name="attribute_default" id="attribute_default" value="1" />
&nbsp;{l s='Make this the default combination for this product'}<br /><br />
</td>
</tr>
<tr>
<td style="width:150px">&nbsp;</td>
<td style="padding-bottom:5px;">
<span style="float: left;">
<input type="submit" name="submitProductAttribute" id="submitProductAttribute" value="{l s='Add this combination'}" class="button" onclick="attr_selectall(); this.form.action += '&addproduct&tabs=3';" add="{l s='Add this combination'}" update="{l s='Update this combination'}" />
</span>
<span id="ResetSpan" style="float: left; margin-left: 8px; display: none;">
<input type="reset" name="ResetBtn" id="ResetBtn" onclick="init_elems(); getE('submitProductAttribute').value ='{l s='Add this attributes group'}';getE('id_product_attribute').value = 0; $('#ResetSpan').slideToggle();" class="button" value="{l s='Cancel modification'}" />
</span>
<span class="clear"></span>
</td>
</tr>
</table>
</div>
{$list}
</script>
</td>
</tr>
<tr>
<td style="width:150px;vertical-align:top;text-align:right;padding-right:10px;font-weight:bold;" valign="top">
<input style="width: 140px; margin-bottom: 10px;" type="button" value="{l s='Add'}" class="button" onclick="add_attr();"/><br />
<input style="width: 140px;" type="button" value="{l s='Delete'}" class="button" onclick="del_attr()"/></td>
<td align="left">
<select id="product_att_list" name="attribute_combinaison_list[]" multiple="multiple" size="4" style="width: 320px;"></select>
</td>
</tr>
<tr>
<td colspan="2">
<div class="separation"></div>
</td>
</tr>
<tr>
<td style="width:150px;vertical-align:top;text-align:right;padding-right:10px;font-weight:bold;">{l s='Reference:'}</td>
<td style="padding-bottom:5px;">
<input size="55" type="text" id="attribute_reference" name="attribute_reference" value="" style="width: 130px; margin-right: 44px;" />
{l s='EAN13:'}<input size="55" maxlength="13" type="text" id="attribute_ean13" name="attribute_ean13" value="" style="width: 110px; margin-left: 10px; margin-right: 44px;" />
{l s='UPC:'}<input size="55" maxlength="12" type="text" id="attribute_upc" name="attribute_upc" value="" style="width: 110px; margin-left: 10px; margin-right: 44px;" />
<span class="hint" name="help_box">{l s='Special characters allowed:'} .-_#<span class="hint-pointer">&nbsp;</span></span>
</td>
</tr>
<tr>
<td colspan="2">
<div class="separation"></div>
</td>
</tr>
</table>
<table cellpadding="5" id="virtual_good_attributes" style="width:100%;display:none;">
<tr>
<td colspan="2">
<div style="padding:5px;width:50%;float:left;margin-right:20px;border-right:1px solid #E0D0B1">
<p>{l s='Your server\'s maximum upload file size is'}:&nbsp;{$upload_max_filesize}</p>
<label id="virtual_product_file_attribute_label" for="virtual_product_file_attribute" class="t">{l s='Upload a file'}</label>
<p><input id="virtual_product_file_attribute" name="virtual_product_file_attribute" onchange="uploadFile2();" maxlength="'.$this->maxFileSize.'" type="file"></p>
<div id="upload-confirmation2">
<p id="gethtmlink" style="display: none;">{l s='This is the link'} :&nbsp;{$product->productDownload->getHtmlLink(false, true)}
<a id="make_downloadable_product_attribute" onclick="return confirm('{l s='Delete this file' slashes=1 js=1}')" href="index.php?tab=AdminProducts&id_product={$product->productDownload->id_product}&id_category={$id_category}&token={$token}&deleteVirtualProductAttribute=true" class="red">{l s='Delete this file'}</a>
</p>
</div>
<a id="delete_downloadable_product_attribute" style="display:none;" onclick="return confirm('{l s='Delete this file' slashes=1 js=1}')" href="index.php?tab=AdminProducts&id_product={$product->id}&id_category={$id_category}&token={$token}&deleteVirtualProductAttribute=true" class="red">{l s='Delete this file'}</a>
{if $up_filename}
<input type="hidden" id="virtual_product_filename_attribute" name="virtual_product_filename_attribute" value="{$up_filename}" />
{/if}
<p class="block">
<label for="virtual_product_name" class="t">{l s='Filename'}</label>
<input id="virtual_product_name_attribute" name="virtual_product_name_attribute" style="width:200px" value="" type="text">
<span class="hint" name="help_box" style="display:none;">{l s='The full filename with its extension (e.g., Book.pdf)'}</span>
</p>
</div>
<div id="virtual_good_more_attribute" style="padding:5px;width:40%;float:left;margin-left:10px">
<p class="block">
<label for="virtual_product_nb_downloable" class="t">{l s='Number of downloads'}</label>
<input type="text" id="virtual_product_nb_downloable_attribute" name="virtual_product_nb_downloable_attribute" value="" class="" size="6" />
<span class="hint" name="help_box" style="display:none">{l s='Number of authorized downloads per customer'}</span>
</p>
<p class="block">
<label for="virtual_product_expiration_date_attribute" class="t">{l s='Expiration date'}</label>
<input type="text" id="virtual_product_expiration_date_attribute" name="virtual_product_expiration_date_attribute" value="" size="11" maxlength="10" autocomplete="off" /> {l s='Format: YYYY-MM-DD'}
<span class="hint" name="help_box" style="display:none">{l s='No expiration date if you leave this blank'}</span>
</p>
<p class="block">
<label for="virtual_product_nb_days" class="t">{l s='Number of days'}</label>
<input type="text" id="virtual_product_nb_days_attribute" name="virtual_product_nb_days_attribute" value="" class="" size="4" /><sup> *</sup>
<span class="hint" name="help_box" style="display:none">{l s='How many days this file can be accessed by customers'} - <em>({l s='set to zero for unlimited access'} ) </em></span>
</p>
<p class="block">
<label for="virtual_product_is_shareable_attribute" class="t">{l s='is shareable'}</label>
<input type="checkbox" id="virtual_product_is_shareable_attribute" name="virtual_product_is_shareable" value="1" />
<span class="hint" name="help_box" style="display:none">{l s='Specify if the file can be shared'}</span>
</p>
</div>
</td>
</tr>
<tr>
<td colspan="2">
<div class="separation"></div>
</td>
</tr>
</table>
<table>
<tr>
<td style="width:150px;vertical-align:top;text-align:right;padding-right:10px;font-weight:bold;">
{l s='Wholesale price:'}
</td>
<td style="padding-bottom:5px;">
{if $currency->format % 2 != 0}{$currency->sign}{/if}
<input type="text" size="6" name="attribute_wholesale_price" id="attribute_wholesale_price" value="0.00" onKeyUp="if (isArrowKey(event)) return ;this.value = this.value.replace(/,/g, '.');" />
{if $currency->format % 2 == 0} {$currency->sign} {/if}({l s='overrides Wholesale price on Information tab'})
</td>
</tr>
<tr>
<td style="width:150px;vertical-align:top;text-align:right;padding-right:10px;font-weight:bold;">{l s='Impact on price:'}</td>
<td colspan="2" style="padding-bottom:5px;">
<select name="attribute_price_impact" id="attribute_price_impact" style="width: 140px;" onchange="check_impact(); calcImpactPriceTI();">
<option value="0">{l s='None'}</option>
<option value="1">{l s='Increase'}</option>
<option value="-1">{l s='Reduction'}</option>
</select>
<span id="span_impact">&nbsp;&nbsp;{l s='of'}&nbsp;&nbsp;{if $currency->format % 2 != 0}{$currency->sign} {/if}
<input type="text" size="6" name="attribute_price" id="attribute_price" value="0.00" onKeyUp="if (isArrowKey(event)) return ;this.value = this.value.replace(/,/g, '.'); calcImpactPriceTI();"/>{if $currency->format % 2 == 0} {$currency->sign}{/if}
{if $country_display_tax_label}
{l s='(tax excl.)'}
<span {if $tax_exclude_option}style="display:none"{/if}> {l s='or'}
{if $currency->format % 2 != 0}{$currency->sign} {/if}
<input type="text" size="6" name="attribute_priceTI" id="attribute_priceTI" value="0.00" onKeyUp="if (isArrowKey(event)) return ;this.value = this.value.replace(/,/g, '.'); calcImpactPriceTE();"/>
{if $currency->format % 2 == 0} {$currency->sign}{/if} {l s='(tax incl.)'}
</span> {l s='final product price will be set to'}
{if $currency->format % 2 != 0}{$currency->sign} {/if}
<span id="attribute_new_total_price">0.00</span>
{if $currency->format % 2 == 0}{$currency->sign} {/if}
{/if}
</span>
</td>
</tr>
<tr>
<td style="width:150px;vertical-align:top;text-align:right;padding-right:10px;font-weight:bold;">{l s='Impact on weight:'}</td>
<td colspan="2" style="padding-bottom:5px;">
<select name="attribute_weight_impact" id="attribute_weight_impact" style="width: 140px;" onchange="check_weight_impact();">
<option value="0">{l s='None'}</option>
<option value="1">{l s='Increase'}</option>
<option value="-1">{l s='Reduction'}</option>
</select>
<span id="span_weight_impact">&nbsp;&nbsp;{l s='of'}&nbsp;&nbsp;
<input type="text" size="6" name="attribute_weight" id="attribute_weight" value="0.00" onKeyUp="if (isArrowKey(event)) return ;this.value = this.value.replace(/,/g, '.');" />
{$ps_weight_unit}
</span>
</td>
</tr>
<tr id="tr_unit_impact">
<td style="width:150px;vertical-align:top;text-align:right;padding-right:10px;font-weight:bold;">{l s='Impact on unit price :'}</td>
<td colspan="2" style="padding-bottom:5px;">
<select name="attribute_unit_impact" id="attribute_unit_impact" style="width: 140px;" onchange="check_unit_impact();">
<option value="0">{l s='None'}</option>
<option value="1">{l s='Increase'}</option>
<option value="-1">{l s='Reduction'}</option>
</select>
<span id="span_weight_impact">&nbsp;&nbsp;{l s='of'}&nbsp;&nbsp;&nbsp;&nbsp;
{if $currency->format % 2 != 0} {$currency->sign} {/if}
<input type="text" size="6" name="attribute_unity" id="attribute_unity" value="0.00" onKeyUp="if (isArrowKey(event)) return ;this.value = this.value.replace(/,/g, '.');" />{if $currency->format % 2 == 0} {$currency->sign}{/if} / <span id="unity_third">{$field_value_unity}</span>
</span>
</td>
</tr>
{if $ps_use_ecotax}
<tr>
<td style="width:150px;vertical-align:top;text-align:right;padding-right:10px;font-weight:bold;">
{l s='Eco-tax:'}
</td>
<td style="padding-bottom:5px;">{if $currency->format % 2 != 0}{$currency->sign}{/if}
<input type="text" size="3" name="attribute_ecotax" id="attribute_ecotax" value="0.00" onKeyUp="if (isArrowKey(event)) return ;this.value = this.value.replace(/,/g, '.');" />
{if $currency->format % 2 == 0} {$currency->sign}{/if}
({l s='overrides Eco-tax on Information tab'})
</td>
</tr>
{/if}
<tr>
<td style="width:150px;vertical-align:top;text-align:right;padding-right:10px;font-weight:bold;" class="col-left">
<label>{l s='Minimum quantity:'}</label>
</td>
<td style="padding-bottom:5px;">
<input size="3" maxlength="6" name="minimal_quantity" id="minimal_quantity" type="text" value="{$minimal_quantity}" />
<p>{l s='The minimum quantity to buy this product (set to 1 to disable this feature)'}</p>
</td>
</tr>
<tr>
<td style="width:150px;vertical-align:top;text-align:right;padding-right:10px;font-weight:bold;" class="col-left" style="width:150px">
<label>{l s='Available date:'}</label>
</td>
<td style="padding-bottom:5px;">
<input class="datepicker" id="available_date" name="available_date" value="{$available_date}" style="text-align: center;" type="text" />
<p>{l s='The available date when this product is out of stock'}</p>
<script type="text/javascript">
$(document).ready(function(){
$(".datepicker").datepicker({
prevText: '',
nextText: ''
});
});
</script>
</td>
</tr>
<tr>
<td colspan="2">
<div class="separation"></div>
</td>
</tr>
<tr>
<td style="width:150px">{l s='Image:'}</td>
<td style="padding-bottom:5px;">
<ul id="id_image_attr">
{foreach from=$images key=k item=image}
<li style="float: left; width: {$imageWidth}px;">
<input type="checkbox" name="id_image_attr[]" value="{$image.id_image}" id="id_image_attr_{$image.id_image}" />
<label for="id_image_attr_{$image.id_image}" style="float: none;">
<img src="{$smarty.const._THEME_PROD_DIR_}{$image.obj->getExistingImgPath()}-small.jpg" alt="{$image.legend|htmlentitiesUTF8}" title="{$image.legend|htmlentitiesUTF8}" />
</label>
</li>
{/foreach}
</ul>
<img id="pic" alt="" title="" style="display: none; width: 100px; height: 100px; float: left; border: 1px dashed #BBB; margin-left: 20px;" />
</td>
</tr>
<tr>
<td style="width:150px">{l s='Default:'}<br /><br /></td>
<td style="padding-bottom:5px;">
<input type="checkbox" name="attribute_default" id="attribute_default" value="1" />
&nbsp;{l s='Make this the default combination for this product'}<br /><br />
</td>
</tr>
<tr>
<td style="width:150px">&nbsp;</td>
<td style="padding-bottom:5px;">
<span style="float: left;">
<input type="submit" name="submitProductAttribute" id="submitProductAttribute" value="{l s='Add this combination'}" class="button" onclick="attr_selectall(); this.form.action += '&addproduct&tabs=3';" add="{l s='Add this combination'}" update="{l s='Update this combination'}" />
</span>
<span id="ResetSpan" style="float: left; margin-left: 8px; display: none;">
<input type="reset" name="ResetBtn" id="ResetBtn" onclick="init_elems(); getE('submitProductAttribute').value ='{l s='Add this attributes group'}';getE('id_product_attribute').value = 0; $('#ResetSpan').slideToggle();" class="button" value="{l s='Cancel modification'}" />
</span>
<span class="clear"></span>
</td>
</tr>
</table>
</div>
{$list}
{/if}
@@ -23,56 +23,58 @@
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
* International Registered Trademark & Property of PrestaShop SA
*}
<h4>{l s='Add or modify customizable properties'}</h4>
<div class="separation"></div><br />
<table cellpadding="5" style="width:100%">
<tr>
<td style="width:150px;text-align:right;padding-right:10px;font-weight:bold;vertical-align:top;" valign="top">{l s='File fields:'}</td>
<td style="padding-bottom:5px;">
<input type="text" name="uploadable_files" id="uploadable_files" size="4" value="{$uploadable_files}" />
<p class="preference_description">{l s='Number of upload file fields displayed'}</p>
</td>
</tr>
<tr>
<td style="width:150px;text-align:right;padding-right:10px;font-weight:bold;vertical-align:top;" valign="top">{l s='Text fields:'}</td>
<td style="padding-bottom:5px;">
<input type="text" name="text_fields" id="text_fields" size="4" value="{$text_fields}" />
<p class="preference_description">{l s='Number of text fields displayed'}</p>
</td>
</tr>
<tr>
<td colspan="2" style="text-align:center;">
<input type="submit" name="submitCustomizationConfiguration" value="{l s='Update settings'}" class="button" onclick="this.form.action += '&addproduct&tabs=5';" />
</td>
</tr>
{if $has_file_labels}
{if isset($obj->id)}
<h4>{l s='Add or modify customizable properties'}</h4>
<div class="separation"></div><br />
<table cellpadding="5" style="width:100%">
<tr>
<td colspan="2"><div class="separation"></div></td>
</tr>
<tr>
<td style="width:150px" valign="top">{l s='Files fields:'}</td>
<td>
{$display_file_labels}
<td style="width:150px;text-align:right;padding-right:10px;font-weight:bold;vertical-align:top;" valign="top">{l s='File fields:'}</td>
<td style="padding-bottom:5px;">
<input type="text" name="uploadable_files" id="uploadable_files" size="4" value="{$uploadable_files}" />
<p class="preference_description">{l s='Number of upload file fields displayed'}</p>
</td>
</tr>
{/if}
{if $has_text_labels}
<tr>
<td colspan="2"><div class="separation"></div></td>
</tr>
<tr>
<td style="width:150px" valign="top">{l s='Text fields:'}</td>
<td>
{$display_text_labels}
<td style="width:150px;text-align:right;padding-right:10px;font-weight:bold;vertical-align:top;" valign="top">{l s='Text fields:'}</td>
<td style="padding-bottom:5px;">
<input type="text" name="text_fields" id="text_fields" size="4" value="{$text_fields}" />
<p class="preference_description">{l s='Number of text fields displayed'}</p>
</td>
</tr>
{/if}
<tr>
<td colspan="2" style="text-align:center;">
{if $has_file_labels || $has_text_labels}
<input type="submit" name="submitProductCustomization" id="submitProductCustomization" value="{l s='Save labels'}" class="button" onclick="this.form.action += '&addproduct&tabs=5';" style="margin-top: 9px" />
{/if}
</td>
</tr>
</table>
<tr>
<td colspan="2" style="text-align:center;">
<input type="submit" name="submitCustomizationConfiguration" value="{l s='Update settings'}" class="button" onclick="this.form.action += '&addproduct&tabs=5';" />
</td>
</tr>
{if $has_file_labels}
<tr>
<td colspan="2"><div class="separation"></div></td>
</tr>
<tr>
<td style="width:150px" valign="top">{l s='Files fields:'}</td>
<td>
{$display_file_labels}
</td>
</tr>
{/if}
{if $has_text_labels}
<tr>
<td colspan="2"><div class="separation"></div></td>
</tr>
<tr>
<td style="width:150px" valign="top">{l s='Text fields:'}</td>
<td>
{$display_text_labels}
</td>
</tr>
{/if}
<tr>
<td colspan="2" style="text-align:center;">
{if $has_file_labels || $has_text_labels}
<input type="submit" name="submitProductCustomization" id="submitProductCustomization" value="{l s='Save labels'}" class="button" onclick="this.form.action += '&addproduct&tabs=5';" style="margin-top: 9px" />
{/if}
</td>
</tr>
</table>
{/if}
+92 -62
View File
@@ -1,66 +1,96 @@
<h4>{l s='Assign features to this product:'}</h4>
<div class="separation"></div>
<ul>
<li>{l s='You can specify a value for each relevant feature regarding this product, empty fields will not be displayed.'}</li>
<li>{l s='You can either set a specific value, or select among existing pre-defined values you added previously.'}</li>
</ul>
{*
* 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$
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
* International Registered Trademark & Property of PrestaShop SA
*}
{if isset($product->id)}
<h4>{l s='Assign features to this product:'}</h4>
<div class="separation"></div>
<ul>
<li>{l s='You can specify a value for each relevant feature regarding this product, empty fields will not be displayed.'}</li>
<li>{l s='You can either set a specific value, or select among existing pre-defined values you added previously.'}</li>
</ul>
</td>
</tr>
</table>
<br />
<table border="0" cellpadding="0" cellspacing="0" class="table" style="width:900px;">
<tr>
<th>{l s='Feature'}</td>
<th style="width:30%">{l s='Pre-defined value'}</td>
<th style="width:40%"><u>{l s='or'}</u> {l s='Customized value'}</td>
</tr>
</table>
{foreach from=$available_features item=available_feature}
<table cellpadding="5" style="width: 900px; margin-top: 10px">
<tr>
<td>{$available_feature.name}</td>
<td style="width: 30%">
{if sizeof($available_feature.featureValues)}
<select id="feature_{$available_feature.id_feature}_value" name="feature_{$available_feature.id_feature}_value"
onchange="$('.custom_{$available_feature.id_feature}_').val('');">
<option value="0">---&nbsp;</option>
{foreach from=$available_feature.featureValues item=value}
<option value="{$value.id_feature_value}"{if $available_feature.current_item == $value.id_feature_value}selected="selected"{/if} >
{$value.value|truncate:40}&nbsp;
</option>
{/foreach}
</select>
{else}
<input type="hidden" name="feature_{$available_feature.id_feature}_value" value="0" />
<span style="font-size: 10px; color: #666;">{l s='N/A'} -
<a href="{$link->getAdminLink('AdminFeatures')}&amp;addfeature_value&id_feature={$available_feature.id_feature}"
style="color: #666; text-decoration: underline;">{l s='Add pre-defined values first'}</a>
</span>
{/if}
</td>
<td style="width:40%" class="translatable">
{foreach from=$languages item=language}
<div class="lang_{$language.id_lang}" style="{if $language.id_lang != $default_form_language}display:none;{/if}float: left;">
<textarea class="custom_{$available_feature.id_feature}_" name="custom_{$available_feature.id_feature}_{$language.id_lang}" cols="40" rows="1"
onkeyup="if (isArrowKey(event)) return ;$('#feature_{$available_feature.id_feature}_value').val(0);" >{$available_feature.val[$language.id_lang].value|htmlentitiesUTF8|default:""}</textarea>
</div>
{/foreach}
</td>
</tr>
</table>
<br />
<table border="0" cellpadding="0" cellspacing="0" class="table" style="width:900px;">
<tr>
<th>{l s='Feature'}</td>
<th style="width:30%">{l s='Pre-defined value'}</td>
<th style="width:40%"><u>{l s='or'}</u> {l s='Customized value'}</td>
</tr>
</table>
{foreach from=$available_features item=available_feature}
<table cellpadding="5" style="width: 900px; margin-top: 10px">
<tr>
<td>{$available_feature.name}</td>
<td style="width: 30%">
{if sizeof($available_feature.featureValues)}
<select id="feature_{$available_feature.id_feature}_value" name="feature_{$available_feature.id_feature}_value"
onchange="$('.custom_{$available_feature.id_feature}_').val('');">
<option value="0">---&nbsp;</option>
{foreach from=$available_feature.featureValues item=value}
<option value="{$value.id_feature_value}"{if $available_feature.current_item == $value.id_feature_value}selected="selected"{/if} >
{$value.value|truncate:40}&nbsp;
</option>
{/foreach}
</select>
{else}
<input type="hidden" name="feature_{$available_feature.id_feature}_value" value="0" />
<span style="font-size: 10px; color: #666;">{l s='N/A'} -
<a href="{$link->getAdminLink('AdminFeatures')}&amp;addfeature_value&id_feature={$available_feature.id_feature}"
style="color: #666; text-decoration: underline;">{l s='Add pre-defined values first'}</a>
</span>
{/if}
</td>
<td style="width:40%" class="translatable">
{foreach from=$languages item=language}
<div class="lang_{$language.id_lang}" style="{if $language.id_lang != $default_form_language}display:none;{/if}float: left;">
<textarea class="custom_{$available_feature.id_feature}_" name="custom_{$available_feature.id_feature}_{$language.id_lang}" cols="40" rows="1"
onkeyup="if (isArrowKey(event)) return ;$('#feature_{$available_feature.id_feature}_value').val(0);" >{$available_feature.val[$language.id_lang].value|htmlentitiesUTF8|default:""}</textarea>
</div>
{foreachelse}
<tr><td colspan="3" style="text-align:center;">{l s='No features defined'}</td></tr>
{/foreach}
</td>
</tr>
</table>
<div class="separation"></div>
<div style="text-align:center;">
<a href="{$link->getAdminLink('AdminFeatures')}&amp;addfeature" onclick="return confirm('{l s='You will lose all modifications not saved, you may want to save modifications first?' js=1}');">
<img src="../img/admin/add.gif" alt="new_features" title="{l s='Add a new feature'}" />&nbsp;{l s='Add a new feature'}
</a>
</div>
<script type="text/javascript">
displayFlags(languages, id_language, allowEmployeeFormLang);
</script>
{foreachelse}
<tr><td colspan="3" style="text-align:center;">{l s='No features defined'}</td></tr>
{/foreach}
</table>
<div class="separation"></div>
<div style="text-align:center;">
<a href="{$link->getAdminLink('AdminFeatures')}&amp;addfeature" onclick="return confirm('{l s='You will lose all modifications not saved, you may want to save modifications first?' js=1}');">
<img src="../img/admin/add.gif" alt="new_features" title="{l s='Add a new feature'}" />&nbsp;{l s='Add a new feature'}
</a>
</div>
<script type="text/javascript">
displayFlags(languages, id_language, allowEmployeeFormLang);
</script>
{/if}
+225 -260
View File
@@ -27,279 +27,244 @@
{extends file="helper/form/form.tpl"}
{block name="defaultForm"}
<div>
<div class="productTabs">
<ul class="tab">
{foreach $product_tabs key=numStep item=tab}
<li class="tab-row">
<a class="tab-page {if $tab.selected}selected{/if}" id="link-{$tab.id}" href="{$tab.href}&amp;updateproduct">{$tab.name}</a>{*todo href when nojs*}
</li>
{/foreach}
</ul>
<div>
<div class="productTabs">
<ul class="tab">
{foreach $product_tabs key=numStep item=tab}
<li class="tab-row">
<a class="tab-page {if $tab.selected}selected{/if}" id="link-{$tab.id}" href="{$tab.href}&amp;updateproduct">{$tab.name}</a>{*todo href when nojs*}
</li>
{/foreach}
</ul>
</div>
</div>
</div>
<script type="text/javascript">
function showSaveButtons()
{
$('#desc-product-save').show();
$('#desc-product-cancel').show();
$('#desc-product-duplicate').show();
$('#desc-product-delete').show();
$('#desc-product-save-and-stay').show();
}
function hideSaveButtons()
{
$('#desc-product-save').hide();
$('#desc-product-cancel').hide();
$('#desc-product-duplicate').hide();
$('#desc-product-delete').hide();
$('#desc-product-save-and-stay').hide();
}
var toload = new Array();
var pos_select = {$pos_select};
var tabs_toolbar_save_buttons = [];
{foreach $tabs_toolbar_save_buttons key=key item=value}
{if $value == true}
tabs_toolbar_save_buttons.push('{$key}');
{/if}
{/foreach}
$(document).ready(function(){
$('#desc-product-newCombination').hide();
{* submenu binding *}
$(".tab-page").click(function(e){
e.preventDefault();
// currentId is the current producttab id
currentId = $(".productTabs a.selected").attr('id').substr(5);
// id is the wanted producttab id
id = $(this).attr('id').substr(5);
// Update submit button value
var split_position = id.indexOf('-') + 1;
var btn_name = id.substr(split_position);
$("#product_form_submit_btn").attr('name', 'submit'+btn_name);
// Show/hide save buttons
if (jQuery.inArray(btn_name, tabs_toolbar_save_buttons) != -1)
showSaveButtons();
else
hideSaveButtons();
if ($(this).attr("id") != $(".productTabs a.selected").attr('id'))
{
$(".tab-page").removeClass('selected');
$("#product-tab-content-"+currentId).hide();
}
else
{
if (confirm(' {l s='Do you really want to reload the current tab (all modifications will be lost)'}'))
$("#product-tab-content-"+currentId).html();
else
return false;
}
$("#product-tab-content-wait").show();
if ($("#product-tab-content-"+id).hasClass('not-loaded') || $(this).hasClass('selected'))
{
myurl = $(this).attr("href")+"&ajax=1";
$.ajax({
url : myurl,
async : true,
success :function(data)
<script type="text/javascript">
var toload = new Array();
var pos_select = {$pos_select};
$(document).ready(function(){
$('#desc-product-newCombination').hide();
{* submenu binding *}
$(".tab-page").click(function(e){
e.preventDefault();
// currentId is the current product tab id
currentId = $(".productTabs a.selected").attr('id').substr(5);
// id is the wanted producttab id
id = $(this).attr('id').substr(5);
// Update submit button value
var split_position = id.indexOf('-') + 1;
var btn_name = id.substr(split_position);
$("#product_form_submit_btn").attr('name', 'submit'+btn_name);
if ($(this).attr("id") != $(".productTabs a.selected").attr('id'))
{
$(".tab-page").removeClass('selected');
$("#product-tab-content-"+currentId).hide();
}
else
{
if (confirm(' {l s='Do you really want to reload the current tab (all modifications will be lost)'}'))
$("#product-tab-content-"+currentId).html();
else
return false;
}
$("#product-tab-content-wait").show();
if ($("#product-tab-content-"+id).hasClass('not-loaded') || $(this).hasClass('selected'))
{
myurl = $(this).attr("href")+"&ajax=1";
$.ajax({
url : myurl,
async : true,
success :function(data)
{
$("#product-tab-content-"+id).html(data);
$("#product-tab-content-"+id).removeClass('not-loaded');
$("#product-tab-content-"+id).show();
$("#link-"+id).addClass('selected');
}
});
}
else
{
$("#product-tab-content-"+id).html(data);
$("#product-tab-content-"+id).removeClass('not-loaded');
$("#product-tab-content-"+id).show();
$("#link-"+id).addClass('selected');
}
});
}
else
{
$("#product-tab-content-"+id).show();
$("#link-"+id).addClass('selected');
}
$("#product-tab-content-wait").hide();
var languages = new Array();
if (btn_name == "Combinations")
{
$('#desc-product-new').hide();
$('#desc-product-newCombination').show();
populate_attrs();
}
else if (btn_name == 'Attachments')
{
$("#addAttachment").live('click', function() {
return !$("#selectAttachment2 option:selected").remove().appendTo("#selectAttachment1");
});
$("#removeAttachment").live('click', function() {
return !$("#selectAttachment1 option:selected").remove().appendTo("#selectAttachment2");
});
$("#product").submit(function() {
$("#selectAttachment1 option").each(function(i) {
$(this).attr("selected", "selected");
});
});
}
else
$('#desc-product-newCombination').hide();
});
{if $show_product_tab_content}
$("div.productTabs a[id$=-{$show_product_tab_content}]").click();
{/if}
});
</script>
{***********************************************}
{********** TO CHECK !!!!!!!!!!!!!!! ***********}
<script type="text/javascript">
// <![CDATA[
ThickboxI18nImage = "{l s='Image'}";
ThickboxI18nOf = "{l s='of'}";
ThickboxI18nClose = "{l s='Close'}";
ThickboxI18nOrEscKey = "{l s='(or "Esc")'}";
ThickboxI18nNext = "{l s='Next >'}";
ThickboxI18nPrev = "{l s='< Previous'}";
tb_pathToImage = "../img/loadingAnimation.gif";
//]]>
</script>
<script type="text/javascript">
//<![CDATA[
function toggleVirtualProduct(elt)
{
$("#is_virtual_file_product").hide();
$("#virtual_good_attributes").hide();
if (elt.checked)
{
$('#virtual_good').show('slow');
$('#virtual_good_more').show('slow');
getE('out_of_stock_1').checked = 'checked';
getE('out_of_stock_2').disabled = 'disabled';
getE('out_of_stock_3').disabled = 'disabled';
getE('label_out_of_stock_2').setAttribute('for', '');
getE('label_out_of_stock_3').setAttribute('for', '');
}
else
{
$('#virtual_good').hide('slow');
$('#virtual_good_more').hide('slow');
getE('out_of_stock_2').disabled = false;
getE('out_of_stock_3').disabled = false;
getE('label_out_of_stock_2').setAttribute('for', 'out_of_stock_2');
getE('label_out_of_stock_3').setAttribute('for', 'out_of_stock_3');
}
}
function uploadFile()
{
$.ajaxFileUpload (
{
url:'./uploadProductFile.php',
secureuri:false,
fileElementId:'virtual_product_file',
dataType: 'xml',
success: function (data, status)
$("#product-tab-content-wait").hide();
var languages = new Array();
if (btn_name == "Combinations")
{
data = data.getElementsByTagName('return')[0];
var result = data.getAttribute("result");
var msg = data.getAttribute("msg");
var fileName = data.getAttribute("filename")
if(result == "error")
$("#upload-confirmation").html('<p>error: ' + msg + '</p>');
else
{
$('#virtual_product_file').remove();
$('#virtual_product_file_label').hide();
$('#file_missing').hide();
$('#delete_downloadable_product').show();
$('#virtual_product_name').attr('value', fileName);
$('#upload-confirmation').html(
'<a class="link" href="get-file-admin.php?file='+msg+'&filename='+fileName+'">{l s='The file'}&nbsp;"' + fileName + '"&nbsp;{l s='has successfully been uploaded'}</a>' +
'<input type="hidden" id="virtual_product_filename" name="virtual_product_filename" value="' + msg + '" />');
}
$('#desc-product-new').hide();
$('#desc-product-newCombination').show();
populate_attrs();
}
else if (btn_name == 'Attachments')
{
$("#addAttachment").live('click', function() {
return !$("#selectAttachment2 option:selected").remove().appendTo("#selectAttachment1");
});
$("#removeAttachment").live('click', function() {
return !$("#selectAttachment1 option:selected").remove().appendTo("#selectAttachment2");
});
$("#product").submit(function() {
$("#selectAttachment1 option").each(function(i) {
$(this).attr("selected", "selected");
});
});
}
else
$('#desc-product-newCombination').hide();
});
{if $show_product_tab_content}
$("div.productTabs a[id$=-{$show_product_tab_content}]").click();
{/if}
});
</script>
{***********************************************}
{********** TO CHECK !!!!!!!!!!!!!!! ***********}
<script type="text/javascript">
// <![CDATA[
ThickboxI18nImage = "{l s='Image'}";
ThickboxI18nOf = "{l s='of'}";
ThickboxI18nClose = "{l s='Close'}";
ThickboxI18nOrEscKey = "{l s='(or "Esc")'}";
ThickboxI18nNext = "{l s='Next >'}";
ThickboxI18nPrev = "{l s='< Previous'}";
tb_pathToImage = "../img/loadingAnimation.gif";
//]]>
</script>
<script type="text/javascript">
//<![CDATA[
function toggleVirtualProduct(elt)
{
$("#is_virtual_file_product").hide();
$("#virtual_good_attributes").hide();
if (elt.checked)
{
$('#virtual_good').show('slow');
$('#virtual_good_more').show('slow');
getE('out_of_stock_1').checked = 'checked';
getE('out_of_stock_2').disabled = 'disabled';
getE('out_of_stock_3').disabled = 'disabled';
getE('label_out_of_stock_2').setAttribute('for', '');
getE('label_out_of_stock_3').setAttribute('for', '');
}
);
}
function uploadFile2()
{
var link = '';
else
{
$('#virtual_good').hide('slow');
$('#virtual_good_more').hide('slow');
getE('out_of_stock_2').disabled = false;
getE('out_of_stock_3').disabled = false;
getE('label_out_of_stock_2').setAttribute('for', 'out_of_stock_2');
getE('label_out_of_stock_3').setAttribute('for', 'out_of_stock_3');
}
}
function uploadFile()
{
$.ajaxFileUpload (
{
url:'./uploadProductFileAttribute.php',
secureuri:false,
fileElementId:'virtual_product_file_attribute',
dataType: 'xml',
success: function (data, status)
{
data = data.getElementsByTagName('return')[0];
var result = data.getAttribute("result");
var msg = data.getAttribute("msg");
var fileName = data.getAttribute("filename");
if(result == "error")
$("#upload-confirmation2").html('<p>error: ' + msg + '</p>');
else
url:'./uploadProductFile.php',
secureuri:false,
fileElementId:'virtual_product_file',
dataType: 'xml',
success: function (data, status)
{
$('#virtual_product_file_attribute').remove();
$('#virtual_product_file_label').hide();
$('#file_missing').hide();
$('#delete_downloadable_product_attribute').show();
$('#upload-confirmation2').html(
'<a class="link" href="get-file-admin.php?file='+msg+'&filename='+fileName+'">{l s='The file'}&nbsp;"' + fileName + '"&nbsp;{l s='has successfully been uploaded'}</a>' +
'<input type="hidden" id="virtual_product_filename_attribute" name="virtual_product_filename_attribute" value="' + msg + '" />');
$('#virtual_product_name_attribute').attr('value', fileName);
link = $("#delete_downloadable_product_attribute").attr('href');
$("#delete_downloadable_product_attribute").attr('href', link+"&file="+msg);
data = data.getElementsByTagName('return')[0];
var result = data.getAttribute("result");
var msg = data.getAttribute("msg");
var fileName = data.getAttribute("filename")
if(result == "error")
$("#upload-confirmation").html('<p>error: ' + msg + '</p>');
else
{
$('#virtual_product_file').remove();
$('#virtual_product_file_label').hide();
$('#file_missing').hide();
$('#delete_downloadable_product').show();
$('#virtual_product_name').attr('value', fileName);
$('#upload-confirmation').html(
'<a class="link" href="get-file-admin.php?file='+msg+'&filename='+fileName+'">{l s='The file'}&nbsp;"' + fileName + '"&nbsp;{l s='has successfully been uploaded'}</a>' +
'<input type="hidden" id="virtual_product_filename" name="virtual_product_filename" value="' + msg + '" />');
}
}
}
}
);
}
//]]>
</script>
<form id="product_form" action="{$form_action}" method="post" enctype="multipart/form-data" name="product">
<input type="hidden" name="id_product" value="{$id_product}" />
<input type="hidden" name="tabs" id="tabs" value="0" />
<div class="tab-pane" id="tabPane1">
{if !$product->active}
<div class="warn draft" >
<p>
<span style="float: left">
{l s='Your product will be saved as draft'}</span>
<span style="float:right"><a href="#" class="button" style="display: block" onclick="submitAddProductAndPreview()" >{l s='Save and preview'}</a></span>
<input type="hidden" name="fakeSubmitAddProductAndPreview" id="fakeSubmitAddProductAndPreview" />
<br />
</p>
</div>
{/if}
{* all input are here *}
<div id="product-tab-content-wait" style="display:none" >{l s='loading ...'}</div>
{if !$newproduct}
{foreach $product_tabs key=numStep item=tab}
<div id="product-tab-content-{$tab.id}" class="{if !$tab.selected}not-loaded{/if} product-tab-content" {if !$tab.selected}style="display:none"{/if}>
{if $tab.selected}{$custom_form}{/if}
);
}
function uploadFile2()
{
var link = '';
$.ajaxFileUpload (
{
url:'./uploadProductFileAttribute.php',
secureuri:false,
fileElementId:'virtual_product_file_attribute',
dataType: 'xml',
success: function (data, status)
{
data = data.getElementsByTagName('return')[0];
var result = data.getAttribute("result");
var msg = data.getAttribute("msg");
var fileName = data.getAttribute("filename");
if(result == "error")
$("#upload-confirmation2").html('<p>error: ' + msg + '</p>');
else
{
$('#virtual_product_file_attribute').remove();
$('#virtual_product_file_label').hide();
$('#file_missing').hide();
$('#delete_downloadable_product_attribute').show();
$('#upload-confirmation2').html(
'<a class="link" href="get-file-admin.php?file='+msg+'&filename='+fileName+'">{l s='The file'}&nbsp;"' + fileName + '"&nbsp;{l s='has successfully been uploaded'}</a>' +
'<input type="hidden" id="virtual_product_filename_attribute" name="virtual_product_filename_attribute" value="' + msg + '" />');
$('#virtual_product_name_attribute').attr('value', fileName);
link = $("#delete_downloadable_product_attribute").attr('href');
$("#delete_downloadable_product_attribute").attr('href', link+"&file="+msg);
}
}
}
);
}
//]]>
</script>
<form id="product_form" action="{$form_action}" method="post" enctype="multipart/form-data" name="product">
<input type="hidden" name="id_product" value="{$id_product}" />
<input type="hidden" name="tabs" id="tabs" value="0" />
<div class="tab-pane" id="tabPane1">
{if !$product->active}
<div class="warn draft" >
<p>
<span style="float: left">
{l s='Your product will be saved as draft'}</span>
<span style="float:right"><a href="#" class="button" style="display: block" onclick="submitAddProductAndPreview()" >{l s='Save and preview'}</a></span>
<input type="hidden" name="fakeSubmitAddProductAndPreview" id="fakeSubmitAddProductAndPreview" />
<br />
</p>
</div>
{/if}
{* all input are here *}
<div id="product-tab-content-wait" style="display:none" >{l s='loading ...'}</div>
{foreach $product_tabs key=numStep item=tab}
<div id="product-tab-content-{$tab.id}" class="{if !$tab.selected}not-loaded{/if} product-tab-content" {if !$tab.selected}style="display:none"{/if}>
{if $tab.selected}{$custom_form}{/if}
</div>
{/foreach}
</div>
{/foreach}
{else}
<div id="product-tab-content-1" class="product-tab-content">{$custom_form}</div>
{/if}
</div>
<input type="hidden" name="id_product_attribute" id="id_product_attribute" value="0" />
<input id="product_form_submit_btn" type="submit" value="{l s='Save'}" name="submitAddproduct" class="button" />
</form>
</div>
<br/>
<input type="hidden" name="id_product_attribute" id="id_product_attribute" value="0" />
<input id="product_form_submit_btn" type="submit" value="{l s='Save'}" name="submitAddproduct" class="button" />
</form>
<br/>
{/block}
{*a href="{$link->getAdminLink('AdminCatalog')}"><img src="../img/admin/arrow2.gif" />{l s='Back to list'}</a><br/>
*}
+262 -233
View File
@@ -1,7 +1,34 @@
<div class="tab-page" id="step2">
{*
* 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$
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
* International Registered Trademark & Property of PrestaShop SA
*}
{if isset($id_product) && isset($product)}
<h4 class="tab" >2. {l s='Images'} (<span id="countImage">{$countImages}</span>)</h4>
<h4>{if isset($id_image)}{l s='Edit this product image'}{else}{l s='Add a new image to this product'}{/if}</h4> <div class="separation"></div><br />
<table cellpadding="5" style="width:100%">
<table cellpadding="5" style="width:100%">
<tr>
<td class="col-left"><label>{l s='File:'}</label></td>
<td style="padding-bottom:5px;">
@@ -46,253 +73,255 @@
</td>
</tr>
</table>
</div>
<table id="lineType" style="display:none;">
<tr id="image_id">
<td style="padding: 4px;">
<a href="image_path.jpg" target="_blank">
<img src="{$smarty.const._THEME_PROD_DIR_}en-default-small.jpg" alt="image_id" title="image_id" />
</a>
</td>
<td id="td_image_id" class="pointer dragHandle center positionImage">
image_position
</td>
{if $shops}
{foreach from=$shops item=shop}
<td class="center">
<input type="checkbox" class="image_shop" name="id_image" id="{$shop.id_shop}image_id" value="{$shop.id_shop}" />
</td>
{/foreach}
{/if}
<td class="center cover"><a href="#">
<img class="covered" src="../img/admin/blank.gif" alt="e" /></a>
</td>
<td class="center">
<a href="#" class="delete_product_image" >
<img src="../img/admin/delete.gif" alt="{l s='Delete this image'}" title="{l s='Delete this image'}" />
</a>
</td>
</tr>
</table>
<script type="text/javascript">
var upbutton = '{l s='Upload a file'}';
var token = '{$token}';
var come_from = '{$table}';
var id_tmp = 0;
{literal}
//Ready Function
$(document).ready(function(){
{/literal}
{foreach from=$images item=image}
assoc = {literal}"{"{/literal};
<table id="lineType" style="display:none;">
<tr id="image_id">
<td style="padding: 4px;">
<a href="image_path.jpg" target="_blank">
<img src="{$smarty.const._THEME_PROD_DIR_}en-default-small.jpg" alt="image_id" title="image_id" />
</a>
</td>
<td id="td_image_id" class="pointer dragHandle center positionImage">
image_position
</td>
{if $shops}
{foreach from=$shops item=shop}
assoc += '"{$shop.id_shop}" : {if $image->isAssociatedToShop($shop.id_shop)}1{else}0{/if},';
<td class="center">
<input type="checkbox" class="image_shop" name="id_image" id="{$shop.id_shop}image_id" value="{$shop.id_shop}" />
</td>
{/foreach}
{/if}
if (assoc != {literal}"{"{/literal})
{
assoc = assoc.slice(0, -1);
assoc += {literal}"}"{/literal};
}
else
assoc = false;
imageLine({$image->id}, "{$image->getExistingImgPath()}", {$image->position}, "{if $image->cover}enabled{else}forbbiden{/if}", assoc);
{/foreach}
<td class="center cover"><a href="#">
<img class="covered" src="../img/admin/blank.gif" alt="e" /></a>
</td>
<td class="center">
<a href="#" class="delete_product_image" >
<img src="../img/admin/delete.gif" alt="{l s='Delete this image'}" title="{l s='Delete this image'}" />
</a>
</td>
</tr>
</table>
<script type="text/javascript">
var upbutton = '{l s='Upload a file'}';
var token = '{$token}';
var come_from = '{$table}';
var id_tmp = 0;
{literal}
$("#imageTable").tableDnD(
{
onDrop: function(table, row) {
current = $(row).attr("id");
stop = false;
image_up = "{";
$("#imageList").find("tr").each(function(i) {
$("#td_" + $(this).attr("id")).html(i + 1);
if ($(this).attr("id") == current)
{
image_up += '"' + $(this).attr("id") + '" : ' + (i + 1) + ',';
stop = true;
//Ready Function
$(document).ready(function(){
{/literal}
{foreach from=$images item=image}
assoc = {literal}"{"{/literal};
{if $shops}
{foreach from=$shops item=shop}
assoc += '"{$shop.id_shop}" : {if $image->isAssociatedToShop($shop.id_shop)}1{else}0{/if},';
{/foreach}
{/if}
if (assoc != {literal}"{"{/literal})
{
assoc = assoc.slice(0, -1);
assoc += {literal}"}"{/literal};
}
else
assoc = false;
imageLine({$image->id}, "{$image->getExistingImgPath()}", {$image->position}, "{if $image->cover}enabled{else}forbbiden{/if}", assoc);
{/foreach}
{literal}
$("#imageTable").tableDnD(
{
onDrop: function(table, row) {
current = $(row).attr("id");
stop = false;
image_up = "{";
$("#imageList").find("tr").each(function(i) {
$("#td_" + $(this).attr("id")).html(i + 1);
if ($(this).attr("id") == current)
{
image_up += '"' + $(this).attr("id") + '" : ' + (i + 1) + ',';
stop = true;
}
if (!stop || (i + 1) == 2)
image_up += '"' + $(this).attr("id") + '" : ' + (i + 1) + ',';
});
image_up = image_up.slice(0, -1);
image_up += "}";
updateImagePositon(image_up);
}
if (!stop || (i + 1) == 2)
image_up += '"' + $(this).attr("id") + '" : ' + (i + 1) + ',';
});
image_up = image_up.slice(0, -1);
image_up += "}";
updateImagePositon(image_up);
}
});
var filecheck = 1;
var uploader = new qq.FileUploader(
{
element: document.getElementById("file-uploader"),
action: "ajax-tab.php",
debug: false,
params: {
id_product : {/literal}{$id_product}{literal},
id_category : {/literal}{$id_category_default}{literal},
token : "{/literal}{$token}{literal}",
tab : "AdminProducts",
action : 'addImage',
ajax: 1,
},
onComplete: function(id, fileName, responseJSON)
var filecheck = 1;
var uploader = new qq.FileUploader(
{
var percent = ((filecheck * 100) / nbfile);
$("#progressBarImage").progressbar({value: percent});
if (percent != 100)
element: document.getElementById("file-uploader"),
action: "ajax-tab.php",
debug: false,
params: {
id_product : {/literal}{$id_product}{literal},
id_category : {/literal}{$id_category_default}{literal},
token : "{/literal}{$token}{literal}",
tab : "AdminProducts",
action : 'addImage',
ajax: 1,
},
onComplete: function(id, fileName, responseJSON)
{
$("#imageUpload").html(parseInt(filecheck));
$("#imageTotal").html(" / " + parseInt(nbfile) + " {/literal}{l s='Images'}{literal}");
$("#progressBarImage").show();
$("#showCounter").show();
}
else
var percent = ((filecheck * 100) / nbfile);
$("#progressBarImage").progressbar({value: percent});
if (percent != 100)
{
$("#imageUpload").html(parseInt(filecheck));
$("#imageTotal").html(" / " + parseInt(nbfile) + " {/literal}{l s='Images'}{literal}");
$("#progressBarImage").show();
$("#showCounter").show();
}
else
{
$("#progressBarImage").progressbar({value: 0});
$("#progressBarImage").hide();
$("#showCounter").hide();
nbfile = 0;
filecheck = 0;
}
if (responseJSON.status == 'ok')
{
cover = "forbbiden";
if (responseJSON.cover == "1")
cover = "enabled";
imageLine(responseJSON.id, responseJSON.path, responseJSON.position, cover, false)
$("#imageTable tr:last").after(responseJSON.html);
$("#countImage").html(parseInt($("#countImage").html()) + 1);
$("#img" + id).remove();
$("#imageTable").tableDnDUpdate();
}
else
{
$("#img" + id).addClass("red");
$("#img" + id + " .errorImg").html(responseJSON.error);
$("#img" + id + " .errorImg").show();
}
filecheck++;
},
onSubmit: function(id, filename)
{
$("#progressBarImage").progressbar({value: 0});
$("#progressBarImage").hide();
$("#showCounter").hide();
nbfile = 0;
filecheck = 0;
$("#imageTable").show();
$("#listImage").append("<li id='img"+id+"'><div class=\"float\" >" + filename + "</div></div><a style=\"margin-left:10px\"href=\"javascript:delQueue(" + id +");\"><img src=\"../img/admin/disabled.gif\" alt=\"\" border=\"0\"></a><p class=\"errorImg\"></p></li>");
}
if (responseJSON.status == 'ok')
{
cover = "forbbiden";
if (responseJSON.cover == "1")
cover = "enabled";
imageLine(responseJSON.id, responseJSON.path, responseJSON.position, cover, false)
$("#imageTable tr:last").after(responseJSON.html);
$("#countImage").html(parseInt($("#countImage").html()) + 1);
$("#img" + id).remove();
$("#imageTable").tableDnDUpdate();
}
else
{
$("#img" + id).addClass("red");
$("#img" + id + " .errorImg").html(responseJSON.error);
$("#img" + id + " .errorImg").show();
}
filecheck++;
},
onSubmit: function(id, filename)
});
$('.delete_product_image').die().live('click', function(e)
{
$("#imageTable").show();
$("#listImage").append("<li id='img"+id+"'><div class=\"float\" >" + filename + "</div></div><a style=\"margin-left:10px\"href=\"javascript:delQueue(" + id +");\"><img src=\"../img/admin/disabled.gif\" alt=\"\" border=\"0\"></a><p class=\"errorImg\"></p></li>");
}
});
$('.delete_product_image').die().live('click', function(e)
{
e.preventDefault();
id = $(this).parent().parent().attr('id');
if (confirm("{/literal}{l s='Are you sure?'}{literal}"))
$.ajax(
e.preventDefault();
id = $(this).parent().parent().attr('id');
if (confirm("{/literal}{l s='Are you sure?'}{literal}"))
$.ajax(
{
url : "ajax-tab.php",
data : {"action":"deleteProductImage",
"id_image":id,
"id_product" : {/literal}{$id_product}{literal},
"id_category" : {/literal}{$id_category_default}{literal},
"token" : "{/literal}{$token}{literal}",
"tab" : "AdminProducts",
"ajax" : 1 },
success : function (data)
{
data = jQuery.parseJSON(data);
if (data)
{
cover = 0;
if(data.status == 'ok')
{
if ($("#" + id).find(".covered").attr("src") == "../img/admin/enabled.gif")
cover = 1;
$("#" + id).remove();
}
if (cover)
$("#imageTable tr").eq(1).find(".covered").attr("src", "../img/admin/enabled.gif");
$("#countImage").html(parseInt($("#countImage").html()) - 1);
refreshImagePositions($("#imageTable"));
}
}
});
});
$('.covered').die().live('click', function(e)
{
url : "ajax-tab.php",
data : {"action":"deleteProductImage",
e.preventDefault();
id = $(this).parent().parent().parent().attr('id');
$("#imageList .cover img").each( function(i){
$(this).attr("src", $(this).attr("src").replace("enabled", "forbbiden"));
});
$(this).attr("src", $(this).attr("src").replace("forbbiden", "enabled"));
doAdminAjax({
"action":"UpdateCover",
"id_image":id,
"id_product" : {/literal}{$id_product}{literal},
"id_category" : {/literal}{$id_category_default}{literal},
"token" : "{/literal}{$token}{literal}",
"controller" : "AdminProducts",
"ajax" : 1 }
);
});
$('.image_shop').die().live('click', function()
{
active = false;
if ($(this).attr("checked"))
active = true;
id = $(this).parent().parent().attr('id');
id_shop = $(this).attr("id").replace(id, "");
doAdminAjax(
{
"action":"UpdateProductImageShopAsso",
"id_image":id,
"id_shop": id_shop,
"active":active,
"token" : "{/literal}{$token}{literal}",
"tab" : "AdminProducts",
"ajax" : 1 },
success : function (data)
{
data = jQuery.parseJSON(data);
if (data)
{
cover = 0;
if(data.status == 'ok')
{
if ($("#" + id).find(".covered").attr("src") == "../img/admin/enabled.gif")
cover = 1;
$("#" + id).remove();
}
if (cover)
$("#imageTable tr").eq(1).find(".covered").attr("src", "../img/admin/enabled.gif");
$("#countImage").html(parseInt($("#countImage").html()) - 1);
refreshImagePositions($("#imageTable"));
}
}
});
});
$('.covered').die().live('click', function(e)
{
e.preventDefault();
id = $(this).parent().parent().parent().attr('id');
$("#imageList .cover img").each( function(i){
$(this).attr("src", $(this).attr("src").replace("enabled", "forbbiden"));
});
$(this).attr("src", $(this).attr("src").replace("forbbiden", "enabled"));
doAdminAjax({
"action":"UpdateCover",
"id_image":id,
"id_product" : {/literal}{$id_product}{literal},
"token" : "{/literal}{$token}{literal}",
"controller" : "AdminProducts",
"ajax" : 1 }
);
});
$('.image_shop').die().live('click', function()
{
active = false;
if ($(this).attr("checked"))
active = true;
id = $(this).parent().parent().attr('id');
id_shop = $(this).attr("id").replace(id, "");
doAdminAjax(
{
"action":"UpdateProductImageShopAsso",
"id_image":id,
"id_shop": id_shop,
"active":active,
"token" : "{/literal}{$token}{literal}",
"tab" : "AdminProducts",
"ajax" : 1
});
});
//function
function updateImagePositon(json)
{
doAdminAjax(
{
"action":"updateImagePosition",
"json":json,
"token" : "{/literal}{$token}{literal}",
"tab" : "AdminProducts",
"ajax" : 1
});
}
function delQueue(id)
{
$("#img" + id).fadeOut("slow");
$("#img" + id).remove();
}
function imageLine(id, path, position, cover, shops)
{
line = $("#lineType").html();
line = line.replace(/image_id/g, id);
line = line.replace(/en-default/g, path);
line = line.replace(/image_position/g, position);
line = line.replace(/blank/g, cover);
line = line.replace("<tbody>", "");
line = line.replace("</tbody>", "");
if (shops != false)
{
tmp = jQuery.parseJSON(shops);
$.each(tmp, function(key, value){
if (value == 1)
line = line.replace('id="' + key + '' + id + '"','id="' + key + '' + id + '" checked=checked');
"ajax" : 1
});
});
//function
function updateImagePositon(json)
{
doAdminAjax(
{
"action":"updateImagePosition",
"json":json,
"token" : "{/literal}{$token}{literal}",
"tab" : "AdminProducts",
"ajax" : 1
});
}
$("#imageList").append(line);
}
});
{/literal}
</script>
function delQueue(id)
{
$("#img" + id).fadeOut("slow");
$("#img" + id).remove();
}
function imageLine(id, path, position, cover, shops)
{
line = $("#lineType").html();
line = line.replace(/image_id/g, id);
line = line.replace(/en-default/g, path);
line = line.replace(/image_position/g, position);
line = line.replace(/blank/g, cover);
line = line.replace("<tbody>", "");
line = line.replace("</tbody>", "");
if (shops != false)
{
tmp = jQuery.parseJSON(shops);
$.each(tmp, function(key, value){
if (value == 1)
line = line.replace('id="' + key + '' + id + '"','id="' + key + '' + id + '" checked=checked');
});
}
$("#imageList").append(line);
}
});
{/literal}
</script>
{/if}
@@ -1,3 +1,29 @@
{*
* 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$
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
* International Registered Trademark & Property of PrestaShop SA
*}
<div id="step1">
<h4 class="tab">1. {l s='Info.'}</h4>
<h4>{l s='Product global information'}</h4>
@@ -1,3 +1,29 @@
{*
* 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$
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
* International Registered Trademark & Property of PrestaShop SA
*}
<div class="translatable">
{foreach from=$languages item=language}
<div class="lang_{$language.id_lang}" style="{if !$language.is_default}display:none;{/if}float: left;">
+244 -206
View File
@@ -1,66 +1,85 @@
<script type="text/javascript" src="{$smarty.const._PS_JS_DIR_}price.js"></script>
{*
* 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$
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
* International Registered Trademark & Property of PrestaShop SA
*}
<div class="block_specific_prices_modifications">
<h4>{l s='Product price'}</h4>
<div class="separation"></div>
<script type="text/javascript">
var product_prices = new Array();
{foreach from=$combinations item='combination'}
product_prices['{$combination.id_product_attribute}'] = '{$combination.price}';
{/foreach}
</script>
<table>
<tr>
<td class="col-left"><label>{l s='Pre-tax wholesale price:'}</label></td>
<td style="padding-bottom:5px;">
{$currency->prefix}<input size="11" maxlength="14" name="wholesale_price" type="text" value="{$product->wholesale_price}" onchange="this.value = this.value.replace(/,/g, '.');" />{$currency->suffix}
<p class="preference_description">{l s='The wholesale price at which you bought this product'}</p>
</td>
</tr>
<tr>
<td class="col-left"><label>{l s='Pre-tax retail price:'}</label></td>
<td style="padding-bottom:5px;">
{$currency->prefix}<input size="11" maxlength="14" id="priceTE" name="price" type="text" value="{$product->price}" onchange="this.value = this.value.replace(/,/g, '.');" onkeyup="if (isArrowKey(event)) return; calcPriceTI();" />{$currency->suffix}<sup> *</sup>
<p class="preference_description">{l s='The pre-tax retail price to sell this product'}</p>
</td>
</tr>
<tr>
<td class="col-left"><label>{l s='Tax rule:' }</label></td>
<td style="padding-bottom:5px;">
<script type="text/javascript">
noTax = {if $tax_exclude_taxe_option}true{else}false{/if};
taxesArray = new Array ();
taxesArray[0] = 0;
{foreach $tax_rules_groups as $tax_rules_group}
{if isset($taxesRatesByGroup[$tax_rules_group['id_tax_rules_group']])}
taxesArray[{$tax_rules_group.id_tax_rules_group}] = {$taxesRatesByGroup[$tax_rules_group['id_tax_rules_group']]};
{else}
taxesArray[{$tax_rules_group.id_tax_rules_group}] = 0;
<h4>{l s='Product price'}</h4>
<div class="separation"></div>
<table>
<tr>
<td class="col-left"><label>{l s='Pre-tax wholesale price:'}</label></td>
<td style="padding-bottom:5px;">
{$currency->prefix}<input size="11" maxlength="14" name="wholesale_price" type="text" value="{$product->wholesale_price}" onchange="this.value = this.value.replace(/,/g, '.');" />{$currency->suffix}
<p class="preference_description">{l s='The wholesale price at which you bought this product'}</p>
</td>
</tr>
<tr>
<td class="col-left"><label>{l s='Pre-tax retail price:'}</label></td>
<td style="padding-bottom:5px;">
{$currency->prefix}<input size="11" maxlength="14" id="priceTE" name="price" type="text" value="{$product->price}" onchange="this.value = this.value.replace(/,/g, '.');" onkeyup="if (isArrowKey(event)) return; calcPriceTI();" />{$currency->suffix}<sup> *</sup>
<p class="preference_description">{l s='The pre-tax retail price to sell this product'}</p>
</td>
</tr>
<tr>
<td class="col-left"><label>{l s='Tax rule:' }</label></td>
<td style="padding-bottom:5px;">
<script type="text/javascript">
noTax = {if $tax_exclude_taxe_option}true{else}false{/if};
taxesArray = new Array ();
taxesArray[0] = 0;
{foreach $tax_rules_groups as $tax_rules_group}
{if isset($taxesRatesByGroup[$tax_rules_group['id_tax_rules_group']])}
taxesArray[{$tax_rules_group.id_tax_rules_group}] = {$taxesRatesByGroup[$tax_rules_group['id_tax_rules_group']]};
{else}
taxesArray[{$tax_rules_group.id_tax_rules_group}] = 0;
{/if}
{/foreach}
ecotaxTaxRate = {$ecotaxTaxRate / 100};
</script>
<span {if $tax_exclude_taxe_option}style="display:none;"{/if} >
<select onChange="javascript:calcPriceTI(); unitPriceWithTax('unit');" name="id_tax_rules_group" id="id_tax_rules_group" {if $tax_exclude_taxe_option}disabled="disabled"{/if} >
<option value="0">{l s='No Tax'}</option>
{foreach from=$tax_rules_groups item=tax_rules_group}
<option value="{$tax_rules_group.id_tax_rules_group}" {if $product->id_tax_rules_group == $tax_rules_group.id_tax_rules_group}selected="selected"{/if} >
{$tax_rules_group['name']|htmlentitiesUTF8}
</option>
{/foreach}
</select>
<a href="{$link->getAdminLink('AdminTaxRulesGroup')}&addtax_rules_group&id_product={$product->id}" onclick="return confirm('{l s='Are you sure you want to delete entered product information?'}'" >
<img src="../img/admin/add.gif" alt="{l s='Create'}" title="{l s='Create'}" /> <b>{l s='Create'}</b>
</a>
</span>
{if $tax_exclude_taxe_option}
<span style="margin-left:10px; color:red;">{l s='Taxes are currently disabled'}</span> (<b><a href="{$link->getAdminLink('AdminTaxes')}">{l s='Tax options'}</a></b>)
<input type="hidden" value="{$product->id_tax_rules_group}" name="id_tax_rules_group" />
{/if}
{/foreach}
ecotaxTaxRate = {$ecotaxTaxRate / 100};
</script>
<span {if $tax_exclude_taxe_option}style="display:none;"{/if} >
<select onChange="javascript:calcPriceTI(); unitPriceWithTax('unit');" name="id_tax_rules_group" id="id_tax_rules_group" {if $tax_exclude_taxe_option}disabled="disabled"{/if} >
<option value="0">{l s='No Tax'}</option>
{foreach from=$tax_rules_groups item=tax_rules_group}
<option value="{$tax_rules_group.id_tax_rules_group}" {if $product->id_tax_rules_group == $tax_rules_group.id_tax_rules_group}selected="selected"{/if} >
{$tax_rules_group['name']|htmlentitiesUTF8}
</option>
{/foreach}
</select>
<a href="{$link->getAdminLink('AdminTaxRulesGroup')}&addtax_rules_group&id_product={$product->id}" onclick="return confirm('{l s='Are you sure you want to delete entered product information?'}'" >
<img src="../img/admin/add.gif" alt="{l s='Create'}" title="{l s='Create'}" /> <b>{l s='Create'}</b>
</a>
</span>
{if $tax_exclude_taxe_option}
<span style="margin-left:10px; color:red;">{l s='Taxes are currently disabled'}</span> (<b><a href="{$link->getAdminLink('AdminTaxes')}">{l s='Tax options'}</a></b>)
<input type="hidden" value="{$product->id_tax_rules_group}" name="id_tax_rules_group" />
{/if}
</td>
</tr>
{if $ps_use_ecotax}
</td>
</tr>
{if $ps_use_ecotax}
<tr>
<td class="col-left"><label>{l s='Eco-tax (tax incl.):' }</label></td>
<td style="padding-bottom:5px;">
@@ -68,157 +87,174 @@ var product_prices = new Array();
<span style="margin-left:10px">({l s='already included in price'})</span>
</td>
</tr>
{/if}
<tr {if !$country_display_tax_label || $tax_exclude_taxe_option}style="display:none"{/if} >
<td class="col-left"><label>{l s='Retail price with tax:' }</label></td>
<td style="padding-bottom:5px;">
{$currency->prefix}<input size="11" maxlength="14" id="priceTI" type="text" value="" onchange="noComma('priceTI');" onkeyup="if (isArrowKey(event)) return; calcPriceTE();" />{$currency->suffix}
</td>
</tr>
<tr id="tr_unit_price">
<td class="col-left"><label>{l s='Unit price without tax:' }</label></td>
<td style="padding-bottom:5px;">
{$currency->prefix} <input size="11" maxlength="14" id="unit_price" name="unit_price" type="text" value="{$product->unit_price}"
onkeyup="if (isArrowKey(event)) return ;this.value = this.value.replace(/,/g, '.'); unitPriceWithTax('unit');"/>{$currency->suffix}
{l s='per'} <input size="6" maxlength="10" id="unity" name="unity" type="text" value="{$product->unity|htmlentitiesUTF8}" onkeyup="if (isArrowKey(event)) return ;unitySecond();" onchange="unitySecond();"/>
{if $ps_tax && $country_display_tax_label}
<span style="margin-left:15px">{l s='or'}
{$currency->prefix}<span id="unit_price_with_tax">0.00</span>{$currency->suffix}
{l s='per'} <span id="unity_second">{$product->unity}</span> {l s='with tax'}
</span>
{/if}
<p>{l s='Eg. $15 per Lb'}</p>
</td>
</tr>
<tr>
<td class="col-left"><label>&nbsp;</label></td>
<td style="padding-bottom:5px;">
<input type="checkbox" name="on_sale" id="on_sale" style="padding-top: 5px;" {if $product->on_sale}checked="checked"{/if} value="1" />&nbsp;<label for="on_sale" class="t">{l s='Display "on sale" icon on product page and text on product listing'}</label>
</td>
</tr>
<tr>
<td class="col-left"><label><b>{l s='Final retail price:'}</b></label></td>
<td style="padding-bottom:5px;">
<span {if !$country_display_tax_label}style="display:none"{/if} >
{$currency->prefix}<span id="finalPrice" style="font-weight: bold;"></span>{$currency->suffix}<span {if $ps_tax}style="display:none;"{/if}> ({l s='tax incl.'})</span>
</span>
<span {if $ps_tax}style="display:none;"{/if} >
{/if}
<tr {if !$country_display_tax_label || $tax_exclude_taxe_option}style="display:none"{/if} >
<td class="col-left"><label>{l s='Retail price with tax:' }</label></td>
<td style="padding-bottom:5px;">
{$currency->prefix}<input size="11" maxlength="14" id="priceTI" type="text" value="" onchange="noComma('priceTI');" onkeyup="if (isArrowKey(event)) return; calcPriceTE();" />{$currency->suffix}
</td>
</tr>
<tr id="tr_unit_price">
<td class="col-left"><label>{l s='Unit price without tax:' }</label></td>
<td style="padding-bottom:5px;">
{$currency->prefix} <input size="11" maxlength="14" id="unit_price" name="unit_price" type="text" value="{$product->unit_price}"
onkeyup="if (isArrowKey(event)) return ;this.value = this.value.replace(/,/g, '.'); unitPriceWithTax('unit');"/>{$currency->suffix}
{l s='per'} <input size="6" maxlength="10" id="unity" name="unity" type="text" value="{$product->unity|htmlentitiesUTF8}" onkeyup="if (isArrowKey(event)) return ;unitySecond();" onchange="unitySecond();"/>
{if $ps_tax && $country_display_tax_label}
<span style="margin-left:15px">{l s='or'}
{$currency->prefix}<span id="unit_price_with_tax">0.00</span>{$currency->suffix}
{l s='per'} <span id="unity_second">{$product->unity}</span> {l s='with tax'}
</span>
{/if}
<p>{l s='Eg. $15 per Lb'}</p>
</td>
</tr>
<tr>
<td class="col-left"><label>&nbsp;</label></td>
<td style="padding-bottom:5px;">
<input type="checkbox" name="on_sale" id="on_sale" style="padding-top: 5px;" {if $product->on_sale}checked="checked"{/if} value="1" />&nbsp;<label for="on_sale" class="t">{l s='Display "on sale" icon on product page and text on product listing'}</label>
</td>
</tr>
<tr>
<td class="col-left"><label><b>{l s='Final retail price:'}</b></label></td>
<td style="padding-bottom:5px;">
<span {if !$country_display_tax_label}style="display:none"{/if} >
{$currency->prefix}<span id="finalPrice" style="font-weight: bold;"></span>{$currency->suffix}<span {if $ps_tax}style="display:none;"{/if}> ({l s='tax incl.'})</span>
</span>
<span {if $ps_tax}style="display:none;"{/if} >
{if $country_display_tax_label}
/
{/if}
{$currency->prefix}<span id="finalPriceWithoutTax" style="font-weight: bold;"></span>{$currency->suffix} {if $country_display_tax_label}({l s='tax excl.'}){/if}</span>
</td>
</tr>
<tr>
<td class="col-left"><label>&nbsp;</label></td>
<td>
<div class="hint clear" style="display: block;width: 70%;">{l s='You can define many discounts and specific price rules in the Prices tab'}</div>
</td>
</tr>
{* [end] prices *}
</table>
<div class="separation"></div>
<h4>{l s='Current specific prices'}</h4>
<a class="button bt-icon" href="#" onclick="$('#add_specific_price').slideToggle();return false;"><img src="../img/admin/add.gif" alt="" /><span>{l s='Add a new specific price'}</span></a>
<br/>
<div id="add_specific_price" style="display: none;">
<input type="hidden" name="sp_id_shop" value="0" />
<label>{l s='For:'}</label>
<div class="margin-form">
<select name="sp_id_shop">
<option value="0">{l s='All shops'}</option>
{foreach from=$shops item=shop}
<option value="{$shop['id_shop']}">{$shop['name']|htmlentitiesUTF8}</option>
{if $country_display_tax_label}
/
{/if}
{$currency->prefix}<span id="finalPriceWithoutTax" style="font-weight: bold;"></span>{$currency->suffix} {if $country_display_tax_label}({l s='tax excl.'}){/if}</span>
</td>
</tr>
<tr>
<td class="col-left"><label>&nbsp;</label></td>
<td>
<div class="hint clear" style="display: block;width: 70%;">{l s='You can define many discounts and specific price rules in the Prices tab'}</div>
</td>
</tr>
</table>
<div class="separation"></div>
{if isset($specificPriceModificationForm)}
<h4>{l s='Current specific prices'}</h4>
<a class="button bt-icon" href="#" onclick="$('#add_specific_price').slideToggle();return false;"><img src="../img/admin/add.gif" alt="" /><span>{l s='Add a new specific price'}</span></a>
<br/>
<script type="text/javascript">
var product_prices = new Array();
{foreach from=$combinations item='combination'}
product_prices['{$combination.id_product_attribute}'] = '{$combination.price}';
{/foreach}
</select>
&gt;
<select name="sp_id_currency" id="spm_currency_0" onchange="changeCurrencySpecificPrice(0);">
<option value="0">{l s='All currencies'}</option>
{foreach from=$currencies item=curr}
<option value="{$curr['id_currency']}">{$curr['name']|htmlentitiesUTF8}</option>
{/foreach}
</select>
&gt;
<select name="sp_id_country">
<option value="0">{l s='All countries'}</option>
{foreach from=$countries item=country}
<option value="{$country['id_country']}">{$country['name']|htmlentitiesUTF8}</option>
{/foreach}
</select>
&gt;
<select name="sp_id_group">
<option value="0">{l s='All groups'}</option>
{foreach from=$groups item=group}
<option value="'.(int)($group['id_group']).'">'.{$group['name']}</option>
{/foreach}
</select>
</div>
{if $combinations|@count != 0}
<label>{l s='Combination:'}</label>
<div class="margin-form">
<select id="sp_id_product_attribute" name="sp_id_product_attribute">
<option value="0">{l s='Apply to all combinations'}</option>
{foreach from=$combinations item='combination'}
<option value="{$combination.id_product_attribute}">{$combination.attributes}</option>
</script>
<div id="add_specific_price" style="display: none;">
<input type="hidden" name="sp_id_shop" value="0" />
<label>{l s='For:'}</label>
<div class="margin-form">
<select name="sp_id_shop">
<option value="0">{l s='All shops'}</option>
{foreach from=$shops item=shop}
<option value="{$shop['id_shop']}">{$shop['name']|htmlentitiesUTF8}</option>
{/foreach}
</select>
</div>
{/if}
<label>{l s='Available from:'}</label>
<div class="margin-form">
<input class="datepicker" type="text" name="sp_from" value="" style="text-align: center" id="sp_from" /><span style="font-weight:bold; color:#000000; font-size:12px"> {l s='to'}</span>
<input class="datepicker" type="text" name="sp_to" value="" style="text-align: center" id="sp_to" />
</div>
<label>{l s='Starting at'}</label>
<div class="margin-form">
<input type="text" name="sp_from_quantity" value="1" size="3" /> <span style="font-weight:bold; color:#000000; font-size:12px">{l s='unit'}</span>
</div>
<script type="text/javascript">
$(document).ready(function(){
product_prices['0'] = $('#sp_current_ht_price').html();
$('#id_product_attribute').change(function() {
$('#sp_current_ht_price').html(product_prices[$('#id_product_attribute option:selected').val()]);
</select>
&gt;
<select name="sp_id_currency" id="spm_currency_0" onchange="changeCurrencySpecificPrice(0);">
<option value="0">{l s='All currencies'}</option>
{foreach from=$currencies item=curr}
<option value="{$curr['id_currency']}">{$curr['name']|htmlentitiesUTF8}</option>
{/foreach}
</select>
&gt;
<select name="sp_id_country">
<option value="0">{l s='All countries'}</option>
{foreach from=$countries item=country}
<option value="{$country['id_country']}">{$country['name']|htmlentitiesUTF8}</option>
{/foreach}
</select>
&gt;
<select name="sp_id_group">
<option value="0">{l s='All groups'}</option>
{foreach from=$groups item=group}
<option value="'.(int)($group['id_group']).'">'.{$group['name']}</option>
{/foreach}
</select>
</div>
{if $combinations|@count != 0}
<label>{l s='Combination:'}</label>
<div class="margin-form">
<select id="sp_id_product_attribute" name="sp_id_product_attribute">
<option value="0">{l s='Apply to all combinations'}</option>
{foreach from=$combinations item='combination'}
<option value="{$combination.id_product_attribute}">{$combination.attributes}</option>
{/foreach}
</select>
</div>
{/if}
<label>{l s='Available from:'}</label>
<div class="margin-form">
<input class="datepicker" type="text" name="sp_from" value="" style="text-align: center" id="sp_from" /><span style="font-weight:bold; color:#000000; font-size:12px"> {l s='to'}</span>
<input class="datepicker" type="text" name="sp_to" value="" style="text-align: center" id="sp_to" />
</div>
<label>{l s='Starting at'}</label>
<div class="margin-form">
<input type="text" name="sp_from_quantity" value="1" size="3" /> <span style="font-weight:bold; color:#000000; font-size:12px">{l s='unit'}</span>
</div>
<script type="text/javascript">
$(document).ready(function(){
product_prices['0'] = $('#sp_current_ht_price').html();
$('#id_product_attribute').change(function() {
$('#sp_current_ht_price').html(product_prices[$('#id_product_attribute option:selected').val()]);
});
$('.datepicker').datepicker({
prevText: '',
nextText: '',
dateFormat: 'yy-mm-dd'
});
});
$('.datepicker').datepicker({
prevText: '',
nextText: '',
dateFormat: 'yy-mm-dd'
});
});
</script>
</script>
<label>{l s='Product price'}
{if $country_display_tax_label}
{l s='(tax excl.):'}
{/if}
</label>
<div class="margin-form">
<span id="spm_currency_sign_pre_0" style="font-weight:bold; color:#000000; font-size:12px">{$currency->prefix}</span>
<input type="text" name="sp_price" value="0" size="11" />
<span id="spm_currency_sign_post_0" style="font-weight:bold; color:#000000; font-size:12px">{$currency->suffix}</span>
<span>({l s='Current:'} </span><span id="sp_current_ht_price">{displayWtPrice p=$product->price}</span> )</span>
<div class="hint" style="display:block;">
{l s='You can set this value at 0 in order to apply the default price'}
</div>
</div>
<label>{l s='Apply a discount of:'}</label>
<div class="margin-form">
<input type="text" name="sp_reduction" value="0.00" size="11" />
<select name="sp_reduction_type">
<option selected="selected">---</option>
<option value="amount">{l s='Amount'}</option>
<option value="percentage">{l s='Percentage'}</option>
</select>
{l s='(if set to "amount", the tax is included)'}
</div>
<div class="margin-form">
<input type="submit" name="submitPriceAddition" value="{l s='Add'}" class="button" />
</div>
{l s='(tax excl.):'}
{/if}
</label>
<div class="margin-form">
<span id="spm_currency_sign_pre_0" style="font-weight:bold; color:#000000; font-size:12px">
{$currency->prefix}
</span>
<input type="text" name="sp_price" value="0" size="11" />
<span id="spm_currency_sign_post_0" style="font-weight:bold; color:#000000; font-size:12px">
{$currency->suffix}
</span>
<span>
(
{l s='Current:'}
<span id="sp_current_ht_price">{displayWtPrice p=$product->price}</span>
)
</span>
<div class="hint" style="display:block;">
{l s='You can set this value at 0 in order to apply the default price'}
</div>
</div>
<label>{l s='Apply a discount of:'}</label>
<div class="margin-form">
<input type="text" name="sp_reduction" value="0.00" size="11" />
<select name="sp_reduction_type">
<option selected="selected">---</option>
<option value="amount">{l s='Amount'}</option>
<option value="percentage">{l s='Percentage'}</option>
</select>
{l s='(if set to "amount", the tax is included)'}
</div>
<div class="margin-form">
<input type="submit" name="submitPriceAddition" value="{l s='Add'}" class="button" />
</div>
</div>
<table style="text-align: center;width:100%" class="table" cellpadding="0" cellspacing="0">
<thead>
<tr>
@@ -241,4 +277,6 @@ var product_prices = new Array();
<script type="text/javascript">
calcPriceTI();
unitPriceWithTax('unit');
</script>
</script>
{/if}
+135 -105
View File
@@ -1,4 +1,32 @@
<h4>{l s='Available quantities for sale'}</h4>
{*
* 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: 11069 $
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
* International Registered Trademark & Property of PrestaShop SA
*}
{if isset($product->id)}
<h4>{l s='Available quantities for sale'}</h4>
<div class="separation"></div>
<div class="hint" style="display:block; position:'auto';">
<p>{l s='This interface allows you to manage the available quantities for sale of the current product and its combinations on the current shop.'}</p>
@@ -100,118 +128,120 @@
</div>
{/if}
<script type="text/javascript">
var showAjaxError = function(msg)
{
$('#available_quantity_ajax_error_msg').html(msg);
$('#available_quantity_ajax_error_msg').show();
$('#available_quantity_ajax_msg').hide();
$('#available_quantity_ajax_success_msg').hide();
};
var showAjaxSuccess = function(msg)
{
$('#available_quantity_ajax_success_msg').html(msg);
$('#available_quantity_ajax_error_msg').hide();
$('#available_quantity_ajax_msg').hide();
$('#available_quantity_ajax_success_msg').show();
};
var showAjaxMsg = function(msg)
{
$('#available_quantity_ajax_msg').html(msg);
$('#available_quantity_ajax_error_msg').hide();
$('#available_quantity_ajax_msg').show();
$('#available_quantity_ajax_success_msg').hide();
};
var ajaxCall = function(data)
{
data.ajaxProductQuantity = 1;
data.id_product = '{$product->id}';
data.token = "{$token}";
data.ajax = 1;
data.controller = "AdminProducts";
data.action = "productQuantity";
showAjaxMsg('{l s='Saving data...'}');
$.ajax({
type: "POST",
url: "ajax-tab.php",
data: data,
dataType: 'json',
async : true,
success: function(msg)
{
if (msg.error)
<script type="text/javascript">
var showAjaxError = function(msg)
{
$('#available_quantity_ajax_error_msg').html(msg);
$('#available_quantity_ajax_error_msg').show();
$('#available_quantity_ajax_msg').hide();
$('#available_quantity_ajax_success_msg').hide();
};
var showAjaxSuccess = function(msg)
{
$('#available_quantity_ajax_success_msg').html(msg);
$('#available_quantity_ajax_error_msg').hide();
$('#available_quantity_ajax_msg').hide();
$('#available_quantity_ajax_success_msg').show();
};
var showAjaxMsg = function(msg)
{
$('#available_quantity_ajax_msg').html(msg);
$('#available_quantity_ajax_error_msg').hide();
$('#available_quantity_ajax_msg').show();
$('#available_quantity_ajax_success_msg').hide();
};
var ajaxCall = function(data)
{
data.ajaxProductQuantity = 1;
data.id_product = '{$product->id}';
data.token = "{$token}";
data.ajax = 1;
data.controller = "AdminProducts";
data.action = "productQuantity";
showAjaxMsg('{l s='Saving data...'}');
$.ajax({
type: "POST",
url: "ajax-tab.php",
data: data,
dataType: 'json',
async : true,
success: function(msg)
{
if (msg.error)
{
showAjaxError('{l s='Error durring saving data'}');
return;
}
showAjaxSuccess('{l s='Data saved'}');
},
error: function(msg)
{
showAjaxError('{l s='Error durring saving data'}');
return;
}
showAjaxSuccess('{l s='Data saved'}');
},
error: function(msg)
});
};
var refreshQtyAvaibilityForm = function()
{
if ($('#depends_on_stock_0').attr('checked'))
{
showAjaxError('{l s='Error durring saving data'}');
$('.available_quantity').find('input').show();
$('.available_quantity').find('span').hide();
}
else
{
$('.available_quantity').find('input').hide();
$('.available_quantity').find('span').show();
}
};
$('.depends_on_stock').click(function(e)
{
refreshQtyAvaibilityForm();
ajaxCall( { actionQty: 'depends_on_stock', value: $(this).val() } );
if($(this).val() == 0)
$('.available_quantity input').trigger('change');
});
// bind enter key event on search field
$('.available_quantity').find('input').bind('keypress', function(e) {
var code = (e.keyCode ? e.keyCode : e.which);
if(code == 13) { //Enter keycode
e.stopPropagation();//Stop event propagation
return false;
}
});
};
var refreshQtyAvaibilityForm = function()
{
if ($('#depends_on_stock_0').attr('checked'))
$('.available_quantity').find('input').blur(function(e)
{
$('.available_quantity').find('input').show();
$('.available_quantity').find('span').hide();
}
else
ajaxCall( { actionQty: 'set_qty', id_product_attribute: $(this).parent().attr('id').split('_')[1], value: $(this).val() } );
});
$('.available_quantity').find('input').click(function(e)
{
$('.available_quantity').find('input').hide();
$('.available_quantity').find('span').show();
}
};
$('.depends_on_stock').click(function(e)
{
refreshQtyAvaibilityForm();
ajaxCall( { actionQty: 'depends_on_stock', value: $(this).val() } );
if($(this).val() == 0)
$('.available_quantity input').trigger('change');
});
// bind enter key event on search field
$('.available_quantity').find('input').bind('keypress', function(e) {
var code = (e.keyCode ? e.keyCode : e.which);
if(code == 13) { //Enter keycode
e.stopPropagation();//Stop event propagation
return false;
}
});
$('.available_quantity').find('input').blur(function(e)
{
ajaxCall( { actionQty: 'set_qty', id_product_attribute: $(this).parent().attr('id').split('_')[1], value: $(this).val() } );
});
$('.available_quantity').find('input').click(function(e)
{
if(typeof(this.intervalId) != 'undefined')
window.clearInterval(this.intervalId);
this.intervalId = window.setInterval(function(it, initialValue)
{
if(initialValue != $(it).val())
if(typeof(this.intervalId) != 'undefined')
window.clearInterval(this.intervalId);
this.intervalId = window.setInterval(function(it, initialValue)
{
window.clearInterval(it.intervalId);
$(it).trigger('change');
$(it).trigger('click');
}
}, 500, this, $(this).val())
});
$('.out_of_stock').click(function(e)
{
if(initialValue != $(it).val())
{
window.clearInterval(it.intervalId);
$(it).trigger('change');
$(it).trigger('click');
}
}, 500, this, $(this).val())
});
$('.out_of_stock').click(function(e)
{
refreshQtyAvaibilityForm();
ajaxCall( { actionQty: 'out_of_stock', value: $(this).val() } );
});
refreshQtyAvaibilityForm();
ajaxCall( { actionQty: 'out_of_stock', value: $(this).val() } );
});
</script>
refreshQtyAvaibilityForm();
</script>
{/if}
+178 -148
View File
@@ -1,165 +1,195 @@
<h4>{l s='Suppliers of the current product'}</h4>
<div class="separation"></div>
<div class="hint" style="display:block; position:'auto';">
<p>{l s='This interface allows you to specify the suppliers of the current product and eventually its combinations.'}</p>
<p>{l s='It is also possible to specify for each product/product combinations the supplier reference according to previously associated suppliers.'}</p>
</div>
<p>{l s='Please choose the suppliers associated to this product, and the default one.'}</p>
{assign var=confirm value="Are you sure you want to delete entered product information?"}
<a class="button bt-icon" href="{$link->getAdminLink('AdminSuppliers')}&addsupplier" onclick="return confirm(' {$confirm} ')">
<img src="../img/admin/add.gif" alt="{l s='Create new supplier'}" title="{l s='Create new supplier'}" /><span>{l s='Create new supplier'}</span>
</a>
<table cellpadding="5" style="width:100%">
<tbody>
<tr>
<td valign="top" style="text-align:left;vertical-align:top;">
<table class="table" cellpadding="0" cellspacing="0" style="width:50%;">
{*
* 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: 11069 $
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
* International Registered Trademark & Property of PrestaShop SA
*}
{if isset($product->id)}
<h4>{l s='Suppliers of the current product'}</h4>
<div class="separation"></div>
<div class="hint" style="display:block; position:'auto';">
<p>{l s='This interface allows you to specify the suppliers of the current product and eventually its combinations.'}</p>
<p>{l s='It is also possible to specify for each product/product combinations the supplier reference according to previously associated suppliers.'}</p>
</div>
<p>{l s='Please choose the suppliers associated to this product, and the default one.'}</p>
{assign var=confirm value="Are you sure you want to delete entered product information?"}
<a class="button bt-icon" href="{$link->getAdminLink('AdminSuppliers')}&addsupplier" onclick="return confirm(' {$confirm} ')">
<img src="../img/admin/add.gif" alt="{l s='Create new supplier'}" title="{l s='Create new supplier'}" /><span>{l s='Create new supplier'}</span>
</a>
<table cellpadding="5" style="width:100%">
<tbody>
<tr>
<td valign="top" style="text-align:left;vertical-align:top;">
<table class="table" cellpadding="0" cellspacing="0" style="width:50%;">
<thead>
<tr>
<th>{l s='Selected'}</th>
<th>{l s='Supplier Name'}</th>
<th>{l s='Default'}</th>
</tr>
</thead>
<tbody>
{foreach from=$suppliers item=supplier}
<tr>
<td><input type="checkbox" class="supplierCheckBox" name="check_supplier_{$supplier['id_supplier']}" {if $supplier['is_selected'] == true}checked="checked"{/if} value="{$supplier['id_supplier']}" /></td>
<td>{$supplier['name']}</td>
<td><input type="radio" id="default_supplier_{$supplier['id_supplier']}" name="default_supplier" value="{$supplier['id_supplier']}" {if $supplier['is_selected'] == false}disabled="disabled"{/if} {if $supplier['is_default'] == true}checked="checked"{/if} /></td>
</tr>
{/foreach}
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
<p>&nbsp;</p>
<h4>{l s='Product reference(s)'}</h4>
<div class="separation"></div>
<p>{l s='You can specify product reference(s) for each supplier associated.'}</p>
<div id="suppliers_accordion" style="margin-top:10px; display:block;">
{foreach from=$associated_suppliers item=supplier}
<h3 style="margin-bottom:0;"><a href="#">{$supplier->name}</a></h3>
<div style="display:block;">
<table cellpadding="10" cellspacing="0" class="table">
<thead>
<tr>
<th>{l s='Selected'}</th>
<th>{l s='Supplier Name'}</th>
<th>{l s='Default'}</th>
<th>{l s='Product name'}</th>
<th width="150">{l s='Supplier reference'}</th>
<th width="150">{l s='Unit price tax excluded'}</th>
<th width="150">{l s='Unit price currency'}</th>
</tr>
</thead>
<tbody>
{foreach from=$suppliers item=supplier}
<tr>
<td><input type="checkbox" class="supplierCheckBox" name="check_supplier_{$supplier['id_supplier']}" {if $supplier['is_selected'] == true}checked="checked"{/if} value="{$supplier['id_supplier']}" /></td>
<td>{$supplier['name']}</td>
<td><input type="radio" id="default_supplier_{$supplier['id_supplier']}" name="default_supplier" value="{$supplier['id_supplier']}" {if $supplier['is_selected'] == false}disabled="disabled"{/if} {if $supplier['is_default'] == true}checked="checked"{/if} /></td>
{foreach $attributes AS $index => $attribute}
{assign var=reference value=''}
{assign var=price_te value=''}
{assign var=id_currency value=''}
{foreach from=$associated_suppliers_collection item=asc}
{if $asc->id_product == $attribute['id_product'] && $asc->id_product_attribute == $attribute['id_product_attribute'] && $asc->id_supplier == $supplier->id_supplier}
{assign var=reference value=$asc->product_supplier_reference}
{assign var=price_te value=Tools::ps_round($asc->product_supplier_price_te, 2)}
{assign var=id_currency value=$asc->id_currency}
{/if}
{/foreach}
<tr {if $index is odd}class="alt_row"{/if}>
<td>{$product_designation[$attribute['id_product_attribute']]}</td>
<td>
<input type="text" size="10" value="{$reference}" name="supplier_reference_{$attribute['id_product']}_{$attribute['id_product_attribute']}_{$supplier->id_supplier}" />
</td>
<td>
<input type="text" size="10" value="{$price_te}" name="product_price_{$attribute['id_product']}_{$attribute['id_product_attribute']}_{$supplier->id_supplier}" />
</td>
<td>
<select name="product_price_currency_{$attribute['id_product']}_{$attribute['id_product_attribute']}_{$supplier->id_supplier}">
{foreach $currencies AS $currency}
<option value="{$currency['id_currency']}"
{if $currency['id_currency'] == $id_currency}selected="selected"{/if}
>{$currency['name']}</option>
{/foreach}
</select>
</td>
</tr>
{/foreach}
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
<p>&nbsp;</p>
<h4>{l s='Product reference(s)'}</h4>
<div class="separation"></div>
<p>{l s='You can specify product reference(s) for each supplier associated.'}</p>
<div id="suppliers_accordion" style="margin-top:10px; display:block;">
{foreach from=$associated_suppliers item=supplier}
<h3 style="margin-bottom:0;"><a href="#">{$supplier->name}</a></h3>
<div style="display:block;">
<table cellpadding="10" cellspacing="0" class="table">
<thead>
<tr>
<th>{l s='Product name'}</th>
<th width="150">{l s='Supplier reference'}</th>
<th width="150">{l s='Unit price tax excluded'}</th>
<th width="150">{l s='Unit price currency'}</th>
</tr>
</thead>
<tbody>
{foreach $attributes AS $index => $attribute}
{assign var=reference value=''}
{assign var=price_te value=''}
{assign var=id_currency value=''}
{foreach from=$associated_suppliers_collection item=asc}
{if $asc->id_product == $attribute['id_product'] && $asc->id_product_attribute == $attribute['id_product_attribute'] && $asc->id_supplier == $supplier->id_supplier}
{assign var=reference value=$asc->product_supplier_reference}
{assign var=price_te value=Tools::ps_round($asc->product_supplier_price_te, 2)}
{assign var=id_currency value=$asc->id_currency}
{/if}
{/foreach}
<tr {if $index is odd}class="alt_row"{/if}>
<td>{$product_designation[$attribute['id_product_attribute']]}</td>
<td>
<input type="text" size="10" value="{$reference}" name="supplier_reference_{$attribute['id_product']}_{$attribute['id_product_attribute']}_{$supplier->id_supplier}" />
</td>
<td>
<input type="text" size="10" value="{$price_te}" name="product_price_{$attribute['id_product']}_{$attribute['id_product_attribute']}_{$supplier->id_supplier}" />
</td>
<td>
<select name="product_price_currency_{$attribute['id_product']}_{$attribute['id_product_attribute']}_{$supplier->id_supplier}">
{foreach $currencies AS $currency}
<option value="{$currency['id_currency']}"
{if $currency['id_currency'] == $id_currency}selected="selected"{/if}
>{$currency['name']}</option>
{/foreach}
</select>
</td>
</tr>
{/foreach}
</tbody>
</table>
</div>
{/foreach}
</div>
<script type="text/javascript">
$(function() {
var default_is_ok = false;
var manageDefaultSupplier = function() {
var availables_radio_buttons = [];
var radio_buttons = $('input[name="default_supplier"]');
for (i=0; i<radio_buttons.length; i++)
{
var item = $(radio_buttons[i]);
if (item.is(':disabled'))
</div>
{/foreach}
</div>
<script type="text/javascript">
$(function() {
var default_is_ok = false;
var manageDefaultSupplier = function() {
var availables_radio_buttons = [];
var radio_buttons = $('input[name="default_supplier"]');
for (i=0; i<radio_buttons.length; i++)
{
if (item.is(':checked'))
var item = $(radio_buttons[i]);
if (item.is(':disabled'))
{
item.attr("checked", "");
default_is_ok = false;
if (item.is(':checked'))
{
item.attr("checked", "");
default_is_ok = false;
}
}
else
{
availables_radio_buttons.push(item);
}
}
if (default_is_ok == false)
{
for (i=0; i<availables_radio_buttons.length; i++)
{
var item = $(availables_radio_buttons[i]);
if (item.is(':disabled') == false)
{
item.attr("checked", "checked");
default_is_ok = true;
}
break;
}
}
};
$('.supplierCheckBox').click(function() {
var check = $(this);
var checkbox = $('#default_supplier_'+check.val());
if (this.checked)
{
//enable default radio button associated
checkbox.attr("disabled","");
}
else
{
availables_radio_buttons.push(item);
//enable default radio button associated
checkbox.attr("disabled","disabled");
}
}
if (default_is_ok == false)
{
for (i=0; i<availables_radio_buttons.length; i++)
{
var item = $(availables_radio_buttons[i]);
if (item.is(':disabled') == false)
{
item.attr("checked", "checked");
default_is_ok = true;
}
break;
}
}
};
$('.supplierCheckBox').click(function() {
var check = $(this);
var checkbox = $('#default_supplier_'+check.val());
if (this.checked)
{
//enable default radio button associated
checkbox.attr("disabled","");
}
else
{
//enable default radio button associated
checkbox.attr("disabled","disabled");
}
//manage default supplier check
manageDefaultSupplier();
//manage default supplier check
manageDefaultSupplier();
});
setTimeout(function() {
$('#suppliers_accordion').accordion();
}, 500);
});
setTimeout(function() {
$('#suppliers_accordion').accordion();
}, 500);
});
</script>
</script>
{/if}
@@ -1,3 +1,29 @@
{*
* 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$
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
* International Registered Trademark & Property of PrestaShop SA
*}
<div class="translatable">
{foreach from=$languages item=language}
<div class="lang_{$language.id_lang}" style="{if !$language.is_default}display:none;{/if}float: left;">
+111 -81
View File
@@ -1,88 +1,118 @@
<h4>{l s='Product location in warehouses'}</h4>
<div class="separation"></div>
<div class="hint" style="display:block; position:'auto';">
<p>{l s='This interface allows you to specify in which warehouses the product is stocked.'}</p>
<p>{l s='It is also possible to specify for each product/product combinations its location in each warehouse.'}</p>
</div>
<p>{l s='Please choose the warehouses associated to this product, and the default one.'}</p>
{*
* 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: 11069 $
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
* International Registered Trademark & Property of PrestaShop SA
*}
{assign var=confirm value="Are you sure you want to delete entered product information?"}
{if isset($product->id)}
<a class="button bt-icon" href="{$link->getAdminLink('AdminWarehouses')}&addwarehouse" onclick="return confirm(' {$confirm} ')">
<img src="../img/admin/add.gif" alt="{l s='Create new warehouse'}" title="{l s='Create new warehouse'}" /><span>{l s='Create new warehouse'}</span>
</a>
<div id="warehouse_accordion" style="margin-top:10px; display:block;">
{foreach from=$warehouses item=warehouse}
<h3 style="margin-bottom:0;"><a href="#">{$warehouse['name']}</a></h3>
<div style="display:block;">
<table cellpadding="10" cellspacing="0" class="table">
<tr>
<th width="100">{l s='In the warehouse?'}</th>
<th>{l s='product name'}</th>
<th width="150">{l s='location in the warehouse (optionnal)'}</th>
</tr>
{foreach $attributes AS $index => $attribute}
{assign var=location value=''}
{assign var=selected value=''}
{foreach from=$associated_warehouses item=aw}
{if $aw->id_product == $attribute['id_product'] && $aw->id_product_attribute == $attribute['id_product_attribute'] && $aw->id_warehouse == $warehouse['id_warehouse']}
{assign var=location value=$aw->location}
{assign var=selected value=true}
{/if}
{/foreach}
<tr {if $index is odd}class="alt_row"{/if}>
<td><input type="checkbox"
name="check_warehouse_{$warehouse['id_warehouse']}_{$attribute['id_product']}_{$attribute['id_product_attribute']}"
{if $selected == true}checked="checked"{/if}
value="1" />
</td>
<td>{$product_designation[$attribute['id_product_attribute']]}</td>
<td><input type="text"
name="location_warehouse_{$warehouse['id_warehouse']}_{$attribute['id_product']}_{$attribute['id_product_attribute']}"
value="{$location}"
size="20" />
</td>
<h4>{l s='Product location in warehouses'}</h4>
<div class="separation"></div>
<div class="hint" style="display:block; position:'auto';">
<p>{l s='This interface allows you to specify in which warehouses the product is stocked.'}</p>
<p>{l s='It is also possible to specify for each product/product combinations its location in each warehouse.'}</p>
</div>
<p>{l s='Please choose the warehouses associated to this product, and the default one.'}</p>
{assign var=confirm value="Are you sure you want to delete entered product information?"}
<a class="button bt-icon" href="{$link->getAdminLink('AdminWarehouses')}&addwarehouse" onclick="return confirm(' {$confirm} ')">
<img src="../img/admin/add.gif" alt="{l s='Create new warehouse'}" title="{l s='Create new warehouse'}" /><span>{l s='Create new warehouse'}</span>
</a>
<div id="warehouse_accordion" style="margin-top:10px; display:block;">
{foreach from=$warehouses item=warehouse}
<h3 style="margin-bottom:0;"><a href="#">{$warehouse['name']}</a></h3>
<div style="display:block;">
<table cellpadding="10" cellspacing="0" class="table">
<tr>
<th width="100">{l s='In the warehouse?'}</th>
<th>{l s='product name'}</th>
<th width="150">{l s='location in the warehouse (optionnal)'}</th>
</tr>
{/foreach}
<tr>
<td colspan="3">&nbsp;</td>
</tr>
<tr>
<td><input type="checkbox" id="check_all_suppliers" value="check_warehouse_{$warehouse['id_warehouse']}" /></td>
<td colspan="2"><i>{l s='Mark all products available in the current warehouse.'}</i></td>
</tr>
</table>
</div>
{/foreach}
</div>
<p>&nbsp;</p>
<script type="text/javascript">
$(function() {
$('#check_all_suppliers').click(function() {
var check = $(this);
//get all checkboxes of current warehouse
var checkboxes = $('input[name*="'+check.val()+'"]');
for (i=0; i<checkboxes.length; i++)
{
var item = $(checkboxes[i]);
if (item.is(':checked'))
{foreach $attributes AS $index => $attribute}
{assign var=location value=''}
{assign var=selected value=''}
{foreach from=$associated_warehouses item=aw}
{if $aw->id_product == $attribute['id_product'] && $aw->id_product_attribute == $attribute['id_product_attribute'] && $aw->id_warehouse == $warehouse['id_warehouse']}
{assign var=location value=$aw->location}
{assign var=selected value=true}
{/if}
{/foreach}
<tr {if $index is odd}class="alt_row"{/if}>
<td><input type="checkbox"
name="check_warehouse_{$warehouse['id_warehouse']}_{$attribute['id_product']}_{$attribute['id_product_attribute']}"
{if $selected == true}checked="checked"{/if}
value="1" />
</td>
<td>{$product_designation[$attribute['id_product_attribute']]}</td>
<td><input type="text"
name="location_warehouse_{$warehouse['id_warehouse']}_{$attribute['id_product']}_{$attribute['id_product_attribute']}"
value="{$location}"
size="20" />
</td>
</tr>
{/foreach}
<tr>
<td colspan="3">&nbsp;</td>
</tr>
<tr>
<td><input type="checkbox" id="check_all_suppliers" value="check_warehouse_{$warehouse['id_warehouse']}" /></td>
<td colspan="2"><i>{l s='Mark all products available in the current warehouse.'}</i></td>
</tr>
</table>
</div>
{/foreach}
</div>
<p>&nbsp;</p>
<script type="text/javascript">
$(function() {
$('#check_all_suppliers').click(function() {
var check = $(this);
//get all checkboxes of current warehouse
var checkboxes = $('input[name*="'+check.val()+'"]');
for (i=0; i<checkboxes.length; i++)
{
item.attr("checked", "");
var item = $(checkboxes[i]);
if (item.is(':checked'))
{
item.attr("checked", "");
}
else
{
item.attr("checked", "checked");
}
}
else
{
item.attr("checked", "checked");
}
}
});
setTimeout(function() {
$('#warehouse_accordion').accordion();
}, 500);
});
</script>
setTimeout(function() {
$('#warehouse_accordion').accordion();
}, 500);
});
</script>
{/if}
+9 -8
View File
@@ -33,16 +33,17 @@
<div>{$btn.desc}</div>
</a>
</li>
{if isset($ps_help_context) && $ps_help_context}
<li class="help-context" style="display:none">
<a id="desc-{$table}-help" class="toolbar_btn" href="#" title="{l s='Help'}">
<span class="process-icon-help"></span>
<div>{l s='Help'}</div>
</a>
</li>
{/if}
{/foreach}
{if isset($ps_help_context) && $ps_help_context}
<li class="help-context" style="display:none">
<a id="desc-{$table}-help" class="toolbar_btn" href="#" title="{l s='Help'}">
<span class="process-icon-help"></span>
<div>{l s='Help'}</div>
</a>
</li>
{/if}
</ul>
<script language="javascript">
$(function() {
//get reference on save link