Minubo_Interface - Version 1.0.14

Version Notes

Several enhancements when using other store_id than 1

Download this release

Release Info

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


Code changes from version 1.0.12 to 1.0.14

app/code/community/Minubo/Interface/Model/Mysql4/Categories.php CHANGED
@@ -1,6 +1,7 @@
1
  <?php
2
  class Minubo_Interface_Model_Mysql4_Categories extends Mage_Core_Model_Mysql4_Abstract
3
  {
 
4
  public function _construct()
5
  {
6
  $this->_init('minubo_interface/categories', 'entity_id');
@@ -22,26 +23,26 @@ class Minubo_Interface_Model_Mysql4_Categories extends Mage_Core_Model_Mysql4_Ab
22
  return $id;
23
  }
24
 
25
- public function loadAll(){
26
- $table = $this->getMainTable();
27
  $where = $this->_getReadAdapter()->quoteInto("entity_id > ?", 0);
28
  $select = $this->_getReadAdapter()->select()->from($table)
29
- ->reset('columns')
30
- ->columns($this->getColumns())
31
- ->where($where)
32
- ->order('created_at');
33
  return $this->_getReadAdapter()->fetchAll($select);
34
  }
35
 
36
- public function loadLimited($limit, $offset){
37
- $table = $this->getMainTable();
38
  $where = $this->_getReadAdapter()->quoteInto("entity_id > ?", 0);
39
  $select = $this->_getReadAdapter()->select()->from($table)
40
- ->reset('columns')
41
- ->columns($this->getColumns())
42
- ->where($where)
43
- ->limit($limit, $offset)
44
- ->order('created_at');
45
  return $this->_getReadAdapter()->fetchAll($select);
46
  }
47
  }
1
  <?php
2
  class Minubo_Interface_Model_Mysql4_Categories extends Mage_Core_Model_Mysql4_Abstract
3
  {
4
+
5
  public function _construct()
6
  {
7
  $this->_init('minubo_interface/categories', 'entity_id');
23
  return $id;
24
  }
25
 
26
+ public function loadAllByStoreId($store_id=''){
27
+ $table = str_replace('_1','_'.$store_id,$this->getMainTable());
28
  $where = $this->_getReadAdapter()->quoteInto("entity_id > ?", 0);
29
  $select = $this->_getReadAdapter()->select()->from($table)
30
+ ->reset('columns')
31
+ ->columns($this->getColumns())
32
+ ->where($where)
33
+ ->order('created_at');
34
  return $this->_getReadAdapter()->fetchAll($select);
35
  }
36
 
37
+ public function loadLimitedByStoreId($limit, $offset, $store_id=''){
38
+ $table = str_replace('_1','_'.$store_id,$this->getMainTable());
39
  $where = $this->_getReadAdapter()->quoteInto("entity_id > ?", 0);
40
  $select = $this->_getReadAdapter()->select()->from($table)
41
+ ->reset('columns')
42
+ ->columns($this->getColumns())
43
+ ->where($where)
44
+ ->limit($limit, $offset)
45
+ ->order('created_at');
46
  return $this->_getReadAdapter()->fetchAll($select);
47
  }
48
  }
