//added russian installer and changed english strings

This commit is contained in:
vAugagneur
2013-03-13 16:28:19 +01:00
645 changed files with 8683 additions and 7069 deletions
+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).'"');
+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;
} }
@@ -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 />
@@ -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;">';
@@ -983,7 +983,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 +997,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 +1021,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 +1054,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 +1067,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 +1080,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 +1101,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 +1159,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 +1176,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 +1199,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 +1210,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 +1229,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 +1237,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>
+36 -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')))
@@ -1089,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)
@@ -1100,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;
} }
@@ -1414,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;
} }
@@ -1887,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]))
@@ -1895,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))
@@ -1903,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']))
@@ -1911,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')
@@ -1929,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
@@ -1943,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]))
@@ -1954,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]))
{ {
@@ -1970,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]))
{ {
@@ -1987,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';
@@ -2002,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'))
@@ -2013,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;
} }
} }
@@ -2346,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)
); );
@@ -2365,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
); );
@@ -2393,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)
); );
@@ -2402,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)
); );
} }
@@ -2419,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']
); );
@@ -2636,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;
@@ -2692,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
+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'),
+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'))
{ {
@@ -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,18 +357,18 @@ 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')) 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'); $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 */
@@ -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'];
@@ -304,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();
@@ -599,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()
@@ -608,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();
@@ -619,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)
@@ -652,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();
} }
} }
@@ -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
+3 -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>',
@@ -205,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();
@@ -56,7 +56,7 @@ class AdminInvoicesControllerCore extends AdminController
'cast' => 'intval' 'cast' => 'intval'
), ),
'PS_INVOICE_FREE_TEXT' => array( 'PS_INVOICE_FREE_TEXT' => array(
'title' => $this->l('Footer Text:'), 'title' => $this->l('Footer text:'),
'desc' => $this->l('This text will appear at the bottom of the invoice'), 'desc' => $this->l('This text will appear at the bottom of the invoice'),
'size' => 6, 'size' => 6,
'type' => 'textareaLang', 'type' => 'textareaLang',
@@ -71,7 +71,7 @@ class AdminInvoicesControllerCore extends AdminController
'list' => $this->getInvoicesModels() 'list' => $this->getInvoicesModels()
), ),
'PS_PDF_USE_CACHE' => array( 'PS_PDF_USE_CACHE' => array(
'title' => $this->l('Use disk as cache for PDF invoices'), 'title' => $this->l('Use disk as cache for PDF invoices:'),
'desc' => $this->l('Saves memory but slows down the rendering process.'), 'desc' => $this->l('Saves memory but slows down the rendering process.'),
'validation' => 'isBool', 'validation' => 'isBool',
'cast' => 'intval', 'cast' => 'intval',
@@ -215,10 +215,10 @@ class AdminInvoicesControllerCore extends AdminController
if (Tools::getValue('submitAddinvoice_date')) if (Tools::getValue('submitAddinvoice_date'))
{ {
if (!Validate::isDate(Tools::getValue('date_from'))) if (!Validate::isDate(Tools::getValue('date_from')))
$this->errors[] = $this->l('Invalid "From:" date'); $this->errors[] = $this->l('Invalid "From" date');
if (!Validate::isDate(Tools::getValue('date_to'))) if (!Validate::isDate(Tools::getValue('date_to')))
$this->errors[] = $this->l('Invalid "To:" date'); $this->errors[] = $this->l('Invalid "To" date');
if (!count($this->errors)) if (!count($this->errors))
{ {
@@ -283,7 +283,7 @@ class AdminLanguagesControllerCore extends AdminController
if (!$this->checkDeletion($object)) if (!$this->checkDeletion($object))
return false; return false;
if (!$this->deleteNoPictureImages((int)$object->id)) if (!$this->deleteNoPictureImages((int)$object->id))
$this->errors[] = Tools::displayError('An error occurred while deleting object.').' <b>'.$this->table.'</b> '; $this->errors[] = Tools::displayError('An error occurred while deleting the object.').' <b>'.$this->table.'</b> ';
return parent::processDelete(); return parent::processDelete();
} }
@@ -300,7 +300,7 @@ class AdminLanguagesControllerCore extends AdminController
return false; return false;
if (!$this->deleteNoPictureImages((int)$object->id)) if (!$this->deleteNoPictureImages((int)$object->id))
{ {
$this->errors[] = Tools::displayError('An error occurred while deleting object.').' <b>'.$this->table.'</b> '; $this->errors[] = Tools::displayError('An error occurred while deleting the object.').' <b>'.$this->table.'</b> ';
return false; return false;
} }
} }
@@ -315,7 +315,7 @@ class AdminLanguagesControllerCore extends AdminController
if ($object->id == Configuration::get('PS_LANG_DEFAULT')) if ($object->id == Configuration::get('PS_LANG_DEFAULT'))
$this->errors[] = $this->l('You cannot delete the default language.'); $this->errors[] = $this->l('You cannot delete the default language.');
elseif ($object->id == $this->context->language->id) elseif ($object->id == $this->context->language->id)
$this->errors[] = $this->l('You cannot delete the language currently in use. Please change languages before deleting.'); $this->errors[] = $this->l('You cannot delete the language currently in use. Please select a different language.');
else else
return true; return true;
} }
@@ -328,7 +328,7 @@ class AdminLanguagesControllerCore extends AdminController
protected function checkDisableStatus($object) protected function checkDisableStatus($object)
{ {
if (!Validate::isLoadedObject($object)) if (!Validate::isLoadedObject($object))
$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)');
else else
{ {
if ($object->id == (int)Configuration::get('PS_LANG_DEFAULT')) if ($object->id == (int)Configuration::get('PS_LANG_DEFAULT'))
@@ -416,11 +416,11 @@ class AdminLanguagesControllerCore extends AdminController
if (!($tmp_name = tempnam(_PS_TMP_IMG_DIR_, 'PS')) || !move_uploaded_file($_FILES['no-picture']['tmp_name'], $tmp_name)) if (!($tmp_name = tempnam(_PS_TMP_IMG_DIR_, 'PS')) || !move_uploaded_file($_FILES['no-picture']['tmp_name'], $tmp_name))
return false; return false;
if (!ImageManager::resize($tmp_name, _PS_IMG_DIR_.'p/'.$language.'.jpg')) if (!ImageManager::resize($tmp_name, _PS_IMG_DIR_.'p/'.$language.'.jpg'))
$this->errors[] = Tools::displayError('An error occurred while copying no-picture image to your product folder.'); $this->errors[] = Tools::displayError('An error occurred while copying "No Picture" image to your product folder.');
if (!ImageManager::resize($tmp_name, _PS_IMG_DIR_.'c/'.$language.'.jpg')) if (!ImageManager::resize($tmp_name, _PS_IMG_DIR_.'c/'.$language.'.jpg'))
$this->errors[] = Tools::displayError('An error occurred while copying "No picture" image to your category folder.'); $this->errors[] = Tools::displayError('An error occurred while copying "No picture" image to your category folder.');
if (!ImageManager::resize($tmp_name, _PS_IMG_DIR_.'m/'.$language.'.jpg')) if (!ImageManager::resize($tmp_name, _PS_IMG_DIR_.'m/'.$language.'.jpg'))
$this->errors[] = Tools::displayError('An error occurred while copying "No picture" image to your manufacturer folder'); $this->errors[] = Tools::displayError('An error occurred while copying "No picture" image to your manufacturer folder.');
else else
{ {
$images_types = ImageType::getImagesTypes('products'); $images_types = ImageType::getImagesTypes('products');
@@ -454,11 +454,11 @@ class AdminLanguagesControllerCore extends AdminController
foreach ($images_types as $k => $image_type) foreach ($images_types as $k => $image_type)
if (file_exists($dir.$language.'-default-'.stripslashes($image_type['name']).'.jpg')) if (file_exists($dir.$language.'-default-'.stripslashes($image_type['name']).'.jpg'))
if (!unlink($dir.$language.'-default-'.stripslashes($image_type['name']).'.jpg')) if (!unlink($dir.$language.'-default-'.stripslashes($image_type['name']).'.jpg'))
$this->errors[] = Tools::displayError('An error occurred during image deletion.'); $this->errors[] = Tools::displayError('An error occurred during image deletion process.');
if (file_exists($dir.$language.'.jpg')) if (file_exists($dir.$language.'.jpg'))
if (!unlink($dir.$language.'.jpg')) if (!unlink($dir.$language.'.jpg'))
$this->errors[] = Tools::displayError('An error occurred during image deletion.'); $this->errors[] = Tools::displayError('An error occurred during image deletion process.');
} }
return !count($this->errors) ? true : false; return !count($this->errors) ? true : false;
@@ -130,7 +130,7 @@ class AdminLocalizationControllerCore extends AdminController
if (function_exists('date_default_timezone_set')) if (function_exists('date_default_timezone_set'))
$this->fields_options['general']['fields']['PS_TIMEZONE'] = array( $this->fields_options['general']['fields']['PS_TIMEZONE'] = array(
'title' => $this->l('Time Zone.'), 'title' => $this->l('Time zone:'),
'validation' => 'isAnything', 'validation' => 'isAnything',
'type' => 'select', 'type' => 'select',
'list' => Db::getInstance(_PS_USE_SQL_SLAVE_)->executeS('SELECT name FROM '._DB_PREFIX_.'timezone'), 'list' => Db::getInstance(_PS_USE_SQL_SLAVE_)->executeS('SELECT name FROM '._DB_PREFIX_.'timezone'),
@@ -152,7 +152,7 @@ class AdminLocalizationControllerCore extends AdminController
$pack = @Tools::file_get_contents('http://api.prestashop.com/localization/'.$version.'/'.Tools::getValue('iso_localization_pack').'.xml'); $pack = @Tools::file_get_contents('http://api.prestashop.com/localization/'.$version.'/'.Tools::getValue('iso_localization_pack').'.xml');
if (!$pack && !($pack = @Tools::file_get_contents(dirname(__FILE__).'/../../localization/'.Tools::getValue('iso_localization_pack').'.xml'))) if (!$pack && !($pack = @Tools::file_get_contents(dirname(__FILE__).'/../../localization/'.Tools::getValue('iso_localization_pack').'.xml')))
$this->errors[] = Tools::displayError('Cannot load localization pack (from prestashop.com and from your local folder "localization")'); $this->errors[] = Tools::displayError('Cannot load the localization pack.');
if (!$selection = Tools::getValue('selection')) if (!$selection = Tools::getValue('selection'))
$this->errors[] = Tools::displayError('Please select at least one item to import.'); $this->errors[] = Tools::displayError('Please select at least one item to import.');
@@ -221,12 +221,12 @@ class AdminLocalizationControllerCore extends AdminController
array( array(
'id' => 'taxes', 'id' => 'taxes',
'val' => 'taxes', 'val' => 'taxes',
'name' => $this->l('Taxes:') 'name' => $this->l('Taxes')
), ),
array( array(
'id' => 'currencies', 'id' => 'currencies',
'val' => 'currencies', 'val' => 'currencies',
'name' => $this->l('Currencies:') 'name' => $this->l('Currencies')
), ),
array( array(
'id' => 'languages', 'id' => 'languages',
+13 -13
View File
@@ -59,10 +59,10 @@ class AdminLoginControllerCore extends AdminController
$clientIsMaintenanceOrLocal = in_array(Tools::getRemoteAddr(), array_merge(array('127.0.0.1'), explode(',', Configuration::get('PS_MAINTENANCE_IP')))); $clientIsMaintenanceOrLocal = in_array(Tools::getRemoteAddr(), array_merge(array('127.0.0.1'), explode(',', Configuration::get('PS_MAINTENANCE_IP'))));
// If ssl is enabled, https protocol is required. Exception for maintenance and local (127.0.0.1) IP // If ssl is enabled, https protocol is required. Exception for maintenance and local (127.0.0.1) IP
if ($clientIsMaintenanceOrLocal) if ($clientIsMaintenanceOrLocal)
$this->errors[] = Tools::displayError('SSL is activated. However, your IP is allowed to use unsecure mode (Maintenance or local IP).'); $this->errors[] = Tools::displayError('SSL is activated. However, your IP is allowed to enter unsecure mode for maintenance or local IP issues.');
else else
{ {
$warningSslMessage = Tools::displayError('SSL is activated. Please connect using the following url to log in in secure mode (https).'); $warningSslMessage = Tools::displayError('SSL is activated. Please connect using the following URL to log into secure mode (https://).');
$warningSslMessage .= '<a href="https://'.Tools::safeOutput(Tools::getServerName()).Tools::safeOutput($_SERVER['REQUEST_URI']).'">https://'.Tools::safeOutput(Tools::getServerName()).Tools::safeOutput($_SERVER['REQUEST_URI']).'</a>'; $warningSslMessage .= '<a href="https://'.Tools::safeOutput(Tools::getServerName()).Tools::safeOutput($_SERVER['REQUEST_URI']).'">https://'.Tools::safeOutput(Tools::getServerName()).Tools::safeOutput($_SERVER['REQUEST_URI']).'</a>';
$this->context->smarty->assign(array('warningSslMessage' => $warningSslMessage)); $this->context->smarty->assign(array('warningSslMessage' => $warningSslMessage));
} }
@@ -134,14 +134,14 @@ class AdminLoginControllerCore extends AdminController
$passwd = trim(Tools::getValue('passwd')); $passwd = trim(Tools::getValue('passwd'));
$email = trim(Tools::getValue('email')); $email = trim(Tools::getValue('email'));
if (empty($email)) if (empty($email))
$this->errors[] = Tools::displayError('E-mail is empty'); $this->errors[] = Tools::displayError('Email is empty.');
elseif (!Validate::isEmail($email)) elseif (!Validate::isEmail($email))
$this->errors[] = Tools::displayError('Invalid e-mail address'); $this->errors[] = Tools::displayError('Invalid email address.');
if (empty($passwd)) if (empty($passwd))
$this->errors[] = Tools::displayError('Password is blank'); $this->errors[] = Tools::displayError('The password field is blank.');
elseif (!Validate::isPasswd($passwd)) elseif (!Validate::isPasswd($passwd))
$this->errors[] = Tools::displayError('Invalid password'); $this->errors[] = Tools::displayError('Invalid password.');
if (!count($this->errors)) if (!count($this->errors))
{ {
@@ -151,12 +151,12 @@ class AdminLoginControllerCore extends AdminController
$employee_associated_shop = $this->context->employee->getAssociatedShops(); $employee_associated_shop = $this->context->employee->getAssociatedShops();
if (!$is_employee_loaded) if (!$is_employee_loaded)
{ {
$this->errors[] = Tools::displayError('Employee does not exist or password is incorrect.'); $this->errors[] = Tools::displayError('The Employee does not exist, or the password provided is incorrect.');
$this->context->employee->logout(); $this->context->employee->logout();
} }
elseif (empty($employee_associated_shop) && !$this->context->employee->isSuperAdmin()) elseif (empty($employee_associated_shop) && !$this->context->employee->isSuperAdmin())
{ {
$this->errors[] = Tools::displayError('Employee does not manage any shop anymore (shop has been deleted or permissions have been removed).'); $this->errors[] = Tools::displayError('This employee does not manage the shop anymore (Either the shop has been deleted or permissions have been revoked).');
$this->context->employee->logout(); $this->context->employee->logout();
} }
else else
@@ -195,14 +195,14 @@ class AdminLoginControllerCore extends AdminController
if (_PS_MODE_DEMO_) if (_PS_MODE_DEMO_)
$this->errors[] = Tools::displayError('This functionality has been disabled.'); $this->errors[] = Tools::displayError('This functionality has been disabled.');
elseif (!($email = trim(Tools::getValue('email_forgot')))) elseif (!($email = trim(Tools::getValue('email_forgot'))))
$this->errors[] = Tools::displayError('E-mail is empty'); $this->errors[] = Tools::displayError('Email is empty.');
elseif (!Validate::isEmail($email)) elseif (!Validate::isEmail($email))
$this->errors[] = Tools::displayError('Invalid e-mail address'); $this->errors[] = Tools::displayError('Invalid email address.');
else else
{ {
$employee = new Employee(); $employee = new Employee();
if (!$employee->getByEmail($email) || !$employee) if (!$employee->getByEmail($email) || !$employee)
$this->errors[] = Tools::displayError('This account does not exist'); $this->errors[] = Tools::displayError('This account does not exist.');
elseif ((strtotime($employee->last_passwd_gen.'+'.Configuration::get('PS_PASSWD_TIME_BACK').' minutes') - time()) > 0) elseif ((strtotime($employee->last_passwd_gen.'+'.Configuration::get('PS_PASSWD_TIME_BACK').' minutes') - time()) > 0)
$this->errors[] = sprintf( $this->errors[] = sprintf(
Tools::displayError('You can regenerate your password only every %d minute(s)'), Tools::displayError('You can regenerate your password only every %d minute(s)'),
@@ -228,7 +228,7 @@ class AdminLoginControllerCore extends AdminController
// Update employee only if the mail can be sent // Update employee only if the mail can be sent
$result = $employee->update(); $result = $employee->update();
if (!$result) if (!$result)
$this->errors[] = Tools::displayError('An error occurred during your password change.'); $this->errors[] = Tools::displayError('An error occurred while attempting to change your password.');
else else
die(Tools::jsonEncode(array( die(Tools::jsonEncode(array(
'hasErrors' => false, 'hasErrors' => false,
@@ -238,7 +238,7 @@ class AdminLoginControllerCore extends AdminController
else else
die(Tools::jsonEncode(array( die(Tools::jsonEncode(array(
'hasErrors' => true, 'hasErrors' => true,
'errors' => array(Tools::displayError('An error occurred during your password change.')) 'errors' => array(Tools::displayError('An error occurred while attempting to change your password.'))
))); )));
} }
@@ -47,7 +47,7 @@ class AdminMaintenanceControllerCore extends AdminController
), ),
'PS_MAINTENANCE_IP' => array( 'PS_MAINTENANCE_IP' => array(
'title' => $this->l('Maintenance IP'), 'title' => $this->l('Maintenance IP'),
'desc' => $this->l('IP addresses allowed to access the Front Office even if the shop is disabled. Use a comma to separate them (e.g. 42.24.4.2,127.0.0.1,99.98.97.96)'), 'desc' => $this->l('IP addresses allowed to access the Front Office even if the shop is disabled. Please use a comma to separate them (e.g. 42.24.4.2,127.0.0.1,99.98.97.96)'),
'validation' => 'isGenericName', 'validation' => 'isGenericName',
'type' => 'maintenance_ip', 'type' => 'maintenance_ip',
'size' => 30, 'size' => 30,
@@ -702,7 +702,7 @@ class AdminManufacturersControllerCore extends AdminController
} }
if (!$res) if (!$res)
$this->errors[] = Tools::displayError('Unable to resize one or more pictures'); $this->errors[] = Tools::displayError('Unable to resize one or more of your pictures.');
return $res; return $res;
} }
+6 -6
View File
@@ -72,7 +72,7 @@ class AdminMetaControllerCore extends AdminController
'type' => 'bool' 'type' => 'bool'
), ),
'PS_CANONICAL_REDIRECT' => array( 'PS_CANONICAL_REDIRECT' => array(
'title' => $this->l('Automatically redirect to the canonical URL.'), 'title' => $this->l('Automatically redirect to the canonical URL'),
'desc' => $this->l('Recommended, but your theme must be compliant.'), 'desc' => $this->l('Recommended, but your theme must be compliant.'),
'validation' => 'isBool', 'validation' => 'isBool',
'cast' => 'intval', 'cast' => 'intval',
@@ -249,7 +249,7 @@ class AdminMetaControllerCore extends AdminController
$this->fields_form = array( $this->fields_form = array(
'legend' => array( 'legend' => array(
'title' => $this->l('Meta-Tags'), 'title' => $this->l('Meta tags'),
'image' => '../img/admin/metatags.gif' 'image' => '../img/admin/metatags.gif'
), ),
'input' => array( 'input' => array(
@@ -310,7 +310,7 @@ class AdminMetaControllerCore extends AdminController
'name' => 'url_rewrite', 'name' => 'url_rewrite',
'lang' => true, 'lang' => true,
'required' => true, 'required' => true,
'hint' => $this->l('Only letters and the minus (-) character are allowed'), 'hint' => $this->l('Only letters and hyphens are allowed'),
'desc' => $this->l('e.g. "contacts" for http://mysite.com/shop/contacts to redirect to http://mysite.com/shop/contact-form.php'), 'desc' => $this->l('e.g. "contacts" for http://mysite.com/shop/contacts to redirect to http://mysite.com/shop/contact-form.php'),
'size' => 50 'size' => 50
), ),
@@ -343,7 +343,7 @@ class AdminMetaControllerCore extends AdminController
if (!$defaultLangIsValidated && !$englishLangIsValidated) if (!$defaultLangIsValidated && !$englishLangIsValidated)
{ {
$this->errors[] = Tools::displayError('URL rewrite field must be filled at least in default or English language.'); $this->errors[] = Tools::displayError('The URL rewrite field must be filled in either the default or English language.');
return false; return false;
} }
@@ -531,7 +531,7 @@ class AdminMetaControllerCore extends AdminController
$this->url->update(); $this->url->update();
} }
else else
$this->errors[] = Tools::displayError('Domain is not valid'); $this->errors[] = Tools::displayError('This domain is not valid.');
} }
} }
@@ -548,7 +548,7 @@ class AdminMetaControllerCore extends AdminController
$this->url->update(); $this->url->update();
} }
else else
$this->errors[] = Tools::displayError('SSL Domain is not valid'); $this->errors[] = Tools::displayError('The SSL domain is not valid.');
} }
} }
+20 -20
View File
@@ -79,7 +79,7 @@ class AdminModulesControllerCore extends AdminController
$this->list_modules_categories['checkout']['name'] = $this->l('Checkout'); $this->list_modules_categories['checkout']['name'] = $this->l('Checkout');
$this->list_modules_categories['content_management']['name'] = $this->l('Content Management'); $this->list_modules_categories['content_management']['name'] = $this->l('Content Management');
$this->list_modules_categories['export']['name'] = $this->l('Export'); $this->list_modules_categories['export']['name'] = $this->l('Export');
$this->list_modules_categories['emailing']['name'] = $this->l('E-mailing'); $this->list_modules_categories['emailing']['name'] = $this->l('Emailing');
$this->list_modules_categories['front_office_features']['name'] = $this->l('Front Office Features'); $this->list_modules_categories['front_office_features']['name'] = $this->l('Front Office Features');
$this->list_modules_categories['i18n_localization']['name'] = $this->l('Internationalization and Localization'); $this->list_modules_categories['i18n_localization']['name'] = $this->l('Internationalization and Localization');
$this->list_modules_categories['merchandizing']['name'] = $this->l('Merchandizing'); $this->list_modules_categories['merchandizing']['name'] = $this->l('Merchandizing');
@@ -363,13 +363,13 @@ class AdminModulesControllerCore extends AdminController
} }
} }
if (!$success) if (!$success)
$this->errors[] = Tools::displayError('Error while extracting module (file may be corrupted).'); $this->errors[] = Tools::displayError('There was an error while extracting the module (file may be corrupted).');
//check if it's a real module //check if it's a real module
foreach($zip_folders as $folder) foreach($zip_folders as $folder)
if (!in_array($folder, array('.', '..', '.svn', '.git', '__MACOSX')) && !Module::getInstanceByName($folder)) if (!in_array($folder, array('.', '..', '.svn', '.git', '__MACOSX')) && !Module::getInstanceByName($folder))
{ {
$this->errors[] = Tools::displayError('The module '.$folder.' you uploaded is not a module'); $this->errors[] = Tools::displayError('The \'.$folder.\' you uploaded is not a module');
$this->recursiveDeleteOnDisk(_PS_MODULE_DIR_.$folder); $this->recursiveDeleteOnDisk(_PS_MODULE_DIR_.$folder);
} }
@@ -465,24 +465,24 @@ class AdminModulesControllerCore extends AdminController
if (Validate::isLoadedObject($module)) if (Validate::isLoadedObject($module))
{ {
if (!$module->getPermission('configure')) if (!$module->getPermission('configure'))
$this->errors[] = Tools::displayError('You do not have the permission to use this module'); $this->errors[] = Tools::displayError('You do not have the permission to use this module.');
else else
{ {
if ($module->uninstall()) if ($module->uninstall())
if ($module->install()) if ($module->install())
Tools::redirectAdmin(self::$currentIndex.'&conf=21'.'&token='.$this->token.'&tab_module='.$module->tab.'&module_name='.$module->name.'&anchor=anchor'.ucfirst($module->name)); Tools::redirectAdmin(self::$currentIndex.'&conf=21'.'&token='.$this->token.'&tab_module='.$module->tab.'&module_name='.$module->name.'&anchor=anchor'.ucfirst($module->name));
else else
$this->errors[] = Tools::displayError('Cannot install module'); $this->errors[] = Tools::displayError('Cannot install this module.');
else else
$this->errors[] = Tools::displayError('Cannot uninstall module'); $this->errors[] = Tools::displayError('Cannot uninstall this module.');
} }
} }
else else
$this->errors[] = Tools::displayError('Cannot load module object'); $this->errors[] = Tools::displayError('Cannot load the module\'s object.');
$this->errors = array_merge($this->errors, $module->getErrors()); $this->errors = array_merge($this->errors, $module->getErrors());
} }
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.');
} }
public function postProcessDownload() public function postProcessDownload()
@@ -508,14 +508,14 @@ class AdminModulesControllerCore extends AdminController
$this->errors[] = $this->l('No file has been selected'); $this->errors[] = $this->l('No file has been selected');
elseif (substr($_FILES['file']['name'], -4) != '.tar' && substr($_FILES['file']['name'], -4) != '.zip' elseif (substr($_FILES['file']['name'], -4) != '.tar' && substr($_FILES['file']['name'], -4) != '.zip'
&& substr($_FILES['file']['name'], -4) != '.tgz' && substr($_FILES['file']['name'], -7) != '.tar.gz') && substr($_FILES['file']['name'], -4) != '.tgz' && substr($_FILES['file']['name'], -7) != '.tar.gz')
$this->errors[] = Tools::displayError('Unknown archive type'); $this->errors[] = Tools::displayError('Unknown archive type.');
elseif (!@copy($_FILES['file']['tmp_name'], _PS_MODULE_DIR_.$_FILES['file']['name'])) elseif (!@copy($_FILES['file']['tmp_name'], _PS_MODULE_DIR_.$_FILES['file']['name']))
$this->errors[] = Tools::displayError('An error occurred while copying archive to module directory.'); $this->errors[] = Tools::displayError('An error occurred while copying archive to the module directory.');
else else
$this->extractArchive(_PS_MODULE_DIR_.$_FILES['file']['name']); $this->extractArchive(_PS_MODULE_DIR_.$_FILES['file']['name']);
} }
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.');
} }
public function postProcessEnable() public function postProcessEnable()
@@ -526,7 +526,7 @@ class AdminModulesControllerCore extends AdminController
if (Validate::isLoadedObject($module)) if (Validate::isLoadedObject($module))
{ {
if (!$module->getPermission('configure')) if (!$module->getPermission('configure'))
$this->errors[] = Tools::displayError('You do not have the permission to use this module'); $this->errors[] = Tools::displayError('You do not have the permission to use this module.');
else else
{ {
if (Tools::getValue('enable')) if (Tools::getValue('enable'))
@@ -537,10 +537,10 @@ class AdminModulesControllerCore extends AdminController
} }
} }
else else
$this->errors[] = Tools::displayError('Cannot load module object'); $this->errors[] = Tools::displayError('Cannot load the module\'s object.');
} }
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.');
} }
public function postProcessDelete() public function postProcessDelete()
@@ -551,7 +551,7 @@ class AdminModulesControllerCore extends AdminController
{ {
$module = Module::getInstanceByName(Tools::getValue('module_name')); $module = Module::getInstanceByName(Tools::getValue('module_name'));
if (Validate::isLoadedObject($module) && !$module->getPermission('configure')) if (Validate::isLoadedObject($module) && !$module->getPermission('configure'))
$this->errors[] = Tools::displayError('You do not have the permission to use this module'); $this->errors[] = Tools::displayError('You do not have the permission to use this module.');
else else
{ {
// Uninstall the module before deleting the files, but do not block the process if uninstall returns false // Uninstall the module before deleting the files, but do not block the process if uninstall returns false
@@ -563,7 +563,7 @@ class AdminModulesControllerCore 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.');
} }
public function postProcessCallback() public function postProcessCallback()
@@ -628,7 +628,7 @@ class AdminModulesControllerCore extends AdminController
if (!($module = Module::getInstanceByName(urldecode($name)))) if (!($module = Module::getInstanceByName(urldecode($name))))
$this->errors[] = $this->l('Module not found'); $this->errors[] = $this->l('Module not found');
elseif ($key == 'install' && $this->tabAccess['add'] !== '1') elseif ($key == 'install' && $this->tabAccess['add'] !== '1')
$this->errors[] = Tools::displayError('You do not have permission to install a module.'); $this->errors[] = Tools::displayError('You do not have permission to install this module.');
elseif ($key == 'uninstall' && ($this->tabAccess['delete'] !== '1' || !$module->getPermission('configure'))) elseif ($key == 'uninstall' && ($this->tabAccess['delete'] !== '1' || !$module->getPermission('configure')))
$this->errors[] = Tools::displayError('You do not have permission to delete this module.'); $this->errors[] = Tools::displayError('You do not have permission to delete this module.');
elseif ($key == 'configure' && ($this->tabAccess['edit'] !== '1' || !$module->getPermission('configure') || !Module::isInstalled(urldecode($name)))) elseif ($key == 'configure' && ($this->tabAccess['edit'] !== '1' || !$module->getPermission('configure') || !Module::isInstalled(urldecode($name))))
@@ -636,9 +636,9 @@ class AdminModulesControllerCore extends AdminController
elseif ($key == 'install' && Module::isInstalled($module->name)) elseif ($key == 'install' && Module::isInstalled($module->name))
$this->errors[] = Tools::displayError('This module is already installed:').' '.$module->name; $this->errors[] = Tools::displayError('This module is already installed:').' '.$module->name;
elseif ($key == 'uninstall' && !Module::isInstalled($module->name)) elseif ($key == 'uninstall' && !Module::isInstalled($module->name))
$this->errors[] = Tools::displayError('This module is already uninstalled:').' '.$module->name; $this->errors[] = Tools::displayError('This module has already been uninstalled:').' '.$module->name;
else if ($key == 'update' && !Module::isInstalled($module->name)) else if ($key == 'update' && !Module::isInstalled($module->name))
$this->errors[] = Tools::displayError('This module need to be installed to be updated:').' '.$module->name; $this->errors[] = Tools::displayError('This module need to be installed in order to be updated:').' '.$module->name;
else else
{ {
// If we install a module, force temporary global context for multishop // If we install a module, force temporary global context for multishop
@@ -677,7 +677,7 @@ class AdminModulesControllerCore extends AdminController
<th>'.$this->l('Module').' <span style="color: green;">'.$module->name.'</span></th> <th>'.$this->l('Module').' <span style="color: green;">'.$module->name.'</span></th>
<th><a href="'.$backlink.'" style="padding:5px 10px">'.$this->l('Back').'</a></th> <th><a href="'.$backlink.'" style="padding:5px 10px">'.$this->l('Back').'</a></th>
<th><a href="'.$hooklink.'" style="padding:5px 10px">'.$this->l('Manage hooks').'</a></th> <th><a href="'.$hooklink.'" style="padding:5px 10px">'.$this->l('Manage hooks').'</a></th>
<th style="padding:5px 10px">'.$this->l('Manage translations:').' '; <th style="padding:5px 10px">'.$this->l('Manage translations').' ';
foreach (Language::getLanguages(false) as $language) foreach (Language::getLanguages(false) as $language)
$toolbar .= '<a href="'.$tradlink.$language['iso_code'].'#'.$module->name.'" style="margin-left:5px"><img src="'._THEME_LANG_DIR_.$language['id_lang'].'.jpg" alt="'.$language['iso_code'].'" title="'.$language['iso_code'].'" /></a>'; $toolbar .= '<a href="'.$tradlink.$language['iso_code'].'#'.$module->name.'" style="margin-left:5px"><img src="'._THEME_LANG_DIR_.$language['id_lang'].'.jpg" alt="'.$language['iso_code'].'" title="'.$language['iso_code'].'" /></a>';
$toolbar .= '</th></tr>'; $toolbar .= '</th></tr>';
@@ -48,10 +48,10 @@ class AdminModulesPositionsControllerCore extends AdminController
Tools::redirectAdmin(self::$currentIndex.($this->display_key ? '&show_modules='.$this->display_key : '').'&token='.$this->token); Tools::redirectAdmin(self::$currentIndex.($this->display_key ? '&show_modules='.$this->display_key : '').'&token='.$this->token);
} }
else else
$this->errors[] = Tools::displayError('module cannot be loaded'); $this->errors[] = Tools::displayError('This module cannot be loaded');
} }
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.');
} }
// Add new module in hook // Add new module in hook
@@ -66,18 +66,18 @@ class AdminModulesPositionsControllerCore extends AdminController
$hook = new Hook($id_hook); $hook = new Hook($id_hook);
if (!$id_module || !Validate::isLoadedObject($module)) if (!$id_module || !Validate::isLoadedObject($module))
$this->errors[] = Tools::displayError('module cannot be loaded'); $this->errors[] = Tools::displayError('This module cannot be loaded');
elseif (!$id_hook || !Validate::isLoadedObject($hook)) elseif (!$id_hook || !Validate::isLoadedObject($hook))
$this->errors[] = Tools::displayError('Hook cannot be loaded.'); $this->errors[] = Tools::displayError('Hook cannot be loaded.');
elseif (Hook::getModulesFromHook($id_hook, $id_module)) elseif (Hook::getModulesFromHook($id_hook, $id_module))
$this->errors[] = Tools::displayError('This module is already transplanted to this hook'); $this->errors[] = Tools::displayError('This module has already been transplanted to this hook');
elseif (!$module->isHookableOn($hook->name)) elseif (!$module->isHookableOn($hook->name))
$this->errors[] = Tools::displayError('This module cannot be transplanted to this hook.'); $this->errors[] = Tools::displayError('This module cannot be transplanted to this hook.');
// Adding vars... // Adding vars...
else else
{ {
if (!$module->registerHook($hook->name, Shop::getContextListShopID())) if (!$module->registerHook($hook->name, Shop::getContextListShopID()))
$this->errors[] = Tools::displayError('An error occurred while transplanting module to hook.'); $this->errors[] = Tools::displayError('An error occurred while transplanting the module to its hook.');
else else
{ {
$exceptions = Tools::getValue('exceptions'); $exceptions = Tools::getValue('exceptions');
@@ -89,17 +89,17 @@ class AdminModulesPositionsControllerCore extends AdminController
if (empty($except)) if (empty($except))
unset($exceptions[$key]); unset($exceptions[$key]);
else if (!Validate::isFileName($except)) else if (!Validate::isFileName($except))
$this->errors[] = Tools::displayError('No valid value for field exceptions'); $this->errors[] = Tools::displayError('No valid value for field exceptions has been defined.');
} }
if (!$this->errors && !$module->registerExceptions($id_hook, $exceptions, Shop::getContextListShopID())) if (!$this->errors && !$module->registerExceptions($id_hook, $exceptions, Shop::getContextListShopID()))
$this->errors[] = Tools::displayError('An error occurred while transplanting module to hook.'); $this->errors[] = Tools::displayError('An error occurred while transplanting the module to its hook.');
} }
if (!$this->errors) if (!$this->errors)
Tools::redirectAdmin(self::$currentIndex.'&conf=16'.($this->display_key ? '&show_modules='.$this->display_key : '').'&token='.$this->token); Tools::redirectAdmin(self::$currentIndex.'&conf=16'.($this->display_key ? '&show_modules='.$this->display_key : '').'&token='.$this->token);
} }
} }
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.');
} }
// Edit module from hook // Edit module from hook
@@ -114,7 +114,7 @@ class AdminModulesPositionsControllerCore extends AdminController
$hook = new Hook($id_hook); $hook = new Hook($id_hook);
if (!$id_module || !Validate::isLoadedObject($module)) if (!$id_module || !Validate::isLoadedObject($module))
$this->errors[] = Tools::displayError('module cannot be loaded'); $this->errors[] = Tools::displayError('This module cannot be loaded');
elseif (!$id_hook || !Validate::isLoadedObject($hook)) elseif (!$id_hook || !Validate::isLoadedObject($hook))
$this->errors[] = Tools::displayError('Hook cannot be loaded.'); $this->errors[] = Tools::displayError('Hook cannot be loaded.');
else else
@@ -129,14 +129,14 @@ class AdminModulesPositionsControllerCore extends AdminController
// Check files name // Check files name
foreach ($exception as $except) foreach ($exception as $except)
if (!Validate::isFileName($except)) if (!Validate::isFileName($except))
$this->errors[] = Tools::displayError('No valid value for field exceptions'); $this->errors[] = Tools::displayError('No valid value for field exceptions has been defined.');
$exceptions[$id] = $exception; $exceptions[$id] = $exception;
} }
// Add files exceptions // Add files exceptions
if (!$module->editExceptions($id_hook, $exceptions)) if (!$module->editExceptions($id_hook, $exceptions))
$this->errors[] = Tools::displayError('An error occurred while transplanting module to hook.'); $this->errors[] = Tools::displayError('An error occurred while transplanting the module to its hook.');
if (!$this->errors) if (!$this->errors)
Tools::redirectAdmin(self::$currentIndex.'&conf=16'.($this->display_key ? '&show_modules='.$this->display_key : '').'&token='.$this->token); Tools::redirectAdmin(self::$currentIndex.'&conf=16'.($this->display_key ? '&show_modules='.$this->display_key : '').'&token='.$this->token);
@@ -148,18 +148,18 @@ class AdminModulesPositionsControllerCore extends AdminController
// Check files name // Check files name
foreach ($exceptions as $except) foreach ($exceptions as $except)
if (!Validate::isFileName($except)) if (!Validate::isFileName($except))
$this->errors[] = Tools::displayError('No valid value for field exceptions'); $this->errors[] = Tools::displayError('No valid value for field exceptions has been defined.');
// Add files exceptions // Add files exceptions
if (!$module->editExceptions($id_hook, $exceptions, Shop::getContextListShopID())) if (!$module->editExceptions($id_hook, $exceptions, Shop::getContextListShopID()))
$this->errors[] = Tools::displayError('An error occurred while transplanting module to hook.'); $this->errors[] = Tools::displayError('An error occurred while transplanting the module to its hook.');
else else
Tools::redirectAdmin(self::$currentIndex.'&conf=16'.($this->display_key ? '&show_modules='.$this->display_key : '').'&token='.$this->token); Tools::redirectAdmin(self::$currentIndex.'&conf=16'.($this->display_key ? '&show_modules='.$this->display_key : '').'&token='.$this->token);
} }
} }
} }
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.');
} }
// Delete module from hook // Delete module from hook
@@ -172,25 +172,25 @@ class AdminModulesPositionsControllerCore extends AdminController
$id_hook = (int)Tools::getValue('id_hook'); $id_hook = (int)Tools::getValue('id_hook');
$hook = new Hook($id_hook); $hook = new Hook($id_hook);
if (!Validate::isLoadedObject($module)) if (!Validate::isLoadedObject($module))
$this->errors[] = Tools::displayError('module cannot be loaded'); $this->errors[] = Tools::displayError('This module cannot be loaded');
elseif (!$id_hook || !Validate::isLoadedObject($hook)) elseif (!$id_hook || !Validate::isLoadedObject($hook))
$this->errors[] = Tools::displayError('Hook cannot be loaded.'); $this->errors[] = Tools::displayError('Hook cannot be loaded.');
else else
{ {
if (!$module->unregisterHook($id_hook, Shop::getContextListShopID()) if (!$module->unregisterHook($id_hook, Shop::getContextListShopID())
|| !$module->unregisterExceptions($id_hook, Shop::getContextListShopID())) || !$module->unregisterExceptions($id_hook, Shop::getContextListShopID()))
$this->errors[] = Tools::displayError('An error occurred while deleting module from hook.'); $this->errors[] = Tools::displayError('An error occurred while deleting the module from its hook.');
else else
Tools::redirectAdmin(self::$currentIndex.'&conf=17'.($this->display_key ? '&show_modules='.$this->display_key : '').'&token='.$this->token); Tools::redirectAdmin(self::$currentIndex.'&conf=17'.($this->display_key ? '&show_modules='.$this->display_key : '').'&token='.$this->token);
} }
} }
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('unhookform')) elseif (Tools::isSubmit('unhookform'))
{ {
if (!($unhooks = Tools::getValue('unhooks')) || !is_array($unhooks)) if (!($unhooks = Tools::getValue('unhooks')) || !is_array($unhooks))
$this->errors[] = Tools::displayError('Select a module to unhook.'); $this->errors[] = Tools::displayError('Please select a module to unhook.');
else else
{ {
foreach ($unhooks as $unhook) foreach ($unhooks as $unhook)
@@ -201,13 +201,13 @@ class AdminModulesPositionsControllerCore extends AdminController
$module = Module::getInstanceById((int)$id_module); $module = Module::getInstanceById((int)$id_module);
$hook = new Hook((int)$id_hook); $hook = new Hook((int)$id_hook);
if (!Validate::isLoadedObject($module)) if (!Validate::isLoadedObject($module))
$this->errors[] = Tools::displayError('module cannot be loaded'); $this->errors[] = Tools::displayError('This module cannot be loaded');
elseif (!$id_hook || !Validate::isLoadedObject($hook)) elseif (!$id_hook || !Validate::isLoadedObject($hook))
$this->errors[] = Tools::displayError('Hook cannot be loaded.'); $this->errors[] = Tools::displayError('Hook cannot be loaded.');
else else
{ {
if (!$module->unregisterHook((int)$id_hook) || !$module->unregisterExceptions((int)$id_hook)) if (!$module->unregisterHook((int)$id_hook) || !$module->unregisterExceptions((int)$id_hook))
$this->errors[] = Tools::displayError('An error occurred while deleting module from hook.'); $this->errors[] = Tools::displayError('An error occurred while deleting the module from its hook.');
} }
} }
if (!count($this->errors)) if (!count($this->errors))
@@ -49,7 +49,7 @@ class AdminOrderPreferencesControllerCore extends AdminController
), ),
array( array(
'value' => PS_ORDER_PROCESS_OPC, 'value' => PS_ORDER_PROCESS_OPC,
'name' => $this->l('One page checkout') 'name' => $this->l('One-page checkout')
) )
); );
@@ -75,7 +75,7 @@ class AdminOrderPreferencesControllerCore extends AdminController
'type' => 'bool' 'type' => 'bool'
), ),
'PS_PURCHASE_MINIMUM' => array( 'PS_PURCHASE_MINIMUM' => array(
'title' => $this->l('Minimum purchase total required in order to validate the order.'), 'title' => $this->l('Minimum purchase total required in order to validate the order'),
'desc' => $this->l('Set to 0 to disable this feature'), 'desc' => $this->l('Set to 0 to disable this feature'),
'validation' => 'isFloat', 'validation' => 'isFloat',
'cast' => 'floatval', 'cast' => 'floatval',
@@ -83,7 +83,7 @@ class AdminOrderPreferencesControllerCore extends AdminController
), ),
'PS_ALLOW_MULTISHIPPING' => array( 'PS_ALLOW_MULTISHIPPING' => array(
'title' => $this->l('Allow multishipping'), 'title' => $this->l('Allow multishipping'),
'desc' => $this->l('Allow the customer to ship his order to multiple addresses. This option will convert the customer\'s cart into one or more orders.'), 'desc' => $this->l('Allow the customer to ship orders to multiple addresses. This option will convert the customer\'s cart into one or more orders.'),
'validation' => 'isBool', 'validation' => 'isBool',
'cast' => 'intval', 'cast' => 'intval',
'type' => 'bool' 'type' => 'bool'
@@ -107,7 +107,7 @@ class AdminOrderPreferencesControllerCore extends AdminController
) )
), ),
'PS_CONDITIONS_CMS_ID' => array( 'PS_CONDITIONS_CMS_ID' => array(
'title' => $this->l('Conditions of use for the CMS page.'), 'title' => $this->l('Conditions of use for the CMS page'),
'desc' => $this->l('Choose the conditions of use for the CMS page.'), 'desc' => $this->l('Choose the conditions of use for the CMS page.'),
'validation' => 'isInt', 'validation' => 'isInt',
'type' => 'select', 'type' => 'select',
+81 -81
View File
@@ -275,9 +275,9 @@ class AdminOrdersControllerCore extends AdminController
{ {
$order_carrier = new OrderCarrier(Tools::getValue('id_order_carrier')); $order_carrier = new OrderCarrier(Tools::getValue('id_order_carrier'));
if (!Validate::isLoadedObject($order_carrier)) if (!Validate::isLoadedObject($order_carrier))
$this->errors[] = Tools::displayError('Order carrier ID is invalid'); $this->errors[] = Tools::displayError('The order carrier ID is invalid.');
elseif (!Validate::isTrackingNumber(Tools::getValue('tracking_number'))) elseif (!Validate::isTrackingNumber(Tools::getValue('tracking_number')))
$this->errors[] = Tools::displayError('Tracking number is incorrect'); $this->errors[] = Tools::displayError('The tracking number is incorrect.');
else else
{ {
// update shipping number // update shipping number
@@ -312,14 +312,14 @@ class AdminOrdersControllerCore extends AdminController
Tools::redirectAdmin(self::$currentIndex.'&id_order='.$order->id.'&vieworder&conf=4&token='.$this->token); Tools::redirectAdmin(self::$currentIndex.'&id_order='.$order->id.'&vieworder&conf=4&token='.$this->token);
} }
else else
$this->errors[] = Tools::displayError('An error occurred while sending e-mail to the customer.'); $this->errors[] = Tools::displayError('An error occurred while sending an email to the customer.');
} }
else else
$this->errors[] = Tools::displayError('Order carrier can\'t be updated'); $this->errors[] = Tools::displayError('The order carrier cannot be updated.');
} }
} }
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.');
} }
/* Change order state, add a new entry in order history and send an e-mail to the customer if needed */ /* Change order state, add a new entry in order history and send an e-mail to the customer if needed */
@@ -330,7 +330,7 @@ class AdminOrdersControllerCore extends AdminController
$order_state = new OrderState(Tools::getValue('id_order_state')); $order_state = new OrderState(Tools::getValue('id_order_state'));
if (!Validate::isLoadedObject($order_state)) if (!Validate::isLoadedObject($order_state))
$this->errors[] = Tools::displayError('Invalid new order status'); $this->errors[] = Tools::displayError('The new order status is invalid.');
else else
{ {
$current_order_state = $order->getCurrentOrderState(); $current_order_state = $order->getCurrentOrderState();
@@ -365,14 +365,14 @@ class AdminOrdersControllerCore extends AdminController
Tools::redirectAdmin(self::$currentIndex.'&id_order='.(int)$order->id.'&vieworder&token='.$this->token); Tools::redirectAdmin(self::$currentIndex.'&id_order='.(int)$order->id.'&vieworder&token='.$this->token);
} }
$this->errors[] = Tools::displayError('An error occurred while changing the status or was unable to send e-mail to the customer.'); $this->errors[] = Tools::displayError('An error occurred while changing order status, or we were unable to send an email to the customer.');
} }
else else
$this->errors[] = Tools::displayError('This order is already assigned this status'); $this->errors[] = Tools::displayError('The order has already been assigned this 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.');
} }
/* Add a new message for the current order and send an e-mail to the customer if needed */ /* Add a new message for the current order and send an e-mail to the customer if needed */
@@ -382,9 +382,9 @@ class AdminOrdersControllerCore extends AdminController
{ {
$customer = new Customer(Tools::getValue('id_customer')); $customer = new Customer(Tools::getValue('id_customer'));
if (!Validate::isLoadedObject($customer)) if (!Validate::isLoadedObject($customer))
$this->errors[] = Tools::displayError('Customer is invalid'); $this->errors[] = Tools::displayError('The customer is invalid.');
elseif (!Tools::getValue('message')) elseif (!Tools::getValue('message'))
$this->errors[] = Tools::displayError('Message cannot be blank'); $this->errors[] = Tools::displayError('The message cannot be blank.');
else else
{ {
/* Get message rules and and check fields validity */ /* Get message rules and and check fields validity */
@@ -428,7 +428,7 @@ class AdminOrdersControllerCore extends AdminController
$customer_message->private = Tools::getValue('visibility'); $customer_message->private = Tools::getValue('visibility');
if (!$customer_message->add()) if (!$customer_message->add())
$this->errors[] = Tools::displayError('An error occurred while saving message'); $this->errors[] = Tools::displayError('An error occurred while saving the message.');
elseif ($customer_message->private) elseif ($customer_message->private)
Tools::redirectAdmin(self::$currentIndex.'&id_order='.(int)$order->id.'&vieworder&conf=11&token='.$this->token); Tools::redirectAdmin(self::$currentIndex.'&id_order='.(int)$order->id.'&vieworder&conf=11&token='.$this->token);
else else
@@ -449,12 +449,12 @@ class AdminOrdersControllerCore extends AdminController
$customer->firstname.' '.$customer->lastname, null, null, null, null, _PS_MAIL_DIR_, true, (int)$order->id_shop)) $customer->firstname.' '.$customer->lastname, null, null, null, null, _PS_MAIL_DIR_, true, (int)$order->id_shop))
Tools::redirectAdmin(self::$currentIndex.'&id_order='.$order->id.'&vieworder&conf=11'.'&token='.$this->token); Tools::redirectAdmin(self::$currentIndex.'&id_order='.$order->id.'&vieworder&conf=11'.'&token='.$this->token);
} }
$this->errors[] = Tools::displayError('An error occurred while sending e-mail to the customer.'); $this->errors[] = Tools::displayError('An error occurred while sending an email to the customer.');
} }
} }
} }
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.');
} }
/* Partial refund from order */ /* Partial refund from order */
@@ -491,7 +491,7 @@ class AdminOrdersControllerCore extends AdminController
if ($amount > 0) if ($amount > 0)
{ {
if (!OrderSlip::createPartialOrderSlip($order, $amount, $shipping_cost_amount, $order_detail_list)) if (!OrderSlip::createPartialOrderSlip($order, $amount, $shipping_cost_amount, $order_detail_list))
$this->errors[] = Tools::displayError('Cannot generate partial credit slip'); $this->errors[] = Tools::displayError('You cannot generate a partial credit slip.');
// Generate voucher // Generate voucher
if (Tools::isSubmit('generateDiscountRefund') && !count($this->errors)) if (Tools::isSubmit('generateDiscountRefund') && !count($this->errors))
@@ -521,7 +521,7 @@ class AdminOrdersControllerCore extends AdminController
$cart_rule->reduction_currency = $order->id_currency; $cart_rule->reduction_currency = $order->id_currency;
if (!$cart_rule->add()) if (!$cart_rule->add())
$this->errors[] = Tools::displayError('Cannot generate voucher'); $this->errors[] = Tools::displayError('You cannot generate a voucher.');
else else
{ {
// Update the voucher code and name // Update the voucher code and name
@@ -530,7 +530,7 @@ class AdminOrdersControllerCore extends AdminController
$cart_rule->code = sprintf('V%1$dC%2$dO%3$d', $cart_rule->id, $order->id_customer, $order->id); $cart_rule->code = sprintf('V%1$dC%2$dO%3$d', $cart_rule->id, $order->id_customer, $order->id);
if (!$cart_rule->update()) if (!$cart_rule->update())
$this->errors[] = Tools::displayError('Cannot generate voucher'); $this->errors[] = Tools::displayError('You cannot generate a voucher.');
else else
{ {
$currency = $this->context->currency; $currency = $this->context->currency;
@@ -550,17 +550,17 @@ class AdminOrdersControllerCore extends AdminController
} }
} }
else else
$this->errors[] = Tools::displayError('You have to write an amount if you want to do a partial credit slip'); $this->errors[] = Tools::displayError('You have to enter an amount if you want to create a partial credit slip.');
// Redirect if no errors // Redirect if no errors
if (!count($this->errors)) if (!count($this->errors))
Tools::redirectAdmin(self::$currentIndex.'&id_order='.$order->id.'&vieworder&conf=30&token='.$this->token); Tools::redirectAdmin(self::$currentIndex.'&id_order='.$order->id.'&vieworder&conf=30&token='.$this->token);
} }
else else
$this->errors[] = Tools::displayError('Partial refund data is incorrect'); $this->errors[] = Tools::displayError('The partial refund data is incorrect.');
} }
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.');
} }
/* Cancel product from order */ /* Cancel product from order */
@@ -569,9 +569,9 @@ class AdminOrdersControllerCore extends AdminController
if ($this->tabAccess['delete'] === '1') if ($this->tabAccess['delete'] === '1')
{ {
if (!Tools::isSubmit('id_order_detail')) if (!Tools::isSubmit('id_order_detail'))
$this->errors[] = Tools::displayError('You must select a product'); $this->errors[] = Tools::displayError('You must select a product.');
elseif (!Tools::isSubmit('cancelQuantity')) elseif (!Tools::isSubmit('cancelQuantity'))
$this->errors[] = Tools::displayError('You must enter a quantity'); $this->errors[] = Tools::displayError('You must enter a quantity.');
else else
{ {
$productList = Tools::getValue('id_order_detail'); $productList = Tools::getValue('id_order_detail');
@@ -611,7 +611,7 @@ class AdminOrdersControllerCore extends AdminController
{ {
$qtyCancelProduct = abs($qtyList[$key]); $qtyCancelProduct = abs($qtyList[$key]);
if (!$qtyCancelProduct) if (!$qtyCancelProduct)
$this->errors[] = Tools::displayError('No quantity selected for product.'); $this->errors[] = Tools::displayError('No quantity has been selected for this product.');
$order_detail = new OrderDetail($id_order_detail); $order_detail = new OrderDetail($id_order_detail);
$customization_quantity = 0; $customization_quantity = 0;
@@ -619,7 +619,7 @@ class AdminOrdersControllerCore extends AdminController
$customization_quantity = (int)$customization_quantities[$order_detail->product_id][$order_detail->product_attribute_id]; $customization_quantity = (int)$customization_quantities[$order_detail->product_id][$order_detail->product_attribute_id];
if (($order_detail->product_quantity - $customization_quantity - $order_detail->product_quantity_refunded - $order_detail->product_quantity_return) < $qtyCancelProduct) if (($order_detail->product_quantity - $customization_quantity - $order_detail->product_quantity_refunded - $order_detail->product_quantity_return) < $qtyCancelProduct)
$this->errors[] = Tools::displayError('Invalid quantity selected for product.'); $this->errors[] = Tools::displayError('An invalid quantity was selected for this product.');
} }
} }
@@ -633,10 +633,10 @@ class AdminOrdersControllerCore extends AdminController
$customization_quantity = $customization_quantities[$id_customization]; $customization_quantity = $customization_quantities[$id_customization];
if (!$qtyCancelProduct) if (!$qtyCancelProduct)
$this->errors[] = Tools::displayError('No quantity selected for product.'); $this->errors[] = Tools::displayError('No quantity has been selected for this product.');
if ($qtyCancelProduct > ($customization_quantity['quantity'] - ($customization_quantity['quantity_refunded'] + $customization_quantity['quantity_returned']))) if ($qtyCancelProduct > ($customization_quantity['quantity'] - ($customization_quantity['quantity_refunded'] + $customization_quantity['quantity_returned'])))
$this->errors[] = Tools::displayError('Invalid quantity selected for product.'); $this->errors[] = Tools::displayError('An invalid quantity was selected for this product.');
} }
} }
@@ -652,7 +652,7 @@ class AdminOrdersControllerCore extends AdminController
// Delete product // Delete product
$order_detail = new OrderDetail((int)$id_order_detail); $order_detail = new OrderDetail((int)$id_order_detail);
if (!$order->deleteProduct($order, $order_detail, $qtyCancelProduct)) if (!$order->deleteProduct($order, $order_detail, $qtyCancelProduct))
$this->errors[] = Tools::displayError('An error occurred during deletion of the product.').' <span class="bold">'.$order_detail->product_name.'</span>'; $this->errors[] = Tools::displayError('An error occurred while attempting to delete the product.').' <span class="bold">'.$order_detail->product_name.'</span>';
Hook::exec('actionProductCancel', array('order' => $order, 'id_order_detail' => (int)$id_order_detail)); Hook::exec('actionProductCancel', array('order' => $order, 'id_order_detail' => (int)$id_order_detail));
} }
if (!count($this->errors) && $customizationList) if (!count($this->errors) && $customizationList)
@@ -661,7 +661,7 @@ class AdminOrdersControllerCore extends AdminController
$order_detail = new OrderDetail((int)($id_order_detail)); $order_detail = new OrderDetail((int)($id_order_detail));
$qtyCancelProduct = abs($customizationQtyList[$id_customization]); $qtyCancelProduct = abs($customizationQtyList[$id_customization]);
if (!$order->deleteCustomization($id_customization, $qtyCancelProduct, $order_detail)) if (!$order->deleteCustomization($id_customization, $qtyCancelProduct, $order_detail))
$this->errors[] = Tools::displayError('An error occurred during deletion of product customization.').' '.$id_customization; $this->errors[] = Tools::displayError('An error occurred while attempting to delete product customization.').' '.$id_customization;
} }
// E-mail params // E-mail params
if ((Tools::isSubmit('generateCreditSlip') || Tools::isSubmit('generateDiscount')) && !count($this->errors)) if ((Tools::isSubmit('generateCreditSlip') || Tools::isSubmit('generateDiscount')) && !count($this->errors))
@@ -677,7 +677,7 @@ class AdminOrdersControllerCore extends AdminController
if (Tools::isSubmit('generateCreditSlip') && !count($this->errors)) if (Tools::isSubmit('generateCreditSlip') && !count($this->errors))
{ {
if (!OrderSlip::createOrderSlip($order, $full_product_list, $full_quantity_list, Tools::isSubmit('shippingBack'))) if (!OrderSlip::createOrderSlip($order, $full_product_list, $full_quantity_list, Tools::isSubmit('shippingBack')))
$this->errors[] = Tools::displayError('Cannot generate credit slip'); $this->errors[] = Tools::displayError('A credit slip cannot be generated. ');
else else
{ {
Hook::exec('actionOrderSlipAdd', array('order' => $order, 'productList' => $full_product_list, 'qtyList' => $full_quantity_list)); Hook::exec('actionOrderSlipAdd', array('order' => $order, 'productList' => $full_product_list, 'qtyList' => $full_quantity_list));
@@ -737,7 +737,7 @@ class AdminOrdersControllerCore extends AdminController
$cartrule->reduction_currency = $order->id_currency; $cartrule->reduction_currency = $order->id_currency;
if (!$cartrule->add()) if (!$cartrule->add())
$this->errors[] = Tools::displayError('Cannot generate voucher'); $this->errors[] = Tools::displayError('You cannot generate a voucher.');
else else
{ {
// Update the voucher code and name // Update the voucher code and name
@@ -745,7 +745,7 @@ class AdminOrdersControllerCore extends AdminController
$cartrule->name[$language['id_lang']] = 'V'.(int)($cartrule->id).'C'.(int)($order->id_customer).'O'.$order->id; $cartrule->name[$language['id_lang']] = 'V'.(int)($cartrule->id).'C'.(int)($order->id_customer).'O'.$order->id;
$cartrule->code = 'V'.(int)($cartrule->id).'C'.(int)($order->id_customer).'O'.$order->id; $cartrule->code = 'V'.(int)($cartrule->id).'C'.(int)($order->id_customer).'O'.$order->id;
if (!$cartrule->update()) if (!$cartrule->update())
$this->errors[] = Tools::displayError('Cannot generate voucher'); $this->errors[] = Tools::displayError('You cannot generate a voucher.');
else else
{ {
$currency = $this->context->currency; $currency = $this->context->currency;
@@ -759,7 +759,7 @@ class AdminOrdersControllerCore extends AdminController
} }
} }
else else
$this->errors[] = Tools::displayError('No product or quantity selected.'); $this->errors[] = Tools::displayError('No product or quantity has been selected.');
// Redirect if no errors // Redirect if no errors
if (!count($this->errors)) if (!count($this->errors))
@@ -767,7 +767,7 @@ class AdminOrdersControllerCore 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.');
} }
elseif (Tools::isSubmit('messageReaded')) elseif (Tools::isSubmit('messageReaded'))
Message::markAsReaded(Tools::getValue('messageReaded'), $this->context->employee->id); Message::markAsReaded(Tools::getValue('messageReaded'), $this->context->employee->id);
@@ -784,29 +784,29 @@ class AdminOrdersControllerCore extends AdminController
$order_invoice = null; $order_invoice = null;
if (!Validate::isLoadedObject($order)) if (!Validate::isLoadedObject($order))
$this->errors[] = Tools::displayError('Order can\'t be found'); $this->errors[] = Tools::displayError('The order cannot be found');
elseif (!Validate::isNegativePrice($amount)) elseif (!Validate::isNegativePrice($amount))
$this->errors[] = Tools::displayError('Amount is invalid'); $this->errors[] = Tools::displayError('The amount is invalid.');
elseif (!Validate::isString(Tools::getValue('payment_method'))) elseif (!Validate::isString(Tools::getValue('payment_method')))
$this->errors[] = Tools::displayError('Payment method is invalid'); $this->errors[] = Tools::displayError('The selected payment method is invalid.');
elseif (!Validate::isString(Tools::getValue('payment_transaction_id'))) elseif (!Validate::isString(Tools::getValue('payment_transaction_id')))
$this->errors[] = Tools::displayError('Transaction ID is invalid'); $this->errors[] = Tools::displayError('The transaction ID is invalid.');
elseif (!Validate::isLoadedObject($currency)) elseif (!Validate::isLoadedObject($currency))
$this->errors[] = Tools::displayError('Currency is invalid'); $this->errors[] = Tools::displayError('The selected currency is invalid.');
elseif ($order_has_invoice && !Validate::isLoadedObject($order_invoice)) elseif ($order_has_invoice && !Validate::isLoadedObject($order_invoice))
$this->errors[] = Tools::displayError('Invoice is invalid'); $this->errors[] = Tools::displayError('The invoice is invalid.');
elseif (!Validate::isDate(Tools::getValue('payment_date'))) elseif (!Validate::isDate(Tools::getValue('payment_date')))
$this->errors[] = Tools::displayError('Date is invalid'); $this->errors[] = Tools::displayError('The date is invalid');
else else
{ {
if (!$order->addOrderPayment($amount, Tools::getValue('payment_method'), Tools::getValue('payment_transaction_id'), $currency, Tools::getValue('payment_date'), $order_invoice)) if (!$order->addOrderPayment($amount, Tools::getValue('payment_method'), Tools::getValue('payment_transaction_id'), $currency, Tools::getValue('payment_date'), $order_invoice))
$this->errors[] = Tools::displayError('An error occurred on adding order payment'); $this->errors[] = Tools::displayError('An error occurred during payment.');
else else
Tools::redirectAdmin(self::$currentIndex.'&id_order='.$order->id.'&vieworder&conf=4&token='.$this->token); Tools::redirectAdmin(self::$currentIndex.'&id_order='.$order->id.'&vieworder&conf=4&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::isSubmit('submitEditNote')) elseif (Tools::isSubmit('submitEditNote'))
{ {
@@ -820,13 +820,13 @@ class AdminOrdersControllerCore extends AdminController
if ($order_invoice->save()) if ($order_invoice->save())
Tools::redirectAdmin(self::$currentIndex.'&id_order='.$order_invoice->id_order.'&vieworder&conf=4&token='.$this->token); Tools::redirectAdmin(self::$currentIndex.'&id_order='.$order_invoice->id_order.'&vieworder&conf=4&token='.$this->token);
else else
$this->errors[] = Tools::displayError('Unable to save invoice note.'); $this->errors[] = Tools::displayError('The invoice note was not saved.');
} }
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
$this->errors[] = Tools::displayError('Unable to load invoice for edit note.'); $this->errors[] = Tools::displayError('The invoice for edit note was unable to load. ');
} }
elseif (Tools::isSubmit('submitAddOrder') && ($id_cart = Tools::getValue('id_cart')) && elseif (Tools::isSubmit('submitAddOrder') && ($id_cart = Tools::getValue('id_cart')) &&
($module_name = Tools::getValue('payment_module_name')) && ($module_name = Tools::getValue('payment_module_name')) &&
@@ -848,7 +848,7 @@ class AdminOrdersControllerCore extends AdminController
Tools::redirectAdmin(self::$currentIndex.'&id_order='.$payment_module->currentOrder.'&vieworder'.'&token='.$this->token); Tools::redirectAdmin(self::$currentIndex.'&id_order='.$payment_module->currentOrder.'&vieworder'.'&token='.$this->token);
} }
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 ((Tools::isSubmit('submitAddressShipping') || Tools::isSubmit('submitAddressInvoice')) && isset($order)) elseif ((Tools::isSubmit('submitAddressShipping') || Tools::isSubmit('submitAddressInvoice')) && isset($order))
{ {
@@ -869,7 +869,7 @@ class AdminOrdersControllerCore extends AdminController
$this->errors[] = Tools::displayErrror('This address can\'t be loaded'); $this->errors[] = Tools::displayErrror('This address can\'t be loaded');
} }
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('submitChangeCurrency') && isset($order)) elseif (Tools::isSubmit('submitChangeCurrency') && isset($order))
{ {
@@ -965,17 +965,17 @@ class AdminOrdersControllerCore extends AdminController
$order->update(); $order->update();
} }
else else
$this->errors[] = Tools::displayError('You cannot change the currency'); $this->errors[] = Tools::displayError('You cannot change the currency.');
} }
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('submitGenerateInvoice') && isset($order)) elseif (Tools::isSubmit('submitGenerateInvoice') && isset($order))
{ {
if (!Configuration::get('PS_INVOICE', null, null, $order->id_shop)) if (!Configuration::get('PS_INVOICE', null, null, $order->id_shop))
$this->errors[] = Tools::displayError('Invoice management has been disabled'); $this->errors[] = Tools::displayError('Invoice management has been disabled.');
elseif ($order->hasInvoice()) elseif ($order->hasInvoice())
$this->errors[] = Tools::displayError('This order already has an invoice'); $this->errors[] = Tools::displayError('This order already has an invoice.');
else else
{ {
$order->setInvoice(true); $order->setInvoice(true);
@@ -1021,17 +1021,17 @@ class AdminOrdersControllerCore extends AdminController
Tools::redirectAdmin(self::$currentIndex.'&id_order='.$order->id.'&vieworder&conf=4&token='.$this->token); Tools::redirectAdmin(self::$currentIndex.'&id_order='.$order->id.'&vieworder&conf=4&token='.$this->token);
} }
else else
$this->errors[] = Tools::displayError('Cannot edit this Order Cart Rule'); $this->errors[] = Tools::displayError('You cannot edit this cart rule.');
} }
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('submitNewVoucher') && isset($order)) elseif (Tools::getValue('submitNewVoucher') && isset($order))
{ {
if ($this->tabAccess['edit'] === '1') if ($this->tabAccess['edit'] === '1')
{ {
if (!Tools::getValue('discount_name')) if (!Tools::getValue('discount_name'))
$this->errors[] = Tools::displayError('You must specify a name in order to create a new discount'); $this->errors[] = Tools::displayError('You must specify a name in order to create a new discount.');
else else
{ {
if ($order->hasInvoice()) if ($order->hasInvoice())
@@ -1079,14 +1079,14 @@ class AdminOrdersControllerCore extends AdminController
} }
} }
else else
$this->errors[] = Tools::displayError('Discount value is invalid'); $this->errors[] = Tools::displayError('The discount value is invalid.');
break; break;
// Amount type // Amount type
case 2: case 2:
if (isset($order_invoice)) if (isset($order_invoice))
{ {
if (Tools::getValue('discount_value') > $order_invoice->total_paid_tax_incl) if (Tools::getValue('discount_value') > $order_invoice->total_paid_tax_incl)
$this->errors[] = Tools::displayError('Discount value is greater than the order invoice total'); $this->errors[] = Tools::displayError('The discount value is greater than the order invoice total.');
else else
{ {
$cart_rules[$order_invoice->id]['value_tax_incl'] = Tools::ps_round(Tools::getValue('discount_value'), 2); $cart_rules[$order_invoice->id]['value_tax_incl'] = Tools::ps_round(Tools::getValue('discount_value'), 2);
@@ -1102,7 +1102,7 @@ class AdminOrdersControllerCore extends AdminController
foreach ($order_invoices_collection as $order_invoice) foreach ($order_invoices_collection as $order_invoice)
{ {
if (Tools::getValue('discount_value') > $order_invoice->total_paid_tax_incl) if (Tools::getValue('discount_value') > $order_invoice->total_paid_tax_incl)
$this->errors[] = Tools::displayError('Discount value is greater than the order invoice total (Invoice:').$order_invoice->getInvoiceNumberFormatted(Context::getContext()->language->id, (int)$order->id_shop).')'; $this->errors[] = Tools::displayError('The discount value is greater than the order invoice total.').$order_invoice->getInvoiceNumberFormatted(Context::getContext()->language->id, (int)$order->id_shop).')';
else else
{ {
$cart_rules[$order_invoice->id]['value_tax_incl'] = Tools::ps_round(Tools::getValue('discount_value'), 2); $cart_rules[$order_invoice->id]['value_tax_incl'] = Tools::ps_round(Tools::getValue('discount_value'), 2);
@@ -1116,7 +1116,7 @@ class AdminOrdersControllerCore extends AdminController
else else
{ {
if (Tools::getValue('discount_value') > $order->total_paid_tax_incl) if (Tools::getValue('discount_value') > $order->total_paid_tax_incl)
$this->errors[] = Tools::displayError('Discount value is greater than the order total'); $this->errors[] = Tools::displayError('The discount value is greater than the order total.');
else else
{ {
$cart_rules[0]['value_tax_incl'] = Tools::ps_round(Tools::getValue('discount_value'), 2); $cart_rules[0]['value_tax_incl'] = Tools::ps_round(Tools::getValue('discount_value'), 2);
@@ -1158,7 +1158,7 @@ class AdminOrdersControllerCore extends AdminController
} }
break; break;
default: default:
$this->errors[] = Tools::displayError('Discount type is invalid'); $this->errors[] = Tools::displayError('The discount type is invalid.');
} }
$res = true; $res = true;
@@ -1212,11 +1212,11 @@ class AdminOrdersControllerCore extends AdminController
if ($res) if ($res)
Tools::redirectAdmin(self::$currentIndex.'&id_order='.$order->id.'&vieworder&conf=4&token='.$this->token); Tools::redirectAdmin(self::$currentIndex.'&id_order='.$order->id.'&vieworder&conf=4&token='.$this->token);
else else
$this->errors[] = Tools::displayError('An error occurred on OrderCartRule creation'); $this->errors[] = Tools::displayError('An error occurred during the OrderCartRule creation');
} }
} }
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::postProcess(); parent::postProcess();
@@ -1483,13 +1483,13 @@ class AdminOrdersControllerCore extends AdminController
if (!Validate::isLoadedObject($order)) if (!Validate::isLoadedObject($order))
die(Tools::jsonEncode(array( die(Tools::jsonEncode(array(
'result' => false, 'result' => false,
'error' => Tools::displayError('Can\'t load Order object') 'error' => Tools::displayError('The order object cannot be loaded.')
))); )));
if ($order->hasBeenShipped()) if ($order->hasBeenShipped())
die(Tools::jsonEncode(array( die(Tools::jsonEncode(array(
'result' => false, 'result' => false,
'error' => Tools::displayError('Can\'t add a product on delivered order') 'error' => Tools::displayError('You cannot add products to delivered orders. ')
))); )));
$product_informations = $_POST['add_product']; $product_informations = $_POST['add_product'];
@@ -1501,7 +1501,7 @@ class AdminOrdersControllerCore extends AdminController
if (!Validate::isLoadedObject($product)) if (!Validate::isLoadedObject($product))
die(Tools::jsonEncode(array( die(Tools::jsonEncode(array(
'result' => false, 'result' => false,
'error' => Tools::displayError('Can\'t load Product object') 'error' => Tools::displayError('The product object cannot be loaded.')
))); )));
if (isset($product_informations['product_attribute_id']) && $product_informations['product_attribute_id']) if (isset($product_informations['product_attribute_id']) && $product_informations['product_attribute_id'])
@@ -1510,7 +1510,7 @@ class AdminOrdersControllerCore extends AdminController
if (!Validate::isLoadedObject($combination)) if (!Validate::isLoadedObject($combination))
die(Tools::jsonEncode(array( die(Tools::jsonEncode(array(
'result' => false, 'result' => false,
'error' => Tools::displayError('Can\'t load Combination object') 'error' => Tools::displayError('The combination object cannot be loaded.')
))); )));
} }
@@ -1776,21 +1776,21 @@ class AdminOrdersControllerCore extends AdminController
if (!Validate::isLoadedObject($order_detail)) if (!Validate::isLoadedObject($order_detail))
die(Tools::jsonEncode(array( die(Tools::jsonEncode(array(
'result' => false, 'result' => false,
'error' => Tools::displayError('Can\'t load OrderDetail object') 'error' => Tools::displayError('The OrderDetail object cannot be loaded.')
))); )));
$product = new Product($order_detail->product_id); $product = new Product($order_detail->product_id);
if (!Validate::isLoadedObject($product)) if (!Validate::isLoadedObject($product))
die(Tools::jsonEncode(array( die(Tools::jsonEncode(array(
'result' => false, 'result' => false,
'error' => Tools::displayError('Can\'t load Product object') 'error' => Tools::displayError('The product object cannot be loaded.')
))); )));
$address = new Address(Tools::getValue('id_address')); $address = new Address(Tools::getValue('id_address'));
if (!Validate::isLoadedObject($address)) if (!Validate::isLoadedObject($address))
die(Tools::jsonEncode(array( die(Tools::jsonEncode(array(
'result' => false, 'result' => false,
'error' => Tools::displayError('Can\'t load Address object') 'error' => Tools::displayError('The address object cannot be loaded.')
))); )));
die(Tools::jsonEncode(array( die(Tools::jsonEncode(array(
@@ -1940,7 +1940,7 @@ class AdminOrdersControllerCore extends AdminController
if (!$res) if (!$res)
die(Tools::jsonEncode(array( die(Tools::jsonEncode(array(
'result' => $res, 'result' => $res,
'error' => Tools::displayError('Error occurred while editing this product line') 'error' => Tools::displayError('An error occurred while editing the product line.')
))); )));
@@ -1999,7 +1999,7 @@ class AdminOrdersControllerCore extends AdminController
if (!$res) if (!$res)
die(Tools::jsonEncode(array( die(Tools::jsonEncode(array(
'result' => $res, 'result' => $res,
'error' => Tools::displayError('Error occurred on deletion of this product line') 'error' => Tools::displayError('An error occurred while attempting to delete the product line.')
))); )));
// Get invoices collection // Get invoices collection
@@ -2038,38 +2038,38 @@ class AdminOrdersControllerCore extends AdminController
if (!Validate::isLoadedObject($order_detail)) if (!Validate::isLoadedObject($order_detail))
die(Tools::jsonEncode(array( die(Tools::jsonEncode(array(
'result' => false, 'result' => false,
'error' => Tools::displayError('Can\'t load Order Detail object') 'error' => Tools::displayError('The Order Detail object could not be loaded.')
))); )));
if (!empty($order_invoice) && !Validate::isLoadedObject($order_invoice)) if (!empty($order_invoice) && !Validate::isLoadedObject($order_invoice))
die(Tools::jsonEncode(array( die(Tools::jsonEncode(array(
'result' => false, 'result' => false,
'error' => Tools::displayError('Can\'t load Invoice object') 'error' => Tools::displayError('The invoice object cannot be loaded.')
))); )));
if (!Validate::isLoadedObject($order)) if (!Validate::isLoadedObject($order))
die(Tools::jsonEncode(array( die(Tools::jsonEncode(array(
'result' => false, 'result' => false,
'error' => Tools::displayError('Can\'t load Order object') 'error' => Tools::displayError('The order object cannot be loaded.')
))); )));
if ($order_detail->id_order != $order->id) if ($order_detail->id_order != $order->id)
die(Tools::jsonEncode(array( die(Tools::jsonEncode(array(
'result' => false, 'result' => false,
'error' => Tools::displayError('Can\'t edit this Order Detail for this order') 'error' => Tools::displayError('You cannot edit the order detail for this order.')
))); )));
// We can't edit a delivered order // We can't edit a delivered order
if ($order->hasBeenDelivered()) if ($order->hasBeenDelivered())
die(Tools::jsonEncode(array( die(Tools::jsonEncode(array(
'result' => false, 'result' => false,
'error' => Tools::displayError('Can\'t edit a delivered order') 'error' => Tools::displayError('You cannot edit a delivered order.')
))); )));
if (!empty($order_invoice) && $order_invoice->id_order != Tools::getValue('id_order')) if (!empty($order_invoice) && $order_invoice->id_order != Tools::getValue('id_order'))
die(Tools::jsonEncode(array( die(Tools::jsonEncode(array(
'result' => false, 'result' => false,
'error' => Tools::displayError('Can\'t use this invoice for this order') 'error' => Tools::displayError('You cannot use this invoice for the order')
))); )));
// Clean price // Clean price
@@ -2101,26 +2101,26 @@ class AdminOrdersControllerCore extends AdminController
if (!Validate::isLoadedObject($order_detail)) if (!Validate::isLoadedObject($order_detail))
die(Tools::jsonEncode(array( die(Tools::jsonEncode(array(
'result' => false, 'result' => false,
'error' => Tools::displayError('Can\'t load Order Detail object') 'error' => Tools::displayError('The Order Detail object could not be loaded.')
))); )));
if (!Validate::isLoadedObject($order)) if (!Validate::isLoadedObject($order))
die(Tools::jsonEncode(array( die(Tools::jsonEncode(array(
'result' => false, 'result' => false,
'error' => Tools::displayError('Can\'t load Order object') 'error' => Tools::displayError('The order object cannot be loaded.')
))); )));
if ($order_detail->id_order != $order->id) if ($order_detail->id_order != $order->id)
die(Tools::jsonEncode(array( die(Tools::jsonEncode(array(
'result' => false, 'result' => false,
'error' => Tools::displayError('Can\'t delete this Order Detail for this order') 'error' => Tools::displayError('You cannot delete the order detail.')
))); )));
// We can't edit a delivered order // We can't edit a delivered order
if ($order->hasBeenDelivered()) if ($order->hasBeenDelivered())
die(Tools::jsonEncode(array( die(Tools::jsonEncode(array(
'result' => false, 'result' => false,
'error' => Tools::displayError('Can\'t edit a delivered order') 'error' => Tools::displayError('You cannot edit a delivered order.')
))); )));
} }
@@ -2194,7 +2194,7 @@ class AdminOrdersControllerCore extends AdminController
); );
} }
else else
$this->errors[] = Tools::displayError('Cannot re-stock product'); $this->errors[] = Tools::displayError('This product cannot be re-stocked.');
} }
protected function applyDiscountOnInvoice($order_invoice, $value_tax_incl, $value_tax_excl) protected function applyDiscountOnInvoice($order_invoice, $value_tax_incl, $value_tax_excl)
@@ -60,7 +60,7 @@ class AdminPPreferencesControllerCore extends AdminController
'type' => 'text' 'type' => 'text'
), ),
'PS_CART_REDIRECT' => array( 'PS_CART_REDIRECT' => array(
'title' => $this->l('Redirect after adding product to cart.'), 'title' => $this->l('Redirect after adding product to cart'),
'desc' => $this->l('Only for non-AJAX versions of the cart.'), 'desc' => $this->l('Only for non-AJAX versions of the cart.'),
'cast' => 'intval', 'cast' => 'intval',
'show' => true, 'show' => true,
@@ -68,8 +68,8 @@ class AdminPPreferencesControllerCore extends AdminController
'type' => 'radio', 'type' => 'radio',
'validation' => 'isBool', 'validation' => 'isBool',
'choices' => array( 'choices' => array(
0 => $this->l('previous page'), 0 => $this->l('Previous page'),
1 => $this->l('cart summary') 1 => $this->l('Cart summary')
) )
), ),
'PS_PRODUCT_SHORT_DESC_LIMIT' => array( 'PS_PRODUCT_SHORT_DESC_LIMIT' => array(
@@ -142,7 +142,7 @@ class AdminPPreferencesControllerCore extends AdminController
'title' => $this->l('Product page'), 'title' => $this->l('Product page'),
'fields' => array( 'fields' => array(
'PS_DISPLAY_QTIES' => array( 'PS_DISPLAY_QTIES' => array(
'title' => $this->l('Display available quantities on the product page.'), 'title' => $this->l('Display available quantities on the product page'),
'desc' => '', 'desc' => '',
'validation' => 'isBool', 'validation' => 'isBool',
'cast' => 'intval', 'cast' => 'intval',
@@ -158,7 +158,7 @@ class AdminPPreferencesControllerCore extends AdminController
'type' => 'text' 'type' => 'text'
), ),
'PS_DISPLAY_JQZOOM' => array( 'PS_DISPLAY_JQZOOM' => array(
'title' => $this->l('Enable JqZoom instead of Thickbox on the product page.'), 'title' => $this->l('Enable JqZoom instead of Thickbox on the product page'),
'desc' => '', 'desc' => '',
'validation' => 'isBool', 'validation' => 'isBool',
'cast' => 'intval', 'cast' => 'intval',
@@ -166,7 +166,7 @@ class AdminPPreferencesControllerCore extends AdminController
'type' => 'bool' 'type' => 'bool'
), ),
'PS_DISP_UNAVAILABLE_ATTR' => array( 'PS_DISP_UNAVAILABLE_ATTR' => array(
'title' => $this->l('Display unavailable product attributes on the product page.'), 'title' => $this->l('Display unavailable product attributes on the product page'),
'desc' => '', 'desc' => '',
'validation' => 'isBool', 'validation' => 'isBool',
'cast' => 'intval', 'cast' => 'intval',
@@ -174,7 +174,7 @@ class AdminPPreferencesControllerCore extends AdminController
'type' => 'bool' 'type' => 'bool'
), ),
'PS_ATTRIBUTE_CATEGORY_DISPLAY' => array( 'PS_ATTRIBUTE_CATEGORY_DISPLAY' => array(
'title' => $this->l('Display the "add to cart" button when a product has attributes.'), 'title' => $this->l('Display the "add to cart" button when a product has attributes'),
'desc' => $this->l('Display or hide the "add to cart" button on category pages for products that have attributes forcing customers to see product details.'), 'desc' => $this->l('Display or hide the "add to cart" button on category pages for products that have attributes forcing customers to see product details.'),
'validation' => 'isBool', 'validation' => 'isBool',
'cast' => 'intval', 'cast' => 'intval',
@@ -206,7 +206,7 @@ class AdminPPreferencesControllerCore extends AdminController
) )
), ),
'PS_ADVANCED_STOCK_MANAGEMENT' => array( 'PS_ADVANCED_STOCK_MANAGEMENT' => array(
'title' => $this->l('Enable advanced stock management'), 'title' => $this->l('Enable advanced-stock management'),
'desc' => $this->l('Allows you to manage physical stock, warehouses and supply orders.'), 'desc' => $this->l('Allows you to manage physical stock, warehouses and supply orders.'),
'validation' => 'isBool', 'validation' => 'isBool',
'cast' => 'intval', 'cast' => 'intval',
+1 -1
View File
@@ -101,7 +101,7 @@ class AdminPaymentControllerCore extends AdminController
$this->action = 'group'; $this->action = 'group';
} }
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.');
} }
+12 -12
View File
@@ -41,7 +41,7 @@ class AdminPdfControllerCore extends AdminController
if ($access['view'] === '1' && ($action = Tools::getValue('submitAction'))) if ($access['view'] === '1' && ($action = Tools::getValue('submitAction')))
$this->action = $action; $this->action = $action;
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.');
} }
public function processGenerateInvoicePdf() public function processGenerateInvoicePdf()
@@ -51,7 +51,7 @@ class AdminPdfControllerCore extends AdminController
elseif (Tools::isSubmit('id_order_invoice')) elseif (Tools::isSubmit('id_order_invoice'))
$this->generateInvoicePDFByIdOrderInvoice(Tools::getValue('id_order_invoice')); $this->generateInvoicePDFByIdOrderInvoice(Tools::getValue('id_order_invoice'));
else else
die (Tools::displayError('Missing order ID or invoice order ID')); die (Tools::displayError('The order ID -- or the invoice order ID -- is missing.'));
} }
public function processGenerateOrderSlipPDF() public function processGenerateOrderSlipPDF()
@@ -59,7 +59,7 @@ class AdminPdfControllerCore extends AdminController
$orderSlip = new OrderSlip((int)Tools::getValue('id_order_slip')); $orderSlip = new OrderSlip((int)Tools::getValue('id_order_slip'));
$order = new Order((int)$orderSlip->id_order); $order = new Order((int)$orderSlip->id_order);
if (!Validate::isLoadedObject($order)) if (!Validate::isLoadedObject($order))
die(Tools::displayError('Cannot find order in database')); die(Tools::displayError('The order cannot be found within your database.'));
$order->products = OrderSlip::getOrdersSlipProducts($orderSlip->id, $order); $order->products = OrderSlip::getOrdersSlipProducts($orderSlip->id, $order);
$this->generatePDF($orderSlip, PDF::TEMPLATE_ORDER_SLIP); $this->generatePDF($orderSlip, PDF::TEMPLATE_ORDER_SLIP);
@@ -77,7 +77,7 @@ class AdminPdfControllerCore extends AdminController
$this->generateDeliverySlipPDFByIdOrder((int)$order->id); $this->generateDeliverySlipPDFByIdOrder((int)$order->id);
} }
else else
die (Tools::displayError('Missing order ID or invoice order ID')); die (Tools::displayError('The order ID -- or the invoice order ID -- is missing.'));
} }
public function processGenerateInvoicesPDF() public function processGenerateInvoicesPDF()
@@ -85,7 +85,7 @@ class AdminPdfControllerCore extends AdminController
$order_invoice_collection = OrderInvoice::getByDateInterval(Tools::getValue('date_from'), Tools::getValue('date_to')); $order_invoice_collection = OrderInvoice::getByDateInterval(Tools::getValue('date_from'), Tools::getValue('date_to'));
if (!count($order_invoice_collection)) if (!count($order_invoice_collection))
die(Tools::displayError('No invoices found')); die(Tools::displayError('No invoice was found.'));
$this->generatePDF($order_invoice_collection, PDF::TEMPLATE_INVOICE); $this->generatePDF($order_invoice_collection, PDF::TEMPLATE_INVOICE);
} }
@@ -98,7 +98,7 @@ class AdminPdfControllerCore extends AdminController
$order_invoice_collection = array_merge($order_invoices, $order_invoice_collection); $order_invoice_collection = array_merge($order_invoices, $order_invoice_collection);
if (!count($order_invoice_collection)) if (!count($order_invoice_collection))
die(Tools::displayError('No invoices found')); die(Tools::displayError('No invoice was found.'));
$this->generatePDF($order_invoice_collection, PDF::TEMPLATE_INVOICE); $this->generatePDF($order_invoice_collection, PDF::TEMPLATE_INVOICE);
} }
@@ -107,7 +107,7 @@ class AdminPdfControllerCore extends AdminController
{ {
$id_order_slips_list = OrderSlip::getSlipsIdByDate(Tools::getValue('date_from'), Tools::getValue('date_to')); $id_order_slips_list = OrderSlip::getSlipsIdByDate(Tools::getValue('date_from'), Tools::getValue('date_to'));
if (!count($id_order_slips_list)) if (!count($id_order_slips_list))
die (Tools::displayError('No order slips found')); die (Tools::displayError('No order slips were found.'));
$order_slips = array(); $order_slips = array();
foreach ($id_order_slips_list as $id_order_slips) foreach ($id_order_slips_list as $id_order_slips)
@@ -121,7 +121,7 @@ class AdminPdfControllerCore extends AdminController
$order_invoice_collection = OrderInvoice::getByDeliveryDateInterval(Tools::getValue('date_from'), Tools::getValue('date_to')); $order_invoice_collection = OrderInvoice::getByDeliveryDateInterval(Tools::getValue('date_from'), Tools::getValue('date_to'));
if (!count($order_invoice_collection)) if (!count($order_invoice_collection))
die(Tools::displayError('No invoices found')); die(Tools::displayError('No invoice was found.'));
$this->generatePDF($order_invoice_collection, PDF::TEMPLATE_DELIVERY_SLIP); $this->generatePDF($order_invoice_collection, PDF::TEMPLATE_DELIVERY_SLIP);
} }
@@ -129,13 +129,13 @@ class AdminPdfControllerCore extends AdminController
public function processGenerateSupplyOrderFormPDF() public function processGenerateSupplyOrderFormPDF()
{ {
if (!Tools::isSubmit('id_supply_order')) if (!Tools::isSubmit('id_supply_order'))
die (Tools::displayError('Missing supply order ID')); die (Tools::displayError('The supply order ID is missing.'));
$id_supply_order = (int)Tools::getValue('id_supply_order'); $id_supply_order = (int)Tools::getValue('id_supply_order');
$supply_order = new SupplyOrder($id_supply_order); $supply_order = new SupplyOrder($id_supply_order);
if (!Validate::isLoadedObject($supply_order)) if (!Validate::isLoadedObject($supply_order))
die(Tools::displayError('Cannot find this supply order in the database')); die(Tools::displayError('The supply order cannot be found within your database.'));
$this->generatePDF($supply_order, PDF::TEMPLATE_SUPPLY_ORDER_FORM); $this->generatePDF($supply_order, PDF::TEMPLATE_SUPPLY_ORDER_FORM);
} }
@@ -163,7 +163,7 @@ class AdminPdfControllerCore extends AdminController
{ {
$order = new Order((int)$id_order); $order = new Order((int)$id_order);
if (!Validate::isLoadedObject($order)) if (!Validate::isLoadedObject($order))
die(Tools::displayError('Cannot find order in database')); die(Tools::displayError('The order cannot be found within your database.'));
$order_invoice_list = $order->getInvoicesCollection(); $order_invoice_list = $order->getInvoicesCollection();
Hook::exec('actionPDFInvoiceRender', array('order_invoice_list' => $order_invoice_list)); Hook::exec('actionPDFInvoiceRender', array('order_invoice_list' => $order_invoice_list));
@@ -174,7 +174,7 @@ class AdminPdfControllerCore extends AdminController
{ {
$order_invoice = new OrderInvoice((int)$id_order_invoice); $order_invoice = new OrderInvoice((int)$id_order_invoice);
if (!Validate::isLoadedObject($order_invoice)) if (!Validate::isLoadedObject($order_invoice))
die(Tools::displayError('Cannot find order invoice in database')); die(Tools::displayError('The order invoice cannot be found within your database.'));
Hook::exec('actionPDFInvoiceRender', array('order_invoice_list' => array($order_invoice))); Hook::exec('actionPDFInvoiceRender', array('order_invoice_list' => array($order_invoice)));
$this->generatePDF($order_invoice, PDF::TEMPLATE_INVOICE); $this->generatePDF($order_invoice, PDF::TEMPLATE_INVOICE);
@@ -61,7 +61,7 @@ class AdminPerformanceControllerCore extends AdminController
'id' => 'smarty_force_compile_'._PS_SMARTY_FORCE_COMPILE_, 'id' => 'smarty_force_compile_'._PS_SMARTY_FORCE_COMPILE_,
'value' => _PS_SMARTY_FORCE_COMPILE_, 'value' => _PS_SMARTY_FORCE_COMPILE_,
'label' => $this->l('Force compilation'), 'label' => $this->l('Force compilation'),
'desc' => $this->l('This forces Smarty to (re)compile templates on every invocation. This is handy for development and debugging. It should never be used in a production environment.') 'desc' => $this->l('This forces Smarty to (re)compile templates on every invocation. This is handy for development and debugging. Note: This should never be used in a production environment.')
) )
) )
), ),
@@ -155,7 +155,7 @@ class AdminPerformanceControllerCore extends AdminController
), ),
array( array(
'type' => 'radio', 'type' => 'radio',
'label' => $this->l('Features:'), 'label' => $this->l('Features'),
'name' => 'feature', 'name' => 'feature',
'class' => 't', 'class' => 't',
'is_bool' => true, 'is_bool' => true,
@@ -307,7 +307,7 @@ class AdminPerformanceControllerCore extends AdminController
'title' => $this->l('Media servers (use only with CCC)'), 'title' => $this->l('Media servers (use only with CCC)'),
'image' => '../img/admin/subdomain.gif' 'image' => '../img/admin/subdomain.gif'
), ),
'desc' => $this->l('You must enter another domain or subdomain in order to use cookieless static content.'), 'desc' => $this->l('You must enter another domain, or subdomain, in order to use cookieless static content.'),
'input' => array( 'input' => array(
array( array(
'type' => 'hidden', 'type' => 'hidden',
@@ -554,11 +554,11 @@ class AdminPerformanceControllerCore extends AdminController
if ($this->tabAccess['add'] === '1') if ($this->tabAccess['add'] === '1')
{ {
if (!Tools::getValue('memcachedIp')) if (!Tools::getValue('memcachedIp'))
$this->errors[] = Tools::displayError('Memcached IP is missing'); $this->errors[] = Tools::displayError('The Memcached IP is missing.');
if (!Tools::getValue('memcachedPort')) if (!Tools::getValue('memcachedPort'))
$this->errors[] = Tools::displayError('Memcached port is missing'); $this->errors[] = Tools::displayError('The Memcached port is missing.');
if (!Tools::getValue('memcachedWeight')) if (!Tools::getValue('memcachedWeight'))
$this->errors[] = Tools::displayError('Memcached weight is missing'); $this->errors[] = Tools::displayError('The Memcached weight is missing.');
if (!count($this->errors)) if (!count($this->errors))
{ {
if (CacheMemcache::addServer(pSQL(Tools::getValue('memcachedIp')), if (CacheMemcache::addServer(pSQL(Tools::getValue('memcachedIp')),
@@ -566,11 +566,11 @@ class AdminPerformanceControllerCore extends AdminController
(int)Tools::getValue('memcachedWeight'))) (int)Tools::getValue('memcachedWeight')))
Tools::redirectAdmin(self::$currentIndex.'&token='.Tools::getValue('token').'&conf=4'); Tools::redirectAdmin(self::$currentIndex.'&token='.Tools::getValue('token').'&conf=4');
else else
$this->errors[] = Tools::displayError('Cannot add Memcached server'); $this->errors[] = Tools::displayError('The Memcached server cannot be added.');
} }
} }
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.');
} }
if (Tools::getValue('deleteMemcachedServer')) if (Tools::getValue('deleteMemcachedServer'))
@@ -580,10 +580,10 @@ class AdminPerformanceControllerCore extends AdminController
if (CacheMemcache::deleteServer((int)Tools::getValue('deleteMemcachedServer'))) if (CacheMemcache::deleteServer((int)Tools::getValue('deleteMemcachedServer')))
Tools::redirectAdmin(self::$currentIndex.'&token='.Tools::getValue('token').'&conf=4'); Tools::redirectAdmin(self::$currentIndex.'&token='.Tools::getValue('token').'&conf=4');
else else
$this->errors[] = Tools::displayError('Error in deleting Memcached server'); $this->errors[] = Tools::displayError('There was an error when attempting to delete the Memcached server.');
} }
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.');
} }
$redirectAdmin = false; $redirectAdmin = false;
@@ -597,7 +597,7 @@ class AdminPerformanceControllerCore extends AdminController
$redirectAdmin = true; $redirectAdmin = true;
} }
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 ((bool)Tools::getValue('features_detachables_up')) if ((bool)Tools::getValue('features_detachables_up'))
@@ -610,7 +610,7 @@ class AdminPerformanceControllerCore extends AdminController
$redirectAdmin = true; $redirectAdmin = true;
} }
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 ((bool)Tools::getValue('ccc_up')) if ((bool)Tools::getValue('ccc_up'))
@@ -631,7 +631,7 @@ class AdminPerformanceControllerCore extends AdminController
} }
} }
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 ((bool)Tools::getValue('media_server_up')) if ((bool)Tools::getValue('media_server_up'))
@@ -663,7 +663,7 @@ class AdminPerformanceControllerCore extends AdminController
} }
} }
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 ((bool)Tools::getValue('ciphering_up') && Configuration::get('PS_CIPHER_ALGORITHM') != (int)Tools::getValue('PS_CIPHER_ALGORITHM')) if ((bool)Tools::getValue('ciphering_up') && Configuration::get('PS_CIPHER_ALGORITHM') != (int)Tools::getValue('PS_CIPHER_ALGORITHM'))
@@ -676,7 +676,7 @@ class AdminPerformanceControllerCore extends AdminController
if ($algo) if ($algo)
{ {
if (!function_exists('mcrypt_encrypt')) if (!function_exists('mcrypt_encrypt'))
$this->errors[] = Tools::displayError('PHP "Mcrypt" extension is not activated on this server.'); $this->errors[] = Tools::displayError('The PHP "Mcrypt" extension is not activated on this server.');
else else
{ {
if (!strstr($new_settings, '_RIJNDAEL_KEY_')) if (!strstr($new_settings, '_RIJNDAEL_KEY_'))
@@ -713,11 +713,11 @@ class AdminPerformanceControllerCore extends AdminController
$redirectAdmin = true; $redirectAdmin = true;
} }
else else
$this->errors[] = Tools::displayError('Cannot overwrite settings file.'); $this->errors[] = Tools::displayError('The settings file cannot be overwritten.');
} }
} }
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 ((bool)Tools::getValue('cache_up')) if ((bool)Tools::getValue('cache_up'))
@@ -732,7 +732,7 @@ class AdminPerformanceControllerCore extends AdminController
$cache_active = 1; $cache_active = 1;
if (!$caching_system = Tools::getValue('caching_system')) if (!$caching_system = Tools::getValue('caching_system'))
$this->errors[] = Tools::displayError('Caching system is missing'); $this->errors[] = Tools::displayError('The caching system is missing.');
else else
$new_settings = preg_replace( $new_settings = preg_replace(
'/define\(\'_PS_CACHING_SYSTEM_\', \'([a-z0-9=\/+-_]+)\'\);/Ui', '/define\(\'_PS_CACHING_SYSTEM_\', \'([a-z0-9=\/+-_]+)\'\);/Ui',
@@ -754,14 +754,14 @@ class AdminPerformanceControllerCore extends AdminController
<a href="http://xcache.lighttpd.net/wiki/XcacheIni">http://xcache.lighttpd.net/wiki/XcacheIni</a>'; <a href="http://xcache.lighttpd.net/wiki/XcacheIni">http://xcache.lighttpd.net/wiki/XcacheIni</a>';
elseif ($cache_active && $caching_system == 'CacheFs' && !is_writable(_PS_CACHEFS_DIRECTORY_)) elseif ($cache_active && $caching_system == 'CacheFs' && !is_writable(_PS_CACHEFS_DIRECTORY_))
$this->errors[] = sprintf( $this->errors[] = sprintf(
Tools::displayError('To use CacheFS the directory %s must be writable.'), Tools::displayError('To use CacheFS, the directory %s must be writable.'),
realpath(_PS_CACHEFS_DIRECTORY_) realpath(_PS_CACHEFS_DIRECTORY_)
); );
if ($caching_system == 'CacheFs' && $cache_active) if ($caching_system == 'CacheFs' && $cache_active)
{ {
if (!($depth = Tools::getValue('ps_cache_fs_directory_depth'))) if (!($depth = Tools::getValue('ps_cache_fs_directory_depth')))
$this->errors[] = Tools::displayError('Please set a directory depth'); $this->errors[] = Tools::displayError('Please set a directory depth.');
if (!count($this->errors)) if (!count($this->errors))
{ {
CacheFs::deleteCacheDirectory(); CacheFs::deleteCacheDirectory();
@@ -782,11 +782,11 @@ class AdminPerformanceControllerCore extends AdminController
)) ))
$redirectAdmin = true; $redirectAdmin = true;
else else
$this->errors[] = Tools::displayError('Cannot overwrite settings file.'); $this->errors[] = Tools::displayError('The settings file cannot be overwritten.');
} }
} }
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 ($redirectAdmin && (!isset($this->errors) || !count($this->errors))) if ($redirectAdmin && (!isset($this->errors) || !count($this->errors)))
{ {
+72 -72
View File
@@ -84,13 +84,13 @@ class AdminProductsControllerCore extends AdminController
'Seo' => $this->l('SEO'), 'Seo' => $this->l('SEO'),
'Images' => $this->l('Images'), 'Images' => $this->l('Images'),
'Associations' => $this->l('Associations'), 'Associations' => $this->l('Associations'),
'Shipping' => $this->l('Shipping:'), 'Shipping' => $this->l('Shipping'),
'Combinations' => $this->l('Combinations'), 'Combinations' => $this->l('Combinations'),
'Features' => $this->l('Features:'), 'Features' => $this->l('Features'),
'Customization' => $this->l('Customization'), 'Customization' => $this->l('Customization'),
'Attachments' => $this->l('Attachments'), 'Attachments' => $this->l('Attachments'),
'Quantities' => $this->l('Quantities'), 'Quantities' => $this->l('Quantities'),
'Suppliers' => $this->l('Suppliers:'), 'Suppliers' => $this->l('Suppliers'),
'Warehouses' => $this->l('Warehouses'), 'Warehouses' => $this->l('Warehouses'),
); );
@@ -440,12 +440,12 @@ class AdminProductsControllerCore extends AdminController
if (!Validate::isGenericName(Tools::getValue('attachment_name_'.(int)($language['id_lang'])))) if (!Validate::isGenericName(Tools::getValue('attachment_name_'.(int)($language['id_lang']))))
$this->errors[] = Tools::displayError('Invalid Name'); $this->errors[] = Tools::displayError('Invalid Name');
elseif (Tools::strlen(Tools::getValue('attachment_name_'.(int)($language['id_lang']))) > 32) elseif (Tools::strlen(Tools::getValue('attachment_name_'.(int)($language['id_lang']))) > 32)
$this->errors[] = sprintf(Tools::displayError('Name is too long (%d chars max).'), 32); $this->errors[] = sprintf(Tools::displayError('The name is too long (%d chars max).'), 32);
if (!Validate::isCleanHtml(Tools::getValue('attachment_description_'.(int)($language['id_lang'])))) if (!Validate::isCleanHtml(Tools::getValue('attachment_description_'.(int)($language['id_lang']))))
$this->errors[] = Tools::displayError('Invalid description'); $this->errors[] = Tools::displayError('Invalid description');
} }
if (!$is_attachment_name_valid) if (!$is_attachment_name_valid)
$this->errors[] = Tools::displayError('Attachment name required'); $this->errors[] = Tools::displayError('An attachment name is required.');
if (empty($this->errors)) if (empty($this->errors))
{ {
@@ -478,7 +478,7 @@ class AdminProductsControllerCore extends AdminController
); );
} }
else else
$this->errors[] = Tools::displayError('File is missing'); $this->errors[] = Tools::displayError('The file is missing.');
if (empty($this->errors) && isset($uniqid)) if (empty($this->errors) && isset($uniqid))
{ {
@@ -498,18 +498,18 @@ class AdminProductsControllerCore extends AdminController
if (!Validate::isGenericName($attachment->file_name)) if (!Validate::isGenericName($attachment->file_name))
$this->errors[] = Tools::displayError('Invalid file name'); $this->errors[] = Tools::displayError('Invalid file name');
if (Tools::strlen($attachment->file_name) > 128) if (Tools::strlen($attachment->file_name) > 128)
$this->errors[] = Tools::displayError('File name too long'); $this->errors[] = Tools::displayError('The file name is too long.');
if (empty($this->errors)) if (empty($this->errors))
{ {
$res = $attachment->add(); $res = $attachment->add();
if (!$res) if (!$res)
$this->errors[] = Tools::displayError('Unable to add this attachment in the database'); $this->errors[] = Tools::displayError('This attachment was unable to be loaded into the database.');
else else
{ {
$id_product = (int)Tools::getValue($this->identifier); $id_product = (int)Tools::getValue($this->identifier);
$res = $attachment->attachProduct($id_product); $res = $attachment->attachProduct($id_product);
if (!$res) if (!$res)
$this->errors[] = Tools::displayError('Unable to associate this attachment to product'); $this->errors[] = Tools::displayError('We were unable to associate this attachment to a product.');
} }
} }
else else
@@ -530,7 +530,7 @@ class AdminProductsControllerCore extends AdminController
$attachments = trim(Tools::getValue('arrayAttachments'), ','); $attachments = trim(Tools::getValue('arrayAttachments'), ',');
$attachments = explode(',', $attachments); $attachments = explode(',', $attachments);
if (!Attachment::attachToProduct($id, $attachments)) if (!Attachment::attachToProduct($id, $attachments))
$this->errors[] = Tools::displayError('There was an error while saving product attachments.'); $this->errors[] = Tools::displayError('An error occurred while saving product attachments.');
} }
} }
@@ -579,7 +579,7 @@ class AdminProductsControllerCore extends AdminController
} }
} }
else else
$this->errors[] = Tools::displayError('An error occurred while creating object.'); $this->errors[] = Tools::displayError('An error occurred while creating an object.');
} }
} }
@@ -604,7 +604,7 @@ class AdminProductsControllerCore extends AdminController
$physical_quantity = $stock_manager->getProductPhysicalQuantities($object->id, 0); $physical_quantity = $stock_manager->getProductPhysicalQuantities($object->id, 0);
$real_quantity = $stock_manager->getProductRealQuantities($object->id, 0); $real_quantity = $stock_manager->getProductRealQuantities($object->id, 0);
if ($physical_quantity > 0 || $real_quantity > $physical_quantity) if ($physical_quantity > 0 || $real_quantity > $physical_quantity)
$this->errors[] = Tools::displayError('You cannot delete the product because there is physical stock left or supply orders in progress.'); $this->errors[] = Tools::displayError('You cannot delete this product because there\'s physical stock left.');
} }
if (!count($this->errors)) if (!count($this->errors))
@@ -621,7 +621,7 @@ class AdminProductsControllerCore extends AdminController
} }
} }
else else
$this->errors[] = Tools::displayError('An error occurred while deleting object.').' <b>'.$this->table.'</b> '.Tools::displayError('(cannot load object)'); $this->errors[] = Tools::displayError('An error occurred while deleting the object.').' <b>'.$this->table.'</b> '.Tools::displayError('(cannot load object)');
} }
public function processImage() public function processImage()
@@ -646,7 +646,7 @@ class AdminProductsControllerCore extends AdminController
Image::deleteCover($image->id_product); Image::deleteCover($image->id_product);
$image->cover = 1; $image->cover = 1;
if (!$image->update()) if (!$image->update())
$this->errors[] = Tools::displayError('Cannot change the product cover image'); $this->errors[] = Tools::displayError('You cannot change the product\'s cover image.');
else else
{ {
$productId = (int)Tools::getValue('id_product'); $productId = (int)Tools::getValue('id_product');
@@ -664,7 +664,7 @@ class AdminProductsControllerCore extends AdminController
} }
} }
else else
$this->errors[] = Tools::displayError('Could not find image.'); $this->errors[] = Tools::displayError('The image could not be found. ');
} }
protected function processBulkDelete() protected function processBulkDelete()
@@ -706,7 +706,7 @@ class AdminProductsControllerCore extends AdminController
$physical_quantity = $stock_manager->getProductPhysicalQuantities($product->id, 0); $physical_quantity = $stock_manager->getProductPhysicalQuantities($product->id, 0);
$real_quantity = $stock_manager->getProductRealQuantities($product->id, 0); $real_quantity = $stock_manager->getProductRealQuantities($product->id, 0);
if ($physical_quantity > 0 || $real_quantity > $physical_quantity) if ($physical_quantity > 0 || $real_quantity > $physical_quantity)
$this->errors[] = sprintf(Tools::displayError('You cannot delete the product #%d because there is physical stock left or supply orders in progress.'), $product->id); $this->errors[] = sprintf(Tools::displayError('You cannot delete the product #%d because there is physical stock left.'), $product->id);
} }
if (!count($this->errors)) if (!count($this->errors))
$success &= $product->delete(); $success &= $product->delete();
@@ -720,7 +720,7 @@ class AdminProductsControllerCore extends AdminController
$this->redirect_after = self::$currentIndex.'&conf=2&token='.$this->token.$category_url; $this->redirect_after = self::$currentIndex.'&conf=2&token='.$this->token.$category_url;
} }
else else
$this->errors[] = Tools::displayError('An error occurred while deleting selection.'); $this->errors[] = Tools::displayError('An error occurred while deleting this selection.');
} }
} }
else else
@@ -739,7 +739,7 @@ class AdminProductsControllerCore extends AdminController
if (Validate::isLoadedObject($product = $this->object)) if (Validate::isLoadedObject($product = $this->object))
{ {
if ($this->isProductFieldUpdated('attribute_price') && (!Tools::getIsset('attribute_price') || Tools::getIsset('attribute_price') == null)) if ($this->isProductFieldUpdated('attribute_price') && (!Tools::getIsset('attribute_price') || Tools::getIsset('attribute_price') == null))
$this->errors[] = Tools::displayError('Attribute price required.'); $this->errors[] = Tools::displayError('The price attribute is required.');
if (!Tools::getIsset('attribute_combination_list') || Tools::isEmpty(Tools::getValue('attribute_combination_list'))) if (!Tools::getIsset('attribute_combination_list') || Tools::isEmpty(Tools::getValue('attribute_combination_list')))
$this->errors[] = Tools::displayError('You must add at least one attribute.'); $this->errors[] = Tools::displayError('You must add at least one attribute.');
@@ -781,7 +781,7 @@ class AdminProductsControllerCore extends AdminController
} }
} }
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.');
} }
// Add new // Add new
else else
@@ -813,7 +813,7 @@ class AdminProductsControllerCore extends AdminController
} }
} }
else else
$this->errors[] = Tools::displayError('You do not have permission to').'<hr>'.Tools::displayError('Edit here.'); $this->errors[] = Tools::displayError('You do not have permission to').'<hr>'.Tools::displayError('edit here.');
} }
if (!count($this->errors)) if (!count($this->errors))
{ {
@@ -869,7 +869,7 @@ class AdminProductsControllerCore extends AdminController
} }
} }
else else
$this->errors[] = Tools::displayError('Product must be created before adding features.'); $this->errors[] = Tools::displayError('A product must be created before adding features.');
} }
/** /**
@@ -965,12 +965,12 @@ class AdminProductsControllerCore extends AdminController
{ {
$id_specific_price = (int)Tools::getValue('id_specific_price'); $id_specific_price = (int)Tools::getValue('id_specific_price');
if (!$id_specific_price || !Validate::isUnsignedId($id_specific_price)) if (!$id_specific_price || !Validate::isUnsignedId($id_specific_price))
$error = Tools::displayError('Invalid specific price ID'); $error = Tools::displayError('The specific price ID is invalid.');
else else
{ {
$specificPrice = new SpecificPrice((int)$id_specific_price); $specificPrice = new SpecificPrice((int)$id_specific_price);
if (!$specificPrice->delete()) if (!$specificPrice->delete())
$error = Tools::displayError('An error occurred while deleting the specific price'); $error = Tools::displayError('An error occurred while attempting to delete the specific price.');
} }
} }
else else
@@ -995,7 +995,7 @@ class AdminProductsControllerCore extends AdminController
if (!($obj = $this->loadObject())) if (!($obj = $this->loadObject()))
return; return;
if (!$priorities = Tools::getValue('specificPricePriority')) if (!$priorities = Tools::getValue('specificPricePriority'))
$this->errors[] = Tools::displayError('Please specify priorities'); $this->errors[] = Tools::displayError('Please specify priorities.');
elseif (Tools::isSubmit('specificPricePriorityToAll')) elseif (Tools::isSubmit('specificPricePriorityToAll'))
{ {
if (!SpecificPrice::setPriorities($priorities)) if (!SpecificPrice::setPriorities($priorities))
@@ -1028,10 +1028,10 @@ class AdminProductsControllerCore extends AdminController
if (!$product->createLabels((int)$product->uploadable_files - $files_count, (int)$product->text_fields - $text_count)) if (!$product->createLabels((int)$product->uploadable_files - $files_count, (int)$product->text_fields - $text_count))
$this->errors[] = Tools::displayError('An error occurred while creating customization fields.'); $this->errors[] = Tools::displayError('An error occurred while creating customization fields.');
if (!count($this->errors) && !$product->updateLabels()) if (!count($this->errors) && !$product->updateLabels())
$this->errors[] = Tools::displayError('An error occurred while updating customization.'); $this->errors[] = Tools::displayError('An error occurred while updating customization fields.');
$product->customizable = ($product->uploadable_files > 0 || $product->text_fields > 0) ? 1 : 0; $product->customizable = ($product->uploadable_files > 0 || $product->text_fields > 0) ? 1 : 0;
if (!count($this->errors) && !$product->update()) if (!count($this->errors) && !$product->update())
$this->errors[] = Tools::displayError('An error occurred while updating customization configuration.'); $this->errors[] = Tools::displayError('An error occurred while updating the custom configuration.');
} }
public function processProductCustomization() public function processProductCustomization()
@@ -1040,14 +1040,14 @@ class AdminProductsControllerCore extends AdminController
{ {
foreach ($_POST as $field => $value) foreach ($_POST as $field => $value)
if (strncmp($field, 'label_', 6) == 0 && !Validate::isLabel($value)) if (strncmp($field, 'label_', 6) == 0 && !Validate::isLabel($value))
$this->errors[] = Tools::displayError('Label fields are invalid'); $this->errors[] = Tools::displayError('The label fields defined are invalid.');
if (empty($this->errors) && !$product->updateLabels()) if (empty($this->errors) && !$product->updateLabels())
$this->errors[] = Tools::displayError('An error occurred while updating customization.'); $this->errors[] = Tools::displayError('An error occurred while updating customization fields.');
if (empty($this->errors)) if (empty($this->errors))
$this->confirmations[] = $this->l('Update successful'); $this->confirmations[] = $this->l('Update successful');
} }
else else
$this->errors[] = Tools::displayError('Product must be created before adding customization possibilities.'); $this->errors[] = Tools::displayError('A product must be created before adding customization.');
} }
/** /**
@@ -1057,7 +1057,7 @@ class AdminProductsControllerCore extends AdminController
{ {
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')))
@@ -1079,7 +1079,7 @@ class AdminProductsControllerCore extends AdminController
if ($this->tabAccess['delete'] === '1') if ($this->tabAccess['delete'] === '1')
$this->action = 'deleteVirtualProduct'; $this->action = 'deleteVirtualProduct';
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.');
} }
// Product preview // Product preview
elseif (Tools::isSubmit('submitAddProductAndPreview')) elseif (Tools::isSubmit('submitAddProductAndPreview'))
@@ -1102,7 +1102,7 @@ class AdminProductsControllerCore extends AdminController
$this->display = 'edit'; $this->display = 'edit';
} }
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 (Tools::isSubmit('submitAttachments')) elseif (Tools::isSubmit('submitAttachments'))
{ {
@@ -1112,7 +1112,7 @@ class AdminProductsControllerCore extends AdminController
$this->tab_display = 'attachments'; $this->tab_display = 'attachments';
} }
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.');
} }
// Product duplication // Product duplication
elseif (Tools::getIsset('duplicate'.$this->table)) elseif (Tools::getIsset('duplicate'.$this->table))
@@ -1120,7 +1120,7 @@ class AdminProductsControllerCore extends AdminController
if ($this->tabAccess['add'] === '1') if ($this->tabAccess['add'] === '1')
$this->action = 'duplicate'; $this->action = 'duplicate';
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.');
} }
// Product images management // Product images management
elseif (Tools::getValue('id_image') && Tools::getValue('ajax')) elseif (Tools::getValue('id_image') && Tools::getValue('ajax'))
@@ -1128,7 +1128,7 @@ class AdminProductsControllerCore extends AdminController
if ($this->tabAccess['edit'] === '1') if ($this->tabAccess['edit'] === '1')
$this->action = 'image'; $this->action = 'image';
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.');
} }
// Product attributes management // Product attributes management
elseif (Tools::isSubmit('submitProductAttribute')) elseif (Tools::isSubmit('submitProductAttribute'))
@@ -1136,7 +1136,7 @@ class AdminProductsControllerCore extends AdminController
if ($this->tabAccess['edit'] === '1') if ($this->tabAccess['edit'] === '1')
$this->action = 'productAttribute'; $this->action = 'productAttribute';
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.');
} }
// Product features management // Product features management
elseif (Tools::isSubmit('submitFeatures') || Tools::isSubmit('submitFeaturesAndStay')) elseif (Tools::isSubmit('submitFeatures') || Tools::isSubmit('submitFeaturesAndStay'))
@@ -1144,7 +1144,7 @@ class AdminProductsControllerCore extends AdminController
if ($this->tabAccess['edit'] === '1') if ($this->tabAccess['edit'] === '1')
$this->action = 'features'; $this->action = 'features';
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.');
} }
// Product specific prices management NEVER USED // Product specific prices management NEVER USED
elseif (Tools::isSubmit('submitPricesModification')) elseif (Tools::isSubmit('submitPricesModification'))
@@ -1152,14 +1152,14 @@ class AdminProductsControllerCore extends AdminController
if ($this->tabAccess['add'] === '1') if ($this->tabAccess['add'] === '1')
$this->action = 'pricesModification'; $this->action = 'pricesModification';
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 (Tools::isSubmit('deleteSpecificPrice')) elseif (Tools::isSubmit('deleteSpecificPrice'))
{ {
if ($this->tabAccess['delete'] === '1') if ($this->tabAccess['delete'] === '1')
$this->action = 'deleteSpecificPrice'; $this->action = 'deleteSpecificPrice';
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('submitSpecificPricePriorities')) elseif (Tools::isSubmit('submitSpecificPricePriorities'))
{ {
@@ -1169,7 +1169,7 @@ class AdminProductsControllerCore extends AdminController
$this->tab_display = 'prices'; $this->tab_display = 'prices';
} }
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.');
} }
// Customization management // Customization management
elseif (Tools::isSubmit('submitCustomizationConfiguration')) elseif (Tools::isSubmit('submitCustomizationConfiguration'))
@@ -1181,7 +1181,7 @@ class AdminProductsControllerCore extends AdminController
$this->display = 'edit'; $this->display = 'edit';
} }
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('submitProductCustomization')) elseif (Tools::isSubmit('submitProductCustomization'))
{ {
@@ -1192,7 +1192,7 @@ class AdminProductsControllerCore extends AdminController
$this->display = 'edit'; $this->display = 'edit';
} }
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 (!$this->action) if (!$this->action)
@@ -1440,7 +1440,7 @@ class AdminProductsControllerCore extends AdminController
if ($res) if ($res)
$this->jsonConfirmation($this->_conf[27]); $this->jsonConfirmation($this->_conf[27]);
else else
$this->jsonError(Tools::displayError('Error on picture shop association')); $this->jsonError(Tools::displayError('An error occurred while attempting to associate this image with your shop. '));
} }
public function ajaxProcessUpdateImagePosition() public function ajaxProcessUpdateImagePosition()
@@ -1461,7 +1461,7 @@ class AdminProductsControllerCore extends AdminController
if ($res) if ($res)
$this->jsonConfirmation($this->_conf[25]); $this->jsonConfirmation($this->_conf[25]);
else else
$this->jsonError(Tools::displayError('Error on moving picture')); $this->jsonError(Tools::displayError('An error occurred while attempting to move this picture.'));
} }
public function ajaxProcessUpdateCover() public function ajaxProcessUpdateCover()
@@ -1476,7 +1476,7 @@ class AdminProductsControllerCore extends AdminController
if ($img->update()) if ($img->update())
$this->jsonConfirmation($this->_conf[26]); $this->jsonConfirmation($this->_conf[26]);
else else
$this->jsonError(Tools::displayError('Error on moving picture')); $this->jsonError(Tools::displayError('An error occurred while attempting to move this picture.'));
} }
public function ajaxProcessDeleteProductImage() public function ajaxProcessDeleteProductImage()
@@ -1513,7 +1513,7 @@ class AdminProductsControllerCore extends AdminController
if ($res) if ($res)
$this->jsonConfirmation($this->_conf[7]); $this->jsonConfirmation($this->_conf[7]);
else else
$this->jsonError(Tools::displayError('Error on deleting product image')); $this->jsonError(Tools::displayError('An error occurred while attempting to delete the product image.'));
} }
protected function _validateSpecificPrice($id_shop, $id_currency, $id_country, $id_group, $id_customer, $price, $from_quantity, $reduction, $reduction_type, $from, $to, $id_combination = 0) protected function _validateSpecificPrice($id_shop, $id_currency, $id_country, $id_group, $id_customer, $price, $from_quantity, $reduction, $reduction_type, $from, $to, $id_combination = 0)
@@ -1525,11 +1525,11 @@ class AdminProductsControllerCore extends AdminController
elseif (!Validate::isUnsignedInt($from_quantity)) elseif (!Validate::isUnsignedInt($from_quantity))
$this->errors[] = Tools::displayError('Invalid quantity'); $this->errors[] = Tools::displayError('Invalid quantity');
elseif ($reduction && !Validate::isReductionType($reduction_type)) elseif ($reduction && !Validate::isReductionType($reduction_type))
$this->errors[] = Tools::displayError('Please select a discount type (amount or percentage)'); $this->errors[] = Tools::displayError('Please select a discount type (amount or percentage).');
elseif ($from && $to && (!Validate::isDateFormat($from) || !Validate::isDateFormat($to))) elseif ($from && $to && (!Validate::isDateFormat($from) || !Validate::isDateFormat($to)))
$this->errors[] = Tools::displayError('Wrong from/to date'); $this->errors[] = Tools::displayError('The from/to date is invalid.');
elseif (SpecificPrice::exists((int)$this->object->id, $id_combination, $id_shop, $id_group, $id_country, $id_currency, $id_customer, $from_quantity, $from, $to, false)) elseif (SpecificPrice::exists((int)$this->object->id, $id_combination, $id_shop, $id_group, $id_country, $id_currency, $id_customer, $from_quantity, $from, $to, false))
$this->errors[] = Tools::displayError('A specific price already exists for these parameters'); $this->errors[] = Tools::displayError('A specific price already exists for these parameters.');
else else
return true; return true;
return false; return false;
@@ -1553,7 +1553,7 @@ class AdminProductsControllerCore extends AdminController
); );
elseif (!call_user_func(array('Validate', $rules['validateLang']['value']), $val)) elseif (!call_user_func(array('Validate', $rules['validateLang']['value']), $val))
$this->errors[] = sprintf( $this->errors[] = sprintf(
Tools::displayError('Valid name required for feature. %1$s in %2$s.'), Tools::displayError('A valid name required for feature. %1$s in %2$s.'),
' <b>'.$feature['name'].'</b>', ' <b>'.$feature['name'].'</b>',
$current_language->name $current_language->name
); );
@@ -1578,7 +1578,7 @@ class AdminProductsControllerCore extends AdminController
{ {
$image = new Image((int)$id_image); $image = new Image((int)$id_image);
if (!Validate::isLoadedObject($image)) if (!Validate::isLoadedObject($image))
$this->errors[] = Tools::displayError('An error occurred while loading object image.'); $this->errors[] = Tools::displayError('An error occurred while loading the object image.');
else else
{ {
if (($cover = Tools::getValue('cover')) == 1) if (($cover = Tools::getValue('cover')) == 1)
@@ -1587,7 +1587,7 @@ class AdminProductsControllerCore extends AdminController
$this->validateRules('Image'); $this->validateRules('Image');
$this->copyFromPost($image, 'image'); $this->copyFromPost($image, 'image');
if (count($this->errors) || !$image->update()) if (count($this->errors) || !$image->update())
$this->errors[] = Tools::displayError('An error occurred while updating image.'); $this->errors[] = Tools::displayError('An error occurred while updating the image.');
elseif (isset($_FILES['image_product']['tmp_name']) && $_FILES['image_product']['tmp_name'] != null) elseif (isset($_FILES['image_product']['tmp_name']) && $_FILES['image_product']['tmp_name'] != null)
$this->copyImage($product->id, $image->id, $method); $this->copyImage($product->id, $image->id, $method);
} }
@@ -1617,11 +1617,11 @@ class AdminProductsControllerCore extends AdminController
$image = new Image($id_image); $image = new Image($id_image);
if (!$new_path = $image->getPathForCreation()) if (!$new_path = $image->getPathForCreation())
$this->errors[] = Tools::displayError('An error occurred during new folder creation'); $this->errors[] = Tools::displayError('An error occurred while attempting to create a new folder.');
if (!($tmpName = tempnam(_PS_TMP_IMG_DIR_, 'PS')) || !move_uploaded_file($_FILES['image_product']['tmp_name'], $tmpName)) if (!($tmpName = tempnam(_PS_TMP_IMG_DIR_, 'PS')) || !move_uploaded_file($_FILES['image_product']['tmp_name'], $tmpName))
$this->errors[] = Tools::displayError('An error occurred during the image upload'); $this->errors[] = Tools::displayError('An error occurred during the image upload process.');
elseif (!ImageManager::resize($tmpName, $new_path.'.'.$image->image_format)) elseif (!ImageManager::resize($tmpName, $new_path.'.'.$image->image_format))
$this->errors[] = Tools::displayError('An error occurred while copying image.'); $this->errors[] = Tools::displayError('An error occurred while copying the image.');
elseif ($method == 'auto') elseif ($method == 'auto')
{ {
$imagesTypes = ImageType::getImagesTypes('products'); $imagesTypes = ImageType::getImagesTypes('products');
@@ -1668,7 +1668,7 @@ class AdminProductsControllerCore extends AdminController
{ {
$languages = Language::getLanguages(false); $languages = Language::getLanguages(false);
if ($this->isProductFieldUpdated('category_box') && !$this->object->updateCategories(Tools::getValue('categoryBox'))) if ($this->isProductFieldUpdated('category_box') && !$this->object->updateCategories(Tools::getValue('categoryBox')))
$this->errors[] = Tools::displayError('An error occurred while linking object.').' <b>'.$this->table.'</b> '.Tools::displayError('To categories'); $this->errors[] = Tools::displayError('An error occurred while linking the object.').' <b>'.$this->table.'</b> '.Tools::displayError('To categories');
elseif (!$this->updateTags($languages, $this->object)) elseif (!$this->updateTags($languages, $this->object))
$this->errors[] = Tools::displayError('An error occurred while adding tags.'); $this->errors[] = Tools::displayError('An error occurred while adding tags.');
else else
@@ -1719,7 +1719,7 @@ class AdminProductsControllerCore extends AdminController
$this->display = 'edit'; $this->display = 'edit';
} }
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>';
return $this->object; return $this->object;
} }
@@ -1807,7 +1807,7 @@ class AdminProductsControllerCore extends AdminController
$this->updateTags(Language::getLanguages(false), $object); $this->updateTags(Language::getLanguages(false), $object);
if ($this->isProductFieldUpdated('category_box') && !$object->updateCategories(Tools::getValue('categoryBox'))) if ($this->isProductFieldUpdated('category_box') && !$object->updateCategories(Tools::getValue('categoryBox')))
$this->errors[] = Tools::displayError('An error occurred while linking object.').' <b>'.$this->table.'</b> '.Tools::displayError('To categories'); $this->errors[] = Tools::displayError('An error occurred while linking the object.').' <b>'.$this->table.'</b> '.Tools::displayError('To categories');
} }
if ($this->isTabSubmitted('Warehouses')) if ($this->isTabSubmitted('Warehouses'))
@@ -1865,10 +1865,10 @@ class AdminProductsControllerCore extends AdminController
$this->display = 'edit'; $this->display = 'edit';
} }
else else
$this->errors[] = Tools::displayError('An error occurred while updating object.').' <b>'.$this->table.'</b> ('.Db::getInstance()->getMsgError().')'; $this->errors[] = Tools::displayError('An error occurred while updating an object.').' <b>'.$this->table.'</b> ('.Db::getInstance()->getMsgError().')';
} }
else else
$this->errors[] = Tools::displayError('An error occurred while updating object.').' <b>'.$this->table.'</b> ('.Tools::displayError('Cannot load object').')'; $this->errors[] = Tools::displayError('An error occurred while updating an object.').' <b>'.$this->table.'</b> ('.Tools::displayError('The object cannot be loaded. ').')';
return $object; return $object;
} }
} }
@@ -1895,7 +1895,7 @@ class AdminProductsControllerCore extends AdminController
if (Tools::getValue('id_'.$this->table) && $field == 'passwd') if (Tools::getValue('id_'.$this->table) && $field == 'passwd')
continue; continue;
$this->errors[] = sprintf( $this->errors[] = sprintf(
Tools::displayError('The field %s is required.'), Tools::displayError('The %s field is required.'),
call_user_func(array($className, 'displayFieldName'), $field, $className) call_user_func(array($className, 'displayFieldName'), $field, $className)
); );
} }
@@ -1905,7 +1905,7 @@ class AdminProductsControllerCore extends AdminController
foreach ($rules['requiredLang'] as $fieldLang) foreach ($rules['requiredLang'] as $fieldLang)
if ($this->isProductFieldUpdated($fieldLang, $default_language->id) && !Tools::getValue($fieldLang.'_'.$default_language->id)) if ($this->isProductFieldUpdated($fieldLang, $default_language->id) && !Tools::getValue($fieldLang.'_'.$default_language->id))
$this->errors[] = sprintf( $this->errors[] = sprintf(
Tools::displayError('This field %1$s is required at least in %2$s'), Tools::displayError('This %1$s field is required at least in %2$s'),
call_user_func(array($className, 'displayFieldName'), $fieldLang, $className), call_user_func(array($className, 'displayFieldName'), $fieldLang, $className),
$default_language->name $default_language->name
); );
@@ -1914,7 +1914,7 @@ class AdminProductsControllerCore extends AdminController
foreach ($rules['size'] as $field => $maxLength) foreach ($rules['size'] as $field => $maxLength)
if ($this->isProductFieldUpdated($field) && ($value = Tools::getValue($field)) && Tools::strlen($value) > $maxLength) if ($this->isProductFieldUpdated($field) && ($value = Tools::getValue($field)) && Tools::strlen($value) > $maxLength)
$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($className, 'displayFieldName'), $field, $className), call_user_func(array($className, 'displayFieldName'), $field, $className),
$maxLength $maxLength
); );
@@ -1932,7 +1932,7 @@ class AdminProductsControllerCore extends AdminController
if ($this->isProductFieldUpdated('description_short', $language['id_lang']) && ($value = Tools::getValue('description_short_'.$language['id_lang']))) if ($this->isProductFieldUpdated('description_short', $language['id_lang']) && ($value = Tools::getValue('description_short_'.$language['id_lang'])))
if (Tools::strlen(strip_tags($value)) > $limit) if (Tools::strlen(strip_tags($value)) > $limit)
$this->errors[] = sprintf( $this->errors[] = sprintf(
Tools::displayError('This field %1$s (%2$s) is too long: %3$d chars max (count now %4$d).'), Tools::displayError('This %1$s field (%2$s) is too long: %3$d chars max (current count %4$d).'),
call_user_func(array($className, 'displayFieldName'), 'description_short'), call_user_func(array($className, 'displayFieldName'), 'description_short'),
$language['name'], $language['name'],
$limit, $limit,
@@ -1946,7 +1946,7 @@ class AdminProductsControllerCore extends AdminController
$value = Tools::getValue($fieldLang.'_'.$language['id_lang']); $value = Tools::getValue($fieldLang.'_'.$language['id_lang']);
if ($value && Tools::strlen($value) > $maxLength) if ($value && Tools::strlen($value) > $maxLength)
$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($className, 'displayFieldName'), $fieldLang, $className), call_user_func(array($className, 'displayFieldName'), $fieldLang, $className),
$maxLength $maxLength
); );
@@ -1960,7 +1960,7 @@ class AdminProductsControllerCore extends AdminController
if ($this->isProductFieldUpdated($field) && ($value = Tools::getValue($field))) if ($this->isProductFieldUpdated($field) && ($value = Tools::getValue($field)))
if (!Validate::$function($value)) if (!Validate::$function($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($className, 'displayFieldName'), $field, $className) call_user_func(array($className, 'displayFieldName'), $field, $className)
); );
@@ -1970,7 +1970,7 @@ class AdminProductsControllerCore extends AdminController
if ($this->isProductFieldUpdated('description_short', $language['id_lang']) && ($value = Tools::getValue($fieldLang.'_'.$language['id_lang']))) if ($this->isProductFieldUpdated('description_short', $language['id_lang']) && ($value = Tools::getValue($fieldLang.'_'.$language['id_lang'])))
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($className, 'displayFieldName'), $fieldLang, $className), call_user_func(array($className, 'displayFieldName'), $fieldLang, $className),
$language['name'] $language['name']
); );
@@ -1987,7 +1987,7 @@ class AdminProductsControllerCore extends AdminController
if ($value = Tools::getValue('tags_'.$language['id_lang'])) if ($value = Tools::getValue('tags_'.$language['id_lang']))
if (!Validate::isTagsList($value)) if (!Validate::isTagsList($value))
$this->errors[] = sprintf( $this->errors[] = sprintf(
Tools::displayError('Tags list (%s) is invalid'), Tools::displayError('The tags list (%s) is invalid.'),
$language['name'] $language['name']
); );
} }
@@ -2047,7 +2047,7 @@ class AdminProductsControllerCore extends AdminController
{ {
if (!Tools::getValue('virtual_product_expiration_date')) if (!Tools::getValue('virtual_product_expiration_date'))
{ {
$this->errors[] = Tools::displayError('This field expiration date attribute is required.'); $this->errors[] = Tools::displayError('The expiration-date attribute is required.');
return false; return false;
} }
} }
@@ -2142,7 +2142,7 @@ class AdminProductsControllerCore extends AdminController
$tag_success = true; $tag_success = true;
/* Reset all tags for THIS product */ /* Reset all tags for THIS product */
if (!Tag::deleteTagsForProduct((int)$product->id)) if (!Tag::deleteTagsForProduct((int)$product->id))
$this->errors[] = Tools::displayError('An error occurred while deleting previous tags.'); $this->errors[] = Tools::displayError('An error occurred while attempting to delete previous tags.');
/* Assign tags to this product */ /* Assign tags to this product */
foreach ($languages as $language) foreach ($languages as $language)
if ($value = Tools::getValue('tags_'.$language['id_lang'])) if ($value = Tools::getValue('tags_'.$language['id_lang']))
@@ -3046,7 +3046,7 @@ class AdminProductsControllerCore extends AdminController
if (!file_exists($exists_file) if (!file_exists($exists_file)
&& !empty($product->productDownload->display_filename) && !empty($product->productDownload->display_filename)
&& empty($product->cache_default_attribute)) && empty($product->cache_default_attribute))
$msg = sprintf(Tools::displayError('This file "%s" is missing'), $product->productDownload->display_filename); $msg = sprintf(Tools::displayError('This file "%s" is missing.'), $product->productDownload->display_filename);
else else
$msg = ''; $msg = '';
@@ -4213,7 +4213,7 @@ class AdminProductsControllerCore extends AdminController
if (Pack::isPack((int)$item_id)) if (Pack::isPack((int)$item_id))
$this->errors[] = Tools::displayError('You can\'t add product packs into a pack'); $this->errors[] = Tools::displayError('You can\'t add product packs into a pack');
elseif (!Pack::addItem((int)$product->id, (int)$item_id, (int)$qty)) elseif (!Pack::addItem((int)$product->id, (int)$item_id, (int)$qty))
$this->errors[] = Tools::displayError('An error occurred while adding products to the pack.'); $this->errors[] = Tools::displayError('An error occurred while attempting to add products to the pack.');
} }
} }
} }
@@ -124,9 +124,9 @@ class AdminRangePriceControllerCore extends AdminController
if (Tools::getValue('delimiter1') >= Tools::getValue('delimiter2')) if (Tools::getValue('delimiter1') >= Tools::getValue('delimiter2'))
$this->errors[] = Tools::displayError('Invalid range'); $this->errors[] = Tools::displayError('Invalid range');
else if (!$id && RangePrice::rangeExist((int)Tools::getValue('id_carrier'), (float)Tools::getValue('delimiter1'), (float)Tools::getValue('delimiter2'))) else if (!$id && RangePrice::rangeExist((int)Tools::getValue('id_carrier'), (float)Tools::getValue('delimiter1'), (float)Tools::getValue('delimiter2')))
$this->errors[] = Tools::displayError('Range already exists'); $this->errors[] = Tools::displayError('The range already exists');
else if (RangePrice::isOverlapping((int)Tools::getValue('id_carrier'), (float)Tools::getValue('delimiter1'), (float)Tools::getValue('delimiter2'), ($id ? (int)$id : null))) else if (RangePrice::isOverlapping((int)Tools::getValue('id_carrier'), (float)Tools::getValue('delimiter1'), (float)Tools::getValue('delimiter2'), ($id ? (int)$id : null)))
$this->errors[] = Tools::displayError('Ranges are overlapping'); $this->errors[] = Tools::displayError('Error: Ranges are overlapping');
else if (!count($this->errors)) else if (!count($this->errors))
parent::postProcess(); parent::postProcess();
} }
@@ -121,9 +121,9 @@ class AdminRangeWeightControllerCore extends AdminController
if (Tools::getValue('delimiter1') >= Tools::getValue('delimiter2')) if (Tools::getValue('delimiter1') >= Tools::getValue('delimiter2'))
$this->errors[] = Tools::displayError('Invalid range'); $this->errors[] = Tools::displayError('Invalid range');
else if (!$id && RangeWeight::rangeExist((int)Tools::getValue('id_carrier'), (float)Tools::getValue('delimiter1'), (float)Tools::getValue('delimiter2'))) else if (!$id && RangeWeight::rangeExist((int)Tools::getValue('id_carrier'), (float)Tools::getValue('delimiter1'), (float)Tools::getValue('delimiter2')))
$this->errors[] = Tools::displayError('Range already exists'); $this->errors[] = Tools::displayError('The range already exists');
else if (RangeWeight::isOverlapping((int)Tools::getValue('id_carrier'), (float)Tools::getValue('delimiter1'), (float)Tools::getValue('delimiter2'), ($id ? (int)$id : null))) else if (RangeWeight::isOverlapping((int)Tools::getValue('id_carrier'), (float)Tools::getValue('delimiter1'), (float)Tools::getValue('delimiter2'), ($id ? (int)$id : null)))
$this->errors[] = Tools::displayError('Ranges are overlapping'); $this->errors[] = Tools::displayError('Error: Ranges are overlapping');
else if (!count($this->errors)) else if (!count($this->errors))
parent::postProcess(); parent::postProcess();
} }
@@ -386,7 +386,7 @@ class AdminRequestSqlControllerCore extends AdminController
case 'checkedWhere': case 'checkedWhere':
if (isset($e[$key]['operator'])) if (isset($e[$key]['operator']))
$this->errors[] = sprintf(Tools::displayError('The operator "%s" used is incorrect.'), $e[$key]['operator']); $this->errors[] = sprintf(Tools::displayError('The operator "%s" is incorrect.'), $e[$key]['operator']);
else if (isset($e[$key]['attribut'])) else if (isset($e[$key]['attribut']))
$this->errors[] = sprintf( $this->errors[] = sprintf(
Tools::displayError('The attribute "%1$s" does not exist in the table: %2$s.'), Tools::displayError('The attribute "%1$s" does not exist in the table: %2$s.'),
@@ -399,7 +399,7 @@ class AdminRequestSqlControllerCore extends AdminController
case 'checkedHaving': case 'checkedHaving':
if (isset($e[$key]['operator'])) if (isset($e[$key]['operator']))
$this->errors[] = sprintf(Tools::displayError('The operator "%s" used is incorrect.'), $e[$key]['operator']); $this->errors[] = sprintf(Tools::displayError('The operator "%s" is incorrect.'), $e[$key]['operator']);
else if (isset($e[$key]['attribut'])) else if (isset($e[$key]['attribut']))
$this->errors[] = sprintf( $this->errors[] = sprintf(
Tools::displayError('The attribute "%1$s" does not exist in the table: %2$s.'), Tools::displayError('The attribute "%1$s" does not exist in the table: %2$s.'),
@@ -444,7 +444,7 @@ class AdminRequestSqlControllerCore extends AdminController
$e[$key]['attribut'][1] $e[$key]['attribut'][1]
); );
else else
$this->errors[] = Tools::displayError('When multiple tables are used, each attribute must refer to a table.'); $this->errors[] = Tools::displayError('When multiple tables are used, each attribute must refer back to a table.');
break; break;
case 'testedRequired': case 'testedRequired':
@@ -452,7 +452,7 @@ class AdminRequestSqlControllerCore extends AdminController
break; break;
case 'testedUnauthorized': case 'testedUnauthorized':
$this->errors[] = sprintf(Tools::displayError('is an unauthorized keyword.'), $e[$key]); $this->errors[] = sprintf(Tools::displayError('Is an unauthorized keyword.'), $e[$key]);
break; break;
} }
} }
+6 -6
View File
@@ -95,7 +95,7 @@ class AdminReturnControllerCore extends AdminController
), ),
array( array(
'type' => 'select', 'type' => 'select',
'label' => $this->l('Status:'), 'label' => $this->l('Status'),
'name' => 'state', 'name' => 'state',
'required' => false, 'required' => false,
'options' => array( 'options' => array(
@@ -107,7 +107,7 @@ class AdminReturnControllerCore extends AdminController
), ),
array( array(
'type' => 'list_products', 'type' => 'list_products',
'label' => $this->l('Products:'), 'label' => $this->l('Products'),
'name' => '', 'name' => '',
'size' => '', 'size' => '',
'required' => false, 'required' => false,
@@ -184,7 +184,7 @@ class AdminReturnControllerCore extends AdminController
if (OrderReturn::deleteOrderReturnDetail($id_order_return, $id_order_detail, (int)(Tools::getValue('id_customization', 0)))) if (OrderReturn::deleteOrderReturnDetail($id_order_return, $id_order_detail, (int)(Tools::getValue('id_customization', 0))))
Tools::redirectAdmin(self::$currentIndex.'&conf=4token='.$this->token); Tools::redirectAdmin(self::$currentIndex.'&conf=4token='.$this->token);
else else
$this->errors[] = Tools::displayError('An error occurred while deleting details of your order return.'); $this->errors[] = Tools::displayError('An error occurred while deleting the details of your order return.');
} }
else else
$this->errors[] = Tools::displayError('You need at least one product.'); $this->errors[] = Tools::displayError('You need at least one product.');
@@ -196,7 +196,7 @@ class AdminReturnControllerCore extends AdminController
$this->errors[] = Tools::displayError('The order return content is invalid.'); $this->errors[] = Tools::displayError('The order return content is invalid.');
} }
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('submitAddorder_return') || Tools::isSubmit('submitAddorder_returnAndStay')) elseif (Tools::isSubmit('submitAddorder_return') || Tools::isSubmit('submitAddorder_returnAndStay'))
{ {
@@ -227,10 +227,10 @@ class AdminReturnControllerCore extends AdminController
} }
} }
else else
$this->errors[] = Tools::displayError('No order return ID.'); $this->errors[] = Tools::displayError('No order return ID has been specified.');
} }
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::postProcess(); parent::postProcess();
} }
+9 -9
View File
@@ -196,10 +196,10 @@ class AdminScenesControllerCore extends AdminController
$image_to_map_desc = ''; $image_to_map_desc = '';
$image_to_map_desc .= $this->l('Format:').' JPG, GIF, PNG. '.$this->l('File size:').' ' $image_to_map_desc .= $this->l('Format:').' JPG, GIF, PNG. '.$this->l('File size:').' '
.(Tools::getMaxUploadSize() / 1024).''.$this->l('kB max.').' ' .(Tools::getMaxUploadSize() / 1024).''.$this->l('Kb max.').' '
.sprintf($this->l('If larger than the image size setting, the image will be reduced to %1$d x %2$dpx (width x height).'), .sprintf($this->l('If an image is too large, it will be reduced to %1$d x %2$dpx (width x height).'),
$large_scene_image_type['width'], $large_scene_image_type['height']) $large_scene_image_type['width'], $large_scene_image_type['height'])
.$this->l('If smaller than the image size setting, a white background will be added in order to achieve the correct image size.').'<br />'. .$this->l('If an image is deemed too small, a white background will be added in order to achieve the correct image size.').'<br />'.
$this->l('Note: To change image dimensions, please change the \'large_scene\' image type settings to the desired size (in Back Office > Preferences > Images).'); $this->l('Note: To change image dimensions, please change the \'large_scene\' image type settings to the desired size (in Back Office > Preferences > Images).');
if ($obj->id && file_exists(_PS_SCENE_IMG_DIR_.$obj->id.'-scene_default.jpg')) if ($obj->id && file_exists(_PS_SCENE_IMG_DIR_.$obj->id.'-scene_default.jpg'))
{ {
@@ -211,7 +211,7 @@ class AdminScenesControllerCore extends AdminController
$image_to_map_desc .= ' $image_to_map_desc .= '
<div id="ajax_choose_product" style="display:none; padding:6px; padding-top:2px; width:600px;"> <div id="ajax_choose_product" style="display:none; padding:6px; padding-top:2px; width:600px;">
'.$this->l('Begin typing the first letters of the product name, then select the product from the drop-down list:').' '.$this->l('Begin typing the first few letters of the product name, then select the product you are looking for from the drop-down list:').'
<br /><input type="text" value="" id="product_autocomplete_input" /> <br /><input type="text" value="" id="product_autocomplete_input" />
<input type="button" class="button" value="'.$this->l('OK').'" onclick="$(this).prev().search();" /> <input type="button" class="button" value="'.$this->l('OK').'" onclick="$(this).prev().search();" />
<input type="button" class="button" value="'.$this->l('Delete').'" onclick="undoEdit();" /> <input type="button" class="button" value="'.$this->l('Delete').'" onclick="undoEdit();" />
@@ -226,7 +226,7 @@ class AdminScenesControllerCore extends AdminController
$img_alt_desc = ''; $img_alt_desc = '';
$img_alt_desc .= $this->l('If you want to use a thumbnail other than one generated from simply reducing the mapped image, please upload it here.') $img_alt_desc .= $this->l('If you want to use a thumbnail other than one generated from simply reducing the mapped image, please upload it here.')
.'<br />'.$this->l('Format:').' JPG, GIF, PNG. ' .'<br />'.$this->l('Format:').' JPG, GIF, PNG. '
.$this->l('Filesize:').' '.(Tools::getMaxUploadSize() / 1024).''.$this->l('kB max.').' ' .$this->l('File size:').' '.(Tools::getMaxUploadSize() / 1024).''.$this->l('Kb max.').' '
.sprintf($this->l('Automatically resized to %1$d x %2$dpx (width x height).'), .sprintf($this->l('Automatically resized to %1$d x %2$dpx (width x height).'),
$thumb_scene_image_type['width'], $thumb_scene_image_type['height']).'.<br />' $thumb_scene_image_type['width'], $thumb_scene_image_type['height']).'.<br />'
.$this->l('Note: To change image dimensions, please change the \'thumb_scene\' image type settings to the desired size (in Back Office > Preferences > Images).'); .$this->l('Note: To change image dimensions, please change the \'thumb_scene\' image type settings to the desired size (in Back Office > Preferences > Images).');
@@ -255,7 +255,7 @@ class AdminScenesControllerCore extends AdminController
$root_category = array('id_category' => (int)$root_category->id, 'name' => $root_category->name); $root_category = array('id_category' => (int)$root_category->id, 'name' => $root_category->name);
$trads = array( $trads = array(
'Root' => $root_category, 'Root' => $root_category,
'selected' => $this->l('selected'), 'selected' => $this->l('Selected'),
'Check all' => $this->l('Check all'), 'Check all' => $this->l('Check all'),
'Check All' => $this->l('Check All'), 'Check All' => $this->l('Check All'),
'Uncheck All' => $this->l('Uncheck All'), 'Uncheck All' => $this->l('Uncheck All'),
@@ -266,7 +266,7 @@ class AdminScenesControllerCore extends AdminController
); );
$this->fields_form['input'][] = array( $this->fields_form['input'][] = array(
'type' => 'categories', 'type' => 'categories',
'label' => $this->l('Categories:'), 'label' => $this->l('Categories'),
'name' => 'categories', 'name' => 'categories',
'values' => array('trads' => $trads, 'values' => array('trads' => $trads,
'selected_cat' => $selected_cat, 'selected_cat' => $selected_cat,
@@ -308,9 +308,9 @@ class AdminScenesControllerCore extends AdminController
if (Tools::isSubmit('save_image_map')) if (Tools::isSubmit('save_image_map'))
{ {
if (!Tools::isSubmit('categories') || !count(Tools::getValue('categories'))) if (!Tools::isSubmit('categories') || !count(Tools::getValue('categories')))
$this->errors[] = Tools::displayError('You should select at least one category'); $this->errors[] = Tools::displayError('You should select at least one category.');
if (!Tools::isSubmit('zones') || !count(Tools::getValue('zones'))) if (!Tools::isSubmit('zones') || !count(Tools::getValue('zones')))
$this->errors[] = Tools::displayError('You should make at least one zone'); $this->errors[] = Tools::displayError('You should create at least one zone.');
} }
parent::postProcess(); parent::postProcess();
@@ -47,7 +47,7 @@ class AdminSearchConfControllerCore extends AdminController
$this->fields_list = array( $this->fields_list = array(
'alias' => array('title' => $this->l('Aliases'), 'width' => 'auto'), 'alias' => array('title' => $this->l('Aliases'), 'width' => 'auto'),
'search' => array('title' => $this->l('Search:'), 'width' => 100), 'search' => array('title' => $this->l('Search'), 'width' => 100),
'active' => array('title' => $this->l('Status'), 'width' => 25, 'align' => 'center', 'active' => 'status', 'type' => 'bool', 'orderby' => false) 'active' => array('title' => $this->l('Status'), 'width' => 25, 'align' => 'center', 'active' => 'status', 'type' => 'bool', 'orderby' => false)
); );
@@ -64,7 +64,7 @@ class AdminSearchConfControllerCore extends AdminController
'icon' => 'search', 'icon' => 'search',
'info' => 'info' =>
$this->l('The "indexed" products have been analyzed by PrestaShop and will appear in the results of a Front Office search.').'<br /> $this->l('The "indexed" products have been analyzed by PrestaShop and will appear in the results of a Front Office search.').'<br />
'.$this->l('Indexed products:').' <b>'.(int)$indexed.' / '.(int)$total.'</b>. '.$this->l('Indexed products').' <b>'.(int)$indexed.' / '.(int)$total.'</b>.
</p> </p>
<p>'.$this->l('Building the product index may take a few minutes.') <p>'.$this->l('Building the product index may take a few minutes.')
.$this->l('If your server stops before the process ends, you can resume the indexation by clicking "Add missing products."').'</p> .$this->l('If your server stops before the process ends, you can resume the indexation by clicking "Add missing products."').'</p>
@@ -84,7 +84,7 @@ class AdminSearchConfControllerCore extends AdminController
) )
), ),
'search' => array( 'search' => array(
'title' => $this->l('Search:'), 'title' => $this->l('Search'),
'icon' => 'search', 'icon' => 'search',
'fields' => array( 'fields' => array(
'PS_SEARCH_AJAX' => array( 'PS_SEARCH_AJAX' => array(
@@ -99,7 +99,7 @@ class AdminSearchConfControllerCore extends AdminController
'validation' => 'isBool', 'validation' => 'isBool',
'cast' => 'intval', 'cast' => 'intval',
'type' => 'bool', 'type' => 'bool',
'desc' => $this->l('Enable instant search for your visitors.').'<br />'. 'desc' => $this->l('Enable instant search for your visitors?').'<br />'.
$this->l('With instant search, the results will appear immediately as the user writes a query.')), $this->l('With instant search, the results will appear immediately as the user writes a query.')),
'PS_SEARCH_MINWORDLEN' => array( 'PS_SEARCH_MINWORDLEN' => array(
'title' => $this->l('Minimum word length (in characters)'), 'title' => $this->l('Minimum word length (in characters)'),
@@ -240,7 +240,7 @@ class AdminSearchConfControllerCore extends AdminController
'size' => 40, 'size' => 40,
'required' => true, 'required' => true,
'desc' => array( 'desc' => array(
$this->l('Enter each alias separated by a comma (\',\') (e.g. \'prestshop,preztashop,prestasohp\')'), $this->l('Enter each alias separated by a comma (e.g. \'prestshop,preztashop,prestasohp\')'),
$this->l('Forbidden characters: <>;=#{}') $this->l('Forbidden characters: <>;=#{}')
) )
), ),
+5 -5
View File
@@ -34,7 +34,7 @@ class AdminSearchControllerCore extends AdminController
/* Handle empty search field */ /* Handle empty search field */
if (empty($this->query)) if (empty($this->query))
{ {
$this->errors[] = Tools::displayError('Please fill in search form first.'); $this->errors[] = Tools::displayError('Please complete the search form first.');
return; return;
} }
else else
@@ -111,7 +111,7 @@ class AdminSearchControllerCore extends AdminController
} }
} }
elseif ($searchType == 3) elseif ($searchType == 3)
$this->errors[] = Tools::displayError('No order found with this ID:').' '.Tools::htmlentitiesUTF8($this->query); $this->errors[] = Tools::displayError('No order was found with this ID:').' '.Tools::htmlentitiesUTF8($this->query);
} }
} }
@@ -120,7 +120,7 @@ class AdminSearchControllerCore extends AdminController
{ {
if ((int)$this->query && Validate::isUnsignedInt((int)$this->query) && ($invoice = Order::getInvoice((int)$this->query))) if ((int)$this->query && Validate::isUnsignedInt((int)$this->query) && ($invoice = Order::getInvoice((int)$this->query)))
Tools::redirectAdmin($this->context->link->getAdminLink('AdminPdf').'&submitAction=generateInvoicePDF&id_order='.(int)($invoice['id_order'])); Tools::redirectAdmin($this->context->link->getAdminLink('AdminPdf').'&submitAction=generateInvoicePDF&id_order='.(int)($invoice['id_order']));
$this->errors[] = Tools::displayError('No invoice found with this ID:').' '.Tools::htmlentitiesUTF8($this->query); $this->errors[] = Tools::displayError('No invoice was found with this ID:').' '.Tools::htmlentitiesUTF8($this->query);
} }
/* Cart */ /* Cart */
@@ -128,7 +128,7 @@ class AdminSearchControllerCore extends AdminController
{ {
if ((int)$this->query && Validate::isUnsignedInt((int)$this->query) && ($cart = new Cart($this->query)) && Validate::isLoadedObject($cart)) if ((int)$this->query && Validate::isUnsignedInt((int)$this->query) && ($cart = new Cart($this->query)) && Validate::isLoadedObject($cart))
Tools::redirectAdmin('index.php?tab=AdminCarts&id_cart='.(int)($cart->id).'&viewcart'.'&token='.Tools::getAdminToken('AdminCarts'.(int)(Tab::getIdFromClassName('AdminCarts')).(int)$this->context->employee->id)); Tools::redirectAdmin('index.php?tab=AdminCarts&id_cart='.(int)($cart->id).'&viewcart'.'&token='.Tools::getAdminToken('AdminCarts'.(int)(Tab::getIdFromClassName('AdminCarts')).(int)$this->context->employee->id));
$this->errors[] = Tools::displayError('No cart found with this ID:').' '.Tools::htmlentitiesUTF8($this->query); $this->errors[] = Tools::displayError('No cart was found with this ID:').' '.Tools::htmlentitiesUTF8($this->query);
} }
/* IP */ /* IP */
// 6 - but it is included in the customer block // 6 - but it is included in the customer block
@@ -152,7 +152,7 @@ class AdminSearchControllerCore extends AdminController
{ {
if (!ip2long(trim($this->query))) if (!ip2long(trim($this->query)))
{ {
$this->errors[] = Tools::displayError('It seems that this is not an IP address:').' '.Tools::htmlentitiesUTF8($this->query); $this->errors[] = Tools::displayError('This is not a valid IP address:').' '.Tools::htmlentitiesUTF8($this->query);
return; return;
} }
$this->_list['customers'] = Customer::searchByIp($this->query); $this->_list['customers'] = Customer::searchByIp($this->query);
@@ -185,15 +185,15 @@ class AdminShippingControllerCore extends AdminController
Tools::redirectAdmin(self::$currentIndex.'&conf=6&id_carrier='.$carrier->id.'&token='.$this->token); Tools::redirectAdmin(self::$currentIndex.'&conf=6&id_carrier='.$carrier->id.'&token='.$this->token);
} }
else else
$this->errors[] = Tools::displayError('An error occurred while updating fees (cannot load carrier object).'); $this->errors[] = Tools::displayError('An error occurred while attempting to update fees (cannot load carrier object).');
} }
elseif (isset($id_carrier2)) elseif (isset($id_carrier2))
$_POST['id_carrier'] = $id_carrier2; $_POST['id_carrier'] = $id_carrier2;
else else
$this->errors[] = Tools::displayError('An error occurred while updating fees (cannot load carrier object).'); $this->errors[] = Tools::displayError('An error occurred while attempting to update fees (cannot load carrier 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.');
} }
else else
return parent::postProcess(); return parent::postProcess();
+9 -9
View File
@@ -233,7 +233,7 @@ class AdminShopControllerCore extends AdminController
AND id_shop_group = '.(int)Tools::getValue('id_shop_group').' AND id_shop_group = '.(int)Tools::getValue('id_shop_group').'
'.(Tools::getValue('id_shop') ? 'AND id_shop != '.(int)Tools::getValue('id_shop') : '')); '.(Tools::getValue('id_shop') ? 'AND id_shop != '.(int)Tools::getValue('id_shop') : ''));
if ($same_name) if ($same_name)
$this->errors[] = Tools::displayError('You cannot have 2 shops with the same name in the same group'); $this->errors[] = Tools::displayError('You cannot have two shops with the same name in the same group.');
} }
if (count($this->errors)) if (count($this->errors))
@@ -258,7 +258,7 @@ class AdminShopControllerCore extends AdminController
return $result; return $result;
} }
else else
$this->errors[] = Tools::displayError('You can\'t delete this shop (customer and/or order dependency)'); $this->errors[] = Tools::displayError('You can\'t delete this shop (customer and/or order dependency).');
return false; return false;
} }
@@ -325,7 +325,7 @@ class AdminShopControllerCore extends AdminController
'type' => 'text', 'type' => 'text',
'label' => $this->l('Shop name:'), 'label' => $this->l('Shop name:'),
'desc' => $this->l('This field does not refer to the shop name visible in the front office.').' '. 'desc' => $this->l('This field does not refer to the shop name visible in the front office.').' '.
sprintf($this->l('Follow %sthis link%s to edit the shop name used on the front office.'), '<a href="'.$this->context->link->getAdminLink('AdminStores').'">', '</a>'), sprintf($this->l('Follow %sthis link%s to edit the shop name used on the Front Office.'), '<a href="'.$this->context->link->getAdminLink('AdminStores').'">', '</a>'),
'name' => 'name', 'name' => 'name',
'required' => true, 'required' => true,
) )
@@ -357,7 +357,7 @@ class AdminShopControllerCore extends AdminController
if ($this->display == 'add') if ($this->display == 'add')
$group_desc = $this->l('Warning: You won\'t be able to change the group of this shop if this shop belongs to a group with one of these options activated: Share Customers, Share Quantities or Share Orders.'); $group_desc = $this->l('Warning: You won\'t be able to change the group of this shop if this shop belongs to a group with one of these options activated: Share Customers, Share Quantities or Share Orders.');
else else
$group_desc = $this->l('You can only move your shop to a shop group with all "share" options disabled or to a shop group with no customers/orders.'); $group_desc = $this->l('You can only move your shop to a shop group with all "share" options disabled -- or to a shop group with no customers/orders.');
$this->fields_form['input'][] = array( $this->fields_form['input'][] = array(
'type' => 'select', 'type' => 'select',
@@ -391,7 +391,7 @@ class AdminShopControllerCore extends AdminController
$this->fields_form['input'][] = array( $this->fields_form['input'][] = array(
'type' => 'select', 'type' => 'select',
'label' => $this->l('Category root:'), 'label' => $this->l('Category root:'),
'desc' => $this->l('This is the root category of the store that you create. To define a new root category for your store').'&nbsp;<a href="'.$this->context->link->getAdminLink('AdminCategories').'&addcategoryroot">'.$this->l('Click here').'</a>', 'desc' => $this->l('This is the root category of the store that you\'ve created. To define a new root category for your store,').'&nbsp;<a href="'.$this->context->link->getAdminLink('AdminCategories').'&addcategoryroot">'.$this->l('Please click here').'</a>',
'name' => 'id_category', 'name' => 'id_category',
'options' => array( 'options' => array(
'query' => $categories, 'query' => $categories,
@@ -484,10 +484,10 @@ class AdminShopControllerCore extends AdminController
'warehouse' => $this->l('Warehouse'), 'warehouse' => $this->l('Warehouse'),
'webservice_account' => $this->l('Webservice accounts'), 'webservice_account' => $this->l('Webservice accounts'),
'attribute_group' => $this->l('Attribute groups'), 'attribute_group' => $this->l('Attribute groups'),
'feature' => $this->l('Features:'), 'feature' => $this->l('Features'),
'group' => $this->l('Customer groups'), 'group' => $this->l('Customer groups'),
'tax_rules_group' => $this->l('Tax rules groups'), 'tax_rules_group' => $this->l('Tax rules groups'),
'supplier' => $this->l('Suppliers:'), 'supplier' => $this->l('Suppliers'),
'referrer' => $this->l('Referrers'), 'referrer' => $this->l('Referrers'),
'zone' => $this->l('Zones'), 'zone' => $this->l('Zones'),
'cart_rule' => $this->l('Cart rules'), 'cart_rule' => $this->l('Cart rules'),
@@ -573,7 +573,7 @@ class AdminShopControllerCore extends AdminController
$this->beforeAdd($object); $this->beforeAdd($object);
if (!$object->add()) if (!$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 */
@@ -661,7 +661,7 @@ class AdminShopControllerCore extends AdminController
if (!isset($tree[$id_shop_group])) if (!isset($tree[$id_shop_group]))
$tree[$id_shop_group] = array( $tree[$id_shop_group] = array(
'data' => array( 'data' => array(
'title' => '<b>'.$this->l('Group:').'</b> '.$row['group_name'], 'title' => '<b>'.$this->l('Group').'</b> '.$row['group_name'],
'icon' => 'themes/'.$this->context->employee->bo_theme.'/img/tree-multishop-groups.png', 'icon' => 'themes/'.$this->context->employee->bo_theme.'/img/tree-multishop-groups.png',
'attr' => array( 'attr' => array(
'href' => $this->context->link->getAdminLink('AdminShop').'&id_shop_group='.$id_shop_group, 'href' => $this->context->link->getAdminLink('AdminShop').'&id_shop_group='.$id_shop_group,
@@ -280,7 +280,7 @@ class AdminShopGroupControllerCore extends AdminController
if (ShopGroup::getTotalShopGroup() == 1) if (ShopGroup::getTotalShopGroup() == 1)
$this->errors[] = Tools::displayError('You cannot delete or disable the last shop group.'); $this->errors[] = Tools::displayError('You cannot delete or disable the last shop group.');
else if ($object->haveShops()) else if ($object->haveShops())
$this->errors[] = Tools::displayError('You cannot delete or disable a shop group which has shops using it.'); $this->errors[] = Tools::displayError('You cannot delete or disable a shop group in use. ');
if (count($this->errors)) if (count($this->errors))
return false; return false;
+9 -9
View File
@@ -280,7 +280,7 @@ class AdminShopUrlControllerCore extends AdminController
$this->show_toolbar = false; $this->show_toolbar = false;
if (isset($this->toolbar_btn['new'])) if (isset($this->toolbar_btn['new']))
$this->toolbar_btn['new'] = array( $this->toolbar_btn['new'] = array(
'desc' => $this->l('Add new URL'), 'desc' => $this->l('Add a new URL'),
'href' => $this->context->link->getAdminLink('AdminShopUrl').'&amp;add'.$this->table.'&amp;id_shop='.$this->id_shop, 'href' => $this->context->link->getAdminLink('AdminShopUrl').'&amp;add'.$this->table.'&amp;id_shop='.$this->id_shop,
); );
@@ -323,17 +323,17 @@ class AdminShopUrlControllerCore extends AdminController
if (Validate::isLoadedObject($object = $this->loadObject())) if (Validate::isLoadedObject($object = $this->loadObject()))
{ {
if ($object->main) if ($object->main)
$this->errors[] = Tools::displayError('You can\'t disable a Main URL'); $this->errors[] = Tools::displayError('You cannot disable the Main URL.');
elseif ($object->toggleStatus()) elseif ($object->toggleStatus())
Tools::redirectAdmin(self::$currentIndex.'&conf=5&token='.$token); Tools::redirectAdmin(self::$currentIndex.'&conf=5&token='.$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.').' <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)');
} }
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
$result = parent::postProcess(); $result = parent::postProcess();
@@ -348,7 +348,7 @@ class AdminShopUrlControllerCore extends AdminController
{ {
$object = $this->loadObject(true); $object = $this->loadObject(true);
if ($object->canAddThisUrl(Tools::getValue('domain'), Tools::getValue('domain_ssl'), Tools::getValue('physical_uri'), Tools::getValue('virtual_uri'))) if ($object->canAddThisUrl(Tools::getValue('domain'), Tools::getValue('domain_ssl'), Tools::getValue('physical_uri'), Tools::getValue('virtual_uri')))
$this->errors[] = Tools::displayError('A shop URL that use this domain and uri already exists'); $this->errors[] = Tools::displayError('A shop URL that uses this domain already exists.');
$return = parent::processSave(); $return = parent::processSave();
if (!$this->errors) if (!$this->errors)
@@ -362,16 +362,16 @@ class AdminShopUrlControllerCore extends AdminController
$object = $this->loadObject(true); $object = $this->loadObject(true);
if ($object->canAddThisUrl(Tools::getValue('domain'), Tools::getValue('domain_ssl'), Tools::getValue('physical_uri'), Tools::getValue('virtual_uri'))) if ($object->canAddThisUrl(Tools::getValue('domain'), Tools::getValue('domain_ssl'), Tools::getValue('physical_uri'), Tools::getValue('virtual_uri')))
$this->errors[] = Tools::displayError('A shop URL that use this domain and uri already exists'); $this->errors[] = Tools::displayError('A shop URL that uses this domain already exists.');
if ($object->id && Tools::getValue('main')) if ($object->id && Tools::getValue('main'))
$object->setMain(); $object->setMain();
if ($object->main && !Tools::getValue('main')) if ($object->main && !Tools::getValue('main'))
$this->errors[] = Tools::displayError('You can\'t change a Main URL to a non-Main URL, you have to set another URL as Main URL for selected shop'); $this->errors[] = Tools::displayError('You cannot change a main URL to a non-main URL. You have to set another URL as your Main URL for the selected shop.');
if (($object->main || Tools::getValue('main')) && !Tools::getValue('active')) if (($object->main || Tools::getValue('main')) && !Tools::getValue('active'))
$this->errors[] = Tools::displayError('You can\'t disable a Main URL'); $this->errors[] = Tools::displayError('You cannot disable the Main URL.');
return parent::processAdd(); return parent::processAdd();
} }
+1 -1
View File
@@ -64,7 +64,7 @@ class AdminSlipControllerCore extends AdminController
'title' => $this->l('Credit slip options'), 'title' => $this->l('Credit slip options'),
'fields' => array( 'fields' => array(
'PS_CREDIT_SLIP_PREFIX' => array( 'PS_CREDIT_SLIP_PREFIX' => array(
'title' => $this->l('Credit slips prefix:'), 'title' => $this->l('Credit slip prefix:'),
'desc' => $this->l('Prefix used for credit slips'), 'desc' => $this->l('Prefix used for credit slips'),
'size' => 6, 'size' => 6,
'type' => 'textLang' 'type' => 'textLang'
@@ -140,16 +140,16 @@ class AdminSpecificPriceRuleControllerCore extends AdminController
'input' => array( 'input' => array(
array( array(
'type' => 'text', 'type' => 'text',
'label' => $this->l('Name:'), 'label' => $this->l('Name'),
'name' => 'name', 'name' => 'name',
'size' => 33, 'size' => 33,
'maxlength' => 32, 'maxlength' => 32,
'required' => true, 'required' => true,
'hint' => $this->l('Forbidden characters:').' <>;=#{}' 'hint' => $this->l('Forbidden characters').' <>;=#{}'
), ),
array( array(
'type' => 'select', 'type' => 'select',
'label' => $this->l('Shop:'), 'label' => $this->l('Shop'),
'name' => 'id_shop', 'name' => 'id_shop',
'options' => array( 'options' => array(
'query' => $shops, 'query' => $shops,
@@ -161,7 +161,7 @@ class AdminSpecificPriceRuleControllerCore extends AdminController
), ),
array( array(
'type' => 'select', 'type' => 'select',
'label' => $this->l('Currency:'), 'label' => $this->l('Currency'),
'name' => 'id_currency', 'name' => 'id_currency',
'options' => array( 'options' => array(
'query' => array_merge(array(0 => array('id_currency' => 0, 'name' => $this->l('All currencies'))), Currency::getCurrencies()), 'query' => array_merge(array(0 => array('id_currency' => 0, 'name' => $this->l('All currencies'))), Currency::getCurrencies()),
@@ -171,7 +171,7 @@ class AdminSpecificPriceRuleControllerCore extends AdminController
), ),
array( array(
'type' => 'select', 'type' => 'select',
'label' => $this->l('Country:'), 'label' => $this->l('Country'),
'name' => 'id_country', 'name' => 'id_country',
'options' => array( 'options' => array(
'query' => array_merge(array(0 => array('id_country' => 0, 'name' => $this->l('All countries'))), Country::getCountries((int)$this->context->language->id)), 'query' => array_merge(array(0 => array('id_country' => 0, 'name' => $this->l('All countries'))), Country::getCountries((int)$this->context->language->id)),
@@ -181,7 +181,7 @@ class AdminSpecificPriceRuleControllerCore extends AdminController
), ),
array( array(
'type' => 'select', 'type' => 'select',
'label' => $this->l('Group:'), 'label' => $this->l('Group'),
'name' => 'id_group', 'name' => 'id_group',
'options' => array( 'options' => array(
'query' => array_merge(array(0 => array('id_group' => 0, 'name' => $this->l('All groups'))), Group::getGroups((int)$this->context->language->id)), 'query' => array_merge(array(0 => array('id_group' => 0, 'name' => $this->l('All groups'))), Group::getGroups((int)$this->context->language->id)),
@@ -191,7 +191,7 @@ class AdminSpecificPriceRuleControllerCore extends AdminController
), ),
array( array(
'type' => 'text', 'type' => 'text',
'label' => $this->l('From quantity:'), 'label' => $this->l('From quantity'),
'name' => 'from_quantity', 'name' => 'from_quantity',
'size' => 6, 'size' => 6,
'maxlength' => 10, 'maxlength' => 10,
@@ -199,7 +199,7 @@ class AdminSpecificPriceRuleControllerCore extends AdminController
), ),
array( array(
'type' => 'text', 'type' => 'text',
'label' => $this->l('Price (tax excl.):'), 'label' => $this->l('Price (tax excl.)'),
'name' => 'price', 'name' => 'price',
'size' => 6, 'size' => 6,
'disabled' => ($this->object->price == -1 ? 1 : 0), 'disabled' => ($this->object->price == -1 ? 1 : 0),
@@ -225,19 +225,19 @@ class AdminSpecificPriceRuleControllerCore extends AdminController
), ),
array( array(
'type' => 'date', 'type' => 'date',
'label' => $this->l('From:'), 'label' => $this->l('From'),
'name' => 'from', 'name' => 'from',
'size' => 12, 'size' => 12,
), ),
array( array(
'type' => 'date', 'type' => 'date',
'label' => $this->l('To:'), 'label' => $this->l('To'),
'name' => 'to', 'name' => 'to',
'size' => 12, 'size' => 12,
), ),
array( array(
'type' => 'select', 'type' => 'select',
'label' => $this->l('Reduction type:'), 'label' => $this->l('Reduction type'),
'name' => 'reduction_type', 'name' => 'reduction_type',
'options' => array( 'options' => array(
'query' => array(array('reduction_type' => 'amount', 'name' => $this->l('Amount')), array('reduction_type' => 'percentage', 'name' => $this->l('Percentage'))), 'query' => array(array('reduction_type' => 'amount', 'name' => $this->l('Amount')), array('reduction_type' => 'percentage', 'name' => $this->l('Percentage'))),
@@ -247,7 +247,7 @@ class AdminSpecificPriceRuleControllerCore extends AdminController
), ),
array( array(
'type' => 'text', 'type' => 'text',
'label' => $this->l('Reduction:'), 'label' => $this->l('Reduction'),
'name' => 'reduction', 'name' => 'reduction',
'required' => true, 'required' => true,
), ),
+6 -6
View File
@@ -129,7 +129,7 @@ class AdminStatesControllerCore extends AdminController
'id' => 'id_country', 'id' => 'id_country',
'name' => 'name', 'name' => 'name',
), ),
'desc' => $this->l('Country where state, region or city is located') 'desc' => $this->l('Country where the state, region or city is located')
), ),
array( array(
'type' => 'select', 'type' => 'select',
@@ -187,13 +187,13 @@ class AdminStatesControllerCore extends AdminController
if (!Tools::getValue('id_'.$this->table)) if (!Tools::getValue('id_'.$this->table))
{ {
if (Validate::isStateIsoCode(Tools::getValue('iso_code')) && State::getIdByIso(Tools::getValue('iso_code'), Tools::getValue('id_country'))) if (Validate::isStateIsoCode(Tools::getValue('iso_code')) && State::getIdByIso(Tools::getValue('iso_code'), Tools::getValue('id_country')))
$this->errors[] = Tools::displayError('This ISO code already exists, you cannot create two states with the same ISO code in the same country'); $this->errors[] = Tools::displayError('This ISO code already exists. You cannot create two states with the same ISO code.');
} }
else if (Validate::isStateIsoCode(Tools::getValue('iso_code'))) else if (Validate::isStateIsoCode(Tools::getValue('iso_code')))
{ {
$id_state = State::getIdByIso(Tools::getValue('iso_code'), Tools::getValue('id_country')); $id_state = State::getIdByIso(Tools::getValue('iso_code'), Tools::getValue('id_country'));
if ($id_state && $id_state != Tools::getValue('id_'.$this->table)) if ($id_state && $id_state != Tools::getValue('id_'.$this->table))
$this->errors[] = Tools::displayError('This ISO code already exists, you cannot create two states with the same ISO code in the same country'); $this->errors[] = Tools::displayError('This ISO code already exists. You cannot create two states with the same ISO code.');
} }
/* Delete object */ /* Delete object */
@@ -225,13 +225,13 @@ class AdminStatesControllerCore extends AdminController
} }
} }
else else
$this->errors[] = Tools::displayError('This state was used in at least one address, it cannot be removed'); $this->errors[] = Tools::displayError('This state was used in at least one address. It cannot be removed.');
} }
else else
$this->errors[] = Tools::displayError('An error occurred while deleting object.').' <b>'.$this->table.'</b> '.Tools::displayError('(cannot load object)'); $this->errors[] = Tools::displayError('An error occurred while deleting the 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.');
} }
else else
parent::postProcess(); parent::postProcess();

Some files were not shown because too many files have changed in this diff Show More