aftership - Version 0.2.9

Version Notes

Added Cron Job

Download this release

Release Info

Developer aftership
Extension aftership
Version 0.2.9
Comparing to
See all releases


Code changes from version 0.2.8 to 0.2.9

app/code/community/Aftership/Track/Model/FrequencyWords.php ADDED
@@ -0,0 +1,16 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Aftership_Track_Model_FrequencyWords
3
+ {
4
+ public function toOptionArray()
5
+ {
6
+ return array(
7
+ array('value'=>0, 'label'=>Mage::helper('aftership')->__('Every 30 minutes')),
8
+ array('value'=>1, 'label'=>Mage::helper('aftership')->__('Every 60 minutes')),
9
+ array('value'=>2, 'label'=>Mage::helper('aftership')->__('Every 6 hours')),
10
+ array('value'=>3, 'label'=>Mage::helper('aftership')->__('Every 12 hours')),
11
+ array('value'=>4, 'label'=>Mage::helper('aftership')->__('Every 24 hours')),
12
+ );
13
+ }
14
+
15
+ }
16
+ ?>
app/code/community/Aftership/Track/Model/Observer.php CHANGED
@@ -2,6 +2,10 @@
2
 
3
  class Aftership_Track_Model_Observer
4
  {
 
 
 
 
5
  public function salesOrderShipmentTrackSaveAfter(Varien_Event_Observer $observer)
6
  {
7
  ob_start();
@@ -68,8 +72,24 @@ class Aftership_Track_Model_Observer
68
  $track->save();
69
  }
70
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
71
 
72
- if (array_key_exists("status", $config) && $config["status"])
73
  {
74
  $api_key = $config["api_key"];
75
 
@@ -82,7 +102,7 @@ class Aftership_Track_Model_Observer
82
 
83
  foreach ($post_tracks as $track) {
84
 
85
- $url = "https://api.aftership.com/v1/trackings";
86
  $url_params["tracking_number"] = $track["tracking_number"];
87
  $url_params["smses[]"] = $track["telephone"];
88
  $url_params["emails[]"] = $track["email"];
@@ -124,7 +144,7 @@ class Aftership_Track_Model_Observer
124
  $track_obj->setPosted(1);
125
  $track_obj->save();*/
126
 
127
- }
128
  }
129
 
130
  ob_end_clean();
@@ -133,55 +153,237 @@ class Aftership_Track_Model_Observer
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
144
- );
145
- $url = "https://api.aftership.com/v1/users/authenticate";
146
-
147
- $ch = curl_init();
148
- curl_setopt($ch, CURLOPT_URL, $url);
149
- curl_setopt($ch, CURLOPT_POST, true);
150
- curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($url_params));
151
- curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
152
- curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 30);
153
- curl_setopt($ch, CURLOPT_HEADER, 0);
154
- curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
155
- curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
156
-
157
- $response = curl_exec($ch);
158
- $error = curl_error($ch);
159
- $http_status = curl_getinfo($ch, CURLINFO_HTTP_CODE);
160
- curl_close($ch);
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
  }
2
 
3
  class Aftership_Track_Model_Observer
