Contiamo_Connector - Version 1.1.1

Version Notes

Minor: fix custom attribute fetching when all values are empty

Download this release

Release Info

Developer Chris Baynes
Extension Contiamo_Connector
Version 1.1.1
Comparing to
See all releases


Code changes from version 1.1.0 to 1.1.1

app/code/community/Contiamo/Connector/Helper/Data.php CHANGED
@@ -17,6 +17,27 @@ class Contiamo_Connector_Helper_Data extends Mage_Core_Helper_Abstract
17
  return Mage::getConfig()->getNode()->modules->Contiamo_Connector->version;
18
  }
19
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
20
  public function snakeCaseToTitle($s)
21
  {
22
  return ucwords(str_replace('_', ' ', $s));
17
  return Mage::getConfig()->getNode()->modules->Contiamo_Connector->version;
18
  }
19
 
20
+ public function getSettings($key)
21
+ {
22
+ $customAttributes = Mage::getStoreConfig('contiamo_settings/' . $key);
23
+ if (!$customAttributes || empty($customAttributes)) {
24
+ $customAttributes = array();
25
+ foreach (range(1,10) as $i) {
26
+ $key = 'custom_' . $i;
27
+ $customAttributes[$key] = '';
28
+ }
29
+ }
30
+
31
+ $sorter = function($a, $b) {
32
+ $a = intval(str_replace('custom_', '', $a));
33
+ $b = intval(str_replace('custom_', '', $b));
34
+ return $a - $b;
35
+ };
36
+ uksort($customAttributes, $sorter);
37
+
38
+ return $customAttributes;
39
+ }
40
+
41
  public function snakeCaseToTitle($s)
