Merge branch 'development' of https://github.com/PrestaShop/PrestaShop into bootstrap

Conflicts:
	admin-dev/themes/default/template/controllers/customer_threads/message.tpl
	admin-dev/themes/default/template/controllers/customers/helpers/view/view.tpl
	admin-dev/themes/default/template/controllers/import/helpers/form/form.tpl
	admin-dev/themes/default/template/controllers/modules/favorites.tpl
	admin-dev/themes/default/template/controllers/modules/list.tpl
	admin-dev/themes/default/template/controllers/modules/tab_module_line.tpl
	admin-dev/themes/default/template/controllers/modules_positions/list_modules.tpl
	admin-dev/themes/default/template/controllers/orders/_print_pdf_icon.tpl
	admin-dev/themes/default/template/controllers/orders/form.tpl
	admin-dev/themes/default/template/controllers/orders/helpers/view/view.tpl
	admin-dev/themes/default/template/controllers/products/associations.tpl
	admin-dev/themes/default/template/controllers/products/combinations.tpl
	admin-dev/themes/default/template/controllers/products/images.tpl
	admin-dev/themes/default/template/controllers/products/informations.tpl
	admin-dev/themes/default/template/controllers/products/prices.tpl
	admin-dev/themes/default/template/controllers/referrers/helpers/view/view.tpl
	admin-dev/themes/default/template/header.tpl
	admin-dev/themes/default/template/helpers/form/form.tpl
	admin-dev/themes/default/template/helpers/list/list_header.tpl
	classes/ProductSale.php
	classes/helper/HelperList.php
	controllers/admin/AdminCmsController.php
	controllers/admin/AdminCustomersController.php
	controllers/admin/AdminMetaController.php
	controllers/admin/AdminModulesController.php
	controllers/admin/AdminPerformanceController.php
	controllers/admin/AdminProductsController.php
	controllers/front/ParentOrderController.php
	install-dev/theme/views/welcome.phtml
	modules/blocknewproducts/blocknewproducts.php
	modules/blocktopmenu/blocktopmenu.php
	modules/importerosc/importerosc.php
	modules/mailalerts/mailalerts.php
	modules/shopimporter/shopimporter.php
	modules/statsstock/statsstock.php
	themes/default/css/product_list.css
