From d0ffa9d9f2efe3f19f9601a7e7194eda0dde78ec Mon Sep 17 00:00:00 2001 From: mDeflotte Date: Mon, 25 Jun 2012 12:26:07 +0000 Subject: [PATCH] [-] MO : #PSCFV-2868 - Fix addslashes --- modules/mailalerts/MailAlert.php | 16 ++++++++-------- modules/mailalerts/mailalerts.php | 28 ++++++++++++++-------------- 2 files changed, 22 insertions(+), 22 deletions(-) diff --git a/modules/mailalerts/MailAlert.php b/modules/mailalerts/MailAlert.php index 5eff978d6..6c4afabe4 100644 --- a/modules/mailalerts/MailAlert.php +++ b/modules/mailalerts/MailAlert.php @@ -44,18 +44,18 @@ class MailAlert extends ObjectModel 'table' => 'mailalert_customer_oos', 'primary' => 'id_customer', 'fields' => array( - 'id_customer' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedInt', 'required' => true), - 'customer_email' => array('type' => self::TYPE_STRING, 'validate' => 'isEmail', 'required' => true), - 'id_product' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedInt', 'required' => true), - 'id_product_attribute' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedInt', 'required' => true), - 'id_shop' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedInt', 'required' => true) + 'id_customer' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedInt', 'required' => true), + 'customer_email' => array('type' => self::TYPE_STRING, 'validate' => 'isEmail', 'required' => true), + 'id_product' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedInt', 'required' => true), + 'id_product_attribute' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedInt', 'required' => true), + 'id_shop' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedInt', 'required' => true) ), ); public static function customerHasNotification($id_customer, $id_product, $id_product_attribute, $id_shop = null) { if ($id_shop == null) - $id_shop = Context::getContext()->shop->id; + $id_shop = Context::getContext()->shop->id; $customer = new Customer($id_customer); $customer_email = $customer->email; @@ -109,7 +109,7 @@ class MailAlert extends ObjectModel continue; if (isset($products[$i]['id_product_attribute']) && - Validate::isUnsignedInt($products[$i]['id_product_attribute'])) + Validate::isUnsignedInt($products[$i]['id_product_attribute'])) { $attributes = self::getProductAttributeCombination($products[$i]['id_product_attribute'], $id_lang); $products[$i]['attributes_small'] = ''; @@ -187,7 +187,7 @@ class MailAlert extends ObjectModel $iso = Language::getIsoById($id_lang); if (file_exists(dirname(__FILE__).'/mails/'.$iso.'/customer_qty.txt') && - file_exists(dirname(__FILE__).'/mails/'.$iso.'/customer_qty.html')) + file_exists(dirname(__FILE__).'/mails/'.$iso.'/customer_qty.html')) Mail::Send((int)Configuration::get('PS_LANG_DEFAULT'), 'customer_qty', Mail::l('Product available', $id_lang), $templateVars, strval($customer_email), NULL, strval(Configuration::get('PS_SHOP_EMAIL')), strval(Configuration::get('PS_SHOP_NAME')), NULL, NULL, dirname(__FILE__).'/mails/'); Hook::exec('actionModuleMailAlertSendCustomer', array('product' => (is_array($product->name) ? $product->name[$id_lang] : $product->name), 'link' => $link->getProductLink($product))); diff --git a/modules/mailalerts/mailalerts.php b/modules/mailalerts/mailalerts.php index 1c99b45e9..222a4bfe9 100644 --- a/modules/mailalerts/mailalerts.php +++ b/modules/mailalerts/mailalerts.php @@ -49,7 +49,7 @@ class MailAlerts extends Module $this->tab = 'administration'; $this->version = '2.4'; $this->author = 'PrestaShop'; - $this->need_instance = 0; + $this->need_instance = 0; parent::__construct(); @@ -264,7 +264,7 @@ class MailAlerts extends Module // Getting differents vars $id_lang = (int)Context::getContext()->language->id; - $currency = $params['currency']; + $currency = $params['currency']; $configuration = Configuration::getMultiple(array('PS_SHOP_EMAIL', 'PS_MAIL_METHOD', 'PS_MAIL_SERVER', 'PS_MAIL_USER', 'PS_MAIL_PASSWD', 'PS_SHOP_NAME')); $order = $params['order']; $customer = $params['customer']; @@ -311,7 +311,7 @@ class MailAlerts extends Module ' .$product['product_name'].(isset($product['attributes_small']) ? ' '.$product['attributes_small'] : '').(!empty($customization_text) ? '
'.$customization_text : ''). - '
+ ' '.Tools::displayPrice($unit_price, $currency, false).' '.(int)$product['product_quantity'].' @@ -340,11 +340,11 @@ class MailAlerts extends Module '{delivery_block_txt}' => MailAlert::getFormatedAddress($delivery, "\n"), '{invoice_block_txt}' => MailAlert::getFormatedAddress($invoice, "\n"), '{delivery_block_html}' => MailAlert::getFormatedAddress($delivery, '
', array( - 'firstname' => '%s', - 'lastname' => '%s')), + 'firstname' => '%s', + 'lastname' => '%s')), '{invoice_block_html}' => MailAlert::getFormatedAddress($invoice, '
', array( - 'firstname' => '%s', - 'lastname' => '%s')), + 'firstname' => '%s', + 'lastname' => '%s')), '{delivery_company}' => $delivery->company, '{delivery_firstname}' => $delivery->firstname, '{delivery_lastname}' => $delivery->lastname, @@ -438,13 +438,13 @@ class MailAlerts extends Module $product_name = Product::getProductName($id_product, $id_product_attribute, $id_lang); $template_vars = array( '{qty}' => $quantity, - '{last_qty}' => $ma_last_qties, - '{product}' => pSQL($product_name)); + '{last_qty}' => $ma_last_qties, + '{product}' => $product_name); if (file_exists(dirname(__FILE__).'/mails/'.$iso.'/productoutofstock.txt') && file_exists(dirname(__FILE__).'/mails/'.$iso.'/productoutofstock.html')) Mail::Send($id_lang, - 'productoutofstock', + 'productoutofstock', Mail::l('Product out of stock', $id_lang), $template_vars, explode(self::__MA_MAIL_DELIMITOR__, $this->_merchant_mails), @@ -546,14 +546,14 @@ class MailAlerts extends Module $product_name = Product::getProductName($id_product, $id_product_attribute, $id_lang); $template_vars = array( '{current_coverage}' => $coverage, - '{warning_coverage}' => $warning_coverage, - '{product}' => pSQL($product_name)); + '{warning_coverage}' => $warning_coverage, + '{product}' => pSQL($product_name)); if (file_exists(dirname(__FILE__).'/mails/'.$iso.'/productcoverage.txt') && file_exists(dirname(__FILE__).'/mails/'.$iso.'/productcoverage.html')) { Mail::Send($id_lang, - 'productcoverage', + 'productcoverage', Mail::l('Stock coverage', $id_lang), $template_vars, explode(self::__MA_MAIL_DELIMITOR__, $this->_merchant_mails), @@ -569,6 +569,6 @@ class MailAlerts extends Module public function hookDisplayHeader($params) { - $this->context->controller->addCSS($this->_path.'mailalerts.css', 'all'); + $this->context->controller->addCSS($this->_path.'mailalerts.css', 'all'); } }