42
  {
43
  return ucwords(str_replace('_', ' ', $s));
app/code/community/Contiamo/Connector/Model/Export/Customers.php CHANGED
@@ -14,15 +14,7 @@ class Contiamo_Connector_Model_Export_Customers extends Contiamo_Connector_Model
14
 
15
  public static function customAttributes()
16
  {
17
- $customAttributes = Mage::getStoreConfig('contiamo_settings/customer_attributes');
18
- $sorter = function($a, $b) {
19
- $a = intval(str_replace('custom_', '', $a));
20
- $b = intval(str_replace('custom_', '', $b));
21
- return $a - $b;
22
- };
23
- uksort($customAttributes, $sorter);
24
-
25
- return $customAttributes;
26
  }
27
 
28
  public function init($dateFrom, $pageNum, $pageSize)
14
 
15
  public static function customAttributes()
16
  {
17
+ return Mage::helper('contiamo')->getSettings('customer_attributes');
 
 
 
 
 
 
 
 
18
  }
19
 
20
  public function init($dateFrom, $pageNum, $pageSize)
app/code/community/Contiamo/Connector/Model/Export/OrderItems.php CHANGED
@@ -26,15 +26,7 @@ class Contiamo_Connector_Model_Export_OrderItems extends Contiamo_Connector_Mode
26
 
27
  public static function customAttributes()
28
  {
29
- $customAttributes = Mage::getStoreConfig('contiamo_settings/sale_item_attributes');
30
- $sorter = function($a, $b) {
31
- $a = intval(str_replace('custom_', '', $a));
32
- $b = intval(str_replace('custom_', '', $b));
33
- return $a - $b;
34
- };
35
- uksort($customAttributes, $sorter);
36
-
37
- return $customAttributes;
38
  }
39
 
40
  public function init($dateFrom, $pageNum, $pageSize)
26
 
27
  public static function customAttributes()
28
  {
29
+ return Mage::helper('contiamo')->getSettings('sale_item_attributes');
 
 
 
 
 
 
 
 
30
  }
31
 
32
  public function init($dateFrom, $pageNum, $pageSize)
app/code/community/Contiamo/Connector/Model/Export/Orders.php CHANGED
@@ -48,15 +48,7 @@ class Contiamo_Connector_Model_Export_Orders extends Contiamo_Connector_Model_Ex
48
 
49
  public static function customAttributes()
50
  {
51
- $customAttributes = Mage::getStoreConfig('contiamo_settings/sale_attributes');
52
- $sorter = function($a, $b) {
53
- $a = intval(str_replace('custom_', '', $a));
54
- $b = intval(str_replace('custom_', '', $b));
55
- return $a - $b;
56
- };
57
- uksort($customAttributes, $sorter);
58
-
59
- return $customAttributes;
60
  }
61
 
62
  public function init($dateFrom, $pageNum, $pageSize)
48
 
49
  public static function customAttributes()
50
  {
51
+ return Mage::helper('contiamo')->getSettings('sale_attributes');
 
 
 
 
 
 
 
 
52
  }
53
 
54
  public function init($dateFrom, $pageNum, $pageSize)
app/code/community/Contiamo/Connector/etc/config.xml CHANGED
@@ -2,7 +2,7 @@
2
  <config>
3
  <modules>
4
  <Contiamo_Connector>
5
- <version>1.1.0</version>
6
  </Contiamo_Connector>
7
  </modules>
8
 
2
  <config>
3
  <modules>
4
  <Contiamo_Connector>
5
+ <version>1.1.1</version>
6
  </Contiamo_Connector>
7
  </modules>
8
 
package.xml CHANGED
@@ -1,20 +1,18 @@
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>Contiamo_Connector</name>
4
- <version>1.1.0</version>
5
  <stability>stable</stability>
6
  <license uri="http://opensource.org/licenses/osl-3.0.php">OSL v3.0</license>
7
  <channel>community</channel>
8
  <extends/>
9
  <summary>Use Contiamo to analyze your sale trends and customer base.</summary>
10
  <description>Use Contiamo to analyze your sale trends and customer base.</description>
11
- <notes>Added support for user defined attributes in the export.&#xD;
12
- &#xD;
13
- Minor: Include "name" in order item export. </notes>
14
  <authors><author><name>Chris Baynes</name><user>contiamo</user><email>info@contiamo.com</email></author></authors>
15
- <date>2015-02-11</date>
16
- <time>16:57:13</time>
17
- <contents><target name="magecommunity"><dir name="Contiamo"><dir name="Connector"><dir name="Helper"><file name="Data.php" hash="e354215a2c6bbb79c4d83c49f4bb7e65"/></dir><dir name="Model"><dir name="Admin"><file name="AbstractSource.php" hash="649e273afe1ed9833eaa93c3c9dd9ce0"/><file name="CustomerSource.php" hash="832645ffd3dfc57e0d98ad83325ece02"/><file name="SaleItemSource.php" hash="3d24b9f71dee66d0b3f91c25deec6dc4"/><file name="SaleSource.php" hash="e6a42a4efe291823d2b3cd5cb38c7518"/></dir><file name="Contiamo.php" hash="7ed0a780d45c090cdd5af6738830ac62"/><dir name="Export"><file name="Collection.php" hash="2ca6280af2cdd7412e9f9bbdc04be6b1"/><file name="CustomAttributes.php" hash="3d798281b48857947316642e86fdd584"/><file name="Customer.php" hash="2b31447c49506f07b42d968619cab062"/><file name="Customers.php" hash="3d8c29a0bccc29e08e314c6c02396b19"/><file name="Order.php" hash="882fe4101b27df47036ab0d565a5b36b"/><file name="OrderItem.php" hash="56249ebb4dce0f77da92a14268128ee0"/><file name="OrderItems.php" hash="a6e7dac5289196e79275e768b076024b"/><file name="OrderUpdates.php" hash="0bba8474dfa37f09a8f55216e1985cd4"/><file name="Orders.php" hash="bf6893fedb3739842bb72e95a70e360a"/><file name="Status.php" hash="9f2fb6a8241a071168dddf726c988878"/></dir><dir name="Resource"><dir name="Mysql4"><file name="Setup.php" hash="3d4b6ecfc461825f115eb6dc8ba3677f"/></dir></dir></dir><dir name="controllers"><file name="ExportController.php" hash="2a6fe5fece69bfbf9395b61e1b91a4bb"/></dir><dir name="etc"><file name="adminhtml.xml" hash="70f5bf8121d1a276e649b9b5fb4ac9cc"/><file name="config.xml" hash="86265a601408ff8aec600e04e347dd6b"/><file name="system.xml" hash="c1aaa3061a5e8fc4ba3ac66a0f408c58"/></dir><dir name="sql"><dir name="contiamo_setup"><file name="mysql4-install-0.0.1.php" hash="8b799197fe5d2567f1510b0777b137b1"/></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Contiamo_Connector.xml" hash="54eb6cba356dc238f94212376cbd86c1"/></dir></target></contents>
18
  <compatible/>
19
  <dependencies><required><php><min>5.2.0</min><max>6.0.0</max></php></required></dependencies>
20
  </package>
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>Contiamo_Connector</name>
4
+ <version>1.1.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>
8
  <extends/>
9
  <summary>Use Contiamo to analyze your sale trends and customer base.</summary>
10
  <description>Use Contiamo to analyze your sale trends and customer base.</description>
11
+ <notes>Minor: fix custom attribute fetching when all values are empty</notes>
 
 
12
  <authors><author><name>Chris Baynes</name><user>contiamo</user><email>info@contiamo.com</email></author></authors>
13
+ <date>2015-02-17</date>
14
+ <time>11:23:32</time>
15
+ <contents><target name="magecommunity"><dir name="Contiamo"><dir name="Connector"><dir name="Helper"><file name="Data.php" hash="0b7005dfbd871a92c54f5a66201cde27"/></dir><dir name="Model"><dir name="Admin"><file name="AbstractSource.php" hash="649e273afe1ed9833eaa93c3c9dd9ce0"/><file name="CustomerSource.php" hash="832645ffd3dfc57e0d98ad83325ece02"/><file name="SaleItemSource.php" hash="3d24b9f71dee66d0b3f91c25deec6dc4"/><file name="SaleSource.php" hash="e6a42a4efe291823d2b3cd5cb38c7518"/></dir><file name="Contiamo.php" hash="7ed0a780d45c090cdd5af6738830ac62"/><dir name="Export"><file name="Collection.php" hash="2ca6280af2cdd7412e9f9bbdc04be6b1"/><file name="CustomAttributes.php" hash="3d798281b48857947316642e86fdd584"/><file name="Customer.php" hash="2b31447c49506f07b42d968619cab062"/><file name="Customers.php" hash="105a08c13f7034f0d8bb6f8212fcdda3"/><file name="Order.php" hash="882fe4101b27df47036ab0d565a5b36b"/><file name="OrderItem.php" hash="56249ebb4dce0f77da92a14268128ee0"/><file name="OrderItems.php" hash="1be1dbbd461d0b5604abce6b283c14f2"/><file name="OrderUpdates.php" hash="0bba8474dfa37f09a8f55216e1985cd4"/><file name="Orders.php" hash="1a9d572b76704b58a1d588ef29ae35dd"/><file name="Status.php" hash="9f2fb6a8241a071168dddf726c988878"/></dir><dir name="Resource"><dir name="Mysql4"><file name="Setup.php" hash="3d4b6ecfc461825f115eb6dc8ba3677f"/></dir></dir></dir><dir name="controllers"><file name="ExportController.php" hash="2a6fe5fece69bfbf9395b61e1b91a4bb"/></dir><dir name="etc"><file name="adminhtml.xml" hash="70f5bf8121d1a276e649b9b5fb4ac9cc"/><file name="config.xml" hash="a2319c9c4ec7032aba4d9ec3388b918a"/><file name="system.xml" hash="c1aaa3061a5e8fc4ba3ac66a0f408c58"/></dir><dir name="sql"><dir name="contiamo_setup"><file name="mysql4-install-0.0.1.php" hash="8b799197fe5d2567f1510b0777b137b1"/></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Contiamo_Connector.xml" hash="54eb6cba356dc238f94212376cbd86c1"/></dir></target></contents>
16
  <compatible/>
17
  <dependencies><required><php><min>5.2.0</min><max>6.0.0</max></php></required></dependencies>
18
  </package>