Merge branch 'release' into development

This commit is contained in:
François Gaillard committed 2013-03-14 16:39:47 +01:00
commit e08945de6b
715 files changed
+10968 -19548

No files matched your search

+1 -13
View File
@@ -24,18 +24,6 @@
* International Registered Trademark & Property of PrestaShop SA * International Registered Trademark & Property of PrestaShop SA
*/ */
/* Send the proper status code in HTTP headers */
header('HTTP/1.1 404 Not Found');
header('Status: 404 Not Found');
if (in_array(substr($_SERVER['REQUEST_URI'], -3), array('png', 'jpg', 'gif')))
{
require_once(dirname(__FILE__).'/config/settings.inc.php');
header('Location: '.__PS_BASE_URI__.'img/404.gif');
exit;
}
elseif (in_array(substr($_SERVER['REQUEST_URI'], -3), array('.js', 'css')))
die('');
require_once(dirname(__FILE__).'/config/config.inc.php'); require_once(dirname(__FILE__).'/config/config.inc.php');
Tools::displayFileAsDeprecated();
Controller::getController('PageNotFoundController')->run(); Controller::getController('PageNotFoundController')->run();
+2 -2
View File
@@ -25,8 +25,8 @@
*/ */
define('_PS_ADMIN_DIR_', getcwd()); define('_PS_ADMIN_DIR_', getcwd());
require(dirname(__FILE__).'/../config/config.inc.php'); require(_PS_ADMIN_DIR_.'/../config/config.inc.php');
require(dirname(__FILE__).'/functions.php'); require(_PS_ADMIN_DIR_.'/functions.php');
// For retrocompatibility with "tab" parameter // For retrocompatibility with "tab" parameter
if (!isset($_GET['controller']) && isset($_GET['tab'])) if (!isset($_GET['controller']) && isset($_GET['tab']))
+1 -1
View File
@@ -27,7 +27,7 @@
define('_PS_ADMIN_DIR_', getcwd()); define('_PS_ADMIN_DIR_', getcwd());
include(_PS_ADMIN_DIR_.'/../config/config.inc.php'); include(_PS_ADMIN_DIR_.'/../config/config.inc.php');
/* Getting cookie or logout */ /* Getting cookie or logout */
require_once(dirname(__FILE__).'/init.php'); require_once(_PS_ADMIN_DIR_.'/init.php');
$context = Context::getContext(); $context = Context::getContext();
+1 -1
View File
@@ -27,7 +27,7 @@
define('_PS_ADMIN_DIR_', getcwd()); define('_PS_ADMIN_DIR_', getcwd());
include(_PS_ADMIN_DIR_.'/../config/config.inc.php'); include(_PS_ADMIN_DIR_.'/../config/config.inc.php');
/* Getting cookie or logout */ /* Getting cookie or logout */
require_once(dirname(__FILE__).'/init.php'); require_once(_PS_ADMIN_DIR_.'/init.php');
$query = Tools::getValue('q', false); $query = Tools::getValue('q', false);
if (!$query OR $query == '' OR strlen($query) < 1) if (!$query OR $query == '' OR strlen($query) < 1)
+5 -5
View File
@@ -33,15 +33,15 @@ if (!Context::getContext()->employee->isLoggedBack())
$tabAccess = Profile::getProfileAccess(Context::getContext()->employee->id_profile, Tab::getIdFromClassName('AdminBackup')); $tabAccess = Profile::getProfileAccess(Context::getContext()->employee->id_profile, Tab::getIdFromClassName('AdminBackup'));
if ($tabAccess['view'] !== '1') if ($tabAccess['view'] !== '1')
die (Tools::displayError('You do not have permission to view here')); die (Tools::displayError('You do not have permission to view this.'));
$backupdir = realpath(_PS_ADMIN_DIR_ . '/backups/'); $backupdir = realpath(_PS_ADMIN_DIR_ . '/backups/');
if ($backupdir === false) if ($backupdir === false)
die (Tools::displayError('"Backup" directory does not exist.')); die (Tools::displayError('A "Backup" directory does not exist.'));
if (!$backupfile = Tools::getValue('filename')) if (!$backupfile = Tools::getValue('filename'))
die (Tools::displayError('No file specified')); die (Tools::displayError('No file has been specified.'));
// Check the realpath so we can validate the backup file is under the backup directory // Check the realpath so we can validate the backup file is under the backup directory
$backupfile = realpath($backupdir.'/'.$backupfile); $backupfile = realpath($backupdir.'/'.$backupfile);
@@ -58,7 +58,7 @@ else
$fp = @fopen($backupfile, 'r'); $fp = @fopen($backupfile, 'r');
if ($fp === false) if ($fp === false)
die (Tools::displayError('Unable to open backup file').' "'.addslashes($backupfile).'"'); die (Tools::displayError('Unable to open backup file(s).').' "'.addslashes($backupfile).'"');
// Add the correct headers, this forces the file is saved // Add the correct headers, this forces the file is saved
header('Content-Type: '.$contentType); header('Content-Type: '.$contentType);
@@ -70,4 +70,4 @@ $ret = @fpassthru($fp);
fclose($fp); fclose($fp);
if ($ret === false) if ($ret === false)
die (Tools::displayError('Unable to display backup file').' "'.addslashes($backupfile).'"'); die (Tools::displayError('Unable to display backup file(s).').' "'.addslashes($backupfile).'"');
+2 -2
View File
@@ -25,8 +25,8 @@
*/ */
define('_PS_ADMIN_DIR_', getcwd()); define('_PS_ADMIN_DIR_', getcwd());
require_once(dirname(__FILE__).'/../config/config.inc.php'); require_once(_PS_ADMIN_DIR_.'/../config/config.inc.php');
require_once(dirname(__FILE__).'/init.php'); require_once(_PS_ADMIN_DIR_.'/init.php');
if (isset($_GET['img']) AND Validate::isMd5($_GET['img']) AND isset($_GET['name']) AND Validate::isGenericName($_GET['name']) AND file_exists(_PS_UPLOAD_DIR_.$_GET['img'])) if (isset($_GET['img']) AND Validate::isMd5($_GET['img']) AND isset($_GET['name']) AND Validate::isGenericName($_GET['name']) AND file_exists(_PS_UPLOAD_DIR_.$_GET['img']))
{ {
+1 -1
View File
@@ -25,7 +25,7 @@
*/ */
define('_PS_ADMIN_DIR_', getcwd()); define('_PS_ADMIN_DIR_', getcwd());
include_once(dirname(__FILE__).'/../config/config.inc.php'); include_once(_PS_ADMIN_DIR_.'/../config/config.inc.php');
$module = Tools::getValue('module'); $module = Tools::getValue('module');
$render = Tools::getValue('render'); $render = Tools::getValue('render');
+1 -1
View File
@@ -250,7 +250,7 @@ function checkingTab($tab)
{ {
if (isset(AdminTab::$tabParenting[$tab])) if (isset(AdminTab::$tabParenting[$tab]))
Tools::redirectAdmin('?tab='.AdminTab::$tabParenting[$tab].'&token='.Tools::getAdminTokenLite(AdminTab::$tabParenting[$tab])); Tools::redirectAdmin('?tab='.AdminTab::$tabParenting[$tab].'&token='.Tools::getAdminTokenLite(AdminTab::$tabParenting[$tab]));
echo sprintf(Tools::displayError('Page %s cannot be found.'),$tab); echo sprintf(Tools::displayError('Page %s cannot be found..'),$tab);
return false; return false;
} }
+1 -1
View File
@@ -25,5 +25,5 @@
*/ */
define('_PS_ADMIN_DIR_', getcwd()); define('_PS_ADMIN_DIR_', getcwd());
require(dirname(dirname(__FILE__)).'/config/config.inc.php'); require(_PS_ADMIN_DIR_.'/config/config.inc.php');
Controller::getController('GetFileController')->run(); Controller::getController('GetFileController')->run();
+1 -1
View File
@@ -25,7 +25,7 @@
*/ */
define('_PS_ADMIN_DIR_', getcwd()); define('_PS_ADMIN_DIR_', getcwd());
include_once(dirname(__FILE__).'/../config/config.inc.php'); include_once(_PS_ADMIN_DIR_.'/../config/config.inc.php');
$module = Tools::getValue('module'); $module = Tools::getValue('module');
$render = Tools::getValue('render'); $render = Tools::getValue('render');
+2 -2
View File
@@ -27,8 +27,8 @@
$timer_start = microtime(true); $timer_start = microtime(true);
define('_PS_ADMIN_DIR_', getcwd()); define('_PS_ADMIN_DIR_', getcwd());
require(dirname(__FILE__).'/../config/config.inc.php'); require(_PS_ADMIN_DIR_.'/../config/config.inc.php');
require(dirname(__FILE__).'/functions.php'); require(_PS_ADMIN_DIR_.'/functions.php');
//small test to clear cache after upgrade //small test to clear cache after upgrade
if (Configuration::get('PS_UPGRADE_CLEAR_CACHE')) if (Configuration::get('PS_UPGRADE_CLEAR_CACHE'))
+1 -1
View File
@@ -25,7 +25,7 @@
*/ */
define('_PS_ADMIN_DIR_', getcwd()); define('_PS_ADMIN_DIR_', getcwd());
include(dirname(__FILE__).'/../config/config.inc.php'); include(_PS_ADMIN_DIR_.'/../config/config.inc.php');
Context::getContext()->shop->setContext(Shop::CONTEXT_ALL); Context::getContext()->shop->setContext(Shop::CONTEXT_ALL);
if (substr(_COOKIE_KEY_, 34, 8) != Tools::getValue('token')) if (substr(_COOKIE_KEY_, 34, 8) != Tools::getValue('token'))
+19 -19
View File
@@ -199,7 +199,7 @@ a.module_toggle_all{color: #268CCD;}
/*toolbarBox*/ /*toolbarBox*/
.toolbar-placeholder {position:relative} .toolbar-placeholder {position:relative}
.toolbarBox {background-color: #F8F8F8; border: 1px solid #CCCCCC; margin-bottom:10px; padding: 5px 0; border-radius:3px; -moz-border-radius:3px; -webkit-border-radius:3px;-o-border-radius:3px;position:relative;width: auto !important;} .toolbarBox {background-color: #F8F8F8; border: 1px solid #CCCCCC; margin-bottom:10px; padding: 5px 0; border-radius:3px; -moz-border-radius:3px; -webkit-border-radius:3px;-o-border-radius:3px;position:relative}
.toolbarBox .pageTitle { margin-left:10px; line-height:48px} .toolbarBox .pageTitle { margin-left:10px; line-height:48px}
.toolbarBox .pageTitle h3 {font-size: 1.6em; font-weight: normal; line-height: 52px; margin: 0; padding: 0; text-shadow:0 1px 0 #fff;} .toolbarBox .pageTitle h3 {font-size: 1.6em; font-weight: normal; line-height: 52px; margin: 0; padding: 0; text-shadow:0 1px 0 #fff;}
.toolbarBox ul.cc_button {float:right;margin:0 5px 0 0;padding:0;} .toolbarBox ul.cc_button {float:right;margin:0 5px 0 0;padding:0;}
@@ -243,7 +243,7 @@ a.module_toggle_all{color: #268CCD;}
.toolbarReduced {margin-right:221px} .toolbarReduced {margin-right:221px}
#modules_list_button {width:211px;height:63px;border:none;position:absolute;top:0;right:0;background-image:url('../img/modules_list_button.png');font-size: 1.6em;cursor:pointer;padding-left:45px} #modules_list_button {width:211px;height:63px;border:none;position:absolute;top:0;right:0;background-image:url('../img/modules_list_button.png');font-size: 1.6em;cursor:pointer;padding-left:45px}
#modules_list_container { .toolbarBox #modules_list_container {
background: none repeat scroll 0 0 #FFF; background: none repeat scroll 0 0 #FFF;
border: solid 1px #CCC; border: solid 1px #CCC;
display: block; display: block;
@@ -252,7 +252,7 @@ a.module_toggle_all{color: #268CCD;}
width: 300px; width: 300px;
position: absolute; position: absolute;
right: 13px; right: 13px;
top: 83px; top: 63px;
z-index: 100; z-index: 100;
padding: 10px; padding: 10px;
box-shadow: 1px 5px 5px #CCCCCC; box-shadow: 1px 5px 5px #CCCCCC;
@@ -261,29 +261,29 @@ a.module_toggle_all{color: #268CCD;}
opacity: 1; opacity: 1;
} }
#modules_list_container #modules_list_container_content .toolbarBox #modules_list_container #modules_list_container_content
{ {
max-height: 500px; max-height: 500px;
overflow: auto; overflow: auto;
} }
#modules_list_container #modules_list_container_tab {margin-top: 10px;width: auto;height: auto; } .toolbarBox #modules_list_container #modules_list_container_tab {margin-top: 10px;width: auto;height: auto; }
#modules_list_container #modules_list_container_tab table {width: 100%;border-spacing: 0px; } .toolbarBox #modules_list_container #modules_list_container_tab table {width: 100%;border-spacing: 0px; }
#modules_list_container #modules_list_container_tab tr { height: auto} .toolbarBox #modules_list_container #modules_list_container_tab tr { height: auto}
#modules_list_container #modules_list_container_tab tr.rowalt {background-color: #EEE} .toolbarBox #modules_list_container #modules_list_container_tab tr.rowalt {background-color: #EEE}
#modules_list_container #modules_list_container_tab #tab_module_switch {margin-bottom: 10px;} .toolbarBox #modules_list_container #modules_list_container_tab #tab_module_switch {margin-bottom: 10px;}
#modules_list_container #modules_list_loader {margin-top: 10px} .toolbarBox #modules_list_container #modules_list_loader {margin-top: 10px}
#modules_list_container .nav-tabs-modules:after {clear:both} .toolbarBox #modules_list_container .nav-tabs-modules:after {clear: both;}
#modules_list_container .nav-tabs-modules > li {height: 19px;float:left} .toolbarBox #modules_list_container .nav-tabs-modules > li {height: 19px;}
#modules_list_container .nav-tabs-modules > li > a { .toolbarBox #modules_list_container .nav-tabs-modules > li > a {
padding-right: 12px; padding-right: 12px;
padding-left: 12px; padding-left: 12px;
margin-right: 2px; margin-right: 2px;
line-height: 14px; line-height: 14px;
} }
#modules_list_container .nav-tabs-modules > li > a { .toolbarBox #modules_list_container .nav-tabs-modules > li > a {
padding-top: 8px; padding-top: 8px;
padding-bottom: 7px; padding-bottom: 7px;
border: 1px solid transparent; border: 1px solid transparent;
@@ -293,15 +293,15 @@ a.module_toggle_all{color: #268CCD;}
border-radius: 4px 4px 0 0; border-radius: 4px 4px 0 0;
} }
#modules_list_container .nav-tabs-modules > li > a:hover { .toolbarBox #modules_list_container .nav-tabs-modules > li > a:hover {
border-color: #C0C0C0; border-color: #C0C0C0;
background-color: #ffffff; background-color: #ffffff;
} }
#modules_list_container .nav-tabs-modules > li > a {border: 1px solid #ddd;border-bottom:none;} .toolbarBox #modules_list_container .nav-tabs-modules > li > a {border: 1px solid #ddd;border-bottom:none;}
#modules_list_container .nav-tabs-modules > .active > a, .toolbarBox #modules_list_container .nav-tabs-modules > .active > a,
#modules_list_container .nav-tabs-modules > .active > a:hover { .toolbarBox #modules_list_container .nav-tabs-modules > .active > a:hover {
color: #555555; color: #555555;
cursor: default; cursor: default;
background-color: #EEE; background-color: #EEE;
@@ -312,7 +312,7 @@ a.module_toggle_all{color: #268CCD;}
div.fix-toolbar {border-bottom: 1px solid #E0E0E0;position:fixed;top:0;opacity:0.9;z-index:500;width:90% !important;margin:auto} div.fix-toolbar {border-bottom: 1px solid #E0E0E0;position:fixed;top:0;opacity:0.9;z-index:500;margin:auto}
/*button upload files*/ /*button upload files*/
#content .qq-upload-button { #content .qq-upload-button {
@@ -51,7 +51,7 @@
</div> </div>
<div class="warn width2" style="float: left;"> <div class="warn width2" style="float: left;">
<p>{l s='How to restore a database Backup in 10 easy steps:'}</p> <p>{l s='How to restore a database backup in 10 easy steps:'}</p>
<ol style="font-size: 11px; font-weight: normal; line-height: 20px;"> <ol style="font-size: 11px; font-weight: normal; line-height: 20px;">
<li>{l s='Set "Enable Shop" to "No" in the "Maintenance" page under the "Preferences" menu.'}</li> <li>{l s='Set "Enable Shop" to "No" in the "Maintenance" page under the "Preferences" menu.'}</li>
<li>{l s='Download the backup from the list below or from your FTP server (in the folder "admin/backups").'}</li> <li>{l s='Download the backup from the list below or from your FTP server (in the folder "admin/backups").'}</li>
@@ -61,7 +61,7 @@
<li>{l s='Unless you enabled the "Drop existing tables" option, you must delete all tables from your current database.'}</li> <li>{l s='Unless you enabled the "Drop existing tables" option, you must delete all tables from your current database.'}</li>
<li>{l s='At the top of the screen, please select the "Import" tab'}</li> <li>{l s='At the top of the screen, please select the "Import" tab'}</li>
<li>{l s='Click on the "Browse" button and select the backup file from your hard drive.'}</li> <li>{l s='Click on the "Browse" button and select the backup file from your hard drive.'}</li>
<li>{l s='Check the max. allowed filesize (e.g. Max: 16MB)'}<br />{l s='If your backup file exceeds this limit, contact your hosting provider for assistence. '}</li> <li>{l s='Check the maximum filesize allowed (e.g. Max: 16MB)'}<br />{l s='If your backup file exceeds this limit, contact your hosting provider for assistence. '}</li>
<li>{l s='Click on the "Go" button and please wait patiently for the import process to conclude. This may take several minutes.'}</li> <li>{l s='Click on the "Go" button and please wait patiently for the import process to conclude. This may take several minutes.'}</li>
</ol> </ol>
</div> </div>
@@ -59,7 +59,7 @@
</div> </div>
<div class="warn width2" style="float: left;"> <div class="warn width2" style="float: left;">
<p>{l s='How to restore a database Backup in 10 easy steps:'}</p> <p>{l s='How to restore a database backup in 10 easy steps:'}</p>
<ol style="font-size: 11px; font-weight: normal; line-height: 20px;"> <ol style="font-size: 11px; font-weight: normal; line-height: 20px;">
<li>{l s='Set "Enable Shop" to "No" in the "Maintenance" page under the "Preferences" menu.'}</li> <li>{l s='Set "Enable Shop" to "No" in the "Maintenance" page under the "Preferences" menu.'}</li>
<li>{l s='Download the backup from the list below or from your FTP server (in the folder "admin/backups").'}</li> <li>{l s='Download the backup from the list below or from your FTP server (in the folder "admin/backups").'}</li>
@@ -69,7 +69,7 @@
<li>{l s='Unless you enabled the "Drop existing tables" option, you must delete all tables from your current database.'}</li> <li>{l s='Unless you enabled the "Drop existing tables" option, you must delete all tables from your current database.'}</li>
<li>{l s='At the top of the screen, please select the "Import" tab'}</li> <li>{l s='At the top of the screen, please select the "Import" tab'}</li>
<li>{l s='Click on the "Browse" button and select the backup file from your hard drive.'}</li> <li>{l s='Click on the "Browse" button and select the backup file from your hard drive.'}</li>
<li>{l s='Check the max. allowed filesize (e.g. Max: 16MB)'}<br />{l s='If your backup file exceeds this limit, contact your hosting provider for assistence. '}</li> <li>{l s='Check the maximum filesize allowed (e.g. Max: 16MB)'}<br />{l s='If your backup file exceeds this limit, contact your hosting provider for assistence. '}</li>
<li>{l s='Click on the "Go" button and please wait patiently for the import process to conclude. This may take several minutes.'}</li> <li>{l s='Click on the "Go" button and please wait patiently for the import process to conclude. This may take several minutes.'}</li>
</ol> </ol>
</div> </div>
@@ -42,12 +42,12 @@
<label>{l s='Total available'}</label> <label>{l s='Total available'}</label>
<div class="margin-form"> <div class="margin-form">
<input type="text" name="quantity" value="{$currentTab->getFieldValue($currentObject, 'quantity')|intval}" /> <input type="text" name="quantity" value="{$currentTab->getFieldValue($currentObject, 'quantity')|intval}" />
<p class="preference_description">{l s='The cart rule will be applied to the first X customers only.'}</p> <p class="preference_description">{l s='The cart rule will be applied to the first "X" customers only.'}</p>
</div> </div>
<label>{l s='Total available for each user.'}</label> <label>{l s='Total available for each user.'}</label>
<div class="margin-form"> <div class="margin-form">
<input type="text" name="quantity_per_user" value="{$currentTab->getFieldValue($currentObject, 'quantity_per_user')|intval}" /> <input type="text" name="quantity_per_user" value="{$currentTab->getFieldValue($currentObject, 'quantity_per_user')|intval}" />
<p class="preference_description">{l s='A customer will only be able to use the cart rule X time(s).'}</p> <p class="preference_description">{l s='A customer will only be able to use the cart rule "X" time(s).'}</p>
</div> </div>
{if $countries.unselected|@count + $countries.selected|@count > 1} {if $countries.unselected|@count + $countries.selected|@count > 1}
<br /> <br />
@@ -98,7 +98,7 @@
<p><strong>{l s='Unselected carriers'}</strong></p> <p><strong>{l s='Unselected carriers'}</strong></p>
<select id="carrier_select_1" style="border:1px solid #AAAAAA;width:400px;height:160px" multiple> <select id="carrier_select_1" style="border:1px solid #AAAAAA;width:400px;height:160px" multiple>
{foreach from=$carriers.unselected item='carrier'} {foreach from=$carriers.unselected item='carrier'}
<option value="{$carrier.id_carrier|intval}">&nbsp;{$carrier.name|escape}</option> <option value="{$carrier.id_reference|intval}">&nbsp;{$carrier.name|escape}</option>
{/foreach} {/foreach}
</select><br /><br /> </select><br /><br />
<a <a
@@ -112,7 +112,7 @@
<p><strong>{l s='Selected carriers'}</strong></p> <p><strong>{l s='Selected carriers'}</strong></p>
<select name="carrier_select[]" id="carrier_select_2" style="border:1px solid #AAAAAA;width:400px;height:160px" multiple> <select name="carrier_select[]" id="carrier_select_2" style="border:1px solid #AAAAAA;width:400px;height:160px" multiple>
{foreach from=$carriers.selected item='carrier'} {foreach from=$carriers.selected item='carrier'}
<option value="{$carrier.id_carrier|intval}">&nbsp;{$carrier.name|escape}</option> <option value="{$carrier.id_reference|intval}">&nbsp;{$carrier.name|escape}</option>
{/foreach} {/foreach}
</select><br /><br /> </select><br /><br />
<a <a
@@ -20,17 +20,17 @@
{if $currentObject->id}<input type="hidden" name="id_cart_rule" value="{$currentObject->id|intval}" />{/if} {if $currentObject->id}<input type="hidden" name="id_cart_rule" value="{$currentObject->id|intval}" />{/if}
<input type="hidden" id="currentFormTab" name="currentFormTab" value="informations" /> <input type="hidden" id="currentFormTab" name="currentFormTab" value="informations" />
<div id="cart_rule_informations" class="cart_rule_tab"> <div id="cart_rule_informations" class="cart_rule_tab">
<h4>{l s='Cart rule information'}</h4> <h4>{l s='Cart-rule information'}</h4>
<div class="separation"></div> <div class="separation"></div>
{include file='controllers/cart_rules/informations.tpl'} {include file='controllers/cart_rules/informations.tpl'}
</div> </div>
<div id="cart_rule_conditions" class="cart_rule_tab"> <div id="cart_rule_conditions" class="cart_rule_tab">
<h4>{l s='Cart rule conditions'}</h4> <h4>{l s='Cart-rule conditions'}</h4>
<div class="separation"></div> <div class="separation"></div>
{include file='controllers/cart_rules/conditions.tpl'} {include file='controllers/cart_rules/conditions.tpl'}
</div> </div>
<div id="cart_rule_actions" class="cart_rule_tab"> <div id="cart_rule_actions" class="cart_rule_tab">
<h4>{l s='Cart rule actions'}</h4> <h4>{l s='Cart-rule actions'}</h4>
<div class="separation"></div> <div class="separation"></div>
{include file='controllers/cart_rules/actions.tpl'} {include file='controllers/cart_rules/actions.tpl'}
</div> </div>
@@ -33,7 +33,7 @@
<input type="radio" name="highlight" id="highlight_off" value="0" {if !$currentTab->getFieldValue($currentObject, 'highlight')|intval}checked="checked"{/if} /> <input type="radio" name="highlight" id="highlight_off" value="0" {if !$currentTab->getFieldValue($currentObject, 'highlight')|intval}checked="checked"{/if} />
<label class="t" for="highlight_off"> <img src="../img/admin/disabled.gif" alt="{l s='No'}" title="{l s='No'}" style="cursor:pointer" /></label> <label class="t" for="highlight_off"> <img src="../img/admin/disabled.gif" alt="{l s='No'}" title="{l s='No'}" style="cursor:pointer" /></label>
<p class="preference_description"> <p class="preference_description">
{l s='If the voucher is not yet in the cart, it will be displayed under the cart in the cart summary.'} {l s='If the voucher is not yet in the cart, it will be displayed in the cart summary.'}
</p> </p>
</div> </div>
<label>{l s='Partial use'}</label> <label>{l s='Partial use'}</label>
@@ -8,7 +8,7 @@
<input type="hidden" name="product_rule_{$product_rule_group_id|intval}[]" value="{$product_rule_id}" /> <input type="hidden" name="product_rule_{$product_rule_group_id|intval}[]" value="{$product_rule_id}" />
<input type="hidden" name="product_rule_{$product_rule_group_id|intval}_{$product_rule_id|intval}_type" value="{$product_rule_type|escape}" /> <input type="hidden" name="product_rule_{$product_rule_group_id|intval}_{$product_rule_id|intval}_type" value="{$product_rule_type|escape}" />
{* Everything is on a single line in order to avoid a empty space between the [ ] and the word *} {* Everything is on a single line in order to avoid a empty space between the [ ] and the word *}
[{if $product_rule_type == 'products'}{l s='Products:'}{elseif $product_rule_type == 'categories'}{l s='Categories:'}{elseif $product_rule_type == 'manufacturers'}{l s='Manufacturers:'}{elseif $product_rule_type == 'suppliers'}{l s='Suppliers:'}{elseif $product_rule_type == 'attributes'}{l s='Attributes'}{/if}] [{if $product_rule_type == 'products'}{l s='Products:'}{elseif $product_rule_type == 'categories'}{l s='Categories:'}{elseif $product_rule_type == 'manufacturers'}{l s='Manufacturers:'}{elseif $product_rule_type == 'suppliers'}{l s='Suppliers'}{elseif $product_rule_type == 'attributes'}{l s='Attributes'}{/if}]
</td> </td>
<td> <td>
{l s='The product(s) are matching on of these'} {l s='The product(s) are matching on of these'}
@@ -20,7 +20,7 @@
<option value="attributes">{l s='Attributes'}</option> <option value="attributes">{l s='Attributes'}</option>
<option value="categories">{l s='Categories:'}</option> <option value="categories">{l s='Categories:'}</option>
<option value="manufacturers">{l s='Manufacturers:'}</option> <option value="manufacturers">{l s='Manufacturers:'}</option>
<option value="suppliers">{l s='Suppliers:'}</option> <option value="suppliers">{l s='Suppliers'}</option>
</select> </select>
<a href="javascript:addProductRule({$product_rule_group_id|intval});"> <a href="javascript:addProductRule({$product_rule_group_id|intval});">
<input type="button" class="button" value="OK" /> <input type="button" class="button" value="OK" />
@@ -138,13 +138,13 @@
{/if} {/if}
{/foreach} {/foreach}
<tr class="cart_total_product"> <tr class="cart_total_product">
<td colspan="5">{l s='Total products:'}</td> <td colspan="5">{l s='Total cost of products:'}</td>
<td class="price bold right">{displayWtPriceWithCurrency price=$total_products currency=$currency}</td> <td class="price bold right">{displayWtPriceWithCurrency price=$total_products currency=$currency}</td>
</tr> </tr>
{if $total_discounts != 0} {if $total_discounts != 0}
<tr class="cart_total_voucher"> <tr class="cart_total_voucher">
<td colspan="5">{l s='Total vouchers:'}</td> <td colspan="5">{l s='Total value of vouchers:'}</td>
<td class="price-discount bold right">{displayWtPriceWithCurrency price=$total_discounts currency=$currency}</td> <td class="price-discount bold right">{displayWtPriceWithCurrency price=$total_discounts currency=$currency}</td>
</tr> </tr>
{/if} {/if}
@@ -156,7 +156,7 @@
{/if} {/if}
{if $cart->getOrderTotal(true, Cart::ONLY_SHIPPING) > 0} {if $cart->getOrderTotal(true, Cart::ONLY_SHIPPING) > 0}
<tr class="cart_total_delivery"> <tr class="cart_total_delivery">
<td colspan="5">{l s='Total shipping:'}</td> <td colspan="5">{l s='Total cost of shipping:'}</td>
<td class="price bold right">{displayWtPriceWithCurrency price=$total_shipping currency=$currency}</td> <td class="price bold right">{displayWtPriceWithCurrency price=$total_shipping currency=$currency}</td>
</tr> </tr>
{/if} {/if}
@@ -58,7 +58,7 @@
{else} {else}
<a href="{$currentIndex}&token={$token}&id_customer_thread={$id_customer_thread}&viewcustomer_thread" class="button"> <a href="{$currentIndex}&token={$token}&id_customer_thread={$id_customer_thread}&viewcustomer_thread" class="button">
{$total_thread} {$total_thread}
{if $total_thread > 1}{l s='new messages'}{else}{l s='new message'}{/if} {if $total_thread > 1}{l s='New messages'}{else}{l s='New message'}{/if}
</a> </a>
{/if} {/if}
</div> </div>
@@ -51,7 +51,7 @@
</p> </p>
<div id="message_forward_email" style="display:none"> <div id="message_forward_email" style="display:none">
<b>{l s='Email:'}</b> <input type="text" name="email" /> <b>{l s='Email'}</b> <input type="text" name="email" />
</div> </div>
<div id="message_forward" style="display:none;margin-bottom:10px"> <div id="message_forward" style="display:none;margin-bottom:10px">
@@ -49,7 +49,7 @@
<dl> <dl>
<dt>{l s='Customer ID:'}</dd> <dt>{l s='Customer ID:'}</dd>
<dd><a href="index.php?tab=AdminCustomers&id_customer={$message.id_customer}&viewcustomer&token={getAdminToken tab='AdminCustomers'}" title="{l s='View customer'}"> <dd><a href="index.php?tab=AdminCustomers&id_customer={$message.id_customer}&viewcustomer&token={getAdminToken tab='AdminCustomers'}" title="{l s='View customer'}">
{$message.id_customer} <img src="../img/admin/search.gif" alt="{l s='view'}" /> {$message.id_customer} <img src="../img/admin/search.gif" alt="{l s='View'}" />
</a> </a>
</dd> </dd>
</dl> </dl>
@@ -73,7 +73,7 @@
<dt>{l s='File attachment'}</dt> <dt>{l s='File attachment'}</dt>
<dd><a href="index.php?tab=AdminCustomerThreads&id_customer_thread={$message.id_customer_thread}&viewcustomer_thread&token={getAdminToken tab='AdminCustomerThreads'}&filename={$message.file_name}" <dd><a href="index.php?tab=AdminCustomerThreads&id_customer_thread={$message.id_customer_thread}&viewcustomer_thread&token={getAdminToken tab='AdminCustomerThreads'}&filename={$message.file_name}"
title="{l s='View file'}"> title="{l s='View file'}">
<img src="../img/admin/search.gif" alt="{l s='view'}" /> <img src="../img/admin/search.gif" alt="{l s='View'}" />
</a> </a>
</dd> </dd>
</dl> </dl>
@@ -83,7 +83,7 @@
<dl> <dl>
<dt>{l s='Order #'}</dt> <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'}"> <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'}" /> {$message.id_order} <img src="../img/admin/search.gif" alt="{l s='View'}" />
</a></dd> </a></dd>
</dl> </dl>
{/if} {/if}
@@ -92,7 +92,7 @@
<dl> <dl>
<dt>{l s='Product #'}</dt> <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'}"> <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'}" /> {$message.id_product} <img src="../img/admin/search.gif" alt="{l s='View'}" />
</a></dd> </a></dd>
</dl> </dl>
{/if} {/if}
@@ -70,7 +70,7 @@
<br /><br /> <br /><br />
{l s='ID:'} {$customer->id|string_format:"%06d"}<br /> {l s='ID:'} {$customer->id|string_format:"%06d"}<br />
{l s='Registration date:'} {$registration_date}<br /> {l s='Registration date:'} {$registration_date}<br />
{l s='Last visit:'} {if $customer_stats['last_visit']}{$last_visit}{else}{l s='never'}{/if}<br /> {l s='Last visit:'} {if $customer_stats['last_visit']}{$last_visit}{else}{l s='Never'}{/if}<br />
{if $count_better_customers != '-'}{l s='Rank: #'} {$count_better_customers}<br />{/if} {if $count_better_customers != '-'}{l s='Rank: #'} {$count_better_customers}<br />{/if}
{if $shop_is_feature_active}{l s='Shop:'} {$name_shop}<br />{/if} {if $shop_is_feature_active}{l s='Shop:'} {$name_shop}<br />{/if}
</div> </div>
@@ -84,17 +84,17 @@
{l s='Language:'} {if isset($customerLanguage)}{$customerLanguage->name}{else}{l s='undefined'}{/if}<br /> {l s='Language:'} {if isset($customerLanguage)}{$customerLanguage->name}{else}{l s='undefined'}{/if}<br />
{l s='Newsletter:'} {if $customer->newsletter}<img src="../img/admin/enabled.gif" />{else}<img src="../img/admin/disabled.gif" />{/if}<br /> {l s='Newsletter:'} {if $customer->newsletter}<img src="../img/admin/enabled.gif" />{else}<img src="../img/admin/disabled.gif" />{/if}<br />
{l s='Opt in:'} {if $customer->optin}<img src="../img/admin/enabled.gif" />{else}<img src="../img/admin/disabled.gif" />{/if}<br /> {l s='Opt in:'} {if $customer->optin}<img src="../img/admin/enabled.gif" />{else}<img src="../img/admin/disabled.gif" />{/if}<br />
{l s='Age:'} {$customer_stats['age']} {if isset($customer->birthday['age'])}({$customer_birthday}){else}{l s='unknown'}{/if}<br /><br /> {l s='Age:'} {$customer_stats['age']} {if isset($customer->birthday['age'])}({$customer_birthday}){else}{l s='Unknown'}{/if}<br /><br />
{l s='Last update:'} {$last_update}<br /> {l s='Last update:'} {$last_update}<br />
{l s='Status:'} {if $customer->active}<img src="../img/admin/enabled.gif" />{else}<img src="../img/admin/disabled.gif" />{/if} {l s='Status:'} {if $customer->active}<img src="../img/admin/enabled.gif" />{else}<img src="../img/admin/disabled.gif" />{/if}
{if $customer->isGuest()} {if $customer->isGuest()}
<div> <div>
{l s='This customer is registered as.'} <b>{l s='guest'}</b> {l s='This customer is registered as.'} <b>{l s='Guest'}</b>
{if !$customer_exists} {if !$customer_exists}
<form method="post" action="index.php?tab=AdminCustomers&id_customer={$customer->id}&token={getAdminToken tab='AdminCustomers'}"> <form method="post" action="index.php?tab=AdminCustomers&id_customer={$customer->id}&token={getAdminToken tab='AdminCustomers'}">
<input type="hidden" name="id_lang" value="{$id_lang}" /> <input type="hidden" name="id_lang" value="{$id_lang}" />
<p class="center"><input class="button" type="submit" name="submitGuestToCustomer" value="{l s='Transform to customer account'}" /></p> <p class="center"><input class="button" type="submit" name="submitGuestToCustomer" value="{l s='Transform to a customer account'}" /></p>
{l s='This feature generates a random password before sending an email to your customer.'} {l s='This feature generates a random password before sending an email to your customer.'}
</form> </form>
{else} {else}
@@ -37,7 +37,7 @@
<form action="{$current}&token={$token}" method="post"> <form action="{$current}&token={$token}" method="post">
<fieldset class="width4"> <fieldset class="width4">
<legend><img src="../img/admin/picture.gif" /> {l s='Regenerate thumbnails'}</legend><br /> <legend><img src="../img/admin/picture.gif" /> {l s='Regenerate thumbnails'}</legend><br />
<label>{l s='Select image'}</label> <label>{l s='Select an image'}</label>
<div class="margin-form"> <div class="margin-form">
<select name="type" onchange="changeFormat(this)"> <select name="type" onchange="changeFormat(this)">
<option value="all">{l s='All'}</option> <option value="all">{l s='All'}</option>
@@ -48,7 +48,7 @@
</div> </div>
{foreach $types AS $k => $type} {foreach $types AS $k => $type}
<label class="second-select format_{$k}" style="display:none;">{l s='Select format'}</label> <label class="second-select format_{$k}" style="display:none;">{l s='Select a format'}</label>
<div class="second-select margin-form format_{$k}" style="display:none;"> <div class="second-select margin-form format_{$k}" style="display:none;">
<select class="second-select format_{$k}" name="format_{$k}"> <select class="second-select format_{$k}" name="format_{$k}">
<option value="all">{l s='All'}</option> <option value="all">{l s='All'}</option>
@@ -82,7 +82,7 @@
<br /> <br />
{if $safe_mode} {if $safe_mode}
<div class="warn"> <div class="warn">
{l s='PrestaShop has detected that your server configuration is not compatible with the new storage system (directive "safe_mode" is activated). You should continue to use the existing system.'} {l s='PrestaShop has detected that your server configuration is not compatible with the new storage system (directive "safe_mode" is activated). You should therefore continue to use the existing system.'}
</div> </div>
{else} {else}
<form action="{$current}&token={$token}" method="post"> <form action="{$current}&token={$token}" method="post">
@@ -50,7 +50,7 @@
console.log(truncateAuthorized); console.log(truncateAuthorized);
if (truncateAuthorized) if (truncateAuthorized)
{ {
if (!confirm('{l s='Are you sure you want to delete' js=1}' + ' ' + $.trim($('#entity > option:selected').text().toLowerCase()) + '{l s='?' js=1}')) if (!confirm('{l s='Are you sure that you would like to delete this' js=1}' + ' ' + $.trim($('#entity > option:selected').text().toLowerCase()) + '{l s='?' js=1}'))
{ {
e.preventDefault(); e.preventDefault();
} }
@@ -126,7 +126,7 @@
<a href="#upload_file_import" id="upload_file_import_link" class="button"><img src="../img/admin/add.gif" alt="Uplaod" title="Upload" />{l s='Upload'}</a> <a href="#upload_file_import" id="upload_file_import_link" class="button"><img src="../img/admin/add.gif" alt="Uplaod" title="Upload" />{l s='Upload'}</a>
</div> </div>
<div style="width:50%; margin: 0 auto;"> <div style="width:50%; margin: 0 auto;">
<a href="#" onclick="$('#sample_files_import').slideToggle(); return false;">{l s='Click to see our samples import csv files.'}</a> <a href="#" onclick="$('#sample_files_import').slideToggle(); return false;">{l s='Click to view our sample import csv files.'}</a>
<ul id="sample_files_import" style="display:none"> <ul id="sample_files_import" style="display:none">
<li><a href="../docs/csv_import/categories_import.csv">{l s='Sample Categories file'}</a></li> <li><a href="../docs/csv_import/categories_import.csv">{l s='Sample Categories file'}</a></li>
<li><a href="../docs/csv_import/products_import.csv">{l s='Sample Products file'}</a></li> <li><a href="../docs/csv_import/products_import.csv">{l s='Sample Products file'}</a></li>
@@ -190,14 +190,14 @@
</div> </div>
<div class="space margin-form"> <div class="space margin-form">
<input type="submit" name="submitImportFile" value="{l s='Next step'}" class="button" {if empty($files_to_import)}disabled{/if}/> <input type="submit" name="submitImportFile" value="{l s='Next step'}" class="button" {if empty($files_to_import)}disabled{/if}/>
{if empty($files_to_import)}<span style="color:red;">{l s='You must upload a file for go to the next step.'}</span>{/if} {if empty($files_to_import)}<span style="color:red;">{l s='You must upload a file in order to proceed to the next step'}</span>{/if}
</div> </div>
<div class="warn import_products_categories" style="margin-top: 20px;"> <div class="warn import_products_categories" style="margin-top: 20px;">
<p>{l s='Note that the category import does not support categories of the same name.'}</p> <p>{l s='Note that the category import does not support categories of the same name.'}</p>
<p>{l s='Note that you can have several products with the same reference.'}</p> <p>{l s='Note that you can have several products with the same reference.'}</p>
</div> </div>
<div class="warn import_supply_orders_details" style="margin-top: 20px; display:none"> <div class="warn import_supply_orders_details" style="margin-top: 20px; display:none">
<p>{l s='Importing Supply Order Details will first reset the products ordered, if any.'}</p> <p>{l s='Importing Supply Order Details will reset products ordered, if there are any.'}</p>
</div> </div>
{if !count($files_to_import)} {if !count($files_to_import)}
<div class="warn" style="margin-top: 20px;"> <div class="warn" style="margin-top: 20px;">
@@ -222,7 +222,7 @@
</div> </div>
<div class="clear"> <div class="clear">
<br /><br />{l s='*Required field'} <br /><br />{l s='* Required field'}
</div> </div>
</fieldset> </fieldset>
@@ -70,7 +70,7 @@
</script> </script>
<fieldset> <fieldset>
<legend><img src="../img/t/AdminInformation.gif" alt="" />{l s='Configuration Information'}</legend> <legend><img src="../img/t/AdminInformation.gif" alt="" />{l s='Configuration information'}</legend>
<p>{l s='This information must be provided when you report an issue on our bug tracker or forum.'}</p> <p>{l s='This information must be provided when you report an issue on our bug tracker or forum.'}</p>
</fieldset> </fieldset>
<br /> <br />
@@ -113,7 +113,7 @@
<hr /> <hr />
<h3>{l s='Store information'}</h3> <h3>{l s='Store information'}</h3>
<p> <p>
<b>{l s='Prestashop version'}:</b> {$shop.ps|escape:'htmlall':'UTF-8'} <b>{l s='PrestaShop version'}:</b> {$shop.ps|escape:'htmlall':'UTF-8'}
</p> </p>
<p> <p>
<b>{l s='Shop URL'}:</b> {$shop.url|escape:'htmlall':'UTF-8'} <b>{l s='Shop URL'}:</b> {$shop.url|escape:'htmlall':'UTF-8'}
@@ -39,7 +39,7 @@
var langPackOk = "<img src=\"{$smarty.const._PS_IMG_}admin/information.png\" alt=\"\" /> {l s='A language pack is available for this ISO.'}"; var langPackOk = "<img src=\"{$smarty.const._PS_IMG_}admin/information.png\" alt=\"\" /> {l s='A language pack is available for this ISO.'}";
var langPackVersion = "{l s='The Prestashop version compatible with this language and your system is:'}"; var langPackVersion = "{l s='The Prestashop version compatible with this language and your system is:'}";
var langPackInfo = "{l s='After creating the language, you can import the content of the language pack, which you can download under "Localization -- Translations."'}"; var langPackInfo = "{l s='After creating the language, you can import the content of the language pack, which you can download under "Localization -- Translations."'}";
var noLangPack = "<img src=\"{$smarty.const._PS_IMG_}admin/information.png\" alt=\"\" /> {l s='No language pack available on prestashop.com for this ISO code'}"; var noLangPack = "<img src=\"{$smarty.const._PS_IMG_}admin/information.png\" alt=\"\" /> {l s='No language pack is available on prestashop.com for this ISO code'}";
var download = "{l s='Download'}"; var download = "{l s='Download'}";
$(document).ready(function() { $(document).ready(function() {
@@ -29,7 +29,7 @@
<h2>{$manufacturer->name}</h2> <h2>{$manufacturer->name}</h2>
<h3>{l s='Total addresses:'} {count($addresses)}</h3> <h3>{l s='Total addresses'} {count($addresses)}</h3>
<hr /> <hr />
{if !count($addresses)} {if !count($addresses)}
@@ -60,7 +60,7 @@
{/foreach} {/foreach}
{/if} {/if}
<h3>{l s='Total products:'} {count($products)}</h3> <h3>{l s='Total products'} {count($products)}</h3>
{foreach $products AS $product} {foreach $products AS $product}
<hr /> <hr />
{if !$product->hasAttributes()} {if !$product->hasAttributes()}
@@ -27,7 +27,7 @@
<th>{l s='Description'}</th> <th>{l s='Description'}</th>
<th>{l s='Status'}</th> <th>{l s='Status'}</th>
<th>{l s='Tab'}</th> <th>{l s='Tab'}</th>
<th>{l s='Categories:'}</th> <th>{l s='Categories'}</th>
<th>{l s='Interest'}</th> <th>{l s='Interest'}</th>
<th>{l s='Favorite'}</th> <th>{l s='Favorite'}</th>
<th>&nbsp;</th> <th>&nbsp;</th>
@@ -47,7 +47,7 @@
<div class="filter-module" id="addons_login_div"> <div class="filter-module" id="addons_login_div">
<p>{l s='Do you have a %s account?' sprintf='<a href="http://addons.prestashop.com/">PrestaShop Addons</a>'}</p> <p>{l s='Do you have a %s account?' sprintf='<a href="http://addons.prestashop.com/">PrestaShop Addons</a>'}</p>
<form id="addons_login_form" method="post"> <form id="addons_login_form" method="post">
<label>{l s='Login to Addons'} :</label> <input type="text" value="" id="username_addons" autocomplete="off" class="ac_input"> <label>{l s='Addons Login'} :</label> <input type="text" value="" id="username_addons" autocomplete="off" class="ac_input">
<label>{l s= 'Password Addons'} :</label> <input type="password" value="" id="password_addons" autocomplete="off" class="ac_input"> <label>{l s= 'Password Addons'} :</label> <input type="password" value="" id="password_addons" autocomplete="off" class="ac_input">
<input type="submit" class="button" id="addons_login_button" value="{l s='Log in'}"> <input type="submit" class="button" id="addons_login_button" value="{l s='Log in'}">
<br /><span id="addons_loading" style="color:red"></span> <br /><span id="addons_loading" style="color:red"></span>
@@ -64,7 +64,7 @@
<div class="filter-module"> <div class="filter-module">
<form id="filternameForm" method="post"> <form id="filternameForm" method="post">
<input type="text" value="" name="filtername" autocomplete="off" class="ac_input"> <input type="text" value="" name="filtername" autocomplete="off" class="ac_input">
<input type="submit" class="button" value="{l s='Search:'}"> <input type="submit" class="button" value="{l s='Search'}">
</form> </form>
<form method="post"> <form method="post">
<div class="select-filter"> <div class="select-filter">
@@ -36,7 +36,7 @@
<!--start sidebar module--> <!--start sidebar module-->
<div class="sidebar"> <div class="sidebar">
<div class="categorieTitle"> <div class="categorieTitle">
<h3>{l s='Categories:'}</h3> <h3>{l s='Categories'}</h3>
<div class="subHeadline">&nbsp;</div> <div class="subHeadline">&nbsp;</div>
<ul class="categorieList"> <ul class="categorieList">
<li {if isset($categoryFiltered.favorites)}style="background-color:#EBEDF4"{/if} class="categoryModuleFilterLink"> <li {if isset($categoryFiltered.favorites)}style="background-color:#EBEDF4"{/if} class="categoryModuleFilterLink">
@@ -79,7 +79,7 @@
</colgroup> </colgroup>
<tr class="nodrag nodrop"><th colspan="5"> {if $hook['module_count'] && $can_move} <tr class="nodrag nodrop"><th colspan="5"> {if $hook['module_count'] && $can_move}
<input type="checkbox" id="Ghook{$hook['id_hook']}" style="margin-right: 2px;" onclick="hookCheckboxes({$hook['id_hook']}, 0, this)"/> <input type="checkbox" id="Ghook{$hook['id_hook']}" style="margin-right: 2px;" onclick="hookCheckboxes({$hook['id_hook']}, 0, this)"/>
{/if}{$hook['title']} - <span style="color: red">{$hook['module_count']}</span> {if $hook['module_count'] > 1}{l s='modules'}{else}{l s='module'}{/if} {/if}{$hook['title']} - <span style="color: red">{$hook['module_count']}</span> {if $hook['module_count'] > 1}{l s='Modules'}{else}{l s='Module'}{/if}
{if !empty($hook['description'])} {if !empty($hook['description'])}
&nbsp;<span style="font-size:0.8em; font-weight: normal">[{$hook['description']}]</span> &nbsp;<span style="font-size:0.8em; font-weight: normal">[{$hook['description']}]</span>
@@ -128,7 +128,7 @@
{foreachelse} {foreachelse}
<tr> <tr>
<td colspan="5" class="center"> <td colspan="5" class="center">
<h3>{l s='No document is available'}</h3> <h3>{l s='No documents are available'}</h3>
{if isset($invoice_management_active) && $invoice_management_active} {if isset($invoice_management_active) && $invoice_management_active}
<p><a class="button" href="{$current_index}&viewOrder&submitGenerateInvoice&id_order={$order->id}&token={$smarty.get.token|escape:'htmlall':'UTF-8'}">{l s='Generate invoice'}</a></p> <p><a class="button" href="{$current_index}&viewOrder&submitGenerateInvoice&id_order={$order->id}&token={$smarty.get.token|escape:'htmlall':'UTF-8'}">{l s='Generate invoice'}</a></p>
{/if} {/if}
@@ -27,10 +27,10 @@
<input type="hidden" id="add_product_product_id" name="add_product[product_id]" value="0" /> <input type="hidden" id="add_product_product_id" name="add_product[product_id]" value="0" />
{l s='Product:'} <input type="text" id="add_product_product_name" value="" size="42" /> {l s='Product:'} <input type="text" id="add_product_product_name" value="" size="42" />
<div id="add_product_product_attribute_area" style="margin-top: 5px;display: none;"> <div id="add_product_product_attribute_area" style="margin-top: 5px;display: none;">
{l s='Combinations:'} <select name="add_product[product_attribute_id]" id="add_product_product_attribute_id"></select> {l s='Combinations'} <select name="add_product[product_attribute_id]" id="add_product_product_attribute_id"></select>
</div> </div>
<div id="add_product_product_warehouse_area" style="margin-top: 5px; display: none;"> <div id="add_product_product_warehouse_area" style="margin-top: 5px; display: none;">
{l s='Warehouse:'} <select id="add_product_warehouse" name="add_product_warehouse"> {l s='Warehouse'} <select id="add_product_warehouse" name="add_product_warehouse">
</select> </select>
</div> </div>
</td> </td>
@@ -64,7 +64,7 @@
<tr id="new_invoice" style="display:none;background-color:#e9f1f6;"> <tr id="new_invoice" style="display:none;background-color:#e9f1f6;">
<td colspan="10"> <td colspan="10">
<h3>{l s='New invoice information'}</h3> <h3>{l s='New invoice information'}</h3>
<label>{l s='Carrier:'}</label> <label>{l s='Carrier'}</label>
<div class="margin-form"> <div class="margin-form">
{$carrier->name} {$carrier->name}
</div> </div>
@@ -32,7 +32,7 @@
</colgroup> </colgroup>
<thead> <thead>
<tr> <tr>
<th>{l s='Date:'}</th> <th>{l s='Date'}</th>
<th>{l s='Type'}</th> <th>{l s='Type'}</th>
<th>{l s='Carrier'}</th> <th>{l s='Carrier'}</th>
<th>{l s='Weight'}</th> <th>{l s='Weight'}</th>
@@ -34,7 +34,7 @@
var id_currency = ''; var id_currency = '';
var id_lang = ''; var id_lang = '';
var txt_show_carts = '{l s='Show carts and orders for this customer.'}'; var txt_show_carts = '{l s='Show carts and orders for this customer.'}';
var txt_hide_carts = '{l s='Hide carts and orders for this customer'}'; var txt_hide_carts = '{l s='Hide carts and orders for this customer.'}';
var defaults_order_state = new Array(); var defaults_order_state = new Array();
var customization_errors = false; var customization_errors = false;
var pic_dir = '{$pic_dir}'; var pic_dir = '{$pic_dir}';
@@ -560,7 +560,7 @@
customization_errors = false; customization_errors = false;
$('#products_found').show(); $('#products_found').show();
products_found += '<label>{l s='Product:'}</label><select id="id_product" onclick="display_product_attributes();display_product_customizations();">'; products_found += '<label>{l s='Product:'}</label><select id="id_product" onclick="display_product_attributes();display_product_customizations();">';
attributes_html += '<label>{l s='Combination:'}</label>'; attributes_html += '<label>{l s='Combination'}</label>';
$.each(res.products, function() { $.each(res.products, function() {
products_found += '<option '+(this.combinations.length > 0 ? 'rel="'+this.qty_in_stock+'"' : '')+' value="'+this.id_product+'">'+this.name+(this.combinations.length == 0 ? ' - '+this.formatted_price : '')+'</option>'; products_found += '<option '+(this.combinations.length > 0 ? 'rel="'+this.qty_in_stock+'"' : '')+' value="'+this.id_product+'">'+this.name+(this.combinations.length == 0 ? ' - '+this.formatted_price : '')+'</option>';
attributes_html += '<select class="id_product_attribute" id="ipa_'+this.id_product+'" style="display:none;">'; attributes_html += '<select class="id_product_attribute" id="ipa_'+this.id_product+'" style="display:none;">';
@@ -971,7 +971,6 @@
}, },
success : function(res) success : function(res)
{ {
displaySummary(res);
updateDeliveryOption(); updateDeliveryOption();
} }
}); });
@@ -983,7 +982,7 @@
<fieldset id="customer_part"> <fieldset id="customer_part">
<legend><img src="../img/admin/tab-customers.gif" />{l s='Customer'}</legend> <legend><img src="../img/admin/tab-customers.gif" />{l s='Customer'}</legend>
<label>{l s='Search customers:'}</label> <label>{l s='Search customers'}</label>
<div class="margin-form"> <div class="margin-form">
<input type="text" id="customer" value="" /> <input type="text" id="customer" value="" />
<p>{l s='Search a customer by tapping the first letters of his/her name'}</p> <p>{l s='Search a customer by tapping the first letters of his/her name'}</p>
@@ -997,7 +996,7 @@
<form action="{$link->getAdminLink('AdminOrders')|escape:'htmlall':'UTF-8'}&submitAdd{$table}=1" method="post" autocomplete="off"> <form action="{$link->getAdminLink('AdminOrders')|escape:'htmlall':'UTF-8'}&submitAdd{$table}=1" method="post" autocomplete="off">
<fieldset id="products_part" style="display:none;"><legend><img src="../img/t/AdminCatalog.gif" />{l s='Cart'}</legend> <fieldset id="products_part" style="display:none;"><legend><img src="../img/t/AdminCatalog.gif" />{l s='Cart'}</legend>
<div> <div>
<label>{l s='Search a product:'} </label> <label>{l s='Search for a product'} </label>
<div class="margin-form"> <div class="margin-form">
<input type="hidden" value="" id="id_cart" name="id_cart" /> <input type="hidden" value="" id="id_cart" name="id_cart" />
<input type="text" id="product" value="" /> <input type="text" id="product" value="" />
@@ -1021,7 +1020,7 @@
</body> </body>
</html> </html>
</iframe> </iframe>
<p><label for="qty">{l s='Quantity:'}</label><input type="text" name="qty" id="qty" value="1" />&nbsp;<b>{l s='In stock:'}</b>&nbsp;<span id="qty_in_stock"></span></p> <p><label for="qty">{l s='Quantity:'}</label><input type="text" name="qty" id="qty" value="1" />&nbsp;<b>{l s='In stock'}</b>&nbsp;<span id="qty_in_stock"></span></p>
<div class="margin-form"> <div class="margin-form">
<p><input type="submit" onclick="addProduct();return false;" class="button" id="submitAddProduct" value="{l s='Add to cart'}"/></p> <p><input type="submit" onclick="addProduct();return false;" class="button" id="submitAddProduct" value="{l s='Add to cart'}"/></p>
</div> </div>
@@ -1054,7 +1053,7 @@
<p><b>{l s='The prices are without taxes.'}</b></p> <p><b>{l s='The prices are without taxes.'}</b></p>
</div> </div>
<div> <div>
<p><label for="id_currency">{l s='Currency:'}</label> <p><label for="id_currency">{l s='Currency'}</label>
<script type="text/javascript"> <script type="text/javascript">
{foreach from=$currencies item='currency'} {foreach from=$currencies item='currency'}
currencies['{$currency.id_currency}'] = '{$currency.sign}'; currencies['{$currency.id_currency}'] = '{$currency.sign}';
@@ -1067,7 +1066,7 @@
</select> </select>
</p> </p>
<p> <p>
<label for="id_lang">{l s='Language:'}</label> <label for="id_lang">{l s='Language'}</label>
<select id="id_lang" name="id_lang"> <select id="id_lang" name="id_lang">
{foreach from=$langs item='lang'} {foreach from=$langs item='lang'}
<option value="{$lang.id_lang}">{$lang.name}</option> <option value="{$lang.id_lang}">{$lang.name}</option>
@@ -1080,7 +1079,7 @@
<p><a href="#" id="show_old_carts" class="button"></a></p> <p><a href="#" id="show_old_carts" class="button"></a></p>
<div id="old_carts_orders"> <div id="old_carts_orders">
<div id="nonOrderedCarts"> <div id="nonOrderedCarts">
<h3>{l s='Carts:'}</h3> <h3>{l s='Carts'}</h3>
<table cellspacing="0" cellpadding="0" class="table width5"> <table cellspacing="0" cellpadding="0" class="table width5">
<colgroup> <colgroup>
<col width="10px"> <col width="10px">
@@ -1101,7 +1100,7 @@
</table> </table>
</div> </div>
<div id="lastOrders"> <div id="lastOrders">
<h3>{l s='Orders:'}</h3> <h3>{l s='Orders'}</h3>
<table cellspacing="0" cellpadding="0" class="table width5"> <table cellspacing="0" cellpadding="0" class="table width5">
<colgroup> <colgroup>
<col width="10px"> <col width="10px">
@@ -1159,14 +1158,14 @@
<legend><img src="../img/t/AdminAddresses.gif" />{l s='Addresses'}</legend> <legend><img src="../img/t/AdminAddresses.gif" />{l s='Addresses'}</legend>
<div id="addresses_err" class="warn" style="display:none;"></div> <div id="addresses_err" class="warn" style="display:none;"></div>
<div id="address_delivery"> <div id="address_delivery">
<h3>{l s='Delivery:'}</h3> <h3>{l s='Delivery'}</h3>
<select id="id_address_delivery" name="id_address_delivery"> <select id="id_address_delivery" name="id_address_delivery">
</select> </select>
<div id="address_delivery_detail"> <div id="address_delivery_detail">
</div> </div>
</div> </div>
<div id="address_invoice"> <div id="address_invoice">
<h3>{l s='Invoice:'}</h3> <h3>{l s='Invoice'}</h3>
<select id="id_address_invoice" name="id_address_invoice"> <select id="id_address_invoice" name="id_address_invoice">
</select> </select>
<div id="address_invoice_detail"> <div id="address_invoice_detail">
@@ -1176,20 +1175,20 @@
</fieldset> </fieldset>
<br /> <br />
<fieldset id="carriers_part" style="display:none;"> <fieldset id="carriers_part" style="display:none;">
<legend><img src="../img/t/AdminCarriers.gif" />{l s='Shipping:'}</legend> <legend><img src="../img/t/AdminCarriers.gif" />{l s='Shipping'}</legend>
<div id="carriers_err" style="display:none;" class="warn"></div> <div id="carriers_err" style="display:none;" class="warn"></div>
<div id="carrier_form"> <div id="carrier_form">
<div> <div>
<p> <p>
<label>{l s='Delivery option:'} </label> <label>{l s='Delivery option'} </label>
<select name="delivery_option" id="delivery_option"> <select name="delivery_option" id="delivery_option">
</select> </select>
</p> </p>
<p> <p>
<label for="shipping_price">{l s='Shipping price:'}</label> <span id="shipping_price" name="shipping_price"></span>&nbsp;<span class="currency_sign"></span>&nbsp; <label for="shipping_price">{l s='Shipping price'}</label> <span id="shipping_price" name="shipping_price"></span>&nbsp;<span class="currency_sign"></span>&nbsp;
</p> </p>
<p> <p>
<label for="free_shipping">{l s='Free shipping:'}</label> <label for="free_shipping">{l s='Free shipping'}</label>
<input type="checkbox" id="free_shipping" name="free_shipping" value="1" /> <input type="checkbox" id="free_shipping" name="free_shipping" value="1" />
</p> </p>
</div> </div>
@@ -1199,7 +1198,7 @@
{/if} {/if}
{if $gift_wrapping} {if $gift_wrapping}
<p><input type="checkbox" name="order_gift" id="order_gift" value="1" /> <label for="order_gift">{l s='Gift'}</label></p> <p><input type="checkbox" name="order_gift" id="order_gift" value="1" /> <label for="order_gift">{l s='Gift'}</label></p>
<p><label for="gift_message">{l s='Gift message:'}</label><textarea id="gift_message" cols="40" rows="4"></textarea></p> <p><label for="gift_message">{l s='Gift message'}</label><textarea id="gift_message" cols="40" rows="4"></textarea></p>
{/if} {/if}
</div> </div>
</div> </div>
@@ -1210,16 +1209,16 @@
<div id="send_email_feedback"></div> <div id="send_email_feedback"></div>
<div id="cart_summary" style="clear:both;float:left;"> <div id="cart_summary" style="clear:both;float:left;">
<ul> <ul>
<li><span class="total_cart">{l s='Total products:'}</span><span id="total_products"></span><span class="currency_sign"></span></li> <li><span class="total_cart">{l s='Total products'}</span><span id="total_products"></span><span class="currency_sign"></span></li>
<li><span class="total_cart">{l s='Total vouchers:'}</span><span id="total_vouchers"></span><span class="currency_sign"></span></li> <li><span class="total_cart">{l s='Total vouchers'}</span><span id="total_vouchers"></span><span class="currency_sign"></span></li>
<li><span class="total_cart">{l s='Total shipping:'}</span><span id="total_shipping"></span><span class="currency_sign"></span></li> <li><span class="total_cart">{l s='Total shipping'}</span><span id="total_shipping"></span><span class="currency_sign"></span></li>
<li><span class="total_cart">{l s='Total taxes:'}</span><span id="total_taxes"></span><span class="currency_sign"></span></li> <li><span class="total_cart">{l s='Total taxes'}</span><span id="total_taxes"></span><span class="currency_sign"></span></li>
<li><span class="total_cart">{l s='Total without taxes:'}</span><span id="total_without_taxes"></span><span class="currency_sign"></span></li> <li><span class="total_cart">{l s='Total without taxes'}</span><span id="total_without_taxes"></span><span class="currency_sign"></span></li>
<li><span class="total_cart">{l s='Total with taxes:'}</span><span id="total_with_taxes"></span><span class="currency_sign"></span></li> <li><span class="total_cart">{l s='Total with taxes'}</span><span id="total_with_taxes"></span><span class="currency_sign"></span></li>
</ul> </ul>
</div> </div>
<div class="order_message_right"> <div class="order_message_right">
<label for="order_message">{l s='Order message:'}</label> <label for="order_message">{l s='Order message'}</label>
<div class="margin-form"> <div class="margin-form">
<textarea name="order_message" id="order_message" rows="3" cols="45"></textarea> <textarea name="order_message" id="order_message" rows="3" cols="45"></textarea>
</div> </div>
@@ -1229,7 +1228,7 @@
<div class="margin-form"> <div class="margin-form">
<a target="_blank" id="go_order_process" href="" class="button">{l s='Go on payment page to process the payment.'}</a> <a target="_blank" id="go_order_process" href="" class="button">{l s='Go on payment page to process the payment.'}</a>
</div> </div>
<label>{l s='Payment:'}</label> <label>{l s='Payment'}</label>
<div class="margin-form"> <div class="margin-form">
<select name="payment_module_name" id="payment_module_name"> <select name="payment_module_name" id="payment_module_name">
{foreach from=$payment_modules item='module'} {foreach from=$payment_modules item='module'}
@@ -1237,7 +1236,7 @@
{/foreach} {/foreach}
</select> </select>
</div> </div>
<label>{l s='Order status:'}</label> <label>{l s='Order status'}</label>
<div class="margin-form"> <div class="margin-form">
<select name="id_order_state" id="id_order_state"> <select name="id_order_state" id="id_order_state">
{foreach from=$order_states item='order_state'} {foreach from=$order_states item='order_state'}
@@ -84,7 +84,7 @@
</div> </div>
<div class="metadata-command"> <div class="metadata-command">
<dl> <dl>
<dt>{l s='Date:'} </dt> <dt>{l s='Date'} </dt>
<dd>{dateFormat date=$order->date_add full=true}</dd> <dd>{dateFormat date=$order->date_add full=true}</dd>
|</dl> |</dl>
<dl> <dl>
@@ -100,7 +100,7 @@
<dd id="product_number">{sizeof($products)}</dd> <dd id="product_number">{sizeof($products)}</dd>
|</dl> |</dl>
<dl> <dl>
<dt>{l s='Total:'}</dt> <dt>{l s='Total'}</dt>
<dd class="total_paid">{displayPrice price=$order->total_paid_tax_incl currency=$currency->id}</dd> <dd class="total_paid">{displayPrice price=$order->total_paid_tax_incl currency=$currency->id}</dd>
</dl> </dl>
<div class="clear"></div> <div class="clear"></div>
@@ -162,7 +162,7 @@
{if (!Customer::customerExists($customer->email))} {if (!Customer::customerExists($customer->email))}
<form method="post" action="index.php?tab=AdminCustomers&id_customer={$customer->id}&token={getAdminToken tab='AdminCustomers'}"> <form method="post" action="index.php?tab=AdminCustomers&id_customer={$customer->id}&token={getAdminToken tab='AdminCustomers'}">
<input type="hidden" name="id_lang" value="{$order->id_lang}" /> <input type="hidden" name="id_lang" value="{$order->id_lang}" />
<p class="center"><input class="button" type="submit" name="submitGuestToCustomer" value="{l s='Transform guest into customer'}" /></p> <p class="center"><input class="button" type="submit" name="submitGuestToCustomer" value="{l s='Transform a guest into a customer'}" /></p>
{l s='This feature will generate a random password and send an email to the customer.'} {l s='This feature will generate a random password and send an email to the customer.'}
</form> </form>
{else} {else}
@@ -185,9 +185,9 @@
{foreach from=$sources item=source} {foreach from=$sources item=source}
<li> <li>
{dateFormat date=$source['date_add'] full=true}<br /> {dateFormat date=$source['date_add'] full=true}<br />
<b>{l s='From:'}</b>{if $source['http_referer'] != ''}<a href="{$source['http_referer']}">{parse_url($source['http_referer'], $smarty.const.PHP_URL_HOST)|regex_replace:'/^www./':''}</a>{else}-{/if}<br /> <b>{l s='From'}</b>{if $source['http_referer'] != ''}<a href="{$source['http_referer']}">{parse_url($source['http_referer'], $smarty.const.PHP_URL_HOST)|regex_replace:'/^www./':''}</a>{else}-{/if}<br />
<b>{l s='To:'}</b> <a href="http://{$source['request_uri']}">{$source['request_uri']|truncate:100:'...'}</a><br /> <b>{l s='To'}</b> <a href="http://{$source['request_uri']}">{$source['request_uri']|truncate:100:'...'}</a><br />
{if $source['keywords']}<b>{l s='Keywords:'}</b> {$source['keywords']}<br />{/if}<br /> {if $source['keywords']}<b>{l s='Keywords'}</b> {$source['keywords']}<br />{/if}<br />
</li> </li>
{/foreach} {/foreach}
</ul> </ul>
@@ -266,8 +266,8 @@
{if (!$order->valid && sizeof($currencies) > 1)} {if (!$order->valid && sizeof($currencies) > 1)}
<form method="post" action="{$currentIndex}&vieworder&id_order={$order->id}&token={$smarty.get.token|escape:'htmlall':'UTF-8'}"> <form method="post" action="{$currentIndex}&vieworder&id_order={$order->id}&token={$smarty.get.token|escape:'htmlall':'UTF-8'}">
<p class="warn">{l s='Don\'t forget to update your conversion rate before make this change.'}</p> <p class="warn">{l s='Don\'t forget to update your conversion rate before making this change.'}</p>
<label>{l s='Don\'t forget to update your conversion rate before make this change.'}</label> <label>{l s='Don\'t forget to update your conversion rate before making this change.'}</label>
<select name="new_currency"> <select name="new_currency">
{foreach from=$currencies item=currency_change} {foreach from=$currencies item=currency_change}
{if $currency_change['id_currency'] != $order->id_currency} {if $currency_change['id_currency'] != $order->id_currency}
@@ -282,13 +282,13 @@
{if count($order->getOrderPayments()) > 0} {if count($order->getOrderPayments()) > 0}
<p class="error" style="{if round($orders_total_paid_tax_incl, 2) == round($total_paid, 2) || $currentState->id == 6}display: none;{/if}"> <p class="error" style="{if round($orders_total_paid_tax_incl, 2) == round($total_paid, 2) || $currentState->id == 6}display: none;{/if}">
{l s='Warning:'} {displayPrice price=$total_paid currency=$currency->id} {l s='Warning'} {displayPrice price=$total_paid currency=$currency->id}
{l s='paid instead of'} <span class="total_paid">{displayPrice price=$orders_total_paid_tax_incl currency=$currency->id}</span> {l s='paid instead of'} <span class="total_paid">{displayPrice price=$orders_total_paid_tax_incl currency=$currency->id}</span>
{foreach $order->getBrother() as $brother_order} {foreach $order->getBrother() as $brother_order}
{if $brother_order@first} {if $brother_order@first}
{if count($order->getBrother()) == 1} {if count($order->getBrother()) == 1}
<br />{l s='This warning also concerns the order '} <br />{l s='This warning also concerns order '}
{else} {else}
<br />{l s='This warning also concerns the next orders:'} <br />{l s='This warning also concerns the next orders:'}
{/if} {/if}
@@ -339,7 +339,7 @@
<tr class="payment_information" style="display: none;"> <tr class="payment_information" style="display: none;">
<td colspan="6"> <td colspan="6">
<p> <p>
<b>{l s='Card Number:'}</b>&nbsp; <b>{l s='Card Number'}</b>&nbsp;
{if $payment->card_number} {if $payment->card_number}
{$payment->card_number} {$payment->card_number}
{else} {else}
@@ -348,7 +348,7 @@
</p> </p>
<p> <p>
<b>{l s='Card Brand:'}</b>&nbsp; <b>{l s='Card Brand'}</b>&nbsp;
{if $payment->card_brand} {if $payment->card_brand}
{$payment->card_brand} {$payment->card_brand}
{else} {else}
@@ -357,7 +357,7 @@
</p> </p>
<p> <p>
<b>{l s='Card Expiration:'}</b>&nbsp; <b>{l s='Card Expiration'}</b>&nbsp;
{if $payment->card_expiration} {if $payment->card_expiration}
{$payment->card_expiration} {$payment->card_expiration}
{else} {else}
@@ -366,7 +366,7 @@
</p> </p>
<p> <p>
<b>{l s='Card Holder:'}</b>&nbsp; <b>{l s='Card Holder'}</b>&nbsp;
{if $payment->card_holder} {if $payment->card_holder}
{$payment->card_holder} {$payment->card_holder}
{else} {else}
@@ -378,7 +378,7 @@
{foreachelse} {foreachelse}
<tr> <tr>
<td colspan="6" class="center"> <td colspan="6" class="center">
<h3>{l s='No payment available'}</h3> <h3>{l s='No payments are available'}</h3>
</td> </td>
</tr> </tr>
{/foreach} {/foreach}
@@ -422,10 +422,10 @@
<!-- Shipping block --> <!-- Shipping block -->
{if !$order->isVirtual()} {if !$order->isVirtual()}
<fieldset> <fieldset>
<legend><img src="../img/admin/delivery.gif" /> {l s='Shipping:'}</legend> <legend><img src="../img/admin/delivery.gif" /> {l s='Shipping'}</legend>
<div class="clear" style="float: left; margin-right: 10px;"> <div class="clear" style="float: left; margin-right: 10px;">
<span>{l s='Recycled packaging:'}</span> <span>{l s='Recycled packaging'}</span>
{if $order->recyclable} {if $order->recyclable}
<img src="../img/admin/enabled.gif" /> <img src="../img/admin/enabled.gif" />
{else} {else}
@@ -433,13 +433,13 @@
{/if} {/if}
</div> </div>
<div style="float: left;"> <div style="float: left;">
<span>{l s='Gift-wrapping:'}</span> <span>{l s='Gift wrapping'}</span>
{if $order->gift} {if $order->gift}
<img src="../img/admin/enabled.gif" /> <img src="../img/admin/enabled.gif" />
</div> </div>
<div style="clear: left; margin: 0px 42px 0px 42px; padding-top: 2px;"> <div style="clear: left; margin: 0px 42px 0px 42px; padding-top: 2px;">
{if $order->gift_message} {if $order->gift_message}
<div style="border: 1px dashed #999; padding: 5px; margin-top: 8px;"><b>{l s='Message:'}</b><br />{$order->gift_message|nl2br}</div> <div style="border: 1px dashed #999; padding: 5px; margin-top: 8px;"><b>{l s='Message'}</b><br />{$order->gift_message|nl2br}</div>
{/if} {/if}
{else} {else}
<img src="../img/admin/disabled.gif" /> <img src="../img/admin/disabled.gif" />
@@ -661,7 +661,7 @@
<td class="partial_refund_fields current-edit" style="display:none;">&nbsp;</td> <td class="partial_refund_fields current-edit" style="display:none;">&nbsp;</td>
</tr> </tr>
<tr id="total_shipping"> <tr id="total_shipping">
<td><b>{l s='Shipping:'}</b></td> <td><b>{l s='Shipping'}</b></td>
<td class="amount" align="right">{displayPrice price=$order->total_shipping_tax_incl currency=$currency->id}</td> <td class="amount" align="right">{displayPrice price=$order->total_shipping_tax_incl currency=$currency->id}</td>
<td class="partial_refund_fields current-edit" style="display:none;">{$currency->prefix}<input type="text" size="3" name="partialRefundShippingCost" value="0" />{$currency->suffix}</td> <td class="partial_refund_fields current-edit" style="display:none;">{$currency->prefix}<input type="text" size="3" name="partialRefundShippingCost" value="0" />{$currency->suffix}</td>
</tr> </tr>
@@ -780,7 +780,7 @@
{/if} {/if}
{l s='At'} <i>{dateFormat date=$message['date_add']} {l s='At'} <i>{dateFormat date=$message['date_add']}
</i> {l s='from'} <b>{if ($message['elastname']|escape:'htmlall':'UTF-8')}{$message['efirstname']|escape:'htmlall':'UTF-8'} {$message['elastname']|escape:'htmlall':'UTF-8'}{else}{$message['cfirstname']|escape:'htmlall':'UTF-8'} {$message['clastname']|escape:'htmlall':'UTF-8'}{/if}</b> </i> {l s='from'} <b>{if ($message['elastname']|escape:'htmlall':'UTF-8')}{$message['efirstname']|escape:'htmlall':'UTF-8'} {$message['elastname']|escape:'htmlall':'UTF-8'}{else}{$message['cfirstname']|escape:'htmlall':'UTF-8'} {$message['clastname']|escape:'htmlall':'UTF-8'}{/if}</b>
{if ($message['private'] == 1)}<span style="color:red; font-weight:bold;">{l s='Private:'}</span>{/if} {if ($message['private'] == 1)}<span style="color:red; font-weight:bold;">{l s='Private'}</span>{/if}
<p>{$message['message']|escape:'htmlall':'UTF-8'|nl2br}</p> <p>{$message['message']|escape:'htmlall':'UTF-8'|nl2br}</p>
</div> </div>
<br /> <br />
@@ -48,7 +48,7 @@
{/foreach} {/foreach}
</div> </div>
<div class="clear">&nbsp;</div> <div class="clear">&nbsp;</div>
<label>{l s='File'}</label> <label>{l s='File:'}</label>
<div class="margin-form"> <div class="margin-form">
<p><input type="file" name="attachment_file" /></p> <p><input type="file" name="attachment_file" /></p>
<p class="preference_description">{l s='Upload a file from your computer'} ({$PS_ATTACHMENT_MAXIMUM_SIZE|string_format:"%.2f"} {l s='MB max.'})</p> <p class="preference_description">{l s='Upload a file from your computer'} ({$PS_ATTACHMENT_MAXIMUM_SIZE|string_format:"%.2f"} {l s='MB max.'})</p>
@@ -46,9 +46,9 @@
{/foreach} {/foreach}
</script> </script>
<h4>{l s='Add or modify combinations for this product.'}</h4> <h4>{l s='Add or modify combinations for this product.'}</h4>
<div class="separation"></div> {l s='or use the'} <div class="separation"></div> {l s='Or use the'}
&nbsp;<a class="button bt-icon confirm_leave" href="index.php?tab=AdminAttributeGenerator&id_product={$product->id}&attributegenerator&token={$token_generator}"><img src="../img/admin/appearance.gif" alt="combinations_generator" class="middle" title="{l s='Product combinations generator'}" /><span>{l s='Product combinations generator'}</span></a> &nbsp;<a class="button bt-icon confirm_leave" href="index.php?tab=AdminAttributeGenerator&id_product={$product->id}&attributegenerator&token={$token_generator}"><img src="../img/admin/appearance.gif" alt="combinations_generator" class="middle" title="{l s='Product combinations generator'}" /><span>{l s='Product combinations generator'}</span></a>
{l s='in order to automatically create a set of combinations'} {l s='in order to automatically create a set of combinations.'}
{if $combination_exists} {if $combination_exists}
<div class="warn" style="display:block"> <div class="warn" style="display:block">
<ul> <ul>
@@ -131,7 +131,7 @@
<td style="padding-bottom:5px;"> <td style="padding-bottom:5px;">
{if $currency->format % 2 != 0}{$currency->sign}{/if} {if $currency->format % 2 != 0}{$currency->sign}{/if}
<input type="text" size="6" name="attribute_wholesale_price" id="attribute_wholesale_price" value="" onKeyUp="if (isArrowKey(event)) return ;this.value = this.value.replace(/,/g, '.');" /> <input type="text" size="6" name="attribute_wholesale_price" id="attribute_wholesale_price" value="" onKeyUp="if (isArrowKey(event)) return ;this.value = this.value.replace(/,/g, '.');" />
{if $currency->format % 2 == 0} {$currency->sign} {/if}<span id="attribute_wholesale_price_blank">({l s='leave blank if the price does not change'})</span> {if $currency->format % 2 == 0} {$currency->sign} {/if}<span id="attribute_wholesale_price_blank">({l s='Leave blank if the price does not change'})</span>
<span style="display:none" id="attribute_wholesale_price_full">({l s='Overrides wholesale price on "Information" tab'})</span> <span style="display:none" id="attribute_wholesale_price_full">({l s='Overrides wholesale price on "Information" tab'})</span>
</td> </td>
</tr> </tr>
@@ -84,7 +84,7 @@
<p class="clear" style="padding:10px 0 0 0"> <p class="clear" style="padding:10px 0 0 0">
<a style="cursor:pointer" class="button" <a style="cursor:pointer" class="button"
onmousedown="updateFriendlyURLByName();">{l s='Generate'}</a>&nbsp; onmousedown="updateFriendlyURLByName();">{l s='Generate'}</a>&nbsp;
{l s='Friendly URL. From the product name.'}<br /><br /> {l s='friendly URL from the product name.'}<br /><br />
{l s='The product link will look like this:'} {l s='The product link will look like this:'}
{$curent_shop_url|escape:'htmlall':'UTF-8'}lang/{if isset($product->id)}{$product->id}{else}<b>id_product</b>{/if}-<span id="friendly-url">{$product->link_rewrite[$default_language]}</span>.html</p> {$curent_shop_url|escape:'htmlall':'UTF-8'}lang/{if isset($product->id)}{$product->id}{else}<b>id_product</b>{/if}-<span id="friendly-url">{$product->link_rewrite[$default_language]}</span>.html</p>
</td> </td>
@@ -25,7 +25,7 @@
<input type="hidden" name="submitted_tabs[]" value="Shipping" /> <input type="hidden" name="submitted_tabs[]" value="Shipping" />
<h4 class="tab">1. {l s='Info.'}</h4> <h4 class="tab">1. {l s='Info.'}</h4>
<h4>{l s='Shipping:'}</h4> <h4>{l s='Shipping'}</h4>
{if isset($display_common_field) && $display_common_field} {if isset($display_common_field) && $display_common_field}
<div class="hint" style="display: block">{l s='Warning, if you change the value of fields with an orange bullet %s, the value will be changed for all other shops for this product' sprintf=$bullet_common_field}</div> <div class="hint" style="display: block">{l s='Warning, if you change the value of fields with an orange bullet %s, the value will be changed for all other shops for this product' sprintf=$bullet_common_field}</div>
@@ -36,7 +36,7 @@
</div> </div>
<p>{l s='Please choose the suppliers associated with this product. Please select a default supplier, as well.'}</p> <p>{l s='Please choose the suppliers associated with this product. Please select a default supplier, as well.'}</p>
<a class="button bt-icon confirm_leave" href="{$link->getAdminLink('AdminSuppliers')|escape:'htmlall':'UTF-8'}&addsupplier"> <a class="button bt-icon confirm_leave" href="{$link->getAdminLink('AdminSuppliers')|escape:'htmlall':'UTF-8'}&addsupplier">
<img src="../img/admin/add.gif" alt="{l s='Create a new supplier.'}" title="{l s='Create a new supplier.'}" /><span>{l s='Create a new supplier.'}</span> <img src="../img/admin/add.gif" alt="{l s='Create a new supplier'}" title="{l s='Create a new supplier'}" /><span>{l s='Create a new supplier'}</span>
</a> </a>
<table cellpadding="5" style="width:100%"> <table cellpadding="5" style="width:100%">
<tbody> <tbody>
@@ -116,7 +116,7 @@
</select> </select>
</div> </div>
<br class="clear" /> <br class="clear" />
<label>{l s='Search:'}</label> <label>{l s='Search'}</label>
<div class="margin-left"> <div class="margin-left">
<input type="text" size="34" id="filterProduct" name="filterProduct" onkeyup="fillProducts();" /> <input type="text" size="34" id="filterProduct" name="filterProduct" onkeyup="fillProducts();" />
</div> </div>
@@ -37,7 +37,7 @@
<div id="condition_list"> <div id="condition_list">
<h3>{l s='Conditions'}</h3> <h3>{l s='Conditions'}</h3>
<div class="row"> <div class="row">
<label for="id_category">{l s='Category:'}</label> <label for="id_category">{l s='Category'}</label>
<div class="margin-form"> <div class="margin-form">
<select id="id_category" name="id_category"> <select id="id_category" name="id_category">
{foreach from=$categories item='category'} {foreach from=$categories item='category'}
@@ -52,7 +52,7 @@
</div> </div>
<div class="row"> <div class="row">
<label for="id_manufacturer">{l s='Manufacturer:'}</label> <label for="id_manufacturer">{l s='Manufacturer'}</label>
<div class="margin-form"> <div class="margin-form">
<select id="id_manufacturer" name="id_manufacturer"> <select id="id_manufacturer" name="id_manufacturer">
{foreach from=$manufacturers item='manufacturer'} {foreach from=$manufacturers item='manufacturer'}
@@ -67,7 +67,7 @@
</div> </div>
<div class="row"> <div class="row">
<label for="id_supplier">{l s='Supplier:'}</label> <label for="id_supplier">{l s='Supplier'}</label>
<div class="margin-form"> <div class="margin-form">
<select id="id_supplier" name="id_supplier"> <select id="id_supplier" name="id_supplier">
{foreach from=$suppliers item='supplier'} {foreach from=$suppliers item='supplier'}
@@ -82,7 +82,7 @@
</div> </div>
<div class="row"> <div class="row">
<label for="id_attribute">{l s='Attributes:'}</label> <label for="id_attribute">{l s='Attributes'}</label>
<div class="margin-form"> <div class="margin-form">
<select id="id_attribute_group"> <select id="id_attribute_group">
{foreach from=$attributes_group item='attribute_group'} {foreach from=$attributes_group item='attribute_group'}
@@ -105,7 +105,7 @@
</div> </div>
<div class="row"> <div class="row">
<label for="id_attribute">{l s='Features:'}</label> <label for="id_attribute">{l s='Features'}</label>
<div class="margin-form"> <div class="margin-form">
<select id="id_feature"> <select id="id_feature">
{foreach from=$features item='feature'} {foreach from=$features item='feature'}
@@ -35,7 +35,7 @@
{if !$product->hasAttributes()} {if !$product->hasAttributes()}
<table border="0" cellpadding="0" cellspacing="0" class="table" style=""> <table border="0" cellpadding="0" cellspacing="0" class="table" style="">
<tr> <tr>
<th width="450">{l s='Name:'} {$product->name}</th> <th width="450">{l s='Name'} {$product->name}</th>
{if !empty($product->product_supplier_reference)}<th width="190">{l s='Supplier Reference:'} {$product->product_supplier_reference}</th>{/if} {if !empty($product->product_supplier_reference)}<th width="190">{l s='Supplier Reference:'} {$product->product_supplier_reference}</th>{/if}
{if !empty($product->product_supplier_price_te)}<th width="190">{l s='Wholesale price:'} {$product->product_supplier_price_te}</th>{/if} {if !empty($product->product_supplier_price_te)}<th width="190">{l s='Wholesale price:'} {$product->product_supplier_price_te}</th>{/if}
{if !empty($product->reference)}<th width="150">{l s='Reference:'} {$product->reference}</th>{/if} {if !empty($product->reference)}<th width="150">{l s='Reference:'} {$product->reference}</th>{/if}
@@ -55,8 +55,8 @@
<fieldset> <fieldset>
<legend><img src="../img/admin/translation.gif" />{l s='Modify translations'}</legend> <legend><img src="../img/admin/translation.gif" />{l s='Modify translations'}</legend>
{l s='Here you can modify translations for every line of copy inside PrestaShop.'}<br /> {l s='Here you can modify translations for every line of code inside PrestaShop.'}<br />
{l s='First, select a section (such as Back Office or Modules), then click the flag representing the language you want to edit.'}<br /><br /> {l s='First, select a section (such as Back Office or Installed modules), and then click the flag representing the language you want to edit.'}<br /><br />
<form method="get" action="index.php" id="typeTranslationForm"> <form method="get" action="index.php" id="typeTranslationForm">
<input type="hidden" name="controller" value="AdminTranslations" /> <input type="hidden" name="controller" value="AdminTranslations" />
<input type="hidden" name="lang" id="translation_lang" value="0" /> <input type="hidden" name="lang" id="translation_lang" value="0" />
@@ -117,7 +117,7 @@
<form action="{$url_submit}" method="post" enctype="multipart/form-data"> <form action="{$url_submit}" method="post" enctype="multipart/form-data">
<fieldset> <fieldset>
<legend> <legend>
<img src="../img/admin/import.gif" />{l s='Import a language pack manually.'} <img src="../img/admin/import.gif" />{l s='Import a language pack manually'}
</legend> </legend>
<div id="submitImportContent"> <div id="submitImportContent">
<p> <p>
@@ -34,7 +34,7 @@
<b>{$limit_warning['post.max_vars']}</b> {l s='for suhosin.post.max_vars.'}<br/> <b>{$limit_warning['post.max_vars']}</b> {l s='for suhosin.post.max_vars.'}<br/>
<b>{$limit_warning['request.max_vars']}</b> {l s='for suhosin.request.max_vars.'}<br/> <b>{$limit_warning['request.max_vars']}</b> {l s='for suhosin.request.max_vars.'}<br/>
{l s='Please ask your hosting provider to increase the suhosin post and request a limit of'} {l s='Please ask your hosting provider to increase the suhosin limit to'}
{else} {else}
{l s='Warning! Your PHP configuration limits the maximum number of fields allowed in a form:'}<br/> {l s='Warning! Your PHP configuration limits the maximum number of fields allowed in a form:'}<br/>
<b>{$limit_warning['max_input_vars']}</b> {l s='for max_input_vars.'}<br/> <b>{$limit_warning['max_input_vars']}</b> {l s='for max_input_vars.'}<br/>
@@ -34,7 +34,7 @@
<b>{$limit_warning['post.max_vars']}</b> {l s='for suhosin.post.max_vars.'}<br/> <b>{$limit_warning['post.max_vars']}</b> {l s='for suhosin.post.max_vars.'}<br/>
<b>{$limit_warning['request.max_vars']}</b> {l s='for suhosin.request.max_vars.'}<br/> <b>{$limit_warning['request.max_vars']}</b> {l s='for suhosin.request.max_vars.'}<br/>
{l s='Please ask your hosting provider to increase the suhosin post and request a limit of'} {l s='Please ask your hosting provider to increase the suhosin limit to'}
{else} {else}
{l s='Warning! Your PHP configuration limits the maximum number of fields allowed in a form:'} {l s='Warning! Your PHP configuration limits the maximum number of fields allowed in a form:'}
<b>{$limit_warning['max_input_vars']}</b> {l s='for max_input_vars.'}<br/> <b>{$limit_warning['max_input_vars']}</b> {l s='for max_input_vars.'}<br/>
@@ -46,7 +46,7 @@
<div class="hint" style="display:block;"> <div class="hint" style="display:block;">
<ul style="margin-left:30px;list-style-type:disc;"> <ul style="margin-left:30px;list-style-type:disc;">
<li>{l s='Click on the titles to open fieldsets'}.</li> <li>{l s='Click on titles to open fieldsets'}.</li>
<li>{l s='Some sentences to translate use this syntax: %s... These are variables, and PrestaShop take care of replacing them before displaying your translation. You must leave these in your translations, and place them appropriately in your sentence.' sprintf='%d, %s, %1$s, %2$d'}</li> <li>{l s='Some sentences to translate use this syntax: %s... These are variables, and PrestaShop take care of replacing them before displaying your translation. You must leave these in your translations, and place them appropriately in your sentence.' sprintf='%d, %s, %1$s, %2$d'}</li>
</ul> </ul>
</div><br /><br /> </div><br /><br />
@@ -36,7 +36,7 @@
<b>{$limit_warning['post.max_vars']}</b> {l s='for suhosin.post.max_vars.'}<br/> <b>{$limit_warning['post.max_vars']}</b> {l s='for suhosin.post.max_vars.'}<br/>
<b>{$limit_warning['request.max_vars']}</b> {l s='for suhosin.request.max_vars.'}<br/> <b>{$limit_warning['request.max_vars']}</b> {l s='for suhosin.request.max_vars.'}<br/>
{l s='Please ask your hosting provider to increase the suhosin post and request a limit of'} {l s='Please ask your hosting provider to increase the suhosin limit to'}
{else} {else}
{l s='Warning! Your PHP configuration limits the maximum number of fields allowed in a form:'}<br/> {l s='Warning! Your PHP configuration limits the maximum number of fields allowed in a form:'}<br/>
<b>{$limit_warning['max_input_vars']}</b> {l s='for max_input_vars.'}<br/> <b>{$limit_warning['max_input_vars']}</b> {l s='for max_input_vars.'}<br/>
@@ -48,7 +48,7 @@
<div class="hint" style="display:block;"> <div class="hint" style="display:block;">
<ul style="margin-left:30px;list-style-type:disc;"> <ul style="margin-left:30px;list-style-type:disc;">
<li>{l s='Click on the titles to open fieldsets'}.</li> <li>{l s='Click on titles to open fieldsets'}.</li>
<li>{l s='Some sentences to translate use this syntax: %s... These are variables, and PrestaShop take care of replacing them before displaying your translation. You must leave these in your translations, and place them appropriately in your sentence.' sprintf='%d, %s, %1$s, %2$d'}</li> <li>{l s='Some sentences to translate use this syntax: %s... These are variables, and PrestaShop take care of replacing them before displaying your translation. You must leave these in your translations, and place them appropriately in your sentence.' sprintf='%d, %s, %1$s, %2$d'}</li>
</ul> </ul>
</div><br /><br /> </div><br /><br />
@@ -34,7 +34,7 @@
<b>{$limit_warning['post.max_vars']}</b> {l s='for suhosin.post.max_vars.'}<br/> <b>{$limit_warning['post.max_vars']}</b> {l s='for suhosin.post.max_vars.'}<br/>
<b>{$limit_warning['request.max_vars']}</b> {l s='for suhosin.request.max_vars.'}<br/> <b>{$limit_warning['request.max_vars']}</b> {l s='for suhosin.request.max_vars.'}<br/>
{l s='Please ask your hosting provider to increase the suhosin post and request a limit of'} {l s='Please ask your hosting provider to increase the suhosin limit to'}
{else} {else}
{l s='Warning! Your PHP configuration limits the maximum number of fields allowed in a form:'}<br/> {l s='Warning! Your PHP configuration limits the maximum number of fields allowed in a form:'}<br/>
<b>{$limit_warning['max_input_vars']}</b> {l s='for max_input_vars.'}<br/> <b>{$limit_warning['max_input_vars']}</b> {l s='for max_input_vars.'}<br/>
@@ -46,7 +46,7 @@
<div class="hint" style="display:block;"> <div class="hint" style="display:block;">
<ul style="margin-left:30px;list-style-type:disc;"> <ul style="margin-left:30px;list-style-type:disc;">
<li>{l s='Click on the titles to open fieldsets'}.</li> <li>{l s='Click on titles to open fieldsets'}.</li>
<li>{l s='Some sentences to translate use this syntax: %s... These are variables, and PrestaShop take care of replacing them before displaying your translation. You must leave these in your translations, and place them appropriately in your sentence.' sprintf='%d, %s, %1$s, %2$d'}</li> <li>{l s='Some sentences to translate use this syntax: %s... These are variables, and PrestaShop take care of replacing them before displaying your translation. You must leave these in your translations, and place them appropriately in your sentence.' sprintf='%d, %s, %1$s, %2$d'}</li>
</ul> </ul>
</div><br /><br /> </div><br /><br />
@@ -59,7 +59,7 @@
<td>{$currency->name} ({$currency->sign})</td> <td>{$currency->name} ({$currency->sign})</td>
</tr> </tr>
<tr> <tr>
<td>{l s='Products:'}</td> <td>{l s='Products'}</td>
<td>{$warehouse_num_products} {l s='References:'}</td> <td>{$warehouse_num_products} {l s='References:'}</td>
</tr> </tr>
<tr> <tr>
@@ -50,7 +50,7 @@
<input type="hidden" name="{$input.name}" id="{$input.name}" value="{$fields_value[$input.name]|escape:'htmlall':'UTF-8'}" /> <input type="hidden" name="{$input.name}" id="{$input.name}" value="{$fields_value[$input.name]|escape:'htmlall':'UTF-8'}" />
{else} {else}
{if $input.name == 'id_state'} {if $input.name == 'id_state'}
<div id="contains_states" {if $contains_states}style="display:none;"{/if}> <div id="contains_states" {if !$contains_states}style="display:none;"{/if}>
{/if} {/if}
{block name="label"} {block name="label"}
{if isset($input.label)}<label>{$input.label} </label>{/if} {if isset($input.label)}<label>{$input.label} </label>{/if}
@@ -318,7 +318,7 @@
{if isset($input.required) && $input.required && $input.type != 'radio'} <sup>*</sup>{/if} {if isset($input.required) && $input.required && $input.type != 'radio'} <sup>*</sup>{/if}
{/block}{* end block input *} {/block}{* end block input *}
{block name="description"} {block name="description"}
{if isset($input.desc)} {if isset($input.desc) && !empty($input.desc)}
<p class="preference_description"> <p class="preference_description">
{if is_array($input.desc)} {if is_array($input.desc)}
{foreach $input.desc as $p} {foreach $input.desc as $p}
@@ -82,7 +82,9 @@
{elseif isset($params.image)} {elseif isset($params.image)}
{$tr.$key} {$tr.$key}
{elseif isset($params.icon)} {elseif isset($params.icon)}
<img src="../img/admin/{$tr[$key]['src']}" alt="{$tr[$key]['alt']}" title="{$tr[$key]['alt']}" /> {if is_array($tr[$key])}
<img src="../img/admin/{$tr[$key]['src']}" alt="{$tr[$key]['alt']}" title="{$tr[$key]['alt']}" />
{/if}
{elseif isset($params.price)} {elseif isset($params.price)}
{$tr.$key} {$tr.$key}
{elseif isset($params.float)} {elseif isset($params.float)}
+41 -50
View File
@@ -24,7 +24,7 @@
*} *}
<div class="toolbar-placeholder"> <div class="toolbar-placeholder">
<div class="toolbarBox {if $toolbar_scroll}toolbarHead{/if} {if isset($tab_modules_list)}toolbarReduced{/if}"> <div class="toolbarBox {if $toolbar_scroll}toolbarHead{/if}">
{block name=toolbarBox} {block name=toolbarBox}
<ul class="cc_button"> <ul class="cc_button">
{foreach from=$toolbar_btn item=btn key=k} {foreach from=$toolbar_btn item=btn key=k}
@@ -33,6 +33,15 @@
<span class="process-icon-{if isset($btn.imgclass)}{$btn.imgclass}{else}{$k}{/if} {if isset($btn.class)}{$btn.class}{/if}" ></span> <span class="process-icon-{if isset($btn.imgclass)}{$btn.imgclass}{else}{$k}{/if} {if isset($btn.class)}{$btn.class}{/if}" ></span>
<div {if isset($btn.force_desc) && $btn.force_desc == true } class="locked" {/if}>{$btn.desc}</div> <div {if isset($btn.force_desc) && $btn.force_desc == true } class="locked" {/if}>{$btn.desc}</div>
</a> </a>
{if $k == 'modules-list'}
<div id="modules_list_container" style="display:none">
<div style="float:right;top:-5px">
<a href="#" onclick="$('#modules_list_container').slideUp();return false;"><img alt="X" src="../img/admin/close.png"></a>
</div>
<div id="modules_list_loader"><img src="../img/loader.gif" alt="" border="0"></div>
<div id="modules_list_container_tab" style="display:none;"></div>
</div>
{/if}
</li> </li>
{/foreach} {/foreach}
</ul> </ul>
@@ -108,51 +117,13 @@
} }
{/block} {/block}
} }
}); {if isset($tab_modules_open)}
//]]> if ({$tab_modules_open})
</script> openModulesList();
{/block}
<div class="pageTitle">
<h3>{block name=pageTitle}
<span id="current_obj" style="font-weight: normal;">
{if $title}
{foreach $title as $key => $item name=title}
{* Use strip_tags because if the string already has been through htmlentities using escape will break it *}
<span class="breadcrumb item-{$key} ">{$item|strip_tags}
{if !$smarty.foreach.title.last}
<img alt="&gt;" style="margin-right:5px" src="../img/admin/separator_breadcrumb.png" />
{/if}
</span>
{/foreach}
{else}
&nbsp;
{/if} {/if}
</span> });
{/block} {if isset($tab_modules_list)}
</h3> $('.process-icon-modules-list').parent('a').unbind().bind('click', function (){
</div>
</div>
{if isset($tab_modules_list)}
<button id="modules_list_button">
{l s='Modules list'}
</button>
<div class="clear">&nbsp;</div>
<div id="modules_list_container" style="display:none">
<div style="float:right;top:-5px">
<a href="#" onclick="$('#modules_list_container').slideUp();return false;"><img alt="X" src="../img/admin/close.png"></a>
</div>
<div id="modules_list_loader"><img src="../img/loader.gif" alt="" border="0"></div>
<div id="modules_list_container_tab" style="display:none"></div>
</div>
<script language="javascript" type="text/javascript">
//<![CDATA[
{if isset($tab_modules_open)}
if ({$tab_modules_open})
openModulesList();
{/if}
{if isset($tab_modules_list)}
$('#modules_list_button').bind('click', function (){
openModulesList(); openModulesList();
}); });
@@ -187,8 +158,28 @@
} }
return false; return false;
} }
{/if} {/if}
//]]> //]]>
</script> </script>
{/if} {/block}
</div> <div class="pageTitle">
<h3>{block name=pageTitle}
<span id="current_obj" style="font-weight: normal;">
{if $title}
{foreach $title as $key => $item name=title}
{* Use strip_tags because if the string already has been through htmlentities using escape will break it *}
<span class="breadcrumb item-{$key} ">{$item|strip_tags}
{if !$smarty.foreach.title.last}
<img alt="&gt;" style="margin-right:5px" src="../img/admin/separator_breadcrumb.png" />
{/if}
</span>
{/foreach}
{else}
&nbsp;
{/if}
</span>
{/block}
</h3>
</div>
</div>
</div>
+2 -2
View File
@@ -142,7 +142,7 @@ class Autoload
do do
{ {
$integrity_is_ok = false; $integrity_is_ok = false;
file_put_contents($filename, $content); file_put_contents($filename, $content, LOCK_EX);
if ($loop_protection++ > 10) if ($loop_protection++ > 10)
break; break;
@@ -154,7 +154,7 @@ class Autoload
if (!$integrity_is_ok) if (!$integrity_is_ok)
{ {
file_put_contents($filename, '<?php return array(); ?>'); file_put_contents($filename, '<?php return array(); ?>', LOCK_EX);
// Cannot use PrestaShopException in this context // Cannot use PrestaShopException in this context
die('Your file '.$filename.' is corrupted. Please remove this file, a new one will be regenerated automatically'); die('Your file '.$filename.' is corrupted. Please remove this file, a new one will be regenerated automatically');
} }
+1 -1
View File
@@ -1195,7 +1195,7 @@ class CarrierCore extends ObjectModel
$carrier_list = $available_carrier_list; $carrier_list = $available_carrier_list;
if (isset($warehouse_carrier_list)) if (isset($warehouse_carrier_list))
$carrier_list = array_intersect($carrier_list, $warehouse_carrier_list); $carrier_list = array_intersect($carrier_list, $warehouse_carrier_list);
if ($product->width > 0 || $product->height > 0 || $product->depth > 0 || $product->weight > 0) if ($product->width > 0 || $product->height > 0 || $product->depth > 0 || $product->weight > 0)
{ {
+1 -1
View File
@@ -1701,7 +1701,7 @@ class CartCore extends ObjectModel
if (!$this->allow_seperated_package) if (!$this->allow_seperated_package)
$key = 'in_stock'; $key = 'in_stock';
else else
$key = (!$product['out_of_stock']) ? 'in_stock' : 'out_of_stock'; $key = $product['in_stock'] ? 'in_stock' : 'out_of_stock';
if (empty($product['carrier_list'])) if (empty($product['carrier_list']))
$product['carrier_list'] = array(0); $product['carrier_list'] = array(0);
+10 -6
View File
@@ -445,8 +445,9 @@ class CartRuleCore extends ObjectModel
$id_cart_rule = (int)Db::getInstance()->getValue(' $id_cart_rule = (int)Db::getInstance()->getValue('
SELECT crc.id_cart_rule SELECT crc.id_cart_rule
FROM '._DB_PREFIX_.'cart_rule_carrier crc FROM '._DB_PREFIX_.'cart_rule_carrier crc
INNER JOIN '._DB_PREFIX_.'carrier c ON (c.id_reference = crc.id_carrier AND c.deleted = 0)
WHERE crc.id_cart_rule = '.(int)$this->id.' WHERE crc.id_cart_rule = '.(int)$this->id.'
AND crc.id_carrier = '.(int)$context->cart->id_carrier); AND c.id_carrier = '.(int)$context->cart->id_carrier);
if (!$id_cart_rule) if (!$id_cart_rule)
return (!$display_error) ? false : Tools::displayError('You cannot use this voucher with this carrier'); return (!$display_error) ? false : Tools::displayError('You cannot use this voucher with this carrier');
} }
@@ -762,10 +763,11 @@ class CartRuleCore extends ObjectModel
else else
{ {
$data = Db::getInstance()->executeS(' $data = Db::getInstance()->executeS('
SELECT crc.id_cart_rule, crc.id_carrier SELECT crc.id_cart_rule, c.id_carrier
FROM '._DB_PREFIX_.'cart_rule_carrier crc FROM '._DB_PREFIX_.'cart_rule_carrier crc
INNER JOIN '._DB_PREFIX_.'carrier c ON (c.id_reference = crc.id_carrier AND c.deleted = 0)
WHERE crc.id_cart_rule = '.(int)$this->id.' WHERE crc.id_cart_rule = '.(int)$this->id.'
AND crc.id_carrier = '.(int)$context->cart->id_carrier); AND c.id_carrier = '.(int)$context->cart->id_carrier);
if ($data) if ($data)
foreach ($data as $cart_rule) foreach ($data as $cart_rule)
@@ -1032,9 +1034,10 @@ class CartRuleCore extends ObjectModel
SELECT t.*'.($i18n ? ', tl.*' : '').', IF(crt.id_'.$type.' IS NULL, 0, 1) as selected SELECT t.*'.($i18n ? ', tl.*' : '').', IF(crt.id_'.$type.' IS NULL, 0, 1) as selected
FROM `'._DB_PREFIX_.$type.'` t FROM `'._DB_PREFIX_.$type.'` t
'.($i18n ? 'LEFT JOIN `'._DB_PREFIX_.$type.'_lang` tl ON (t.id_'.$type.' = tl.id_'.$type.' AND tl.id_lang = '.(int)Context::getContext()->language->id.')' : '').' '.($i18n ? 'LEFT JOIN `'._DB_PREFIX_.$type.'_lang` tl ON (t.id_'.$type.' = tl.id_'.$type.' AND tl.id_lang = '.(int)Context::getContext()->language->id.')' : '').'
LEFT JOIN (SELECT id_'.$type.' FROM `'._DB_PREFIX_.'cart_rule_'.$type.'` WHERE id_cart_rule = '.(int)$this->id.') crt ON t.id_'.$type.' = crt.id_'.$type.' LEFT JOIN (SELECT id_'.$type.' FROM `'._DB_PREFIX_.'cart_rule_'.$type.'` WHERE id_cart_rule = '.(int)$this->id.') crt ON t.id_'.($type == 'carrier' ? 'reference' : $type).' = crt.id_'.$type.'
WHERE 1 '.($active_only ? ' AND t.active = 1' : ''). WHERE 1 '.($active_only ? ' AND t.active = 1' : '').
$shop_list. $shop_list
.(in_array($type, array('carrier', 'shop')) ? ' AND t.deleted = 0' : '').
' ORDER BY name ASC', ' ORDER BY name ASC',
false); false);
while ($row = Db::getInstance()->nextRow($resource)) while ($row = Db::getInstance()->nextRow($resource))
@@ -1081,6 +1084,7 @@ class CartRuleCore extends ObjectModel
FROM '._DB_PREFIX_.'cart_rule cr FROM '._DB_PREFIX_.'cart_rule cr
LEFT JOIN '._DB_PREFIX_.'cart_rule_shop crs ON cr.id_cart_rule = crs.id_cart_rule LEFT JOIN '._DB_PREFIX_.'cart_rule_shop crs ON cr.id_cart_rule = crs.id_cart_rule
LEFT JOIN '._DB_PREFIX_.'cart_rule_carrier crca ON cr.id_cart_rule = crca.id_cart_rule LEFT JOIN '._DB_PREFIX_.'cart_rule_carrier crca ON cr.id_cart_rule = crca.id_cart_rule
'.($context->cart->id_carrier ? 'INNER JOIN '._DB_PREFIX_.'carrier c ON (c.id_reference = crca.id_carrier AND c.deleted = 0)' : '').'
LEFT JOIN '._DB_PREFIX_.'cart_rule_country crco ON cr.id_cart_rule = crco.id_cart_rule LEFT JOIN '._DB_PREFIX_.'cart_rule_country crco ON cr.id_cart_rule = crco.id_cart_rule
WHERE cr.active = 1 WHERE cr.active = 1
AND cr.code = "" AND cr.code = ""
@@ -1093,7 +1097,7 @@ class CartRuleCore extends ObjectModel
) )
AND ( AND (
cr.carrier_restriction = 0 cr.carrier_restriction = 0
'.($context->cart->id_carrier ? 'OR crca.id_carrier = '.(int)$context->cart->id_carrier : '').' '.($context->cart->id_carrier ? 'OR c.id_carrier = '.(int)$context->cart->id_carrier : '').'
) )
AND ( AND (
cr.shop_restriction = 0 cr.shop_restriction = 0
+1 -1
View File
@@ -1161,7 +1161,7 @@ class CategoryCore extends ObjectModel
UPDATE `'._DB_PREFIX_.'category` c UPDATE `'._DB_PREFIX_.'category` c
LEFT JOIN `'._DB_PREFIX_.'category_shop` cs LEFT JOIN `'._DB_PREFIX_.'category_shop` cs
ON (c.`id_category` = cs.`id_category` AND cs.`id_shop` = '.(int)$id_shop.') ON (c.`id_category` = cs.`id_category` AND cs.`id_shop` = '.(int)$id_shop.')
SET cs.`position` = '.(int)$i.' SET cs.`position` = '.(int)($i+1).'
WHERE c.`id_parent` = '.(int)$id_category_parent.' WHERE c.`id_parent` = '.(int)$id_category_parent.'
AND c.`id_category` = '.(int)$result[$i]['id_category']; AND c.`id_category` = '.(int)$result[$i]['id_category'];
$return &= Db::getInstance()->execute($sql); $return &= Db::getInstance()->execute($sql);
+8
View File
@@ -47,6 +47,7 @@ class ConfigurationTestCore
'upload' => false, 'upload' => false,
'gd' => false, 'gd' => false,
'mysql_support' => false, 'mysql_support' => false,
'sessions' => false,
'config_dir' => 'config', 'config_dir' => 'config',
'cache_dir' => 'cache', 'cache_dir' => 'cache',
'sitemap' => 'sitemap.xml', 'sitemap' => 'sitemap.xml',
@@ -305,6 +306,13 @@ class ConfigurationTestCore
return function_exists('mcrypt_encrypt'); return function_exists('mcrypt_encrypt');
} }
public static function test_sessions()
{
if (!$path = @ini_get('session.save_path'))
return true;
return is_writable($path);
}
public static function test_dom() public static function test_dom()
{ {
return extension_loaded('Dom'); return extension_loaded('Dom');
+13 -12
View File
@@ -45,18 +45,6 @@ class DispatcherCore
* @var array List of default routes * @var array List of default routes
*/ */
public $default_routes = array( public $default_routes = array(
'layered_rule' => array(
'controller' => 'category',
'rule' => '{id}-{rewrite}{/:selected_filters}',
'keywords' => array(
'id' => array('regexp' => '[0-9]+', 'param' => 'id_category'),
/* Selected filters is used by the module blocklayered */
'selected_filters' => array('regexp' => '.*', 'param' => 'selected_filters'),
'rewrite' => array('regexp' => '[_a-zA-Z0-9-\pL]*'),
'meta_keywords' => array('regexp' => '[_a-zA-Z0-9-\pL]*'),
'meta_title' => array('regexp' => '[_a-zA-Z0-9-\pL]*'),
),
),
'category_rule' => array( 'category_rule' => array(
'controller' => 'category', 'controller' => 'category',
'rule' => '{id}-{rewrite}', 'rule' => '{id}-{rewrite}',
@@ -136,6 +124,19 @@ class DispatcherCore
'tags' => array('regexp' => '[a-zA-Z0-9-\pL]*'), 'tags' => array('regexp' => '[a-zA-Z0-9-\pL]*'),
), ),
), ),
// Must be after the product and category rules in order to avoid conflict
'layered_rule' => array(
'controller' => 'category',
'rule' => '{id}-{rewrite}{/:selected_filters}',
'keywords' => array(
'id' => array('regexp' => '[0-9]+', 'param' => 'id_category'),
/* Selected filters is used by the module blocklayered */
'selected_filters' => array('regexp' => '.*', 'param' => 'selected_filters'),
'rewrite' => array('regexp' => '[_a-zA-Z0-9-\pL]*'),
'meta_keywords' => array('regexp' => '[_a-zA-Z0-9-\pL]*'),
'meta_title' => array('regexp' => '[_a-zA-Z0-9-\pL]*'),
),
),
); );
/** /**
+30 -39
View File
@@ -292,54 +292,45 @@ class LocalizationPackCore
foreach ($xml->languages->language as $data) foreach ($xml->languages->language as $data)
{ {
$attributes = $data->attributes(); $attributes = $data->attributes();
if (Language::getIdByIso($attributes['iso_code']))
continue;
$native_lang = Language::getLanguages();
$native_iso_code = array();
foreach ($native_lang as $lang)
$native_iso_code[] = $lang['iso_code'];
// if we are not in an installation context or if the pack is not available in the local directory // if we are not in an installation context or if the pack is not available in the local directory
if (!$install_mode || !in_array((string)$attributes['iso_code'], $native_iso_code)) if (Language::getIdByIso($attributes['iso_code']) && !$install_mode)
continue;
$errno = 0;
$errstr = '';
if (!$lang_pack_link = Tools::file_get_contents('http://www.prestashop.com/download/lang_packs/get_language_pack.php?version='._PS_VERSION_.'&iso_lang='.$attributes['iso_code']))
$this->_errors[] = Tools::displayError('Archive cannot be downloaded from prestashop.com.');
elseif (!$lang_pack = Tools::jsonDecode($lang_pack_link))
$this->_errors[] = Tools::displayError('Error occurred when language was checked according to your Prestashop version.');
elseif ($content = Tools::file_get_contents('http://translations.prestashop.com/download/lang_packs/gzip/'.$lang_pack->version.'/'.$attributes['iso_code'].'.gzip'))
{ {
$errno = 0; $file = _PS_TRANSLATIONS_DIR_.$attributes['iso_code'].'.gzip';
$errstr = ''; if (file_put_contents($file, $content))
if (!@fsockopen('api.prestashop.com', 80, $errno, $errstr, 5))
$this->_errors[] = Tools::displayError('Archive cannot be downloaded from prestashop.com.');
elseif (!($lang_pack = Tools::jsonDecode(Tools::file_get_contents('http://www.prestashop.com/download/lang_packs/get_language_pack.php?version='._PS_VERSION_.'&iso_lang='.$attributes['iso_code']))))
$this->_errors[] = Tools::displayError('Error occurred when language was checked according to your Prestashop version.');
elseif ($content = Tools::file_get_contents('http://translations.prestashop.com/download/lang_packs/gzip/'.$lang_pack->version.'/'.$attributes['iso_code'].'.gzip'))
{ {
$file = _PS_TRANSLATIONS_DIR_.$attributes['iso_code'].'.gzip'; $gz = new Archive_Tar($file, true);
if (file_put_contents($file, $content)) $files_list = $gz->listContent();
if (!$gz->extract(_PS_TRANSLATIONS_DIR_.'../', false))
{ {
$gz = new Archive_Tar($file, true); $this->_errors[] = Tools::displayError('Cannot decompress the translation file for the following language: ').(string)$attributes['iso_code'];
$files_list = $gz->listContent(); return false;
if (!$gz->extract(_PS_TRANSLATIONS_DIR_.'../', false))
{
$this->_errors[] = Tools::displayError('Cannot decompress the translation file for the following language: ').(string)$attributes['iso_code'];
return false;
}
else
{
AdminTranslationsController::checkAndAddMailsFiles($attributes['iso_code'], $files_list);
AdminTranslationsController::addNewTabs($attributes['iso_code'], $files_list);
}
if (!Language::checkAndAddLanguage((string)$attributes['iso_code']))
{
$this->_errors[] = Tools::displayError('An error occurred while creating the language: ').(string)$attributes['iso_code'];
return false;
}
@unlink($file);
} }
else else
$this->_errors[] = Tools::displayError('Server does not have permissions for writing.'); {
AdminTranslationsController::checkAndAddMailsFiles($attributes['iso_code'], $files_list);
AdminTranslationsController::addNewTabs($attributes['iso_code'], $files_list);
}
if (!Language::checkAndAddLanguage((string)$attributes['iso_code']))
{
$this->_errors[] = Tools::displayError('An error occurred while creating the language: ').(string)$attributes['iso_code'];
return false;
}
@unlink($file);
} }
else
$this->_errors[] = Tools::displayError('Server does not have permissions for writing.');
} }
} }
// change the default language if there is only one language in the localization pack // change the default language if there is only one language in the localization pack
if (!count($this->_errors) && $install_mode && isset($attributes['iso_code']) && count($xml->languages->language) == 1) if (!count($this->_errors) && $install_mode && isset($attributes['iso_code']) && count($xml->languages->language) == 1)
$this->iso_code_lang = $attributes['iso_code']; $this->iso_code_lang = $attributes['iso_code'];
+17 -19
View File
@@ -129,20 +129,24 @@ class MediaCore
} }
public static function packJS($js_content) public static function packJS($js_files)
{ {
if (!empty($js_content)) if (count($js_files))
{ {
require_once(_PS_TOOL_DIR_.'js_minify/jsmin.php'); try
try { {
$js_content = JSMin::minify($js_content); require_once(_PS_TOOL_DIR_.'closure/closure.php');
} catch (Exception $e) { $closure = new PhpClosure($js_files);
if (_PS_MODE_DEV_) return $closure->getCompiledCode();
}
catch (Exception $e)
{
if (_PS_MODE_DEV_ === true)
echo $e->getMessage(); echo $e->getMessage();
return $js_content; return false;
} }
} }
return $js_content; return null;
} }
public static function minifyCSS($css_content, $fileuri = false, &$import_url = array()) public static function minifyCSS($css_content, $fileuri = false, &$import_url = array())
@@ -535,16 +539,10 @@ class MediaCore
// aggregate and compress js files content, write new caches files // aggregate and compress js files content, write new caches files
if ($js_files_date > $compressed_js_file_date) if ($js_files_date > $compressed_js_file_date)
{ {
$content = ''; $content = Media::packJS($js_files_infos);
foreach ($js_files_infos as $file_infos) if ($content === false)
{ return false;
if (file_exists($file_infos['path']))
$content .= file_get_contents($file_infos['path']).';';
else
$compressed_js_files_not_found[] = $file_infos['path'];
}
$content = Media::packJS($content);
if (!empty($compressed_js_files_not_found)) if (!empty($compressed_js_files_not_found))
$content = '/* WARNING ! file(s) not found : "'. $content = '/* WARNING ! file(s) not found : "'.
implode(',', $compressed_js_files_not_found). implode(',', $compressed_js_files_not_found).
+1 -1
View File
@@ -382,7 +382,7 @@ class SearchCore
{ {
// Adjust the limit to get only "whole" products, in every languages (and at least one) // Adjust the limit to get only "whole" products, in every languages (and at least one)
$max_possibilities = $total_languages * count(Shop::getShops(true)); $max_possibilities = $total_languages * count(Shop::getShops(true));
$limit = max(1, floor($limit / $max_possibilities) * $max_possibilities); $limit = max($max_possibilities, floor($limit / $max_possibilities) * $max_possibilities);
return Db::getInstance()->executeS(' return Db::getInstance()->executeS('
SELECT p.id_product, pl.id_lang, pl.id_shop, pl.name pname, p.reference, p.ean13, p.upc, SELECT p.id_product, pl.id_lang, pl.id_shop, pl.name pname, p.reference, p.ean13, p.upc,
+8 -15
View File
@@ -1799,20 +1799,14 @@ exit;
*/ */
public static function displayAsDeprecated($message = null) public static function displayAsDeprecated($message = null)
{ {
if (_PS_DISPLAY_COMPATIBILITY_WARNING_)
{
$backtrace = debug_backtrace(); $backtrace = debug_backtrace();
$callee = next($backtrace); $callee = next($backtrace);
if ($message)
trigger_error($message, E_USER_WARNING);
else
{
trigger_error('Function <b>'.$callee['function'].'()</b> is deprecated in <b>'.$callee['file'].'</b> on line <b>'.$callee['line'].'</b><br />', E_USER_WARNING);
$message = 'The function '.$callee['function'].' (Line '.$callee['line'].') is deprecated and will be removed in the next major version.';
}
$class = isset($callee['class']) ? $callee['class'] : null; $class = isset($callee['class']) ? $callee['class'] : null;
Logger::addLog($message, 3, $class); if ($message === null)
} $message = 'The function '.$callee['function'].' (Line '.$callee['line'].') is deprecated and will be removed in the next major version.';
$error = 'Function <b>'.$callee['function'].'()</b> is deprecated in <b>'.$callee['file'].'</b> on line <b>'.$callee['line'].'</b><br />';
Tools::throwDeprecated($error, $message, $class);
} }
/** /**
@@ -1824,9 +1818,8 @@ exit;
$callee = next($backtrace); $callee = next($backtrace);
$error = 'Parameter <b>'.$parameter.'</b> in function <b>'.$callee['function'].'()</b> is deprecated in <b>'.$callee['file'].'</b> on line <b>'.$callee['Line'].'</b><br />'; $error = 'Parameter <b>'.$parameter.'</b> in function <b>'.$callee['function'].'()</b> is deprecated in <b>'.$callee['file'].'</b> on line <b>'.$callee['Line'].'</b><br />';
$message = 'The parameter '.$parameter.' in function '.$callee['function'].' (Line '.$callee['Line'].') is deprecated and will be removed in the next major version.'; $message = 'The parameter '.$parameter.' in function '.$callee['function'].' (Line '.$callee['Line'].') is deprecated and will be removed in the next major version.';
trigger_error($message, E_WARNING);
$class = isset($callee['class']) ? $callee['class'] : null; $class = isset($callee['class']) ? $callee['class'] : null;
Tools::throwDeprecated($error, $message, $class); Tools::throwDeprecated($error, $message, $class);
} }
@@ -1836,8 +1829,8 @@ exit;
$callee = current($backtrace); $callee = current($backtrace);
$error = 'File <b>'.$callee['file'].'</b> is deprecated<br />'; $error = 'File <b>'.$callee['file'].'</b> is deprecated<br />';
$message = 'The file '.$callee['file'].' is deprecated and will be removed in the next major version.'; $message = 'The file '.$callee['file'].' is deprecated and will be removed in the next major version.';
$class = isset($callee['class']) ? $callee['class'] : null; $class = isset($callee['class']) ? $callee['class'] : null;
Tools::throwDeprecated($error, $message, $class); Tools::throwDeprecated($error, $message, $class);
} }
@@ -1845,7 +1838,7 @@ exit;
{ {
if (_PS_DISPLAY_COMPATIBILITY_WARNING_) if (_PS_DISPLAY_COMPATIBILITY_WARNING_)
{ {
// trigger_error($error, E_USER_WARNING); trigger_error($error, E_USER_WARNING);
Logger::addLog($message, 3, $class); Logger::addLog($message, 3, $class);
} }
} }
+47 -36
View File
@@ -477,7 +477,7 @@ class AdminControllerCore extends Controller
if (isset($value[0]) && !empty($value[0])) if (isset($value[0]) && !empty($value[0]))
{ {
if (!Validate::isDate($value[0])) if (!Validate::isDate($value[0]))
$this->errors[] = Tools::displayError('\'From:\' date format is invalid (YYYY-MM-DD)'); $this->errors[] = Tools::displayError('The \'From\' date format is invalid (YYYY-MM-DD)');
else else
$sql_filter .= ' AND '.pSQL($key).' >= \''.pSQL(Tools::dateFrom($value[0])).'\''; $sql_filter .= ' AND '.pSQL($key).' >= \''.pSQL(Tools::dateFrom($value[0])).'\'';
} }
@@ -485,7 +485,7 @@ class AdminControllerCore extends Controller
if (isset($value[1]) && !empty($value[1])) if (isset($value[1]) && !empty($value[1]))
{ {
if (!Validate::isDate($value[1])) if (!Validate::isDate($value[1]))
$this->errors[] = Tools::displayError('\'To:\' date format is invalid (YYYY-MM-DD)'); $this->errors[] = Tools::displayError('The \'To\' date format is invalid (YYYY-MM-DD)');
else else
$sql_filter .= ' AND '.pSQL($key).' <= \''.pSQL(Tools::dateTo($value[1])).'\''; $sql_filter .= ' AND '.pSQL($key).' <= \''.pSQL(Tools::dateTo($value[1])).'\'';
} }
@@ -563,7 +563,7 @@ class AdminControllerCore extends Controller
$this->content = 'ok'; $this->content = 'ok';
} }
} }
$this->errors[] = Tools::displayError('An error occurred during image deletion (cannot load object).'); $this->errors[] = Tools::displayError('An error occurred while attempting to delet the image. (cannot load object).');
return $object; return $object;
} }
@@ -628,7 +628,7 @@ class AdminControllerCore extends Controller
$res = $object->deleteImage(); $res = $object->deleteImage();
if (!$res) if (!$res)
$this->errors[] = Tools::displayError('Unable to delete associated images'); $this->errors[] = Tools::displayError('Unable to delete associated images.');
$object->deleted = 1; $object->deleted = 1;
if ($object->update()) if ($object->update())
@@ -641,7 +641,7 @@ class AdminControllerCore extends Controller
} }
else else
{ {
$this->errors[] = Tools::displayError('An error occurred while deleting object.'). $this->errors[] = Tools::displayError('An error occurred while deleting the object.').
' <b>'.$this->table.'</b> '. ' <b>'.$this->table.'</b> '.
Tools::displayError('(cannot load object)'); Tools::displayError('(cannot load object)');
} }
@@ -679,7 +679,7 @@ class AdminControllerCore extends Controller
$this->beforeAdd($this->object); $this->beforeAdd($this->object);
if (method_exists($this->object, 'add') && !$this->object->add()) if (method_exists($this->object, 'add') && !$this->object->add())
{ {
$this->errors[] = Tools::displayError('An error occurred while creating object.'). $this->errors[] = Tools::displayError('An error occurred while creating an object.').
' <b>'.$this->table.' ('.Db::getInstance()->getMsgError().')</b>'; ' <b>'.$this->table.' ('.Db::getInstance()->getMsgError().')</b>';
} }
/* voluntary do affectation here */ /* voluntary do affectation here */
@@ -760,7 +760,7 @@ class AdminControllerCore extends Controller
if (!$result) if (!$result)
{ {
$this->errors[] = Tools::displayError('An error occurred while updating object.'). $this->errors[] = Tools::displayError('An error occurred while updating an object.').
' <b>'.$this->table.'</b> ('.Db::getInstance()->getMsgError().')'; ' <b>'.$this->table.'</b> ('.Db::getInstance()->getMsgError().')';
} }
elseif ($this->postImage($object->id) && !count($this->errors) && $this->_redirect) elseif ($this->postImage($object->id) && !count($this->errors) && $this->_redirect)
@@ -787,7 +787,7 @@ class AdminControllerCore extends Controller
} }
} }
else else
$this->errors[] = Tools::displayError('An error occurred while updating object.'). $this->errors[] = Tools::displayError('An error occurred while updating an object.').
' <b>'.$this->table.'</b> '.Tools::displayError('(cannot load object)'); ' <b>'.$this->table.'</b> '.Tools::displayError('(cannot load object)');
} }
} }
@@ -814,7 +814,7 @@ class AdminControllerCore extends Controller
$object = new $this->className(); $object = new $this->className();
if (!$object->addFieldsRequiredDatabase($fields)) if (!$object->addFieldsRequiredDatabase($fields))
$this->errors[] = Tools::displayError('Error in updating required fields'); $this->errors[] = Tools::displayError('An error occurred when attempting to update the required fields.');
else else
$this->redirect_after = self::$currentIndex.'&conf=4&token='.$this->token; $this->redirect_after = self::$currentIndex.'&conf=4&token='.$this->token;
@@ -834,10 +834,10 @@ class AdminControllerCore extends Controller
$this->redirect_after = self::$currentIndex.'&conf=5'.$id_category.'&token='.$this->token; $this->redirect_after = self::$currentIndex.'&conf=5'.$id_category.'&token='.$this->token;
} }
else else
$this->errors[] = Tools::displayError('An error occurred while updating status.'); $this->errors[] = Tools::displayError('An error occurred while updating the status.');
} }
else else
$this->errors[] = Tools::displayError('An error occurred while updating status for object.'). $this->errors[] = Tools::displayError('An error occurred while updating the status for an object.').
' <b>'.$this->table.'</b> '. ' <b>'.$this->table.'</b> '.
Tools::displayError('(cannot load object)'); Tools::displayError('(cannot load object)');
@@ -851,7 +851,7 @@ class AdminControllerCore extends Controller
{ {
if (!Validate::isLoadedObject($object = $this->loadObject())) if (!Validate::isLoadedObject($object = $this->loadObject()))
{ {
$this->errors[] = Tools::displayError('An error occurred while updating status for object.'). $this->errors[] = Tools::displayError('An error occurred while updating the status for an object.').
' <b>'.$this->table.'</b> '.Tools::displayError('(cannot load object)'); ' <b>'.$this->table.'</b> '.Tools::displayError('(cannot load object)');
} }
elseif (!$object->updatePosition((int)Tools::getValue('way'), (int)Tools::getValue('position'))) elseif (!$object->updatePosition((int)Tools::getValue('way'), (int)Tools::getValue('position')))
@@ -1069,6 +1069,7 @@ class AdminControllerCore extends Controller
'desc' => $this->l('Export') 'desc' => $this->l('Export')
); );
} }
$this->addToolBarModulesListButton();
} }
/** /**
@@ -1088,7 +1089,7 @@ class AdminControllerCore extends Controller
if (Validate::isLoadedObject($this->object)) if (Validate::isLoadedObject($this->object))
return $this->object; return $this->object;
// throw exception // throw exception
$this->errors[] = Tools::displayError('Object cannot be loaded (not found)'); $this->errors[] = Tools::displayError('The object cannot be loaded (or found)');
return false; return false;
} }
elseif ($opt) elseif ($opt)
@@ -1099,7 +1100,7 @@ class AdminControllerCore extends Controller
} }
else else
{ {
$this->errors[] = Tools::displayError('Object cannot be loaded (identifier missing or invalid)'); $this->errors[] = Tools::displayError('The object cannot be loaded (ithe dentifier is missing or invalid)');
return false; return false;
} }
@@ -1413,7 +1414,7 @@ class AdminControllerCore extends Controller
{ {
if (!$this->viewAccess()) if (!$this->viewAccess())
{ {
$this->errors[] = Tools::displayError('You do not have permission to view here.'); $this->errors[] = Tools::displayError('You do not have permission to view this.');
return; return;
} }
@@ -1466,6 +1467,7 @@ class AdminControllerCore extends Controller
$this->filter_modules_list = $this->tab_modules_list['default_list']; $this->filter_modules_list = $this->tab_modules_list['default_list'];
elseif (is_array($this->tab_modules_list['slider_list']) && count($this->tab_modules_list['slider_list'])) elseif (is_array($this->tab_modules_list['slider_list']) && count($this->tab_modules_list['slider_list']))
{ {
$this->addToolBarModulesListButton();
$this->context->smarty->assign(array( $this->context->smarty->assign(array(
'tab_modules_list' => implode(',', $this->tab_modules_list['slider_list']), 'tab_modules_list' => implode(',', $this->tab_modules_list['slider_list']),
'admin_module_ajax_url' => $this->context->link->getAdminLink('AdminModules'), 'admin_module_ajax_url' => $this->context->link->getAdminLink('AdminModules'),
@@ -1474,6 +1476,15 @@ class AdminControllerCore extends Controller
)); ));
} }
} }
protected function addToolBarModulesListButton()
{
if (is_array($this->tab_modules_list['slider_list']) && count($this->tab_modules_list['slider_list']))
$this->toolbar_btn['modules-list'] = array(
'href' => '#',
'desc' => $this->l('Modules List')
);
}
/** /**
* initialize the invalid doom page of death * initialize the invalid doom page of death
@@ -1876,7 +1887,7 @@ class AdminControllerCore extends Controller
if ($this->tabAccess['delete'] === '1') if ($this->tabAccess['delete'] === '1')
$this->action = 'delete_image'; $this->action = 'delete_image';
else else
$this->errors[] = Tools::displayError('You do not have permission to delete here.'); $this->errors[] = Tools::displayError('You do not have permission to delete this.');
} }
/* Delete object */ /* Delete object */
elseif (isset($_GET['delete'.$this->table])) elseif (isset($_GET['delete'.$this->table]))
@@ -1884,7 +1895,7 @@ class AdminControllerCore extends Controller
if ($this->tabAccess['delete'] === '1') if ($this->tabAccess['delete'] === '1')
$this->action = 'delete'; $this->action = 'delete';
else else
$this->errors[] = Tools::displayError('You do not have permission to delete here.'); $this->errors[] = Tools::displayError('You do not have permission to delete this.');
} }
/* Change object statuts (active, inactive) */ /* Change object statuts (active, inactive) */
elseif ((isset($_GET['status'.$this->table]) || isset($_GET['status'])) && Tools::getValue($this->identifier)) elseif ((isset($_GET['status'.$this->table]) || isset($_GET['status'])) && Tools::getValue($this->identifier))
@@ -1892,7 +1903,7 @@ class AdminControllerCore extends Controller
if ($this->tabAccess['edit'] === '1') if ($this->tabAccess['edit'] === '1')
$this->action = 'status'; $this->action = 'status';
else else
$this->errors[] = Tools::displayError('You do not have permission to edit here.'); $this->errors[] = Tools::displayError('You do not have permission to edit this.');
} }
/* Move an object */ /* Move an object */
elseif (isset($_GET['position'])) elseif (isset($_GET['position']))
@@ -1900,7 +1911,7 @@ class AdminControllerCore extends Controller
if ($this->tabAccess['edit'] == '1') if ($this->tabAccess['edit'] == '1')
$this->action = 'position'; $this->action = 'position';
else else
$this->errors[] = Tools::displayError('You do not have permission to edit here.'); $this->errors[] = Tools::displayError('You do not have permission to edit this.');
} }
elseif (Tools::getValue('submitAdd'.$this->table) elseif (Tools::getValue('submitAdd'.$this->table)
|| Tools::getValue('submitAdd'.$this->table.'AndStay') || Tools::getValue('submitAdd'.$this->table.'AndStay')
@@ -1918,7 +1929,7 @@ class AdminControllerCore extends Controller
$this->display = 'list'; $this->display = 'list';
} }
else else
$this->errors[] = Tools::displayError('You do not have permission to edit here.'); $this->errors[] = Tools::displayError('You do not have permission to edit this.');
} }
// case 2: creating new entry // case 2: creating new entry
else else
@@ -1932,7 +1943,7 @@ class AdminControllerCore extends Controller
$this->display = 'list'; $this->display = 'list';
} }
else else
$this->errors[] = Tools::displayError('You do not have permission to add here.'); $this->errors[] = Tools::displayError('You do not have permission to add this.');
} }
} }
elseif (isset($_GET['add'.$this->table])) elseif (isset($_GET['add'.$this->table]))
@@ -1943,13 +1954,13 @@ class AdminControllerCore extends Controller
$this->display = 'add'; $this->display = 'add';
} }
else else
$this->errors[] = Tools::displayError('You do not have permission to add here.'); $this->errors[] = Tools::displayError('You do not have permission to add this.');
} }
elseif (isset($_GET['update'.$this->table]) && isset($_GET[$this->identifier])) elseif (isset($_GET['update'.$this->table]) && isset($_GET[$this->identifier]))
{ {
$this->display = 'edit'; $this->display = 'edit';
if ($this->tabAccess['edit'] !== '1') if ($this->tabAccess['edit'] !== '1')
$this->errors[] = Tools::displayError('You do not have permission to edit here.'); $this->errors[] = Tools::displayError('You do not have permission to edit this.');
} }
elseif (isset($_GET['view'.$this->table])) elseif (isset($_GET['view'.$this->table]))
{ {
@@ -1959,7 +1970,7 @@ class AdminControllerCore extends Controller
$this->action = 'view'; $this->action = 'view';
} }
else else
$this->errors[] = Tools::displayError('You do not have permission to view here.'); $this->errors[] = Tools::displayError('You do not have permission to view this.');
} }
elseif (isset($_GET['export'.$this->table])) elseif (isset($_GET['export'.$this->table]))
{ {
@@ -1976,7 +1987,7 @@ class AdminControllerCore extends Controller
if ($this->tabAccess['edit'] === '1') if ($this->tabAccess['edit'] === '1')
$this->action = 'update_options'; $this->action = 'update_options';
else else
$this->errors[] = Tools::displayError('You do not have permission to edit here.'); $this->errors[] = Tools::displayError('You do not have permission to edit this.');
} }
elseif (Tools::isSubmit('submitFields') && $this->required_database && $this->tabAccess['add'] === '1' && $this->tabAccess['delete'] === '1') elseif (Tools::isSubmit('submitFields') && $this->required_database && $this->tabAccess['add'] === '1' && $this->tabAccess['delete'] === '1')
$this->action = 'update_fields'; $this->action = 'update_fields';
@@ -1991,7 +2002,7 @@ class AdminControllerCore extends Controller
$this->boxes = Tools::getValue($this->table.'Box'); $this->boxes = Tools::getValue($this->table.'Box');
} }
else else
$this->errors[] = Tools::displayError('You do not have permission to edit here.'); $this->errors[] = Tools::displayError('You do not have permission to edit this.');
break; break;
} }
elseif (Tools::isSubmit('submitBulk')) elseif (Tools::isSubmit('submitBulk'))
@@ -2002,7 +2013,7 @@ class AdminControllerCore extends Controller
$this->boxes = Tools::getValue($this->table.'Box'); $this->boxes = Tools::getValue($this->table.'Box');
} }
else else
$this->errors[] = Tools::displayError('You do not have permission to edit here.'); $this->errors[] = Tools::displayError('You do not have permission to edit this.');
break; break;
} }
} }
@@ -2335,7 +2346,7 @@ class AdminControllerCore extends Controller
if (($value = Tools::getValue($field)) == false && (string)$value != '0') if (($value = Tools::getValue($field)) == false && (string)$value != '0')
if (!Tools::getValue($this->identifier) || ($field != 'passwd' && $field != 'no-picture')) if (!Tools::getValue($this->identifier) || ($field != 'passwd' && $field != 'no-picture'))
$this->errors[] = sprintf( $this->errors[] = sprintf(
Tools::displayError('The field %s is required.'), Tools::displayError('The %s field is required.'),
call_user_func(array($class_name, 'displayFieldName'), $field, $class_name) call_user_func(array($class_name, 'displayFieldName'), $field, $class_name)
); );
@@ -2354,7 +2365,7 @@ class AdminControllerCore extends Controller
foreach ($rules['size'] as $field => $max_length) foreach ($rules['size'] as $field => $max_length)
if (Tools::getValue($field) !== false && Tools::strlen(Tools::getValue($field)) > $max_length) if (Tools::getValue($field) !== false && Tools::strlen(Tools::getValue($field)) > $max_length)
$this->errors[] = sprintf( $this->errors[] = sprintf(
Tools::displayError('The field %1$s is too long (%2$d chars max).'), Tools::displayError('The %1$s field is too long (%2$d chars max).'),
call_user_func(array($class_name, 'displayFieldName'), $field, $class_name), call_user_func(array($class_name, 'displayFieldName'), $field, $class_name),
$max_length $max_length
); );
@@ -2382,7 +2393,7 @@ class AdminControllerCore extends Controller
if (($value = Tools::getValue($field)) !== false && ($field != 'passwd')) if (($value = Tools::getValue($field)) !== false && ($field != 'passwd'))
if (!Validate::$function($value) && !empty($value)) if (!Validate::$function($value) && !empty($value))
$this->errors[] = sprintf( $this->errors[] = sprintf(
Tools::displayError('The field %s is invalid.'), Tools::displayError('The %s field is invalid.'),
call_user_func(array($class_name, 'displayFieldName'), $field, $class_name) call_user_func(array($class_name, 'displayFieldName'), $field, $class_name)
); );
@@ -2391,12 +2402,12 @@ class AdminControllerCore extends Controller
{ {
if ($class_name == 'Employee' && !Validate::isPasswdAdmin($value)) if ($class_name == 'Employee' && !Validate::isPasswdAdmin($value))
$this->errors[] = sprintf( $this->errors[] = sprintf(
Tools::displayError('The field %s is invalid.'), Tools::displayError('The %s field is invalid.'),
call_user_func(array($class_name, 'displayFieldName'), 'passwd', $class_name) call_user_func(array($class_name, 'displayFieldName'), 'passwd', $class_name)
); );
elseif ($class_name == 'Customer' && !Validate::isPasswd($value)) elseif ($class_name == 'Customer' && !Validate::isPasswd($value))
$this->errors[] = sprintf( $this->errors[] = sprintf(
Tools::displayError('The field %s is invalid.'), Tools::displayError('The %s field is invalid.'),
call_user_func(array($class_name, 'displayFieldName'), 'passwd', $class_name) call_user_func(array($class_name, 'displayFieldName'), 'passwd', $class_name)
); );
} }
@@ -2408,7 +2419,7 @@ class AdminControllerCore extends Controller
if (($value = Tools::getValue($field_lang.'_'.$language['id_lang'])) !== false && !empty($value)) if (($value = Tools::getValue($field_lang.'_'.$language['id_lang'])) !== false && !empty($value))
if (!Validate::$function($value)) if (!Validate::$function($value))
$this->errors[] = sprintf( $this->errors[] = sprintf(
Tools::displayError('The field %1$s (%2$s) is invalid.'), Tools::displayError('The %1$s field (%2$s) is invalid.'),
call_user_func(array($class_name, 'displayFieldName'), $field_lang, $class_name), call_user_func(array($class_name, 'displayFieldName'), $field_lang, $class_name),
$language['name'] $language['name']
); );
@@ -2625,11 +2636,11 @@ class AdminControllerCore extends Controller
// Evaluate the memory required to resize the image: if it's too much, you can't resize it. // Evaluate the memory required to resize the image: if it's too much, you can't resize it.
if (!ImageManager::checkImageMemoryLimit($tmp_name)) if (!ImageManager::checkImageMemoryLimit($tmp_name))
$this->errors[] = Tools::displayError('This image cannot be loaded due to memory limit restrictions, please increase your memory_limit value on your server configuration.'); $this->errors[] = Tools::displayError('Due to memory limit restrictions, this image cannot be loaded. Please increase your memory_limit value via your server\'s configuration settings. ');
// Copy new image // Copy new image
if (empty($this->errors) && !ImageManager::resize($tmp_name, _PS_IMG_DIR_.$dir.$id.'.'.$this->imageType, (int)$width, (int)$height, ($ext ? $ext : $this->imageType))) if (empty($this->errors) && !ImageManager::resize($tmp_name, _PS_IMG_DIR_.$dir.$id.'.'.$this->imageType, (int)$width, (int)$height, ($ext ? $ext : $this->imageType)))
$this->errors[] = Tools::displayError('An error occurred while uploading image.'); $this->errors[] = Tools::displayError('An error occurred while uploading the image.');
if (count($this->errors)) if (count($this->errors))
return false; return false;
@@ -2681,7 +2692,7 @@ class AdminControllerCore extends Controller
if ($result) if ($result)
$this->redirect_after = self::$currentIndex.'&conf=2&token='.$this->token; $this->redirect_after = self::$currentIndex.'&conf=2&token='.$this->token;
$this->errors[] = Tools::displayError('An error occurred while deleting selection.'); $this->errors[] = Tools::displayError('An error occurred while deleting this selection.');
} }
} }
else else
+8 -4
View File
@@ -327,15 +327,19 @@ abstract class ControllerCore
foreach ($name as $plugin) foreach ($name as $plugin)
{ {
$plugin_path = Media::getJqueryPluginPath($plugin, $folder); $plugin_path = Media::getJqueryPluginPath($plugin, $folder);
$this->addJS($plugin_path['js']); if(!empty($plugin_path['js']))
$this->addCSS($plugin_path['css']); $this->addJS($plugin_path['js']);
if(!empty($plugin_path['css']))
$this->addCSS($plugin_path['css']);
} }
} }
else else
$plugin_path = Media::getJqueryPluginPath($name, $folder); $plugin_path = Media::getJqueryPluginPath($name, $folder);
$this->addCSS($plugin_path['css']); if(!empty($plugin_path['css']))
$this->addJS($plugin_path['js']); $this->addCSS($plugin_path['css']);
if(!empty($plugin_path['js']))
$this->addJS($plugin_path['js']);
} }
/** /**
+6 -4
View File
@@ -452,7 +452,8 @@ class FrontControllerCore extends Controller
$this->css_files = Media::cccCSS($this->css_files); $this->css_files = Media::cccCSS($this->css_files);
//JS compressor management //JS compressor management
if (Configuration::get('PS_JS_THEME_CACHE')) if (Configuration::get('PS_JS_THEME_CACHE'))
$this->js_files = Media::cccJs($this->js_files); if ($js_files = Media::cccJs($this->js_files))
$this->js_files = $js_files;
} }
// Call hook before assign of css_files and js_files in order to include correctly all css and javascript files // Call hook before assign of css_files and js_files in order to include correctly all css and javascript files
@@ -515,7 +516,8 @@ class FrontControllerCore extends Controller
$this->css_files = Media::cccCSS($this->css_files); $this->css_files = Media::cccCSS($this->css_files);
//JS compressor management //JS compressor management
if (Configuration::get('PS_JS_THEME_CACHE')) if (Configuration::get('PS_JS_THEME_CACHE'))
$this->js_files = Media::cccJs($this->js_files); if ($js_files = Media::cccJs($this->js_files))
$this->js_files = $js_files;
} }
$this->context->smarty->assign('css_files', $this->css_files); $this->context->smarty->assign('css_files', $this->css_files);
@@ -701,13 +703,13 @@ class FrontControllerCore extends Controller
public function setMobileMedia() public function setMobileMedia()
{ {
$this->addjquery(); $this->addjquery();
$this->addJS(_THEME_MOBILE_JS_DIR_.'jquery.mobile-1.2.0.js'); $this->addJS(_THEME_MOBILE_JS_DIR_.'jquery.mobile-1.3.0.min.js');
$this->addJS(_THEME_MOBILE_JS_DIR_.'jqm-docs.js'); $this->addJS(_THEME_MOBILE_JS_DIR_.'jqm-docs.js');
$this->addJS(_PS_JS_DIR_.'tools.js'); $this->addJS(_PS_JS_DIR_.'tools.js');
$this->addJS(_THEME_MOBILE_JS_DIR_.'global.js'); $this->addJS(_THEME_MOBILE_JS_DIR_.'global.js');
$this->addjqueryPlugin('fancybox'); $this->addjqueryPlugin('fancybox');
$this->addCSS(_THEME_MOBILE_CSS_DIR_.'jquery.mobile-1.2.0.min.css', 'all'); $this->addCSS(_THEME_MOBILE_CSS_DIR_.'jquery.mobile-1.3.0.min.css', 'all');
$this->addCSS(_THEME_MOBILE_CSS_DIR_.'jqm-docs.css', 'all'); $this->addCSS(_THEME_MOBILE_CSS_DIR_.'jqm-docs.css', 'all');
$this->addCSS(_THEME_MOBILE_CSS_DIR_.'global.css', 'all'); $this->addCSS(_THEME_MOBILE_CSS_DIR_.'global.css', 'all');
} }
+1 -1
View File
@@ -174,7 +174,7 @@ class HelperCore
$use_shop_context = false) $use_shop_context = false)
{ {
$translations = array( $translations = array(
'selected' => $this->l('selected'), 'selected' => $this->l('Selected'),
'Collapse All' => $this->l('Collapse All'), 'Collapse All' => $this->l('Collapse All'),
'Expand All' => $this->l('Expand All'), 'Expand All' => $this->l('Expand All'),
'Check All' => $this->l('Check All'), 'Check All' => $this->l('Check All'),
+1 -1
View File
@@ -39,7 +39,7 @@ class PDFGeneratorCore extends TCPDF
public $content; public $content;
public $font; public $font;
public $font_by_lang = array('ja' => 'cid0jp', 'ru' => 'freeserif', 'el' => 'freeserif', 'vn' => 'dejavusans', 'pl' => 'dejavusans'); public $font_by_lang = array('ja' => 'cid0jp', 'bg' => 'freeserif', 'ru' => 'freeserif', 'el' => 'freeserif', 'vn' => 'dejavusans', 'pl' => 'dejavusans');
public function __construct($use_cache = false) public function __construct($use_cache = false)
+8 -4
View File
@@ -367,9 +367,11 @@ class StockAvailableCore extends ObjectModel
*/ */
public function add($autodate = true, $null_values = false) public function add($autodate = true, $null_values = false)
{ {
if (!parent::add($autodate, $null_values)) if (!$result = parent::add($autodate, $null_values))
return false; return false;
$this->postSave();
$result &= $this->postSave();
return $result;
} }
/** /**
@@ -378,9 +380,11 @@ class StockAvailableCore extends ObjectModel
*/ */
public function update($null_values = false) public function update($null_values = false)
{ {
if (!parent::update($null_values)) if (!$result = parent::update($null_values))
return false; return false;
return $this->postSave();
$result &= $this->postSave();
return $result;
} }
/** /**
+2 -2
View File
@@ -134,7 +134,7 @@ class AdminAccessControllerCore extends AdminController
if (_PS_MODE_DEMO_) if (_PS_MODE_DEMO_)
throw new PrestaShopException(Tools::displayError('This functionality has been disabled.')); throw new PrestaShopException(Tools::displayError('This functionality has been disabled.'));
if ($this->tabAccess['edit'] != '1') if ($this->tabAccess['edit'] != '1')
throw new PrestaShopException(Tools::displayError('You do not have permission to edit here.')); throw new PrestaShopException(Tools::displayError('You do not have permission to edit this.'));
if (Tools::isSubmit('submitAddAccess')) if (Tools::isSubmit('submitAddAccess'))
{ {
@@ -194,7 +194,7 @@ class AdminAccessControllerCore extends AdminController
if (_PS_MODE_DEMO_) if (_PS_MODE_DEMO_)
throw new PrestaShopException(Tools::displayError('This functionality has been disabled.')); throw new PrestaShopException(Tools::displayError('This functionality has been disabled.'));
if ($this->tabAccess['edit'] != '1') if ($this->tabAccess['edit'] != '1')
throw new PrestaShopException(Tools::displayError('You do not have permission to edit here.')); throw new PrestaShopException(Tools::displayError('You do not have permission to edit this.'));
if (Tools::isSubmit('changeModuleAccess')) if (Tools::isSubmit('changeModuleAccess'))
{ {
+12 -9
View File
@@ -126,7 +126,7 @@ class AdminAddressesControllerCore extends AdminController
'name' => 'phone_mobile', 'name' => 'phone_mobile',
'size' => 33, 'size' => 33,
'required' => false, 'required' => false,
'desc' => sprintf($this->l('You must register at least one phone number %s'), '<sup>*</sup>') 'desc' => Configuration::get('PS_ONE_PHONE_AT_LEAST')? sprintf($this->l('You must register at least one phone number %s'), '<sup>*</sup>') : ''
), ),
array( array(
'type' => 'textarea', 'type' => 'textarea',
@@ -278,7 +278,7 @@ class AdminAddressesControllerCore extends AdminController
{ {
$temp_fields[] = array( $temp_fields[] = array(
'type' => 'select', 'type' => 'select',
'label' => $this->l('Country:'), 'label' => $this->l('Country'),
'name' => 'id_country', 'name' => 'id_country',
'required' => false, 'required' => false,
'default_value' => (int)$this->context->country->id, 'default_value' => (int)$this->context->country->id,
@@ -318,7 +318,7 @@ class AdminAddressesControllerCore extends AdminController
if (Validate::isLoadedObject($customer)) if (Validate::isLoadedObject($customer))
$_POST['id_customer'] = $customer->id; $_POST['id_customer'] = $customer->id;
else else
$this->errors[] = Tools::displayError('This e-mail address is not registered.'); $this->errors[] = Tools::displayError('This email address is not registered.');
} }
else if ($id_customer = Tools::getValue('id_customer')) else if ($id_customer = Tools::getValue('id_customer'))
{ {
@@ -331,14 +331,14 @@ class AdminAddressesControllerCore extends AdminController
else else
$this->errors[] = Tools::displayError('Unknown customer'); $this->errors[] = Tools::displayError('Unknown customer');
if (Country::isNeedDniByCountryId(Tools::getValue('id_country')) && !Tools::getValue('dni')) if (Country::isNeedDniByCountryId(Tools::getValue('id_country')) && !Tools::getValue('dni'))
$this->errors[] = Tools::displayError('Identification number is incorrect or has already been used.'); $this->errors[] = Tools::displayError('The identification number is incorrect or has already been used.');
/* If the selected country does not contain states */ /* If the selected country does not contain states */
$id_state = (int)Tools::getValue('id_state'); $id_state = (int)Tools::getValue('id_state');
$id_country = (int)Tools::getValue('id_country'); $id_country = (int)Tools::getValue('id_country');
$country = new Country((int)$id_country); $country = new Country((int)$id_country);
if ($country && !(int)$country->contains_states && $id_state) if ($country && !(int)$country->contains_states && $id_state)
$this->errors[] = Tools::displayError('You have selected a state for a country that does not contain states.'); $this->errors[] = Tools::displayError('You\'ve selected a state for a country that does not contain states.');
/* If the selected country contains states, then a state have to be selected */ /* If the selected country contains states, then a state have to be selected */
if ((int)$country->contains_states && !$id_state) if ((int)$country->contains_states && !$id_state)
@@ -357,16 +357,19 @@ class AdminAddressesControllerCore extends AdminController
$zip_regexp = str_replace('L', '[a-zA-Z]', $zip_regexp); $zip_regexp = str_replace('L', '[a-zA-Z]', $zip_regexp);
$zip_regexp = str_replace('C', $country->iso_code, $zip_regexp); $zip_regexp = str_replace('C', $country->iso_code, $zip_regexp);
if (!preg_match($zip_regexp, $postcode)) if (!preg_match($zip_regexp, $postcode))
$this->errors[] = Tools::displayError('Your Postal Code/Zip Code is incorrect.').'<br />'. $this->errors[] = Tools::displayError('Your Postal / Zip Code is incorrect.').'<br />'.
Tools::displayError('Must be typed as follows:').' '. Tools::displayError('It must be entered as follows:').' '.
str_replace('C', $country->iso_code, str_replace('N', '0', str_replace('L', 'A', $zip_code_format))); str_replace('C', $country->iso_code, str_replace('N', '0', str_replace('L', 'A', $zip_code_format)));
} }
else if ($zip_code_format) else if ($zip_code_format)
$this->errors[] = Tools::displayError('Postal Code/Zip Code required.'); $this->errors[] = Tools::displayError('A Postal / Zip Code required.');
else if ($postcode && !preg_match('/^[0-9a-zA-Z -]{4,9}$/ui', $postcode)) else if ($postcode && !preg_match('/^[0-9a-zA-Z -]{4,9}$/ui', $postcode))
$this->errors[] = Tools::displayError('Your Postal Code/Zip Code is incorrect.'); $this->errors[] = Tools::displayError('Your Postal / Zip Code is incorrect.');
} }
if (Configuration::get('PS_ONE_PHONE_AT_LEAST') && !Tools::getValue('phone') && !Tools::getValue('phone_mobile'))
$this->errors[] = Tools::displayError('You must register at least one phone number.');
/* If this address come from order's edition and is the same as the other one (invoice or delivery one) /* If this address come from order's edition and is the same as the other one (invoice or delivery one)
** we delete its id_address to force the creation of a new one */ ** we delete its id_address to force the creation of a new one */
if ((int)Tools::getValue('id_order')) if ((int)Tools::getValue('id_order'))
@@ -94,7 +94,7 @@ class AdminAdminPreferencesControllerCore extends AdminController
'validation' => 'isInt', 'validation' => 'isInt',
'cast' => 'intval', 'cast' => 'intval',
'type' => 'text', 'type' => 'text',
'suffix' => $this->l('Megabytes:'), 'suffix' => $this->l('megabytes'),
'default' => '2' 'default' => '2'
), ),
'PS_LIMIT_UPLOAD_FILE_VALUE' => array( 'PS_LIMIT_UPLOAD_FILE_VALUE' => array(
@@ -103,7 +103,7 @@ class AdminAdminPreferencesControllerCore extends AdminController
'validation' => 'isInt', 'validation' => 'isInt',
'cast' => 'intval', 'cast' => 'intval',
'type' => 'text', 'type' => 'text',
'suffix' => $this->l('Megabytes:'), 'suffix' => $this->l('megabytes'),
'default' => '1' 'default' => '1'
), ),
'PS_LIMIT_UPLOAD_IMAGE_VALUE' => array( 'PS_LIMIT_UPLOAD_IMAGE_VALUE' => array(
@@ -112,7 +112,7 @@ class AdminAdminPreferencesControllerCore extends AdminController
'validation' => 'isInt', 'validation' => 'isInt',
'cast' => 'intval', 'cast' => 'intval',
'type' => 'text', 'type' => 'text',
'suffix' => $this->l('Megabytes:'), 'suffix' => $this->l('megabytes'),
'default' => '1' 'default' => '1'
), ),
), ),
@@ -85,7 +85,7 @@ class AdminAttributeGeneratorControllerCore extends AdminController
if ($this->tabAccess['edit'] === '1') if ($this->tabAccess['edit'] === '1')
$this->action = 'generate'; $this->action = 'generate';
else else
$this->errors[] = Tools::displayError('You do not have permission to add here.'); $this->errors[] = Tools::displayError('You do not have permission to add this.');
} }
parent::initProcess(); parent::initProcess();
} }
@@ -100,7 +100,7 @@ class AdminAttributeGeneratorControllerCore extends AdminController
public function processGenerate() public function processGenerate()
{ {
if (!is_array(Tools::getValue('options'))) if (!is_array(Tools::getValue('options')))
$this->errors[] = Tools::displayError('Please choose at least 1 attribute.'); $this->errors[] = Tools::displayError('Please select at least one attribute.');
else else
{ {
$tab = array_values(Tools::getValue('options')); $tab = array_values(Tools::getValue('options'));
@@ -134,7 +134,7 @@ class AdminAttributeGeneratorControllerCore extends AdminController
Tools::redirectAdmin($this->context->link->getAdminLink('AdminProducts').'&id_product='.(int)Tools::getValue('id_product').'&addproduct&key_tab=Combinations&conf=4'); Tools::redirectAdmin($this->context->link->getAdminLink('AdminProducts').'&id_product='.(int)Tools::getValue('id_product').'&addproduct&key_tab=Combinations&conf=4');
} }
else else
$this->errors[] = Tools::displayError('Unable to initialize parameters, combination is missing or object cannot be loaded.'); $this->errors[] = Tools::displayError('Unable to initialize these parameters. A combination is missing or an object cannot be loaded.');
} }
} }
@@ -98,7 +98,7 @@ class AdminAttributesGroupsControllerCore extends AdminController
$this->lang = true; $this->lang = true;
if (!Validate::isLoadedObject($obj = new AttributeGroup((int)$id))) if (!Validate::isLoadedObject($obj = new AttributeGroup((int)$id)))
$this->errors[] = Tools::displayError('An error occurred while updating status for object.').' <b>'.$this->table.'</b> '.Tools::displayError('(cannot load object)'); $this->errors[] = Tools::displayError('An error occurred while updating the status for an object.').' <b>'.$this->table.'</b> '.Tools::displayError('(cannot load object)');
$this->fields_list = array( $this->fields_list = array(
'id_attribute' => array( 'id_attribute' => array(
@@ -591,9 +591,9 @@ class AdminAttributesGroupsControllerCore extends AdminController
if (Tools::getValue('updateattribute') || Tools::isSubmit('deleteattribute') || Tools::isSubmit('submitAddattribute')) if (Tools::getValue('updateattribute') || Tools::isSubmit('deleteattribute') || Tools::isSubmit('submitAddattribute'))
{ {
if ($this->tabAccess['edit'] !== '1') if ($this->tabAccess['edit'] !== '1')
$this->errors[] = Tools::displayError('You do not have permission to edit here.'); $this->errors[] = Tools::displayError('You do not have permission to edit this.');
else if (!$object = new Attribute((int)Tools::getValue($this->identifier))) else if (!$object = new Attribute((int)Tools::getValue($this->identifier)))
$this->errors[] = Tools::displayError('An error occurred while updating status for object.').' <b>'.$this->table.'</b> '.Tools::displayError('(cannot load object)'); $this->errors[] = Tools::displayError('An error occurred while updating the status for an object.').' <b>'.$this->table.'</b> '.Tools::displayError('(cannot load object)');
if (Tools::getValue('position') !== false && Tools::getValue('id_attribute')) if (Tools::getValue('position') !== false && Tools::getValue('id_attribute'))
{ {
@@ -606,7 +606,7 @@ class AdminAttributesGroupsControllerCore extends AdminController
else if (Tools::isSubmit('deleteattribute') && Tools::getValue('id_attribute')) else if (Tools::isSubmit('deleteattribute') && Tools::getValue('id_attribute'))
{ {
if (!$object->delete()) if (!$object->delete())
$this->errors[] = Tools::displayError('Failed to delete attribute.'); $this->errors[] = Tools::displayError('Failed to delete the attribute.');
else else
Tools::redirectAdmin(self::$currentIndex.'&conf=1&token='.Tools::getAdminTokenLite('AdminAttributesGroups')); Tools::redirectAdmin(self::$currentIndex.'&conf=1&token='.Tools::getAdminTokenLite('AdminAttributesGroups'));
} }
@@ -640,13 +640,13 @@ class AdminAttributesGroupsControllerCore extends AdminController
$object = new $this->className(); $object = new $this->className();
if ($object->deleteSelection($_POST[$this->table.'Box'])) if ($object->deleteSelection($_POST[$this->table.'Box']))
Tools::redirectAdmin(self::$currentIndex.'&conf=2'.'&token='.$this->token); Tools::redirectAdmin(self::$currentIndex.'&conf=2'.'&token='.$this->token);
$this->errors[] = Tools::displayError('An error occurred while deleting selection.'); $this->errors[] = Tools::displayError('An error occurred while deleting this selection.');
} }
else else
$this->errors[] = Tools::displayError('You must select at least one element to delete.'); $this->errors[] = Tools::displayError('You must select at least one element to delete.');
} }
else else
$this->errors[] = Tools::displayError('You do not have permission to delete here.'); $this->errors[] = Tools::displayError('You do not have permission to delete this.');
// clean position after delete // clean position after delete
AttributeGroup::cleanPositions(); AttributeGroup::cleanPositions();
} }
+10 -10
View File
@@ -166,21 +166,21 @@ class AdminCarriersControllerCore extends AdminController
<li>'.$this->l('Fill in the fields and click "Save."').'</li> <li>'.$this->l('Fill in the fields and click "Save."').'</li>
<li>'. <li>'.
$this->l('You need to set a price range -- or weight range -- for which the new carrier will be available.').' '. $this->l('You need to set a price range -- or weight range -- for which the new carrier will be available.').' '.
$this->l('Under the "Shipping" menu, click either "Price Ranges" or "Weight Ranges".').' $this->l('Under the "Shipping" menu, click either "Price ranges" or "Weight ranges.".').'
</li> </li>
<li>'.$this->l('Click "Add New."').'</li> <li>'.$this->l('Click "Add New."').'</li>
<li>'. <li>'.
$this->l('Select the name of the carrier before defining the price or weight range.').' '. $this->l('Select the name of the carrier before defining the price or weight range.').' '.
$this->l('For example, the carrier can be made available for a weight range between 0 and 5lbs. Another carrier can have a range between 5 and 10lbs.').' $this->l('For example, the carrier can be made available for a weight range between 0 and 5lbs. Another carrier can have a range between 5 and 10lbs.').'
</li> </li>
<li>'.$this->l('When you are done, click "Save."').'</li> <li>'.$this->l('When you\'re done, click "Save."').'</li>
<li>'.$this->l('Click on the "Shipping" menu.').'</li> <li>'.$this->l('Click on the "Shipping" menu.').'</li>
<li>'. <li>'.
$this->l('You need to set the fees that will be applied for this carrier.').' '. $this->l('You need to set the fees that will be applied for this carrier.').' '.
$this->l('At the bottom on the page -- in the "Fees" section -- select the name of the carrier.').' $this->l('At the bottom on the page -- in the "Fees" section -- select the name of the carrier.').'
</li> </li>
<li>'.$this->l('For each zone, enter a price and then click "Save."').'</li> <li>'.$this->l('For each zone, enter a price and then click "Save."').'</li>
<li>'.$this->l('You\'re all set! The new carrier will be displayed to your customers.').'</li> <li>'.$this->l('You\'re all set! The new carrier will now be displayed to customers.').'</li>
</ul>' </ul>'
); );
$this->_select = 'b.*'; $this->_select = 'b.*';
@@ -501,10 +501,10 @@ class AdminCarriersControllerCore extends AdminController
Tools::redirectAdmin(self::$currentIndex.'&id_'.$this->table.'='.$current_carrier->id.'&conf=4&token='.$this->token); Tools::redirectAdmin(self::$currentIndex.'&id_'.$this->table.'='.$current_carrier->id.'&conf=4&token='.$this->token);
} }
else else
$this->errors[] = Tools::displayError('An error occurred while updating object.').' <b>'.$this->table.'</b>'; $this->errors[] = Tools::displayError('An error occurred while updating an object.').' <b>'.$this->table.'</b>';
} }
else else
$this->errors[] = Tools::displayError('You do not have permission to edit here.'); $this->errors[] = Tools::displayError('You do not have permission to edit this.');
} catch (PrestaShopException $e) { } catch (PrestaShopException $e) {
$this->errors[] = $e->getMessage(); $this->errors[] = $e->getMessage();
} }
@@ -531,10 +531,10 @@ class AdminCarriersControllerCore extends AdminController
} }
} }
else else
$this->errors[] = Tools::displayError('An error occurred while creating object.').' <b>'.$this->table.'</b>'; $this->errors[] = Tools::displayError('An error occurred while creating an object.').' <b>'.$this->table.'</b>';
} }
else else
$this->errors[] = Tools::displayError('You do not have permission to add here.'); $this->errors[] = Tools::displayError('You do not have permission to add this.');
} }
} }
parent::postProcess(); parent::postProcess();
@@ -544,12 +544,12 @@ class AdminCarriersControllerCore extends AdminController
if ($this->tabAccess['edit'] === '1') if ($this->tabAccess['edit'] === '1')
{ {
if (Tools::getValue('id_carrier') == Configuration::get('PS_CARRIER_DEFAULT')) if (Tools::getValue('id_carrier') == Configuration::get('PS_CARRIER_DEFAULT'))
$this->errors[] = Tools::displayError('You cannot disable the default carrier, please change your default carrier first.'); $this->errors[] = Tools::displayError('You cannot disable the default carrier, however you can change your defeault carrier. ');
else else
parent::postProcess(); parent::postProcess();
} }
else else
$this->errors[] = Tools::displayError('You do not have permission to edit here.'); $this->errors[] = Tools::displayError('You do not have permission to edit this.');
} }
else else
{ {
@@ -646,7 +646,7 @@ class AdminCarriersControllerCore extends AdminController
{ {
$carrier = new $this->className($id); $carrier = new $this->className($id);
if (!Validate::isLoadedObject($carrier)) if (!Validate::isLoadedObject($carrier))
die (Tools::displayError('Object cannot be loaded')); die (Tools::displayError('The object cannot be loaded.'));
$zones = Zone::getZones(false); $zones = Zone::getZones(false);
foreach ($zones as $zone) foreach ($zones as $zone)
if (count($carrier->getZone($zone['id_zone']))) if (count($carrier->getZone($zone['id_zone'])))
@@ -119,13 +119,13 @@ class AdminCartRulesControllerCore extends AdminController
// Idiot-proof control // Idiot-proof control
if (strtotime(Tools::getValue('date_from')) > strtotime(Tools::getValue('date_to'))) if (strtotime(Tools::getValue('date_from')) > strtotime(Tools::getValue('date_to')))
$this->errors[] = Tools::displayError('The voucher cannot end before it begins'); $this->errors[] = Tools::displayError('The voucher cannot end before it begins.');
if ((int)Tools::getValue('minimum_amount') < 0) if ((int)Tools::getValue('minimum_amount') < 0)
$this->errors[] = Tools::displayError('Minimum amount cannot be lower than 0'); $this->errors[] = Tools::displayError('The minimum amount cannot be lower than zero.');
if ((float)Tools::getValue('reduction_percent') < 0 || (float)Tools::getValue('reduction_percent') > 100) if ((float)Tools::getValue('reduction_percent') < 0 || (float)Tools::getValue('reduction_percent') > 100)
$this->errors[] = Tools::displayError('Reduction percent must be between 0% and 100%'); $this->errors[] = Tools::displayError('Reduction percent must be between 0% and 100%');
if ((int)Tools::getValue('reduction_amount') < 0) if ((int)Tools::getValue('reduction_amount') < 0)
$this->errors[] = Tools::displayError('Reduction amount cannot be lower than 0'); $this->errors[] = Tools::displayError('Reduction amount cannot be lower than zero.');
if (Tools::getValue('code') && ($same_code = (int)CartRule::getIdByCode(Tools::getValue('code'))) && $same_code != Tools::getValue('id_cart_rule')) if (Tools::getValue('code') && ($same_code = (int)CartRule::getIdByCode(Tools::getValue('code'))) && $same_code != Tools::getValue('id_cart_rule'))
$this->errors[] = sprintf(Tools::displayError('This cart rule code is already used (conflict with cart rule %d)'), $same_code); $this->errors[] = sprintf(Tools::displayError('This cart rule code is already used (conflict with cart rule %d)'), $same_code);
} }
@@ -451,7 +451,7 @@ class AdminCartRulesControllerCore extends AdminController
); );
} }
else else
return array('found' => false, 'notfound' => Tools::displayError('No product found')); return array('found' => false, 'notfound' => Tools::displayError('No product has been found.'));
} }
public function ajaxProcessSearchProducts() public function ajaxProcessSearchProducts()
+13 -13
View File
@@ -276,7 +276,7 @@ class AdminCartsControllerCore extends AdminController
if (!isset($_POST[$field_id]) || empty($_POST[$field_id])) if (!isset($_POST[$field_id]) || empty($_POST[$field_id]))
{ {
if ($customization_field['required']) if ($customization_field['required'])
$errors[] = Tools::displayError('Please fill in all required fields'); $errors[] = Tools::displayError('Please fill in all the required fields.');
continue; continue;
} }
if (!Validate::isMessage($_POST[$field_id]) || empty($_POST[$field_id])) if (!Validate::isMessage($_POST[$field_id]) || empty($_POST[$field_id]))
@@ -288,20 +288,20 @@ class AdminCartsControllerCore extends AdminController
if (!isset($_FILES[$field_id]) || !isset($_FILES[$field_id]['tmp_name']) || empty($_FILES[$field_id]['tmp_name'])) if (!isset($_FILES[$field_id]) || !isset($_FILES[$field_id]['tmp_name']) || empty($_FILES[$field_id]['tmp_name']))
{ {
if ($customization_field['required']) if ($customization_field['required'])
$errors[] = Tools::displayError('Please fill in all required fields'); $errors[] = Tools::displayError('Please fill in all the required fields.');
continue; continue;
} }
if ($error = ImageManager::validateUpload($_FILES[$field_id], (int)Configuration::get('PS_PRODUCT_PICTURE_MAX_SIZE'))) if ($error = ImageManager::validateUpload($_FILES[$field_id], (int)Configuration::get('PS_PRODUCT_PICTURE_MAX_SIZE')))
$errors[] = $error; $errors[] = $error;
if (!($tmp_name = tempnam(_PS_TMP_IMG_DIR_, 'PS')) || !move_uploaded_file($_FILES[$field_id]['tmp_name'], $tmp_name)) if (!($tmp_name = tempnam(_PS_TMP_IMG_DIR_, 'PS')) || !move_uploaded_file($_FILES[$field_id]['tmp_name'], $tmp_name))
$errors[] = Tools::displayError('An error occurred during the image upload.'); $errors[] = Tools::displayError('An error occurred during the image upload process.');
$file_name = md5(uniqid(rand(), true)); $file_name = md5(uniqid(rand(), true));
if (!ImageManager::resize($tmp_name, _PS_UPLOAD_DIR_.$file_name)) if (!ImageManager::resize($tmp_name, _PS_UPLOAD_DIR_.$file_name))
continue; continue;
elseif (!ImageManager::resize($tmp_name, _PS_UPLOAD_DIR_.$file_name.'_small', (int)Configuration::get('PS_PRODUCT_PICTURE_WIDTH'), (int)Configuration::get('PS_PRODUCT_PICTURE_HEIGHT'))) elseif (!ImageManager::resize($tmp_name, _PS_UPLOAD_DIR_.$file_name.'_small', (int)Configuration::get('PS_PRODUCT_PICTURE_WIDTH'), (int)Configuration::get('PS_PRODUCT_PICTURE_HEIGHT')))
$errors[] = Tools::displayError('An error occurred during the image upload.'); $errors[] = Tools::displayError('An error occurred during the image upload process.');
elseif (!chmod(_PS_UPLOAD_DIR_.$file_name, 0777) || !chmod(_PS_UPLOAD_DIR_.$file_name.'_small', 0777)) elseif (!chmod(_PS_UPLOAD_DIR_.$file_name, 0777) || !chmod(_PS_UPLOAD_DIR_.$file_name.'_small', 0777))
$errors[] = Tools::displayError('An error occurred during the image upload.'); $errors[] = Tools::displayError('An error occurred during the image upload process.');
else else
$this->context->cart->addPictureToProduct((int)$product->id, (int)$customization_field['id_customization_field'], Product::CUSTOMIZE_FILE, $file_name); $this->context->cart->addPictureToProduct((int)$product->id, (int)$customization_field['id_customization_field'], Product::CUSTOMIZE_FILE, $file_name);
unlink($tmp_name); unlink($tmp_name);
@@ -324,7 +324,7 @@ class AdminCartsControllerCore extends AdminController
if (!$this->context->cart->id) if (!$this->context->cart->id)
return; return;
if ($this->context->cart->OrderExists()) if ($this->context->cart->OrderExists())
$errors[] = Tools::displayError('An order has already been placed with this cart'); $errors[] = Tools::displayError('An order has already been placed with this cart.');
elseif (!($id_product = (int)Tools::getValue('id_product')) || !($product = new Product((int)$id_product, true, $this->context->language->id))) elseif (!($id_product = (int)Tools::getValue('id_product')) || !($product = new Product((int)$id_product, true, $this->context->language->id)))
$errors[] = Tools::displayError('Invalid product'); $errors[] = Tools::displayError('Invalid product');
elseif (!($qty = Tools::getValue('qty')) || $qty == 0) elseif (!($qty = Tools::getValue('qty')) || $qty == 0)
@@ -336,17 +336,17 @@ class AdminCartsControllerCore extends AdminController
if (($id_product_attribute = Tools::getValue('id_product_attribute')) != 0) if (($id_product_attribute = Tools::getValue('id_product_attribute')) != 0)
{ {
if (!Product::isAvailableWhenOutOfStock($product->out_of_stock) && !Attribute::checkAttributeQty((int)$id_product_attribute, (int)$qty)) if (!Product::isAvailableWhenOutOfStock($product->out_of_stock) && !Attribute::checkAttributeQty((int)$id_product_attribute, (int)$qty))
$errors[] = Tools::displayError('There is not enough product in stock'); $errors[] = Tools::displayError('There is not enough product in stock.');
} }
else else
if (!$product->checkQty((int)$qty)) if (!$product->checkQty((int)$qty))
$errors[] = Tools::displayError('There is not enough product in stock'); $errors[] = Tools::displayError('There is not enough product in stock.');
if (!($id_customization = (int)Tools::getValue('id_customization', 0)) && !$product->hasAllRequiredCustomizableFields()) if (!($id_customization = (int)Tools::getValue('id_customization', 0)) && !$product->hasAllRequiredCustomizableFields())
$errors[] = Tools::displayError('Please fill in all required fields'); $errors[] = Tools::displayError('Please fill in all the required fields.');
$this->context->cart->save(); $this->context->cart->save();
} }
else else
$errors[] = Tools::displayError('Product can\'t be added to the cart'); $errors[] = Tools::displayError('This product cannot be added to the cart');
if (!count($errors)) if (!count($errors))
{ {
@@ -363,7 +363,7 @@ class AdminCartsControllerCore extends AdminController
elseif ($qty_upd < 0) elseif ($qty_upd < 0)
{ {
$minimal_qty = $id_product_attribute ? Attribute::getAttributeMinimalQty((int)$id_product_attribute) : $product->minimal_quantity; $minimal_qty = $id_product_attribute ? Attribute::getAttributeMinimalQty((int)$id_product_attribute) : $product->minimal_quantity;
$errors[] = sprintf(Tools::displayError('You must add a minimum of %d quantity', false), $minimal_qty); $errors[] = sprintf(Tools::displayError('You must add a minimum quantity of %d', false), $minimal_qty);
} }
} }
@@ -452,9 +452,9 @@ class AdminCartsControllerCore extends AdminController
$cart = Cart::getCartByOrderId($id_order); $cart = Cart::getCartByOrderId($id_order);
$new_cart = $cart->duplicate(); $new_cart = $cart->duplicate();
if (!$new_cart || !Validate::isLoadedObject($new_cart['cart'])) if (!$new_cart || !Validate::isLoadedObject($new_cart['cart']))
$errors[] = Tools::displayError('The order cannot be renewed'); $errors[] = Tools::displayError('The order cannot be renewed.');
else if (!$new_cart['success']) else if (!$new_cart['success'])
$errors[] = Tools::displayError('The order cannot be renewed'); $errors[] = Tools::displayError('The order cannot be renewed.');
else else
{ {
$this->context->cart = $new_cart['cart']; $this->context->cart = $new_cart['cart'];
+44 -39
View File
@@ -102,12 +102,46 @@ class AdminCategoriesControllerCore extends AdminController
if (($id_category = Tools::getvalue('id_category')) && $this->action != 'select_delete') if (($id_category = Tools::getvalue('id_category')) && $this->action != 'select_delete')
$this->_category = new Category($id_category); $this->_category = new Category($id_category);
else else
{
if (Shop::isFeatureActive() && Shop::getContext() == Shop::CONTEXT_SHOP) if (Shop::isFeatureActive() && Shop::getContext() == Shop::CONTEXT_SHOP)
$this->_category = new Category($this->context->shop->id_category); $this->_category = new Category($this->context->shop->id_category);
else if (count(Category::getCategoriesWithoutParent()) > 1 && Configuration::get('PS_MULTISHOP_FEATURE_ACTIVE') && count(Shop::getShops(true, null, true)) != 1) elseif (count(Category::getCategoriesWithoutParent()) > 1 && Configuration::get('PS_MULTISHOP_FEATURE_ACTIVE') && count(Shop::getShops(true, null, true)) != 1)
$this->_category = Category::getTopCategory(); $this->_category = Category::getTopCategory();
else else
$this->_category = new Category(Configuration::get('PS_HOME_CATEGORY')); $this->_category = new Category(Configuration::get('PS_HOME_CATEGORY'));
}
$count_categories_without_parent = count(Category::getCategoriesWithoutParent());
$top_category = Category::getTopCategory();
if (Tools::isSubmit('id_category'))
$id_parent = $this->_category->id;
elseif (!Shop::isFeatureActive() && $count_categories_without_parent > 1)
$id_parent = $top_category->id;
elseif (Shop::isFeatureActive() && $count_categories_without_parent == 1)
$id_parent = Configuration::get('PS_HOME_CATEGORY');
elseif (Shop::isFeatureActive() && $count_categories_without_parent > 1 && Shop::getContext() != Shop::CONTEXT_SHOP)
{
if (Configuration::get('PS_MULTISHOP_FEATURE_ACTIVE') && count(Shop::getShops(true, null, true)) == 1)
$id_parent = $this->context->shop->id_category;
else
$id_parent = $top_category->id;
}
else
$id_parent = $this->context->shop->id_category;
$this->_select = 'sa.position position';
$this->_filter .= ' AND `id_parent` = '.(int)$id_parent.' ';
if (Shop::getContext() == Shop::CONTEXT_SHOP)
$this->_join .= ' LEFT JOIN `'._DB_PREFIX_.'category_shop` sa ON (a.`id_category` = sa.`id_category` AND sa.id_shop = '.(int)$this->context->shop->id.') ';
else
$this->_join .= ' LEFT JOIN `'._DB_PREFIX_.'category_shop` sa ON (a.`id_category` = sa.`id_category` AND sa.id_shop = a.id_shop_default) ';
// we add restriction for shop
if (Shop::getContext() == Shop::CONTEXT_SHOP && Shop::isFeatureActive())
$this->_where = ' AND sa.`id_shop` = '.(int)Context::getContext()->shop->id;
// if we are not in a shop context, we remove the position column // if we are not in a shop context, we remove the position column
if (Shop::isFeatureActive() && Shop::getContext() != Shop::CONTEXT_SHOP) if (Shop::isFeatureActive() && Shop::getContext() != Shop::CONTEXT_SHOP)
unset($this->fields_list['position']); unset($this->fields_list['position']);
@@ -145,41 +179,12 @@ class AdminCategoriesControllerCore extends AdminController
$this->addRowAction('add'); $this->addRowAction('add');
$this->addRowAction('view'); $this->addRowAction('view');
$count_categories_without_parent = count(Category::getCategoriesWithoutParent()); $count_categories_without_parent = count(Category::getCategoriesWithoutParent());
$is_multishop = Configuration::get('PS_MULTISHOP_FEATURE_ACTIVE');
$top_category = Category::getTopCategory();
if (Tools::isSubmit('id_category'))
$id_parent = $this->_category->id;
else if (!$is_multishop && $count_categories_without_parent > 1)
$id_parent = $top_category->id;
else if ($is_multishop && $count_categories_without_parent == 1)
$id_parent = Configuration::get('PS_HOME_CATEGORY');
else if ($is_multishop && $count_categories_without_parent > 1 && Shop::getContext() != Shop::CONTEXT_SHOP)
if (Configuration::get('PS_MULTISHOP_FEATURE_ACTIVE') && count(Shop::getShops(true, null, true)) == 1)
$id_parent = $this->context->shop->id_category;
else
$id_parent = $top_category->id;
else
$id_parent = $this->context->shop->id_category;
$this->_select = 'sa.position position';
$this->_filter .= ' AND `id_parent` = '.(int)$id_parent.' ';
if (Shop::getContext() == Shop::CONTEXT_SHOP)
$this->_join .= ' LEFT JOIN `'._DB_PREFIX_.'category_shop` sa ON (a.`id_category` = sa.`id_category` AND sa.id_shop = '.(int)$this->context->shop->id.') ';
else
$this->_join .= ' LEFT JOIN `'._DB_PREFIX_.'category_shop` sa ON (a.`id_category` = sa.`id_category` AND sa.id_shop = a.id_shop_default) ';
// we add restriction for shop
if (Shop::getContext() == Shop::CONTEXT_SHOP && $is_multishop)
$this->_where = ' AND sa.`id_shop` = '.(int)Context::getContext()->shop->id;
$categories_tree = $this->_category->getParentsCategories(); $categories_tree = $this->_category->getParentsCategories();
if (empty($categories_tree) if (empty($categories_tree)
&& ($this->_category->id != 1 || Tools::isSubmit('id_category')) && ($this->_category->id != 1 || Tools::isSubmit('id_category'))
&& (Shop::getContext() == Shop::CONTEXT_SHOP && !$is_multishop && $count_categories_without_parent > 1)) && (Shop::getContext() == Shop::CONTEXT_SHOP && !Shop::isFeatureActive() && $count_categories_without_parent > 1))
$categories_tree = array(array('name' => $this->_category->name[$this->context->language->id])); $categories_tree = array(array('name' => $this->_category->name[$this->context->language->id]));
asort($categories_tree); asort($categories_tree);
@@ -299,7 +304,7 @@ class AdminCategoriesControllerCore extends AdminController
$this->display = 'add'; $this->display = 'add';
} }
else else
$this->errors[] = Tools::displayError('You do not have permission to edit here.'); $this->errors[] = Tools::displayError('You do not have permission to edit this.');
} }
parent::initProcess(); parent::initProcess();
@@ -594,7 +599,7 @@ class AdminCategoriesControllerCore extends AdminController
return false; return false;
} }
else else
$this->errors[] = Tools::displayError('You do not have permission to delete here.'); $this->errors[] = Tools::displayError('You do not have permission to delete this.');
} }
public function processDelete() public function processDelete()
@@ -603,7 +608,7 @@ class AdminCategoriesControllerCore extends AdminController
if ($this->tabAccess['delete'] === '1') if ($this->tabAccess['delete'] === '1')
{ {
if ($category->isRootCategoryForAShop()) if ($category->isRootCategoryForAShop())
$this->errors[] = Tools::displayError('You cannot remove this category because a shop uses this category as a root category.'); $this->errors[] = Tools::displayError('You cannot remove this category because one of your shops uses it as a root category.');
else if (parent::processDelete()) else if (parent::processDelete())
{ {
$this->setDeleteMode(); $this->setDeleteMode();
@@ -614,7 +619,7 @@ class AdminCategoriesControllerCore extends AdminController
return false; return false;
} }
else else
$this->errors[] = Tools::displayError('You do not have permission to delete here.'); $this->errors[] = Tools::displayError('You do not have permission to delete this.');
} }
public function processFatherlessProducts($id_parent) public function processFatherlessProducts($id_parent)
@@ -647,9 +652,9 @@ class AdminCategoriesControllerCore extends AdminController
public function processPosition() public function processPosition()
{ {
if ($this->tabAccess['edit'] !== '1') if ($this->tabAccess['edit'] !== '1')
$this->errors[] = Tools::displayError('You do not have permission to edit here.'); $this->errors[] = Tools::displayError('You do not have permission to edit this.');
else if (!Validate::isLoadedObject($object = new Category((int)Tools::getValue($this->identifier, Tools::getValue('id_category_to_move', 1))))) else if (!Validate::isLoadedObject($object = new Category((int)Tools::getValue($this->identifier, Tools::getValue('id_category_to_move', 1)))))
$this->errors[] = Tools::displayError('An error occurred while updating status for object.').' <b>'. $this->errors[] = Tools::displayError('An error occurred while updating the status for an object.').' <b>'.
$this->table.'</b> '.Tools::displayError('(cannot load object)'); $this->table.'</b> '.Tools::displayError('(cannot load object)');
if (!$object->updatePosition((int)Tools::getValue('way'), (int)Tools::getValue('position'))) if (!$object->updatePosition((int)Tools::getValue('way'), (int)Tools::getValue('position')))
$this->errors[] = Tools::displayError('Failed to update the position.'); $this->errors[] = Tools::displayError('Failed to update the position.');
@@ -98,7 +98,7 @@ class AdminCmsCategoriesControllerCore extends AdminController
$this->id_object = $id_cms_category; $this->id_object = $id_cms_category;
if (!CMSCategory::checkBeforeMove($id_cms_category, (int)Tools::getValue('id_parent'))) if (!CMSCategory::checkBeforeMove($id_cms_category, (int)Tools::getValue('id_parent')))
{ {
$this->errors[] = Tools::displayError('CMS Category cannot be moved here'); $this->errors[] = Tools::displayError('The CMS Category cannot be moved here.');
return false; return false;
} }
} }
@@ -120,14 +120,14 @@ class AdminCmsCategoriesControllerCore extends AdminController
Tools::redirectAdmin(self::$currentIndex.'&conf=5'.$identifier.'&token='.Tools::getValue('token')); Tools::redirectAdmin(self::$currentIndex.'&conf=5'.$identifier.'&token='.Tools::getValue('token'));
} }
else else
$this->errors[] = Tools::displayError('An error occurred while updating status.'); $this->errors[] = Tools::displayError('An error occurred while updating the status.');
} }
else else
$this->errors[] = Tools::displayError('An error occurred while updating status for object.') $this->errors[] = Tools::displayError('An error occurred while updating the status for an object.')
.' <b>'.$this->table.'</b> '.Tools::displayError('(cannot load object)'); .' <b>'.$this->table.'</b> '.Tools::displayError('(cannot load object)');
} }
else else
$this->errors[] = Tools::displayError('You do not have permission to edit here.'); $this->errors[] = Tools::displayError('You do not have permission to edit this.');
} }
/* Delete object */ /* Delete object */
elseif (Tools::isSubmit('delete'.$this->table)) elseif (Tools::isSubmit('delete'.$this->table))
@@ -155,19 +155,19 @@ class AdminCmsCategoriesControllerCore extends AdminController
} }
} }
else else
$this->errors[] = Tools::displayError('An error occurred while deleting object.') $this->errors[] = Tools::displayError('An error occurred while deleting the object.')
.' <b>'.$this->table.'</b> '.Tools::displayError('(cannot load object)'); .' <b>'.$this->table.'</b> '.Tools::displayError('(cannot load object)');
} }
else else
$this->errors[] = Tools::displayError('You do not have permission to delete here.'); $this->errors[] = Tools::displayError('You do not have permission to delete this.');
} }
elseif (Tools::isSubmit('position')) elseif (Tools::isSubmit('position'))
{ {
$object = new CMSCategory((int)Tools::getValue($this->identifier, Tools::getValue('id_cms_category_to_move', 1))); $object = new CMSCategory((int)Tools::getValue($this->identifier, Tools::getValue('id_cms_category_to_move', 1)));
if ($this->tabAccess['edit'] !== '1') if ($this->tabAccess['edit'] !== '1')
$this->errors[] = Tools::displayError('You do not have permission to edit here.'); $this->errors[] = Tools::displayError('You do not have permission to edit this.');
elseif (!Validate::isLoadedObject($object)) elseif (!Validate::isLoadedObject($object))
$this->errors[] = Tools::displayError('An error occurred while updating status for object.') $this->errors[] = Tools::displayError('An error occurred while updating the status for an object.')
.' <b>'.$this->table.'</b> '.Tools::displayError('(cannot load object)'); .' <b>'.$this->table.'</b> '.Tools::displayError('(cannot load object)');
elseif (!$object->updatePosition((int)Tools::getValue('way'), (int)Tools::getValue('position'))) elseif (!$object->updatePosition((int)Tools::getValue('way'), (int)Tools::getValue('position')))
$this->errors[] = Tools::displayError('Failed to update the position.'); $this->errors[] = Tools::displayError('Failed to update the position.');
@@ -196,14 +196,14 @@ class AdminCmsCategoriesControllerCore extends AdminController
$token = Tools::getAdminTokenLite('AdminCmsContent'); $token = Tools::getAdminTokenLite('AdminCmsContent');
Tools::redirectAdmin(self::$currentIndex.'&conf=2&token='.$token.'&id_cms_category='.(int)Tools::getValue('id_cms_category')); Tools::redirectAdmin(self::$currentIndex.'&conf=2&token='.$token.'&id_cms_category='.(int)Tools::getValue('id_cms_category'));
} }
$this->errors[] = Tools::displayError('An error occurred while deleting selection.'); $this->errors[] = Tools::displayError('An error occurred while deleting this selection.');
} }
else else
$this->errors[] = Tools::displayError('You must select at least one element to delete.'); $this->errors[] = Tools::displayError('You must select at least one element to delete.');
} }
else else
$this->errors[] = Tools::displayError('You do not have permission to delete here.'); $this->errors[] = Tools::displayError('You do not have permission to delete this.');
} }
parent::postProcess(); parent::postProcess();
} }
+12 -12
View File
@@ -174,7 +174,7 @@ class AdminCmsControllerCore extends AdminController
), ),
), ),
'submit' => array( 'submit' => array(
'title' => $this->l(' Save '), 'title' => $this->l('Save'),
'class' => 'button' 'class' => 'button'
) )
); );
@@ -256,7 +256,7 @@ class AdminCmsControllerCore extends AdminController
$cms = new CMS((int)Tools::getValue('id_cms')); $cms = new CMS((int)Tools::getValue('id_cms'));
$cms->cleanPositions($cms->id_cms_category); $cms->cleanPositions($cms->id_cms_category);
if (!$cms->delete()) if (!$cms->delete())
$this->errors[] = Tools::displayError('An error occurred while deleting object.') $this->errors[] = Tools::displayError('An error occurred while deleting the object.')
.' <b>'.$this->table.' ('.Db::getInstance()->getMsgError().')</b>'; .' <b>'.$this->table.' ('.Db::getInstance()->getMsgError().')</b>';
else else
Tools::redirectAdmin(self::$currentIndex.'&id_cms_category='.$cms->id_cms_category.'&conf=1&token='.Tools::getAdminTokenLite('AdminCmsContent')); Tools::redirectAdmin(self::$currentIndex.'&id_cms_category='.$cms->id_cms_category.'&conf=1&token='.Tools::getAdminTokenLite('AdminCmsContent'));
@@ -276,14 +276,14 @@ class AdminCmsControllerCore extends AdminController
$token = Tools::getAdminTokenLite('AdminCmsContent'); $token = Tools::getAdminTokenLite('AdminCmsContent');
Tools::redirectAdmin(self::$currentIndex.'&conf=2&token='.$token.'&id_cms_category='.(int)Tools::getValue('id_cms_category')); Tools::redirectAdmin(self::$currentIndex.'&conf=2&token='.$token.'&id_cms_category='.(int)Tools::getValue('id_cms_category'));
} }
$this->errors[] = Tools::displayError('An error occurred while deleting selection.'); $this->errors[] = Tools::displayError('An error occurred while deleting this selection.');
} }
else else
$this->errors[] = Tools::displayError('You must select at least one element to delete.'); $this->errors[] = Tools::displayError('You must select at least one element to delete.');
} }
else else
$this->errors[] = Tools::displayError('You do not have permission to delete here.'); $this->errors[] = Tools::displayError('You do not have permission to delete this.');
} }
elseif (Tools::isSubmit('submitAddcms') || Tools::isSubmit('submitAddcmsAndPreview')) elseif (Tools::isSubmit('submitAddcms') || Tools::isSubmit('submitAddcmsAndPreview'))
{ {
@@ -295,7 +295,7 @@ class AdminCmsControllerCore extends AdminController
$cms = new CMS(); $cms = new CMS();
$this->copyFromPost($cms, 'cms'); $this->copyFromPost($cms, 'cms');
if (!$cms->add()) if (!$cms->add())
$this->errors[] = Tools::displayError('An error occurred while creating object.') $this->errors[] = Tools::displayError('An error occurred while creating an object.')
.' <b>'.$this->table.' ('.Db::getInstance()->getMsgError().')</b>'; .' <b>'.$this->table.' ('.Db::getInstance()->getMsgError().')</b>';
else else
$this->updateAssoShop($cms->id); $this->updateAssoShop($cms->id);
@@ -305,7 +305,7 @@ class AdminCmsControllerCore extends AdminController
$cms = new CMS($id_cms); $cms = new CMS($id_cms);
$this->copyFromPost($cms, 'cms'); $this->copyFromPost($cms, 'cms');
if (!$cms->update()) if (!$cms->update())
$this->errors[] = Tools::displayError('An error occurred while updating object.') $this->errors[] = Tools::displayError('An error occurred while updating an object.')
.' <b>'.$this->table.' ('.Db::getInstance()->getMsgError().')</b>'; .' <b>'.$this->table.' ('.Db::getInstance()->getMsgError().')</b>';
else else
$this->updateAssoShop($cms->id); $this->updateAssoShop($cms->id);
@@ -340,9 +340,9 @@ class AdminCmsControllerCore extends AdminController
elseif (Tools::isSubmit('way') && Tools::isSubmit('id_cms') && (Tools::isSubmit('position'))) elseif (Tools::isSubmit('way') && Tools::isSubmit('id_cms') && (Tools::isSubmit('position')))
{ {
if ($this->tabAccess['edit'] !== '1') if ($this->tabAccess['edit'] !== '1')
$this->errors[] = Tools::displayError('You do not have permission to edit here.'); $this->errors[] = Tools::displayError('You do not have permission to edit this.');
elseif (!Validate::isLoadedObject($object = $this->loadObject())) elseif (!Validate::isLoadedObject($object = $this->loadObject()))
$this->errors[] = Tools::displayError('An error occurred while updating status for object.') $this->errors[] = Tools::displayError('An error occurred while updating the status for an object.')
.' <b>'.$this->table.'</b> '.Tools::displayError('(cannot load object)'); .' <b>'.$this->table.'</b> '.Tools::displayError('(cannot load object)');
elseif (!$object->updatePosition((int)Tools::getValue('way'), (int)Tools::getValue('position'))) elseif (!$object->updatePosition((int)Tools::getValue('way'), (int)Tools::getValue('position')))
$this->errors[] = Tools::displayError('Failed to update the position.'); $this->errors[] = Tools::displayError('Failed to update the position.');
@@ -359,14 +359,14 @@ class AdminCmsControllerCore extends AdminController
if ($object->toggleStatus()) if ($object->toggleStatus())
Tools::redirectAdmin(self::$currentIndex.'&conf=5&id_cms_category='.(int)$object->id_cms_category.'&token='.Tools::getValue('token')); Tools::redirectAdmin(self::$currentIndex.'&conf=5&id_cms_category='.(int)$object->id_cms_category.'&token='.Tools::getValue('token'));
else else
$this->errors[] = Tools::displayError('An error occurred while updating status.'); $this->errors[] = Tools::displayError('An error occurred while updating the status.');
} }
else else
$this->errors[] = Tools::displayError('An error occurred while updating status for object.') $this->errors[] = Tools::displayError('An error occurred while updating the status for an object.')
.' <b>'.$this->table.'</b> '.Tools::displayError('(cannot load object)'); .' <b>'.$this->table.'</b> '.Tools::displayError('(cannot load object)');
} }
else else
$this->errors[] = Tools::displayError('You do not have permission to edit here.'); $this->errors[] = Tools::displayError('You do not have permission to edit this.');
} }
/* Delete multiple CMS content */ /* Delete multiple CMS content */
elseif (Tools::isSubmit('submitBulkdeletecms')) elseif (Tools::isSubmit('submitBulkdeletecms'))
@@ -385,7 +385,7 @@ class AdminCmsControllerCore extends AdminController
} }
} }
else else
$this->errors[] = Tools::displayError('You do not have permission to delete here.'); $this->errors[] = Tools::displayError('You do not have permission to delete this.');
} }
else else
parent::postProcess(true); parent::postProcess(true);
@@ -55,12 +55,12 @@ class AdminContactsControllerCore extends AdminController
'input' => array( 'input' => array(
array( array(
'type' => 'text', 'type' => 'text',
'label' => $this->l('Title:'), 'label' => $this->l('Title'),
'name' => 'name', 'name' => 'name',
'size' => 33, 'size' => 33,
'required' => true, 'required' => true,
'lang' => true, 'lang' => true,
'desc' => $this->l('Contact name (e.g. Technical Support)'), 'desc' => $this->l('Contact name (e.g. Customer Support)'),
), ),
array( array(
'type' => 'text', 'type' => 'text',
@@ -216,7 +216,7 @@ class AdminCountriesControllerCore extends AdminController
), ),
array( array(
'type' => 'radio', 'type' => 'radio',
'label' => $this->l('Need zip/postal code'), 'label' => $this->l('Need zip/postal code:'),
'name' => 'need_zip_code', 'name' => 'need_zip_code',
'required' => false, 'required' => false,
'class' => 't', 'class' => 't',
@@ -236,7 +236,7 @@ class AdminCountriesControllerCore extends AdminController
), ),
array( array(
'type' => 'text', 'type' => 'text',
'label' => $this->l('Zip/post code format'), 'label' => $this->l('Zip/post code format:'),
'name' => 'zip_code_format', 'name' => 'zip_code_format',
'class' => 'uppercase', 'class' => 'uppercase',
'required' => true, 'required' => true,
@@ -270,7 +270,7 @@ class AdminCountriesControllerCore extends AdminController
'label' => $this->l('Disabled') 'label' => $this->l('Disabled')
) )
), ),
'desc' => $this->l('Display this country to your customer (the country will always be displayed in the back office)') 'desc' => $this->l('Display this country to your customers (the selected country will always be displayed in the Back Office)')
), ),
array( array(
'type' => 'radio', 'type' => 'radio',
@@ -354,13 +354,13 @@ class AdminCountriesControllerCore extends AdminController
if (!Tools::getValue('id_'.$this->table)) if (!Tools::getValue('id_'.$this->table))
{ {
if (Validate::isLanguageIsoCode(Tools::getValue('iso_code')) && Country::getByIso(Tools::getValue('iso_code'))) if (Validate::isLanguageIsoCode(Tools::getValue('iso_code')) && Country::getByIso(Tools::getValue('iso_code')))
$this->errors[] = Tools::displayError('This ISO code already exists, you cannot create two country with the same ISO code'); $this->errors[] = Tools::displayError('This ISO code already exists.You cannot create two countries with the same ISO code.');
} }
else if (Validate::isLanguageIsoCode(Tools::getValue('iso_code'))) else if (Validate::isLanguageIsoCode(Tools::getValue('iso_code')))
{ {
$id_country = Country::getByIso(Tools::getValue('iso_code')); $id_country = Country::getByIso(Tools::getValue('iso_code'));
if (!is_null($id_country) && $id_country != Tools::getValue('id_'.$this->table)) if (!is_null($id_country) && $id_country != Tools::getValue('id_'.$this->table))
$this->errors[] = Tools::displayError('This ISO code already exists, you cannot create two country with the same ISO code'); $this->errors[] = Tools::displayError('This ISO code already exists.You cannot create two countries with the same ISO code.');
} }
if (!count($this->errors)) if (!count($this->errors))
@@ -52,7 +52,7 @@ class AdminCurrenciesControllerCore extends AdminController
'change' => array( 'change' => array(
'title' => $this->l('Currency rates'), 'title' => $this->l('Currency rates'),
'image' => '../img/admin/exchangesrate.gif', 'image' => '../img/admin/exchangesrate.gif',
'description' => $this->l('Use PrestaShop\'s webservice to update your currency exchange rates. Please use caution, rates are provided as-is.'), 'description' => $this->l('Use PrestaShop\'s webservice to update your currency exchange rates. Please use caution, however, rates are provided as-is.'),
'submit' => array( 'submit' => array(
'title' => $this->l('Update currency rates'), 'title' => $this->l('Update currency rates'),
'class' => 'button', 'class' => 'button',
@@ -135,11 +135,11 @@ class AdminCurrenciesControllerCore extends AdminController
'size' => 3, 'size' => 3,
'maxlength' => 11, 'maxlength' => 11,
'required' => true, 'required' => true,
'desc' => $this->l('Conversion rate from one unit of your shop\'s default currency (for example, 1€) to this currency. For example, if the default currency is euros and this currency is dollars, type \'1.20\'').' 1&euro; = $1.20', 'desc' => $this->l('Conversion rates are calculated from one unit of your shop\'s default currency. For example, if the default currency is euros and your chosen currency is dollars, type "1.20"').' 1&euro; = $1.20',
), ),
array( array(
'type' => 'select', 'type' => 'select',
'label' => $this->l('Conversion rate from one unit of your shop\'s default currency (for example, 1 Euro) to this currency. For example, if the default currency is Euros and this currency is Dollars, type \'1.20\''), 'label' => $this->l('Currency format:'),
'name' => 'format', 'name' => 'format',
'size' => 3, 'size' => 3,
'maxlength' => 11, 'maxlength' => 11,
@@ -249,7 +249,7 @@ class AdminCurrenciesControllerCore extends AdminController
return true; return true;
} }
else else
$this->errors[] = Tools::displayError('An error occurred while deleting object.').' $this->errors[] = Tools::displayError('An error occurred while deleting the object.').'
<b>'.$this->table.'</b> '.Tools::displayError('(cannot load object)'); <b>'.$this->table.'</b> '.Tools::displayError('(cannot load object)');
return false; return false;
@@ -265,7 +265,7 @@ class AdminCurrenciesControllerCore extends AdminController
return true; return true;
} }
else else
$this->errors[] = Tools::displayError('An error occurred while updating status for object.').' $this->errors[] = Tools::displayError('An error occurred while updating the status for an object.').'
<b>'.$this->table.'</b> '.Tools::displayError('(cannot load object)'); <b>'.$this->table.'</b> '.Tools::displayError('(cannot load object)');
return false; return false;
@@ -342,10 +342,10 @@ class AdminCurrenciesControllerCore extends AdminController
if ($this->tabAccess['edit'] === '1') if ($this->tabAccess['edit'] === '1')
$this->action = 'exchangeRates'; $this->action = 'exchangeRates';
else else
$this->errors[] = Tools::displayError('You do not have permission to edit here.'); $this->errors[] = Tools::displayError('You do not have permission to edit this.');
} }
if (Tools::isSubmit('submitAddcurrency') && !Tools::getValue('id_currency') && Currency::exists(Tools::getValue('iso_code'), Tools::getValue('iso_code_num'))) if (Tools::isSubmit('submitAddcurrency') && !Tools::getValue('id_currency') && Currency::exists(Tools::getValue('iso_code'), Tools::getValue('iso_code_num')))
$this->errors[] = Tools::displayError('This currency already exist.'); $this->errors[] = Tools::displayError('This currency already exists.');
parent::initProcess(); parent::initProcess();
} }
} }
@@ -74,7 +74,7 @@ class AdminCustomerPreferencesControllerCore extends AdminController
), ),
'PS_PASSWD_TIME_FRONT' => array( 'PS_PASSWD_TIME_FRONT' => array(
'title' => $this->l('Regenerate password'), 'title' => $this->l('Regenerate password'),
'desc' => $this->l('Minimum time requirted to to regenerate a password.'), 'desc' => $this->l('Minimum time required to regenerate a password.'),
'validation' => 'isUnsignedInt', 'validation' => 'isUnsignedInt',
'cast' => 'intval', 'cast' => 'intval',
'size' => 5, 'size' => 5,
@@ -67,7 +67,7 @@ class AdminCustomerThreadsControllerCore extends AdminController
'tmpTableFilter' => true, 'tmpTableFilter' => true,
), ),
'email' => array( 'email' => array(
'title' => $this->l('Email:'), 'title' => $this->l('Email'),
'width' => 100, 'width' => 100,
'filter_key' => 'a!email', 'filter_key' => 'a!email',
), ),
@@ -256,8 +256,8 @@ class AdminCustomerThreadsControllerCore extends AdminController
$params = array( $params = array(
$this->l('Total threads') => $all = CustomerThread::getTotalCustomerThreads(), $this->l('Total threads') => $all = CustomerThread::getTotalCustomerThreads(),
$this->l('Threads pending') => $pending = CustomerThread::getTotalCustomerThreads('status LIKE "%pending%"'), $this->l('Threads pending') => $pending = CustomerThread::getTotalCustomerThreads('status LIKE "%pending%"'),
$this->l('Total customer messages') => CustomerMessage::getTotalCustomerMessages('id_employee = 0'), $this->l('Total number of customer messages') => CustomerMessage::getTotalCustomerMessages('id_employee = 0'),
$this->l('Total employee messages') => CustomerMessage::getTotalCustomerMessages('id_employee != 0'), $this->l('Total number of employee messages') => CustomerMessage::getTotalCustomerMessages('id_employee != 0'),
$this->l('Unread threads') => $unread = CustomerThread::getTotalCustomerThreads('status = "open"'), $this->l('Unread threads') => $unread = CustomerThread::getTotalCustomerThreads('status = "open"'),
$this->l('Closed threads') => $all - ($unread + $pending) $this->l('Closed threads') => $all - ($unread + $pending)
); );
@@ -368,7 +368,7 @@ class AdminCustomerThreadsControllerCore extends AdminController
} }
} }
else else
$this->errors[] = '<div class="alert error">'.Tools::displayError('E-mail invalid.').'</div>'; $this->errors[] = '<div class="alert error">'.Tools::displayError('The email address is invalid.').'</div>';
} }
if (Tools::isSubmit('submitReply')) if (Tools::isSubmit('submitReply'))
{ {
@@ -380,7 +380,7 @@ class AdminCustomerThreadsControllerCore extends AdminController
$cm->message = Tools::htmlentitiesutf8(Tools::getValue('reply_message')); $cm->message = Tools::htmlentitiesutf8(Tools::getValue('reply_message'));
$cm->ip_address = ip2long($_SERVER['REMOTE_ADDR']); $cm->ip_address = ip2long($_SERVER['REMOTE_ADDR']);
if (isset($_FILES) && !empty($_FILES['joinFile']['name']) && $_FILES['joinFile']['error'] != 0) if (isset($_FILES) && !empty($_FILES['joinFile']['name']) && $_FILES['joinFile']['error'] != 0)
$this->errors[] = Tools::displayError('An error occurred with the file upload.'); $this->errors[] = Tools::displayError('An error occurred during the file upload process.');
elseif ($cm->add()) elseif ($cm->add())
{ {
$file_attachment = null; $file_attachment = null;
@@ -424,7 +424,7 @@ class AdminCustomerThreadsControllerCore extends AdminController
); );
} }
else else
$this->errors[] = Tools::displayError('An error occurred, your message was not sent. Please contact your system administrator.'); $this->errors[] = Tools::displayError('An error occurred. Your message was not sent. Please contact your system administrator.');
} }
} }
@@ -659,7 +659,7 @@ class AdminCustomerThreadsControllerCore extends AdminController
public function updateOptionPsSavImapOpt($value) public function updateOptionPsSavImapOpt($value)
{ {
if ($this->tabAccess['edit'] != '1') if ($this->tabAccess['edit'] != '1')
throw new PrestaShopException(Tools::displayError('You do not have permission to edit here.')); throw new PrestaShopException(Tools::displayError('You do not have permission to edit this.'));
if (!$this->errors && $value) if (!$this->errors && $value)
Configuration::updateValue('PS_SAV_IMAP_OPT', implode('', $value)); Configuration::updateValue('PS_SAV_IMAP_OPT', implode('', $value));
@@ -668,7 +668,7 @@ class AdminCustomerThreadsControllerCore extends AdminController
public function ajaxProcessMarkAsRead() public function ajaxProcessMarkAsRead()
{ {
if ($this->tabAccess['edit'] != '1') if ($this->tabAccess['edit'] != '1')
throw new PrestaShopException(Tools::displayError('You do not have permission to edit here.')); throw new PrestaShopException(Tools::displayError('You do not have permission to edit this.'));
$id_thread = Tools::getValue('id_thread'); $id_thread = Tools::getValue('id_thread');
$messages = CustomerThread::getMessageCustomerThreads($id_thread); $messages = CustomerThread::getMessageCustomerThreads($id_thread);
@@ -679,7 +679,7 @@ class AdminCustomerThreadsControllerCore extends AdminController
public function ajaxProcessSyncImap() public function ajaxProcessSyncImap()
{ {
if ($this->tabAccess['edit'] != '1') if ($this->tabAccess['edit'] != '1')
throw new PrestaShopException(Tools::displayError('You do not have permission to edit here.')); throw new PrestaShopException(Tools::displayError('You do not have permission to edit this.'));
if (Tools::isSubmit('syncImapMail')) if (Tools::isSubmit('syncImapMail'))
{ {
+18 -18
View File
@@ -82,7 +82,7 @@ class AdminCustomersControllerCore extends AdminController
'width' => 20 'width' => 20
), ),
'id_gender' => array( 'id_gender' => array(
'title' => $this->l('Titles'), 'title' => $this->l('Title'),
'width' => 70, 'width' => 70,
'align' => 'center', 'align' => 'center',
'icon' => $genders_icon, 'icon' => $genders_icon,
@@ -92,7 +92,7 @@ class AdminCustomersControllerCore extends AdminController
'filter_key' => 'a!id_gender', 'filter_key' => 'a!id_gender',
), ),
'lastname' => array( 'lastname' => array(
'title' => $this->l('Last Name'), 'title' => $this->l('Last name'),
'width' => 'auto' 'width' => 'auto'
), ),
'firstname' => array( 'firstname' => array(
@@ -205,21 +205,21 @@ class AdminCustomersControllerCore extends AdminController
if ($this->tabAccess['edit'] === '1') if ($this->tabAccess['edit'] === '1')
$this->action = 'guest_to_customer'; $this->action = 'guest_to_customer';
else else
$this->errors[] = Tools::displayError('You do not have permission to edit here.'); $this->errors[] = Tools::displayError('You do not have permission to edit this.');
} }
elseif (Tools::isSubmit('changeNewsletterVal') && $this->id_object) elseif (Tools::isSubmit('changeNewsletterVal') && $this->id_object)
{ {
if ($this->tabAccess['edit'] === '1') if ($this->tabAccess['edit'] === '1')
$this->action = 'change_newsletter_val'; $this->action = 'change_newsletter_val';
else else
$this->errors[] = Tools::displayError('You do not have permission to edit here.'); $this->errors[] = Tools::displayError('You do not have permission to edit this.');
} }
elseif (Tools::isSubmit('changeOptinVal') && $this->id_object) elseif (Tools::isSubmit('changeOptinVal') && $this->id_object)
{ {
if ($this->tabAccess['edit'] === '1') if ($this->tabAccess['edit'] === '1')
$this->action = 'change_optin_val'; $this->action = 'change_optin_val';
else else
$this->errors[] = Tools::displayError('You do not have permission to edit here.'); $this->errors[] = Tools::displayError('You do not have permission to edit this.');
} }
// When deleting, first display a form to select the type of deletion // When deleting, first display a form to select the type of deletion
@@ -269,7 +269,7 @@ class AdminCustomersControllerCore extends AdminController
'input' => array( 'input' => array(
array( array(
'type' => 'radio', 'type' => 'radio',
'label' => $this->l('Titles:'), 'label' => $this->l('Title:'),
'name' => 'id_gender', 'name' => 'id_gender',
'required' => false, 'required' => false,
'class' => 't', 'class' => 't',
@@ -470,7 +470,7 @@ class AdminCustomersControllerCore extends AdminController
); );
$this->fields_form['input'][] = array( $this->fields_form['input'][] = array(
'type' => 'text', 'type' => 'text',
'label' => $this->l('Max payment days:'), 'label' => $this->l('Maximum number of payment days:'),
'name' => 'max_payment_days', 'name' => 'max_payment_days',
'size' => 10, 'size' => 10,
'hint' => $this->l('Valid characters:').' 0-9' 'hint' => $this->l('Valid characters:').' 0-9'
@@ -584,7 +584,7 @@ class AdminCustomersControllerCore extends AdminController
foreach ($orders as $order) foreach ($orders as $order)
{ {
if (!isset($order['order_state'])) if (!isset($order['order_state']))
$order['order_state'] = $this->l('The state isn\'t still defined for this order'); $order['order_state'] = $this->l('The state isn\'t defined for this order');
if ($order['valid']) if ($order['valid'])
{ {
@@ -752,7 +752,7 @@ class AdminCustomersControllerCore extends AdminController
$customer->getByEmail($customer_email); $customer->getByEmail($customer_email);
if ($customer->id) if ($customer->id)
{ {
$this->errors[] = Tools::displayError('An account already exists for this e-mail address:').' '.$customer_email; $this->errors[] = Tools::displayError('An account already exists for this email address:').' '.$customer_email;
$this->display = 'edit'; $this->display = 'edit';
return $customer; return $customer;
} }
@@ -776,13 +776,13 @@ class AdminCustomersControllerCore extends AdminController
$customer = new Customer(); $customer = new Customer();
$customer->getByEmail($customer_email); $customer->getByEmail($customer_email);
if ($customer->id) if ($customer->id)
$this->errors[] = Tools::displayError('An account already exists for this e-mail address:').' '.$customer_email; $this->errors[] = Tools::displayError('An account already exists for this email address:').' '.$customer_email;
} }
return parent::processUpdate(); return parent::processUpdate();
} }
else else
$this->errors[] = Tools::displayError('An error occurred while loading object.').' $this->errors[] = Tools::displayError('An error occurred while loading the object.').'
<b>'.$this->table.'</b> '.Tools::displayError('(cannot load object)'); <b>'.$this->table.'</b> '.Tools::displayError('(cannot load object)');
} }
@@ -790,7 +790,7 @@ class AdminCustomersControllerCore extends AdminController
{ {
// Check that default group is selected // Check that default group is selected
if (!is_array(Tools::getValue('groupBox')) || !in_array(Tools::getValue('id_default_group'), Tools::getValue('groupBox'))) if (!is_array(Tools::getValue('groupBox')) || !in_array(Tools::getValue('id_default_group'), Tools::getValue('groupBox')))
$this->errors[] = Tools::displayError('Default customer group must be selected in group box.'); $this->errors[] = Tools::displayError('A default customer group must be selected in group box.');
// Check the requires fields which are settings in the BO // Check the requires fields which are settings in the BO
$customer = new Customer(); $customer = new Customer();
@@ -824,7 +824,7 @@ class AdminCustomersControllerCore extends AdminController
else if ($customer->transformToCustomer(Tools::getValue('id_lang', $this->context->language->id))) else if ($customer->transformToCustomer(Tools::getValue('id_lang', $this->context->language->id)))
Tools::redirectAdmin(self::$currentIndex.'&'.$this->identifier.'='.$customer->id.'&conf=3&token='.$this->token); Tools::redirectAdmin(self::$currentIndex.'&'.$this->identifier.'='.$customer->id.'&conf=3&token='.$this->token);
else else
$this->errors[] = Tools::displayError('An error occurred while updating the customer.'); $this->errors[] = Tools::displayError('An error occurred while updating customer information.');
} }
/** /**
@@ -834,10 +834,10 @@ class AdminCustomersControllerCore extends AdminController
{ {
$customer = new Customer($this->id_object); $customer = new Customer($this->id_object);
if (!Validate::isLoadedObject($customer)) if (!Validate::isLoadedObject($customer))
$this->errors[] = Tools::displayError('An error occurred while updating the customer.'); $this->errors[] = Tools::displayError('An error occurred while updating customer information.');
$customer->newsletter = $customer->newsletter ? 0 : 1; $customer->newsletter = $customer->newsletter ? 0 : 1;
if (!$customer->update()) if (!$customer->update())
$this->errors[] = Tools::displayError('An error occurred while updating the customer.'); $this->errors[] = Tools::displayError('An error occurred while updating customer information.');
Tools::redirectAdmin(self::$currentIndex.'&token='.$this->token); Tools::redirectAdmin(self::$currentIndex.'&token='.$this->token);
} }
@@ -848,10 +848,10 @@ class AdminCustomersControllerCore extends AdminController
{ {
$customer = new Customer($this->id_object); $customer = new Customer($this->id_object);
if (!Validate::isLoadedObject($customer)) if (!Validate::isLoadedObject($customer))
$this->errors[] = Tools::displayError('An error occurred while updating the customer.'); $this->errors[] = Tools::displayError('An error occurred while updating customer information.');
$customer->optin = $customer->optin ? 0 : 1; $customer->optin = $customer->optin ? 0 : 1;
if (!$customer->update()) if (!$customer->update())
$this->errors[] = Tools::displayError('An error occurred while updating the customer.'); $this->errors[] = Tools::displayError('An error occurred while updating customer information.');
Tools::redirectAdmin(self::$currentIndex.'&token='.$this->token); Tools::redirectAdmin(self::$currentIndex.'&token='.$this->token);
} }
@@ -887,7 +887,7 @@ class AdminCustomersControllerCore extends AdminController
$tpl->assign(array( $tpl->assign(array(
'href' => self::$currentIndex.'&'.$this->identifier.'='.$id.'&delete'.$this->table.'&token='.($token != null ? $token : $this->token), 'href' => self::$currentIndex.'&'.$this->identifier.'='.$id.'&delete'.$this->table.'&token='.($token != null ? $token : $this->token),
'confirm' => $this->l('Delete selected item?').$name, 'confirm' => $this->l('Delete the selected item?').$name,
'action' => $this->l('Delete'), 'action' => $this->l('Delete'),
'id' => $id, 'id' => $id,
)); ));
@@ -44,7 +44,7 @@ class AdminDeliverySlipControllerCore extends AdminController
), ),
'PS_DELIVERY_NUMBER' => array( 'PS_DELIVERY_NUMBER' => array(
'title' => $this->l('Delivery number:'), 'title' => $this->l('Delivery number:'),
'desc' => $this->l('The next delivery slip will begin with this number, and then increase with each additional slip'), 'desc' => $this->l('The next delivery slip will begin with this number and then increase with each additional slip.'),
'size' => 6, 'size' => 6,
'cast' => 'intval', 'cast' => 'intval',
'type' => 'text' 'type' => 'text'
@@ -111,7 +111,7 @@ class AdminDeliverySlipControllerCore extends AdminController
if (count(OrderInvoice::getByDeliveryDateInterval(Tools::getValue('date_from'), Tools::getValue('date_to')))) if (count(OrderInvoice::getByDeliveryDateInterval(Tools::getValue('date_from'), Tools::getValue('date_to'))))
Tools::redirectAdmin($this->context->link->getAdminLink('AdminPdf').'&submitAction=generateDeliverySlipsPDF&date_from='.urlencode(Tools::getValue('date_from')).'&date_to='.urlencode(Tools::getValue('date_to'))); Tools::redirectAdmin($this->context->link->getAdminLink('AdminPdf').'&submitAction=generateDeliverySlipsPDF&date_from='.urlencode(Tools::getValue('date_from')).'&date_to='.urlencode(Tools::getValue('date_to')));
else else
$this->errors[] = Tools::displayError('No delivery slip found for this period'); $this->errors[] = Tools::displayError('No delivery slip was found for this period.');
} }
} }
else else
+4 -3
View File
@@ -38,7 +38,7 @@ class AdminEmailsControllerCore extends AdminController
$this->fields_options = array( $this->fields_options = array(
'email' => array( 'email' => array(
'title' => $this->l('Email:'), 'title' => $this->l('Email'),
'icon' => 'email', 'icon' => 'email',
'fields' => array( 'fields' => array(
'PS_MAIL_EMAIL_MESSAGE' => array( 'PS_MAIL_EMAIL_MESSAGE' => array(
@@ -76,7 +76,7 @@ class AdminEmailsControllerCore extends AdminController
'submit' => array() 'submit' => array()
), ),
'smtp' => array( 'smtp' => array(
'title' => $this->l('Email:'), 'title' => $this->l('Email'),
'icon' => 'email', 'icon' => 'email',
'top' => '<div id="smtp" style="display: '.((Configuration::get('PS_MAIL_METHOD') == 2) ? 'block' : 'none').';">', 'top' => '<div id="smtp" style="display: '.((Configuration::get('PS_MAIL_METHOD') == 2) ? 'block' : 'none').';">',
'bottom' => '</div>', 'bottom' => '</div>',
@@ -173,6 +173,7 @@ class AdminEmailsControllerCore extends AdminController
{ {
$this->initTabModuleList(); $this->initTabModuleList();
$this->initToolbar(); $this->initToolbar();
$this->addToolBarModulesListButton();
unset($this->toolbar_btn['save']); unset($this->toolbar_btn['save']);
$back = $this->context->link->getAdminLink('AdminHome'); $back = $this->context->link->getAdminLink('AdminHome');
@@ -204,7 +205,7 @@ class AdminEmailsControllerCore extends AdminController
$_POST['PS_SHOP_EMAIL'] = Configuration::get('PS_SHOP_EMAIL'); $_POST['PS_SHOP_EMAIL'] = Configuration::get('PS_SHOP_EMAIL');
if (isset($_POST['PS_MAIL_METHOD']) && $_POST['PS_MAIL_METHOD'] == 2 && (empty($_POST['PS_MAIL_SERVER']) || empty($_POST['PS_MAIL_SMTP_PORT']))) if (isset($_POST['PS_MAIL_METHOD']) && $_POST['PS_MAIL_METHOD'] == 2 && (empty($_POST['PS_MAIL_SERVER']) || empty($_POST['PS_MAIL_SMTP_PORT'])))
$this->errors[] = Tools::displayError('You must define an SMTP server and an SMTP port. If you do not know, use the PHP mail() function instead.'); $this->errors[] = Tools::displayError('You must define an SMTP server and an SMTP port. If you do not know it, use the PHP mail() function instead.');
} }
public function ajaxProcessSendMailTest() public function ajaxProcessSendMailTest()
+13 -13
View File
@@ -65,7 +65,7 @@ class AdminEmployeesControllerCore extends AdminController
$profiles = Profile::getProfiles($this->context->language->id); $profiles = Profile::getProfiles($this->context->language->id);
if (!$profiles) if (!$profiles)
$this->errors[] = Tools::displayError('No profile'); $this->errors[] = Tools::displayError('No profile.');
else else
foreach ($profiles as $profile) foreach ($profiles as $profile)
$this->profiles_array[$profile['name']] = $profile['name']; $this->profiles_array[$profile['name']] = $profile['name'];
@@ -85,7 +85,7 @@ class AdminEmployeesControllerCore extends AdminController
'fields' => array( 'fields' => array(
'PS_PASSWD_TIME_BACK' => array( 'PS_PASSWD_TIME_BACK' => array(
'title' => $this->l('Password regeneration'), 'title' => $this->l('Password regeneration'),
'desc' => $this->l('Security: Minimum time to wait between two password changes'), 'desc' => $this->l('Security: Minimum time to wait between two password changes.'),
'cast' => 'intval', 'cast' => 'intval',
'size' => 5, 'size' => 5,
'type' => 'text', 'type' => 'text',
@@ -93,7 +93,7 @@ class AdminEmployeesControllerCore extends AdminController
'visibility' => Shop::CONTEXT_ALL 'visibility' => Shop::CONTEXT_ALL
), ),
'PS_BO_ALLOW_EMPLOYEE_FORM_LANG' => array( 'PS_BO_ALLOW_EMPLOYEE_FORM_LANG' => array(
'title' => $this->l('Memorize the language used in Admin panel forms.'), 'title' => $this->l('Memorize the language used in Admin panel forms'),
'desc' => $this->l('Allow employees to select a specific language for the Admin panel form.'), 'desc' => $this->l('Allow employees to select a specific language for the Admin panel form.'),
'cast' => 'intval', 'cast' => 'intval',
'type' => 'select', 'type' => 'select',
@@ -158,7 +158,7 @@ class AdminEmployeesControllerCore extends AdminController
if ($obj->id_profile == _PS_ADMIN_PROFILE_ && $this->context->employee->id_profile != _PS_ADMIN_PROFILE_) if ($obj->id_profile == _PS_ADMIN_PROFILE_ && $this->context->employee->id_profile != _PS_ADMIN_PROFILE_)
{ {
$this->errors[] = Tools::displayError('You cannot edit SuperAdmin profile.'); $this->errors[] = Tools::displayError('You cannot edit the SuperAdmin profile.');
return parent::renderForm(); return parent::renderForm();
} }
@@ -170,14 +170,14 @@ class AdminEmployeesControllerCore extends AdminController
'input' => array( 'input' => array(
array( array(
'type' => 'text', 'type' => 'text',
'label' => $this->l('First name:'), 'label' => $this->l('First Name:'),
'name' => 'firstname', 'name' => 'firstname',
'size' => 33, 'size' => 33,
'required' => true 'required' => true
), ),
array( array(
'type' => 'text', 'type' => 'text',
'label' => $this->l('Last name:'), 'label' => $this->l('Last Name:'),
'name' => 'lastname', 'name' => 'lastname',
'size' => 33, 'size' => 33,
'required' => true 'required' => true
@@ -241,7 +241,7 @@ class AdminEmployeesControllerCore extends AdminController
), ),
array( array(
'type' => 'radio', 'type' => 'radio',
'label' => $this->l('Show screencast at log in:'), 'label' => $this->l('Show screencast at login:'),
'name' => 'bo_show_screencast', 'name' => 'bo_show_screencast',
'desc' => $this->l('Display the welcome video in the Admin panel dashboard at log in.'), 'desc' => $this->l('Display the welcome video in the Admin panel dashboard at log in.'),
'required' => false, 'required' => false,
@@ -342,9 +342,9 @@ class AdminEmployeesControllerCore extends AdminController
return false; return false;
$email = $this->getFieldValue($obj, 'email'); $email = $this->getFieldValue($obj, 'email');
if (!Validate::isEmail($email)) if (!Validate::isEmail($email))
$this->errors[] = Tools::displayError('Invalid e-mail'); $this->errors[] = Tools::displayError('Invalid email address.');
elseif (Employee::employeeExists($email) && (!Tools::getValue('id_employee') || ($employee = new Employee((int)Tools::getValue('id_employee'))) && $employee->email != $email)) elseif (Employee::employeeExists($email) && (!Tools::getValue('id_employee') || ($employee = new Employee((int)Tools::getValue('id_employee'))) && $employee->email != $email))
$this->errors[] = Tools::displayError('An account already exists for this e-mail address:').' '.$email; $this->errors[] = Tools::displayError('An account already exists for this email address:').' '.$email;
} }
public function postProcess() public function postProcess()
@@ -367,7 +367,7 @@ class AdminEmployeesControllerCore extends AdminController
$employee = new Employee(Tools::getValue('id_employee')); $employee = new Employee(Tools::getValue('id_employee'));
if ($employee->isLastAdmin()) if ($employee->isLastAdmin())
{ {
$this->errors[] = Tools::displayError('You cannot disable or delete the last administrator account.'); $this->errors[] = Tools::displayError('You cannot disable or delete the administrator account.');
return false; return false;
} }
@@ -436,21 +436,21 @@ class AdminEmployeesControllerCore extends AdminController
if (Tools::getvalue('active') == 0) if (Tools::getvalue('active') == 0)
{ {
$this->errors[] = Tools::displayError('You cannot disable or delete the last administrator account.'); $this->errors[] = Tools::displayError('You cannot disable or delete the administrator account.');
return false; return false;
} }
} }
if (!in_array(Tools::getValue('bo_theme'), $this->themes)) if (!in_array(Tools::getValue('bo_theme'), $this->themes))
{ {
$this->errors[] = Tools::displayError('Invalid theme.'); $this->errors[] = Tools::displayError('Invalid theme');
return false; return false;
} }
$assos = $this->getSelectedAssoShop($this->table); $assos = $this->getSelectedAssoShop($this->table);
if (!$assos && $this->table = 'employee') if (!$assos && $this->table = 'employee')
if (Shop::isFeatureActive() && _PS_ADMIN_PROFILE_ != $_POST['id_profile']) if (Shop::isFeatureActive() && _PS_ADMIN_PROFILE_ != $_POST['id_profile'])
$this->errors[] = Tools::displayError('The employee must be associated with at least one shop'); $this->errors[] = Tools::displayError('The employee must be associated with at least one shop.');
} }
return parent::postProcess(); return parent::postProcess();
} }
@@ -127,7 +127,7 @@ class AdminFeaturesControllerCore extends AdminController
$this->addRowAction('delete'); $this->addRowAction('delete');
if (!Validate::isLoadedObject($obj = new Feature((int)$id))) if (!Validate::isLoadedObject($obj = new Feature((int)$id)))
$this->errors[] = Tools::displayError('An error occurred while updating status for object.').' <b>'.$this->table.'</b> '.Tools::displayError('(cannot load object)'); $this->errors[] = Tools::displayError('An error occurred while updating the status for an object.').' <b>'.$this->table.'</b> '.Tools::displayError('(cannot load object)');
$this->fields_list = array( $this->fields_list = array(
'id_feature_value' => array( 'id_feature_value' => array(
+1 -1
View File
@@ -177,7 +177,7 @@ class AdminGendersControllerCore extends AdminController
if (isset($this->fieldImageSettings['name']) && isset($this->fieldImageSettings['dir'])) if (isset($this->fieldImageSettings['name']) && isset($this->fieldImageSettings['dir']))
{ {
if (!Validate::isInt(Tools::getValue('img_width')) || !Validate::isInt(Tools::getValue('img_height'))) if (!Validate::isInt(Tools::getValue('img_width')) || !Validate::isInt(Tools::getValue('img_height')))
$this->errors[] = Tools::displayError('Width and height must be numeric values'); $this->errors[] = Tools::displayError('Width and height must be numeric values.');
else else
{ {
if ((int)Tools::getValue('img_width') > 0 && (int)Tools::getValue('img_height') > 0) if ((int)Tools::getValue('img_width') > 0 && (int)Tools::getValue('img_height') > 0)
@@ -87,12 +87,12 @@ class AdminGeolocationControllerCore extends AdminController
Configuration::updateValue('PS_GEOLOCATION_ENABLED', (int)Tools::getValue('PS_GEOLOCATION_ENABLED')); Configuration::updateValue('PS_GEOLOCATION_ENABLED', (int)Tools::getValue('PS_GEOLOCATION_ENABLED'));
// stop processing if geolocation is set to yes but geolite pack is not available // stop processing if geolocation is set to yes but geolite pack is not available
elseif (Tools::getValue('PS_GEOLOCATION_ENABLED')) elseif (Tools::getValue('PS_GEOLOCATION_ENABLED'))
$this->errors[] = Tools::displayError('Geolocation database is unavailable.'); $this->errors[] = Tools::displayError('The geolocation database is unavailable.');
if (empty($this->errors)) if (empty($this->errors))
{ {
if (!is_array(Tools::getValue('countries')) || !count(Tools::getValue('countries'))) if (!is_array(Tools::getValue('countries')) || !count(Tools::getValue('countries')))
$this->errors[] = Tools::displayError('Country selection is invalid'); $this->errors[] = Tools::displayError('Country selection is invalid.');
else else
{ {
Configuration::updateValue( Configuration::updateValue(
@@ -121,7 +121,7 @@ class AdminGeolocationControllerCore extends AdminController
{ {
// This field is not declared in class constructor because we want it to be manually post processed // This field is not declared in class constructor because we want it to be manually post processed
$this->fields_options['geolocationCountries']['fields']['countries'] = array( $this->fields_options['geolocationCountries']['fields']['countries'] = array(
'title' => $this->l('Select countries that can access your store:'), 'title' => $this->l('Select the countries from which your store is accessible'),
'type' => 'checkbox_table', 'type' => 'checkbox_table',
'identifier' => 'iso_code', 'identifier' => 'iso_code',
'list' => Country::getCountries($this->context->language->id), 'list' => Country::getCountries($this->context->language->id),
+6 -6
View File
@@ -359,7 +359,7 @@ class AdminGroupsControllerCore extends AdminController
public function processSave() public function processSave()
{ {
if (!$this->validateDiscount(Tools::getValue('reduction'))) if (!$this->validateDiscount(Tools::getValue('reduction')))
$this->errors[] = Tools::displayError('Discount value is incorrect (must be a percentage)'); $this->errors[] = Tools::displayError('The discount value is incorrect (must be a percentage).');
else else
{ {
$this->updateCategoryReduction(); $this->updateCategoryReduction();
@@ -390,7 +390,7 @@ class AdminGroupsControllerCore extends AdminController
} }
else if (!$this->validateDiscount($category_reduction)) else if (!$this->validateDiscount($category_reduction))
{ {
$result['errors'][] = Tools::displayError('Discount value is incorrect (must be a percentage)'); $result['errors'][] = Tools::displayError('The discount value is incorrect (must be a percentage).');
$result['hasError'] = true; $result['hasError'] = true;
} }
else else
@@ -435,7 +435,7 @@ class AdminGroupsControllerCore extends AdminController
foreach ($category_reduction as $cat => $reduction) foreach ($category_reduction as $cat => $reduction)
{ {
if (!Validate::isUnsignedId($cat) || !$this->validateDiscount($reduction)) if (!Validate::isUnsignedId($cat) || !$this->validateDiscount($reduction))
$this->errors[] = Tools::displayError('Discount value is incorrect'); $this->errors[] = Tools::displayError('The discount value is incorrect.');
else else
{ {
$category = new Category((int)$cat); $category = new Category((int)$cat);
@@ -445,7 +445,7 @@ class AdminGroupsControllerCore extends AdminController
$group_reduction->reduction = (float)($reduction / 100); $group_reduction->reduction = (float)($reduction / 100);
$group_reduction->id_category = (int)$cat; $group_reduction->id_category = (int)$cat;
if (!$group_reduction->save()) if (!$group_reduction->save())
$this->errors[] = Tools::displayError('Cannot save group reductions'); $this->errors[] = Tools::displayError('You cannot save group reductions.');
} }
} }
} }
@@ -458,10 +458,10 @@ class AdminGroupsControllerCore extends AdminController
{ {
$group = new Group($this->id_object); $group = new Group($this->id_object);
if (!Validate::isLoadedObject($group)) if (!Validate::isLoadedObject($group))
$this->errors[] = Tools::displayError('An error occurred while updating group.'); $this->errors[] = Tools::displayError('An error occurred while updating this group.');
$update = Db::getInstance()->execute('UPDATE `'._DB_PREFIX_.'group` SET show_prices = '.($group->show_prices ? 0 : 1).' WHERE `id_group` = '.(int)$group->id); $update = Db::getInstance()->execute('UPDATE `'._DB_PREFIX_.'group` SET show_prices = '.($group->show_prices ? 0 : 1).' WHERE `id_group` = '.(int)$group->id);
if (!$update) if (!$update)
$this->errors[] = Tools::displayError('An error occurred while updating group.'); $this->errors[] = Tools::displayError('An error occurred while updating this group.');
Tools::redirectAdmin(self::$currentIndex.'&token='.$this->token); Tools::redirectAdmin(self::$currentIndex.'&token='.$this->token);
} }
+6 -6
View File
@@ -198,14 +198,14 @@ class AdminHomeControllerCore extends AdminController
if ($profile_access[(int)Tab::getIdFromClassName('AdminSpecificPriceRule')]['add']) if ($profile_access[(int)Tab::getIdFromClassName('AdminSpecificPriceRule')]['add'])
$quick_links['third'] = array( $quick_links['third'] = array(
'href' => $this->context->link->getAdminLink('AdminSpecificPriceRule').'&amp;addspecific_price_rule', 'href' => $this->context->link->getAdminLink('AdminSpecificPriceRule').'&amp;addspecific_price_rule',
'title' => $this->l('New Price Rule for catalog'), 'title' => $this->l('New price rule for catalog'),
'description' => $this->l('Monitor your activity with a thorough analysis of your shop.'), 'description' => $this->l('Monitor your activity with a thorough analysis of your shop.'),
); );
if ($profile_access[(int)Tab::getIdFromClassName('AdminProducts')]['add']) if ($profile_access[(int)Tab::getIdFromClassName('AdminProducts')]['add'])
$quick_links['fourth'] = array( $quick_links['fourth'] = array(
'href' => $this->context->link->getAdminLink('AdminProducts').'&amp;addproduct', 'href' => $this->context->link->getAdminLink('AdminProducts').'&amp;addproduct',
'title' => $this->l('New Product'), 'title' => $this->l('New product'),
'description' => $this->l('Add a new employee account and discharge a part of your duties as shop owner.'), 'description' => $this->l('Add a new employee account and discharge a part of your duties as shop owner.'),
); );
@@ -213,27 +213,27 @@ class AdminHomeControllerCore extends AdminController
$quick_links['fifth'] = array( $quick_links['fifth'] = array(
'href' => $this->context->link->getAdminLink('AdminModules'), 'href' => $this->context->link->getAdminLink('AdminModules'),
'title' => $this->l('New module'), 'title' => $this->l('New module'),
'description' => $this->l('Configure your modules.'), 'description' => $this->l('Configure your modules'),
); );
if ($profile_access[(int)Tab::getIdFromClassName('AdminCartRules')]['add']) if ($profile_access[(int)Tab::getIdFromClassName('AdminCartRules')]['add'])
$quick_links['sixth'] = array( $quick_links['sixth'] = array(
'href' => $this->context->link->getAdminLink('AdminCartRules').'&amp;addcart_rule', 'href' => $this->context->link->getAdminLink('AdminCartRules').'&amp;addcart_rule',
'title' => $this->l('New price rule for cart'), 'title' => $this->l('New price rule for cart'),
'description' => $this->l('Add new cart rule.'), 'description' => $this->l('Add new cart rule'),
); );
if ($profile_access[(int)Tab::getIdFromClassName('AdminCmsContent')]['add']) if ($profile_access[(int)Tab::getIdFromClassName('AdminCmsContent')]['add'])
$quick_links['seventh'] = array( $quick_links['seventh'] = array(
'href' => $this->context->link->getAdminLink('AdminCmsContent').'&amp;addcms', 'href' => $this->context->link->getAdminLink('AdminCmsContent').'&amp;addcms',
'title' => $this->l('New Page CMS'), 'title' => $this->l('New CMS page'),
'description' => $this->l('Add a new CMS page.'), 'description' => $this->l('Add a new CMS page.'),
); );
if ($profile_access[(int)Tab::getIdFromClassName('AdminCarts')]['view']) if ($profile_access[(int)Tab::getIdFromClassName('AdminCarts')]['view'])
$quick_links['eighth'] = array( $quick_links['eighth'] = array(
'href' => $this->context->link->getAdminLink('AdminCarts').'&amp;id_cart', 'href' => $this->context->link->getAdminLink('AdminCarts').'&amp;id_cart',
'title' => $this->l('Abandoned Carts'), 'title' => $this->l('Abandoned shopping carts'),
'description' => $this->l('View your customer\'s carts.'), 'description' => $this->l('View your customer\'s carts.'),
); );
return $quick_links; return $quick_links;
+36 -36
View File
@@ -43,10 +43,10 @@ class AdminImagesControllerCore extends AdminController
'name' => array('title' => $this->l('Name'), 'width' => 'auto'), 'name' => array('title' => $this->l('Name'), 'width' => 'auto'),
'width' => array('title' => $this->l('Width'), 'align' => 'right', 'suffix' => ' px', 'width' => 50, 'size' => 5), 'width' => array('title' => $this->l('Width'), 'align' => 'right', 'suffix' => ' px', 'width' => 50, 'size' => 5),
'height' => array('title' => $this->l('Height'), 'align' => 'right', 'suffix' => ' px', 'width' => 50, 'size' => 5), 'height' => array('title' => $this->l('Height'), 'align' => 'right', 'suffix' => ' px', 'width' => 50, 'size' => 5),
'products' => array('title' => $this->l('Products:'), 'width' => 50, 'align' => 'center', 'type' => 'bool', 'callback' => 'printEntityActiveIcon', 'orderby' => false), 'products' => array('title' => $this->l('Products'), 'width' => 50, 'align' => 'center', 'type' => 'bool', 'callback' => 'printEntityActiveIcon', 'orderby' => false),
'categories' => array('title' => $this->l('Categories:'), 'width' => 50, 'align' => 'center', 'type' => 'bool', 'callback' => 'printEntityActiveIcon', 'orderby' => false), 'categories' => array('title' => $this->l('Categories'), 'width' => 50, 'align' => 'center', 'type' => 'bool', 'callback' => 'printEntityActiveIcon', 'orderby' => false),
'manufacturers' => array('title' => $this->l('Manufacturers:'), 'width' => 50, 'align' => 'center', 'type' => 'bool', 'callback' => 'printEntityActiveIcon', 'orderby' => false), 'manufacturers' => array('title' => $this->l('Manufacturers'), 'width' => 50, 'align' => 'center', 'type' => 'bool', 'callback' => 'printEntityActiveIcon', 'orderby' => false),
'suppliers' => array('title' => $this->l('Suppliers:'), 'width' => 50, 'align' => 'center', 'type' => 'bool', 'callback' => 'printEntityActiveIcon', 'orderby' => false), 'suppliers' => array('title' => $this->l('Suppliers'), 'width' => 50, 'align' => 'center', 'type' => 'bool', 'callback' => 'printEntityActiveIcon', 'orderby' => false),
'scenes' => array('title' => $this->l('Scenes'), 'width' => 50, 'align' => 'center', 'type' => 'bool', 'callback' => 'printEntityActiveIcon', 'orderby' => false), 'scenes' => array('title' => $this->l('Scenes'), 'width' => 50, 'align' => 'center', 'type' => 'bool', 'callback' => 'printEntityActiveIcon', 'orderby' => false),
'stores' => array('title' => $this->l('Stores'), 'width' => 50, 'align' => 'center', 'type' => 'bool', 'callback' => 'printEntityActiveIcon', 'orderby' => false) 'stores' => array('title' => $this->l('Stores'), 'width' => 50, 'align' => 'center', 'type' => 'bool', 'callback' => 'printEntityActiveIcon', 'orderby' => false)
); );
@@ -57,8 +57,8 @@ class AdminImagesControllerCore extends AdminController
'icon' => 'tab-orders', 'icon' => 'tab-orders',
'top' => '', 'top' => '',
'bottom' => '', 'bottom' => '',
'description' => $this->l('JPEG images have a small file size and standard quality. PNG images have a bigger file size, a higher quality and support transparency. Note that in all cases the image files will have the .jpg extension.').' 'description' => $this->l('JPEG images have a small file size and standard quality. PNG images have a larger file size, a higher quality and support transparency. Note that in all cases the image files will have the .jpg extension.').'
<br /><br />'.$this->l('WARNING: This feature may not be compatible with your theme or with some modules. In particular, PNG mode is not compatible with the Watermark module. If you encounter any issues, turn it off by selecting "Use JPEG".'), <br /><br />'.$this->l('WARNING: This feature may not be compatible with your theme, or with some of your modules. In particular, PNG mode is not compatible with the Watermark module. If you encounter any issues, turn it off by selecting "Use JPEG".'),
'fields' => array( 'fields' => array(
'PS_IMAGE_QUALITY' => array( 'PS_IMAGE_QUALITY' => array(
'title' => $this->l('Image quality'), 'title' => $this->l('Image quality'),
@@ -98,15 +98,15 @@ class AdminImagesControllerCore extends AdminController
'list' => array( 'list' => array(
array( array(
'id' => '0', 'id' => '0',
'name' => $this->l('auto') 'name' => $this->l('Auto')
), ),
array( array(
'id' => '1', 'id' => '1',
'name' => $this->l('width') 'name' => $this->l('Width')
), ),
array( array(
'id' => '2', 'id' => '2',
'name' => $this->l('height') 'name' => $this->l('Height')
) )
), ),
'identifier' => 'id', 'identifier' => 'id',
@@ -119,7 +119,7 @@ class AdminImagesControllerCore extends AdminController
'required' => true, 'required' => true,
'cast' => 'intval', 'cast' => 'intval',
'type' => 'text', 'type' => 'text',
'suffix' => $this->l('bytes'), 'suffix' => $this->l('Bytes'),
'visibility' => Shop::CONTEXT_ALL 'visibility' => Shop::CONTEXT_ALL
), ),
'PS_PRODUCT_PICTURE_WIDTH' => array( 'PS_PRODUCT_PICTURE_WIDTH' => array(
@@ -143,7 +143,7 @@ class AdminImagesControllerCore extends AdminController
'visibility' => Shop::CONTEXT_ALL 'visibility' => Shop::CONTEXT_ALL
), ),
'PS_LEGACY_IMAGES' => array( 'PS_LEGACY_IMAGES' => array(
'title' => $this->l('Use the legacy image filesystem.'), 'title' => $this->l('Use the legacy image filesystem'),
'desc' => $this->l('This should be set to yes unless you successfully moved images in "Images" page under the "Preferences" menu.'), 'desc' => $this->l('This should be set to yes unless you successfully moved images in "Images" page under the "Preferences" menu.'),
'validation' => 'isBool', 'validation' => 'isBool',
'cast' => 'intval', 'cast' => 'intval',
@@ -164,14 +164,14 @@ class AdminImagesControllerCore extends AdminController
'input' => array( 'input' => array(
array( array(
'type' => 'text', 'type' => 'text',
'label' => $this->l('Type name:'), 'label' => $this->l('Type name'),
'name' => 'name', 'name' => 'name',
'required' => true, 'required' => true,
'desc' => $this->l('Letters and minus sign (-) only (e.g. small, medium, large, extra-large)') 'desc' => $this->l('Letters and hyphens only (e.g. small, medium, large, extra-large)')
), ),
array( array(
'type' => 'text', 'type' => 'text',
'label' => $this->l('Width:'), 'label' => $this->l('Width'),
'name' => 'width', 'name' => 'width',
'required' => true, 'required' => true,
'size' => 4, 'size' => 4,
@@ -180,7 +180,7 @@ class AdminImagesControllerCore extends AdminController
), ),
array( array(
'type' => 'text', 'type' => 'text',
'label' => $this->l('Height:'), 'label' => $this->l('Height'),
'name' => 'height', 'name' => 'height',
'required' => true, 'required' => true,
'size' => 4, 'size' => 4,
@@ -189,7 +189,7 @@ class AdminImagesControllerCore extends AdminController
), ),
array( array(
'type' => 'radio', 'type' => 'radio',
'label' => $this->l('Products:'), 'label' => $this->l('Products'),
'name' => 'products', 'name' => 'products',
'required' => false, 'required' => false,
'class' => 't', 'class' => 't',
@@ -210,7 +210,7 @@ class AdminImagesControllerCore extends AdminController
), ),
array( array(
'type' => 'radio', 'type' => 'radio',
'label' => $this->l('Categories:'), 'label' => $this->l('Categories'),
'name' => 'categories', 'name' => 'categories',
'required' => false, 'required' => false,
'class' => 't', 'class' => 't',
@@ -231,7 +231,7 @@ class AdminImagesControllerCore extends AdminController
), ),
array( array(
'type' => 'radio', 'type' => 'radio',
'label' => $this->l('Manufacturers:'), 'label' => $this->l('Manufacturers'),
'name' => 'manufacturers', 'name' => 'manufacturers',
'required' => false, 'required' => false,
'class' => 't', 'class' => 't',
@@ -252,7 +252,7 @@ class AdminImagesControllerCore extends AdminController
), ),
array( array(
'type' => 'radio', 'type' => 'radio',
'label' => $this->l('Suppliers:'), 'label' => $this->l('Suppliers'),
'name' => 'suppliers', 'name' => 'suppliers',
'required' => false, 'required' => false,
'class' => 't', 'class' => 't',
@@ -273,7 +273,7 @@ class AdminImagesControllerCore extends AdminController
), ),
array( array(
'type' => 'radio', 'type' => 'radio',
'label' => $this->l('Scenes:'), 'label' => $this->l('Scenes'),
'name' => 'scenes', 'name' => 'scenes',
'required' => false, 'required' => false,
'class' => 't', 'class' => 't',
@@ -294,7 +294,7 @@ class AdminImagesControllerCore extends AdminController
), ),
array( array(
'type' => 'radio', 'type' => 'radio',
'label' => $this->l('Stores:'), 'label' => $this->l('Stores'),
'name' => 'stores', 'name' => 'stores',
'required' => false, 'required' => false,
'class' => 't', 'class' => 't',
@@ -331,7 +331,7 @@ class AdminImagesControllerCore extends AdminController
{ {
$this->warnings[] = $this->l('Duplicate images were found when moving the product images. This is likely caused by unused demonstration images. Please make sure that the folder'). $this->warnings[] = $this->l('Duplicate images were found when moving the product images. This is likely caused by unused demonstration images. Please make sure that the folder').
_PS_PROD_IMG_DIR_.'duplicates/'. _PS_PROD_IMG_DIR_.'duplicates/'.
$this->l('only contains demonstration images, and then delete this folder.'); $this->l('only contains demonstration images, and then delete it.');
} }
if (Tools::getValue('submitRegenerate'.$this->table)) if (Tools::getValue('submitRegenerate'.$this->table))
@@ -342,7 +342,7 @@ class AdminImagesControllerCore extends AdminController
Tools::redirectAdmin(self::$currentIndex.'&conf=9'.'&token='.$this->token); Tools::redirectAdmin(self::$currentIndex.'&conf=9'.'&token='.$this->token);
} }
else else
$this->errors[] = Tools::displayError('You do not have permission to edit here.'); $this->errors[] = Tools::displayError('You do not have permission to edit this.');
} }
elseif (Tools::getValue('submitMoveImages'.$this->table)) elseif (Tools::getValue('submitMoveImages'.$this->table))
{ {
@@ -352,7 +352,7 @@ class AdminImagesControllerCore extends AdminController
Tools::redirectAdmin(self::$currentIndex.'&conf=25'.'&token='.$this->token); Tools::redirectAdmin(self::$currentIndex.'&conf=25'.'&token='.$this->token);
} }
else else
$this->errors[] = Tools::displayError('You do not have permission to edit here.'); $this->errors[] = Tools::displayError('You do not have permission to edit this.');
} }
elseif (Tools::getValue('submitImagePreferences')) elseif (Tools::getValue('submitImagePreferences'))
{ {
@@ -360,10 +360,10 @@ class AdminImagesControllerCore extends AdminController
{ {
if ((int)Tools::getValue('PS_JPEG_QUALITY') < 0 if ((int)Tools::getValue('PS_JPEG_QUALITY') < 0
|| (int)Tools::getValue('PS_JPEG_QUALITY') > 100) || (int)Tools::getValue('PS_JPEG_QUALITY') > 100)
$this->errors[] = Tools::displayError('Incorrect value for JPEG image quality.'); $this->errors[] = Tools::displayError('Incorrect value for the selected JPEG image quality.');
elseif ((int)Tools::getValue('PS_PNG_QUALITY') < 0 elseif ((int)Tools::getValue('PS_PNG_QUALITY') < 0
|| (int)Tools::getValue('PS_PNG_QUALITY') > 9) || (int)Tools::getValue('PS_PNG_QUALITY') > 9)
$this->errors[] = Tools::displayError('Incorrect value for PNG image quality.'); $this->errors[] = Tools::displayError('Incorrect value for the selected PNG image quality.');
elseif (!Configuration::updateValue('PS_IMAGE_QUALITY', Tools::getValue('PS_IMAGE_QUALITY')) elseif (!Configuration::updateValue('PS_IMAGE_QUALITY', Tools::getValue('PS_IMAGE_QUALITY'))
|| !Configuration::updateValue('PS_JPEG_QUALITY', Tools::getValue('PS_JPEG_QUALITY')) || !Configuration::updateValue('PS_JPEG_QUALITY', Tools::getValue('PS_JPEG_QUALITY'))
|| !Configuration::updateValue('PS_PNG_QUALITY', Tools::getValue('PS_PNG_QUALITY'))) || !Configuration::updateValue('PS_PNG_QUALITY', Tools::getValue('PS_PNG_QUALITY')))
@@ -372,7 +372,7 @@ class AdminImagesControllerCore extends AdminController
return parent::postProcess(); return parent::postProcess();
} }
else else
$this->errors[] = Tools::displayError('You do not have permission to edit here.'); $this->errors[] = Tools::displayError('You do not have permission to edit this.');
} }
else else
@@ -396,11 +396,11 @@ class AdminImagesControllerCore extends AdminController
public function initRegenerate() public function initRegenerate()
{ {
$types = array( $types = array(
'categories' => $this->l('Categories:'), 'categories' => $this->l('Categories'),
'manufacturers' => $this->l('Manufacturers:'), 'manufacturers' => $this->l('Manufacturers'),
'suppliers' => $this->l('Suppliers:'), 'suppliers' => $this->l('Suppliers'),
'scenes' => $this->l('Scenes'), 'scenes' => $this->l('Scenes'),
'products' => $this->l('Products:'), 'products' => $this->l('Products'),
'stores' => $this->l('Stores') 'stores' => $this->l('Stores')
); );
@@ -613,12 +613,12 @@ class AdminImagesControllerCore extends AdminController
$this->errors[] = sprintf(Tools::displayError('Cannot write %s images. Please check the folder\'s writing permissions %s.'), $proc['type'], $proc['dir']); $this->errors[] = sprintf(Tools::displayError('Cannot write %s images. Please check the folder\'s writing permissions %s.'), $proc['type'], $proc['dir']);
} }
elseif ($return == 'timeout') elseif ($return == 'timeout')
$this->errors[] = Tools::displayError('Only part of the images have been regenerated, server timed out before finishing.'); $this->errors[] = Tools::displayError('Only part of the images have been regenerated. The server timed out before finishing.');
else else
{ {
if ($proc['type'] == 'products') if ($proc['type'] == 'products')
if ($this->_regenerateWatermark($proc['dir']) == 'timeout') if ($this->_regenerateWatermark($proc['dir']) == 'timeout')
$this->errors[] = Tools::displayError('Server timed out, the watermark may not have been applied to all images.'); $this->errors[] = Tools::displayError('Server timed out. The watermark may not have been applied to all images.');
if (!count($this->errors)) if (!count($this->errors))
if ($this->_regenerateNoPictureImages($proc['dir'], $formats, $languages)) if ($this->_regenerateNoPictureImages($proc['dir'], $formats, $languages))
$this->errors[] = sprintf( $this->errors[] = sprintf(
@@ -647,16 +647,16 @@ class AdminImagesControllerCore extends AdminController
protected function _moveImagesToNewFileSystem() protected function _moveImagesToNewFileSystem()
{ {
if (!Image::testFileSystem()) if (!Image::testFileSystem())
$this->errors[] = Tools::displayError('Error: your server configuration is not compatible with the new image system. No images were moved'); $this->errors[] = Tools::displayError('Error: Your server configuration is not compatible with the new image system. No images were moved.');
else else
{ {
ini_set('max_execution_time', $this->max_execution_time); // ini_set may be disabled, we need the real value ini_set('max_execution_time', $this->max_execution_time); // ini_set may be disabled, we need the real value
$this->max_execution_time = (int)ini_get('max_execution_time'); $this->max_execution_time = (int)ini_get('max_execution_time');
$result = Image::moveToNewFileSystem($this->max_execution_time); $result = Image::moveToNewFileSystem($this->max_execution_time);
if ($result === 'timeout') if ($result === 'timeout')
$this->errors[] = Tools::displayError('Not all images have been moved, server timed out before finishing. Click on "Move images" again to resume moving images'); $this->errors[] = Tools::displayError('Not all images have been moved. The server timed out before finishing. Click on "Move images" again to resume the moving process.');
else if ($result === false) else if ($result === false)
$this->errors[] = Tools::displayError('Error: some or all images could not be moved.'); $this->errors[] = Tools::displayError('Error: Some -- or all -- images can not be moved.');
} }
return (count($this->errors) > 0 ? false : true); return (count($this->errors) > 0 ? false : true);
} }
+46 -46
View File
@@ -81,13 +81,13 @@ class AdminImportControllerCore extends AdminController
public function __construct() public function __construct()
{ {
$this->entities = array( $this->entities = array(
$this->l('Categories:'), $this->l('Categories'),
$this->l('Products:'), $this->l('Products'),
$this->l('Combinations'), $this->l('Combinations'),
$this->l('Customers'), $this->l('Customers'),
$this->l('Addresses'), $this->l('Addresses'),
$this->l('Manufacturers:'), $this->l('Manufacturers'),
$this->l('Suppliers:'), $this->l('Suppliers'),
); );
// @since 1.5.0 // @since 1.5.0
@@ -96,8 +96,8 @@ class AdminImportControllerCore extends AdminController
$this->entities = array_merge( $this->entities = array_merge(
$this->entities, $this->entities,
array( array(
$this->l('SupplyOrders'), $this->l('Supply Orders'),
$this->l('SupplyOrdersDetails'), $this->l('Supply Order Details'),
) )
); );
} }
@@ -161,7 +161,7 @@ class AdminImportControllerCore extends AdminController
); );
break; break;
case $this->entities[$this->l('Categories:')]: case $this->entities[$this->l('Categories')]:
$this->available_fields = array( $this->available_fields = array(
'no' => array('label' => $this->l('Ignore this column')), 'no' => array('label' => $this->l('Ignore this column')),
'id' => array('label' => $this->l('ID')), 'id' => array('label' => $this->l('ID')),
@@ -173,9 +173,9 @@ class AdminImportControllerCore extends AdminController
'help' => $this->l('A category root is where a category tree can begin. This is used with multistore.') 'help' => $this->l('A category root is where a category tree can begin. This is used with multistore.')
), ),
'description' => array('label' => $this->l('Description')), 'description' => array('label' => $this->l('Description')),
'meta_title' => array('label' => $this->l('Meta-title')), 'meta_title' => array('label' => $this->l('Meta title')),
'meta_keywords' => array('label' => $this->l('Meta-keywords')), 'meta_keywords' => array('label' => $this->l('Meta keywords')),
'meta_description' => array('label' => $this->l('Meta-description')), 'meta_description' => array('label' => $this->l('Meta description')),
'link_rewrite' => array('label' => $this->l('URL rewritten')), 'link_rewrite' => array('label' => $this->l('URL rewritten')),
'image' => array('label' => $this->l('Image URL')), 'image' => array('label' => $this->l('Image URL')),
'shop' => array( 'shop' => array(
@@ -191,7 +191,7 @@ class AdminImportControllerCore extends AdminController
); );
break; break;
case $this->entities[$this->l('Products:')]: case $this->entities[$this->l('Products')]:
self::$validators['image'] = array( self::$validators['image'] = array(
'AdminImportController', 'AdminImportController',
'split' 'split'
@@ -224,9 +224,9 @@ class AdminImportControllerCore extends AdminController
'description_short' => array('label' => $this->l('Short description')), 'description_short' => array('label' => $this->l('Short description')),
'description' => array('label' => $this->l('Description')), 'description' => array('label' => $this->l('Description')),
'tags' => array('label' => $this->l('Tags (x,y,z...)')), 'tags' => array('label' => $this->l('Tags (x,y,z...)')),
'meta_title' => array('label' => $this->l('Meta-title')), 'meta_title' => array('label' => $this->l('Meta title')),
'meta_keywords' => array('label' => $this->l('Meta-keywords')), 'meta_keywords' => array('label' => $this->l('Meta keywords')),
'meta_description' => array('label' => $this->l('Meta-description')), 'meta_description' => array('label' => $this->l('Meta description')),
'link_rewrite' => array('label' => $this->l('URL rewritten')), 'link_rewrite' => array('label' => $this->l('URL rewritten')),
'available_now' => array('label' => $this->l('Text when in stock')), 'available_now' => array('label' => $this->l('Text when in stock')),
'available_later' => array('label' => $this->l('Text when backorder allowed')), 'available_later' => array('label' => $this->l('Text when backorder allowed')),
@@ -316,7 +316,7 @@ class AdminImportControllerCore extends AdminController
'firstname' => array('label' => $this->l('First Name *')), 'firstname' => array('label' => $this->l('First Name *')),
'address1' => array('label' => $this->l('Address 1 *')), 'address1' => array('label' => $this->l('Address 1 *')),
'address2' => array('label' => $this->l('Address 2')), 'address2' => array('label' => $this->l('Address 2')),
'postcode' => array('label' => $this->l('Postcode*/ Zipcode*')), 'postcode' => array('label' => $this->l('Postal code / Zipcode*')),
'city' => array('label' => $this->l('City *')), 'city' => array('label' => $this->l('City *')),
'country' => array('label' => $this->l('Country *')), 'country' => array('label' => $this->l('Country *')),
'state' => array('label' => $this->l('State')), 'state' => array('label' => $this->l('State')),
@@ -332,8 +332,8 @@ class AdminImportControllerCore extends AdminController
); );
break; break;
case $this->entities[$this->l('Manufacturers:')]: case $this->entities[$this->l('Manufacturers')]:
case $this->entities[$this->l('Suppliers:')]: case $this->entities[$this->l('Suppliers')]:
//Overwrite validators AS name is not MultiLangField //Overwrite validators AS name is not MultiLangField
self::$validators = array( self::$validators = array(
'description' => array('AdminImportController', 'createMultiLangField'), 'description' => array('AdminImportController', 'createMultiLangField'),
@@ -350,9 +350,9 @@ class AdminImportControllerCore extends AdminController
'name' => array('label' => $this->l('Name *')), 'name' => array('label' => $this->l('Name *')),
'description' => array('label' => $this->l('Description')), 'description' => array('label' => $this->l('Description')),
'short_description' => array('label' => $this->l('Short description')), 'short_description' => array('label' => $this->l('Short description')),
'meta_title' => array('label' => $this->l('Meta-title')), 'meta_title' => array('label' => $this->l('Meta title')),
'meta_keywords' => array('label' => $this->l('Meta-keywords')), 'meta_keywords' => array('label' => $this->l('Meta keywords')),
'meta_description' => array('label' => $this->l('Meta-description')), 'meta_description' => array('label' => $this->l('Meta description')),
'shop' => array( 'shop' => array(
'label' => $this->l('ID / Name of group shop'), 'label' => $this->l('ID / Name of group shop'),
'help' => $this->l('Ignore this field if you don\'t use the Multistore tool. If you leave this field empty, the default shop will be used.'), 'help' => $this->l('Ignore this field if you don\'t use the Multistore tool. If you leave this field empty, the default shop will be used.'),
@@ -364,7 +364,7 @@ class AdminImportControllerCore extends AdminController
); );
break; break;
// @since 1.5.0 // @since 1.5.0
case $this->entities[$this->l('SupplyOrders')]: case $this->entities[$this->l('Supply Orders')]:
if (Configuration::get('PS_ADVANCED_STOCK_MANAGEMENT')) if (Configuration::get('PS_ADVANCED_STOCK_MANAGEMENT'))
{ {
// required fields // required fields
@@ -397,7 +397,7 @@ class AdminImportControllerCore extends AdminController
} }
break; break;
// @since 1.5.0 // @since 1.5.0
case $this->entities[$this->l('SupplyOrdersDetails')]: case $this->entities[$this->l('Supply Order Details')]:
if (Configuration::get('PS_ADVANCED_STOCK_MANAGEMENT')) if (Configuration::get('PS_ADVANCED_STOCK_MANAGEMENT'))
{ {
// required fields // required fields
@@ -601,7 +601,7 @@ class AdminImportControllerCore extends AdminController
$this->content .= $this->renderView(); $this->content .= $this->renderView();
else else
{ {
$this->errors[] = $this->l('You must upload a file for go to the next step'); $this->errors[] = $this->l('You must upload a file in order to proceed to the next step');
$this->content .= $this->renderForm(); $this->content .= $this->renderForm();
} }
else else
@@ -855,7 +855,7 @@ class AdminImportControllerCore extends AdminController
$tab_categ = array(Configuration::get('PS_HOME_CATEGORY'), Configuration::get('PS_ROOT_CATEGORY')); $tab_categ = array(Configuration::get('PS_HOME_CATEGORY'), Configuration::get('PS_ROOT_CATEGORY'));
if (isset($info['id']) && in_array((int)$info['id'], $tab_categ)) if (isset($info['id']) && in_array((int)$info['id'], $tab_categ))
{ {
$this->errors[] = Tools::displayError('The ID category cannot be the same as the ID Root category, nor the ID Home category'); $this->errors[] = Tools::displayError('The ID category cannot be the same as the ID Root category or the ID Home category.');
continue; continue;
} }
AdminImportController::setDefaultValues($info); AdminImportController::setDefaultValues($info);
@@ -969,7 +969,7 @@ class AdminImportControllerCore extends AdminController
if ($category->id && $category->categoryExists($category->id) && !in_array($category->id, $categories_home_root)) if ($category->id && $category->categoryExists($category->id) && !in_array($category->id, $categories_home_root))
$res = $category->update(); $res = $category->update();
if ($category->id == Configuration::get('PS_ROOT_CATEGORY')) if ($category->id == Configuration::get('PS_ROOT_CATEGORY'))
$this->errors[] = Tools::displayError('Root category cannot be modified'); $this->errors[] = Tools::displayError('The root category cannot be modified.');
// If no id_category or update failed // If no id_category or update failed
if (!$res) if (!$res)
$res = $category->add(); $res = $category->add();
@@ -977,7 +977,7 @@ class AdminImportControllerCore extends AdminController
//copying images of categories //copying images of categories
if (isset($category->image) && !empty($category->image)) if (isset($category->image) && !empty($category->image))
if (!(AdminImportController::copyImg($category->id, null, $category->image, 'categories'))) if (!(AdminImportController::copyImg($category->id, null, $category->image, 'categories')))
$this->warnings[] = $category->image.' '.Tools::displayError('cannot be copied'); $this->warnings[] = $category->image.' '.Tools::displayError('cannot be copied.');
// If both failed, mysql error // If both failed, mysql error
if (!$res) if (!$res)
{ {
@@ -1088,7 +1088,7 @@ class AdminImportControllerCore extends AdminController
$this->addProductWarning( $this->addProductWarning(
'id_tax_rules_group', 'id_tax_rules_group',
$product->id_tax_rules_group, $product->id_tax_rules_group,
Tools::displayError('Invalid tax rule group ID, you first need a group with this ID.') Tools::displayError('Invalid tax rule group ID. You first need to create a group with this ID.')
); );
} }
if (isset($product->manufacturer) && is_numeric($product->manufacturer) && Manufacturer::manufacturerExists((int)$product->manufacturer)) if (isset($product->manufacturer) && is_numeric($product->manufacturer) && Manufacturer::manufacturerExists((int)$product->manufacturer))
@@ -1593,7 +1593,7 @@ class AdminImportControllerCore extends AdminController
} }
if (!$id_image) if (!$id_image)
$this->warnings[] = sprintf( $this->warnings[] = sprintf(
Tools::displayError('No image found for combination with id_product = %s and image position = %s.'), Tools::displayError('No image was found for combination with id_product = %s and image position = %s.'),
$product->id, $product->id,
(int)$info['image_position'] (int)$info['image_position']
); );
@@ -2035,7 +2035,7 @@ class AdminImportControllerCore extends AdminController
} }
else else
{ {
$this->errors[] = sprintf(Tools::displayError('"%s": Is not a valid e-mail address'), $address->customer_email); $this->errors[] = sprintf(Tools::displayError('"%s": Is not a valid email address'), $address->customer_email);
continue; continue;
} }
} }
@@ -2057,7 +2057,7 @@ class AdminImportControllerCore extends AdminController
); );
} }
else else
$this->errors[] = sprintf(Tools::displayError('The customer ID n.%d does not exist in database (ID: %d) cannot be saved'), $address->customer_id); $this->errors[] = sprintf(Tools::displayError('The customer ID n.%d does not exist in the database (ID: %d) cannot be saved'), $address->customer_id);
} }
else else
{ {
@@ -2358,7 +2358,7 @@ class AdminImportControllerCore extends AdminController
$current_line + 1, $this->l('YYYY-MM-DD')); $current_line + 1, $this->l('YYYY-MM-DD'));
if ($discount_rate < 0 || $discount_rate > 100) if ($discount_rate < 0 || $discount_rate > 100)
$this->errors[] = sprintf($this->l('Discount rate (%d) is not valid (at line %d). %s.'), $discount_rate, $this->errors[] = sprintf($this->l('Discount rate (%d) is not valid (at line %d). %s.'), $discount_rate,
$current_line + 1, $this->l('Format: between 0 and 100')); $current_line + 1, $this->l('Format: Between 0 and 100'));
if ($supply_order->id > 0 && !$supply_order->isEditable()) if ($supply_order->id > 0 && !$supply_order->isEditable())
$this->errors[] = sprintf($this->l('Supply Order (%d) is not editable (at line %d).'), $supply_order->id, $current_line + 1); $this->errors[] = sprintf($this->l('Supply Order (%d) is not editable (at line %d).'), $supply_order->id, $current_line + 1);
@@ -2456,10 +2456,10 @@ class AdminImportControllerCore extends AdminController
$this->errors[] = sprintf($this->l('Quantity Expected (%d) is not valid (at line %d).'), $quantity_expected, $current_line + 1); $this->errors[] = sprintf($this->l('Quantity Expected (%d) is not valid (at line %d).'), $quantity_expected, $current_line + 1);
if ($discount_rate < 0 || $discount_rate > 100) if ($discount_rate < 0 || $discount_rate > 100)
$this->errors[] = sprintf($this->l('Discount rate (%d) is not valid (at line %d). %s.'), $discount_rate, $this->errors[] = sprintf($this->l('Discount rate (%d) is not valid (at line %d). %s.'), $discount_rate,
$current_line + 1, $this->l('Format: between 0 and 100')); $current_line + 1, $this->l('Format: Between 0 and 100'));
if ($tax_rate < 0 || $tax_rate > 100) if ($tax_rate < 0 || $tax_rate > 100)
$this->errors[] = sprintf($this->l('Quantity Expected (%d) is not valid (at line %d).'), $tax_rate, $this->errors[] = sprintf($this->l('Quantity Expected (%d) is not valid (at line %d).'), $tax_rate,
$current_line + 1, $this->l('Format: between 0 and 100')); $current_line + 1, $this->l('Format: Between 0 and 100'));
// if no errors, sets supply order details // if no errors, sets supply order details
if (empty($this->errors)) if (empty($this->errors))
@@ -2565,7 +2565,7 @@ class AdminImportControllerCore extends AdminController
{ {
switch ((int)$case) switch ((int)$case)
{ {
case $this->entities[$this->l('Categories:')]: case $this->entities[$this->l('Categories')]:
Db::getInstance()->execute(' Db::getInstance()->execute('
DELETE FROM `'._DB_PREFIX_.'category` DELETE FROM `'._DB_PREFIX_.'category`
WHERE id_category NOT IN ('.(int)Configuration::get('PS_HOME_CATEGORY'). WHERE id_category NOT IN ('.(int)Configuration::get('PS_HOME_CATEGORY').
@@ -2583,7 +2583,7 @@ class AdminImportControllerCore extends AdminController
if (preg_match('/^[0-9]+(\-(.*))?\.jpg$/', $d)) if (preg_match('/^[0-9]+(\-(.*))?\.jpg$/', $d))
unlink(_PS_CAT_IMG_DIR_.$d); unlink(_PS_CAT_IMG_DIR_.$d);
break; break;
case $this->entities[$this->l('Products:')]: case $this->entities[$this->l('Products')]:
Db::getInstance()->execute('TRUNCATE TABLE `'._DB_PREFIX_.'product'); Db::getInstance()->execute('TRUNCATE TABLE `'._DB_PREFIX_.'product');
Db::getInstance()->execute('TRUNCATE TABLE `'._DB_PREFIX_.'product_shop'); Db::getInstance()->execute('TRUNCATE TABLE `'._DB_PREFIX_.'product_shop');
Db::getInstance()->execute('TRUNCATE TABLE `'._DB_PREFIX_.'feature_product'); Db::getInstance()->execute('TRUNCATE TABLE `'._DB_PREFIX_.'feature_product');
@@ -2643,7 +2643,7 @@ class AdminImportControllerCore extends AdminController
case $this->entities[$this->l('Addresses')]: case $this->entities[$this->l('Addresses')]:
Db::getInstance()->execute('TRUNCATE TABLE `'._DB_PREFIX_.'address'); Db::getInstance()->execute('TRUNCATE TABLE `'._DB_PREFIX_.'address');
break; break;
case $this->entities[$this->l('Manufacturers:')]: case $this->entities[$this->l('Manufacturers')]:
Db::getInstance()->execute('TRUNCATE TABLE `'._DB_PREFIX_.'manufacturer'); Db::getInstance()->execute('TRUNCATE TABLE `'._DB_PREFIX_.'manufacturer');
Db::getInstance()->execute('TRUNCATE TABLE `'._DB_PREFIX_.'manufacturer_lang'); Db::getInstance()->execute('TRUNCATE TABLE `'._DB_PREFIX_.'manufacturer_lang');
Db::getInstance()->execute('TRUNCATE TABLE `'._DB_PREFIX_.'manufacturer_shop'); Db::getInstance()->execute('TRUNCATE TABLE `'._DB_PREFIX_.'manufacturer_shop');
@@ -2651,7 +2651,7 @@ class AdminImportControllerCore extends AdminController
if (preg_match('/^[0-9]+(\-(.*))?\.jpg$/', $d)) if (preg_match('/^[0-9]+(\-(.*))?\.jpg$/', $d))
unlink(_PS_MANU_IMG_DIR_.$d); unlink(_PS_MANU_IMG_DIR_.$d);
break; break;
case $this->entities[$this->l('Suppliers:')]: case $this->entities[$this->l('Suppliers')]:
Db::getInstance()->execute('TRUNCATE TABLE `'._DB_PREFIX_.'supplier'); Db::getInstance()->execute('TRUNCATE TABLE `'._DB_PREFIX_.'supplier');
Db::getInstance()->execute('TRUNCATE TABLE `'._DB_PREFIX_.'supplier_lang'); Db::getInstance()->execute('TRUNCATE TABLE `'._DB_PREFIX_.'supplier_lang');
Db::getInstance()->execute('TRUNCATE TABLE `'._DB_PREFIX_.'supplier_shop'); Db::getInstance()->execute('TRUNCATE TABLE `'._DB_PREFIX_.'supplier_shop');
@@ -2696,14 +2696,14 @@ class AdminImportControllerCore extends AdminController
break; break;
break; break;
case UPLOAD_ERR_NO_FILE: case UPLOAD_ERR_NO_FILE:
$this->errors[] = Tools::displayError('No file was uploaded'); $this->errors[] = Tools::displayError('No file was uploaded.');
break; break;
break; break;
} }
} }
else if (!file_exists($_FILES['file']['tmp_name']) || else if (!file_exists($_FILES['file']['tmp_name']) ||
!@move_uploaded_file($_FILES['file']['tmp_name'], _PS_ADMIN_DIR_.'/import/'.date('Ymdhis').'-'.$_FILES['file']['name'])) !@move_uploaded_file($_FILES['file']['tmp_name'], _PS_ADMIN_DIR_.'/import/'.date('Ymdhis').'-'.$_FILES['file']['name']))
$this->errors[] = $this->l('an error occurred while uploading and copying file'); $this->errors[] = $this->l('An error occurred while uploading / copying the file.');
else else
Tools::redirectAdmin(self::$currentIndex.'&token='.Tools::getValue('token').'&conf=18'); Tools::redirectAdmin(self::$currentIndex.'&token='.Tools::getValue('token').'&conf=18');
} }
@@ -2718,10 +2718,10 @@ class AdminImportControllerCore extends AdminController
switch ((int)Tools::getValue('entity')) switch ((int)Tools::getValue('entity'))
{ {
case $this->entities[$this->l('Categories:')]: case $this->entities[$this->l('Categories')]:
$this->categoryImport(); $this->categoryImport();
break; break;
case $this->entities[$this->l('Products:')]: case $this->entities[$this->l('Products')]:
$this->productImport(); $this->productImport();
break; break;
case $this->entities[$this->l('Customers')]: case $this->entities[$this->l('Customers')]:
@@ -2733,19 +2733,19 @@ class AdminImportControllerCore extends AdminController
case $this->entities[$this->l('Combinations')]: case $this->entities[$this->l('Combinations')]:
$this->attributeImport(); $this->attributeImport();
break; break;
case $this->entities[$this->l('Manufacturers:')]: case $this->entities[$this->l('Manufacturers')]:
$this->manufacturerImport(); $this->manufacturerImport();
break; break;
case $this->entities[$this->l('Suppliers:')]: case $this->entities[$this->l('Suppliers')]:
$this->supplierImport(); $this->supplierImport();
break; break;
// @since 1.5.0 // @since 1.5.0
case $this->entities[$this->l('SupplyOrders')]: case $this->entities[$this->l('Supply Orders')]:
if (Configuration::get('PS_ADVANCED_STOCK_MANAGEMENT')) if (Configuration::get('PS_ADVANCED_STOCK_MANAGEMENT'))
$this->supplyOrdersImport(); $this->supplyOrdersImport();
break; break;
// @since 1.5.0 // @since 1.5.0
case $this->entities[$this->l('SupplyOrdersDetails')]: case $this->entities[$this->l('Supply Order Details')]:
if (Configuration::get('PS_ADVANCED_STOCK_MANAGEMENT')) if (Configuration::get('PS_ADVANCED_STOCK_MANAGEMENT'))
$this->supplyOrdersDetailsImport(); $this->supplyOrdersDetailsImport();
break; break;
@@ -2754,7 +2754,7 @@ class AdminImportControllerCore extends AdminController
} }
} }
else else
$this->errors[] = $this->l('You must upload a file for go to the next step'); $this->errors[] = $this->l('You must upload a file in order to proceed to the next step');
} }
parent::postProcess(); parent::postProcess();
Loaded 100 of 715 files, more files were not shown because too many files have changed in this diff. Show more