// Context part 16 (shops)

This commit is contained in:
rMalie
2011-07-20 12:08:15 +00:00
parent 02a738dce1
commit 73d6f4267b
27 changed files with 394 additions and 351 deletions
+5 -5
View File
@@ -112,17 +112,17 @@ class ContactControllerCore extends FrontController
$id_customer_thread = (int)Tools::getValue('id_customer_thread')
AND (int)Db::getInstance()->getValue('
SELECT cm.id_customer_thread FROM '._DB_PREFIX_.'customer_thread cm
WHERE cm.id_customer_thread = '.(int)$id_customer_thread.' AND cm.id_shop='.(int)$this->id_current_shop.' AND token = \''.pSQL(Tools::getValue('token')).'\'')
WHERE cm.id_customer_thread = '.(int)$id_customer_thread.' AND cm.id_shop = '.(int)$this->id_current_shop.' AND token = \''.pSQL(Tools::getValue('token')).'\'')
) OR (
$id_customer_thread = (int)Db::getInstance()->getValue('
SELECT cm.id_customer_thread FROM '._DB_PREFIX_.'customer_thread cm
WHERE cm.email = \''.pSQL($from).'\' AND cm.id_shop='.(int)$this->id_current_shop.' AND cm.id_order = '.(int)(Tools::getValue('id_order')).'')
WHERE cm.email = \''.pSQL($from).'\' AND cm.id_shop = '.(int)$this->id_current_shop.' AND cm.id_order = '.(int)(Tools::getValue('id_order')).'')
)))
{
$fields = Db::getInstance()->ExecuteS('
SELECT cm.id_customer_thread, cm.id_contact, cm.id_customer, cm.id_order, cm.id_product, cm.email
FROM '._DB_PREFIX_.'customer_thread cm
WHERE email = \''.pSQL($from).'\' AND cm.id_shop='.(int)$this->id_current_shop.' AND ('.
WHERE email = \''.pSQL($from).'\' AND cm.id_shop = '.(int)$this->id_current_shop.' AND ('.
($customer->id ? 'id_customer = '.(int)($customer->id).' OR ' : '').'
id_order = '.(int)(Tools::getValue('id_order')).')');
$score = 0;
@@ -148,7 +148,7 @@ class ContactControllerCore extends FrontController
}
$old_message = Db::getInstance()->getValue('
SELECT cm.message FROM '._DB_PREFIX_.'customer_message cm
WHERE cm.id_customer_thread = '.(int)($id_customer_thread).'AND cm.id_shop='.(int)$this->id_current_shop.'
WHERE cm.id_customer_thread = '.(int)($id_customer_thread).'AND cm.id_shop = '.(int)$this->id_current_shop.'
ORDER BY date_add DESC');
if ($old_message == htmlentities($message, ENT_COMPAT, 'UTF-8'))
{
@@ -246,7 +246,7 @@ class ContactControllerCore extends FrontController
{
$customerThread = Db::getInstance()->getRow('
SELECT cm.* FROM '._DB_PREFIX_.'customer_thread cm
WHERE cm.id_customer_thread = '.(int)$id_customer_thread.' AND cm.id_shop='.(int)$this->id_current_shop.' AND token = \''.pSQL($token).'\'');
WHERE cm.id_customer_thread = '.(int)$id_customer_thread.' AND cm.id_shop = '.(int)$this->id_current_shop.' AND token = \''.pSQL($token).'\'');
$this->smarty->assign('customerThread', $customerThread);
}
$this->smarty->assign(array('contacts' => Contact::getContacts((int)self::$cookie->id_lang),