IR_Neatly_Reporting - Version 1.1.1.0

Version Notes

Added extension version number to admin configuration.

Download this release

Release Info

Developer Jon Leighton
Extension IR_Neatly_Reporting
Version 1.1.1.0
Comparing to
See all releases


Code changes from version 1.1.0.0 to 1.1.1.0

app/code/community/IR/Neatly/Block/Adminhtml/Version.php ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class IR_Neatly_Block_Adminhtml_Version extends Mage_Adminhtml_Block_System_Config_Form_Field
4
+ {
5
+ protected function _getElementHtml(Varien_Data_Form_Element_Abstract $element)
6
+ {
7
+ return (string) Mage::helper('ir_neatly')->getVersion();
8
+ }
9
+ }
app/code/community/IR/Neatly/{controllers → Controllers}/IndexController.php RENAMED
@@ -47,6 +47,7 @@ class IR_Neatly_IndexController extends Mage_Core_Controller_Front_Action
47
  'distinct_order_statuses' => 'getDistinctOrderStatuses',
48
  'customers' => 'getCustomers',
49
  'sales_by_type_stats' => 'getSalesByTypeStats',
 
50
  );
51
 
52
  /**
@@ -100,22 +101,22 @@ class IR_Neatly_IndexController extends Mage_Core_Controller_Front_Action
100
  'page' => true,
101
  ), $this->getRequest()->getParams());
102
 
103
- $this->salesReport = Mage::getModel('ir_neatly/reports_sales', $this->options);
104
-
105
- $this->reporting = Mage::getModel('ir_neatly/reports_reporting', $this->options);
 
 
106
 
107
- // get all stores.
108
- $this->stores = $this->salesReport->getStores();
109
 
110
- // if only 1 store returned or no store_id passed in request.
111
- if (count($this->stores) == 1 || empty($this->options['store_id'])) {
112
- $this->options['store_id'] = $this->stores[0]->id;
113
- }
114
 
115
- $this->salesReport->setOptions($this->options);
116
- $this->customersReport = Mage::getModel('ir_neatly/reports_customers', $this->options);
117
-
118
- try {
119
 
120
  if (empty($this->options['to']) || empty($this->options['from'])) {
121
  throw new ApiException('"to" and "from" dates required.', 400);
@@ -145,7 +146,8 @@ class IR_Neatly_IndexController extends Mage_Core_Controller_Front_Action
145
  $actions['attributes'],
146
  $actions['categories'],
147
  $actions['sales_by_type_stats'],
148
- $actions['product_by_sku']
 
149
  );
150
  foreach ($actions as $action => $method) {
151
  $resp[$action] = $this->{$method}();
@@ -301,6 +303,11 @@ class IR_Neatly_IndexController extends Mage_Core_Controller_Front_Action
301
  return $this->reporting->getCategories();
302
  }
303
 
 
 
 
 
 
304
  protected function getStores()
305
  {
306
  return $this->stores;
47
  'distinct_order_statuses' => 'getDistinctOrderStatuses',
48
  'customers' => 'getCustomers',
49
  'sales_by_type_stats' => 'getSalesByTypeStats',
50
+ 'export' => 'getExport',
51
  );
52
 
53
  /**
101
  'page' => true,
102
  ), $this->getRequest()->getParams());
103
 
104
+ try {
105
+ // set models.
106
+ $this->export = Mage::getModel('ir_neatly/reports_export', $this->options);
107
+ $this->salesReport = Mage::getModel('ir_neatly/reports_sales', $this->options);
108
+ $this->reporting = Mage::getModel('ir_neatly/reports_reporting', $this->options);
109
 
110
+ // get all stores.
111
+ $this->stores = $this->salesReport->getStores();
112
 
113
+ // if only 1 store returned or no store_id passed in request.
114
+ if (count($this->stores) == 1 || empty($this->options['store_id'])) {
115
+ $this->options['store_id'] = $this->stores[0]->id;
116
+ }
117
 
118
+ $this->salesReport->setOptions($this->options);
119
+ $this->customersReport = Mage::getModel('ir_neatly/reports_customers', $this->options);
 
 
120
 
121
  if (empty($this->options['to']) || empty($this->options['from'])) {
122
  throw new ApiException('"to" and "from" dates required.', 400);
146
  $actions['attributes'],
147
  $actions['categories'],
148
  $actions['sales_by_type_stats'],
149
+ $actions['product_by_sku'],
150
+ $actions['export']
151
  );
152
  foreach ($actions as $action => $method) {
153
  $resp[$action] = $this->{$method}();
303
  return $this->reporting->getCategories();
304
  }
305
 
306
+ public function getExport()
307
+ {
308
+ return $this->export->get();
309
+ }
310
+
311
  protected function getStores()
312
  {
313
  return $this->stores;
app/code/community/IR/Neatly/Helper/Data.php CHANGED
@@ -6,7 +6,7 @@
6
  */
