MondialRelay_Pointsrelais - Version 1.2.1

Version Notes

ajout du mode LD1 et LDS pour les livraisons a domicile

Download this release

Release Info

Developer Magento Core Team
Extension MondialRelay_Pointsrelais
Version 1.2.1
Comparing to
See all releases


Code changes from version 1.0.8 to 1.2.1

Files changed (25) hide show
  1. app/code/community/MondialRelay/Pointsrelais/Block/Sales/Order/Shipment/View.php +1 -1
  2. app/code/community/MondialRelay/Pointsrelais/Block/System/Config/Form.php +3 -1
  3. app/code/community/MondialRelay/Pointsrelais/Block/System/Config/Form/Field/Exportpointsrelais.php +1 -1
  4. app/code/community/MondialRelay/Pointsrelais/Block/System/Config/Form/Field/Exportpointsrelaisld1.php +54 -0
  5. app/code/community/MondialRelay/Pointsrelais/Block/System/Config/Form/Field/Exportpointsrelaislds.php +54 -0
  6. app/code/community/MondialRelay/Pointsrelais/Model/Carrier/Pointsrelaisld1.php +134 -0
  7. app/code/community/MondialRelay/Pointsrelais/Model/Carrier/Pointsrelaislds.php +134 -0
  8. app/code/community/MondialRelay/Pointsrelais/Model/Mysql4/Carrier/Pointsrelaisld1.php +373 -0
  9. app/code/community/MondialRelay/Pointsrelais/Model/Mysql4/Carrier/Pointsrelaisld1/Collection.php +48 -0
  10. app/code/community/MondialRelay/Pointsrelais/Model/Mysql4/Carrier/Pointsrelaislds.php +369 -0
  11. app/code/community/MondialRelay/Pointsrelais/Model/Mysql4/Carrier/Pointsrelaislds/Collection.php +48 -0
  12. app/code/community/MondialRelay/Pointsrelais/Model/System/Config/Backend/Shipping/Pointsrelaisld1.php +8 -0
  13. app/code/community/MondialRelay/Pointsrelais/Model/System/Config/Backend/Shipping/Pointsrelaislds.php +8 -0
  14. app/code/community/MondialRelay/Pointsrelais/Model/System/Config/Source/Shipping/Pointsrelaisld1.php +15 -0
  15. app/code/community/MondialRelay/Pointsrelais/Model/System/Config/Source/Shipping/Pointsrelaislds.php +15 -0
  16. app/code/community/MondialRelay/Pointsrelais/controllers/Sales/Order/ShipmentController.php +123 -2
  17. app/code/community/MondialRelay/Pointsrelais/controllers/System/ConfigController.php +19 -4
  18. app/code/community/MondialRelay/Pointsrelais/etc/config.xml +41 -4
  19. app/code/community/MondialRelay/Pointsrelais/etc/system.xml +520 -0
  20. app/code/community/MondialRelay/Pointsrelais/sql/pointsrelais_setup/mysql4-install-1.2.0.php +161 -0
  21. app/code/community/MondialRelay/Pointsrelais/sql/pointsrelais_setup/{mysql4-uninstall-0.1.0.php → mysql4-uninstall-1.2.0.php} +2 -0
  22. app/code/community/MondialRelay/Pointsrelais/sql/pointsrelais_setup/mysql4-update-1.0.4.php +92 -4
  23. app/code/community/MondialRelay/Pointsrelais/sql/pointsrelais_setup/mysql4-update-1.2.0.php +108 -0
  24. app/locale/fr_FR/MondialRelay_Pointsrelais.csv +2 -1
  25. package.xml +5 -5
app/code/community/MondialRelay/Pointsrelais/Block/Sales/Order/Shipment/View.php CHANGED
@@ -50,7 +50,7 @@ class MondialRelay_Pointsrelais_Block_Sales_Order_Shipment_View extends Mage_Adm
50
  //Ajout de l'impression de l'étiquette
51
  $_order = $this->getShipment()->getOrder();
52
  $_shippingMethod = explode("_",$_order->getShippingMethod());
