// Revert normalization
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@8019 b9a71923-0436-4b27-9f14-aed3839534dd
This commit is contained in:
@@ -184,7 +184,7 @@ class BlockCart extends Module
|
||||
if (Configuration::get('PS_CATALOG_MODE'))
|
||||
return;
|
||||
$this->context->controller->addCSS(($this->_path).'blockcart.css', 'all');
|
||||
if (Configuration::get('PS_BLOCK_CART_AJAX'))
|
||||
if ((int)(Configuration::get('PS_BLOCK_CART_AJAX')))
|
||||
$this->context->controller->addJS(($this->_path).'ajax-cart.js');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -62,7 +62,7 @@ class BlockLanguages extends Module
|
||||
return;
|
||||
$link = new Link();
|
||||
|
||||
if (Configuration::get('PS_REWRITING_SETTINGS'))
|
||||
if((int)Configuration::get('PS_REWRITING_SETTINGS'))
|
||||
{
|
||||
$default_rewrite = array();
|
||||
$phpSelf = isset($_SERVER['PHP_SELF']) ? substr($_SERVER['PHP_SELF'], strlen(__PS_BASE_URI__)) : '';
|
||||
|
||||
@@ -58,7 +58,7 @@ class BlockNewProducts extends Module
|
||||
{
|
||||
if (!$productNbr = Tools::getValue('productNbr') OR empty($productNbr))
|
||||
$output .= '<div class="alert error">'.$this->l('Please fill in the "products displayed" field.').'</div>';
|
||||
elseif ((int)$productNbr == 0)
|
||||
elseif ((int)($productNbr) == 0)
|
||||
$output .= '<div class="alert error">'.$this->l('Invalid number.').'</div>';
|
||||
else
|
||||
{
|
||||
|
||||
@@ -63,7 +63,7 @@ class BlockTags extends Module
|
||||
{
|
||||
if (!$tagsNbr = Tools::getValue('tagsNbr') OR empty($tagsNbr))
|
||||
$output .= '<div class="alert error">'.$this->l('Please fill in the "tags displayed" field.').'</div>';
|
||||
elseif ((int)$tagsNbr == 0)
|
||||
elseif ((int)($tagsNbr) == 0)
|
||||
$output .= '<div class="alert error">'.$this->l('Invalid number.').'</div>';
|
||||
else
|
||||
{
|
||||
|
||||
@@ -64,7 +64,7 @@ class BlockViewed extends Module
|
||||
{
|
||||
if (!$productNbr = Tools::getValue('productNbr') OR empty($productNbr))
|
||||
$output .= '<div class="alert error">'.$this->l('You must fill in the \'Products displayed\' field.').'</div>';
|
||||
elseif ((int)$productNbr == 0)
|
||||
elseif ((int)($productNbr) == 0)
|
||||
$output .= '<div class="alert error">'.$this->l('Invalid number.').'</div>';
|
||||
else
|
||||
{
|
||||
|
||||
@@ -1162,7 +1162,7 @@ class CanadaPost extends CarrierModule
|
||||
|
||||
public function hookupdateCarrier($params)
|
||||
{
|
||||
if ((int)$params['id_carrier'] != (int)$params['carrier']->id)
|
||||
if ((int)($params['id_carrier']) != (int)($params['carrier']->id))
|
||||
{
|
||||
$serviceSelected = Db::getInstance()->getRow('SELECT * FROM `'._DB_PREFIX_.'cp_rate_service_code` WHERE `id_carrier` = '.(int)$params['id_carrier']);
|
||||
$update = array('id_carrier' => (int)($params['carrier']->id), 'id_carrier_history' => pSQL($serviceSelected['id_carrier_history'].'|'.(int)($params['carrier']->id)));
|
||||
|
||||
@@ -839,7 +839,7 @@ class Dejala extends CarrierModule
|
||||
do
|
||||
{
|
||||
$wd = date("w", $balladUtc);
|
||||
if ((int)$calendar[$wd]['stop_hour'] < (int)$calendar[$wd]['start_hour']) continue ;
|
||||
if ((int)($calendar[$wd]['stop_hour']) < (int)($calendar[$wd]['start_hour'])) continue ;
|
||||
|
||||
$dates[$iDate]['value'] = date("Y/m/d", $balladUtc);
|
||||
$dates[$iDate]['ts'] = $balladUtc ;
|
||||
@@ -856,9 +856,9 @@ class Dejala extends CarrierModule
|
||||
return ;
|
||||
|
||||
$now = (int)(date("H", $ctime)) ;
|
||||
if ((int)$dates[0]['stop_hour'] > $now && (int)$dates[0]['start_hour'] < $now)
|
||||
if ((int)($dates[0]['stop_hour']) > $now && (int)($dates[0]['start_hour']) < $now)
|
||||
$dates[0]['start_hour'] = $now ;
|
||||
elseif ((int)$dates[0]['ts'] == $now && (int)$dates[0]['stop_hour'] < $now)
|
||||
elseif ((int)($dates[0]['ts']) == $now && (int)($dates[0]['stop_hour']) < $now)
|
||||
array_shift($dates) ;
|
||||
|
||||
|
||||
|
||||
@@ -14,7 +14,7 @@ class DejalaCarrierUtils
|
||||
$id_zone = 1;
|
||||
$moduleCountryIsoCode = strtoupper($dejalaConfig->country);
|
||||
$countryID = Country::getByIso($moduleCountryIsoCode);
|
||||
if ($countryID)
|
||||
if ((int)($countryID))
|
||||
$id_zone = Country::getIdZone($countryID);
|
||||
|
||||
//TODO Will have to review this and apply proper code.
|
||||
|
||||
@@ -38,7 +38,7 @@ if (!Context::getContext()->cookie->isLogged())
|
||||
|
||||
include(dirname(__FILE__).'/../../header.php');
|
||||
|
||||
if (Context::getContext()->customer->id)
|
||||
if ((int)Context::getContext()->customer->id)
|
||||
{
|
||||
$smarty->assign('favoriteProducts', FavoriteProduct::getFavoriteProducts((int)Context::getContext()->customer->id, (int)Context::getContext()->language->id));
|
||||
|
||||
|
||||
@@ -1336,7 +1336,7 @@ class FedexCarrier extends CarrierModule
|
||||
|
||||
public function hookupdateCarrier($params)
|
||||
{
|
||||
if ((int)$params['id_carrier'] != (int)$params['carrier']->id)
|
||||
if ((int)($params['id_carrier']) != (int)($params['carrier']->id))
|
||||
{
|
||||
$serviceSelected = Db::getInstance()->getRow('SELECT * FROM `'._DB_PREFIX_.'fedex_rate_service_code` WHERE `id_carrier` = '.(int)$params['id_carrier']);
|
||||
$update = array('id_carrier' => (int)($params['carrier']->id), 'id_carrier_history' => pSQL($serviceSelected['id_carrier_history'].'|'.(int)($params['carrier']->id)));
|
||||
|
||||
@@ -301,7 +301,7 @@ class Loyalty extends Module
|
||||
foreach ($order_states AS $order_state)
|
||||
{
|
||||
$html .= '<option value="' . $order_state['id_order_state'] . '" style="background-color:' . $order_state['color'] . ';"';
|
||||
if ((int)$this->loyaltyStateValidation->id_order_state == $order_state['id_order_state'] )
|
||||
if ((int)($this->loyaltyStateValidation->id_order_state) == $order_state['id_order_state'] )
|
||||
$html .= ' selected="selected"';
|
||||
$html .= '>' . $order_state['name'] . '</option>';
|
||||
}
|
||||
@@ -314,7 +314,7 @@ class Loyalty extends Module
|
||||
foreach ($order_states AS $order_state)
|
||||
{
|
||||
$html .= '<option value="' . $order_state['id_order_state'] . '" style="background-color:' . $order_state['color'] . ';"';
|
||||
if ((int)$this->loyaltyStateCancel->id_order_state == $order_state['id_order_state'] )
|
||||
if ((int)($this->loyaltyStateCancel->id_order_state) == $order_state['id_order_state'] )
|
||||
$html .= ' selected="selected"';
|
||||
$html .= '>' . $order_state['name'] . '</option>';
|
||||
}
|
||||
@@ -542,7 +542,7 @@ class Loyalty extends Module
|
||||
$loyalty->id_customer = (int)$params['customer']->id;
|
||||
$loyalty->id_order = (int)$params['order']->id;
|
||||
$loyalty->points = LoyaltyModule::getOrderNbPoints($params['order']);
|
||||
if (Configuration::get('PS_LOYALTY_NONE_AWARD') AND (int)$loyalty->points == 0)
|
||||
if ((int)(Configuration::get('PS_LOYALTY_NONE_AWARD')) AND (int)($loyalty->points) == 0)
|
||||
$loyalty->id_loyalty_state = LoyaltyStateModule::getNoneAwardId();
|
||||
else
|
||||
$loyalty->id_loyalty_state = LoyaltyStateModule::getDefaultId();
|
||||
@@ -567,13 +567,13 @@ class Loyalty extends Module
|
||||
{
|
||||
if (!Validate::isLoadedObject($loyalty = new LoyaltyModule(LoyaltyModule::getByOrderId($order->id))))
|
||||
return false;
|
||||
if (Configuration::get('PS_LOYALTY_NONE_AWARD') AND $loyalty->id_loyalty_state == LoyaltyStateModule::getNoneAwardId())
|
||||
if ((int)(Configuration::get('PS_LOYALTY_NONE_AWARD')) AND $loyalty->id_loyalty_state == LoyaltyStateModule::getNoneAwardId())
|
||||
return true;
|
||||
|
||||
if ($newOrder->id == $this->loyaltyStateValidation->id_order_state)
|
||||
{
|
||||
$loyalty->id_loyalty_state = LoyaltyStateModule::getValidationId();
|
||||
if ((int)$loyalty->points < 0)
|
||||
if ((int)($loyalty->points) < 0)
|
||||
$loyalty->points = abs((int)($loyalty->points));
|
||||
}
|
||||
elseif ($newOrder->id == $this->loyaltyStateCancel->id_order_state)
|
||||
|
||||
@@ -346,7 +346,7 @@ if (!isset(Context::getContext()->cookie->paypal_token) OR !Context::getContext(
|
||||
else
|
||||
{
|
||||
// We have token, we need to confirm user informations (login or signup)
|
||||
if (Tools::getValue('confirm'))
|
||||
if ((int)(Tools::getValue('confirm')))
|
||||
displayConfirm();
|
||||
elseif (Tools::isSubmit('submitAccount'))
|
||||
submitAccount();
|
||||
|
||||
@@ -34,7 +34,7 @@ if (empty($_GET['id_lang']) === false &&
|
||||
isset($_GET['id_product']) === true)
|
||||
{
|
||||
$criterions = ProductCommentCriterion::get($_GET['id_lang']);
|
||||
if ($_GET['id_product'])
|
||||
if ((int)($_GET['id_product']))
|
||||
$selects = ProductCommentCriterion::getByProduct($_GET['id_product'], $_GET['id_lang']);
|
||||
echo '<select name="id_product_comment_criterion[]" id="id_product_comment_criterion" multiple="true" style="height:100px;width:360px;">';
|
||||
foreach ($criterions as $criterion)
|
||||
|
||||
@@ -166,7 +166,7 @@ $stats = $customer->getStats();
|
||||
|
||||
$orderQuantity = (int)(Configuration::get('REFERRAL_ORDER_QUANTITY'));
|
||||
$canSendInvitations = false;
|
||||
if ((int)$stats['nb_orders'] >= $orderQuantity)
|
||||
if ((int)($stats['nb_orders']) >= $orderQuantity)
|
||||
$canSendInvitations = true;
|
||||
|
||||
// Smarty display
|
||||
|
||||
@@ -493,7 +493,7 @@ class Socolissimo extends CarrierModule
|
||||
|
||||
public function hookupdateCarrier($params)
|
||||
{
|
||||
if ((int)$params['id_carrier'] == (int)Configuration::get('SOCOLISSIMO_CARRIER_ID'))
|
||||
if ((int)($params['id_carrier']) == (int)(Configuration::get('SOCOLISSIMO_CARRIER_ID')))
|
||||
{
|
||||
Configuration::updateValue('SOCOLISSIMO_CARRIER_ID', (int)($params['carrier']->id));
|
||||
Configuration::updateValue('SOCOLISSIMO_CARRIER_ID_HIST', Configuration::get('SOCOLISSIMO_CARRIER_ID_HIST').'|'.(int)($params['carrier']->id));
|
||||
|
||||
@@ -90,7 +90,7 @@ class StatsCarrier extends ModuleGraph
|
||||
protected function getData($layers)
|
||||
{
|
||||
$stateQuery = '';
|
||||
if ($this->_option)
|
||||
if ((int)($this->_option))
|
||||
$stateQuery = 'AND (SELECT oh.id_order_state FROM `'._DB_PREFIX_.'order_history` oh WHERE o.id_order = oh.id_order ORDER BY oh.date_add DESC, oh.id_order_history DESC LIMIT 1) = '.(int)($this->_option);
|
||||
$this->_titles['main'] = $this->l('Percentage of orders by carrier');
|
||||
|
||||
|
||||
@@ -182,7 +182,7 @@ class StatsData extends Module
|
||||
FROM `'._DB_PREFIX_.'guest`
|
||||
WHERE `id_customer` = '.(int)($params['cookie']->id_customer));
|
||||
|
||||
if ($result['id_guest'])
|
||||
if ((int)($result['id_guest']))
|
||||
{
|
||||
// The new guest is merged with the old one when it's connecting to an account
|
||||
$guest->mergeWithCustomer($result['id_guest'], $params['cookie']->id_customer);
|
||||
|
||||
@@ -486,7 +486,7 @@ class StatsForecast extends Module
|
||||
$ca = array();
|
||||
|
||||
$where = $join = '';
|
||||
if ($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';
|
||||
$where = ' AND co.id_zone = '.$this->context->cookie->stats_id_zone.' ';
|
||||
|
||||
@@ -392,7 +392,7 @@ class ThemeInstallator extends Module
|
||||
$foo = Db::getInstance()->getRow('
|
||||
SELECT name FROM `'._DB_PREFIX_.'image_type` i
|
||||
WHERE i.name LIKE \''.pSQL($row['name']).'\'');
|
||||
if ((int)Tools::getValue('imagesConfig') == 1 AND $foo)
|
||||
if ((int)(Tools::getValue('imagesConfig')) == 1 AND $foo)
|
||||
continue ;
|
||||
if ($foo)
|
||||
Db::getInstance()->Execute('
|
||||
@@ -533,7 +533,7 @@ class ThemeInstallator extends Module
|
||||
}
|
||||
}
|
||||
}
|
||||
if ((int)Tools::getValue('imagesConfig') != 3 AND self::updateImages())
|
||||
if ((int)(Tools::getValue('imagesConfig')) != 3 AND self::updateImages())
|
||||
$msg .= '<br /><b>'.$this->l('Images have been correctly updated in database').'</b><br />';
|
||||
|
||||
$theme = new Theme();
|
||||
@@ -1009,7 +1009,7 @@ class ThemeInstallator extends Module
|
||||
$count = 0;
|
||||
while (Tools::isSubmit('myvar_'.++$count))
|
||||
{
|
||||
if ((int)Tools::getValue('myvar_'.$count) == -1)
|
||||
if ((int)(Tools::getValue('myvar_'.$count)) == -1)
|
||||
continue ;
|
||||
$name = Tools::getValue('themevariationname_'.$count);
|
||||
$dir = Tools::getValue('myvar_'.$count);
|
||||
@@ -1088,7 +1088,7 @@ class ThemeInstallator extends Module
|
||||
$this->_html .= parent::displayError($this->l('Please enter a valid theme name'));
|
||||
while ($this->error === false AND Tools::isSubmit('myvar_'.++$count))
|
||||
{
|
||||
if ((int)Tools::getValue('myvar_'.$count) == -1)
|
||||
if ((int)(Tools::getValue('myvar_'.$count)) == -1)
|
||||
continue ;
|
||||
$name = Tools::getValue('themevariationname_'.$count);
|
||||
if (!$name OR !Validate::isGenericName($name) OR strlen($name) > MAX_NAME_LENGTH)
|
||||
@@ -1110,7 +1110,7 @@ class ThemeInstallator extends Module
|
||||
$this->_html .= parent::displayError($this->l('Syntax error on version field. Only digits and points are allowed and the compatibility should be increasing or equal.'));
|
||||
while ($this->error === false AND Tools::isSubmit('myvar_'.++$count))
|
||||
{
|
||||
if ((int)Tools::getValue('myvar_'.$count) == -1)
|
||||
if ((int)(Tools::getValue('myvar_'.$count)) == -1)
|
||||
continue ;
|
||||
$from = Tools::getValue('compafrom_'.$count);
|
||||
$to = Tools::getValue('compato_'.$count);
|
||||
|
||||
@@ -1010,7 +1010,7 @@ class Twenga extends PaymentModule
|
||||
$condition = '';
|
||||
if(strlen((string)$version) < 2)
|
||||
$version = (string)$version.'0';
|
||||
if ((int)substr($version, 0, 2) >= 14)
|
||||
if((int)substr($version, 0, 2) >= 14)
|
||||
$condition = (($product->condition === 'new') ? 0 : 1);
|
||||
|
||||
$price = $product->getPrice(true, (isset($combination['id_combination']) ? $combination['id_combination'] : NULL), 2);
|
||||
|
||||
@@ -1317,7 +1317,7 @@ class UpsCarrier extends CarrierModule
|
||||
|
||||
public function hookupdateCarrier($params)
|
||||
{
|
||||
if ((int)$params['id_carrier'] != (int)$params['carrier']->id)
|
||||
if ((int)($params['id_carrier']) != (int)($params['carrier']->id))
|
||||
{
|
||||
$serviceSelected = Db::getInstance()->getRow('SELECT * FROM `'._DB_PREFIX_.'ups_rate_service_code` WHERE `id_carrier` = '.(int)$params['id_carrier']);
|
||||
$update = array('id_carrier' => (int)($params['carrier']->id), 'id_carrier_history' => pSQL($serviceSelected['id_carrier_history'].'|'.(int)($params['carrier']->id)));
|
||||
|
||||
@@ -1340,7 +1340,7 @@ class UspsCarrier extends CarrierModule
|
||||
|
||||
public function hookupdateCarrier($params)
|
||||
{
|
||||
if ((int)$params['id_carrier'] != (int)$params['carrier']->id)
|
||||
if ((int)($params['id_carrier']) != (int)($params['carrier']->id))
|
||||
{
|
||||
$serviceSelected = Db::getInstance()->getRow('SELECT * FROM `'._DB_PREFIX_.'usps_rate_service_code` WHERE `id_carrier` = '.(int)$params['id_carrier']);
|
||||
$update = array('id_carrier' => (int)($params['carrier']->id), 'id_carrier_history' => pSQL($serviceSelected['id_carrier_history'].'|'.(int)($params['carrier']->id)));
|
||||
|
||||
Reference in New Issue
Block a user