Minubo_Interface - Version 1.0.11

Version Notes

Added the option to get all data with limit=0

Download this release

Release Info

Developer sven rothe
Extension Minubo_Interface
Version 1.0.11
Comparing to
See all releases


Code changes from version 1.0.10 to 1.0.11

app/code/community/Minubo/Interface/Model/Mysql4/Categories4.php ADDED
@@ -0,0 +1,26 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Minubo_Interface_Model_Mysql4_Categories4 extends Mage_Core_Model_Mysql4_Abstract
3
+ {
4
+ public function _construct()
5
+ {
6
+ $this->_init('minubo_interface/categories4', 'entity_id');
7
+ }
8
+
9
+ public function loadByField($field,$value){
10
+ $table = $this->getMainTable();
11
+ $where = $this->_getReadAdapter()->quoteInto("$field = ?", $value);
12
+ $select = $this->_getReadAdapter()->select()->from($table,array('entity_id','parent_id','position','name','image','url_key','url_path'))->where($where);
13
+ $id = $this->_getReadAdapter()->fetchOne($select);
14
+ return $id;
15
+ }
16
+
17
+ public function loadAll(){
18
+ $table = $this->getMainTable();
19
+ $where = $this->_getReadAdapter()->quoteInto("entity_id > ?", 1);
20
+ // $select = $this->_getReadAdapter()->select()->from($table)->columns(array('entity_id','parent_id','name'))->where($where)->limit(10,5)->order('created_at');
21
+ $select = $this->_getReadAdapter()->select()->from($table,array('entity_id','parent_id','position','name','image','url_key','url_path'))->where($where)->order('created_at');
22
+ return $this->_getReadAdapter()->fetchAll($select);
23
+ }
24
+
25
+ }
26
+ ?>
app/code/community/Minubo/Interface/Model/Mysql4/Products4.php ADDED
@@ -0,0 +1,62 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Minubo_Interface_Model_Mysql4_Products4 extends Mage_Core_Model_Mysql4_Abstract
3
+ {
4
+ public function _construct()
5
+ {
6
+ $this->_init('minubo_interface/products4', 'entity_id');
7
+ }
8
+
9
+ protected function getColumns() {
10
+ $r = array('entity_id','sku','name','type_id','attribute_set_id','created_at','type_id as typeKey','weight',
11
+ 'visibility','has_options','gift_message_available','price','special_price',
12
+ 'special_from_date','special_to_date','tax_class_id','required_options',
13
+ 'price_type','sku_type','shipment_type','cost','msrp_enabled','msrp',
14
+ 'small_image','thumbnail','news_from_date','news_to_date','url_key','url_path',
15
+ 'is_recurring','recurring_profile','image_label','small_image_label',
16
+ 'thumbnail_label','updated_at','weight_type','price_view',
17
+ 'links_purchased_separately','links_exist',
18
+ 'msrp_display_actual_price_type','short_description');
19
+ $field1 = Mage::getStoreConfig('minubo_interface/settings/productbrand',Mage::app()->getStore());
20
+ $field2 = Mage::getStoreConfig('minubo_interface/settings/productorigin',Mage::app()->getStore());
21
+ $fields = Mage::getStoreConfig('minubo_interface/settings/productfields',Mage::app()->getStore());
22
+ $f = explode(',', str_replace(' ','',$fields));
23
+ return array_merge($r, array($field1, $field2), $f);
24
+ }
25
+
26
+ public function loadByField($field,$value){
27
+ $table = $this->getMainTable();
28
+ $where = $this->_getReadAdapter()->quoteInto("$field = ?", $value);
29
+ $select = $this->_getReadAdapter()->select()
30
+ ->from($table)
31
+ ->reset('columns')
32
+ ->columns($this->getColumns())
33
+ ->where($where);
34
+ $id = $this->_getReadAdapter()->fetchOne($select);
35
+ return $id;
36
+ }
37
+
38
+ public function loadAll(){
39
+ $table = $this->getMainTable();
40
+ $where = $this->_getReadAdapter()->quoteInto("entity_id > ?", 0);
41
+ $select = $this->_getReadAdapter()->select()->from($table)
42
+ ->reset('columns')
43
+ ->columns($this->getColumns())
44
+ ->where($where)
45
+ ->order('entity_id');
46
+ return $this->_getReadAdapter()->fetchAll($select);
47
+ }
48
+
49
+ public function loadLimited($limit, $offset){
50
+ $table = $this->getMainTable();
51
+ $where = $this->_getReadAdapter()->quoteInto("entity_id > ?", 0);
52
+ $select = $this->_getReadAdapter()->select()->from($table)
53
+ ->reset('columns')
54
+ ->columns($this->getColumns())
55
+ ->where($where)
56
+ ->limit($limit, $offset)
57
+ ->order('entity_id');
58
+ return $this->_getReadAdapter()->fetchAll($select);
59
+ }
60
+
61
+ }
62
+ ?>
app/code/community/Minubo/Interface/controllers/ExportController.php CHANGED
@@ -118,7 +118,7 @@ class Minubo_Interface_ExportController extends Mage_Core_Controller_Front_Actio
118
  '# memory_get_peak_usage(false): '.memory_get_peak_usage(false).'<br>';