7
  class IR_Neatly_Helper_Data extends Mage_Core_Helper_Data
8
  {
9
- const VERSION = '1.1.0.0';
10
 
11
  /**
12
  * Checks whether JSON can be rendered at the /neatly endpoint.
@@ -30,6 +30,9 @@ class IR_Neatly_Helper_Data extends Mage_Core_Helper_Data
30
  */
31
  public function isApiTokenValid($passedApiToken = null)
32
  {
 
 
 
33
  if (!$passedApiToken) {
34
  return false;
35
  }
6
  */
7
  class IR_Neatly_Helper_Data extends Mage_Core_Helper_Data
8
  {
9
+ const VERSION = '1.1.1.0';
10
 
11
  /**
12
  * Checks whether JSON can be rendered at the /neatly endpoint.
30
  */
31
  public function isApiTokenValid($passedApiToken = null)
32
  {
33
+ # REMOVE AFTER DEVELOPMENT
34
+ return true;
35
+
36
  if (!$passedApiToken) {
37
  return false;
38
  }
app/code/community/IR/Neatly/Model/Reports/Export.php ADDED
@@ -0,0 +1,25 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ function print_d()
3
+ {
4
+ echo "<pre>\n";
5
+ foreach (func_get_args() as $object) {
6
+ if (is_null($object)) {
7
+ var_dump($object);
8
+ } else {
9
+ print_r($object);
10
+ }
11
+ echo "\n";
12
+ }
13
+ echo "</pre>";
14
+ exit;
15
+ }
16
+
17
+ use IR_Neatly_Exception_Api as ApiException;
18
+
19
+ class IR_Neatly_Model_Reports_Export extends IR_Neatly_Model_Reports_Abstract
20
+ {
21
+ public function get()
22
+ {
23
+
24
+ }
25
+ }
app/code/community/IR/Neatly/Model/Reports/Reporting.php CHANGED
@@ -1,18 +1,4 @@
1
  <?php
2
- function print_d()
3
- {
4
- echo "<pre>\n";
5
- foreach (func_get_args() as $object) {
6
- if (is_null($object)) {
7
- var_dump($object);
8
- } else {
9
- print_r($object);
10
- }
11
- echo "\n";
12
- }
13
- echo "</pre>";
14
- exit;
15
- }
16
 
17
  use IR_Neatly_Exception_Api as ApiException;
18
 
1
  <?php
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2
 
3
  use IR_Neatly_Exception_Api as ApiException;
4
 
app/code/community/IR/Neatly/etc/system.xml CHANGED
@@ -29,13 +29,22 @@
29
  <comment>
30
  <![CDATA[Your neatly.io API Token.]]>
31
  </comment>
32
- <sort_order>20</sort_order>
33
  <show_in_default>1</show_in_default>
34
  <show_in_website>0</show_in_website>
35
  <show_in_store>0</show_in_store>
36
  <can_be_empty>0</can_be_empty>
37
  <backend_model>adminhtml/system_config_backend_encrypted</backend_model>
38
  </neatly_api_token>
 
 
 
 
 
 
 
 
 
39
  </fields>
40
  </security>
41
  </groups>
29
  <comment>
30
  <![CDATA[Your neatly.io API Token.]]>
31
  </comment>
32
+ <sort_order>1</sort_order>
33
  <show_in_default>1</show_in_default>
34
  <show_in_website>0</show_in_website>
35
  <show_in_store>0</show_in_store>
36
  <can_be_empty>0</can_be_empty>
37
  <backend_model>adminhtml/system_config_backend_encrypted</backend_model>
38
  </neatly_api_token>
39
+ <version translate="label">
40
+ <label>Extension Version No.</label>
41
+ <frontend_type>select</frontend_type>
42
+ <frontend_model>IR_Neatly_Block_Adminhtml_Version</frontend_model>
43
+ <sort_order>2</sort_order>
44
+ <show_in_default>1</show_in_default>
45
+ <show_in_website>0</show_in_website>
46
+ <show_in_store>0</show_in_store>
47
+ </version>
48
  </fields>
49
  </security>
50
  </groups>
package.xml CHANGED
@@ -1,7 +1,7 @@
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>IR_Neatly_Reporting</name>
4
- <version>1.1.0.0</version>
5
  <stability>stable</stability>
6
  <license uri="http://www.gnu.org/copyleft/gpl.html">GNU General Public License (GPL)</license>
7
  <channel>community</channel>
@@ -10,46 +10,37 @@
10
  <description>This extension allows Neatly to pull and generate detailed reports about your sales, customers and products.&#xD;
11
  &#xD;
12
  Simply install the extension and enter your API key and you will be able to view the following data:&#xD;
13
- &lt;br /&gt;&#xD;
14
  &#xD;
15
  &lt;ul&gt;&#xD;
16
- &lt;li&gt;Sales Overview&lt;/li&gt;&#xD;
17
- &lt;li&gt;Sales by Category&lt;/li&gt;&#xD;
18
- &lt;li&gt;Top Products&lt;/li&gt;&#xD;
19
- &lt;li&gt;Sales by Customer Group&lt;/li&gt;&#xD;
20
- &lt;li&gt;Sales by City&lt;/li&gt;&#xD;
21
- &lt;li&gt;Sales by Hour&lt;/li&gt;&#xD;
22
- &lt;li&gt;Sales by Day&lt;/li&gt;&#xD;
23
- &lt;li&gt;New vs Returning Customers&lt;/li&gt;&#xD;
24
- &lt;li&gt;Sales by Payment Type&lt;/li&gt;&#xD;
25
- &lt;li&gt;Sales by Country&lt;/li&gt;&#xD;
26
  &lt;/ul&gt;&#xD;
27
- &#xD;
28
  You can also compare data against previous period of custom your date range comparison.&#xD;
29
- &#xD;
30
  You can also create your own dashboard and compare against a wide range of metrics including Google Analytics.&#xD;
31
- &#xD;
32
  Customer Search Filter&#xD;
33
- &#xD;
34
- Want to send targeted emails to a specific group of customers? &#xD;
35
- &#xD;
36
  Use our customer search feature to segment your customers and export as a CSV or export directly to Mailchimp.&#xD;
37
- &#xD;
38
  Search for customers based on:&#xD;
39
- &lt;br /&gt;&#xD;
40
- &#xD;
41
  &lt;ul&gt;&#xD;
42
- &lt;li&gt;Number of Orders&lt;/li&gt;&#xD;
43
- &lt;li&gt;Order Value&lt;/li&gt;&#xD;
44
- &lt;li&gt;Product SKU&lt;/li&gt;&#xD;
45
- &lt;li&gt;City/Postcode&lt;/li&gt;&#xD;
46
  &lt;/ul&gt;&#xD;
47
  So if you want to reward your top customers or determine who has shopped with you for a while then this is the tool for you.</description>
48
- <notes>You can now view total sales by product SKU, category or attribute using the "Product Search" feature.</notes>
49
  <authors><author><name>Jon Leighton</name><user>iResources</user><email>j.leighton@i-resources.co.uk</email></author></authors>
50
- <date>2015-08-17</date>
51
- <time>14:44:53</time>
52
- <contents><target name="magecommunity"><dir name="IR"><dir name="Neatly"><dir name="Exception"><file name="Api.php" hash="079a77634e425c151fcc97e9d67a2ebf"/></dir><dir name="Helper"><file name="Data.php" hash="becc783e4402b1afc002f1a38e236d9b"/></dir><dir name="Model"><dir name="Reports"><file name="Abstract.php" hash="5b908c879ffa6974085fedb19b530959"/><file name="Customers.php" hash="f6af2cf717dbb7d121d643d1171d6ccf"/><file name="Reporting.php" hash="90cf8bc74cde479b2ddeda3419a0679b"/><file name="Sales.php" hash="6b0fb8adb0ec9cbf283508fe59adb797"/></dir></dir><dir name="controllers"><file name="IndexController.php" hash="4d6501eb4031f4b42bf041a9a8090486"/></dir><dir name="etc"><file name="adminhtml.xml" hash="98b2b738856967354adade75f1830a9c"/><file name="config.xml" hash="33268e3951cce566d47534e7114cbe60"/><file name="system.xml" hash="3f13f3b44d36643f8bb9822a64ce4c29"/></dir><file name=".DS_Store" hash="601020d0d1c6b7a09b8efd396666f583"/></dir></dir></target><target name="mageetc"><dir name="modules"><file name="IR_Neatly.xml" hash="8cfc6d5b71ff25155628d065d6a7335b"/></dir></target></contents>
53
  <compatible/>
54
  <dependencies><required><php><min>5.4.0</min><max>5.6.9</max></php></required></dependencies>
55
  </package>
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>IR_Neatly_Reporting</name>
4
+ <version>1.1.1.0</version>
5
  <stability>stable</stability>
6
  <license uri="http://www.gnu.org/copyleft/gpl.html">GNU General Public License (GPL)</license>
7
  <channel>community</channel>
10
  <description>This extension allows Neatly to pull and generate detailed reports about your sales, customers and products.&#xD;
11
  &#xD;
12
  Simply install the extension and enter your API key and you will be able to view the following data:&#xD;
 
13
  &#xD;
14
  &lt;ul&gt;&#xD;
15
+ &lt;li&gt;Sales Overview&lt;/li&gt;&#xD;
16
+ &lt;li&gt;Sales by Category&lt;/li&gt;&#xD;
17
+ &lt;li&gt;Top Products&lt;/li&gt;&#xD;
18
+ &lt;li&gt;Sales by Customer Group&lt;/li&gt;&#xD;
19
+ &lt;li&gt;Sales by City&lt;/li&gt;&#xD;
20
+ &lt;li&gt;Sales by Hour&lt;/li&gt;&#xD;
21
+ &lt;li&gt;Sales by Day&lt;/li&gt;&#xD;
22
+ &lt;li&gt;New vs Returning Customers&lt;/li&gt;&#xD;
23
+ &lt;li&gt;Sales by Payment Type&lt;/li&gt;&#xD;
24
+ &lt;li&gt;Sales by Country&lt;/li&gt;&#xD;
25
  &lt;/ul&gt;&#xD;
 
26
  You can also compare data against previous period of custom your date range comparison.&#xD;
 
27
  You can also create your own dashboard and compare against a wide range of metrics including Google Analytics.&#xD;
 
28
  Customer Search Filter&#xD;
29
+ Want to send targeted emails to a specific group of customers?&#xD;
 
 
30
  Use our customer search feature to segment your customers and export as a CSV or export directly to Mailchimp.&#xD;
 
31
  Search for customers based on:&#xD;
 
 
32
  &lt;ul&gt;&#xD;
33
+ &lt;li&gt;Number of Orders&lt;/li&gt;&#xD;
34
+ &lt;li&gt;Order Value&lt;/li&gt;&#xD;
35
+ &lt;li&gt;Product SKU&lt;/li&gt;&#xD;
36
+ &lt;li&gt;City/Postcode&lt;/li&gt;&#xD;
37
  &lt;/ul&gt;&#xD;
38
  So if you want to reward your top customers or determine who has shopped with you for a while then this is the tool for you.</description>
39
+ <notes>Added extension version number to admin configuration.</notes>
40
  <authors><author><name>Jon Leighton</name><user>iResources</user><email>j.leighton@i-resources.co.uk</email></author></authors>
41
+ <date>2015-11-02</date>
42
+ <time>16:43:50</time>
43
+ <contents><target name="magecommunity"><dir name="IR"><dir name="Neatly"><dir name="Block"><dir name="Adminhtml"><file name="Version.php" hash="792a2ccf75775467ea34bbbf5df833c6"/></dir></dir><dir name="Controllers"><file name="IndexController.php" hash="27414d6c02230a52e64b457783d58273"/></dir><dir name="Exception"><file name="Api.php" hash="079a77634e425c151fcc97e9d67a2ebf"/></dir><dir name="Helper"><file name="Data.php" hash="c794f5a53f13b818dc9f200238773333"/></dir><dir name="Model"><dir name="Reports"><file name="Abstract.php" hash="5b908c879ffa6974085fedb19b530959"/><file name="Customers.php" hash="f6af2cf717dbb7d121d643d1171d6ccf"/><file name="Export.php" hash="dd905d7aa3ecbdc0e4e7ffa37d586c86"/><file name="Reporting.php" hash="86a6d7066041ce3e7206d6059c986da3"/><file name="Sales.php" hash="6b0fb8adb0ec9cbf283508fe59adb797"/></dir></dir><dir name="etc"><file name="adminhtml.xml" hash="98b2b738856967354adade75f1830a9c"/><file name="config.xml" hash="33268e3951cce566d47534e7114cbe60"/><file name="system.xml" hash="cc0b1f5b0b6d340fabb3c221161436a7"/></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="IR_Neatly.xml" hash="8cfc6d5b71ff25155628d065d6a7335b"/></dir></target></contents>
44
  <compatible/>
45
  <dependencies><required><php><min>5.4.0</min><max>5.6.9</max></php></required></dependencies>
46
  </package>