[*] BO : #PSTEST-791 - Fiche produit Virtuels - Onglet Produit dématérialisé incompréhensible

This commit is contained in:
tDidierjean
2012-03-28 14:21:29 +00:00
parent 9613298e49
commit 2b4f5bbcd0
2 changed files with 130 additions and 105 deletions
@@ -87,18 +87,16 @@
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>');
var fileName = data.getAttribute("filename");
$("#upload-confirmation").show();
if (result == "error")
$("#upload-confirmation td").html('<div class="error">{l s='Error:'} ' + msg + '</div>');
else
{
$('#virtual_product_file').remove();
$('#virtual_product_file_label').hide();
$('#upload_input').remove();
$('#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>' +
$('#upload-confirmation div').prepend('{l s='The file'}&nbsp;"<a class="link" href="get-file-admin.php?file='+msg+'&filename='+fileName+'">'+fileName+'</a>"&nbsp;{l s='has successfully been uploaded'}' +
'<input type="hidden" id="virtual_product_filename" name="virtual_product_filename" value="' + msg + '" />');
}
}
@@ -146,108 +144,129 @@
<h4>{l s='Virtual Product (services, booking and downloadable products)'}</h4>
<div class="separation"></div>
<table cellpadding="5" cellspacing="0" border="0" style="width: 100%;">
<tr>
<td colspan="2">
<div class="is_virtual_good">
<input type="checkbox" id="is_virtual_good" name="is_virtual_good" value="true" {if $product->is_virtual && $product->productDownload->active}checked="checked"{/if} />
<label for="is_virtual_good" class="t bold">{l s='Is this a virtual product?'}</label>
</div>
{* [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 #CCCCCC;">
<tr><td>
<br/>{l s='Does this product has an associated file?'}<br />
<label style="width:50px"><input type="radio" value="1" id="virtual_good_file_1" name="is_virtual_file" {if $product_downloaded}checked="checked"{/if} />{l s='Yes'}</label>
<label style="width:50px"><input type="radio" value="0" id="virtual_good_file_2" name="is_virtual_file" {if !$product_downloaded}checked="checked"{/if} />{l s='No'}</label><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 #CCCCCC">
<p>{l s='Your server\'s maximum upload file size is'}:&nbsp;{$upload_max_filesize} {l s='MB'}</p>
{if $show_file_input}
<div>
<div class="is_virtual_good">
<input type="checkbox" id="is_virtual_good" name="is_virtual_good" value="true" {if $product->is_virtual && $product->productDownload->active}checked="checked"{/if} />
<label for="is_virtual_good" class="t bold">{l s='Is this a virtual product?'}</label>
</div>
{* [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}" />
<div>
<label>{l s='Does this product has an associated file?'}</label>
<label class="radio_check" style="width:50px"><input type="radio" value="1" id="virtual_good_file_1" name="is_virtual_file" {if $product_downloaded}checked="checked"{/if} />{l s='Yes'}</label>
<label style="width:50px;"><input type="radio" value="0" id="virtual_good_file_2" name="is_virtual_file" {if !$product_downloaded}checked="checked"{/if} />{l s='No'}</label>
</div><br />
<div class="separation"></div>
{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}
<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}
{* Don't display file form if the product has combinations *}
{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}
<table cellpadding="5" style="float: left; margin-left: 10px;">
{if !$product->productDownload->checkFile()}
{if $show_file_input}
<tr id="upload_input">
<td class="col-left">
<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>
</td>
<td class="col-right">
<input type="file" id="virtual_product_file" name="virtual_product_file" onchange="uploadFile();" maxlength="{$upload_max_filesize}" />
<p class="product_description">{l s='Your server\'s maximum upload file size is'}:&nbsp;{$upload_max_filesize} {l s='MB'}</p>
</td>
</tr>
{/if}
<tr id="upload-confirmation" style="display:none">
<td colspan=2>
{if $up_filename}
<input type="hidden" id="virtual_product_filename" name="virtual_product_filename" value="{$up_filename}" />
{/if}
<div id="upload-confirmation">
{if $up_filename}
<input type="hidden" id="virtual_product_filename" name="virtual_product_filename" value="{$up_filename}" />
{/if}
<div class="conf">
<a id="delete_downloadable_product" onclick="return confirm('{l s='Delete this file'}')" href="{$currentIndex}&deleteVirtualProduct=true&token={$token}&id_product={$product->id}" class="red">
<img src="../img/admin/delete.gif" alt="{l s='Delete this file'}"/>
</a>
</div>
<a id="delete_downloadable_product" style="display:none;" onclick="return confirm('{l s='Delete this file'}')" href="{$currentIndex}&deleteVirtualProduct=true&token={$token}&id_product={$product->id}" class="red">
<img src="../img/admin/delete.gif" alt="{l s='Delete this file'}"/>
</a>
</div>
{else}
</td>
</tr>
{else}
<tr>
<td class="col-left">
<input type="hidden" id="virtual_product_filename" name="virtual_product_filename" value="{$product->productDownload->filename}" />
{l s='This is the link'}:<br />
<label class="t">{l s='Link to the file:'}</label>
</td>
<td class="col-right">
{$product->productDownload->getHtmlLink(false, true)}
<a onclick="return confirm('{l s='Delete this file'})')" href="{$currentIndex}&deleteVirtualProduct=true&token={$token}&id_product={$product->id}" class="red">
<img src="../img/admin/delete.gif" alt="{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|htmlentities}" />
<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|htmlentities}" 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='Leave this blank for no expiration date'}</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|htmlentities}" 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 cannot edit your file here because you used combinations. Please edit it in the Combinations tab'}</div>
<br />
{$error_product_download}
{/if}
</td></tr>
</table>
</div>
</td>
</tr>
</table>
</td>
</tr>
{/if}
<tr>
<td class="col-left">
<label for="virtual_product_name" class="t">{l s='Filename'}</label>
</td>
<td class="col-right">
<input type="text" id="virtual_product_name" name="virtual_product_name" style="width:200px" value="{$product->productDownload->display_filename|htmlentities}" />
<p class="preference_description" name="help_box">{l s='The full filename with its extension (e.g. Book.pdf)'}</p>
</td>
</tr>
<tr>
<td class="col-left">
<label for="virtual_product_nb_downloable" class="t">{l s='Number of allowed downloads'}</label>
</td>
<td class="col-right">
<input type="text" id="virtual_product_nb_downloable" name="virtual_product_nb_downloable" value="{$product->productDownload->nb_downloadable|htmlentities}" class="" size="6" />
<p class="preference_description">{l s='Number of allowed downloads per customer - (Set to 0 for unlimited downloads)'}</p>
</td>
</tr>
<tr>
<td class="col-left">
<label for="virtual_product_expiration_date" class="t">{l s='Expiration date'}</label>
</td>
<td class="col-right">
<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'}
<p class="preference_description">{l s='If set, the file will not be downloadable anymore after this date. Leave this blank for no expiration date'}</p>
</td>
</tr>
<td class="col-left">
<label for="virtual_product_nb_days" class="t">{l s='Number of days'}</label>
</td>
<td class="col-right">
<input type="text" id="virtual_product_nb_days" name="virtual_product_nb_days" value="{$product->productDownload->nb_days_accessible|htmlentities}" class="" size="4" /><sup> *</sup>
<p class="preference_description">{l s='How many days this file can be accessed by customers'} - <em>({l s='Set to zero for unlimited access'})</em></p>
</td>
</tr>
{* Feature not implemented *}
{*<tr>*}
{*<td class="col-left">*}
{*<label for="virtual_product_is_shareable" class="t">{l s='is shareable'}</label>*}
{*</td>*}
{*<td class="col-right">*}
{*<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>*}
{*</td>*}
{*</tr>*}
{else}
<div class="hint clear" style="display: block;width: 70%;">{l s='You cannot edit your file here because you used combinations. Please edit it in the Combinations tab'}</div>
<br />
{$error_product_download}
{/if}
</table>
</div>
</div>
</div>
+6
View File
@@ -2456,6 +2456,7 @@ $_LANGADM['AdminProducts004bf6c9a40003140292e97330236c53'] = 'Action';
$_LANGADM['AdminProducts0063394f0497bfd610ebac0aee7cfc34'] = 'Associations';
$_LANGADM['AdminProducts006b4cc15322f7951d9100716edcac07'] = 'Quantité minimale :';
$_LANGADM['AdminProducts00d23a76e43b46dae9ec7aa9dcbebb32'] = 'Activé';
$_LANGADM['AdminProducts014140590702586ff3083be3cf84ee2f'] = 'Si elle est définie, le fichier ne sera plus disponible au téléchargement à partir de cette date. Laissez vide si vous ne souhaitez pas de date d\'expiration';
$_LANGADM['AdminProducts019d1ca7d50cc54b995f60d456435e87'] = 'Occasion';
$_LANGADM['AdminProducts01b6e20344b68835c5ed1ddedf20d531'] = 'à';
$_LANGADM['AdminProducts02fa003c38fefcda498b876f67f4cac7'] = 'URL simplifiée :';
@@ -2534,6 +2535,7 @@ $_LANGADM['AdminProducts290b7c47045d269e2ccfa69e6477acfe'] = 'Prix de vente du p
$_LANGADM['AdminProducts2998f049bcca4beccebd03d57d35384e'] = 'Nombre de champs texte à afficher';
$_LANGADM['AdminProducts29d7b46b863639e29ae8452d2320530a'] = 'Faire de cette déclinaison celle par défaut pour ce produit';
$_LANGADM['AdminProducts2aa2ef9d99efe99c01d0c1fb2a3838e5'] = 'Prix d\'achat HT :';
$_LANGADM['AdminProducts2ad05de2ced7109415b7aae16965fa31'] = 'Lien vers le fichier :';
$_LANGADM['AdminProducts2b05e1a0e6c62dbf0018af09ed38f4e0'] = 'Format : YYYY-MM-DD';
$_LANGADM['AdminProducts2ba18b8df558ceaabcc89f3a16772a9b'] = 'Recherche uniquement';
$_LANGADM['AdminProducts2bb8274755d1ebd33d759a3005bfbcd3'] = 'Prix à l\'unité HT';
@@ -2558,6 +2560,7 @@ $_LANGADM['AdminProducts3b6c024d7eff743d98d894ce0e0d1242'] = 'Documents disponib
$_LANGADM['AdminProducts3bc79dca1e0cdc4b2ac5a2e415f902bf'] = 'Le prix de vente hors taxe du produit';
$_LANGADM['AdminProducts3c6c11039b6caf151f6e3e99237f2f3b'] = 'À partir de (quantité)';
$_LANGADM['AdminProducts3cb94c0658e6bbfdeac7e65b9635a8f5'] = 'Voici le lien';
$_LANGADM['AdminProducts3d9f514d46849760ef1b1412e314fd99'] = 'Erreur :';
$_LANGADM['AdminProducts3dd42bfc8345e82c43b4a40a3426ec49'] = 'Référence :';
$_LANGADM['AdminProducts3e053943605d9e4bf7dd7588ea19e9d2'] = 'Caractères interdits :';
$_LANGADM['AdminProducts3e06cfca1e715c7c256ef8da2098f62a'] = 'Vous devez enregistrer ce produit avant de pouvoir ajouter des images.';
@@ -2700,6 +2703,7 @@ $_LANGADM['AdminProducts92c75dc7b5c97898f326b95360d4bac7'] = 'afficher le nom du
$_LANGADM['AdminProducts936229092c21ed68de9ba5c3edb6c9f8'] = 'nombre de jours';
$_LANGADM['AdminProducts936ccdb97115e9f35a11d35e3d5b5cad'] = 'Cliquez ici';
$_LANGADM['AdminProducts93cba07454f06a4a960172bbd6e2a435'] = 'Oui';
$_LANGADM['AdminProducts945ceb0f13fd944d0766929df2053dff'] = 'Nombre de téléchargement permis par client (mettez à 0 pour des téléchargements illimités)';
$_LANGADM['AdminProducts94d26b23623d5a7a411fa43f3cd48c9a'] = 'Vous pouvez choisir d\'utiliser la gestion des stocks avancée pour ce produit, ou non.';
$_LANGADM['AdminProducts94d4eb606950cf2b2d24c9821a362cb8'] = 'Quantité disponible à la vente dans la boutique/groupe de boutiques en cours';
$_LANGADM['AdminProducts95b6faa9d75417fe5e7767a733ab6fb4'] = 'À partir de';
@@ -2722,6 +2726,7 @@ $_LANGADM['AdminProducts9d74dc485c5bf552c65dd6a2a3596a59'] = 'Enregistrement des
$_LANGADM['AdminProducts9d9aa88574c4dab04ddd8356c377357d'] = 'Catégorie par défaut :';
$_LANGADM['AdminProducts9e648a50303a03e66b9d41cfbaa52ea7'] = 'Impossible si le produit est un pack';
$_LANGADM['AdminProducts9e834f13e35e4edf64863ab414a6217a'] = 'Réduction';
$_LANGADM['AdminProducts9e8502652dd83fa0544df75ba4641144'] = 'La réduction est appliquée après les taxes';
$_LANGADM['AdminProducts9e962fd822ee734a531490fffa643c49'] = 'Mettez à 0 pour un accès illimité au téléchargement';
$_LANGADM['AdminProducts9ea67be453eaccf020697b4654fc021a'] = 'Enregistrer et rester';
$_LANGADM['AdminProducts9f82518d468b9fee614fcc92f76bb163'] = 'Boutique';
@@ -2795,6 +2800,7 @@ $_LANGADM['AdminProductsc795dfff10a7c952f4c5438951e9ece9'] = 'Image de couvertur
$_LANGADM['AdminProductsc7c2169d380b95e2e3672037c5ace793'] = 'Attribuer des caractéristiques à ce produit';
$_LANGADM['AdminProductsc8360cc476fc8b5ee9a4db494220058d'] = 'Nombre de téléchargements autorisé par client';
$_LANGADM['AdminProductsc9211c294f5e55646fb079d71194cd96'] = 'Impossible si la gestion des stocks avancée n\'est pas activée';
$_LANGADM['AdminProductsc925e061d42989c43e6d3a7e43f2a878'] = 'Nombre de téléchargement permis';
$_LANGADM['AdminProductsc975449f6135768798a09476bcbaa6e8'] = 'afficher le nom du fichier d\'une déclinaison';
$_LANGADM['AdminProductsc9cc8cce247e49bae79f15173ce97354'] = 'Enregistrer';
$_LANGADM['AdminProductsc9ccbcfb87f75a9cf7a437314e6ece4f'] = 'Veuillez choisir les fournisseurs associés au produit, et celui par défaut.';