Version Notes
Changed PHP dependency version
Download this release
Release Info
Developer | aftership |
Extension | aftership |
Version | 0.2.6 |
Comparing to | |
See all releases |
Code changes from version 0.2.5 to 0.2.6
- app/code/community/Aftership/Track/Helper/Data.php +4 -4
- app/code/community/Aftership/Track/Model/Methods.php +12 -12
- app/code/community/Aftership/Track/Model/Mysql4/Track.php +8 -8
- app/code/community/Aftership/Track/Model/Mysql4/Track/Collection.php +8 -8
- app/code/community/Aftership/Track/Model/Observer.php +149 -150
- app/code/community/Aftership/Track/Model/Resource/Mysql4/Setup.php +3 -3
- app/code/community/Aftership/Track/Model/Track.php +8 -8
- app/code/community/Aftership/Track/Model/Words.php +12 -12
- app/code/community/Aftership/Track/controllers/IndexController.php +6 -6
- app/code/community/Aftership/Track/etc/config.xml +109 -109
- app/code/community/Aftership/Track/etc/system.xml +57 -57
- app/code/community/Aftership/Track/sql/track_setup/mysql4-install-0.1.0.php +38 -38
- app/etc/modules/Aftership_Track.xml +8 -8
- package.xml +6 -6
app/code/community/Aftership/Track/Helper/Data.php
CHANGED
@@ -1,5 +1,5 @@
|
|
1 |
-
<?php
|
2 |
-
class Aftership_Track_Helper_Data extends Mage_Core_Helper_Abstract
|
3 |
-
{
|
4 |
-
}
|
5 |
?>
|
1 |
+
<?php
|
2 |
+
class Aftership_Track_Helper_Data extends Mage_Core_Helper_Abstract
|
3 |
+
{
|
4 |
+
}
|
5 |
?>
|
app/code/community/Aftership/Track/Model/Methods.php
CHANGED
@@ -1,13 +1,13 @@
|
|
1 |
-
<?php
|
2 |
-
class Aftership_Track_Model_Methods
|
3 |
-
{
|
4 |
-
public function toOptionArray()
|
5 |
-
{
|
6 |
-
return array(
|
7 |
-
array('value'=>1, 'label'=>Mage::helper('aftership')->__('Email')),
|
8 |
-
array('value'=>2, 'label'=>Mage::helper('aftership')->__('SMS')),
|
9 |
-
);
|
10 |
-
}
|
11 |
-
|
12 |
-
}
|
13 |
?>
|
1 |
+
<?php
|
2 |
+
class Aftership_Track_Model_Methods
|
3 |
+
{
|
4 |
+
public function toOptionArray()
|
5 |
+
{
|
6 |
+
return array(
|
7 |
+
array('value'=>1, 'label'=>Mage::helper('aftership')->__('Email')),
|
8 |
+
array('value'=>2, 'label'=>Mage::helper('aftership')->__('SMS')),
|
9 |
+
);
|
10 |
+
}
|
11 |
+
|
12 |
+
}
|
13 |
?>
|
app/code/community/Aftership/Track/Model/Mysql4/Track.php
CHANGED
@@ -1,9 +1,9 @@
|
|
1 |
-
<?php
|
2 |
-
class Aftership_Track_Model_Mysql4_Track extends Mage_Core_Model_Mysql4_Abstract
|
3 |
-
{
|
4 |
-
protected function _construct()
|
5 |
-
{
|
6 |
-
$this->_init('track/track','track_id');
|
7 |
-
}
|
8 |
-
}
|
9 |
?>
|
1 |
+
<?php
|
2 |
+
class Aftership_Track_Model_Mysql4_Track extends Mage_Core_Model_Mysql4_Abstract
|
3 |
+
{
|
4 |
+
protected function _construct()
|
5 |
+
{
|
6 |
+
$this->_init('track/track','track_id');
|
7 |
+
}
|
8 |
+
}
|
9 |
?>
|
app/code/community/Aftership/Track/Model/Mysql4/Track/Collection.php
CHANGED
@@ -1,9 +1,9 @@
|
|
1 |
-
<?php
|
2 |
-
class Aftership_Track_Model_Mysql4_Track_Collection extends Mage_Core_Model_Mysql4_Collection_Abstract
|
3 |
-
{
|
4 |
-
protected function _construct()
|
5 |
-
{
|
6 |
-
$this->_init('track/track');
|
7 |
-
}
|
8 |
-
}
|
9 |
?>
|
1 |
+
<?php
|
2 |
+
class Aftership_Track_Model_Mysql4_Track_Collection extends Mage_Core_Model_Mysql4_Collection_Abstract
|
3 |
+
{
|
4 |
+
protected function _construct()
|
5 |
+
{
|
6 |
+
$this->_init('track/track');
|
7 |
+
}
|
8 |
+
}
|
9 |
?>
|
app/code/community/Aftership/Track/Model/Observer.php
CHANGED
@@ -1,151 +1,150 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
class Aftership_Track_Model_Observer
|
4 |
-
{
|
5 |
-
|
6 |
-
|
7 |
-
|
8 |
-
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
|
63 |
-
|
64 |
-
|
65 |
-
|
66 |
-
|
67 |
-
|
68 |
-
|
69 |
-
|
70 |
-
|
71 |
-
|
72 |
-
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
-
|
77 |
-
|
78 |
-
|
79 |
-
|
80 |
-
|
81 |
-
|
82 |
-
|
83 |
-
|
84 |
-
|
85 |
-
|
86 |
-
|
87 |
-
|
88 |
-
|
89 |
-
|
90 |
-
|
91 |
-
|
92 |
-
|
93 |
-
|
94 |
-
|
95 |
-
|
96 |
-
|
97 |
-
|
98 |
-
|
99 |
-
|
100 |
-
|
101 |
-
|
102 |
-
|
103 |
-
|
104 |
-
|
105 |
-
|
106 |
-
|
107 |
-
|
108 |
-
|
109 |
-
|
110 |
-
|
111 |
-
|
112 |
-
|
113 |
-
|
114 |
-
|
115 |
-
|
116 |
-
|
117 |
-
|
118 |
-
|
119 |
-
|
120 |
-
|
121 |
-
|
122 |
-
|
123 |
-
|
124 |
-
|
125 |
-
|
126 |
-
|
127 |
-
|
128 |
-
|
129 |
-
|
130 |
-
|
131 |
-
|
132 |
-
|
133 |
-
|
134 |
-
|
135 |
-
|
136 |
-
|
137 |
-
|
138 |
-
|
139 |
-
|
140 |
-
|
141 |
-
|
142 |
-
|
143 |
-
|
144 |
-
|
145 |
-
|
146 |
-
|
147 |
-
|
148 |
-
|
149 |
-
|
150 |
-
}
|
151 |
}
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class Aftership_Track_Model_Observer
|
4 |
+
{
|
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
|
17 |
+
$track_no = trim($track_data["track_number"]);
|
18 |
+
} else {
|
19 |
+
//1.5.1.0
|
20 |
+
$track_no = trim($track_data["number"]);
|
21 |
+
}
|
22 |
+
|
23 |
+
$exist_track_data = Mage::getModel('track/track')
|
24 |
+
->getCollection()
|
25 |
+
->addFieldToFilter('tracking_number', array('eq' => $track_no))
|
26 |
+
->addFieldToFilter('order_id', array('eq' => $order_data["order_id"]))
|
27 |
+
->getData();
|
28 |
+
|
29 |
+
|
30 |
+
if (!$exist_track_data) {
|
31 |
+
$track = Mage::getModel('track/track');
|
32 |
+
|
33 |
+
$track->setTrackingNumber($track_no);
|
34 |
+
|
35 |
+
$track->setShipCompCode($track_data["carrier_code"]);
|
36 |
+
$track->setTitle($order_data["increment_id"]);
|
37 |
+
|
38 |
+
$track->setOrderId($order_data["increment_id"]);
|
39 |
+
|
40 |
+
if ($order_data["customer_email"] && $order_data["customer_email"] != "") {
|
41 |
+
$track->setEmail($order_data["customer_email"]);
|
42 |
+
}
|
43 |
+
|
44 |
+
if ($shipping_address_data["telephone"] && $shipping_address_data["telephone"] != "") {
|
45 |
+
$track->setTelephone($shipping_address_data["telephone"]);
|
46 |
+
}
|
47 |
+
|
48 |
+
if (array_key_exists("status", $config) && $config["status"]) {
|
49 |
+
$track->setPosted(0);
|
50 |
+
} else {
|
51 |
+
$track->setPosted(2);
|
52 |
+
}
|
53 |
+
|
54 |
+
$track->save();
|
55 |
+
}
|
56 |
+
|
57 |
+
|
58 |
+
if (array_key_exists("status", $config) && $config["status"])
|
59 |
+
{
|
60 |
+
$api_key = $config["api_key"];
|
61 |
+
|
62 |
+
$post_tracks = Mage::getModel('track/track')
|
63 |
+
->getCollection()
|
64 |
+
->addFieldToFilter('posted', array('eq' => 0))
|
65 |
+
->getData();
|
66 |
+
|
67 |
+
$url_params = array("api_key" => $api_key);
|
68 |
+
|
69 |
+
foreach ($post_tracks as $track) {
|
70 |
+
$url = "https://api.aftership.com/v1/trackings";
|
71 |
+
$url_params["tracking_number"] = $track["tracking_number"];
|
72 |
+
$url_params["smses[]"] = $track["telephone"];
|
73 |
+
$url_params["emails[]"] = $track["email"];
|
74 |
+
$url_params["title"] = $track["title"];
|
75 |
+
$url_params["order_id"] = $track["order_id"];
|
76 |
+
|
77 |
+
$ch = curl_init();
|
78 |
+
curl_setopt($ch, CURLOPT_URL, $url);
|
79 |
+
|
80 |
+
curl_setopt($ch, CURLOPT_POST, true);
|
81 |
+
curl_setopt($ch, CURLOPT_POSTFIELDS, $url_params);
|
82 |
+
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
|
83 |
+
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 30);
|
84 |
+
curl_setopt($ch, CURLOPT_HEADER, 0);
|
85 |
+
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
|
86 |
+
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0); //the SSL is not correct
|
87 |
+
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0); //the SSL is not correct
|
88 |
+
|
89 |
+
$response = curl_exec($ch);
|
90 |
+
$http_status = curl_getinfo($ch, CURLINFO_HTTP_CODE);
|
91 |
+
$error = curl_error($ch);
|
92 |
+
curl_close($ch);
|
93 |
+
$response_obj = json_decode($response, true);
|
94 |
+
|
95 |
+
if ($http_status == "201" || $http_status == "422") //422: repeated
|
96 |
+
{
|
97 |
+
$track_obj = Mage::getModel('track/track');
|
98 |
+
$track_obj->load($track["track_id"]);
|
99 |
+
$track_obj->setPosted(1);
|
100 |
+
$track_obj->save();
|
101 |
+
} else {
|
102 |
+
|
103 |
+
}
|
104 |
+
}
|
105 |
+
}
|
106 |
+
|
107 |
+
ob_end_clean();
|
108 |
+
}
|
109 |
+
|
110 |
+
public function adminSystemConfigChangedSectionAftership($obj)
|
111 |
+
{
|
112 |
+
$post_data = Mage::app()->getRequest()->getPost();
|
113 |
+
$api_key = $post_data["groups"]["messages"]["fields"]["api_key"]["value"];
|
114 |
+
if (!array_key_exists("notification", $post_data["groups"]["messages"]["fields"])) {
|
115 |
+
Mage::getModel('core/config')->saveConfig('aftership_options/messages/notification', 0);
|
116 |
+
}
|
117 |
+
|
118 |
+
$url_params = array(
|
119 |
+
"api_key" => $api_key
|
120 |
+
);
|
121 |
+
$url = "https://api.aftership.com/v1/users/authenticate";
|
122 |
+
|
123 |
+
$ch = curl_init();
|
124 |
+
curl_setopt($ch, CURLOPT_URL, $url);
|
125 |
+
curl_setopt($ch, CURLOPT_POST, true);
|
126 |
+
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($url_params));
|
127 |
+
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
|
128 |
+
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 30);
|
129 |
+
curl_setopt($ch, CURLOPT_HEADER, 0);
|
130 |
+
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
|
131 |
+
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
|
132 |
+
|
133 |
+
$response = curl_exec($ch);
|
134 |
+
$error = curl_error($ch);
|
135 |
+
$http_status = curl_getinfo($ch, CURLINFO_HTTP_CODE);
|
136 |
+
curl_close($ch);
|
137 |
+
$response_obj = json_decode($response, true);
|
138 |
+
|
139 |
+
if ($http_status != "200" && $http_status != "401") {
|
140 |
+
Mage::getModel('core/config')->saveConfig('aftership_options/messages/status', 0);
|
141 |
+
Mage::throwException(Mage::helper('adminhtml')->__("Connection error, please try again later."));
|
142 |
+
} else {
|
143 |
+
if (!$response_obj["success"]) //error
|
144 |
+
{
|
145 |
+
Mage::getModel('core/config')->saveConfig('aftership_options/messages/status', 0);
|
146 |
+
Mage::throwException(Mage::helper('adminhtml')->__("Incorrect API Key"));
|
147 |
+
}
|
148 |
+
}
|
149 |
+
}
|
|
|
150 |
}
|
app/code/community/Aftership/Track/Model/Resource/Mysql4/Setup.php
CHANGED
@@ -1,4 +1,4 @@
|
|
1 |
-
<?php
|
2 |
-
class Aftership_Track_Model_Resource_Mysql4_Setup extends Mage_Core_Model_Resource_Setup {
|
3 |
-
}
|
4 |
?>
|
1 |
+
<?php
|
2 |
+
class Aftership_Track_Model_Resource_Mysql4_Setup extends Mage_Core_Model_Resource_Setup {
|
3 |
+
}
|
4 |
?>
|
app/code/community/Aftership/Track/Model/Track.php
CHANGED
@@ -1,9 +1,9 @@
|
|
1 |
-
<?php
|
2 |
-
class Aftership_Track_Model_Track extends Mage_Core_Model_Abstract
|
3 |
-
{
|
4 |
-
protected function _construct()
|
5 |
-
{
|
6 |
-
$this->_init('track/track');
|
7 |
-
}
|
8 |
-
}
|
9 |
?>
|
1 |
+
<?php
|
2 |
+
class Aftership_Track_Model_Track extends Mage_Core_Model_Abstract
|
3 |
+
{
|
4 |
+
protected function _construct()
|
5 |
+
{
|
6 |
+
$this->_init('track/track');
|
7 |
+
}
|
8 |
+
}
|
9 |
?>
|
app/code/community/Aftership/Track/Model/Words.php
CHANGED
@@ -1,13 +1,13 @@
|
|
1 |
-
<?php
|
2 |
-
class Aftership_Track_Model_Words
|
3 |
-
{
|
4 |
-
public function toOptionArray()
|
5 |
-
{
|
6 |
-
return array(
|
7 |
-
array('value'=>0, 'label'=>Mage::helper('aftership')->__('Disable')),
|
8 |
-
array('value'=>1, 'label'=>Mage::helper('aftership')->__('Enable')),
|
9 |
-
);
|
10 |
-
}
|
11 |
-
|
12 |
-
}
|
13 |
?>
|
1 |
+
<?php
|
2 |
+
class Aftership_Track_Model_Words
|
3 |
+
{
|
4 |
+
public function toOptionArray()
|
5 |
+
{
|
6 |
+
return array(
|
7 |
+
array('value'=>0, 'label'=>Mage::helper('aftership')->__('Disable')),
|
8 |
+
array('value'=>1, 'label'=>Mage::helper('aftership')->__('Enable')),
|
9 |
+
);
|
10 |
+
}
|
11 |
+
|
12 |
+
}
|
13 |
?>
|
app/code/community/Aftership/Track/controllers/IndexController.php
CHANGED
@@ -1,7 +1,7 @@
|
|
1 |
-
<?php
|
2 |
-
class Aftership_Track_IndexController extends Mage_Core_Controller_Front_Action {
|
3 |
-
|
4 |
-
public function indexAction() {
|
5 |
-
}
|
6 |
-
}
|
7 |
?>
|
1 |
+
<?php
|
2 |
+
class Aftership_Track_IndexController extends Mage_Core_Controller_Front_Action {
|
3 |
+
|
4 |
+
public function indexAction() {
|
5 |
+
}
|
6 |
+
}
|
7 |
?>
|
app/code/community/Aftership/Track/etc/config.xml
CHANGED
@@ -1,110 +1,110 @@
|
|
1 |
-
<?xml version="1.0"?>
|
2 |
-
<config>
|
3 |
-
<global>
|
4 |
-
<models>
|
5 |
-
<track>
|
6 |
-
<class>Aftership_Track_Model</class>
|
7 |
-
<resourceModel>track_mysql4</resourceModel>
|
8 |
-
</track>
|
9 |
-
<track_mysql4>
|
10 |
-
<class>Aftership_Track_Model_Mysql4</class>
|
11 |
-
<entities>
|
12 |
-
<track>
|
13 |
-
<table>as_track</table>
|
14 |
-
</track>
|
15 |
-
<!--<user>
|
16 |
-
<table>as_user</table>
|
17 |
-
</user>-->
|
18 |
-
</entities>
|
19 |
-
</track_mysql4>
|
20 |
-
<status>
|
21 |
-
<class>Aftership_Track_Model</class>
|
22 |
-
</status>
|
23 |
-
<notification>
|
24 |
-
<class>Aftership_Track_Model</class>
|
25 |
-
</notification>
|
26 |
-
</models>
|
27 |
-
<resources>
|
28 |
-
<track_write>
|
29 |
-
<connection>
|
30 |
-
<use>core_write</use>
|
31 |
-
</connection>
|
32 |
-
</track_write>
|
33 |
-
<track_read>
|
34 |
-
<connection>
|
35 |
-
<use>core_read</use>
|
36 |
-
</connection>
|
37 |
-
</track_read>
|
38 |
-
<track_setup>
|
39 |
-
<setup>
|
40 |
-
<module>Aftership_Track</module>
|
41 |
-
<class>Aftership_Track_Model_Resource_Mysql4_Setup</class>
|
42 |
-
</setup>
|
43 |
-
<connection>
|
44 |
-
<use>core_setup</use>
|
45 |
-
</connection>
|
46 |
-
</track_setup>
|
47 |
-
</resources>
|
48 |
-
<helpers>
|
49 |
-
<aftership>
|
50 |
-
<class>Aftership_Track_Helper</class>
|
51 |
-
</aftership>
|
52 |
-
</helpers>
|
53 |
-
</global>
|
54 |
-
<modules>
|
55 |
-
<Aftership_Track>
|
56 |
-
<version>0.1.0</version>
|
57 |
-
</Aftership_Track>
|
58 |
-
</modules>
|
59 |
-
<frontend>
|
60 |
-
<routers>
|
61 |
-
<track>
|
62 |
-
<use>standard</use>
|
63 |
-
<args>
|
64 |
-
<module>Aftership_Track</module>
|
65 |
-
<frontName>track</frontName>
|
66 |
-
</args>
|
67 |
-
</track>
|
68 |
-
</routers>
|
69 |
-
</frontend>
|
70 |
-
<adminhtml>
|
71 |
-
<events>
|
72 |
-
<sales_order_shipment_track_save_after>
|
73 |
-
<observers>
|
74 |
-
<fishpig_save_product_data>
|
75 |
-
<type>singleton</type>
|
76 |
-
<class>track/observer</class>
|
77 |
-
<method>salesOrderShipmentTrackSaveAfter</method>
|
78 |
-
</fishpig_save_product_data>
|
79 |
-
</observers>
|
80 |
-
</sales_order_shipment_track_save_after>
|
81 |
-
<admin_system_config_changed_section_aftership_options>
|
82 |
-
<observers>
|
83 |
-
<index>
|
84 |
-
<class>track/observer</class>
|
85 |
-
<method>adminSystemConfigChangedSectionAftership</method>
|
86 |
-
</index>
|
87 |
-
</observers>
|
88 |
-
</admin_system_config_changed_section_aftership_options>
|
89 |
-
</events>
|
90 |
-
<acl>
|
91 |
-
<resources>
|
92 |
-
<admin>
|
93 |
-
<children>
|
94 |
-
<system>
|
95 |
-
<children>
|
96 |
-
<config>
|
97 |
-
<children>
|
98 |
-
<aftership_options>
|
99 |
-
<title>Aftership tracking config</title>
|
100 |
-
</aftership_options>
|
101 |
-
</children>
|
102 |
-
</config>
|
103 |
-
</children>
|
104 |
-
</system>
|
105 |
-
</children>
|
106 |
-
</admin>
|
107 |
-
</resources>
|
108 |
-
</acl>
|
109 |
-
</adminhtml>
|
110 |
</config>
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<config>
|
3 |
+
<global>
|
4 |
+
<models>
|
5 |
+
<track>
|
6 |
+
<class>Aftership_Track_Model</class>
|
7 |
+
<resourceModel>track_mysql4</resourceModel>
|
8 |
+
</track>
|
9 |
+
<track_mysql4>
|
10 |
+
<class>Aftership_Track_Model_Mysql4</class>
|
11 |
+
<entities>
|
12 |
+
<track>
|
13 |
+
<table>as_track</table>
|
14 |
+
</track>
|
15 |
+
<!--<user>
|
16 |
+
<table>as_user</table>
|
17 |
+
</user>-->
|
18 |
+
</entities>
|
19 |
+
</track_mysql4>
|
20 |
+
<status>
|
21 |
+
<class>Aftership_Track_Model</class>
|
22 |
+
</status>
|
23 |
+
<notification>
|
24 |
+
<class>Aftership_Track_Model</class>
|
25 |
+
</notification>
|
26 |
+
</models>
|
27 |
+
<resources>
|
28 |
+
<track_write>
|
29 |
+
<connection>
|
30 |
+
<use>core_write</use>
|
31 |
+
</connection>
|
32 |
+
</track_write>
|
33 |
+
<track_read>
|
34 |
+
<connection>
|
35 |
+
<use>core_read</use>
|
36 |
+
</connection>
|
37 |
+
</track_read>
|
38 |
+
<track_setup>
|
39 |
+
<setup>
|
40 |
+
<module>Aftership_Track</module>
|
41 |
+
<class>Aftership_Track_Model_Resource_Mysql4_Setup</class>
|
42 |
+
</setup>
|
43 |
+
<connection>
|
44 |
+
<use>core_setup</use>
|
45 |
+
</connection>
|
46 |
+
</track_setup>
|
47 |
+
</resources>
|
48 |
+
<helpers>
|
49 |
+
<aftership>
|
50 |
+
<class>Aftership_Track_Helper</class>
|
51 |
+
</aftership>
|
52 |
+
</helpers>
|
53 |
+
</global>
|
54 |
+
<modules>
|
55 |
+
<Aftership_Track>
|
56 |
+
<version>0.1.0</version>
|
57 |
+
</Aftership_Track>
|
58 |
+
</modules>
|
59 |
+
<frontend>
|
60 |
+
<routers>
|
61 |
+
<track>
|
62 |
+
<use>standard</use>
|
63 |
+
<args>
|
64 |
+
<module>Aftership_Track</module>
|
65 |
+
<frontName>track</frontName>
|
66 |
+
</args>
|
67 |
+
</track>
|
68 |
+
</routers>
|
69 |
+
</frontend>
|
70 |
+
<adminhtml>
|
71 |
+
<events>
|
72 |
+
<sales_order_shipment_track_save_after>
|
73 |
+
<observers>
|
74 |
+
<fishpig_save_product_data>
|
75 |
+
<type>singleton</type>
|
76 |
+
<class>track/observer</class>
|
77 |
+
<method>salesOrderShipmentTrackSaveAfter</method>
|
78 |
+
</fishpig_save_product_data>
|
79 |
+
</observers>
|
80 |
+
</sales_order_shipment_track_save_after>
|
81 |
+
<admin_system_config_changed_section_aftership_options>
|
82 |
+
<observers>
|
83 |
+
<index>
|
84 |
+
<class>track/observer</class>
|
85 |
+
<method>adminSystemConfigChangedSectionAftership</method>
|
86 |
+
</index>
|
87 |
+
</observers>
|
88 |
+
</admin_system_config_changed_section_aftership_options>
|
89 |
+
</events>
|
90 |
+
<acl>
|
91 |
+
<resources>
|
92 |
+
<admin>
|
93 |
+
<children>
|
94 |
+
<system>
|
95 |
+
<children>
|
96 |
+
<config>
|
97 |
+
<children>
|
98 |
+
<aftership_options>
|
99 |
+
<title>Aftership tracking config</title>
|
100 |
+
</aftership_options>
|
101 |
+
</children>
|
102 |
+
</config>
|
103 |
+
</children>
|
104 |
+
</system>
|
105 |
+
</children>
|
106 |
+
</admin>
|
107 |
+
</resources>
|
108 |
+
</acl>
|
109 |
+
</adminhtml>
|
110 |
</config>
|
app/code/community/Aftership/Track/etc/system.xml
CHANGED
@@ -1,58 +1,58 @@
|
|
1 |
-
<config>
|
2 |
-
<tabs>
|
3 |
-
<aftershipconfig translate="label" module="aftership">
|
4 |
-
<label>Aftership</label>
|
5 |
-
<sort_order>99999</sort_order>
|
6 |
-
</aftershipconfig>
|
7 |
-
</tabs>
|
8 |
-
<sections>
|
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>
|
15 |
-
<show_in_website>1</show_in_website>
|
16 |
-
<show_in_store>1</show_in_store>
|
17 |
-
<groups>
|
18 |
-
<messages translate="label">
|
19 |
-
<label>Account setting</label>
|
20 |
-
<frontend_type>text</frontend_type>
|
21 |
-
<sort_order>1</sort_order>
|
22 |
-
<show_in_default>1</show_in_default>
|
23 |
-
<show_in_website>1</show_in_website>
|
24 |
-
<show_in_store>1</show_in_store>
|
25 |
-
<fields>
|
26 |
-
<api_key>
|
27 |
-
<label>API key</label>
|
28 |
-
<frontend_type>text</frontend_type>
|
29 |
-
<sort_order>10</sort_order>
|
30 |
-
<show_in_default>1</show_in_default>
|
31 |
-
<show_in_website>1</show_in_website>
|
32 |
-
<show_in_store>0</show_in_store>
|
33 |
-
<comment>You can find your API key in <![CDATA[<a target='_blank' href="https://www.aftership.com/connect/magento">https://www.aftership.com/connect/magento</a>]]></comment>
|
34 |
-
</api_key>
|
35 |
-
<status>
|
36 |
-
<label>Status</label>
|
37 |
-
<frontend_type>Select</frontend_type>
|
38 |
-
<source_model>status/words</source_model>
|
39 |
-
<sort_order>30</sort_order>
|
40 |
-
<show_in_default>1</show_in_default>
|
41 |
-
<show_in_website>1</show_in_website>
|
42 |
-
<show_in_store>0</show_in_store>
|
43 |
-
</status>
|
44 |
-
<!--<notification>
|
45 |
-
<label>Notification</label>
|
46 |
-
<frontend_type>Multiselect</frontend_type>
|
47 |
-
<source_model>notification/methods</source_model>
|
48 |
-
<sort_order>40</sort_order>
|
49 |
-
<show_in_default>1</show_in_default>
|
50 |
-
<show_in_website>1</show_in_website>
|
51 |
-
<show_in_store>0</show_in_store>
|
52 |
-
</notification>-->
|
53 |
-
</fields>
|
54 |
-
</messages>
|
55 |
-
</groups>
|
56 |
-
</aftership_options>
|
57 |
-
</sections>
|
58 |
</config>
|
1 |
+
<config>
|
2 |
+
<tabs>
|
3 |
+
<aftershipconfig translate="label" module="aftership">
|
4 |
+
<label>Aftership</label>
|
5 |
+
<sort_order>99999</sort_order>
|
6 |
+
</aftershipconfig>
|
7 |
+
</tabs>
|
8 |
+
<sections>
|
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>
|
15 |
+
<show_in_website>1</show_in_website>
|
16 |
+
<show_in_store>1</show_in_store>
|
17 |
+
<groups>
|
18 |
+
<messages translate="label">
|
19 |
+
<label>Account setting</label>
|
20 |
+
<frontend_type>text</frontend_type>
|
21 |
+
<sort_order>1</sort_order>
|
22 |
+
<show_in_default>1</show_in_default>
|
23 |
+
<show_in_website>1</show_in_website>
|
24 |
+
<show_in_store>1</show_in_store>
|
25 |
+
<fields>
|
26 |
+
<api_key>
|
27 |
+
<label>API key</label>
|
28 |
+
<frontend_type>text</frontend_type>
|
29 |
+
<sort_order>10</sort_order>
|
30 |
+
<show_in_default>1</show_in_default>
|
31 |
+
<show_in_website>1</show_in_website>
|
32 |
+
<show_in_store>0</show_in_store>
|
33 |
+
<comment>You can find your API key in <![CDATA[<a target='_blank' href="https://www.aftership.com/connect/magento">https://www.aftership.com/connect/magento</a>]]></comment>
|
34 |
+
</api_key>
|
35 |
+
<status>
|
36 |
+
<label>Status</label>
|
37 |
+
<frontend_type>Select</frontend_type>
|
38 |
+
<source_model>status/words</source_model>
|
39 |
+
<sort_order>30</sort_order>
|
40 |
+
<show_in_default>1</show_in_default>
|
41 |
+
<show_in_website>1</show_in_website>
|
42 |
+
<show_in_store>0</show_in_store>
|
43 |
+
</status>
|
44 |
+
<!--<notification>
|
45 |
+
<label>Notification</label>
|
46 |
+
<frontend_type>Multiselect</frontend_type>
|
47 |
+
<source_model>notification/methods</source_model>
|
48 |
+
<sort_order>40</sort_order>
|
49 |
+
<show_in_default>1</show_in_default>
|
50 |
+
<show_in_website>1</show_in_website>
|
51 |
+
<show_in_store>0</show_in_store>
|
52 |
+
</notification>-->
|
53 |
+
</fields>
|
54 |
+
</messages>
|
55 |
+
</groups>
|
56 |
+
</aftership_options>
|
57 |
+
</sections>
|
58 |
</config>
|
app/code/community/Aftership/Track/sql/track_setup/mysql4-install-0.1.0.php
CHANGED
@@ -1,39 +1,39 @@
|
|
1 |
-
<?php
|
2 |
-
//echo "start";
|
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,
|
12 |
-
`telephone` varchar(255) NOT NULL,
|
13 |
-
`title` varchar(255) NOT NULL,
|
14 |
-
`posted` int(11) NOT NULL DEFAULT '0',
|
15 |
-
`order_id` varchar(255) NOT NULL,
|
16 |
-
PRIMARY KEY (`track_id`),
|
17 |
-
KEY `posted` (`posted`)
|
18 |
-
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
|
19 |
-
|
20 |
-
|
21 |
-
");
|
22 |
-
$installer->endSetup();
|
23 |
-
|
24 |
-
|
25 |
-
//echo 'Running This Upgrade: '.get_class($this)."\n <br /> \n";
|
26 |
-
//die("Exit for now");
|
27 |
-
/*
|
28 |
-
CREATE TABLE `{$installer->getTable('track/user')}` (
|
29 |
-
`user_id` int(11) NOT NULL,
|
30 |
-
`login_name` varchar(255) NOT NULL,
|
31 |
-
`password` varchar(255) NOT NULL,
|
32 |
-
`consumer_key` varchar(255) NOT NULL,
|
33 |
-
`consumer_secret` varchar(255) NOT NULL,
|
34 |
-
`status` int(11) NOT NULL,
|
35 |
-
PRIMARY KEY (`user_id`),
|
36 |
-
KEY `status` (`status`)
|
37 |
-
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
38 |
-
*/
|
39 |
?>
|
1 |
+
<?php
|
2 |
+
//echo "start";
|
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,
|
12 |
+
`telephone` varchar(255) NOT NULL,
|
13 |
+
`title` varchar(255) NOT NULL,
|
14 |
+
`posted` int(11) NOT NULL DEFAULT '0',
|
15 |
+
`order_id` varchar(255) NOT NULL,
|
16 |
+
PRIMARY KEY (`track_id`),
|
17 |
+
KEY `posted` (`posted`)
|
18 |
+
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
|
19 |
+
|
20 |
+
|
21 |
+
");
|
22 |
+
$installer->endSetup();
|
23 |
+
|
24 |
+
|
25 |
+
//echo 'Running This Upgrade: '.get_class($this)."\n <br /> \n";
|
26 |
+
//die("Exit for now");
|
27 |
+
/*
|
28 |
+
CREATE TABLE `{$installer->getTable('track/user')}` (
|
29 |
+
`user_id` int(11) NOT NULL,
|
30 |
+
`login_name` varchar(255) NOT NULL,
|
31 |
+
`password` varchar(255) NOT NULL,
|
32 |
+
`consumer_key` varchar(255) NOT NULL,
|
33 |
+
`consumer_secret` varchar(255) NOT NULL,
|
34 |
+
`status` int(11) NOT NULL,
|
35 |
+
PRIMARY KEY (`user_id`),
|
36 |
+
KEY `status` (`status`)
|
37 |
+
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
38 |
+
*/
|
39 |
?>
|
app/etc/modules/Aftership_Track.xml
CHANGED
@@ -1,9 +1,9 @@
|
|
1 |
-
<?xml version="1.0"?>
|
2 |
-
<config>
|
3 |
-
<modules>
|
4 |
-
<Aftership_Track>
|
5 |
-
<active>true</active>
|
6 |
-
<codePool>community</codePool>
|
7 |
-
</Aftership_Track>
|
8 |
-
</modules>
|
9 |
</config>
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<config>
|
3 |
+
<modules>
|
4 |
+
<Aftership_Track>
|
5 |
+
<active>true</active>
|
6 |
+
<codePool>community</codePool>
|
7 |
+
</Aftership_Track>
|
8 |
+
</modules>
|
9 |
</config>
|
package.xml
CHANGED
@@ -1,18 +1,18 @@
|
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>aftership</name>
|
4 |
-
<version>0.2.
|
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 <https://www.aftership.com/> account at the same time when input in magento shipment. Please go to aftership.com <https://www.aftership.com/> 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>
|
12 |
<authors><author><name>aftership</name><user>aftership</user><email>support@aftership.com</email></author></authors>
|
13 |
-
<date>2012-
|
14 |
-
<time>10:
|
15 |
-
<contents><target name="magecommunity"><dir name="Aftership"><dir name="Track"><dir name="Helper"><file name="Data.php" hash="
|
16 |
<compatible/>
|
17 |
-
<dependencies><required><php><min>5.2.13</min><max>5.4.
|
18 |
</package>
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>aftership</name>
|
4 |
+
<version>0.2.6</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 <https://www.aftership.com/> account at the same time when input in magento shipment. Please go to aftership.com <https://www.aftership.com/> 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>Changed PHP dependency version</notes>
|
12 |
<authors><author><name>aftership</name><user>aftership</user><email>support@aftership.com</email></author></authors>
|
13 |
+
<date>2012-12-18</date>
|
14 |
+
<time>10:02:35</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="87e8b2b2593e5e1b87fa8c282d7151f8"/><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>
|