// 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:
+1
-1
@@ -704,7 +704,7 @@ if (Tools::isSubmit('updateProductImageShopAsso'))
|
||||
{
|
||||
if ($id_image = (int)Tools::getValue('id_image') AND $id_shop = (int)Tools::getValue('id_shop'))
|
||||
{
|
||||
if (Tools::getValue('active'))
|
||||
if ((int)Tools::getValue('active'))
|
||||
Db::getInstance()->Execute('INSERT INTO '._DB_PREFIX_.'image_shop (`id_image`, `id_shop`) VALUES('.(int)$id_image.', '.(int)$id_shop.')');
|
||||
else
|
||||
Db::getInstance()->Execute('DELETE FROM '._DB_PREFIX_.'image_shop WHERE `id_image`='.(int)$id_image.' AND `id_shop`='.(int)$id_shop);
|
||||
|
||||
@@ -74,7 +74,7 @@
|
||||
foreach ($categoryBox AS $k => $row)
|
||||
$index[] = $row;
|
||||
}
|
||||
elseif (Tools::getValue('id_product'))
|
||||
elseif ((int)Tools::getValue('id_product'))
|
||||
$index = Product::getProductCategories((int)Tools::getValue('id_product'));
|
||||
$adminProducts->recurseCategoryForInclude((int)(Tools::getValue('id_product')), $index, $categories, $categories[0][1], 1, (int)(Tools::getValue('id_category_default')));
|
||||
echo ' </table>
|
||||
|
||||
@@ -86,7 +86,7 @@ class AttributeGroupCore extends ObjectModel
|
||||
$attributeCombinations = Db::getInstance()->ExecuteS('SELECT pac.`id_attribute`, pa.`id_product_attribute` FROM `'._DB_PREFIX_.'product_attribute` pa LEFT JOIN `'._DB_PREFIX_.'product_attribute_combination` pac ON (pa.`id_product_attribute` = pac.`id_product_attribute`)');
|
||||
$toRemove = array();
|
||||
foreach ($attributeCombinations AS $attributeCombination)
|
||||
if ($attributeCombination['id_attribute'] == 0)
|
||||
if ((int)($attributeCombination['id_attribute']) == 0)
|
||||
$toRemove[] = (int)($attributeCombination['id_product_attribute']);
|
||||
if (!empty($toRemove) AND Db::getInstance()->Execute('DELETE FROM `'._DB_PREFIX_.'product_attribute` WHERE `id_product_attribute` IN ('.implode(', ', $toRemove).')') === false)
|
||||
return false;
|
||||
|
||||
+1
-1
@@ -152,7 +152,7 @@ class CMSCore extends ObjectModel
|
||||
return false;
|
||||
|
||||
foreach ($res AS $cms)
|
||||
if ((int)$cms['id_cms'] == (int)$this->id)
|
||||
if ((int)($cms['id_cms']) == (int)($this->id))
|
||||
$movedCms = $cms;
|
||||
|
||||
if (!isset($movedCms) || !isset($position))
|
||||
|
||||
@@ -576,7 +576,7 @@ class CMSCategoryCore extends ObjectModel
|
||||
))
|
||||
return false;
|
||||
foreach ($res AS $category)
|
||||
if ((int)$category['id_cms_category'] == (int)$this->id)
|
||||
if ((int)($category['id_cms_category']) == (int)($this->id))
|
||||
$movedCategory = $category;
|
||||
|
||||
if (!isset($movedCategory) || !isset($position))
|
||||
|
||||
+3
-3
@@ -156,7 +156,7 @@ class CarrierCore extends ObjectModel
|
||||
return false;
|
||||
if (!$numRows = Db::getInstance()->NumRows())
|
||||
return false;
|
||||
if ($numRows == 1)
|
||||
if ((int)($numRows) == 1)
|
||||
Configuration::updateValue('PS_CARRIER_DEFAULT', (int)($this->id));
|
||||
return true;
|
||||
}
|
||||
@@ -689,7 +689,7 @@ class CarrierCore extends ObjectModel
|
||||
VALUES ('.$this->id.','.(int)$val['id_zone'].')');
|
||||
|
||||
//Copy default carrier
|
||||
if (Configuration::get('PS_CARRIER_DEFAULT') == $oldId)
|
||||
if ((int)(Configuration::get('PS_CARRIER_DEFAULT')) == $oldId)
|
||||
Configuration::updateValue('PS_CARRIER_DEFAULT', (int)($this->id));
|
||||
}
|
||||
|
||||
@@ -718,7 +718,7 @@ class CarrierCore extends ObjectModel
|
||||
if ($this->shipping_method == Carrier::SHIPPING_METHOD_DEFAULT)
|
||||
{
|
||||
// backward compatibility
|
||||
if (Configuration::get('PS_SHIPPING_METHOD'))
|
||||
if ((int)Configuration::get('PS_SHIPPING_METHOD'))
|
||||
$method = Carrier::SHIPPING_METHOD_WEIGHT;
|
||||
else
|
||||
$method = Carrier::SHIPPING_METHOD_PRICE;
|
||||
|
||||
+6
-6
@@ -464,7 +464,7 @@ class CartCore extends ObjectModel
|
||||
{
|
||||
$paImplode = array();
|
||||
foreach ($ipaList as $id_product_attribute)
|
||||
if ($id_product_attribute AND !array_key_exists($id_product_attribute.'-'.$id_lang, self::$_attributesLists))
|
||||
if ((int)$id_product_attribute AND !array_key_exists($id_product_attribute.'-'.$id_lang, self::$_attributesLists))
|
||||
{
|
||||
$paImplode[] = (int)$id_product_attribute;
|
||||
self::$_attributesLists[(int)$id_product_attribute.'-'.$id_lang] = array('attributes' => '', 'attributes_small' => '');
|
||||
@@ -569,7 +569,7 @@ class CartCore extends ObjectModel
|
||||
unset(self::$_nbProducts[$this->id]);
|
||||
if (isset(self::$_totalWeight[$this->id]))
|
||||
unset(self::$_totalWeight[$this->id]);
|
||||
if ($quantity <= 0)
|
||||
if ((int)$quantity <= 0)
|
||||
return $this->deleteProduct($id_product, $id_product_attribute, (int)$id_customization);
|
||||
elseif (!$product->available_for_order OR Configuration::get('PS_CATALOG_MODE'))
|
||||
return false;
|
||||
@@ -631,10 +631,10 @@ class CartCore extends ObjectModel
|
||||
WHERE p.id_product = '.$id_product;
|
||||
$result2 = Db::getInstance()->getRow($sql);
|
||||
if (!Product::isAvailableWhenOutOfStock((int)$result2['out_of_stock']))
|
||||
if ($quantity > $result2['quantity'])
|
||||
if ((int)$quantity > $result2['quantity'])
|
||||
return false;
|
||||
|
||||
if ($quantity < $minimalQuantity)
|
||||
if ((int)$quantity < $minimalQuantity)
|
||||
return -1;
|
||||
|
||||
$resultAdd = Db::getInstance()->AutoExecute(_DB_PREFIX_.'cart_product', array(
|
||||
@@ -799,7 +799,7 @@ class CartCore extends ObjectModel
|
||||
unset(self::$_nbProducts[$this->id]);
|
||||
if (isset(self::$_totalWeight[$this->id]))
|
||||
unset(self::$_totalWeight[$this->id]);
|
||||
if ($id_customization)
|
||||
if ((int)($id_customization))
|
||||
{
|
||||
$productTotalQuantity = (int)(Db::getInstance()->getValue('SELECT `quantity`
|
||||
FROM `'._DB_PREFIX_.'cart_product`
|
||||
@@ -1101,7 +1101,7 @@ class CartCore extends ObjectModel
|
||||
|
||||
if (empty($id_carrier))
|
||||
{
|
||||
if ($this->id_customer)
|
||||
if ((int)($this->id_customer))
|
||||
{
|
||||
$customer = new Customer((int)($this->id_customer));
|
||||
$result = Carrier::getCarriers((int)(Configuration::get('PS_LANG_DEFAULT')), true, false, (int)($id_zone), $customer->getGroups());
|
||||
|
||||
@@ -262,7 +262,7 @@ class CategoryCore extends ObjectModel
|
||||
|
||||
public function delete()
|
||||
{
|
||||
if ((int)$this->id === 0 OR (int)$this->id === 1) return false;
|
||||
if ((int)($this->id) === 0 OR (int)($this->id) === 1) return false;
|
||||
|
||||
$this->clearCache();
|
||||
|
||||
@@ -891,7 +891,7 @@ class CategoryCore extends ObjectModel
|
||||
return false;
|
||||
|
||||
foreach ($res AS $category)
|
||||
if ((int)$category['id_category'] == $this->id)
|
||||
if ((int)($category['id_category']) == (int)($this->id))
|
||||
$movedCategory = $category;
|
||||
|
||||
if (!isset($movedCategory) || !isset($position))
|
||||
@@ -903,8 +903,8 @@ class CategoryCore extends ObjectModel
|
||||
SET `position`= `position` '.($way ? '- 1' : '+ 1').'
|
||||
WHERE `position`
|
||||
'.($way
|
||||
? '> '.(int)($movedCategory['position']).' AND `position` <= '.(int)$position
|
||||
: '< '.(int)($movedCategory['position']).' AND `position` >= '.(int)$position).'
|
||||
? '> '.(int)($movedCategory['position']).' AND `position` <= '.(int)($position)
|
||||
: '< '.(int)($movedCategory['position']).' AND `position` >= '.(int)($position)).'
|
||||
AND `id_parent`='.(int)($movedCategory['id_parent']))
|
||||
AND Db::getInstance()->Execute('
|
||||
UPDATE `'._DB_PREFIX_.'category`
|
||||
|
||||
@@ -158,7 +158,7 @@ class FrontControllerCore
|
||||
$_MODULES = array();
|
||||
|
||||
/* Cart already exists */
|
||||
if ($this->context->cookie->id_cart)
|
||||
if ((int)$this->context->cookie->id_cart)
|
||||
{
|
||||
$cart = new Cart($this->context->cookie->id_cart);
|
||||
if ($cart->OrderExists())
|
||||
|
||||
+1
-1
@@ -257,7 +257,7 @@ class ImageCore extends ObjectModel
|
||||
return ;
|
||||
foreach ($combinationImages['new'] AS $id_product_attribute => $imageIds)
|
||||
foreach ($imageIds AS $key => $imageId)
|
||||
if ((int)$imageId == (int)$saved_id)
|
||||
if ((int)($imageId) == (int)($saved_id))
|
||||
$combinationImages['new'][$id_product_attribute][$key] = (int)($id_image);
|
||||
}
|
||||
|
||||
|
||||
@@ -224,7 +224,7 @@ class ManufacturerCore extends ObjectModel
|
||||
}
|
||||
}
|
||||
for ($i = 0; $i < sizeof($manufacturers); $i++)
|
||||
if (Configuration::get('PS_REWRITING_SETTINGS'))
|
||||
if ((int)(Configuration::get('PS_REWRITING_SETTINGS')))
|
||||
$manufacturers[$i]['link_rewrite'] = Tools::link_rewrite($manufacturers[$i]['name'], false);
|
||||
else
|
||||
$manufacturers[$i]['link_rewrite'] = 0;
|
||||
|
||||
+1
-1
@@ -948,7 +948,7 @@ abstract class ModuleCore
|
||||
continue;
|
||||
|
||||
foreach ($res AS $key => $values)
|
||||
if ((int)$values[$this->identifier] == (int)$this->id)
|
||||
if ((int)($values[$this->identifier]) == (int)($this->id))
|
||||
{
|
||||
$k = $key ;
|
||||
break ;
|
||||
|
||||
@@ -115,7 +115,7 @@ class OrderReturnCore extends ObjectModel
|
||||
if (!isset($orderedCustomizations[$customizationId]))
|
||||
return false;
|
||||
$quantity = (isset($customizationQtyInput[$customizationId]) ? (int)($customizationQtyInput[$customizationId]) : 0);
|
||||
if ((int)$orderedCustomizations[$customizationId]['quantity'] - $quantity < 0)
|
||||
if ((int)($orderedCustomizations[$customizationId]['quantity']) - $quantity < 0)
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -563,7 +563,7 @@ class PDFCore extends PDF_PageGroupCore
|
||||
$pdf->Cell(0, 6, self::l('SLIP #').' '.sprintf('%06d', self::$orderSlip->id).' '.self::l('from') . ' ' .Tools::displayDate(self::$orderSlip->date_upd, self::$order->id_lang), 1, 2, 'L', 1);
|
||||
elseif (self::$delivery)
|
||||
$pdf->Cell(0, 6, self::l('DELIVERY SLIP #').Tools::iconv('utf-8', self::encoding(), Configuration::get('PS_DELIVERY_PREFIX', $context->language->id)).sprintf('%06d', self::$delivery).' '.self::l('from') . ' ' .Tools::displayDate(self::$order->delivery_date, self::$order->id_lang), 1, 2, 'L', 1);
|
||||
elseif (self::$order->invoice_date)
|
||||
elseif ((int)self::$order->invoice_date)
|
||||
$pdf->Cell(0, 6, self::l('INVOICE #').' '.Tools::iconv('utf-8', self::encoding(), Configuration::get('PS_INVOICE_PREFIX', $context->language->id)).sprintf('%06d', self::$order->invoice_number).' '.self::l('from') . ' ' .Tools::displayDate(self::$order->invoice_date, self::$order->id_lang), 1, 2, 'L', 1);
|
||||
else
|
||||
$pdf->Cell(0, 6, self::l('Invoice draft'), 1, 2, 'L', 1);
|
||||
|
||||
@@ -431,7 +431,7 @@ abstract class PaymentModuleCore extends Module
|
||||
$data = array_merge($data, $extraVars);
|
||||
|
||||
// Join PDF invoice
|
||||
if (Configuration::get('PS_INVOICE') AND Validate::isLoadedObject($orderStatus) AND $orderStatus->invoice AND $order->invoice_number)
|
||||
if ((int)(Configuration::get('PS_INVOICE')) AND Validate::isLoadedObject($orderStatus) AND $orderStatus->invoice AND $order->invoice_number)
|
||||
{
|
||||
$fileAttachment['content'] = PDF::invoice($order, 'S');
|
||||
$fileAttachment['name'] = Configuration::get('PS_INVOICE_PREFIX', (int)($order->id_lang)).sprintf('%06d', $order->invoice_number).'.pdf';
|
||||
|
||||
+6
-6
@@ -456,7 +456,7 @@ class ProductCore extends ObjectModel
|
||||
return false;
|
||||
|
||||
foreach ($res AS $product)
|
||||
if ((int)$product['id_product'] == (int)$this->id)
|
||||
if ((int)($product['id_product']) == (int)($this->id))
|
||||
$movedProduct = $product;
|
||||
|
||||
if (!isset($movedProduct) || !isset($position))
|
||||
@@ -1678,7 +1678,7 @@ class ProductCore extends ObjectModel
|
||||
$cur_cart = new Cart($id_cart);
|
||||
}
|
||||
|
||||
if ($id_cart)
|
||||
if ((int)($id_cart))
|
||||
{
|
||||
if (!isset(self::$_cart_quantity[(int)($id_cart).'_'.(int)($id_product)]) OR self::$_cart_quantity[(int)($id_cart).'_'.(int)($id_product)] != (int)($quantity))
|
||||
self::$_cart_quantity[(int)($id_cart).'_'.(int)($id_product)] = Db::getInstance(_PS_USE_SQL_SLAVE_)->getValue('
|
||||
@@ -2398,7 +2398,7 @@ class ProductCore extends ObjectModel
|
||||
{
|
||||
$productImplode = array();
|
||||
foreach ($productIds as $id_product)
|
||||
if ($id_product AND !array_key_exists($id_product, self::$_cacheFeatures))
|
||||
if ((int)$id_product AND !array_key_exists($id_product, self::$_cacheFeatures))
|
||||
$productImplode[] = (int)$id_product;
|
||||
if (!count($productImplode))
|
||||
return;
|
||||
@@ -2419,7 +2419,7 @@ class ProductCore extends ObjectModel
|
||||
{
|
||||
$productImplode = array();
|
||||
foreach ($productIds as $id_product)
|
||||
if ($id_product AND !array_key_exists($id_product.'-'.$id_lang, self::$_cacheFeatures))
|
||||
if ((int)$id_product AND !array_key_exists($id_product.'-'.$id_lang, self::$_cacheFeatures))
|
||||
$productImplode[] = (int)$id_product;
|
||||
if (!count($productImplode))
|
||||
return;
|
||||
@@ -2970,11 +2970,11 @@ class ProductCore extends ObjectModel
|
||||
public function createLabels($uploadableFiles, $textFields)
|
||||
{
|
||||
$languages = Language::getLanguages();
|
||||
if ($uploadableFiles > 0)
|
||||
if ((int)($uploadableFiles) > 0)
|
||||
for ($i = 0; $i < (int)($uploadableFiles); $i++)
|
||||
if (!$this->_createLabel($languages, _CUSTOMIZE_FILE_))
|
||||
return false;
|
||||
if ((int)$textFields > 0)
|
||||
if ((int)($textFields) > 0)
|
||||
for ($i = 0; $i < (int)($textFields); $i++)
|
||||
if (!$this->_createLabel($languages, _CUSTOMIZE_TEXTFIELD_))
|
||||
return false;
|
||||
|
||||
@@ -241,7 +241,7 @@ class ReferrerCore extends ObjectModel
|
||||
|
||||
$implode = array();
|
||||
foreach ($result as $row)
|
||||
if ($row['id_order'])
|
||||
if ((int)$row['id_order'])
|
||||
$implode[] = (int)$row['id_order'];
|
||||
|
||||
if ($implode)
|
||||
@@ -339,7 +339,7 @@ class ReferrerCore extends ObjectModel
|
||||
$statsSales = $referrer->getStatsSales($id_product, $employee);
|
||||
|
||||
// If it's a product and it has no visits nor orders
|
||||
if ($id_product AND !$statsVisits['visits'] AND !$statsSales['orders'])
|
||||
if ((int)($id_product) AND !$statsVisits['visits'] AND !$statsSales['orders'])
|
||||
exit;
|
||||
|
||||
$jsonArray = array();
|
||||
|
||||
@@ -151,7 +151,7 @@ class SupplierCore extends ObjectModel
|
||||
}
|
||||
}
|
||||
for ($i = 0; $i < sizeof($suppliers); $i++)
|
||||
if (Configuration::get('PS_REWRITING_SETTINGS'))
|
||||
if ((int)(Configuration::get('PS_REWRITING_SETTINGS')))
|
||||
$suppliers[$i]['link_rewrite'] = Tools::link_rewrite($suppliers[$i]['name'], false);
|
||||
else
|
||||
$suppliers[$i]['link_rewrite'] = 0;
|
||||
|
||||
+1
-1
@@ -65,7 +65,7 @@ class ToolsCore
|
||||
$url = substr($url, strlen($baseUri));
|
||||
if (strpos($url, 'index.php?controller=') !== FALSE && strpos($url, 'index.php/') == 0) {
|
||||
$url = substr($url, strlen('index.php?controller='));
|
||||
if (Configuration::get('PS_REWRITING_SETTINGS'))
|
||||
if((int)(Configuration::get('PS_REWRITING_SETTINGS') == 1))
|
||||
$url = self::strReplaceFirst('&', '?' , $url);
|
||||
}
|
||||
|
||||
|
||||
@@ -813,7 +813,7 @@ class WebserviceSpecificManagementImagesCore implements WebserviceSpecificManage
|
||||
}
|
||||
else
|
||||
{
|
||||
if ((int)Configuration::get('PS_IMAGE_GENERATION_METHOD') == 2 OR ((int)Configuration::get('PS_IMAGE_GENERATION_METHOD') == 0 AND $widthDiff > $heightDiff))
|
||||
if ((int)(Configuration::get('PS_IMAGE_GENERATION_METHOD')) == 2 OR ((int)(Configuration::get('PS_IMAGE_GENERATION_METHOD')) == 0 AND $widthDiff > $heightDiff))
|
||||
{
|
||||
$nextHeight = $destHeight;
|
||||
$nextWidth = (int)(($sourceWidth * $nextHeight) / $sourceHeight);
|
||||
|
||||
@@ -128,7 +128,7 @@ class AddressControllerCore extends FrontController
|
||||
$this->context->customer->isLogged(true) === true)
|
||||
$this->errors[] = Tools::displayError('Invalid token');
|
||||
|
||||
if ($country->contains_states AND !$address->id_state)
|
||||
if ((int)($country->contains_states) AND !(int)($address->id_state))
|
||||
$this->errors[] = Tools::displayError('This country requires a state selection.');
|
||||
|
||||
if (!sizeof($this->errors))
|
||||
|
||||
@@ -140,7 +140,7 @@ class AuthControllerCore extends FrontController
|
||||
{
|
||||
if (!$country = new Country($address->id_country, Configuration::get('PS_LANG_DEFAULT')) OR !Validate::isLoadedObject($country))
|
||||
die(Tools::displayError());
|
||||
if ($country->contains_states AND !$address->id_state)
|
||||
if ((int)($country->contains_states) AND !(int)($address->id_state))
|
||||
$this->errors[] = Tools::displayError('This country requires a state selection.');
|
||||
else
|
||||
{
|
||||
|
||||
@@ -185,7 +185,7 @@ class CartControllerCore extends FrontController
|
||||
if ($updateQuantity < 0)
|
||||
{
|
||||
/* if product has attribute, minimal quantity is set with minimal quantity of attribute*/
|
||||
if ($idProductAttribute)
|
||||
if ((int)$idProductAttribute)
|
||||
$minimal_quantity = Attribute::getAttributeMinimalQty($idProductAttribute);
|
||||
else
|
||||
$minimal_quantity = $producToAdd->minimal_quantity;
|
||||
|
||||
@@ -121,7 +121,7 @@ class ContactControllerCore extends FrontController
|
||||
foreach ($fields as $key => $row)
|
||||
{
|
||||
$tmp = 0;
|
||||
if ($row['id_customer'] AND $row['id_customer'] != $customer->id AND $row['email'] != $from)
|
||||
if ((int)$row['id_customer'] AND $row['id_customer'] != $customer->id AND $row['email'] != $from)
|
||||
continue;
|
||||
if ($row['id_order'] != 0 AND Tools::getValue('id_order') != $row['id_order'])
|
||||
continue;
|
||||
@@ -159,7 +159,7 @@ class ContactControllerCore extends FrontController
|
||||
|
||||
if ($contact->customer_service)
|
||||
{
|
||||
if ($id_customer_thread)
|
||||
if ((int)$id_customer_thread)
|
||||
{
|
||||
$ct = new CustomerThread($id_customer_thread);
|
||||
$ct->status = 'open';
|
||||
|
||||
@@ -141,7 +141,7 @@ class ParentOrderControllerCore extends FrontController
|
||||
if ((Configuration::get('PS_ORDER_PROCESS_TYPE') == 0 AND Tools::getValue('step') == 1) OR Configuration::get('PS_ORDER_PROCESS_TYPE') == 1)
|
||||
$this->addJS(_THEME_JS_DIR_.'order-address.js');
|
||||
$this->addJS(_PS_JS_DIR_.'jquery/jquery.fancybox-1.3.4.js');
|
||||
if (Configuration::get('PS_BLOCK_CART_AJAX') OR Configuration::get('PS_ORDER_PROCESS_TYPE') == 1)
|
||||
if ((int)(Configuration::get('PS_BLOCK_CART_AJAX')) OR Configuration::get('PS_ORDER_PROCESS_TYPE') == 1)
|
||||
{
|
||||
$this->addJS(_THEME_JS_DIR_.'cart-summary.js');
|
||||
$this->addJS(_PS_JS_DIR_.'jquery/jquery-typewatch.pack.js');
|
||||
@@ -200,7 +200,7 @@ class ParentOrderControllerCore extends FrontController
|
||||
{
|
||||
$this->context->cart->recyclable = (int)(Tools::getValue('recyclable'));
|
||||
$this->context->cart->gift = (int)(Tools::getValue('gift'));
|
||||
if (Tools::getValue('gift'))
|
||||
if ((int)(Tools::getValue('gift')))
|
||||
{
|
||||
if (!Validate::isMessage($_POST['gift_message']))
|
||||
$this->errors[] = Tools::displayError('Invalid gift message');
|
||||
@@ -427,7 +427,7 @@ class ParentOrderControllerCore extends FrontController
|
||||
if (sizeof($carriers))
|
||||
{
|
||||
$defaultCarrierIsPresent = false;
|
||||
if ($this->context->cart->id_carrier)
|
||||
if ((int)$this->context->cart->id_carrier != 0)
|
||||
foreach ($carriers AS $carrier)
|
||||
if ($carrier['id_carrier'] == (int)$this->context->cart->id_carrier)
|
||||
$defaultCarrierIsPresent = true;
|
||||
|
||||
@@ -185,7 +185,7 @@ if (isFormValid())
|
||||
$sqlParams[] = 'UPDATE '._DB_PREFIX_.'configuration SET value = \''.pSQL($_GET['isoCode']).'\' WHERE name = \'PS_LOCALE_LANGUAGE\'';
|
||||
$sqlParams[] = 'UPDATE '._DB_PREFIX_.'configuration SET value = \''.(int)$_GET['catalogMode'].'\' WHERE name = \'PS_CATALOG_MODE\'';
|
||||
$sqlParams[] = "INSERT IGNORE INTO "._DB_PREFIX_."configuration (name, value, date_add, date_upd) VALUES ('PS_SHOP_ACTIVITY', '".(int)($_GET['infosActivity'])."', NOW(), NOW())";
|
||||
if ($_GET['infosCountry'])
|
||||
if ((int)($_GET['infosCountry']) != 0)
|
||||
{
|
||||
$sqlParams[] = 'UPDATE '._DB_PREFIX_.'configuration SET value = '.(int)($_GET['infosCountry']).' WHERE name = \'PS_COUNTRY_DEFAULT\'';
|
||||
$sqlParams[] = 'UPDATE '._DB_PREFIX_.'configuration SET value = "'.pSQL($_GET['infosTimezone']).'" WHERE name = \'PS_TIMEZONE\'';
|
||||
|
||||
@@ -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