119
  }
120
 
121
- function getParam(&$lastChangeDate, &$maxChangeDate, &$lastOrderID, &$maxOrderID, &$limit, &$offset, &$debug, &$pdata, &$store_id, &$download) {
122
 
123
  $debug = $this->getRequest()->getPost('debug');
124
  if($debug) echo '# memory_get_usage(true): '.memory_get_usage(true).'<br>';
@@ -143,25 +143,40 @@ class Minubo_Interface_ExportController extends Mage_Core_Controller_Front_Actio
143
  $maxOrderID = $this->getRequest()->getPost('max_order_id');
144
  // if(!$maxOrderID) $maxOrderID=9999999999;
145
 
146
- $limit = $this->getRequest()->getPost('limit');
147
- if(!$limit) $limit=1000;
 
 
 
 
148
 
149
- $offset = $this->getRequest()->getPost('offset');
150
- if(!$offset) $offset=0;
151
 
152
- $store_id = $this->getRequest()->getPost('store_id');
153
- if(!$store_id) $store_id=1;
154
 
155
- $pdata = $this->getRequest()->getPost('pdata');
156
 
157
- $download = $this->getRequest()->getPost('download');
158
 
159
- $endtime = str_replace('.','-',Mage::getStoreConfig('minubo_interface/settings/lastexportenddate',Mage::app()->getStore()));
160
- if(time()-strtotime($endtime)>(600)) {
161
  $config = new Mage_Core_Model_Config();
162
- $config->saveConfig('minubo_interface/settings/lastexportstartdate', str_replace('.','-',date('Y.m.d H:i:s')), 'default', 0);
163
  $config = null;
164
  }
 
 
 
 
 
 
 
 
 
 
 
165
  }
166
 
167
  public function countriesAction ()
@@ -292,7 +307,14 @@ class Minubo_Interface_ExportController extends Mage_Core_Controller_Front_Actio
292
  case 'Standard':
293
  $model = Mage::getModel('minubo_interface/tables');
294
  $model->init($sqlinterface.($store_id=='1'?'':$store_id));
295
- $rows = $model->readLimited($limit, $offset);
 
 
 
 
 
 
 
296
 
297
  if (count($colTitles)==0) {
298
  $colTitles = $rows[0]; // first data-row: Array ( [attribute_set_id] => 38 ...
118
  '# memory_get_peak_usage(false): '.memory_get_peak_usage(false).'<br>';
119
  }
120
 