4
  {
5
+ const ENDPOINT_TRACKING = 'https://api.aftership.com/v1/trackings';
6
+ const ENDPOINT_CONFIG = 'https://api.aftership.com/v1/users/authenticate';
7
+
8
+
9
  public function salesOrderShipmentTrackSaveAfter(Varien_Event_Observer $observer)
10
  {
11
  ob_start();
72
  $track->save();
73
  }
74
 
75
+ /*
76
+
77
+ $scope = "websites";
78
+ $score_id = (int)Mage::getConfig()->getNode('websites/'.Mage::app()->getWebsite($website_id)->getCode().'/system/website/id');
79
+
80
+ var_dump($website_id);
81
+ var_dump($score_id);
82
+
83
+ $config = Mage::app()->getWebsite($website_id)->getConfig('aftership_options/messages');
84
+ echo '<pre>';
85
+ var_dump($config);
86
+ echo '</pre>';
87
+
88
+ die();
89
+
90
+ */
91
 
92
+ if (array_key_exists("status", $config) && $config["status"])
93
  {
94
  $api_key = $config["api_key"];
95
 
102
 
103
  foreach ($post_tracks as $track) {
104
 
105
+ $url = self::ENDPOINT_TRACKING;
106
  $url_params["tracking_number"] = $track["tracking_number"];
107
  $url_params["smses[]"] = $track["telephone"];
108
  $url_params["emails[]"] = $track["email"];
144
  $track_obj->setPosted(1);
145
  $track_obj->save();*/
146
 
147
+ }
148
  }
149
 
150
  ob_end_clean();
153
  public function adminSystemConfigChangedSectionAftership(Varien_Event_Observer $observer)
154
  {
155
  $post_data = Mage::app()->getRequest()->getPost();
 
156
 
157
+ //$website = Mage::app()->getRequest()->getParam('website');
158
+ //$scope = "websites";
159
+ //$score_id = (int)Mage::getConfig()->getNode('websites/'.$website.'/system/website/id');
160
+
161
+ if (!isset($post_data["groups"]["messages"]["fields"]["api_key"]['inherit']) || $post_data["groups"]["messages"]["fields"]["api_key"]['inherit'] != 1)
162
+ {
163
+ $api_key = $post_data["groups"]["messages"]["fields"]["api_key"]["value"];
164
+
165
+ $url_params = array(
166
+ "api_key" => $api_key
167
+ );
168
+ $url = self::ENDPOINT_CONFIG;
169
+
170
+ $ch = curl_init();
171
+ curl_setopt($ch, CURLOPT_URL, $url);
172
+ curl_setopt($ch, CURLOPT_POST, true);
173
+ curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($url_params));
174
+ curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
175
+ curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 30);
176
+ curl_setopt($ch, CURLOPT_HEADER, 0);
177
+ curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
178
+ curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
179
+
180
+ $response = curl_exec($ch);
181
+ $error = curl_error($ch);
182
+ $http_status = curl_getinfo($ch, CURLINFO_HTTP_CODE);
183
+ curl_close($ch);
184
+ $response_obj = json_decode($response, true);
185
+
186
+ if ($http_status != "200" && $http_status != "401") {
187
+ //Mage::getModel('core/config')->saveConfig('aftership_options/messages/status', 0);
 
 
 
 
 
 
 
188
  /*Mage::getModel('core/config_data')
189
  ->setScope($scope)
190
+ ->setScopeId($score_id)
191
  ->setPath('aftership_options/messages/status')
192
  ->setValue(0)
193
  ->save();*/
194
+ Mage::throwException(Mage::helper('adminhtml')->__("Connection error, please try again later."));
195
+ } else {
196
+ if (!$response_obj["success"]) //error
197
+ {
198
+ //Mage::getModel('core/config')->saveConfig('aftership_options/messages/status', 0);
199
+ /*Mage::getModel('core/config_data')
200
+ ->setScope($scope)
201
+ ->setScopeId($score_id)
202
+ ->setPath('aftership_options/messages/status')
203
+ ->setValue(0)
204
+ ->save();*/
205
+ Mage::throwException(Mage::helper('adminhtml')->__("Incorrect API Key"));
206
+ }
207
+ }
208
+ }
209
+ }
210
+
211
+ /*
212
+ *
213
+ * Cron
214
+ *
215
+ */
216
+
217
+ public function sendTracking($api_key, $tracking_number, $carrier_code, $telephone, $email, $title, $order_id, $customer_name)
218
+ {
219
+ //echo $tracking_number.', '.$telephone.', '.$email.', '.$title.', '.$order_id.', '.$customer_name;
220
+
221
+ //save to table
222
+ $exist_track_data = Mage::getModel('track/track')
223
+ ->getCollection()
224
+ ->addFieldToFilter('tracking_number', array('eq' => $tracking_number))
225
+ ->addFieldToFilter('order_id', array('eq' => $order_id))
226
+ ->getData();
227
+
228
+ if (!$exist_track_data) {
229
+ $track = Mage::getModel('track/track')
230
+ ->setTrackingNumber($tracking_number)
231
+ ->setShipCompCode($carrier_code)
232
+ ->setTitle($title)
233
+ ->setOrderId($order_id)
234
+ ->setEmail($email)
235
+ ->setTelephone($telephone)
236
+ ->setPosted(0)
237
+ ->save();
238
+
239
+ $track_id = $track->getTrackId();
240
+ }
241
+ else
242
+ {
243
+ $track = $exist_track_data[0];
244
+ $track_id = $track['track_id'];
245
+ }
246
 
247
+ //send
248
+ $url = self::ENDPOINT_TRACKING;
249
+
250
+ $url_params = array();
251
+
252
+ $url_params["api_key"] = (string)$api_key;
253
+ $url_params["tracking_number"] = $tracking_number;
254
+ $url_params["smses[]"] = $telephone;
255
+ $url_params["emails[]"] = $email;
256
+ $url_params["title"] = $title;
257
+ $url_params["order_id"] = $order_id;
258
+ $url_params["customer_name"] = $customer_name;
259
+ $url_params["source"] = "magento";
260
+
261
+ $ch = curl_init();
262
+ curl_setopt($ch, CURLOPT_URL, $url);
263
+ curl_setopt($ch, CURLOPT_POST, true);
264
+ curl_setopt($ch, CURLOPT_POSTFIELDS, $url_params);
265
+ curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
266
+ curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 30);
267
+ curl_setopt($ch, CURLOPT_HEADER, 0);
268
+ curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
269
+ curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0); //the SSL is not correct
270
+ curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0); //the SSL is not correct
271
+
272
+ $response = curl_exec($ch);
273
+ $http_status = curl_getinfo($ch, CURLINFO_HTTP_CODE);
274
+ $error = curl_error($ch);
275
+ curl_close($ch);
276
+
277
+ $response_obj = json_decode($response, true);
278
+
279
+ //echo ' status: '.$http_status."\n";
280
+
281
+ //save
282
+ if ($http_status == "201" || $http_status == "422") //422: repeated
283
+ {
284
+ Mage::getModel('track/track')
285
+ ->load($track_id)
286
+ ->setPosted(1)
287
+ ->save();
288
+ }
289
+ }
290
+
291
+ public function cron() {
292
+
293
+ set_time_limit(0);
294
+
295
+ $global_config = Mage::getStoreConfig('aftership_options/messages');
296
+
297
+ $last_update = $global_config['last_update'];
298
+
299
+ //load website config
300
+ $website_config = array();
301
+ foreach (Mage::app()->getWebsites() as $website) {
302
+ $website_id = $website->getId();
303
+ $config = Mage::app()->getWebsite($website_id)->getConfig('aftership_options/messages');
304
+ $website_config[$website_id] = $config;
305
+ }
306
+
307
+ //ob_start();
308
+
309
+ $from = '';
310
+ $to = '';
311
+
312
+ $debug_range = 1;
313
+
314
+ if ($last_update == '0' || !$last_update)
315
+ {
316
+ $from = gmdate('Y-m-d H:i:s', time() - 3*60*60 * $debug_range); //past 3 hours
317
+ $to = gmdate('Y-m-d H:i:s');
318
+ }
319
+ else
320
+ {
321
+ $from = gmdate('Y-m-d H:i:s', $last_update);
322
+ $to = gmdate('Y-m-d H:i:s');
323
+ }
324
+
325
+ //echo "from: ".$from.", to: ".$to."\n";
326
+
327
+ $track_collection = Mage::getResourceModel('sales/order_shipment_track_collection')
328
+ ->addAttributeToFilter('created_at', array(
329
+ 'from' => $from,
330
+ 'to' => $to,
331
+ ))
332
+ ->addAttributeToSort('created_at', 'asc');
333
+
334
+ foreach ($track_collection as $track)
335
+ {
336
+ //echo "order id: ".$track->getOrderId().", tracking number: ".$track->getTrackNumber().", created at: ".$track->getCreatedAt()."\n";
337
+
338
+ $order_shipment = $track->getShipment();
339
+
340
+ $store_id = $order_shipment->getStoreId();
341
+
342
+ if (isset($website_config[$store_id]['status']) && $website_config[$store_id]['status'] == 1 &&
343
+ isset($website_config[$store_id]['cron_job_enable']) && $website_config[$store_id]['cron_job_enable'] == 1) //if website enabled
344
+ {
345
+ //check with existing as_track table and see if sent
346
+ $post_tracks = Mage::getModel('track/track')
347
+ ->getCollection()
348
+ ->addFieldToFilter('posted', array('eq' => 1))
349
+ ->addFieldToFilter('tracking_number', array('eq' => $track->getTrackNumber()))
350
+ ->getData();
351
+
352
+ if (count($post_tracks) == 0) //if not sent
353
+ {
354
+ $order = $order_shipment->getOrder();
355
+ $shipping_address = $order->getShippingAddress();
356
+
357
+ $api_key = $website_config[$store_id]['api_key'];
358
+ $telephone = $shipping_address->getTelephone();
359
+ $carrier_code = $track->getCarrierCode();
360
+ $email = $order->getCustomerEmail();
361
+ $title = $order->getIncrementId();
362
+ $order_id = $order->getIncrementId();
363
+ $customer_name = $shipping_address->getFirstname()." ".$shipping_address->getLastname();
364
+
365
+ $this->sendTracking($api_key, $track->getTrackNumber(), $carrier_code, $telephone, $email, $title, $order_id, $customer_name);
366
+ }
367
+ }
368
+ }
369
+
370
+ //Mage::log(ob_get_clean());
371
+
372
+ //update time ONLY if success
373
+ Mage::getModel('core/config')->saveConfig('aftership_options/messages/last_update', time());
374
+
375
+ foreach (Mage::app()->getWebsites() as $website) {
376
+ $website_id = $website->getId();
377
+ $scope = "websites";
378
+ $scope_id = (int)Mage::getConfig()->getNode('websites/'.Mage::app()->getWebsite($website_id)->getCode().'/system/website/id');
379
+
380
+ Mage::getModel('core/config_data')
381
+ ->setScope($scope)
382
+ ->setScopeId($scope_id)
383
+ ->setPath('aftership_options/messages/last_update')
384
+ ->setValue(time())
385
+ ->save();
386
+
387
+ }
388
+ }
389
  }
