// Merge -> revision 8800

This commit is contained in:
rMalie
2011-09-27 14:30:06 +00:00
parent cde0690abc
commit 91083e190c
110 changed files with 1240 additions and 1066 deletions
+27 -27
View File
@@ -380,9 +380,9 @@ class CanadaPost extends CarrierModule
if (isset($_GET['id_tab']))
$html .= '<script>
$(".menuTabButton.selected").removeClass("selected");
$("#menuTab'.Tools::getValue('id_tab').'").addClass("selected");
$("#menuTab'.Tools::safeOutput(Tools::getValue('id_tab')).'").addClass("selected");
$(".tabItem.selected").removeClass("selected");
$("#menuTab'.Tools::getValue('id_tab').'Sheet").addClass("selected");
$("#menuTab'.Tools::safeOutput(Tools::getValue('id_tab')).'Sheet").addClass("selected");
</script>';
return $html;
}
@@ -416,21 +416,21 @@ class CanadaPost extends CarrierModule
</style>
<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=1&section=general" method="post" class="form" id="configForm">
<form action="index.php?tab='.Tools::safeOutput(Tools::getValue('tab')).'&configure='.Tools::safeOutput(Tools::getValue('configure')).'&token='.Tools::safeOutput(Tools::getValue('token')).'&tab_module='.Tools::safeOutput(Tools::getValue('tab_module')).'&module_name='.Tools::safeOutput(Tools::getValue('module_name')).'&id_tab=1&section=general" method="post" class="form" id="configForm">
<fieldset style="border: 0px;">
<h4>'.$this->l('General configuration').' :</h4>
<label>'.$this->l('Your Canada Post account').' : </label>
<div class="margin-form"><input type="text" size="20" name="cp_carrier_account" value="'.Tools::getValue('cp_carrier_account', Configuration::get('CP_CARRIER_ACCOUNT')).'" /></div>
<div class="margin-form"><input type="text" size="20" name="cp_carrier_account" value="'.Tools::safeOutput(Tools::getValue('cp_carrier_account', Configuration::get('CP_CARRIER_ACCOUNT'))).'" /></div>
<br /><br />
<label>'.$this->l('Packaging Weight').' : </label>
<div class="margin-form">
<input type="text" size="5" name="cp_carrier_packaging_weight" value="'.Tools::getValue('cp_carrier_packaging_weight', Configuration::get('CP_CARRIER_PACKAGING_WEIGHT')).'" />
'.Tools::getValue('ps_weight_unit', Configuration::get('PS_WEIGHT_UNIT')).'
<input type="text" size="5" name="cp_carrier_packaging_weight" value="'.Tools::safeOutput(Tools::getValue('cp_carrier_packaging_weight', Configuration::get('CP_CARRIER_PACKAGING_WEIGHT'))).'" />
'.Tools::safeOutput(Tools::getValue('ps_weight_unit', Configuration::get('PS_WEIGHT_UNIT'))).'
</div>
<label>'.$this->l('Handling Fee').' : </label>
<div class="margin-form">
<input type="text" size="5" name="cp_carrier_handling_fee" value="'.Tools::getValue('cp_carrier_handling_fee', Configuration::get('CP_CARRIER_HANDLING_FEE')).'" />
<input type="text" size="5" name="cp_carrier_handling_fee" value="'.Tools::safeOutput(Tools::getValue('cp_carrier_handling_fee', Configuration::get('CP_CARRIER_HANDLING_FEE'))).'" />
'.$configCurrency->sign.'
</div>
</fieldset>
@@ -439,12 +439,12 @@ class CanadaPost extends CarrierModule
<h4>'.$this->l('Localization configuration').' :</h4>
<label>'.$this->l('Weight unit').' : </label>
<div class="margin-form">
<input type="text" size="20" name="ps_weight_unit" value="'.Tools::getValue('ps_weight_unit', Configuration::get('PS_WEIGHT_UNIT')).'" />
<input type="text" size="20" name="ps_weight_unit" value="'.Tools::safeOutput(Tools::getValue('ps_weight_unit', Configuration::get('PS_WEIGHT_UNIT'))).'" />
<p>'.$this->l('The weight unit of your shop (eg. kg or lbs)').'</p>
</div>
<label>'.$this->l('Dimension unit').' : </label>
<div class="margin-form">
<input type="text" size="20" name="ps_dimension_unit" value="'.Tools::getValue('ps_dimension_unit', Configuration::get('PS_DIMENSION_UNIT')).'" />
<input type="text" size="20" name="ps_dimension_unit" value="'.Tools::safeOutput(Tools::getValue('ps_dimension_unit', Configuration::get('PS_DIMENSION_UNIT'))).'" />
<p>'.$this->l('The dimension unit of your shop (eg. cm or in)').'</p>
</div>
</fieldset>
@@ -452,13 +452,13 @@ class CanadaPost extends CarrierModule
<fieldset style="border: 0px;">
<h4>'.$this->l('Address configuration').' :</h4>
<label>'.$this->l('Your address line 1').' : </label>
<div class="margin-form"><input type="text" size="20" name="cp_carrier_address1" value="'.Tools::getValue('cp_carrier_address1', Configuration::get('CP_CARRIER_ADDRESS1')).'" /></div>
<div class="margin-form"><input type="text" size="20" name="cp_carrier_address1" value="'.Tools::safeOutput(Tools::getValue('cp_carrier_address1', Configuration::get('CP_CARRIER_ADDRESS1'))).'" /></div>
<label>'.$this->l('Your address line 2').' : </label>
<div class="margin-form"><input type="text" size="20" name="cp_carrier_address2" value="'.Tools::getValue('cp_carrier_address2', Configuration::get('CP_CARRIER_ADDRESS2')).'" /></div>
<div class="margin-form"><input type="text" size="20" name="cp_carrier_address2" value="'.Tools::safeOutput(Tools::getValue('cp_carrier_address2', Configuration::get('CP_CARRIER_ADDRESS2'))).'" /></div>
<label>'.$this->l('Zip / Postal Code').' : </label>
<div class="margin-form"><input type="text" size="20" name="cp_carrier_postal_code" value="'.Tools::getValue('cp_carrier_postal_code', Configuration::get('CP_CARRIER_POSTAL_CODE')).'" /></div><br />
<div class="margin-form"><input type="text" size="20" name="cp_carrier_postal_code" value="'.Tools::safeOutput(Tools::getValue('cp_carrier_postal_code', Configuration::get('CP_CARRIER_POSTAL_CODE'))).'" /></div><br />
<label>'.$this->l('Your City').' : </label>
<div class="margin-form"><input type="text" size="20" name="cp_carrier_city" value="'.Tools::getValue('cp_carrier_city', Configuration::get('CP_CARRIER_CITY')).'" /></div>
<div class="margin-form"><input type="text" size="20" name="cp_carrier_city" value="'.Tools::safeOutput(Tools::getValue('cp_carrier_city', Configuration::get('CP_CARRIER_CITY'))).'" /></div>
<label>'.$this->l('Country').' : </label>
<div class="margin-form">
<select name="cp_carrier_country" id="cp_carrier_country">
@@ -732,10 +732,10 @@ class CanadaPost extends CarrierModule
<td>'.$c['additional_charges'].' '.$configCurrency->sign.'</td>
<td>'.$services.'</td>
<td>
<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=2&section=category&action=edit&id_cp_rate_config='.(int)($c['id_cp_rate_config']).'" style="float: left;">
<a href="index.php?tab='.Tools::safeOutput(Tools::getValue('tab')).'&configure='.Tools::safeOutput(Tools::getValue('configure')).'&token='.Tools::safeOutput(Tools::getValue('token')).'&tab_module='.Tools::safeOutput(Tools::getValue('tab_module')).'&module_name='.Tools::safeOutput(Tools::getValue('module_name')).'&id_tab=2&section=category&action=edit&id_cp_rate_config='.(int)($c['id_cp_rate_config']).'" style="float: left;">
<img src="'._PS_IMG_.'admin/edit.gif" />
</a>
<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=2&section=category&action=delete&id_cp_rate_config='.(int)($c['id_cp_rate_config']).'&id_category='.(int)($c['id_category']).'" method="post" class="form" style="float: left;">
<form action="index.php?tab='.Tools::safeOutput(Tools::getValue('tab')).'&configure='.Tools::safeOutput(Tools::getValue('configure')).'&token='.Tools::safeOutput(Tools::getValue('token')).'&tab_module='.Tools::safeOutput(Tools::getValue('tab_module')).'&module_name='.Tools::safeOutput(Tools::getValue('module_name')).'&id_tab=2&section=category&action=delete&id_cp_rate_config='.(int)($c['id_cp_rate_config']).'&id_category='.(int)($c['id_category']).'" method="post" class="form" style="float: left;">
<input name="submitSave" type="image" src="'._PS_IMG_.'admin/delete.gif" OnClick="return confirm(\''.$this->l('Are you sure you want to delete this specific Canada Post configuration for this category ?').'\');" />
</form>
</td>
@@ -761,13 +761,13 @@ class CanadaPost extends CarrierModule
$path .= $p;
}
$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=2&section=category&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=2&section=category&action=edit&id_cp_rate_config='.(int)(Tools::getValue('id_cp_rate_config')).'" method="post" class="form">
$html .= '<p align="center"><b>'.$this->l('Update a rule').' (<a href="index.php?tab='.Tools::safeOutput(Tools::getValue('tab')).'&configure='.Tools::safeOutput(Tools::getValue('configure')).'&token='.Tools::safeOutput(Tools::getValue('token')).'&tab_module='.Tools::safeOutput(Tools::getValue('tab_module')).'&module_name='.Tools::safeOutput(Tools::getValue('module_name')).'&id_tab=2&section=category&action=add">'.$this->l('Add a rule').' ?</a>)</b></p>
<form action="index.php?tab='.Tools::safeOutput(Tools::getValue('tab')).'&configure='.Tools::safeOutput(Tools::getValue('configure')).'&token='.Tools::safeOutput(Tools::getValue('token')).'&tab_module='.Tools::safeOutput(Tools::getValue('tab_module')).'&module_name='.Tools::safeOutput(Tools::getValue('module_name')).'&id_tab=2&section=category&action=edit&id_cp_rate_config='.(int)(Tools::getValue('id_cp_rate_config')).'" method="post" class="form">
<label>'.$this->l('Category').' :</label>
<div class="margin-form" style="padding: 0.2em 0.5em 0 0; font-size: 12px;">'.$path.' <input type="hidden" name="id_category" value="'.(int)($configSelected['id_category']).'" /></div><br clear="left" />
<label>'.$this->l('Additional charges').' : </label>
<div class="margin-form"><input type="text" size="20" name="additional_charges" value="'.Tools::getValue('additional_charges', $configSelected['additional_charges']).'" /></div><br />
<div class="margin-form"><input type="text" size="20" name="additional_charges" value="'.Tools::safeOutput(Tools::getValue('additional_charges', $configSelected['additional_charges'])).'" /></div><br />
<label>'.$this->l('Delivery Service').' : </label>
<div class="margin-form">';
$rateServiceList = Db::getInstance()->ExecuteS('SELECT * FROM `'._DB_PREFIX_.'cp_rate_service_code`');
@@ -785,7 +785,7 @@ class CanadaPost extends CarrierModule
else
{
$html .= '<p align="center"><b>'.$this->l('Add a rule').'</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=2&section=category&action=add" method="post" class="form">
<form action="index.php?tab='.Tools::safeOutput(Tools::getValue('tab')).'&configure='.Tools::safeOutput(Tools::getValue('configure')).'&token='.Tools::safeOutput(Tools::getValue('token')).'&tab_module='.Tools::safeOutput(Tools::getValue('tab_module')).'&module_name='.Tools::safeOutput(Tools::getValue('module_name')).'&id_tab=2&section=category&action=add" method="post" class="form">
<label>'.$this->l('Category').' : </label>
<div class="margin-form">
<select name="id_category">
@@ -794,7 +794,7 @@ class CanadaPost extends CarrierModule
</select>
</div>
<label>'.$this->l('Additional charges').' : </label>
<div class="margin-form"><input type="text" size="20" name="additional_charges" value="'.Tools::getValue('additional_charges').'" /></div><br />
<div class="margin-form"><input type="text" size="20" name="additional_charges" value="'.Tools::safeOutput(Tools::getValue('additional_charges')).'" /></div><br />
<label>'.$this->l('Delivery Service').' : </label>
<div class="margin-form">';
$rateServiceList = Db::getInstance()->ExecuteS('SELECT * FROM `'._DB_PREFIX_.'cp_rate_service_code`');
@@ -963,10 +963,10 @@ class CanadaPost extends CarrierModule
<td>'.$c['additional_charges'].' '.$configCurrency->sign.'</td>
<td>'.$services.'</td>
<td>
<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=edit&id_cp_rate_config='.(int)($c['id_cp_rate_config']).'" style="float: left;">
<a href="index.php?tab='.Tools::safeOutput(Tools::getValue('tab')).'&configure='.Tools::safeOutput(Tools::getValue('configure')).'&token='.Tools::safeOutput(Tools::getValue('token')).'&tab_module='.Tools::safeOutput(Tools::getValue('tab_module')).'&module_name='.Tools::safeOutput(Tools::getValue('module_name')).'&id_tab=3&section=product&action=edit&id_cp_rate_config='.(int)($c['id_cp_rate_config']).'" style="float: left;">
<img src="'._PS_IMG_.'admin/edit.gif" />
</a>
<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=delete&id_cp_rate_config='.(int)($c['id_cp_rate_config']).'&id_product='.(int)($c['id_product']).'" method="post" class="form" style="float: left;">
<form action="index.php?tab='.Tools::safeOutput(Tools::getValue('tab')).'&configure='.Tools::safeOutput(Tools::getValue('configure')).'&token='.Tools::safeOutput(Tools::getValue('token')).'&tab_module='.Tools::safeOutput(Tools::getValue('tab_module')).'&module_name='.Tools::safeOutput(Tools::getValue('module_name')).'&id_tab=3&section=product&action=delete&id_cp_rate_config='.(int)($c['id_cp_rate_config']).'&id_product='.(int)($c['id_product']).'" method="post" class="form" style="float: left;">
<input name="submitSave" type="image" src="'._PS_IMG_.'admin/delete.gif" OnClick="return confirm(\''.$this->l('Are you sure you want to delete this specific Canada Post configuration for this product ?').'\');" />
</form>
</td>
@@ -984,13 +984,13 @@ class CanadaPost extends CarrierModule
$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)$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">
$html .= '<p align="center"><b>'.$this->l('Update a rule').' (<a href="index.php?tab='.Tools::safeOutput(Tools::getValue('tab')).'&configure='.Tools::safeOutput(Tools::getValue('configure')).'&token='.Tools::safeOutput(Tools::getValue('token')).'&tab_module='.Tools::safeOutput(Tools::getValue('tab_module')).'&module_name='.Tools::safeOutput(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::safeOutput(Tools::getValue('tab')).'&configure='.Tools::safeOutput(Tools::getValue('configure')).'&token='.Tools::safeOutput(Tools::getValue('token')).'&tab_module='.Tools::safeOutput(Tools::getValue('tab_module')).'&module_name='.Tools::safeOutput(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">
<label>'.$this->l('Product').' :</label>
<div class="margin-form" style="padding: 0.2em 0.5em 0 0; font-size: 12px;">'.$product->name.' <input type="hidden" name="id_product" value="'.(int)($configSelected['id_product']).'" /></div><br clear="left" />
<label>'.$this->l('Additional charges').' : </label>
<div class="margin-form"><input type="text" size="20" name="additional_charges" value="'.Tools::getValue('additional_charges', $configSelected['additional_charges']).'" /></div><br />
<div class="margin-form"><input type="text" size="20" name="additional_charges" value="'.Tools::safeOutput(Tools::getValue('additional_charges', $configSelected['additional_charges'])).'" /></div><br />
<label>'.$this->l('Delivery Service').' : </label>
<div class="margin-form">';
$rateServiceList = Db::getInstance()->ExecuteS('SELECT * FROM `'._DB_PREFIX_.'cp_rate_service_code`');
@@ -1008,7 +1008,7 @@ class CanadaPost extends CarrierModule
else
{
$html .= '<p align="center"><b>'.$this->l('Add a rule').'</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=add" method="post" class="form">
<form action="index.php?tab='.Tools::safeOutput(Tools::getValue('tab')).'&configure='.Tools::safeOutput(Tools::getValue('configure')).'&token='.Tools::safeOutput(Tools::getValue('token')).'&tab_module='.Tools::safeOutput(Tools::getValue('tab_module')).'&module_name='.Tools::safeOutput(Tools::getValue('module_name')).'&id_tab=3&section=product&action=add" method="post" class="form">
<label>'.$this->l('Product').' : </label>
<div class="margin-form">
<select name="id_product">
@@ -1024,7 +1024,7 @@ class CanadaPost extends CarrierModule
</div>
<label>'.$this->l('Additional charges').' : </label>
<div class="margin-form"><input type="text" size="20" name="additional_charges" value="'.Tools::getValue('additional_charges').'" /></div><br />
<div class="margin-form"><input type="text" size="20" name="additional_charges" value="'.Tools::safeOutput(Tools::getValue('additional_charges')).'" /></div><br />
<label>'.$this->l('Delivery Service').' : </label>
<div class="margin-form">';
$rateServiceList = Db::getInstance()->ExecuteS('SELECT * FROM `'._DB_PREFIX_.'cp_rate_service_code`');