// Context part 29

git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@7935 b9a71923-0436-4b27-9f14-aed3839534dd
This commit is contained in:
tDidierjean
2011-08-08 13:17:12 +00:00
parent 89cc9649cf
commit 653ef8d115
40 changed files with 195 additions and 360 deletions
+6 -13
View File
@@ -388,7 +388,6 @@ class CanadaPost extends CarrierModule
private function _displayFormGeneral()
{
global $cookie;
$configCurrency = new Currency((int)Configuration::get('PS_CURRENCY_DEFAULT'));
$html = '<script>
@@ -464,7 +463,7 @@ class CanadaPost extends CarrierModule
<select name="cp_carrier_country" id="cp_carrier_country">
<option value="0">'.$this->l('Select a country ...').'</option>';
$idcountries = array();
foreach (Country::getCountries($cookie->id_lang) as $v)
foreach (Country::getCountries($this->context->language->id) as $v)
{
$html .= '<option value="'.$v['id_country'].'" '.($v['id_country'] == (int)(Tools::getValue('cp_carrier_country', Configuration::get('CP_CARRIER_COUNTRY'))) ? 'selected="selected"' : '').'>'.$v['name'].'</option>';
$idcountries[] = $v['id_country'];
@@ -619,8 +618,6 @@ class CanadaPost extends CarrierModule
private function _getPathInTab($id_category)
{
global $cookie;
$category = Db::getInstance()->getRow('
SELECT id_category, level_depth, nleft, nright
FROM '._DB_PREFIX_.'category
@@ -632,7 +629,7 @@ class CanadaPost extends CarrierModule
SELECT c.id_category, cl.name, cl.link_rewrite
FROM '._DB_PREFIX_.'category c
LEFT JOIN '._DB_PREFIX_.'category_lang cl ON (cl.id_category = c.id_category)
WHERE c.nleft <= '.(int)$category['nleft'].' AND c.nright >= '.(int)$category['nright'].' AND cl.id_lang = '.(int)($cookie->id_lang).'
WHERE c.nleft <= '.(int)$category['nleft'].' AND c.nright >= '.(int)$category['nright'].' AND cl.id_lang = '.(int)$this->context->language->id.'
ORDER BY c.level_depth ASC
LIMIT '.(int)($category['level_depth'] + 1));
@@ -677,8 +674,6 @@ class CanadaPost extends CarrierModule
private function _displayFormCategory()
{
global $cookie;
// Check if the module is configured
if (!$this->_webserviceTestResult)
return '<p><b>'.$this->l('You have to configure "General Settings" tab before using this tab.').'</b></p><br />';
@@ -794,7 +789,7 @@ class CanadaPost extends CarrierModule
<div class="margin-form">
<select name="id_category">
<option value="0">'.$this->l('Select a category ...').'</option>
'.$this->_getChildCategories(Category::getCategories($cookie->id_lang), 0).'
'.$this->_getChildCategories(Category::getCategories($this->context->language->id), 0).'
</select>
</div>
<label>'.$this->l('Additional charges').' : </label>
@@ -916,8 +911,6 @@ class CanadaPost extends CarrierModule
private function _displayFormProduct()
{
global $cookie;
// Check if the module is configured
if (!$this->_webserviceTestResult)
return '<p><b>'.$this->l('You have to configure "General Settings" tab before using this tab.').'</b></p><br />';
@@ -943,7 +936,7 @@ class CanadaPost extends CarrierModule
foreach ($configProductList as $k => $c)
{
// Loading Product
$product = new Product((int)$c['id_product'], false, (int)$cookie->id_lang);
$product = new Product((int)$c['id_product'], false, (int)$this->context->language->id);
// Loading config currency
$configCurrency = new Currency($c['id_currency']);
@@ -988,7 +981,7 @@ class CanadaPost extends CarrierModule
{
// Loading 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)$cookie->id_lang);
$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>
<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">
@@ -1021,7 +1014,7 @@ class CanadaPost extends CarrierModule
<option value="0">'.$this->l('Select a product ...').'</option>';
$productsList = Db::getInstance()->ExecuteS('
SELECT pl.* FROM `'._DB_PREFIX_.'product` p
LEFT JOIN `'._DB_PREFIX_.'product_lang` pl ON (pl.`id_product` = p.`id_product` AND pl.`id_lang` = '.(int)$cookie->id_lang.')
LEFT JOIN `'._DB_PREFIX_.'product_lang` pl ON (pl.`id_product` = p.`id_product` AND pl.`id_lang` = '.(int)$this->context->language->id.')
WHERE p.`active` = 1
ORDER BY pl.`name`');
foreach ($productsList as $product)