121
+ function getParam(&$lastChangeDate, &$maxChangeDate, &$lastOrderID, &$maxOrderID, &$limit, &$offset, &$debug, &$pdata, &$store_id, &$download, $nolog = false) {
122
 
123
  $debug = $this->getRequest()->getPost('debug');
124
  if($debug) echo '# memory_get_usage(true): '.memory_get_usage(true).'<br>';
143
  $maxOrderID = $this->getRequest()->getPost('max_order_id');
144
  // if(!$maxOrderID) $maxOrderID=9999999999;
145
 
146
+ $limit = $this->getRequest()->getPost('limit');
147
+ if($limit=='0') {
148
+ // ok
149
+ } else {
150
+ if(!$limit) $limit=1000;
151
+ }
152
 
153
+ $offset = $this->getRequest()->getPost('offset');
154
+ if(!$offset) $offset=0;
155
 
156
+ $store_id = $this->getRequest()->getPost('store_id');
157
+ if(!$store_id) $store_id=1;
158
 
159
+ $pdata = $this->getRequest()->getPost('pdata');
160
 
161
+ $download = $this->getRequest()->getPost('download');
162
 
163
+ $endtime = str_replace('.','-',Mage::getStoreConfig('vinos_interface/settings/lastexportenddate',Mage::app()->getStore()));
164
+ if((time()-strtotime($endtime)>(600)) && !$nolog) {
165
  $config = new Mage_Core_Model_Config();
166
+ $config->saveConfig('vinos_interface/settings/lastexportstartdate', str_replace('.','-',date('Y.m.d H:i:s')), 'default', 0);
167
  $config = null;
168
  }
169
+
170
+ if($debug) {
171
+ echo 'lastChangeDate: '.$lastChangeDate.'<br>';
172
+ echo 'maxChangeDate: '.$maxChangeDate.'<br>';
173
+ echo 'lastOrderId: '.$lastOrderID.'<br>';
174
+ echo 'maxOrderId: '.$maxOrderID.'<br>';
175
+ echo 'limit: '.$limit.'<br>';
176
+ echo 'offset: '.$offset.'<br>';
177
+ echo 'storeId: '.$store_id.'<br>';
178
+ echo 'download: '.$download.'<br>';
179
+ }
180
  }
181
 
182
  public function countriesAction ()
307
  case 'Standard':
308
  $model = Mage::getModel('minubo_interface/tables');
309
  $model->init($sqlinterface.($store_id=='1'?'':$store_id));
310
+
311
+ if($limit>0) {
312
+ if($debug) echo 'readLimited: '.$limit.'/'.$offset.'<br>';
313
+ $rows = $model->readLimited($limit, $offset);
314
+ } else {
315
+ if($debug) echo 'readAll<br>';
316
+ $rows = $model->readAll();
317
+ }
318
 
