magento_mobile_assistant_manager - Version 0.2.2

Version Notes

-Provided theme change from Dashboard
-Enhanced Notification

Download this release

Release Info

Developer Biztech
Extension magento_mobile_assistant_manager
Version 0.2.2
Comparing to
See all releases


Code changes from version 0.2.1 to 0.2.2

app/code/local/Biztech/All/Model/Update.php CHANGED
@@ -34,50 +34,56 @@
34
  $feedData = array();
35
  $extensio_module = array();
36
  try{
37
- $xml = file_get_contents(self::UPDATE_NOTIFICATION_FEED_URL);
 
 
38
  $xml = simplexml_load_string($xml, 'SimpleXMLElement', LIBXML_NOCDATA);//LIBXML_NOCDATA LIBXML_NOWARNING
39
 
40
- $interests = $this->getInterests();
41
- if(!empty($interests[0])){
42
- $isInterestedInSelfUpgrades = in_array(Biztech_All_Model_Source_Updates_Type::TYPE_INSTALLED_UPDATE, $interests);
43
- $isInterestedInAllUpgrades = in_array(Biztech_All_Model_Source_Updates_Type::TYPE_UPDATE_RELEASE, $interests);
44
- $modules = Mage::getConfig()->getNode('modules')->children();
45
- $modulesArray = (array)$modules;
46
- foreach($xml->channel->item as $keys=>$extensions) {
47
- $types[] = (string) $extensions->update_notifications->type;
48
- $extensions_name = (string)$extensions->update_notifications->extensions;
 
49
 
50
- if((string)$extensions->update_notifications->date!=""&&(string)$extensions->update_notifications->extension_title!=""&&(string)$extensions->update_notifications->extension_content!=""&&(string)$extensions->update_notifications->product_url!=""){
51
- if(!$isInterestedInAllUpgrades){
52
- if ($this->isExtensionInstalled($extensions_name)) {
53
- $feedData[] = array(
 
 
 
 
 
 
 
 
 
54
  'severity' => 4,
55
- 'date_added' => (string) $extensions->update_notifications->date,
56
  'title' => (string)$extensions->update_notifications->extension_title,
57
  'description' => (string)$extensions->update_notifications->extension_content,
58
  'url' => (string)$extensions->update_notifications->product_url,
59
  );
60
- }
61
- } else{
62
- $feedData[] = array(
63
- 'severity' => 4,
64
- 'date_added' => (string)$extensions->update_notifications->date,
65
- 'title' => (string)$extensions->update_notifications->extension_title,
66
- 'description' => (string)$extensions->update_notifications->extension_content,
67
- 'url' => (string)$extensions->update_notifications->product_url,
68
- );
69
  }
70
  }
71
- }
72
- if ($feedData) {
73
- foreach($feedData as $data){
74
- if ((array_intersect($types,$interests) && $isInterestedInSelfUpgrades)) {
75
- Mage::getModel('adminnotification/inbox')->parse(array_reverse(array($data)));
76
  }
77
- }
78
- }
79
- Mage::app()->saveCache(time(), 'biztech_all_updates_feed_lastcheck');
80
- return true;
 
 
81
  }
82
  }catch (Exception $e) {
83
  Mage::getSingleton('adminhtml/session')->addError($e->getMessage());
34
  $feedData = array();
35
  $extensio_module = array();
36
  try{
37
+ $xml = false;
38
+ $limit_context = stream_context_create(array('http'=>array('timeout' => 5)));
39
+ $xml = file_get_contents(self::UPDATE_NOTIFICATION_FEED_URL,true,$limit_context);
40
  $xml = simplexml_load_string($xml, 'SimpleXMLElement', LIBXML_NOCDATA);//LIBXML_NOCDATA LIBXML_NOWARNING
41
 
42
+ if($xml != false){
43
+ $interests = $this->getInterests();
44
+ if(!empty($interests[0])){
45
+ $isInterestedInSelfUpgrades = in_array(Biztech_All_Model_Source_Updates_Type::TYPE_INSTALLED_UPDATE, $interests);
46
+ $isInterestedInAllUpgrades = in_array(Biztech_All_Model_Source_Updates_Type::TYPE_UPDATE_RELEASE, $interests);
47
+ $modules = Mage::getConfig()->getNode('modules')->children();
48
+ $modulesArray = (array)$modules;
49
+ foreach($xml->channel->item as $keys=>$extensions) {
50
+ $types[] = (string) $extensions->update_notifications->type;
51
+ $extensions_name = (string)$extensions->update_notifications->extensions;
52
 
53
+ if((string)$extensions->update_notifications->date!=""&&(string)$extensions->update_notifications->extension_title!=""&&(string)$extensions->update_notifications->extension_content!=""&&(string)$extensions->update_notifications->product_url!=""){
54
+ if(!$isInterestedInAllUpgrades){
55
+ if ($this->isExtensionInstalled($extensions_name)) {
56
+ $feedData[] = array(
57
+ 'severity' => 4,
58
+ 'date_added' => (string) $extensions->update_notifications->date,
59
+ 'title' => (string)$extensions->update_notifications->extension_title,
60
+ 'description' => (string)$extensions->update_notifications->extension_content,
61
+ 'url' => (string)$extensions->update_notifications->product_url,
62
+ );
63
+ }
64
+ } else{
65
+ $feedData[] = array(
66
  'severity' => 4,
67
+ 'date_added' => (string)$extensions->update_notifications->date,
68
  'title' => (string)$extensions->update_notifications->extension_title,
69
  'description' => (string)$extensions->update_notifications->extension_content,
70
  'url' => (string)$extensions->update_notifications->product_url,
71
  );
72
+ }
 
 
 
 
 
 
 
 
73
  }
74
  }
75
+ if ($feedData) {
76
+ foreach($feedData as $data){
77
+ if ((array_intersect($types,$interests) && $isInterestedInSelfUpgrades)) {
78
+ Mage::getModel('adminnotification/inbox')->parse(array_reverse(array($data)));
79
+ }
80
  }
81
+ }
82
+ Mage::app()->saveCache(time(), 'biztech_all_updates_feed_lastcheck');
83
+ return true;
84
+ }
85
+ } else{
86
+ return false;
87
  }
88
  }catch (Exception $e) {
89
  Mage::getSingleton('adminhtml/session')->addError($e->getMessage());
app/code/local/Biztech/All/etc/config.xml CHANGED
@@ -1,16 +1,16 @@
1
  <?xml version="1.0"?>
2
  <!--
3
  /**
4
- * @category Biztech
5
- * @package Biztech_All
6
- * @author ModuleCreator
7
- * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
8
- */
9
- -->
10
  <config>
11
  <modules>
12
  <Biztech_All>
13
- <version>0.1.1</version>
14
  </Biztech_All>
15
  </modules>
16
  <frontend>
@@ -23,38 +23,58 @@
23
  </args>
24
  </all>
25
  </routers>
 
 
 
 
 
 
 
26
  </frontend>
27
  <admin>
28
  <routers>
29
- <adminhtml>
30
- <args>
31
- <module>
32
- <all>Biztech_All_Adminhtml</all>
33
- </module>
34
- </args>
35
- </adminhtml>
36
  </routers>
37
  </admin>
38
  <adminhtml>
39
- <acl>
40
- <resources>
41
- <all>
42
- <title>Allow Everything</title>
43
- </all>
44
- <admin>
45
- <children>
46
- <Biztech_All>
47
- <title>All Module</title>
48
- <sort_order>10</sort_order>
49
- </Biztech_All>
50
- </children>
51
- </admin>
52
- </resources>
53
- </acl>
 
 
 
 
 
 
 
 
 
 
 
 
 
54
  <events>
55
  <controller_action_predispatch>
56
  <observers>
57
-
58
  <bzall_upds>
59
  <type>singleton</type>
60
  <class>all/update</class>
@@ -63,6 +83,13 @@
63
  </observers>
64
  </controller_action_predispatch>
65
  </events>
 
 
 
 
 
 
 
66
  </adminhtml>
67
  <global>
68
  <models>
1
  <?xml version="1.0"?>
2
  <!--
3
  /**
4
+ * @category Biztech
5
+ * @package Biztech_All
6
+ * @author ModuleCreator
7
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
8
+ */
9
+ -->
10
  <config>
11
  <modules>
12
  <Biztech_All>
13
+ <version>0.1.0</version>
14
  </Biztech_All>
15
  </modules>
16
  <frontend>
23
  </args>
24
  </all>
25
  </routers>
26
+ <!--<layout>
27
+ <updates>
28
+ <all>
29
+ <file>all.xml</file>
30
+ </all>
31
+ </updates>
32
+ </layout>-->
33
  </frontend>
34
  <admin>
35
  <routers>
36
+ <all>
37
+ <use>admin</use>
38
+ <args>
39
+ <module>Biztech_All</module>
40
+ <frontName>all</frontName>
41
+ </args>
42
+ </all>
43
  </routers>
44
  </admin>
45
  <adminhtml>
46
+ <!--<menu>
47
+ <all module="all">
48
+ <title>All</title>
49
+ <sort_order>71</sort_order>
50
+ <children>
51
+ <items module="all">
52
+ <title>Manage Items</title>
53
+ <sort_order>0</sort_order>
54
+ <action>all/adminhtml_all</action>
55
+ </items>
56
+ </children>
57
+ </all>
58
+ </menu> -->
59
+ <acl>
60
+ <resources>
61
+ <all>
62
+ <title>Allow Everything</title>
63
+ </all>
64
+ <admin>
65
+ <children>
66
+ <Biztech_All>
67
+ <title>All Module</title>
68
+ <sort_order>10</sort_order>
69
+ </Biztech_All>
70
+ </children>
71
+ </admin>
72
+ </resources>
73
+ </acl>
74
  <events>
75
  <controller_action_predispatch>
76
  <observers>
77
+
78
  <bzall_upds>
79
  <type>singleton</type>
80
  <class>all/update</class>
83
  </observers>
84
  </controller_action_predispatch>
85
  </events>
86
+ <!--<layout>
87
+ <updates>
88
+ <all>
89
+ <file>all.xml</file>
90
+ </all>
91
+ </updates>
92
+ </layout> -->
93
  </adminhtml>
94
  <global>
95
  <models>
app/code/local/Biztech/Mobileassistant/Helper/Data.php CHANGED
@@ -120,6 +120,7 @@
120
  if($msgString == null){
121
  $msgString = Mage::helper('mobileassistant')->__('A New order has been received on the Store.');
122
  }
 
123
  $message =$msgString."\nOrder Id: ".$order->getIncrementId()."\nGrand Total: ".$this->getPrice($order->getGrandTotal(),$order->getStoreId(),$order->getOrderCurrencyCode());
124
 
125
  }else if($notification_type == 'product'){
120
  if($msgString == null){
121
  $msgString = Mage::helper('mobileassistant')->__('A New order has been received on the Store.');
122
  }
123
+ Mage::log('ordernoti',null);
124
  $message =$msgString."\nOrder Id: ".$order->getIncrementId()."\nGrand Total: ".$this->getPrice($order->getGrandTotal(),$order->getStoreId(),$order->getOrderCurrencyCode());
125
 
126
  }else if($notification_type == 'product'){
app/code/local/Biztech/Mobileassistant/Model/Observer.php CHANGED
@@ -1,111 +1,136 @@
1
  <?php
2
- class Biztech_Mobileassistant_Model_Observer
3
- {
4
- private static $_handleCustomerFirstOrderCounter = 1;
5
- private static $_handleCustomerFirstRegisterNotificationCounter = 1;
6
 
 
7
 
8
- /*inventory status-starts*/
9
- public function catalogInventorySave(Varien_Event_Observer $observer)
10
- {
11
- if (Mage::getStoreConfig('mobileassistant/mobileassistant_general/enabled')) {
12
- $event = $observer->getEvent();
13
- $_item = $event->getItem();
14
- $params = array();
15
- $params['product_id'] = $_item->getProductId();
16
- $params['name'] = Mage::getModel('catalog/product')->load($params['product_id'])->getName();
17
- $params['qty'] = $_item->getQty();
18
- $minQty = Mage::getStoreConfig('mobileassistant/mobileassistant_general/minimum_qty');
19
- if($params['qty'] <= $minQty){
20
- Mage::helper('mobileassistant')->pushNotification('product',$params['product_id'],$params);
 
 
 
 
 
 
 
 
21
  }
22
  }
23
  }
 
24
 
25
-
26
- public function subtractQuoteInventory(Varien_Event_Observer $observer)
27
- {
28
- if (Mage::getStoreConfig('mobileassistant/mobileassistant_general/enabled')) {
29
- $quote = $observer->getEvent()->getQuote();
30
- foreach ($quote->getAllItems() as $item) {
31
- $params = array();
32
- $params['product_id'] = $item->getProductId();
33
- $params['name'] = $item->getName();
34
- $params['qty'] = $item->getProduct()->getStockItem()->getQty() - $item->getTotalQty();
35
- $minQty = Mage::getStoreConfig('mobileassistant/mobileassistant_general/minimum_qty');
36
- if(($params['qty']) <= $minQty){
37
- Mage::helper('mobileassistant')->pushNotification('product',$params['product_id'],$params);
 
 
38
  }
39
-
40
  }
41
  }
42
  }
 
43
 
44
- public function revertQuoteInventory(Varien_Event_Observer $observer)
45
- {
46
- if (Mage::getStoreConfig('mobileassistant/mobileassistant_general/enabled')) {
47
- $quote = $observer->getEvent()->getQuote();
48
- foreach ($quote->getAllItems() as $item) {
49
- $params = array();
50
- $params['product_id'] = $item->getProductId();
51
- $params['name'] = $item->getName();
52
- $params['qty'] = $item->getProduct()->getStockItem()->getQty() + $item->getTotalQty();
53
- $minQty = Mage::getStoreConfig('mobileassistant/mobileassistant_general/minimum_qty');
54
- if(($params['qty']) <= $minQty){
55
- Mage::helper('mobileassistant')->pushNotification('product',$params['product_id'],$params);
 
 
 
56
  }
57
  }
58
  }
59
  }
 
60
 
61
- /*inventory status- ends*/
62
-
63
 
64
- public function sales_order_save_after(Varien_Event_Observer $observer)
65
- {
66
- if(Mage::getStoreConfig('mobileassistant/mobileassistant_general/enabled')){
67
 
68
- $action = Mage::app()->getFrontController()->getAction();
69
- if ($action->getFullActionName() == 'checkout_onepage_saveOrder')
70
- {
71
- if (self::$_handleCustomerFirstOrderCounter > 1) {
72
- return $this;
73
- }
74
- self::$_handleCustomerFirstOrderCounter++;
75
- $result = Mage::helper('mobileassistant')->pushNotification('order',$observer->getEvent()->getOrder()->getId());
 
 
 
 
 
76
 
77
- $quoteId = $observer->getEvent()->getOrder()->getData('quote_id');
78
- $quote = Mage::getModel('sales/quote')->load($quoteId);
79
- $method = $quote->getCheckoutMethod(true);
80
 
81
- if ($method=='register'){
82
- Mage::dispatchEvent('customer_register_checkout',
83
- array(
84
- 'customer' => $observer->getEvent()->getOrder()->getCustomer()
85
  )
86
- );
87
- }
88
  }
89
  }
90
  }
 
91
 
92
- public function customerRegisterNotification(Varien_Event_Observer $observer){
93
- if(Mage::getStoreConfig('mobileassistant/mobileassistant_general/enabled')){
94
- $customer = $observer->getEvent()->getCustomer();
95
- if ($customer){
96
- $customer_id = $customer->getId();
97
- }
98
- if ($customer_id){
99
- $result = Mage::helper('mobileassistant')->pushNotification('customer',$customer_id);
 
 
 
 
100
  }
101
- }
102
  }
 
103
 
104
- public function customerRegisterNotificationCheckout(Varien_Event_Observer $observer){
105
- $customer = $observer->getEvent()->getCustomer();
106
- if ($customer){
107
- $customer_id = $customer->getId();
108
- $result = Mage::helper('mobileassistant')->pushNotification('customer',$customer_id);
109
- }
 
 
 
 
110
  }
111
  }
 
 
1
  <?php
 
 
 
 
2
 
3
+ class Biztech_Mobileassistant_Model_Observer {
4
 
5
+ private static $_handleCustomerFirstOrderCounter = 1;
6
+ private static $_handleCustomerFirstRegisterNotificationCounter = 1;
7
+
8
+ /* inventory status-starts */
9
+
10
+ public function catalogInventorySave(Varien_Event_Observer $observer) {
11
+ if (Mage::getStoreConfig('mobileassistant/mobileassistant_general/enabled')) {
12
+ $event = $observer->getEvent();
13
+ $_item = $event->getItem();
14
+ $params = array();
15
+ $params['product_id'] = $_item->getProductId();
16
+ $params['name'] = Mage::getModel('catalog/product')->load($params['product_id'])->getName();
17
+ $params['qty'] = $_item->getQty();
18
+ $minQty = Mage::getStoreConfig('mobileassistant/mobileassistant_general/minimum_qty');
19
+
20
+ $data = array();
21
+ $data['status'] = Mage::getStoreConfig('mobileassistant/mobileassistant_general/notification');
22
+ $statuses = explode(",", $data['status']);
23
+ if (in_array('product_notification', $statuses)) {
24
+ if ($params['qty'] <= $minQty) {
25
+ Mage::helper('mobileassistant')->pushNotification('product', $params['product_id'], $params);
26
  }
27
  }
28
  }
29
+ }
30
 
31
+ public function subtractQuoteInventory(Varien_Event_Observer $observer) {
32
+ if (Mage::getStoreConfig('mobileassistant/mobileassistant_general/enabled')) {
33
+ $quote = $observer->getEvent()->getQuote();
34
+ foreach ($quote->getAllItems() as $item) {
35
+ $params = array();
36
+ $params['product_id'] = $item->getProductId();
37
+ $params['name'] = $item->getName();
38
+ $params['qty'] = $item->getProduct()->getStockItem()->getQty() - $item->getTotalQty();
39
+ $minQty = Mage::getStoreConfig('mobileassistant/mobileassistant_general/minimum_qty');
40
+ $data = array();
41
+ $data['status'] = Mage::getStoreConfig('mobileassistant/mobileassistant_general/notification');
42
+ $statuses = explode(",", $data['status']);
43
+ if (in_array('product_notification', $statuses)) {
44
+ if (($params['qty']) <= $minQty) {
45
+ Mage::helper('mobileassistant')->pushNotification('product', $params['product_id'], $params);
46
  }
 
47
  }
48
  }
49
  }
50
+ }
51
 
52
+ public function revertQuoteInventory(Varien_Event_Observer $observer) {
53
+ if (Mage::getStoreConfig('mobileassistant/mobileassistant_general/enabled')) {
54
+ $quote = $observer->getEvent()->getQuote();
55
+ foreach ($quote->getAllItems() as $item) {
56
+ $params = array();
57
+ $params['product_id'] = $item->getProductId();
58
+ $params['name'] = $item->getName();
59
+ $params['qty'] = $item->getProduct()->getStockItem()->getQty() + $item->getTotalQty();
60
+ $minQty = Mage::getStoreConfig('mobileassistant/mobileassistant_general/minimum_qty');
61
+ $data = array();
62
+ $data['status'] = Mage::getStoreConfig('mobileassistant/mobileassistant_general/notification');
63
+ $statuses = explode(",", $data['status']);
64
+ if (in_array('product_notification', $statuses)) {
65
+ if (($params['qty']) <= $minQty) {
66
+ Mage::helper('mobileassistant')->pushNotification('product', $params['product_id'], $params);
67
  }
68
  }
69
  }
70
  }
71
+ }
72
 
73
+ /* inventory status- ends */
 
74
 
75
+ public function sales_order_save_after(Varien_Event_Observer $observer) {
76
+ if (Mage::getStoreConfig('mobileassistant/mobileassistant_general/enabled')) {
 
77
 
78
+ $action = Mage::app()->getFrontController()->getAction();
79
+ if ($action->getFullActionName() == 'checkout_onepage_saveOrder') {
80
+ if (self::$_handleCustomerFirstOrderCounter > 1) {
81
+ return $this;
82
+ }
83
+ self::$_handleCustomerFirstOrderCounter++;
84
+
85
+ $data = array();
86
+ $data['status'] = Mage::getStoreConfig('mobileassistant/mobileassistant_general/notification');
87
+ $statuses = explode(",", $data['status']);
88
+ if (in_array('order_notification', $statuses)) {
89
+ $result = Mage::helper('mobileassistant')->pushNotification('order', $observer->getEvent()->getOrder()->getId());
90
+ }
91
 
92
+ $quoteId = $observer->getEvent()->getOrder()->getData('quote_id');
93
+ $quote = Mage::getModel('sales/quote')->load($quoteId);
94
+ $method = $quote->getCheckoutMethod(true);
95
 
96
+ if ($method == 'register') {
97
+ Mage::dispatchEvent('customer_register_checkout', array(
98
+ 'customer' => $observer->getEvent()->getOrder()->getCustomer()
 
99
  )
100
+ );
 
101
  }
102
  }
103
  }
104
+ }
105
 
106
+ public function customerRegisterNotification(Varien_Event_Observer $observer) {
107
+ if (Mage::getStoreConfig('mobileassistant/mobileassistant_general/enabled')) {
108
+ $customer = $observer->getEvent()->getCustomer();
109
+ if ($customer) {
110
+ $customer_id = $customer->getId();
111
+ }
112
+ if ($customer_id) {
113
+ $data = array();
114
+ $data['status'] = Mage::getStoreConfig('mobileassistant/mobileassistant_general/notification');
115
+ $statuses = explode(",", $data['status']);
116
+ if (in_array('customer_notification', $statuses)) {
117
+ $result = Mage::helper('mobileassistant')->pushNotification('customer', $customer_id);
118
  }
119
+ }
120
  }
121
+ }
122
 
123
+ public function customerRegisterNotificationCheckout(Varien_Event_Observer $observer) {
124
+ $customer = $observer->getEvent()->getCustomer();
125
+ if ($customer) {
126
+ $customer_id = $customer->getId();
127
+ $data = array();
128
+ $data['status'] = Mage::getStoreConfig('mobileassistant/mobileassistant_general/notification');
129
+ $statuses = explode(",", $data['status']);
130
+ if (in_array('customer_notification', $statuses)) {
131
+ $result = Mage::helper('mobileassistant')->pushNotification('customer', $customer_id);
132
+ }
133
  }
134
  }
135
+
136
+ }
app/code/local/Biztech/Mobileassistant/Model/System/Config/Notification.php ADDED
@@ -0,0 +1,23 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Biztech_Mobileassistant_Model_System_Config_Notification {
4
+
5
+ public function toOptionArray() {
6
+ $optionArray = array(
7
+ array(
8
+ 'value' => 'order_notification',
9
+ 'label' => 'Order Notification',
10
+ ),
11
+ array(
12
+ 'value' => 'product_notification',
13
+ 'label' => 'Product Notification',
14
+ ),
15
+ array(
16
+ 'value' => 'customer_notification',
17
+ 'label' => 'Customer Notification',
18
+ ));
19
+
20
+ return $optionArray;
21
+ }
22
+
23
+ }
app/code/local/Biztech/Mobileassistant/controllers/DashboardController.php CHANGED
@@ -28,7 +28,7 @@ class Biztech_Mobileassistant_DashboardController extends Mage_Core_Controller_F
28
  $now = Mage::getModel('core/date')->timestamp(time());
29
  $end_date = date('Y-m-d 23:59:59', $now);
30
  $start_date = '';
31
- $orderCollection = Mage::getModel('sales/order')->getCollection()->addFieldToFilter('store_id', Array('eq' => $storeId))->addFieldToFilter('status', Array('eq' => 'complete'))->setOrder('entity_id', 'desc');
32
  if ($type_id == 7) {
33
  $start_date = date('Y-m-d 00:00:00', strtotime('-6 days'));
34
  } elseif ($type_id == 30) {
@@ -74,7 +74,7 @@ class Biztech_Mobileassistant_DashboardController extends Mage_Core_Controller_F
74
  }
75
  $count = 0;
76
  foreach ($dates as $date) {
77
- $orderCollectionByDate = Mage::getModel('sales/order')->getCollection()->addFieldToFilter('store_id', Array('eq' => $storeId))->addFieldToFilter('status', Array('eq' => 'complete'))->setOrder('entity_id', 'desc');
78
 
79
  if ($type_id == 24) {
80
  if ($count == 23) {
@@ -132,7 +132,7 @@ class Biztech_Mobileassistant_DashboardController extends Mage_Core_Controller_F
132
  $dates = $this->getDatesFromRange($first_day, $last_day);
133
 
134
  foreach ($dates as $date) {
135
- $orderCollectionByDate = Mage::getModel('sales/order')->getCollection()->addFieldToFilter('store_id', Array('eq' => $storeId))->addFieldToFilter('status', Array('eq' => 'complete'))->setOrder('entity_id', 'desc');
136
  $dateStart = date('Y-m-d 00:00:00', strtotime($date));
137
  $dateEnd = date('Y-m-d 23:59:59', strtotime($date));
138
  $orderByDate = $orderCollectionByDate->addAttributeToFilter('created_at', array('from' => $dateStart, 'to' => $dateEnd));
28
  $now = Mage::getModel('core/date')->timestamp(time());
29
  $end_date = date('Y-m-d 23:59:59', $now);
30
  $start_date = '';
31
+ $orderCollection = Mage::getModel('sales/order')->getCollection()->addFieldToFilter('store_id', Array('eq' => $storeId))->addFieldToFilter('status', array('in' => array('complete', 'processing')))->setOrder('entity_id', 'desc');
32
  if ($type_id == 7) {
33
  $start_date = date('Y-m-d 00:00:00', strtotime('-6 days'));
34
  } elseif ($type_id == 30) {
74
  }
75
  $count = 0;
76
  foreach ($dates as $date) {
77
+ $orderCollectionByDate = Mage::getModel('sales/order')->getCollection()->addFieldToFilter('store_id', Array('eq' => $storeId))->addFieldToFilter('status', array('in' => array('complete', 'processing')))->setOrder('entity_id', 'desc');
78
 
79
  if ($type_id == 24) {
80
  if ($count == 23) {
132
  $dates = $this->getDatesFromRange($first_day, $last_day);
133
 
134
  foreach ($dates as $date) {
135
+ $orderCollectionByDate = Mage::getModel('sales/order')->getCollection()->addFieldToFilter('store_id', Array('eq' => $storeId))->addFieldToFilter('status', array('in' => array('complete', 'processing')))->setOrder('entity_id', 'desc');
136
  $dateStart = date('Y-m-d 00:00:00', strtotime($date));
137
  $dateEnd = date('Y-m-d 23:59:59', strtotime($date));
138
  $orderByDate = $orderCollectionByDate->addAttributeToFilter('created_at', array('from' => $dateStart, 'to' => $dateEnd));
app/code/local/Biztech/Mobileassistant/etc/system.xml CHANGED
@@ -1,90 +1,100 @@
1
- <?xml version="1.0" encoding="UTF-8" ?>
2
- <config>
3
- <tabs>
4
- <biztech translate="label" module="mobileassistant">
5
- <label>Biztech Extensions</label>
6
- <sort_order>400</sort_order>
7
- </biztech>
8
- </tabs>
9
- <sections>
10
- <mobileassistant translate="label" module="mobileassistant">
11
- <label>MageMob Admin</label>
12
- <tab>biztech</tab>
13
- <frontend_type>text</frontend_type>
14
- <sort_order>10</sort_order>
15
- <show_in_default>1</show_in_default>
16
- <show_in_website>1</show_in_website>
17
- <show_in_store>1</show_in_store>
18
- <groups>
19
- <mobileassistant_general translate="label">
20
- <label>General</label>
21
- <frontend_type>text</frontend_type>
22
- <sort_order>10</sort_order>
23
- <show_in_default>1</show_in_default>
24
- <show_in_website>1</show_in_website>
25
- <show_in_store>1</show_in_store>
26
- <fields>
27
- <enabled translate="label">
28
- <label>Enabled</label>
29
- <frontend_type>select</frontend_type>
30
- <source_model>adminhtml/system_config_source_yesno</source_model>
31
- <sort_order>1</sort_order>
32
- <show_in_default>1</show_in_default>
33
- <show_in_website>1</show_in_website>
34
- <show_in_store>1</show_in_store>
35
- <comment>Select Yes to enable this feature.</comment>
36
- </enabled>
37
- <notification_msg translate="label">
38
- <label>New Order Notification Message</label>
39
- <frontend_type>text</frontend_type>
40
- <sort_order>2</sort_order>
41
- <show_in_default>1</show_in_default>
42
- <show_in_website>1</show_in_website>
43
- <show_in_store>1</show_in_store>
44
- <comment>Enter your message which will be received on the Mobile app whenever a New Order is received.</comment>
45
- </notification_msg>
46
- <customer_register_notification_msg translate="label">
47
- <label>New Customer Register Notification Message</label>
48
- <frontend_type>text</frontend_type>
49
- <sort_order>3</sort_order>
50
- <show_in_default>1</show_in_default>
51
- <show_in_website>1</show_in_website>
52
- <show_in_store>1</show_in_store>
53
- <comment>Enter your message which will be received on the Mobile app whenever a New Customer is registered.</comment>
54
- </customer_register_notification_msg>
55
-
56
- <minimum_qty translate="label">
57
- <label>Minimum Quantity Required For Product</label>
58
- <frontend_type>text</frontend_type>
59
- <sort_order>5</sort_order>
60
- <show_in_default>1</show_in_default>
61
- <show_in_website>1</show_in_website>
62
- <show_in_store>1</show_in_store>
63
- <validate>validate-zero-or-greater</validate>
64
- <comment>Enter minimum quantity required for product inventory alerts</comment>
65
- </minimum_qty>
66
- <product_inventory_notification_msg translate="label">
67
- <label>Product Inventory Notification Message</label>
68
- <frontend_type>text</frontend_type>
69
- <sort_order>6</sort_order>
70
- <show_in_default>1</show_in_default>
71
- <show_in_website>1</show_in_website>
72
- <show_in_store>1</show_in_store>
73
- <comment>Enter your message which will be received on the Mobile app whenever a product qty is lower than or equal to minimum qty.</comment>
74
- </product_inventory_notification_msg>
75
- <barcode_for_url translate="label">
76
- <label>Store Base Url QRcode</label>
77
- <frontend_type>text</frontend_type>
78
- <frontend_model>mobileassistant/config_barcodeurl</frontend_model>
79
- <sort_order>7</sort_order>
80
- <show_in_default>1</show_in_default>
81
- <show_in_website>1</show_in_website>
82
- <show_in_store>1</show_in_store>
83
- <comment>Displays QR code for store base url.</comment>
84
- </barcode_for_url>
85
- </fields>
86
- </mobileassistant_general>
87
- </groups>
88
- </mobileassistant>
89
- </sections>
90
- </config>
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0" encoding="UTF-8" ?>
2
+ <config>
3
+ <tabs>
4
+ <biztech translate="label" module="mobileassistant">
5
+ <label>Biztech Extensions</label>
6
+ <sort_order>400</sort_order>
7
+ </biztech>
8
+ </tabs>
9
+ <sections>
10
+ <mobileassistant translate="label" module="mobileassistant">
11
+ <label>MageMob Admin</label>
12
+ <tab>biztech</tab>
13
+ <frontend_type>text</frontend_type>
14
+ <sort_order>10</sort_order>
15
+ <show_in_default>1</show_in_default>
16
+ <show_in_website>1</show_in_website>
17
+ <show_in_store>1</show_in_store>
18
+ <groups>
19
+ <mobileassistant_general translate="label">
20
+ <label>General</label>
21
+ <frontend_type>text</frontend_type>
22
+ <sort_order>10</sort_order>
23
+ <show_in_default>1</show_in_default>
24
+ <show_in_website>1</show_in_website>
25
+ <show_in_store>1</show_in_store>
26
+ <fields>
27
+ <enabled translate="label">
28
+ <label>Enabled</label>
29
+ <frontend_type>select</frontend_type>
30
+ <source_model>adminhtml/system_config_source_yesno</source_model>
31
+ <sort_order>1</sort_order>
32
+ <show_in_default>1</show_in_default>
33
+ <show_in_website>1</show_in_website>
34
+ <show_in_store>1</show_in_store>
35
+ <comment>Select Yes to enable this feature.</comment>
36
+ </enabled>
37
+ <notification translate="label">
38
+ <label>Send Notification For</label>
39
+ <frontend_type>multiselect</frontend_type>
40
+ <source_model>mobileassistant/system_config_notification</source_model>
41
+ <sort_order>2</sort_order>
42
+ <show_in_default>1</show_in_default>
43
+ <show_in_website>1</show_in_website>
44
+ <show_in_store>1</show_in_store>
45
+ </notification>
46
+
47
+ <notification_msg translate="label">
48
+ <label>New Order Notification Message</label>
49
+ <frontend_type>text</frontend_type>
50
+ <sort_order>2</sort_order>
51
+ <show_in_default>1</show_in_default>
52
+ <show_in_website>1</show_in_website>
53
+ <show_in_store>1</show_in_store>
54
+ <comment>Enter your message which will be received on the Mobile app whenever a New Order is received.</comment>
55
+ </notification_msg>
56
+ <customer_register_notification_msg translate="label">
57
+ <label>New Customer Register Notification Message</label>
58
+ <frontend_type>text</frontend_type>
59
+ <sort_order>3</sort_order>
60
+ <show_in_default>1</show_in_default>
61
+ <show_in_website>1</show_in_website>
62
+ <show_in_store>1</show_in_store>
63
+ <comment>Enter your message which will be received on the Mobile app whenever a New Customer is registered.</comment>
64
+ </customer_register_notification_msg>
65
+
66
+ <minimum_qty translate="label">
67
+ <label>Minimum Quantity Required For Product</label>
68
+ <frontend_type>text</frontend_type>
69
+ <sort_order>5</sort_order>
70
+ <show_in_default>1</show_in_default>
71
+ <show_in_website>1</show_in_website>
72
+ <show_in_store>1</show_in_store>
73
+ <validate>validate-zero-or-greater</validate>
74
+ <comment>Enter minimum quantity required for product inventory alerts</comment>
75
+ </minimum_qty>
76
+ <product_inventory_notification_msg translate="label">
77
+ <label>Product Inventory Notification Message</label>
78
+ <frontend_type>text</frontend_type>
79
+ <sort_order>6</sort_order>
80
+ <show_in_default>1</show_in_default>
81
+ <show_in_website>1</show_in_website>
82
+ <show_in_store>1</show_in_store>
83
+ <comment>Enter your message which will be received on the Mobile app whenever a product qty is lower than or equal to minimum qty.</comment>
84
+ </product_inventory_notification_msg>
85
+ <barcode_for_url translate="label">
86
+ <label>Store Base Url QRcode</label>
87
+ <frontend_type>text</frontend_type>
88
+ <frontend_model>mobileassistant/config_barcodeurl</frontend_model>
89
+ <sort_order>7</sort_order>
90
+ <show_in_default>1</show_in_default>
91
+ <show_in_website>1</show_in_website>
92
+ <show_in_store>1</show_in_store>
93
+ <comment>Displays QR code for store base url.</comment>
94
+ </barcode_for_url>
95
+ </fields>
96
+ </mobileassistant_general>
97
+ </groups>
98
+ </mobileassistant>
99
+ </sections>
100
+ </config>
package.xml CHANGED
@@ -1,7 +1,7 @@
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>magento_mobile_assistant_manager</name>
4
- <version>0.2.1</version>
5
  <stability>stable</stability>
6
  <license uri="http://opensource.org/licenses/osl-3.0.php">OSL v3.0</license>
7
  <channel>community</channel>
@@ -28,9 +28,9 @@ https://itunes.apple.com/us/app/magentomobilemanager/id695074519?mt=8&amp;ign-mp
28
  <notes>-Provided theme change from Dashboard&#xD;
29
  -Enhanced Notification</notes>
30
  <authors><author><name>Biztech</name><user>biztechcon</user><email>sales@biztechconsultancy.com</email></author></authors>
31
- <date>2016-01-07</date>
32
- <time>06:04:25</time>
33
- <contents><target name="magelocal"><dir name="Biztech"><dir name="All"><dir name="Helper"><file name="Data.php" hash="e856726fd089e7f73ca7de450b696419"/></dir><dir name="Model"><file name="All.php" hash="a9aeeb9c6d7be9cf20414f405efc878d"/><dir name="Mysql4"><dir name="All"><file name="Collection.php" hash="a1909236183d126f38e628b85bb57e81"/></dir><file name="All.php" hash="f02542393eb26eadfb9b92d901d2ac12"/></dir><dir name="Source"><dir name="Updates"><file name="Type.php" hash="fa695bf4764c2d93c7436ed54bde89ba"/></dir></dir><file name="Status.php" hash="30a6f0da7d9d45e1082da532d5f8dabc"/><file name="Update.php" hash="83ceddbab4d621545b9c7c4bccdec7c0"/></dir><dir name="etc"><file name="config.xml" hash="8e46b7e9f47d565a9ff54fea30d034cc"/><file name="system.xml" hash="17262087dc933d934e09ac04cafb4c51"/></dir></dir><dir name="Authentication"><dir name="controllers"><file name="IndexController.php" hash="d5e9bcb327c8b4e41dde53948c16d329"/></dir><dir name="etc"><file name="config.xml" hash="d12ebc10e7781ff82323e54ff7713dae"/></dir></dir><dir name="Mobileassistant"><dir name="Block"><dir name="Config"><file name="Barcodeurl.php" hash="6dc63c4a9f259cb5fb854d39c9057eaa"/></dir></dir><dir name="Helper"><file name="Data.php" hash="48ab9efe6677c3066a245864174c4f4a"/></dir><dir name="Model"><dir name="Mobileassistant"><file name="Api.php" hash="4e8e1f556fc8f1d9e6c2f520a3a84e52"/></dir><file name="Mobileassistant.php" hash="68e160bf752ec8c1facc514389c00849"/><dir name="Mysql4"><dir name="Mobileassistant"><file name="Collection.php" hash="e9319365535ec2c42429ea1d9dbdc097"/></dir><file name="Mobileassistant.php" hash="62dc51f43aa6dff1dc762646b71cd600"/></dir><file name="Observer.php" hash="5962e33fc0b1048151144465958cdcbd"/></dir><dir name="controllers"><file name="CustomerController.php" hash="ec59b629f4d34dee388df2ebb4e36ca8"/><file name="DashboardController.php" hash="80032f6c96af8e7884a84441a2c9d3a4"/><file name="IndexController.php" hash="67599a94a41762b9624069f63d8dace0"/><file name="OrderController.php" hash="2f7265fdaec17ec0285e0ba6e281d632"/><file name="ProductController.php" hash="2b2c994a6a6e2a740a54eedaaadcebbf"/></dir><dir name="etc"><file name="api.xml" hash="7860c9fe0f121148eb2a3a498d1879b1"/><file name="config.xml" hash="65bac894f725fcd4886f5a95a3abb980"/><file name="system.xml" hash="0f75afd9196108912b700c6d07f44b68"/></dir><dir name="sql"><dir name="mobileassistant_setup"><file name="mysql4-install-0.1.0.php" hash="4f06ae1c3c5362b88fae1b1951a6b02a"/><file name="mysql4-upgrade-0.1.0-0.1.4.php" hash="172e9ecba3b5b385cef1c257b2af4bfa"/><file name="mysql4-upgrade-0.1.10-0.2.0.php" hash="dcb5288e356d3c36838446bbcadf6a2e"/><file name="mysql4-upgrade-0.1.4-0.1.5.php" hash="bd4adba7146d89fed6c548dd46a30a81"/><file name="mysql4-upgrade-0.1.5-0.1.6.php" hash="88ea6198ef876da921faebb1aa067485"/><file name="mysql4-upgrade-0.1.6-0.1.10.php" hash="88ea6198ef876da921faebb1aa067485"/></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Biztech_All.xml" hash="f4c3b9c029e56da8f09d7d71336c00f7"/><file name="Biztech_Mobileassistant.xml" hash="18d9cf7b8e516db899336adfd8210621"/><file name="Biztech_Authentication.xml" hash="149998e1599f43939f13cbc059123c8f"/></dir></target><target name="mage"><dir name="lib"><dir name="mobileassistant"><file name="pushcert.pem" hash="8199227be504f504a5dcc516025962f6"/></dir></dir><dir name="."><file name="MageMobAdmin.pdf" hash="a8f3d6830b1fc710be0c73de5f278bc2"/></dir></target><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="template"><dir name="mobileassistant"><dir name="system"><dir name="config"><file name="barcode.phtml" hash="1d24add024ce2297841ef826e345cad0"/></dir></dir></dir></dir></dir></dir></dir></target></contents>
34
  <compatible/>
35
  <dependencies><required><php><min>5.3.0</min><max>6.0.0</max></php></required></dependencies>
36
  </package>
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>magento_mobile_assistant_manager</name>
4
+ <version>0.2.2</version>
5
  <stability>stable</stability>
6
  <license uri="http://opensource.org/licenses/osl-3.0.php">OSL v3.0</license>
7
  <channel>community</channel>
28
  <notes>-Provided theme change from Dashboard&#xD;
29
  -Enhanced Notification</notes>
30
  <authors><author><name>Biztech</name><user>biztechcon</user><email>sales@biztechconsultancy.com</email></author></authors>
31
+ <date>2016-01-20</date>
32
+ <time>07:34:24</time>
33
+ <contents><target name="magelocal"><dir name="Biztech"><dir name="All"><dir name="Helper"><file name="Data.php" hash="e856726fd089e7f73ca7de450b696419"/></dir><dir name="Model"><file name="All.php" hash="a9aeeb9c6d7be9cf20414f405efc878d"/><dir name="Mysql4"><dir name="All"><file name="Collection.php" hash="a1909236183d126f38e628b85bb57e81"/></dir><file name="All.php" hash="f02542393eb26eadfb9b92d901d2ac12"/></dir><dir name="Source"><dir name="Updates"><file name="Type.php" hash="fa695bf4764c2d93c7436ed54bde89ba"/></dir></dir><file name="Status.php" hash="30a6f0da7d9d45e1082da532d5f8dabc"/><file name="Update.php" hash="8c4c167baf8775736e6861bfceb8e09f"/></dir><dir name="etc"><file name="config.xml" hash="27e403cedb861da03753d28527d9c664"/><file name="system.xml" hash="17262087dc933d934e09ac04cafb4c51"/></dir></dir><dir name="Authentication"><dir name="controllers"><file name="IndexController.php" hash="d5e9bcb327c8b4e41dde53948c16d329"/></dir><dir name="etc"><file name="config.xml" hash="d12ebc10e7781ff82323e54ff7713dae"/></dir></dir><dir name="Mobileassistant"><dir name="Block"><dir name="Config"><file name="Barcodeurl.php" hash="6dc63c4a9f259cb5fb854d39c9057eaa"/></dir></dir><dir name="Helper"><file name="Data.php" hash="6ba2646927ce10f4418c8da0ff823433"/></dir><dir name="Model"><dir name="Mobileassistant"><file name="Api.php" hash="4e8e1f556fc8f1d9e6c2f520a3a84e52"/></dir><file name="Mobileassistant.php" hash="68e160bf752ec8c1facc514389c00849"/><dir name="Mysql4"><dir name="Mobileassistant"><file name="Collection.php" hash="e9319365535ec2c42429ea1d9dbdc097"/></dir><file name="Mobileassistant.php" hash="62dc51f43aa6dff1dc762646b71cd600"/></dir><file name="Observer.php" hash="60865d6f69d69913162364495cd687d8"/><dir name="System"><dir name="Config"><file name="Notification.php" hash="e534c166867436b3ab6c5d3a9c0e5d45"/></dir></dir></dir><dir name="controllers"><file name="CustomerController.php" hash="ec59b629f4d34dee388df2ebb4e36ca8"/><file name="DashboardController.php" hash="523f0879812b3d81c6fdc1382ea44363"/><file name="IndexController.php" hash="67599a94a41762b9624069f63d8dace0"/><file name="OrderController.php" hash="2f7265fdaec17ec0285e0ba6e281d632"/><file name="ProductController.php" hash="2b2c994a6a6e2a740a54eedaaadcebbf"/></dir><dir name="etc"><file name="api.xml" hash="7860c9fe0f121148eb2a3a498d1879b1"/><file name="config.xml" hash="65bac894f725fcd4886f5a95a3abb980"/><file name="system.xml" hash="9fd105412f5707746a3dd283b26a7bb1"/></dir><dir name="sql"><dir name="mobileassistant_setup"><file name="mysql4-install-0.1.0.php" hash="4f06ae1c3c5362b88fae1b1951a6b02a"/><file name="mysql4-upgrade-0.1.0-0.1.4.php" hash="172e9ecba3b5b385cef1c257b2af4bfa"/><file name="mysql4-upgrade-0.1.10-0.2.0.php" hash="dcb5288e356d3c36838446bbcadf6a2e"/><file name="mysql4-upgrade-0.1.4-0.1.5.php" hash="bd4adba7146d89fed6c548dd46a30a81"/><file name="mysql4-upgrade-0.1.5-0.1.6.php" hash="88ea6198ef876da921faebb1aa067485"/><file name="mysql4-upgrade-0.1.6-0.1.10.php" hash="88ea6198ef876da921faebb1aa067485"/></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Biztech_All.xml" hash="f4c3b9c029e56da8f09d7d71336c00f7"/><file name="Biztech_Mobileassistant.xml" hash="18d9cf7b8e516db899336adfd8210621"/><file name="Biztech_Authentication.xml" hash="149998e1599f43939f13cbc059123c8f"/></dir></target><target name="mage"><dir name="lib"><dir name="mobileassistant"><file name="pushcert.pem" hash="8199227be504f504a5dcc516025962f6"/></dir></dir><dir name="."><file name="MageMobAdmin.pdf" hash="a8f3d6830b1fc710be0c73de5f278bc2"/></dir></target><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="template"><dir name="mobileassistant"><dir name="system"><dir name="config"><file name="barcode.phtml" hash="1d24add024ce2297841ef826e345cad0"/></dir></dir></dir></dir></dir></dir></dir></target></contents>
34
  <compatible/>
35
  <dependencies><required><php><min>5.3.0</min><max>6.0.0</max></php></required></dependencies>
36
  </package>