This commit is contained in:
Kevin Granger
2013-11-04 14:43:01 +01:00
169 changed files with 2783 additions and 1759 deletions
+6 -14
View File
@@ -22,26 +22,18 @@
$upload->setInvalidFileExt(explode(",", CONFIG_UPLOAD_INVALID_EXTS));
if(CONFIG_SYS_VIEW_ONLY || !CONFIG_OPTIONS_UPLOAD)
{
$error = SYS_DISABLED;
}
elseif(empty($_GET['folder']) || !isUnderRoot($_GET['folder']))
{
$error = ERR_FOLDER_PATH_NOT_ALLOWED;
}else if(!$upload->isFileUploaded('file'))
{
elseif (!$upload->isFileUploaded('file'))
$error = ERR_FILE_NOT_UPLOADED;
}else if(!$upload->moveUploadedFile($_GET['folder']))
{
$error = ERR_FILE_MOVE_FAILED;
}
elseif(!$upload->isPermittedFileExt(explode(",", CONFIG_UPLOAD_VALID_EXTS)))
{
elseif (!$upload->isPermittedFileExt(explode(",", CONFIG_UPLOAD_VALID_EXTS)))
$error = ERR_FILE_TYPE_NOT_ALLOWED;
}elseif(defined('CONFIG_UPLOAD_MAXSIZE') && CONFIG_UPLOAD_MAXSIZE && $upload->isSizeTooBig(CONFIG_UPLOAD_MAXSIZE))
{
elseif (defined('CONFIG_UPLOAD_MAXSIZE') && CONFIG_UPLOAD_MAXSIZE && $upload->isSizeTooBig(CONFIG_UPLOAD_MAXSIZE))
$error = sprintf(ERROR_FILE_TOO_BID, transformFileSize(CONFIG_UPLOAD_MAXSIZE));
}else
elseif (!$upload->moveUploadedFile($_GET['folder']))
$error = ERR_FILE_MOVE_FAILED;
else
{
include_once(CLASS_FILE);
$path = $upload->getFilePath();
@@ -24,7 +24,8 @@
if(!empty($_GET['search']))
{
include_once(CLASS_SEARCH);
if (!preg_match('/^'.Tools::pRegexp(realpath(dirname(__FILE__).'/'.$_GET['search_folder']), '/').'/i', _PS_ROOT_DIR_.'/img/cms'))
exit;
$search = new Search($_GET['search_folder']);
$search->addSearchKeyword('recursive', @$_GET['search_recursively']);
$search->addSearchKeyword('mtime_from', @$_GET['search_mtime_from']);
@@ -78,9 +78,9 @@
define('CONFIG_EDITABLE_VALID_EXTS', 'txt,htm,html,xml,js,css'); //make you include all these extension in CONFIG_UPLOAD_VALID_EXTS if you want all valid
define('CONFIG_OVERWRITTEN', false); //overwirte when processing paste
define('CONFIG_UPLOAD_VALID_EXTS', 'gif,jpg,png');// //
define('CONFIG_UPLOAD_VALID_EXTS', 'gif,jpg,jpeg,png');// //
//define('CONFIG_UPLOAD_VALID_EXTS', 'gif,jpg,png,bmp,tif,zip,sit,rar,gz,tar,htm,html,mov,mpg,avi,asf,mpeg,wmv,aif,aiff,wav,mp3,swf,ppt,rtf,doc,pdf,xls,txt,xml,xsl,dtd');//
define("CONFIG_VIEWABLE_VALID_EXTS", 'gif,jpg,png');
define("CONFIG_VIEWABLE_VALID_EXTS", 'gif,jpg,jpeg,jpeg,png');
//define('CONFIG_UPLOAD_VALID_EXTS', 'gif,jpg,png,txt'); //
define('CONFIG_UPLOAD_INVALID_EXTS', '');
+3
View File
@@ -10,6 +10,9 @@
//FILESYSTEM CONFIG <br>
require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . "class.auth.php");
if (_PS_MODE_DEMO_)
die('This functionality has been disabled.');
define('CONFIG_QUERY_STRING_ENABLE', true); //Enable passed query string to setting the system configuration
if(!isset($_SESSION))
{
@@ -73,9 +73,9 @@
define('CONFIG_EDITABLE_VALID_EXTS', 'txt,htm,html,xml,js,css'); //make you include all these extension in CONFIG_UPLOAD_VALID_EXTS if you want all valid
define('CONFIG_OVERWRITTEN', false); //overwirte when processing paste
define('CONFIG_UPLOAD_VALID_EXTS', 'gif,jpg,png,txt'); //
define('CONFIG_UPLOAD_VALID_EXTS', 'gif,jpg,jpeg,png,txt'); //
//define('CONFIG_UPLOAD_VALID_EXTS', 'gif,jpg,png,bmp,tif,zip,sit,rar,gz,tar,htm,html,mov,mpg,avi,asf,mpeg,wmv,aif,aiff,wav,mp3,swf,ppt,rtf,doc,pdf,xls,txt,xml,xsl,dtd');//
define("CONFIG_VIEWABLE_VALID_EXTS", 'gif,bmp,txt,jpg,png,tif,html,htm,js,css,xml,xsl,dtd,mp3,wav,wmv,wma,rm,rmvb,mov,swf');
define("CONFIG_VIEWABLE_VALID_EXTS", 'gif,bmp,txt,jpg,jpeg,png,tif,html,htm,js,css,xml,xsl,dtd,mp3,wav,wmv,wma,rm,rmvb,mov,swf');
//define('CONFIG_UPLOAD_VALID_EXTS', 'gif,jpg,png,txt'); //
define('CONFIG_UPLOAD_INVALID_EXTS', '');
@@ -53,12 +53,12 @@
{/if}
<dl class="dl-horizontal">
<dt>{l s='Sent on:'}</dt>
<dd>{$message.date_add}</dd>
<dd>{$message.date_add}&nbsp;</dd>
</dl>
{if empty($message.id_employee)}
<dl class="dl-horizontal">
<dt>{l s='Browser:'}</dt>
<dd>{$message.user_agent}</dd>
<dd>{$message.user_agent}&nbsp;</dd>
</dl>
{/if}
{if !empty($message.file_name) && $file_name}
@@ -72,33 +72,26 @@
</dd>
</dl>
{/if}
{if !empty($message.id_order) && empty($message.id_employee)}
<dl class="dl-horizontal">
{if !empty($message.id_order) && $is_valid_order_id && empty($message.id_employee)}
<dl>
<dt>{l s='Order #'}</dt>
<dd>
<a href="index.php?tab=AdminOrders&id_order={$message.id_order}&vieworder&token={getAdminToken tab='AdminOrders'}" title="{l s='View order'}">
{$message.id_order} <i class="icon-search"></i>
</a>
<dd><a href="index.php?tab=AdminOrders&id_order={$message.id_order}&vieworder&token={getAdminToken tab='AdminOrders'}" title="{l s='View order'}">{$message.id_order} <img src="../img/admin/search.gif" alt="{l s='View'}" /></a>
</dd>
</dl>
{/if}
{if !empty($message.id_product) && empty($message.id_employee)}
<dl class="dl-horizontal">
<dt>{l s='Product #'}</dt>
<dd>
<a href="index.php?tab=AdminProducts&id_product={$message.id_product}&updateproduct&token={getAdminToken tab='AdminProducts'}" title="{l s='View order'}">
{$message.id_product} <i class="icon-search"></i>
</a>
</dd>
<dd><a href="index.php?tab=AdminProducts&id_product={$message.id_product}&updateproduct&token={getAdminToken tab='AdminProducts'}" title="{l s='View order'}">{$message.id_product} <img src="../img/admin/search.gif" alt="{l s='View'}" /></a></dd>
</dl>
{/if}
<form action="{$current}&token={$token}&id_customer_thread={$message.id_customer_thread}&viewcustomer_thread" method="post" class="form-horizontal">
<dl class="dl-horizontal">
<dt> {l s='Subject:'}</dt>
<form class="form-horizontal" action="{$current}&token={$token}&id_customer_thread={$message.id_customer_thread}&viewcustomer_thread" method="post">
<input type="hidden" name="id_customer_message" value="{$message.id_customer_message}" />
<dl>
<dt>{l s='Subject:'}</dt>
<dd>
<input type="hidden" name="id_customer_message" value="{$message.id_customer_message}" />
<select name="id_contact" onchange="this.form.submit();" class="col-lg-3">
<select name="id_contact" onchange="this.form.submit();">
{foreach $contacts as $contact}
<option value="{$contact.id_contact}" {if $contact.id_contact == $message.id_contact}selected="selected"{/if}>
{$contact.name}
@@ -200,4 +193,4 @@
</form>
</div>
</div>
{/if}
{/if}
@@ -26,7 +26,6 @@
{extends file="helpers/view/view.tpl"}
{block name="override_tpl"}
<script type="text/javascript">
function saveCustomerNote()
{
@@ -26,7 +26,7 @@
<div class="leadin">{block name="leadin"}{/block}</div>
{if $module_confirmation}
<div class="module_confirmation conf confirm">
{l s='Your .CSV file has been sucessfully imported into your shop.'}
{l s='Your .CSV file has been sucessfully imported into your shop. Don\'t forget to Re-build the products search index.'}
</div>
{/if}
<div style="display: none">
@@ -118,6 +118,7 @@
<a class="list-group-item" href="../docs/csv_import/addresses_import.csv" target="_blank">{l s='Sample Addresses file'}</a>
<a class="list-group-item" href="../docs/csv_import/manufacturers_import.csv" target="_blank">{l s='Sample Manufacturers file'}</a>
<a class="list-group-item" href="../docs/csv_import/suppliers_import.csv" target="_blank">{l s='Sample Suppliers file'}</a>
<a class="list-group-item" href="../docs/csv_import/alias_import.csv" target="_blank">{l s='Sample Alias file'}</a>
{if $PS_ADVANCED_STOCK_MANAGEMENT}
<a class="list-group-item" href="../docs/csv_import/supply_orders_import.csv" target="_blank">{l s='Supply Orders sample file'}</a>
<a class="list-group-item" href="../docs/csv_import/supply_orders_details_import.csv" target="_blank">{l s='Supply Orders Details sample file'}</a>
@@ -291,30 +292,35 @@
});
$("select#entity").change(function(){
if ($("#entity > option:selected").val() == 7 || $("#entity > option:selected").val() == 8)
if ($("#entity > option:selected").val() == 8 || $("#entity > option:selected").val() == 9)
$("label[for=truncate],#truncate").hide();
else
$("label[for=truncate],#truncate").show();
if ($("#entity > option:selected").val() == 8)
{
if ($("#entity > option:selected").val() == 9)
$(".import_supply_orders_details").show();
$('input[name=multiple_value_separator]').val('|');
}
else
{
$(".import_supply_orders_details").hide();
$('input[name=multiple_value_separator]').val('{if isset($multiple_value_separator_selected)}{$multiple_value_separator_selected}{else},{/if}');
}
if ($("#entity > option:selected").val() == 1)
$("label[for=match_ref], #match_ref, label[for=regenerate], #regenerate").show();
$("label[for=match_ref], #match_ref").show();
else
$("label[for=match_ref], #match_ref, label[for=regenerate], #regenerate").hide();
$("label[for=match_ref], #match_ref").hide();
if ($("#entity > option:selected").val() == 1 || $("#entity > option:selected").val() == 0)
$(".import_products_categories, label[for=regenerate], #regenerate").show();
$(".import_products_categories").show();
else
$(".import_products_categories, label[for=regenerate], #regenerate").hide();
if ($("#entity > option:selected").val() == 0 || $("#entity > option:selected").val() == 1 || $("#entity > option:selected").val() == 3 || $("#entity > option:selected").val() == 5 || $("#entity > option:selected").val() == 6)
$(".import_products_categories").hide();
if ($("#entity > option:selected").val() == 0 || $("#entity > option:selected").val() == 1 ||
$("#entity > option:selected").val() == 5 || $("#entity > option:selected").val() == 6)
$("label[for=regenerate], #regenerate").show()
else
$("label[for=regenerate], #regenerate").hide();
if ($("#entity > option:selected").val() == 0 || $("#entity > option:selected").val() == 1 || $("#entity > option:selected").val() == 3 || $("#entity > option:selected").val() == 5 || $("#entity > option:selected").val() == 6 || $("#entity > option:selected").val() == 7)
$("label[for=forceIDs], #forceIDs").show();
else
$("label[for=forceIDs], #forceIDs").hide();
@@ -96,14 +96,14 @@
</td>
<td>
<select name="i_{$module->name}" class="moduleFavorite">
<option value="" selected="selected">---</option>
<option value="" selected="selected">-</option>
<option value="1" {if isset($module->preferences.interest) && $module->preferences.interest eq '1'}selected="selected"{/if}>{l s='Yes'}</option>
<option value="0" {if isset($module->preferences.interest) && $module->preferences.interest eq '0'}selected="selected"{/if}>{l s='No'}</option>
</select>
</td>
<td>
<select name="f_{$module->name}" class="moduleFavorite">
<option value="" selected="selected">---</option>
<option value="" selected="selected">-</option>
<option value="1" {if isset($module->preferences.favorite) && $module->preferences.favorite eq '1'}selected="selected"{/if}>{l s='Yes'}</option>
<option value="0" {if isset($module->preferences.favorite) && $module->preferences.favorite eq '0'}selected="selected"{/if}>{l s='No'}</option>
</select>
@@ -69,10 +69,7 @@
<div class="module_name">
<span style="display:none">{$module->name}</span>
{$module->displayName}
<small>v{$module->version}</small>
{if isset($module->type) && $module->type == 'addonsMustHave'}
<span class="label label-info">{l s='Must Have'}</span>
{elseif isset($module->id) && $module->id gt 0}
@@ -86,20 +83,7 @@
{else}
<span class="label label-warning">{l s='Not installed'}</span>
{/if}
<!-- {if isset($module->id) && $module->id gt 0}
<span class="label label-success{if isset($module->active) && $module->active eq 0} off{/if}">{l s='Installed'}</span>
{else}
<span class="label label-warning">{l s='Not installed'}</span>
{/if} -->
</div>
<!-- <p class="text-muted">
{if isset($module->author) && !empty($module->author)}
{l s='Developed by'} {$module->author|truncate:20:'...'}
{/if}
{if isset($module->version_addons)}
({l s='Update'} {$module->version_addons} {l s='Available on PrestaShop Addons'})
{/if}
</p> -->
<p class="module_description">
{if isset($module->description) && $module->description ne ''}
{$module->description}
@@ -38,7 +38,7 @@
<span>
<select id="show_modules" onChange="autoUrl('show_modules', '{$url_show_modules}')" class="filter fixed-width-lg">
<option value="all">{l s='All modules'}&nbsp;</option>
<option>---------------</option>
<option>-</option>
{foreach $modules as $module}
<option value="{$module->id|intval}" {if $display_key == $module->id}selected="selected"{/if}>{$module->displayName}</option>
{/foreach}
@@ -51,7 +51,6 @@
</label>
</p>
</form>
<div id="modulePosition">
<form method="post" action="{$url_submit}" >
@@ -196,4 +195,4 @@
}
});
});
</script>
</script>
@@ -39,4 +39,4 @@
<i class="icon-truck"></i>
</a>
{/if}
</span>
</span>
@@ -689,7 +689,7 @@
var id_product = Number(this.id_product);
var id_product_attribute = Number(this.id_product_attribute);
cart_quantity[Number(this.id_product)+'_'+Number(this.id_product_attribute)+'_'+Number(this.id_customization)] = this.cart_quantity;
cart_content += '<tr><td><img src="'+this.image_link+'" title="'+this.name+'" /></td><td>'+this.name+'<br />'+this.attributes_small+'</td><td>'+this.reference+'</td><td><input type="text" rel="'+this.id_product+'_'+this.id_product_attribute+'" class="product_unit_price" value="' + formatCurrency(parseFloat(this.price.replace(',', '.')), currency_format, currency_sign, currency_blank) + '" /></td><td>';
cart_content += '<tr><td><img src="'+this.image_link+'" title="'+this.name+'" /></td><td>'+this.name+'<br />'+this.attributes_small+'</td><td>'+this.reference+'</td><td><input type="text" rel="'+this.id_product+'_'+this.id_product_attribute+'" class="product_unit_price" value="' + this.numeric_price + '" /></td><td>';
cart_content += (!this.id_customization ? '<div class="input-group fixed-width-md"><div class="input-group-btn"><a href="#" class="btn btn-default increaseqty_product" rel="'+this.id_product+'_'+this.id_product_attribute+'_'+(this.id_customization ? this.id_customization : 0)+'" ><i class="icon-caret-up"></i></a><a href="#" class="btn btn-default decreaseqty_product" rel="'+this.id_product+'_'+this.id_product_attribute+'_'+(this.id_customization ? this.id_customization : 0)+'"><i class="icon-caret-down"></i></a></div>' : '');
cart_content += (!this.id_customization ? '<input type="text" rel="'+this.id_product+'_'+this.id_product_attribute+'_'+(this.id_customization ? this.id_customization : 0)+'" class="cart_quantity" value="'+this.cart_quantity+'" />' : '');
cart_content += (!this.id_customization ? '<div class="input-group-btn"><a href="#" class="delete_product btn btn-default" rel="delete_'+this.id_product+'_'+this.id_product_attribute+'_'+(this.id_customization ? this.id_customization : 0)+'" ><i class="icon-remove text-danger"></i></a></div></div>' : '');
@@ -748,6 +748,16 @@
$('#payment_list').html(payment_list);
}
function fixPriceFormat(price)
{
if(price.indexOf(',') > 0 && price.indexOf('.') > 0) // if contains , and .
if(price.indexOf(',') < price.indexOf('.')) // if , is before .
price = price.replace(',',''); // remove ,
price = price.replace(' ',''); // remove any spaces
price = price.replace(',','.'); // remove , if price did not cotain both , and .
return price;
}
function displaySummary(jsonSummary)
{
currency_format = jsonSummary.currency.format;
@@ -783,13 +793,13 @@
if (!changed_shipping_price)
$('#shipping_price').html('<b>' + formatCurrency(parseFloat(jsonSummary.summary.total_shipping), currency_format, currency_sign, currency_blank) + '</b>');
shipping_price_selected_carrier = jsonSummary.summary.total_shipping;
$('#total_vouchers').html(formatCurrency(parseFloat(jsonSummary.summary.total_discounts_tax_exc.replace(',', '.')), currency_format, currency_sign, currency_blank));
$('#total_shipping').html(formatCurrency(parseFloat(jsonSummary.summary.total_shipping_tax_exc.replace(',', '.')), currency_format, currency_sign, currency_blank));
$('#total_taxes').html(formatCurrency(parseFloat(jsonSummary.summary.total_tax.replace(',', '.')), currency_format, currency_sign, currency_blank));
$('#total_without_taxes').html(formatCurrency(parseFloat(jsonSummary.summary.total_price_without_tax.replace(',', '.')), currency_format, currency_sign, currency_blank));
$('#total_with_taxes').html(formatCurrency(parseFloat(jsonSummary.summary.total_price.replace(',', '.')), currency_format, currency_sign, currency_blank));
$('#total_products').html(formatCurrency(parseFloat(jsonSummary.summary.total_products.replace(',', '.')), currency_format, currency_sign, currency_blank));
$('#total_vouchers').html(formatCurrency(parseFloat(fixPriceFormat(jsonSummary.summary.total_discounts_tax_exc)), currency_format, currency_sign, currency_blank));
$('#total_shipping').html(formatCurrency(parseFloat(fixPriceFormat(jsonSummary.summary.total_shipping_tax_exc)), currency_format, currency_sign, currency_blank));
$('#total_taxes').html(formatCurrency(parseFloat(fixPriceFormat(jsonSummary.summary.total_tax)), currency_format, currency_sign, currency_blank));
$('#total_without_taxes').html(formatCurrency(parseFloat(fixPriceFormat(jsonSummary.summary.total_price_without_tax)), currency_format, currency_sign, currency_blank));
$('#total_with_taxes').html(formatCurrency(parseFloat(fixPriceFormat(jsonSummary.summary.total_price)), currency_format, currency_sign, currency_blank));
$('#total_products').html(formatCurrency(parseFloat(fixPriceFormat(jsonSummary.summary.total_products)), currency_format, currency_sign, currency_blank));
id_currency = jsonSummary.cart.id_currency;
$('#id_currency option').removeAttr('selected');
$('#id_currency option[value="'+id_currency+'"]').attr('selected', true);
@@ -65,29 +65,27 @@
<div class="row">
<div class="col-lg-3 box-stats color3" >
<i class="icon-calendar-empty"></i>
<span class="title">{l s='Date'}<br /><small>sous-titre</small></span>
<span class="title">{l s='Date'}<br /><small>{l s='subtitle'}</small></span>
<span class="value">{dateFormat date=$order->date_add full=false}</span>
</div>
<div class="col-lg-3 box-stats color2" >
<i class="icon-comments"></i>
<span class="title">{l s='Messages'}<br /><small>sous-titre</small></span>
<!-- <span class="value">{sizeof($messages)}</span> -->
<span class="title">{l s='Messages'}<br /><small>{l s='subtitle'}</small></span>
<span class="value"><a href="{$link->getAdminLink('AdminCustomerThreads')|escape:'htmlall':'UTF-8'}">{sizeof($customer_thread_message)}</a></span>
</div>
<div class="col-lg-3 box-stats color1" >
<i class="icon-ok"></i>
<span class="title">{l s='Products'}<br /><small>sous-titre</small></span>
<span class="title">{l s='Products'}<br /><small>{l s='subtitle'}</small></span>
<span class="value">{sizeof($products)}</span>
</div>
<div class="col-lg-3 box-stats color4" >
<i class="icon-money"></i>
<span class="title">{l s='Total'}<br /><small>sous-titre</small></span>
<span class="title">{l s='Total'}<br /><small>{l s='subtitle'}</small></span>
<span class="value">{displayPrice price=$order->total_paid_tax_incl currency=$currency->id}</span>
</div>
</div>
</div>
<!-- Todo : Be smart and find the best place for Admin order hook -->
{hook h="displayAdminOrder" id_order=$order->id}
<div class="row">
@@ -534,7 +532,7 @@
<label class="control-label col-lg-3">{l s='Choose a standard message'}</label>
<div class="col-lg-9">
<select name="order_message" id="order_message" onchange="orderOverwriteMessage(this, '{l s='Do you want to overwrite your existing message?'}')">
<option value="0" selected="selected">--</option>
<option value="0" selected="selected">-</option>
{foreach from=$orderMessages item=orderMessage}
<option value="{$orderMessage['message']|escape:'htmlall':'UTF-8'}">{$orderMessage['name']}</option>
{/foreach}
@@ -852,10 +850,6 @@
</div>
</div>
<form class="container-command-top-spacing" action="{$current_index}&vieworder&token={$smarty.get.token}&id_order={$order->id}" method="post" onsubmit="return orderDeleteProduct('{l s='This product cannot be returned.'}', '{l s='Quantity to cancel is greater than quantity available.'}');">
<input type="hidden" name="id_order" value="{$order->id}" />
<div style="display: none">
@@ -1114,8 +1108,6 @@
</div>
</form>
{if (sizeof($messages))}
<div class="panel">
<h3>
@@ -92,16 +92,16 @@
<label class="control-label col-lg-3" for="id_manufacturer">{l s='Manufacturer:'}</label>
<div class="col-lg-5">
<select name="id_manufacturer" id="id_manufacturer">
<option value="0">-- {l s='Choose (optional)'} --</option>
<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>
<option disabled="disabled">-</option>
</select>
</div>
<div class="col-lg-4">
<a class="btn btn-link bt-icon confirm_leave" style="margin-bottom:0" href="{$link->getAdminLink('AdminManufacturers')|escape:'htmlall':'UTF-8'}&addmanufacturer">
<i class="icon-plus-sign"></i> {l s='Create new manufacturer'} <i class="icon-external-link-sign"></i>
<i class="icon-plus-sign"></i> {l s='Create new manufacturer'} <i class="icon-external-link-sign"></i>
</a>
</div>
</div>
@@ -24,14 +24,12 @@
*}
{if isset($product->id) && !$product->is_virtual}
<div class="panel">
<script type="text/javascript">
var msg_combination_1 = '{l s='Please choose an attribute.'}';
var msg_combination_2 = '{l s='Please choose a value.'}';
var msg_combination_3 = '{l s='You can only add one combination per attribute type.'}';
var msg_new_combination = '{l s='New combination'}';
var msg_cancel_combination = '{l s='Cancel combination'}';
var attrs = new Array();
var modifyattributegroup = "{l s='Modify this attribute combination.' js=1}";
attrs[0] = new Array(0, "---");
@@ -43,10 +41,8 @@
{/foreach}
);
{/foreach}
$(document).ready(function(){
populate_attrs();
$(".datepicker").datepicker({
prevText: '',
nextText: '',
@@ -54,14 +50,11 @@
});
});
</script>
<input type="hidden" name="submitted_tabs[]" value="Combinations" />
<h3>{l s='Add or modify combinations for this product.'}</h3>
<div class="alert alert-info">
{l s='Or use the'}&nbsp;<a class="btn btn-link bt-icon confirm_leave" href="index.php?tab=AdminAttributeGenerator&id_product={$product->id}&attributegenerator&token={$token_generator}"><i class="icon-magic"></i> {l s='Product combinations generator'} <i class="icon-external-link-sign"></i></a> {l s='in order to automatically create a set of combinations.'}
</div>
{if $combination_exists}
<div class="alert alert-info" style="display:block">
{l s='Some combinations already exist. If you want to generate new combinations, the quantities for the existing combinations will be lost.'}<br/>
@@ -72,11 +65,8 @@
<br />
{include file="controllers/products/multishop/check_fields.tpl" product_tab="Combinations"}
{/if}
<div id="add_new_combination" class="panel" style="display: none;">
<div class="panel-heading">{l s='Add or modify combinations for this product.'}</div>
<div class="form-group">
<label class="control-label col-lg-3" for="attribute_group">{l s='Attribute:'}</label>
<div class="col-lg-5">
@@ -89,14 +79,13 @@
</select>
</div>
</div>
<div class="row">
<label class="control-label col-lg-3" for="attribute">{l s='Value:'}</label>
<div class="col-lg-9">
<div class="form-group">
<div class="col-lg-8">
<select name="attribute" id="attribute">
<option value="0">---</option>
<option value="0">-</option>
</select>
</div>
<div class="col-lg-4">
@@ -113,9 +102,7 @@
</div>
</div>
</div>
<hr/>
<div class="form-group">
<label class="control-label col-lg-3" for="attribute_reference">
<span class="label-tooltip" data-toggle="tooltip"
@@ -126,8 +113,7 @@
<div class="col-lg-5">
<input type="text" id="attribute_reference" name="attribute_reference" value="" />
</div>
</div>
</div>
<div class="form-group">
<label class="control-label col-lg-3" for="attribute_ean13">
{l s='EAN13:'}
@@ -135,8 +121,7 @@
<div class="col-lg-3">
<input maxlength="13" type="text" id="attribute_ean13" name="attribute_ean13" value="" />
</div>
</div>
</div>
<div class="form-group">
<label class="control-label col-lg-3" for="attribute_upc">
{l s='UPC:'}
@@ -144,10 +129,8 @@
<div class="col-lg-3">
<input maxlength="12" type="text" id="attribute_upc" name="attribute_upc" value="" />
</div>
</div>
</div>
<hr/>
<div class="form-group">
<label class="control-label col-lg-3" for="attribute_wholesale_price">
{include file="controllers/products/multishop/checkbox.tpl" field="attribute_wholesale_price" type="default"}
@@ -165,7 +148,6 @@
</div>
<span style="display:none;" id="attribute_wholesale_price_full">({l s='Overrides wholesale price on "Information" tab'})</span>
</div>
<div class="form-group">
<label class="control-label col-lg-3" for="attribute_price_impact">
{include file="controllers/products/multishop/checkbox.tpl" field="attribute_price_impact" type="attribute_price_impact"}
@@ -223,8 +205,6 @@
</div>
</div>
</div>
<div class="form-group">
<label class="control-label col-lg-3" for="attribute_weight_impact">
{include file="controllers/products/multishop/checkbox.tpl" field="attribute_weight_impact" type="attribute_weight_impact"}
@@ -255,7 +235,6 @@
</div>
</div>
</div>
<div id="tr_unit_impact" class="form-group">
<label class="control-label col-lg-3" for="attribute_unit_impact">
{include file="controllers/products/multishop/checkbox.tpl" field="attribute_unit_impact" type="attribute_unit_impact"}
@@ -284,7 +263,6 @@
</div>
</div>
</div>
{if $ps_use_ecotax}
<div class="form-group">
<label class="control-label col-lg-3" for="attribute_ecotax">
@@ -303,7 +281,6 @@
</div>
</div>
{/if}
<div class="form-group">
<label class="control-label col-lg-3" for="attribute_minimal_quantity">
{include file="controllers/products/multishop/checkbox.tpl" field="attribute_minimal_quantity" type="default"}
@@ -317,7 +294,6 @@
<input maxlength="6" name="attribute_minimal_quantity" id="attribute_minimal_quantity" type="text" value="{$minimal_quantity}" />
</div>
</div>
<div class="form-group">
<label class="control-label col-lg-3" for="available_date_attribute">
{include file="controllers/products/multishop/checkbox.tpl" field="available_date_attribute" type="default"}
@@ -333,9 +309,7 @@
</div>
</div>
</div>
<hr/>
<div class="form-group">
<label class="control-label col-lg-3">{l s='Image:'}</label>
<div class="col-lg-9">
@@ -344,14 +318,13 @@
<li>
<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}">
<img src="{$smarty.const._THEME_PROD_DIR_}{$image.obj->getExistingImgPath()}-small_default.jpg" alt="{$image.legend|escape:'htmlall':'UTF-8'}" title="{$image.legend|escape:'htmlall':'UTF-8'}" />
<img src="{$smarty.const._THEME_PROD_DIR_}{$image.obj->getExistingImgPath()}-{$imageType}.jpg" alt="{$image.legend|escape:'htmlall':'UTF-8'}" title="{$image.legend|escape:'htmlall':'UTF-8'}" />
</label>
</li>
{/foreach}
</ul>
</div>
</div>
<div class="form-group">
<label class="control-label col-lg-3" for="attribute_default">
{include file="controllers/products/multishop/checkbox.tpl" field="attribute_default" type="attribute_default"}
@@ -366,7 +339,6 @@
</p>
</div>
</div>
<div class="panel-footer">
<span id="ResetSpan">
<button type="reset" name="ResetBtn" id="ResetBtn" onclick="$('#desc-product-newCombination').click();" class="btn btn-default">
@@ -377,4 +349,4 @@
</div>
{$list}
</div>
{/if}
{/if}
@@ -33,27 +33,42 @@
</h3>
<div class="row">
<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 class="form-group">
<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-9">
{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 id="progressBarImage" class="progressBarImage"></div>
<div id="showCounter" style="display:none;">
<span id="imageUpload">0</span><span id="imageTotal">0</span>
</div>
<div class="form-group">
<label class="control-label col-lg-3">
{l s='Legend:'}
</label>
<div class="col-lg-9 translatable">
{foreach from=$languages item=language}
<div class="lang_{$language.id_lang}" style="{if !$language.is_default}display: none;{/if} float: left;">
<input class="updateCurrentText" type="text" {if !$product->id}disabled="disabled"{/if} id="legend_{$language.id_lang}" name="legend_{$language.id_lang}" value="{$product->name[$language.id_lang]|escape:'htmlall':'UTF-8'}"/>
<div class="help-block">{l s='Invalid characters:'} <>;=#{}</div>
</div>
{/foreach}
</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>
@@ -61,6 +76,7 @@
<thead>
<tr class="nodrag nodrop">
<th class="fixed-width-sm"><span class="title_box">{l s='Image'}</span></th>
<th class="fixed-width-lg"><span class="title_box">{l s='Legend'}</span></th>
<th class="center fixed-width-xs"><span class="title_box">{l s='Position'}</span></th>
{if $shops}
{foreach from=$shops item=shop}
@@ -79,9 +95,10 @@
<tr id="image_id">
<td>
<a href="{$smarty.const._THEME_PROD_DIR_}image_path.jpg" class="fancybox">
<img src="{$smarty.const._THEME_PROD_DIR_}{$iso_lang}-default-small_default.jpg" alt="image_id" title="image_id" />
<img src="{$smarty.const._THEME_PROD_DIR_}{$iso_lang}-default-{$imageType}.jpg" alt="image_id" title="image_id" />
</a>
</td>
<td>legend</td>
<td id="td_image_id" class="pointer dragHandle center positionImage">
image_position
</td>
@@ -129,7 +146,7 @@
}
else
assoc = false;
imageLine({$image->id}, "{$image->getExistingImgPath()}", {$image->position}, "{if $image->cover}icon-check-sign{else}icon-check-empty{/if}", assoc);
imageLine({$image->id}, "{$image->getExistingImgPath()}", {$image->position}, "{if $image->cover}icon-check-sign{else}icon-check-empty{/if}", assoc, "{$image->legend[$default_language]|@addcslashes:'\"'}");
{/foreach}
{literal}
$("#imageTable").tableDnD(
@@ -149,19 +166,18 @@
}
});
var filecheck = 1;
var uploader = new qq.FileUploader(
var params = new Array;
params['id_product'] = {/literal}{$id_product|intval}{literal};
params['id_category'] = {/literal}{$id_category_default|intval}{literal};
params['token'] = "{/literal}{$token}{literal}";
params['tab'] = "AdminProducts";
params['action'] = "addImage";
params['ajax'] = 1;
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);
@@ -186,7 +202,7 @@
cover = "icon-check-empty";
if (responseJSON.cover == "1")
cover = "icon-check-sign";
imageLine(responseJSON.id, responseJSON.path, responseJSON.position, cover, responseJSON.shops)
imageLine(responseJSON.id, responseJSON.path, responseJSON.position, cover, responseJSON.shops, responseJSON.legend[{/literal}{$default_language|intval}{literal}])
$("#imageTable tr:last").after(responseJSON.html);
$("#countImage").html(parseInt($("#countImage").html()) + 1);
$("#img" + id).remove();
@@ -199,6 +215,12 @@
},
onSubmit: function(id, filename)
{
$('input[id^="legend_"]').each(function()
{
id = $(this).prop("id").replace("legend_", "legend[") + "]";
params[id] = $(this).val();
});
uploader.setParams(params);
$("#imageTable").show();
$("#listImage").append("<li id='img"+id+"'><div>" + filename + "</div></div><a href=\"javascript:delQueue(" + id +");\"><img src=\"../img/admin/disabled.gif\" ></a><p class=\"errorImg\"></p></li>");
}
@@ -286,8 +308,7 @@
"ajax" : 1
});
});
//function
function updateImagePosition(json)
{
doAdminAjax(
@@ -306,13 +327,14 @@
$("#img" + id).remove();
}
function imageLine(id, path, position, cover, shops)
function imageLine(id, path, position, cover, shops, legend)
{
line = $("#lineType").html();
line = line.replace(/image_id/g, id);
line = line.replace(/[a-z]{2}-default-small_default/g, path+'-small_default');
line = line.replace(/image_id/g, legend);
line = line.replace(/[a-z]{0,2}-default-small_default/g, path+'-small_default');
line = line.replace(/image_path/g, path);
line = line.replace(/image_position/g, position);
line = line.replace(/legend/g, legend);
line = line.replace(/icon-check-empty/g, cover);
line = line.replace(/<tbody>/gi, "");
line = line.replace(/<\/tbody>/gi, "");
@@ -330,4 +352,4 @@
{/literal}
</script>
</div>
{/if}
{/if}
@@ -429,6 +429,17 @@
<div class="row">
{/if}
{foreach from=$languages item=language}
{literal}
<script type="text/javascript">
$().ready(function () {
var input_id = '{/literal}tags_{$language.id_lang}{literal}';
$('#'+input_id).tagify({delimiters: [13,44], addTagPrompt: '{/literal}{l s='Add tag' js=1}{literal}'});
$({/literal}'#{$table}{literal}_form').submit( function() {
$(this).find('#'+input_id).val($('#'+input_id).tagify('serialize'));
});
});
</script>
{/literal}
{if $languages|count > 1}
<div class="translatable-field lang-{$language.id_lang}">
<div class="col-lg-9">
@@ -444,7 +444,7 @@ $(document).ready(function () {
</div>
<div class="col-lg-6">
<select name="sp_reduction_type" id="sp_reduction_type">
<option selected="selected">---</option>
<option selected="selected">-</option>
<option value="amount">{l s='Amount'}</option>
<option value="percentage">{l s='Percentage'}</option>
</select>
@@ -453,7 +453,6 @@ $(document).ready(function () {
</div>
<p class="help-block">{l s='The discount is applied after the tax'}</p>
</div>
</div>
</div>
<script type="text/javascript">
@@ -58,6 +58,7 @@
$('#file_missing').hide();
$('#virtual_product_name').attr('value', fileName);
$("#upload-confirmation .error").remove();
$('#upload-confirmation div').find('span').remove()
$('#upload-confirmation div').prepend('<span>{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 + '" /></span>');
$("#upload-confirmation").show();
@@ -112,7 +112,7 @@
<label class="control-label col-lg-3">{l s='Filter by product:'}</label>
<div class="col-lg-9">
<select id="selectProduct" name="selectProduct" style="width: 200px;" onfocus="fillProducts();" onchange="updateConversionRate(this.value);">
<option value="0" selected="selected">-- {l s='All'} --</option>
<option value="0" selected="selected">- {l s='All'} -</option>
</select>
</div>
</div>
@@ -127,6 +127,4 @@
<script type="text/javascript">
updateConversionRate(0);
</script>
{/block}
+9 -9
View File
@@ -44,14 +44,14 @@
var roundMode = {$round_mode};
{if isset($shop_context)}
{if $shop_context == Shop::CONTEXT_ALL}
var youEditFieldFor = "{l s='A modification of this field will be applied for all shops' slashes=1 }";
var youEditFieldFor = '{l s='A modification of this field will be applied for all shops' slashes=1}';
{elseif $shop_context == Shop::CONTEXT_GROUP}
var youEditFieldFor = "{l s='A modification of this field will be applied for all shops of group ' slashes=1 }<b>{$shop_name}</b>";
var youEditFieldFor = '{l s='A modification of this field will be applied for all shops of group' slashes=1}<b>{$shop_name}</b>';
{else}
var youEditFieldFor = "{l s='A modification of this field will be applied for the shop ' slashes=1 }<b>{$shop_name}</b>";
var youEditFieldFor = '{l s='A modification of this field will be applied for the shop' slashes=1}<b>{$shop_name}</b>';
{/if}
{else}
var youEditFieldFor = '';
{else}
var youEditFieldFor = '';
{/if}
{* Notifications vars *}
var autorefresh_notifications = '{$autorefresh_notifications}';
@@ -66,12 +66,12 @@
var new_msg = '{l s='A new message posted on your shop.' slashes=1}';
var excerpt_msg = '{l s='Excerpt: ' slashes=1}';
var see_msg = '{l s='Read this message' slashes=1}';
var token_admin_orders = '{getAdminToken tab='AdminOrders' slashes=1}';
var token_admin_customers = '{getAdminToken tab='AdminCustomers' slashes=1}';
var token_admin_customer_threads = '{getAdminToken tab='AdminCustomerThreads' slashes=1}';
var token_admin_orders = '{getAdminToken tab='AdminOrders'}';
var token_admin_customers = '{getAdminToken tab='AdminCustomers'}';
var token_admin_customer_threads = '{getAdminToken tab='AdminCustomerThreads'}';
var currentIndex = '{$currentIndex}';
var default_language = '{$default_language|intval}';
var choose_language_translate = "{l s='Choose language' slashes=1}";
var choose_language_translate = '{l s='Choose language' slashes=1}';
var admin_modules_link = '{$link->getAdminLink("AdminModules")|addslashes}';
var tab_modules_list = '{if isset($tab_modules_list) && $tab_modules_list}{$tab_modules_list|addslashes}{/if}';
</script>
@@ -178,8 +178,7 @@
<script type="text/javascript">
$().ready(function () {
var input_id = '{/literal}{if isset($input.id)}{$input.id}{else}{$input.name}{/if}{literal}';
$('#'+input_id).tagify();
$('#'+input_id).tagify({delimiters: [13,44],addTagPrompt: '{/literal}{l s='Add tag'}{literal}'});
$('#'+input_id).tagify({delimiters: [13,44], addTagPrompt: '{/literal}{l s='Add tag'}{literal}'});
$({/literal}'#{$table}{literal}_form').submit( function() {
$(this).find('#'+input_id).val($('#'+input_id).tagify('serialize'));
});
@@ -337,7 +336,7 @@
{/if}
>{$option->$input.options.name}</option>
{elseif $option == "-"}
<option value="">--</option>
<option value="">-</option>
{else}
<option value="{$option[$input.options.id]}"
{if isset($input.multiple)}
@@ -24,11 +24,11 @@
*}
{if count($categories) && isset($categories)}
<script type="text/javascript">
var inputName = '{$categories.input_name}';
var inputName = '{$categories.input_name|@addcslashes:'\''}';
var use_radio = {if $categories.use_radio}1{else}0{/if};
var selectedCat = '{implode value=$categories.selected_cat}';
var selectedLabel = '{$categories.trads.selected}';
var home = '{$categories.trads.Root.name}';
var selectedCat = {$categories.selected_cat|@implode|intval};
var selectedLabel = '{$categories.trads.selected|@addcslashes:'\''}';
var home = '{$categories.trads.Root.name|@addcslashes:'\''}';
var use_radio = {if $categories.use_radio}1{else}0{/if};
var use_context = {if isset($categories.use_context)}1{else}0{/if};
$(document).ready(function(){
@@ -256,7 +256,7 @@
{else}
{if $params.type == 'bool'}
<select class="filter fixed-width-sm" onchange="$('#submitFilterButton{$list_id}').focus();$('#submitFilterButton{$list_id}').click();" name="{$list_id}Filter_{$key}">
<option value="">--</option>
<option value="">-</option>
<option value="1" {if $params.value == 1} selected="selected" {/if}>{l s='Yes'}</option>
<option value="0" {if $params.value == 0 && $params.value != ''} selected="selected" {/if}>{l s='No'}</option>
</select>
@@ -278,7 +278,7 @@
{elseif $params.type == 'select'}
{if isset($params.filter_key)}
<select class="filter" onchange="$('#submitFilterButton{$list_id}').focus();$('#submitFilterButton{$list_id}').click();" name="{$list_id}Filter_{$params.filter_key}" {if isset($params.width)} style="width:{$params.width}px"{/if}>
<option value="" {if $params.value == ''} selected="selected" {/if}>--</option>
<option value="" {if $params.value == ''} selected="selected" {/if}>-</option>
{if isset($params.list) && is_array($params.list)}
{foreach $params.list AS $option_value => $option_display}
<option value="{$option_value}" {if (string)$option_display === (string)$params.value || (string)$option_value === (string)$params.value} selected="selected"{/if}>{$option_display}</option>
@@ -83,7 +83,7 @@
btn_submit.hide();
//bind enter key press to validate form
$('#{$table}_form').keypress(function (e) {
if (e.which == 13 && e.target.localName != 'textarea')
if (e.which == 13 && e.target.localName != 'textarea' && !e.target.hasClass('tagify'))
$('#desc-{$table}-save').click();
});
//submit the form