aftership - Version 0.2.8

Version Notes

Fixed multiple store

Download this release

Release Info

Developer Magento Core Team
Extension aftership
Version 0.2.8
Comparing to
See all releases


Code changes from version 0.2.7 to 0.2.8

app/code/community/Aftership/Track/Model/Observer.php CHANGED
@@ -5,12 +5,16 @@ class Aftership_Track_Model_Observer
5
  public function salesOrderShipmentTrackSaveAfter(Varien_Event_Observer $observer)
6
  {
7
  ob_start();
8
- $config = Mage::getStoreConfig('aftership_options/messages');
9
 
10
- $track = $observer->getEvent()->getTrack();
11
- $track_data = $track->getData();
12
- $order_data = $track->getShipment()->getOrder()->getData();
13
- $shipment_data = $track->getShipment()->getData();
 
 
 
 
 
14
  $shipping_address_data = $track->getShipment()->getOrder()->getShippingAddress()->getData();
15
  if (strlen(trim($track_data["track_number"])) > 0) {
16
  //1.6.2.0 or later
@@ -126,13 +130,14 @@ class Aftership_Track_Model_Observer
126
  ob_end_clean();
127
  }
128
 
129
- public function adminSystemConfigChangedSectionAftership($obj)
130
  {
131
- $post_data = Mage::app()->getRequest()->getPost();
132
- $api_key = $post_data["groups"]["messages"]["fields"]["api_key"]["value"];
133
- if (!array_key_exists("notification", $post_data["groups"]["messages"]["fields"])) {
134
- Mage::getModel('core/config')->saveConfig('aftership_options/messages/notification', 0);
135
- }
 
136
 
137
  $url_params = array(
138
  "api_key" => $api_key
@@ -156,14 +161,27 @@ class Aftership_Track_Model_Observer
156
  $response_obj = json_decode($response, true);
157
 
158
  if ($http_status != "200" && $http_status != "401") {
159
- Mage::getModel('core/config')->saveConfig('aftership_options/messages/status', 0);
160
- Mage::throwException(Mage::helper('adminhtml')->__("Connection error, please try again later."));
 
 
 
 
 
 
161
  } else {
162
  if (!$response_obj["success"]) //error
163
  {
164
- Mage::getModel('core/config')->saveConfig('aftership_options/messages/status', 0);
 
 
 
 
 
 
165
  Mage::throwException(Mage::helper('adminhtml')->__("Incorrect API Key"));
166
  }
167
  }
 
168
  }
169
  }
5
  public function salesOrderShipmentTrackSaveAfter(Varien_Event_Observer $observer)
6
  {
7
  ob_start();
 
8
 
9
+ $track = $observer->getEvent()->getTrack();
10
+ $track_data = $track->getData();
11
+ $order_data = $track->getShipment()->getOrder()->getData();
12
+
13
+ $website_id = Mage::getModel('core/store')->load($order_data['store_id'])->getWebsiteId();
14
+
15
+ //$config = Mage::getStoreConfig('aftership_options/messages');
16
+ $config = Mage::app()->getWebsite($website_id)->getConfig('aftership_options/messages');
17
+
18
  $shipping_address_data = $track->getShipment()->getOrder()->getShippingAddress()->getData();
19
  if (strlen(trim($track_data["track_number"])) > 0) {
20
  //1.6.2.0 or later
130
  ob_end_clean();
131
  }
132
 
133
+ public function adminSystemConfigChangedSectionAftership(Varien_Event_Observer $observer)
134
  {
135
+ $post_data = Mage::app()->getRequest()->getPost();
136
+ $api_key = $post_data["groups"]["messages"]["fields"]["api_key"]["value"];
137
+
138
+ $website = Mage::app()->getRequest()->getParam('website');
139
+ $scope = "websites";
140
+ $score_id = (int)Mage::getConfig()->getNode('websites/'.$website.'/system/website/id');
141
 
142
  $url_params = array(
143
  "api_key" => $api_key
161
  $response_obj = json_decode($response, true);
162
 
163
  if ($http_status != "200" && $http_status != "401") {
164
+ //Mage::getModel('core/config')->saveConfig('aftership_options/messages/status', 0);
165
+ /*Mage::getModel('core/config_data')
166
+ ->setScope($scope)
167
+ ->setScopeId(2)
168
+ ->setPath('aftership_options/messages/status')
169
+ ->setValue(0)
170
+ ->save();*/
171
+ Mage::throwException(Mage::helper('adminhtml')->__("Connection error, please try again later."));
172
  } else {
173
  if (!$response_obj["success"]) //error
174
  {
175
+ //Mage::getModel('core/config')->saveConfig('aftership_options/messages/status', 0);
176
+ /*Mage::getModel('core/config_data')
177
+ ->setScope($scope)
178
+ ->setScopeId(2)
179
+ ->setPath('aftership_options/messages/status')
180
+ ->setValue(0)
181
+ ->save();*/
182
  Mage::throwException(Mage::helper('adminhtml')->__("Incorrect API Key"));
183
  }
184
  }
185
+
186
  }
187
  }
app/code/community/Aftership/Track/etc/adminhtml.xml ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <config>
3
+ <layout>
4
+ <updates>
5
+ <aftershipconfig module="Aftership_Track">
6
+ <file>aftership.xml</file>
7
+ </aftershipconfig>
8
+ </updates>
9
+ </layout>
10
+ </config>
app/code/community/Aftership/Track/etc/config.xml CHANGED
@@ -53,7 +53,7 @@
53
  </global>
54
  <modules>
55
  <Aftership_Track>
56
- <version>0.1.0</version>
57
  </Aftership_Track>
58
  </modules>
59
  <frontend>
@@ -68,6 +68,14 @@
68
  </routers>
69
  </frontend>
70
  <adminhtml>
 
 
 
 
 
 
 
 
71
  <events>
72
  <sales_order_shipment_track_save_after>
73
  <observers>
53
  </global>
54
  <modules>
55
  <Aftership_Track>
56
+ <version>0.2.8</version>
57
  </Aftership_Track>
58
  </modules>
59
  <frontend>
68
  </routers>
69
  </frontend>
70
  <adminhtml>
71
+ <layout>
72
+ <updates>
73
+ <aftershipconfig module="Aftership_Track">
74
+ <file>aftership.xml</file>
75
+ </aftershipconfig>
76
+ </updates>
77
+ </layout>
78
+
79
  <events>
80
  <sales_order_shipment_track_save_after>
81
  <observers>
app/code/community/Aftership/Track/etc/system.xml CHANGED
@@ -9,6 +9,7 @@
9
  <aftership_options translate="label" module="aftership">
10
  <label>AfterShip Config Options</label>
11
  <tab>aftershipconfig</tab>
 
12
  <frontend_type>text</frontend_type>
13
  <sort_order>1000</sort_order>
14
  <show_in_default>1</show_in_default>
9
  <aftership_options translate="label" module="aftership">
10
  <label>AfterShip Config Options</label>
11
  <tab>aftershipconfig</tab>
12
+ <class>aftership-logo</class>
13
  <frontend_type>text</frontend_type>
14
  <sort_order>1000</sort_order>
15
  <show_in_default>1</show_in_default>
app/code/community/Aftership/Track/sql/track_setup/{mysql4-install-0.1.0.php → mysql4-install-0.2.8.php} RENAMED
@@ -3,9 +3,11 @@
3
  $installer = $this;
4
  $installer->startSetup();
5
  $installer->run("DROP TABLE IF EXISTS `{$installer->getTable('track/track')}`;");
 
6
  $installer->run("
7
  CREATE TABLE `{$installer->getTable('track/track')}` (
8
  `track_id` int(11) NOT NULL AUTO_INCREMENT,
 
9
  `tracking_number` varchar(255) NOT NULL,
10
  `ship_comp_code` varchar(255) NOT NULL,
11
  `email` varchar(255) NOT NULL,
3
  $installer = $this;
4
  $installer->startSetup();
5
  $installer->run("DROP TABLE IF EXISTS `{$installer->getTable('track/track')}`;");
6
+ //`store_id` int(11) NOT NULL,
7
  $installer->run("
8
  CREATE TABLE `{$installer->getTable('track/track')}` (
9
  `track_id` int(11) NOT NULL AUTO_INCREMENT,
10
+
11
  `tracking_number` varchar(255) NOT NULL,
12
  `ship_comp_code` varchar(255) NOT NULL,
13
  `email` varchar(255) NOT NULL,
app/code/community/Aftership/Track/sql/track_setup/mysql4-upgrade-0.0.1-0.2.8.php ADDED
@@ -0,0 +1,40 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ //echo "start";
3
+ $installer = $this;
4
+ $installer->startSetup();
5
+ $installer->run("DROP TABLE IF EXISTS `{$installer->getTable('track/track')}`;");
6
+ //`store_id` int(11) NOT NULL,
7
+ $installer->run("
8
+ CREATE TABLE `{$installer->getTable('track/track')}` (
9
+ `track_id` int(11) NOT NULL AUTO_INCREMENT,
10
+ `tracking_number` varchar(255) NOT NULL,
11
+ `ship_comp_code` varchar(255) NOT NULL,
12
+ `email` varchar(255) NOT NULL,
13
+ `telephone` varchar(255) NOT NULL,
14
+ `title` varchar(255) NOT NULL,
15
+ `posted` int(11) NOT NULL DEFAULT '0',
16
+ `order_id` varchar(255) NOT NULL,
17
+ PRIMARY KEY (`track_id`),
18
+ KEY `posted` (`posted`)
19
+ ) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
20
+
21
+
22
+ ");
23
+ $installer->endSetup();
24
+
25
+
26
+ //echo 'Running This Upgrade: '.get_class($this)."\n <br /> \n";
27
+ //die("Exit for now");
28
+ /*
29
+ CREATE TABLE `{$installer->getTable('track/user')}` (
30
+ `user_id` int(11) NOT NULL,
31
+ `login_name` varchar(255) NOT NULL,
32
+ `password` varchar(255) NOT NULL,
33
+ `consumer_key` varchar(255) NOT NULL,
34
+ `consumer_secret` varchar(255) NOT NULL,
35
+ `status` int(11) NOT NULL,
36
+ PRIMARY KEY (`user_id`),
37
+ KEY `status` (`status`)
38
+ ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
39
+ */
40
+ ?>
app/design/adminhtml/default/default/layout/aftership.xml ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <layout>
3
+ <default>
4
+ <reference name="head">
5
+ <action method="addCss">
6
+ <name>aftership/css/style.css</name>
7
+ </action>
8
+ </reference>
9
+ </default>
10
+ </layout>
package.xml CHANGED
@@ -1,18 +1,18 @@
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>aftership</name>
4
- <version>0.2.7</version>
5
  <stability>stable</stability>
6
  <license uri="http://www.opensource.org/licenses/gpl-license.php">GPL</license>
7
  <channel>community</channel>
8
  <extends/>
9
  <summary>AfterShip magento extension interface. Tracking number will be added to the aftership.com &lt;https://www.aftership.com/&gt; account at the same time when input in magento shipment. Please go to aftership.com &lt;https://www.aftership.com/&gt; to change the notification setting and value.</summary>
10
  <description>Users can simply link their online stores to Aftership and view all packages in one place. Online stores can also automatically inform their customers of the latest delivery status through SMS, email and Twitter. All the messages are white-labeled and can be customized for any marketing opportunities. Aftership also provides online stores a reporting tool so that they can easily find out any shipping problems like delayed delivery and solve immediately. Aftership currently supports over 40 shipping companies worldwide.</description>
11
- <notes>Support 1.7.0.2</notes>
12
- <authors><author><name>aftership</name><user>aftership</user><email>support@aftership.com</email></author></authors>
13
- <date>2013-01-21</date>
14
- <time>06:11:37</time>
15
- <contents><target name="magecommunity"><dir name="Aftership"><dir name="Track"><dir name="Helper"><file name="Data.php" hash="854baf793cb348f80c94703b585691b9"/></dir><dir name="Model"><file name="Methods.php" hash="ee6ccd73ab94405e8b0ab4a59990a0fa"/><dir name="Mysql4"><dir name="Track"><file name="Collection.php" hash="b359845af660063396556b37920675ad"/></dir><file name="Track.php" hash="e7799ea4fef0ff7e4217ae0d3a3ed50e"/></dir><file name="Observer.php" hash="72b996e1e90688fe65a56594a9fa0700"/><dir name="Resource"><dir name="Mysql4"><file name="Setup.php" hash="9a1fee597d5f7219cd3f68f38bb1ed97"/></dir></dir><file name="Track.php" hash="61bae429d01ace637296e11994203fe5"/><file name="Words.php" hash="40d412b8ea57998ae6429219b14709db"/></dir><dir name="controllers"><file name="IndexController.php" hash="7f5c1ae52f625152ca3e9ffe15a93028"/></dir><dir name="etc"><file name="config.xml" hash="1fef5c2ffa09abff28386c7f7979a399"/><file name="system.xml" hash="45dc0a90aa6f619006c7b930245e7879"/></dir><dir name="sql"><dir name="track_setup"><file name="mysql4-install-0.1.0.php" hash="6cfe686b1f1846396ff597956b99b692"/></dir></dir></dir></dir></target><target name="mage"><dir name="app"><dir name="etc"><dir name="modules"><file name="Aftership_Track.xml" hash="25367ce0ec0484973a73e5548199dea0"/></dir></dir></dir></target></contents>
16
  <compatible/>
17
- <dependencies><required><php><min>5.2.13</min><max>5.4.9</max></php></required></dependencies>
18
  </package>
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>aftership</name>
4
+ <version>0.2.8</version>
5
  <stability>stable</stability>
6
  <license uri="http://www.opensource.org/licenses/gpl-license.php">GPL</license>
7
  <channel>community</channel>
8
  <extends/>
9
  <summary>AfterShip magento extension interface. Tracking number will be added to the aftership.com &lt;https://www.aftership.com/&gt; account at the same time when input in magento shipment. Please go to aftership.com &lt;https://www.aftership.com/&gt; to change the notification setting and value.</summary>
10
  <description>Users can simply link their online stores to Aftership and view all packages in one place. Online stores can also automatically inform their customers of the latest delivery status through SMS, email and Twitter. All the messages are white-labeled and can be customized for any marketing opportunities. Aftership also provides online stores a reporting tool so that they can easily find out any shipping problems like delayed delivery and solve immediately. Aftership currently supports over 40 shipping companies worldwide.</description>
11
+ <notes>Fixed multiple store</notes>
12
+ <authors><author><name>aftership</name><user>auto-converted</user><email>support@aftership.com</email></author></authors>
13
+ <date>2013-02-22</date>
14
+ <time>10:37:25</time>
15
+ <contents><target name="magecommunity"><dir name="Aftership"><dir name="Track"><dir name="Helper"><file name="Data.php" hash="854baf793cb348f80c94703b585691b9"/></dir><dir name="Model"><dir name="Mysql4"><dir name="Track"><file name="Collection.php" hash="b359845af660063396556b37920675ad"/></dir><file name="Track.php" hash="e7799ea4fef0ff7e4217ae0d3a3ed50e"/></dir><dir name="Resource"><dir name="Mysql4"><file name="Setup.php" hash="9a1fee597d5f7219cd3f68f38bb1ed97"/></dir></dir><file name="Methods.php" hash="ee6ccd73ab94405e8b0ab4a59990a0fa"/><file name="Observer.php" hash="b65d8d5a2c05030d30d9d5766e562ac8"/><file name="Track.php" hash="61bae429d01ace637296e11994203fe5"/><file name="Words.php" hash="40d412b8ea57998ae6429219b14709db"/></dir><dir name="controllers"><file name="IndexController.php" hash="7f5c1ae52f625152ca3e9ffe15a93028"/></dir><dir name="etc"><file name="adminhtml.xml" hash="cadc113478c285edf9f43c7506f6ba89"/><file name="config.xml" hash="6e079d2517a29b29359e50ae410c387d"/><file name="system.xml" hash="a4df64f7531fc842c7c0f8d0400b4584"/></dir><dir name="sql"><dir name="track_setup"><file name="mysql4-install-0.2.8.php" hash="69238c0451d35741c1053a5e8e902f45"/><file name="mysql4-upgrade-0.0.1-0.2.8.php" hash="63156c824a90293e7cb7e42cd4ce5e66"/></dir></dir></dir></dir></target><target name="mage"><dir name="app"><dir name="etc"><dir name="modules"><file name="Aftership_Track.xml" hash="25367ce0ec0484973a73e5548199dea0"/></dir></dir></dir></target><target name="mageskin"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="aftership"><dir name="css"><file name="style.css" hash="bd5df03e68aa767303eb392df394ce52"/></dir><dir name="images"><file name="logo.png" hash="3e8d8f9d5e1747c18fcd1a810ddc5f2a"/><file name=".DS_Store" hash="194577a7e20bdcc7afbb718f502c134c"/></dir><file name=".DS_Store" hash="e8931b980e8ec084f41ef4f99eeef0c3"/></dir></dir></dir></dir></target><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><file name="aftership.xml" hash="263c8bb1e2ba9acbf017a2a44fb11439"/></dir></dir></dir></dir></target></contents>
16
  <compatible/>
17
+ <dependencies/>
18
  </package>
skin/adminhtml/default/default/aftership/.DS_Store ADDED
Binary file
skin/adminhtml/default/default/aftership/css/style.css ADDED
@@ -0,0 +1,8 @@
 
 
 
 
 
 
 
 
1
+ ul.tabs a.aftership-logo span, ul.tabs a.aftership-logo:hover span {
2
+ background: url("../images/logo.png") no-repeat scroll 0 0 transparent;
3
+ height: 0;
4
+ overflow: hidden;
5
+ padding: 24px 0px 0px 0px;
6
+ margin-left: 20px;
7
+ width: 192px;
8
+ }
skin/adminhtml/default/default/aftership/images/.DS_Store ADDED
Binary file
skin/adminhtml/default/default/aftership/images/logo.png ADDED
Binary file