app/code/community/Minubo/Interface/Model/Mysql4/Categories2.php DELETED
@@ -1,26 +0,0 @@
1
- <?php
2
- class Minubo_Interface_Model_Mysql4_Categories2 extends Mage_Core_Model_Mysql4_Abstract
3
- {
4
- public function _construct()
5
- {
6
- $this->_init('minubo_interface/categories2', '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/Categories3.php DELETED
@@ -1,26 +0,0 @@
1
- <?php
2
- class Minubo_Interface_Model_Mysql4_Categories3 extends Mage_Core_Model_Mysql4_Abstract
3
- {
4
- public function _construct()
5
- {
6
- $this->_init('minubo_interface/categories3', '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/Categories4.php DELETED
@@ -1,26 +0,0 @@
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/Products.php CHANGED
@@ -37,8 +37,8 @@ class Minubo_Interface_Model_Mysql4_Products extends Mage_Core_Model_Mysql4_Abst
37
  return $id;
38
  }
39
 
40
- public function loadAll(){
41
- $table = $this->getMainTable();
42
  $where = $this->_getReadAdapter()->quoteInto("entity_id > ?", 0);
43
  $select = $this->_getReadAdapter()->select()->from($table)
44
  ->reset('columns')
@@ -48,8 +48,8 @@ class Minubo_Interface_Model_Mysql4_Products extends Mage_Core_Model_Mysql4_Abst
48
  return $this->_getReadAdapter()->fetchAll($select);
49
  }
50
 
51
- public function loadLimited($limit, $offset){
52
- $table = $this->getMainTable();
53
  $where = $this->_getReadAdapter()->quoteInto("entity_id > ?", 0);
54
  $select = $this->_getReadAdapter()->select()->from($table)
55
  ->reset('columns')
37
  return $id;
38
  }
39
 
40
+ public function loadAllByStoreId($store_id=''){
41
+ $table = str_replace('_1','_'.$store_id,$this->getMainTable());
42
  $where = $this->_getReadAdapter()->quoteInto("entity_id > ?", 0);
43
  $select = $this->_getReadAdapter()->select()->from($table)
44
  ->reset('columns')
48
  return $this->_getReadAdapter()->fetchAll($select);
49
  }
50
 
51
+ public function loadLimitedByStoreId($limit, $offset, $store_id=''){
52
+ $table = str_replace('_1','_'.$store_id,$this->getMainTable());
53
  $where = $this->_getReadAdapter()->quoteInto("entity_id > ?", 0);
54
  $select = $this->_getReadAdapter()->select()->from($table)
55
  ->reset('columns')
app/code/community/Minubo/Interface/Model/Mysql4/Products2.php DELETED
@@ -1,62 +0,0 @@
1
- <?php
2
- class Minubo_Interface_Model_Mysql4_Products2 extends Mage_Core_Model_Mysql4_Abstract
3
- {
4
- public function _construct()
5
- {
6
- $this->_init('minubo_interface/products2', '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/Model/Mysql4/Products3.php DELETED
@@ -1,62 +0,0 @@
1
- <?php
2
- class Minubo_Interface_Model_Mysql4_Products3 extends Mage_Core_Model_Mysql4_Abstract
3
- {
4
- public function _construct()
5
- {
6
- $this->_init('minubo_interface/products3', '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/Model/Mysql4/Products4.php DELETED
@@ -1,62 +0,0 @@
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/Model/Tables.php CHANGED
@@ -48,12 +48,22 @@ class Minubo_Interface_Model_Tables extends Minubo_Interface_Model_Read_Common
48
  $data = $this->getResource()->loadAll();
49
  return $data;
50
  }
51
-
 
 
 
 
 
52
  public function readLimited($limit, $offset)
53
  {
54
  $data = $this->getResource()->loadLimited($limit, $offset);
55
  return $data;
56
  }
 
 
 
 
 
57
 
58
  }
59
  ?>
48
  $data = $this->getResource()->loadAll();
49
  return $data;
50
  }
51
+ public function readAllByStoreId($storeId)
52
+ {
53
+ $data = $this->getResource()->loadAllByStoreId($storeId);
54
+ return $data;
55
+ }
56
+
57
  public function readLimited($limit, $offset)
58
  {
59
  $data = $this->getResource()->loadLimited($limit, $offset);
60
  return $data;
61
  }
62
+ public function readLimitedByStoreId($limit, $offset, $storeId)
63
+ {
64
+ $data = $this->getResource()->loadLimitedByStoreId($limit, $offset, $storeId);
65
+ return $data;
66
+ }
67
 
68
  }
69
  ?>
app/code/community/Minubo/Interface/controllers/ExportController.php CHANGED
@@ -174,17 +174,18 @@ class Minubo_Interface_ExportController extends Mage_Core_Controller_Front_Actio
174
  $offset = $this->getRequest()->getPost('offset');
175
  if(!$offset) $offset=0;
176
 
177
- $store_id = $this->getRequest()->getPost('store_id');
178
- if(!$store_id) $store_id=1;
 
179
 
180
  $pdata = $this->getRequest()->getPost('pdata');
181
 
182
  $download = $this->getRequest()->getPost('download');
183
 
184
- $endtime = str_replace('.','-',Mage::getStoreConfig('vinos_interface/settings/lastexportenddate',Mage::app()->getStore()));
185
- if((time()-strtotime($endtime)>(600)) && !$nolog) {
186
  $config = new Mage_Core_Model_Config();
187
- $config->saveConfig('vinos_interface/settings/lastexportstartdate', str_replace('.','-',date('Y.m.d H:i:s')), 'default', 0);
188
  $config = null;
189
  }
190
 
@@ -211,7 +212,7 @@ class Minubo_Interface_ExportController extends Mage_Core_Controller_Front_Actio
211
 
212
  public function handleCountries (&$rows, $filename, $type, $pdata, $start, $download)
213
  {
214
- switch(Mage::getStoreConfig('minubo_interface/settings/output_type')){
215
  case 'Standard':
216
  $file = Mage::getModel('minubo_interface/export_csv')->exportCountries($rows, $filename, $type, $pdata);
217
  if (!$download) {
@@ -219,7 +220,7 @@ class Minubo_Interface_ExportController extends Mage_Core_Controller_Front_Actio
219
  } else {
220
  $this->_prepareDownloadResponse($file, file_get_contents(Mage::getBaseDir('export').'/'.$file));
221
  }
222
- break;
223
  }
224
  $config = new Mage_Core_Model_Config();
225
  $config->saveConfig('minubo_interface/settings/lastexportenddate', str_replace('.','-',date('Y.m.d H:i:s')), 'default', 0);
@@ -276,14 +277,14 @@ class Minubo_Interface_ExportController extends Mage_Core_Controller_Front_Actio
276
  {
277
  $renameCols = array('entity_id' => 'category_id');
278
  $colTitles = array('Category_Id','Parent_Id','Position','Category_Name','level','image','url_key','url_path');
279
- $this->handleTable ('categories', 'category', 'categories', $colTitles, Array(), $renameCols);
280
  }
281
 
282
  public function productcategoriesAction ()
283
  {
284
  $skipCols = array('is_parent');
285
  $colTitles = array('category_id','product_id','position','store_id','visibility');
286
- $this->handleTable ('productcategories', 'productcategory', 'productcategories', $colTitles, $skipCols, Array(), true);
287
  }
288
 
289
  public function productattributesAction ()
@@ -328,21 +329,28 @@ class Minubo_Interface_ExportController extends Mage_Core_Controller_Front_Actio
328
  $start = $this->getMicrotime();
329
  $this->getParam($lastChangeDate, $maxChangeDate, $lastOrderID, $maxOrderID, $limit, $offset, $debug, $pdata, $store_id, $download);
330
 
331
- // switch(Mage::getStoreConfig('minubo_interface/settings/output_type')){
332
- // case 'Standard':
333
  $model = Mage::getModel('minubo_interface/tables');
334
- if($appendStoreId):
335
- $model->init($sqlinterface.($store_id=='1'?'':$store_id));
336
- else:
337
- $model->init($sqlinterface);
338
- endif;
339
 
340
  if($limit>0) {
341
- if($debug) echo 'readLimited: '.$limit.'/'.$offset.'<br>';
342
- $rows = $model->readLimited($limit, $offset);
 
 
 
 
 
343
  } else {
344
- if($debug) echo 'readAll<br>';
345
- $rows = $model->readAll();
 
 
 
 
 
346
  }
347
 
348
  if (count($colTitles)==0) {
@@ -357,8 +365,8 @@ class Minubo_Interface_ExportController extends Mage_Core_Controller_Front_Actio
357
  } else {
358
  $this->_prepareDownloadResponse($file, file_get_contents(Mage::getBaseDir('export').'/'.$file));
359
  }
360
- // break;
361
- // }
362
  $config = new Mage_Core_Model_Config();
363
  $config->saveConfig('minubo_interface/settings/lastexportenddate', str_replace('.','-',date('Y.m.d H:i:s')), 'default', 0);
364
  $config = null;
@@ -366,7 +374,7 @@ class Minubo_Interface_ExportController extends Mage_Core_Controller_Front_Actio
366
  $model = null;
367
  $rows = null;
368
  $file = null;
369
- if($debug) echo $this->getEndlog($start);
370
  }
371
 
372
  }
174
  $offset = $this->getRequest()->getPost('offset');
175
  if(!$offset) $offset=0;
176
 
177
+ $store_id = Mage::getStoreConfig('minubo_interface/settings/storeid',Mage::app()->getStore());
178
+ if(!$store_id) $store_id = $this->getRequest()->getPost('store_id');
179
+ if(!$store_id) $store_id='1';
180
 
181
  $pdata = $this->getRequest()->getPost('pdata');
182
 
183
  $download = $this->getRequest()->getPost('download');
184
 
185
+ $endtime = str_replace('.','-',Mage::getStoreConfig('minubo_interface/settings/lastexportenddate',Mage::app()->getStore()));
186
+ if(((time()-strtotime($endtime))>600) && !$nolog) {
187
  $config = new Mage_Core_Model_Config();
188
+ $config->saveConfig('minubo_interface/settings/lastexportstartdate', str_replace('.','-',date('Y.m.d H:i:s')), 'default', 0);
189
  $config = null;
190
  }
191
 
212
 
213
  public function handleCountries (&$rows, $filename, $type, $pdata, $start, $download)
214
  {
215
+ switch(Mage::getStoreConfig('minubo_interface/settings/output_type',Mage::app()->getStore())){
216
  case 'Standard':
217
  $file = Mage::getModel('minubo_interface/export_csv')->exportCountries($rows, $filename, $type, $pdata);
218
  if (!$download) {
220
  } else {
221
  $this->_prepareDownloadResponse($file, file_get_contents(Mage::getBaseDir('export').'/'.$file));
222
  }
223
+ break;
224
  }
225
  $config = new Mage_Core_Model_Config();
226
  $config->saveConfig('minubo_interface/settings/lastexportenddate', str_replace('.','-',date('Y.m.d H:i:s')), 'default', 0);
277
  {
278
  $renameCols = array('entity_id' => 'category_id');
279
  $colTitles = array('Category_Id','Parent_Id','Position','Category_Name','level','image','url_key','url_path');
280
+ $this->handleTable ('categories', 'category', 'categories', $colTitles, Array(), $renameCols, true);
281
  }
282
 
283
  public function productcategoriesAction ()
284
  {
285
  $skipCols = array('is_parent');
286
  $colTitles = array('category_id','product_id','position','store_id','visibility');
287
+ $this->handleTable ('productcategories', 'productcategory', 'productcategories', $colTitles, $skipCols, Array());
288
  }
289
 
290
  public function productattributesAction ()
329
  $start = $this->getMicrotime();
330
  $this->getParam($lastChangeDate, $maxChangeDate, $lastOrderID, $maxOrderID, $limit, $offset, $debug, $pdata, $store_id, $download);
331
 
332
+ switch(Mage::getStoreConfig('minubo_interface/settings/output_type',Mage::app()->getStore())){
333
+ case 'Standard':
334
  $model = Mage::getModel('minubo_interface/tables');
335
+ if($debug) echo 'model->init: '.$sqlinterface.'<br>';
336
+ $model->init($sqlinterface);
 
 
 
337
 
338
  if($limit>0) {
339
+ if($appendStoreId):
340
+ if($debug) echo 'readLimitedByStoreId: '.$limit.'/'.$offset.'/'.$store_id.'<br>';
341
+ $rows = $model->readLimitedByStoreId($limit, $offset, $store_id);
342
+ else:
343
+ if($debug) echo 'readLimited: '.$limit.'/'.$offset.'<br>';
344
+ $rows = $model->readLimited($limit, $offset);
345
+ endif;
346
  } else {
347
+ if($appendStoreId):
348
+ if($debug) echo 'readAllByStoreId: '.$store_id.'<br>';
349
+ $rows = $model->readAllByStoreId($store_id);
350
+ else:
351
+ if($debug) echo 'readAll<br>';
352
+ $rows = $model->readAll();
353
+ endif;
354
  }
355
 
356
  if (count($colTitles)==0) {
365
  } else {
366
  $this->_prepareDownloadResponse($file, file_get_contents(Mage::getBaseDir('export').'/'.$file));
367
  }
368
+ break;
369
+ }
370
  $config = new Mage_Core_Model_Config();
371
  $config->saveConfig('minubo_interface/settings/lastexportenddate', str_replace('.','-',date('Y.m.d H:i:s')), 'default', 0);
372
  $config = null;
374
  $model = null;
375
  $rows = null;
376
  $file = null;
377
+ if($debug) echo $this->getEndlog($start).'<br>';
378
  }
379
 
380
  }
app/code/community/Minubo/Interface/etc/config.xml CHANGED
@@ -2,7 +2,7 @@
2
  <config>
3
  <modules>
4
  <Minubo_Interface>
5
- <version>1.0.12</version>
6
  </Minubo_Interface>
7
  </modules>
8
  <global>
2
  <config>
3
  <modules>
4
  <Minubo_Interface>
5
+ <version>1.0.14</version>
6
  </Minubo_Interface>
7
  </modules>
8
  <global>
app/code/community/Minubo/Interface/etc/system.xml CHANGED
@@ -70,18 +70,26 @@
70
  <show_in_website>1</show_in_website>
71
  <show_in_store>0</show_in_store>
72
  </output_type>
 
 
 
 
 
 
 
 
73
  <productbrand translate="label">
74
  <label>Additional product-field brand (see catalog_product_flat_1)</label>
75
  <frontend_type>text</frontend_type>
76
- <sort_order>5</sort_order>
77
  <show_in_default>1</show_in_default>
78
  <show_in_website>1</show_in_website>
79
  <show_in_store>0</show_in_store>
80
  </productbrand>
81
  <productorigin translate="label">
82
- <label>Additional product-fields country of origin (see catalog_product_flat_1)</label>
83
  <frontend_type>text</frontend_type>
84
- <sort_order>6</sort_order>
85
  <show_in_default>1</show_in_default>
86
  <show_in_website>1</show_in_website>
87
  <show_in_store>0</show_in_store>
@@ -89,7 +97,7 @@
89
  <productfields translate="label">
90
  <label>Additional product-fields (comma-separated, see catalog_product_flat_1)</label>
91
  <frontend_type>text</frontend_type>
92
- <sort_order>7</sort_order>
93
  <show_in_default>1</show_in_default>
94
  <show_in_website>1</show_in_website>
95
  <show_in_store>0</show_in_store>
@@ -97,7 +105,7 @@
97
  <attributefields translate="label">
98
  <label>Additional product-attribute-fields (comma-separated, see eav_attribute.attribute_code -> catalog_product_entity_varchar)</label>
99
  <frontend_type>text</frontend_type>
100
- <sort_order>8</sort_order>
101
  <show_in_default>1</show_in_default>
102
  <show_in_website>1</show_in_website>
103
  <show_in_store>0</show_in_store>
@@ -105,7 +113,7 @@
105
  <lastexportstartdate translate="label">
106
  <label>Last Export started at</label>
107
  <frontend_type>label</frontend_type>
108
- <sort_order>9</sort_order>
109
  <show_in_default>1</show_in_default>
110
  <show_in_website>1</show_in_website>
111
  <show_in_store>0</show_in_store>
@@ -113,7 +121,7 @@
113
  <lastexportenddate translate="label">
114
  <label>Last Export ended at</label>
115
  <frontend_type>label</frontend_type>
116
- <sort_order>10</sort_order>
117
  <show_in_default>1</show_in_default>
118
  <show_in_website>1</show_in_website>
119
  <show_in_store>0</show_in_store>
@@ -121,7 +129,7 @@
121
  <firstchangedate translate="label">
122
  <label>Last Export from Change-Date</label>
123
  <frontend_type>label</frontend_type>
124
- <sort_order>11</sort_order>
125
  <show_in_default>1</show_in_default>
126
  <show_in_website>1</show_in_website>
127
  <show_in_store>0</show_in_store>
@@ -129,7 +137,7 @@
129
  <lastchangedate translate="label">
130
  <label>Last Export to Change-Date</label>
131
  <frontend_type>label</frontend_type>
132
- <sort_order>12</sort_order>
133
  <show_in_default>1</show_in_default>
134
  <show_in_website>1</show_in_website>
135
  <show_in_store>0</show_in_store>
70
  <show_in_website>1</show_in_website>
71
  <show_in_store>0</show_in_store>
72
  </output_type>
73
+ <storeid translate="label">
74
+ <label>Store ID (optional, Default: 1)</label>
75
+ <frontend_type>text</frontend_type>
76
+ <sort_order>5</sort_order>
77
+ <show_in_default>1</show_in_default>
78
+ <show_in_website>1</show_in_website>
79
+ <show_in_store>0</show_in_store>
80
+ </storeid>
81
  <productbrand translate="label">
82
  <label>Additional product-field brand (see catalog_product_flat_1)</label>
83
  <frontend_type>text</frontend_type>
84
+ <sort_order>6</sort_order>
85
  <show_in_default>1</show_in_default>
86
  <show_in_website>1</show_in_website>
87
  <show_in_store>0</show_in_store>
88
  </productbrand>
89
  <productorigin translate="label">
90
+ <label>Additional product-field country of origin (see catalog_product_flat_1)</label>
91
  <frontend_type>text</frontend_type>
92
+ <sort_order>7</sort_order>
93
  <show_in_default>1</show_in_default>
94
  <show_in_website>1</show_in_website>
95
  <show_in_store>0</show_in_store>
97
  <productfields translate="label">
98
  <label>Additional product-fields (comma-separated, see catalog_product_flat_1)</label>
99
  <frontend_type>text</frontend_type>
100
+ <sort_order>8</sort_order>
101
  <show_in_default>1</show_in_default>
102
  <show_in_website>1</show_in_website>
103
  <show_in_store>0</show_in_store>
105
  <attributefields translate="label">
106
  <label>Additional product-attribute-fields (comma-separated, see eav_attribute.attribute_code -> catalog_product_entity_varchar)</label>
107
  <frontend_type>text</frontend_type>
108
+ <sort_order>9</sort_order>
109
  <show_in_default>1</show_in_default>
110
  <show_in_website>1</show_in_website>
111
  <show_in_store>0</show_in_store>
113
  <lastexportstartdate translate="label">
114
  <label>Last Export started at</label>
115
  <frontend_type>label</frontend_type>
116
+ <sort_order>10</sort_order>
117
  <show_in_default>1</show_in_default>
118
  <show_in_website>1</show_in_website>
119
  <show_in_store>0</show_in_store>
121
  <lastexportenddate translate="label">
122
  <label>Last Export ended at</label>
123
  <frontend_type>label</frontend_type>
124
+ <sort_order>11</sort_order>
125
  <show_in_default>1</show_in_default>
126
  <show_in_website>1</show_in_website>
127
  <show_in_store>0</show_in_store>
129
  <firstchangedate translate="label">
130
  <label>Last Export from Change-Date</label>
131
  <frontend_type>label</frontend_type>
132
+ <sort_order>12</sort_order>
133
  <show_in_default>1</show_in_default>
134
  <show_in_website>1</show_in_website>
135
  <show_in_store>0</show_in_store>
137
  <lastchangedate translate="label">
138
  <label>Last Export to Change-Date</label>
139
  <frontend_type>label</frontend_type>
140
+ <sort_order>13</sort_order>
141
  <show_in_default>1</show_in_default>
142
  <show_in_website>1</show_in_website>
143
  <show_in_store>0</show_in_store>
package.xml CHANGED
@@ -1,18 +1,18 @@
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>Minubo_Interface</name>
4
- <version>1.0.12</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>Bugfix when using other store_id than 1 and reading config information; Extended counter function</notes>
12
  <authors><author><name>sven rothe</name><user>minubo</user><email>sven@minubo.com</email></author></authors>
13
- <date>2013-10-23</date>
14
- <time>11:35:13</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="94a1b9c669ff01892994faa507152f9c"/><file name="Csv.php" hash="dd8c0131b7099fb914fbdee1d6e1a468"/><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="3d92e8d366554a304f48aaef02dfe5c3"/><file name="Invoiceitems.php" hash="b487f7780366a832e9e28bb7e66e95e0"/><file name="Invoices.php" hash="8b1dcc3491f76eb68ac1ee2c4e965234"/><file name="Orderaddresses.php" hash="648014e35db97bd57c4830e0f4882ad4"/><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="e324b0330982839038855380c32eecea"/></dir><dir name="controllers"><file name="ExportController.php" hash="9ca44cbeff9865934d124d0221de4301"/></dir><dir name="etc"><file name="adminhtml.xml" hash="375c548aacaf6f1bfdf4de3af7b29dfb"/><file name="config.xml" hash="bbab3a84122ed44692f67a5d388e58b0"/><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.14</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>Several enhancements when using other store_id than 1</notes>
12
  <authors><author><name>sven rothe</name><user>minubo</user><email>sven@minubo.com</email></author></authors>
13
+ <date>2013-10-24</date>
14
+ <time>11:05:53</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="94a1b9c669ff01892994faa507152f9c"/><file name="Csv.php" hash="dd8c0131b7099fb914fbdee1d6e1a468"/><file name="Status.php" hash="cef67926aef558b87d4e3bcb02386743"/></dir><dir name="Mysql4"><file name="Categories.php" hash="134195b236be62eb41f87ace553c445e"/><file name="Creditmemoitems.php" hash="417301b2227b91c6f4289214c287b4e8"/><file name="Creditmemos.php" hash="821c38dffc35468da0b5405a18b49429"/><file name="Customeraddresses.php" hash="93d3c82c80f85de361de5e7e6c4ecf68"/><file name="Customers.php" hash="3d92e8d366554a304f48aaef02dfe5c3"/><file name="Invoiceitems.php" hash="b487f7780366a832e9e28bb7e66e95e0"/><file name="Invoices.php" hash="8b1dcc3491f76eb68ac1ee2c4e965234"/><file name="Orderaddresses.php" hash="648014e35db97bd57c4830e0f4882ad4"/><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="ad3ac6a1f906bc369a74b16b67515606"/><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="01c70cbcfea18fc3081ecab487a59498"/></dir><dir name="controllers"><file name="ExportController.php" hash="4ae2ab5f39317405ff9ed05d8d745b93"/></dir><dir name="etc"><file name="adminhtml.xml" hash="375c548aacaf6f1bfdf4de3af7b29dfb"/><file name="config.xml" hash="f8838fa725018b19871b338cac0d6d3d"/><file name="system.xml" hash="682c1364dd016ebde10820ecfa21382f"/></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>