319
  if (count($colTitles)==0) {
320
  $colTitles = $rows[0]; // first data-row: Array ( [attribute_set_id] => 38 ...
app/code/community/Minubo/Interface/etc/config.xml CHANGED
@@ -2,7 +2,7 @@
2
  <config>
3
  <modules>
4
  <Minubo_Interface>
5
- <version>1.0.10</version>
6
  </Minubo_Interface>
7
  </modules>
8
  <global>
@@ -35,6 +35,24 @@
35
  <categories3>
36
  <table>catalog_category_flat_store_3</table>
37
  </categories3>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
38
  <customers>
39
  <table>customer_entity</table>
40
  </customers>
@@ -71,6 +89,24 @@
71
  <products3>
72
  <table>catalog_product_flat_3</table>
73
  </products3>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
74
  <productcategories>
75
  <table>catalog_category_product_index</table>
76
  </productcategories>
2
  <config>
3
  <modules>
4
  <Minubo_Interface>
5
+ <version>1.0.11</version>
6
  </Minubo_Interface>
7
  </modules>
8
  <global>
35
  <categories3>
36
  <table>catalog_category_flat_store_3</table>
37
  </categories3>
38
+ <categories4>
39
+ <table>catalog_category_flat_store_4</table>
40
+ </categories4>
41
+ <categories5>
42
+ <table>catalog_category_flat_store_5</table>
43
+ </categories5>
44
+ <categories6>
45
+ <table>catalog_category_flat_store_6</table>
46
+ </categories6>
47
+ <categories7>
48
+ <table>catalog_category_flat_store_7</table>
49
+ </categories7>
50
+ <categories8>
51
+ <table>catalog_category_flat_store_8</table>
52
+ </categories8>
53
+ <categories9>
54
+ <table>catalog_category_flat_store_9</table>
55
+ </categories9>
56
  <customers>
57
  <table>customer_entity</table>
58
  </customers>
89
  <products3>
90
  <table>catalog_product_flat_3</table>
91
  </products3>
92
+ <products4>
93
+ <table>catalog_product_flat_4</table>
94
+ </products4>
95
+ <products5>
96
+ <table>catalog_product_flat_5</table>
97
+ </products5>
98
+ <products6>
99
+ <table>catalog_product_flat_6</table>
100
+ </products6>
101
+ <products7>
102
+ <table>catalog_product_flat_7</table>
103
+ </products7>
104
+ <products8>
105
+ <table>catalog_product_flat_8</table>
106
+ </products8>
107
+ <products9>
108
+ <table>catalog_product_flat_9</table>
109
+ </products9>
110
  <productcategories>
111
  <table>catalog_category_product_index</table>
112
  </productcategories>
package.xml CHANGED
@@ -1,18 +1,18 @@
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>Minubo_Interface</name>
4
- <version>1.0.10</version>
5
  <stability>stable</stability>
6
  <license uri="http://opensource.org/licenses/osl-3.0.php">Open Software License (OSL)</license>
7
  <channel>community</channel>
8
  <extends/>
9
  <summary>Minubo Interface connects your Magento Shop to the All-In-One eCommerce Cloud BI Solution at minubo.com</summary>
10
  <description>Minubo Interface connects your Magento Shop to the All-In-One eCommerce Cloud BI Solution at minubo.com. With this Extension in your Magento Shop your minubo Account at minubo.com can be configured to poll the newest data - of cause without any personalization - every day to bring the information to your screen, which you need to optimize your sales business. See more about minubo at minubo.com Minubo Interface supports Magento 1.5 (or newer). In Backend you can configure the Minubo Interface at System/Configuration/Sales/Minubo Interface (enable/disable, generate access key and see information about last export). Right now, the Minubo Interface is at the end of beta status and you have to change in the Magento Connect Backend the setting to allow download of other than stable releases.</description>
11
- <notes>Added the ability to add custom fields to products especially for manufacturer and country-of-origin</notes>
12
  <authors><author><name>sven rothe</name><user>minubo</user><email>sven@minubo.com</email></author></authors>
13
- <date>2013-09-22</date>
14
- <time>19:53:42</time>
15
- <contents><target name="magecommunity"><dir name="Minubo"><dir name="Interface"><dir name="Block"><dir name="Adminhtml"><file name="Authhash.php" hash="c98e63efd5e4e42a6bc1c223a75176c3"/><file name="Lastchangedate.php" hash="c82ee55fad83d848f47a8594bd25c5af"/><dir name="System"><dir name="Config"><dir name="Form"><file name="Button.php" hash="c288b69aa22cc9ff5e978ff2b89646e9"/></dir></dir></dir><file name="Version.php" hash="31db32eca5dcaf3ad86c747bb3e11efc"/></dir></dir><dir name="Helper"><file name="Data.php" hash="d9cf690ff97d2014cd3e443c07ab4ea7"/></dir><dir name="Model"><dir name="Export"><file name="Abstractcsv.php" hash="13e3663020c59a2700c298c55613cfce"/><file name="Csv.php" hash="77cbeb41b49539b9179bc185bbbb6b4e"/><file name="Status.php" hash="cef67926aef558b87d4e3bcb02386743"/></dir><dir name="Mysql4"><file name="Categories.php" hash="4c5cc06db334e8f8e93176983ff2a2a5"/><file name="Categories2.php" hash="8aca4fa85df43b3a3ce218d0af27564b"/><file name="Categories3.php" hash="a39d7d2fa625e89f731a0b84a1659563"/><file name="Creditmemoitems.php" hash="417301b2227b91c6f4289214c287b4e8"/><file name="Creditmemos.php" hash="821c38dffc35468da0b5405a18b49429"/><file name="Customeraddresses.php" hash="93d3c82c80f85de361de5e7e6c4ecf68"/><file name="Customers.php" hash="2243c128671e73cf70396efd9a9e5627"/><file name="Invoiceitems.php" hash="b487f7780366a832e9e28bb7e66e95e0"/><file name="Invoices.php" hash="8b1dcc3491f76eb68ac1ee2c4e965234"/><file name="Orderaddresses.php" hash="15672ef2e5eaf1a4a7d327edec087652"/><file name="Orderitems.php" hash="37fa91a9307f37441bdf0ac37794b3a4"/><file name="Orders.php" hash="1c221153e35b0dfc28e0ea0189bf1e83"/><file name="Productattributes.php" hash="3f1d8d692e5a96d231548568bc79b228"/><file name="Productcategories.php" hash="3fe724235a87d4700dc1a2dc9dde7175"/><file name="Products.php" hash="6e458cae91b41af7d9fab3f5e5a6cd14"/><file name="Products2.php" hash="f06c90f73b9a54f650aa6f372133143b"/><file name="Products3.php" hash="5fc4b0816e4646726872a0295ef98464"/><file name="Regions.php" hash="f1575516572fbd9a58e8c025fefa95d4"/></dir><dir name="Options"><file name="Options.php" hash="b696a731d9daa7f53c8375f19ad3838f"/><file name="Version.php" hash="fafcca0d77fbbe7fb26b869a845963bf"/></dir><dir name="Read"><file name="Collections.php" hash="2af8284c1653b0637c9d1542397043f1"/><file name="Common.php" hash="18b089bb03cbb226b95db428a7c31ef2"/></dir><file name="Tables.php" hash="c66214083bce5f94d932c6521dfaf05a"/></dir><dir name="controllers"><file name="ExportController.php" hash="9880af09daa1417e2032afe910ebe349"/></dir><dir name="etc"><file name="adminhtml.xml" hash="375c548aacaf6f1bfdf4de3af7b29dfb"/><file name="config.xml" hash="7527be2f6d174742c1fc1524aa5c88a3"/><file name="system.xml" hash="6e5dee7d3b636760a19d9d793123cb7f"/></dir></dir></dir></target><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="template"><dir name="minubo"><dir name="system"><dir name="config"><file name="button.phtml" hash=""/></dir></dir></dir></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Minubo_Interface.xml" hash=""/></dir></target></contents>
16
  <compatible/>
17
  <dependencies><required><php><min>5.1.0</min><max>6.0.0</max></php></required></dependencies>
18
  </package>
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>Minubo_Interface</name>
4
+ <version>1.0.11</version>
5
  <stability>stable</stability>
6
  <license uri="http://opensource.org/licenses/osl-3.0.php">Open Software License (OSL)</license>
7
  <channel>community</channel>
8
  <extends/>
9
  <summary>Minubo Interface connects your Magento Shop to the All-In-One eCommerce Cloud BI Solution at minubo.com</summary>
10
  <description>Minubo Interface connects your Magento Shop to the All-In-One eCommerce Cloud BI Solution at minubo.com. With this Extension in your Magento Shop your minubo Account at minubo.com can be configured to poll the newest data - of cause without any personalization - every day to bring the information to your screen, which you need to optimize your sales business. See more about minubo at minubo.com Minubo Interface supports Magento 1.5 (or newer). In Backend you can configure the Minubo Interface at System/Configuration/Sales/Minubo Interface (enable/disable, generate access key and see information about last export). Right now, the Minubo Interface is at the end of beta status and you have to change in the Magento Connect Backend the setting to allow download of other than stable releases.</description>
11
+ <notes>Added the option to get all data with limit=0</notes>
12
  <authors><author><name>sven rothe</name><user>minubo</user><email>sven@minubo.com</email></author></authors>
13
+ <date>2013-10-16</date>
14
+ <time>11:56:27</time>
15
+ <contents><target name="magecommunity"><dir name="Minubo"><dir name="Interface"><dir name="Block"><dir name="Adminhtml"><file name="Authhash.php" hash="c98e63efd5e4e42a6bc1c223a75176c3"/><file name="Lastchangedate.php" hash="c82ee55fad83d848f47a8594bd25c5af"/><dir name="System"><dir name="Config"><dir name="Form"><file name="Button.php" hash="c288b69aa22cc9ff5e978ff2b89646e9"/></dir></dir></dir><file name="Version.php" hash="31db32eca5dcaf3ad86c747bb3e11efc"/></dir></dir><dir name="Helper"><file name="Data.php" hash="d9cf690ff97d2014cd3e443c07ab4ea7"/></dir><dir name="Model"><dir name="Export"><file name="Abstractcsv.php" hash="13e3663020c59a2700c298c55613cfce"/><file name="Csv.php" hash="77cbeb41b49539b9179bc185bbbb6b4e"/><file name="Status.php" hash="cef67926aef558b87d4e3bcb02386743"/></dir><dir name="Mysql4"><file name="Categories.php" hash="4c5cc06db334e8f8e93176983ff2a2a5"/><file name="Categories2.php" hash="8aca4fa85df43b3a3ce218d0af27564b"/><file name="Categories3.php" hash="a39d7d2fa625e89f731a0b84a1659563"/><file name="Categories4.php" hash="e4da47ff0558565456e7ed33a8e80436"/><file name="Creditmemoitems.php" hash="417301b2227b91c6f4289214c287b4e8"/><file name="Creditmemos.php" hash="821c38dffc35468da0b5405a18b49429"/><file name="Customeraddresses.php" hash="93d3c82c80f85de361de5e7e6c4ecf68"/><file name="Customers.php" hash="2243c128671e73cf70396efd9a9e5627"/><file name="Invoiceitems.php" hash="b487f7780366a832e9e28bb7e66e95e0"/><file name="Invoices.php" hash="8b1dcc3491f76eb68ac1ee2c4e965234"/><file name="Orderaddresses.php" hash="15672ef2e5eaf1a4a7d327edec087652"/><file name="Orderitems.php" hash="37fa91a9307f37441bdf0ac37794b3a4"/><file name="Orders.php" hash="1c221153e35b0dfc28e0ea0189bf1e83"/><file name="Productattributes.php" hash="3f1d8d692e5a96d231548568bc79b228"/><file name="Productcategories.php" hash="3fe724235a87d4700dc1a2dc9dde7175"/><file name="Products.php" hash="6e458cae91b41af7d9fab3f5e5a6cd14"/><file name="Products2.php" hash="f06c90f73b9a54f650aa6f372133143b"/><file name="Products3.php" hash="5fc4b0816e4646726872a0295ef98464"/><file name="Products4.php" hash="15ef1a50ad26397d168497871ddd47c5"/><file name="Regions.php" hash="f1575516572fbd9a58e8c025fefa95d4"/></dir><dir name="Options"><file name="Options.php" hash="b696a731d9daa7f53c8375f19ad3838f"/><file name="Version.php" hash="fafcca0d77fbbe7fb26b869a845963bf"/></dir><dir name="Read"><file name="Collections.php" hash="2af8284c1653b0637c9d1542397043f1"/><file name="Common.php" hash="18b089bb03cbb226b95db428a7c31ef2"/></dir><file name="Tables.php" hash="c66214083bce5f94d932c6521dfaf05a"/></dir><dir name="controllers"><file name="ExportController.php" hash="6bc24912f975f87ae7fc6058d3c5dd51"/></dir><dir name="etc"><file name="adminhtml.xml" hash="375c548aacaf6f1bfdf4de3af7b29dfb"/><file name="config.xml" hash="3d82a6dab2dba7090e76e92a57e12db8"/><file name="system.xml" hash="6e5dee7d3b636760a19d9d793123cb7f"/></dir></dir></dir></target><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="template"><dir name="minubo"><dir name="system"><dir name="config"><file name="button.phtml" hash=""/></dir></dir></dir></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Minubo_Interface.xml" hash=""/></dir></target></contents>
16
  <compatible/>
17
  <dependencies><required><php><min>5.1.0</min><max>6.0.0</max></php></required></dependencies>
18
  </package>