app/code/community/Aftership/Track/etc/config.xml CHANGED
@@ -1,7 +1,16 @@
1
  <?xml version="1.0"?>
2
  <config>
 
 
 
 
 
 
3
  <global>
4
  <models>
 
 
 
5
  <track>
6
  <class>Aftership_Track_Model</class>
7
  <resourceModel>track_mysql4</resourceModel>
@@ -15,11 +24,14 @@
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>
@@ -51,11 +63,20 @@
51
  </aftership>
52
  </helpers>
53
  </global>
54
- <modules>
55
- <Aftership_Track>
56
- <version>0.2.8</version>
57
- </Aftership_Track>
58
- </modules>
 
 
 
 
 
 
 
 
 
59
  <frontend>
60
  <routers>
61
  <track>
@@ -67,6 +88,7 @@
67
  </track>
68
  </routers>
69
  </frontend>
 
70
  <adminhtml>
71
  <layout>
72
  <updates>
1
  <?xml version="1.0"?>
2
  <config>
3
+ <modules>
4
+ <Aftership_Track>
5
+ <version>0.2.9</version>
6
+ </Aftership_Track>
7
+ </modules>
8
+
9
  <global>
10
  <models>
11
+ <aftershiptrackcron>
12
+ <class>Aftership_Track_Model</class>
13
+ </aftershiptrackcron>
14
  <track>
