// Merge -> revision 8800

This commit is contained in:
rMalie committed 2011-09-27 14:30:06 +00:00
1 parent cde0690abc
commit 91083e190c
110 files changed
+791 -617

No files matched your search

+1 -1
View File
@@ -621,7 +621,7 @@ if (Tools::isSubmit('saveHook'))
foreach ($hookedModules as $module) foreach ($hookedModules as $module)
{ {
$ids = explode('_', $module); $ids = explode('_', $module);
$value .= '('.$ids[1].', '.$id_shop.', (SELECT id_hook FROM '._DB_PREFIX_.'hook WHERE `name` = \''.pSQL($hook).'\' LIMIT 1), '.$i.'),'; $value .= '('.(int)$ids[1].', '.$id_shop.', (SELECT id_hook FROM '._DB_PREFIX_.'hook WHERE `name` = \''.pSQL($hook).'\' LIMIT 1), '.(int)$i.'),';
$i++; $i++;
} }
$value = rtrim($value, ','); $value = rtrim($value, ',');
@@ -10,7 +10,10 @@
require_once('../init.php'); require_once('../init.php');
require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . "inc" . DIRECTORY_SEPARATOR . "config.php"); require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . "inc" . DIRECTORY_SEPARATOR . "config.php");
@ob_start(); @ob_start();
displayArray($_POST); $safe_post = array();
foreach ($_POST AS $key => $value)
$safe_post[Tools::safeOutput($key)] = Tools::safeOutput($value);
displayArray($safe_post);
writeInfo(@ob_get_clean()); writeInfo(@ob_get_clean());
echo "{"; echo "{";
$error = ""; $error = "";
@@ -105,7 +105,7 @@
<fieldset id="modes"> <fieldset id="modes">
<legend>Modes</legend> <legend>Modes</legend>
<form name="formAction" id="formAction" method="post" action="<?php echo appendQueryString(CONFIG_URL_IMAGE_UNDO, makeQueryString(array('path'))); ?>"> <form name="formAction" id="formAction" method="post" action="<?php echo appendQueryString(CONFIG_URL_IMAGE_UNDO, makeQueryString(array('path'))); ?>">
<input type="hidden" name="file_path" id="file_path" value="<?php echo $_GET['path']; ?>" /> <input type="hidden" name="file_path" id="file_path" value="<?php echo Tools::safeOutput($_GET['path']); ?>" />
<p><label><?php echo IMG_MODE_RESIZE; ?></label> <input type="radio" name="mode" value="resize" class="input" checked="checked" onclick="return changeMode();"/> <p><label><?php echo IMG_MODE_RESIZE; ?></label> <input type="radio" name="mode" value="resize" class="input" checked="checked" onclick="return changeMode();"/>
<label><?php echo IMG_MODE_CROP; ?></label> <input type="radio" name="mode" value="crop" class="input" onclick="return changeMode();" /> <label><?php echo IMG_MODE_CROP; ?></label> <input type="radio" name="mode" value="crop" class="input" onclick="return changeMode();" />
@@ -131,7 +131,7 @@
<p><input type="hidden" name="mode" id="image_mode" value="" /> <p><input type="hidden" name="mode" id="image_mode" value="" />
<input type="hidden" name="new_name" id="hidden_new_name" value="" /> <input type="hidden" name="new_name" id="hidden_new_name" value="" />
<input type="hidden" name="save_to" id="hidden_save_to" value="" /> <input type="hidden" name="save_to" id="hidden_save_to" value="" />
<input type="hidden" name="path" id="path" value="<?php echo $_GET['path']; ?>" /> <input type="hidden" name="path" id="path" value="<?php echo Tools::safeOutput($_GET['path']); ?>" />
<input type="hidden" name="flip_angle" id="flip_angle" value="" /> <input type="hidden" name="flip_angle" id="flip_angle" value="" />
<label><?php echo IMG_LBL_WIDTH; ?></label> <input type="text" name="width" id="width" value="" class="input imageInput" /> <label><?php echo IMG_LBL_WIDTH; ?></label> <input type="text" name="width" id="width" value="" class="input imageInput" />
<label><?php echo IMG_LBL_HEIGHT; ?></label> <input type="text" name="height" id="height" value="" class="input imageInput" /> <label><?php echo IMG_LBL_HEIGHT; ?></label> <input type="text" name="height" id="height" value="" class="input imageInput" />
@@ -74,7 +74,7 @@
<script type="text/javascript" src="jscripts/ajaxfilemanager.js"></script>--> <script type="text/javascript" src="jscripts/ajaxfilemanager.js"></script>-->
<script type="text/javascript"> <script type="text/javascript">
var globalSettings = {'upload_init':false}; var globalSettings = {'upload_init':false};
var queryString = '<?php echo makeQueryString(array('path')); ?>'; var queryString = '<?php echo Tools::safeOutput(makeQueryString(array('path'))); ?>';
var paths = {'root':'<?php echo addTrailingSlash(backslashToSlash(CONFIG_SYS_ROOT_PATH)); ?>', 'root_title':'<?php echo LBL_FOLDER_ROOT; ?>'}; var paths = {'root':'<?php echo addTrailingSlash(backslashToSlash(CONFIG_SYS_ROOT_PATH)); ?>', 'root_title':'<?php echo LBL_FOLDER_ROOT; ?>'};
var parentFolder = {}; var parentFolder = {};
var urls = { var urls = {
@@ -90,7 +90,7 @@
'text_editor':'<?php echo CONFIG_URL_TEXT_EDITOR; ?>', 'text_editor':'<?php echo CONFIG_URL_TEXT_EDITOR; ?>',
'image_editor':'<?php echo CONFIG_URL_IMAGE_EDITOR; ?>', 'image_editor':'<?php echo CONFIG_URL_IMAGE_EDITOR; ?>',
'download':'<?php echo CONFIG_URL_DOWNLOAD; ?>', 'download':'<?php echo CONFIG_URL_DOWNLOAD; ?>',
'present':'<?php echo getCurrentUrl(); ?>', 'present':'<?php echo Tools::safeOutput(getCurrentUrl()); ?>',
'home':'<?php echo CONFIG_URL_HOME; ?>', 'home':'<?php echo CONFIG_URL_HOME; ?>',
'view':'<?php echo CONFIG_URL_LIST_LISTING; ?>' 'view':'<?php echo CONFIG_URL_LIST_LISTING; ?>'
}; };
@@ -131,7 +131,7 @@
var searchRequired = false; var searchRequired = false;
var supporedPreviewExts = '<?php echo CONFIG_VIEWABLE_VALID_EXTS; ?>'; var supporedPreviewExts = '<?php echo CONFIG_VIEWABLE_VALID_EXTS; ?>';
var supportedUploadExts = '<?php echo CONFIG_UPLOAD_VALID_EXTS; ?>' var supportedUploadExts = '<?php echo CONFIG_UPLOAD_VALID_EXTS; ?>'
var elementId = <?php echo (!empty($_GET['elementId'])?"'" . $_GET['elementId'] . "'":'null'); ?>; var elementId = <?php echo (!empty($_GET['elementId'])?"'" . Tools::safeOutput($_GET['elementId']) . "'":'null'); ?>;
var files = {}; var files = {};
$(document).ready( $(document).ready(
function() function()
@@ -464,9 +464,9 @@ $(document).ready(
<tr> <tr>
<td> <td>
<b><?php echo LBL_SEARCH_MTIME; ?></b><br /> <b><?php echo LBL_SEARCH_MTIME; ?></b><br />
<input type="text" class="input inputMtime" name="search_mtime_from" id="search_mtime_from" value="<?php echo (!empty($_GET['search_mtime_from'])?$_GET['search_mtime_from']:''); ?>" /> <input type="text" class="input inputMtime" name="search_mtime_from" id="search_mtime_from" value="<?php echo (!empty($_GET['search_mtime_from'])?Tools::safeOutput($_GET['search_mtime_from']):''); ?>" />
<span class="leftToRightArrow">&nbsp;</span> <span class="leftToRightArrow">&nbsp;</span>
<input type="text" class="input inputMtime" name="search_mtime_to" id="search_mtime_to" value="<?php echo (!empty($_GET['search_mtime_to'])?$_GET['search_mtime_to']:''); ?>" /> <input type="text" class="input inputMtime" name="search_mtime_to" id="search_mtime_to" value="<?php echo (!empty($_GET['search_mtime_to'])?Tools::safeOutput($_GET['search_mtime_to']):''); ?>" />
</td></tr> </td></tr>
<tr> <tr>
+1 -1
View File
@@ -48,7 +48,7 @@ if ((empty($_SERVER['HTTPS']) OR strtolower($_SERVER['HTTPS']) == 'off')
$errors[] = translate('SSL is activated. However, your IP is allowed to use unsecure mode (Maintenance or local IP).').'<br/>'; $errors[] = translate('SSL is activated. However, your IP is allowed to use unsecure mode (Maintenance or local IP).').'<br/>';
else else
$warningSslMessage = translate('SSL is activated. Please connect using the following url to log in in secure mode (https).') $warningSslMessage = translate('SSL is activated. Please connect using the following url to log in in secure mode (https).')
.'<br/><br/><a href="https://'.Tools::getServerName().$_SERVER['REQUEST_URI'].'">https://'.Tools::getServerName().$_SERVER['REQUEST_URI'].'</a>'; .'<br/><br/><a href="https://'.Tools::getServerName().Tools::safeOutput($_SERVER['REQUEST_URI']).'">https://'.Tools::getServerName().Tools::safeOutput($_SERVER['REQUEST_URI']).'</a>';
} }
$iso = strtolower(Context::getContext()->language->iso_code); $iso = strtolower(Context::getContext()->language->iso_code);
+1 -1
View File
@@ -215,7 +215,7 @@ class AdminAddresses extends AdminTab
WHERE 1 '.(isset($this->_where) ? $this->_where.' ' : '').(($this->deleted OR $this->table == 'currency') ? 'AND a.`deleted` = 0 ' : '').$this->_filter.' WHERE 1 '.(isset($this->_where) ? $this->_where.' ' : '').(($this->deleted OR $this->table == 'currency') ? 'AND a.`deleted` = 0 ' : '').$this->_filter.'
'.(isset($this->_group) ? $this->_group.' ' : '').' '.(isset($this->_group) ? $this->_group.' ' : '').'
'.(isset($this->addressType) ? 'AND a.id_'.strval($this->addressType).' != 0' : '').' '.(isset($this->addressType) ? 'AND a.id_'.strval($this->addressType).' != 0' : '').'
ORDER BY '.(($orderBy == 'id_'.$this->table) ? 'a.' : '').'`'.pSQL($orderBy).'` '.pSQL($orderWay).' ORDER BY '.(($orderBy == 'id_'.$this->table) ? 'a.' : '').'`'.bqSQL($orderBy).'` '.bqSQL($orderWay).'
LIMIT '.(int)($start).','.(int)($limit)); LIMIT '.(int)($start).','.(int)($limit));
} }
+1 -1
View File
@@ -116,7 +116,7 @@ class AdminAttributes extends AdminTab
<label>'.$this->l('Current texture:').' </label> <label>'.$this->l('Current texture:').' </label>
<div class="margin-form"> <div class="margin-form">
<p>'.(file_exists(_PS_IMG_DIR_.$this->fieldImageSettings['dir'].'/'.$obj->id.'.jpg') <p>'.(file_exists(_PS_IMG_DIR_.$this->fieldImageSettings['dir'].'/'.$obj->id.'.jpg')
? '<img src="../img/'.$this->fieldImageSettings['dir'].'/'.$obj->id.'.jpg" alt="" title="" /> <a href="'.$_SERVER['REQUEST_URI'].'&deleteImage=1"><img src="../img/admin/delete.gif" alt="'.$this->l('delete').'" title="" /></a>' ? '<img src="../img/'.$this->fieldImageSettings['dir'].'/'.$obj->id.'.jpg" alt="" title="" /> <a href="'.Tools::safeOutput($_SERVER['REQUEST_URI']).'&deleteImage=1"><img src="../img/admin/delete.gif" alt="'.$this->l('delete').'" title="" /></a>'
: $this->l('None') : $this->l('None')
).'</p> ).'</p>
</div> </div>
+1 -1
View File
@@ -114,7 +114,7 @@ class AdminDb extends AdminPreferences
if ($engineType == $tables_engine[$table]) if ($engineType == $tables_engine[$table])
$this->_errors[] = $table.' '.$this->l('is already in').' '.$engineType; $this->_errors[] = $table.' '.$this->l('is already in').' '.$engineType;
else else
if (!Db::getInstance()->Execute('ALTER TABLE '.pSQL($table).' ENGINE='.pSQL($engineType))) if (!Db::getInstance()->Execute('ALTER TABLE `'.bqSQL($table).'` ENGINE=`'.bqSQL($engineType).'`'))
$this->_errors[] = $this->l('Can\'t change engine for').' '.$table; $this->_errors[] = $this->l('Can\'t change engine for').' '.$table;
else else
echo '<div class="conf confirm"><img src="../img/admin/ok.gif" alt="'.$this->l('Confirmation').'" />'.$this->l('Engine change of').' '.$table.' '.$this->l('to').' '.$engineType.'</div>'; echo '<div class="conf confirm"><img src="../img/admin/ok.gif" alt="'.$this->l('Confirmation').'" />'.$this->l('Engine change of').' '.$table.' '.$this->l('to').' '.$engineType.'</div>';
+2 -2
View File
@@ -891,7 +891,7 @@ class AdminOrders extends AdminTab
$slips = OrderSlip::getOrdersSlip($order->id_customer, $order->id); $slips = OrderSlip::getOrdersSlip($order->id_customer, $order->id);
echo ' echo '
<div style="float: left"> <div style="float: left">
<form action="'.$_SERVER['REQUEST_URI'].'&token='.$this->token.'" method="post" onsubmit="if (getE(\'visibility\').checked == true) return confirm(\''.$this->l('Do you want to send this message to the customer?', __CLASS__, true, false).'\');"> <form action="'.Tools::safeOutput($_SERVER['REQUEST_URI']).'&token='.$this->token.'" method="post" onsubmit="if (getE(\'visibility\').checked == true) return confirm(\''.$this->l('Do you want to send this message to the customer?', __CLASS__, true, false).'\');">
<fieldset style="width: 400px;"> <fieldset style="width: 400px;">
<legend style="cursor: pointer;" onclick="$(\'#message\').slideToggle();$(\'#message_m\').slideToggle();return false"><img src="../img/admin/email_edit.gif" /> '.$this->l('New message').'</legend> <legend style="cursor: pointer;" onclick="$(\'#message\').slideToggle();$(\'#message_m\').slideToggle();return false"><img src="../img/admin/email_edit.gif" /> '.$this->l('New message').'</legend>
<div id="message_m" style="display: '.(Tools::getValue('message') ? 'none' : 'block').'; overflow: auto; width: 400px;"> <div id="message_m" style="display: '.(Tools::getValue('message') ? 'none' : 'block').'; overflow: auto; width: 400px;">
@@ -926,7 +926,7 @@ class AdminOrders extends AdminTab
{ {
echo '<div style="overflow:auto; width:400px;" '.($message['is_new_for_me'] ?'class="new_message"':'').'>'; echo '<div style="overflow:auto; width:400px;" '.($message['is_new_for_me'] ?'class="new_message"':'').'>';
if ($message['is_new_for_me']) if ($message['is_new_for_me'])
echo '<a class="new_message" title="'.$this->l('Mark this message as \'viewed\'').'" href="'.$_SERVER['REQUEST_URI'].'&token='.$this->token.'&messageReaded='.(int)($message['id_message']).'"><img src="../img/admin/enabled.gif" alt="" /></a>'; echo '<a class="new_message" title="'.$this->l('Mark this message as \'viewed\'').'" href="'.Tools::safeOutput($_SERVER['REQUEST_URI']).'&token='.$this->token.'&messageReaded='.(int)($message['id_message']).'"><img src="../img/admin/enabled.gif" alt="" /></a>';
echo $this->l('At').' <i>'.Tools::displayDate($message['date_add'], $this->context->language->id, true); echo $this->l('At').' <i>'.Tools::displayDate($message['date_add'], $this->context->language->id, true);
echo '</i> '.$this->l('from').' <b>'.(($message['elastname']) ? ($message['efirstname'].' '.$message['elastname']) : ($message['cfirstname'].' '.$message['clastname'])).'</b>'; echo '</i> '.$this->l('from').' <b>'.(($message['elastname']) ? ($message['efirstname'].' '.$message['elastname']) : ($message['cfirstname'].' '.$message['clastname'])).'</b>';
echo ((int)($message['private']) == 1 ? '<span style="color:red; font-weight:bold;">'.$this->l('Private:').'</span>' : ''); echo ((int)($message['private']) == 1 ? '<span style="color:red; font-weight:bold;">'.$this->l('Private:').'</span>' : '');
+1 -1
View File
@@ -111,7 +111,7 @@ class AdminPreferences extends AdminTab
if (!Tools::usingSecureMode()) if (!Tools::usingSecureMode())
{ {
$fields['PS_SSL_ENABLED']['type'] = 'disabled'; $fields['PS_SSL_ENABLED']['type'] = 'disabled';
$fields['PS_SSL_ENABLED']['disabled'] = '<a href="https://'.Tools::getShopDomainSsl().$_SERVER['REQUEST_URI'].'">'.$this->l('Please click here to use HTTPS protocol before enabling SSL.').'</a>'; $fields['PS_SSL_ENABLED']['disabled'] = '<a href="https://'.Tools::getShopDomainSsl().Tools::safeOutput($_SERVER['REQUEST_URI']).'">'.$this->l('Please click here to use HTTPS protocol before enabling SSL.').'</a>';
} }
$this->optionsList = array( $this->optionsList = array(
+2 -2
View File
@@ -100,7 +100,7 @@ abstract class AdminStatsTab extends AdminPreferences
$arrayGridEngines = ModuleGridEngine::getGridEngines(); $arrayGridEngines = ModuleGridEngine::getGridEngines();
echo ' echo '
<form action="'.$_SERVER['REQUEST_URI'].'" method="post"> <form action="'.Tools::safeOutput($_SERVER['REQUEST_URI']).'" method="post">
<fieldset style="width: 200px;"><legend><img src="../img/admin/tab-preferences.gif" />'.$this->l('Settings', 'AdminStatsTab').'</legend>'; <fieldset style="width: 200px;"><legend><img src="../img/admin/tab-preferences.gif" />'.$this->l('Settings', 'AdminStatsTab').'</legend>';
echo '<p><strong>'.$this->l('Graph engine', 'AdminStatsTab').' </strong><br />'; echo '<p><strong>'.$this->l('Graph engine', 'AdminStatsTab').' </strong><br />';
if (sizeof($arrayGraphEngines)) if (sizeof($arrayGraphEngines))
@@ -153,7 +153,7 @@ abstract class AdminStatsTab extends AdminPreferences
return ' return '
<fieldset style="width: 200px; font-size:13px;"><legend><img src="../img/admin/date.png" /> '.$translations['Calendar'].'</legend> <fieldset style="width: 200px; font-size:13px;"><legend><img src="../img/admin/date.png" /> '.$translations['Calendar'].'</legend>
<div> <div>
<form action="'.$_SERVER['REQUEST_URI'].'" method="post"> <form action="'.Tools::safeOutput($_SERVER['REQUEST_URI']).'" method="post">
<input type="submit" name="submitDateDay" class="button" value="'.$translations['Day'].'"> <input type="submit" name="submitDateDay" class="button" value="'.$translations['Day'].'">
<input type="submit" name="submitDateMonth" class="button" value="'.$translations['Month'].'"> <input type="submit" name="submitDateMonth" class="button" value="'.$translations['Month'].'">
<input type="submit" name="submitDateYear" class="button" value="'.$translations['Year'].'"><br /> <input type="submit" name="submitDateYear" class="button" value="'.$translations['Year'].'"><br />
+2 -2
View File
@@ -843,13 +843,13 @@ class AdminTranslations extends AdminTab
<script type="text/javascript">'; <script type="text/javascript">';
if (Tools::getValue('type') == 'mails') if (Tools::getValue('type') == 'mails')
$str_output .= '$(document).ready(function(){ $str_output .= '$(document).ready(function(){
openCloseAllDiv(\''.$_GET['type'].'_div\', this.value == openAll); toggleElemValue(this.id, openAll, closeAll); openCloseAllDiv(\''.Tools::safeOutput($_GET['type']).'_div\', this.value == openAll); toggleElemValue(this.id, openAll, closeAll);
});'; });';
$str_output .= ' $str_output .= '
var openAll = \''.html_entity_decode($this->l('Expand all fieldsets'), ENT_NOQUOTES, 'UTF-8').'\'; var openAll = \''.html_entity_decode($this->l('Expand all fieldsets'), ENT_NOQUOTES, 'UTF-8').'\';
var closeAll = \''.html_entity_decode($this->l('Close all fieldsets'), ENT_NOQUOTES, 'UTF-8').'\'; var closeAll = \''.html_entity_decode($this->l('Close all fieldsets'), ENT_NOQUOTES, 'UTF-8').'\';
</script> </script>
<input type="button" class="button" id="buttonall" onclick="openCloseAllDiv(\''.$_GET['type'].'_div\', this.value == openAll); toggleElemValue(this.id, openAll, closeAll);" /> <input type="button" class="button" id="buttonall" onclick="openCloseAllDiv(\''.Tools::safeOutput($_GET['type']).'_div\', this.value == openAll); toggleElemValue(this.id, openAll, closeAll);" />
<script type="text/javascript">toggleElemValue(\'buttonall\', '.($closed ? 'openAll' : 'closeAll').', '.($closed ? 'closeAll' : 'openAll').');</script>'; <script type="text/javascript">toggleElemValue(\'buttonall\', '.($closed ? 'openAll' : 'closeAll').', '.($closed ? 'closeAll' : 'openAll').');</script>';
return $str_output; return $str_output;
} }
+2 -2
View File
@@ -844,7 +844,7 @@ abstract class AdminTabCore
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('\'from:\' date format is invalid (YYYY-MM-DD)');
else else
$sqlFilter .= ' AND '.pSQL($key).' >= \''.pSQL(Tools::dateFrom($value[0])).'\''; $sqlFilter .= ' AND `'.bqSQL($key).'` >= \''.pSQL(Tools::dateFrom($value[0])).'\'';
} }
if (isset($value[1]) AND !empty($value[1])) if (isset($value[1]) AND !empty($value[1]))
@@ -852,7 +852,7 @@ abstract class AdminTabCore
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('\'to:\' date format is invalid (YYYY-MM-DD)');
else else
$sqlFilter .= ' AND '.pSQL($key).' <= \''.pSQL(Tools::dateTo($value[1])).'\''; $sqlFilter .= ' AND `'.bqSQL($key).'` <= \''.pSQL(Tools::dateTo($value[1])).'\'';
} }
} }
else else
+21 -20
View File
@@ -417,10 +417,11 @@ class CartCore extends ObjectModel
IF (IFNULL(pa.`supplier_reference`, \'\') = \'\', p.`supplier_reference`, pa.`supplier_reference`) AS supplier_reference, IF (IFNULL(pa.`supplier_reference`, \'\') = \'\', p.`supplier_reference`, pa.`supplier_reference`) AS supplier_reference,
(p.`weight`+ pa.`weight`) weight_attribute, (p.`weight`+ pa.`weight`) weight_attribute,
IF (IFNULL(pa.`ean13`, \'\') = \'\', p.`ean13`, pa.`ean13`) AS ean13, IF (IFNULL(pa.`upc`, \'\') = \'\', p.`upc`, pa.`upc`) AS upc, IF (IFNULL(pa.`ean13`, \'\') = \'\', p.`ean13`, pa.`ean13`) AS ean13, IF (IFNULL(pa.`upc`, \'\') = \'\', p.`upc`, pa.`upc`) AS upc,
pai.`id_image` as pai_id_image, IFNULL(pa.`minimal_quantity`, p.`minimal_quantity`) as minimal_quantity, pa.`ecotax` AS ecotax_attr'); pai.`id_image` as pai_id_image, il.`legend` as pai_legend, IFNULL(pa.`minimal_quantity`, p.`minimal_quantity`) as minimal_quantity, pa.`ecotax` AS ecotax_attr');
$sql->leftJoin('product_attribute pa ON pa.`id_product_attribute` = cp.`id_product_attribute`'); $sql->leftJoin('product_attribute pa ON pa.`id_product_attribute` = cp.`id_product_attribute`');
$sql->leftJoin('product_attribute_image pai ON pai.`id_product_attribute` = pa.`id_product_attribute`'); $sql->leftJoin('product_attribute_image pai ON pai.`id_product_attribute` = pa.`id_product_attribute`');
$sql->leftJoin('image_lang il ON il.id_image = pai.id_image AND il.id_lang = '.(int)$this->id_lang);
} }
else else
$sql->select('p.`reference` AS reference, p.`supplier_reference` AS supplier_reference, p.`ean13`, p.`upc` AS upc, p.`minimal_quantity` AS minimal_quantity'); $sql->select('p.`reference` AS reference, p.`supplier_reference` AS supplier_reference, p.`ean13`, p.`upc` AS upc, p.`minimal_quantity` AS minimal_quantity');
@@ -465,30 +466,29 @@ class CartCore extends ObjectModel
$row['price'] = Product::getPriceStatic((int)$row['id_product'], false, (int)$row['id_product_attribute'], 6, NULL, false, true, $row['cart_quantity'], false, ((int)($this->id_customer) ? (int)($this->id_customer) : NULL), (int)($this->id), ((int)($this->{Configuration::get('PS_TAX_ADDRESS_TYPE')}) ? (int)($this->{Configuration::get('PS_TAX_ADDRESS_TYPE')}) : NULL), $specificPriceOutput); $row['price'] = Product::getPriceStatic((int)$row['id_product'], false, (int)$row['id_product_attribute'], 6, NULL, false, true, $row['cart_quantity'], false, ((int)($this->id_customer) ? (int)($this->id_customer) : NULL), (int)($this->id), ((int)($this->{Configuration::get('PS_TAX_ADDRESS_TYPE')}) ? (int)($this->{Configuration::get('PS_TAX_ADDRESS_TYPE')}) : NULL), $specificPriceOutput);
$row['price_wt'] = Product::getPriceStatic((int)$row['id_product'], true, (int)$row['id_product_attribute'], 2, NULL, false, true, $row['cart_quantity'], false, ((int)($this->id_customer) ? (int)($this->id_customer) : NULL), (int)($this->id), ((int)($this->{Configuration::get('PS_TAX_ADDRESS_TYPE')}) ? (int)($this->{Configuration::get('PS_TAX_ADDRESS_TYPE')}) : NULL)); $row['price_wt'] = Product::getPriceStatic((int)$row['id_product'], true, (int)$row['id_product_attribute'], 2, NULL, false, true, $row['cart_quantity'], false, ((int)($this->id_customer) ? (int)($this->id_customer) : NULL), (int)($this->id), ((int)($this->{Configuration::get('PS_TAX_ADDRESS_TYPE')}) ? (int)($this->{Configuration::get('PS_TAX_ADDRESS_TYPE')}) : NULL));
/* In case when you use QuantityDiscount, getPriceStatic() can be return more of 2 decimals */ // In case when you use QuantityDiscount, getPriceStatic() can be return more of 2 decimals
$row['price_wt'] = Tools::ps_round($row['price_wt'], 2); $row['price_wt'] = Tools::ps_round($row['price_wt'], 2);
$row['total_wt'] = $row['price_wt'] * (int)($row['cart_quantity']); $row['total_wt'] = $row['price_wt'] * (int)($row['cart_quantity']);
$row['total'] = Tools::ps_round($row['price'] * (int)($row['cart_quantity']), 2); $row['total'] = Tools::ps_round($row['price'] * (int)($row['cart_quantity']), 2);
} }
$row2 = Db::getInstance()->getRow(' if (!isset($row['pai_id_image']))
SELECT i.`id_image`, il.`legend` {
FROM `'._DB_PREFIX_.'image` i $row2 = Db::getInstance()->getRow('
LEFT JOIN `'._DB_PREFIX_.'image_lang` il ON (i.`id_image` = il.`id_image` AND il.`id_lang` = '.(int)$this->id_lang.') SELECT i.`id_image`, il.`legend`
WHERE '.((isset($row['`pai_id_image`']) AND $row['`pai_id_image`']) FROM `'._DB_PREFIX_.'image` i
? 'i.`id_image` = ( LEFT JOIN `'._DB_PREFIX_.'image_lang` il ON (i.`id_image` = il.`id_image` AND il.`id_lang` = '.(int)$this->id_lang.')
SELECT i2.`id_image` WHERE i.`id_product` = '.(int)$row['id_product'].' AND i.`cover` = 1');
FROM `'._DB_PREFIX_.'image` i2 if (!$row2)
INNER JOIN `'._DB_PREFIX_.'product_attribute_image` pai2 ON (pai2.`id_image` = i2.`id_image`) $row2 = array('id_image' => false, 'legend' => false);
WHERE i2.`id_product` = p.`id_product` AND pai2.`id_product_attribute` = pa.`id_product_attribute` else
ORDER BY i2.`position` $row = array_merge($row, $row2);
LIMIT 1 }
)' else
: 'i.`id_product` = '.(int)$row['id_product'].' AND i.`cover` = 1').' {
'); $row['id_image'] = $row['pai_id_image'];
if (!$row2) $row['legend'] = $row['pai_legend'];
$row2 = array('id_image' => false, 'legend' => false); }
$row = array_merge($row, $row2);
$row['reduction_applies'] = ($specificPriceOutput AND (float)$specificPriceOutput['reduction']); $row['reduction_applies'] = ($specificPriceOutput AND (float)$specificPriceOutput['reduction']);
$row['quantity_discount_applies'] = ($specificPriceOutput AND $row['cart_quantity'] >= (int)$specificPriceOutput['from_quantity']); $row['quantity_discount_applies'] = ($specificPriceOutput AND $row['cart_quantity'] >= (int)$specificPriceOutput['from_quantity']);
@@ -500,6 +500,7 @@ class CartCore extends ObjectModel
$this->_products[] = $row; $this->_products[] = $row;
} }
return $this->_products; return $this->_products;
} }
+2 -2
View File
@@ -674,7 +674,7 @@ class CategoryCore extends ObjectModel
FROM `'._DB_PREFIX_.'category` c3 FROM `'._DB_PREFIX_.'category` c3
WHERE c3.`nleft` > c.`nleft` WHERE c3.`nleft` > c.`nleft`
AND c3.`nright` < c.`nright` AND c3.`nright` < c.`nright`
AND c3.`id_category` IN ('.$selectedCat.') AND c3.`id_category` IN ('.array_map('intval', $selectedCat).')
)' : '0').' AS nbSelectedSubCat )' : '0').' AS nbSelectedSubCat
FROM `'._DB_PREFIX_.'category` c FROM `'._DB_PREFIX_.'category` c
LEFT JOIN `'._DB_PREFIX_.'category_lang` cl ON c.`id_category` = cl.`id_category`'.$shop->sqlLang('cl').' LEFT JOIN `'._DB_PREFIX_.'category_lang` cl ON c.`id_category` = cl.`id_category`'.$shop->sqlLang('cl').'
@@ -1123,7 +1123,7 @@ class CategoryCore extends ObjectModel
FROM `'._DB_PREFIX_.'category` c FROM `'._DB_PREFIX_.'category` c
LEFT JOIN `'._DB_PREFIX_.'category_lang` cl ON (c.`id_category` = cl.`id_category`'.Context::getContext()->shop->sqlLang('cl').') LEFT JOIN `'._DB_PREFIX_.'category_lang` cl ON (c.`id_category` = cl.`id_category`'.Context::getContext()->shop->sqlLang('cl').')
WHERE cl.`id_lang` = '.(int)$id_lang.' WHERE cl.`id_lang` = '.(int)$id_lang.'
AND c.`id_category` IN ('.implode(',', $ids_category).') AND c.`id_category` IN ('.implode(',', array_map('intval', $ids_category)).')
'); ');
foreach($results as $category) foreach($results as $category)
+1 -1
View File
@@ -280,7 +280,7 @@ abstract class ModuleGraphCore extends Module
$urlParams['module'] = Tools::getValue('module'); $urlParams['module'] = Tools::getValue('module');
$urlParams['id_employee'] = $id_employee; $urlParams['id_employee'] = $id_employee;
$urlParams['id_lang'] = $id_lang; $urlParams['id_lang'] = $id_lang;
$drawer = 'drawer.php?' . http_build_query($urlParams); $drawer = 'drawer.php?' . http_build_query(array_map('Tools::safeOutput', $urlParams));
require_once(dirname(__FILE__).'/../modules/'.$render.'/'.$render.'.php'); require_once(dirname(__FILE__).'/../modules/'.$render.'/'.$render.'.php');
return call_user_func(array($render, 'hookGraphEngine'), $params, $drawer); return call_user_func(array($render, 'hookGraphEngine'), $params, $drawer);
+1 -1
View File
@@ -100,7 +100,7 @@ abstract class ModuleGridCore extends Module
if (!file_exists(dirname(__FILE__).'/../modules/'.$render.'/'.$render.'.php')) if (!file_exists(dirname(__FILE__).'/../modules/'.$render.'/'.$render.'.php'))
return Tools::displayError('Grid engine selected is unavailable.'); return Tools::displayError('Grid engine selected is unavailable.');
$grider = 'grider.php?render='.$render.'&module='.Tools::getValue('module'); $grider = 'grider.php?render='.$render.'&module='.Tools::safeOutput(Tools::getValue('module'));
$context = Context::getContext(); $context = Context::getContext();
$grider .= '&id_employee='.(int)($context->employee->id); $grider .= '&id_employee='.(int)($context->employee->id);
+3 -2
View File
@@ -1543,7 +1543,7 @@ class ProductCore extends ObjectModel
'.$context->shop->sqlAsso('product', 'p').' '.$context->shop->sqlAsso('product', 'p').'
WHERE p.`active` = 1 WHERE p.`active` = 1
AND p.`show_price` = 1 AND p.`show_price` = 1
'.((!$beginning AND !$ending) ? ' AND p.`id_product` IN('.((is_array($ids_product) AND sizeof($ids_product)) ? implode(', ', $ids_product) : 0).')' : '').' '.((!$beginning AND !$ending) ? ' AND p.`id_product` IN('.((is_array($ids_product) AND sizeof($ids_product)) ? implode(', ', array_map('intval', $ids_product)) : 0).')' : '').'
AND p.`id_product` IN ( AND p.`id_product` IN (
SELECT cp.`id_product` SELECT cp.`id_product`
FROM `'._DB_PREFIX_.'category_group` cg FROM `'._DB_PREFIX_.'category_group` cg
@@ -2809,6 +2809,7 @@ class ProductCore extends ObjectModel
public static function defineProductImage($row, $id_lang) public static function defineProductImage($row, $id_lang)
{ {
if (isset($row['id_image']))
if ($row['id_image']) if ($row['id_image'])
return $row['id_product'].'-'.$row['id_image']; return $row['id_product'].'-'.$row['id_image'];
return Language::getIsoById((int)$id_lang).'-default'; return Language::getIsoById((int)$id_lang).'-default';
@@ -3606,7 +3607,7 @@ class ProductCore extends ObjectModel
$row = Db::getInstance()->getRow(' $row = Db::getInstance()->getRow('
SELECT `reference` SELECT `reference`
FROM `'._DB_PREFIX_.'product` p FROM `'._DB_PREFIX_.'product` p
WHERE p.reference = "'.$reference.'"'); WHERE p.reference = "'.pSQL($reference).'"');
return isset($row['reference']); return isset($row['reference']);
} }
+4 -4
View File
@@ -198,8 +198,8 @@ class SpecificPriceCore extends ObjectModel
return Db::getInstance()->Execute(' return Db::getInstance()->Execute('
INSERT INTO `'._DB_PREFIX_.'specific_price_priority` (`id_product`, `priority`) INSERT INTO `'._DB_PREFIX_.'specific_price_priority` (`id_product`, `priority`)
VALUES ('.(int)$id_product.',\''.rtrim($value, ';').'\') VALUES ('.(int)$id_product.',\''.pSQL(rtrim($value, ';')).'\')
ON DUPLICATE KEY UPDATE `priority` = \''.rtrim($value, ';').'\' ON DUPLICATE KEY UPDATE `priority` = \''.pSQL(rtrim($value, ';')).'\'
'); ');
} }
@@ -285,9 +285,9 @@ class SpecificPriceCore extends ObjectModel
`id_group` IN(0, '.(int)$id_group.') AND `id_group` IN(0, '.(int)$id_group.') AND
`from_quantity` = 1 AND `from_quantity` = 1 AND
( (
(`from` = \'0000-00-00 00:00:00\' OR \''.$beginning.'\' >= `from`) (`from` = \'0000-00-00 00:00:00\' OR \''.pSQL($beginning).'\' >= `from`)
AND AND
(`to` = \'0000-00-00 00:00:00\' OR \''.$ending.'\' <= `to`) (`to` = \'0000-00-00 00:00:00\' OR \''.pSQL($ending).'\' <= `to`)
) )
AND AND
`reduction` > 0 `reduction` > 0
+2 -2
View File
@@ -509,8 +509,8 @@ class ToolsCore
public static function safeOutput($string, $html = false) public static function safeOutput($string, $html = false)
{ {
if (!$html) if (!$html)
$string = @htmlentities(strip_tags($string), ENT_QUOTES, 'utf-8'); $string = strip_tags($string);
return $string; return @Tools::htmlentitiesUTF8($string, ENT_QUOTES);;
} }
public static function htmlentitiesUTF8($string, $type = ENT_QUOTES) public static function htmlentitiesUTF8($string, $type = ENT_QUOTES)
+1 -1
View File
@@ -303,7 +303,7 @@ abstract class DbCore
public function delete($table, $where = false, $limit = false, $use_cache = 1) public function delete($table, $where = false, $limit = false, $use_cache = 1)
{ {
$this->_result = false; $this->_result = false;
$sql = 'DELETE FROM `'.pSQL($table).'`'.($where ? ' WHERE '.$where : '').($limit ? ' LIMIT '.(int)$limit : ''); $sql = 'DELETE FROM `'.bqSQL($table).'`'.($where ? ' WHERE '.$where : '').($limit ? ' LIMIT '.(int)$limit : '');
$res = $this->query($sql); $res = $this->query($sql);
if ($use_cache AND _PS_CACHE_ENABLED_) if ($use_cache AND _PS_CACHE_ENABLED_)
Cache::getInstance()->deleteQuery($sql); Cache::getInstance()->deleteQuery($sql);
+5
View File
@@ -57,6 +57,11 @@ function pSQL($string, $htmlOK = false)
return Db::getInstance()->escape($string, $htmlOK); return Db::getInstance()->escape($string, $htmlOK);
} }
function bqSQL($string)
{
return str_replace('`', '\`', pSQL($string));
}
/** /**
* @deprecated * @deprecated
*/ */
+3
View File
@@ -178,6 +178,9 @@ class AuthControllerCore extends FrontController
$this->context->cart->secure_key = $customer->secure_key; $this->context->cart->secure_key = $customer->secure_key;
$this->context->cart->id_address_delivery = Address::getFirstCustomerAddressId((int)($customer->id)); $this->context->cart->id_address_delivery = Address::getFirstCustomerAddressId((int)($customer->id));
$this->context->cart->id_address_invoice = Address::getFirstCustomerAddressId((int)($customer->id)); $this->context->cart->id_address_invoice = Address::getFirstCustomerAddressId((int)($customer->id));
// If a logged guest logs in as a customer, the cart secure key was already set and needs to be updated
$this->context->cart->secure_key = $customer->secure_key;
$this->context->cart->update(); $this->context->cart->update();
Module::hookExec('createAccount', array( Module::hookExec('createAccount', array(
'_POST' => $_POST, '_POST' => $_POST,
+5 -5
View File
@@ -156,15 +156,15 @@ class CategoryControllerCore extends FrontController
{ {
$hookExecuted = false; $hookExecuted = false;
Module::hookExec('productListAssign', array('nbProducts' => &$this->nbProducts, 'catProducts' => &$this->cat_products, 'hookExecuted' => &$hookExecuted)); Module::hookExec('productListAssign', array('nbProducts' => &$this->nbProducts, 'catProducts' => &$this->cat_products, 'hookExecuted' => &$hookExecuted));
if (!$hookExecuted) if (!$hookExecuted) // The hook was not executed, standard working
{ {
self::$smarty->assign('categoryNameComplement', ''); $this->context->smarty->assign('categoryNameComplement', '');
$this->nbProducts = $this->category->getProducts(NULL, NULL, NULL, $this->orderBy, $this->orderWay, true); $this->nbProducts = $this->category->getProducts(NULL, NULL, NULL, $this->orderBy, $this->orderWay, true);
$this->pagination((int)$this->nbProducts); $this->pagination((int)$this->nbProducts); // Pagination must be call after "getProducts"
$this->cat_products = $this->category->getProducts($this->context->language->id, (int)$this->p, (int)$this->n, $this->orderBy, $this->orderWay); $this->cat_products = $this->category->getProducts($this->context->language->id, (int)$this->p, (int)$this->n, $this->orderBy, $this->orderWay);
} }
else else // Hook executed, use the override
$this->pagination((int)$this->nbProducts); $this->pagination((int)$this->nbProducts); // Pagination must be call after "getProducts"
self::$smarty->assign('nb_products', (int)$this->nbProducts); self::$smarty->assign('nb_products', (int)$this->nbProducts);
} }
} }
+3 -2
View File
@@ -34,7 +34,7 @@
<taxRule iso_code_country="sk" id_tax="1"/> <taxRule iso_code_country="sk" id_tax="1"/>
<taxRule iso_code_country="fi" id_tax="1"/> <taxRule iso_code_country="fi" id_tax="1"/>
<taxRule iso_code_country="se" id_tax="1"/> <taxRule iso_code_country="se" id_tax="1"/>
<taxRule iso_code_country="uk" id_tax="1"/> <taxRule iso_code_country="gb" id_tax="1"/>
</taxRulesGroup> </taxRulesGroup>
<taxRulesGroup name="UK Reduced Rate (5%)"> <taxRulesGroup name="UK Reduced Rate (5%)">
@@ -64,7 +64,7 @@
<taxRule iso_code_country="sk" id_tax="2"/> <taxRule iso_code_country="sk" id_tax="2"/>
<taxRule iso_code_country="fi" id_tax="2"/> <taxRule iso_code_country="fi" id_tax="2"/>
<taxRule iso_code_country="se" id_tax="2"/> <taxRule iso_code_country="se" id_tax="2"/>
<taxRule iso_code_country="uk" id_tax="2"/> <taxRule iso_code_country="gb" id_tax="2"/>
</taxRulesGroup> </taxRulesGroup>
</taxes> </taxes>
<units> <units>
@@ -75,3 +75,4 @@
<unit type="long_distance" value="mi"/> <unit type="long_distance" value="mi"/>
</units> </units>
</localizationPack> </localizationPack>
+1 -1
View File
@@ -104,7 +104,7 @@ class AdminPreferences extends AdminTab
if (empty($_SERVER['HTTPS']) OR strtolower($_SERVER['HTTPS']) == 'off') if (empty($_SERVER['HTTPS']) OR strtolower($_SERVER['HTTPS']) == 'off')
{ {
$this->_fieldsGeneral['PS_SSL_ENABLED']['type'] = 'disabled'; $this->_fieldsGeneral['PS_SSL_ENABLED']['type'] = 'disabled';
$this->_fieldsGeneral['PS_SSL_ENABLED']['disabled'] = '<a href="https://'.Tools14::getShopDomainSsl().$_SERVER['REQUEST_URI'].'">'.$this->l('Please click here to use HTTPS protocol before enabling SSL.').'</a>'; $this->_fieldsGeneral['PS_SSL_ENABLED']['disabled'] = '<a href="https://'.Tools14::getShopDomainSsl().Tools::safeOutput($_SERVER['REQUEST_URI']).'">'.$this->l('Please click here to use HTTPS protocol before enabling SSL.').'</a>';
} }
parent::__construct(); parent::__construct();
+1 -1
View File
@@ -61,7 +61,7 @@ class BirthdayPresent extends Module
$this->_html = ' $this->_html = '
<fieldset class="width3"><legend><img src="../modules/'.$this->name.'/logo.gif" /> '.$this->displayName.'</legend> <fieldset class="width3"><legend><img src="../modules/'.$this->name.'/logo.gif" /> '.$this->displayName.'</legend>
<p>'.$this->l('Create a voucher for customers celebrating their birthday and having at least one valid order').'</p> <p>'.$this->l('Create a voucher for customers celebrating their birthday and having at least one valid order').'</p>
<form action="'.$_SERVER['REQUEST_URI'].'" method="post" style="margin-top: 15px;"> <form action="'.Tools::safeOutput($_SERVER['REQUEST_URI']).'" method="post" style="margin-top: 15px;">
<label>'.$this->l('Active').'</label> <label>'.$this->l('Active').'</label>
<div class="margin-form"> <div class="margin-form">
<img src="../img/admin/enabled.gif" /> <input type="radio" name="bp_active" value="1"'.(Configuration::get('BIRTHDAY_ACTIVE') ? ' checked="checked"' : '').' /> <img src="../img/admin/enabled.gif" /> <input type="radio" name="bp_active" value="1"'.(Configuration::get('BIRTHDAY_ACTIVE') ? ' checked="checked"' : '').' />
@@ -169,7 +169,7 @@ class BlockAdvertising extends Module
$this->postProcess(); $this->postProcess();
$output = ''; $output = '';
$output .= ' $output .= '
<form action="'.$_SERVER['REQUEST_URI'].'" method="post" enctype="multipart/form-data"> <form action="'.Tools::safeOutput($_SERVER['REQUEST_URI']).'" method="post" enctype="multipart/form-data">
<fieldset><legend>'.$this->l('Advertising block configuration').'</legend> <fieldset><legend>'.$this->l('Advertising block configuration').'</legend>
<a href="'.$this->adv_link.'" target="_blank" title="'.$this->adv_title.'">'; <a href="'.$this->adv_link.'" target="_blank" title="'.$this->adv_title.'">';
if ($this->adv_img) if ($this->adv_img)
@@ -78,7 +78,7 @@ class BlockBestSellers extends Module
public function displayForm() public function displayForm()
{ {
return ' return '
<form action="'.$_SERVER['REQUEST_URI'].'" method="post"> <form action="'.Tools::safeOutput($_SERVER['REQUEST_URI']).'" method="post">
<fieldset> <fieldset>
<legend><img src="'.$this->_path.'logo.gif" alt="" title="" />'.$this->l('Settings').'</legend> <legend><img src="'.$this->_path.'logo.gif" alt="" title="" />'.$this->l('Settings').'</legend>
<label>'.$this->l('Always display block').'</label> <label>'.$this->l('Always display block').'</label>
+1 -1
View File
@@ -123,7 +123,7 @@ class BlockCart extends Module
public function displayForm() public function displayForm()
{ {
return ' return '
<form action="'.$_SERVER['REQUEST_URI'].'" method="post"> <form action="'.Tools::safeOutput($_SERVER['REQUEST_URI']).'" method="post">
<fieldset> <fieldset>
<legend><img src="'.$this->_path.'logo.gif" alt="" title="" />'.$this->l('Settings').'</legend> <legend><img src="'.$this->_path.'logo.gif" alt="" title="" />'.$this->l('Settings').'</legend>
+1 -1
View File
@@ -95,7 +95,7 @@ class BlockCategories extends Module
public function displayForm() public function displayForm()
{ {
return ' return '
<form action="'.$_SERVER['REQUEST_URI'].'" method="post"> <form action="'.Tools::safeOutput($_SERVER['REQUEST_URI']).'" method="post">
<fieldset> <fieldset>
<legend><img src="'.$this->_path.'logo.gif" alt="" title="" />'.$this->l('Settings').'</legend> <legend><img src="'.$this->_path.'logo.gif" alt="" title="" />'.$this->l('Settings').'</legend>
<label>'.$this->l('Maximum depth').'</label> <label>'.$this->l('Maximum depth').'</label>
@@ -1,13 +0,0 @@
<?php
include(dirname(__FILE__).'/../../config/config.inc.php');
include(dirname(__FILE__).'/../../init.php');
include(dirname(__FILE__).'/blocklayered.php');
if (substr(Tools::encrypt('blocklayered/index'),0,10) != Tools::getValue('token') || !Module::isInstalled('blocklayered'))
die('Bad token');
if(Tools::getValue('full'))
echo BlockLayered::fullindexProcess((int)Tools::getValue('cursor'), (int)Tools::getValue('ajax'), true);
else
echo BlockLayered::indexProcess((int)Tools::getValue('cursor'), (int)Tools::getValue('ajax'));
@@ -0,0 +1,29 @@
<?php
include(dirname(__FILE__).'/../../config/config.inc.php');
include(dirname(__FILE__).'/../../init.php');
include(dirname(__FILE__).'/blocklayered.php');
if (substr(Tools::encrypt('blocklayered/index'),0,10) != Tools::getValue('token') || !Module::isInstalled('blocklayered'))
die('Bad token');
if (!Tools::getValue('ajax'))
{
// Case of nothing to do but showing a message (1)
if (Tools::getValue('return_message') !== false)
{
echo '1';
die();
}
// Return a content without waiting the end of index execution
header('Location: '.Tools::getProtocol().Tools::getHttpHost().'/modules/blocklayered/blocklayered-price-indexer.php?token='.Tools::getValue('token') .'&return_message='.(int)Tools::getValue('cursor'));
flush();
}
if(Tools::getValue('full'))
{
echo BlockLayered::fullPricesIndexProcess((int)Tools::getValue('cursor'), (int)Tools::getValue('ajax'), true);
}
else
echo BlockLayered::pricesIndexProcess((int)Tools::getValue('cursor'), (int)Tools::getValue('ajax'));
@@ -9,4 +9,4 @@ if (substr(Tools::encrypt('blocklayered/index'),0,10) != Tools::getValue('token'
$blockLayered = new BlockLayered(); $blockLayered = new BlockLayered();
$cursor = Tools::jsonDecode(Tools::getValue('cursor', '{}'), true); $cursor = Tools::jsonDecode(Tools::getValue('cursor', '{}'), true);
echo $blockLayered->indexUrl($cursor, (int)Tools::getValue('ajax'), (int)Tools::getValue('truncate')); echo $blockLayered->indexUrl($cursor, (int)Tools::getValue('truncate'));
File diff suppressed because it is too large. Load diff
+3 -4
View File
@@ -14,7 +14,6 @@ $_MODULE['<{blocklayered}prestashop>blocklayered_b3786b970611c1a3809dd51b630812a
$_MODULE['<{blocklayered}prestashop>blocklayered_c3ef60194d18cf4026d22051b3a19428'] = 'Indexable :'; $_MODULE['<{blocklayered}prestashop>blocklayered_c3ef60194d18cf4026d22051b3a19428'] = 'Indexable :';
$_MODULE['<{blocklayered}prestashop>blocklayered_7c831eb524882fd27ecdab45019d1466'] = 'Utilise cet attribut dans l\'url généré par le module de bloc de navigation à facette'; $_MODULE['<{blocklayered}prestashop>blocklayered_7c831eb524882fd27ecdab45019d1466'] = 'Utilise cet attribut dans l\'url généré par le module de bloc de navigation à facette';
$_MODULE['<{blocklayered}prestashop>blocklayered_ccc12c5568381293a27db0232877937b'] = 'Nom du modèle de filtre nécessaire (ne peut être vide)'; $_MODULE['<{blocklayered}prestashop>blocklayered_ccc12c5568381293a27db0232877937b'] = 'Nom du modèle de filtre nécessaire (ne peut être vide)';
$_MODULE['<{blocklayered}prestashop>blocklayered_af1b98adf7f686b84cd0b443e022b7a0'] = 'Catégories';
$_MODULE['<{blocklayered}prestashop>blocklayered_817c37b9c1f5cd4a450dad384e63e6c7'] = 'Votre filtre'; $_MODULE['<{blocklayered}prestashop>blocklayered_817c37b9c1f5cd4a450dad384e63e6c7'] = 'Votre filtre';
$_MODULE['<{blocklayered}prestashop>blocklayered_3185cefd67b575e582063148e4f15860'] = 'a été mis à jour avec succès.'; $_MODULE['<{blocklayered}prestashop>blocklayered_3185cefd67b575e582063148e4f15860'] = 'a été mis à jour avec succès.';
$_MODULE['<{blocklayered}prestashop>blocklayered_7ccab4d8de5d6b9bb61e99c7bba343ab'] = 'a été ajouté avec succès.'; $_MODULE['<{blocklayered}prestashop>blocklayered_7ccab4d8de5d6b9bb61e99c7bba343ab'] = 'a été ajouté avec succès.';
@@ -35,9 +34,9 @@ $_MODULE['<{blocklayered}prestashop>blocklayered_16349835364cf839e6670b0de7da636
$_MODULE['<{blocklayered}prestashop>blocklayered_56fc8142961f1f3e9f9ec0c178881b69'] = '(En cours)'; $_MODULE['<{blocklayered}prestashop>blocklayered_56fc8142961f1f3e9f9ec0c178881b69'] = '(En cours)';
$_MODULE['<{blocklayered}prestashop>blocklayered_e1e43ed7e0922095a801341dca2f1822'] = 'Indexation des urls terminée'; $_MODULE['<{blocklayered}prestashop>blocklayered_e1e43ed7e0922095a801341dca2f1822'] = 'Indexation des urls terminée';
$_MODULE['<{blocklayered}prestashop>blocklayered_1c1783101d972ba096fff9756378b0e1'] = 'L\'indexation des urls a échoué'; $_MODULE['<{blocklayered}prestashop>blocklayered_1c1783101d972ba096fff9756378b0e1'] = 'L\'indexation des urls a échoué';
$_MODULE['<{blocklayered}prestashop>blocklayered_f83cc9b5e3192cbe1c40ec2effd6cbb4'] = 'Indexation des produits terminée'; $_MODULE['<{blocklayered}prestashop>blocklayered_e2dd8f544131eaf47a4f722ace7f876b'] = 'Indexation des prix terminée';
$_MODULE['<{blocklayered}prestashop>blocklayered_638041e8465b00f32e95eeef1d15fc77'] = '(En cours, %s produits à indexer)'; $_MODULE['<{blocklayered}prestashop>blocklayered_7cf7d150dd287df0a8e17eeb4cf2161d'] = '(En cours,% s produits à indexer)';
$_MODULE['<{blocklayered}prestashop>blocklayered_5e123b0351f06875436de2dfde577e19'] = 'Produit d\'indexation a échoué'; $_MODULE['<{blocklayered}prestashop>blocklayered_ceda32b8540dee4f1222cd482a513db8'] = 'L\'Indexation des prix a échouée';
$_MODULE['<{blocklayered}prestashop>blocklayered_a607dc3941415ecea04bb1eb8a978962'] = 'Modèles de filtres existants'; $_MODULE['<{blocklayered}prestashop>blocklayered_a607dc3941415ecea04bb1eb8a978962'] = 'Modèles de filtres existants';
$_MODULE['<{blocklayered}prestashop>blocklayered_9923a3739235561cc50eb9446dc1771e'] = 'modèles de filtres sont configurés :'; $_MODULE['<{blocklayered}prestashop>blocklayered_9923a3739235561cc50eb9446dc1771e'] = 'modèles de filtres sont configurés :';
$_MODULE['<{blocklayered}prestashop>blocklayered_b718adec73e04ce3ec720dd11a06a308'] = 'ID'; $_MODULE['<{blocklayered}prestashop>blocklayered_b718adec73e04ce3ec720dd11a06a308'] = 'ID';
+3 -3
View File
@@ -274,7 +274,7 @@ class BlockLink extends Module
</script> </script>
<fieldset> <fieldset>
<legend><img src="'.$this->_path.'add.png" alt="" title="" /> '.$this->l('Add a new link').'</legend> <legend><img src="'.$this->_path.'add.png" alt="" title="" /> '.$this->l('Add a new link').'</legend>
<form method="post" action="'.$_SERVER['REQUEST_URI'].'"> <form method="post" action="'.Tools::safeOutput($_SERVER['REQUEST_URI']).'">
<label>'.$this->l('Text:').'</label> <label>'.$this->l('Text:').'</label>
<div class="margin-form">'; <div class="margin-form">';
foreach ($languages as $language) foreach ($languages as $language)
@@ -299,7 +299,7 @@ class BlockLink extends Module
</fieldset> </fieldset>
<fieldset class="space"> <fieldset class="space">
<legend><img src="'.$this->_path.'logo.gif" alt="" title="" /> '.$this->l('Block title').'</legend> <legend><img src="'.$this->_path.'logo.gif" alt="" title="" /> '.$this->l('Block title').'</legend>
<form method="post" action="'.$_SERVER['REQUEST_URI'].'"> <form method="post" action="'.Tools::safeOutput($_SERVER['REQUEST_URI']).'">
<label>'.$this->l('Block title:').'</label> <label>'.$this->l('Block title:').'</label>
<div class="margin-form">'; <div class="margin-form">';
foreach ($languages as $language) foreach ($languages as $language)
@@ -318,7 +318,7 @@ class BlockLink extends Module
</fieldset> </fieldset>
<fieldset class="space"> <fieldset class="space">
<legend><img src="'.$this->_path.'prefs.gif" alt="" title="" /> '.$this->l('Settings').'</legend> <legend><img src="'.$this->_path.'prefs.gif" alt="" title="" /> '.$this->l('Settings').'</legend>
<form method="post" action="'.$_SERVER['REQUEST_URI'].'"> <form method="post" action="'.Tools::safeOutput($_SERVER['REQUEST_URI']).'">
<label>'.$this->l('Order list:').'</label> <label>'.$this->l('Order list:').'</label>
<div class="margin-form"> <div class="margin-form">
<select name="orderWay"> <select name="orderWay">
@@ -98,7 +98,7 @@ class BlockManufacturer extends Module
public function displayForm() public function displayForm()
{ {
$output = ' $output = '
<form action="'.$_SERVER['REQUEST_URI'].'" method="post"> <form action="'.Tools::safeOutput($_SERVER['REQUEST_URI']).'" method="post">
<fieldset><legend><img src="'.$this->_path.'logo.gif" alt="" title="" />'.$this->l('Settings').'</legend> <fieldset><legend><img src="'.$this->_path.'logo.gif" alt="" title="" />'.$this->l('Settings').'</legend>
<label>'.$this->l('Use a plain-text list').'</label> <label>'.$this->l('Use a plain-text list').'</label>
<div class="margin-form"> <div class="margin-form">
@@ -73,7 +73,7 @@ class BlockNewProducts extends Module
public function displayForm() public function displayForm()
{ {
$output = ' $output = '
<form action="'.$_SERVER['REQUEST_URI'].'" method="post"> <form action="'.Tools::safeOutput($_SERVER['REQUEST_URI']).'" method="post">
<fieldset><legend><img src="'.$this->_path.'logo.gif" alt="" title="" />'.$this->l('Settings').'</legend> <fieldset><legend><img src="'.$this->_path.'logo.gif" alt="" title="" />'.$this->l('Settings').'</legend>
<label>'.$this->l('Products displayed').'</label> <label>'.$this->l('Products displayed').'</label>
<div class="margin-form"> <div class="margin-form">
+1 -1
View File
@@ -117,7 +117,7 @@ class Blocknewsletter extends Module
private function _displayForm() private function _displayForm()
{ {
$this->_html .= ' $this->_html .= '
<form method="post" action="'.$_SERVER['REQUEST_URI'].'"> <form method="post" action="'.Tools::safeOutput($_SERVER['REQUEST_URI']).'">
<fieldset> <fieldset>
<legend><img src="'.$this->_path.'logo.gif" />'.$this->l('Settings').'</legend> <legend><img src="'.$this->_path.'logo.gif" />'.$this->l('Settings').'</legend>
<label>'.$this->l('Display configuration in a new page?').'</label> <label>'.$this->l('Display configuration in a new page?').'</label>
@@ -82,7 +82,7 @@ class BlockPaymentLogo extends Module
else else
{ {
$html .= ' $html .= '
<form action="'.$_SERVER['REQUEST_URI'].'" method="post"> <form action="'.Tools::safeOutput($_SERVER['REQUEST_URI']).'" method="post">
<fieldset> <fieldset>
<legend><img src="'.$this->_path.'/logo.gif" alt="" /> '.$this->l('Configure').'</legend> <legend><img src="'.$this->_path.'/logo.gif" alt="" /> '.$this->l('Configure').'</legend>
<label>'.$this->l('Page CMS for link').':</label> <label>'.$this->l('Page CMS for link').':</label>
+1 -1
View File
@@ -121,7 +121,7 @@ class Blockrss extends Module
public function displayForm() public function displayForm()
{ {
$output = ' $output = '
<form action="'.$_SERVER['REQUEST_URI'].'" method="post"> <form action="'.Tools::safeOutput($_SERVER['REQUEST_URI']).'" method="post">
<fieldset><legend><img src="'.$this->_path.'logo.gif" alt="" title="" />'.$this->l('Settings').'</legend> <fieldset><legend><img src="'.$this->_path.'logo.gif" alt="" title="" />'.$this->l('Settings').'</legend>
<label>'.$this->l('Block title').'</label> <label>'.$this->l('Block title').'</label>
<div class="margin-form"> <div class="margin-form">
+1 -1
View File
@@ -66,7 +66,7 @@ class BlockSpecials extends Module
public function displayForm() public function displayForm()
{ {
return ' return '
<form action="'.$_SERVER['REQUEST_URI'].'" method="post"> <form action="'.Tools::safeOutput($_SERVER['REQUEST_URI']).'" method="post">
<fieldset> <fieldset>
<legend><img src="'.$this->_path.'logo.gif" alt="" title="" />'.$this->l('Settings').'</legend> <legend><img src="'.$this->_path.'logo.gif" alt="" title="" />'.$this->l('Settings').'</legend>
<label>'.$this->l('Always display block').'</label> <label>'.$this->l('Always display block').'</label>
+1 -1
View File
@@ -102,7 +102,7 @@ class BlockStore extends Module
public function getContent() public function getContent()
{ {
$output = $this->postProcess().' $output = $this->postProcess().'
<form action="'.$_SERVER['REQUEST_URI'].'" method="post" enctype="multipart/form-data"> <form action="'.Tools::safeOutput($_SERVER['REQUEST_URI']).'" method="post" enctype="multipart/form-data">
<fieldset> <fieldset>
<legend>'.$this->l('Store block configuration').'</legend>'; <legend>'.$this->l('Store block configuration').'</legend>';
if (Configuration::get('BLOCKSTORE_IMG')) if (Configuration::get('BLOCKSTORE_IMG'))
+1 -1
View File
@@ -100,7 +100,7 @@ class BlockSupplier extends Module
public function displayForm() public function displayForm()
{ {
$output = ' $output = '
<form action="'.$_SERVER['REQUEST_URI'].'" method="post"> <form action="'.Tools::safeOutput($_SERVER['REQUEST_URI']).'" method="post">
<fieldset><legend><img src="'.$this->_path.'logo.gif" alt="" title="" />'.$this->l('Settings').'</legend> <fieldset><legend><img src="'.$this->_path.'logo.gif" alt="" title="" />'.$this->l('Settings').'</legend>
<label>'.$this->l('Use a plain-text list').'</label> <label>'.$this->l('Use a plain-text list').'</label>
<div class="margin-form"> <div class="margin-form">
+1 -1
View File
@@ -77,7 +77,7 @@ class BlockTags extends Module
public function displayForm() public function displayForm()
{ {
$output = ' $output = '
<form action="'.$_SERVER['REQUEST_URI'].'" method="post"> <form action="'.Tools::safeOutput($_SERVER['REQUEST_URI']).'" method="post">
<fieldset><legend><img src="'.$this->_path.'logo.gif" alt="" title="" />'.$this->l('Settings').'</legend> <fieldset><legend><img src="'.$this->_path.'logo.gif" alt="" title="" />'.$this->l('Settings').'</legend>
<label>'.$this->l('Tags displayed').'</label> <label>'.$this->l('Tags displayed').'</label>
<div class="margin-form"> <div class="margin-form">
+1 -1
View File
@@ -78,7 +78,7 @@ class BlockViewed extends Module
public function displayForm() public function displayForm()
{ {
$output = ' $output = '
<form action="'.$_SERVER['REQUEST_URI'].'" method="post"> <form action="'.Tools::safeOutput($_SERVER['REQUEST_URI']).'" method="post">
<fieldset><legend><img src="'.$this->_path.'logo.gif" alt="" title="" />'.$this->l('Settings').'</legend> <fieldset><legend><img src="'.$this->_path.'logo.gif" alt="" title="" />'.$this->l('Settings').'</legend>
<label>'.$this->l('Products displayed').'</label> <label>'.$this->l('Products displayed').'</label>
<div class="margin-form"> <div class="margin-form">
+2 -2
View File
@@ -115,7 +115,7 @@ class BlockWishList extends Module
if (!$id_customer) if (!$id_customer)
$id_customer = $customers[0]['id_customer']; $id_customer = $customers[0]['id_customer'];
$this->_html .= '<br /> $this->_html .= '<br />
<form action="'.$_SERVER['REQUEST_URI'].'" method="post" id="listing"> <form action="'.Tools::safeOutput($_SERVER['REQUEST_URI']).'" method="post" id="listing">
<fieldset> <fieldset>
<legend><img src="'.$this->_path.'img/icon/package_go.png" alt="" title="" />'.$this->l('Listing').'</legend> <legend><img src="'.$this->_path.'img/icon/package_go.png" alt="" title="" />'.$this->l('Listing').'</legend>
@@ -297,7 +297,7 @@ class BlockWishList extends Module
$this->_html .= $customer->lastname.' '.$customer->firstname.' '.$this->l('No wishlist.'); $this->_html .= $customer->lastname.' '.$customer->firstname.' '.$this->l('No wishlist.');
else else
{ {
$this->_html .= '<form action="'.$_SERVER['REQUEST_URI'].'" method="post" id="listing">'; $this->_html .= '<form action="'.Tools::safeOutput($_SERVER['REQUEST_URI']).'" method="post" id="listing">';
$id_wishlist = (int)(Tools::getValue('id_wishlist')); $id_wishlist = (int)(Tools::getValue('id_wishlist'));
if (!$id_wishlist) if (!$id_wishlist)
+27 -27
View File
@@ -380,9 +380,9 @@ class CanadaPost extends CarrierModule
if (isset($_GET['id_tab'])) if (isset($_GET['id_tab']))
$html .= '<script> $html .= '<script>
$(".menuTabButton.selected").removeClass("selected"); $(".menuTabButton.selected").removeClass("selected");
$("#menuTab'.Tools::getValue('id_tab').'").addClass("selected"); $("#menuTab'.Tools::safeOutput(Tools::getValue('id_tab')).'").addClass("selected");
$(".tabItem.selected").removeClass("selected"); $(".tabItem.selected").removeClass("selected");
$("#menuTab'.Tools::getValue('id_tab').'Sheet").addClass("selected"); $("#menuTab'.Tools::safeOutput(Tools::getValue('id_tab')).'Sheet").addClass("selected");
</script>'; </script>';
return $html; return $html;
} }
@@ -416,21 +416,21 @@ class CanadaPost extends CarrierModule
</style> </style>
<form action="index.php?tab='.Tools::getValue('tab').'&configure='.Tools::getValue('configure').'&token='.Tools::getValue('token').'&tab_module='.Tools::getValue('tab_module').'&module_name='.Tools::getValue('module_name').'&id_tab=1&section=general" method="post" class="form" id="configForm"> <form action="index.php?tab='.Tools::safeOutput(Tools::getValue('tab')).'&configure='.Tools::safeOutput(Tools::getValue('configure')).'&token='.Tools::safeOutput(Tools::getValue('token')).'&tab_module='.Tools::safeOutput(Tools::getValue('tab_module')).'&module_name='.Tools::safeOutput(Tools::getValue('module_name')).'&id_tab=1&section=general" method="post" class="form" id="configForm">
<fieldset style="border: 0px;"> <fieldset style="border: 0px;">
<h4>'.$this->l('General configuration').' :</h4> <h4>'.$this->l('General configuration').' :</h4>
<label>'.$this->l('Your Canada Post account').' : </label> <label>'.$this->l('Your Canada Post account').' : </label>
<div class="margin-form"><input type="text" size="20" name="cp_carrier_account" value="'.Tools::getValue('cp_carrier_account', Configuration::get('CP_CARRIER_ACCOUNT')).'" /></div> <div class="margin-form"><input type="text" size="20" name="cp_carrier_account" value="'.Tools::safeOutput(Tools::getValue('cp_carrier_account', Configuration::get('CP_CARRIER_ACCOUNT'))).'" /></div>
<br /><br /> <br /><br />
<label>'.$this->l('Packaging Weight').' : </label> <label>'.$this->l('Packaging Weight').' : </label>
<div class="margin-form"> <div class="margin-form">
<input type="text" size="5" name="cp_carrier_packaging_weight" value="'.Tools::getValue('cp_carrier_packaging_weight', Configuration::get('CP_CARRIER_PACKAGING_WEIGHT')).'" /> <input type="text" size="5" name="cp_carrier_packaging_weight" value="'.Tools::safeOutput(Tools::getValue('cp_carrier_packaging_weight', Configuration::get('CP_CARRIER_PACKAGING_WEIGHT'))).'" />
'.Tools::getValue('ps_weight_unit', Configuration::get('PS_WEIGHT_UNIT')).' '.Tools::safeOutput(Tools::getValue('ps_weight_unit', Configuration::get('PS_WEIGHT_UNIT'))).'
</div> </div>
<label>'.$this->l('Handling Fee').' : </label> <label>'.$this->l('Handling Fee').' : </label>
<div class="margin-form"> <div class="margin-form">
<input type="text" size="5" name="cp_carrier_handling_fee" value="'.Tools::getValue('cp_carrier_handling_fee', Configuration::get('CP_CARRIER_HANDLING_FEE')).'" /> <input type="text" size="5" name="cp_carrier_handling_fee" value="'.Tools::safeOutput(Tools::getValue('cp_carrier_handling_fee', Configuration::get('CP_CARRIER_HANDLING_FEE'))).'" />
'.$configCurrency->sign.' '.$configCurrency->sign.'
</div> </div>
</fieldset> </fieldset>
@@ -439,12 +439,12 @@ class CanadaPost extends CarrierModule
<h4>'.$this->l('Localization configuration').' :</h4> <h4>'.$this->l('Localization configuration').' :</h4>
<label>'.$this->l('Weight unit').' : </label> <label>'.$this->l('Weight unit').' : </label>
<div class="margin-form"> <div class="margin-form">
<input type="text" size="20" name="ps_weight_unit" value="'.Tools::getValue('ps_weight_unit', Configuration::get('PS_WEIGHT_UNIT')).'" /> <input type="text" size="20" name="ps_weight_unit" value="'.Tools::safeOutput(Tools::getValue('ps_weight_unit', Configuration::get('PS_WEIGHT_UNIT'))).'" />
<p>'.$this->l('The weight unit of your shop (eg. kg or lbs)').'</p> <p>'.$this->l('The weight unit of your shop (eg. kg or lbs)').'</p>
</div> </div>
<label>'.$this->l('Dimension unit').' : </label> <label>'.$this->l('Dimension unit').' : </label>
<div class="margin-form"> <div class="margin-form">
<input type="text" size="20" name="ps_dimension_unit" value="'.Tools::getValue('ps_dimension_unit', Configuration::get('PS_DIMENSION_UNIT')).'" /> <input type="text" size="20" name="ps_dimension_unit" value="'.Tools::safeOutput(Tools::getValue('ps_dimension_unit', Configuration::get('PS_DIMENSION_UNIT'))).'" />
<p>'.$this->l('The dimension unit of your shop (eg. cm or in)').'</p> <p>'.$this->l('The dimension unit of your shop (eg. cm or in)').'</p>
</div> </div>
</fieldset> </fieldset>
@@ -452,13 +452,13 @@ class CanadaPost extends CarrierModule
<fieldset style="border: 0px;"> <fieldset style="border: 0px;">
<h4>'.$this->l('Address configuration').' :</h4> <h4>'.$this->l('Address configuration').' :</h4>
<label>'.$this->l('Your address line 1').' : </label> <label>'.$this->l('Your address line 1').' : </label>
<div class="margin-form"><input type="text" size="20" name="cp_carrier_address1" value="'.Tools::getValue('cp_carrier_address1', Configuration::get('CP_CARRIER_ADDRESS1')).'" /></div> <div class="margin-form"><input type="text" size="20" name="cp_carrier_address1" value="'.Tools::safeOutput(Tools::getValue('cp_carrier_address1', Configuration::get('CP_CARRIER_ADDRESS1'))).'" /></div>
<label>'.$this->l('Your address line 2').' : </label> <label>'.$this->l('Your address line 2').' : </label>
<div class="margin-form"><input type="text" size="20" name="cp_carrier_address2" value="'.Tools::getValue('cp_carrier_address2', Configuration::get('CP_CARRIER_ADDRESS2')).'" /></div> <div class="margin-form"><input type="text" size="20" name="cp_carrier_address2" value="'.Tools::safeOutput(Tools::getValue('cp_carrier_address2', Configuration::get('CP_CARRIER_ADDRESS2'))).'" /></div>
<label>'.$this->l('Zip / Postal Code').' : </label> <label>'.$this->l('Zip / Postal Code').' : </label>
<div class="margin-form"><input type="text" size="20" name="cp_carrier_postal_code" value="'.Tools::getValue('cp_carrier_postal_code', Configuration::get('CP_CARRIER_POSTAL_CODE')).'" /></div><br /> <div class="margin-form"><input type="text" size="20" name="cp_carrier_postal_code" value="'.Tools::safeOutput(Tools::getValue('cp_carrier_postal_code', Configuration::get('CP_CARRIER_POSTAL_CODE'))).'" /></div><br />
<label>'.$this->l('Your City').' : </label> <label>'.$this->l('Your City').' : </label>
<div class="margin-form"><input type="text" size="20" name="cp_carrier_city" value="'.Tools::getValue('cp_carrier_city', Configuration::get('CP_CARRIER_CITY')).'" /></div> <div class="margin-form"><input type="text" size="20" name="cp_carrier_city" value="'.Tools::safeOutput(Tools::getValue('cp_carrier_city', Configuration::get('CP_CARRIER_CITY'))).'" /></div>
<label>'.$this->l('Country').' : </label> <label>'.$this->l('Country').' : </label>
<div class="margin-form"> <div class="margin-form">
<select name="cp_carrier_country" id="cp_carrier_country"> <select name="cp_carrier_country" id="cp_carrier_country">
@@ -732,10 +732,10 @@ class CanadaPost extends CarrierModule
<td>'.$c['additional_charges'].' '.$configCurrency->sign.'</td> <td>'.$c['additional_charges'].' '.$configCurrency->sign.'</td>
<td>'.$services.'</td> <td>'.$services.'</td>
<td> <td>
<a href="index.php?tab='.Tools::getValue('tab').'&configure='.Tools::getValue('configure').'&token='.Tools::getValue('token').'&tab_module='.Tools::getValue('tab_module').'&module_name='.Tools::getValue('module_name').'&id_tab=2&section=category&action=edit&id_cp_rate_config='.(int)($c['id_cp_rate_config']).'" style="float: left;"> <a href="index.php?tab='.Tools::safeOutput(Tools::getValue('tab')).'&configure='.Tools::safeOutput(Tools::getValue('configure')).'&token='.Tools::safeOutput(Tools::getValue('token')).'&tab_module='.Tools::safeOutput(Tools::getValue('tab_module')).'&module_name='.Tools::safeOutput(Tools::getValue('module_name')).'&id_tab=2&section=category&action=edit&id_cp_rate_config='.(int)($c['id_cp_rate_config']).'" style="float: left;">
<img src="'._PS_IMG_.'admin/edit.gif" /> <img src="'._PS_IMG_.'admin/edit.gif" />
</a> </a>
<form action="index.php?tab='.Tools::getValue('tab').'&configure='.Tools::getValue('configure').'&token='.Tools::getValue('token').'&tab_module='.Tools::getValue('tab_module').'&module_name='.Tools::getValue('module_name').'&id_tab=2&section=category&action=delete&id_cp_rate_config='.(int)($c['id_cp_rate_config']).'&id_category='.(int)($c['id_category']).'" method="post" class="form" style="float: left;"> <form action="index.php?tab='.Tools::safeOutput(Tools::getValue('tab')).'&configure='.Tools::safeOutput(Tools::getValue('configure')).'&token='.Tools::safeOutput(Tools::getValue('token')).'&tab_module='.Tools::safeOutput(Tools::getValue('tab_module')).'&module_name='.Tools::safeOutput(Tools::getValue('module_name')).'&id_tab=2&section=category&action=delete&id_cp_rate_config='.(int)($c['id_cp_rate_config']).'&id_category='.(int)($c['id_category']).'" method="post" class="form" style="float: left;">
<input name="submitSave" type="image" src="'._PS_IMG_.'admin/delete.gif" OnClick="return confirm(\''.$this->l('Are you sure you want to delete this specific Canada Post configuration for this category ?').'\');" /> <input name="submitSave" type="image" src="'._PS_IMG_.'admin/delete.gif" OnClick="return confirm(\''.$this->l('Are you sure you want to delete this specific Canada Post configuration for this category ?').'\');" />
</form> </form>
</td> </td>
@@ -761,13 +761,13 @@ class CanadaPost extends CarrierModule
$path .= $p; $path .= $p;
} }
$html .= '<p align="center"><b>'.$this->l('Update a rule').' (<a href="index.php?tab='.Tools::getValue('tab').'&configure='.Tools::getValue('configure').'&token='.Tools::getValue('token').'&tab_module='.Tools::getValue('tab_module').'&module_name='.Tools::getValue('module_name').'&id_tab=2&section=category&action=add">'.$this->l('Add a rule').' ?</a>)</b></p> $html .= '<p align="center"><b>'.$this->l('Update a rule').' (<a href="index.php?tab='.Tools::safeOutput(Tools::getValue('tab')).'&configure='.Tools::safeOutput(Tools::getValue('configure')).'&token='.Tools::safeOutput(Tools::getValue('token')).'&tab_module='.Tools::safeOutput(Tools::getValue('tab_module')).'&module_name='.Tools::safeOutput(Tools::getValue('module_name')).'&id_tab=2&section=category&action=add">'.$this->l('Add a rule').' ?</a>)</b></p>
<form action="index.php?tab='.Tools::getValue('tab').'&configure='.Tools::getValue('configure').'&token='.Tools::getValue('token').'&tab_module='.Tools::getValue('tab_module').'&module_name='.Tools::getValue('module_name').'&id_tab=2&section=category&action=edit&id_cp_rate_config='.(int)(Tools::getValue('id_cp_rate_config')).'" method="post" class="form"> <form action="index.php?tab='.Tools::safeOutput(Tools::getValue('tab')).'&configure='.Tools::safeOutput(Tools::getValue('configure')).'&token='.Tools::safeOutput(Tools::getValue('token')).'&tab_module='.Tools::safeOutput(Tools::getValue('tab_module')).'&module_name='.Tools::safeOutput(Tools::getValue('module_name')).'&id_tab=2&section=category&action=edit&id_cp_rate_config='.(int)(Tools::getValue('id_cp_rate_config')).'" method="post" class="form">
<label>'.$this->l('Category').' :</label> <label>'.$this->l('Category').' :</label>
<div class="margin-form" style="padding: 0.2em 0.5em 0 0; font-size: 12px;">'.$path.' <input type="hidden" name="id_category" value="'.(int)($configSelected['id_category']).'" /></div><br clear="left" /> <div class="margin-form" style="padding: 0.2em 0.5em 0 0; font-size: 12px;">'.$path.' <input type="hidden" name="id_category" value="'.(int)($configSelected['id_category']).'" /></div><br clear="left" />
<label>'.$this->l('Additional charges').' : </label> <label>'.$this->l('Additional charges').' : </label>
<div class="margin-form"><input type="text" size="20" name="additional_charges" value="'.Tools::getValue('additional_charges', $configSelected['additional_charges']).'" /></div><br /> <div class="margin-form"><input type="text" size="20" name="additional_charges" value="'.Tools::safeOutput(Tools::getValue('additional_charges', $configSelected['additional_charges'])).'" /></div><br />
<label>'.$this->l('Delivery Service').' : </label> <label>'.$this->l('Delivery Service').' : </label>
<div class="margin-form">'; <div class="margin-form">';
$rateServiceList = Db::getInstance()->ExecuteS('SELECT * FROM `'._DB_PREFIX_.'cp_rate_service_code`'); $rateServiceList = Db::getInstance()->ExecuteS('SELECT * FROM `'._DB_PREFIX_.'cp_rate_service_code`');
@@ -785,7 +785,7 @@ class CanadaPost extends CarrierModule
else else
{ {
$html .= '<p align="center"><b>'.$this->l('Add a rule').'</b></p> $html .= '<p align="center"><b>'.$this->l('Add a rule').'</b></p>
<form action="index.php?tab='.Tools::getValue('tab').'&configure='.Tools::getValue('configure').'&token='.Tools::getValue('token').'&tab_module='.Tools::getValue('tab_module').'&module_name='.Tools::getValue('module_name').'&id_tab=2&section=category&action=add" method="post" class="form"> <form action="index.php?tab='.Tools::safeOutput(Tools::getValue('tab')).'&configure='.Tools::safeOutput(Tools::getValue('configure')).'&token='.Tools::safeOutput(Tools::getValue('token')).'&tab_module='.Tools::safeOutput(Tools::getValue('tab_module')).'&module_name='.Tools::safeOutput(Tools::getValue('module_name')).'&id_tab=2&section=category&action=add" method="post" class="form">
<label>'.$this->l('Category').' : </label> <label>'.$this->l('Category').' : </label>
<div class="margin-form"> <div class="margin-form">
<select name="id_category"> <select name="id_category">
@@ -794,7 +794,7 @@ class CanadaPost extends CarrierModule
</select> </select>
</div> </div>
<label>'.$this->l('Additional charges').' : </label> <label>'.$this->l('Additional charges').' : </label>
<div class="margin-form"><input type="text" size="20" name="additional_charges" value="'.Tools::getValue('additional_charges').'" /></div><br /> <div class="margin-form"><input type="text" size="20" name="additional_charges" value="'.Tools::safeOutput(Tools::getValue('additional_charges')).'" /></div><br />
<label>'.$this->l('Delivery Service').' : </label> <label>'.$this->l('Delivery Service').' : </label>
<div class="margin-form">'; <div class="margin-form">';
$rateServiceList = Db::getInstance()->ExecuteS('SELECT * FROM `'._DB_PREFIX_.'cp_rate_service_code`'); $rateServiceList = Db::getInstance()->ExecuteS('SELECT * FROM `'._DB_PREFIX_.'cp_rate_service_code`');
@@ -963,10 +963,10 @@ class CanadaPost extends CarrierModule
<td>'.$c['additional_charges'].' '.$configCurrency->sign.'</td> <td>'.$c['additional_charges'].' '.$configCurrency->sign.'</td>
<td>'.$services.'</td> <td>'.$services.'</td>
<td> <td>
<a href="index.php?tab='.Tools::getValue('tab').'&configure='.Tools::getValue('configure').'&token='.Tools::getValue('token').'&tab_module='.Tools::getValue('tab_module').'&module_name='.Tools::getValue('module_name').'&id_tab=3&section=product&action=edit&id_cp_rate_config='.(int)($c['id_cp_rate_config']).'" style="float: left;"> <a href="index.php?tab='.Tools::safeOutput(Tools::getValue('tab')).'&configure='.Tools::safeOutput(Tools::getValue('configure')).'&token='.Tools::safeOutput(Tools::getValue('token')).'&tab_module='.Tools::safeOutput(Tools::getValue('tab_module')).'&module_name='.Tools::safeOutput(Tools::getValue('module_name')).'&id_tab=3&section=product&action=edit&id_cp_rate_config='.(int)($c['id_cp_rate_config']).'" style="float: left;">
<img src="'._PS_IMG_.'admin/edit.gif" /> <img src="'._PS_IMG_.'admin/edit.gif" />
</a> </a>
<form action="index.php?tab='.Tools::getValue('tab').'&configure='.Tools::getValue('configure').'&token='.Tools::getValue('token').'&tab_module='.Tools::getValue('tab_module').'&module_name='.Tools::getValue('module_name').'&id_tab=3&section=product&action=delete&id_cp_rate_config='.(int)($c['id_cp_rate_config']).'&id_product='.(int)($c['id_product']).'" method="post" class="form" style="float: left;"> <form action="index.php?tab='.Tools::safeOutput(Tools::getValue('tab')).'&configure='.Tools::safeOutput(Tools::getValue('configure')).'&token='.Tools::safeOutput(Tools::getValue('token')).'&tab_module='.Tools::safeOutput(Tools::getValue('tab_module')).'&module_name='.Tools::safeOutput(Tools::getValue('module_name')).'&id_tab=3&section=product&action=delete&id_cp_rate_config='.(int)($c['id_cp_rate_config']).'&id_product='.(int)($c['id_product']).'" method="post" class="form" style="float: left;">
<input name="submitSave" type="image" src="'._PS_IMG_.'admin/delete.gif" OnClick="return confirm(\''.$this->l('Are you sure you want to delete this specific Canada Post configuration for this product ?').'\');" /> <input name="submitSave" type="image" src="'._PS_IMG_.'admin/delete.gif" OnClick="return confirm(\''.$this->l('Are you sure you want to delete this specific Canada Post configuration for this product ?').'\');" />
</form> </form>
</td> </td>
@@ -984,13 +984,13 @@ class CanadaPost extends CarrierModule
$configSelected = Db::getInstance()->getRow('SELECT * FROM `'._DB_PREFIX_.'cp_rate_config` WHERE `id_cp_rate_config` = '.(int)(Tools::getValue('id_cp_rate_config'))); $configSelected = Db::getInstance()->getRow('SELECT * FROM `'._DB_PREFIX_.'cp_rate_config` WHERE `id_cp_rate_config` = '.(int)(Tools::getValue('id_cp_rate_config')));
$product = new Product((int)$configSelected['id_product'], false, (int)$this->context->language->id); $product = new Product((int)$configSelected['id_product'], false, (int)$this->context->language->id);
$html .= '<p align="center"><b>'.$this->l('Update a rule').' (<a href="index.php?tab='.Tools::getValue('tab').'&configure='.Tools::getValue('configure').'&token='.Tools::getValue('token').'&tab_module='.Tools::getValue('tab_module').'&module_name='.Tools::getValue('module_name').'&id_tab=3&section=product&action=add">'.$this->l('Add a rule').' ?</a>)</b></p> $html .= '<p align="center"><b>'.$this->l('Update a rule').' (<a href="index.php?tab='.Tools::safeOutput(Tools::getValue('tab')).'&configure='.Tools::safeOutput(Tools::getValue('configure')).'&token='.Tools::safeOutput(Tools::getValue('token')).'&tab_module='.Tools::safeOutput(Tools::getValue('tab_module')).'&module_name='.Tools::safeOutput(Tools::getValue('module_name')).'&id_tab=3&section=product&action=add">'.$this->l('Add a rule').' ?</a>)</b></p>
<form action="index.php?tab='.Tools::getValue('tab').'&configure='.Tools::getValue('configure').'&token='.Tools::getValue('token').'&tab_module='.Tools::getValue('tab_module').'&module_name='.Tools::getValue('module_name').'&id_tab=3&section=product&action=edit&id_cp_rate_config='.(int)(Tools::getValue('id_cp_rate_config')).'" method="post" class="form"> <form action="index.php?tab='.Tools::safeOutput(Tools::getValue('tab')).'&configure='.Tools::safeOutput(Tools::getValue('configure')).'&token='.Tools::safeOutput(Tools::getValue('token')).'&tab_module='.Tools::safeOutput(Tools::getValue('tab_module')).'&module_name='.Tools::safeOutput(Tools::getValue('module_name')).'&id_tab=3&section=product&action=edit&id_cp_rate_config='.(int)(Tools::getValue('id_cp_rate_config')).'" method="post" class="form">
<label>'.$this->l('Product').' :</label> <label>'.$this->l('Product').' :</label>
<div class="margin-form" style="padding: 0.2em 0.5em 0 0; font-size: 12px;">'.$product->name.' <input type="hidden" name="id_product" value="'.(int)($configSelected['id_product']).'" /></div><br clear="left" /> <div class="margin-form" style="padding: 0.2em 0.5em 0 0; font-size: 12px;">'.$product->name.' <input type="hidden" name="id_product" value="'.(int)($configSelected['id_product']).'" /></div><br clear="left" />
<label>'.$this->l('Additional charges').' : </label> <label>'.$this->l('Additional charges').' : </label>
<div class="margin-form"><input type="text" size="20" name="additional_charges" value="'.Tools::getValue('additional_charges', $configSelected['additional_charges']).'" /></div><br /> <div class="margin-form"><input type="text" size="20" name="additional_charges" value="'.Tools::safeOutput(Tools::getValue('additional_charges', $configSelected['additional_charges'])).'" /></div><br />
<label>'.$this->l('Delivery Service').' : </label> <label>'.$this->l('Delivery Service').' : </label>
<div class="margin-form">'; <div class="margin-form">';
$rateServiceList = Db::getInstance()->ExecuteS('SELECT * FROM `'._DB_PREFIX_.'cp_rate_service_code`'); $rateServiceList = Db::getInstance()->ExecuteS('SELECT * FROM `'._DB_PREFIX_.'cp_rate_service_code`');
@@ -1008,7 +1008,7 @@ class CanadaPost extends CarrierModule
else else
{ {
$html .= '<p align="center"><b>'.$this->l('Add a rule').'</b></p> $html .= '<p align="center"><b>'.$this->l('Add a rule').'</b></p>
<form action="index.php?tab='.Tools::getValue('tab').'&configure='.Tools::getValue('configure').'&token='.Tools::getValue('token').'&tab_module='.Tools::getValue('tab_module').'&module_name='.Tools::getValue('module_name').'&id_tab=3&section=product&action=add" method="post" class="form"> <form action="index.php?tab='.Tools::safeOutput(Tools::getValue('tab')).'&configure='.Tools::safeOutput(Tools::getValue('configure')).'&token='.Tools::safeOutput(Tools::getValue('token')).'&tab_module='.Tools::safeOutput(Tools::getValue('tab_module')).'&module_name='.Tools::safeOutput(Tools::getValue('module_name')).'&id_tab=3&section=product&action=add" method="post" class="form">
<label>'.$this->l('Product').' : </label> <label>'.$this->l('Product').' : </label>
<div class="margin-form"> <div class="margin-form">
<select name="id_product"> <select name="id_product">
@@ -1024,7 +1024,7 @@ class CanadaPost extends CarrierModule
</div> </div>
<label>'.$this->l('Additional charges').' : </label> <label>'.$this->l('Additional charges').' : </label>
<div class="margin-form"><input type="text" size="20" name="additional_charges" value="'.Tools::getValue('additional_charges').'" /></div><br /> <div class="margin-form"><input type="text" size="20" name="additional_charges" value="'.Tools::safeOutput(Tools::getValue('additional_charges')).'" /></div><br />
<label>'.$this->l('Delivery Service').' : </label> <label>'.$this->l('Delivery Service').' : </label>
<div class="margin-form">'; <div class="margin-form">';
$rateServiceList = Db::getInstance()->ExecuteS('SELECT * FROM `'._DB_PREFIX_.'cp_rate_service_code`'); $rateServiceList = Db::getInstance()->ExecuteS('SELECT * FROM `'._DB_PREFIX_.'cp_rate_service_code`');
+1 -1
View File
@@ -82,7 +82,7 @@ class CrossSelling extends Module
$this->_html .= $this->displayConfirmation($this->l('Settings updated successfully')); $this->_html .= $this->displayConfirmation($this->l('Settings updated successfully'));
} }
$this->_html .= ' $this->_html .= '
<form action="'.$_SERVER['REQUEST_URI'].'" method="post"> <form action="'.Tools::safeOutput($_SERVER['REQUEST_URI']).'" method="post">
<fieldset><legend><img src="'.$this->_path.'logo.gif" alt="" title="" />'.$this->l('Settings').'</legend> <fieldset><legend><img src="'.$this->_path.'logo.gif" alt="" title="" />'.$this->l('Settings').'</legend>
<label>'.$this->l('Display price on products').'</label> <label>'.$this->l('Display price on products').'</label>
<div class="margin-form"> <div class="margin-form">
+5 -5
View File
@@ -477,16 +477,16 @@ class Dejala extends CarrierModule
if (!isset($_GET['cat']) || ($_GET['cat']==='home') || ($_GET['cat']==='')) if (!isset($_GET['cat']) || ($_GET['cat']==='home') || ($_GET['cat']===''))
$currentTab="home"; $currentTab = "home";
else else
$currentTab=$_GET['cat']; $currentTab = $_GET['cat'];
$this->context->smarty->assign("currentTab", $currentTab); $this->context->smarty->assign("currentTab", $currentTab);
$this->context->smarty->assign("moduleConfigURL", 'index.php?tab=AdminModules&configure=dejala&token='.$_GET['token']); $this->context->smarty->assign("moduleConfigURL", 'index.php?tab=AdminModules&configure=dejala&token='.$_GET['token']);
$this->context->smarty->assign("formAction", $_SERVER['REQUEST_URI']); $this->context->smarty->assign("formAction", Tools::safeOutput($_SERVER['REQUEST_URI']));
$outputMenu = $this->display(__FILE__, 'dejala_menu.tpl'); $outputMenu = $this->display(__FILE__, 'dejala_menu.tpl');
if ($currentTab==='home') if ($currentTab === 'home')
{ {
$this->context->smarty->assign("login", html_entity_decode(Configuration::get('PS_SHOP_EMAIL'), ENT_COMPAT, 'UTF-8')); $this->context->smarty->assign("login", html_entity_decode(Configuration::get('PS_SHOP_EMAIL'), ENT_COMPAT, 'UTF-8'));
if ($registered) if ($registered)
@@ -1005,7 +1005,7 @@ class Dejala extends CarrierModule
else else
{ {
$_html = ''; $_html = '';
$_html .= '<form action="'.$_SERVER['REQUEST_URI'].'" method="post">'; $_html .= '<form action="'.Tools::safeOutput($_SERVER['REQUEST_URI']).'" method="post">';
$_html .= '<input type="hidden" name="dejala_action" value="order">'; $_html .= '<input type="hidden" name="dejala_action" value="order">';
$_html .= '<input type="submit" value="Commander la course">'; $_html .= '<input type="submit" value="Commander la course">';
$_html .= '</form><br />'; $_html .= '</form><br />';
+16 -16
View File
@@ -526,7 +526,7 @@ class Ebay extends Module
if (Tools::getValue('ebay_country_default_fr') == 'ok') if (Tools::getValue('ebay_country_default_fr') == 'ok')
$this->context->cookie->ebay_country_default_fr = true; $this->context->cookie->ebay_country_default_fr = true;
if (strtolower($this->context->country->iso_code) != 'fr' && !isset($this->context->cookie->ebay_country_default_fr)) if (strtolower($this->context->country->iso_code) != 'fr' && !isset($this->context->cookie->ebay_country_default_fr))
return $this->_html.$this->displayError($this->l('eBay module currently works only for eBay.fr').'. <a href="'.$_SERVER['REQUEST_URI'].'&ebay_country_default_fr=ok">'.$this->l('Continue anyway ?').'</a>'); return $this->_html.$this->displayError($this->l('eBay module currently works only for eBay.fr').'. <a href="'.Tools::safeOutput($_SERVER['REQUEST_URI']).'&ebay_country_default_fr=ok">'.$this->l('Continue anyway ?').'</a>');
// Checking Extension // Checking Extension
@@ -653,7 +653,7 @@ class Ebay extends Module
success: function(data) success: function(data)
{ {
if (data == \'OK\') if (data == \'OK\')
window.location.href = \''.$_SERVER['REQUEST_URI'].'&action=validateToken\'; window.location.href = \''.Tools::safeOutput($_SERVER['REQUEST_URI']).'&action=validateToken\';
else else
setTimeout ("checkToken()", 5000); setTimeout ("checkToken()", 5000);
} }
@@ -690,7 +690,7 @@ class Ebay extends Module
}); });
}); });
</script> </script>
<form action="'.$_SERVER['REQUEST_URI'].'&action=logged" method="post"> <form action="'.Tools::safeOutput($_SERVER['REQUEST_URI']).'&action=logged" method="post">
<fieldset> <fieldset>
<legend><img src="'.$this->_path.'logo.gif" alt="" title="" />'.$this->l('Register the module on eBay').'</legend> <legend><img src="'.$this->_path.'logo.gif" alt="" title="" />'.$this->l('Register the module on eBay').'</legend>
<label>'.$this->l('Click on the button below').'</label> <label>'.$this->l('Click on the button below').'</label>
@@ -763,9 +763,9 @@ class Ebay extends Module
if (isset($_GET['id_tab'])) if (isset($_GET['id_tab']))
$html .= '<script> $html .= '<script>
$(".menuTabButton.selected").removeClass("selected"); $(".menuTabButton.selected").removeClass("selected");
$("#menuTab'.$_GET['id_tab'].'").addClass("selected"); $("#menuTab'.Tools::safeOutput($_GET['id_tab']).'").addClass("selected");
$(".tabItem.selected").removeClass("selected"); $(".tabItem.selected").removeClass("selected");
$("#menuTab'.$_GET['id_tab'].'Sheet").addClass("selected"); $("#menuTab'.Tools::safeOutput($_GET['id_tab']).'Sheet").addClass("selected");
</script>'; </script>';
return $html; return $html;
} }
@@ -777,22 +777,22 @@ class Ebay extends Module
// Display Form // Display Form
$html = '<form action="index.php?tab='.$_GET['tab'].'&configure='.$_GET['configure'].'&token='.$_GET['token'].'&tab_module='.$_GET['tab_module'].'&module_name='.$_GET['module_name'].'&id_tab=1&section=parameters" method="post" class="form" id="configForm1"> $html = '<form action="index.php?tab='.Tools::safeOutput($_GET['tab']).'&configure='.Tools::safeOutput($_GET['configure']).'&token='.Tools::safeOutput($_GET['token']).'&tab_module='.Tools::safeOutput($_GET['tab_module']).'&module_name='.Tools::safeOutput($_GET['module_name']).'&id_tab=1&section=parameters" method="post" class="form" id="configForm1">
<fieldset style="border: 0"> <fieldset style="border: 0">
<h4>'.$this->l('To export your products on eBay, you have to create a pro account on eBay (see Help) and configure your eBay-Prestashop module.').'</h4> <h4>'.$this->l('To export your products on eBay, you have to create a pro account on eBay (see Help) and configure your eBay-Prestashop module.').'</h4>
<label>'.$this->l('eBay Identifier').' : </label> <label>'.$this->l('eBay Identifier').' : </label>
<div class="margin-form"> <div class="margin-form">
<input type="text" size="20" name="ebay_identifier" value="'.Tools::getValue('ebay_identifier', Configuration::get('EBAY_IDENTIFIER')).'" /> <input type="text" size="20" name="ebay_identifier" value="'.Tools::safeOutput(Tools::getValue('ebay_identifier', Configuration::get('EBAY_IDENTIFIER'))).'" />
<p>'.(Configuration::get('EBAY_IDENTIFIER') ? '<a href="http://shop.ebay.fr/'.Configuration::get('EBAY_IDENTIFIER').'/m.html?_ipg=50&_sop=12&_rdc=1" target="_blank">'.$this->l('Your products on eBay').'</a>' : $this->l('Your eBay identifier')).'</p> <p>'.(Configuration::get('EBAY_IDENTIFIER') ? '<a href="http://shop.ebay.fr/'.Configuration::get('EBAY_IDENTIFIER').'/m.html?_ipg=50&_sop=12&_rdc=1" target="_blank">'.$this->l('Your products on eBay').'</a>' : $this->l('Your eBay identifier')).'</p>
</div> </div>
<label>'.$this->l('eBay shop').' : </label> <label>'.$this->l('eBay shop').' : </label>
<div class="margin-form"> <div class="margin-form">
<input type="text" size="20" name="ebay_shop" value="'.Tools::getValue('ebay_shop', Configuration::get('EBAY_SHOP')).'" /> <input type="text" size="20" name="ebay_shop" value="'.Tools::safeOutput(Tools::getValue('ebay_shop', Configuration::get('EBAY_SHOP'))).'" />
<p>'.(Configuration::get('EBAY_SHOP') ? '<a href="http://stores.ebay.fr/'.Configuration::get('EBAY_SHOP').'" target="_blank">'.$this->l('Your shop on eBay').'</a>' : $this->l('Your eBay shop name')).'</p> <p>'.(Configuration::get('EBAY_SHOP') ? '<a href="http://stores.ebay.fr/'.Configuration::get('EBAY_SHOP').'" target="_blank">'.$this->l('Your shop on eBay').'</a>' : $this->l('Your eBay shop name')).'</p>
</div> </div>
<label>'.$this->l('Paypal Identifier (e-mail)').' : </label> <label>'.$this->l('Paypal Identifier (e-mail)').' : </label>
<div class="margin-form"> <div class="margin-form">
<input type="text" size="20" name="ebay_paypal_email" value="'.Tools::getValue('ebay_paypal_email', Configuration::get('EBAY_PAYPAL_EMAIL')).'" /> <input type="text" size="20" name="ebay_paypal_email" value="'.Tools::safeOutput(Tools::getValue('ebay_paypal_email', Configuration::get('EBAY_PAYPAL_EMAIL'))).'" />
<p>'.$this->l('You have to set your PayPal e-mail account, it\'s the only payment available with this module').'</p> <p>'.$this->l('You have to set your PayPal e-mail account, it\'s the only payment available with this module').'</p>
</div> </div>
<label>'.$this->l('Shipping method').' : </label> <label>'.$this->l('Shipping method').' : </label>
@@ -805,12 +805,12 @@ class Ebay extends Module
</div> </div>
<label>'.$this->l('Shipping cost').' : </label> <label>'.$this->l('Shipping cost').' : </label>
<div class="margin-form"> <div class="margin-form">
<input type="text" size="20" name="ebay_shipping_cost" value="'.Tools::getValue('ebay_shipping_cost', Configuration::get('EBAY_SHIPPING_COST')).'" /> '.$configCurrency->sign.' <input type="text" size="20" name="ebay_shipping_cost" value="'.Tools::safeOutput(Tools::getValue('ebay_shipping_cost', Configuration::get('EBAY_SHIPPING_COST'))).'" /> '.$configCurrency->sign.'
<p>'.$this->l('Shipping cost configuration for your products on eBay').'</p> <p>'.$this->l('Shipping cost configuration for your products on eBay').'</p>
</div> </div>
<label>'.$this->l('Shop postal code').' : </label> <label>'.$this->l('Shop postal code').' : </label>
<div class="margin-form"> <div class="margin-form">
<input type="text" size="20" name="ebay_shop_postalcode" value="'.Tools::getValue('ebay_shop_postalcode', Configuration::get('EBAY_SHOP_POSTALCODE')).'" /> <input type="text" size="20" name="ebay_shop_postalcode" value="'.Tools::safeOutput(Tools::getValue('ebay_shop_postalcode', Configuration::get('EBAY_SHOP_POSTALCODE'))).'" />
<p>'.$this->l('Your shop\'s postal code').'</p> <p>'.$this->l('Your shop\'s postal code').'</p>
</div> </div>
</fieldset> </fieldset>
@@ -932,13 +932,13 @@ class Ebay extends Module
// Display header // Display header
$html = '<p><b>'.$this->l('To export your products on eBay, you have to associate each one of your shop categories to an eBay category. You can also define an impact of your price on eBay.').'</b></p><br /> $html = '<p><b>'.$this->l('To export your products on eBay, you have to associate each one of your shop categories to an eBay category. You can also define an impact of your price on eBay.').'</b></p><br />
<form action="index.php?tab='.$_GET['tab'].'&configure='.$_GET['configure'].'&token='.$_GET['token'].'&tab_module='.$_GET['tab_module'].'&module_name='.$_GET['module_name'].'&id_tab=2&section=category&action=suggestCategories" method="post" class="form" id="configForm2SuggestedCategories"> <form action="index.php?tab='.Tools::safeOutput($_GET['tab']).'&configure='.Tools::safeOutput($_GET['configure']).'&token='.Tools::safeOutput($_GET['token']).'&tab_module='.Tools::safeOutput($_GET['tab_module']).'&module_name='.Tools::safeOutput($_GET['module_name']).'&id_tab=2&section=category&action=suggestCategories" method="post" class="form" id="configForm2SuggestedCategories">
<p><b>'.$this->l('You can use the button below to associate automatically the categories which have no association for the moment with an eBay suggested category.').'</b> <p><b>'.$this->l('You can use the button below to associate automatically the categories which have no association for the moment with an eBay suggested category.').'</b>
<input class="button" name="submitSave" type="submit" value="'.$this->l('Suggest Categories').'" /> <input class="button" name="submitSave" type="submit" value="'.$this->l('Suggest Categories').'" />
</p><br /> </p><br />
</form> </form>
<form action="index.php?tab='.$_GET['tab'].'&configure='.$_GET['configure'].'&token='.$_GET['token'].'&tab_module='.$_GET['tab_module'].'&module_name='.$_GET['module_name'].'&id_tab=2&section=category" method="post" class="form" id="configForm2"> <form action="index.php?tab='.Tools::safeOutput($_GET['tab']).'&configure='.Tools::safeOutput($_GET['configure']).'&token='.Tools::safeOutput($_GET['token']).'&tab_module='.Tools::safeOutput($_GET['tab_module']).'&module_name='.Tools::safeOutput($_GET['module_name']).'&id_tab=2&section=category" method="post" class="form" id="configForm2">
<table class="table tableDnD" cellpadding="0" cellspacing="0" width="100%"> <table class="table tableDnD" cellpadding="0" cellspacing="0" width="100%">
<thead> <thead>
<tr class="nodrag nodrop"> <tr class="nodrag nodrop">
@@ -1108,10 +1108,10 @@ class Ebay extends Module
$ad = dirname($_SERVER["PHP_SELF"]); $ad = dirname($_SERVER["PHP_SELF"]);
// Display Form // Display Form
$html = '<form action="index.php?tab='.$_GET['tab'].'&configure='.$_GET['configure'].'&token='.$_GET['token'].'&tab_module='.$_GET['tab_module'].'&module_name='.$_GET['module_name'].'&id_tab=3&section=template" method="post" class="form" id="configForm3"> $html = '<form action="index.php?tab='.Tools::safeOutput($_GET['tab']).'&configure='.Tools::safeOutput($_GET['configure']).'&token='.Tools::safeOutput($_GET['token']).'&tab_module='.Tools::safeOutput($_GET['tab_module']).'&module_name='.Tools::safeOutput($_GET['module_name']).'&id_tab=3&section=template" method="post" class="form" id="configForm3">
<fieldset style="border: 0"> <fieldset style="border: 0">
<h4>'.$this->l('You can customise the template for your products page on eBay').' :</h4> <h4>'.$this->l('You can customise the template for your products page on eBay').' :</h4>
<textarea class="rte" cols="100" rows="50" name="ebay_product_template">'.Tools::getValue('ebay_product_template', Configuration::get('EBAY_PRODUCT_TEMPLATE')).'</textarea><br /> <textarea class="rte" cols="100" rows="50" name="ebay_product_template">'.Tools::safeOutput(Tools::getValue('ebay_product_template', Configuration::get('EBAY_PRODUCT_TEMPLATE'))).'</textarea><br />
'.(substr(_PS_VERSION_, 0, 3) == '1.3' ? ' '.(substr(_PS_VERSION_, 0, 3) == '1.3' ? '
<script type="text/javascript" src="'.__PS_BASE_URI__.'js/tinymce/jscripts/tiny_mce/tiny_mce.js"></script> <script type="text/javascript" src="'.__PS_BASE_URI__.'js/tinymce/jscripts/tiny_mce/tiny_mce.js"></script>
@@ -1289,7 +1289,7 @@ class Ebay extends Module
<div id="resultSync" style="text-align: center; font-weight: bold; font-size: 14px;"></div> <div id="resultSync" style="text-align: center; font-weight: bold; font-size: 14px;"></div>
<form action="index.php?tab='.$_GET['tab'].'&configure='.$_GET['configure'].'&token='.$_GET['token'].'&tab_module='.$_GET['tab_module'].'&module_name='.$_GET['module_name'].'&id_tab=4&section=sync" method="post" class="form" id="configForm4"> <form action="index.php?tab='.Tools::safeOutput($_GET['tab']).'&configure='.Tools::safeOutput($_GET['configure']).'&token='.Tools::safeOutput($_GET['token']).'&tab_module='.Tools::safeOutput($_GET['tab_module']).'&module_name='.Tools::safeOutput($_GET['module_name']).'&id_tab=4&section=sync" method="post" class="form" id="configForm4">
<fieldset style="border: 0"> <fieldset style="border: 0">
<h4>'.$this->l('You will now push your products on eBay.').' <b>'.$this->l('Reminder,').'</b> '.$this->l('you will not have to pay any fees if you have a shop on eBay.').'</h4> <h4>'.$this->l('You will now push your products on eBay.').' <b>'.$this->l('Reminder,').'</b> '.$this->l('you will not have to pay any fees if you have a shop on eBay.').'</h4>
<label style="width: 250px;">'.$this->l('Sync Mode').' : </label><br clear="left" /><br /><br /> <label style="width: 250px;">'.$this->l('Sync Mode').' : </label><br clear="left" /><br /><br />
+2 -2
View File
@@ -196,7 +196,7 @@ class Editorial extends Module
<script type="text/javascript" src="'.__PS_BASE_URI__.'js/tinymce.inc.js"></script>'; <script type="text/javascript" src="'.__PS_BASE_URI__.'js/tinymce.inc.js"></script>';
$this->_html .= ' $this->_html .= '
<script type="text/javascript">id_language = Number('.$defaultLanguage.');</script> <script type="text/javascript">id_language = Number('.$defaultLanguage.');</script>
<form method="post" action="'.$_SERVER['REQUEST_URI'].'" enctype="multipart/form-data"> <form method="post" action="'.Tools::safeOutput($_SERVER['REQUEST_URI']).'" enctype="multipart/form-data">
<fieldset style="width: 905px;"> <fieldset style="width: 905px;">
<legend><img src="'.$this->_path.'logo.gif" alt="" title="" /> '.$this->displayName.'</legend> <legend><img src="'.$this->_path.'logo.gif" alt="" title="" /> '.$this->displayName.'</legend>
<label>'.$this->l('Main title').'</label> <label>'.$this->l('Main title').'</label>
@@ -252,7 +252,7 @@ class Editorial extends Module
$this->_html .= '<div id="image" > $this->_html .= '<div id="image" >
<img src="'.$this->_path.'homepage_logo.jpg?t='.time().'" /> <img src="'.$this->_path.'homepage_logo.jpg?t='.time().'" />
<p align="center">'.$this->l('Filesize').' '.(filesize(dirname(__FILE__).'/homepage_logo.jpg') / 1000).'kb</p> <p align="center">'.$this->l('Filesize').' '.(filesize(dirname(__FILE__).'/homepage_logo.jpg') / 1000).'kb</p>
<a href="'.$_SERVER['REQUEST_URI'].'&deleteImage" onclick="return confirm(\''.$this->l('Are you sure?', __CLASS__, true, false).'\');"> <a href="'.Tools::safeOutput($_SERVER['REQUEST_URI']).'&deleteImage" onclick="return confirm(\''.$this->l('Are you sure?', __CLASS__, true, false).'\');">
<img src="../img/admin/delete.gif" alt="'.$this->l('Delete').'" /> '.$this->l('Delete').'</a> <img src="../img/admin/delete.gif" alt="'.$this->l('Delete').'" /> '.$this->l('Delete').'</a>
</div>'; </div>';
@@ -50,7 +50,7 @@ class AdminEnvoiMoinsCher extends AdminTab
$orderToExport[] = self::getOrderDetails((int)($id)); $orderToExport[] = self::getOrderDetails((int)($id));
} }
echo '<form action="http://www.envoimoinscher.com/index.html" method="POST"> echo '<form action="http://www.envoimoinscher.com/index.html" method="POST">
<input type="hidden" name="url_renvoi" value="'.Tools::getProtocol().htmlspecialchars($_SERVER['HTTP_HOST'], ENT_COMPAT, 'UTF-8').$_SERVER['REQUEST_URI'].'"> <input type="hidden" name="url_renvoi" value="'.Tools::getProtocol().htmlspecialchars($_SERVER['HTTP_HOST'], ENT_COMPAT, 'UTF-8').Tools::safeOutput($_SERVER['REQUEST_URI']).'">
<input type="hidden" name="login" value="'.htmlspecialchars(Configuration::get('EMC_LOGIN'), ENT_COMPAT, 'UTF-8').'"> <input type="hidden" name="login" value="'.htmlspecialchars(Configuration::get('EMC_LOGIN'), ENT_COMPAT, 'UTF-8').'">
<input type="hidden" name="tracking" value="prestashop_module_v1">'; <input type="hidden" name="tracking" value="prestashop_module_v1">';
self::inputMaker($orderToExport); self::inputMaker($orderToExport);
@@ -65,7 +65,7 @@ class AdminEnvoiMoinsCher extends AdminTab
else echo '<div class="alert error"> else echo '<div class="alert error">
<img src="' . _PS_IMG_ . 'admin/forbbiden.gif" alt="nok" /> <img src="' . _PS_IMG_ . 'admin/forbbiden.gif" alt="nok" />
'.$emc->lang('No order to export').'</div> '.$emc->lang('No order to export').'</div>
<p><a class="button" href="'.Tools::getProtocol().htmlspecialchars($_SERVER['HTTP_HOST'], ENT_COMPAT, 'UTF-8').$_SERVER['REQUEST_URI'].'">Retour</a></p>'; <p><a class="button" href="'.Tools::getProtocol().htmlspecialchars($_SERVER['HTTP_HOST'], ENT_COMPAT, 'UTF-8').Tools::safeOutput($_SERVER['REQUEST_URI']).'">Retour</a></p>';
} }
else else
{ {
@@ -73,7 +73,7 @@ class AdminEnvoiMoinsCher extends AdminTab
AND Configuration::get('EMC_ADDRESS') AND Configuration::get('EMC_ZIP_CODE') AND Configuration::get('EMC_CITY') AND Configuration::get('EMC_COUNTRY') AND Configuration::get('EMC_ADDRESS') AND Configuration::get('EMC_ZIP_CODE') AND Configuration::get('EMC_CITY') AND Configuration::get('EMC_COUNTRY')
AND Configuration::get('EMC_PHONE') AND Configuration::get('EMC_EMAIL') AND Configuration::get('EMC_LOGIN')) AND Configuration::get('EMC_PHONE') AND Configuration::get('EMC_EMAIL') AND Configuration::get('EMC_LOGIN'))
{ {
echo '<form action="'.$_SERVER['REQUEST_URI'].'" method="POST">'; echo '<form action="'.Tools::safeOutput($_SERVER['REQUEST_URI']).'" method="POST">';
$orders = self::getOrders(); $orders = self::getOrders();
self::displayOrders($orders); self::displayOrders($orders);
echo '<p><input type="submit" value="'.$emc->lang('Send').'" name="submitExport" class="button" style="margin:10px 0px 0px 25px;"></p> echo '<p><input type="submit" value="'.$emc->lang('Send').'" name="submitExport" class="button" style="margin:10px 0px 0px 25px;"></p>
+2 -2
View File
@@ -172,10 +172,10 @@ class Envoimoinscher extends Module
&facturation.contact_ville='.(isset($confs['EMC_CITY']) ? htmlspecialchars($confs['EMC_CITY'], ENT_COMPAT, 'UTF-8') : '' ).' &facturation.contact_ville='.(isset($confs['EMC_CITY']) ? htmlspecialchars($confs['EMC_CITY'], ENT_COMPAT, 'UTF-8') : '' ).'
&facturation.contact_tel='.(isset($confs['EMC_PHONE']) ? htmlspecialchars($confs['EMC_PHONE'], ENT_COMPAT, 'UTF-8') : '' ).' &facturation.contact_tel='.(isset($confs['EMC_PHONE']) ? htmlspecialchars($confs['EMC_PHONE'], ENT_COMPAT, 'UTF-8') : '' ).'
&facturation.contact_email='.(isset($confs['EMC_EMAIL']) ? htmlspecialchars($confs['EMC_EMAIL'], ENT_COMPAT, 'UTF-8') : '' ).' &facturation.contact_email='.(isset($confs['EMC_EMAIL']) ? htmlspecialchars($confs['EMC_EMAIL'], ENT_COMPAT, 'UTF-8') : '' ).'
&url_renvoi='.urlencode(Tools::getProtocol().htmlspecialchars($_SERVER['HTTP_HOST'], ENT_COMPAT, 'UTF-8').$_SERVER['REQUEST_URI']).'">'; &url_renvoi='.urlencode(Tools::getProtocol().htmlspecialchars($_SERVER['HTTP_HOST'], ENT_COMPAT, 'UTF-8').Tools::safeOutput($_SERVER['REQUEST_URI'])).'">';
$this->_html .= '<form action="'.$_SERVER['REQUEST_URI'].'" method="post" class="form"> $this->_html .= '<form action="'.Tools::safeOutput($_SERVER['REQUEST_URI']).'" method="post" class="form">
<div style="float: right; width: 440px; height: 165px; border: 1px dashed rgb(102, 102, 102); padding: 8px; margin-left: 12px;margin-top: 11px;">'.$link.' <div style="float: right; width: 440px; height: 165px; border: 1px dashed rgb(102, 102, 102); padding: 8px; margin-left: 12px;margin-top: 11px;">'.$link.'
<h3>'.$this->l('Create Envoimoinscher account:').'</h3> <h3>'.$this->l('Create Envoimoinscher account:').'</h3>
<p style="text-align:justify">'.$this->l('To create your account on Envoimoinscher, click the image below. You will go to a dedicated personal space where you will find the necessary tools for easy management of your shipments.').'</p> <p style="text-align:justify">'.$this->l('To create your account on Envoimoinscher, click the image below. You will go to a dedicated personal space where you will find the necessary tools for easy management of your shipments.').'</p>
+1 -1
View File
@@ -2,7 +2,7 @@
<module> <module>
<name>fedexcarrier</name> <name>fedexcarrier</name>
<displayName><![CDATA[Fedex Carrier]]></displayName> <displayName><![CDATA[Fedex Carrier]]></displayName>
<version><![CDATA[1.2.1]]></version> <version><![CDATA[1.2.3]]></version>
<description><![CDATA[Offer your customers, different delivery methods with Fedex]]></description> <description><![CDATA[Offer your customers, different delivery methods with Fedex]]></description>
<author><![CDATA[PrestaShop]]></author> <author><![CDATA[PrestaShop]]></author>
<tab><![CDATA[shipping_logistics]]></tab> <tab><![CDATA[shipping_logistics]]></tab>
+36 -35
View File
@@ -56,7 +56,7 @@ class FedexCarrier extends CarrierModule
{ {
$this->name = 'fedexcarrier'; $this->name = 'fedexcarrier';
$this->tab = 'shipping_logistics'; $this->tab = 'shipping_logistics';
$this->version = '1.2.1'; $this->version = '1.2.3';
$this->author = 'PrestaShop'; $this->author = 'PrestaShop';
$this->limited_countries = array('us'); $this->limited_countries = array('us');
@@ -432,9 +432,9 @@ class FedexCarrier extends CarrierModule
if (isset($_GET['id_tab'])) if (isset($_GET['id_tab']))
$html .= '<script> $html .= '<script>
$(".menuTabButton.selected").removeClass("selected"); $(".menuTabButton.selected").removeClass("selected");
$("#menuTab'.Tools::getValue('id_tab').'").addClass("selected"); $("#menuTab'.Tools::safeOutput(Tools::getValue('id_tab')).'").addClass("selected");
$(".tabItem.selected").removeClass("selected"); $(".tabItem.selected").removeClass("selected");
$("#menuTab'.Tools::getValue('id_tab').'Sheet").addClass("selected"); $("#menuTab'.Tools::safeOutput(Tools::getValue('id_tab')).'Sheet").addClass("selected");
</script>'; </script>';
return $html; return $html;
} }
@@ -468,30 +468,30 @@ class FedexCarrier extends CarrierModule
</style> </style>
<form action="index.php?tab='.Tools::getValue('tab').'&configure='.Tools::getValue('configure').'&token='.Tools::getValue('token').'&tab_module='.Tools::getValue('tab_module').'&module_name='.Tools::getValue('module_name').'&id_tab=1&section=general" method="post" class="form" id="configForm"> <form action="index.php?tab='.Tools::safeOutput(Tools::getValue('tab')).'&configure='.Tools::safeOutput(Tools::getValue('configure')).'&token='.Tools::safeOutput(Tools::getValue('token')).'&tab_module='.Tools::safeOutput(Tools::getValue('tab_module')).'&module_name='.Tools::safeOutput(Tools::getValue('module_name')).'&id_tab=1&section=general" method="post" class="form" id="configForm">
<fieldset style="border: 0px;"> <fieldset style="border: 0px;">
<h4>'.$this->l('General configuration').' :</h4> <h4>'.$this->l('General configuration').' :</h4>
<label>'.$this->l('Your Fedex account').' : </label> <label>'.$this->l('Your Fedex account').' : </label>
<div class="margin-form"><input type="text" size="20" name="fedex_carrier_account" value="'.Tools::getValue('fedex_carrier_account', Configuration::get('FEDEX_CARRIER_ACCOUNT')).'" /></div> <div class="margin-form"><input type="text" size="20" name="fedex_carrier_account" value="'.Tools::safeOutput(Tools::getValue('fedex_carrier_account', Configuration::get('FEDEX_CARRIER_ACCOUNT'))).'" /></div>
<label>'.$this->l('Your Fedex meter number').' : </label> <label>'.$this->l('Your Fedex meter number').' : </label>
<div class="margin-form"><input type="text" size="20" name="fedex_carrier_meter" value="'.Tools::getValue('fedex_carrier_meter', Configuration::get('FEDEX_CARRIER_METER')).'" /></div> <div class="margin-form"><input type="text" size="20" name="fedex_carrier_meter" value="'.Tools::safeOutput(Tools::getValue('fedex_carrier_meter', Configuration::get('FEDEX_CARRIER_METER'))).'" /></div>
<label>'.$this->l('Your Fedex password').' : </label> <label>'.$this->l('Your Fedex password').' : </label>
<div class="margin-form"><input type="text" size="20" name="fedex_carrier_password" value="'.Tools::getValue('fedex_carrier_password', Configuration::get('FEDEX_CARRIER_PASSWORD')).'" /></div> <div class="margin-form"><input type="text" size="20" name="fedex_carrier_password" value="'.Tools::safeOutput(Tools::getValue('fedex_carrier_password', Configuration::get('FEDEX_CARRIER_PASSWORD'))).'" /></div>
<label>'.$this->l('Your Fedex API Key').' : </label> <label>'.$this->l('Your Fedex API Key').' : </label>
<div class="margin-form"> <div class="margin-form">
<input type="text" size="20" name="fedex_carrier_api_key" value="'.Tools::getValue('fedex_carrier_api_key', Configuration::get('FEDEX_CARRIER_API_KEY')).'" /> <input type="text" size="20" name="fedex_carrier_api_key" value="'.Tools::safeOutput(Tools::getValue('fedex_carrier_api_key', Configuration::get('FEDEX_CARRIER_API_KEY'))).'" />
<p><a href="http://www.fedex.com/webtools/" target="_blank">' . $this->l('Please click here to get your Fedex API Key.') . '</a></p> <p><a href="http://www.fedex.com/webtools/" target="_blank">' . $this->l('Please click here to get your Fedex API Key.') . '</a></p>
</div> </div>
<br /><br /> <br /><br />
<label>'.$this->l('Packaging Weight').' : </label> <label>'.$this->l('Packaging Weight').' : </label>
<div class="margin-form"> <div class="margin-form">
<input type="text" size="5" name="fedex_carrier_packaging_weight" value="'.Tools::getValue('fedex_carrier_packaging_weight', Configuration::get('FEDEX_CARRIER_PACKAGING_WEIGHT')).'" /> <input type="text" size="5" name="fedex_carrier_packaging_weight" value="'.Tools::safeOutput(Tools::getValue('fedex_carrier_packaging_weight', Configuration::get('FEDEX_CARRIER_PACKAGING_WEIGHT'))).'" />
'.Tools::getValue('ps_weight_unit', Configuration::get('PS_WEIGHT_UNIT')).' '.Tools::safeOutput(Tools::getValue('ps_weight_unit', Configuration::get('PS_WEIGHT_UNIT'))).'
</div> </div>
<label>'.$this->l('Handling Fee').' : </label> <label>'.$this->l('Handling Fee').' : </label>
<div class="margin-form"> <div class="margin-form">
<input type="text" size="5" name="fedex_carrier_handling_fee" value="'.Tools::getValue('fedex_carrier_handling_fee', Configuration::get('FEDEX_CARRIER_HANDLING_FEE')).'" /> <input type="text" size="5" name="fedex_carrier_handling_fee" value="'.Tools::safeOutput(Tools::getValue('fedex_carrier_handling_fee', Configuration::get('FEDEX_CARRIER_HANDLING_FEE'))).'" />
'.$configCurrency->sign.' '.$configCurrency->sign.'
</div> </div>
</fieldset> </fieldset>
@@ -500,12 +500,12 @@ class FedexCarrier extends CarrierModule
<h4>'.$this->l('Localization configuration').' :</h4> <h4>'.$this->l('Localization configuration').' :</h4>
<label>'.$this->l('Weight unit').' : </label> <label>'.$this->l('Weight unit').' : </label>
<div class="margin-form"> <div class="margin-form">
<input type="text" size="20" name="ps_weight_unit" value="'.Tools::getValue('ps_weight_unit', Configuration::get('PS_WEIGHT_UNIT')).'" /> <input type="text" size="20" name="ps_weight_unit" value="'.Tools::safeOutput(Tools::getValue('ps_weight_unit', Configuration::get('PS_WEIGHT_UNIT'))).'" />
<p>'.$this->l('The weight unit of your shop (eg. kg or lbs)').'</p> <p>'.$this->l('The weight unit of your shop (eg. kg or lbs)').'</p>
</div> </div>
<label>'.$this->l('Dimension unit').' : </label> <label>'.$this->l('Dimension unit').' : </label>
<div class="margin-form"> <div class="margin-form">
<input type="text" size="20" name="ps_dimension_unit" value="'.Tools::getValue('ps_dimension_unit', Configuration::get('PS_DIMENSION_UNIT')).'" /> <input type="text" size="20" name="ps_dimension_unit" value="'.Tools::safeOutput(Tools::getValue('ps_dimension_unit', Configuration::get('PS_DIMENSION_UNIT'))).'" />
<p>'.$this->l('The dimension unit of your shop (eg. cm or in)').'</p> <p>'.$this->l('The dimension unit of your shop (eg. cm or in)').'</p>
</div> </div>
</fieldset> </fieldset>
@@ -513,13 +513,13 @@ class FedexCarrier extends CarrierModule
<fieldset style="border: 0px;"> <fieldset style="border: 0px;">
<h4>'.$this->l('Address configuration').' :</h4> <h4>'.$this->l('Address configuration').' :</h4>
<label>'.$this->l('Your address line 1').' : </label> <label>'.$this->l('Your address line 1').' : </label>
<div class="margin-form"><input type="text" size="20" name="fedex_carrier_address1" value="'.Tools::getValue('fedex_carrier_address1', Configuration::get('FEDEX_CARRIER_ADDRESS1')).'" /></div> <div class="margin-form"><input type="text" size="20" name="fedex_carrier_address1" value="'.Tools::safeOutput(Tools::getValue('fedex_carrier_address1', Configuration::get('FEDEX_CARRIER_ADDRESS1'))).'" /></div>
<label>'.$this->l('Your address line 2').' : </label> <label>'.$this->l('Your address line 2').' : </label>
<div class="margin-form"><input type="text" size="20" name="fedex_carrier_address2" value="'.Tools::getValue('fedex_carrier_address2', Configuration::get('FEDEX_CARRIER_ADDRESS2')).'" /></div> <div class="margin-form"><input type="text" size="20" name="fedex_carrier_address2" value="'.Tools::safeOutput(Tools::getValue('fedex_carrier_address2', Configuration::get('FEDEX_CARRIER_ADDRESS2'))).'" /></div>
<label>'.$this->l('Zip / Postal Code').' : </label> <label>'.$this->l('Zip / Postal Code').' : </label>
<div class="margin-form"><input type="text" size="20" name="fedex_carrier_postal_code" value="'.Tools::getValue('fedex_carrier_postal_code', Configuration::get('FEDEX_CARRIER_POSTAL_CODE')).'" /></div><br /> <div class="margin-form"><input type="text" size="20" name="fedex_carrier_postal_code" value="'.Tools::safeOutput(Tools::getValue('fedex_carrier_postal_code', Configuration::get('FEDEX_CARRIER_POSTAL_CODE'))).'" /></div><br />
<label>'.$this->l('Your City').' : </label> <label>'.$this->l('Your City').' : </label>
<div class="margin-form"><input type="text" size="20" name="fedex_carrier_city" value="'.Tools::getValue('fedex_carrier_city', Configuration::get('FEDEX_CARRIER_CITY')).'" /></div> <div class="margin-form"><input type="text" size="20" name="fedex_carrier_city" value="'.Tools::safeOutput(Tools::getValue('fedex_carrier_city', Configuration::get('FEDEX_CARRIER_CITY'))).'" /></div>
<label>'.$this->l('Country').' : </label> <label>'.$this->l('Country').' : </label>
<div class="margin-form"> <div class="margin-form">
<select name="fedex_carrier_country" id="fedex_carrier_country"> <select name="fedex_carrier_country" id="fedex_carrier_country">
@@ -832,10 +832,10 @@ class FedexCarrier extends CarrierModule
<td>'.$c['additional_charges'].' '.$configCurrency->sign.'</td> <td>'.$c['additional_charges'].' '.$configCurrency->sign.'</td>
<td>'.$services.'</td> <td>'.$services.'</td>
<td> <td>
<a href="index.php?tab='.Tools::getValue('tab').'&configure='.Tools::getValue('configure').'&token='.Tools::getValue('token').'&tab_module='.Tools::getValue('tab_module').'&module_name='.Tools::getValue('module_name').'&id_tab=2&section=category&action=edit&id_fedex_rate_config='.(int)($c['id_fedex_rate_config']).'" style="float: left;"> <a href="index.php?tab='.Tools::safeOutput(Tools::getValue('tab')).'&configure='.Tools::safeOutput(Tools::getValue('configure')).'&token='.Tools::safeOutput(Tools::getValue('token')).'&tab_module='.Tools::safeOutput(Tools::getValue('tab_module')).'&module_name='.Tools::safeOutput(Tools::getValue('module_name')).'&id_tab=2&section=category&action=edit&id_fedex_rate_config='.(int)($c['id_fedex_rate_config']).'" style="float: left;">
<img src="'._PS_IMG_.'admin/edit.gif" /> <img src="'._PS_IMG_.'admin/edit.gif" />
</a> </a>
<form action="index.php?tab='.Tools::getValue('tab').'&configure='.Tools::getValue('configure').'&token='.Tools::getValue('token').'&tab_module='.Tools::getValue('tab_module').'&module_name='.Tools::getValue('module_name').'&id_tab=2&section=category&action=delete&id_fedex_rate_config='.(int)($c['id_fedex_rate_config']).'&id_category='.(int)($c['id_category']).'" method="post" class="form" style="float: left;"> <form action="index.php?tab='.Tools::safeOutput(Tools::getValue('tab')).'&configure='.Tools::safeOutput(Tools::getValue('configure')).'&token='.Tools::safeOutput(Tools::getValue('token')).'&tab_module='.Tools::safeOutput(Tools::getValue('tab_module')).'&module_name='.Tools::safeOutput(Tools::getValue('module_name')).'&id_tab=2&section=category&action=delete&id_fedex_rate_config='.(int)($c['id_fedex_rate_config']).'&id_category='.(int)($c['id_category']).'" method="post" class="form" style="float: left;">
<input name="submitSave" type="image" src="'._PS_IMG_.'admin/delete.gif" OnClick="return confirm(\''.$this->l('Are you sure you want to delete this specific FEDEX configuration for this category ?').'\');" /> <input name="submitSave" type="image" src="'._PS_IMG_.'admin/delete.gif" OnClick="return confirm(\''.$this->l('Are you sure you want to delete this specific FEDEX configuration for this category ?').'\');" />
</form> </form>
</td> </td>
@@ -861,8 +861,8 @@ class FedexCarrier extends CarrierModule
$path .= $p; $path .= $p;
} }
$html .= '<p align="center"><b>'.$this->l('Update a rule').' (<a href="index.php?tab='.Tools::getValue('tab').'&configure='.Tools::getValue('configure').'&token='.Tools::getValue('token').'&tab_module='.Tools::getValue('tab_module').'&module_name='.Tools::getValue('module_name').'&id_tab=2&section=category&action=add">'.$this->l('Add a rule').' ?</a>)</b></p> $html .= '<p align="center"><b>'.$this->l('Update a rule').' (<a href="index.php?tab='.Tools::safeOutput(Tools::getValue('tab')).'&configure='.Tools::safeOutput(Tools::getValue('configure')).'&token='.Tools::safeOutput(Tools::getValue('token')).'&tab_module='.Tools::safeOutput(Tools::getValue('tab_module')).'&module_name='.Tools::safeOutput(Tools::getValue('module_name')).'&id_tab=2&section=category&action=add">'.$this->l('Add a rule').' ?</a>)</b></p>
<form action="index.php?tab='.Tools::getValue('tab').'&configure='.Tools::getValue('configure').'&token='.Tools::getValue('token').'&tab_module='.Tools::getValue('tab_module').'&module_name='.Tools::getValue('module_name').'&id_tab=2&section=category&action=edit&id_fedex_rate_config='.(int)(Tools::getValue('id_fedex_rate_config')).'" method="post" class="form"> <form action="index.php?tab='.Tools::safeOutput(Tools::getValue('tab')).'&configure='.Tools::safeOutput(Tools::getValue('configure')).'&token='.Tools::safeOutput(Tools::getValue('token')).'&tab_module='.Tools::safeOutput(Tools::getValue('tab_module')).'&module_name='.Tools::safeOutput(Tools::getValue('module_name')).'&id_tab=2&section=category&action=edit&id_fedex_rate_config='.(int)(Tools::getValue('id_fedex_rate_config')).'" method="post" class="form">
<label>'.$this->l('Category').' :</label> <label>'.$this->l('Category').' :</label>
<div class="margin-form" style="padding: 0.2em 0.5em 0 0; font-size: 12px;">'.$path.' <input type="hidden" name="id_category" value="'.(int)($configSelected['id_category']).'" /></div><br clear="left" /> <div class="margin-form" style="padding: 0.2em 0.5em 0 0; font-size: 12px;">'.$path.' <input type="hidden" name="id_category" value="'.(int)($configSelected['id_category']).'" /></div><br clear="left" />
<label>'.$this->l('Pickup Type').' : </label> <label>'.$this->l('Pickup Type').' : </label>
@@ -882,7 +882,7 @@ class FedexCarrier extends CarrierModule
$html .= '</select> $html .= '</select>
</div> </div>
<label>'.$this->l('Additional charges').' : </label> <label>'.$this->l('Additional charges').' : </label>
<div class="margin-form"><input type="text" size="20" name="additional_charges" value="'.Tools::getValue('additional_charges', $configSelected['additional_charges']).'" /></div><br /> <div class="margin-form"><input type="text" size="20" name="additional_charges" value="'.Tools::safeOutput(Tools::getValue('additional_charges', $configSelected['additional_charges'])).'" /></div><br />
<label>'.$this->l('Delivery Service').' : </label> <label>'.$this->l('Delivery Service').' : </label>
<div class="margin-form">'; <div class="margin-form">';
$rateServiceList = Db::getInstance()->ExecuteS('SELECT * FROM `'._DB_PREFIX_.'fedex_rate_service_code`'); $rateServiceList = Db::getInstance()->ExecuteS('SELECT * FROM `'._DB_PREFIX_.'fedex_rate_service_code`');
@@ -900,7 +900,7 @@ class FedexCarrier extends CarrierModule
else else
{ {
$html .= '<p align="center"><b>'.$this->l('Add a rule').'</b></p> $html .= '<p align="center"><b>'.$this->l('Add a rule').'</b></p>
<form action="index.php?tab='.Tools::getValue('tab').'&configure='.Tools::getValue('configure').'&token='.Tools::getValue('token').'&tab_module='.Tools::getValue('tab_module').'&module_name='.Tools::getValue('module_name').'&id_tab=2&section=category&action=add" method="post" class="form"> <form action="index.php?tab='.Tools::safeOutput(Tools::getValue('tab')).'&configure='.Tools::safeOutput(Tools::getValue('configure')).'&token='.Tools::safeOutput(Tools::getValue('token')).'&tab_module='.Tools::safeOutput(Tools::getValue('tab_module')).'&module_name='.Tools::safeOutput(Tools::getValue('module_name')).'&id_tab=2&section=category&action=add" method="post" class="form">
<label>'.$this->l('Category').' : </label> <label>'.$this->l('Category').' : </label>
<div class="margin-form"> <div class="margin-form">
<select name="id_category"> <select name="id_category">
@@ -925,7 +925,7 @@ class FedexCarrier extends CarrierModule
$html .= '</select> $html .= '</select>
</div> </div>
<label>'.$this->l('Additional charges').' : </label> <label>'.$this->l('Additional charges').' : </label>
<div class="margin-form"><input type="text" size="20" name="additional_charges" value="'.Tools::getValue('additional_charges').'" /></div><br /> <div class="margin-form"><input type="text" size="20" name="additional_charges" value="'.Tools::safeOutput(Tools::getValue('additional_charges')).'" /></div><br />
<label>'.$this->l('Delivery Service').' : </label> <label>'.$this->l('Delivery Service').' : </label>
<div class="margin-form">'; <div class="margin-form">';
$rateServiceList = Db::getInstance()->ExecuteS('SELECT * FROM `'._DB_PREFIX_.'fedex_rate_service_code`'); $rateServiceList = Db::getInstance()->ExecuteS('SELECT * FROM `'._DB_PREFIX_.'fedex_rate_service_code`');
@@ -1102,10 +1102,10 @@ class FedexCarrier extends CarrierModule
<td>'.$c['additional_charges'].' '.$configCurrency->sign.'</td> <td>'.$c['additional_charges'].' '.$configCurrency->sign.'</td>
<td>'.$services.'</td> <td>'.$services.'</td>
<td> <td>
<a href="index.php?tab='.Tools::getValue('tab').'&configure='.Tools::getValue('configure').'&token='.Tools::getValue('token').'&tab_module='.Tools::getValue('tab_module').'&module_name='.Tools::getValue('module_name').'&id_tab=3&section=product&action=edit&id_fedex_rate_config='.(int)($c['id_fedex_rate_config']).'" style="float: left;"> <a href="index.php?tab='.Tools::safeOutput(Tools::getValue('tab')).'&configure='.Tools::safeOutput(Tools::getValue('configure')).'&token='.Tools::safeOutput(Tools::getValue('token')).'&tab_module='.Tools::safeOutput(Tools::getValue('tab_module')).'&module_name='.Tools::safeOutput(Tools::getValue('module_name')).'&id_tab=3&section=product&action=edit&id_fedex_rate_config='.(int)($c['id_fedex_rate_config']).'" style="float: left;">
<img src="'._PS_IMG_.'admin/edit.gif" /> <img src="'._PS_IMG_.'admin/edit.gif" />
</a> </a>
<form action="index.php?tab='.Tools::getValue('tab').'&configure='.Tools::getValue('configure').'&token='.Tools::getValue('token').'&tab_module='.Tools::getValue('tab_module').'&module_name='.Tools::getValue('module_name').'&id_tab=3&section=product&action=delete&id_fedex_rate_config='.(int)($c['id_fedex_rate_config']).'&id_product='.(int)($c['id_product']).'" method="post" class="form" style="float: left;"> <form action="index.php?tab='.Tools::safeOutput(Tools::getValue('tab')).'&configure='.Tools::safeOutput(Tools::getValue('configure')).'&token='.Tools::safeOutput(Tools::getValue('token')).'&tab_module='.Tools::safeOutput(Tools::getValue('tab_module')).'&module_name='.Tools::safeOutput(Tools::getValue('module_name')).'&id_tab=3&section=product&action=delete&id_fedex_rate_config='.(int)($c['id_fedex_rate_config']).'&id_product='.(int)($c['id_product']).'" method="post" class="form" style="float: left;">
<input name="submitSave" type="image" src="'._PS_IMG_.'admin/delete.gif" OnClick="return confirm(\''.$this->l('Are you sure you want to delete this specific FEDEX configuration for this product ?').'\');" /> <input name="submitSave" type="image" src="'._PS_IMG_.'admin/delete.gif" OnClick="return confirm(\''.$this->l('Are you sure you want to delete this specific FEDEX configuration for this product ?').'\');" />
</form> </form>
</td> </td>
@@ -1123,8 +1123,8 @@ class FedexCarrier extends CarrierModule
$configSelected = Db::getInstance()->getRow('SELECT * FROM `'._DB_PREFIX_.'fedex_rate_config` WHERE `id_fedex_rate_config` = '.(int)(Tools::getValue('id_fedex_rate_config'))); $configSelected = Db::getInstance()->getRow('SELECT * FROM `'._DB_PREFIX_.'fedex_rate_config` WHERE `id_fedex_rate_config` = '.(int)(Tools::getValue('id_fedex_rate_config')));
$product = new Product((int)$configSelected['id_product'], false, (int)$this->context->language->id); $product = new Product((int)$configSelected['id_product'], false, (int)$this->context->language->id);
$html .= '<p align="center"><b>'.$this->l('Update a rule').' (<a href="index.php?tab='.Tools::getValue('tab').'&configure='.Tools::getValue('configure').'&token='.Tools::getValue('token').'&tab_module='.Tools::getValue('tab_module').'&module_name='.Tools::getValue('module_name').'&id_tab=3&section=product&action=add">'.$this->l('Add a rule').' ?</a>)</b></p> $html .= '<p align="center"><b>'.$this->l('Update a rule').' (<a href="index.php?tab='.Tools::safeOutput(Tools::getValue('tab')).'&configure='.Tools::safeOutput(Tools::getValue('configure')).'&token='.Tools::safeOutput(Tools::getValue('token')).'&tab_module='.Tools::safeOutput(Tools::getValue('tab_module')).'&module_name='.Tools::safeOutput(Tools::getValue('module_name')).'&id_tab=3&section=product&action=add">'.$this->l('Add a rule').' ?</a>)</b></p>
<form action="index.php?tab='.Tools::getValue('tab').'&configure='.Tools::getValue('configure').'&token='.Tools::getValue('token').'&tab_module='.Tools::getValue('tab_module').'&module_name='.Tools::getValue('module_name').'&id_tab=3&section=product&action=edit&id_fedex_rate_config='.(int)(Tools::getValue('id_fedex_rate_config')).'" method="post" class="form"> <form action="index.php?tab='.Tools::safeOutput(Tools::getValue('tab')).'&configure='.Tools::safeOutput(Tools::getValue('configure')).'&token='.Tools::safeOutput(Tools::getValue('token')).'&tab_module='.Tools::safeOutput(Tools::getValue('tab_module')).'&module_name='.Tools::safeOutput(Tools::getValue('module_name')).'&id_tab=3&section=product&action=edit&id_fedex_rate_config='.(int)(Tools::getValue('id_fedex_rate_config')).'" method="post" class="form">
<label>'.$this->l('Product').' :</label> <label>'.$this->l('Product').' :</label>
<div class="margin-form" style="padding: 0.2em 0.5em 0 0; font-size: 12px;">'.$product->name.' <input type="hidden" name="id_product" value="'.(int)($configSelected['id_product']).'" /></div><br clear="left" /> <div class="margin-form" style="padding: 0.2em 0.5em 0 0; font-size: 12px;">'.$product->name.' <input type="hidden" name="id_product" value="'.(int)($configSelected['id_product']).'" /></div><br clear="left" />
<label>'.$this->l('Pickup Type').' : </label> <label>'.$this->l('Pickup Type').' : </label>
@@ -1144,13 +1144,14 @@ class FedexCarrier extends CarrierModule
$html .= '</select> $html .= '</select>
</div> </div>
<label>'.$this->l('Additional charges').' : </label> <label>'.$this->l('Additional charges').' : </label>
<div class="margin-form"><input type="text" size="20" name="additional_charges" value="'.Tools::getValue('additional_charges', $configSelected['additional_charges']).'" /></div><br /> <div class="margin-form"><input type="text" size="20" name="additional_charges" value="'.Tools::safeOutput(Tools::getValue('additional_charges', $configSelected['additional_charges'])).'" /></div><br />
<label>'.$this->l('Delivery Service').' : </label> <label>'.$this->l('Delivery Service').' : </label>
<div class="margin-form">'; <div class="margin-form">';
$rateServiceList = Db::getInstance()->ExecuteS('SELECT * FROM `'._DB_PREFIX_.'fedex_rate_service_code`'); $rateServiceList = Db::getInstance()->ExecuteS('SELECT * FROM `'._DB_PREFIX_.'fedex_rate_service_code`');
foreach($rateServiceList as $rateService) foreach($rateServiceList as $rateService)
{ {
$configServiceSelected = Db::getInstance()->getValue('SELECT `id_fedex_rate_service_code` FROM `'._DB_PREFIX_.'fedex_rate_config_service` WHERE `id_fedex_rate_config` = '.(int)(Tools::getValue('id_fedex_rate_config')).' AND `id_fedex_rate_service_code` = '.(int)($rateService['id_fedex_rate_service_code'])); $configServiceSelected = Db::getInstance()->getValue('SELECT `id_fedex_rate_service_code` FROM `'._DB_PREFIX_.'fedex_rate_config_service` WHERE `id_fedex_rate_config` = '.(int)(
Tools::getValue('id_fedex_rate_config')).' AND `id_fedex_rate_service_code` = '.(int)($rateService['id_fedex_rate_service_code']));
$html .= '<input type="checkbox" name="service[]" value="'.$rateService['id_fedex_rate_service_code'].'" '.(($this->_isPostCheck($rateService['id_fedex_rate_service_code']) == 1 || $configServiceSelected > 0) ? 'checked="checked"' : '').' /> '.$rateService['service'].'<br />'; $html .= '<input type="checkbox" name="service[]" value="'.$rateService['id_fedex_rate_service_code'].'" '.(($this->_isPostCheck($rateService['id_fedex_rate_service_code']) == 1 || $configServiceSelected > 0) ? 'checked="checked"' : '').' /> '.$rateService['service'].'<br />';
} }
$html .= ' $html .= '
@@ -1162,7 +1163,7 @@ class FedexCarrier extends CarrierModule
else else
{ {
$html .= '<p align="center"><b>'.$this->l('Add a rule').'</b></p> $html .= '<p align="center"><b>'.$this->l('Add a rule').'</b></p>
<form action="index.php?tab='.Tools::getValue('tab').'&configure='.Tools::getValue('configure').'&token='.Tools::getValue('token').'&tab_module='.Tools::getValue('tab_module').'&module_name='.Tools::getValue('module_name').'&id_tab=3&section=product&action=add" method="post" class="form"> <form action="index.php?tab='.Tools::safeOutput(Tools::getValue('tab')).'&configure='.Tools::safeOutput(Tools::getValue('configure')).'&token='.Tools::safeOutput(Tools::getValue('token')).'&tab_module='.Tools::safeOutput(Tools::getValue('tab_module')).'&module_name='.Tools::safeOutput(Tools::getValue('module_name')).'&id_tab=3&section=product&action=add" method="post" class="form">
<label>'.$this->l('Product').' : </label> <label>'.$this->l('Product').' : </label>
<div class="margin-form"> <div class="margin-form">
<select name="id_product"> <select name="id_product">
@@ -1193,7 +1194,7 @@ class FedexCarrier extends CarrierModule
$html .= '</select> $html .= '</select>
</div> </div>
<label>'.$this->l('Additional charges').' : </label> <label>'.$this->l('Additional charges').' : </label>
<div class="margin-form"><input type="text" size="20" name="additional_charges" value="'.Tools::getValue('additional_charges').'" /></div><br /> <div class="margin-form"><input type="text" size="20" name="additional_charges" value="'.Tools::safeOutput(Tools::getValue('additional_charges')).'" /></div><br />
<label>'.$this->l('Delivery Service').' : </label> <label>'.$this->l('Delivery Service').' : </label>
<div class="margin-form">'; <div class="margin-form">';
$rateServiceList = Db::getInstance()->ExecuteS('SELECT * FROM `'._DB_PREFIX_.'fedex_rate_service_code`'); $rateServiceList = Db::getInstance()->ExecuteS('SELECT * FROM `'._DB_PREFIX_.'fedex_rate_service_code`');
@@ -1692,7 +1693,7 @@ class FedexCarrier extends CarrierModule
Db::getInstance()->autoExecute(_DB_PREFIX_.'fedex_cache_test', array('hash' => pSQL(md5(var_export($requestHash, true))), 'result' => pSQL(serialize($resultTab)), 'date_add' => pSQL(date('Y-m-d H:i:s')), 'date_upd' => pSQL(date('Y-m-d H:i:s'))), 'INSERT'); Db::getInstance()->autoExecute(_DB_PREFIX_.'fedex_cache_test', array('hash' => pSQL(md5(var_export($requestHash, true))), 'result' => pSQL(serialize($resultTab)), 'date_add' => pSQL(date('Y-m-d H:i:s')), 'date_upd' => pSQL(date('Y-m-d H:i:s'))), 'INSERT');
// Return results // Return results
if (isset($resultTab->HighestSeverity) && $resultTab->HighestSeverity == 'SUCCESS') if (isset($resultTab->HighestSeverity) && $resultTab->HighestSeverity != 'ERROR' && isset($resultTab->RateReplyDetails->RatedShipmentDetails[0]->ShipmentRateDetail->TotalNetCharge->Amount))
return true; return true;
if (isset($resultTab->HighestSeverity) && $resultTab->HighestSeverity == 'ERROR') if (isset($resultTab->HighestSeverity) && $resultTab->HighestSeverity == 'ERROR')
@@ -1763,7 +1764,7 @@ class FedexCarrier extends CarrierModule
// Get Rates // Get Rates
try { $resultTab = $client->getRates($request); } try { $resultTab = $client->getRates($request); }
catch (Exception $e) { return array('connect' => false, 'cost' => 0); } catch (Exception $e) { }
// Check currency // Check currency
@@ -1775,7 +1776,7 @@ class FedexCarrier extends CarrierModule
} }
// Return results // Return results
if (isset($resultTab->HighestSeverity) && $resultTab->HighestSeverity == 'SUCCESS') if (isset($resultTab->HighestSeverity) && $resultTab->HighestSeverity != 'ERROR' && isset($resultTab->RateReplyDetails->RatedShipmentDetails[0]->ShipmentRateDetail->TotalNetCharge->Amount))
return array('connect' => true, 'cost' => number_format($resultTab->RateReplyDetails->RatedShipmentDetails[0]->ShipmentRateDetail->TotalNetCharge->Amount,2,'.',',') * $conversionRate); return array('connect' => true, 'cost' => number_format($resultTab->RateReplyDetails->RatedShipmentDetails[0]->ShipmentRateDetail->TotalNetCharge->Amount,2,'.',',') * $conversionRate);
if (isset($resultTab->HighestSeverity) && $resultTab->HighestSeverity == 'ERROR') if (isset($resultTab->HighestSeverity) && $resultTab->HighestSeverity == 'ERROR')
+1 -1
View File
@@ -108,7 +108,7 @@ class Followup extends Module
echo ' echo '
<h2>'.$this->l('Customer follow-up').'</h2> <h2>'.$this->l('Customer follow-up').'</h2>
<form action="'.$_SERVER['REQUEST_URI'].'" method="post"> <form action="'.Tools::safeOutput($_SERVER['REQUEST_URI']).'" method="post">
<fieldset style="width: 400px; float: left;"> <fieldset style="width: 400px; float: left;">
<legend><img src="'.$this->_path.'logo.gif" alt="" title="" />'.$this->l('Settings').'</legend> <legend><img src="'.$this->_path.'logo.gif" alt="" title="" />'.$this->l('Settings').'</legend>
<p>'.$this->l('Four kinds of e-mail alerts available in order to stay in touch with your customers!').'<br /><br /> <p>'.$this->l('Four kinds of e-mail alerts available in order to stay in touch with your customers!').'<br /><br />
+2 -2
View File
@@ -79,11 +79,11 @@ class GAdsense extends Module
public function displayForm() public function displayForm()
{ {
$output = ' $output = '
<form action="'.$_SERVER['REQUEST_URI'].'" method="post"> <form action="'.Tools::safeOutput($_SERVER['REQUEST_URI']).'" method="post">
<fieldset><legend>'.$this->l('Settings').'</legend> <fieldset><legend>'.$this->l('Settings').'</legend>
<label>'.$this->l('Your code').'</label> <label>'.$this->l('Your code').'</label>
<div class="margin-form"> <div class="margin-form">
<textarea name="gadsense_id" cols="90" rows="10" />'.Tools::getValue('gadsense_id', Configuration::get('GADSENSE_ID')).'</textarea> <textarea name="gadsense_id" cols="90" rows="10" />'.Tools::safeOutput(Tools::getValue('gadsense_id', Configuration::get('GADSENSE_ID'))).'</textarea>
<p class="clear">'.$this->l('Example:').' <br /><br /><img src="../modules/gadsense/adsense_script.gif"></p> <p class="clear">'.$this->l('Example:').' <br /><br /><img src="../modules/gadsense/adsense_script.gif"></p>
</div> </div>
<center><input type="submit" name="submitGAdsense" value="'.$this->l('Update settings').'" class="button" /></center> <center><input type="submit" name="submitGAdsense" value="'.$this->l('Update settings').'" class="button" /></center>
+2 -2
View File
@@ -78,12 +78,12 @@ class GAnalytics extends Module
public function displayForm() public function displayForm()
{ {
$output = ' $output = '
<form action="'.$_SERVER['REQUEST_URI'].'" method="post"> <form action="'.Tools::safeOutput($_SERVER['REQUEST_URI']).'" method="post">
<fieldset class="width2"> <fieldset class="width2">
<legend><img src="../img/admin/cog.gif" alt="" class="middle" />'.$this->l('Settings').'</legend> <legend><img src="../img/admin/cog.gif" alt="" class="middle" />'.$this->l('Settings').'</legend>
<label>'.$this->l('Your username').'</label> <label>'.$this->l('Your username').'</label>
<div class="margin-form"> <div class="margin-form">
<input type="text" name="ganalytics_id" value="'.Tools::getValue('ganalytics_id', Configuration::get('GANALYTICS_ID')).'" /> <input type="text" name="ganalytics_id" value="'.Tools::safeOutput(Tools::getValue('ganalytics_id', Configuration::get('GANALYTICS_ID'))).'" />
<p class="clear">'.$this->l('Example:').' UA-1234567-1</p> <p class="clear">'.$this->l('Example:').' UA-1234567-1</p>
</div> </div>
<center><input type="submit" name="submitGAnalytics" value="'.$this->l('Update ID').'" class="button" /></center> <center><input type="submit" name="submitGAnalytics" value="'.$this->l('Update ID').'" class="button" /></center>
+5 -5
View File
@@ -104,14 +104,14 @@ class GCheckout extends PaymentModule
else else
Configuration::updateValue('GCHECKOUT_NO_SHIPPING', 0); Configuration::updateValue('GCHECKOUT_NO_SHIPPING', 0);
if (!sizeof($errors)) if (!$errors)
Tools::redirectAdmin(AdminTab::$currentIndex.'&configure=gcheckout&token='.Tools::getValue('token').'&conf=4'); Tools::redirectAdmin(AdminTab::$currentIndex.'&configure=gcheckout&token='.Tools::safeOutput(Tools::getValue('token')).'&conf=4');
foreach ($errors as $error) foreach ($errors as $error)
echo $error; echo $error;
} }
$html = '<h2>'.$this->displayName.'</h2> $html = '<h2>'.$this->displayName.'</h2>
<form action="'.$_SERVER['REQUEST_URI'].'" method="post"> <form action="'.Tools::safeOutput($_SERVER['REQUEST_URI']).'" method="post">
<fieldset> <fieldset>
<legend><img src="'.__PS_BASE_URI__.'modules/gcheckout/logo.gif" />'.$this->l('Settings').'</legend> <legend><img src="'.__PS_BASE_URI__.'modules/gcheckout/logo.gif" />'.$this->l('Settings').'</legend>
<p> <p>
@@ -139,13 +139,13 @@ class GCheckout extends PaymentModule
'.$this->l('Merchant ID').' '.$this->l('Merchant ID').'
</label> </label>
<div class="margin-form"> <div class="margin-form">
<input type="text" name="gcheckout_merchant_id" value="'.Tools::getValue('gcheckout_merchant_id', Configuration::get('GCHECKOUT_MERCHANT_ID')).'" /> <input type="text" name="gcheckout_merchant_id" value="'.Tools::safeOutput(Tools::getValue('gcheckout_merchant_id', Configuration::get('GCHECKOUT_MERCHANT_ID'))).'" />
</div> </div>
<label> <label>
'.$this->l('Merchant Key').' '.$this->l('Merchant Key').'
</label> </label>
<div class="margin-form"> <div class="margin-form">
<input type="text" name="gcheckout_merchant_key" value="'.Tools::getValue('gcheckout_merchant_key', Configuration::get('GCHECKOUT_MERCHANT_KEY')).'" /> <input type="text" name="gcheckout_merchant_key" value="'.Tools::safeOutput(Tools::getValue('gcheckout_merchant_key', Configuration::get('GCHECKOUT_MERCHANT_KEY'))).'" />
</div> </div>
<p>'.$this->l('If you click this box, buyers will be able to see the shipping fees you have setup in Google Checkout on the purchase page.').'</p> <p>'.$this->l('If you click this box, buyers will be able to see the shipping fees you have setup in Google Checkout on the purchase page.').'</p>
<label> <label>
+5 -5
View File
@@ -416,7 +416,7 @@ class Hipay extends PaymentModule
</div>'; </div>';
} }
$link = AdminTab::$currentIndex.'&configure='.$this->name.'&token='.Tools::getValue('token'); $link = AdminTab::$currentIndex.'&configure='.$this->name.'&token='.Tools::safeOutput(Tools::getValue('token'));
$form = ' $form = '
<style> <style>
.hipay_label {float:none;font-weight:normal;padding:0;text-align:left;width:100%;line-height:30px} .hipay_label {float:none;font-weight:normal;padding:0;text-align:left;width:100%;line-height:30px}
@@ -472,11 +472,11 @@ class Hipay extends PaymentModule
<td class="hipay_block"><b>'.$this->l('Configuration in').' '.$currency['name'].' '.$currency['sign'].'</b></td> <td class="hipay_block"><b>'.$this->l('Configuration in').' '.$currency['name'].' '.$currency['sign'].'</b></td>
<td class="hipay_prod hipay_block" style="padding-left:10px"> <td class="hipay_prod hipay_block" style="padding-left:10px">
<label class="hipay_label" for="HIPAY_ACCOUNT_'.$currency['iso_code'].'">'.$this->l('Account number').' <a href="../modules/'.$this->name.'/screenshots/accountnumber.png" target="_blank"><img src="../modules/'.$this->name.'/help.png" class="hipay_help" /></a></label><br /> <label class="hipay_label" for="HIPAY_ACCOUNT_'.$currency['iso_code'].'">'.$this->l('Account number').' <a href="../modules/'.$this->name.'/screenshots/accountnumber.png" target="_blank"><img src="../modules/'.$this->name.'/help.png" class="hipay_help" /></a></label><br />
<input type="text" id="HIPAY_ACCOUNT_'.$currency['iso_code'].'" name="HIPAY_ACCOUNT_'.$currency['iso_code'].'" value="'.Tools::getValue('HIPAY_ACCOUNT_'.$currency['iso_code'], Configuration::get('HIPAY_ACCOUNT_'.$currency['iso_code'])).'" /><br /> <input type="text" id="HIPAY_ACCOUNT_'.$currency['iso_code'].'" name="HIPAY_ACCOUNT_'.$currency['iso_code'].'" value="'.Tools::safeOutput(Tools::getValue('HIPAY_ACCOUNT_'.$currency['iso_code'], Configuration::get('HIPAY_ACCOUNT_'.$currency['iso_code']))).'" /><br />
<label class="hipay_label" for="HIPAY_PASSWORD_'.$currency['iso_code'].'">'.$this->l('Merchant password').' <a href="../modules/'.$this->name.'/screenshots/merchantpassword.png" target="_blank"><img src="../modules/'.$this->name.'/help.png" class="hipay_help" /></a></label><br /> <label class="hipay_label" for="HIPAY_PASSWORD_'.$currency['iso_code'].'">'.$this->l('Merchant password').' <a href="../modules/'.$this->name.'/screenshots/merchantpassword.png" target="_blank"><img src="../modules/'.$this->name.'/help.png" class="hipay_help" /></a></label><br />
<input type="text" id="HIPAY_PASSWORD_'.$currency['iso_code'].'" name="HIPAY_PASSWORD_'.$currency['iso_code'].'" value="'.Tools::getValue('HIPAY_PASSWORD_'.$currency['iso_code'], Configuration::get('HIPAY_PASSWORD_'.$currency['iso_code'])).'" /><br /> <input type="text" id="HIPAY_PASSWORD_'.$currency['iso_code'].'" name="HIPAY_PASSWORD_'.$currency['iso_code'].'" value="'.Tools::safeOutput(Tools::getValue('HIPAY_PASSWORD_'.$currency['iso_code'], Configuration::get('HIPAY_PASSWORD_'.$currency['iso_code']))).'" /><br />
<label class="hipay_label" for="HIPAY_SITEID_'.$currency['iso_code'].'">'.$this->l('Site ID').' <a href="../modules/'.$this->name.'/screenshots/siteid.png" target="_blank"><img src="../modules/'.$this->name.'/help.png" class="hipay_help" /></a></label><br /> <label class="hipay_label" for="HIPAY_SITEID_'.$currency['iso_code'].'">'.$this->l('Site ID').' <a href="../modules/'.$this->name.'/screenshots/siteid.png" target="_blank"><img src="../modules/'.$this->name.'/help.png" class="hipay_help" /></a></label><br />
<input type="text" id="HIPAY_SITEID_'.$currency['iso_code'].'" name="HIPAY_SITEID_'.$currency['iso_code'].'" value="'.Tools::getValue('HIPAY_SITEID_'.$currency['iso_code'], Configuration::get('HIPAY_SITEID_'.$currency['iso_code'])).'" /><br />'; <input type="text" id="HIPAY_SITEID_'.$currency['iso_code'].'" name="HIPAY_SITEID_'.$currency['iso_code'].'" value="'.Tools::safeOutput(Tools::getValue('HIPAY_SITEID_'.$currency['iso_code'], Configuration::get('HIPAY_SITEID_'.$currency['iso_code']))).'" /><br />';
if ($ping AND $hipaySiteId = (int)Configuration::get('HIPAY_SITEID_'.$currency['iso_code']) AND $hipayAccountId = (int)Configuration::get('HIPAY_ACCOUNT_'.$currency['iso_code'])) if ($ping AND $hipaySiteId = (int)Configuration::get('HIPAY_SITEID_'.$currency['iso_code']) AND $hipayAccountId = (int)Configuration::get('HIPAY_ACCOUNT_'.$currency['iso_code']))
{ {
$form .= ' <label for="HIPAY_CATEGORY_'.$currency['iso_code'].'" class="hipay_label">'.$this->l('Category').'</label><br /> $form .= ' <label for="HIPAY_CATEGORY_'.$currency['iso_code'].'" class="hipay_label">'.$this->l('Category').'</label><br />
@@ -523,7 +523,7 @@ class Hipay extends PaymentModule
<fieldset> <fieldset>
<legend><img src="../modules/'.$this->name.'/logo.gif" /> '.$this->l('Zones restrictions').'</legend> <legend><img src="../modules/'.$this->name.'/logo.gif" /> '.$this->l('Zones restrictions').'</legend>
'.$this->l('Select the authorized shipping zones').'<br /><br /> '.$this->l('Select the authorized shipping zones').'<br /><br />
<form action="'.AdminTab::$currentIndex.'&configure=hipay&token='.Tools::getValue('token').'" method="post"> <form action="'.AdminTab::$currentIndex.'&configure=hipay&token='.Tools::safeOutput(Tools::getValue('token')).'" method="post">
<table cellspacing="0" cellpadding="0" class="table"> <table cellspacing="0" cellpadding="0" class="table">
<tr> <tr>
<th class="center">'.$this->l('ID').'</th> <th class="center">'.$this->l('ID').'</th>
+2 -2
View File
@@ -75,12 +75,12 @@ class HomeFeatured extends Module
public function displayForm() public function displayForm()
{ {
$output = ' $output = '
<form action="'.$_SERVER['REQUEST_URI'].'" method="post"> <form action="'.Tools::safeOutput($_SERVER['REQUEST_URI']).'" method="post">
<fieldset><legend><img src="'.$this->_path.'logo.gif" alt="" title="" />'.$this->l('Settings').'</legend> <fieldset><legend><img src="'.$this->_path.'logo.gif" alt="" title="" />'.$this->l('Settings').'</legend>
<p>'.$this->l('In order to add products to your homepage, just add them to the "home" category.').'</p><br /> <p>'.$this->l('In order to add products to your homepage, just add them to the "home" category.').'</p><br />
<label>'.$this->l('Number of products displayed').'</label> <label>'.$this->l('Number of products displayed').'</label>
<div class="margin-form"> <div class="margin-form">
<input type="text" size="5" name="nbr" value="'.Tools::getValue('nbr', (int)(Configuration::get('HOME_FEATURED_NBR'))).'" /> <input type="text" size="5" name="nbr" value="'.Tools::safeOutput(Tools::getValue('nbr', (int)(Configuration::get('HOME_FEATURED_NBR')))).'" />
<p class="clear">'.$this->l('The number of products displayed on homepage (default: 10).').'</p> <p class="clear">'.$this->l('The number of products displayed on homepage (default: 10).').'</p>
</div> </div>
+1 -1
View File
@@ -85,7 +85,7 @@ class iAdvize extends Module
<br /> <br />
<a href="http://www.iadvize.com/offre_prestashop.html" target="_blank">'.$this->l('For more information, click here').'</a> <a href="http://www.iadvize.com/offre_prestashop.html" target="_blank">'.$this->l('For more information, click here').'</a>
</p> </p>
<form action="'.$_SERVER['REQUEST_URI'].'" method="post"> <form action="'.Tools::safeOutput($_SERVER['REQUEST_URI']).'" method="post">
<fieldset class="width2"> <fieldset class="width2">
<legend><img src="../img/admin/cog.gif" alt="" class="middle" />'.$this->l('Settings').'</legend> <legend><img src="../img/admin/cog.gif" alt="" class="middle" />'.$this->l('Settings').'</legend>
<label>'.$this->l('iAdvize merchant ID:').'</label> <label>'.$this->l('iAdvize merchant ID:').'</label>
+35 -35
View File
@@ -61,8 +61,8 @@ class importerosc extends ImportModule
public function displaySpecificOptions() public function displaySpecificOptions()
{ {
$langagues = $this->ExecuteS('SELECT * FROM `'.addslashes($this->prefix).'languages`'); $langagues = $this->ExecuteS('SELECT * FROM `'.bqSQL($this->prefix).'languages`');
$curencies = $this->ExecuteS('SELECT * FROM `'.addslashes($this->prefix).'currencies`'); $curencies = $this->ExecuteS('SELECT * FROM `'.bqSQL($this->prefix).'currencies`');
$html = '<label style=\'width:220px\'>'.$this->l('Default osCommerce language : ').'</label> $html = '<label style=\'width:220px\'>'.$this->l('Default osCommerce language : ').'</label>
<div class="margin-form"> <div class="margin-form">
@@ -115,7 +115,7 @@ class importerosc extends ImportModule
public function getLangagues($limit = 0, $nrb_import = 100) public function getLangagues($limit = 0, $nrb_import = 100)
{ {
$identifier = 'id_lang'; $identifier = 'id_lang';
$langagues = $this->ExecuteS('SELECT languages_id as id_lang, name as name, code as iso_code, 1 as active FROM `'.addslashes($this->prefix).'languages` LIMIT '.(int)($limit).' , '.(int)$nrb_import); $langagues = $this->ExecuteS('SELECT languages_id as id_lang, name as name, code as iso_code, 1 as active FROM `'.bqSQL($this->prefix).'languages` LIMIT '.(int)($limit).' , '.(int)$nrb_import);
return $this->autoFormat($langagues, $identifier); return $this->autoFormat($langagues, $identifier);
} }
@@ -125,7 +125,7 @@ class importerosc extends ImportModule
$currencies = $this->ExecuteS(' $currencies = $this->ExecuteS('
SELECT currencies_id as id_currency, title as name, code as iso_code, 0 as format, 999 as iso_code_num, 1 as decimals, SELECT currencies_id as id_currency, title as name, code as iso_code, 0 as format, 999 as iso_code_num, 1 as decimals,
CONCAT(`symbol_left`, `symbol_right`) as sign, value as conversion_rate CONCAT(`symbol_left`, `symbol_right`) as sign, value as conversion_rate
FROM `'.addslashes($this->prefix).'currencies` LIMIT '.(int)($limit).' , '.(int)$nrb_import FROM `'.bqSQL($this->prefix).'currencies` LIMIT '.(int)($limit).' , '.(int)$nrb_import
); );
return $this->autoFormat($currencies, $identifier); return $this->autoFormat($currencies, $identifier);
} }
@@ -133,7 +133,7 @@ class importerosc extends ImportModule
public function getZones($limit = 0, $nrb_import = 100) public function getZones($limit = 0, $nrb_import = 100)
{ {
$identifier = 'id_zone'; $identifier = 'id_zone';
$zones = $this->ExecuteS('SELECT geo_zone_id as id_zone, geo_zone_name as name, 1 as active FROM `'.addslashes($this->prefix).'geo_zones` LIMIT '.(int)($limit).' , '.(int)$nrb_import); $zones = $this->ExecuteS('SELECT geo_zone_id as id_zone, geo_zone_name as name, 1 as active FROM `'.bqSQL($this->prefix).'geo_zones` LIMIT '.(int)($limit).' , '.(int)$nrb_import);
return $this->autoFormat($zones, $identifier); return $this->autoFormat($zones, $identifier);
} }
@@ -144,9 +144,9 @@ class importerosc extends ImportModule
$identifier = 'id_country'; $identifier = 'id_country';
$defaultIdLang = $this->getDefaultIdLang(); $defaultIdLang = $this->getDefaultIdLang();
$countries = $this->ExecuteS(' $countries = $this->ExecuteS('
SELECT countries_id as id_country, countries_name as name, countries_iso_code_2 as iso_code, '.$defaultIdLang.' as id_lang, SELECT countries_id as id_country, countries_name as name, countries_iso_code_2 as iso_code, `'.bqSQL($defaultIdLang).'̀ as id_lang,
1 as id_zone, 0 as id_currency, 1 as contains_states, 1 as need_identification_number, 1 as active, 1 as display_tax_label 1 as id_zone, 0 as id_currency, 1 as contains_states, 1 as need_identification_number, 1 as active, 1 as display_tax_label
FROM `'.addslashes($this->prefix).'countries` as c LIMIT '.(int)($limit).' , '.(int)$nrb_import); FROM `'.bqSQL($this->prefix).'countries` as c LIMIT '.(int)($limit).' , '.(int)$nrb_import);
return $this->autoFormat($countries, $identifier, $keyLanguage, $multiLangFields); return $this->autoFormat($countries, $identifier, $keyLanguage, $multiLangFields);
} }
@@ -186,8 +186,8 @@ class importerosc extends ImportModule
IFNULL( STRCMP(c.`customers_newsletter`, \'\') , 0 ) as newsletter, c.`customers_lastname` as lastname, IFNULL( STRCMP(c.`customers_newsletter`, \'\') , 0 ) as newsletter, c.`customers_lastname` as lastname,
DATE(c.`customers_dob`) as birthday, c.`customers_email_address` as email, c.`customers_password` as passwd, 1 as active, DATE(c.`customers_dob`) as birthday, c.`customers_email_address` as email, c.`customers_password` as passwd, 1 as active,
ci.`customers_info_date_account_created` as date_add ci.`customers_info_date_account_created` as date_add
FROM `'.addslashes($this->prefix).'customers` c FROM `'.bqSQL($this->prefix).'customers` c
LEFT JOIN `'.addslashes($this->prefix).'customers_info` ci ON (c.`customers_id` = ci.`customers_info_id`) LEFT JOIN `'.bqSQL($this->prefix).'customers_info` ci ON (c.`customers_id` = ci.`customers_info_id`)
LIMIT '.(int)($limit).' , '.(int)$nrb_import LIMIT '.(int)($limit).' , '.(int)$nrb_import
); );
@@ -206,7 +206,7 @@ class importerosc extends ImportModule
$addresses = $this->ExecuteS(' $addresses = $this->ExecuteS('
SELECT address_book_id as id_address, customers_id as id_customer, CONCAT(customers_id, \'_address\') as alias, entry_company as company, entry_firstname as firstname, SELECT address_book_id as id_address, customers_id as id_customer, CONCAT(customers_id, \'_address\') as alias, entry_company as company, entry_firstname as firstname,
entry_lastname as lastname, entry_street_address as address1, entry_postcode as postcode, entry_city as city, entry_country_id as id_country, 0 as id_state entry_lastname as lastname, entry_street_address as address1, entry_postcode as postcode, entry_city as city, entry_country_id as id_country, 0 as id_state
FROM `'.addslashes($this->prefix).'address_book` LIMIT '.(int)($limit).' , '.(int)$nrb_import); FROM `'.bqSQL($this->prefix).'address_book` LIMIT '.(int)($limit).' , '.(int)$nrb_import);
return $this->autoFormat($addresses, $identifier); return $this->autoFormat($addresses, $identifier);
} }
@@ -218,8 +218,8 @@ class importerosc extends ImportModule
$categories = $this->ExecuteS(' $categories = $this->ExecuteS('
SELECT c.categories_id as id_category, c.parent_id as id_parent, 0 as level_depth, cd.language_id as id_lang, cd.categories_name as name , 1 as active, categories_image as images SELECT c.categories_id as id_category, c.parent_id as id_parent, 0 as level_depth, cd.language_id as id_lang, cd.categories_name as name , 1 as active, categories_image as images
FROM `'.addslashes($this->prefix).'categories` c FROM `'.bqSQL($this->prefix).'categories` c
LEFT JOIN `'.addslashes($this->prefix).'categories_description` cd ON (c.categories_id = cd.categories_id) LEFT JOIN `'.bqSQL($this->prefix).'categories_description` cd ON (c.categories_id = cd.categories_id)
WHERE cd.categories_name IS NOT NULL AND cd.language_id IS NOT NULL WHERE cd.categories_name IS NOT NULL AND cd.language_id IS NOT NULL
ORDER BY c.categories_id, cd.language_id ORDER BY c.categories_id, cd.language_id
LIMIT '.(int)($limit).' , '.(int)$nrb_import); LIMIT '.(int)($limit).' , '.(int)$nrb_import);
@@ -238,7 +238,7 @@ class importerosc extends ImportModule
$identifier = 'id_attribute_group'; $identifier = 'id_attribute_group';
$countries = $this->ExecuteS(' $countries = $this->ExecuteS('
SELECT products_options_id as id_attribute_group, products_options_name as name , products_options_name as public_name, language_id as id_lang, 0 as is_color_group SELECT products_options_id as id_attribute_group, products_options_name as name , products_options_name as public_name, language_id as id_lang, 0 as is_color_group
FROM `'.addslashes($this->prefix).'products_options` FROM `'.bqSQL($this->prefix).'products_options`
LIMIT '.(int)($limit).' , '.(int)$nrb_import); LIMIT '.(int)($limit).' , '.(int)$nrb_import);
return $this->autoFormat($countries, $identifier, $keyLanguage, $multiLangFields); return $this->autoFormat($countries, $identifier, $keyLanguage, $multiLangFields);
} }
@@ -250,8 +250,8 @@ class importerosc extends ImportModule
$identifier = 'id_attribute'; $identifier = 'id_attribute';
$countries = $this->ExecuteS(' $countries = $this->ExecuteS('
SELECT p.`products_options_values_id` as id_attribute, p.`products_options_values_name` as name, p.`language_id` as id_lang , po.`products_options_id` as id_attribute_group SELECT p.`products_options_values_id` as id_attribute, p.`products_options_values_name` as name, p.`language_id` as id_lang , po.`products_options_id` as id_attribute_group
FROM `'.addslashes($this->prefix).'products_options_values` p FROM `'.bqSQL($this->prefix).'products_options_values` p
LEFT JOIN `'.addslashes($this->prefix).'products_options_values_to_products_options` po ON (po.products_options_values_id = p.products_options_values_id) LEFT JOIN `'.bqSQL($this->prefix).'products_options_values_to_products_options` po ON (po.products_options_values_id = p.products_options_values_id)
LIMIT '.(int)($limit).' , '.(int)$nrb_import); LIMIT '.(int)($limit).' , '.(int)$nrb_import);
return $this->autoFormat($countries, $identifier, $keyLanguage, $multiLangFields); return $this->autoFormat($countries, $identifier, $keyLanguage, $multiLangFields);
} }
@@ -264,11 +264,11 @@ class importerosc extends ImportModule
$products = $this->ExecuteS(' $products = $this->ExecuteS('
SELECT p.`products_id` as id_product, p.`products_quantity` as quantity, p.`products_model` as reference, p.`products_price` as price, p.`products_weight` as weight, SELECT p.`products_id` as id_product, p.`products_quantity` as quantity, p.`products_model` as reference, p.`products_price` as price, p.`products_weight` as weight,
IFNULL(STRCMP(p.`products_status`, \'\') , 0 ) as active, p.`manufacturers_id` as id_manufacturer, pd.language_id as id_lang, pd.products_name as name, IFNULL(STRCMP(p.`products_status`, \'\') , 0 ) as active, p.`manufacturers_id` as id_manufacturer, pd.language_id as id_lang, pd.products_name as name,
pd.products_description as description, CONCAT(\''.Tools::getProtocol().Tools::getValue('shop_url').'\/images/\',p.`products_image`) as images, pd.products_description as description, CONCAT(\''.pSQL(Tools::getProtocol()).pSQL(Tools::getValue('shop_url')).'\/images/\',p.`products_image`) as images,
(SELECT ptc.categories_id FROM `'.addslashes($this->prefix).'products_to_categories` ptc WHERE ptc.`products_id` = p.`products_id` LIMIT 1) as id_category_default, (SELECT ptc.categories_id FROM `'.bqSQL($this->prefix).'products_to_categories` ptc WHERE ptc.`products_id` = p.`products_id` LIMIT 1) as id_category_default,
p.`products_date_added` as date_add p.`products_date_added` as date_add
FROM `'.addslashes($this->prefix).'products` p FROM `'.bqSQL($this->prefix).'products` p
LEFT JOIN `'.addslashes($this->prefix).'products_description` pd ON (p.products_id = pd.products_id) LEFT JOIN `'.bqSQL($this->prefix).'products_description` pd ON (p.products_id = pd.products_id)
WHERE pd.products_name IS NOT NULL AND pd.language_id IS NOT NULL WHERE pd.products_name IS NOT NULL AND pd.language_id IS NOT NULL
LIMIT '.(int)($limit).' , '.(int)$nrb_import); LIMIT '.(int)($limit).' , '.(int)$nrb_import);
@@ -283,7 +283,7 @@ class importerosc extends ImportModule
)'); )');
foreach($products as& $product) foreach($products as& $product)
{ {
$result = $this->ExecuteS('SELECT `image` FROM `'.addslashes($this->prefix).'products_images` WHERE products_id = '.(int)$product['id_product']); $result = $this->ExecuteS('SELECT `image` FROM `'.bqSQL($this->prefix).'products_images` WHERE products_id = '.(int)$product['id_product']);
$images = array(); $images = array();
foreach($result as $res) foreach($result as $res)
$images[] = Tools::getProtocol().Tools::getValue('shop_url').'/images/'.$res['image']; $images[] = Tools::getProtocol().Tools::getValue('shop_url').'/images/'.$res['image'];
@@ -299,7 +299,7 @@ class importerosc extends ImportModule
$identifier = 'id_product_attribute'; $identifier = 'id_product_attribute';
$combinations = $this->ExecuteS(' $combinations = $this->ExecuteS('
SELECT products_attributes_id as id_product_attribute, products_id as id_product, options_values_price as price, options_values_id SELECT products_attributes_id as id_product_attribute, products_id as id_product, options_values_price as price, options_values_id
FROM `'.addslashes($this->prefix).'products_attributes` LIMIT '.(int)($limit).' , '.(int)$nrb_import); FROM `'.bqSQL($this->prefix).'products_attributes` LIMIT '.(int)($limit).' , '.(int)$nrb_import);
foreach($combinations as& $combination) foreach($combinations as& $combination)
{ {
$combination['association'] = array('product_attribute_combination' => array($combination['options_values_id'] => $combination['id_product_attribute'])); $combination['association'] = array('product_attribute_combination' => array($combination['options_values_id'] => $combination['id_product_attribute']));
@@ -313,7 +313,7 @@ class importerosc extends ImportModule
$identifier = 'id_manufacturer'; $identifier = 'id_manufacturer';
$manufacturers = $this->ExecuteS(' $manufacturers = $this->ExecuteS('
SELECT manufacturers_id as id_manufacturer, manufacturers_name as name, 1 as active, manufacturers_image as images SELECT manufacturers_id as id_manufacturer, manufacturers_name as name, 1 as active, manufacturers_image as images
FROM `'.addslashes($this->prefix).'manufacturers` LIMIT '.(int)($limit).' , '.(int)$nrb_import); FROM `'.bqSQL($this->prefix).'manufacturers` LIMIT '.(int)($limit).' , '.(int)$nrb_import);
foreach($manufacturers as& $manufacturer) foreach($manufacturers as& $manufacturer)
$manufacturer['images'] = array(Tools::getProtocol().Tools::getValue('shop_url').'/images/'.$manufacturer['images']); $manufacturer['images'] = array(Tools::getProtocol().Tools::getValue('shop_url').'/images/'.$manufacturer['images']);
@@ -327,7 +327,7 @@ class importerosc extends ImportModule
$identifier = 'id_order_state'; $identifier = 'id_order_state';
$ordersStates = $this->ExecuteS(' $ordersStates = $this->ExecuteS('
SELECT `orders_status_id` as id_order_state, `language_id` as id_lang, `orders_status_name` as name , 1 as hidden SELECT `orders_status_id` as id_order_state, `language_id` as id_lang, `orders_status_name` as name , 1 as hidden
FROM `'.addslashes($this->prefix).'orders_status` FROM `'.bqSQL($this->prefix).'orders_status`
LIMIT '.(int)($limit).' , '.(int)$nrb_import);//IF(`public_flag` = 0, 1, 0) as hidden LIMIT '.(int)($limit).' , '.(int)$nrb_import);//IF(`public_flag` = 0, 1, 0) as hidden
return $this->autoFormat($ordersStates, $identifier, $keyLanguage, $multiLangFields); return $this->autoFormat($ordersStates, $identifier, $keyLanguage, $multiLangFields);
} }
@@ -335,7 +335,7 @@ class importerosc extends ImportModule
public function getOrders($limit = 0, $nrb_import = 100) public function getOrders($limit = 0, $nrb_import = 100)
{ {
$orders = array(); $orders = array();
$addresses = $this->ExecuteS('SELECT customers_id as id_customer, address_book_id as id_address FROM `'.addslashes($this->prefix).'address_book` GROUP BY customers_id'); $addresses = $this->ExecuteS('SELECT customers_id as id_customer, address_book_id as id_address FROM `'.bqSQL($this->prefix).'address_book` GROUP BY customers_id');
$matchAddresses = array(); $matchAddresses = array();
foreach($addresses as $address) foreach($addresses as $address)
$matchAddresses[$address['id_customer']] = $address['id_address']; $matchAddresses[$address['id_customer']] = $address['id_address'];
@@ -351,30 +351,30 @@ class importerosc extends ImportModule
$orders = $this->ExecuteS(' $orders = $this->ExecuteS('
SELECT orders_id as id_cart, '.$psCarrierDefault.' as id_carrier, 1 as id_lang, currency as id_currency, customers_id as id_customer, payment_method as payment, 1 as valid, SELECT orders_id as id_cart, '.$psCarrierDefault.' as id_carrier, 1 as id_lang, currency as id_currency, customers_id as id_customer, payment_method as payment, 1 as valid,
date_purchased as date_add, last_modified as date_upd date_purchased as date_add, last_modified as date_upd
FROM `'.addslashes($this->prefix).'orders` LIMIT '.(int)($limit).' , '.(int)$nrb_import); FROM `'.bqSQL($this->prefix).'orders` LIMIT '.(int)($limit).' , '.(int)$nrb_import);
foreach($orders as $key => $order) foreach($orders as $key => $order)
{ {
$orders[$key]['id_currency'] = (array_key_exists($order['id_currency'], $psCurrency) ? $psCurrency[$order['id_currency']] : 0); $orders[$key]['id_currency'] = (array_key_exists($order['id_currency'], $psCurrency) ? $psCurrency[$order['id_currency']] : 0);
$orders[$key]['id_address_delivery'] = (array_key_exists($order['id_customer'], $matchAddresses) ? $matchAddresses[$order['id_customer']] : 0); $orders[$key]['id_address_delivery'] = (array_key_exists($order['id_customer'], $matchAddresses) ? $matchAddresses[$order['id_customer']] : 0);
$orders[$key]['id_address_invoice'] = (array_key_exists($order['id_customer'], $matchAddresses) ? $matchAddresses[$order['id_customer']] : 0); $orders[$key]['id_address_invoice'] = (array_key_exists($order['id_customer'], $matchAddresses) ? $matchAddresses[$order['id_customer']] : 0);
$orders[$key]['total_paid'] = $this->getValue('SELECT value FROM `'.addslashes($this->prefix).'orders_total` WHERE `orders_id` = '.$order['id_cart'].' AND class=\'ot_total\''); $orders[$key]['total_paid'] = $this->getValue('SELECT value FROM `'.bqSQL($this->prefix).'orders_total` WHERE `orders_id` = '.(int)$order['id_cart'].' AND class=\'ot_total\'');
$orders[$key]['total_paid_real'] = $this->getValue('SELECT value FROM `'.addslashes($this->prefix).'orders_total` WHERE `orders_id` = '.$order['id_cart'].' AND class=\'ot_total\''); $orders[$key]['total_paid_real'] = $this->getValue('SELECT value FROM `'.bqSQL($this->prefix).'orders_total` WHERE `orders_id` = '.(int)$order['id_cart'].' AND class=\'ot_total\'');
$orders[$key]['total_products'] = $this->getValue('SELECT value FROM `'.addslashes($this->prefix).'orders_total` WHERE `orders_id` = '.$order['id_cart'].' AND class=\'ot_shipping\''); $orders[$key]['total_products'] = $this->getValue('SELECT value FROM `'.bqSQL($this->prefix).'orders_total` WHERE `orders_id` = '.(int)$order['id_cart'].' AND class=\'ot_shipping\'');
$tax = $this->getValue('SELECT value FROM `'.addslashes($this->prefix).'orders_total` WHERE `orders_id` = '.$order['id_cart'].' AND class=\'ot_tax\''); $tax = $this->getValue('SELECT value FROM `'.bqSQL($this->prefix).'orders_total` WHERE `orders_id` = '.(int)$order['id_cart'].' AND class=\'ot_tax\'');
$orders[$key]['total_products_wt'] = $this->getValue('SELECT value FROM `'.addslashes($this->prefix).'orders_total` WHERE `orders_id` = '.$order['id_cart'].' AND class=\'ot_total\'') - $tax; $orders[$key]['total_products_wt'] = $this->getValue('SELECT value FROM `'.bqSQL($this->prefix).'orders_total` WHERE `orders_id` = '.(int)$order['id_cart'].' AND class=\'ot_total\'') - $tax;
$orders[$key]['total_shipping'] = $this->getValue('SELECT value FROM `'.addslashes($this->prefix).'orders_total` WHERE `orders_id` = '.$order['id_cart'].' AND class=\'ot_shipping\''); $orders[$key]['total_shipping'] = $this->getValue('SELECT value FROM `'.bqSQL($this->prefix).'orders_total` WHERE `orders_id` = '.(int)$order['id_cart'].' AND class=\'ot_shipping\'');
$orders[$key]['total_discounts'] = 0; $orders[$key]['total_discounts'] = 0;
$orders[$key]['total_wrapping'] = 0; $orders[$key]['total_wrapping'] = 0;
$orders[$key]['cart_products'] = $this->ExecuteS(' $orders[$key]['cart_products'] = $this->ExecuteS('
SELECT `orders_id` as id_cart, `products_id` as id_product, 0 as id_product_attribute, `products_quantity` as quantity SELECT `orders_id` as id_cart, `products_id` as id_product, 0 as id_product_attribute, `products_quantity` as quantity
FROM `'.addslashes($this->prefix).'orders_products` WHERE `orders_id` = '.$order['id_cart']); FROM `'.bqSQL($this->prefix).'orders_products` WHERE `orders_id` = '.(int)$order['id_cart']);
$orders[$key]['order_products'] = $this->ExecuteS(' $orders[$key]['order_products'] = $this->ExecuteS('
SELECT `orders_id` as id_order, `products_id` as product_id, 0 as product_attribute_id, `products_name` as product_name, `products_quantity` as product_quantity, SELECT `orders_id` as id_order, `products_id` as product_id, 0 as product_attribute_id, `products_name` as product_name, `products_quantity` as product_quantity,
`final_price` as product_price, 0 as product_weight `final_price` as product_price, 0 as product_weight
FROM `'.addslashes($this->prefix).'orders_products` WHERE `orders_id` = '.$order['id_cart']); FROM `'.bqSQL($this->prefix).'orders_products` WHERE `orders_id` = '.(int)$order['id_cart']);
$orders[$key]['order_history'] = $this->ExecuteS(' $orders[$key]['order_history'] = $this->ExecuteS('
SELECT `orders_status_history_id` as id_order_history, 0 as id_employee, `orders_id` as id_order, `orders_status_id` as id_order_state, `date_added` as date_add SELECT `orders_status_history_id` as id_order_history, 0 as id_employee, `orders_id` as id_order, `orders_status_id` as id_order_state, `date_added` as date_add
FROM `'.addslashes($this->prefix).'orders_status_history` WHERE `orders_id` = '.$order['id_cart']); FROM `'.bqSQL($this->prefix).'orders_status_history` WHERE `orders_id` = '.(int)$order['id_cart']);
} }
return $orders; return $orders;
@@ -413,7 +413,7 @@ class importerosc extends ImportModule
$ps_passwd = md5(pSQL(_COOKIE_KEY_.$passwd)); $ps_passwd = md5(pSQL(_COOKIE_KEY_.$passwd));
Db::getInstance()->Execute(' Db::getInstance()->Execute('
UPDATE `'._DB_PREFIX_.'customer` UPDATE `'._DB_PREFIX_.'customer`
SET `passwd` = \''.pSQL($ps_passwd).'\', passwd_'.pSQL($this->name).' = \'\' SET `passwd` = \''.pSQL($ps_passwd).'\', `passwd_'.bqSQL($this->name).'` = \'\'
WHERE `'._DB_PREFIX_.'customer`.`id_customer` ='.(int)$result['id_customer'].' LIMIT 1'); WHERE `'._DB_PREFIX_.'customer`.`id_customer` ='.(int)$result['id_customer'].' LIMIT 1');
} }
} }
+1 -1
View File
@@ -258,7 +258,7 @@ class Loyalty extends Module
id_language = Number('.$defaultLanguage.'); id_language = Number('.$defaultLanguage.');
</script> </script>
<h2>'.$this->l('Loyalty Program').'</h2> <h2>'.$this->l('Loyalty Program').'</h2>
<form action="'.$_SERVER['REQUEST_URI'].'" method="post"> <form action="'.Tools::safeOutput($_SERVER['REQUEST_URI']).'" method="post">
<fieldset> <fieldset>
<legend>'.$this->l('Settings').'</legend> <legend>'.$this->l('Settings').'</legend>
+2 -2
View File
@@ -68,7 +68,7 @@ class AdminMondialRelay extends AdminTab
$html.= '<h3 style="color:red;">' . $this->l('No orders with this state.') . '</h3>'; $html.= '<h3 style="color:red;">' . $this->l('No orders with this state.') . '</h3>';
else else
{ {
$html.= '<form method="post" action="'.$_SERVER['REQUEST_URI'].'">'; $html.= '<form method="post" action="'.Tools::safeOutput($_SERVER['REQUEST_URI']).'">';
$html.= "\n<table class=\"table\" id='orders'>"; $html.= "\n<table class=\"table\" id='orders'>";
$html.= '<tr>'; $html.= '<tr>';
$html.= '<th>'.$this->l('Order ID').'</th>'; $html.= '<th>'.$this->l('Order ID').'</th>';
@@ -152,7 +152,7 @@ class AdminMondialRelay extends AdminTab
<fieldset> <fieldset>
<legend>' . $this->l('History of labels creation') . '</legend> <legend>' . $this->l('History of labels creation') . '</legend>
<div style="overflow-x: auto;overflow-y: scroller; height: 300px; padding-top: 0.6em;" > <div style="overflow-x: auto;overflow-y: scroller; height: 300px; padding-top: 0.6em;" >
<form method="post" action="'.$_SERVER['REQUEST_URI'].'"> <form method="post" action="'.Tools::safeOutput($_SERVER['REQUEST_URI']).'">
<table class="table" id="PS_MRHistoriqueTableList"> <table class="table" id="PS_MRHistoriqueTableList">
<tbody> <tbody>
<tr> <tr>
@@ -412,10 +412,10 @@ class MRCreateTickets implements IMondialRelayWSMethod
{ {
Db::getInstance()->Execute(' Db::getInstance()->Execute('
UPDATE `'._DB_PREFIX_.'mr_selected` UPDATE `'._DB_PREFIX_.'mr_selected`
SET `MR_poids` = \''.$params['Poids'].'\', SET `MR_poids` = \''.pSQL($params['Poids']).'\',
`exp_number` = \''.$expeditionNum.'\', `exp_number` = \''.pSQL($expeditionNum).'\',
`url_etiquette` = \''.$ticketURL.'\', `url_etiquette` = \''.pSQL($ticketURL).'\',
`url_suivi` = \''.$trackingURL.'\' `url_suivi` = \''.pSQL($trackingURL).'\'
WHERE id_mr_selected = '.(int)$id_mr_selected); WHERE id_mr_selected = '.(int)$id_mr_selected);
// NDossier contains the id_order // NDossier contains the id_order
@@ -431,8 +431,8 @@ class MRCreateTickets implements IMondialRelayWSMethod
_PS_OS_SHIPPING_; _PS_OS_SHIPPING_;
$history = new OrderHistory(); $history = new OrderHistory();
$history->id_order = (int)($params['NDossier']); $history->id_order = (int)$params['NDossier'];
$history->changeIdOrderState($orderState, (int)($params['NDossier'])); $history->changeIdOrderState($orderState, (int)$params['NDossier']);
$history->id_employee = (int)Context::getContext()->employee->id; $history->id_employee = (int)Context::getContext()->employee->id;
$history->addWithemail(true, $templateVars); $history->addWithemail(true, $templateVars);
@@ -187,7 +187,7 @@ class MRGetRelayPoint implements IMondialRelayWSMethod
unset($result['STAT']); unset($result['STAT']);
// Clean Content // Clean Content
foreach($result as &$relayPoint) foreach($result as $num => $relayPoint)
{ {
$totalEmptyFields = 0; $totalEmptyFields = 0;
foreach ($relayPoint as $key => &$value) foreach ($relayPoint as $key => &$value)
@@ -197,11 +197,10 @@ class MRGetRelayPoint implements IMondialRelayWSMethod
++$totalEmptyFields; ++$totalEmptyFields;
} }
if ($totalEmptyFields == count($relayPoint)) if ($totalEmptyFields == count($relayPoint))
{ unset($result[$num]);
$errors[] = $this->_mondialRelay->l('MondialRelay can\'t find any relay point near your address. Maybe your address isn\'t properly filled ?');
break;
} }
} if (!count($result))
$errors[] = $this->_mondialRelay->l('MondialRelay can\'t find any relay point near your address. Maybe your address isn\'t properly filled ?');
$success = $result; $success = $result;
} }
$this->_resultList['error'] = $errors; $this->_resultList['error'] = $errors;
@@ -142,7 +142,7 @@ class MRGetTickets implements IMondialRelayWSMethod
{ {
$query = ' $query = '
SELECT id FROM `'._DB_PREFIX_.'mr_historique` SELECT id FROM `'._DB_PREFIX_.'mr_historique`
WHERE `order`=\''.$id_order.'\''; WHERE `order`='.(int)$id_order;
$row = Db::getInstance()->getRow($query); $row = Db::getInstance()->getRow($query);
if ($row) if ($row)
@@ -151,9 +151,9 @@ class MRGetTickets implements IMondialRelayWSMethod
UPDATE `'._DB_PREFIX_.'mr_historique` UPDATE `'._DB_PREFIX_.'mr_historique`
SET SET
`exp` = \''.(int)$expeditionNumber.'\', `exp` = \''.(int)$expeditionNumber.'\',
`url_a4` = \''.(string)$URLA4.'\', `url_a4` = \''.pSQL((string)$URLA4).'\',
`url_a5` = \''.(string)$URLA5.'\' `url_a5` = \''.pSQL((string)$URLA5).'\'
WHERE `order` = \''.$id_order.'\''; WHERE `order` = '.(int)$id_order;
} }
else else
{ {
@@ -161,10 +161,10 @@ class MRGetTickets implements IMondialRelayWSMethod
INSERT INTO '._DB_PREFIX_.'mr_historique INSERT INTO '._DB_PREFIX_.'mr_historique
(`order`, `exp`, `url_a4`, `url_a5`) (`order`, `exp`, `url_a4`, `url_a5`)
VALUES ( VALUES (
\''.(int)$id_order.'\', '.(int)$id_order.',
\''.(int)$expeditionNumber.'\', '.(int)$expeditionNumber.',
\''.(string)$URLA4.'\', \''.pSQL((string)$URLA4).'\',
\''.(string)$URLA5.'\')'; \''.pSQL((string)$URLA5).'\')';
} }
Db::getInstance()->Execute($query); Db::getInstance()->Execute($query);
$success['id_mr_history'] = isset($row['id']) ? $row['id'] : Db::getInstance()->Insert_ID(); $success['id_mr_history'] = isset($row['id']) ? $row['id'] : Db::getInstance()->Insert_ID();
+41 -2
View File
@@ -372,9 +372,11 @@ function PS_MRBackupDatabase()
*/ */
function PS_MRAddSelectedRelayPointInDB(relayPointNumber, id_carrier) function PS_MRAddSelectedRelayPointInDB(relayPointNumber, id_carrier)
{ {
PS_MRSelectedRelayPoint['relayPointNum'] = relayPointNumber;
// Ajax call to add the selection in the database (compatibility for 1.3) // Ajax call to add the selection in the database (compatibility for 1.3)
// But keep this way to add a selection better that the hook // But keep this way to add a selection better that the hook
$.ajax({ MRjQuery.ajax({
type: 'POST', type: 'POST',
url: _PS_MR_MODULE_DIR_ + 'ajax.php', url: _PS_MR_MODULE_DIR_ + 'ajax.php',
data: {'method' : 'addSelectedCarrierToDB', data: {'method' : 'addSelectedCarrierToDB',
@@ -384,6 +386,7 @@ function PS_MRAddSelectedRelayPointInDB(relayPointNumber, id_carrier)
'mrtoken' : mrtoken}, 'mrtoken' : mrtoken},
success: function(json) success: function(json)
{ {
}, },
error: function(xhr, ajaxOptions, thrownError) error: function(xhr, ajaxOptions, thrownError)
{ {
@@ -398,6 +401,7 @@ function PS_MRAddSelectedRelayPointInDB(relayPointNumber, id_carrier)
function PS_MRAddSelectedCarrierInDB(id_carrier) function PS_MRAddSelectedCarrierInDB(id_carrier)
{ {
PS_MRHideLastRelayPointList(); PS_MRHideLastRelayPointList();
// Make the request // Make the request
$.ajax({ $.ajax({
type: 'POST', type: 'POST',
@@ -417,12 +421,23 @@ function PS_MRAddSelectedCarrierInDB(id_carrier)
function PS_MRCarrierSelectedProcess(carrierSelected, id_carrier, MRLivraisonType) function PS_MRCarrierSelectedProcess(carrierSelected, id_carrier, MRLivraisonType)
{ {
// Reset for any carrier changement
if (MRLivraisonType != 'LD1' && MRLivraisonType != 'LDS') if (MRLivraisonType != 'LD1' && MRLivraisonType != 'LDS')
{
// Seek Relay point if it doesn't a home delivery mode // Seek Relay point if it doesn't a home delivery mode
PS_MRGetRelayPoint(carrierSelected); PS_MRGetRelayPoint(carrierSelected);
// Will have relay points
PS_MRSelectedRelayPoint['relayPointNum'] = 0;
}
else else
{
// Simply add the selected carrier to the db, relay information will be empty // Simply add the selected carrier to the db, relay information will be empty
PS_MRAddSelectedCarrierInDB(id_carrier); PS_MRAddSelectedCarrierInDB(id_carrier);
// Won't have any relay points
PS_MRSelectedRelayPoint['relayPointNum'] = -1;
}
} }
/* /*
@@ -433,6 +448,26 @@ function PS_MRHideLastRelayPointList()
$('.PS_MRSelectedCarrier').fadeOut('fast'); $('.PS_MRSelectedCarrier').fadeOut('fast');
} }
/*
** Check if the user select a carrier and a relay point if exist
*/
function PS_MRCheckSelectedRelayPoint()
{
var input;
// Check if the input is linked to the module and look into
// a temporary variable if a relay point has been selected
if ((input = $('input[name=id_carrier]:checked')).length &&
PS_MRCarrierMethodList[input.val()] != undefined &&
PS_MRSelectedRelayPoint['relayPointNum'] == 0)
{
//$('#PS_MRSelectCarrierError').fadeIn('fast');
alert(PS_MRTranslationList['errorSelection']);
return false;
}
return true;
}
/* /*
** Link the generated relay point to an handle click ** Link the generated relay point to an handle click
** Allow to add the selected relay point in the database ** Allow to add the selected relay point in the database
@@ -535,7 +570,7 @@ function PS_MRFetchRelayPoint(carrierSelected)
</td></tr>'); </td></tr>');
fetchingRelayPoint[carrier_id] = $('#PS_MRSelectedCarrier_' + carrier_id); fetchingRelayPoint[carrier_id] = $('#PS_MRSelectedCarrier_' + carrier_id);
$.ajax( MRjQuery.ajax(
{ {
type: 'POST', type: 'POST',
url: _PS_MR_MODULE_DIR_ + 'ajax.php', url: _PS_MR_MODULE_DIR_ + 'ajax.php',
@@ -748,6 +783,10 @@ function PS_MRAddGMapMarker(id_carrier, relayPointNumber, contentBlockid)
$(document).ready(function() $(document).ready(function()
{ {
$('#form').submit(function()
{
return PS_MRCheckSelectedRelayPoint();
});
$('#toggleStatusOrderList').click(function() $('#toggleStatusOrderList').click(function()
{ {
toggleOrderListSelection(); toggleOrderListSelection();
+27 -18
View File
@@ -59,7 +59,7 @@ class MondialRelay extends Module
{ {
$this->name = 'mondialrelay'; $this->name = 'mondialrelay';
$this->tab = 'shipping_logistics'; $this->tab = 'shipping_logistics';
$this->version = '1.7'; $this->version = '1.7.3';
parent::__construct(); parent::__construct();
@@ -394,13 +394,20 @@ class MondialRelay extends Module
** Override a jQuery version included by another one us. ** Override a jQuery version included by another one us.
** Allow a compatibility for Presta < 1.4 ** Allow a compatibility for Presta < 1.4
*/ */
public static function getJqueryCompatibility() public static function getJqueryCompatibility($overloadCurrent = false)
{ {
if ($overloadCurrent)
return ' return '
<script type="text/javascript"> <script type="text/javascript">
jq13 = jQuery.noConflict(true); current = jQuery.noConflict(true);
</script> </script>
<script type="text/javascript" src="'.self::$moduleURL.'/jquery-1.4.4.min.js"></script>'; <script type="text/javascript" src="'.self::$moduleURL.'/jquery-1.4.4.min.js"></script>';
return '
<script type="text/javascript" src="'.self::$moduleURL.'/jquery-1.4.4.min.js"></script>
<script type="text/javascript">
MRjQuery = jQuery.noConflict(true);
</script>';
} }
public function hookNewOrder($params) public function hookNewOrder($params)
@@ -422,7 +429,8 @@ class MondialRelay extends Module
var _PS_MR_MODULE_DIR_ = "'.self::$moduleURL.'"; var _PS_MR_MODULE_DIR_ = "'.self::$moduleURL.'";
var mrtoken = "'.self::$MRBackToken.'"; var mrtoken = "'.self::$MRBackToken.'";
</script> </script>
<script type="text/javascript" src="'.$jsFilePath.'"></script>'; <script type="text/javascript" src="'.$jsFilePath.'"></script>'.
self::getJqueryCompatibility(true);
} }
private function _postValidation() private function _postValidation()
@@ -625,7 +633,8 @@ class MondialRelay extends Module
'one_page_checkout' => (Configuration::get('PS_ORDER_PROCESS_TYPE') ? Configuration::get('PS_ORDER_PROCESS_TYPE') : 0), 'one_page_checkout' => (Configuration::get('PS_ORDER_PROCESS_TYPE') ? Configuration::get('PS_ORDER_PROCESS_TYPE') : 0),
'new_base_dir' => self::$moduleURL, 'new_base_dir' => self::$moduleURL,
'MRToken' => self::$MRFrontToken, 'MRToken' => self::$MRFrontToken,
'carriersextra' => $carriersList)); 'carriersextra' => $carriersList,
'jQueryOverload' => self::getJqueryCompatibility()));
return $this->display(__FILE__, 'mondialrelay.tpl'); return $this->display(__FILE__, 'mondialrelay.tpl');
} }
@@ -768,7 +777,7 @@ class MondialRelay extends Module
Db::getInstance()->Execute(' Db::getInstance()->Execute('
INSERT INTO `' . _DB_PREFIX_ . 'carrier` INSERT INTO `' . _DB_PREFIX_ . 'carrier`
(`url`, `name`, `active`, `is_module`, `range_behavior`) (`url`, `name`, `active`, `is_module`, `range_behavior`)
VALUES(NULL, "'.pSQL('mondialrelay').'", "1", "1", "1")'); VALUES(NULL, "'.pSQL('mondialrelay').'", "1", "0", "1")');
$get = Db::getInstance()->getRow('SELECT * FROM `' . _DB_PREFIX_ . 'carrier` WHERE `id_carrier` = "' . Db::getInstance()->Insert_ID() . '"'); $get = Db::getInstance()->getRow('SELECT * FROM `' . _DB_PREFIX_ . 'carrier` WHERE `id_carrier` = "' . Db::getInstance()->Insert_ID() . '"');
Db::getInstance()->Execute('UPDATE `' . _DB_PREFIX_ . 'mr_method` SET `id_carrier` = "' . (int)($get['id_carrier']) . '" WHERE `id_mr_method` = "' . pSQL($mainInsert) . '"'); Db::getInstance()->Execute('UPDATE `' . _DB_PREFIX_ . 'mr_method` SET `id_carrier` = "' . (int)($get['id_carrier']) . '" WHERE `id_mr_method` = "' . pSQL($mainInsert) . '"');
@@ -806,7 +815,7 @@ class MondialRelay extends Module
{ {
$zones = Db::getInstance()->ExecuteS("SELECT * FROM " . _DB_PREFIX_ . "zone WHERE active = 1"); $zones = Db::getInstance()->ExecuteS("SELECT * FROM " . _DB_PREFIX_ . "zone WHERE active = 1");
$output = ' $output = '
<form action="'.$_SERVER['REQUEST_URI'].'" method="post" > <form action="'.Tools::safeOutput($_SERVER['REQUEST_URI']).'" method="post" >
<fieldset> <fieldset>
<legend><img src="../modules/mondialrelay/images/logo.gif" alt="" />'.$this->l('Add a Shipping Method').'</legend> <legend><img src="../modules/mondialrelay/images/logo.gif" alt="" />'.$this->l('Add a Shipping Method').'</legend>
<ul> <ul>
@@ -815,7 +824,7 @@ class MondialRelay extends Module
</li> </li>
<li> <li>
<label for="mr_Name" class="shipLabel">'.$this->l('Carrier\'s name').'<sup>*</sup></label> <label for="mr_Name" class="shipLabel">'.$this->l('Carrier\'s name').'<sup>*</sup></label>
<input type="text" id="mr_Name" name="mr_Name" '.(Tools::getValue('mr_Name') ? 'value="'.Tools::getValue('mr_Name').'"' : '').'/> <input type="text" id="mr_Name" name="mr_Name" '.(Tools::getValue('mr_Name') ? 'value="'.Tools::safeOutput(Tools::getValue('mr_Name')).'"' : '').'/>
</li> </li>
<li> <li>
<label for="mr_ModeCol" class="shipLabel">'.$this->l('Collection Mode').'<sup>*</sup></label> <label for="mr_ModeCol" class="shipLabel">'.$this->l('Collection Mode').'<sup>*</sup></label>
@@ -878,7 +887,7 @@ class MondialRelay extends Module
WHERE c.`deleted` = 0'); WHERE c.`deleted` = 0');
$output = ' $output = '
<form action="' . $_SERVER['REQUEST_URI'] . '" method="post"> <form action="' . Tools::safeOutput($_SERVER['REQUEST_URI']) . '" method="post">
<fieldset class="shippingList"> <fieldset class="shippingList">
<legend><img src="../modules/mondialrelay/images/logo.gif" />'.$this->l('Shipping Method\'s list').'</legend> <legend><img src="../modules/mondialrelay/images/logo.gif" />'.$this->l('Shipping Method\'s list').'</legend>
<ol>'; <ol>';
@@ -942,7 +951,7 @@ class MondialRelay extends Module
// Check if a request exist and if errors occured, use the post variable // Check if a request exist and if errors occured, use the post variable
if (Tools::isSubmit('PS_MRSubmitFieldPersonalization') && count($this->_postErrors)) if (Tools::isSubmit('PS_MRSubmitFieldPersonalization') && count($this->_postErrors))
$addr1 = Tools::getValue('Expe_ad1'); $addr1 = Tools::safeOutput(Tools::getValue('Expe_ad1'));
if (!Configuration::get('PS_MR_SHOP_NAME')) if (!Configuration::get('PS_MR_SHOP_NAME'))
@@ -950,7 +959,7 @@ class MondialRelay extends Module
$this->l('Its seems you updated Mondialrelay without use the uninstall / install method, you have to set up this part to make working the generating ticket process'). $this->l('Its seems you updated Mondialrelay without use the uninstall / install method, you have to set up this part to make working the generating ticket process').
'</div>'; '</div>';
// Form // Form
$form = '<form action="'.$_SERVER['REQUEST_URI'].'" method="post" class="form">'; $form = '<form action="'.Tools::safeOutput($_SERVER['REQUEST_URI']).'" method="post" class="form">';
$form .= ' $form .= '
<fieldset class="PS_MRFormStyle"> <fieldset class="PS_MRFormStyle">
<legend> <legend>
@@ -983,7 +992,7 @@ class MondialRelay extends Module
{ {
$this->orderState = Configuration::get('MONDIAL_RELAY_ORDER_STATE'); $this->orderState = Configuration::get('MONDIAL_RELAY_ORDER_STATE');
$output = ''; $output = '';
$output .= '<form action="'.$_SERVER['REQUEST_URI'].'" method="post" class="form">'; $output .= '<form action="'.Tools::safeOutput($_SERVER['REQUEST_URI']).'" method="post" class="form">';
$output .= '<fieldset><legend><img src="../modules/mondialrelay/images/logo.gif" />'.$this->l('Settings').'</legend>'; $output .= '<fieldset><legend><img src="../modules/mondialrelay/images/logo.gif" />'.$this->l('Settings').'</legend>';
$output .= '<label for="id_order_state">' . $this->l('Order state') . '</label>'; $output .= '<label for="id_order_state">' . $this->l('Order state') . '</label>';
$output .= '<div class="margin-form">'; $output .= '<div class="margin-form">';
@@ -1012,7 +1021,7 @@ class MondialRelay extends Module
public function settingsForm() public function settingsForm()
{ {
$output = ' $output = '
<form action="' . $_SERVER['REQUEST_URI'] . '" method="post" > <form action="' . Tools::safeOutput($_SERVER['REQUEST_URI']) . '" method="post" >
<fieldset> <fieldset>
<legend><img src="../modules/mondialrelay/images/logo.gif" />'.$this->l('Mondial Relay Account Settings').'</legend> <legend><img src="../modules/mondialrelay/images/logo.gif" />'.$this->l('Mondial Relay Account Settings').'</legend>
<div> <div>
@@ -1025,22 +1034,22 @@ class MondialRelay extends Module
<li> <li>
<label for="mr_Enseigne_WebService" class="mrLabel">' . $this->l('Webservice Enseigne:') . '<sup>*</sup></label> <label for="mr_Enseigne_WebService" class="mrLabel">' . $this->l('Webservice Enseigne:') . '<sup>*</sup></label>
<input id="mr_Enseigne_WebService" class="mrInput" type="text" name="mr_Enseigne_WebService" value="' . <input id="mr_Enseigne_WebService" class="mrInput" type="text" name="mr_Enseigne_WebService" value="' .
(Tools::getValue('mr_Enseigne_WebService') ? Tools::getValue('mr_Enseigne_WebService') : Configuration::get('MR_ENSEIGNE_WEBSERVICE')) . '"/> (Tools::getValue('mr_Enseigne_WebService') ? Tools::safeOutput(Tools::getValue('mr_Enseigne_WebService')) : Configuration::get('MR_ENSEIGNE_WEBSERVICE')) . '"/>
</li> </li>
<li> <li>
<label for="mr_code_marque" class="mrLabel">' . $this->l('Code marque:') . '<sup>*</sup></label> <label for="mr_code_marque" class="mrLabel">' . $this->l('Code marque:') . '<sup>*</sup></label>
<input id="mr_code_marque" class="mrInput" type="text" name="mr_code_marque" value="' . <input id="mr_code_marque" class="mrInput" type="text" name="mr_code_marque" value="' .
(Tools::getValue('mr_code_marque') ? Tools::getValue('mr_code_marque') : Configuration::get('MR_CODE_MARQUE')) . '"/> (Tools::getValue('mr_code_marque') ? Tools::safeOutput(Tools::getValue('mr_code_marque')) : Configuration::get('MR_CODE_MARQUE')) . '"/>
</li> </li>
<li> <li>
<label for="mr_Key_WebService" class="mrLabel">' . $this->l('Webservice Key:') . '<sup>*</sup></label> <label for="mr_Key_WebService" class="mrLabel">' . $this->l('Webservice Key:') . '<sup>*</sup></label>
<input id="mr_Key_WebService" class="mrInput" type="text" name="mr_Key_WebService" value="' . <input id="mr_Key_WebService" class="mrInput" type="text" name="mr_Key_WebService" value="' .
(Tools::getValue('mr_Key_WebService') ? Tools::getValue('mr_Key_WebService') : Configuration::get('MR_KEY_WEBSERVICE')) . '"/> (Tools::getValue('mr_Key_WebService') ? Tools::safeOutput(Tools::getValue('mr_Key_WebService')) : Configuration::get('MR_KEY_WEBSERVICE')) . '"/>
</li> </li>
<li> <li>
<label for="mr_Langage" class="mrLabel">' . $this->l('Etiquette\'s Language:') . '<sup>*</sup></label> <label for="mr_Langage" class="mrLabel">' . $this->l('Etiquette\'s Language:') . '<sup>*</sup></label>
<select id="mr_Langage" name="mr_Langage" value="'. <select id="mr_Langage" name="mr_Langage" value="'.
(Tools::getValue('mr_Langage') ? Tools::getValue('mr_Langage') : Configuration::get('MR_LANGUAGE')).'" >'; (Tools::getValue('mr_Langage') ? Tools::safeOutput(Tools::getValue('mr_Langage')) : Configuration::get('MR_LANGUAGE')).'" >';
$languages = Language::getLanguages(); $languages = Language::getLanguages();
foreach ($languages as $language) foreach ($languages as $language)
$output .= '<option value="'.strtoupper($language['iso_code']).'" '.(strtoupper($language['iso_code']) == Configuration::get('MR_LANGUAGE') ? 'selected="selected"' : '').'>'.$language['name'].'</option>'; $output .= '<option value="'.strtoupper($language['iso_code']).'" '.(strtoupper($language['iso_code']) == Configuration::get('MR_LANGUAGE') ? 'selected="selected"' : '').'>'.$language['name'].'</option>';
@@ -1050,7 +1059,7 @@ class MondialRelay extends Module
<li> <li>
<label for="mr_weight_coef" class="mrLabel">' . $this->l('Weight Coefficient:') . '<sup>*</sup></label> <label for="mr_weight_coef" class="mrLabel">' . $this->l('Weight Coefficient:') . '<sup>*</sup></label>
<input class="mrInput" type="text" name="mr_weight_coef" value="' . <input class="mrInput" type="text" name="mr_weight_coef" value="' .
(Tools::getValue('mr_weight_coef') ? Tools::getValue('mr_weight_coef') : Configuration::get('MR_WEIGHT_COEF')) . '" style="width:45px;"/> (Tools::getValue('mr_weight_coef') ? Tools::safeOutput(Tools::getValue('mr_weight_coef')) : Configuration::get('MR_WEIGHT_COEF')) . '" style="width:45px;"/>
<span class="indication">(' . $this->l('grammes = 1 ') . Configuration::get('PS_WEIGHT_UNIT').')</span> <span class="indication">(' . $this->l('grammes = 1 ') . Configuration::get('PS_WEIGHT_UNIT').')</span>
</li> </li>
<li class="PS_MRSubmit"> <li class="PS_MRSubmit">
+5
View File
@@ -24,6 +24,8 @@
* International Registered Trademark & Property of PrestaShop SA * International Registered Trademark & Property of PrestaShop SA
*} *}
{$jQueryOverload}
<link href="{$new_base_dir}/style.css" rel="stylesheet" type="text/css" media="all" /> <link href="{$new_base_dir}/style.css" rel="stylesheet" type="text/css" media="all" />
<script type="text/javascript"> <script type="text/javascript">
@@ -33,9 +35,11 @@
var one_page_checkout = {$one_page_checkout}; var one_page_checkout = {$one_page_checkout};
var PS_MRTranslationList = new Array(); var PS_MRTranslationList = new Array();
var PS_MRCarrierMethodList = new Array(); var PS_MRCarrierMethodList = new Array();
var PS_MRSelectedRelayPoint = {literal}{{/literal}'carrier_id': 0, 'relayPointNum': 0{literal}}{/literal};
PS_MRTranslationList['Select'] = "{l s='Select' mod='mondialrelay'}"; PS_MRTranslationList['Select'] = "{l s='Select' mod='mondialrelay'}";
PS_MRTranslationList['Selected'] = "{l s='Selected' mod='mondialrelay'}"; PS_MRTranslationList['Selected'] = "{l s='Selected' mod='mondialrelay'}";
PS_MRTranslationList['errorSelection'] = "{l s='Please choose a relay point' mod='mondialrelay'}";
</script> </script>
<script type="text/javascript" src="{$new_base_dir}mondialrelay.js"></script> <script type="text/javascript" src="{$new_base_dir}mondialrelay.js"></script>
@@ -43,6 +47,7 @@
<script type="text/javascript" src="{$new_base_dir}js/gmap.js"></script> <script type="text/javascript" src="{$new_base_dir}js/gmap.js"></script>
<script type="text/javascript"> <script type="text/javascript">
$(document).ready(function() $(document).ready(function()
{literal}{{/literal} {literal}{{/literal}
// Bind id_carrierX to an ajax call // Bind id_carrierX to an ajax call
+5 -5
View File
@@ -371,7 +371,7 @@ class MoneyBookers extends PaymentModule
$this->l('Moneybookers changes its name and becomes Skrill!').'<br /><br /> $this->l('Moneybookers changes its name and becomes Skrill!').'<br /><br />
<div style="clear: both;"></div> <div style="clear: both;"></div>
<form method="post" action="'.$_SERVER['REQUEST_URI'].'" id="form-settings"> <form method="post" action="'.Tools::safeOutput($_SERVER['REQUEST_URI']).'" id="form-settings">
<fieldset class="width2" style="margin: 20px 0; width: 800px;"> <fieldset class="width2" style="margin: 20px 0; width: 800px;">
<legend><img src="'.__PS_BASE_URI__.'modules/moneybookers/logo.gif" alt="" />'.$this->l('Settings').'</legend> <legend><img src="'.__PS_BASE_URI__.'modules/moneybookers/logo.gif" alt="" />'.$this->l('Settings').'</legend>
<div class="margin-form" style="margin:0; padding:0 0 1em 20px"> <div class="margin-form" style="margin:0; padding:0 0 1em 20px">
@@ -399,7 +399,7 @@ class MoneyBookers extends PaymentModule
</div> </div>
</fieldset> </fieldset>
</form> </form>
<form method="post" action="'.$_SERVER['REQUEST_URI'].'" id="form-opening"> <form method="post" action="'.Tools::safeOutput($_SERVER['REQUEST_URI']).'" id="form-opening">
<fieldset class="width2" style="margin: 20px 0; width: 800px;"> <fieldset class="width2" style="margin: 20px 0; width: 800px;">
<legend><img src="'.__PS_BASE_URI__.'modules/moneybookers/logo.gif" alt="" />'.$this->l('Open Account').'</legend> <legend><img src="'.__PS_BASE_URI__.'modules/moneybookers/logo.gif" alt="" />'.$this->l('Open Account').'</legend>
'.$this->l('Start by opening a').' <b>'.$this->l('free account').'</b> '.$this->l('with Moneybookers:').' '.$this->l('Start by opening a').' <b>'.$this->l('free account').'</b> '.$this->l('with Moneybookers:').'
@@ -441,7 +441,7 @@ class MoneyBookers extends PaymentModule
</fieldset> </fieldset>
</form> </form>
<form method="post" action="'.$_SERVER['REQUEST_URI'].'" id="form-activation"'.((!Configuration::get('MB_PARAMETERS') AND !isset($_POST['SubmitValidation'])) ? ' style="display: none;"' : '').'> <form method="post" action="'.Tools::safeOutput($_SERVER['REQUEST_URI']).'" id="form-activation"'.((!Configuration::get('MB_PARAMETERS') AND !isset($_POST['SubmitValidation'])) ? ' style="display: none;"' : '').'>
<fieldset class="width2" style="margin: 20px 0; width: 800px;"> <fieldset class="width2" style="margin: 20px 0; width: 800px;">
<legend><img src="'.__PS_BASE_URI__.'modules/moneybookers/logo.gif" alt="" />'.$this->l('Account validation').'</legend> <legend><img src="'.__PS_BASE_URI__.'modules/moneybookers/logo.gif" alt="" />'.$this->l('Account validation').'</legend>
'.(Configuration::get('MB_PARAMETERS') == 1 ? '<p style="font-weight: bold; color: green;"><img src="../img/admin/ok.gif" alt="" /> '.$this->l('Your account has been activated').'</p>' : '').' '.(Configuration::get('MB_PARAMETERS') == 1 ? '<p style="font-weight: bold; color: green;"><img src="../img/admin/ok.gif" alt="" /> '.$this->l('Your account has been activated').'</p>' : '').'
@@ -452,7 +452,7 @@ class MoneyBookers extends PaymentModule
</fieldset> </fieldset>
</form> </form>
<form method="post" action="'.$_SERVER['REQUEST_URI'].'" id="form-secret"'.((!Configuration::get('MB_PARAMETERS') AND !isset($_POST['SubmitSecret'])) ? ' style="display: none;"' : '').'> <form method="post" action="'.Tools::safeOutput($_SERVER['REQUEST_URI']).'" id="form-secret"'.((!Configuration::get('MB_PARAMETERS') AND !isset($_POST['SubmitSecret'])) ? ' style="display: none;"' : '').'>
<fieldset class="width2" style="margin: 20px 0; width: 800px;"> <fieldset class="width2" style="margin: 20px 0; width: 800px;">
<legend><img src="'.__PS_BASE_URI__.'modules/moneybookers/logo.gif" alt="" />'.$this->l('Secret word validation').'</legend> <legend><img src="'.__PS_BASE_URI__.'modules/moneybookers/logo.gif" alt="" />'.$this->l('Secret word validation').'</legend>
'.(Configuration::get('MB_PARAMETERS_2') == 1 ? '<p style="font-weight: bold; color: green;"><img src="../img/admin/ok.gif" alt="" /> '.$this->l('Your secret word has been activated').'</p>' : '').' '.(Configuration::get('MB_PARAMETERS_2') == 1 ? '<p style="font-weight: bold; color: green;"><img src="../img/admin/ok.gif" alt="" /> '.$this->l('Your secret word has been activated').'</p>' : '').'
@@ -473,7 +473,7 @@ class MoneyBookers extends PaymentModule
</fieldset> </fieldset>
</form> </form>
<form method="post" action="'.$_SERVER['REQUEST_URI'].'" id="form-settings"'.(!Configuration::get('MB_PARAMETERS') ? ' style="display: none;"' : '').'> <form method="post" action="'.Tools::safeOutput($_SERVER['REQUEST_URI']).'" id="form-settings"'.(!Configuration::get('MB_PARAMETERS') ? ' style="display: none;"' : '').'>
<style type="text/css"> <style type="text/css">
label { label {
width: 300px; width: 300px;
+3 -3
View File
@@ -115,7 +115,7 @@ class Newsletter extends Module
$this->_html .= $this->displayConfirmation( $this->_html .= $this->displayConfirmation(
$this->l('The .CSV file has been successfully exported.'). $this->l('The .CSV file has been successfully exported.').
' ('.$nb.' '.$this->l('customers found').')<br />> ' ('.$nb.' '.$this->l('customers found').')<br />>
<a href="../modules/newsletter/'.strval($_POST['action']).'_'.$this->_file.'"><b>'.$this->l('Download the file').' '.$this->_file.'</b></a> <a href="../modules/newsletter/'.Tools::safeOutput(strval($_POST['action'])).'_'.$this->_file.'"><b>'.$this->l('Download the file').' '.$this->_file.'</b></a>
<br /> <br />
<ol style="margin-top: 10px;"> <ol style="margin-top: 10px;">
<li style="color: red;">'.$this->l('WARNING: If opening this .csv file with Excel, remember to choose UTF-8 encoding or you may see strange characters.').'</li> <li style="color: red;">'.$this->l('WARNING: If opening this .csv file with Excel, remember to choose UTF-8 encoding or you may see strange characters.').'</li>
@@ -192,14 +192,14 @@ class Newsletter extends Module
</p> </p>
</fieldset><br /> </fieldset><br />
<fieldset class="width3"><legend>'.$this->l('Export Newsletter Subscribers').'</legend> <fieldset class="width3"><legend>'.$this->l('Export Newsletter Subscribers').'</legend>
<form action="'.$_SERVER['REQUEST_URI'].'" method="post"> <form action="'.Tools::safeOutput($_SERVER['REQUEST_URI']).'" method="post">
<input type="hidden" name="action" value="blockNewsletter"> <input type="hidden" name="action" value="blockNewsletter">
'.$this->l('Generate a .CSV file based on BlockNewsletter subscribers data.').'.<br /><br />'; '.$this->l('Generate a .CSV file based on BlockNewsletter subscribers data.').'.<br /><br />';
$this->_html .= '<br /> $this->_html .= '<br />
<center><input type="submit" class="button" name="submitExport" value="'.$this->l('Export .CSV file').'" /></center> <center><input type="submit" class="button" name="submitExport" value="'.$this->l('Export .CSV file').'" /></center>
</form></fieldset><br /> </form></fieldset><br />
<fieldset class="width3"><legend>'.$this->l('Export customers').'</legend> <fieldset class="width3"><legend>'.$this->l('Export customers').'</legend>
<form action="'.$_SERVER['REQUEST_URI'].'" method="post"> <form action="'.Tools::safeOutput($_SERVER['REQUEST_URI']).'" method="post">
<input type="hidden" name="action" value="customers"> <input type="hidden" name="action" value="customers">
'.$this->l('Generate a .CSV file from customer account data').'.<br /><br />'; '.$this->l('Generate a .CSV file from customer account data').'.<br /><br />';
foreach ($this->_fieldsExport as $key => $field) foreach ($this->_fieldsExport as $key => $field)
+3 -3
View File
@@ -117,17 +117,17 @@ class Ogone extends PaymentModule
<fieldset><legend><img src="../img/admin/contact.gif" /> '.$this->l('Settings').'</legend> <fieldset><legend><img src="../img/admin/contact.gif" /> '.$this->l('Settings').'</legend>
<label for="pspid">'.$this->l('PSPID').'</label> <label for="pspid">'.$this->l('PSPID').'</label>
<div class="margin-form"> <div class="margin-form">
<input type="text" id="pspid" size="20" name="OGONE_PSPID" value="'.Tools::getValue('OGONE_PSPID', Configuration::get('OGONE_PSPID')).'" /> <input type="text" id="pspid" size="20" name="OGONE_PSPID" value="'.Tools::safeOutput(Tools::getValue('OGONE_PSPID', Configuration::get('OGONE_PSPID'))).'" />
</div> </div>
<div class="clear">&nbsp;</div> <div class="clear">&nbsp;</div>
<label for="sha-in">'.$this->l('SHA-in signature').'</label> <label for="sha-in">'.$this->l('SHA-in signature').'</label>
<div class="margin-form"> <div class="margin-form">
<input type="text" id="sha-in" size="20" name="OGONE_SHA_IN" value="'.Tools::getValue('OGONE_SHA_IN', Configuration::get('OGONE_SHA_IN')).'" /> <input type="text" id="sha-in" size="20" name="OGONE_SHA_IN" value="'.Tools::safeOutput(Tools::getValue('OGONE_SHA_IN', Configuration::get('OGONE_SHA_IN'))).'" />
</div> </div>
<div class="clear">&nbsp;</div> <div class="clear">&nbsp;</div>
<label for="sha-out">'.$this->l('SHA-out signature').'</label> <label for="sha-out">'.$this->l('SHA-out signature').'</label>
<div class="margin-form"> <div class="margin-form">
<input type="text" id="sha-out" size="20" name="OGONE_SHA_OUT" value="'.Tools::getValue('OGONE_SHA_OUT', Configuration::get('OGONE_SHA_OUT')).'" /> <input type="text" id="sha-out" size="20" name="OGONE_SHA_OUT" value="'.Tools::safeOutput(Tools::getValue('OGONE_SHA_OUT', Configuration::get('OGONE_SHA_OUT'))).'" />
</div> </div>
<div class="clear">&nbsp;</div> <div class="clear">&nbsp;</div>
<label>'.$this->l('Mode').'</label> <label>'.$this->l('Mode').'</label>
+1 -1
View File
@@ -328,7 +328,7 @@ abstract class PSCPrepaidServices extends PaymentModule
} }
$currencies_configuration .= '</table>'; $currencies_configuration .= '</table>';
return '<form enctype="multipart/form-data" action="'.$_SERVER['REQUEST_URI'].'" method="post"> return '<form enctype="multipart/form-data" action="'.Tools::safeOutput($_SERVER['REQUEST_URI']).'" method="post">
<fieldset> <fieldset>
<legend><img src="../img/admin/cog.gif" alt="" />'.$this->getL('configuration').'</legend> <legend><img src="../img/admin/cog.gif" alt="" />'.$this->getL('configuration').'</legend>
<label>'.$this->getL('environment').'</label> <label>'.$this->getL('environment').'</label>
@@ -74,7 +74,7 @@ class productsCategory extends Module
$this->_html .= $this->displayConfirmation($this->l('Settings updated successfully')); $this->_html .= $this->displayConfirmation($this->l('Settings updated successfully'));
} }
$this->_html .= ' $this->_html .= '
<form action="'.$_SERVER['REQUEST_URI'].'" method="post"> <form action="'.Tools::safeOutput($_SERVER['REQUEST_URI']).'" method="post">
<fieldset><legend><img src="'.$this->_path.'logo.gif" alt="" title="" />'.$this->l('Settings').'</legend> <fieldset><legend><img src="'.$this->_path.'logo.gif" alt="" title="" />'.$this->l('Settings').'</legend>
<label>'.$this->l('Display price on products').'</label> <label>'.$this->l('Display price on products').'</label>
<div class="margin-form"> <div class="margin-form">
+1 -1
View File
@@ -87,7 +87,7 @@ class ProductToolTip extends Module
/* Configuration form */ /* Configuration form */
$output = ' $output = '
<form action="'.$_SERVER['REQUEST_URI'].'" method="post"> <form action="'.Tools::safeOutput($_SERVER['REQUEST_URI']).'" method="post">
<fieldset class="width2" style="float: left;"> <fieldset class="width2" style="float: left;">
<legend><img src="'.__PS_BASE_URI__.'modules/producttooltip/logo.gif" alt="" />'.$this->l('Product tooltips').'</legend> <legend><img src="'.__PS_BASE_URI__.'modules/producttooltip/logo.gif" alt="" />'.$this->l('Product tooltips').'</legend>
<p> <p>
+6 -6
View File
@@ -241,16 +241,16 @@ class ReferralProgram extends Module
$currencies = Currency::getCurrencies(); $currencies = Currency::getCurrencies();
$this->_html .= ' $this->_html .= '
<form action="'.$_SERVER['REQUEST_URI'].'" method="post"> <form action="'.Tools::safeOutput($_SERVER['REQUEST_URI']).'" method="post">
<fieldset class="width3"> <fieldset class="width3">
<legend><img src="'._PS_ADMIN_IMG_.'prefs.gif" alt="'.$this->l('Settings').'" />'.$this->l('Settings').'</legend> <legend><img src="'._PS_ADMIN_IMG_.'prefs.gif" alt="'.$this->l('Settings').'" />'.$this->l('Settings').'</legend>
<p> <p>
<label class="t" for="order_quantity">'.$this->l('Minimum number of orders a sponsored friend must place to get their voucher:').'</label> <label class="t" for="order_quantity">'.$this->l('Minimum number of orders a sponsored friend must place to get their voucher:').'</label>
<input type="text" name="order_quantity" id="order_quantity" value="'.Tools::getValue('order_quantity', Configuration::get('REFERRAL_ORDER_QUANTITY')).'" style="width: 50px; text-align: right;" /> <input type="text" name="order_quantity" id="order_quantity" value="'.Tools::safeOutput(Tools::getValue('order_quantity', Configuration::get('REFERRAL_ORDER_QUANTITY'))).'" style="width: 50px; text-align: right;" />
</p> </p>
<p> <p>
<label class="t" for="nb_friends">'.$this->l('Number of friends in the referral program invitation form (customer account, referral program section):').'</label> <label class="t" for="nb_friends">'.$this->l('Number of friends in the referral program invitation form (customer account, referral program section):').'</label>
<input type="text" name="nb_friends" id="nb_friends" value="'.Tools::getValue('nb_friends', Configuration::get('REFERRAL_NB_FRIENDS')).'" style="width: 50px; text-align: right;" /> <input type="text" name="nb_friends" id="nb_friends" value="'.Tools::safeOutput(Tools::getValue('nb_friends', Configuration::get('REFERRAL_NB_FRIENDS'))).'" style="width: 50px; text-align: right;" />
</p> </p>
<p> <p>
<label class="t">'.$this->l('Voucher type:').'</label> <label class="t">'.$this->l('Voucher type:').'</label>
@@ -260,7 +260,7 @@ class ReferralProgram extends Module
<input type="radio" name="discount_type" id="discount_type2" value="2" onclick="$(\'#voucherbycurrency\').show(); $(\'#voucherbypercentage\').hide();" '.(Tools::getValue('discount_type', Configuration::get('REFERRAL_DISCOUNT_TYPE')) == 2 ? 'checked="checked"' : '').' /> <input type="radio" name="discount_type" id="discount_type2" value="2" onclick="$(\'#voucherbycurrency\').show(); $(\'#voucherbypercentage\').hide();" '.(Tools::getValue('discount_type', Configuration::get('REFERRAL_DISCOUNT_TYPE')) == 2 ? 'checked="checked"' : '').' />
<label class="t" for="discount_type2">'.$this->l('Voucher offering a fixed amount (by currency)').'</label> <label class="t" for="discount_type2">'.$this->l('Voucher offering a fixed amount (by currency)').'</label>
</p> </p>
<p id="voucherbypercentage"'.(Configuration::get('REFERRAL_DISCOUNT_TYPE') == 2 ? ' style="display: none;"' : '').'><label class="t">'.$this->l('Percentage:').'</label> <input type="text" id="discount_value_percentage" name="discount_value_percentage" value="'.Tools::getValue('discount_value_percentage', Configuration::get('REFERRAL_PERCENTAGE')).'" style="width: 50px; text-align: right;" /> %</p> <p id="voucherbypercentage"'.(Configuration::get('REFERRAL_DISCOUNT_TYPE') == 2 ? ' style="display: none;"' : '').'><label class="t">'.$this->l('Percentage:').'</label> <input type="text" id="discount_value_percentage" name="discount_value_percentage" value="'.Tools::safeOutput(Tools::getValue('discount_value_percentage', Configuration::get('REFERRAL_PERCENTAGE'))).'" style="width: 50px; text-align: right;" /> %</p>
<table id="voucherbycurrency" cellpadding="5" style="border: 1px solid #BBB;'.(Configuration::get('REFERRAL_DISCOUNT_TYPE') == 1 ? ' display: none;' : '').'" border="0"> <table id="voucherbycurrency" cellpadding="5" style="border: 1px solid #BBB;'.(Configuration::get('REFERRAL_DISCOUNT_TYPE') == 1 ? ' display: none;' : '').'" border="0">
<tr> <tr>
<th style="width: 80px;">'.$this->l('Currency').'</th> <th style="width: 80px;">'.$this->l('Currency').'</th>
@@ -271,7 +271,7 @@ class ReferralProgram extends Module
$this->_html .= ' $this->_html .= '
<tr> <tr>
<td>'.(Configuration::get('PS_CURRENCY_DEFAULT') == $currency['id_currency'] ? '<span style="font-weight: bold;">' : '').htmlentities($currency['name'], ENT_NOQUOTES, 'utf-8').(Configuration::get('PS_CURRENCY_DEFAULT') == $currency['id_currency'] ? '<span style="font-weight: bold;">' : '').'</td> <td>'.(Configuration::get('PS_CURRENCY_DEFAULT') == $currency['id_currency'] ? '<span style="font-weight: bold;">' : '').htmlentities($currency['name'], ENT_NOQUOTES, 'utf-8').(Configuration::get('PS_CURRENCY_DEFAULT') == $currency['id_currency'] ? '<span style="font-weight: bold;">' : '').'</td>
<td><input type="text" name="discount_value['.(int)($currency['id_currency']).']" id="discount_value['.(int)($currency['id_currency']).']" value="'.Tools::getValue('discount_value['.(int)($currency['id_currency']).']', Configuration::get('REFERRAL_DISCOUNT_VALUE_'.(int)($currency['id_currency']))).'" style="width: 50px; text-align: right;" /> '.$currency['sign'].'</td> <td><input type="text" name="discount_value['.(int)($currency['id_currency']).']" id="discount_value['.(int)($currency['id_currency']).']" value="'.Tools::safeOutput(Tools::getValue('discount_value['.(int)($currency['id_currency']).']', Configuration::get('REFERRAL_DISCOUNT_VALUE_'.(int)($currency['id_currency'])))).'" style="width: 50px; text-align: right;" /> '.$currency['sign'].'</td>
</tr>'; </tr>';
$this->_html .= ' $this->_html .= '
@@ -320,7 +320,7 @@ class ReferralProgram extends Module
<script type="text/javascript" src="'.__PS_BASE_URI__.'js/tiny_mce/tiny_mce.js"></script> <script type="text/javascript" src="'.__PS_BASE_URI__.'js/tiny_mce/tiny_mce.js"></script>
<script type="text/javascript" src="'.__PS_BASE_URI__.'js/tinymce.inc.js"></script> <script type="text/javascript" src="'.__PS_BASE_URI__.'js/tinymce.inc.js"></script>
<script language="javascript">id_language = Number('.$defaultLanguage.');</script> <script language="javascript">id_language = Number('.$defaultLanguage.');</script>
<form method="post" action="'.$_SERVER['REQUEST_URI'].'" enctype="multipart/form-data"> <form method="post" action="'.Tools::safeOutput($_SERVER['REQUEST_URI']).'" enctype="multipart/form-data">
<fieldset> <fieldset>
<legend><img src="'.$this->_path.'logo.gif" alt="" title="" /> '.$this->l('Conditions of the referral program').'</legend>'; <legend><img src="'.$this->_path.'logo.gif" alt="" title="" /> '.$this->l('Conditions of the referral program').'</legend>';
foreach ($languages AS $language) foreach ($languages AS $language)
+1 -1
View File
@@ -95,7 +95,7 @@ class Reverso extends Module
$this->_html .= $this->_html .=
'<br /><fieldset><legend>'.$this->l('Configuration').'</legend> '<br /><fieldset><legend>'.$this->l('Configuration').'</legend>
<form action="'.$_SERVER['REQUEST_URI'].'" method="post"> <form action="'.Tools::safeOutput($_SERVER['REQUEST_URI']).'" method="post">
<label for="serial">'.$this->l('Serial number').' :</label> <label for="serial">'.$this->l('Serial number').' :</label>
<div class="margin-form"> <div class="margin-form">
<input type="text" name="reverso_serial" value="'.$conf['REVERSO_SERIAL'].'" /> <input type="text" name="reverso_serial" value="'.$conf['REVERSO_SERIAL'].'" />
+5 -5
View File
@@ -607,7 +607,7 @@ class Secuvad extends Module
private function _setFormConfigure() private function _setFormConfigure()
{ {
$this->_html .= ' $this->_html .= '
<form method="POST" action="'.$_SERVER['REQUEST_URI'].'"> <form method="POST" action="'.Tools::safeOutput($_SERVER['REQUEST_URI']).'">
<fieldset style="width:430px;margin-right:10px;margin-bottom:10px;"> <fieldset style="width:430px;margin-right:10px;margin-bottom:10px;">
<legend><img src="'._PS_BASE_URL_.__PS_BASE_URI__.'/modules/'.$this->name.'/logo.gif" alt="" /> '.$this->l('Company').'</legend> <legend><img src="'._PS_BASE_URL_.__PS_BASE_URI__.'/modules/'.$this->name.'/logo.gif" alt="" /> '.$this->l('Company').'</legend>
@@ -645,7 +645,7 @@ class Secuvad extends Module
$categories[1]['infos'] = array('name' => $this->l('Home'), 'id_parent' => 0, 'level_depth' => 0); $categories[1]['infos'] = array('name' => $this->l('Home'), 'id_parent' => 0, 'level_depth' => 0);
$this->_html .= ' $this->_html .= '
<form method="POST" action="'.$_SERVER['REQUEST_URI'].'"> <form method="POST" action="'.Tools::safeOutput($_SERVER['REQUEST_URI']).'">
<fieldset style="width:900px;margin-right:10px;margin-bottom:10px;"> <fieldset style="width:900px;margin-right:10px;margin-bottom:10px;">
<legend><img src="'._PS_BASE_URL_.__PS_BASE_URI__.'/modules/'.$this->name.'/logo.gif" alt="" /> '.$this->l('Secuvad categories').'</legend> <legend><img src="'._PS_BASE_URL_.__PS_BASE_URI__.'/modules/'.$this->name.'/logo.gif" alt="" /> '.$this->l('Secuvad categories').'</legend>
@@ -664,7 +664,7 @@ class Secuvad extends Module
'; ';
$this->_html .= ' $this->_html .= '
<form method="POST" action="'.$_SERVER['REQUEST_URI'].'"> <form method="POST" action="'.Tools::safeOutput($_SERVER['REQUEST_URI']).'">
<fieldset style="width:430px;margin-right:10px;margin-bottom:10px;"> <fieldset style="width:430px;margin-right:10px;margin-bottom:10px;">
<legend><img src="'._PS_BASE_URL_.__PS_BASE_URI__.'/modules/'.$this->name.'/logo.gif" alt="" /> '.$this->l('Secuvad Payment').'</legend> <legend><img src="'._PS_BASE_URL_.__PS_BASE_URI__.'/modules/'.$this->name.'/logo.gif" alt="" /> '.$this->l('Secuvad Payment').'</legend>
@@ -699,7 +699,7 @@ class Secuvad extends Module
'; ';
$this->_html .= ' $this->_html .= '
<form method="POST" action="'.$_SERVER['REQUEST_URI'].'"> <form method="POST" action="'.Tools::safeOutput($_SERVER['REQUEST_URI']).'">
<fieldset style="width:430px;margin-right:10px;margin-bottom:10px;"> <fieldset style="width:430px;margin-right:10px;margin-bottom:10px;">
<legend><img src="'._PS_BASE_URL_.__PS_BASE_URI__.'/modules/'.$this->name.'/logo.gif" alt="" /> '.$this->l('Secuvad Carrier').'</legend> <legend><img src="'._PS_BASE_URL_.__PS_BASE_URI__.'/modules/'.$this->name.'/logo.gif" alt="" /> '.$this->l('Secuvad Carrier').'</legend>
@@ -786,7 +786,7 @@ class Secuvad extends Module
{ {
$this->_html .= ' $this->_html .= '
<h3>'.$this->l('In order to use the Secuvad module, please fill in this form, then click "Register".').'</h3> <h3>'.$this->l('In order to use the Secuvad module, please fill in this form, then click "Register".').'</h3>
<form method="POST" action="'.($lock ? $this->_getSecuvadRegisterURL() : $_SERVER['REQUEST_URI']).'">'; <form method="POST" action="'.($lock ? $this->_getSecuvadRegisterURL() : Tools::safeOutput($_SERVER['REQUEST_URI'])).'">';
if ($lock) if ($lock)
{ {
foreach (Tools::getValue('categories') as $category) foreach (Tools::getValue('categories') as $category)
+1 -1
View File
@@ -125,7 +125,7 @@ class SEKeywords extends ModuleGraph
$table .= '</tbody></table></div>'; $table .= '</tbody></table></div>';
$this->_html .= '<center>'.$this->engine(array('type' => 'pie')).'</center> $this->_html .= '<center>'.$this->engine(array('type' => 'pie')).'</center>
<br class="clear" /> <br class="clear" />
<p><a href="'.$_SERVER['REQUEST_URI'].'&export=1&exportType=language"><img src="../img/admin/asterisk.gif" />'.$this->l('CSV Export').'</a></p><br class="clear" /> <p><a href="'.Tools::safeOutput($_SERVER['REQUEST_URI']).'&export=1&exportType=language"><img src="../img/admin/asterisk.gif" />'.$this->l('CSV Export').'</a></p><br class="clear" />
<form action="'.Tools::htmlentitiesUTF8($_SERVER['REQUEST_URI']).'" method="post"> <form action="'.Tools::htmlentitiesUTF8($_SERVER['REQUEST_URI']).'" method="post">
'.$this->l('Filter by keyword').' <input type="text" name="SEK_FILTER_KW" value="'.Tools::htmlentitiesUTF8(Configuration::get('SEK_FILTER_KW')).'" /> '.$this->l('Filter by keyword').' <input type="text" name="SEK_FILTER_KW" value="'.Tools::htmlentitiesUTF8(Configuration::get('SEK_FILTER_KW')).'" />
'.$this->l('and min occurrences').' <input type="text" name="SEK_MIN_OCCURENCES" value="'.(int)(Configuration::get('SEK_MIN_OCCURENCES')).'" /> '.$this->l('and min occurrences').' <input type="text" name="SEK_MIN_OCCURENCES" value="'.(int)(Configuration::get('SEK_MIN_OCCURENCES')).'" />
+2 -2
View File
@@ -32,10 +32,10 @@ if (Tools::isSubmit('checkAndSaveConfig'))
$shopImporter = new shopImporter(); $shopImporter = new shopImporter();
foreach($shopImporter->supportedImports as $key => $import) foreach($shopImporter->supportedImports as $key => $import)
if (array_key_exists('alterTable', $import)) if (array_key_exists('alterTable', $import))
$columns = Db::getInstance()->ExecuteS('SHOW COLUMNS FROM `'._DB_PREFIX_.pSQL($import['table']).'`'); $columns = Db::getInstance()->ExecuteS('SHOW COLUMNS FROM `'._DB_PREFIX_.bqSQL($import['table']).'`');
foreach ($columns as $column) foreach ($columns as $column)
if ($column['Field'] == $import['identifier'].'_'.$moduleName) if ($column['Field'] == $import['identifier'].'_'.$moduleName)
Db::getInstance()->Execute('ALTER IGNORE TABLE `'._DB_PREFIX_.pSQL($import['table']).'` DROP `'.pSQL($import['identifier'].'_'.$moduleName).'`'); Db::getInstance()->Execute('ALTER IGNORE TABLE `'._DB_PREFIX_.bqSQL($import['table']).'` DROP `'.bqSQL($import['identifier'].'_'.$moduleName).'`');
if ($link = @mysql_connect(Tools::getValue('server'), Tools::getValue('user'), Tools::getValue('password'))) if ($link = @mysql_connect(Tools::getValue('server'), Tools::getValue('user'), Tools::getValue('password')))
{ {
if (!@mysql_select_db(Tools::getValue('database'), $link)) if (!@mysql_select_db(Tools::getValue('database'), $link))
+13 -13
View File
@@ -701,7 +701,7 @@ class shopimporter extends ImportModule
{ {
$this->saveMatchId(strtolower($className), (int)$object->id, (int)$id); $this->saveMatchId(strtolower($className), (int)$object->id, (int)$id);
if ($className == 'Customer') if ($className == 'Customer')
Db::getInstance()->Execute('UPDATE '._DB_PREFIX_.'customer SET passwd_'.Tools::getValue('moduleName').' = \''.$password.'\' WHERE id_customer = '.(int)$object->id); Db::getInstance()->Execute('UPDATE '._DB_PREFIX_.'customer SET `passwd_'.bqSQL(Tools::getValue('moduleName')).'̀ = \''.pSQL($password).'\' WHERE id_customer = '.(int)$object->id);
if (array_key_exists('hasImage', $this->supportedImports[strtolower($className)]) AND Tools::isSubmit('images_'.$className)) if (array_key_exists('hasImage', $this->supportedImports[strtolower($className)]) AND Tools::isSubmit('images_'.$className))
$this->copyImg($item, $className); $this->copyImg($item, $className);
} }
@@ -795,7 +795,7 @@ class shopimporter extends ImportModule
$associatFields .= (int)$match[$association['fields'][1]][$v].'), '; $associatFields .= (int)$match[$association['fields'][1]][$v].'), ';
} }
if ($associatFields != '') if ($associatFields != '')
Db::getInstance()->Execute('INSERT INTO `'._DB_PREFIX_.pSQL($tableAssociation).'` (`'.$associatFieldsName.'`) VALUES '.rtrim($associatFields, ', ')); Db::getInstance()->Execute('INSERT INTO `'._DB_PREFIX_.bqSQL($tableAssociation).'` (`'.$associatFieldsName.'`) VALUES '.rtrim($associatFields, ', '));
} }
} }
} }
@@ -805,7 +805,7 @@ class shopimporter extends ImportModule
$table = $this->supportedImports[$className]['table']; $table = $this->supportedImports[$className]['table'];
$moduleName = Tools::getValue('moduleName'); $moduleName = Tools::getValue('moduleName');
$identifier = $this->supportedImports[$className]['identifier']; $identifier = $this->supportedImports[$className]['identifier'];
Db::getInstance()->Execute('UPDATE '._DB_PREFIX_.pSQL($table).' SET `'.pSQL($identifier).'_'.pSQL($moduleName).'` = '.(int)$matchId.' WHERE `'.pSQL($identifier).'` = '.(int)$psId); Db::getInstance()->Execute('UPDATE `'._DB_PREFIX_.bqSQL($table).'` SET `'.bqSQL($identifier).'_'.bqSQL($moduleName).'` = '.(int)$matchId.' WHERE `'.bqSQL($identifier).'` = '.(int)$psId);
} }
private function getMatchId($className) private function getMatchId($className)
@@ -813,7 +813,7 @@ class shopimporter extends ImportModule
$table = $this->supportedImports[$className]['table']; $table = $this->supportedImports[$className]['table'];
$moduleName = Tools::getValue('moduleName'); $moduleName = Tools::getValue('moduleName');
$identifier = $this->supportedImports[$className]['identifier']; $identifier = $this->supportedImports[$className]['identifier'];
$returns = Db::getInstance()->ExecuteS('SELECT `'.pSQL($identifier).'_'.pSQL($moduleName).'`, `'.pSQL($identifier).'` FROM '._DB_PREFIX_.pSQL($table).' WHERE `'.pSQL($identifier).'_'.pSQL($moduleName).'` != 0 '); $returns = Db::getInstance()->ExecuteS('SELECT `'.bqSQL($identifier).'_'.bqSQL($moduleName).'`, `'.bqSQL($identifier).'` FROM `'._DB_PREFIX_.bqSQL($table).'` WHERE `'.bqSQL($identifier).'_'.bqSQL($moduleName).'` != 0 ');
$match = array(); $match = array();
foreach($returns as $return) foreach($returns as $return)
$match[$return[$identifier.'_'.$moduleName]] = $return[$identifier]; $match[$return[$identifier.'_'.$moduleName]] = $return[$identifier];
@@ -924,19 +924,19 @@ class shopimporter extends ImportModule
$queryTmp = ''; $queryTmp = '';
$from = $this->supportedImports[$className]['table']; $from = $this->supportedImports[$className]['table'];
$result = array(); $result = array();
$result = Db::getInstance()->getRow('SELECT * FROM `'._DB_PREFIX_.pSQL($from).'`'); $result = Db::getInstance()->getRow('SELECT * FROM `'._DB_PREFIX_.bqSQL($from).'`');
if (!$result) if (!$result)
$result = array(); $result = array();
foreach ($this->supportedImports[$className]['alterTable'] AS $name => $type) foreach ($this->supportedImports[$className]['alterTable'] AS $name => $type)
{ {
$moduleName = Tools::getValue('moduleName'); $moduleName = Tools::getValue('moduleName');
Db::getInstance()->ExecuteS("SHOW COLUMNS FROM `"._DB_PREFIX_.pSQL($from)."` LIKE '".pSQL($name).'_'.pSQL($moduleName)."'"); Db::getInstance()->ExecuteS("SHOW COLUMNS FROM `"._DB_PREFIX_.bqSQL($from)."` LIKE '".pSQL($name).'_'.pSQL($moduleName)."'");
if (!Db::getInstance()->numRows() AND !array_key_exists($name.'_'.$moduleName, $result)) if (!Db::getInstance()->numRows() AND !array_key_exists($name.'_'.$moduleName, $result))
$queryTmp .= ' ADD `'.$name.'_'.$moduleName.'` '.$type.' NOT NULL,'; $queryTmp .= ' ADD `'.$name.'_'.$moduleName.'` '.$type.' NOT NULL,';
} }
if (!empty($queryTmp)) if (!empty($queryTmp))
{ {
$query = 'ALTER TABLE `'._DB_PREFIX_.pSQL($from).'` '; $query = 'ALTER TABLE `'._DB_PREFIX_.bqSQL($from).'` ';
$query .= rtrim($queryTmp, ','); $query .= rtrim($queryTmp, ',');
Db::getInstance()->Execute($query); Db::getInstance()->Execute($query);
} }
@@ -981,7 +981,7 @@ class shopimporter extends ImportModule
foreach($this->supportedImports AS $table => $conf) foreach($this->supportedImports AS $table => $conf)
if ($conf['identifier'] == $key2) if ($conf['identifier'] == $key2)
$from = $this->supportedImports[$table]['table']; $from = $this->supportedImports[$table]['table'];
$return = Db::getInstance()->ExecuteS('SELECT `'.pSQL($key2).'_'.pSQL($moduleName).'`, `'.pSQL($key2).'` FROM `'._DB_PREFIX_.pSQL($from).'` WHERE `'.pSQL($key2).'_'.pSQL($moduleName).'` != 0'); $return = Db::getInstance()->ExecuteS('SELECT `'.bqSQL($key2).'_'.bqSQL($moduleName).'`, `'.bqSQL($key2).'` FROM `'._DB_PREFIX_.bqSQL($from).'` WHERE `'.bqSQL($key2).'_'.bqSQL($moduleName).'` != 0');
if (!empty($return)) if (!empty($return))
foreach($return AS $name => $val) foreach($return AS $name => $val)
$match[$key][$val[$key2.'_'.$moduleName]] = $val[$key2]; $match[$key][$val[$key2.'_'.$moduleName]] = $val[$key2];
@@ -993,7 +993,7 @@ class shopimporter extends ImportModule
{ {
$id = $this->supportedImports[$table]['identifier']; $id = $this->supportedImports[$table]['identifier'];
$moduleName = Tools::getValue('moduleName'); $moduleName = Tools::getValue('moduleName');
$return = Db::getInstance()->ExecuteS('SELECT `'.pSQL($id).'_'.pSQL($moduleName).'`, `'.pSQL($id).'` FROM `'._DB_PREFIX_.pSQL($table).'` WHERE `'.pSQL($id).'_'.pSQL($moduleName).'` != 0'); $return = Db::getInstance()->ExecuteS('SELECT `'.bqSQL($id).'_'.bqSQL($moduleName).'`, `'.bqSQL($id).'` FROM `'._DB_PREFIX_.bqSQL($table).'` WHERE `'.bqSQL($id).'_'.bqSQL($moduleName).'` != 0');
$match = array(); $match = array();
foreach($return AS $name => $val) foreach($return AS $name => $val)
$match[$val[$id.'_'.$moduleName]] = $val[$id]; $match[$val[$id.'_'.$moduleName]] = $val[$id];
@@ -1003,7 +1003,7 @@ class shopimporter extends ImportModule
private function getMatchIdLang($order = 1) private function getMatchIdLang($order = 1)
{ {
$moduleName = Tools::getValue('moduleName'); $moduleName = Tools::getValue('moduleName');
$return = Db::getInstance()->ExecuteS('SELECT `id_lang`, `id_lang_'.pSQL($moduleName).'` FROM `'._DB_PREFIX_.'lang'.'` WHERE `id_lang_'.pSQL($moduleName).'` != 0'); $return = Db::getInstance()->ExecuteS('SELECT `id_lang`, `id_lang_'.bqSQL($moduleName).'` FROM `'._DB_PREFIX_.'lang'.'` WHERE `id_lang_'.bqSQL($moduleName).'` != 0');
$match = array(); $match = array();
foreach($return AS $name => $val) foreach($return AS $name => $val)
if ((bool)$order) if ((bool)$order)
@@ -1183,7 +1183,7 @@ class shopimporter extends ImportModule
{ {
$newId = Language::getIdByIso($iso); $newId = Language::getIdByIso($iso);
Db::getInstance()->Execute('UPDATE `'._DB_PREFIX_.'lang` Db::getInstance()->Execute('UPDATE `'._DB_PREFIX_.'lang`
SET `id_lang_'.pSQL($moduleName).'` = '.(int)$language['id_lang'].' SET `id_lang_'.bqSQL($moduleName).'` = '.(int)$language['id_lang'].'
WHERE `id_lang` = '.(int)$newId); WHERE `id_lang` = '.(int)$newId);
} }
} }
@@ -1206,7 +1206,7 @@ class shopimporter extends ImportModule
{ {
$newId = Language::getIdByIso($iso); $newId = Language::getIdByIso($iso);
Db::getInstance()->Execute('UPDATE `'._DB_PREFIX_.'lang` Db::getInstance()->Execute('UPDATE `'._DB_PREFIX_.'lang`
SET `id_lang_'.pSQL($moduleName).'` = '.(int)$language['id_lang'].' SET `id_lang_'.bqSQL($moduleName).'` = '.(int)$language['id_lang'].'
WHERE `id_lang` = '.(int)$newId); WHERE `id_lang` = '.(int)$newId);
} }
} }
@@ -1290,7 +1290,7 @@ class shopimporter extends ImportModule
case 'customer' : case 'customer' :
case 'zone' : case 'zone' :
case 'state' : case 'state' :
Db::getInstance()->Execute('TRUNCATE TABLE `'._DB_PREFIX_.pSQL($table)); Db::getInstance()->Execute('TRUNCATE TABLE `'._DB_PREFIX_.bqSQL($table).'`');
break; break;
} }
return true; return true;
+3 -3
View File
@@ -211,7 +211,7 @@ class Socolissimo extends CarrierModule
private function _displayForm() private function _displayForm()
{ {
$this->_html .= '<form action="'.$_SERVER['REQUEST_URI'].'" method="post" class="form"> $this->_html .= '<form action="'.Tools::safeOutput($_SERVER['REQUEST_URI']).'" method="post" class="form">
<fieldset><legend><img src="'.$this->_path.'logo.gif" alt="" /> '.$this->l('Description').'</legend>'. <fieldset><legend><img src="'.$this->_path.'logo.gif" alt="" /> '.$this->l('Description').'</legend>'.
$this->l('SoColissimo is a service offered by La Poste, which allows you to offer buyers 5 modes of delivery.').' : $this->l('SoColissimo is a service offered by La Poste, which allows you to offer buyers 5 modes of delivery.').' :
<br/><br/><ul style ="list-style:disc outside none;margin-left:30px;"> <br/><br/><ul style ="list-style:disc outside none;margin-left:30px;">
@@ -234,13 +234,13 @@ class Socolissimo extends CarrierModule
<label>'.$this->l('ID So').' : </label> <label>'.$this->l('ID So').' : </label>
<div class="margin-form"> <div class="margin-form">
<input type="text" name="id_user" value="'.Tools::getValue('id_user', Configuration::get('SOCOLISSIMO_ID')).'" /> <input type="text" name="id_user" value="'.Tools::safeOutput(Tools::getValue('id_user', Configuration::get('SOCOLISSIMO_ID'))).'" />
<p>' . $this->l('Id user for back office SoColissimo.') . '</p> <p>' . $this->l('Id user for back office SoColissimo.') . '</p>
</div> </div>
<label>'.$this->l('Key').' : </label> <label>'.$this->l('Key').' : </label>
<div class="margin-form"> <div class="margin-form">
<input type="text" name="key" value="'.Tools::getValue('key', Configuration::get('SOCOLISSIMO_KEY')).'" /> <input type="text" name="key" value="'.Tools::safeOutput(Tools::getValue('key', Configuration::get('SOCOLISSIMO_KEY'))).'" />
<p>'.$this->l('Secure key for back office SoColissimo.').'</p> <p>'.$this->l('Secure key for back office SoColissimo.').'</p>
</div> </div>
@@ -104,7 +104,7 @@ class StatsBestManufacturers extends ModuleGrid
$this->_html = ' $this->_html = '
<fieldset class="width3"><legend><img src="../modules/'.$this->name.'/logo.gif" /> '.$this->displayName.'</legend> <fieldset class="width3"><legend><img src="../modules/'.$this->name.'/logo.gif" /> '.$this->displayName.'</legend>
'.$this->engine($engineParams).' '.$this->engine($engineParams).'
<br /><a href="'.$_SERVER['REQUEST_URI'].'&export=1"><img src="../img/admin/asterisk.gif" />'.$this->l('CSV Export').'</a> <br /><a href="'.Tools::safeOutput($_SERVER['REQUEST_URI']).'&export=1"><img src="../img/admin/asterisk.gif" />'.$this->l('CSV Export').'</a>
</fieldset>'; </fieldset>';
return $this->_html; return $this->_html;
} }
@@ -103,7 +103,7 @@ class StatsBestSuppliers extends ModuleGrid
$this->_html = ' $this->_html = '
<fieldset class="width3"><legend><img src="../modules/'.$this->name.'/logo.gif" /> '.$this->displayName.'</legend> <fieldset class="width3"><legend><img src="../modules/'.$this->name.'/logo.gif" /> '.$this->displayName.'</legend>
'.$this->engine($engineParams).' '.$this->engine($engineParams).'
<p><a href="'.$_SERVER['REQUEST_URI'].'&export=1"><img src="../img/admin/asterisk.gif" />'.$this->l('CSV Export').'</a></p> <p><a href="'.Tools::safeOutput($_SERVER['REQUEST_URI']).'&export=1"><img src="../img/admin/asterisk.gif" />'.$this->l('CSV Export').'</a></p>
</fieldset>'; </fieldset>';
return $this->_html; return $this->_html;
} }
@@ -104,7 +104,7 @@ class StatsBestVouchers extends ModuleGrid
$this->_html = ' $this->_html = '
<fieldset class="width3"><legend><img src="../modules/'.$this->name.'/logo.gif" /> '.$this->displayName.'</legend> <fieldset class="width3"><legend><img src="../modules/'.$this->name.'/logo.gif" /> '.$this->displayName.'</legend>
'.$this->engine($engineParams).' '.$this->engine($engineParams).'
<br /><a href="'.$_SERVER['REQUEST_URI'].'&export=1"><img src="../img/admin/asterisk.gif" />'.$this->l('CSV Export').'</a> <br /><a href="'.Tools::safeOutput($_SERVER['REQUEST_URI']).'&export=1"><img src="../img/admin/asterisk.gif" />'.$this->l('CSV Export').'</a>
</fieldset>'; </fieldset>';
return $this->_html; return $this->_html;
} }
+2 -2
View File
@@ -68,7 +68,7 @@ class StatsCarrier extends ModuleGraph
$this->csvExport(array('type' => 'pie', 'option' => Tools::getValue('id_order_state'))); $this->csvExport(array('type' => 'pie', 'option' => Tools::getValue('id_order_state')));
$this->_html = ' $this->_html = '
<fieldset class="width3"><legend><img src="../modules/'.$this->name.'/logo.gif" /> '.$this->displayName.'</legend> <fieldset class="width3"><legend><img src="../modules/'.$this->name.'/logo.gif" /> '.$this->displayName.'</legend>
<form action="'.$_SERVER['REQUEST_URI'].'" method="post" style="float: right;"> <form action="'.Tools::safeOutput($_SERVER['REQUEST_URI']).'" method="post" style="float: right;">
<select name="id_order_state"> <select name="id_order_state">
<option value="0"'.((!Tools::getValue('id_order_state')) ? ' selected="selected"' : '').'>'.$this->l('All').'</option>'; <option value="0"'.((!Tools::getValue('id_order_state')) ? ' selected="selected"' : '').'>'.$this->l('All').'</option>';
foreach ($states AS $state) foreach ($states AS $state)
@@ -77,7 +77,7 @@ class StatsCarrier extends ModuleGraph
<input type="submit" name="submitState" value="'.$this->l('Filter').'" class="button" /> <input type="submit" name="submitState" value="'.$this->l('Filter').'" class="button" />
</form> </form>
<p><img src="../img/admin/down.gif" />'.$this->l('This graph represents the carrier distribution for your orders. You can also limit it to orders in one state.').'</p> <p><img src="../img/admin/down.gif" />'.$this->l('This graph represents the carrier distribution for your orders. You can also limit it to orders in one state.').'</p>
'.($result['total'] ? $this->engine(array('type' => 'pie', 'option' => Tools::getValue('id_order_state'))).'<br /><br /> <a href="'.$_SERVER['REQUEST_URI'].'&export=1&exportType=language"><img src="../img/admin/asterisk.gif" />'.$this->l('CSV Export').'</a>' : $this->l('No valid orders for this period.')).' '.($result['total'] ? $this->engine(array('type' => 'pie', 'option' => Tools::getValue('id_order_state'))).'<br /><br /> <a href="'.Tools::safeOutput($_SERVER['REQUEST_URI']).'&export=1&exportType=language"><img src="../img/admin/asterisk.gif" />'.$this->l('CSV Export').'</a>' : $this->l('No valid orders for this period.')).'
</fieldset>'; </fieldset>';
return $this->_html; return $this->_html;
} }
+4 -4
View File
@@ -146,20 +146,20 @@ class StatsCheckUp extends Module
table.checkup td {padding:5px 10px} table.checkup td {padding:5px 10px}
table.checkup2 td {text-align:right} table.checkup2 td {text-align:right}
</style> </style>
<form action="'.AdminTab::$currentIndex.'&token='.Tools::getValue('token').'&module='.$this->name.'" method="post" class="checkup"> <form action="'.AdminTab::$currentIndex.'&token='.Tools::safeOutput(Tools::getValue('token')).'&module='.$this->name.'" method="post" class="checkup">
<table class="table checkup" border="0" cellspacing="0" cellspacing="0"> <table class="table checkup" border="0" cellspacing="0" cellspacing="0">
<tr><th></th><th>'.$arrayColors[0].' '.$this->l('Not enough').'</th><th>'.$arrayColors[2].' '.$this->l('Alright').'</th></tr>'; <tr><th></th><th>'.$arrayColors[0].' '.$this->l('Not enough').'</th><th>'.$arrayColors[2].' '.$this->l('Alright').'</th></tr>';
foreach ($arrayConf as $conf => $translations) foreach ($arrayConf as $conf => $translations)
$html .= '<tr> $html .= '<tr>
<th>'.$translations['name'].'</th> <th>'.$translations['name'].'</th>
<td>'.$this->l('lower than').' <input type="text" name="CHECKUP_'.$conf.'_LT" value="'.Tools::getValue('CHECKUP_'.$conf.'_LT', Configuration::get('CHECKUP_'.$conf.'_LT')).'" /> '.$translations['text'].' <td>'.$this->l('lower than').' <input type="text" name="CHECKUP_'.$conf.'_LT" value="'.Tools::safeOutput(Tools::getValue('CHECKUP_'.$conf.'_LT', Configuration::get('CHECKUP_'.$conf.'_LT'))).'" /> '.$translations['text'].'
<td>'.$this->l('greater than').' <input type="text" name="CHECKUP_'.$conf.'_GT" value="'.Tools::getValue('CHECKUP_'.$conf.'_GT', Configuration::get('CHECKUP_'.$conf.'_GT')).'" /> '.$translations['text'].' <td>'.$this->l('greater than').' <input type="text" name="CHECKUP_'.$conf.'_GT" value="'.Tools::safeOutput(Tools::getValue('CHECKUP_'.$conf.'_GT', Configuration::get('CHECKUP_'.$conf.'_GT'))).'" /> '.$translations['text'].'
</tr>'; </tr>';
$html .= '</table> $html .= '</table>
<div><input type="submit" name="submitCheckup" class="button" value="'.$this->l(' Save ').'" /></div> <div><input type="submit" name="submitCheckup" class="button" value="'.$this->l(' Save ').'" /></div>
</form> </form>
<div class="clear">&nbsp;</div> <div class="clear">&nbsp;</div>
<form action="'.AdminTab::$currentIndex.'&token='.Tools::getValue('token').'&module='.$this->name.'" method="post"> <form action="'.AdminTab::$currentIndex.'&token='.Tools::safeOutput(Tools::getValue('token')).'&module='.$this->name.'" method="post">
'.$this->l('Order by').' '.$this->l('Order by').'
<select name="submitCheckupOrder" onchange="this.form.submit();" style="width:100px"> <select name="submitCheckupOrder" onchange="this.form.submit();" style="width:100px">
<option value="1">'.$this->l('ID').'</option> <option value="1">'.$this->l('ID').'</option>
+2 -2
View File
@@ -111,10 +111,10 @@ class StatsEquipment extends ModuleGraph
<center> <center>
<p><img src="../img/admin/down.gif" />'.$this->l('Determine the percentage of web browsers used by your customers.').'</p> <p><img src="../img/admin/down.gif" />'.$this->l('Determine the percentage of web browsers used by your customers.').'</p>
'.$this->engine(array('type' => 'pie', 'option' => 'wb')).'<br /><br /> '.$this->engine(array('type' => 'pie', 'option' => 'wb')).'<br /><br />
<p><a href="'.$_SERVER['REQUEST_URI'].'&export=1&exportType=browser"><img src="../img/admin/asterisk.gif" />'.$this->l('CSV Export').'</a></p> <p><a href="'.Tools::safeOutput($_SERVER['REQUEST_URI']).'&export=1&exportType=browser"><img src="../img/admin/asterisk.gif" />'.$this->l('CSV Export').'</a></p>
<p><img src="../img/admin/down.gif" />'.$this->l('Determine the percentage of operating systems used by your customers.').'</p> <p><img src="../img/admin/down.gif" />'.$this->l('Determine the percentage of operating systems used by your customers.').'</p>
'.$this->engine(array('type' => 'pie', 'option' => 'os')).' '.$this->engine(array('type' => 'pie', 'option' => 'os')).'
<p><a href="'.$_SERVER['REQUEST_URI'].'&export=1&exportType=os"><img src="../img/admin/asterisk.gif" />'.$this->l('CSV Export').'</a></p>'; <p><a href="'.Tools::safeOutput($_SERVER['REQUEST_URI']).'&export=1&exportType=os"><img src="../img/admin/asterisk.gif" />'.$this->l('CSV Export').'</a></p>';
if ($equipment) if ($equipment)
{ {
+2 -2
View File
@@ -73,7 +73,7 @@ class StatsForecast extends Module
if (!isset($this->context->cookie->stats_granularity)) if (!isset($this->context->cookie->stats_granularity))
$this->context->cookie->stats_granularity = 10; $this->context->cookie->stats_granularity = 10;
if (Tools::isSubmit('submitIdZone')) if (Tools::isSubmit('submitIdZone'))
$this->context->cookie->stats_id_zone = Tools::getValue('stats_id_zone'); $this->context->cookie->stats_id_zone = (int)Tools::getValue('stats_id_zone');
if (Tools::isSubmit('submitGranularity')) if (Tools::isSubmit('submitGranularity'))
$this->context->cookie->stats_granularity = Tools::getValue('stats_granularity'); $this->context->cookie->stats_granularity = Tools::getValue('stats_granularity');
@@ -490,7 +490,7 @@ class StatsForecast extends Module
if ((int)$this->context->cookie->stats_id_zone) if ((int)$this->context->cookie->stats_id_zone)
{ {
$join = ' LEFT JOIN `'._DB_PREFIX_.'address` a ON o.id_address_invoice = a.id_address LEFT JOIN `'._DB_PREFIX_.'country` co ON co.id_country = a.id_country'; $join = ' LEFT JOIN `'._DB_PREFIX_.'address` a ON o.id_address_invoice = a.id_address LEFT JOIN `'._DB_PREFIX_.'country` co ON co.id_country = a.id_country';
$where = ' AND co.id_zone = '.$this->context->cookie->stats_id_zone.' '; $where = ' AND co.id_zone = '.(int)$this->context->cookie->stats_id_zone.' ';
} }
$sql = 'SELECT SUM(od.`product_price` * od.`product_quantity` / o.conversion_rate) as orderSum, COUNT(*) AS orderQty, cl.name, AVG(od.`product_price` / o.conversion_rate) as priveAvg $sql = 'SELECT SUM(od.`product_price` * od.`product_quantity` / o.conversion_rate) as orderSum, COUNT(*) AS orderQty, cl.name, AVG(od.`product_price` / o.conversion_rate) as priveAvg
+1 -1
View File
@@ -101,7 +101,7 @@ class StatsLive extends Module
INNER JOIN `'._DB_PREFIX_.'guest` g ON c.id_guest = g.id_guest INNER JOIN `'._DB_PREFIX_.'guest` g ON c.id_guest = g.id_guest
WHERE (g.id_customer IS NULL OR g.id_customer = 0) WHERE (g.id_customer IS NULL OR g.id_customer = 0)
'.$this->sqlShopRestriction(false, 'c').' '.$this->sqlShopRestriction(false, 'c').'
AND c.`date_add` > "'.date('Y-m-d H:i:s', strtotime('-15 minutes')).'" AND TIME_TO_SEC(TIMEDIFF(NOW(), c.`date_add`)) < 900
ORDER BY c.date_add DESC'; ORDER BY c.date_add DESC';
} }
+1 -1
View File
@@ -67,7 +67,7 @@ class StatsNewsletter extends ModuleGraph
<p>'.$this->l('Registrations from visitors:').' '.(int)($totals['visitors']).'</p> <p>'.$this->l('Registrations from visitors:').' '.(int)($totals['visitors']).'</p>
<p>'.$this->l('Both:').' '.(int)($totals['both']).'</p> <p>'.$this->l('Both:').' '.(int)($totals['both']).'</p>
<center>'.$this->engine(array('type' => 'line', 'layers' => 3)).'</center> <center>'.$this->engine(array('type' => 'line', 'layers' => 3)).'</center>
<p><a href="'.$_SERVER['REQUEST_URI'].'&export=1"><img src="../img/admin/asterisk.gif" />'.$this->l('CSV Export').'</a></p> <p><a href="'.Tools::safeOutput($_SERVER['REQUEST_URI']).'&export=1"><img src="../img/admin/asterisk.gif" />'.$this->l('CSV Export').'</a></p>
</fieldset>'; </fieldset>';
} }
else else
+1 -1
View File
@@ -90,7 +90,7 @@ class StatsOrigin extends ModuleGraph
$this->_html .= ' $this->_html .= '
<center><p><img src="../img/admin/down.gif" />'. $this->l('Here is the percentage of the 10 most popular referrer websites by which visitors went through to get to your shop.').'</p> <center><p><img src="../img/admin/down.gif" />'. $this->l('Here is the percentage of the 10 most popular referrer websites by which visitors went through to get to your shop.').'</p>
'.$this->engine(array('type' => 'pie')).'</center> '.$this->engine(array('type' => 'pie')).'</center>
<p><a href="'.$_SERVER['REQUEST_URI'].'&export=1&exportType=top"><img src="../img/admin/asterisk.gif" />'.$this->l('CSV Export').'</a></p><br /><br /> <p><a href="'.Tools::safeOutput($_SERVER['REQUEST_URI']).'&export=1&exportType=top"><img src="../img/admin/asterisk.gif" />'.$this->l('CSV Export').'</a></p><br /><br />
<div style="overflow-y: scroll; height: 600px;"> <div style="overflow-y: scroll; height: 600px;">
<center> <center>
<table class="table " border="0" cellspacing="0" cellspacing="0"> <table class="table " border="0" cellspacing="0" cellspacing="0">
@@ -74,20 +74,20 @@ class StatsPersonalInfos extends ModuleGraph
<center><p><img src="../img/admin/down.gif" />'.$this->l('Gender distribution allows you to determine the percentage of men and women among your customers.').'</p> <center><p><img src="../img/admin/down.gif" />'.$this->l('Gender distribution allows you to determine the percentage of men and women among your customers.').'</p>
'.$this->engine(array('type' => 'pie', 'option' => 'gender')).'<br /></center> '.$this->engine(array('type' => 'pie', 'option' => 'gender')).'<br /></center>
<p><a href="'.$_SERVER['REQUEST_URI'].'&export=1&exportType=gender"><img src="../img/admin/asterisk.gif" />'.$this->l('CSV Export').'</a></p> <p><a href="'.Tools::safeOutput($_SERVER['REQUEST_URI']).'&export=1&exportType=gender"><img src="../img/admin/asterisk.gif" />'.$this->l('CSV Export').'</a></p>
<br class="clear" /><br /> <br class="clear" /><br />
<center><p><img src="../img/admin/down.gif" />'.$this->l('Age ranges allows you to determine in which age range your customers are.').'</p> <center><p><img src="../img/admin/down.gif" />'.$this->l('Age ranges allows you to determine in which age range your customers are.').'</p>
'.$this->engine(array('type' => 'pie', 'option' => 'age')).'<br /></center> '.$this->engine(array('type' => 'pie', 'option' => 'age')).'<br /></center>
<p><a href="'.$_SERVER['REQUEST_URI'].'&export=1&exportType=age"><img src="../img/admin/asterisk.gif" />'.$this->l('CSV Export').'</a></p><br /><br /> <p><a href="'.Tools::safeOutput($_SERVER['REQUEST_URI']).'&export=1&exportType=age"><img src="../img/admin/asterisk.gif" />'.$this->l('CSV Export').'</a></p><br /><br />
<center><p><img src="../img/admin/down.gif" />'.$this->l('Country distribution allows you to determine in which part of the world your customers are shopping from.').'</p> <center><p><img src="../img/admin/down.gif" />'.$this->l('Country distribution allows you to determine in which part of the world your customers are shopping from.').'</p>
'.$this->engine(array('type' => 'pie', 'option' => 'country')).'<br /></center> '.$this->engine(array('type' => 'pie', 'option' => 'country')).'<br /></center>
<p><a href="'.$_SERVER['REQUEST_URI'].'&export=1&exportType=country"><img src="../img/admin/asterisk.gif" />'.$this->l('CSV Export').'</a></p><br /><br /> <p><a href="'.Tools::safeOutput($_SERVER['REQUEST_URI']).'&export=1&exportType=country"><img src="../img/admin/asterisk.gif" />'.$this->l('CSV Export').'</a></p><br /><br />
<center><p><img src="../img/admin/down.gif" />'.$this->l('Currency ranges allows you to determine which currencies your customers are using.').'</p> <center><p><img src="../img/admin/down.gif" />'.$this->l('Currency ranges allows you to determine which currencies your customers are using.').'</p>
'.$this->engine(array('type' => 'pie', 'option' => 'currency')).'<br /></center> '.$this->engine(array('type' => 'pie', 'option' => 'currency')).'<br /></center>
<p><a href="'.$_SERVER['REQUEST_URI'].'&export=1&exportType=currency"><img src="../img/admin/asterisk.gif" />'.$this->l('CSV Export').'</a></p><br /><br /> <p><a href="'.Tools::safeOutput($_SERVER['REQUEST_URI']).'&export=1&exportType=currency"><img src="../img/admin/asterisk.gif" />'.$this->l('CSV Export').'</a></p><br /><br />
<center><p><img src="../img/admin/down.gif" />'.$this->l('Language distribution allows you to determine the general languages your customers are using on your shop.').'</p> <center><p><img src="../img/admin/down.gif" />'.$this->l('Language distribution allows you to determine the general languages your customers are using on your shop.').'</p>
'.$this->engine(array('type' => 'pie', 'option' => 'language')).'<br /></center> '.$this->engine(array('type' => 'pie', 'option' => 'language')).'<br /></center>
<p><a href="'.$_SERVER['REQUEST_URI'].'&export=1&exportType=language"><img src="../img/admin/asterisk.gif" />'.$this->l('CSV Export').'</a></p> <p><a href="'.Tools::safeOutput($_SERVER['REQUEST_URI']).'&export=1&exportType=language"><img src="../img/admin/asterisk.gif" />'.$this->l('CSV Export').'</a></p>
</center>'; </center>';
} }
else else
+7 -5
View File
@@ -174,10 +174,10 @@ class StatsProduct extends ModuleGraph
<p>'.$this->l('Conversion rate:').' '.number_format($totalViewed ? $totalBought / $totalViewed : 0, 2).'</p> <p>'.$this->l('Conversion rate:').' '.number_format($totalViewed ? $totalBought / $totalViewed : 0, 2).'</p>
<center>'.$this->engine(array('layers' => 2, 'type' => 'line', 'option' => '1-'.$id_product)).'</center> <center>'.$this->engine(array('layers' => 2, 'type' => 'line', 'option' => '1-'.$id_product)).'</center>
<br /> <br />
<p><a href="'.$_SERVER['REQUEST_URI'].'&export=1&exportType=1"><img src="../img/admin/asterisk.gif" />'.$this->l('CSV Export').'</a></p>'; <p><a href="'.Tools::safeOutput($_SERVER['REQUEST_URI']).'&export=1&exportType=1"><img src="../img/admin/asterisk.gif" />'.$this->l('CSV Export').'</a></p>';
if ($hasAttribute = $product->hasAttributes() AND $totalBought) if ($hasAttribute = $product->hasAttributes() AND $totalBought)
$this->_html .= '<h3 class="space">'.$this->l('Attribute sales distribution').'</h3><center>'.$this->engine(array('type' => 'pie', 'option' => '3-'.$id_product)).'</center><br /> $this->_html .= '<h3 class="space">'.$this->l('Attribute sales distribution').'</h3><center>'.$this->engine(array('type' => 'pie', 'option' => '3-'.$id_product)).'</center><br />
<p><a href="'.$_SERVER['REQUEST_URI'].'&export=1&exportType=2"><img src="../img/admin/asterisk.gif" />'.$this->l('CSV Export').'</a></p><br />'; <p><a href="'.Tools::safeOutput($_SERVER['REQUEST_URI']).'&export=1&exportType=2"><img src="../img/admin/asterisk.gif" />'.$this->l('CSV Export').'</a></p><br />';
if ($totalBought) if ($totalBought)
{ {
$sales = $this->getSales($id_product, $this->context->language->id); $sales = $this->getSales($id_product, $this->context->language->id);
@@ -263,10 +263,12 @@ class StatsProduct extends ModuleGraph
<th>'.$this->l('Stock').'</th> <th>'.$this->l('Stock').'</th>
</tr> </tr>
</thead><tbody>'; </thead><tbody>';
foreach ($this->getProducts($this->context->language->id) AS $product)
$this->_html .= '<tr><td>'.$product['reference'].'</td><td><a href="'.AdminTab::$currentIndex.'&token='.Tools::getValue('token').'&module='.$this->name.'&id_product='.$product['id_product'].'">'.$product['name'].'</a></td><td>'.$product['quantity'].'</td></tr>'; foreach ($this->getProducts($this->context->language->id) as $product)
$this->_html .= '<tr><td>'.$product['reference'].'</td><td><a href="'.AdminTab::$currentIndex.'&token='.Tools::safeOutput(Tools::getValue('token')).'&module='.$this->name.'&id_product='.$product['id_product'].'">'.$product['name'].'</a></td><td>'.$product['quantity'].'</td></tr>';
$this->_html .= '</tbody></table><br /></div><br /> $this->_html .= '</tbody></table><br /></div><br />
<a href="'.$_SERVER['REQUEST_URI'].'&export=1"><img src="../img/admin/asterisk.gif" />'.$this->l('CSV Export').'</a><br />'; <a href="'.Tools::safeOutput($_SERVER['REQUEST_URI']).'&export=1"><img src="../img/admin/asterisk.gif" />'.$this->l('CSV Export').'</a><br />';
} }
$this->_html .= '</fieldset><br /> $this->_html .= '</fieldset><br />
@@ -116,7 +116,7 @@ class StatsRegistrations extends ModuleGraph
</p> </p>
<p>'.$this->l('Total customer accounts:').' '.$totalRegistrations.'</p> <p>'.$this->l('Total customer accounts:').' '.$totalRegistrations.'</p>
<center>'.$this->engine(array('type' => 'line')).'</center> <center>'.$this->engine(array('type' => 'line')).'</center>
<p><a href="'.$_SERVER['REQUEST_URI'].'&export=1"><img src="../img/admin/asterisk.gif" />'.$this->l('CSV Export').'</a></p> <p><a href="'.Tools::safeOutput($_SERVER['REQUEST_URI']).'&export=1"><img src="../img/admin/asterisk.gif" />'.$this->l('CSV Export').'</a></p>
</fieldset><br /> </fieldset><br />
<fieldset class="width3"><legend><img src="../img/admin/comment.gif" /> '.$this->l('Guide').'</legend> <fieldset class="width3"><legend><img src="../img/admin/comment.gif" /> '.$this->l('Guide').'</legend>
<h2>'.$this->l('Number of customer accounts created').'</h2> <h2>'.$this->l('Number of customer accounts created').'</h2>
+4 -4
View File
@@ -68,7 +68,7 @@ class StatsSales extends ModuleGraph
$this->_html = ' $this->_html = '
<fieldset class="width3"><legend><img src="../modules/'.$this->name.'/logo.gif" /> '.$this->displayName.'</legend> <fieldset class="width3"><legend><img src="../modules/'.$this->name.'/logo.gif" /> '.$this->displayName.'</legend>
<form action="'.$_SERVER['REQUEST_URI'].'" method="post" style="float: right; margin-left: 10px;"> <form action="'.Tools::safeOutput($_SERVER['REQUEST_URI']).'" method="post" style="float: right; margin-left: 10px;">
<select name="id_country"> <select name="id_country">
<option value="0"'.((!Tools::getValue('id_order_state')) ? ' selected="selected"' : '').'>'.$this->l('All').'</option>'; <option value="0"'.((!Tools::getValue('id_order_state')) ? ' selected="selected"' : '').'>'.$this->l('All').'</option>';
foreach (Country::getCountries($this->context->language->id) AS $country) foreach (Country::getCountries($this->context->language->id) AS $country)
@@ -82,15 +82,15 @@ class StatsSales extends ModuleGraph
<p>'.$this->l('Orders placed:').' '.(int)($totals['orderCount']).'</p> <p>'.$this->l('Orders placed:').' '.(int)($totals['orderCount']).'</p>
<p>'.$this->l('Products bought:').' '.(int)($totals['products']).'</p> <p>'.$this->l('Products bought:').' '.(int)($totals['products']).'</p>
<center>'.$this->engine(array('type' => 'line', 'option' => '1-'.(int)Tools::getValue('id_country'), 'layers' => 2)).'</center> <center>'.$this->engine(array('type' => 'line', 'option' => '1-'.(int)Tools::getValue('id_country'), 'layers' => 2)).'</center>
<p><a href="'.$_SERVER['REQUEST_URI'].'&export=1"><img src="../img/admin/asterisk.gif" alt="" />'.$this->l('CSV Export').'</a></p> <p><a href="'.Tools::safeOutput($_SERVER['REQUEST_URI']).'&export=1"><img src="../img/admin/asterisk.gif" alt="" />'.$this->l('CSV Export').'</a></p>
<p>'.$this->l('Sales:').' '.Tools::displayPrice($totals['orderSum'], $currency).'</p> <p>'.$this->l('Sales:').' '.Tools::displayPrice($totals['orderSum'], $currency).'</p>
<center>'.$this->engine(array('type' => 'line', 'option' => '2-'.(int)Tools::getValue('id_country'))).'</center></p> <center>'.$this->engine(array('type' => 'line', 'option' => '2-'.(int)Tools::getValue('id_country'))).'</center></p>
<p><a href="'.$_SERVER['REQUEST_URI'].'&export=2"><img src="../img/admin/asterisk.gif" alt="" />'.$this->l('CSV Export').'</a></p> <p><a href="'.Tools::safeOutput($_SERVER['REQUEST_URI']).'&export=2"><img src="../img/admin/asterisk.gif" alt="" />'.$this->l('CSV Export').'</a></p>
<p class="space"><img src="../img/admin/down.gif" /> <p class="space"><img src="../img/admin/down.gif" />
'.$this->l('You can see the order state distribution below.').' '.$this->l('You can see the order state distribution below.').'
</p><br /> </p><br />
'.($totals['orderCount'] ? $this->engine(array('type' => 'pie', 'option' => '3-'.(int)Tools::getValue('id_country'))) : $this->l('No orders for this period.')).'</center> '.($totals['orderCount'] ? $this->engine(array('type' => 'pie', 'option' => '3-'.(int)Tools::getValue('id_country'))) : $this->l('No orders for this period.')).'</center>
<p><a href="'.$_SERVER['REQUEST_URI'].'&export=3"><img src="../img/admin/asterisk.gif" />'.$this->l('CSV Export').'</a></p> <p><a href="'.Tools::safeOutput($_SERVER['REQUEST_URI']).'&export=3"><img src="../img/admin/asterisk.gif" />'.$this->l('CSV Export').'</a></p>
</fieldset> </fieldset>
<br class="clear" /> <br class="clear" />
<fieldset class="width3"><legend><img src="../img/admin/comment.gif" /> '.$this->l('Guide').'</legend> <fieldset class="width3"><legend><img src="../img/admin/comment.gif" /> '.$this->l('Guide').'</legend>
Loaded 100 of 110 files, more files were not shown because too many files have changed in this diff. Show more