[+] Helper form WIP
This commit is contained in:
@@ -34,11 +34,10 @@
|
||||
{if $shared_category}
|
||||
<p class="alert alert-block">{l s='If you delete this picture, it will be deleted in all of your shared shops!'}</p>
|
||||
{/if}
|
||||
<br>
|
||||
<a href="{$current}&{$identifier}={$form_id}&token={$token}&{if $shared_category}forcedeleteImage=1{else}deleteImage=1{/if}">
|
||||
<img src="../img/admin/delete.gif" alt="{l s='Delete'}" /> {l s='Delete'}
|
||||
</a>
|
||||
</div><br />
|
||||
</div>
|
||||
{/if}
|
||||
{/if}
|
||||
<input type="file" name="{$input.name}" {if isset($input.id)}id="{$input.id}"{/if} />
|
||||
|
||||
+7
-6
@@ -26,22 +26,23 @@
|
||||
{extends file="helpers/list/list_header.tpl"}
|
||||
|
||||
{block name=leadin}
|
||||
<div class="cat_bar2">
|
||||
<ul class="breadcrumb cat_bar2">
|
||||
{assign var=i value=0}
|
||||
{foreach $categories_tree key=key item=category}
|
||||
{if $i++ == 0}
|
||||
<img src="../img/admin/home.gif" alt="" />
|
||||
<li><i class="icon-home"></i>
|
||||
{assign var=params_url value=""}
|
||||
{else}
|
||||
{assign var=params_url value="&id_category={$category.id_category}&viewcategory"}
|
||||
<li>{assign var=params_url value="&id_category={$category.id_category}&viewcategory"}
|
||||
{/if}
|
||||
{if $category.id_category == $categories_tree_current_id}
|
||||
{$category.name}
|
||||
{$category.name}</li>
|
||||
{else}
|
||||
<a href="{$currentIndex}{$params_url}&token={$token}">{$category.name}</a> >
|
||||
<a href="{$currentIndex}{$params_url}&token={$token}">{$category.name}</a></li>
|
||||
{/if}
|
||||
{/foreach}
|
||||
</div>
|
||||
</ul>
|
||||
|
||||
{if isset($delete_category) && $delete_category}
|
||||
<form action="{$REQUEST_URI}" method="post">
|
||||
<div class="alert alert-block">
|
||||
|
||||
@@ -34,27 +34,29 @@
|
||||
{l s='Filename:'}
|
||||
</span>
|
||||
</label>
|
||||
<div class="col-lg-7 translatable">
|
||||
{foreach $languages as $language}
|
||||
<div class="lang_{$language.id_lang}" style="{if $language.id_lang != $default_form_language}display:none;{/if}">
|
||||
<input type="text" name="attachment_name_{$language.id_lang}" value="{$attachment_name[$language.id_lang]|escape:'htmlall':'UTF-8'}" />
|
||||
</div>
|
||||
{/foreach}
|
||||
<div class="col-lg-7">
|
||||
<div class="row">
|
||||
{include file="controllers/products/input_text_lang.tpl"
|
||||
languages=$languages
|
||||
input_value=$attachment_name
|
||||
input_name="attachment_name"
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<label class="control-label col-lg-3">{l s='Description:'} </label>
|
||||
<div class="col-lg-7 translatable">
|
||||
{foreach $languages as $language}
|
||||
<div class="lang_{$language.id_lang}" style="display: {if $language.id_lang == $default_form_language}block{else}none{/if};">
|
||||
<textarea name="attachment_description_{$language.id_lang}">{$attachment_description[$language.id_lang]|escape:'htmlall':'UTF-8'}</textarea>
|
||||
</div>
|
||||
{/foreach}
|
||||
<div class="col-lg-9">
|
||||
{include
|
||||
file="controllers/products/textarea_lang.tpl"
|
||||
languages=$languages
|
||||
input_name="attachment_description"
|
||||
input_value=$attachment_description
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="row">
|
||||
<label class="control-label col-lg-3">
|
||||
<span class="label-tooltip" data-toggle="tooltip"
|
||||
@@ -62,45 +64,73 @@
|
||||
{l s='File:'}
|
||||
</span>
|
||||
</label>
|
||||
<div class="input-group col-lg-7">
|
||||
<input type="file" name="attachment_file" />
|
||||
<input type="submit" value="{l s='Upload attachment file'}" name="submitAddAttachments" class="btn btn-default" />
|
||||
<div class="col-lg-7">
|
||||
<div class="row">
|
||||
<div class="col-lg-8">
|
||||
<input id="attachement_file" type="file" name="attachment_file" class="hide" />
|
||||
<div class="dummyfile input-group">
|
||||
<span class="input-group-addon"><i class="icon-file"></i></span>
|
||||
<input id="attachement_filename" type="text" class="disabled" name="filename" readonly />
|
||||
<span class="input-group-btn">
|
||||
<button id="attachement_fileselectbutton" type="button" name="submitAddAttachments" class="btn btn-default">
|
||||
{l s='Choose a file'}
|
||||
</button>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-lg-4">
|
||||
<button type="submit" name="submitAddAttachments" class="btn btn-default">
|
||||
<i class="icon-cloud-upload"></i> {l s='Upload attachment file'}
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
$(document).ready(function(){
|
||||
$('#attachement_fileselectbutton').click(function(e){
|
||||
$('#attachement_file').trigger('click');
|
||||
});
|
||||
$('#attachement_file').change(function(e){
|
||||
var val = $(this).val();
|
||||
var file = val.split(/[\\/]/);
|
||||
$('#attachement_filename').val(file[file.length-1]);
|
||||
});
|
||||
});
|
||||
</script>
|
||||
</div>
|
||||
|
||||
<hr/>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-lg-9 col-offset-3">
|
||||
<div class="row">
|
||||
<div class="col-lg-6">
|
||||
<p>{l s='Available attachments:'}</p>
|
||||
<select multiple id="selectAttachment2">
|
||||
{foreach $attach2 as $attach}
|
||||
<option value="{$attach.id_attachment}">{$attach.name}</option>
|
||||
{/foreach}
|
||||
</select>
|
||||
<a href="#" id="addAttachment" class="btn btn-default btn-block">{l s='Add'} <i class="icon-arrow-right"></i></a>
|
||||
</div>
|
||||
<div class="col-lg-6">
|
||||
<p>{l s='Attachments for this product:'}</p>
|
||||
<select multiple id="selectAttachment1" name="attachments[]">
|
||||
{foreach $attach1 as $attach}
|
||||
<option value="{$attach.id_attachment}">{$attach.name}</option>
|
||||
{/foreach}
|
||||
</select>
|
||||
<a href="#" id="removeAttachment" class="btn btn-default btn-block"><i class="icon-arrow-left"></i> {l s='Remove'}</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<input type="hidden" name="arrayAttachments" id="arrayAttachments" value="{foreach $attach1 as $attach}{$attach.id_attachment},{/foreach}" />
|
||||
|
||||
<table>
|
||||
<tr>
|
||||
<td>
|
||||
<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">
|
||||
{l s='Add'} >>
|
||||
</a>
|
||||
</td>
|
||||
<td style="padding-left:20px;">
|
||||
<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'}
|
||||
</a>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<div class="clear"> </div>
|
||||
<input type="hidden" name="arrayAttachments" id="arrayAttachments" value="{foreach $attach1 as $attach}{$attach.id_attachment},{/foreach}" />
|
||||
|
||||
<script type="text/javascript">
|
||||
var iso = '{$iso_tiny_mce}';
|
||||
var pathCSS = '{$smarty.const._THEME_CSS_DIR_}';
|
||||
var ad = '{$ad}';
|
||||
</script>
|
||||
{/if}
|
||||
<script type="text/javascript">
|
||||
var iso = '{$iso_tiny_mce}';
|
||||
var pathCSS = '{$smarty.const._THEME_CSS_DIR_}';
|
||||
var ad = '{$ad}';
|
||||
</script>
|
||||
{/if}
|
||||
@@ -32,18 +32,18 @@
|
||||
{l s='You can either create a specific value, or select among the existing pre-defined values you\'ve previously added.'}
|
||||
</div>
|
||||
|
||||
<table class="table">
|
||||
<table class="table table-striped">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>{l s='Feature'}</th>
|
||||
<th>{l s='Pre-defined value'}</th>
|
||||
<th>{l s='or'} {l s='Customized value'}</th>
|
||||
<th><u>{l s='or'}</u> {l s='Customized value'}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
|
||||
{foreach from=$available_features item=available_feature}
|
||||
<tbody>
|
||||
{foreach from=$available_features item=available_feature}
|
||||
|
||||
<tr>
|
||||
<td>{$available_feature.name}</td>
|
||||
<td>
|
||||
@@ -59,23 +59,47 @@
|
||||
</select>
|
||||
{else}
|
||||
<input type="hidden" name="feature_{$available_feature.id_feature}_value" value="0" />
|
||||
<span>{l s='N/A'} -
|
||||
<span>{l s='N/A'} -
|
||||
<a href="{$link->getAdminLink('AdminFeatures')|escape:'htmlall':'UTF-8'}&addfeature_value&id_feature={$available_feature.id_feature}"
|
||||
class="confirm_leave button"><i class="icon-plus-sign"></i> {l s='Add pre-defined values first'}</a>
|
||||
class="confirm_leave btn btn-link btn-small"><i class="icon-plus-sign"></i> {l s='Add pre-defined values first'} <i class="icon-external-link-sign"></i></a>
|
||||
</span>
|
||||
{/if}
|
||||
</td>
|
||||
<td class="translatable">
|
||||
{foreach from=$languages key=k 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[$k].value|escape:'htmlall':'UTF-8'|default:""}</textarea>
|
||||
<td>
|
||||
{foreach from=$languages key=k item=language}
|
||||
<div class="row translatable-field lang-{$language.id_lang}">
|
||||
<div class="col-lg-9">
|
||||
<textarea
|
||||
class="custom_{$available_feature.id_feature}_{$language.id_lang}"
|
||||
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[$k].value|escape:'htmlall':'UTF-8'|default:""}</textarea>
|
||||
</div>
|
||||
<div class="col-lg-3">
|
||||
<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown">
|
||||
<img src="{$base_url}/img/l/{$language.id_lang|intval}.jpg" alt="">
|
||||
{$language.iso_code}
|
||||
<span class="caret"></span>
|
||||
</button>
|
||||
<ul class="dropdown-menu">
|
||||
{foreach from=$languages item=language}
|
||||
<li>
|
||||
<a href="javascript:hideOtherLanguage({$language.id_lang});">
|
||||
<img src="{$base_url}/img/l/{$language.id_lang|intval}.jpg" alt=""> {$language.iso_code}</a>
|
||||
</li>
|
||||
{/foreach}
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
{/foreach}
|
||||
{/foreach}
|
||||
</td>
|
||||
|
||||
</tr>
|
||||
{foreachelse}
|
||||
<tr><td colspan="3" style="text-align:center;"><i class="icon-warning-sign"></i> {l s='No features have been defined'}</td></tr>
|
||||
<tr>
|
||||
<td colspan="3" style="text-align:center;"><i class="icon-warning-sign"></i> {l s='No features have been defined'}</td>
|
||||
</tr>
|
||||
{/foreach}
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
@@ -54,21 +54,16 @@
|
||||
|
||||
</script>
|
||||
<div class="bloc-leadin">
|
||||
|
||||
<div id="container_category_tree">
|
||||
|
||||
<a href="#" id="toggle_category_tree">
|
||||
<form>
|
||||
<input type="checkbox" {if $is_category_filter}checked="checked"{/if} />{l s='Filter by category'}
|
||||
</form>
|
||||
</a>
|
||||
|
||||
<div id="block_category_tree" {if !$is_category_filter}style="display:none"{/if}>
|
||||
{$category_tree}
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
{/if}
|
||||
{/block}
|
||||
|
||||
@@ -24,317 +24,308 @@
|
||||
*}
|
||||
|
||||
{if isset($id_product) && isset($product)}
|
||||
<input type="hidden" name="submitted_tabs[]" value="Images" />
|
||||
<input type="hidden" name="submitted_tabs[]" value="Images" />
|
||||
|
||||
<legend class="tab" >
|
||||
{l s='Images'}
|
||||
<span class="badge" id="countImage">{$countImages}</span>
|
||||
</legend>
|
||||
<legend class="tab" >
|
||||
{l s='Images'}
|
||||
<span class="badge" id="countImage">{$countImages}</span>
|
||||
</legend>
|
||||
|
||||
|
||||
|
||||
<div class="row">
|
||||
<label class="control-label col-lg-3 file_upload_label">
|
||||
<span class="label-tooltip" data-toggle="tooltip"
|
||||
title="{l s='Format:'} JPG, GIF, PNG. {l s='Filesize:'} {$max_image_size|string_format:"%.2f"} {l s='MB max.'}">
|
||||
{if isset($id_image)}{l s='Edit this product image'}{else}{l s='Add a new image to this product'}{/if}
|
||||
</span>
|
||||
</label>
|
||||
<div class="col-lg-5">
|
||||
{l s='File:'}
|
||||
<div id="file-uploader">
|
||||
<noscript>
|
||||
<p>{l s='Please enable JavaScript to use file uploader:'}</p>
|
||||
</noscript>
|
||||
</div>
|
||||
<div id="progressBarImage" class="progressBarImage"></div>
|
||||
<div id="showCounter" style="display:none;">
|
||||
<span id="imageUpload">0</span><span id="imageTotal">0</span>
|
||||
</div>
|
||||
<input type="hidden" name="resizer" value="auto" />
|
||||
{if Tools::getValue('id_image')}
|
||||
<input type="hidden" name="id_image" value="{Tools::getValue('id_image')|intval}" />
|
||||
{/if}
|
||||
<div class="row panel">
|
||||
<label class="control-label col-lg-5 file_upload_label">
|
||||
<span class="label-tooltip" data-toggle="tooltip"
|
||||
title="{l s='Format:'} JPG, GIF, PNG. {l s='Filesize:'} {$max_image_size|string_format:"%.2f"} {l s='MB max.'}">
|
||||
{if isset($id_image)}{l s='Edit this product image'}{else}{l s='Add a new image to this product'}{/if}
|
||||
</span>
|
||||
</label>
|
||||
<div class="col-lg-7">
|
||||
{l s='File:'}
|
||||
<div id="file-uploader">
|
||||
<noscript>
|
||||
<p>{l s='Please enable JavaScript to use file uploader:'}</p>
|
||||
</noscript>
|
||||
</div>
|
||||
<div id="progressBarImage" class="progressBarImage"></div>
|
||||
<div id="showCounter" style="display:none;">
|
||||
<span id="imageUpload">0</span><span id="imageTotal">0</span>
|
||||
</div>
|
||||
<input type="hidden" name="resizer" value="auto" />
|
||||
{if Tools::getValue('id_image')}
|
||||
<input type="hidden" name="id_image" value="{Tools::getValue('id_image')|intval}" />
|
||||
{/if}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<table class="table tableDnD" id="imageTable">
|
||||
<thead>
|
||||
<tr class="nodrag nodrop">
|
||||
<th>{l s='Image'}</th>
|
||||
<th>{l s='Position'}</th>
|
||||
{if $shops}
|
||||
{foreach from=$shops item=shop}
|
||||
<th>{$shop.name}</th>
|
||||
{/foreach}
|
||||
{/if}
|
||||
<th>{l s='Cover'}</th>
|
||||
<th>{l s='Action'}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody id="imageList">
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
|
||||
<table class="table tableDnD" id="imageTable">
|
||||
<thead>
|
||||
<tr class="nodrag nodrop">
|
||||
<th>{l s='Image'}</th>
|
||||
<th>{l s='Position'}</th>
|
||||
{if $shops}
|
||||
{foreach from=$shops item=shop}
|
||||
<th>{$shop.name}</th>
|
||||
{/foreach}
|
||||
{/if}
|
||||
<th>{l s='Cover'}</th>
|
||||
<th>{l s='Action'}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody id="imageList">
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
|
||||
|
||||
<table id="lineType" style="display:none;">
|
||||
<tr id="image_id">
|
||||
<td style="padding: 4px;">
|
||||
<a href="{$smarty.const._THEME_PROD_DIR_}image_path.jpg" class="fancybox">
|
||||
<img src="{$smarty.const._THEME_PROD_DIR_}en-default-small_default.jpg" alt="image_id" title="image_id" />
|
||||
</a>
|
||||
</td>
|
||||
<td id="td_image_id" class="pointer dragHandle center positionImage">
|
||||
image_position
|
||||
<table id="lineType" style="display:none;">
|
||||
<tr id="image_id">
|
||||
<td style="padding: 4px;">
|
||||
<a href="{$smarty.const._THEME_PROD_DIR_}image_path.jpg" class="fancybox">
|
||||
<img src="{$smarty.const._THEME_PROD_DIR_}en-default-small_default.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="#">
|
||||
<i class="covered icon-check-empty"></i>
|
||||
</td>
|
||||
<td class="center">
|
||||
<a href="#" class="btn btn-default delete_product_image" >
|
||||
<i class="icon-trash"></i> {l s='Delete this image'}
|
||||
</a>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<script type="text/javascript">
|
||||
var upbutton = '{l s='Upload an image'}';
|
||||
var token = '{$token}';
|
||||
var come_from = '{$table}';
|
||||
var success_add = '{l s='The image has been successfully added.'}';
|
||||
var id_tmp = 0;
|
||||
var current_shop_id = {$current_shop_id|intval};
|
||||
{literal}
|
||||
//Ready Function
|
||||
$(document).ready(function(){
|
||||
{/literal}
|
||||
{foreach from=$images item=image}
|
||||
assoc = {literal}"{"{/literal};
|
||||
{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>
|
||||
assoc += '"{$shop.id_shop}" : {if $image->isAssociatedToShop($shop.id_shop)}1{else}0{/if},';
|
||||
{/foreach}
|
||||
{/if}
|
||||
<td class="center cover"><a href="#">
|
||||
<i class="covered icon-check-empty"></i>
|
||||
</td>
|
||||
<td class="center">
|
||||
<a href="#" class="btn btn-default delete_product_image" >
|
||||
<i class="icon-trash"></i> {l s='Delete this image'}
|
||||
</a>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<script type="text/javascript">
|
||||
var upbutton = '{l s='Upload an image'}';
|
||||
var token = '{$token}';
|
||||
var come_from = '{$table}';
|
||||
var success_add = '{l s='The image has been successfully added.'}';
|
||||
var id_tmp = 0;
|
||||
var current_shop_id = {$current_shop_id|intval};
|
||||
{literal}
|
||||
//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};
|
||||
assoc = jQuery.parseJSON(assoc);
|
||||
}
|
||||
else
|
||||
assoc = false;
|
||||
imageLine({$image->id}, "{$image->getExistingImgPath()}", {$image->position}, "{if $image->cover}icon-check-sign{else}icon-check-empty{/if}", assoc);
|
||||
{/foreach}
|
||||
{literal}
|
||||
$("#imageTable").tableDnD(
|
||||
if (assoc != {literal}"{"{/literal})
|
||||
{
|
||||
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 (!stop || (i + 1) == 2)
|
||||
image_up += '"' + $(this).attr("id") + '" : ' + (i + 1) + ',';
|
||||
});
|
||||
image_up = image_up.slice(0, -1);
|
||||
image_up += "}";
|
||||
updateImagePosition(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 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 = "icon-check-empty";
|
||||
if (responseJSON.cover == "1")
|
||||
cover = "icon-check-sign";
|
||||
imageLine(responseJSON.id, responseJSON.path, responseJSON.position, cover, responseJSON.shops)
|
||||
$("#imageTable tr:last").after(responseJSON.html);
|
||||
$("#countImage").html(parseInt($("#countImage").html()) + 1);
|
||||
$("#img" + id).remove();
|
||||
$("#imageTable").tableDnDUpdate();
|
||||
showSuccessMessage(responseJSON.name + " " + success_add);
|
||||
}
|
||||
else
|
||||
showErrorMessage(responseJSON.error);
|
||||
filecheck++;
|
||||
},
|
||||
onSubmit: function(id, filename)
|
||||
{
|
||||
$("#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>");
|
||||
}
|
||||
});
|
||||
|
||||
/**
|
||||
* on success function
|
||||
*/
|
||||
function afterDeleteProductImage(data)
|
||||
{
|
||||
data = $.parseJSON(data);
|
||||
if (data)
|
||||
{
|
||||
cover = 0;
|
||||
id = data.content.id;
|
||||
if (data.status == 'ok')
|
||||
{
|
||||
if ($("#" + id + ' .covered').hasClass('icon-check-sign'))
|
||||
cover = 1;
|
||||
$("#" + id).remove();
|
||||
}
|
||||
if (cover)
|
||||
$("#imageTable tr").eq(1).find(".covered").addClass('icon-check-sign');
|
||||
$("#countImage").html(parseInt($("#countImage").html()) - 1);
|
||||
refreshImagePositions($("#imageTable"));
|
||||
showSuccessMessage(data.confirmations);
|
||||
}
|
||||
assoc = assoc.slice(0, -1);
|
||||
assoc += {literal}"}"{/literal};
|
||||
assoc = jQuery.parseJSON(assoc);
|
||||
}
|
||||
|
||||
$('.delete_product_image').die().live('click', function(e)
|
||||
{
|
||||
e.preventDefault();
|
||||
id = $(this).parent().parent().attr('id');
|
||||
if (confirm("{/literal}{l s='Are you sure?' js=1}{literal}"))
|
||||
doAdminAjax({
|
||||
"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 }, afterDeleteProductImage
|
||||
);
|
||||
else
|
||||
assoc = false;
|
||||
imageLine({$image->id}, "{$image->getExistingImgPath()}", {$image->position}, "{if $image->cover}icon-check-sign{else}icon-check-empty{/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 (!stop || (i + 1) == 2)
|
||||
image_up += '"' + $(this).attr("id") + '" : ' + (i + 1) + ',';
|
||||
});
|
||||
|
||||
$('.covered').die().live('click', function(e)
|
||||
image_up = image_up.slice(0, -1);
|
||||
image_up += "}";
|
||||
updateImagePosition(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)
|
||||
{
|
||||
e.preventDefault();
|
||||
id = $(this).parent().parent().parent().attr('id');
|
||||
$("#imageList .cover i").each( function(i){
|
||||
$(this).removeClass('icon-check-sign').addClass('icon-check-empty');
|
||||
});
|
||||
$(this).removeClass('icon-check-empty').addClass('icon-check-sign');
|
||||
|
||||
if (current_shop_id != 0)
|
||||
$('#' + current_shop_id + id).attr('check', true);
|
||||
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
|
||||
$(this).parent().parent().parent().children('td input').attr('check', true);
|
||||
doAdminAjax({
|
||||
"action":"UpdateCover",
|
||||
{
|
||||
$("#progressBarImage").progressbar({value: 0});
|
||||
$("#progressBarImage").hide();
|
||||
$("#showCounter").hide();
|
||||
nbfile = 0;
|
||||
filecheck = 0;
|
||||
}
|
||||
if (responseJSON.status == 'ok')
|
||||
{
|
||||
cover = "icon-check-empty";
|
||||
if (responseJSON.cover == "1")
|
||||
cover = "icon-check-sign";
|
||||
imageLine(responseJSON.id, responseJSON.path, responseJSON.position, cover, responseJSON.shops)
|
||||
$("#imageTable tr:last").after(responseJSON.html);
|
||||
$("#countImage").html(parseInt($("#countImage").html()) + 1);
|
||||
$("#img" + id).remove();
|
||||
$("#imageTable").tableDnDUpdate();
|
||||
showSuccessMessage(responseJSON.name + " " + success_add);
|
||||
}
|
||||
else
|
||||
showErrorMessage(responseJSON.error);
|
||||
filecheck++;
|
||||
},
|
||||
onSubmit: function(id, filename)
|
||||
{
|
||||
$("#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>");
|
||||
}
|
||||
});
|
||||
|
||||
/**
|
||||
* on success function
|
||||
*/
|
||||
function afterDeleteProductImage(data)
|
||||
{
|
||||
data = $.parseJSON(data);
|
||||
if (data)
|
||||
{
|
||||
cover = 0;
|
||||
id = data.content.id;
|
||||
if (data.status == 'ok')
|
||||
{
|
||||
if ($("#" + id + ' .covered').hasClass('icon-check-sign'))
|
||||
cover = 1;
|
||||
$("#" + id).remove();
|
||||
}
|
||||
if (cover)
|
||||
$("#imageTable tr").eq(1).find(".covered").addClass('icon-check-sign');
|
||||
$("#countImage").html(parseInt($("#countImage").html()) - 1);
|
||||
refreshImagePositions($("#imageTable"));
|
||||
showSuccessMessage(data.confirmations);
|
||||
}
|
||||
}
|
||||
|
||||
$('.delete_product_image').die().live('click', function(e)
|
||||
{
|
||||
e.preventDefault();
|
||||
id = $(this).parent().parent().attr('id');
|
||||
if (confirm("{/literal}{l s='Are you sure?' js=1}{literal}"))
|
||||
doAdminAjax({
|
||||
"action":"deleteProductImage",
|
||||
"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_product":id_product,
|
||||
"id_shop": id_shop,
|
||||
"active":active,
|
||||
"id_category" : {/literal}{$id_category_default}{literal},
|
||||
"token" : "{/literal}{$token}{literal}",
|
||||
"tab" : "AdminProducts",
|
||||
"ajax" : 1
|
||||
});
|
||||
});
|
||||
|
||||
//function
|
||||
function updateImagePosition(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_path/g, path);
|
||||
line = line.replace(/image_position/g, position);
|
||||
line = line.replace(/icon-check-empty/g, cover);
|
||||
line = line.replace(/<tbody>/gi, "");
|
||||
line = line.replace(/<\/tbody>/gi, "");
|
||||
if (shops != false)
|
||||
{
|
||||
$.each(shops, function(key, value){
|
||||
if (value == 1)
|
||||
line = line.replace('id="' + key + '' + id + '"','id="' + key + '' + id + '" checked=checked');
|
||||
});
|
||||
}
|
||||
$("#imageList").append(line);
|
||||
}
|
||||
$('.fancybox').fancybox();
|
||||
"ajax" : 1 }, afterDeleteProductImage
|
||||
);
|
||||
});
|
||||
{/literal}
|
||||
</script>
|
||||
|
||||
$('.covered').die().live('click', function(e)
|
||||
{
|
||||
e.preventDefault();
|
||||
id = $(this).parent().parent().parent().attr('id');
|
||||
$("#imageList .cover i").each( function(i){
|
||||
$(this).removeClass('icon-check-sign').addClass('icon-check-empty');
|
||||
});
|
||||
$(this).removeClass('icon-check-empty').addClass('icon-check-sign');
|
||||
|
||||
if (current_shop_id != 0)
|
||||
$('#' + current_shop_id + id).attr('check', true);
|
||||
else
|
||||
$(this).parent().parent().parent().children('td input').attr('check', true);
|
||||
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_product":id_product,
|
||||
"id_shop": id_shop,
|
||||
"active":active,
|
||||
"token" : "{/literal}{$token}{literal}",
|
||||
"tab" : "AdminProducts",
|
||||
"ajax" : 1
|
||||
});
|
||||
});
|
||||
|
||||
//function
|
||||
function updateImagePosition(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_path/g, path);
|
||||
line = line.replace(/image_position/g, position);
|
||||
line = line.replace(/icon-check-empty/g, cover);
|
||||
line = line.replace(/<tbody>/gi, "");
|
||||
line = line.replace(/<\/tbody>/gi, "");
|
||||
if (shops != false)
|
||||
{
|
||||
$.each(shops, function(key, value){
|
||||
if (value == 1)
|
||||
line = line.replace('id="' + key + '' + id + '"','id="' + key + '' + id + '" checked=checked');
|
||||
});
|
||||
}
|
||||
$("#imageList").append(line);
|
||||
}
|
||||
$('.fancybox').fancybox();
|
||||
});
|
||||
{/literal}
|
||||
</script>
|
||||
{/if}
|
||||
|
||||
@@ -219,9 +219,14 @@
|
||||
<div class="row redirect_product_options redirect_product_options_product_choise" style="display:none">
|
||||
{include file="controllers/products/multishop/checkbox.tpl" field="active" type="radio" onclick=""}
|
||||
<label class="control-label col-lg-3">{l s='Related product:'}</label>
|
||||
<div class="col-lg-5">
|
||||
<div class="col-lg-7">
|
||||
<input type="hidden" value="" name="id_product_redirected" />
|
||||
<input type="text" id="related_product_autocomplete_input" autocomplete="off" class="ac_input" />
|
||||
|
||||
<div class="input-group">
|
||||
<input type="text" id="related_product_autocomplete_input" autocomplete="off" class="ac_input" />
|
||||
<span class="input-group-addon"><i class="icon-search"></i></span>
|
||||
</div>
|
||||
|
||||
<span id="related_product_remove" style="display:none">
|
||||
<a class="btn btn-default" href="#" onclick="removeRelatedProduct(); return false" id="related_product_remove_link">
|
||||
<i class="icon-trash"></i>
|
||||
@@ -299,8 +304,13 @@
|
||||
{l s='Short description:'}
|
||||
</span>
|
||||
</label>
|
||||
<div class="col-lg-8">
|
||||
{include file="controllers/products/textarea_lang.tpl" languages=$languages input_name='description_short' input_value=$product->description_short max=$PS_PRODUCT_SHORT_DESC_LIMIT}
|
||||
<div class="col-lg-9">
|
||||
{include
|
||||
file="controllers/products/textarea_lang.tpl"
|
||||
languages=$languages
|
||||
input_name='description_short'
|
||||
input_value=$product->description_short
|
||||
max=$PS_PRODUCT_SHORT_DESC_LIMIT}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -312,8 +322,11 @@
|
||||
{l s='Description:'}
|
||||
</span>
|
||||
</label>
|
||||
<div class="col-lg-8">
|
||||
{include file="controllers/products/textarea_lang.tpl" languages=$languages input_name='description' input_value=$product->description}
|
||||
<div class="col-lg-9">
|
||||
{include
|
||||
file="controllers/products/textarea_lang.tpl"
|
||||
languages=$languages input_name='description'
|
||||
input_value=$product->description}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -327,19 +340,21 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="createImageDescription" class="well" style="display:none">
|
||||
<div id="createImageDescription" class="panel" style="display:none">
|
||||
|
||||
<div class="row">
|
||||
<label class="control-label col-lg-3">{l s='Select your image:'}</label>
|
||||
<div class="col-lg-5">
|
||||
{foreach from=$images item=image key=key}
|
||||
<p class="checkbox-inline">
|
||||
<input type="radio" name="smallImage" id="smallImage_{$key}" value="{$image.id_image}" {if $key == 0}checked="checked"{/if} >
|
||||
<label for="smallImage_{$key}" class="t">
|
||||
<img src="{$image.src}" alt="{$image.legend}" />
|
||||
</label>
|
||||
</p>
|
||||
{/foreach}
|
||||
<div class="col-lg-9">
|
||||
<ul class="list-inline">
|
||||
{foreach from=$images item=image key=key}
|
||||
<li>
|
||||
<input type="radio" name="smallImage" id="smallImage_{$key}" value="{$image.id_image}" {if $key == 0}checked="checked"{/if} >
|
||||
<label for="smallImage_{$key}" class="t">
|
||||
<img src="{$image.src}" alt="{$image.legend}" />
|
||||
</label>
|
||||
</li>
|
||||
{/foreach}
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -28,51 +28,68 @@
|
||||
var msg_set_quantity = "{l s="Please set a quantity to add a product." js=1}";
|
||||
</script>
|
||||
<input type="hidden" name="submitted_tabs[]" value="Pack" />
|
||||
<h4>{l s='Pack'}</h4>
|
||||
<div class="separation"></div>
|
||||
<legend>{l s='Pack'}</legend>
|
||||
<div class="alert alert-info">{l s='You cannot add combinations to a pack.'}</div>
|
||||
|
||||
<table>
|
||||
<tr>
|
||||
<td>
|
||||
<div class="ppack">
|
||||
<input type="checkbox" name="ppack" id="ppack" value="1" {if $product_type == Product::PTYPE_PACK}checked="checked"{/if} onclick="$('#ppackdiv').slideToggle();" />
|
||||
<label class="t" for="ppack">{l s='Pack'}</label>
|
||||
</div>
|
||||
</td>
|
||||
<td>
|
||||
<div id="ppackdiv" {if !($product_type == Product::PTYPE_PACK)}style="display: none;"{/if}>
|
||||
<div class="ppack">
|
||||
<input type="checkbox" name="ppack" id="ppack" value="1" {if $product_type == Product::PTYPE_PACK}checked="checked"{/if} onclick="$('#ppackdiv').slideToggle();" />
|
||||
<label class="t" for="ppack">{l s='Pack'}</label>
|
||||
</div>
|
||||
|
||||
<label for="curPackItemName" style="width:560px;text-align:left;">
|
||||
{l s='Begin typing the first letters of the product name. Then select the product from the drop-down list:'}
|
||||
</label><br /><br />
|
||||
<div id="ppackdiv" {if !($product_type == Product::PTYPE_PACK)}style="display: none;"{/if}>
|
||||
|
||||
<input type="text" size="25" id="curPackItemName" />
|
||||
<input type="text" name="curPackItemQty" id="curPackItemQty" value="1" size="1" />
|
||||
<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" />
|
||||
<div class="row">
|
||||
<label class="control-label col-lg-3" for="curPackItemName">
|
||||
<span class="label-tooltip" data-toggle="tooltip"
|
||||
title="{l s='Begin typing the first letters of the product name. Then select the product from the drop-down list:'}">
|
||||
{l s='Product'}
|
||||
</span>
|
||||
</label>
|
||||
<div class="input-group col-lg-6">
|
||||
<input type="text" id="curPackItemName" />
|
||||
<span class="input-group-addon"><i class="icon-search"></i></span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<label class="control-label col-lg-3" for="curPackItemQty">
|
||||
{l s='Quantity'}
|
||||
</label>
|
||||
<div class="input-group col-lg-2">
|
||||
<span class="input-group-addon">×</span>
|
||||
<input type="text" name="curPackItemQty" id="curPackItemQty" value="1"/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<span id="add_pack_item" class="button" style="cursor: pointer;">
|
||||
{l s='Add this product to the pack'}
|
||||
</span>
|
||||
<div class="row">
|
||||
<div class="col-lg-9 col-offset-3">
|
||||
<button type="button" id="add_pack_item" class="btn btn-default">
|
||||
<i class="icon-plus-sign-alt"></i> {l s='Add this product to the pack'}
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<p class="product_description listOfPack" style="display:{if count($pack_items) > 0}block{else}none{/if};text-align: left;">
|
||||
<br />{l s='List of products for that pack:'}
|
||||
</p>
|
||||
<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" id="curPackItemId" />
|
||||
|
||||
<div id="divPackItems">
|
||||
{foreach $pack_items as $pack_item}
|
||||
{$pack_item.pack_quantity} x {$pack_item.name}
|
||||
<span class="delPackItem" name="{$pack_item.id}" style="cursor: pointer;">
|
||||
<img src="../img/admin/delete.gif" />
|
||||
</span><br />
|
||||
{/foreach}
|
||||
</div>
|
||||
<hr/>
|
||||
|
||||
<br />
|
||||
<p class="alert alert-info" style="display:block">{l s='You cannot add combinations to a pack.'}</p>
|
||||
<div class="row">
|
||||
<label class="control-label col-lg-3 product_description listOfPack" style="display:{if count($pack_items) > 0}block{else}none{/if};">
|
||||
{l s='List of products for that pack:'}
|
||||
</label>
|
||||
<div class="col-lg-9">
|
||||
<ul id="divPackItems">
|
||||
{foreach $pack_items as $pack_item}
|
||||
<li>
|
||||
<button type="button" class="btn btn-default delPackItem" name="{$pack_item.id}">
|
||||
<i class="icon-trash"></i>
|
||||
</button>
|
||||
{$pack_item.pack_quantity} x {$pack_item.name}
|
||||
</li>
|
||||
{/foreach}
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</td>
|
||||
</div>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
@@ -72,61 +72,62 @@
|
||||
{l s='Click "Save and Stay" after changing selected suppliers to display the associated product references.'}
|
||||
</div>
|
||||
|
||||
<div id="suppliers_accordion">
|
||||
<div id="accordion-supplier">
|
||||
{foreach from=$associated_suppliers item=supplier}
|
||||
<h3>
|
||||
<a href="#">{$supplier->name}</a>
|
||||
</h3>
|
||||
|
||||
<div>
|
||||
|
||||
<table class="table">
|
||||
|
||||
<thead>
|
||||
<tr>
|
||||
<th>{l s='Product name'}</th>
|
||||
<th>{l s='Supplier reference'}</th>
|
||||
<th>{l s='Unit price tax excluded'}</th>
|
||||
<th>{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=$id_default_currency}
|
||||
{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)}
|
||||
{if $asc->id_currency}
|
||||
{assign var=id_currency value=$asc->id_currency}
|
||||
{/if}
|
||||
{/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|escape:'htmlall':'UTF-8'}" name="supplier_reference_{$attribute['id_product']}_{$attribute['id_product_attribute']}_{$supplier->id_supplier}" />
|
||||
</td>
|
||||
<td>
|
||||
<input type="text" size="10" value="{$price_te|htmlentities}" 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 class="accordion-group">
|
||||
<div class="accordion-heading">
|
||||
<a class="accordion-toggle" data-toggle="collapse" data-parent="#accordion" href="#supplier-{$supplier->id}">{$supplier->name}</a>
|
||||
</div>
|
||||
<div id="supplier-{$supplier->id}" class="accordion-body collapse in">
|
||||
<div class="accordion-inner">
|
||||
<table class="table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>{l s='Product name'}</th>
|
||||
<th>{l s='Supplier reference'}</th>
|
||||
<th>{l s='Unit price tax excluded'}</th>
|
||||
<th>{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=$id_default_currency}
|
||||
{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)}
|
||||
{if $asc->id_currency}
|
||||
{assign var=id_currency value=$asc->id_currency}
|
||||
{/if}
|
||||
{/if}
|
||||
{/foreach}
|
||||
<tr {if $index is odd}class="alt_row"{/if}>
|
||||
<td>{$product_designation[$attribute['id_product_attribute']]}</td>
|
||||
<td>
|
||||
<input type="text" value="{$reference|escape:'htmlall':'UTF-8'}" name="supplier_reference_{$attribute['id_product']}_{$attribute['id_product_attribute']}_{$supplier->id_supplier}" />
|
||||
</td>
|
||||
<td>
|
||||
<input type="text" value="{$price_te|htmlentities}" 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>
|
||||
</div>
|
||||
</div>
|
||||
{/foreach}
|
||||
</div>
|
||||
{/if}
|
||||
@@ -23,18 +23,31 @@
|
||||
* 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}">
|
||||
<textarea id="{$input_name}_{$language.id_lang}"
|
||||
{foreach from=$languages item=language}
|
||||
<div class="row translatable-field lang-{$language.id_lang}">
|
||||
<div class="col-lg-10">
|
||||
<textarea
|
||||
id="{$input_name}_{$language.id_lang}"
|
||||
name="{$input_name}_{$language.id_lang}"
|
||||
class="autoload_rte" >{if isset($input_value[$language.id_lang])}{$input_value[$language.id_lang]|htmlentitiesUTF8}{/if}
|
||||
class="autoload_rte" >
|
||||
{if isset($input_value[$language.id_lang])}{$input_value[$language.id_lang]|htmlentitiesUTF8}{/if}
|
||||
</textarea>
|
||||
<span class="counter" max="{if isset($max)}{$max}{else}none{/if}"></span>
|
||||
<span class="help-block">{$hint|default:''}</span>
|
||||
</div>
|
||||
{/foreach}
|
||||
<div class="col-lg-2">
|
||||
<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown">
|
||||
<img src="{$base_url}/img/l/{$language.id_lang|intval}.jpg" alt="">
|
||||
{$language.iso_code}
|
||||
<span class="caret"></span>
|
||||
</button>
|
||||
<ul class="dropdown-menu">
|
||||
{foreach from=$languages item=language}
|
||||
<li><a href="javascript:hideOtherLanguage({$language.id_lang});"><img src="{$base_url}/img/l/{$language.id_lang|intval}.jpg" alt=""> {$language.iso_code}</a></li>
|
||||
{/foreach}
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<span class="counter" max="{if isset($max)}{$max}{else}none{/if}"></span>
|
||||
{/foreach}
|
||||
|
||||
<script type="text/javascript">
|
||||
var iso = '{$iso_tiny_mce}';
|
||||
|
||||
Reference in New Issue
Block a user