53
- if ($_shippingMethod[0] == 'pointsrelais') {
54
  $this->_addButton('etiquette', array(
55
  'label' => Mage::helper('pointsrelais')->__('Etiquette Mondial Relay'),
56
  'class' => 'save',
50
  //Ajout de l'impression de l'étiquette
51
  $_order = $this->getShipment()->getOrder();
52
  $_shippingMethod = explode("_",$_order->getShippingMethod());
53
+ if (($_shippingMethod[0] == 'pointsrelais') || ($_shippingMethod[0] == 'pointsrelaisld1') || ($_shippingMethod[0] == 'pointsrelaislds')) {
54
  $this->_addButton('etiquette', array(
55
  'label' => Mage::helper('pointsrelais')->__('Etiquette Mondial Relay'),
56
  'class' => 'save',
app/code/community/MondialRelay/Pointsrelais/Block/System/Config/Form.php CHANGED
@@ -47,7 +47,9 @@ class MondialRelay_Pointsrelais_Block_System_Config_Form extends Mage_Adminhtml_
47
  'import' => Mage::getConfig()->getBlockClassName('adminhtml/system_config_form_field_import'),
48
  'allowspecific' => Mage::getConfig()->getBlockClassName('adminhtml/system_config_form_field_select_allowspecific'),
49
  'image' => Mage::getConfig()->getBlockClassName('adminhtml/system_config_form_field_image'),
50
- 'export_pointsrelais' => Mage::getConfig()->getBlockClassName('adminhtml/system_config_form_field_exportpointsrelais')
 
 
51
  );
52
  }
53
 
47
  'import' => Mage::getConfig()->getBlockClassName('adminhtml/system_config_form_field_import'),
48
  'allowspecific' => Mage::getConfig()->getBlockClassName('adminhtml/system_config_form_field_select_allowspecific'),
49
  'image' => Mage::getConfig()->getBlockClassName('adminhtml/system_config_form_field_image'),
50
+ 'export_pointsrelais' => Mage::getConfig()->getBlockClassName('pointsrelais/system_config_form_field_exportpointsrelais'),
51
+ 'export_pointsrelaisld1' => Mage::getConfig()->getBlockClassName('pointsrelais/system_config_form_field_exportpointsrelaisld1'),
52
+ 'export_pointsrelaislds' => Mage::getConfig()->getBlockClassName('pointsrelais/system_config_form_field_exportpointsrelaislds')
53
  );
54
  }
55
 
app/code/community/MondialRelay/Pointsrelais/Block/System/Config/Form/Field/Exportpointsrelais.php CHANGED
@@ -43,7 +43,7 @@ class MondialRelay_Pointsrelais_Block_System_Config_Form_Field_Exportpointsrelai
43
 
44
  $data = array(
45
  'label' => Mage::helper('adminhtml')->__('Export CSV'),
46
- 'onclick' => 'setLocation(\''.Mage::helper('adminhtml')->getUrl("pointsrelais/system_config/export", $params) . 'conditionName/\' + $(\'carriers_tablerate_condition_name\').value + \'/tablerates.csv\' )',
47
  'class' => '',
48
  );
49
 
43
 
44
  $data = array(
45
  'label' => Mage::helper('adminhtml')->__('Export CSV'),
46
+ 'onclick' => 'setLocation(\''.Mage::helper('adminhtml')->getUrl("pointsrelais/system_config/export", $params) . 'conditionName/\' + $(\'carriers_pointsrelais_condition_name\').value + \'/tablerates.csv\' )',
47
  'class' => '',
48
  );
49
 
app/code/community/MondialRelay/Pointsrelais/Block/System/Config/Form/Field/Exportpointsrelaisld1.php ADDED
@@ -0,0 +1,54 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to license@magentocommerce.com so we can send you a copy immediately.
14
+ *
15
+ * DISCLAIMER
16
+ *
17
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
18
+ * versions in the future. If you wish to customize Magento for your
19
+ * needs please refer to http://www.magentocommerce.com for more information.
20
+ *
21
+ * @category Mage
22
+ * @package Mage_Adminhtml
23
+ * @copyright Copyright (c) 2008 Irubin Consulting Inc. DBA Varien (http://www.varien.com)
24
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
+ */
26
+
27
+ /**
28
+ * Export CSV button for shipping table rates
29
+ *
30
+ * @category Mage
31
+ * @package Mage_Adminhtml
32
+ * @author Magento Core Team <core@magentocommerce.com>
33
+ */
34
+ class MondialRelay_Pointsrelais_Block_System_Config_Form_Field_Exportpointsrelaisld1 extends Varien_Data_Form_Element_Abstract
35
+ {
36
+ public function getElementHtml()
37
+ {
38
+ $buttonBlock = $this->getForm()->getParent()->getLayout()->createBlock('adminhtml/widget_button');
39
+
40
+ $params = array(
41
+ 'website' => $buttonBlock->getRequest()->getParam('website')
42
+ );
43
+
44
+ $data = array(
45
+ 'label' => Mage::helper('adminhtml')->__('Export CSV'),
46
+ 'onclick' => 'setLocation(\''.Mage::helper('adminhtml')->getUrl("pointsrelais/system_config/exportld1", $params) . 'conditionName/\' + $(\'carriers_pointsrelaisld1_condition_name\').value + \'/tablerates.csv\' )',
47
+ 'class' => '',
48
+ );
49
+
50
+ $html = $buttonBlock->setData($data)->toHtml();
51
+
52
+ return $html;
53
+ }
54
+ }
app/code/community/MondialRelay/Pointsrelais/Block/System/Config/Form/Field/Exportpointsrelaislds.php ADDED
@@ -0,0 +1,54 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to license@magentocommerce.com so we can send you a copy immediately.
14
+ *
15
+ * DISCLAIMER
16
+ *
17
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
18
+ * versions in the future. If you wish to customize Magento for your
19
+ * needs please refer to http://www.magentocommerce.com for more information.
20
+ *
21
+ * @category Mage
22
+ * @package Mage_Adminhtml
23
+ * @copyright Copyright (c) 2008 Irubin Consulting Inc. DBA Varien (http://www.varien.com)
24
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
+ */
26
+
27
+ /**
28
+ * Export CSV button for shipping table rates
29
+ *
30
+ * @category Mage
31
+ * @package Mage_Adminhtml
32
+ * @author Magento Core Team <core@magentocommerce.com>
33
+ */
34
+ class MondialRelay_Pointsrelais_Block_System_Config_Form_Field_Exportpointsrelaislds extends Varien_Data_Form_Element_Abstract
35
+ {
36
+ public function getElementHtml()
37
+ {
38
+ $buttonBlock = $this->getForm()->getParent()->getLayout()->createBlock('adminhtml/widget_button');
39
+
40
+ $params = array(
41
+ 'website' => $buttonBlock->getRequest()->getParam('website')
42
+ );
43
+
44
+ $data = array(
45
+ 'label' => Mage::helper('adminhtml')->__('Export CSV'),
46
+ 'onclick' => 'setLocation(\''.Mage::helper('adminhtml')->getUrl("pointsrelais/system_config/exportlds", $params) . 'conditionName/\' + $(\'carriers_pointsrelaislds_condition_name\').value + \'/tablerates.csv\' )',
47
+ 'class' => '',
48
+ );
49
+
50
+ $html = $buttonBlock->setData($data)->toHtml();
51
+
52
+ return $html;
53
+ }
54
+ }
app/code/community/MondialRelay/Pointsrelais/Model/Carrier/Pointsrelaisld1.php ADDED
@@ -0,0 +1,134 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class MondialRelay_Pointsrelais_Model_Carrier_Pointsrelaisld1 extends Mage_Shipping_Model_Carrier_Abstract
3
+ {
4
+ protected $_code = 'pointsrelaisld1';
5
+
6
+ public function collectRates(Mage_Shipping_Model_Rate_Request $request)
7
+ {
8
+ if (!$this->getConfigFlag('active')) {
9
+ return false;
10
+ }
11
+
12
+ // desactive multi-shipping
13
+
14
+ if (Mage::getSingleton('checkout/session')->getQuote()->getIsMultiShipping())
15
+ {
16
+ return false;
17
+ }
18
+
19
+ if (!$request->getConditionName()) {
20
+ $request->setConditionName($this->getConfigData('condition_name') ? $this->getConfigData('condition_name') : $this->_default_condition_name);
21
+ }
22
+
23
+ $result = Mage::getModel('shipping/rate_result');
24
+
25
+ $rates = $this->getRate($request);
26
+ $cartTmp = $request->_data['package_value_with_discount'];
27
+ $weghtTmp = $request->_data['package_weight'];
28
+
29
+ foreach($rates as $rate)
30
+ {
31
+ if (!empty($rate) && $rate['price'] >= 0)
32
+ {
33
+ $method = Mage::getModel('shipping/rate_result_method');
34
+ $method->setCarrier('pointsrelaisld1');
35
+ $method->setCarrierTitle($this->getConfigData('title'));
36
+ $method->setMethod('pointsrelaisld1');
37
+ $method->setMethodTitle($this->getConfigData('description'));
38
+ $price = $rate['price'];
39
+ $method->setPrice($this->getFinalPriceWithHandlingFee($price));
40
+ $method->setCost($rate['cost']);
41
+ $result->append($method);
42
+ }
43
+ }
44
+
45
+ return $result;
46
+ }
47
+
48
+ public function getRate(Mage_Shipping_Model_Rate_Request $request)
49
+ {
50
+ return Mage::getResourceModel('pointsrelais/carrier_pointsrelaisld1')->getRate($request);
51
+ }
52
+
53
+ public function getCode($type, $code='')
54
+ {
55
+ $codes = array(
56
+
57
+ 'condition_name'=>array(
58
+ 'package_weight' => Mage::helper('shipping')->__('Weight vs. Destination'),
59
+ 'package_value' => Mage::helper('shipping')->__('Price vs. Destination'),
60
+ 'package_qty' => Mage::helper('shipping')->__('# of Items vs. Destination'),
61
+ ),
62
+
63
+ 'condition_name_short'=>array(
64
+ 'package_weight' => Mage::helper('shipping')->__('Poids'),
65
+ 'package_value' => Mage::helper('shipping')->__('Valeur du panier'),
66
+ 'package_qty' => Mage::helper('shipping')->__('Nombre d\'articles'),
67
+ ),
68
+
69
+ );
70
+
71
+ if (!isset($codes[$type])) {
72
+ throw Mage::exception('Mage_Shipping', Mage::helper('shipping')->__('Invalid Tablerate Rate code type: %s', $type));
73
+ }
74
+
75
+ if (''===$code) {
76
+ return $codes[$type];
77
+ }
78
+
79
+ if (!isset($codes[$type][$code])) {
80
+ throw Mage::exception('Mage_Shipping', Mage::helper('shipping')->__('Invalid Tablerate Rate code for type %s: %s', $type, $code));
81
+ }
82
+
83
+ return $codes[$type][$code];
84
+ }
85
+
86
+ public function getAllowedMethods()
87
+ {
88
+ return array('pointsrelais'=>$this->getConfigData('name'));
89
+ }
90
+
91
+ public function isTrackingAvailable()
92
+ {
93
+ return true;
94
+ }
95
+
96
+ public function getTrackingInfo($tracking_number)
97
+ {
98
+ $tracking_result = $this->getTracking($tracking_number);
99
+
100
+ if ($tracking_result instanceof Mage_Shipping_Model_Tracking_Result)
101
+ {
102
+ if ($trackings = $tracking_result->getAllTrackings())
103
+ {
104
+ return $trackings[0];
105
+ }
106
+ }
107
+ elseif (is_string($tracking_result) && !empty($tracking_result))
108
+ {
109
+ return $tracking_result;
110
+ }
111
+
112
+ return false;
113
+ }
114
+
115
+ protected function getTracking($tracking_number)
116
+ {
117
+ $key = '<' . $this->getConfigData('marque_url') .'>' . $tracking_number . '<' . $this->getConfigData('cle_url') . '>';
118
+ $key = md5($key);
119
+
120
+ $tracking_url = 'http://www.mondialrelay.fr/lg_fr/espaces/url/popup_exp_details.aspx?cmrq=' . strtoupper($this->getConfigData('marque_url')) .'&nexp=' . strtoupper($tracking_number) . '&crc=' . strtoupper($key) ;
121
+
122
+ $tracking_result = Mage::getModel('shipping/tracking_result');
123
+
124
+ $tracking_status = Mage::getModel('shipping/tracking_result_status');
125
+ $tracking_status->setCarrier($this->_code)
126
+ ->setCarrierTitle($this->getConfigData('title'))
127
+ ->setTracking($tracking_number)
128
+ ->setUrl($tracking_url);
129
+ $tracking_result->append($tracking_status);
130
+
131
+ return $tracking_result;
132
+ }
133
+
134
+ }
app/code/community/MondialRelay/Pointsrelais/Model/Carrier/Pointsrelaislds.php ADDED
@@ -0,0 +1,134 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class MondialRelay_Pointsrelais_Model_Carrier_Pointsrelaislds extends Mage_Shipping_Model_Carrier_Abstract
3
+ {
4
+ protected $_code = 'pointsrelaislds';
5
+
6
+ public function collectRates(Mage_Shipping_Model_Rate_Request $request)
7
+ {
8
+ if (!$this->getConfigFlag('active')) {
9
+ return false;
10
+ }
11
+
12
+ // desactive multi-shipping
13
+
14
+ if (Mage::getSingleton('checkout/session')->getQuote()->getIsMultiShipping())
15
+ {
16
+ return false;
17
+ }
18
+
19
+ if (!$request->getConditionName()) {
20
+ $request->setConditionName($this->getConfigData('condition_name') ? $this->getConfigData('condition_name') : $this->_default_condition_name);
21
+ }
22
+
23
+ $result = Mage::getModel('shipping/rate_result');
24
+
25
+ $rates = $this->getRate($request);
26
+ $cartTmp = $request->_data['package_value_with_discount'];
27
+ $weghtTmp = $request->_data['package_weight'];
28
+
29
+ foreach($rates as $rate)
30
+ {
31
+ if (!empty($rate) && $rate['price'] >= 0)
32
+ {
33
+ $method = Mage::getModel('shipping/rate_result_method');
34
+ $method->setCarrier('pointsrelaislds');
35
+ $method->setCarrierTitle($this->getConfigData('title'));
36
+ $method->setMethod('pointsrelaislds');
37
+ $method->setMethodTitle($this->getConfigData('description'));
38
+ $price = $rate['price'];
39
+ $method->setPrice($this->getFinalPriceWithHandlingFee($price));
40
+ $method->setCost($rate['cost']);
41
+ $result->append($method);
42
+ }
43
+ }
44
+
45
+ return $result;
46
+ }
47
+
48
+ public function getRate(Mage_Shipping_Model_Rate_Request $request)
49
+ {
50
+ return Mage::getResourceModel('pointsrelais/carrier_pointsrelaislds')->getRate($request);
51
+ }
52
+
53
+ public function getCode($type, $code='')
54
+ {
55
+ $codes = array(
56
+
57
+ 'condition_name'=>array(
58
+ 'package_weight' => Mage::helper('shipping')->__('Weight vs. Destination'),
59
+ 'package_value' => Mage::helper('shipping')->__('Price vs. Destination'),
60
+ 'package_qty' => Mage::helper('shipping')->__('# of Items vs. Destination'),
61
+ ),
62
+
63
+ 'condition_name_short'=>array(
64
+ 'package_weight' => Mage::helper('shipping')->__('Poids'),
65
+ 'package_value' => Mage::helper('shipping')->__('Valeur du panier'),
66
+ 'package_qty' => Mage::helper('shipping')->__('Nombre d\'articles'),
67
+ ),
68
+
69
+ );
70
+
71
+ if (!isset($codes[$type])) {
72
+ throw Mage::exception('Mage_Shipping', Mage::helper('shipping')->__('Invalid Tablerate Rate code type: %s', $type));
73
+ }
74
+
75
+ if (''===$code) {
76
+ return $codes[$type];
77
+ }
78
+
79
+ if (!isset($codes[$type][$code])) {
80
+ throw Mage::exception('Mage_Shipping', Mage::helper('shipping')->__('Invalid Tablerate Rate code for type %s: %s', $type, $code));
81
+ }
82
+
83
+ return $codes[$type][$code];
84
+ }
85
+
86
+ public function getAllowedMethods()
87
+ {
88
+ return array('pointsrelais'=>$this->getConfigData('name'));
89
+ }
90
+
91
+ public function isTrackingAvailable()
92
+ {
93
+ return true;
94
+ }
95
+
96
+ public function getTrackingInfo($tracking_number)
97
+ {
98
+ $tracking_result = $this->getTracking($tracking_number);
99
+
100
+ if ($tracking_result instanceof Mage_Shipping_Model_Tracking_Result)
101
+ {
102
+ if ($trackings = $tracking_result->getAllTrackings())
103
+ {
104
+ return $trackings[0];
105
+ }
106
+ }
107
+ elseif (is_string($tracking_result) && !empty($tracking_result))
108
+ {
109
+ return $tracking_result;
110
+ }
111
+
112
+ return false;
113
+ }
114
+
115
+ protected function getTracking($tracking_number)
116
+ {
117
+ $key = '<' . $this->getConfigData('marque_url') .'>' . $tracking_number . '<' . $this->getConfigData('cle_url') . '>';
118
+ $key = md5($key);
119
+
120
+ $tracking_url = 'http://www.mondialrelay.fr/lg_fr/espaces/url/popup_exp_details.aspx?cmrq=' . strtoupper($this->getConfigData('marque_url')) .'&nexp=' . strtoupper($tracking_number) . '&crc=' . strtoupper($key) ;
121
+
122
+ $tracking_result = Mage::getModel('shipping/tracking_result');
123
+
124
+ $tracking_status = Mage::getModel('shipping/tracking_result_status');
125
+ $tracking_status->setCarrier($this->_code)
126
+ ->setCarrierTitle($this->getConfigData('title'))
127
+ ->setTracking($tracking_number)
128
+ ->setUrl($tracking_url);
129
+ $tracking_result->append($tracking_status);
130
+
131
+ return $tracking_result;
132
+ }
133
+
134
+ }
app/code/community/MondialRelay/Pointsrelais/Model/Mysql4/Carrier/Pointsrelaisld1.php ADDED
@@ -0,0 +1,373 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class MondialRelay_Pointsrelais_Model_Mysql4_Carrier_Pointsrelaisld1 extends Mage_Core_Model_Mysql4_Abstract
3
+ {
4
+ protected function _construct()
5
+ {
6
+ $this->_init('shipping/pointsrelaisld1', 'pk');
7
+ }
8
+
9
+
10
+ public function getRate(Mage_Shipping_Model_Rate_Request $request)
11
+ {
12
+
13
+ //if products cannot be send in one package
14
+
15
+ $read = $this->_getReadAdapter();
16
+
17
+ $table = Mage::getSingleton('core/resource')->getTableName('mondialrelay_pointsrelaisld1');
18
+
19
+ $select = $read->select()->from($table);
20
+
21
+ $select->where(
22
+ $read->quoteInto(" (dest_country_id=? ", $request->getDestCountryId()).
23
+ $read->quoteInto(" AND dest_region_id=? ", $request->getDestRegionId()).
24
+ $read->quoteInto(" AND dest_zip=?) ", $request->getDestPostcode()).
25
+
26
+ $read->quoteInto(" OR (dest_country_id=? ", $request->getDestCountryId()).
27
+ $read->quoteInto(" AND dest_region_id=? AND dest_zip='') ", $request->getDestRegionId()).
28
+
29
+ $read->quoteInto(" OR (dest_country_id=? AND dest_region_id='0' AND dest_zip='') ", $request->getDestCountryId()).
30
+
31
+ $read->quoteInto(" OR (dest_country_id=? AND dest_region_id='0' ", $request->getDestCountryId()).
32
+ $read->quoteInto(" AND dest_zip=?) ", $request->getDestPostcode()).
33
+
34
+ " OR (dest_country_id='0' AND dest_region_id='0' AND dest_zip='')"
35
+ );
36
+
37
+ if (is_array($request->getConditionName()))
38
+ {
39
+ $i = 0;
40
+
41
+ foreach ($request->getConditionName() as $conditionName)
42
+ {
43
+ if ($i == 0)
44
+ {
45
+ $select->where('condition_name=?', $conditionName);
46
+ }
47
+ else
48
+ {
49
+ $select->orWhere('condition_name=?', $conditionName);
50
+ }
51
+
52
+ $select->where('condition_value>=?', $request->getData($conditionName));
53
+ $i++;
54
+ }
55
+ }
56
+ else
57
+ {
58
+ $select->where('condition_name=?', $request->getConditionName());
59
+ $select->where('condition_value>=?', $request->getData($request->getConditionName()));
60
+ }
61
+
62
+ $select->where('website_id=?', $request->getWebsiteId());
63
+
64
+ $select->group('dest_zip');
65
+ $select->group('dest_region_id');
66
+ $select->group('dest_country_id');
67
+
68
+ $select->order('dest_zip DESC');
69
+ $select->order('dest_region_id DESC');
70
+ $select->order('dest_country_id DESC');
71
+
72
+ $select->order('condition_value ASC');
73
+
74
+ $rows = $read->fetchAll($select);
75
+
76
+ /*
77
+ * Check to see if any zip code or region specific rates exist.
78
+ */
79
+ $specific = array();
80
+ $failover = array();
81
+
82
+ $zipFound = $regionFound = false;
83
+
84
+ /*
85
+ * Most specific: Zip code.
86
+ * Check for any not null zip codes, which would mean that we have a specific shipping method for that zipcode
87
+ */
88
+ foreach($rows as $row)
89
+ {
90
+ if (!empty($row['dest_zip']))
91
+ {
92
+ $specific[] = $row;
93
+ $zipFound = true;
94
+ }
95
+ elseif (!empty($row['dest_region_id']) && $zipFound == false)
96
+ {
97
+ $specific[] = $row;
98
+ $regionFound = true;
99
+ }
100
+ elseif (!empty($row['dest_country_id']) && $zipFound == false && $regionFound == false)
101
+ {
102
+ $specific[] = $row;
103
+ }
104
+
105
+ if (empty($row['dest_country_id']) && empty($row['dest_region_id']) && empty($row['dest_zip']))
106
+ {
107
+ $failover[] = $row;
108
+ }
109
+ }
110
+
111
+ if (count($specific) > 0)
112
+ {
113
+ $rates = $specific;
114
+ }
115
+ else
116
+ {
117
+ $rates = $failover;
118
+ }
119
+
120
+ /*
121
+ * Great, we have something specific for the zip code or region, let's return just those
122
+ */
123
+
124
+ return $rates;
125
+ }
126
+
127
+ public function uploadAndImport(Varien_Object $object)
128
+ {
129
+ $csvFile = $_FILES["groups"]["tmp_name"]["pointsrelaisld1"]["fields"]["import"]["value"];
130
+
131
+ if (!empty($csvFile))
132
+ {
133
+ $csv = trim(file_get_contents($csvFile));
134
+
135
+ $table = Mage::getSingleton('core/resource')->getTableName('mondialrelay_pointsrelaisld1');
136
+ Mage::Log('uploadAndImport : '.$table);
137
+ $websiteId = $object->getScopeId();
138
+
139
+ if (isset($_POST['groups']['pointsrelaisld1']['fields']['condition_name']['inherit']))
140
+ {
141
+ $conditionName = (string)Mage::getConfig()->getNode('default/carriers/pointsrelaisld1/condition_name');
142
+ }
143
+ else
144
+ {
145
+ $conditionName = $_POST['groups']['pointsrelaisld1']['fields']['condition_name']['value'];
146
+ }
147
+
148
+ $conditionFullName = Mage::getModel('pointsrelais/carrier_pointsrelaisld1')->getCode('condition_name_short', $conditionName);
149
+
150
+ if (!empty($csv))
151
+ {
152
+ $exceptions = array();
153
+ $csvLines = explode("\n", $csv);
154
+ $csvLine = array_shift($csvLines);
155
+ $csvLine = $this->_getCsvValues($csvLine);
156
+
157
+ if (count($csvLine) < 5)
158
+ {
159
+ $exceptions[0] = Mage::helper('shipping')->__('Invalid Table Rates File Format');
160
+ }
161
+
162
+ $countryCodes = array();
163
+ $regionCodes = array();
164
+
165
+ foreach ($csvLines as $k => $csvLine)
166
+ {
167
+ $csvLine = $this->_getCsvValues($csvLine);
168
+
169
+ if (count($csvLine) > 0 && count($csvLine) < 5)
170
+ {
171
+ $exceptions[0] = Mage::helper('shipping')->__('Invalid Table Rates File Format');
172
+ }
173
+ else
174
+ {
175
+ $countryCodes[] = $csvLine[0];
176
+ $regionCodes[] = $csvLine[1];
177
+ }
178
+ }
179
+
180
+ if (empty($exceptions))
181
+ {
182
+ $data = array();
183
+ $countryCodesToIds = array();
184
+ $regionCodesToIds = array();
185
+ $countryCodesIso2 = array();
186
+
187
+ $countryCollection = Mage::getResourceModel('directory/country_collection')->addCountryCodeFilter($countryCodes)->load();
188
+
189
+ foreach ($countryCollection->getItems() as $country)
190
+ {
191
+ $countryCodesToIds[$country->getData('iso3_code')] = $country->getData('country_id');
192
+ $countryCodesToIds[$country->getData('iso2_code')] = $country->getData('country_id');
193
+ $countryCodesIso2[] = $country->getData('iso2_code');
194
+ }
195
+
196
+ $regionCollection = Mage::getResourceModel('directory/region_collection')
197
+ ->addRegionCodeFilter($regionCodes)
198
+ ->addCountryFilter($countryCodesIso2)
199
+ ->load();
200
+
201
+ foreach ($regionCollection->getItems() as $region)
202
+ {
203
+ $regionCodesToIds[$countryCodesToIds[$region->getData('country_id')]][$region->getData('code')] = $region->getData('region_id');
204
+ }
205
+
206
+ foreach ($csvLines as $k => $csvLine)
207
+ {
208
+
209
+ $csvLine = $this->_getCsvValues($csvLine);
210
+
211
+ /*
212
+ * Column 1 - Country
213
+ */
214
+ if (empty($countryCodesToIds) || !array_key_exists($csvLine[0], $countryCodesToIds))
215
+ {
216
+ $countryId = '0';
217
+
218
+ if ($csvLine[0] != '*' && $csvLine[0] != '')
219
+ {
220
+ $exceptions[] = Mage::helper('shipping')->__('Invalid Country "%s" in the Row #%s', $csvLine[0], ($k+1));
221
+ }
222
+ }
223
+ else
224
+ {
225
+ $countryId = $countryCodesToIds[$csvLine[0]];
226
+ }
227
+
228
+
229
+ /*
230
+ * Column 2 - Region/State
231
+ */
232
+ # if (empty($regionCodesToIds[$countryCodesToIds[$csvLine[0]]]) || !array_key_exists($csvLine[1], $regionCodesToIds[$countryCodesToIds[$csvLine[0]]]))
233
+ if ($countryId == '0')
234
+ {
235
+ $regionId = '0';
236
+ }
237
+ else
238
+ {
239
+ if (empty($regionCodesToIds[$countryCodesToIds[$csvLine[0]]]) || !array_key_exists($csvLine[1], $regionCodesToIds[$countryCodesToIds[$csvLine[0]]]))
240
+ {
241
+ $regionId = '0';
242
+
243
+ if ($csvLine[1] != '*' && $csvLine[1] != '')
244
+ {
245
+ $exceptions[] = Mage::helper('shipping')->__('Invalid Region/State "%s" in the Row #%s', $csvLine[1], ($k+1));
246
+ }
247
+ }
248
+ else
249
+ {
250
+ $regionId = $regionCodesToIds[$countryCodesToIds[$csvLine[0]]][$csvLine[1]];
251
+ }
252
+ }
253
+ /*
254
+ * Column 3 - Zip/Postal Code
255
+ */
256
+ if ($csvLine[2] == '*' || $csvLine[2] == '')
257
+ {
258
+ $zip = '';
259
+ }
260
+ else
261
+ {
262
+ $zip = $csvLine[2];
263
+ }
264
+
265
+ /*
266
+ * Column 4 - Order Subtotal
267
+ */
268
+ if (!$this->_isPositiveDecimalNumber($csvLine[3]) || $csvLine[3] == '*' || $csvLine[3] == '')
269
+ {
270
+ $exceptions[] = Mage::helper('shipping')->__('Invalid %s "%s" in the Row #%s', $conditionFullName, $csvLine[3], ($k+1));
271
+ }
272
+ else
273
+ {
274
+ $csvLine[3] = (float)$csvLine[3];
275
+ }
276
+
277
+ /*
278
+ * Column 5 - Shipping Price
279
+ */
280
+ if (!$this->_isPositiveDecimalNumber($csvLine[4]))
281
+ {
282
+ $exceptions[] = Mage::helper('shipping')->__('Invalid Shipping Price "%s" in the Row #%s', $csvLine[4], ($k+1));
283
+ }
284
+ else
285
+ {
286
+ $csvLine[4] = (float)$csvLine[4];
287
+ }
288
+
289
+ $data[] = array(
290
+ 'website_id' => $websiteId,
291
+ 'dest_country_id' => $countryId,
292
+ 'dest_region_id' => $regionId,
293
+ 'dest_zip' => $zip,
294
+ 'condition_name' => $conditionName,
295
+ 'condition_value' => $csvLine[3],
296
+ 'price' => $csvLine[4],
297
+ );
298
+ }
299
+ }
300
+
301
+ if (empty($exceptions))
302
+ {
303
+ $connection = $this->_getWriteAdapter();
304
+
305
+ $condition = array(
306
+ $connection->quoteInto('website_id = ?', $websiteId),
307
+ $connection->quoteInto('condition_name = ?', $conditionName),
308
+ );
309
+
310
+ $connection->delete($table, $condition);
311
+
312
+ foreach($data as $k=>$dataLine)
313
+ {
314
+ try
315
+ {
316
+ $connection->insert($table, $dataLine);
317
+ }
318
+ catch (Exception $e)
319
+ {
320
+ // This should probably show the exception message too.
321
+ $exceptions[] = Mage::helper('shipping')->__('Import error: ' . $e->getMessage());
322
+ }
323
+ }
324
+ }
325
+
326
+ if (!empty($exceptions))
327
+ {
328
+ throw new Exception( "\n" . implode("\n", $exceptions) );
329
+ }
330
+ }
331
+ }
332
+ }
333
+
334
+ protected function _getCsvValues($string, $separator=",")
335
+ {
336
+ $elements = explode($separator, trim($string));
337
+
338
+ for ($i = 0; $i < count($elements); $i++)
339
+ {
340
+ $nquotes = substr_count($elements[$i], '"');
341
+
342
+ if ($nquotes %2 == 1)
343
+ {
344
+ for ($j = $i+1; $j < count($elements); $j++)
345
+ {
346
+ if (substr_count($elements[$j], '"') > 0)
347
+ {
348
+ // Put the quoted string's pieces back together again
349
+ array_splice($elements, $i, $j-$i+1, implode($separator, array_slice($elements, $i, $j-$i+1)));
350
+ break;
351
+ }
352
+ }
353
+ }
354
+
355
+ if ($nquotes > 0)
356
+ {
357
+ // Remove first and last quotes, then merge pairs of quotes
358
+ $qstr =& $elements[$i];
359
+ $qstr = substr_replace($qstr, '', strpos($qstr, '"'), 1);
360
+ $qstr = substr_replace($qstr, '', strrpos($qstr, '"'), 1);
361
+ $qstr = str_replace('""', '"', $qstr);
362
+ }
363
+ $elements[$i] = trim($elements[$i]);
364
+ }
365
+ return $elements;
366
+ }
367
+
368
+ protected function _isPositiveDecimalNumber($n)
369
+ {
370
+ return preg_match ("/^[0-9]+(\.[0-9]*)?$/", $n);
371
+ }
372
+
373
+ }
app/code/community/MondialRelay/Pointsrelais/Model/Mysql4/Carrier/Pointsrelaisld1/Collection.php ADDED
@@ -0,0 +1,48 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class MondialRelay_Pointsrelais_Model_Mysql4_Carrier_Pointsrelaisld1_Collection extends Varien_Data_Collection_Db
3
+ {
4
+ protected $_shipTable;
5
+ protected $_countryTable;
6
+ protected $_regionTable;
7
+
8
+ public function __construct()
9
+ {
10
+ parent::__construct(Mage::getSingleton('core/resource')->getConnection('shipping_read'));
11
+
12
+ $this->_shipTable = Mage::getSingleton('core/resource')->getTableName('mondialrelay_pointsrelaisld1');
13
+
14
+ $this->_countryTable = Mage::getSingleton('core/resource')->getTableName('directory/country');
15
+
16
+ $this->_regionTable = Mage::getSingleton('core/resource')->getTableName('directory/country_region');
17
+
18
+ $this->_select->from(array("s" => $this->_shipTable))
19
+ ->joinLeft(array("c" => $this->_countryTable), 'c.country_id = s.dest_country_id', 'iso3_code AS dest_country')
20
+ ->joinLeft(array("r" => $this->_regionTable), 'r.region_id = s.dest_region_id', 'code AS dest_region')
21
+ ->order(array("dest_country", "dest_region", "dest_zip"));
22
+
23
+ $this->_setIdFieldName('id');
24
+
25
+ return $this;
26
+ }
27
+
28
+ public function setWebsiteFilter($websiteId)
29
+ {
30
+ $this->_select->where("website_id = ?", $websiteId);
31
+
32
+ return $this;
33
+ }
34
+
35
+ public function setConditionFilter($conditionName)
36
+ {
37
+ $this->_select->where("condition_name = ?", $conditionName);
38
+
39
+ return $this;
40
+ }
41
+
42
+ public function setCountryFilter($countryId)
43
+ {
44
+ $this->_select->where("dest_country_id = ?", $countryId);
45
+
46
+ return $this;
47
+ }
48
+ }
app/code/community/MondialRelay/Pointsrelais/Model/Mysql4/Carrier/Pointsrelaislds.php ADDED
@@ -0,0 +1,369 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class MondialRelay_Pointsrelais_Model_Mysql4_Carrier_Pointsrelaislds extends Mage_Core_Model_Mysql4_Abstract
3
+ {
4
+ protected function _construct()
5
+ {
6
+ $this->_init('shipping/pointsrelaislds', 'pk');
7
+ }
8
+
9
+ public function getRate(Mage_Shipping_Model_Rate_Request $request)
10
+ {
11
+ $read = $this->_getReadAdapter();
12
+
13
+ $table = Mage::getSingleton('core/resource')->getTableName('mondialrelay_pointsrelaislds');
14
+
15
+ $select = $read->select()->from($table);
16
+
17
+ $select->where(
18
+ $read->quoteInto(" (dest_country_id=? ", $request->getDestCountryId()).
19
+ $read->quoteInto(" AND dest_region_id=? ", $request->getDestRegionId()).
20
+ $read->quoteInto(" AND dest_zip=?) ", $request->getDestPostcode()).
21
+
22
+ $read->quoteInto(" OR (dest_country_id=? ", $request->getDestCountryId()).
23
+ $read->quoteInto(" AND dest_region_id=? AND dest_zip='') ", $request->getDestRegionId()).
24
+
25
+ $read->quoteInto(" OR (dest_country_id=? AND dest_region_id='0' AND dest_zip='') ", $request->getDestCountryId()).
26
+
27
+ $read->quoteInto(" OR (dest_country_id=? AND dest_region_id='0' ", $request->getDestCountryId()).
28
+ $read->quoteInto(" AND dest_zip=?) ", $request->getDestPostcode()).
29
+
30
+ " OR (dest_country_id='0' AND dest_region_id='0' AND dest_zip='')"
31
+ );
32
+
33
+ if (is_array($request->getConditionName()))
34
+ {
35
+ $i = 0;
36
+
37
+ foreach ($request->getConditionName() as $conditionName)
38
+ {
39
+ if ($i == 0)
40
+ {
41
+ $select->where('condition_name=?', $conditionName);
42
+ }
43
+ else
44
+ {
45
+ $select->orWhere('condition_name=?', $conditionName);
46
+ }
47
+
48
+ $select->where('condition_value>=?', $request->getData($conditionName));
49
+ $i++;
50
+ }
51
+ }
52
+ else
53
+ {
54
+ $select->where('condition_name=?', $request->getConditionName());
55
+ $select->where('condition_value>=?', $request->getData($request->getConditionName()));
56
+ }
57
+
58
+ $select->where('website_id=?', $request->getWebsiteId());
59
+
60
+ $select->group('dest_zip');
61
+ $select->group('dest_region_id');
62
+ $select->group('dest_country_id');
63
+
64
+ $select->order('dest_zip DESC');
65
+ $select->order('dest_region_id DESC');
66
+ $select->order('dest_country_id DESC');
67
+
68
+ $select->order('condition_value ASC');
69
+
70
+ $rows = $read->fetchAll($select);
71
+
72
+ /*
73
+ * Check to see if any zip code or region specific rates exist.
74
+ */
75
+ $specific = array();
76
+ $failover = array();
77
+
78
+ $zipFound = $regionFound = false;
79
+
80
+ /*
81
+ * Most specific: Zip code.
82
+ * Check for any not null zip codes, which would mean that we have a specific shipping method for that zipcode
83
+ */
84
+ foreach($rows as $row)
85
+ {
86
+ if (!empty($row['dest_zip']))
87
+ {
88
+ $specific[] = $row;
89
+ $zipFound = true;
90
+ }
91
+ elseif (!empty($row['dest_region_id']) && $zipFound == false)
92
+ {
93
+ $specific[] = $row;
94
+ $regionFound = true;
95
+ }
96
+ elseif (!empty($row['dest_country_id']) && $zipFound == false && $regionFound == false)
97
+ {
98
+ $specific[] = $row;
99
+ }
100
+
101
+ if (empty($row['dest_country_id']) && empty($row['dest_region_id']) && empty($row['dest_zip']))
102
+ {
103
+ $failover[] = $row;
104
+ }
105
+ }
106
+
107
+ if (count($specific) > 0)
108
+ {
109
+ $rates = $specific;
110
+ }
111
+ else
112
+ {
113
+ $rates = $failover;
114
+ }
115
+
116
+ /*
117
+ * Great, we have something specific for the zip code or region, let's return just those
118
+ */
119
+
120
+ return $rates;
121
+ }
122
+
123
+ public function uploadAndImport(Varien_Object $object)
124
+ {
125
+ $csvFile = $_FILES["groups"]["tmp_name"]["pointsrelaislds"]["fields"]["import"]["value"];
126
+
127
+ if (!empty($csvFile))
128
+ {
129
+ $csv = trim(file_get_contents($csvFile));
130
+
131
+ $table = Mage::getSingleton('core/resource')->getTableName('mondialrelay_pointsrelaislds');
132
+
133
+ $websiteId = $object->getScopeId();
134
+
135
+ if (isset($_POST['groups']['pointsrelaislds']['fields']['condition_name']['inherit']))
136
+ {
137
+ $conditionName = (string)Mage::getConfig()->getNode('default/carriers/pointsrelaislds/condition_name');
138
+ }
139
+ else
140
+ {
141
+ $conditionName = $_POST['groups']['pointsrelaislds']['fields']['condition_name']['value'];
142
+ }
143
+
144
+ $conditionFullName = Mage::getModel('pointsrelais/carrier_pointsrelaislds')->getCode('condition_name_short', $conditionName);
145
+
146
+ if (!empty($csv))
147
+ {
148
+ $exceptions = array();
149
+ $csvLines = explode("\n", $csv);
150
+ $csvLine = array_shift($csvLines);
151
+ $csvLine = $this->_getCsvValues($csvLine);
152
+
153
+ if (count($csvLine) < 5)
154
+ {
155
+ $exceptions[0] = Mage::helper('shipping')->__('Invalid Table Rates File Format');
156
+ }
157
+
158
+ $countryCodes = array();
159
+ $regionCodes = array();
160
+
161
+ foreach ($csvLines as $k => $csvLine)
162
+ {
163
+ $csvLine = $this->_getCsvValues($csvLine);
164
+
165
+ if (count($csvLine) > 0 && count($csvLine) < 5)
166
+ {
167
+ $exceptions[0] = Mage::helper('shipping')->__('Invalid Table Rates File Format');
168
+ }
169
+ else
170
+ {
171
+ $countryCodes[] = $csvLine[0];
172
+ $regionCodes[] = $csvLine[1];
173
+ }
174
+ }
175
+
176
+ if (empty($exceptions))
177
+ {
178
+ $data = array();
179
+ $countryCodesToIds = array();
180
+ $regionCodesToIds = array();
181
+ $countryCodesIso2 = array();
182
+
183
+ $countryCollection = Mage::getResourceModel('directory/country_collection')->addCountryCodeFilter($countryCodes)->load();
184
+
185
+ foreach ($countryCollection->getItems() as $country)
186
+ {
187
+ $countryCodesToIds[$country->getData('iso3_code')] = $country->getData('country_id');
188
+ $countryCodesToIds[$country->getData('iso2_code')] = $country->getData('country_id');
189
+ $countryCodesIso2[] = $country->getData('iso2_code');
190
+ }
191
+
192
+ $regionCollection = Mage::getResourceModel('directory/region_collection')
193
+ ->addRegionCodeFilter($regionCodes)
194
+ ->addCountryFilter($countryCodesIso2)
195
+ ->load();
196
+
197
+ foreach ($regionCollection->getItems() as $region)
198
+ {
199
+ $regionCodesToIds[$countryCodesToIds[$region->getData('country_id')]][$region->getData('code')] = $region->getData('region_id');
200
+ }
201
+
202
+ foreach ($csvLines as $k => $csvLine)
203
+ {
204
+
205
+ $csvLine = $this->_getCsvValues($csvLine);
206
+
207
+ /*
208
+ * Column 1 - Country
209
+ */
210
+ if (empty($countryCodesToIds) || !array_key_exists($csvLine[0], $countryCodesToIds))
211
+ {
212
+ $countryId = '0';
213
+
214
+ if ($csvLine[0] != '*' && $csvLine[0] != '')
215
+ {
216
+ $exceptions[] = Mage::helper('shipping')->__('Invalid Country "%s" in the Row #%s', $csvLine[0], ($k+1));
217
+ }
218
+ }
219
+ else
220
+ {
221
+ $countryId = $countryCodesToIds[$csvLine[0]];
222
+ }
223
+
224
+
225
+ /*
226
+ * Column 2 - Region/State
227
+ */
228
+ # if (empty($regionCodesToIds[$countryCodesToIds[$csvLine[0]]]) || !array_key_exists($csvLine[1], $regionCodesToIds[$countryCodesToIds[$csvLine[0]]]))
229
+ if ($countryId == '0')
230
+ {
231
+ $regionId = '0';
232
+ }
233
+ else
234
+ {
235
+ if (empty($regionCodesToIds[$countryCodesToIds[$csvLine[0]]]) || !array_key_exists($csvLine[1], $regionCodesToIds[$countryCodesToIds[$csvLine[0]]]))
236
+ {
237
+ $regionId = '0';
238
+
239
+ if ($csvLine[1] != '*' && $csvLine[1] != '')
240
+ {
241
+ $exceptions[] = Mage::helper('shipping')->__('Invalid Region/State "%s" in the Row #%s', $csvLine[1], ($k+1));
242
+ }
243
+ }
244
+ else
245
+ {
246
+ $regionId = $regionCodesToIds[$countryCodesToIds[$csvLine[0]]][$csvLine[1]];
247
+ }
248
+ }
249
+ /*
250
+ * Column 3 - Zip/Postal Code
251
+ */
252
+ if ($csvLine[2] == '*' || $csvLine[2] == '')
253
+ {
254
+ $zip = '';
255
+ }
256
+ else
257
+ {
258
+ $zip = $csvLine[2];
259
+ }
260
+
261
+ /*
262
+ * Column 4 - Order Subtotal
263
+ */
264
+ if (!$this->_isPositiveDecimalNumber($csvLine[3]) || $csvLine[3] == '*' || $csvLine[3] == '')
265
+ {
266
+ $exceptions[] = Mage::helper('shipping')->__('Invalid %s "%s" in the Row #%s', $conditionFullName, $csvLine[3], ($k+1));
267
+ }
268
+ else
269
+ {
270
+ $csvLine[3] = (float)$csvLine[3];
271
+ }
272
+
273
+ /*
274
+ * Column 5 - Shipping Price
275
+ */
276
+ if (!$this->_isPositiveDecimalNumber($csvLine[4]))
277
+ {
278
+ $exceptions[] = Mage::helper('shipping')->__('Invalid Shipping Price "%s" in the Row #%s', $csvLine[4], ($k+1));
279
+ }
280
+ else
281
+ {
282
+ $csvLine[4] = (float)$csvLine[4];
283
+ }
284
+
285
+ $data[] = array(
286
+ 'website_id' => $websiteId,
287
+ 'dest_country_id' => $countryId,
288
+ 'dest_region_id' => $regionId,
289
+ 'dest_zip' => $zip,
290
+ 'condition_name' => $conditionName,
291
+ 'condition_value' => $csvLine[3],
292
+ 'price' => $csvLine[4],
293
+ );
294
+ }
295
+ }
296
+
297
+ if (empty($exceptions))
298
+ {
299
+ $connection = $this->_getWriteAdapter();
300
+
301
+ $condition = array(
302
+ $connection->quoteInto('website_id = ?', $websiteId),
303
+ $connection->quoteInto('condition_name = ?', $conditionName),
304
+ );
305
+
306
+ $connection->delete($table, $condition);
307
+
308
+ foreach($data as $k=>$dataLine)
309
+ {
310
+ try
311
+ {
312
+ $connection->insert($table, $dataLine);
313
+ }
314
+ catch (Exception $e)
315
+ {
316
+ // This should probably show the exception message too.
317
+ $exceptions[] = Mage::helper('shipping')->__('Import error: ' . $e->getMessage());
318
+ }
319
+ }
320
+ }
321
+
322
+ if (!empty($exceptions))
323
+ {
324
+ throw new Exception( "\n" . implode("\n", $exceptions) );
325
+ }
326
+ }
327
+ }
328
+ }
329
+
330
+ protected function _getCsvValues($string, $separator=",")
331
+ {
332
+ $elements = explode($separator, trim($string));
333
+
334
+ for ($i = 0; $i < count($elements); $i++)
335
+ {
336
+ $nquotes = substr_count($elements[$i], '"');
337
+
338
+ if ($nquotes %2 == 1)
339
+ {
340
+ for ($j = $i+1; $j < count($elements); $j++)
341
+ {
342
+ if (substr_count($elements[$j], '"') > 0)
343
+ {
344
+ // Put the quoted string's pieces back together again
345
+ array_splice($elements, $i, $j-$i+1, implode($separator, array_slice($elements, $i, $j-$i+1)));
346
+ break;
347
+ }
348
+ }
349
+ }
350
+
351
+ if ($nquotes > 0)
352
+ {
353
+ // Remove first and last quotes, then merge pairs of quotes
354
+ $qstr =& $elements[$i];
355
+ $qstr = substr_replace($qstr, '', strpos($qstr, '"'), 1);
356
+ $qstr = substr_replace($qstr, '', strrpos($qstr, '"'), 1);
357
+ $qstr = str_replace('""', '"', $qstr);
358
+ }
359
+ $elements[$i] = trim($elements[$i]);
360
+ }
361
+ return $elements;
362
+ }
363
+
364
+ protected function _isPositiveDecimalNumber($n)
365
+ {
366
+ return preg_match ("/^[0-9]+(\.[0-9]*)?$/", $n);
367
+ }
368
+
369
+ }
app/code/community/MondialRelay/Pointsrelais/Model/Mysql4/Carrier/Pointsrelaislds/Collection.php ADDED
@@ -0,0 +1,48 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class MondialRelay_Pointsrelais_Model_Mysql4_Carrier_Pointsrelaislds_Collection extends Varien_Data_Collection_Db
3
+ {
4
+ protected $_shipTable;
5
+ protected $_countryTable;
6
+ protected $_regionTable;
7
+
8
+ public function __construct()
9
+ {
10
+ parent::__construct(Mage::getSingleton('core/resource')->getConnection('shipping_read'));
11
+
12
+ $this->_shipTable = Mage::getSingleton('core/resource')->getTableName('mondialrelay_pointsrelaislds');
13
+
14
+ $this->_countryTable = Mage::getSingleton('core/resource')->getTableName('directory/country');
15
+
16
+ $this->_regionTable = Mage::getSingleton('core/resource')->getTableName('directory/country_region');
17
+
18
+ $this->_select->from(array("s" => $this->_shipTable))
19
+ ->joinLeft(array("c" => $this->_countryTable), 'c.country_id = s.dest_country_id', 'iso3_code AS dest_country')
20
+ ->joinLeft(array("r" => $this->_regionTable), 'r.region_id = s.dest_region_id', 'code AS dest_region')
21
+ ->order(array("dest_country", "dest_region", "dest_zip"));
22
+
23
+ $this->_setIdFieldName('id');
24
+
25
+ return $this;
26
+ }
27
+
28
+ public function setWebsiteFilter($websiteId)
29
+ {
30
+ $this->_select->where("website_id = ?", $websiteId);
31
+
32
+ return $this;
33
+ }
34
+
35
+ public function setConditionFilter($conditionName)
36
+ {
37
+ $this->_select->where("condition_name = ?", $conditionName);
38
+
39
+ return $this;
40
+ }
41
+
42
+ public function setCountryFilter($countryId)
43
+ {
44
+ $this->_select->where("dest_country_id = ?", $countryId);
45
+
46
+ return $this;
47
+ }
48
+ }
app/code/community/MondialRelay/Pointsrelais/Model/System/Config/Backend/Shipping/Pointsrelaisld1.php ADDED
@@ -0,0 +1,8 @@
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class MondialRelay_Pointsrelais_Model_System_Config_Backend_Shipping_Pointsrelaisld1 extends Mage_Core_Model_Config_Data
3
+ {
4
+ public function _afterSave()
5
+ {
6
+ Mage::getResourceModel('pointsrelais/carrier_pointsrelaisld1')->uploadAndImport($this);
7
+ }
8
+ }
app/code/community/MondialRelay/Pointsrelais/Model/System/Config/Backend/Shipping/Pointsrelaislds.php ADDED
@@ -0,0 +1,8 @@
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class MondialRelay_Pointsrelais_Model_System_Config_Backend_Shipping_Pointsrelaislds extends Mage_Core_Model_Config_Data
3
+ {
4
+ public function _afterSave()
5
+ {
6
+ Mage::getResourceModel('pointsrelais/carrier_pointsrelaislds')->uploadAndImport($this);
7
+ }
8
+ }
app/code/community/MondialRelay/Pointsrelais/Model/System/Config/Source/Shipping/Pointsrelaisld1.php ADDED
@@ -0,0 +1,15 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class MondialRelay_Pointsrelais_Model_System_Config_Source_Shipping_Pointsrelaisld1
3
+ {
4
+ public function toOptionArray()
5
+ {
6
+ $tableRate = Mage::getSingleton('pointsrelais/carrier_pointsrelaisld1');
7
+ $arr = array();
8
+
9
+ foreach ($tableRate->getCode('condition_name') as $k=>$v)
10
+ {
11
+ $arr[] = array('value'=>$k, 'label'=>$v);
12
+ }
13
+ return $arr;
14
+ }
15
+ }
app/code/community/MondialRelay/Pointsrelais/Model/System/Config/Source/Shipping/Pointsrelaislds.php ADDED
@@ -0,0 +1,15 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class MondialRelay_Pointsrelais_Model_System_Config_Source_Shipping_Pointsrelaislds
3
+ {
4
+ public function toOptionArray()
5
+ {
6
+ $tableRate = Mage::getSingleton('pointsrelais/carrier_pointsrelaislds');
7
+ $arr = array();
8
+
9
+ foreach ($tableRate->getCode('condition_name') as $k=>$v)
10
+ {
11
+ $arr[] = array('value'=>$k, 'label'=>$v);
12
+ }
13
+ return $arr;
14
+ }
15
+ }
app/code/community/MondialRelay/Pointsrelais/controllers/Sales/Order/ShipmentController.php CHANGED
@@ -123,6 +123,79 @@ class MondialRelay_Pointsrelais_Sales_Order_ShipmentController extends Mage_Admi
123
  // Et on effectue la requète
124
  $expedition = $client->WSI2_CreationExpedition($params)->WSI2_CreationExpeditionResult;
125
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
126
  Mage::Log('WSI2_CreationExpeditionResult : '.($expedition->STAT));
127
  $track = Mage::getModel('sales/order_shipment_track')
128
  ->setNumber($expedition->ExpeditionNum)
@@ -148,8 +221,8 @@ class MondialRelay_Pointsrelais_Sales_Order_ShipmentController extends Mage_Admi
148
  $this->_getSession()->addSuccess($this->__('Shipment was successfully created.'));
149
  $this->_redirect('adminhtml/sales_order/view', array('order_id' => $shipment->getOrderId()));
150
  return;
151
- }
152
- else {
153
  $this->_forward('noRoute');
154
  return;
155
  }
@@ -163,6 +236,54 @@ class MondialRelay_Pointsrelais_Sales_Order_ShipmentController extends Mage_Admi
163
  $this->_redirect('*/*/new', array('order_id' => $this->getRequest()->getParam('order_id')));
164
  }
165
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
166
  Function removeaccents($string){
167
  $stringToReturn = str_replace(
168
  array('�','�','�','�','�', '�', '�','�','�','�', '�','�','�','�', '�', '�','�','�','�','�', '�','�','�','�', '�','�', '�','�','�','�','�', '�', '�','�','�','�', '�','�','�','�', '�', '�','�','�','�','�', '�','�','�','�', '�','/','\xa8'),
123
  // Et on effectue la requète
124
  $expedition = $client->WSI2_CreationExpedition($params)->WSI2_CreationExpeditionResult;
125
 
126
+ Mage::Log('WSI2_CreationExpeditionResult : '.($expedition->STAT));
127
+ $track = Mage::getModel('sales/order_shipment_track')
128
+ ->setNumber($expedition->ExpeditionNum)
129
+ ->setCarrier('Mondial Relay')
130
+ ->setCarrierCode($_shippingMethod[0])
131
+ ->setTitle('Mondial Relay')
132
+ ->setPopup(1);
133
+ $shipment->addTrack($track);
134
+ }else if (($_shippingMethod[0] == 'pointsrelaisld1') || ($_shippingMethod[0] == 'pointsrelaislds')) {
135
+
136
+ // On met en place les paramètres de la requète
137
+
138
+ $adress = $_order->getShippingAddress()->getStreet();
139
+ if (!isset($adress[1]))
140
+ {
141
+ $adress[1] = '';
142
+ }
143
+ $package_weightTmp = $_order->getWeight()*1000;
144
+ $ModeLiv = 'LDR';
145
+ if(($_shippingMethod[0] == 'pointsrelaislds')){
146
+ $ModeLiv = 'LDS';
147
+ }
148
+
149
+ $packageTmp = $this->getPackage($_order,$ModeLiv);
150
+
151
+ $params = array(
152
+ 'Enseigne' => $this->getConfigData('enseigne'),
153
+ 'ModeCol' => 'CCC',
154
+ 'ModeLiv' => $ModeLiv,
155
+ 'Expe_Langage' => 'FR',
156
+ 'Expe_Ad1' => trim($this->removeaccents($this->getConfigData('adresse1_enseigne'))),
157
+ 'Expe_Ad3' => trim($this->removeaccents($this->getConfigData('adresse3_enseigne'))),
158
+ 'Expe_Ad4' => trim($this->removeaccents($this->getConfigData('adresse4_enseigne'))),
159
+ 'Expe_Ville' => trim($this->removeaccents($this->getConfigData('ville_enseigne'))),
160
+ 'Expe_CP' => $this->getConfigData('cp_enseigne'),
161
+ 'Expe_Pays' => trim($this->removeaccents($this->getConfigData('pays_enseigne'))),
162
+ 'Expe_Tel1' => '',
163
+ 'Expe_Tel2' => '',
164
+ 'Expe_Mail' => $this->getConfigData('mail_enseigne'),
165
+ 'Dest_Langage' => 'FR',
166
+ 'Dest_Ad1' => trim($this->removeaccents($_order->getShippingAddress()->getFirstname() . ' ' . $_order->getShippingAddress()->getLastname())),
167
+ 'Dest_Ad2' => trim($this->removeaccents($_order->getShippingAddress()->getCompagny())),
168
+ 'Dest_Ad3' => trim($this->removeaccents($adress[0])),
169
+ 'Dest_Ad4' => trim($this->removeaccents($adress[1])),
170
+ 'Dest_Ville' => trim($this->removeaccents($_order->getShippingAddress()->getCity())),
171
+ 'Dest_CP' => $_order->getShippingAddress()->getPostcode(),
172
+ 'Dest_Pays' => trim($this->removeaccents($_order->getShippingAddress()->getCountryId())),
173
+ 'Dest_Tel1' => trim($this->removeaccents($_order->getShippingAddress()->getTelephone())),
174
+ 'Dest_Mail' => $_order->getCustomerEmail(),
175
+ 'Poids' => $package_weightTmp,
176
+ 'NbColis' => $packageTmp[0],
177
+ 'CRT_Valeur' => '0'
178
+ );
179
+ //On crée le code de sécurité
180
+
181
+ $select = "";
182
+ foreach($params as $key => $value){
183
+ $select .= "\t".'<option value="'.$key.'">' . $value.'</option>'."\r\n";
184
+ }
185
+ Mage::Log('WSI2_CreationExpeditionResult$params : '.($select));
186
+
187
+ $code = implode("",$params);
188
+ $code .= $this->getConfigData('cle');
189
+
190
+ //On le rajoute aux paramètres
191
+ $params["Security"] = strtoupper(md5($code));
192
+
193
+ // On se connecte
194
+ $client = new SoapClient("http://www.mondialrelay.fr/WebService/Web_Services.asmx?WSDL");
195
+
196
+ // Et on effectue la requète
197
+ $expedition = $client->WSI2_CreationExpedition($params)->WSI2_CreationExpeditionResult;
198
+
199
  Mage::Log('WSI2_CreationExpeditionResult : '.($expedition->STAT));
200
  $track = Mage::getModel('sales/order_shipment_track')
201
  ->setNumber($expedition->ExpeditionNum)
221
  $this->_getSession()->addSuccess($this->__('Shipment was successfully created.'));
222
  $this->_redirect('adminhtml/sales_order/view', array('order_id' => $shipment->getOrderId()));
223
  return;
224
+
225
+ }else {
226
  $this->_forward('noRoute');
227
  return;
228
  }
236
  $this->_redirect('*/*/new', array('order_id' => $this->getRequest()->getParam('order_id')));
237
  }
238
 
239
+ Function getPackage($_order,$shipmentType){
240
+ $nbtoreturn = 1;
241
+ $totalLength = 0;
242
+ $length = 0;
243
+ $weight = 0;
244
+ $lengthTmp = 0;
245
+ $weightTmp = 0;
246
+ $decrementFlag = false;
247
+ foreach ($_order->getAllItems() as $item) {
248
+ if($decrementFlag){
249
+ $length += $lengthTmp;
250
+ $weight += $weightTmp;
251
+ $decrementFlag = false;
252
+ }
253
+ if ($productId = $item->getProductId()) {
254
+ $product = Mage::getModel('catalog/product')->load($productId);
255
+ if($product->getDevelopedLength()){
256
+ $length += $product->getDevelopedLength();
257
+ $lengthTmp = $product->getDevelopedLength();
258
+ $totalLength += $product->getDevelopedLength();
259
+ }else{
260
+ $length += $this->getConfigData('default_developed_length');
261
+ $lengthTmp = $this->getConfigData('default_developed_length');
262
+ $totalLength += $this->getConfigData('default_developed_length');
263
+ }
264
+ $weight += $product->getWeight();
265
+
266
+ if($shipmentType == 'LDS'){
267
+ if(($weightTmp > 130) || ($lengthTmp > 450)){
268
+ $decrementFlag = true;
269
+ $nbtoreturn++;
270
+ $length = 0;
271
+ $weight = 0;
272
+ }
273
+ }else{
274
+ if(($weightTmp > 60) || ($lengthTmp > 250)){
275
+ $decrementFlag = true;
276
+ $nbtoreturn++;
277
+ $length = 0;
278
+ $weight = 0;
279
+ }
280
+
281
+ }
282
+ }
283
+ }
284
+ return array($nbtoreturn,$totalLength);
285
+ }
286
+
287
  Function removeaccents($string){
288
  $stringToReturn = str_replace(
289
  array('�','�','�','�','�', '�', '�','�','�','�', '�','�','�','�', '�', '�','�','�','�','�', '�','�','�','�', '�','�', '�','�','�','�','�', '�', '�','�','�','�', '�','�','�','�', '�', '�','�','�','�','�', '�','�','�','�', '�','/','\xa8'),
app/code/community/MondialRelay/Pointsrelais/controllers/System/ConfigController.php CHANGED
@@ -12,20 +12,35 @@ class MondialRelay_Pointsrelais_System_ConfigController extends Mage_Adminhtml_C
12
  }
13
 
14
  public function exportAction()
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
15
  {
16
  $websiteModel = Mage::app()->getWebsite($this->getRequest()->getParam('website'));
17
 
18
- $conditionName = $websiteModel->getConfig('carriers/pointsrelais/condition_name');
19
 
20
- Mage::log($conditionName);
21
- $tableratesCollection = Mage::getResourceModel('pointsrelais/carrier_pointsrelais_collection');
22
  $tableratesCollection->setConditionFilter($conditionName);
23
  $tableratesCollection->setWebsiteFilter($websiteModel->getId());
24
  $tableratesCollection->load();
25
 
26
  $csv = '';
27
 
28
- $conditionName = Mage::getModel('pointsrelais/carrier_pointsrelais')->getCode('condition_name_short', $conditionName);
29
 
30
  $csvHeader = array(
31
  '"'.Mage::helper('adminhtml')->__('Country').'"',
12
  }
13
 
14
  public function exportAction()
15
+ {
16
+ $this->exportCSV();
17
+ }
18
+
19
+ public function exportld1Action()
20
+ {
21
+ $this->exportCSV('pointsrelais/carrier_pointsrelaisld1');
22
+ }
23
+
24
+ public function exportldsAction()
25
+ {
26
+ $this->exportCSV('pointsrelais/carrier_pointsrelaislds');
27
+ }
28
+
29
+ public function exportCSV($class = 'pointsrelais/carrier_pointsrelais')
30
  {
31
  $websiteModel = Mage::app()->getWebsite($this->getRequest()->getParam('website'));
32
 
33
+ $conditionName = $this->getRequest()->getParam('conditionName');
34
 
35
+ Mage::log('conditionName : '.$conditionName);
36
+ $tableratesCollection = Mage::getResourceModel($class.'_collection');
37
  $tableratesCollection->setConditionFilter($conditionName);
38
  $tableratesCollection->setWebsiteFilter($websiteModel->getId());
39
  $tableratesCollection->load();
40
 
41
  $csv = '';
42
 
43
+ $conditionName = Mage::getModel($class)->getCode('condition_name_short', $conditionName);
44
 
45
  $csvHeader = array(
46
  '"'.Mage::helper('adminhtml')->__('Country').'"',
app/code/community/MondialRelay/Pointsrelais/etc/config.xml CHANGED
@@ -2,7 +2,7 @@
2
  <config>
3
  <modules>
4
  <MondialRelay_Pointsrelais>
5
- <version>1.0.8</version>
6
  <depends>
7
  <Mage_Adminhtml />
8
  <Mage_Shipping />
@@ -19,13 +19,29 @@
19
  <specificerrmsg>L'expédition en Points Relais n'est pour le moment pas disponible. Si vous avez des questions concernant ce mode de livraison, merci de nous contacter.</specificerrmsg>
20
  <handling_type>F</handling_type>
21
  </pointsrelais>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
22
  </carriers>
23
  </default>
24
  <global>
25
  <models>
26
  <pointsrelais>
27
  <class>MondialRelay_Pointsrelais_Model</class>
28
- <resourceModel>pointsrelais_mysql4</resourceModel>
29
  </pointsrelais>
30
  <pointsrelais_mysql4>
31
  <class>MondialRelay_Pointsrelais_Model_Mysql4</class>
@@ -33,14 +49,24 @@
33
  <pointsrelais>
34
  <table>mondialrelay_pointsrelais</table>
35
  </pointsrelais>
 
 
 
 
 
 
36
  </entities>
37
  </pointsrelais_mysql4>
38
  <adminhtml>
39
  <rewrite>
40
  <system_config_source_shipping_pointsrelais>MondialRelay_Pointsrelais_Model_System_Config_Source_Shipping_Pointsrelais</system_config_source_shipping_pointsrelais>
41
- </rewrite>
42
- <rewrite>
43
  <system_config_backend_shipping_pointsrelais>MondialRelay_Pointsrelais_Model_System_Config_Backend_Shipping_Pointsrelais</system_config_backend_shipping_pointsrelais>
 
 
 
 
 
 
44
  </rewrite>
45
  </adminhtml>
46
  </models>
@@ -60,11 +86,22 @@
60
  <pointsrelais_setup>
61
  <setup>
62
  <module>MondialRelay_Pointsrelais</module>
 
63
  </setup>
64
  <connection>
65
  <use>core_setup</use>
66
  </connection>
67
  </pointsrelais_setup>
 
 
 
 
 
 
 
 
 
 
68
  </resources>
69
  <helpers>
70
  <pointsrelais>
2
  <config>
3
  <modules>
4
  <MondialRelay_Pointsrelais>
5
+ <version>1.2.1</version>
6
  <depends>
7
  <Mage_Adminhtml />
8
  <Mage_Shipping />
19
  <specificerrmsg>L'expédition en Points Relais n'est pour le moment pas disponible. Si vous avez des questions concernant ce mode de livraison, merci de nous contacter.</specificerrmsg>
20
  <handling_type>F</handling_type>
21
  </pointsrelais>
22
+ <pointsrelaisld1>
23
+ <active>0</active>
24
+ <model>pointsrelais/carrier_pointsrelaisld1</model>
25
+ <title>Mondial Relay - Livraison à Domicile</title>
26
+ <description>Mondial Relay - Livraison à Domicile</description>
27
+ <specificerrmsg>L'expédition en Points Relais n'est pour le moment pas disponible. Si vous avez des questions concernant ce mode de livraison, merci de nous contacter.</specificerrmsg>
28
+ <default_developed_length>10</default_developed_length>
29
+ </pointsrelaisld1>
30
+ <pointsrelaislds>
31
+ <active>0</active>
32
+ <model>pointsrelais/carrier_pointsrelaislds</model>
33
+ <title>Mondial Relay - Livraison à Domicile spécialisé</title>
34
+ <description>Mondial Relay - Livraison à Domicile spécialisé</description>
35
+ <specificerrmsg>L'expédition en Points Relais n'est pour le moment pas disponible. Si vous avez des questions concernant ce mode de livraison, merci de nous contacter.</specificerrmsg>
36
+ <default_developed_length>10</default_developed_length>
37
+ </pointsrelaislds>
38
  </carriers>
39
  </default>
40
  <global>
41
  <models>
42
  <pointsrelais>
43
  <class>MondialRelay_Pointsrelais_Model</class>
44
+ <resourceModel>pointsrelais_mysql4</resourceModel>
45
  </pointsrelais>
46
  <pointsrelais_mysql4>
47
  <class>MondialRelay_Pointsrelais_Model_Mysql4</class>
49
  <pointsrelais>
50
  <table>mondialrelay_pointsrelais</table>
51
  </pointsrelais>
52
+ <pointsrelaisld1>
53
+ <table>mondialrelay_pointsrelaisld1</table>
54
+ </pointsrelaisld1>
55
+ <pointsrelaislds>
56
+ <table>mondialrelay_pointsrelaislds</table>
57
+ </pointsrelaislds>
58
  </entities>
59
  </pointsrelais_mysql4>
60
  <adminhtml>
61
  <rewrite>
62
  <system_config_source_shipping_pointsrelais>MondialRelay_Pointsrelais_Model_System_Config_Source_Shipping_Pointsrelais</system_config_source_shipping_pointsrelais>
 
 
63
  <system_config_backend_shipping_pointsrelais>MondialRelay_Pointsrelais_Model_System_Config_Backend_Shipping_Pointsrelais</system_config_backend_shipping_pointsrelais>
64
+
65
+ <system_config_source_shipping_pointsrelaisld1>MondialRelay_Pointsrelais_Model_System_Config_Source_Shipping_Pointsrelaisld1</system_config_source_shipping_pointsrelaisld1>
66
+ <system_config_backend_shipping_pointsrelaisld1>MondialRelay_Pointsrelais_Model_System_Config_Backend_Shipping_Pointsrelaisld1</system_config_backend_shipping_pointsrelaisld1>
67
+
68
+ <system_config_source_shipping_pointsrelaislds>MondialRelay_Pointsrelais_Model_System_Config_Source_Shipping_Pointsrelaislds</system_config_source_shipping_pointsrelaislds>
69
+ <system_config_backend_shipping_pointsrelaislds>MondialRelay_Pointsrelais_Model_System_Config_Backend_Shipping_Pointsrelaislds</system_config_backend_shipping_pointsrelaislds>
70
  </rewrite>
71
  </adminhtml>
72
  </models>
86
  <pointsrelais_setup>
87
  <setup>
88
  <module>MondialRelay_Pointsrelais</module>
89
+ <class>Mage_Catalog_Model_Resource_Eav_Mysql4_Setup</class>
90
  </setup>
91
  <connection>
92
  <use>core_setup</use>
93
  </connection>
94
  </pointsrelais_setup>
95
+ <pointsrelais_write>
96
+ <connection>
97
+ <use>core_write</use>
98
+ </connection>
99
+ </pointsrelais_write>
100
+ <pointsrelais_read>
101
+ <connection>
102
+ <use>core_read</use>
103
+ </connection>
104
+ </pointsrelais_read>
105
  </resources>
106
  <helpers>
107
  <pointsrelais>
app/code/community/MondialRelay/Pointsrelais/etc/system.xml CHANGED
@@ -236,6 +236,526 @@
236
  </sort_order>
237
  </fields>
238
  </pointsrelais>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
239
  </groups>
240
  </carriers>
241
  </sections>
236
  </sort_order>
237
  </fields>
238
  </pointsrelais>
239
+ <pointsrelaisld1 translate="label" module="shipping">
240
+ <label>Mondial Relay - Livraison a domicile</label>
241
+ <frontend_type>text</frontend_type>
242
+ <sort_order>1</sort_order>
243
+ <show_in_default>1</show_in_default>
244
+ <show_in_website>1</show_in_website>
245
+ <show_in_store>1</show_in_store>
246
+ <fields>
247
+ <active translate="label">
248
+ <label>Enabled</label>
249
+ <frontend_type>select</frontend_type>
250
+ <source_model>adminhtml/system_config_source_yesno</source_model>
251
+ <sort_order>1</sort_order>
252
+ <show_in_default>1</show_in_default>
253
+ <show_in_website>1</show_in_website>
254
+ <show_in_store>1</show_in_store>
255
+ </active>
256
+ <enseigne translate="label">
257
+ <label>Enseigne</label>
258
+ <frontend_type>text</frontend_type>
259
+ <sort_order>2</sort_order>
260
+ <show_in_default>1</show_in_default>
261
+ <show_in_website>1</show_in_website>
262
+ <show_in_store>1</show_in_store>
263
+ </enseigne>
264
+ <marque translate="label">
265
+ <label>Référence de marque (Web service)</label>
266
+ <frontend_type>text</frontend_type>
267
+ <sort_order>3</sort_order>
268
+ <show_in_default>1</show_in_default>
269
+ <show_in_website>1</show_in_website>
270
+ <show_in_store>1</show_in_store>
271
+ </marque>
272
+ <cle translate="label">
273
+ <label>Clé (Web service)</label>
274
+ <frontend_type>text</frontend_type>
275
+ <sort_order>4</sort_order>
276
+ <show_in_default>1</show_in_default>
277
+ <show_in_website>1</show_in_website>
278
+ <show_in_store>1</show_in_store>
279
+ </cle>
280
+ <marque_url translate="label">
281
+ <label>Référence de marque (tracking)</label>
282
+ <frontend_type>text</frontend_type>
283
+ <sort_order>5</sort_order>
284
+ <show_in_default>1</show_in_default>
285
+ <show_in_website>1</show_in_website>
286
+ <show_in_store>1</show_in_store>
287
+ </marque_url>
288
+ <cle_url translate="label">
289
+ <label>Clé (tracking)</label>
290
+ <frontend_type>text</frontend_type>
291
+ <sort_order>6</sort_order>
292
+ <show_in_default>1</show_in_default>
293
+ <show_in_website>1</show_in_website>
294
+ <show_in_store>1</show_in_store>
295
+ </cle_url>
296
+ <adresse1_enseigne translate="label">
297
+ <label>Nom de l'expéditeur</label>
298
+ <comment>Sans accent svp...</comment>
299
+ <frontend_type>text</frontend_type>
300
+ <sort_order>7</sort_order>
301
+ <show_in_default>1</show_in_default>
302
+ <show_in_website>1</show_in_website>
303
+ <show_in_store>1</show_in_store>
304
+ </adresse1_enseigne>
305
+ <adresse3_enseigne translate="label">
306
+ <label>Adresse de l'expéditeur</label>
307
+ <frontend_type>text</frontend_type>
308
+ <sort_order>8</sort_order>
309
+ <show_in_default>1</show_in_default>
310
+ <show_in_website>1</show_in_website>
311
+ <show_in_store>1</show_in_store>
312
+ </adresse3_enseigne>
313
+ <adresse4_enseigne translate="label">
314
+ <label>Complément d'adresse</label>
315
+ <frontend_type>text</frontend_type>
316
+ <sort_order>9</sort_order>
317
+ <show_in_default>1</show_in_default>
318
+ <show_in_website>1</show_in_website>
319
+ <show_in_store>1</show_in_store>
320
+ </adresse4_enseigne>
321
+ <adresse4_enseigne translate="label">
322
+ <label>Complément d'adresse</label>
323
+ <frontend_type>text</frontend_type>
324
+ <sort_order>10</sort_order>
325
+ <show_in_default>1</show_in_default>
326
+ <show_in_website>1</show_in_website>
327
+ <show_in_store>1</show_in_store>
328
+ </adresse4_enseigne>
329
+ <cp_enseigne translate="label">
330
+ <label>Code postal</label>
331
+ <frontend_type>text</frontend_type>
332
+ <sort_order>11</sort_order>
333
+ <show_in_default>1</show_in_default>
334
+ <show_in_website>1</show_in_website>
335
+ <show_in_store>1</show_in_store>
336
+ </cp_enseigne>
337
+ <ville_enseigne translate="label">
338
+ <label>Ville de l'expéditeur</label>
339
+ <frontend_type>text</frontend_type>
340
+ <sort_order>12</sort_order>
341
+ <show_in_default>1</show_in_default>
342
+ <show_in_website>1</show_in_website>
343
+ <show_in_store>1</show_in_store>
344
+ </ville_enseigne>
345
+ <pays_enseigne translate="label">
346
+ <label>Code Pays de l'expéditeur</label>
347
+ <comment>FR, BE, etc...</comment>
348
+ <frontend_type>text</frontend_type>
349
+ <sort_order>13</sort_order>
350
+ <show_in_default>1</show_in_default>
351
+ <show_in_website>1</show_in_website>
352
+ <show_in_store>1</show_in_store>
353
+ </pays_enseigne>
354
+ <tel_enseigne translate="label">
355
+ <label>Téléphone</label>
356
+ <frontend_type>text</frontend_type>
357
+ <sort_order>14</sort_order>
358
+ <show_in_default>1</show_in_default>
359
+ <show_in_website>1</show_in_website>
360
+ <show_in_store>1</show_in_store>
361
+ </tel_enseigne>
362
+ <mobile_enseigne translate="label">
363
+ <label>Mobile</label>
364
+ <comment>Facultatif</comment>
365
+ <frontend_type>text</frontend_type>
366
+ <sort_order>15</sort_order>
367
+ <show_in_default>1</show_in_default>
368
+ <show_in_website>1</show_in_website>
369
+ <show_in_store>1</show_in_store>
370
+ </mobile_enseigne>
371
+ <mail_enseigne translate="label">
372
+ <label>E-mail</label>
373
+ <comment>Facultatif</comment>
374
+ <frontend_type>text</frontend_type>
375
+ <sort_order>16</sort_order>
376
+ <show_in_default>1</show_in_default>
377
+ <show_in_website>1</show_in_website>
378
+ <show_in_store>1</show_in_store>
379
+ </mail_enseigne>
380
+ <title translate="label">
381
+ <label>title</label>
382
+ <comment>Facultatif</comment>
383
+ <frontend_type>text</frontend_type>
384
+ <sort_order>17</sort_order>
385
+ <show_in_default>1</show_in_default>
386
+ <show_in_website>1</show_in_website>
387
+ <show_in_store>1</show_in_store>
388
+ </title>
389
+ <description translate="label">
390
+ <label>Description</label>
391
+ <comment>Facultatif</comment>
392
+ <frontend_type>text</frontend_type>
393
+ <sort_order>18</sort_order>
394
+ <show_in_default>1</show_in_default>
395
+ <show_in_website>1</show_in_website>
396
+ <show_in_store>1</show_in_store>
397
+ </description>
398
+ <handling_type translate="label">
399
+ <label>Calculate Handling Fee</label>
400
+ <frontend_type>select</frontend_type>
401
+ <source_model>shipping/source_handlingType</source_model>
402
+ <sort_order>20</sort_order>
403
+ <show_in_default>1</show_in_default>
404
+ <show_in_website>1</show_in_website>
405
+ <show_in_store>0</show_in_store>
406
+ </handling_type>
407
+ <handling_fee translate="label">
408
+ <label>Handling Fee</label>
409
+ <frontend_type>text</frontend_type>
410
+ <sort_order>21</sort_order>
411
+ <show_in_default>1</show_in_default>
412
+ <show_in_website>1</show_in_website>
413
+ <show_in_store>1</show_in_store>
414
+ </handling_fee>
415
+ <default_developed_length translate="label">
416
+ <label>default developed length</label>
417
+ <comment>Longueur développé par defaut d'un produit</comment>
418
+ <frontend_type>text</frontend_type>
419
+ <sort_order>22</sort_order>
420
+ <show_in_default>1</show_in_default>
421
+ <show_in_website>1</show_in_website>
422
+ <show_in_store>1</show_in_store>
423
+ </default_developed_length>
424
+ <import translate="label">
425
+ <label>Import</label>
426
+ <comment>Vous permet d'importer le fichier de configuration des prix de livraison</comment>
427
+ <frontend_type>import</frontend_type>
428
+ <backend_model>adminhtml/system_config_backend_shipping_pointsrelaisld1</backend_model>
429
+ <sort_order>23</sort_order>
430
+ <show_in_default>0</show_in_default>
431
+ <show_in_website>1</show_in_website>
432
+ <show_in_store>0</show_in_store>
433
+ </import>
434
+ <export translate="label">
435
+ <label>Export</label>
436
+ <comment>Vous permet d'exporter le fichier de configuration des prix de livraison</comment>
437
+ <frontend_type>export_pointsrelaisld1</frontend_type>
438
+ <sort_order>24</sort_order>
439
+ <show_in_default>0</show_in_default>
440
+ <show_in_website>1</show_in_website>
441
+ <show_in_store>0</show_in_store>
442
+ </export>
443
+ <condition_name translate="label">
444
+ <label>Condition</label>
445
+ <frontend_type>select</frontend_type>
446
+ <comment>Lors d'un changement de condition, enregistrez la modification, puis vérifier le fichier de configuration des prix de livraison.</comment>
447
+ <source_model>adminhtml/system_config_source_shipping_pointsrelaisld1</source_model>
448
+ <sort_order>25</sort_order>
449
+ <show_in_default>0</show_in_default>
450
+ <show_in_website>1</show_in_website>
451
+ <show_in_store>0</show_in_store>
452
+ </condition_name>
453
+ <sallowspecific translate="label">
454
+ <label>Ship to applicable countries</label>
455
+ <frontend_type>select</frontend_type>
456
+ <sort_order>30</sort_order>
457
+ <frontend_class>shipping-applicable-country</frontend_class>
458
+ <source_model>adminhtml/system_config_source_shipping_allspecificcountries</source_model>
459
+ <show_in_default>1</show_in_default>
460
+ <show_in_website>1</show_in_website>
461
+ <show_in_store>1</show_in_store>
462
+ </sallowspecific>
463
+ <specificcountry translate="label">
464
+ <label>Ship to Specific countries</label>
465
+ <frontend_type>multiselect</frontend_type>
466
+ <sort_order>31</sort_order>
467
+ <source_model>adminhtml/system_config_source_country</source_model>
468
+ <show_in_default>1</show_in_default>
469
+ <show_in_website>1</show_in_website>
470
+ <show_in_store>1</show_in_store>
471
+ </specificcountry>
472
+ <showmethod translate="label">
473
+ <label>Show method if not applicable</label>
474
+ <frontend_type>select</frontend_type>
475
+ <sort_order>40</sort_order>
476
+ <source_model>adminhtml/system_config_source_yesno</source_model>
477
+ <show_in_default>1</show_in_default>
478
+ <show_in_website>1</show_in_website>
479
+ <show_in_store>1</show_in_store>
480
+ </showmethod>
481
+ <specificerrmsg translate="label">
482
+ <label>Displayed Error Message</label>
483
+ <frontend_type>textarea</frontend_type>
484
+ <sort_order>41</sort_order>
485
+ <show_in_default>1</show_in_default>
486
+ <show_in_website>1</show_in_website>
487
+ <show_in_store>1</show_in_store>
488
+ </specificerrmsg>
489
+ <sort_order translate="label">
490
+ <label>Sort order</label>
491
+ <frontend_type>text</frontend_type>
492
+ <sort_order>100</sort_order>
493
+ <show_in_default>1</show_in_default>
494
+ <show_in_website>1</show_in_website>
495
+ <show_in_store>1</show_in_store>
496
+ </sort_order>
497
+ </fields>
498
+ </pointsrelaisld1>
499
+ <pointsrelaislds translate="label" module="shipping">
500
+ <label>Mondial Relay - Livraison à Domicile spécialisé</label>
501
+ <frontend_type>text</frontend_type>
502
+ <sort_order>1</sort_order>
503
+ <show_in_default>1</show_in_default>
504
+ <show_in_website>1</show_in_website>
505
+ <show_in_store>1</show_in_store>
506
+ <fields>
507
+ <active translate="label">
508
+ <label>Enabled</label>
509
+ <frontend_type>select</frontend_type>
510
+ <source_model>adminhtml/system_config_source_yesno</source_model>
511
+ <sort_order>1</sort_order>
512
+ <show_in_default>1</show_in_default>
513
+ <show_in_website>1</show_in_website>
514
+ <show_in_store>1</show_in_store>
515
+ </active>
516
+ <enseigne translate="label">
517
+ <label>Enseigne</label>
518
+ <frontend_type>text</frontend_type>
519
+ <sort_order>2</sort_order>
520
+ <show_in_default>1</show_in_default>
521
+ <show_in_website>1</show_in_website>
522
+ <show_in_store>1</show_in_store>
523
+ </enseigne>
524
+ <marque translate="label">
525
+ <label>Référence de marque (Web service)</label>
526
+ <frontend_type>text</frontend_type>
527
+ <sort_order>3</sort_order>
528
+ <show_in_default>1</show_in_default>
529
+ <show_in_website>1</show_in_website>
530
+ <show_in_store>1</show_in_store>
531
+ </marque>
532
+ <cle translate="label">
533
+ <label>Clé (Web service)</label>
534
+ <frontend_type>text</frontend_type>
535
+ <sort_order>4</sort_order>
536
+ <show_in_default>1</show_in_default>
537
+ <show_in_website>1</show_in_website>
538
+ <show_in_store>1</show_in_store>
539
+ </cle>
540
+ <marque_url translate="label">
541
+ <label>Référence de marque (tracking)</label>
542
+ <frontend_type>text</frontend_type>
543
+ <sort_order>5</sort_order>
544
+ <show_in_default>1</show_in_default>
545
+ <show_in_website>1</show_in_website>
546
+ <show_in_store>1</show_in_store>
547
+ </marque_url>
548
+ <cle_url translate="label">
549
+ <label>Clé (tracking)</label>
550
+ <frontend_type>text</frontend_type>
551
+ <sort_order>6</sort_order>
552
+ <show_in_default>1</show_in_default>
553
+ <show_in_website>1</show_in_website>
554
+ <show_in_store>1</show_in_store>
555
+ </cle_url>
556
+ <adresse1_enseigne translate="label">
557
+ <label>Nom de l'expéditeur</label>
558
+ <comment>Sans accent svp...</comment>
559
+ <frontend_type>text</frontend_type>
560
+ <sort_order>7</sort_order>
561
+ <show_in_default>1</show_in_default>
562
+ <show_in_website>1</show_in_website>
563
+ <show_in_store>1</show_in_store>
564
+ </adresse1_enseigne>
565
+ <adresse3_enseigne translate="label">
566
+ <label>Adresse de l'expéditeur</label>
567
+ <frontend_type>text</frontend_type>
568
+ <sort_order>8</sort_order>
569
+ <show_in_default>1</show_in_default>
570
+ <show_in_website>1</show_in_website>
571
+ <show_in_store>1</show_in_store>
572
+ </adresse3_enseigne>
573
+ <adresse4_enseigne translate="label">
574
+ <label>Complément d'adresse</label>
575
+ <frontend_type>text</frontend_type>
576
+ <sort_order>9</sort_order>
577
+ <show_in_default>1</show_in_default>
578
+ <show_in_website>1</show_in_website>
579
+ <show_in_store>1</show_in_store>
580
+ </adresse4_enseigne>
581
+ <adresse4_enseigne translate="label">
582
+ <label>Complément d'adresse</label>
583
+ <frontend_type>text</frontend_type>
584
+ <sort_order>10</sort_order>
585
+ <show_in_default>1</show_in_default>
586
+ <show_in_website>1</show_in_website>
587
+ <show_in_store>1</show_in_store>
588
+ </adresse4_enseigne>
589
+ <cp_enseigne translate="label">
590
+ <label>Code postal</label>
591
+ <frontend_type>text</frontend_type>
592
+ <sort_order>11</sort_order>
593
+ <show_in_default>1</show_in_default>
594
+ <show_in_website>1</show_in_website>
595
+ <show_in_store>1</show_in_store>
596
+ </cp_enseigne>
597
+ <ville_enseigne translate="label">
598
+ <label>Ville de l'expéditeur</label>
599
+ <frontend_type>text</frontend_type>
600
+ <sort_order>12</sort_order>
601
+ <show_in_default>1</show_in_default>
602
+ <show_in_website>1</show_in_website>
603
+ <show_in_store>1</show_in_store>
604
+ </ville_enseigne>
605
+ <pays_enseigne translate="label">
606
+ <label>Code Pays de l'expéditeur</label>
607
+ <comment>FR, BE, etc...</comment>
608
+ <frontend_type>text</frontend_type>
609
+ <sort_order>13</sort_order>
610
+ <show_in_default>1</show_in_default>
611
+ <show_in_website>1</show_in_website>
612
+ <show_in_store>1</show_in_store>
613
+ </pays_enseigne>
614
+ <tel_enseigne translate="label">
615
+ <label>Téléphone</label>
616
+ <frontend_type>text</frontend_type>
617
+ <sort_order>14</sort_order>
618
+ <show_in_default>1</show_in_default>
619
+ <show_in_website>1</show_in_website>
620
+ <show_in_store>1</show_in_store>
621
+ </tel_enseigne>
622
+ <mobile_enseigne translate="label">
623
+ <label>Mobile</label>
624
+ <comment>Facultatif</comment>
625
+ <frontend_type>text</frontend_type>
626
+ <sort_order>15</sort_order>
627
+ <show_in_default>1</show_in_default>
628
+ <show_in_website>1</show_in_website>
629
+ <show_in_store>1</show_in_store>
630
+ </mobile_enseigne>
631
+ <mail_enseigne translate="label">
632
+ <label>E-mail</label>
633
+ <comment>Facultatif</comment>
634
+ <frontend_type>text</frontend_type>
635
+ <sort_order>16</sort_order>
636
+ <show_in_default>1</show_in_default>
637
+ <show_in_website>1</show_in_website>
638
+ <show_in_store>1</show_in_store>
639
+ </mail_enseigne>
640
+ <title translate="label">
641
+ <label>title</label>
642
+ <comment>Facultatif</comment>
643
+ <frontend_type>text</frontend_type>
644
+ <sort_order>17</sort_order>
645
+ <show_in_default>1</show_in_default>
646
+ <show_in_website>1</show_in_website>
647
+ <show_in_store>1</show_in_store>
648
+ </title>
649
+ <description translate="label">
650
+ <label>Description</label>
651
+ <comment>Facultatif</comment>
652
+ <frontend_type>text</frontend_type>
653
+ <sort_order>18</sort_order>
654
+ <show_in_default>1</show_in_default>
655
+ <show_in_website>1</show_in_website>
656
+ <show_in_store>1</show_in_store>
657
+ </description>
658
+ <handling_type translate="label">
659
+ <label>Calculate Handling Fee</label>
660
+ <frontend_type>select</frontend_type>
661
+ <source_model>shipping/source_handlingType</source_model>
662
+ <sort_order>20</sort_order>
663
+ <show_in_default>1</show_in_default>
664
+ <show_in_website>1</show_in_website>
665
+ <show_in_store>0</show_in_store>
666
+ </handling_type>
667
+ <handling_fee translate="label">
668
+ <label>Handling Fee</label>
669
+ <frontend_type>text</frontend_type>
670
+ <sort_order>21</sort_order>
671
+ <show_in_default>1</show_in_default>
672
+ <show_in_website>1</show_in_website>
673
+ <show_in_store>1</show_in_store>
674
+ </handling_fee>
675
+ <default_developed_length translate="label">
676
+ <label>default developed length</label>
677
+ <comment>Longueur développé par defaut d'un produit</comment>
678
+ <frontend_type>text</frontend_type>
679
+ <sort_order>22</sort_order>
680
+ <show_in_default>1</show_in_default>
681
+ <show_in_website>1</show_in_website>
682
+ <show_in_store>1</show_in_store>
683
+ </default_developed_length>
684
+ <import translate="label">
685
+ <label>Import</label>
686
+ <comment>Vous permet d'importer le fichier de configuration des prix de livraison</comment>
687
+ <frontend_type>import</frontend_type>
688
+ <backend_model>adminhtml/system_config_backend_shipping_pointsrelaislds</backend_model>
689
+ <sort_order>23</sort_order>
690
+ <show_in_default>0</show_in_default>
691
+ <show_in_website>1</show_in_website>
692
+ <show_in_store>0</show_in_store>
693
+ </import>
694
+ <export translate="label">
695
+ <label>Export</label>
696
+ <comment>Vous permet d'exporter le fichier de configuration des prix de livraison</comment>
697
+ <frontend_type>export_pointsrelaislds</frontend_type>
698
+ <sort_order>24</sort_order>
699
+ <show_in_default>0</show_in_default>
700
+ <show_in_website>1</show_in_website>
701
+ <show_in_store>0</show_in_store>
702
+ </export>
703
+ <condition_name translate="label">
704
+ <label>Condition</label>
705
+ <frontend_type>select</frontend_type>
706
+ <comment>Lors d'un changement de condition, enregistrez la modification, puis vérifier le fichier de configuration des prix de livraison.</comment>
707
+ <source_model>adminhtml/system_config_source_shipping_pointsrelais</source_model>
708
+ <sort_order>25</sort_order>
709
+ <show_in_default>0</show_in_default>
710
+ <show_in_website>1</show_in_website>
711
+ <show_in_store>0</show_in_store>
712
+ </condition_name>
713
+ <sallowspecific translate="label">
714
+ <label>Ship to applicable countries</label>
715
+ <frontend_type>select</frontend_type>
716
+ <sort_order>30</sort_order>
717
+ <frontend_class>shipping-applicable-country</frontend_class>
718
+ <source_model>adminhtml/system_config_source_shipping_allspecificcountries</source_model>
719
+ <show_in_default>1</show_in_default>
720
+ <show_in_website>1</show_in_website>
721
+ <show_in_store>1</show_in_store>
722
+ </sallowspecific>
723
+ <specificcountry translate="label">
724
+ <label>Ship to Specific countries</label>
725
+ <frontend_type>multiselect</frontend_type>
726
+ <sort_order>31</sort_order>
727
+ <source_model>adminhtml/system_config_source_country</source_model>
728
+ <show_in_default>1</show_in_default>
729
+ <show_in_website>1</show_in_website>
730
+ <show_in_store>1</show_in_store>
731
+ </specificcountry>
732
+ <showmethod translate="label">
733
+ <label>Show method if not applicable</label>
734
+ <frontend_type>select</frontend_type>
735
+ <sort_order>40</sort_order>
736
+ <source_model>adminhtml/system_config_source_yesno</source_model>
737
+ <show_in_default>1</show_in_default>
738
+ <show_in_website>1</show_in_website>
739
+ <show_in_store>1</show_in_store>
740
+ </showmethod>
741
+ <specificerrmsg translate="label">
742
+ <label>Displayed Error Message</label>
743
+ <frontend_type>textarea</frontend_type>
744
+ <sort_order>41</sort_order>
745
+ <show_in_default>1</show_in_default>
746
+ <show_in_website>1</show_in_website>
747
+ <show_in_store>1</show_in_store>
748
+ </specificerrmsg>
749
+ <sort_order translate="label">
750
+ <label>Sort order</label>
751
+ <frontend_type>text</frontend_type>
752
+ <sort_order>100</sort_order>
753
+ <show_in_default>1</show_in_default>
754
+ <show_in_website>1</show_in_website>
755
+ <show_in_store>1</show_in_store>
756
+ </sort_order>
757
+ </fields>
758
+ </pointsrelaislds>
759
  </groups>
760
  </carriers>
761
  </sections>
app/code/community/MondialRelay/Pointsrelais/sql/pointsrelais_setup/mysql4-install-1.2.0.php ADDED
@@ -0,0 +1,161 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ $installer = $this;
3
+
4
+ $installer->startSetup();
5
+
6
+ $installer->run("
7
+ DROP TABLE IF EXISTS {$this->getTable('mondialrelay_pointsrelais')};
8
+ CREATE TABLE {$this->getTable('mondialrelay_pointsrelais')} (
9
+ `id` int(10) unsigned NOT NULL auto_increment,
10
+ `website_id` int(11) NOT NULL default '0',
11
+ `dest_country_id` varchar(4) NOT NULL default '0',
12
+ `dest_region_id` int(10) NOT NULL default '0',
13
+ `dest_zip` varchar(10) NOT NULL default '',
14
+ `condition_name` varchar(20) NOT NULL default '',
15
+ `condition_value` decimal(12,4) NOT NULL default '0.0000',
16
+ `price` decimal(12,4) NOT NULL default '0.0000',
17
+ `cost` decimal(12,4) NOT NULL default '0.0000',
18
+ PRIMARY KEY (`id`),
19
+ UNIQUE KEY `dest_country` (`website_id`,`dest_country_id`,`dest_region_id`,`dest_zip`,`condition_name`,`condition_value`)
20
+ ) DEFAULT CHARSET=utf8;
21
+
22
+
23
+ DROP TABLE IF EXISTS {$this->getTable('mondialrelay_pointsrelaisld1')};
24
+ CREATE TABLE {$this->getTable('mondialrelay_pointsrelaisld1')} (
25
+ `id` int(10) unsigned NOT NULL auto_increment,
26
+ `website_id` int(11) NOT NULL default '0',
27
+ `dest_country_id` varchar(4) NOT NULL default '0',
28
+ `dest_region_id` int(10) NOT NULL default '0',
29
+ `dest_zip` varchar(10) NOT NULL default '',
30
+ `condition_name` varchar(20) NOT NULL default '',
31
+ `condition_value` decimal(12,4) NOT NULL default '0.0000',
32
+ `price` decimal(12,4) NOT NULL default '0.0000',
33
+ `cost` decimal(12,4) NOT NULL default '0.0000',
34
+ PRIMARY KEY (`id`),
35
+ UNIQUE KEY `dest_country` (`website_id`,`dest_country_id`,`dest_region_id`,`dest_zip`,`condition_name`,`condition_value`)
36
+ ) DEFAULT CHARSET=utf8;
37
+
38
+
39
+
40
+ DROP TABLE IF EXISTS {$this->getTable('mondialrelay_pointsrelaislds')};
41
+ CREATE TABLE {$this->getTable('mondialrelay_pointsrelaislds')} (
42
+ `id` int(10) unsigned NOT NULL auto_increment,
43
+ `website_id` int(11) NOT NULL default '0',
44
+ `dest_country_id` varchar(4) NOT NULL default '0',
45
+ `dest_region_id` int(10) NOT NULL default '0',
46
+ `dest_zip` varchar(10) NOT NULL default '',
47
+ `condition_name` varchar(20) NOT NULL default '',
48
+ `condition_value` decimal(12,4) NOT NULL default '0.0000',
49
+ `price` decimal(12,4) NOT NULL default '0.0000',
50
+ `cost` decimal(12,4) NOT NULL default '0.0000',
51
+ PRIMARY KEY (`id`),
52
+ UNIQUE KEY `dest_country` (`website_id`,`dest_country_id`,`dest_region_id`,`dest_zip`,`condition_name`,`condition_value`)
53
+ ) DEFAULT CHARSET=utf8;
54
+ ");
55
+
56
+ $storesData = $installer->getConnection()->fetchAll("
57
+ SELECT
58
+ DISTINCT (s.website_id)
59
+ FROM
60
+ {$installer->getTable('core/store')} as s
61
+ WHERE
62
+ s.website_id NOT IN (SELECT DISTINCT (website_id) FROM {$this->getTable('mondialrelay_pointsrelais')})
63
+ ");
64
+
65
+ Mage::Log('mondialrelay_pointsrelais storesData: '.count($storesData));
66
+ foreach ($storesData as $storeData) {
67
+ Mage::Log('mondialrelay_pointsrelais storesData: '.$storeData['website_id']);
68
+ $websiteId = $storeData['website_id'];
69
+ $query = "INSERT INTO {$this->getTable('mondialrelay_pointsrelais')} (`website_id`, `dest_country_id`, `dest_region_id`, `dest_zip`, `condition_name`, `condition_value`, `price`, `cost`) VALUES
70
+ ({$websiteId}, 'FR', 0, '', 'package_weight', 0.5000, 4.2000, 4.2000),
71
+ ({$websiteId}, 'FR', 0, '', 'package_weight', 1.0000, 4.2000, 4.2000),
72
+ ({$websiteId}, 'FR', 0, '', 'package_weight', 2.0000, 5.5000, 5.5000),
73
+ ({$websiteId}, 'FR', 0, '', 'package_weight', 3.0000, 6.2000, 6.2000),
74
+ ({$websiteId}, 'FR', 0, '', 'package_weight', 5.0000, 7.5000, 7.5000),
75
+ ({$websiteId}, 'FR', 0, '', 'package_weight', 7.0000, 9.6000, 9.6000),
76
+ ({$websiteId}, 'FR', 0, '', 'package_weight', 10.0000, 11.9500, 11.9500),
77
+ ({$websiteId}, 'FR', 0, '', 'package_weight', 15.0000, 14.3500, 14.3500),
78
+ ({$websiteId}, 'FR', 0, '', 'package_weight', 20.0000, 17.9500, 17.9500),
79
+ ({$websiteId}, 'BE', 0, '', 'package_weight', 0.5000, 4.2000, 4.2000),
80
+ ({$websiteId}, 'BE', 0, '', 'package_weight', 1.0000, 4.8000, 4.8000),
81
+ ({$websiteId}, 'BE', 0, '', 'package_weight', 2.0000, 5.5000, 5.5000),
82
+ ({$websiteId}, 'BE', 0, '', 'package_weight', 3.0000, 6.2000, 6.2000),
83
+ ({$websiteId}, 'BE', 0, '', 'package_weight', 5.0000, 7.5000, 7.5000),
84
+ ({$websiteId}, 'BE', 0, '', 'package_weight', 7.0000, 9.6000, 9.6000),
85
+ ({$websiteId}, 'BE', 0, '', 'package_weight', 10.0000, 11.9500, 11.9500),
86
+ ({$websiteId}, 'BE', 0, '', 'package_weight', 15.0000, 14.3500, 14.3500),
87
+ ({$websiteId}, 'BE', 0, '', 'package_weight', 20.0000, 17.9500, 17.9500);
88
+ ";
89
+ $installer->run($query);
90
+ }
91
+
92
+ $storesData = $installer->getConnection()->fetchAll("
93
+ SELECT
94
+ DISTINCT (s.website_id)
95
+ FROM
96
+ {$installer->getTable('core/store')} as s
97
+ WHERE
98
+ s.website_id NOT IN (SELECT DISTINCT (website_id) FROM {$this->getTable('mondialrelay_pointsrelaisld1')})
99
+ ");
100
+ foreach ($storesData as $storeData) {
101
+ $websiteId = $storeData['website_id'];
102
+ $query = "INSERT INTO {$this->getTable('mondialrelay_pointsrelaisld1')} (`website_id`, `dest_country_id`, `dest_region_id`, `dest_zip`, `condition_name`, `condition_value`, `price`, `cost`) VALUES
103
+ ({$websiteId}, 'FR', 0, '', 'package_weight', 10.0000, 19.0000, 19.0000),
104
+ ({$websiteId}, 'FR', 0, '', 'package_weight', 20.0000, 24.0000, 24.0000),
105
+ ({$websiteId}, 'FR', 0, '', 'package_weight', 30.0000, 30.0000, 30.0000),
106
+ ({$websiteId}, 'FR', 0, '', 'package_weight', 40.0000, 35.0000, 35.0000),
107
+ ({$websiteId}, 'FR', 0, '', 'package_weight', 50.0000, 40.0000, 40.0000),
108
+ ({$websiteId}, 'FR', 0, '', 'package_weight', 60.0000, 49.0000, 49.0000);
109
+ ";
110
+ $installer->run($query);
111
+ }
112
+
113
+ $storesData = $installer->getConnection()->fetchAll("
114
+ SELECT
115
+ DISTINCT (s.website_id)
116
+ FROM
117
+ {$installer->getTable('core/store')} as s
118
+ WHERE
119
+ s.website_id NOT IN (SELECT DISTINCT (website_id) FROM {$this->getTable('mondialrelay_pointsrelaislds')})
120
+ ");
121
+ foreach ($storesData as $storeData) {
122
+ $websiteId = $storeData['website_id'];
123
+ $query = "INSERT INTO {$this->getTable('mondialrelay_pointsrelaislds')} (`website_id`, `dest_country_id`, `dest_region_id`, `dest_zip`, `condition_name`, `condition_value`, `price`, `cost`) VALUES
124
+ ({$websiteId}, 'FR', 0, '', 'package_weight', 10.0000, 42.0000, 42.0000),
125
+ ({$websiteId}, 'FR', 0, '', 'package_weight', 20.0000, 42.0000, 42.0000),
126
+ ({$websiteId}, 'FR', 0, '', 'package_weight', 30.0000, 50.0000, 50.0000),
127
+ ({$websiteId}, 'FR', 0, '', 'package_weight', 40.0000, 58.0000, 58.0000),
128
+ ({$websiteId}, 'FR', 0, '', 'package_weight', 50.0000, 66.0000, 66.0000),
129
+ ({$websiteId}, 'FR', 0, '', 'package_weight', 60.0000, 74.0000, 74.0000),
130
+ ({$websiteId}, 'FR', 0, '', 'package_weight', 70.0000, 74.0000, 74.0000),
131
+ ({$websiteId}, 'FR', 0, '', 'package_weight', 80.0000, 82.0000, 82.0000),
132
+ ({$websiteId}, 'FR', 0, '', 'package_weight', 90.0000, 90.0000, 90.0000),
133
+ ({$websiteId}, 'FR', 0, '', 'package_weight', 100.0000, 97.0000, 97.0000),
134
+ ({$websiteId}, 'FR', 0, '', 'package_weight', 200.0000, 182.0000, 182.0000),
135
+ ({$websiteId}, 'FR', 0, '', 'package_weight', 300.0000, 267.0000, 267.0000);
136
+ ";
137
+ $installer->run($query);
138
+ }
139
+
140
+ $entityTypeId = $installer->getEntityTypeId('catalog_product');
141
+ $attributeSetId = $installer->getDefaultAttributeSetId($entityTypeId);
142
+
143
+
144
+ // On cree l'attribut shipping_method
145
+ $attribute = array(
146
+ 'developed_length' => array(
147
+ 'input' => 'text',
148
+ 'type' => 'int',
149
+ 'label' => 'developed length in cm',
150
+ 'global' => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_STORE,
151
+ 'visible' => 1,
152
+ 'sort' => 10,
153
+ 'required' => false,
154
+ ),
155
+ );
156
+
157
+ // On ajoute l'attribut cree
158
+ foreach ($attribute as $attributeCode => $attributeInfos) {
159
+ $installer->addAttribute($entityTypeId, $attributeCode, $attributeInfos);
160
+ }
161
+ $installer->endSetup();
app/code/community/MondialRelay/Pointsrelais/sql/pointsrelais_setup/{mysql4-uninstall-0.1.0.php → mysql4-uninstall-1.2.0.php} RENAMED
@@ -5,6 +5,8 @@ $installer->startSetup();
5
 
6
  $installer->run("
7
  DROP TABLE IF EXISTS {$this->getTable('mondialrelay_pointsrelais')};
 
 
8
  DELETE FROM {$this->getTable('core/config_data')} WHERE path like 'carriers/pointsrelais/%';
9
  DELETE FROM {$this->getTable('core/resource')} WHERE code like 'pointsrelais_setup';
10
  ");
5
 
6
  $installer->run("
7
  DROP TABLE IF EXISTS {$this->getTable('mondialrelay_pointsrelais')};
8
+ DROP TABLE IF EXISTS {$this->getTable('mondialrelay_pointsrelaisld1')};
9
+ DROP TABLE IF EXISTS {$this->getTable('mondialrelay_pointsrelaislds')};
10
  DELETE FROM {$this->getTable('core/config_data')} WHERE path like 'carriers/pointsrelais/%';
11
  DELETE FROM {$this->getTable('core/resource')} WHERE code like 'pointsrelais_setup';
12
  ");
app/code/community/MondialRelay/Pointsrelais/sql/pointsrelais_setup/mysql4-update-1.0.4.php CHANGED
@@ -2,19 +2,86 @@
2
  $installer = $this;
3
 
4
  $installer->startSetup();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
5
  $storesData = $installer->getConnection()->fetchAll("
6
  SELECT
7
  DISTINCT (s.website_id)
8
  FROM
9
  {$installer->getTable('core/store')} as s,
10
- {$this->getTable('mondialrelay_pointsrelais')} as mr
11
  WHERE
12
- s.website_id NOT IN (SELECT DISTINCT (website_id) FROM {$this->getTable('mondialrelay_pointsrelais')})
13
  ");
14
-
15
  foreach ($storesData as $storeData) {
16
  $websiteId = $storeData['website_id'];
17
- $query = "INSERT INTO {$this->getTable('mondialrelay_pointsrelais')} (`website_id`, `dest_country_id`, `dest_region_id`, `dest_zip`, `condition_name`, `condition_value`, `price`, `cost`) VALUES
18
  ({$websiteId}, 'FR', 0, '', 'package_weight', 0.5000, 4.2000, 4.2000),
19
  ({$websiteId}, 'FR', 0, '', 'package_weight', 1.0000, 4.2000, 4.2000),
20
  ({$websiteId}, 'FR', 0, '', 'package_weight', 2.0000, 5.5000, 5.5000),
@@ -36,5 +103,26 @@ $storesData = $installer->getConnection()->fetchAll("
36
  ";
37
  $installer->run($query);
38
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
39
 
 
 
 
 
40
  $installer->endSetup();
2
  $installer = $this;
3
 
4
  $installer->startSetup();
5
+ $installer->run("
6
+ DROP TABLE IF EXISTS {$this->getTable('mondialrelay_pointsrelaisld1')};
7
+ CREATE TABLE {$this->getTable('mondialrelay_pointsrelaisld1')} (
8
+ `id` int(10) unsigned NOT NULL auto_increment,
9
+ `website_id` int(11) NOT NULL default '0',
10
+ `dest_country_id` varchar(4) NOT NULL default '0',
11
+ `dest_region_id` int(10) NOT NULL default '0',
12
+ `dest_zip` varchar(10) NOT NULL default '',
13
+ `condition_name` varchar(20) NOT NULL default '',
14
+ `condition_value` decimal(12,4) NOT NULL default '0.0000',
15
+ `price` decimal(12,4) NOT NULL default '0.0000',
16
+ `cost` decimal(12,4) NOT NULL default '0.0000',
17
+ PRIMARY KEY (`id`),
18
+ UNIQUE KEY `dest_country` (`website_id`,`dest_country_id`,`dest_region_id`,`dest_zip`,`condition_name`,`condition_value`)
19
+ ) DEFAULT CHARSET=utf8;
20
+
21
+
22
+
23
+ DROP TABLE IF EXISTS {$this->getTable('mondialrelay_pointsrelaislds')};
24
+ CREATE TABLE {$this->getTable('mondialrelay_pointsrelaislds')} (
25
+ `id` int(10) unsigned NOT NULL auto_increment,
26
+ `website_id` int(11) NOT NULL default '0',
27
+ `dest_country_id` varchar(4) NOT NULL default '0',
28
+ `dest_region_id` int(10) NOT NULL default '0',
29
+ `dest_zip` varchar(10) NOT NULL default '',
30
+ `condition_name` varchar(20) NOT NULL default '',
31
+ `condition_value` decimal(12,4) NOT NULL default '0.0000',
32
+ `price` decimal(12,4) NOT NULL default '0.0000',
33
+ `cost` decimal(12,4) NOT NULL default '0.0000',
34
+ PRIMARY KEY (`id`),
35
+ UNIQUE KEY `dest_country` (`website_id`,`dest_country_id`,`dest_region_id`,`dest_zip`,`condition_name`,`condition_value`)
36
+ ) DEFAULT CHARSET=utf8;
37
+ ");
38
+
39
+ $storesData = $installer->getConnection()->fetchAll("
40
+ SELECT
41
+ DISTINCT (s.website_id)
42
+ FROM
43
+ {$installer->getTable('core/store')} as s,
44
+ {$this->getTable('mondialrelay_pointsrelaisld1')} as mr
45
+ WHERE
46
+ s.website_id NOT IN (SELECT DISTINCT (website_id) FROM {$this->getTable('mondialrelay_pointsrelaisld1')})
47
+ ");
48
+ foreach ($storesData as $storeData) {
49
+ $websiteId = $storeData['website_id'];
50
+ $query = "INSERT INTO {$this->getTable('mondialrelay_pointsrelaisld1')} (`website_id`, `dest_country_id`, `dest_region_id`, `dest_zip`, `condition_name`, `condition_value`, `price`, `cost`) VALUES
51
+ ({$websiteId}, 'FR', 0, '', 'package_weight', 0.5000, 4.2000, 4.2000),
52
+ ({$websiteId}, 'FR', 0, '', 'package_weight', 1.0000, 4.2000, 4.2000),
53
+ ({$websiteId}, 'FR', 0, '', 'package_weight', 2.0000, 5.5000, 5.5000),
54
+ ({$websiteId}, 'FR', 0, '', 'package_weight', 3.0000, 6.2000, 6.2000),
55
+ ({$websiteId}, 'FR', 0, '', 'package_weight', 5.0000, 7.5000, 7.5000),
56
+ ({$websiteId}, 'FR', 0, '', 'package_weight', 7.0000, 9.6000, 9.6000),
57
+ ({$websiteId}, 'FR', 0, '', 'package_weight', 10.0000, 11.9500, 11.9500),
58
+ ({$websiteId}, 'FR', 0, '', 'package_weight', 15.0000, 14.3500, 14.3500),
59
+ ({$websiteId}, 'FR', 0, '', 'package_weight', 20.0000, 17.9500, 17.9500),
60
+ ({$websiteId}, 'BE', 0, '', 'package_weight', 0.5000, 4.2000, 4.2000),
61
+ ({$websiteId}, 'BE', 0, '', 'package_weight', 1.0000, 4.8000, 4.8000),
62
+ ({$websiteId}, 'BE', 0, '', 'package_weight', 2.0000, 5.5000, 5.5000),
63
+ ({$websiteId}, 'BE', 0, '', 'package_weight', 3.0000, 6.2000, 6.2000),
64
+ ({$websiteId}, 'BE', 0, '', 'package_weight', 5.0000, 7.5000, 7.5000),
65
+ ({$websiteId}, 'BE', 0, '', 'package_weight', 7.0000, 9.6000, 9.6000),
66
+ ({$websiteId}, 'BE', 0, '', 'package_weight', 10.0000, 11.9500, 11.9500),
67
+ ({$websiteId}, 'BE', 0, '', 'package_weight', 15.0000, 14.3500, 14.3500),
68
+ ({$websiteId}, 'BE', 0, '', 'package_weight', 20.0000, 17.9500, 17.9500);
69
+ ";
70
+ $installer->run($query);
71
+ }
72
+
73
  $storesData = $installer->getConnection()->fetchAll("
74
  SELECT
75
  DISTINCT (s.website_id)
76
  FROM
77
  {$installer->getTable('core/store')} as s,
78
+ {$this->getTable('mondialrelay_pointsrelaislds')} as mr
79
  WHERE
80
+ s.website_id NOT IN (SELECT DISTINCT (website_id) FROM {$this->getTable('mondialrelay_pointsrelaislds')})
81
  ");
 
82
  foreach ($storesData as $storeData) {
83
  $websiteId = $storeData['website_id'];
84
+ $query = "INSERT INTO {$this->getTable('mondialrelay_pointsrelaislds')} (`website_id`, `dest_country_id`, `dest_region_id`, `dest_zip`, `condition_name`, `condition_value`, `price`, `cost`) VALUES
85
  ({$websiteId}, 'FR', 0, '', 'package_weight', 0.5000, 4.2000, 4.2000),
86
  ({$websiteId}, 'FR', 0, '', 'package_weight', 1.0000, 4.2000, 4.2000),
87
  ({$websiteId}, 'FR', 0, '', 'package_weight', 2.0000, 5.5000, 5.5000),
103
  ";
104
  $installer->run($query);
105
  }
106
+
107
+ $entityTypeId = $installer->getEntityTypeId('catalog_product');
108
+ $attributeSetId = $installer->getDefaultAttributeSetId($entityTypeId);
109
+
110
+
111
+ // On cree l'attribut shipping_method
112
+ $attribute = array(
113
+ 'developed_length' => array(
114
+ 'input' => 'text',
115
+ 'type' => 'int',
116
+ 'label' => 'developed length in cm',
117
+ 'global' => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_STORE,
118
+ 'visible' => 1,
119
+ 'sort' => 10,
120
+ 'required' => false,
121
+ ),
122
+ );
123
 
124
+ // On ajoute l'attribut cree
125
+ foreach ($attribute as $attributeCode => $attributeInfos) {
126
+ $installer->addAttribute($entityTypeId, $attributeCode, $attributeInfos);
127
+ }
128
  $installer->endSetup();
app/code/community/MondialRelay/Pointsrelais/sql/pointsrelais_setup/mysql4-update-1.2.0.php ADDED
@@ -0,0 +1,108 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ $installer = $this;
3
+
4
+ $installer->startSetup();
5
+ $installer->run("
6
+ DROP TABLE IF EXISTS {$this->getTable('mondialrelay_pointsrelaisld1')};
7
+ CREATE TABLE {$this->getTable('mondialrelay_pointsrelaisld1')} (
8
+ `id` int(10) unsigned NOT NULL auto_increment,
9
+ `website_id` int(11) NOT NULL default '0',
10
+ `dest_country_id` varchar(4) NOT NULL default '0',
11
+ `dest_region_id` int(10) NOT NULL default '0',
12
+ `dest_zip` varchar(10) NOT NULL default '',
13
+ `condition_name` varchar(20) NOT NULL default '',
14
+ `condition_value` decimal(12,4) NOT NULL default '0.0000',
15
+ `price` decimal(12,4) NOT NULL default '0.0000',
16
+ `cost` decimal(12,4) NOT NULL default '0.0000',
17
+ PRIMARY KEY (`id`),
18
+ UNIQUE KEY `dest_country` (`website_id`,`dest_country_id`,`dest_region_id`,`dest_zip`,`condition_name`,`condition_value`)
19
+ ) DEFAULT CHARSET=utf8;
20
+
21
+
22
+
23
+ DROP TABLE IF EXISTS {$this->getTable('mondialrelay_pointsrelaislds')};
24
+ CREATE TABLE {$this->getTable('mondialrelay_pointsrelaislds')} (
25
+ `id` int(10) unsigned NOT NULL auto_increment,
26
+ `website_id` int(11) NOT NULL default '0',
27
+ `dest_country_id` varchar(4) NOT NULL default '0',
28
+ `dest_region_id` int(10) NOT NULL default '0',
29
+ `dest_zip` varchar(10) NOT NULL default '',
30
+ `condition_name` varchar(20) NOT NULL default '',
31
+ `condition_value` decimal(12,4) NOT NULL default '0.0000',
32
+ `price` decimal(12,4) NOT NULL default '0.0000',
33
+ `cost` decimal(12,4) NOT NULL default '0.0000',
34
+ PRIMARY KEY (`id`),
35
+ UNIQUE KEY `dest_country` (`website_id`,`dest_country_id`,`dest_region_id`,`dest_zip`,`condition_name`,`condition_value`)
36
+ ) DEFAULT CHARSET=utf8;
37
+ ");
38
+
39
+ $storesData = $installer->getConnection()->fetchAll("
40
+ SELECT
41
+ DISTINCT (s.website_id)
42
+ FROM
43
+ {$installer->getTable('core/store')} as s
44
+ WHERE
45
+ s.website_id NOT IN (SELECT DISTINCT (website_id) FROM {$this->getTable('mondialrelay_pointsrelaisld1')})
46
+ ");
47
+ foreach ($storesData as $storeData) {
48
+ $websiteId = $storeData['website_id'];
49
+ $query = "INSERT INTO {$this->getTable('mondialrelay_pointsrelaisld1')} (`website_id`, `dest_country_id`, `dest_region_id`, `dest_zip`, `condition_name`, `condition_value`, `price`, `cost`) VALUES
50
+ ({$websiteId}, 'FR', 0, '', 'package_weight', 10.0000, 19.0000, 19.0000),
51
+ ({$websiteId}, 'FR', 0, '', 'package_weight', 20.0000, 24.0000, 24.0000),
52
+ ({$websiteId}, 'FR', 0, '', 'package_weight', 30.0000, 30.0000, 30.0000),
53
+ ({$websiteId}, 'FR', 0, '', 'package_weight', 40.0000, 35.0000, 35.0000),
54
+ ({$websiteId}, 'FR', 0, '', 'package_weight', 50.0000, 40.0000, 40.0000),
55
+ ({$websiteId}, 'FR', 0, '', 'package_weight', 60.0000, 49.0000, 49.0000);
56
+ ";
57
+ $installer->run($query);
58
+ }
59
+
60
+ $storesData = $installer->getConnection()->fetchAll("
61
+ SELECT
62
+ DISTINCT (s.website_id)
63
+ FROM
64
+ {$installer->getTable('core/store')} as s
65
+ WHERE
66
+ s.website_id NOT IN (SELECT DISTINCT (website_id) FROM {$this->getTable('mondialrelay_pointsrelaislds')})
67
+ ");
68
+ foreach ($storesData as $storeData) {
69
+ $websiteId = $storeData['website_id'];
70
+ $query = "INSERT INTO {$this->getTable('mondialrelay_pointsrelaislds')} (`website_id`, `dest_country_id`, `dest_region_id`, `dest_zip`, `condition_name`, `condition_value`, `price`, `cost`) VALUES
71
+ ({$websiteId}, 'FR', 0, '', 'package_weight', 10.0000, 42.0000, 42.0000),
72
+ ({$websiteId}, 'FR', 0, '', 'package_weight', 20.0000, 42.0000, 42.0000),
73
+ ({$websiteId}, 'FR', 0, '', 'package_weight', 30.0000, 50.0000, 50.0000),
74
+ ({$websiteId}, 'FR', 0, '', 'package_weight', 40.0000, 58.0000, 58.0000),
75
+ ({$websiteId}, 'FR', 0, '', 'package_weight', 50.0000, 66.0000, 66.0000),
76
+ ({$websiteId}, 'FR', 0, '', 'package_weight', 60.0000, 74.0000, 74.0000),
77
+ ({$websiteId}, 'FR', 0, '', 'package_weight', 70.0000, 74.0000, 74.0000),
78
+ ({$websiteId}, 'FR', 0, '', 'package_weight', 80.0000, 82.0000, 82.0000),
79
+ ({$websiteId}, 'FR', 0, '', 'package_weight', 90.0000, 90.0000, 90.0000),
80
+ ({$websiteId}, 'FR', 0, '', 'package_weight', 100.0000, 97.0000, 97.0000),
81
+ ({$websiteId}, 'FR', 0, '', 'package_weight', 200.0000, 182.0000, 182.0000),
82
+ ({$websiteId}, 'FR', 0, '', 'package_weight', 300.0000, 267.0000, 267.0000);
83
+ ";
84
+ $installer->run($query);
85
+ }
86
+
87
+ $entityTypeId = $installer->getEntityTypeId('catalog_product');
88
+ $attributeSetId = $installer->getDefaultAttributeSetId($entityTypeId);
89
+
90
+
91
+ // On cree l'attribut shipping_method
92
+ $attribute = array(
93
+ 'developed_length' => array(
94
+ 'input' => 'text',
95
+ 'type' => 'int',
96
+ 'label' => 'developed length in cm',
97
+ 'global' => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_STORE,
98
+ 'visible' => 1,
99
+ 'sort' => 10,
100
+ 'required' => false,
101
+ ),
102
+ );
103
+
104
+ // On ajoute l'attribut cree
105
+ foreach ($attribute as $attributeCode => $attributeInfos) {
106
+ $installer->addAttribute($entityTypeId, $attributeCode, $attributeInfos);
107
+ }
108
+ $installer->endSetup();
app/locale/fr_FR/MondialRelay_Pointsrelais.csv CHANGED
@@ -15,4 +15,5 @@ Etiquette Mondial Relay","Etiquette Mondial Relay"
15
  "Etiquettes","Etiquettes"
16
  "Imprimer","Imprimer"
17
  "Imprimer les ̩tiquettes","Imprimer les ̩tiquettes"
18
- "D̩sol̩, une erreure est survenu lors de la r̩cup̩ration de l\'̩tiquetes. Merci de contacter Mondial Relay ou de r̩essayer plus tard","D̩sol̩, une erreure est survenu lors de la r̩cup̩ration de l\'̩tiquetes. Merci de contacter Mondial Relay ou de r̩essayer plus tard"
 
15
  "Etiquettes","Etiquettes"
16
  "Imprimer","Imprimer"
17
  "Imprimer les ̩tiquettes","Imprimer les ̩tiquettes"
18
+ "D̩sol̩, une erreure est survenu lors de la r̩cup̩ration de l\'̩tiquetes. Merci de contacter Mondial Relay ou de r̩essayer plus tard","D̩sol̩, une erreure est survenu lors de la r̩cup̩ration de l\'̩tiquetes. Merci de contacter Mondial Relay ou de r̩essayer plus tard"
19
+ "default developed length","longueur d̬velopp̬ par d̬faut"
package.xml CHANGED
@@ -1,18 +1,18 @@
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>MondialRelay_Pointsrelais</name>
4
- <version>1.0.8</version>
5
  <stability>stable</stability>
6
  <license uri="http://opensource.org/licenses/osl-3.0.php">Open Software License (OSL)</license>
7
  <channel>community</channel>
8
  <extends/>
9
  <summary>Module de livraison Mondial Relay</summary>
10
  <description>Module de livraison Mondial Relay</description>
11
- <notes>correction compatibilit&#xE9; paypal</notes>
12
  <authors><author><name>cyrille guillaud</name><user>auto-converted</user><email>cguillaud@cg-consulting.fr</email></author></authors>
13
- <date>2010-04-07</date>
14
- <time>18:27:27</time>
15
- <contents><target name="mageskin"><dir name="frontend"><dir name="default"><dir name="default"><dir name="css"><file name="pointsrelais.css" hash="229d09977ee2eac2e72dcb89bf8eb05c"/></dir><dir name="images"><dir name="mondialrelay"><file name="img_fermer.gif" hash="5901eaf779aa6fa3eac84d1dd9520113"/><file name="img_fleche.gif" hash="908f8a69124b7b16e3ec2caefc78d948"/><file name="logo_PR_01.gif" hash="7066eb60e2645b304d1b926d0a4c31e2"/><file name="Thumbs.db" hash="51da41310be9652f9360715494dc6b03"/></dir></dir><dir name="js"><file name="pointsrelais.js" hash="8008e112e4dd2f468b5726c561a5f8b4"/></dir></dir></dir></dir></target><target name="magedesign"><dir name="frontend"><dir name="default"><dir name="default"><dir name="layout"><file name="pointsrelais.xml" hash="cecd44caa45a4124f3ed64a36137fd17"/></dir><dir name="template"><dir name="pointsrelais"><file name="baseurl.phtml" hash="ddbe6d60de42248171c32ac6279ae46d"/><file name="info.phtml" hash="bd616597f35a48a71bcd7bd1e4ad6575"/></dir></dir></dir></dir></dir></target><target name="magelocale"><dir name="fr_FR"><file name="MondialRelay_Pointsrelais.csv" hash="0397e023998b05e06539fe9cbc46633a"/></dir></target><target name="mageetc"><dir name="modules"><file name="MondialRelay_All.xml" hash="8257e76c52b260553f8ce663c2a8b3d1"/></dir></target><target name="magecommunity"><dir name="MondialRelay"><dir name="Pointsrelais"><dir name="Block"><dir name="Sales"><dir name="Order"><dir name="Shipment"><file name="View.php" hash="913bad19edb072f54a3037fa2a860e5e"/></dir></dir><dir name="Shipment"><file name="Grid.php" hash="5b2c413145a1d077bd7503ef8302a0a2"/></dir><file name="Impression.php" hash="0685fabf03cb81a76a643e2fbc7d90bd"/></dir><dir name="System"><dir name="Config"><dir name="Form"><dir name="Field"><file name="Exportpointsrelais.php" hash="e55ace0129fe156dbeb32a341d384d6a"/></dir></dir><file name="Form.php" hash="603ef66cf74c32c06ec8d37a16b6bd83"/></dir></dir><file name="Info.php" hash="d24bd6bcffe1eae00144d320f595d40d"/></dir><dir name="controllers"><dir name="Sales"><dir name="Order"><file name="ShipmentController.php" hash="562d1105e31f5d6cf100d74e2db1a03a"/></dir><file name="ImpressionController.php" hash="3d4201841e0dfc10f96f5f4a77d5f214"/></dir><dir name="System"><file name="ConfigController.php" hash="495f6d405adf5fba5a32570a56b3770f"/></dir><file name="IndexController.php" hash="0b3068c6075d1ad50f32f802a91bdf38"/></dir><dir name="etc"><file name="config.xml" hash="6468d85e70b13e995433a4500ed2a7b6"/><file name="system.xml" hash="0d3db29ea0b056990b4d990e8351bd29"/></dir><dir name="Helper"><file name="Data.php" hash="e81c10d80df89ecbd51715672c710d3e"/></dir><dir name="Model"><dir name="Carrier"><file name="Pointsrelais.php" hash="0241fa09cb426ecc3c85813646f3dff6"/></dir><dir name="Mysql4"><dir name="Carrier"><dir name="Pointsrelais"><file name="Collection.php" hash="8c7735c2b69a53f234628b8ac0d946cd"/></dir><file name="Pointsrelais.php" hash="c1d5c5f50611d060612ad557111152ce"/></dir></dir><dir name="System"><dir name="Config"><dir name="Backend"><dir name="Shipping"><file name="Pointsrelais.php" hash="39881a493e895b1921f27b3b144450ee"/></dir></dir><dir name="Source"><dir name="Shipping"><file name="Pointsrelais.php" hash="a75b6978fea52d78b0aabce1401cf9d3"/></dir></dir></dir></dir><file name="Observer.php" hash="1538e54242450741dc7a64a74174584b"/></dir><dir name="sql"><dir name="pointsrelais_setup"><file name="mysql4-install-0.1.0.php" hash="bcef01a55bfd48286a132bba6a202ac4"/><file name="mysql4-uninstall-0.1.0.php" hash="fe48b6326faa98cadaa69b3c54973b10"/><file name="mysql4-update-1.0.4.php" hash="5c2027a8336b10aba6ec8cf4a2e2e9e0"/></dir></dir></dir></dir></target></contents>
16
  <compatible/>
17
  <dependencies/>
18
  </package>
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>MondialRelay_Pointsrelais</name>
4
+ <version>1.2.1</version>
5
  <stability>stable</stability>
6
  <license uri="http://opensource.org/licenses/osl-3.0.php">Open Software License (OSL)</license>
7
  <channel>community</channel>
8
  <extends/>
9
  <summary>Module de livraison Mondial Relay</summary>
10
  <description>Module de livraison Mondial Relay</description>
11
+ <notes>ajout du mode LD1 et LDS pour les livraisons a domicile</notes>
12
  <authors><author><name>cyrille guillaud</name><user>auto-converted</user><email>cguillaud@cg-consulting.fr</email></author></authors>
13
+ <date>2010-04-14</date>
14
+ <time>02:45:34</time>
15
+ <contents><target name="mageskin"><dir name="frontend"><dir name="default"><dir name="default"><dir name="css"><file name="pointsrelais.css" hash="229d09977ee2eac2e72dcb89bf8eb05c"/></dir><dir name="images"><dir name="mondialrelay"><file name="img_fermer.gif" hash="5901eaf779aa6fa3eac84d1dd9520113"/><file name="img_fleche.gif" hash="908f8a69124b7b16e3ec2caefc78d948"/><file name="logo_PR_01.gif" hash="7066eb60e2645b304d1b926d0a4c31e2"/><file name="Thumbs.db" hash="51da41310be9652f9360715494dc6b03"/></dir></dir><dir name="js"><file name="pointsrelais.js" hash="8008e112e4dd2f468b5726c561a5f8b4"/></dir></dir></dir></dir></target><target name="magedesign"><dir name="frontend"><dir name="default"><dir name="default"><dir name="layout"><file name="pointsrelais.xml" hash="cecd44caa45a4124f3ed64a36137fd17"/></dir><dir name="template"><dir name="pointsrelais"><file name="baseurl.phtml" hash="ddbe6d60de42248171c32ac6279ae46d"/><file name="info.phtml" hash="bd616597f35a48a71bcd7bd1e4ad6575"/></dir></dir></dir></dir></dir></target><target name="magelocale"><dir name="fr_FR"><file name="MondialRelay_Pointsrelais.csv" hash="64ed2a0c6bde5f02862e24a0697a6109"/></dir></target><target name="mageetc"><dir name="modules"><file name="MondialRelay_All.xml" hash="8257e76c52b260553f8ce663c2a8b3d1"/></dir></target><target name="magecommunity"><dir name="MondialRelay"><dir name="Pointsrelais"><dir name="Block"><dir name="Sales"><dir name="Order"><dir name="Shipment"><file name="View.php" hash="376279b97f805cb9f4c233277aece2b4"/></dir></dir><dir name="Shipment"><file name="Grid.php" hash="5b2c413145a1d077bd7503ef8302a0a2"/></dir><file name="Impression.php" hash="0685fabf03cb81a76a643e2fbc7d90bd"/></dir><dir name="System"><dir name="Config"><dir name="Form"><dir name="Field"><file name="Exportpointsrelais.php" hash="770095d552bf84b666577c64ce867404"/><file name="Exportpointsrelaisld1.php" hash="04bbf4fbf5f6015c618ef6e8780a896a"/><file name="Exportpointsrelaislds.php" hash="a82da5ceaaf45eafeb71d14dd691fc4c"/></dir></dir><file name="Form.php" hash="4c0349261f32513bebafe15d0e1295ae"/></dir></dir><file name="Info.php" hash="d24bd6bcffe1eae00144d320f595d40d"/></dir><dir name="controllers"><dir name="Sales"><dir name="Order"><file name="ShipmentController.php" hash="01a5c94e69f67f95e36cb707265de165"/></dir><file name="ImpressionController.php" hash="3d4201841e0dfc10f96f5f4a77d5f214"/></dir><dir name="System"><file name="ConfigController.php" hash="ee82a3a607400f7d12589532a5988315"/></dir><file name="IndexController.php" hash="0b3068c6075d1ad50f32f802a91bdf38"/></dir><dir name="etc"><file name="config.xml" hash="86b9ae906dd28860351d41e1699d6f5d"/><file name="system.xml" hash="21f314534b14ce2c948f029f5ee9a6ed"/></dir><dir name="Helper"><file name="Data.php" hash="e81c10d80df89ecbd51715672c710d3e"/></dir><dir name="Model"><dir name="Carrier"><file name="Pointsrelais.php" hash="0241fa09cb426ecc3c85813646f3dff6"/><file name="Pointsrelaisld1.php" hash="841a629922b5e61adb4bb154479d0724"/><file name="Pointsrelaislds.php" hash="f78d6390690b92c45706aaf63bc87685"/></dir><dir name="Mysql4"><dir name="Carrier"><dir name="Pointsrelais"><file name="Collection.php" hash="8c7735c2b69a53f234628b8ac0d946cd"/></dir><dir name="Pointsrelaisld1"><file name="Collection.php" hash="a844776e9aaa2b90ac2a491f2c2c3013"/></dir><dir name="Pointsrelaislds"><file name="Collection.php" hash="2d9338b9f0d9b2e4e7aa5baed24780b9"/></dir><file name="Pointsrelais.php" hash="c1d5c5f50611d060612ad557111152ce"/><file name="Pointsrelaisld1.php" hash="4db6f346ff99567b6eafdeac201c7726"/><file name="Pointsrelaislds.php" hash="64957492e8b2ce9b6e2ab0e6f5b6c7b0"/></dir></dir><dir name="System"><dir name="Config"><dir name="Backend"><dir name="Shipping"><file name="Pointsrelais.php" hash="39881a493e895b1921f27b3b144450ee"/><file name="Pointsrelaisld1.php" hash="0ed2ee4ee8c3c725fa5f3c1cde0c6626"/><file name="Pointsrelaislds.php" hash="b1bbea361c6aeb38528af5892237d791"/></dir></dir><dir name="Source"><dir name="Shipping"><file name="Pointsrelais.php" hash="a75b6978fea52d78b0aabce1401cf9d3"/><file name="Pointsrelaisld1.php" hash="b8e21537df53d6eaba905855d0c459f2"/><file name="Pointsrelaislds.php" hash="9af32669854321d6136f2fa368566411"/></dir></dir></dir></dir><file name="Observer.php" hash="1538e54242450741dc7a64a74174584b"/></dir><dir name="sql"><dir name="pointsrelais_setup"><file name="mysql4-install-0.1.0.php" hash="bcef01a55bfd48286a132bba6a202ac4"/><file name="mysql4-install-1.2.0.php" hash="4b752ac0e50c7046f0c95516f17d6984"/><file name="mysql4-uninstall-1.2.0.php" hash="ddba123ff4181617d314cdb61dfd2f62"/><file name="mysql4-update-1.0.4.php" hash="caf165761a59a5a9e5caf71c3654ce94"/><file name="mysql4-update-1.2.0.php" hash="5e725e4377df89a26d7a6ff1cc8f32d6"/></dir></dir></dir></dir></target></contents>
16
  <compatible/>
17
  <dependencies/>
18
  </package>