15
  <class>Aftership_Track_Model</class>
16
  <resourceModel>track_mysql4</resourceModel>
24
  <!--<user>
25
  <table>as_user</table>
26
  </user>-->
27
+ </entities>
28
  </track_mysql4>
29
  <status>
30
  <class>Aftership_Track_Model</class>
31
  </status>
32
+ <cron_job>
33
+ <class>Aftership_Track_Model</class>
34
+ </cron_job>
35
  <notification>
36
  <class>Aftership_Track_Model</class>
37
  </notification>
63
  </aftership>
64
  </helpers>
65
  </global>
66
+
67
+ <crontab>
68
+ <jobs>
69
+ <aftershiptrackcron>
70
+ <schedule>
71
+ <cron_expr>0 */3 * * *</cron_expr>
72
+ </schedule>
73
+ <run>
74
+ <model>aftershiptrackcron/observer::cron</model>
75
+ </run>
76
+ </aftershiptrackcron>
77
+ </jobs>
78
+ </crontab>
79
+
80
  <frontend>
81
  <routers>
82
  <track>
88
  </track>
89
  </routers>
90
  </frontend>
91
+
92
  <adminhtml>
93
  <layout>
94
  <updates>
app/code/community/Aftership/Track/etc/system.xml CHANGED
@@ -42,6 +42,32 @@
42
  <show_in_website>1</show_in_website>
43
  <show_in_store>0</show_in_store>
44
  </status>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
45
  <!--<notification>
46
  <label>Notification</label>
47
  <frontend_type>Multiselect</frontend_type>
42
  <show_in_website>1</show_in_website>
