// #PSFV-94 - update AdminProductsController
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@9645 b9a71923-0436-4b27-9f14-aed3839534dd
This commit is contained in:
@@ -90,3 +90,8 @@ a.module_toggle_all{color: #268CCD;}
|
||||
.notifs_wrapper p.no_notifs {border: none;}
|
||||
.productTabs ol{padding:0;}
|
||||
.productTabs{background-color:#e0e0e0;border:1px solid #cccccc;position:absolute;top:100px;left:50px;}
|
||||
|
||||
ul.cc_button {float:right;margin:0;padding:6px 0;}
|
||||
ul.cc_button li {float:left;text-decoration: none;list-style: none;font-size:12px;padding:5px 0;}
|
||||
.available_btn {border:2px outset black;display:block;height:50px;margin:2px;padding:3px 2px 1px 2px;width:60px;}
|
||||
.available_btn span{font-size:small;margin-top:5px;text-align:center}
|
||||
|
||||
@@ -18,6 +18,7 @@
|
||||
var toload = new Array();
|
||||
var pos_select = {$pos_select};
|
||||
$(document).ready(function(){
|
||||
{* submenu binding *}
|
||||
$(".tab-page").click(function(e){
|
||||
e.preventDefault();
|
||||
// currentId is the current producttab id
|
||||
@@ -181,8 +182,18 @@ $(document).ready(function(){
|
||||
}
|
||||
//]]>
|
||||
</script>
|
||||
|
||||
<form action="{$form_action}" method="post" enctype="multipart/form-data" name="product" id="product">
|
||||
{$draft_warning}
|
||||
<ul class="cc_button">
|
||||
{foreach from=$available_btn item=btn key=k}
|
||||
<li>
|
||||
<a class="available_btn" href="{$btn.href}" title="{$btn.desc}">
|
||||
<span class="process-icon-{$k}">{$btn.short}</span>
|
||||
</a>
|
||||
</li>
|
||||
{/foreach}
|
||||
</ul>
|
||||
<input type="hidden" name="id_product" value="{$id_product}" />
|
||||
<input type="hidden" name="tabs" id="tabs" value="0" />
|
||||
<div class="tab-pane" id="tabPane1">
|
||||
|
||||
@@ -82,9 +82,499 @@
|
||||
$('#mvt_sign').show();
|
||||
}
|
||||
</script>
|
||||
<hr class="clear"/>
|
||||
<br />
|
||||
<table cellpadding="5" style="width: 50%; float: left; margin-right: 20px; border-right: 1px solid #E0D0B1;">
|
||||
{* global information *}
|
||||
<tr>
|
||||
<td class="col-left">{l s='Name:' }</td>
|
||||
<td style="padding-bottom:5px;" class="translatable">
|
||||
{foreach from=$languages item=language}
|
||||
<div class="lang_{$language.id_lang}" style="{if !$language.is_default}display: none;{/if} float: left;">
|
||||
<input class="{if $product->id}copy2friendlyUrl{/if} updateCurrentText" size="43" type="text"
|
||||
id="name_{$language.id_lang}" name="name_{$language.id_lang}"
|
||||
value="{$language.name|htmlentitiesUTF8}"/><sup> *</sup>
|
||||
<span class="hint" name="help_box">{l s='Invalid characters:'} <>;=#{}<span class="hint-pointer"> </span>
|
||||
</span>
|
||||
</div>
|
||||
{/foreach}
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="col-left">{l s='Reference:' }</td>
|
||||
<td style="padding-bottom:5px;">
|
||||
<input size="55" type="text" name="reference" value="{$product->reference|htmlentitiesUTF8}" style="width: 130px; margin-right: 44px;" />
|
||||
<span class="hint" name="help_box">{l s='Special characters allowed:' }.-_#\<span class="hint-pointer"> </span></span>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="col-left">{l s='Supplier Reference:' }</td>
|
||||
<td style="padding-bottom:5px;">
|
||||
<input size="55" type="text" name="supplier_reference" value="{$product->supplier_reference|htmlentitiesUTF8}" style="width: 130px; margin-right: 44px;" />
|
||||
<span class="hint" name="help_box">{l s='Special characters allowed:' } .-_#\<span class="hint-pointer"> </span></span>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="col-left">{l s='EAN13 or JAN:' }</td>
|
||||
<td style="padding-bottom:5px;">
|
||||
<input size="55" maxlength="13" type="text" name="ean13" value="{$product->ean13|htmlentitiesUTF8}" style="width: 130px; margin-right: 5px;" /> <span class="small">{l s='(Europe, Japan)'}</span>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="col-left">{l s='UPC:' }</td>
|
||||
<td style="padding-bottom:5px;">
|
||||
<input size="55" maxlength="12" type="text" name="upc" value="{$product->upc}" style="width: 130px; margin-right: 5px;" /> <span class="small">{l s='(US, Canada)'}</span>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="col-left">{l s='Location (warehouse):' }</td>
|
||||
<td style="padding-bottom:5px;">
|
||||
<input size="55" type="text" name="location" value="{$product->location|htmlentitiesUTF8}" style="width: 130px; margin-right: 44px;" />
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
|
||||
</table>
|
||||
{* status informations *}
|
||||
<table cellpadding="5" style="width: 40%; float: left; margin-left: 10px;">
|
||||
<tr>
|
||||
<td style="vertical-align:top;text-align:right;padding-right:10px;font-weight:bold;">{l s='Status:' }</td>
|
||||
<td style="padding-bottom:5px;">
|
||||
<input style="float:left;" onclick="toggleDraftWarning(false);showOptions(true);" type="radio" name="active" id="active_on" value="1" {if $product->active}checked="checked" {/if} />
|
||||
<label for="active_on" class="t"><img src="../img/admin/enabled.gif" alt="{l s='Enabled'}"
|
||||
title="{l s='Enabled'}" style="float:left; padding:0px 5px 0px 5px;" />
|
||||
{l s='Enabled'}</label>
|
||||
<br class="clear" />
|
||||
<input style="float:left;" onclick="toggleDraftWarning(true);showOptions(false);" type="radio" name="active" id="active_off" value="0" {if !$product->active}checked="checked"{/if} />
|
||||
<label for="active_off" class="t"><img src="../img/admin/disabled.gif" alt="{l s='Disabled'}" title="{l s='Disabled'}" style="float:left; padding:0px 5px 0px 5px" />{l s='Disabled'} {if !$product->active} (<a href="{$preview_url}" alt="" target="_blank">{l s='View product in shop'}</a>){/if}</label>
|
||||
</td>
|
||||
</tr>
|
||||
{if $feature_shop_active}
|
||||
{* @todo use asso_shop from Helper *}
|
||||
<tr id="shop_association">
|
||||
<td style="vertical-align:top;text-align:right;padding-right:10px;font-weight:bold;">{l s='Shop association:'}</td>
|
||||
<td style="padding-bottom:5px;">{$displayAssoShop}</td>
|
||||
</tr>
|
||||
{/if}
|
||||
<tr id="product_options" {if !$product->active}style="display:none"{/if} >
|
||||
<td style="vertical-align:top;text-align:right;padding-right:10px;font-weight:bold;">{l s='Options:' }</td>
|
||||
<td style="padding-bottom:5px;">
|
||||
<input style="float: left;" type="checkbox" name="available_for_order" id="available_for_order" value="1" {if $product->available_for_order}checked="checked"{/if} />
|
||||
<script type="text/javascript">
|
||||
$(document).ready(function()
|
||||
{
|
||||
$("#available_for_order").click(function(){
|
||||
if ($(this).is(':checked'))
|
||||
{
|
||||
$('#show_price').attr('checked', 'checked');
|
||||
$('#show_price').attr('disabled', 'disabled');
|
||||
}
|
||||
else
|
||||
{
|
||||
$('#show_price').attr('disabled', '');
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
<label for="available_for_order" class="t"><img src="../img/admin/products.gif" alt="{l s='available for order'}" title="{l s='available for order'}" style="float:left; padding:0px 5px 0px 5px" />{l s='available for order'}</label>
|
||||
<br class="clear" />
|
||||
<input style="float: left;" type="checkbox" name="show_price" id="show_price" value="1" {if $product->show_price}checked="checked"{/if} />
|
||||
<label for="show_price" class="t"><img src="../img/admin/gold.gif" alt="{l s='display price'}" title="{l s='show price'}" style="float:left; padding:0px 5px 0px 5px" />{l s='show price'}</label>
|
||||
<br class="clear" />
|
||||
<input style="float: left;" type="checkbox" name="online_only" id="online_only" value="1" {if $product->online_only}checked="checked"{/if} />
|
||||
<label for="online_only" class="t"><img src="../img/admin/basket_error.png" alt="{l s='online only'}" title="{l s='online only'}" style="float:left; padding:0px 5px 0px 5px" />{l s='online only (not sold in store)'}</label>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="vertical-align:top;text-align:right;padding-right:10px;font-weight:bold;">{l s='Condition:' }</td>
|
||||
<td style="padding-bottom:5px;">
|
||||
<select name="condition" id="condition">
|
||||
<option value="new" {if $product->condition == 'new'}selected="selected"{/if} >{l s='New'}</option>
|
||||
<option value="used" {if $product->condition == 'used'}selected="selected"{/if} >{l s='Used'}</option>
|
||||
<option value="refurbished" {if $product->condition == 'refurbished'}selected="selected"{/if}>{l s='Refurbished'}</option>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="vertical-align:top;text-align:right;padding-right:10px;font-weight:bold;">{l s='Manufacturer:' }</td>
|
||||
<td style="padding-bottom:5px;">
|
||||
<select name="id_manufacturer" id="id_manufacturer">
|
||||
<option value="0">-- {l s='Choose (optional)'} --</option>
|
||||
{if $product->id_manufacturer}
|
||||
<option value="{$product->id_manufacturer}" selected="selected">{$product->manufacturer_name}</option>
|
||||
{/if}
|
||||
<option disabled="disabled">----------</option>
|
||||
</select>
|
||||
<a href="{$link->getAdminLink('AdminManufacturer')}&addmanufacturer" onclick="return confirm('{l s='Are you sure you want to delete product information entered?' js=1} ')">
|
||||
<img src="../img/admin/add.gif" alt="{l s='Create'}" title="{l s='Create'}" /> <b>{l s='Create'}</b>
|
||||
</a>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="vertical-align:top;text-align:right;padding-right:10px;font-weight:bold;">{l s='Supplier:' }</td>
|
||||
<td style="padding-bottom:5px;">
|
||||
<select name="id_supplier" id="id_supplier">
|
||||
<option value="0">-- {l s='Choose (optional)'} --</option>
|
||||
{if $product->id_supplier}
|
||||
<option value="{$product->id_supplier}" selected="selected">{$product->supplier_name}</option>
|
||||
{/if}
|
||||
<option disabled="disabled">----------</option>
|
||||
</select>
|
||||
<a href="{$link->getAdminLink('AdminSuppliers')}&addsupplier" onclick="return confirm('{l s='Are you sure you want to delete entered product information?' js=1}">
|
||||
<img src="../img/admin/add.gif" alt="{l s='Create'}" title="{l s='Create'}" /> <b>{l s='Create'}</b>
|
||||
</a>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<div class="clear"></div>
|
||||
<table cellpadding="5" cellspacing="0" border="0" style="width: 100%;"><tr><td><hr style="width:100%;" /></td></tr></table>
|
||||
{* [begin] pack product *}
|
||||
<table>
|
||||
<tr>
|
||||
<td>
|
||||
<input type="checkbox" name="ppack" id="ppack" value="1" {if $is_pack}checked="checked"{/if} onclick="$('#ppackdiv').slideToggle();" />
|
||||
<label class="t" for="ppack">{l s='Pack'}</label>
|
||||
</td>
|
||||
<td>
|
||||
<div id="ppackdiv" {if !$is_pack}style="display: none;"{/if}>
|
||||
<div id="divPackItems">
|
||||
{foreach from=$product->packItems item=packItem}
|
||||
{$packItem->pack_quantity} x {$packItem->name}<span onclick="delPackItem({$packItem->id});" style="cursor: pointer;"><img src="../img/admin/delete.gif" /></span><br />
|
||||
{/foreach}
|
||||
</div>
|
||||
<input type="hidden" name="inputPackItems" id="inputPackItems" value="{$input_pack_items}" />
|
||||
|
||||
<input type="hidden" name="namePackItems" id="namePackItems" value="{$input_namepack_items}" />
|
||||
|
||||
<input type="hidden" size="2" id="curPackItemId" />
|
||||
|
||||
<p class="clear">{l s='Begin typing the first letters of the product name, then select the product from the drop-down list:'}
|
||||
<br />{l s='You cannot add downloadable products to a pack.'}</p>
|
||||
<input type="text" size="25" id="curPackItemName" />
|
||||
<input type="text" name="curPackItemQty" id="curPackItemQty" value="1" size="1" />
|
||||
<span onclick="addPackItem();" style="cursor: pointer;"><img src="../img/admin/add.gif" alt="{l s='Add an item to the pack'}" title="{l s='Add an item to the pack'}" /></span>
|
||||
</td>
|
||||
</div>
|
||||
</tr>
|
||||
</table>
|
||||
<script language="javascript">
|
||||
function addPackItem()
|
||||
{
|
||||
if ($('#curPackItemId').val() == '' || $('#curPackItemName').val() == '')
|
||||
{
|
||||
alert('{l s='Thanks to select at least one product.'}');
|
||||
return false;
|
||||
}
|
||||
else if ($('#curPackItemId').val() == '' || $('#curPackItemQty').val() == '')
|
||||
{
|
||||
alert('{l s='Thanks to set a quantity to add a product.'}');
|
||||
return false;
|
||||
}
|
||||
|
||||
var lineDisplay = $('#curPackItemQty').val()+ 'x ' +$('#curPackItemName').val();
|
||||
|
||||
var divContent = $('#divPackItems').html();
|
||||
divContent += lineDisplay;
|
||||
divContent += '<span onclick="delPackItem(' + $('#curPackItemId').val() + ');" style="cursor: pointer;"><img src="../img/admin/delete.gif" /></span><br />';
|
||||
|
||||
// QTYxID-QTYxID
|
||||
var line = $('#curPackItemQty').val()+ 'x' +$('#curPackItemId').val();
|
||||
|
||||
|
||||
$('#inputPackItems').val($('#inputPackItems').val() + line + '-');
|
||||
$('#divPackItems').html(divContent);
|
||||
$('#namePackItems').val($('#namePackItems').val() + lineDisplay + '¤');
|
||||
|
||||
$('#curPackItemId').val('');
|
||||
$('#curPackItemName').val('');
|
||||
|
||||
$('#curPackItemName').setOptions({
|
||||
extraParams: {
|
||||
excludeIds : getSelectedIds()
|
||||
}
|
||||
});
|
||||
}
|
||||
function delPackItem(id)
|
||||
{
|
||||
var reg = new RegExp('-', 'g');
|
||||
var regx = new RegExp('x', 'g');
|
||||
|
||||
var div = getE('divPackItems');
|
||||
var input = getE('inputPackItems');
|
||||
var name = getE('namePackItems');
|
||||
var select = getE('curPackItemId');
|
||||
var select_quantity = getE('curPackItemQty');
|
||||
|
||||
var inputCut = input.value.split(reg);
|
||||
var nameCut = name.value.split(new RegExp('¤', 'g'));
|
||||
|
||||
input.value = '';
|
||||
name.value = '';
|
||||
div.innerHTML = '';
|
||||
|
||||
for (var i = 0; i < inputCut.length; ++i)
|
||||
if (inputCut[i])
|
||||
{
|
||||
var inputQty = inputCut[i].split(regx);
|
||||
if (inputQty[1] != id)
|
||||
{
|
||||
input.value += inputCut[i] + '-';
|
||||
name.value += nameCut[i] + '¤';
|
||||
div.innerHTML += nameCut[i] + ' <span onclick="delPackItem(' + inputQty[1] + ');" style="cursor: pointer;"><img src="../img/admin/delete.gif" /></span><br />';
|
||||
}
|
||||
}
|
||||
|
||||
$('#curPackItemName').setOptions({
|
||||
extraParams: {
|
||||
excludeIds : getSelectedIds()
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/* function autocomplete */
|
||||
urlToCall = null;
|
||||
function getSelectedIds()
|
||||
{
|
||||
// input lines QTY x ID-
|
||||
var ids = {$product->id}+',';
|
||||
ids += $('#inputPackItems').val().replace(/\\d+x/g, '').replace(/\-/g,',');
|
||||
ids = ids.replace(/\,$/,'');
|
||||
return ids;
|
||||
}
|
||||
|
||||
$(function() {
|
||||
$('#curPackItemName')
|
||||
.autocomplete('ajax_products_list.php', {
|
||||
delay: 100,
|
||||
minChars: 1,
|
||||
autoFill: true,
|
||||
max:20,
|
||||
matchContains: true,
|
||||
mustMatch:true,
|
||||
scroll:false,
|
||||
cacheLength:0,
|
||||
{* param multipleSeparator:'||' ajouté à cause de bug dans lib autocomplete *}
|
||||
multipleSeparator:'||',
|
||||
formatItem: function(item) {
|
||||
return item[1]+' - '+item[0];
|
||||
}
|
||||
}).result(function(event, item){
|
||||
$('#curPackItemId').val(item[1]);
|
||||
});
|
||||
$('#curPackItemName').setOptions({
|
||||
extraParams: {
|
||||
excludeIds : getSelectedIds(), excludeVirtuals : 1
|
||||
}
|
||||
});
|
||||
|
||||
});
|
||||
</script>
|
||||
{* [end] pack product *}
|
||||
|
||||
{* [begin] specific / detailled information *}
|
||||
|
||||
<div class="clear"></div>
|
||||
<script type="text/javascript">
|
||||
var newLabel = '{l s='New label'}';
|
||||
var choose_language = '{l s='Choose language:'}';
|
||||
var required = '{l s='required'}';
|
||||
var customizationUploadableFileNumber = '{$product->uploadable_files}';
|
||||
var customizationTextFieldNumber = '{$product->text_fields}';
|
||||
var uploadableFileLabel = 0;
|
||||
var textFieldLabel = 0;
|
||||
$(document).ready(function(){
|
||||
$("#is_virtual_good").change(function(e)
|
||||
{
|
||||
$(".toggleVirtualPhysicalProduct").toggle();
|
||||
});
|
||||
});
|
||||
</script>
|
||||
<table cellpadding="5" cellspacing="0" border="0" style="width: 100%;"><tr><td><hr style="width:100%;" /></td></tr></table>
|
||||
<table cellpadding="5" cellspacing="0" border="0" style="width: 100%;">
|
||||
<tr>
|
||||
<td colspan="2">
|
||||
<p><input type="checkbox" id="is_virtual_good" name="is_virtual_good" value="true" {*onclick="toggleVirtualProduct(this);"*} {if $product->is_virtual && $product->productDownload->active}checked="checked"{/if} />
|
||||
<label for="is_virtual_good" class="t bold" style="color: black;">{l s='Is this a virtual product?'}</label>
|
||||
</p>
|
||||
{* [begin] physical product infos *}
|
||||
<div id="physical_good" class="toggleVirtualPhysicalProduct" {if $product->productDownload->id && $product->productDownload->active}style="display:none"{/if} >
|
||||
<table cellpadding="5" cellspacing="0" border="0" style="width: 100%;">
|
||||
<tr><td><hr style="width:100%;" /></td></tr>
|
||||
</table>
|
||||
<table cellpadding="5" style="width: 50%; float: left; margin-right: 20px; border-right: 1px solid #E0D0B1;">
|
||||
<tr>
|
||||
<td class="col-left">{l s='Width ( package ) :' }</td>
|
||||
<td style="padding-bottom:5px;">
|
||||
<input size="6" maxlength="6" name="width" type="text" value="{$product->width}" onKeyUp="if (isArrowKey(event)) return ;this.value = this.value.replace(/,/g, '.');" /> {$ps_dimension_unit}
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="col-left">{l s='Height ( package ) :' }</td>
|
||||
<td style="padding-bottom:5px;">
|
||||
<input size="6" maxlength="6" name="height" type="text" value="{$product->height}" onKeyUp="if (isArrowKey(event)) return ;this.value = this.value.replace(/,/g, '.');" /> {$ps_dimension_unit}
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<table cellpadding="5" style="width: 40%; float: left; margin-left: 10px;">
|
||||
<tr>
|
||||
<td class="col-left">{l s='Deep ( package ) :' }</td>
|
||||
<td style="padding-bottom:5px;">
|
||||
<input size="6" maxlength="6" name="depth" type="text" value="{$product->depth}" onKeyUp="if (isArrowKey(event)) return ;this.value = this.value.replace(/,/g, '.');" /> {$ps_dimension_unit}
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="col-left">{l s='Weight ( package ) :' }</td>
|
||||
<td style="padding-bottom:5px;">
|
||||
<input size="6" maxlength="6" name="weight" type="text" value="{$product->weight}" onKeyUp="if (isArrowKey(event)) return ;this.value = this.value.replace(/,/g, '.');" /> {$ps_weight_unit}
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
{* [end] of physical product *}
|
||||
{* [begin] virtual product *}
|
||||
<div id="virtual_good" class="toggleVirtualPhysicalProduct" {if !$product->productDownload->id || $product->productDownload->active}style="display:none"{/if} >
|
||||
<input type="hidden" id="is_virtual" name="is_virtual" value="{$product->is_virtual}" />
|
||||
<table cellpadding="5" style="width: 50%; float: left; margin-right: 20px; border-right: 1px solid #E0D0B1;">
|
||||
<tr><td>
|
||||
<br/>{l s='Does this product has an associated file ?'}<br />
|
||||
<input type="radio" value="1" id="virtual_good_file_1" name="is_virtual_file" {if $product_downloaded}checked="checked"{/if} />{l s='Yes'}
|
||||
<input type="radio" value="0" id="virtual_good_file_2" name="is_virtual_file" {if !$product_downloaded}checked="checked"{/if} />{l s='No'}<br /><br />
|
||||
{if $download_product_file_missing}
|
||||
<p class="alert" id="file_missing">
|
||||
<b>{$download_product_file_missing} :<br/>
|
||||
{$smarty.const._PS_DOWNLOAD_DIR_}/{$product->productDownload->filename}</b>
|
||||
</p>
|
||||
{/if}
|
||||
</td></tr>
|
||||
<tr>
|
||||
<td>
|
||||
<div id="is_virtual_file_product" style="display:none;">
|
||||
{if !$download_dir_writable}
|
||||
<p class="alert">
|
||||
{l s='Your download repository is not writable.'}<br/>
|
||||
{$smarty.const._PS_DOWNLOAD_DIR_}
|
||||
</p>
|
||||
{/if}
|
||||
{if empty($product->cache_default_attribute)}
|
||||
{if $product->productDownload->id}
|
||||
<input type="hidden" id="virtual_product_id" name="virtual_product_id" value="{$product->productDownload->id}" />
|
||||
{/if}
|
||||
<p class="block">
|
||||
{if !$product->productDownload->checkFile()}
|
||||
<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'}: {$upload_max_filesize}</p>
|
||||
{if $show_file_input}
|
||||
<label id="virtual_product_file_label" for="virtual_product_file" class="t">{l s='Upload a file'}</label>
|
||||
<p><input type="file" id="virtual_product_file" name="virtual_product_file" onchange="uploadFile();" maxlength="{$upload_max_filesize}" /></p>
|
||||
{/if}
|
||||
<div id="upload-confirmation">
|
||||
{if $up_filename}
|
||||
<input type="hidden" id="virtual_product_filename" name="virtual_product_filename" value="{$up_filename}" />
|
||||
{/if}
|
||||
</div>
|
||||
<a id="delete_downloadable_product" style="display:none;" onclick="return confirm('{l s='Delete this file' slashes=1 js=1}')" href="{$currentIndex}&deleteVirtualProduct=true" class="red">
|
||||
{l s='Delete this file'}
|
||||
</a>
|
||||
</div>
|
||||
{else}
|
||||
<input type="hidden" id="virtual_product_filename" name="virtual_product_filename" value="{$product->productDownload->filename}" />
|
||||
{l s='This is the link'}: {$product->productDownload->getHtmlLink(false, true)}
|
||||
<a onclick="return confirm('{l s='Delete this file' slashes=1 js=1})')" href="{$currentIndex}&deleteVirtualProduct=true" class="red">{l s='Delete this file'}</a>
|
||||
{/if}
|
||||
</p>
|
||||
|
||||
<p class="block">
|
||||
<label for="virtual_product_name" class="t">{l s='Filename'}</label>
|
||||
<input type="text" id="virtual_product_name" name="virtual_product_name" style="width:200px" value="{$product->productDownload->display_filename|htmlentitiesUTF8}" />
|
||||
<span class="hint" name="help_box" style="display:none;">{l s='The full filename with its extension (e.g., Book.pdf)'}</span>
|
||||
</p>
|
||||
</div>
|
||||
</td></tr>
|
||||
</table>
|
||||
<table cellpadding="5" style="width: 40%; float: left; margin-left: 10px;">
|
||||
<tr><td>
|
||||
<div id="virtual_good_more" style="'.$hidden.'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" name="virtual_product_nb_downloable" value="{$product->productDownload->nb_downloadable}" 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" class="t">{l s='Expiration date'}</label>
|
||||
<input class="datepicker" type="text" id="virtual_product_expiration_date" name="virtual_product_expiration_date" value="{$product->productDownload->date_expiration}" 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" name="virtual_product_nb_days" value="{$product->productDownload->nb_days_accessible}" 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" class="t">{l s='is shareable'}</label>
|
||||
<input type="checkbox" id="virtual_product_is_shareable" name="virtual_product_is_shareable" value="1" {if $product->productDownload->is_shareable}checked="checked"{/if} />
|
||||
<span class="hint" name="help_box" style="display:none">{l s='Specify if the file can be shared'}</span>
|
||||
</p>
|
||||
</div>
|
||||
{else}
|
||||
<div class="hint clear" style="display: block;width: 70%;">{l s='You used combinations, for this reason you can\'t edit your file here, but in the Combinations tab'}</div>
|
||||
<br />
|
||||
{$error_product_download}
|
||||
{/if}
|
||||
</td></tr>
|
||||
</table>
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
$(document).ready(function(){
|
||||
if ($("#is_virtual_good").attr("checked"))
|
||||
{
|
||||
$("#virtual_good").show("slow");
|
||||
$("#virtual_good_more").show("slow");
|
||||
}
|
||||
|
||||
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")
|
||||
{
|
||||
$("#virtual_good_attributes").show();
|
||||
$("#is_virtual_file_product").show();
|
||||
}
|
||||
else
|
||||
{
|
||||
$("#virtual_good_attributes").hide();
|
||||
$("#is_virtual_file_product").hide();
|
||||
}
|
||||
});
|
||||
|
||||
$("input[name=is_virtual_good]").live("change", function() {
|
||||
if($(this).attr("checked"))
|
||||
{
|
||||
$("#is_virtual").val(1);
|
||||
}
|
||||
else
|
||||
{
|
||||
$("#is_virtual").val(0);
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="2" style="padding-bottom:5px;"><hr style="width:100%;" /></td>
|
||||
</tr>
|
||||
|
||||
{$content}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
+22
@@ -101,6 +101,7 @@ function strToAltImgAttr(str,encoding,ucfirst)
|
||||
function copy2friendlyURL()
|
||||
{
|
||||
$('#link_rewrite_' + id_language).val(str2url($('#name_' + id_language).val().replace(/^[0-9]+\./, ''), 'UTF-8'));
|
||||
return;
|
||||
}
|
||||
|
||||
function copyMeta2friendlyURL()
|
||||
@@ -927,3 +928,24 @@ function showErrorMessage(msg)
|
||||
$("#ajax_confirmation").show()
|
||||
.html("<div class=\"error\"><img src=\"../img/admin/error.png\" alt=\"ERROR\" />"+msg+"</div>");
|
||||
}
|
||||
|
||||
$(document).ready(function(){
|
||||
$(".copy2friendlyURL").live('keyup',function(e){
|
||||
if(!isArrowKey(e))
|
||||
return copy2friendlyURL()
|
||||
});
|
||||
|
||||
// on live will make this binded for dynamic content
|
||||
$(".updateCurrentText").live('keyup change',function(e){
|
||||
if(typeof e == KeyboardEvent)
|
||||
if(isArrowKey(e))
|
||||
return;
|
||||
|
||||
updateCurrentText()
|
||||
});
|
||||
|
||||
$(".copyMeta2friendlyURL").live('keyup',function(e){
|
||||
if(!isArrowKey(e))
|
||||
return copyMeta2friendlyURL()
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user