Version Notes
Extended Country-Data; Performance-Enhancements Customer-Data; Preparation for future enhancements
Download this release
Release Info
Developer | sven rothe |
Extension | Minubo_Interface |
Version | 1.0.2 |
Comparing to | |
See all releases |
Code changes from version 1.0.1 to 1.0.2
- app/code/community/Minubo/Interface/Model/Export/Csv.php +29 -35
- app/code/community/Minubo/Interface/Model/Mysql4/Customeraddresses.php +84 -0
- app/code/community/Minubo/Interface/Model/Mysql4/Customers.php +57 -0
- app/code/community/Minubo/Interface/Model/Mysql4/Orderaddresses.php +57 -0
- app/code/community/Minubo/Interface/Model/Mysql4/Productattributes.php +95 -95
- app/code/community/Minubo/Interface/Model/Read/Collections.php +134 -180
- app/code/community/Minubo/Interface/controllers/ExportController.php +406 -396
- app/code/community/Minubo/Interface/etc/config.xml +135 -116
- package.xml +6 -21
app/code/community/Minubo/Interface/Model/Export/Csv.php
CHANGED
@@ -57,6 +57,21 @@ class Minubo_Interface_Model_Export_Csv extends Minubo_Interface_Model_Export_Ab
|
|
57 |
return $fileName;
|
58 |
}
|
59 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
60 |
public function exportCollection($rows, $filename, $type, $pdata = '')
|
61 |
{
|
62 |
$fileName = $filename.'_export_'.date("Ymd_His").'.csv';
|
@@ -233,44 +248,12 @@ class Minubo_Interface_Model_Export_Csv extends Minubo_Interface_Model_Export_Ab
|
|
233 |
'appliedRuleIds', 'giftMessageId'
|
234 |
);
|
235 |
break;
|
236 |
-
case 'customers':
|
237 |
-
if(!$pdata) {
|
238 |
-
$r = array(
|
239 |
-
'Customer_Number',
|
240 |
-
'Customer_Group',
|
241 |
-
'Customer_Group_Name',
|
242 |
-
'Customer_Gender',
|
243 |
-
'Customer_Name',
|
244 |
-
'Customer_Email',
|
245 |
-
'Customer_Company',
|
246 |
-
'Customer_Street',
|
247 |
-
'Customer_Zip',
|
248 |
-
'Customer_City',
|
249 |
-
'Customer_State',
|
250 |
-
'Customer_State_Name',
|
251 |
-
'Customer_Country',
|
252 |
-
'Customer_Country_Name',
|
253 |
-
'Customer_Phone_Number',
|
254 |
-
'Costomer_HashCode'
|
255 |
-
);
|
256 |
-
} else {
|
257 |
-
$r = array(
|
258 |
-
'Customer_Number',
|
259 |
-
'Customer_Gender',
|
260 |
-
'Customer_Zip',
|
261 |
-
'Customer_City',
|
262 |
-
'Customer_State',
|
263 |
-
'Customer_State_Name',
|
264 |
-
'Customer_Country',
|
265 |
-
'Customer_Country_Name',
|
266 |
-
'Costomer_HashCode'
|
267 |
-
);
|
268 |
-
}
|
269 |
-
break;
|
270 |
case 'countries':
|
271 |
$r = array (
|
272 |
'Country_Id',
|
273 |
-
'Country_Name'
|
|
|
|
|
274 |
);
|
275 |
break;
|
276 |
default:
|
@@ -293,6 +276,17 @@ class Minubo_Interface_Model_Export_Csv extends Minubo_Interface_Model_Export_Ab
|
|
293 |
}
|
294 |
fputcsv($fp, $data, self::DELIMITER, self::ENCLOSURE);
|
295 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
296 |
|
297 |
/**
|
298 |
* Writes the row(s) for the given order in the csv file.
|
57 |
return $fileName;
|
58 |
}
|
59 |
|
60 |
+
public function exportCountries($rows, $filename, $type, $pdata = '')
|
61 |
+
{
|
62 |
+
$fileName = $filename.'_export_'.date("Ymd_His").'.csv';
|
63 |
+
$fp = fopen(Mage::getBaseDir('export').'/'.$fileName, 'w');
|
64 |
+
|
65 |
+
$this->writeHeadRow($fp, $type, $pdata);
|
66 |
+
foreach ($rows as $row) {
|
67 |
+
$this->writeCountry($row, $fp, $type);
|
68 |
+
}
|
69 |
+
|
70 |
+
fclose($fp);
|
71 |
+
|
72 |
+
return $fileName;
|
73 |
+
}
|
74 |
+
|
75 |
public function exportCollection($rows, $filename, $type, $pdata = '')
|
76 |
{
|
77 |
$fileName = $filename.'_export_'.date("Ymd_His").'.csv';
|
248 |
'appliedRuleIds', 'giftMessageId'
|
249 |
);
|
250 |
break;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
251 |
case 'countries':
|
252 |
$r = array (
|
253 |
'Country_Id',
|
254 |
+
'Country_Name',
|
255 |
+
'ISO2_Code',
|
256 |
+
'ISO3_Code'
|
257 |
);
|
258 |
break;
|
259 |
default:
|
276 |
}
|
277 |
fputcsv($fp, $data, self::DELIMITER, self::ENCLOSURE);
|
278 |
}
|
279 |
+
|
280 |
+
protected function writeCountry($country, $fp, $group)
|
281 |
+
{
|
282 |
+
$common = array(
|
283 |
+
$country->getCountryId(),
|
284 |
+
$country->getName(),
|
285 |
+
$country->getIso2Code(),
|
286 |
+
$country->getIso3Code());
|
287 |
+
fputcsv($fp, $common, self::DELIMITER, self::ENCLOSURE);
|
288 |
+
}
|
289 |
+
|
290 |
|
291 |
/**
|
292 |
* Writes the row(s) for the given order in the csv file.
|
app/code/community/Minubo/Interface/Model/Mysql4/Customeraddresses.php
ADDED
@@ -0,0 +1,84 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
class Minubo_Interface_Model_Mysql4_Customeraddresses extends Mage_Core_Model_Mysql4_Abstract
|
3 |
+
{
|
4 |
+
public function _construct()
|
5 |
+
{
|
6 |
+
$this->_init('minubo_interface/customeraddresses', 'entity_id');
|
7 |
+
}
|
8 |
+
|
9 |
+
protected function getColumns() {
|
10 |
+
return array('oa.entity_id','oa.customer_address_id','oa.region_id','oa.region','oa.postcode','oa.city','oa.country_id','oa.address_type','MD5(oa.email) AS Customer_HashCode','c.group_id','cg.customer_group_code','o.store_id');
|
11 |
+
}
|
12 |
+
|
13 |
+
public function loadByField($field,$value){
|
14 |
+
$table = $this->getMainTable();
|
15 |
+
$table2 = $this->getTable('customer_address_entity');
|
16 |
+
$cond2 = $this->_getReadAdapter()->quoteInto('oa.customer_address_id = ca.entity_id','');
|
17 |
+
$table3 = $this->getTable('customer_entity');
|
18 |
+
$cond3 = $this->_getReadAdapter()->quoteInto('ca.parent_id = c.entity_id','');
|
19 |
+
$table4 = $this->getTable('customer_group');
|
20 |
+
$cond4 = $this->_getReadAdapter()->quoteInto('c.group_id = cg.customer_group_id','');
|
21 |
+
$table5 = $this->getTable('sales_flat_order');
|
22 |
+
$cond5 = $this->_getReadAdapter()->quoteInto('oa.parent_id = o.entity_id','');
|
23 |
+
$where = $this->_getReadAdapter()->quoteInto("$field = ?", $value);
|
24 |
+
$select = $this->_getReadAdapter()->select()->from(array('oa'=>$table))
|
25 |
+
->join(array('ca'=>$table2), $cond2)
|
26 |
+
->join(array('c'=>$table3), $cond3)
|
27 |
+
->join(array('cg'=>$table4), $cond4)
|
28 |
+
->join(array('o'=>$table5), $cond5)
|
29 |
+
->reset('columns')
|
30 |
+
->columns($this->getColumns())
|
31 |
+
->where($where);
|
32 |
+
$id = $this->_getReadAdapter()->fetchOne($sql);
|
33 |
+
return $id;
|
34 |
+
}
|
35 |
+
|
36 |
+
public function loadAll(){
|
37 |
+
$table = $this->getMainTable();
|
38 |
+
$table2 = $this->getTable('customer_address_entity');
|
39 |
+
$cond2 = $this->_getReadAdapter()->quoteInto('oa.customer_address_id = ca.entity_id','');
|
40 |
+
$table3 = $this->getTable('customer_entity');
|
41 |
+
$cond3 = $this->_getReadAdapter()->quoteInto('ca.parent_id = c.entity_id','');
|
42 |
+
$table4 = $this->getTable('customer_group');
|
43 |
+
$cond4 = $this->_getReadAdapter()->quoteInto('c.group_id = cg.customer_group_id','');
|
44 |
+
$table5 = $this->getTable('sales_flat_order');
|
45 |
+
$cond5 = $this->_getReadAdapter()->quoteInto('oa.parent_id = o.entity_id','');
|
46 |
+
$where = $this->_getReadAdapter()->quoteInto("oa.entity_id > ?", 0);
|
47 |
+
$select = $this->_getReadAdapter()->select()->from(array('oa'=>$table))
|
48 |
+
->join(array('ca'=>$table2), $cond2)
|
49 |
+
->join(array('c'=>$table3), $cond3)
|
50 |
+
->join(array('cg'=>$table4), $cond4)
|
51 |
+
->join(array('o'=>$table5), $cond5)
|
52 |
+
->reset('columns')
|
53 |
+
->columns($this->getColumns())
|
54 |
+
->where($where)
|
55 |
+
->order('entity_id');
|
56 |
+
return $this->_getReadAdapter()->fetchAll($select);
|
57 |
+
}
|
58 |
+
|
59 |
+
public function loadLimited($limit, $offset){
|
60 |
+
$table = $this->getMainTable();
|
61 |
+
$table2 = $this->getTable('customer_address_entity');
|
62 |
+
$cond2 = $this->_getReadAdapter()->quoteInto('oa.customer_address_id = ca.entity_id','');
|
63 |
+
$table3 = $this->getTable('customer_entity');
|
64 |
+
$cond3 = $this->_getReadAdapter()->quoteInto('ca.parent_id = c.entity_id','');
|
65 |
+
$table4 = $this->getTable('customer_group');
|
66 |
+
$cond4 = $this->_getReadAdapter()->quoteInto('c.group_id = cg.customer_group_id','');
|
67 |
+
$table5 = $this->getTable('sales_flat_order');
|
68 |
+
$cond5 = $this->_getReadAdapter()->quoteInto('oa.parent_id = o.entity_id','');
|
69 |
+
$where = $this->_getReadAdapter()->quoteInto("oa.entity_id > ?", 0);
|
70 |
+
$select = $this->_getReadAdapter()->select()->from(array('oa'=>$table))
|
71 |
+
->join(array('ca'=>$table2), $cond2)
|
72 |
+
->join(array('c'=>$table3), $cond3)
|
73 |
+
->join(array('cg'=>$table4), $cond4)
|
74 |
+
->join(array('o'=>$table5), $cond5)
|
75 |
+
->reset('columns')
|
76 |
+
->columns($this->getColumns())
|
77 |
+
->where($where)
|
78 |
+
->limit($limit, $offset)
|
79 |
+
->order('entity_id');
|
80 |
+
return $this->_getReadAdapter()->fetchAll($select);
|
81 |
+
}
|
82 |
+
|
83 |
+
}
|
84 |
+
?>
|
app/code/community/Minubo/Interface/Model/Mysql4/Customers.php
ADDED
@@ -0,0 +1,57 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
class Minubo_Interface_Model_Mysql4_Customers extends Mage_Core_Model_Mysql4_Abstract
|
3 |
+
{
|
4 |
+
public function _construct()
|
5 |
+
{
|
6 |
+
$this->_init('minubo_interface/customers', 'entity_id');
|
7 |
+
}
|
8 |
+
|
9 |
+
protected function getColumns() {
|
10 |
+
return array('entity_id','entity_type_id','attribute_set_id','website_id','MD5(email) AS Customer_HashCode','group_id','increment_id','store_id','created_at','updated_at','is_active','disable_auto_group_change','cg.customer_group_id','cg.customer_group_code','cg.tax_class_id');
|
11 |
+
}
|
12 |
+
|
13 |
+
public function loadByField($field,$value){
|
14 |
+
$table = $this->getMainTable();
|
15 |
+
$table2 = $this->getTable('customer_group');
|
16 |
+
$cond2 = $this->_getReadAdapter()->quoteInto('c.group_id = cg.customer_group_id','');
|
17 |
+
$where = $this->_getReadAdapter()->quoteInto("$field = ?", $value);
|
18 |
+
$select = $this->_getReadAdapter()->select()->from(array('c'=>$table))
|
19 |
+
->join(array('cg'=>$table2), $cond2)
|
20 |
+
->reset('columns')
|
21 |
+
->columns($this->getColumns())
|
22 |
+
->where($where);
|
23 |
+
$id = $this->_getReadAdapter()->fetchOne($sql);
|
24 |
+
return $id;
|
25 |
+
}
|
26 |
+
|
27 |
+
public function loadAll(){
|
28 |
+
$table = $this->getMainTable();
|
29 |
+
$table2 = $this->getTable('customer_group');
|
30 |
+
$cond2 = $this->_getReadAdapter()->quoteInto('c.group_id = cg.customer_group_id','');
|
31 |
+
$where = $this->_getReadAdapter()->quoteInto("c.entity_id > ?", 0);
|
32 |
+
$select = $this->_getReadAdapter()->select()->from(array('c'=>$table))
|
33 |
+
->join(array('cg'=>$table2), $cond2)
|
34 |
+
->reset('columns')
|
35 |
+
->columns($this->getColumns())
|
36 |
+
->where($where)
|
37 |
+
->order('centity_id');
|
38 |
+
return $this->_getReadAdapter()->fetchAll($select);
|
39 |
+
}
|
40 |
+
|
41 |
+
public function loadLimited($limit, $offset){
|
42 |
+
$table = $this->getMainTable();
|
43 |
+
$table2 = $this->getTable('customer_group');
|
44 |
+
$cond2 = $this->_getReadAdapter()->quoteInto('c.group_id = cg.customer_group_id','');
|
45 |
+
$where = $this->_getReadAdapter()->quoteInto("c.entity_id > ?", 0);
|
46 |
+
$select = $this->_getReadAdapter()->select()->from(array('c'=>$table))
|
47 |
+
->join(array('cg'=>$table2), $cond2)
|
48 |
+
->reset('columns')
|
49 |
+
->columns($this->getColumns())
|
50 |
+
->where($where)
|
51 |
+
->limit($limit, $offset)
|
52 |
+
->order('c.entity_id');
|
53 |
+
return $this->_getReadAdapter()->fetchAll($select);
|
54 |
+
}
|
55 |
+
|
56 |
+
}
|
57 |
+
?>
|
app/code/community/Minubo/Interface/Model/Mysql4/Orderaddresses.php
ADDED
@@ -0,0 +1,57 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
class Minubo_Interface_Model_Mysql4_Orderaddresses extends Mage_Core_Model_Mysql4_Abstract
|
3 |
+
{
|
4 |
+
public function _construct()
|
5 |
+
{
|
6 |
+
$this->_init('minubo_interface/orderaddresses', 'entity_id');
|
7 |
+
}
|
8 |
+
|
9 |
+
protected function getColumns() {
|
10 |
+
return array('oa.entity_id','oa.customer_address_id','oa.region_id','oa.region','oa.postcode','oa.city','oa.country_id','oa.address_type','MD5(oa.email) AS Customer_HashCode','o.store_id');
|
11 |
+
}
|
12 |
+
|
13 |
+
public function loadByField($field,$value){
|
14 |
+
$table = $this->getMainTable();
|
15 |
+
$table5 = $this->getTable('sales_flat_order');
|
16 |
+
$cond5 = $this->_getReadAdapter()->quoteInto('oa.parent_id = o.entity_id','');
|
17 |
+
$where = $this->_getReadAdapter()->quoteInto("$field = ?", $value);
|
18 |
+
$select = $this->_getReadAdapter()->select()->from(array('oa'=>$table))
|
19 |
+
->join(array('o'=>$table5), $cond5)
|
20 |
+
->reset('columns')
|
21 |
+
->columns($this->getColumns())
|
22 |
+
->where($where);
|
23 |
+
$id = $this->_getReadAdapter()->fetchOne($sql);
|
24 |
+
return $id;
|
25 |
+
}
|
26 |
+
|
27 |
+
public function loadAll(){
|
28 |
+
$table = $this->getMainTable();
|
29 |
+
$table5 = $this->getTable('sales_flat_order');
|
30 |
+
$cond5 = $this->_getReadAdapter()->quoteInto('oa.parent_id = o.entity_id','');
|
31 |
+
$where = $this->_getReadAdapter()->quoteInto("oa.entity_id > ?", 0);
|
32 |
+
$select = $this->_getReadAdapter()->select()->from(array('oa'=>$table))
|
33 |
+
->join(array('o'=>$table5), $cond5)
|
34 |
+
->reset('columns')
|
35 |
+
->columns($this->getColumns())
|
36 |
+
->where($where)
|
37 |
+
->order('MD5(oa.email), entity_id desc');
|
38 |
+
return $this->_getReadAdapter()->fetchAll($select);
|
39 |
+
}
|
40 |
+
|
41 |
+
public function loadLimited($limit, $offset){
|
42 |
+
$table = $this->getMainTable();
|
43 |
+
$table5 = $this->getTable('sales_flat_order');
|
44 |
+
$cond5 = $this->_getReadAdapter()->quoteInto('oa.parent_id = o.entity_id','');
|
45 |
+
$where = $this->_getReadAdapter()->quoteInto("oa.entity_id > ?", 0);
|
46 |
+
$select = $this->_getReadAdapter()->select()->from(array('oa'=>$table))
|
47 |
+
->join(array('o'=>$table5), $cond5)
|
48 |
+
->reset('columns')
|
49 |
+
->columns($this->getColumns())
|
50 |
+
->where($where)
|
51 |
+
->limit($limit, $offset)
|
52 |
+
->order('MD5(oa.email), entity_id desc');
|
53 |
+
return $this->_getReadAdapter()->fetchAll($select);
|
54 |
+
}
|
55 |
+
|
56 |
+
}
|
57 |
+
?>
|
app/code/community/Minubo/Interface/Model/Mysql4/Productattributes.php
CHANGED
@@ -1,96 +1,96 @@
|
|
1 |
-
<?php
|
2 |
-
class Minubo_Interface_Model_Mysql4_Productattributes extends Mage_Core_Model_Mysql4_Abstract
|
3 |
-
{
|
4 |
-
public function _construct()
|
5 |
-
{
|
6 |
-
$this->_init('minubo_interface/productattributes', 'entity_id');
|
7 |
-
}
|
8 |
-
|
9 |
-
protected function getColumns() {
|
10 |
-
return array('e.attribute_set_id','eas.attribute_set_name','eav.attribute_id','eav.attribute_code','eav.backend_type','eav.is_required','var.value','var.value_id');
|
11 |
-
}
|
12 |
-
|
13 |
-
public function loadByField($field,$value){
|
14 |
-
$table = $this->getMainTable();
|
15 |
-
$table2 = $this->getTable('eav_attribute');
|
16 |
-
$cond2 = $this->_getReadAdapter()->quoteInto('e.entity_type_id = eav.entity_type_id AND ','').$this->_getReadAdapter()->quoteInto('eav.backend_type = "varchar"', '');
|
17 |
-
$table3 = $this->getTable('catalog_product_entity_varchar');
|
18 |
-
$cond3 = $this->_getReadAdapter()->quoteInto('eav.attribute_id = var.attribute_id AND ','').$this->_getReadAdapter()->quoteInto('e.entity_id = var.entity_id', '');
|
19 |
-
$table4 = $this->getTable('eav_attribute_set');
|
20 |
-
$cond4 = $this->_getReadAdapter()->quoteInto('e.attribute_set_id = eas.attribute_set_id AND ','').$this->_getReadAdapter()->quoteInto('e.entity_id = var.entity_id', '');
|
21 |
-
$where = $this->_getReadAdapter()->quoteInto("$field = ? AND eav.attribute_code in ('name','color')", 0);
|
22 |
-
$select = $this->_getReadAdapter()->select()->from(array('e'=>$table))
|
23 |
-
->join(array('eav'=>$table2), $cond2)
|
24 |
-
->join(array('var'=>$table3), $cond3)
|
25 |
-
->join(array('eas'=>$table4), $cond4)
|
26 |
-
->reset('columns')
|
27 |
-
->columns($this->getColumns())
|
28 |
-
->where($where);
|
29 |
-
$id = $this->_getReadAdapter()->fetchOne($sql);
|
30 |
-
return $id;
|
31 |
-
}
|
32 |
-
|
33 |
-
public function loadAll(){
|
34 |
-
$table = $this->getMainTable();
|
35 |
-
$table2 = $this->getTable('eav_attribute');
|
36 |
-
$cond2 = $this->_getReadAdapter()->quoteInto('e.entity_type_id = eav.entity_type_id AND ','').$this->_getReadAdapter()->quoteInto('eav.backend_type = "varchar"', '');
|
37 |
-
$table3 = $this->getTable('catalog_product_entity_varchar');
|
38 |
-
$cond3 = $this->_getReadAdapter()->quoteInto('eav.attribute_id = var.attribute_id AND ','').$this->_getReadAdapter()->quoteInto('e.entity_id = var.entity_id', '');
|
39 |
-
$table4 = $this->getTable('eav_attribute_set');
|
40 |
-
$cond4 = $this->_getReadAdapter()->quoteInto('e.attribute_set_id = eas.attribute_set_id AND ','').$this->_getReadAdapter()->quoteInto('e.entity_id = var.entity_id', '');
|
41 |
-
$where = $this->_getReadAdapter()->quoteInto("e.entity_id > ? AND eav.attribute_code in ('name','color')", 0);
|
42 |
-
$select = $this->_getReadAdapter()->select()->from(array('e'=>$table))
|
43 |
-
->join(array('eav'=>$table2), $cond2)
|
44 |
-
->join(array('var'=>$table3), $cond3)
|
45 |
-
->join(array('eas'=>$table4), $cond4)
|
46 |
-
->reset('columns')
|
47 |
-
->columns($this->getColumns())
|
48 |
-
->where($where)
|
49 |
-
->order('e.entity_id');
|
50 |
-
/*
|
51 |
-
echo $select."<br/>";
|
52 |
-
|
53 |
-
$table = $this->getMainTable();
|
54 |
-
$where = $this->_getReadAdapter()->quoteInto("category_id > ?", 0);
|
55 |
-
// $select = $this->_getReadAdapter()->select()->from($table)->columns(array('entity_id','parent_id','name'))->where($where)->limit(10,5)->order('created_at');
|
56 |
-
$select = $this->_getReadAdapter()->select()->from($table)->where($where)->order('category_id');
|
57 |
-
*/
|
58 |
-
|
59 |
-
return $this->_getReadAdapter()->fetchAll($select);
|
60 |
-
|
61 |
-
/*
|
62 |
-
SELECT e.entity_id AS product_id, var.value AS product_name
|
63 |
-
FROM catalog_product_entity e, eav_attribute eav, catalog_product_entity_varchar var
|
64 |
-
WHERE
|
65 |
-
e.entity_type_id = eav.entity_type_id
|
66 |
-
AND eav.attribute_code = 'name'
|
67 |
-
AND eav.attribute_id = var.attribute_id
|
68 |
-
AND var.entity_id = e.entity_id
|
69 |
-
*/
|
70 |
-
|
71 |
-
|
72 |
-
}
|
73 |
-
|
74 |
-
public function loadLimited($limit, $offset){
|
75 |
-
$table = $this->getMainTable();
|
76 |
-
$table2 = $this->getTable('eav_attribute');
|
77 |
-
$cond2 = $this->_getReadAdapter()->quoteInto('e.entity_type_id = eav.entity_type_id','');
|
78 |
-
$table3 = $this->getTable('catalog_product_entity_varchar');
|
79 |
-
$cond3 = $this->_getReadAdapter()->quoteInto('eav.attribute_id = var.attribute_id AND ','').$this->_getReadAdapter()->quoteInto('e.entity_id = var.entity_id', '');
|
80 |
-
$table4 = $this->getTable('eav_attribute_set');
|
81 |
-
$cond4 = $this->_getReadAdapter()->quoteInto('e.attribute_set_id = eas.attribute_set_id AND ','').$this->_getReadAdapter()->quoteInto('e.entity_id = var.entity_id', '');
|
82 |
-
$where = $this->_getReadAdapter()->quoteInto("e.entity_id > ? AND eav.attribute_code in ('name','color')", 0);
|
83 |
-
$select = $this->_getReadAdapter()->select()->from(array('e'=>$table))->reset('columns')
|
84 |
-
->join(array('eav'=>$table2), $cond2)
|
85 |
-
->join(array('var'=>$table3), $cond3)
|
86 |
-
->join(array('eas'=>$table4), $cond4)
|
87 |
-
->reset('columns')
|
88 |
-
->columns($this->getColumns())
|
89 |
-
->where($where)
|
90 |
-
->limit($limit, $offset)
|
91 |
-
->order('e.entity_id');
|
92 |
-
|
93 |
-
return $this->_getReadAdapter()->fetchAll($select);
|
94 |
-
}
|
95 |
-
}
|
96 |
?>
|
1 |
+
<?php
|
2 |
+
class Minubo_Interface_Model_Mysql4_Productattributes extends Mage_Core_Model_Mysql4_Abstract
|
3 |
+
{
|
4 |
+
public function _construct()
|
5 |
+
{
|
6 |
+
$this->_init('minubo_interface/productattributes', 'entity_id');
|
7 |
+
}
|
8 |
+
|
9 |
+
protected function getColumns() {
|
10 |
+
return array('e.attribute_set_id','eas.attribute_set_name','eav.attribute_id','eav.attribute_code','eav.backend_type','eav.is_required','var.value','var.value_id');
|
11 |
+
}
|
12 |
+
|
13 |
+
public function loadByField($field,$value){
|
14 |
+
$table = $this->getMainTable();
|
15 |
+
$table2 = $this->getTable('eav_attribute');
|
16 |
+
$cond2 = $this->_getReadAdapter()->quoteInto('e.entity_type_id = eav.entity_type_id AND ','').$this->_getReadAdapter()->quoteInto('eav.backend_type = "varchar"', '');
|
17 |
+
$table3 = $this->getTable('catalog_product_entity_varchar');
|
18 |
+
$cond3 = $this->_getReadAdapter()->quoteInto('eav.attribute_id = var.attribute_id AND ','').$this->_getReadAdapter()->quoteInto('e.entity_id = var.entity_id', '');
|
19 |
+
$table4 = $this->getTable('eav_attribute_set');
|
20 |
+
$cond4 = $this->_getReadAdapter()->quoteInto('e.attribute_set_id = eas.attribute_set_id AND ','').$this->_getReadAdapter()->quoteInto('e.entity_id = var.entity_id', '');
|
21 |
+
$where = $this->_getReadAdapter()->quoteInto("$field = ? AND eav.attribute_code in ('name','color')", 0);
|
22 |
+
$select = $this->_getReadAdapter()->select()->from(array('e'=>$table))
|
23 |
+
->join(array('eav'=>$table2), $cond2)
|
24 |
+
->join(array('var'=>$table3), $cond3)
|
25 |
+
->join(array('eas'=>$table4), $cond4)
|
26 |
+
->reset('columns')
|
27 |
+
->columns($this->getColumns())
|
28 |
+
->where($where);
|
29 |
+
$id = $this->_getReadAdapter()->fetchOne($sql);
|
30 |
+
return $id;
|
31 |
+
}
|
32 |
+
|
33 |
+
public function loadAll(){
|
34 |
+
$table = $this->getMainTable();
|
35 |
+
$table2 = $this->getTable('eav_attribute');
|
36 |
+
$cond2 = $this->_getReadAdapter()->quoteInto('e.entity_type_id = eav.entity_type_id AND ','').$this->_getReadAdapter()->quoteInto('eav.backend_type = "varchar"', '');
|
37 |
+
$table3 = $this->getTable('catalog_product_entity_varchar');
|
38 |
+
$cond3 = $this->_getReadAdapter()->quoteInto('eav.attribute_id = var.attribute_id AND ','').$this->_getReadAdapter()->quoteInto('e.entity_id = var.entity_id', '');
|
39 |
+
$table4 = $this->getTable('eav_attribute_set');
|
40 |
+
$cond4 = $this->_getReadAdapter()->quoteInto('e.attribute_set_id = eas.attribute_set_id AND ','').$this->_getReadAdapter()->quoteInto('e.entity_id = var.entity_id', '');
|
41 |
+
$where = $this->_getReadAdapter()->quoteInto("e.entity_id > ? AND eav.attribute_code in ('name','color')", 0);
|
42 |
+
$select = $this->_getReadAdapter()->select()->from(array('e'=>$table))
|
43 |
+
->join(array('eav'=>$table2), $cond2)
|
44 |
+
->join(array('var'=>$table3), $cond3)
|
45 |
+
->join(array('eas'=>$table4), $cond4)
|
46 |
+
->reset('columns')
|
47 |
+
->columns($this->getColumns())
|
48 |
+
->where($where)
|
49 |
+
->order('e.entity_id');
|
50 |
+
/*
|
51 |
+
echo $select."<br/>";
|
52 |
+
|
53 |
+
$table = $this->getMainTable();
|
54 |
+
$where = $this->_getReadAdapter()->quoteInto("category_id > ?", 0);
|
55 |
+
// $select = $this->_getReadAdapter()->select()->from($table)->columns(array('entity_id','parent_id','name'))->where($where)->limit(10,5)->order('created_at');
|
56 |
+
$select = $this->_getReadAdapter()->select()->from($table)->where($where)->order('category_id');
|
57 |
+
*/
|
58 |
+
|
59 |
+
return $this->_getReadAdapter()->fetchAll($select);
|
60 |
+
|
61 |
+
/*
|
62 |
+
SELECT e.entity_id AS product_id, var.value AS product_name
|
63 |
+
FROM catalog_product_entity e, eav_attribute eav, catalog_product_entity_varchar var
|
64 |
+
WHERE
|
65 |
+
e.entity_type_id = eav.entity_type_id
|
66 |
+
AND eav.attribute_code = 'name'
|
67 |
+
AND eav.attribute_id = var.attribute_id
|
68 |
+
AND var.entity_id = e.entity_id
|
69 |
+
*/
|
70 |
+
|
71 |
+
|
72 |
+
}
|
73 |
+
|
74 |
+
public function loadLimited($limit, $offset){
|
75 |
+
$table = $this->getMainTable();
|
76 |
+
$table2 = $this->getTable('eav_attribute');
|
77 |
+
$cond2 = $this->_getReadAdapter()->quoteInto('e.entity_type_id = eav.entity_type_id','');
|
78 |
+
$table3 = $this->getTable('catalog_product_entity_varchar');
|
79 |
+
$cond3 = $this->_getReadAdapter()->quoteInto('eav.attribute_id = var.attribute_id AND ','').$this->_getReadAdapter()->quoteInto('e.entity_id = var.entity_id', '');
|
80 |
+
$table4 = $this->getTable('eav_attribute_set');
|
81 |
+
$cond4 = $this->_getReadAdapter()->quoteInto('e.attribute_set_id = eas.attribute_set_id AND ','').$this->_getReadAdapter()->quoteInto('e.entity_id = var.entity_id', '');
|
82 |
+
$where = $this->_getReadAdapter()->quoteInto("e.entity_id > ? AND eav.attribute_code in ('name','color')", 0);
|
83 |
+
$select = $this->_getReadAdapter()->select()->from(array('e'=>$table))->reset('columns')
|
84 |
+
->join(array('eav'=>$table2), $cond2)
|
85 |
+
->join(array('var'=>$table3), $cond3)
|
86 |
+
->join(array('eas'=>$table4), $cond4)
|
87 |
+
->reset('columns')
|
88 |
+
->columns($this->getColumns())
|
89 |
+
->where($where)
|
90 |
+
->limit($limit, $offset)
|
91 |
+
->order('e.entity_id');
|
92 |
+
|
93 |
+
return $this->_getReadAdapter()->fetchAll($select);
|
94 |
+
}
|
95 |
+
}
|
96 |
?>
|
app/code/community/Minubo/Interface/Model/Read/Collections.php
CHANGED
@@ -1,181 +1,135 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* Magento Minubo Interface Export Module
|
4 |
-
*
|
5 |
-
* NOTICE OF LICENSE
|
6 |
-
*
|
7 |
-
* This source file is subject to the Open Software License (OSL 3.0)
|
8 |
-
* that is bundled with this package in the file LICENSE.txt.
|
9 |
-
* It is also available through the world-wide-web at this URL:
|
10 |
-
* http://opensource.org/licenses/osl-3.0.php
|
11 |
-
* If you did not receive a copy of the license and are unable to
|
12 |
-
* obtain it through the world-wide-web, please send an email
|
13 |
-
* to license@magentocommerce.com so we can send you a copy immediately.
|
14 |
-
*
|
15 |
-
* DISCLAIMER
|
16 |
-
*
|
17 |
-
* Do not edit or add to this file if you wish to upgrade Magento to newer
|
18 |
-
* versions in the future. If you wish to customize Magento for your
|
19 |
-
* needs please refer to http://www.magentocommerce.com for more information.
|
20 |
-
*
|
21 |
-
* @category Minubo
|
22 |
-
* @package Minubo_Interface
|
23 |
-
* @copyright Copyright (c) 2013 Minubo (http://www.minubo.com)
|
24 |
-
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
25 |
-
* @author Sven Rothe <srothe@minubo.com>
|
26 |
-
* */
|
27 |
-
|
28 |
-
class Minubo_Interface_Model_Read_Collections extends Minubo_Interface_Model_Read_Common
|
29 |
-
|
30 |
-
{
|
31 |
-
/**
|
32 |
-
* Concrete implementation of abstract method to export given orders to csv file in var/export.
|
33 |
-
*
|
34 |
-
* @param $orders List of orders of type Mage_Sales_Model_Order or order ids to export.
|
35 |
-
* @return String The name of the written csv file in var/export
|
36 |
-
*/
|
37 |
-
public function read($lastChangeDate, $maxChangeDate, $lastOrderID, $maxOrderID, $limit, $offset, $debug, $pdata, $store_id, $type='', $sort='')
|
38 |
-
{
|
39 |
-
return $this->readOrders($lastChangeDate, $maxChangeDate, $lastOrderID, $maxOrderID, $limit, $offset, $debug, $pdata, $store_id, $type, $sort);
|
40 |
-
}
|
41 |
-
|
42 |
-
public function readOrders($lastExportDate, $maxChangeDate, $lastOrderID, $maxOrderID, $limit, $offset, $debug, $pdata, $store_id, $type='', $sort='')
|
43 |
-
{
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
if(
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
|
63 |
-
|
64 |
-
|
65 |
-
|
66 |
-
|
67 |
-
|
68 |
-
|
69 |
-
|
70 |
-
|
71 |
-
|
72 |
-
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
-
|
77 |
-
|
78 |
-
|
79 |
-
|
80 |
-
|
81 |
-
|
82 |
-
|
83 |
-
|
84 |
-
|
85 |
-
|
86 |
-
|
87 |
-
|
88 |
-
if($debug
|
89 |
-
|
90 |
-
|
91 |
-
$
|
92 |
-
|
93 |
-
|
94 |
-
|
95 |
-
|
96 |
-
|
97 |
-
|
98 |
-
|
99 |
-
|
100 |
-
|
101 |
-
|
102 |
-
|
103 |
-
|
104 |
-
|
105 |
-
|
106 |
-
|
107 |
-
|
108 |
-
|
109 |
-
|
110 |
-
|
111 |
-
|
112 |
-
|
113 |
-
|
114 |
-
|
115 |
-
|
116 |
-
|
117 |
-
|
118 |
-
|
119 |
-
|
120 |
-
|
121 |
-
|
122 |
-
|
123 |
-
|
124 |
-
|
125 |
-
|
126 |
-
|
127 |
-
|
128 |
-
|
129 |
-
|
130 |
-
|
131 |
-
|
132 |
-
|
133 |
-
|
134 |
-
|
135 |
-
|
136 |
-
if(!$maxChangeDate) {
|
137 |
-
$config = new Mage_Core_Model_Config();
|
138 |
-
$config->saveConfig('minubo_interface/settings/firstchangedate', $firstChangeDate, 'default', 0);
|
139 |
-
$config->saveConfig('minubo_interface/settings/lastchangedate', $lastChangeDate, 'default', 0);
|
140 |
-
}
|
141 |
-
|
142 |
-
return $orders;
|
143 |
-
}
|
144 |
-
|
145 |
-
public function readCountries($lastChangeDate, $maxChangeDate, $lastOrderID, $maxOrderID, $limit, $offset, $debug, $pdata, $store_id)
|
146 |
-
{
|
147 |
-
$countries = Mage::getModel('directory/country')->getResourceCollection()->loadByStore()->toOptionArray(true);
|
148 |
-
return $countries;
|
149 |
-
}
|
150 |
-
|
151 |
-
public function readCustomers($lastChangeDate, $maxChangeDate, $lastOrderID, $maxOrderID, $limit, $offset, $debug, $pdata, $store_id)
|
152 |
-
{
|
153 |
-
$customers = Mage::getModel('customer/customer')->getCollection()->addAttributeToSelect('*');
|
154 |
-
return $customers;
|
155 |
-
}
|
156 |
-
|
157 |
-
public function readProducts($lastChangeDate, $maxChangeDate, $lastOrderID, $maxOrderID, $limit, $offset, $debug, $pdata, $store_id)
|
158 |
-
{
|
159 |
-
// $products = Mage::getModel('catalog/product')->getResourceCollection()->toOptionArray(true);
|
160 |
-
$products = Mage::getResourceModel('catalog/product_collection');
|
161 |
-
|
162 |
-
$i=0;
|
163 |
-
$firstChangeDate='';
|
164 |
-
$lastChangeDate='';
|
165 |
-
foreach($products as $key=>$product){
|
166 |
-
if($i<=$offset) {
|
167 |
-
$products->removeItemByKey($key);
|
168 |
-
if($debug>=2) echo '# Deleted by OFFSET: '.$key.' '.$products->getIncrementId().' '.$products->getUpdatedAt(),'<br>';
|
169 |
-
}
|
170 |
-
if($i>($offset+$limit)) {
|
171 |
-
$products->removeItemByKey($key);
|
172 |
-
if($debug>=2) echo '# Deleted by LIMIT: '.$key.' '.$products->getIncrementId().' '.$products->getUpdatedAt(),'<br>';
|
173 |
-
}
|
174 |
-
}
|
175 |
-
|
176 |
-
return $products;
|
177 |
-
}
|
178 |
-
|
179 |
-
}
|
180 |
-
|
181 |
?>
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Magento Minubo Interface Export Module
|
4 |
+
*
|
5 |
+
* NOTICE OF LICENSE
|
6 |
+
*
|
7 |
+
* This source file is subject to the Open Software License (OSL 3.0)
|
8 |
+
* that is bundled with this package in the file LICENSE.txt.
|
9 |
+
* It is also available through the world-wide-web at this URL:
|
10 |
+
* http://opensource.org/licenses/osl-3.0.php
|
11 |
+
* If you did not receive a copy of the license and are unable to
|
12 |
+
* obtain it through the world-wide-web, please send an email
|
13 |
+
* to license@magentocommerce.com so we can send you a copy immediately.
|
14 |
+
*
|
15 |
+
* DISCLAIMER
|
16 |
+
*
|
17 |
+
* Do not edit or add to this file if you wish to upgrade Magento to newer
|
18 |
+
* versions in the future. If you wish to customize Magento for your
|
19 |
+
* needs please refer to http://www.magentocommerce.com for more information.
|
20 |
+
*
|
21 |
+
* @category Minubo
|
22 |
+
* @package Minubo_Interface
|
23 |
+
* @copyright Copyright (c) 2013 Minubo (http://www.minubo.com)
|
24 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
25 |
+
* @author Sven Rothe <srothe@minubo.com>
|
26 |
+
* */
|
27 |
+
|
28 |
+
class Minubo_Interface_Model_Read_Collections extends Minubo_Interface_Model_Read_Common
|
29 |
+
|
30 |
+
{
|
31 |
+
/**
|
32 |
+
* Concrete implementation of abstract method to export given orders to csv file in var/export.
|
33 |
+
*
|
34 |
+
* @param $orders List of orders of type Mage_Sales_Model_Order or order ids to export.
|
35 |
+
* @return String The name of the written csv file in var/export
|
36 |
+
*/
|
37 |
+
public function read($lastChangeDate, $maxChangeDate, $lastOrderID, $maxOrderID, $limit, $offset, $debug, $pdata, $store_id, $type='', $sort='')
|
38 |
+
{
|
39 |
+
return $this->readOrders($lastChangeDate, $maxChangeDate, $lastOrderID, $maxOrderID, $limit, $offset, $debug, $pdata, $store_id, $type, $sort);
|
40 |
+
}
|
41 |
+
|
42 |
+
public function readOrders($lastExportDate, $maxChangeDate, $lastOrderID, $maxOrderID, $limit, $offset, $debug, $pdata, $store_id, $type='', $sort='')
|
43 |
+
{
|
44 |
+
// Bestellungen laden
|
45 |
+
if($debug) echo '# ORDER getCollection: '.$limit.'/'.$offset.'/'.$type.'/'.$sort.'/'.$lastExportDate.'<br>';
|
46 |
+
|
47 |
+
$orders = Mage::getModel('sales/order')->getCollection();
|
48 |
+
|
49 |
+
if($lastExportDate) $orders->addFieldToFilter('updated_at',Array('gt'=>$lastExportDate));
|
50 |
+
if($maxChangeDate ) $orders->addFieldToFilter('updated_at',Array('lteq'=>$maxChangeDate));
|
51 |
+
if($lastOrderID ) $orders->addFieldToFilter('increment_id',Array('gt'=>$lastOrderID));
|
52 |
+
if($maxOrderID ) $orders->addFieldToFilter('increment_id',Array('lteq'=>$mxOrderID));
|
53 |
+
if($sort ) $orders->addAttributeToSort(substr($sort,0,strpos($sort,' ')), substr($sort,strpos($sort,' ')+1));
|
54 |
+
|
55 |
+
$orders->setPage(($offset/$limit)+1, $limit);
|
56 |
+
|
57 |
+
if($debug) echo '# Recordcount: '.count($orders).'/'.$orders->getSize().'<br>';
|
58 |
+
|
59 |
+
if($debug) echo '# Paramter: '.$lastExportDate.'/'.$maxChangeDate.'/'.$lastOrderID.'/'.$maxOrderID.'/'.$limit.'/'.$offset.'<br>';
|
60 |
+
$i=0;
|
61 |
+
$firstChangeDate='';
|
62 |
+
$lastChangeDate='';
|
63 |
+
$distinctKeys=array();
|
64 |
+
foreach($orders as $key=>$order) {
|
65 |
+
//product
|
66 |
+
if($debug>=2) echo '# Next order: '.$lastExportDate.'/'.$maxChangeDate.'/'.$firstChangeDate.'/'.$lastChangeDate.'/'.$order->getUpdatedAt().'<br>';
|
67 |
+
|
68 |
+
if(($offset==0) && (!$firstChangeDate || ($order->getUpdatedAt()<$firstChangeDate))) {
|
69 |
+
if($debug>=2) echo '# New FirstChangeDate: '.$order->getUpdatedAt().' -> '.$firstChangeDate.'<br>';
|
70 |
+
$firstChangeDate=$order->getUpdatedAt();
|
71 |
+
}
|
72 |
+
if(!$maxChangeDate && (!$lastChangeDate || ($order->getUpdatedAt()>$lastChangeDate))) {
|
73 |
+
if($debug>=2) echo '# New LastChangeDate: '.$order->getUpdatedAt().' -> '.$lastChangeDate.'<br>';
|
74 |
+
$lastChangeDate=$order->getUpdatedAt();
|
75 |
+
}
|
76 |
+
|
77 |
+
if($type=='orderCustomers') {
|
78 |
+
$distinctKey=md5($order->getCustomerEmail());
|
79 |
+
if(in_array($distinctKey,$distinctKeys)) {
|
80 |
+
$orders->removeItemByKey($key);
|
81 |
+
if ($debug>=2) echo '# Deleted by DUPLICATE CUSTOMER EMAIL: '.$distinctKey.' '.$order->getIncrementId().' '.$order->getUpdatedAt(),'<br>';
|
82 |
+
} else {
|
83 |
+
$distinctKeys[] = $distinctKey;
|
84 |
+
}
|
85 |
+
}
|
86 |
+
|
87 |
+
}
|
88 |
+
if($debug) echo '# New Values (firstChangeDate/lastChangeDate): '.$firstChangeDate.'/'.$lastChangeDate.'<br>';
|
89 |
+
|
90 |
+
if(!$maxChangeDate) {
|
91 |
+
$config = new Mage_Core_Model_Config();
|
92 |
+
$config->saveConfig('minubo_interface/settings/firstchangedate', $firstChangeDate, 'default', 0);
|
93 |
+
$config->saveConfig('minubo_interface/settings/lastchangedate', $lastChangeDate, 'default', 0);
|
94 |
+
}
|
95 |
+
|
96 |
+
return $orders;
|
97 |
+
}
|
98 |
+
|
99 |
+
public function readCountries($lastChangeDate, $maxChangeDate, $lastOrderID, $maxOrderID, $limit, $offset, $debug, $pdata, $store_id)
|
100 |
+
{
|
101 |
+
$countries = Mage::getModel('directory/country')->getResourceCollection()->loadByStore(); // ->toOptionArray(true);
|
102 |
+
return $countries;
|
103 |
+
}
|
104 |
+
|
105 |
+
public function readCustomers($lastChangeDate, $maxChangeDate, $lastOrderID, $maxOrderID, $limit, $offset, $debug, $pdata, $store_id)
|
106 |
+
{
|
107 |
+
$customers = Mage::getModel('customer/customer')->getCollection()->addAttributeToSelect('*');
|
108 |
+
return $customers;
|
109 |
+
}
|
110 |
+
|
111 |
+
public function readProducts($lastChangeDate, $maxChangeDate, $lastOrderID, $maxOrderID, $limit, $offset, $debug, $pdata, $store_id)
|
112 |
+
{
|
113 |
+
// $products = Mage::getModel('catalog/product')->getResourceCollection()->toOptionArray(true);
|
114 |
+
$products = Mage::getResourceModel('catalog/product_collection');
|
115 |
+
|
116 |
+
$i=0;
|
117 |
+
$firstChangeDate='';
|
118 |
+
$lastChangeDate='';
|
119 |
+
foreach($products as $key=>$product){
|
120 |
+
if($i<=$offset) {
|
121 |
+
$products->removeItemByKey($key);
|
122 |
+
if($debug>=2) echo '# Deleted by OFFSET: '.$key.' '.$products->getIncrementId().' '.$products->getUpdatedAt(),'<br>';
|
123 |
+
}
|
124 |
+
if($i>($offset+$limit)) {
|
125 |
+
$products->removeItemByKey($key);
|
126 |
+
if($debug>=2) echo '# Deleted by LIMIT: '.$key.' '.$products->getIncrementId().' '.$products->getUpdatedAt(),'<br>';
|
127 |
+
}
|
128 |
+
}
|
129 |
+
|
130 |
+
return $products;
|
131 |
+
}
|
132 |
+
|
133 |
+
}
|
134 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
135 |
?>
|
app/code/community/Minubo/Interface/controllers/ExportController.php
CHANGED
@@ -1,4 +1,4 @@
|
|
1 |
-
<?php
|
2 |
/**
|
3 |
* Magento Minubo Interface Export Module
|
4 |
*
|
@@ -24,399 +24,409 @@
|
|
24 |
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
25 |
* @author Sven Rothe <srothe@minubo.com>
|
26 |
* */
|
27 |
-
class Minubo_Interface_ExportController extends Mage_Core_Controller_Front_Action
|
28 |
-
{
|
29 |
-
public function indexAction () {
|
30 |
-
$this->loadLayout(array('default'));
|
31 |
-
$this->renderLayout();
|
32 |
-
}
|
33 |
-
public function mymethodeAction () {
|
34 |
-
$this->loadLayout(array('default'));
|
35 |
-
$this->renderLayout();
|
36 |
-
}
|
37 |
-
|
38 |
-
public function versionAction()
|
39 |
-
{
|
40 |
-
// echo Mage::getStoreConfig('minubo_interface/settings/version',Mage::app()->getStore());
|
41 |
-
echo (string) Mage::getConfig()->getNode()->modules->Minubo_Interface->version;
|
42 |
-
}
|
43 |
-
|
44 |
-
public function counterAction($qtd = 30)
|
45 |
-
{
|
46 |
-
$this->getParam($lastChangeDate, $maxChangeDate, $lastOrderID, $maxOrderID, $limit, $offset, $debug, $pdata, $store_id, $download);
|
47 |
-
|
48 |
-
$countries = Mage::getModel('minubo_interface/read_collections')->readCountries($lastChangeDate, $maxChangeDate, $lastOrderID, $maxOrderID, $limit, $offset, $debug, $pdata, $store_id);
|
49 |
-
echo '# Countries: '.count($countries).'<br>';
|
50 |
-
|
51 |
-
$model = Mage::getModel('minubo_interface/tables');
|
52 |
-
$model->init('regions');
|
53 |
-
$regions = $model->readAll();
|
54 |
-
echo '# Regions: '.count($regions).'<br>';
|
55 |
-
|
56 |
-
$model = Mage::getModel('minubo_interface/tables');
|
57 |
-
$model->init('categories'.($store_id=='1'?'':$store_id));
|
58 |
-
$categories = $model->readAll();
|
59 |
-
echo '# Categories: '.count($categories).'<br>';
|
60 |
-
|
61 |
-
$model = Mage::getModel('minubo_interface/tables');
|
62 |
-
$model->init('products'.($store_id=='1'?'':$store_id));
|
63 |
-
$products = $model->readAll();
|
64 |
-
echo '# Products: '.count($products).'<br>';
|
65 |
-
|
66 |
-
$model = Mage::getModel('minubo_interface/tables');
|
67 |
-
$model->init('productattributes');
|
68 |
-
$productattributes = $model->readAll();
|
69 |
-
echo '# ProductAttributes: '.count($productattributes).'<br>';
|
70 |
-
|
71 |
-
$model = Mage::getModel('minubo_interface/tables');
|
72 |
-
$model->init('productcategories');
|
73 |
-
$productcategories = $model->readAll();
|
74 |
-
echo '# ProductCategories: '.count($productcategories).'<br>';
|
75 |
-
|
76 |
-
$orders = Mage::getModel('minubo_interface/read_collections')->read($lastChangeDate, '', $lastOrderID, $maxOrderID, $limit, $offset, $debug, $pdata, $store_id);
|
77 |
-
echo '# Orders: '.count($orders).'<br>';
|
78 |
-
|
79 |
-
$model = Mage::getModel('minubo_interface/tables');
|
80 |
-
$model->init('creditmemos');
|
81 |
-
$creditmemos = $model->readAll();
|
82 |
-
echo '# CreditMemos: '.count($creditmemos).'<br>';
|
83 |
-
|
84 |
-
$model = Mage::getModel('minubo_interface/tables');
|
85 |
-
$model->init('creditmemoitems');
|
86 |
-
$creditmemoitems = $model->readAll();
|
87 |
-
echo '# CreditMemoItems: '.count($creditmemoitems).'<br>';
|
88 |
-
|
89 |
-
$model = Mage::getModel('minubo_interface/tables');
|
90 |
-
$model->init('invoices');
|
91 |
-
$invoices = $model->readAll();
|
92 |
-
echo '# Invoices: '.count($invoices).'<br>';
|
93 |
-
|
94 |
-
}
|
95 |
-
|
96 |
-
public function getMicrotime() {
|
97 |
-
$mtime = microtime();
|
98 |
-
$mtime = explode(' ', $mtime);
|
99 |
-
return doubleval($mtime[1]) + doubleval($mtime[0]);
|
100 |
-
}
|
101 |
-
|
102 |
-
public function getStartlog() {
|
103 |
-
return $this->getMicrotime();
|
104 |
-
}
|
105 |
-
|
106 |
-
public function getEndlog($start) {
|
107 |
-
return '<br># runtime: '.abs($this->getMicrotime()-$start).'<br>'.
|
108 |
-
'# memory_get_usage(true): '.memory_get_usage(true).'<br>'.
|
109 |
-
'# memory_get_usage(false): '.memory_get_usage(false).'<br>'.
|
110 |
-
'# memory_get_peak_usage(true): '.memory_get_peak_usage(true).'<br>'.
|
111 |
-
'# memory_get_peak_usage(false): '.memory_get_peak_usage(false).'<br>';
|
112 |
-
}
|
113 |
-
|
114 |
-
function getParam(&$lastChangeDate, &$maxChangeDate, &$lastOrderID, &$maxOrderID, &$limit, &$offset, &$debug, &$pdata, &$store_id, &$download) {
|
115 |
-
|
116 |
-
$debug = $this->getRequest()->getPost('debug');
|
117 |
-
if($debug) echo '# memory_get_usage(true): '.memory_get_usage(true).'<br>';
|
118 |
-
if($debug) echo '# memory_get_usage(false): '.memory_get_usage(false).'<br>';
|
119 |
-
|
120 |
-
$enabled = Mage::getStoreConfig('minubo_interface/settings/active',Mage::app()->getStore());
|
121 |
-
if(!$enabled) die('Minubo Interface is disabled.');
|
122 |
-
|
123 |
-
$login = $this->getRequest()->getPost('login');
|
124 |
-
$hash = Mage::getStoreConfig('minubo_interface/settings/hash',Mage::app()->getStore());
|
125 |
-
if($login!=$hash) die('You are not allowed to access this stuff.');
|
126 |
-
|
127 |
-
$lastChangeDate = $this->getRequest()->getPost('last_change_date');
|
128 |
-
// if(!$lastChangeDate) $lastChangeDate='2000-01-01';
|
129 |
-
|
130 |
-
$maxChangeDate = $this->getRequest()->getPost('max_change_date');
|
131 |
-
// if(!$maxChangeDate) $maxChangeDate='2099-12-31';
|
132 |
-
|
133 |
-
$lastOrderID = $this->getRequest()->getPost('last_order_id');
|
134 |
-
// if(!$lastOrderID) $lastOrderID=0;
|
135 |
-
|
136 |
-
$maxOrderID = $this->getRequest()->getPost('max_order_id');
|
137 |
-
// if(!$maxOrderID) $maxOrderID=9999999999;
|
138 |
-
|
139 |
-
$limit = $this->getRequest()->getPost('limit');
|
140 |
-
if(!$limit) $limit=1000;
|
141 |
-
|
142 |
-
$offset = $this->getRequest()->getPost('offset');
|
143 |
-
if(!$offset) $offset=0;
|
144 |
-
|
145 |
-
$store_id = $this->getRequest()->getPost('store_id');
|
146 |
-
if(!$store_id) $store_id=1;
|
147 |
-
|
148 |
-
$pdata = $this->getRequest()->getPost('pdata');
|
149 |
-
|
150 |
-
$download = $this->getRequest()->getPost('download');
|
151 |
-
|
152 |
-
$config = new Mage_Core_Model_Config();
|
153 |
-
$config->saveConfig('minubo_interface/settings/lastexportstartdate', date('Y.m.d H:i:s'), 'default', 0);
|
154 |
-
$config = null;
|
155 |
-
|
156 |
-
}
|
157 |
-
|
158 |
-
/*
|
159 |
-
* load and export of data of type ORDER
|
160 |
-
*/
|
161 |
-
|
162 |
-
public function ordersAction ()
|
163 |
-
{
|
164 |
-
$this->handleOrder('order','orders');
|
165 |
-
}
|
166 |
-
|
167 |
-
public function orderCustomersAction ()
|
168 |
-
{
|
169 |
-
$this->handleOrder('ordercust','orderCustomers');
|
170 |
-
}
|
171 |
-
|
172 |
-
public function orderItemsAction ()
|
173 |
-
{
|
174 |
-
$this->handleOrder('orderitem','orderItems');
|
175 |
-
}
|
176 |
-
|
177 |
-
public function handleOrder ($filename, $type)
|
178 |
-
{
|
179 |
-
$start = $this->getStartlog();
|
180 |
-
$this->getParam($lastChangeDate, $maxChangeDate, $lastOrderID, $maxOrderID, $limit, $offset, $debug, $pdata, $store_id, $download);
|
181 |
-
// $maxChangeDate = (string) Mage::getStoreConfig('minubo_interface/settings/lastchangedate',Mage::app()->getStore());
|
182 |
-
|
183 |
-
switch(Mage::getStoreConfig('minubo_interface/settings/output_type')){
|
184 |
-
case 'Standard':
|
185 |
-
$orders = Mage::getModel('minubo_interface/read_collections')->read($lastChangeDate, $maxChangeDate, $lastOrderID, $maxOrderID,
|
186 |
-
$limit, $offset, $debug, $pdata, $store_id, $type,
|
187 |
-
($type=='orderCustomers'?'entity_id desc':''));
|
188 |
-
$file = Mage::getModel('minubo_interface/export_csv')->exportOrder($orders, $filename, $type, $pdata);
|
189 |
-
if (!$download) {
|
190 |
-
echo file_get_contents(Mage::getBaseDir('export').'/'.$file);
|
191 |
-
} else {
|
192 |
-
$this->_prepareDownloadResponse($file, file_get_contents(Mage::getBaseDir('export').'/'.$file));
|
193 |
-
}
|
194 |
-
break;
|
195 |
-
}
|
196 |
-
$config = new Mage_Core_Model_Config();
|
197 |
-
$config->saveConfig('minubo_interface/settings/lastexportenddate', date('Y.m.d H:i:s'), 'default', 0);
|
198 |
-
$config = null;
|
199 |
-
|
200 |
-
$orders = null;
|
201 |
-
$file = null;
|
202 |
-
if($debug) echo $this->getEndlog($start);
|
203 |
-
}
|
204 |
-
|
205 |
-
/*
|
206 |
-
* load and export of data of type PRODUCT - csv/exportProduct not implemented yet
|
207 |
-
*/
|
208 |
-
/*
|
209 |
-
public function productscollAction ()
|
210 |
-
{
|
211 |
-
$start = $this->getStartlog();
|
212 |
-
$this->getParam($lastChangeDate, $maxChangeDate, $lastOrderID, $maxOrderID, $limit, $offset, $debug, $pdata, $store_id, $download);
|
213 |
-
$maxChangeDate = (string) Mage::getStoreConfig('minubo_interface/settings/lastchangedate',Mage::app()->getStore());
|
214 |
-
|
215 |
-
switch(Mage::getStoreConfig('minubo_interface/settings/output_type')){
|
216 |
-
case 'Standard':
|
217 |
-
$products = Mage::getModel('minubo_interface/read_collections')->readProducts($lastChangeDate, $maxChangeDate, $lastOrderID, $maxOrderID, $limit, $offset, $debug, $pdata, $store_id);
|
218 |
-
$file = Mage::getModel('minubo_interface/export_csv')->exportProduct($products, 'productcoll', 'products', '');
|
219 |
-
if (!$download) {
|
220 |
-
echo file_get_contents(Mage::getBaseDir('export').'/'.$file);
|
221 |
-
} else {
|
222 |
-
$this->_prepareDownloadResponse($file, file_get_contents(Mage::getBaseDir('export').'/'.$file));
|
223 |
-
}break;
|
224 |
-
}
|
225 |
-
$config = new Mage_Core_Model_Config();
|
226 |
-
$config->saveConfig('minubo_interface/settings/lastexportenddate', date('Y.m.d H:i:s'), 'default', 0);
|
227 |
-
$config = null;
|
228 |
-
|
229 |
-
$products = null;
|
230 |
-
$file = null;
|
231 |
-
if($debug) echo $this->getEndlog($start);
|
232 |
-
}
|
233 |
-
*/
|
234 |
-
|
235 |
-
|
236 |
-
|
237 |
-
|
238 |
-
|
239 |
-
|
240 |
-
|
241 |
-
$
|
242 |
-
|
243 |
-
|
244 |
-
|
245 |
-
|
246 |
-
|
247 |
-
|
248 |
-
$file = Mage::getModel('minubo_interface/export_csv')->
|
249 |
-
if (!$download) {
|
250 |
-
echo file_get_contents(Mage::getBaseDir('export').'/'.$file);
|
251 |
-
} else {
|
252 |
-
$this->_prepareDownloadResponse($file, file_get_contents(Mage::getBaseDir('export').'/'.$file));
|
253 |
-
}
|
254 |
-
|
255 |
-
|
256 |
-
$config
|
257 |
-
$config
|
258 |
-
|
259 |
-
|
260 |
-
$
|
261 |
-
|
262 |
-
}
|
263 |
-
|
264 |
-
|
265 |
-
|
266 |
-
|
267 |
-
|
268 |
-
|
269 |
-
|
270 |
-
|
271 |
-
|
272 |
-
|
273 |
-
|
274 |
-
|
275 |
-
|
276 |
-
|
277 |
-
|
278 |
-
|
279 |
-
|
280 |
-
|
281 |
-
|
282 |
-
|
283 |
-
|
284 |
-
|
285 |
-
|
286 |
-
|
287 |
-
|
288 |
-
|
289 |
-
|
290 |
-
|
291 |
-
$
|
292 |
-
|
293 |
-
|
294 |
-
|
295 |
-
|
296 |
-
|
297 |
-
|
298 |
-
|
299 |
-
public function
|
300 |
-
{
|
301 |
-
$
|
302 |
-
|
303 |
-
|
304 |
-
|
305 |
-
|
306 |
-
|
307 |
-
|
308 |
-
|
309 |
-
|
310 |
-
|
311 |
-
|
312 |
-
|
313 |
-
|
314 |
-
|
315 |
-
|
316 |
-
|
317 |
-
|
318 |
-
|
319 |
-
|
320 |
-
|
321 |
-
|
322 |
-
|
323 |
-
|
324 |
-
|
325 |
-
|
326 |
-
|
327 |
-
|
328 |
-
|
329 |
-
|
330 |
-
|
331 |
-
|
332 |
-
|
333 |
-
|
334 |
-
|
335 |
-
|
336 |
-
|
337 |
-
|
338 |
-
|
339 |
-
|
340 |
-
|
341 |
-
|
342 |
-
public function
|
343 |
-
{
|
344 |
-
$
|
345 |
-
|
346 |
-
|
347 |
-
|
348 |
-
|
349 |
-
|
350 |
-
|
351 |
-
|
352 |
-
|
353 |
-
|
354 |
-
|
355 |
-
|
356 |
-
|
357 |
-
|
358 |
-
|
359 |
-
$this->
|
360 |
-
|
361 |
-
|
362 |
-
|
363 |
-
|
364 |
-
|
365 |
-
|
366 |
-
|
367 |
-
|
368 |
-
|
369 |
-
|
370 |
-
|
371 |
-
|
372 |
-
|
373 |
-
$
|
374 |
-
|
375 |
-
|
376 |
-
|
377 |
-
|
378 |
-
|
379 |
-
|
380 |
-
|
381 |
-
|
382 |
-
|
383 |
-
|
384 |
-
|
385 |
-
|
386 |
-
|
387 |
-
|
388 |
-
|
389 |
-
|
390 |
-
|
391 |
-
|
392 |
-
|
393 |
-
|
394 |
-
|
395 |
-
$
|
396 |
-
$
|
397 |
-
$
|
398 |
-
|
399 |
-
|
400 |
-
|
401 |
-
|
402 |
-
|
403 |
-
|
404 |
-
|
405 |
-
|
406 |
-
|
407 |
-
|
408 |
-
$
|
409 |
-
|
410 |
-
|
411 |
-
|
412 |
-
|
413 |
-
|
414 |
-
|
415 |
-
|
416 |
-
|
417 |
-
|
418 |
-
|
419 |
-
|
420 |
-
|
421 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
422 |
?>
|
1 |
+
<?php
|
2 |
/**
|
3 |
* Magento Minubo Interface Export Module
|
4 |
*
|
24 |
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
25 |
* @author Sven Rothe <srothe@minubo.com>
|
26 |
* */
|
27 |
+
class Minubo_Interface_ExportController extends Mage_Core_Controller_Front_Action
|
28 |
+
{
|
29 |
+
public function indexAction () {
|
30 |
+
$this->loadLayout(array('default'));
|
31 |
+
$this->renderLayout();
|
32 |
+
}
|
33 |
+
public function mymethodeAction () {
|
34 |
+
$this->loadLayout(array('default'));
|
35 |
+
$this->renderLayout();
|
36 |
+
}
|
37 |
+
|
38 |
+
public function versionAction()
|
39 |
+
{
|
40 |
+
// echo Mage::getStoreConfig('minubo_interface/settings/version',Mage::app()->getStore());
|
41 |
+
echo (string) Mage::getConfig()->getNode()->modules->Minubo_Interface->version;
|
42 |
+
}
|
43 |
+
|
44 |
+
public function counterAction($qtd = 30)
|
45 |
+
{
|
46 |
+
$this->getParam($lastChangeDate, $maxChangeDate, $lastOrderID, $maxOrderID, $limit, $offset, $debug, $pdata, $store_id, $download);
|
47 |
+
|
48 |
+
$countries = Mage::getModel('minubo_interface/read_collections')->readCountries($lastChangeDate, $maxChangeDate, $lastOrderID, $maxOrderID, $limit, $offset, $debug, $pdata, $store_id);
|
49 |
+
echo '# Countries: '.count($countries).'<br>';
|
50 |
+
|
51 |
+
$model = Mage::getModel('minubo_interface/tables');
|
52 |
+
$model->init('regions');
|
53 |
+
$regions = $model->readAll();
|
54 |
+
echo '# Regions: '.count($regions).'<br>';
|
55 |
+
|
56 |
+
$model = Mage::getModel('minubo_interface/tables');
|
57 |
+
$model->init('categories'.($store_id=='1'?'':$store_id));
|
58 |
+
$categories = $model->readAll();
|
59 |
+
echo '# Categories: '.count($categories).'<br>';
|
60 |
+
|
61 |
+
$model = Mage::getModel('minubo_interface/tables');
|
62 |
+
$model->init('products'.($store_id=='1'?'':$store_id));
|
63 |
+
$products = $model->readAll();
|
64 |
+
echo '# Products: '.count($products).'<br>';
|
65 |
+
|
66 |
+
$model = Mage::getModel('minubo_interface/tables');
|
67 |
+
$model->init('productattributes');
|
68 |
+
$productattributes = $model->readAll();
|
69 |
+
echo '# ProductAttributes: '.count($productattributes).'<br>';
|
70 |
+
|
71 |
+
$model = Mage::getModel('minubo_interface/tables');
|
72 |
+
$model->init('productcategories');
|
73 |
+
$productcategories = $model->readAll();
|
74 |
+
echo '# ProductCategories: '.count($productcategories).'<br>';
|
75 |
+
|
76 |
+
$orders = Mage::getModel('minubo_interface/read_collections')->read($lastChangeDate, '', $lastOrderID, $maxOrderID, $limit, $offset, $debug, $pdata, $store_id);
|
77 |
+
echo '# Orders: '.count($orders).'<br>';
|
78 |
+
|
79 |
+
$model = Mage::getModel('minubo_interface/tables');
|
80 |
+
$model->init('creditmemos');
|
81 |
+
$creditmemos = $model->readAll();
|
82 |
+
echo '# CreditMemos: '.count($creditmemos).'<br>';
|
83 |
+
|
84 |
+
$model = Mage::getModel('minubo_interface/tables');
|
85 |
+
$model->init('creditmemoitems');
|
86 |
+
$creditmemoitems = $model->readAll();
|
87 |
+
echo '# CreditMemoItems: '.count($creditmemoitems).'<br>';
|
88 |
+
|
89 |
+
$model = Mage::getModel('minubo_interface/tables');
|
90 |
+
$model->init('invoices');
|
91 |
+
$invoices = $model->readAll();
|
92 |
+
echo '# Invoices: '.count($invoices).'<br>';
|
93 |
+
|
94 |
+
}
|
95 |
+
|
96 |
+
public function getMicrotime() {
|
97 |
+
$mtime = microtime();
|
98 |
+
$mtime = explode(' ', $mtime);
|
99 |
+
return doubleval($mtime[1]) + doubleval($mtime[0]);
|
100 |
+
}
|
101 |
+
|
102 |
+
public function getStartlog() {
|
103 |
+
return $this->getMicrotime();
|
104 |
+
}
|
105 |
+
|
106 |
+
public function getEndlog($start) {
|
107 |
+
return '<br># runtime: '.abs($this->getMicrotime()-$start).'<br>'.
|
108 |
+
'# memory_get_usage(true): '.memory_get_usage(true).'<br>'.
|
109 |
+
'# memory_get_usage(false): '.memory_get_usage(false).'<br>'.
|
110 |
+
'# memory_get_peak_usage(true): '.memory_get_peak_usage(true).'<br>'.
|
111 |
+
'# memory_get_peak_usage(false): '.memory_get_peak_usage(false).'<br>';
|
112 |
+
}
|
113 |
+
|
114 |
+
function getParam(&$lastChangeDate, &$maxChangeDate, &$lastOrderID, &$maxOrderID, &$limit, &$offset, &$debug, &$pdata, &$store_id, &$download) {
|
115 |
+
|
116 |
+
$debug = $this->getRequest()->getPost('debug');
|
117 |
+
if($debug) echo '# memory_get_usage(true): '.memory_get_usage(true).'<br>';
|
118 |
+
if($debug) echo '# memory_get_usage(false): '.memory_get_usage(false).'<br>';
|
119 |
+
|
120 |
+
$enabled = Mage::getStoreConfig('minubo_interface/settings/active',Mage::app()->getStore());
|
121 |
+
if(!$enabled) die('Minubo Interface is disabled.');
|
122 |
+
|
123 |
+
$login = $this->getRequest()->getPost('login');
|
124 |
+
$hash = Mage::getStoreConfig('minubo_interface/settings/hash',Mage::app()->getStore());
|
125 |
+
if($login!=$hash) die('You are not allowed to access this stuff.');
|
126 |
+
|
127 |
+
$lastChangeDate = $this->getRequest()->getPost('last_change_date');
|
128 |
+
// if(!$lastChangeDate) $lastChangeDate='2000-01-01';
|
129 |
+
|
130 |
+
$maxChangeDate = $this->getRequest()->getPost('max_change_date');
|
131 |
+
// if(!$maxChangeDate) $maxChangeDate='2099-12-31';
|
132 |
+
|
133 |
+
$lastOrderID = $this->getRequest()->getPost('last_order_id');
|
134 |
+
// if(!$lastOrderID) $lastOrderID=0;
|
135 |
+
|
136 |
+
$maxOrderID = $this->getRequest()->getPost('max_order_id');
|
137 |
+
// if(!$maxOrderID) $maxOrderID=9999999999;
|
138 |
+
|
139 |
+
$limit = $this->getRequest()->getPost('limit');
|
140 |
+
if(!$limit) $limit=1000;
|
141 |
+
|
142 |
+
$offset = $this->getRequest()->getPost('offset');
|
143 |
+
if(!$offset) $offset=0;
|
144 |
+
|
145 |
+
$store_id = $this->getRequest()->getPost('store_id');
|
146 |
+
if(!$store_id) $store_id=1;
|
147 |
+
|
148 |
+
$pdata = $this->getRequest()->getPost('pdata');
|
149 |
+
|
150 |
+
$download = $this->getRequest()->getPost('download');
|
151 |
+
|
152 |
+
$config = new Mage_Core_Model_Config();
|
153 |
+
$config->saveConfig('minubo_interface/settings/lastexportstartdate', date('Y.m.d H:i:s'), 'default', 0);
|
154 |
+
$config = null;
|
155 |
+
|
156 |
+
}
|
157 |
+
|
158 |
+
/*
|
159 |
+
* load and export of data of type ORDER
|
160 |
+
*/
|
161 |
+
|
162 |
+
public function ordersAction ()
|
163 |
+
{
|
164 |
+
$this->handleOrder('order','orders');
|
165 |
+
}
|
166 |
+
|
167 |
+
public function orderCustomersAction ()
|
168 |
+
{
|
169 |
+
$this->handleOrder('ordercust','orderCustomers');
|
170 |
+
}
|
171 |
+
|
172 |
+
public function orderItemsAction ()
|
173 |
+
{
|
174 |
+
$this->handleOrder('orderitem','orderItems');
|
175 |
+
}
|
176 |
+
|
177 |
+
public function handleOrder ($filename, $type)
|
178 |
+
{
|
179 |
+
$start = $this->getStartlog();
|
180 |
+
$this->getParam($lastChangeDate, $maxChangeDate, $lastOrderID, $maxOrderID, $limit, $offset, $debug, $pdata, $store_id, $download);
|
181 |
+
// $maxChangeDate = (string) Mage::getStoreConfig('minubo_interface/settings/lastchangedate',Mage::app()->getStore());
|
182 |
+
|
183 |
+
switch(Mage::getStoreConfig('minubo_interface/settings/output_type')){
|
184 |
+
case 'Standard':
|
185 |
+
$orders = Mage::getModel('minubo_interface/read_collections')->read($lastChangeDate, $maxChangeDate, $lastOrderID, $maxOrderID,
|
186 |
+
$limit, $offset, $debug, $pdata, $store_id, $type,
|
187 |
+
($type=='orderCustomers'?'entity_id desc':''));
|
188 |
+
$file = Mage::getModel('minubo_interface/export_csv')->exportOrder($orders, $filename, $type, $pdata);
|
189 |
+
if (!$download) {
|
190 |
+
echo file_get_contents(Mage::getBaseDir('export').'/'.$file);
|
191 |
+
} else {
|
192 |
+
$this->_prepareDownloadResponse($file, file_get_contents(Mage::getBaseDir('export').'/'.$file));
|
193 |
+
}
|
194 |
+
break;
|
195 |
+
}
|
196 |
+
$config = new Mage_Core_Model_Config();
|
197 |
+
$config->saveConfig('minubo_interface/settings/lastexportenddate', date('Y.m.d H:i:s'), 'default', 0);
|
198 |
+
$config = null;
|
199 |
+
|
200 |
+
$orders = null;
|
201 |
+
$file = null;
|
202 |
+
if($debug) echo $this->getEndlog($start);
|
203 |
+
}
|
204 |
+
|
205 |
+
/*
|
206 |
+
* load and export of data of type PRODUCT - csv/exportProduct not implemented yet
|
207 |
+
*/
|
208 |
+
/*
|
209 |
+
public function productscollAction ()
|
210 |
+
{
|
211 |
+
$start = $this->getStartlog();
|
212 |
+
$this->getParam($lastChangeDate, $maxChangeDate, $lastOrderID, $maxOrderID, $limit, $offset, $debug, $pdata, $store_id, $download);
|
213 |
+
$maxChangeDate = (string) Mage::getStoreConfig('minubo_interface/settings/lastchangedate',Mage::app()->getStore());
|
214 |
+
|
215 |
+
switch(Mage::getStoreConfig('minubo_interface/settings/output_type')){
|
216 |
+
case 'Standard':
|
217 |
+
$products = Mage::getModel('minubo_interface/read_collections')->readProducts($lastChangeDate, $maxChangeDate, $lastOrderID, $maxOrderID, $limit, $offset, $debug, $pdata, $store_id);
|
218 |
+
$file = Mage::getModel('minubo_interface/export_csv')->exportProduct($products, 'productcoll', 'products', '');
|
219 |
+
if (!$download) {
|
220 |
+
echo file_get_contents(Mage::getBaseDir('export').'/'.$file);
|
221 |
+
} else {
|
222 |
+
$this->_prepareDownloadResponse($file, file_get_contents(Mage::getBaseDir('export').'/'.$file));
|
223 |
+
}break;
|
224 |
+
}
|
225 |
+
$config = new Mage_Core_Model_Config();
|
226 |
+
$config->saveConfig('minubo_interface/settings/lastexportenddate', date('Y.m.d H:i:s'), 'default', 0);
|
227 |
+
$config = null;
|
228 |
+
|
229 |
+
$products = null;
|
230 |
+
$file = null;
|
231 |
+
if($debug) echo $this->getEndlog($start);
|
232 |
+
}
|
233 |
+
*/
|
234 |
+
|
235 |
+
public function countriesAction ()
|
236 |
+
{
|
237 |
+
$start = $this->getStartlog();
|
238 |
+
$this->getParam($lastChangeDate, $maxChangeDate, $lastOrderID, $maxOrderID, $limit, $offset, $debug, $pdata, $store_id, $download);
|
239 |
+
$countries = Mage::getModel('minubo_interface/read_collections')->readCountries($lastChangeDate, $maxChangeDate, $lastOrderID, $maxOrderID, $limit, $offset, $debug, $pdata, $store_id);
|
240 |
+
$this->handleCountries($countries,'country','countries','',$start,$download);
|
241 |
+
if($debug) echo $this->getEndlog($start);
|
242 |
+
}
|
243 |
+
|
244 |
+
public function handleCountries (&$rows, $filename, $type, $pdata, $start, $download)
|
245 |
+
{
|
246 |
+
switch(Mage::getStoreConfig('minubo_interface/settings/output_type')){
|
247 |
+
case 'Standard':
|
248 |
+
$file = Mage::getModel('minubo_interface/export_csv')->exportCountries($rows, $filename, $type, $pdata);
|
249 |
+
if (!$download) {
|
250 |
+
echo file_get_contents(Mage::getBaseDir('export').'/'.$file);
|
251 |
+
} else {
|
252 |
+
$this->_prepareDownloadResponse($file, file_get_contents(Mage::getBaseDir('export').'/'.$file));
|
253 |
+
}
|
254 |
+
break;
|
255 |
+
}
|
256 |
+
$config = new Mage_Core_Model_Config();
|
257 |
+
$config->saveConfig('minubo_interface/settings/lastexportenddate', date('Y.m.d H:i:s'), 'default', 0);
|
258 |
+
$config = null;
|
259 |
+
|
260 |
+
$rows = null;
|
261 |
+
$file = null;
|
262 |
+
}
|
263 |
+
|
264 |
+
public function handleCollection (&$rows, $filename, $type, $pdata, $start, $download)
|
265 |
+
{
|
266 |
+
switch(Mage::getStoreConfig('minubo_interface/settings/output_type')){
|
267 |
+
case 'Standard':
|
268 |
+
$file = Mage::getModel('minubo_interface/export_csv')->exportCollection($rows, $filename, $type, $pdata);
|
269 |
+
if (!$download) {
|
270 |
+
echo file_get_contents(Mage::getBaseDir('export').'/'.$file);
|
271 |
+
} else {
|
272 |
+
$this->_prepareDownloadResponse($file, file_get_contents(Mage::getBaseDir('export').'/'.$file));
|
273 |
+
}
|
274 |
+
break;
|
275 |
+
}
|
276 |
+
$config = new Mage_Core_Model_Config();
|
277 |
+
$config->saveConfig('minubo_interface/settings/lastexportenddate', date('Y.m.d H:i:s'), 'default', 0);
|
278 |
+
$config = null;
|
279 |
+
|
280 |
+
$rows = null;
|
281 |
+
$file = null;
|
282 |
+
}
|
283 |
+
|
284 |
+
/*
|
285 |
+
* load and export of data of type TABLE
|
286 |
+
* Read data directly from tables defined in config.xml and Model/Mysql4
|
287 |
+
*/
|
288 |
+
|
289 |
+
public function customersAction ()
|
290 |
+
{
|
291 |
+
$renameCols = array('entity_id' => 'customer_id');
|
292 |
+
$this->handleTable ('customers', 'customer', 'customers', Array(), Array(), $renameCols);
|
293 |
+
/*
|
294 |
+
$customers = Mage::getModel('minubo_interface/read_collections')->readCustomers($lastChangeDate, $maxChangeDate, $lastOrderID, $maxOrderID, $limit, $offset, $debug, $pdata, $store_id);
|
295 |
+
$file = Mage::getModel('minubo_interface/export_csv')->exportCustomer($customers, 'customer', 'customers', '');
|
296 |
+
*/
|
297 |
+
}
|
298 |
+
|
299 |
+
public function customerAddressesAction ()
|
300 |
+
{
|
301 |
+
$this->handleTable ('customeraddresses', 'customeraddr', 'customerAddresses', Array(), Array(), Array());
|
302 |
+
}
|
303 |
+
|
304 |
+
public function orderAddressesAction ()
|
305 |
+
{
|
306 |
+
$this->handleTable ('orderaddresses', 'orderaddr', 'orderAddresses', Array(), Array(), Array());
|
307 |
+
}
|
308 |
+
|
309 |
+
public function productsAction ()
|
310 |
+
{
|
311 |
+
$skipCols = array('description', 'in_depth', 'activation_information');
|
312 |
+
$this->handleTable ('products', 'product', 'products', Array(), $skipCols, Array());
|
313 |
+
}
|
314 |
+
|
315 |
+
public function categoriesAction ()
|
316 |
+
{
|
317 |
+
$renameCols = array('entity_id' => 'category_id');
|
318 |
+
$colTitles = array('Category_Id','Parent_Id','Position','Category_Name','level','image','url_key','url_path');
|
319 |
+
$this->handleTable ('categories', 'category', 'categories', $colTitles, Array(), $renameCols);
|
320 |
+
}
|
321 |
+
|
322 |
+
public function productcategoriesAction ()
|
323 |
+
{
|
324 |
+
$skipCols = array('is_parent');
|
325 |
+
$colTitles = array('category_id','product_id','position','store_id','visibility');
|
326 |
+
$this->handleTable ('productcategories', 'productcategory', 'productcategories', $colTitles, $skipCols, Array());
|
327 |
+
}
|
328 |
+
|
329 |
+
public function productattributesAction ()
|
330 |
+
{
|
331 |
+
$renameCols = array('attribute_set_id' => 'setKey',
|
332 |
+
'attribute_set_name' => 'setName',
|
333 |
+
'attribute_id' => 'attributeKey',
|
334 |
+
'attribute_code' => 'attributeCode',
|
335 |
+
'backend_type' => 'attributeType',
|
336 |
+
'is_required' => 'attributeRequired',
|
337 |
+
'value' => 'optionLabel',
|
338 |
+
'value_id' => 'optionValue');
|
339 |
+
$this->handleTable ('productattributes', 'productattribute', 'productattributes', Array(), Array(), $renameCols);
|
340 |
+
}
|
341 |
+
|
342 |
+
public function regionsAction ()
|
343 |
+
{
|
344 |
+
$colTitles = array('Region_Id','Country_Id','Region_Code','Region_Name');
|
345 |
+
$this->handleTable ('regions', 'region', 'regions', $colTitles, Array(), Array());
|
346 |
+
}
|
347 |
+
|
348 |
+
public function creditmemosAction ()
|
349 |
+
{
|
350 |
+
$this->handleTable ('creditmemos', 'creditmemo', 'creditmemos', Array(), Array(), Array());
|
351 |
+
}
|
352 |
+
public function creditmemoItemsAction ()
|
353 |
+
{
|
354 |
+
$this->handleTable ('creditmemoitems', 'creditmemoitem', 'creditmemoitems', Array(), Array(), Array());
|
355 |
+
}
|
356 |
+
|
357 |
+
public function invoicesAction ()
|
358 |
+
{
|
359 |
+
$this->handleTable ('invoices', 'invoice', 'invoices', Array(), Array(), Array());
|
360 |
+
}
|
361 |
+
public function invoiceItemsAction ()
|
362 |
+
{
|
363 |
+
$this->handleTable ( 'invoiceitems', 'invoiceitem', 'invoiceitems', Array(), Array(), Array());
|
364 |
+
}
|
365 |
+
|
366 |
+
public function handleTable ($sqlinterface, $filename, $type, $colTitles = Array(), $skipCols = Array(), $renameCols = Array())
|
367 |
+
{
|
368 |
+
$start = $this->getMicrotime();
|
369 |
+
$this->getParam($lastChangeDate, $maxChangeDate, $lastOrderID, $maxOrderID, $limit, $offset, $debug, $pdata, $store_id, $download);
|
370 |
+
|
371 |
+
switch(Mage::getStoreConfig('minubo_interface/settings/output_type')){
|
372 |
+
case 'Standard':
|
373 |
+
$model = Mage::getModel('minubo_interface/tables');
|
374 |
+
$model->init($sqlinterface.($store_id=='1'?'':$store_id));
|
375 |
+
$rows = $model->readLimited($limit, $offset);
|
376 |
+
|
377 |
+
if (count($colTitles)==0) {
|
378 |
+
$colTitles = $rows[0]; // first data-row: Array ( [attribute_set_id] => 38 ...
|
379 |
+
} else {
|
380 |
+
$colTitles = array_flip($colTitles); // titles: Array ( [0] => Spalte ...
|
381 |
+
}
|
382 |
+
|
383 |
+
$file = Mage::getModel('minubo_interface/export_csv')->exportTable($rows, $filename, $type, $colTitles, $skipCols, $renameCols);
|
384 |
+
if (!$download) {
|
385 |
+
echo file_get_contents(Mage::getBaseDir('export').'/'.$file);
|
386 |
+
} else {
|
387 |
+
$this->_prepareDownloadResponse($file, file_get_contents(Mage::getBaseDir('export').'/'.$file));
|
388 |
+
}
|
389 |
+
break;
|
390 |
+
}
|
391 |
+
$config = new Mage_Core_Model_Config();
|
392 |
+
$config->saveConfig('minubo_interface/settings/lastexportenddate', date('Y.m.d H:i:s'), 'default', 0);
|
393 |
+
$config = null;
|
394 |
+
|
395 |
+
$model = null;
|
396 |
+
$rows = null;
|
397 |
+
$file = null;
|
398 |
+
if($debug) echo $this->getEndlog($start);
|
399 |
+
}
|
400 |
+
|
401 |
+
/*
|
402 |
+
public function getHashAction($qtd = 30)
|
403 |
+
{
|
404 |
+
$chars = '0123456789abcdefghijklmnopqrstuvwxyz0123456789ABCDEFGHIJKLMOPQRSTUVXWYZ0123456789';
|
405 |
+
$anz = strlen($chars);
|
406 |
+
$anz--;
|
407 |
+
$hash=NULL;
|
408 |
+
for($x=1;$x<=$qtd;$x++){
|
409 |
+
$c = rand(0,$anz);
|
410 |
+
$hash .= substr($chars,$c,1);
|
411 |
+
}
|
412 |
+
Mage::getConfig()->setNode('minubo_interface/settings/hash', $hash);
|
413 |
+
echo $hash;
|
414 |
+
}
|
415 |
+
|
416 |
+
public function newHashAction($qtd = 30)
|
417 |
+
{
|
418 |
+
$chars = '0123456789abcdefghijklmnopqrstuvwxyz0123456789ABCDEFGHIJKLMOPQRSTUVXWYZ0123456789';
|
419 |
+
$anz = strlen($chars);
|
420 |
+
$anz--;
|
421 |
+
$hash=NULL;
|
422 |
+
for($x=1;$x<=$qtd;$x++){
|
423 |
+
$c = rand(0,$anz);
|
424 |
+
$hash .= substr($chars,$c,1);
|
425 |
+
}
|
426 |
+
Mage::getConfig()->setNode('minubo_interface/settings/hash', $hash);
|
427 |
+
Mage::app()->getResponse()->setBody($hash);
|
428 |
+
}
|
429 |
+
*/
|
430 |
+
|
431 |
+
}
|
432 |
?>
|
app/code/community/Minubo/Interface/etc/config.xml
CHANGED
@@ -1,120 +1,139 @@
|
|
1 |
-
<?xml version="1.0" encoding="UTF-8"?>
|
2 |
-
<config>
|
3 |
-
<modules>
|
4 |
-
<Minubo_Interface>
|
5 |
-
<version>1.0.
|
6 |
-
</Minubo_Interface>
|
7 |
-
</modules>
|
8 |
-
<global>
|
9 |
-
<models>
|
10 |
-
<minubo_interface>
|
11 |
-
<class>Minubo_Interface_Model</class>
|
12 |
-
<resourceModel>minubo_mysql4</resourceModel>
|
13 |
-
</minubo_interface>
|
14 |
-
<minubo_mysql4>
|
15 |
-
<class>Minubo_Interface_Model_Mysql4</class>
|
16 |
-
<entities>
|
17 |
-
<categories>
|
18 |
-
<table>catalog_category_flat_store_1</table>
|
19 |
-
</categories>
|
20 |
-
<categories2>
|
21 |
-
<table>catalog_category_flat_store_2</table>
|
22 |
-
</categories2>
|
23 |
-
<categories3>
|
24 |
-
<table>catalog_category_flat_store_3</table>
|
25 |
-
</categories3>
|
26 |
-
<
|
27 |
-
<table>
|
28 |
-
</
|
29 |
-
<
|
30 |
-
<table>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
31 |
</products>
|
32 |
-
|
33 |
-
|
34 |
-
<table>catalog_product_flat_2</table>
|
35 |
</products2>
|
36 |
-
|
37 |
-
|
38 |
-
<table>catalog_product_flat_3</table>
|
39 |
</products3>
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
|
63 |
-
|
64 |
-
|
65 |
-
|
66 |
-
|
67 |
-
|
68 |
-
</entities>
|
69 |
-
</minubo_mysql4>
|
70 |
-
</models>
|
71 |
-
<helpers>
|
72 |
-
<minubo_interface>
|
73 |
-
<class>Minubo_Interface_Helper</class>
|
74 |
-
</minubo_interface>
|
75 |
-
</helpers>
|
76 |
-
<blocks>
|
77 |
-
<minubo_interface>
|
78 |
-
<class>Minubo_Interface_Block</class>
|
79 |
-
</minubo_interface>
|
80 |
-
</blocks>
|
81 |
-
<!-- resources>
|
82 |
-
<minuboface_setup>
|
83 |
-
<setup>
|
84 |
-
<module>Excellence_Test</module>
|
85 |
-
</setup>
|
86 |
-
<connection>
|
87 |
-
<use>core_setup</use>
|
88 |
-
</connection>
|
89 |
-
</minuboface_setup>
|
90 |
-
<minuboface_write>
|
91 |
-
<connection>
|
92 |
-
<use>core_write</use>
|
93 |
-
</connection>
|
94 |
-
</minuboface_write>
|
95 |
-
<minuboface_read>
|
96 |
-
<connection>
|
97 |
-
<use>core_read</use>
|
98 |
-
</connection>
|
99 |
-
</minuboface_read>
|
100 |
-
</resources -->
|
101 |
-
</global>
|
102 |
-
<frontend>
|
103 |
-
<routers>
|
104 |
-
<magento_interface>
|
105 |
-
<use>standard</use>
|
106 |
-
<args>
|
107 |
-
<module>Minubo_Interface</module>
|
108 |
-
<frontName>minuboface</frontName>
|
109 |
-
</args>
|
110 |
-
</magento_interface>
|
111 |
-
</routers>
|
112 |
-
<layout>
|
113 |
-
<updates>
|
114 |
-
<interface>
|
115 |
-
<file>interface.xml</file>
|
116 |
-
</interface>
|
117 |
-
</updates>
|
118 |
-
</layout>
|
119 |
-
</frontend>
|
120 |
</config>
|
1 |
+
<?xml version="1.0" encoding="UTF-8"?>
|
2 |
+
<config>
|
3 |
+
<modules>
|
4 |
+
<Minubo_Interface>
|
5 |
+
<version>1.0.2</version>
|
6 |
+
</Minubo_Interface>
|
7 |
+
</modules>
|
8 |
+
<global>
|
9 |
+
<models>
|
10 |
+
<minubo_interface>
|
11 |
+
<class>Minubo_Interface_Model</class>
|
12 |
+
<resourceModel>minubo_mysql4</resourceModel>
|
13 |
+
</minubo_interface>
|
14 |
+
<minubo_mysql4>
|
15 |
+
<class>Minubo_Interface_Model_Mysql4</class>
|
16 |
+
<entities>
|
17 |
+
<categories>
|
18 |
+
<table>catalog_category_flat_store_1</table>
|
19 |
+
</categories>
|
20 |
+
<categories2>
|
21 |
+
<table>catalog_category_flat_store_2</table>
|
22 |
+
</categories2>
|
23 |
+
<categories3>
|
24 |
+
<table>catalog_category_flat_store_3</table>
|
25 |
+
</categories3>
|
26 |
+
<customers>
|
27 |
+
<table>customer_entity</table>
|
28 |
+
</customers>
|
29 |
+
<customeraddresses>
|
30 |
+
<table>sales_flat_order_address</table>
|
31 |
+
</customeraddresses>
|
32 |
+
<orderaddresses>
|
33 |
+
<table>sales_flat_order_address</table>
|
34 |
+
</orderaddresses>
|
35 |
+
<customer_address_entity>
|
36 |
+
<table>customer_address_entity</table>
|
37 |
+
</customer_address_entity>
|
38 |
+
<customer_entity>
|
39 |
+
<table>customer_entity</table>
|
40 |
+
</customer_entity>
|
41 |
+
<customer_group>
|
42 |
+
<table>customer_group</table>
|
43 |
+
</customer_group>
|
44 |
+
<sales_flat_order>
|
45 |
+
<table>sales_flat_order</table>
|
46 |
+
</sales_flat_order>
|
47 |
+
<regions>
|
48 |
+
<table>directory_country_region</table>
|
49 |
+
</regions>
|
50 |
+
<products>
|
51 |
+
<table>catalog_product_flat_1</table>
|
52 |
</products>
|
53 |
+
<products2>
|
54 |
+
<table>catalog_product_flat_2</table>
|
|
|
55 |
</products2>
|
56 |
+
<products3>
|
57 |
+
<table>catalog_product_flat_3</table>
|
|
|
58 |
</products3>
|
59 |
+
<productcategories>
|
60 |
+
<table>catalog_category_product_index</table>
|
61 |
+
</productcategories>
|
62 |
+
<productattributes>
|
63 |
+
<table>catalog_product_entity</table>
|
64 |
+
</productattributes>
|
65 |
+
<eav_attribute>
|
66 |
+
<table>eav_attribute</table>
|
67 |
+
</eav_attribute>
|
68 |
+
<catalog_product_entity_varchar>
|
69 |
+
<table>catalog_product_entity_varchar</table>
|
70 |
+
</catalog_product_entity_varchar>
|
71 |
+
<eav_attribute_set>
|
72 |
+
<table>eav_attribute_set</table>
|
73 |
+
</eav_attribute_set>
|
74 |
+
<creditmemos>
|
75 |
+
<table>sales_flat_creditmemo</table>
|
76 |
+
</creditmemos>
|
77 |
+
<creditmemoitems>
|
78 |
+
<table>sales_flat_creditmemo_item</table>
|
79 |
+
</creditmemoitems>
|
80 |
+
<invoices>
|
81 |
+
<table>sales_flat_invoice</table>
|
82 |
+
</invoices>
|
83 |
+
<invoiceitems>
|
84 |
+
<table>sales_flat_invoice_item</table>
|
85 |
+
</invoiceitems>
|
86 |
+
|
87 |
+
</entities>
|
88 |
+
</minubo_mysql4>
|
89 |
+
</models>
|
90 |
+
<helpers>
|
91 |
+
<minubo_interface>
|
92 |
+
<class>Minubo_Interface_Helper</class>
|
93 |
+
</minubo_interface>
|
94 |
+
</helpers>
|
95 |
+
<blocks>
|
96 |
+
<minubo_interface>
|
97 |
+
<class>Minubo_Interface_Block</class>
|
98 |
+
</minubo_interface>
|
99 |
+
</blocks>
|
100 |
+
<!-- resources>
|
101 |
+
<minuboface_setup>
|
102 |
+
<setup>
|
103 |
+
<module>Excellence_Test</module>
|
104 |
+
</setup>
|
105 |
+
<connection>
|
106 |
+
<use>core_setup</use>
|
107 |
+
</connection>
|
108 |
+
</minuboface_setup>
|
109 |
+
<minuboface_write>
|
110 |
+
<connection>
|
111 |
+
<use>core_write</use>
|
112 |
+
</connection>
|
113 |
+
</minuboface_write>
|
114 |
+
<minuboface_read>
|
115 |
+
<connection>
|
116 |
+
<use>core_read</use>
|
117 |
+
</connection>
|
118 |
+
</minuboface_read>
|
119 |
+
</resources -->
|
120 |
+
</global>
|
121 |
+
<frontend>
|
122 |
+
<routers>
|
123 |
+
<magento_interface>
|
124 |
+
<use>standard</use>
|
125 |
+
<args>
|
126 |
+
<module>Minubo_Interface</module>
|
127 |
+
<frontName>minuboface</frontName>
|
128 |
+
</args>
|
129 |
+
</magento_interface>
|
130 |
+
</routers>
|
131 |
+
<layout>
|
132 |
+
<updates>
|
133 |
+
<interface>
|
134 |
+
<file>interface.xml</file>
|
135 |
+
</interface>
|
136 |
+
</updates>
|
137 |
+
</layout>
|
138 |
+
</frontend>
|
139 |
</config>
|
package.xml
CHANGED
@@ -1,33 +1,18 @@
|
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>Minubo_Interface</name>
|
4 |
-
<version>1.0.
|
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.
|
11 |
-
|
12 |
-
See more about minubo at minubo.com
|
13 |
-

|
14 |
-
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>
|
15 |
-
<notes>v1 collect the following data for minubo:
|
16 |
-
- Products
|
17 |
-
- Categories
|
18 |
-
- Countries
|
19 |
-
- Regions
|
20 |
-
- Orders with Items 
|
21 |
-
- Customers (Guest orders and registered customers)
|
22 |
-
- CreditMemos
|
23 |
-
- Invoices
|
24 |
-

|
25 |
-
Only reading data.
|
26 |
-
Disable/Enable in the backend anytime.</notes>
|
27 |
<authors><author><name>sven rothe</name><user>minubo</user><email>sven@minubo.com</email></author></authors>
|
28 |
-
<date>2013-08-
|
29 |
-
<time>
|
30 |
-
<contents><target name="magecommunity"><dir name="Minubo"><dir name="Interface"><dir name="Block"><dir name="Adminhtml"><file name="Authhash.php" hash="defcbfced29732742d65bfead3043f23"/><file name="Lastchangedate.php" hash="c82ee55fad83d848f47a8594bd25c5af"/><dir name="System"><dir name="Config"><dir name="Form"><file name="Button.php" hash="
|
31 |
<compatible/>
|
32 |
<dependencies><required><php><min>5.1.0</min><max>6.0.0</max></php></required></dependencies>
|
33 |
</package>
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>Minubo_Interface</name>
|
4 |
+
<version>1.0.2</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>Extended Country-Data; Performance-Enhancements Customer-Data; Preparation for future enhancements</notes>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
12 |
<authors><author><name>sven rothe</name><user>minubo</user><email>sven@minubo.com</email></author></authors>
|
13 |
+
<date>2013-08-30</date>
|
14 |
+
<time>12:31:58</time>
|
15 |
+
<contents><target name="magecommunity"><dir name="Minubo"><dir name="Interface"><dir name="Block"><dir name="Adminhtml"><file name="Authhash.php" hash="defcbfced29732742d65bfead3043f23"/><file name="Lastchangedate.php" hash="c82ee55fad83d848f47a8594bd25c5af"/><dir name="System"><dir name="Config"><dir name="Form"><file name="Button.php" hash="a98e838be044c4d3fcc08d3bb95839af"/></dir></dir></dir><file name="Version.php" hash="31db32eca5dcaf3ad86c747bb3e11efc"/></dir></dir><dir name="Helper"><file name="Data.php" hash="dfb5e0b4b7b6be608872f6ef7791c94b"/></dir><dir name="Model"><dir name="Export"><file name="Abstractcsv.php" hash="f61dd9a03327e9ae8a38498ecdb3e0c9"/><file name="Csv.php" hash="f851d8061fcd5700fc9487a6158bfc9b"/><file name="Status.php" hash="3b2f6661e53b287d13d5951421e05dc1"/></dir><dir name="Mysql4"><file name="Categories.php" hash="7ea4b1b769c5f850d30483666c5dc065"/><file name="Categories2.php" hash="9690856ba935ad9d9aa3974090305fce"/><file name="Categories3.php" hash="c1331984e0569d24702e87baff52813b"/><file name="Creditmemoitems.php" hash="0b79c020f04df55e65f08387dea0c3be"/><file name="Creditmemos.php" hash="ab216deb1c15338e5c0d313d5ba29a48"/><file name="Customeraddresses.php" hash="169a9e08dd8f014f84d70937fcf9ce7f"/><file name="Customers.php" hash="ca12a74563b43fc1faf34a10b6b7f43a"/><file name="Invoiceitems.php" hash="d246e86915570560ab2c635c4b937a26"/><file name="Invoices.php" hash="80c8d20ede9861215bac724aa6bbf89a"/><file name="Orderaddresses.php" hash="b3373186e5319bef1ae188153d586a06"/><file name="Productattributes.php" hash="ef027acc9b06695c25baf3d618be533a"/><file name="Productcategories.php" hash="9d3a80b9d9c4dcbf720460113339d2bd"/><file name="Products.php" hash="d41da38a3e2ad2c68448362347c007b0"/><file name="Products2.php" hash="6ad444c1b3bb96297196161ce3787be4"/><file name="Products3.php" hash="fcfa53f99a322aea2727976f87fdbc18"/><file name="Regions.php" hash="4031838d04526b3eef77bc46b0b2e678"/></dir><dir name="Options"><file name="Options.php" hash="b551afea710a55faf8ef18d7cb997f53"/><file name="Version.php" hash="a1941579148ca49ba7bb73c3e69ed3d5"/></dir><dir name="Read"><file name="Collections.php" hash="6260235172d26e42b65740695af5b870"/><file name="Common.php" hash="0986eba552b56312c9fe6cadb9e31015"/></dir><file name="Tables.php" hash="d0f1bb93db995e86baf8e5cec91ed6e2"/></dir><dir name="controllers"><file name="ExportController.php" hash="dcab6b9f402fbbebbe25ceabb476b4dc"/></dir><dir name="etc"><file name="adminhtml.xml" hash="375c548aacaf6f1bfdf4de3af7b29dfb"/><file name="config.xml" hash="4585e925f1a6fad692bda23b11e64ea8"/><file name="system.xml" hash="8b9608b7693b8750f5df874f8a008eec"/></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>
|