43
  <show_in_store>0</show_in_store>
44
  </status>
45
+ <cron_job_enable>
46
+ <label>Enable Cron Job</label>
47
+ <frontend_type>Select</frontend_type>
48
+ <source_model>cron_job/words</source_model>
49
+ <sort_order>40</sort_order>
50
+ <show_in_default>1</show_in_default>
51
+ <show_in_website>1</show_in_website>
52
+ <show_in_store>0</show_in_store>
53
+ </cron_job_enable>
54
+ <cron_job_frequency>
55
+ <label>Cron Job Frequency</label>
56
+ <frontend_type>Select</frontend_type>
57
+ <source_model>cron_job/frequencywords</source_model>
58
+ <sort_order>50</sort_order>
59
+ <show_in_default>0</show_in_default>
60
+ <show_in_website>0</show_in_website>
61
+ <show_in_store>0</show_in_store>
62
+ </cron_job_frequency>
63
+ <last_update>
64
+ <label>Last Update</label>
65
+ <frontend_type>text</frontend_type>
66
+ <sort_order>60</sort_order>
67
+ <show_in_default>0</show_in_default>
68
+ <show_in_website>0</show_in_website>
69
+ <show_in_store>0</show_in_store>
70
+ </last_update>
71
  <!--<notification>
72
  <label>Notification</label>
73
  <frontend_type>Multiselect</frontend_type>
app/code/community/Aftership/Track/sql/track_setup/{mysql4-install-0.2.8.php → mysql4-install-0.2.9.php} RENAMED
@@ -1,13 +1,11 @@
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
-
11
  `tracking_number` varchar(255) NOT NULL,
12
  `ship_comp_code` varchar(255) NOT NULL,
13
  `email` varchar(255) NOT NULL,
@@ -23,19 +21,4 @@ CREATE TABLE `{$installer->getTable('track/track')}` (
23
  ");
24
  $installer->endSetup();
25
 
26
-
27
- //echo 'Running This Upgrade: '.get_class($this)."\n <br /> \n";
28
- //die("Exit for now");
29
- /*
30
- CREATE TABLE `{$installer->getTable('track/user')}` (
31
- `user_id` int(11) NOT NULL,
32
- `login_name` varchar(255) NOT NULL,
33
- `password` varchar(255) NOT NULL,
34
- `consumer_key` varchar(255) NOT NULL,
35
- `consumer_secret` varchar(255) NOT NULL,
36
- `status` int(11) NOT NULL,
37
- PRIMARY KEY (`user_id`),
38
- KEY `status` (`status`)
39
- ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
40
- */
41
  ?>
1
  <?php
2
+
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,
21
  ");
22
  $installer->endSetup();
23
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
24
  ?>
app/code/community/Aftership/Track/sql/track_setup/{mysql4-upgrade-0.0.1-0.2.8.php → mysql4-upgrade-0.2.8-0.2.9.php} RENAMED
@@ -1,9 +1,8 @@
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,
@@ -22,19 +21,4 @@ CREATE TABLE `{$installer->getTable('track/track')}` (
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
  ?>
1
  <?php
2
+
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,
21
  ");
22
  $installer->endSetup();
23
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
24
  ?>
package.xml CHANGED
@@ -1,18 +1,18 @@
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>
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>aftership</name>
4
+ <version>0.2.9</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>Added Cron Job</notes>
12
+ <authors><author><name>aftership</name><user>aftership</user><email>support@aftership.com</email></author></authors>
13
+ <date>2013-03-22</date>
14
+ <time>05:03:11</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="FrequencyWords.php" hash="91aad25bcba1c0f8433ab0f297f50614"/><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="0fd42279783d6121e8ace57a8dd24017"/><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="adminhtml.xml" hash="cadc113478c285edf9f43c7506f6ba89"/><file name="config.xml" hash="71ed4bcbd51777bddbcd58a2f8ea1586"/><file name="system.xml" hash="7dd1b39b8d00a0c3775c997bb223d2df"/></dir><dir name="sql"><dir name="track_setup"><file name="mysql4-install-0.2.9.php" hash="7639b6303191813f78441a6d7297e0d1"/><file name="mysql4-upgrade-0.2.8-0.2.9.php" hash="7639b6303191813f78441a6d7297e0d1"/></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><required><php><min>5.2.13</min><max>5.4.13</max></php></required></dependencies>
18
  </package>