Picqer_PostNL - Version 1.3.0

Version Notes

Added config for showing PostNL options.

Download this release

Release Info

Developer Stephan Groen
Extension Picqer_PostNL
Version 1.3.0
Comparing to
See all releases


Code changes from version 1.2.0 to 1.3.0

app/code/community/Picqer/PostNL/Helper/Data.php CHANGED
@@ -12,6 +12,18 @@ class Picqer_PostNL_Helper_Data extends Mage_Core_Helper_Abstract
12
 
13
  return (bool)$active;
14
  }
 
 
 
 
 
 
 
 
 
 
 
 
15
  /**
16
  * Check whether the TIG PostNL extension is installed
17
  * @return bool
@@ -22,5 +34,4 @@ class Picqer_PostNL_Helper_Data extends Mage_Core_Helper_Abstract
22
 
23
  return (bool)$tigInstalled;
24
  }
25
-
26
  }
12
 
13
  return (bool)$active;
14
  }
15
+
16
+ /**
17
+ * Check whether to show PostNL options in admin
18
+ * @return bool
19
+ */
20
+ public function showPostNLOptions()
21
+ {
22
+ $showOptions = Mage::getStoreConfig('picqer_shipping_options/postnl_settings/picqer_postnl_showoptions');
23
+
24
+ return (bool)$showOptions;
25
+ }
26
+
27
  /**
28
  * Check whether the TIG PostNL extension is installed
29
  * @return bool
34
 
35
  return (bool)$tigInstalled;
36
  }
 
37
  }
app/code/community/Picqer/PostNL/Model/Adminhtml/Observer/Barcode.php ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Picqer_PostNL_Model_Adminhtml_Observer_Barcode extends TIG_PostNL_Model_Core_Observer_Barcode
4
+ {
5
+ public function generateBarcode(Varien_Event_Observer $observer)
6
+ {
7
+ $helper = Mage::helper('picqer_postnl');
8
+ if ($helper->isExtensionActive() && ! $helper->showPostNLOptions()) {
9
+ return $observer;
10
+ }
11
+
12
+ return parent::generateBarcode($observer);
13
+ }
14
+ }
app/code/community/Picqer/PostNL/Model/Adminhtml/Observer/OrderGrid.php CHANGED
@@ -5,7 +5,7 @@ class Picqer_PostNL_Model_Adminhtml_Observer_OrderGrid extends TIG_PostNL_Model_
5
  public function modifyGrid(Varien_Event_Observer $observer)
6
  {
7
  $helper = Mage::helper('picqer_postnl');
8
- if ($helper->isExtensionActive()) {
9
  return $observer;
10
  }
11
 
5
  public function modifyGrid(Varien_Event_Observer $observer)
6
  {
7
  $helper = Mage::helper('picqer_postnl');
8
+ if ($helper->isExtensionActive() && ! $helper->showPostNLOptions()) {
9
  return $observer;
10
  }
11
 
app/code/community/Picqer/PostNL/Model/Adminhtml/Observer/ShipmentGrid.php CHANGED
@@ -5,7 +5,7 @@ class Picqer_PostNL_Model_Adminhtml_Observer_ShipmentGrid extends TIG_PostNL_Mod
5
  public function modifyGrid(Varien_Event_Observer $observer)
6
  {
7
  $helper = Mage::helper('picqer_postnl');
8
- if ($helper->isExtensionActive()) {
9
  return $observer;
10
  }
11
 
5
  public function modifyGrid(Varien_Event_Observer $observer)
6
  {
7
  $helper = Mage::helper('picqer_postnl');
8
+ if ($helper->isExtensionActive() && ! $helper->showPostNLOptions()) {
9
  return $observer;
10
  }
11
 
app/code/community/Picqer/PostNL/Model/Adminhtml/Observer/ShipmentView.php CHANGED
@@ -5,7 +5,7 @@ class Picqer_PostNL_Model_Adminhtml_Observer_ShipmentView extends TIG_PostNL_Mod
5
  public function addPrintLabelButton(Varien_Event_Observer $observer)
6
  {
7
  $helper = Mage::helper('picqer_postnl');
8
- if ($helper->isExtensionActive()) {
9
  return $observer;
10
  }
11
 
5
  public function addPrintLabelButton(Varien_Event_Observer $observer)
6
  {
7
  $helper = Mage::helper('picqer_postnl');
8
+ if ($helper->isExtensionActive() && ! $helper->showPostNLOptions()) {
9
  return $observer;
10
  }
11
 
app/code/community/Picqer/PostNL/Model/Hideoptions.php ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Picqer_PostNL_Model_Hideoptions
4
+ {
5
+ public function toOptionArray()
6
+ {
7
+ return array(
8
+ array('value' => 1, 'label' => Mage::helper('picqer_postnl')->__('Yes')),
9
+ array('value' => 0, 'label' => Mage::helper('picqer_postnl')->__('No'))
10
+ );
11
+ }
12
+ }
app/code/community/Picqer/PostNL/Model/Showoptions.php ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Picqer_PostNL_Model_Showoptions
4
+ {
5
+ public function toOptionArray()
6
+ {
7
+ return array(
8
+ array('value' => 1, 'label' => Mage::helper('picqer_postnl')->__('Yes')),
9
+ array('value' => 0, 'label' => Mage::helper('picqer_postnl')->__('No'))
10
+ );
11
+ }
12
+ }
app/code/community/Picqer/PostNL/etc/config.xml CHANGED
@@ -2,7 +2,7 @@
2
  <config>
3
  <modules>
4
  <Picqer_PostNL>
5
- <version>1.2.0</version>
6
  </Picqer_PostNL>
7
  </modules>
8
  <global>
@@ -44,7 +44,8 @@
44
  <observers>
45
  <!-- Creates a postnl shipment entity and generates a barcode through CIF -->
46
  <postnl_shipment_generate_barcode>
47
- <type>disabled</type>
 
48
  </postnl_shipment_generate_barcode>
49
  </observers>
50
  </sales_order_shipment_save_after>
2
  <config>
3
  <modules>
4
  <Picqer_PostNL>
5
+ <version>1.3.0</version>
6
  </Picqer_PostNL>
7
  </modules>
8
  <global>
44
  <observers>
45
  <!-- Creates a postnl shipment entity and generates a barcode through CIF -->
46
  <postnl_shipment_generate_barcode>
47
+ <class>Picqer_PostNL_Model_Adminhtml_Observer_Barcode</class>
48
+ <method>generateBarcode</method>
49
  </postnl_shipment_generate_barcode>
50
  </observers>
51
  </sales_order_shipment_save_after>
app/code/community/Picqer/PostNL/etc/system.xml CHANGED
@@ -33,6 +33,15 @@
33
  <show_in_website>1</show_in_website>
34
  <show_in_store>1</show_in_store>
35
  </picqer_postnl_active>
 
 
 
 
 
 
 
 
 
36
  </fields>
37
  </postnl_settings>
38
  </groups>
33
  <show_in_website>1</show_in_website>
34
  <show_in_store>1</show_in_store>
35
  </picqer_postnl_active>
36
+ <picqer_postnl_showoptions>
37
+ <label>Show PostNL options (admin)</label>
38
+ <frontend_type>select</frontend_type>
39
+ <source_model>picqer_postnl/showoptions</source_model>
40
+ <sort_order>1</sort_order>
41
+ <show_in_default>1</show_in_default>
42
+ <show_in_website>1</show_in_website>
43
+ <show_in_store>1</show_in_store>
44
+ </picqer_postnl_showoptions>
45
  </fields>
46
  </postnl_settings>
47
  </groups>
package.xml CHANGED
@@ -1,18 +1,18 @@
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>Picqer_PostNL</name>
4
- <version>1.2.0</version>
5
  <stability>stable</stability>
6
  <license>MIT</license>
7
  <channel>community</channel>
8
  <extends/>
9
  <summary>Extension to support PostNL shipments from TIG PostNL extension for Picqer.</summary>
10
  <description>This extension enables you to use the official PostNL extension by TIG with Picqer. Shipments in Picqer will automatically use the right settings, based on the choices of your customer.</description>
11
- <notes>Turns TIG PostNL fields back on when deactivating the Picqer PostNL extension. Better retrieval of PakjeGemak address.</notes>
12
  <authors><author><name>Stephan Groen</name><user>stephangroen</user><email>stephan@picqer.com</email></author></authors>
13
- <date>2017-01-30</date>
14
- <time>14:50:56</time>
15
- <contents><target name="magecommunity"><dir name="Picqer"><dir name="PostNL"><dir name="Helper"><file name="Data.php" hash="da57ee165a0b33beceb01f108e870cf7"/></dir><dir name="Model"><file name="Active.php" hash="4d756a5f96e91f3f9be5194f7378d8bf"/><dir name="Adminhtml"><dir name="Observer"><file name="OrderGrid.php" hash="9df848aa164e180eb4d1aabad1ac6de1"/><file name="Ordergrid.php" hash="0a71bf13c0fdbc17692a4488747a4f00"/><file name="ShipmentGrid.php" hash="de7d9d622f260102359528811bc6654a"/><file name="ShipmentView.php" hash="9df38ce878025e4af09d6d796471b8d7"/></dir></dir><dir name="Sales"><dir name="Order"><file name="Api.php" hash="90f066fc4e00341bba836a3ad356517f"/></dir></dir></dir><dir name="etc"><file name="api.xml" hash="6f5f5494324d29ae5ed9b14c3826dbad"/><file name="config.xml" hash="8daf10d40e2078f244890f962298a826"/><file name="system.xml" hash="f2a526f1d32f243ef253e3d3b3883938"/></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Picqer_PostNL.xml" hash="908eb08b0b31bc34766f8cfa6aa4d713"/></dir></target></contents>
16
  <compatible/>
17
  <dependencies><required><php><min>5.4.0</min><max>7.1.0</max></php><package><name>TIG_PostNL</name><channel>community</channel><min>1.7.0</min><max/></package></required></dependencies>
18
  </package>
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>Picqer_PostNL</name>
4
+ <version>1.3.0</version>
5
  <stability>stable</stability>
6
  <license>MIT</license>
7
  <channel>community</channel>
8
  <extends/>
9
  <summary>Extension to support PostNL shipments from TIG PostNL extension for Picqer.</summary>
10
  <description>This extension enables you to use the official PostNL extension by TIG with Picqer. Shipments in Picqer will automatically use the right settings, based on the choices of your customer.</description>
11
+ <notes>Added config for showing PostNL options.</notes>
12
  <authors><author><name>Stephan Groen</name><user>stephangroen</user><email>stephan@picqer.com</email></author></authors>
13
+ <date>2017-02-02</date>
14
+ <time>11:19:51</time>
15
+ <contents><target name="magecommunity"><dir name="Picqer"><dir name="PostNL"><dir name="Helper"><file name="Data.php" hash="20518add6e7de2d80144ffd0a8f5f0f6"/></dir><dir name="Model"><file name="Active.php" hash="4d756a5f96e91f3f9be5194f7378d8bf"/><dir name="Adminhtml"><dir name="Observer"><file name="Barcode.php" hash="c5e22e4ccf5d10c3f09f2913eb8cc979"/><file name="OrderGrid.php" hash="b30ee0e399e8bef7b151b9070196a39d"/><file name="Ordergrid.php" hash="0a71bf13c0fdbc17692a4488747a4f00"/><file name="ShipmentGrid.php" hash="7f23023ff8ea351f501ea3b94bd18805"/><file name="ShipmentView.php" hash="1f4c56c6a73c9d8c28712c8f3a815c9c"/></dir></dir><file name="Hideoptions.php" hash="859fee8b6ca763e858e2dadf11f8d44d"/><dir name="Sales"><dir name="Order"><file name="Api.php" hash="90f066fc4e00341bba836a3ad356517f"/></dir></dir><file name="Showoptions.php" hash="0aa7babd84a9efe1171f22386080e1b3"/></dir><dir name="etc"><file name="api.xml" hash="6f5f5494324d29ae5ed9b14c3826dbad"/><file name="config.xml" hash="5ba4f81ebee7df078bcc2011deb41857"/><file name="system.xml" hash="48bce82f0b6e86557530692b5d36ed8b"/></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Picqer_PostNL.xml" hash="908eb08b0b31bc34766f8cfa6aa4d713"/></dir></target></contents>
16
  <compatible/>
17
  <dependencies><required><php><min>5.4.0</min><max>7.1.0</max></php><package><name>TIG_PostNL</name><channel>community</channel><min>1.7.0</min><max/></package></required></dependencies>
18
  </package>