mobile_assistant_connector - Version 1.3.0

Version Notes

Fixed:
- search restrictions in orders list
- internal changes

*Works only with release of app (2.6.1) and higher

Download this release

Release Info

Developer eMagicOne
Extension mobile_assistant_connector
Version 1.3.0
Comparing to
See all releases


Code changes from version 1.2.9 to 1.3.0

app/code/community/Emagicone/Mobassistantconnector/controllers/IndexController.php CHANGED
@@ -28,7 +28,7 @@ class Emagicone_Mobassistantconnector_IndexController extends Mage_Core_Controll
28
  private $hash_only;
29
  private $session_key;
30
  const GSM_URL = 'https://android.googleapis.com/gcm/send';
31
- const MB_VERSION = '93';
32
 
33
  public function indexAction()
34
  {
@@ -1437,75 +1437,81 @@ class Emagicone_Mobassistantconnector_IndexController extends Mage_Core_Controll
1437
 
1438
  $cur_order = Mage::getModel('sales/order')->load($this->order_id);
1439
 
1440
- $actions = array();
1441
 
1442
- if ($cur_order->canCancel()) {
1443
- $actions[] = 'cancel';
1444
- }
1445
-
1446
- if ($cur_order->canHold()) {
1447
- $actions[] = 'hold';
1448
- }
1449
 
1450
- if ($cur_order->canUnhold()) {
1451
- $actions[] = 'unhold';
1452
- }
1453
-
1454
- if ($cur_order->canShip()) {
1455
- $actions[] = 'ship';
1456
- }
1457
 
1458
- if ($cur_order->canInvoice()) {
1459
- $actions[] = 'invoice';
1460
- }
1461
 
1462
- if ($cur_order->hasInvoices()) {
1463
- $pdf_invoice = 1;
1464
- }
1465
 
1466
- $cus_id = $cur_order->getCustomerId();
 
 
1467
 
1468
- $customer_data = Mage::getModel('customer/customer')->load($cus_id);
 
 
1469
 
1470
- $customerAddressId = $customer_data->getDefaultBilling();
1471
- if ($customerAddressId) {
1472
- $address = Mage::getModel('customer/address')->load($customerAddressId)->toArray();
1473
- if (count($address) > 1) {
1474
- $order_info['telephone'] = $address['telephone'];
1475
  }
1476
- }
1477
 
1478
- if (empty($order_info['telephone'])) {
1479
- $order_info['telephone'] = '';
1480
- }
1481
- $order_info['shipping_method_mag'] = $cur_order->getShippingDescription();
1482
- $order_info['payment_method_mag'] = $cur_order->getPayment()->getMethodInstance()->getTitle();
1483
 
 
1484
 
1485
- $shipmentCollection = Mage::getResourceModel('sales/order_shipment_collection')
1486
- ->setOrderFilter($cur_order)
1487
- ->load();
1488
- $tracks = array();
1489
- foreach ($shipmentCollection as $shipment) {
1490
- foreach ($shipment->getAllTracks() as $tracknum) {
1491
- $track['track_number'] = $tracknum->getTrackNumber();
1492
- $track['title'] = $tracknum->getTitle();
1493
- $track['carrier_code'] = $tracknum->getCarrierCode();
1494
- $track['created_at'] = $tracknum->getCreatedAt();
1495
-
1496
- $tracks[] = $track;
1497
  }
1498
 
1499
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1500
 
1501
- $order_full_info = array('order_info' => $order_info,
1502
- 'order_products' => $order_products,
1503
- 'o_products_count' => $count_prods,
1504
- 'order_tracking' => $tracks,
1505
- 'actions' => $actions);
1506
 
1507
- if ($pdf_invoice) {
1508
- $order_full_info['pdf_invoice'] = $pdf_invoice;
 
 
 
 
1509
  }
1510
 
1511
  return $order_full_info;
@@ -1788,6 +1794,10 @@ class Emagicone_Mobassistantconnector_IndexController extends Mage_Core_Controll
1788
  $options = array();
1789
  $originalCarriers = Mage::getSingleton('shipping/config')->getAllCarriers();
1790
 
 
 
 
 
1791
  if (!$this->group_id) {
1792
  $this->group_id = null;
1793
  }
@@ -2023,7 +2033,7 @@ class Emagicone_Mobassistantconnector_IndexController extends Mage_Core_Controll
2023
  $ordersCollection->getSelect()->limit($this->show, ($this->page - 1) * $this->show);
2024
  }
2025
 
2026
- $customer_orders = null;
2027
  foreach ($ordersCollection as $order) {
2028
  $o_status_label = $order->getStatusLabel();
2029
  $c_order['store_id'] = $order->getStore()->getId();
@@ -2534,7 +2544,7 @@ class Emagicone_Mobassistantconnector_IndexController extends Mage_Core_Controll
2534
  $this->search_val = $this->search_carts;
2535
  }
2536
  if (!empty($this->search_val) && preg_match('/^\d+(?:,\d+)*$/', $this->search_val)) {
2537
- $quotes->addAttributeToFilter('main_table.entity_id', array('eq' => intval($this->search_val)));
2538
  } else if (!empty($this->search_val)) {
2539
  $quotes->getSelect()->where("main_table.`customer_email` LIKE '%" . $this->search_val . "%' OR main_table.`customer_firstname` LIKE '%" . $this->search_val . "%' OR main_table.`customer_lastname` LIKE '%" . $this->search_val . "%' OR CONCAT(`customer_firstname`, ' ', `customer_lastname`) LIKE '%" . $this->search_val . "%'");
2540
  }
28
  private $hash_only;
29
  private $session_key;
30
  const GSM_URL = 'https://android.googleapis.com/gcm/send';
31
+ const MB_VERSION = '94';
32
 
33
  public function indexAction()
34
  {
1437
 
1438
  $cur_order = Mage::getModel('sales/order')->load($this->order_id);
1439
 
1440
+ if (!is_null($cur_order->getEntityId())) {
1441
 
1442
+ $actions = array();
 
 
 
 
 
 
1443
 
1444
+ if ($cur_order->canCancel()) {
1445
+ $actions[] = 'cancel';
1446
+ }
 
 
 
 
1447
 
1448
+ if ($cur_order->canHold()) {
1449
+ $actions[] = 'hold';
1450
+ }
1451
 
1452
+ if ($cur_order->canUnhold()) {
1453
+ $actions[] = 'unhold';
1454
+ }
1455
 
1456
+ if ($cur_order->canShip()) {
1457
+ $actions[] = 'ship';
1458
+ }
1459
 
1460
+ if ($cur_order->canInvoice()) {
1461
+ $actions[] = 'invoice';
1462
+ }
1463
 
1464
+ if ($cur_order->hasInvoices()) {
1465
+ $pdf_invoice = 1;
 
 
 
1466
  }
 
1467
 
1468
+ $cus_id = $cur_order->getCustomerId();
 
 
 
 
1469
 
1470
+ $customer_data = Mage::getModel('customer/customer')->load($cus_id);
1471
 
1472
+ $customerAddressId = $customer_data->getDefaultBilling();
1473
+ if ($customerAddressId) {
1474
+ $address = Mage::getModel('customer/address')->load($customerAddressId)->toArray();
1475
+ if (count($address) > 1) {
1476
+ $order_info['telephone'] = $address['telephone'];
1477
+ }
 
 
 
 
 
 
1478
  }
1479
 
1480
+ if (empty($order_info['telephone'])) {
1481
+ $order_info['telephone'] = '';
1482
+ }
1483
+ $order_info['shipping_method_mag'] = $cur_order->getShippingDescription();
1484
+ $order_info['payment_method_mag'] = $cur_order->getPayment()->getMethodInstance()->getTitle();
1485
+
1486
+
1487
+ $shipmentCollection = Mage::getResourceModel('sales/order_shipment_collection')
1488
+ ->setOrderFilter($cur_order)
1489
+ ->load();
1490
+ $tracks = array();
1491
+ foreach ($shipmentCollection as $shipment) {
1492
+ foreach ($shipment->getAllTracks() as $tracknum) {
1493
+ $track['track_number'] = $tracknum->getTrackNumber();
1494
+ $track['title'] = $tracknum->getTitle();
1495
+ $track['carrier_code'] = $tracknum->getCarrierCode();
1496
+ $track['created_at'] = $tracknum->getCreatedAt();
1497
+
1498
+ $tracks[] = $track;
1499
+ }
1500
+
1501
+ }
1502
 
1503
+ $order_full_info = array('order_info' => $order_info,
1504
+ 'order_products' => $order_products,
1505
+ 'o_products_count' => $count_prods,
1506
+ 'order_tracking' => $tracks,
1507
+ 'actions' => $actions);
1508
 
1509
+ if ($pdf_invoice) {
1510
+ $order_full_info['pdf_invoice'] = $pdf_invoice;
1511
+ }
1512
+
1513
+ } else {
1514
+ $order_full_info = false;
1515
  }
1516
 
1517
  return $order_full_info;
1794
  $options = array();
1795
  $originalCarriers = Mage::getSingleton('shipping/config')->getAllCarriers();
1796
 
1797
+ if (isset($this->store_group_id)) {
1798
+ $this->group_id = $this->store_group_id;
1799
+ }
1800
+
1801
  if (!$this->group_id) {
1802
  $this->group_id = null;
1803
  }
2033
  $ordersCollection->getSelect()->limit($this->show, ($this->page - 1) * $this->show);
2034
  }
2035
 
2036
+ $customer_orders = array();
2037
  foreach ($ordersCollection as $order) {
2038
  $o_status_label = $order->getStatusLabel();
2039
  $c_order['store_id'] = $order->getStore()->getId();
2544
  $this->search_val = $this->search_carts;
2545
  }
2546
  if (!empty($this->search_val) && preg_match('/^\d+(?:,\d+)*$/', $this->search_val)) {
2547
+ $quotes->addFieldToFilter('main_table.entity_id', array('eq' => intval($this->search_val)));
2548
  } else if (!empty($this->search_val)) {
2549
  $quotes->getSelect()->where("main_table.`customer_email` LIKE '%" . $this->search_val . "%' OR main_table.`customer_firstname` LIKE '%" . $this->search_val . "%' OR main_table.`customer_lastname` LIKE '%" . $this->search_val . "%' OR CONCAT(`customer_firstname`, ' ', `customer_lastname`) LIKE '%" . $this->search_val . "%'");
2550
  }
app/code/community/Emagicone/Mobassistantconnector/etc/config.xml CHANGED
@@ -15,7 +15,7 @@
15
 
16
  <modules>
17
  <Emagicone_Mobassistantconnector>
18
- <version>1.2.9</version>
19
  </Emagicone_Mobassistantconnector>
20
  </modules>
21
  <frontend>
15
 
16
  <modules>
17
  <Emagicone_Mobassistantconnector>
18
+ <version>1.3.0</version>
19
  </Emagicone_Mobassistantconnector>
20
  </modules>
21
  <frontend>
package.xml CHANGED
@@ -1,7 +1,7 @@
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>mobile_assistant_connector</name>
4
- <version>1.2.9</version>
5
  <stability>stable</stability>
6
  <license uri="http://www.gnu.org/licenses/gpl.html">GNU</license>
7
  <channel>community</channel>
@@ -9,15 +9,14 @@
9
  <summary>Mobile Assistant Connector</summary>
10
  <description>Mobile Assistant Connector</description>
11
  <notes>Fixed:&#xD;
12
- - stats in dashboard&#xD;
13
- - pagination for order items&#xD;
14
- - improved compatibility with Magento Mobile Assistant 3.0.0.3&#xD;
15
  &#xD;
16
  *Works only with release of app (2.6.1) and higher</notes>
17
  <authors><author><name>eMagicOne</name><user>mobile</user><email>mobile@emagicone.com</email></author></authors>
18
- <date>2016-02-05</date>
19
- <time>12:47:24</time>
20
- <contents><target name="magecommunity"><dir name="Emagicone"><dir name="Mobassistantconnector"><dir name="Helper"><file name="Access.php" hash="c6f4c96ca225bbc72cb829c59f7808f1"/><file name="Data.php" hash="efa0278512e07a2b87bcb4ee3fe80470"/></dir><dir name="Model"><file name="Defpassword.php" hash="921e5344ba325ddf1aaba6aeb2202696"/><file name="Failed.php" hash="7da654c3cf1e9a3f5a55da7f36192117"/><file name="Login.php" hash="bedbce507924854910524fbabe1c4948"/><file name="Observer.php" hash="fbf33b9ed5ae4a05910619d95245d924"/><file name="Order.php" hash="f3d5529e0504ea0265cb661e03f41109"/><file name="Password.php" hash="66e2050ecc7b56deb654b5476ac1746c"/><dir name="Resource"><dir name="Failed"><file name="Collection.php" hash="18980688d80660f6a663a2c4dce20f54"/></dir><file name="Failed.php" hash="a69ca1239d3400097fabc415ee02751b"/><dir name="Sessions"><file name="Collection.php" hash="397e9a6f637472b59abe42bca09ea616"/></dir><file name="Sessions.php" hash="4d9f6cdd340fd95549d287c6107285ac"/></dir><file name="Sessions.php" hash="e3a32e26446e4cd27032c99dde8d4cfa"/></dir><dir name="controllers"><file name="IndexController.php" hash="2920a8ac6c5050916b69f3455ac8d5db"/><dir name="adminhtml"><file name="IndexController.php" hash="e8fc499b74daeef9dbf856e813cbefb8"/></dir></dir><dir name="etc"><file name="adminhtml.xml" hash="333ed888c7f8a1e067821b6547e34340"/><file name="config.xml" hash="a979fa3055925591784094284ba832bb"/><file name="system.xml" hash="916fe7ee643e4dcb15a5498219605896"/></dir><dir name="sql"><dir name="emagicone_mobassistantconnector_setup"><file name="install-1.2.1.php" hash="2394c0bf43b7c8f15fa83d957ed15ffd"/></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Emagicone_Mobassistantconnector.xml" hash="7bb654478173d96ad294000fc9625820"/></dir></target><target name="magelocale"><dir><dir name="en_GB"><file name="Emagicone_Mobassistantconnector.csv" hash="eaf733f81ff47627c4389d487c93709f"/></dir><dir name="en_US"><file name="Emagicone_Mobassistantconnector.csv" hash="510d79a25c0bfb7a096aab57d8c5b458"/></dir><dir name="es_ES"><file name="Emagicone_Mobassistantconnector.csv" hash="acc37c432dd8b4134844291931b70fbf"/></dir><dir name="fr_FR"><file name="Emagicone_Mobassistantconnector.csv" hash="76c48723a6bbd59534781fd3c7f6d86e"/></dir><dir name="ru_RU"><file name="Emagicone_Mobassistantconnector.csv" hash="2346397cbe029dcc724717b953a3f38c"/></dir><dir name="uk_UA"><file name="Emagicone_Mobassistantconnector.csv" hash="cad0e0c3ec7603e6b886d815357d1766"/></dir></dir></target><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><file name="mobassistantconnector.xml" hash="b5c4d423be8de0c5d73d64783dcb9a3c"/></dir><dir name="template"><dir name="mobassistantconnector"><file name="jsinit.phtml" hash="98e914ee799ba8944a0dd9ecb5ebc54b"/></dir></dir></dir></dir></dir></target></contents>
21
  <compatible/>
22
  <dependencies><required><php><min>5.1.0</min><max>6.0.0</max></php><extension><name>curl</name><min>1.0</min><max>3.0</max></extension><extension><name>json</name><min>1.0</min><max>3.0</max></extension><extension><name>date</name><min>1.0</min><max>3.0</max></extension></required></dependencies>
23
  </package>
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>mobile_assistant_connector</name>
4
+ <version>1.3.0</version>
5
  <stability>stable</stability>
6
  <license uri="http://www.gnu.org/licenses/gpl.html">GNU</license>
7
  <channel>community</channel>
9
  <summary>Mobile Assistant Connector</summary>
10
  <description>Mobile Assistant Connector</description>
11
  <notes>Fixed:&#xD;
12
+ - search restrictions in orders list&#xD;
13
+ - internal changes&#xD;
 
14
  &#xD;
15
  *Works only with release of app (2.6.1) and higher</notes>
16
  <authors><author><name>eMagicOne</name><user>mobile</user><email>mobile@emagicone.com</email></author></authors>
17
+ <date>2016-02-10</date>
18
+ <time>15:49:58</time>
19
+ <contents><target name="magecommunity"><dir name="Emagicone"><dir name="Mobassistantconnector"><dir name="Helper"><file name="Access.php" hash="c6f4c96ca225bbc72cb829c59f7808f1"/><file name="Data.php" hash="efa0278512e07a2b87bcb4ee3fe80470"/></dir><dir name="Model"><file name="Defpassword.php" hash="921e5344ba325ddf1aaba6aeb2202696"/><file name="Failed.php" hash="7da654c3cf1e9a3f5a55da7f36192117"/><file name="Login.php" hash="bedbce507924854910524fbabe1c4948"/><file name="Observer.php" hash="fbf33b9ed5ae4a05910619d95245d924"/><file name="Order.php" hash="f3d5529e0504ea0265cb661e03f41109"/><file name="Password.php" hash="66e2050ecc7b56deb654b5476ac1746c"/><dir name="Resource"><dir name="Failed"><file name="Collection.php" hash="18980688d80660f6a663a2c4dce20f54"/></dir><file name="Failed.php" hash="a69ca1239d3400097fabc415ee02751b"/><dir name="Sessions"><file name="Collection.php" hash="397e9a6f637472b59abe42bca09ea616"/></dir><file name="Sessions.php" hash="4d9f6cdd340fd95549d287c6107285ac"/></dir><file name="Sessions.php" hash="e3a32e26446e4cd27032c99dde8d4cfa"/></dir><dir name="controllers"><file name="IndexController.php" hash="7ced4bf13156f35a291e278d746207c3"/><dir name="adminhtml"><file name="IndexController.php" hash="e8fc499b74daeef9dbf856e813cbefb8"/></dir></dir><dir name="etc"><file name="adminhtml.xml" hash="333ed888c7f8a1e067821b6547e34340"/><file name="config.xml" hash="ff38464daf32c4b1535c5a39238364cb"/><file name="system.xml" hash="916fe7ee643e4dcb15a5498219605896"/></dir><dir name="sql"><dir name="emagicone_mobassistantconnector_setup"><file name="install-1.2.1.php" hash="2394c0bf43b7c8f15fa83d957ed15ffd"/></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Emagicone_Mobassistantconnector.xml" hash="7bb654478173d96ad294000fc9625820"/></dir></target><target name="magelocale"><dir><dir name="en_GB"><file name="Emagicone_Mobassistantconnector.csv" hash="eaf733f81ff47627c4389d487c93709f"/></dir><dir name="en_US"><file name="Emagicone_Mobassistantconnector.csv" hash="510d79a25c0bfb7a096aab57d8c5b458"/></dir><dir name="es_ES"><file name="Emagicone_Mobassistantconnector.csv" hash="acc37c432dd8b4134844291931b70fbf"/></dir><dir name="fr_FR"><file name="Emagicone_Mobassistantconnector.csv" hash="76c48723a6bbd59534781fd3c7f6d86e"/></dir><dir name="ru_RU"><file name="Emagicone_Mobassistantconnector.csv" hash="2346397cbe029dcc724717b953a3f38c"/></dir><dir name="uk_UA"><file name="Emagicone_Mobassistantconnector.csv" hash="cad0e0c3ec7603e6b886d815357d1766"/></dir></dir></target><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><file name="mobassistantconnector.xml" hash="b5c4d423be8de0c5d73d64783dcb9a3c"/></dir><dir name="template"><dir name="mobassistantconnector"><file name="jsinit.phtml" hash="98e914ee799ba8944a0dd9ecb5ebc54b"/></dir></dir></dir></dir></dir></target></contents>
20
  <compatible/>
21
  <dependencies><required><php><min>5.1.0</min><max>6.0.0</max></php><extension><name>curl</name><min>1.0</min><max>3.0</max></extension><extension><name>json</name><min>1.0</min><max>3.0</max></extension><extension><name>date</name><min>1.0</min><max>3.0</max></extension></required></dependencies>
22
  </package>