Mage_AdvancedGrids - Version 1.0.0

Version Notes

N/A

Download this release

Release Info

Developer Sławomir Iwańczuk
Extension Mage_AdvancedGrids
Version 1.0.0
Comparing to
See all releases


Version 1.0.0

app/code/community/Mage/AdvancedGrids/Block/Customer/Edit/Tab/Orders.php ADDED
@@ -0,0 +1,63 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Copyright (C) 2011 Slawomir Iwanczuk
4
+ *
5
+ * This program is free software: you can redistribute it and/or modify
6
+ * it under the terms of the GNU General Public License as published by
7
+ * the Free Software Foundation, either version 3 of the License, or
8
+ * (at your option) any later version.
9
+ *
10
+ * This program is distributed in the hope that it will be useful,
11
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
+ * GNU General Public License for more details.
14
+ *
15
+ * You should have received a copy of the GNU General Public License
16
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
17
+ */
18
+
19
+ class Mage_AdvancedGrids_Block_Customer_Edit_Tab_Orders
20
+ extends Mage_Adminhtml_Block_Customer_Edit_Tab_Orders
21
+ {
22
+ protected function _prepareCollection()
23
+ {
24
+ $collection = Mage::getResourceModel('sales/order_grid_collection')
25
+ ->addFieldToSelect('entity_id')
26
+ ->addFieldToSelect('increment_id')
27
+ ->addFieldToSelect('customer_id')
28
+ ->addFieldToSelect('created_at')
29
+ ->addFieldToSelect('grand_total')
30
+ ->addFieldToSelect('order_currency_code')
31
+ ->addFieldToSelect('store_id')
32
+ ->addFieldToSelect('billing_name')
33
+ ->addFieldToSelect('shipping_name')
34
+ ->addFieldToSelect('status')
35
+ ->addFieldToSelect('payment_method')
36
+ ->addFieldToFilter('customer_id', Mage::registry('current_customer')->getId())
37
+ ->setIsCustomerMode(true);
38
+
39
+ $this->setCollection($collection);
40
+
41
+ return Mage_Adminhtml_Block_Widget_Grid::_prepareCollection();
42
+ }
43
+
44
+ protected function _prepareColumns()
45
+ {
46
+ $this->addColumnAfter('payment_method', array(
47
+ 'header' => Mage::helper('payment')->__('Payment Method'),
48
+ 'index' => 'payment_method',
49
+ 'type' => 'options',
50
+ 'options' => Mage::helper('payment')->getPaymentMethodList()
51
+ ), 'grand_total');
52
+
53
+ $this->addColumnAfter('status', array(
54
+ 'header' => Mage::helper('sales')->__('Status'),
55
+ 'index' => 'status',
56
+ 'type' => 'options',
57
+ 'width' => '70px',
58
+ 'options' => Mage::getSingleton('sales/order_config')->getStatuses(),
59
+ ), 'payment_method');
60
+
61
+ return parent::_prepareColumns();
62
+ }
63
+ }
app/code/community/Mage/AdvancedGrids/Block/Sales/Invoice/Grid.php ADDED
@@ -0,0 +1,44 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Copyright (C) 2011 Slawomir Iwanczuk
4
+ *
5
+ * This program is free software: you can redistribute it and/or modify
6
+ * it under the terms of the GNU General Public License as published by
7
+ * the Free Software Foundation, either version 3 of the License, or
8
+ * (at your option) any later version.
9
+ *
10
+ * This program is distributed in the hope that it will be useful,
11
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
+ * GNU General Public License for more details.
14
+ *
15
+ * You should have received a copy of the GNU General Public License
16
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
17
+ */
18
+
19
+ class Mage_AdvancedGrids_Block_Sales_Invoice_Grid
20
+ extends Mage_Adminhtml_Block_Sales_Invoice_Grid
21
+ {
22
+ protected function _prepareColumns()
23
+ {
24
+ $this->addColumnAfter('customer_email', array(
25
+ 'header' => Mage::helper('customer')->__('Email'),
26
+ 'index' => 'customer_email',
27
+ ), 'billing_name');
28
+
29
+ $this->addColumnAfter('product_name', array(
30
+ 'header' => Mage::helper('catalog')->__('Product'),
31
+ 'index' => 'product_name',
32
+ 'type' => 'productlist'
33
+ ), 'customer_email');
34
+
35
+ return parent::_prepareColumns();
36
+ }
37
+
38
+ public function getColumnRenderers()
39
+ {
40
+ return array(
41
+ 'productlist' => 'advancedgrids/widget_grid_column_renderer_productlist'
42
+ );
43
+ }
44
+ }
app/code/community/Mage/AdvancedGrids/Block/Sales/Order/Grid.php ADDED
@@ -0,0 +1,51 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Copyright (C) 2011 Slawomir Iwanczuk
4
+ *
5
+ * This program is free software: you can redistribute it and/or modify
6
+ * it under the terms of the GNU General Public License as published by
7
+ * the Free Software Foundation, either version 3 of the License, or
8
+ * (at your option) any later version.
9
+ *
10
+ * This program is distributed in the hope that it will be useful,
11
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
+ * GNU General Public License for more details.
14
+ *
15
+ * You should have received a copy of the GNU General Public License
16
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
17
+ */
18
+
19
+ class Mage_AdvancedGrids_Block_Sales_Order_Grid
20
+ extends Mage_Adminhtml_Block_Sales_Order_Grid
21
+ {
22
+ protected function _prepareColumns()
23
+ {
24
+ $this->addColumnAfter('customer_email', array(
25
+ 'header' => Mage::helper('customer')->__('Email'),
26
+ 'index' => 'customer_email',
27
+ ), 'shipping_name');
28
+
29
+ $this->addColumnAfter('product_name', array(
30
+ 'header' => Mage::helper('catalog')->__('Product'),
31
+ 'index' => 'product_name',
32
+ 'type' => 'productlist'
33
+ ), 'customer_email');
34
+
35
+ $this->addColumnAfter('payment_method', array(
36
+ 'header' => Mage::helper('payment')->__('Payment Method'),
37
+ 'index' => 'payment_method',
38
+ 'type' => 'options',
39
+ 'options' => Mage::helper('payment')->getPaymentMethodList()
40
+ ), 'product_name');
41
+
42
+ return parent::_prepareColumns();
43
+ }
44
+
45
+ public function getColumnRenderers()
46
+ {
47
+ return array(
48
+ 'productlist' => 'advancedgrids/widget_grid_column_renderer_productlist'
49
+ );
50
+ }
51
+ }
app/code/community/Mage/AdvancedGrids/Block/Sales/Shipment/Grid.php ADDED
@@ -0,0 +1,44 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Copyright (C) 2011 Slawomir Iwanczuk
4
+ *
5
+ * This program is free software: you can redistribute it and/or modify
6
+ * it under the terms of the GNU General Public License as published by
7
+ * the Free Software Foundation, either version 3 of the License, or
8
+ * (at your option) any later version.
9
+ *
10
+ * This program is distributed in the hope that it will be useful,
11
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
+ * GNU General Public License for more details.
14
+ *
15
+ * You should have received a copy of the GNU General Public License
16
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
17
+ */
18
+
19
+ class Mage_AdvancedGrids_Block_Sales_Shipment_Grid
20
+ extends Mage_Adminhtml_Block_Sales_Shipment_Grid
21
+ {
22
+ protected function _prepareColumns()
23
+ {
24
+ $this->addColumnAfter('customer_email', array(
25
+ 'header' => Mage::helper('customer')->__('Email'),
26
+ 'index' => 'customer_email',
27
+ ), 'shipping_name');
28
+
29
+ $this->addColumnAfter('product_name', array(
30
+ 'header' => Mage::helper('catalog')->__('Product'),
31
+ 'index' => 'product_name',
32
+ 'type' => 'productlist'
33
+ ), 'customer_email');
34
+
35
+ return parent::_prepareColumns();
36
+ }
37
+
38
+ public function getColumnRenderers()
39
+ {
40
+ return array(
41
+ 'productlist' => 'advancedgrids/widget_grid_column_renderer_productlist'
42
+ );
43
+ }
44
+ }
app/code/community/Mage/AdvancedGrids/Block/Widget/Grid/Column/Renderer/Productlist.php ADDED
@@ -0,0 +1,26 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Copyright (C) 2011 Slawomir Iwanczuk
4
+ *
5
+ * This program is free software: you can redistribute it and/or modify
6
+ * it under the terms of the GNU General Public License as published by
7
+ * the Free Software Foundation, either version 3 of the License, or
8
+ * (at your option) any later version.
9
+ *
10
+ * This program is distributed in the hope that it will be useful,
11
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
+ * GNU General Public License for more details.
14
+ *
15
+ * You should have received a copy of the GNU General Public License
16
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
17
+ */
18
+
19
+ class Mage_AdvancedGrids_Block_Widget_Grid_Column_Renderer_Productlist
20
+ extends Mage_Adminhtml_Block_Widget_Grid_Column_Renderer_Abstract
21
+ {
22
+ public function render(Varien_Object $row)
23
+ {
24
+ return nl2br(htmlspecialchars(parent::_getValue($row)));
25
+ }
26
+ }
app/code/community/Mage/AdvancedGrids/Helper/Data.php ADDED
@@ -0,0 +1,23 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Copyright (C) 2011 Slawomir Iwanczuk
4
+ *
5
+ * This program is free software: you can redistribute it and/or modify
6
+ * it under the terms of the GNU General Public License as published by
7
+ * the Free Software Foundation, either version 3 of the License, or
8
+ * (at your option) any later version.
9
+ *
10
+ * This program is distributed in the hope that it will be useful,
11
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
+ * GNU General Public License for more details.
14
+ *
15
+ * You should have received a copy of the GNU General Public License
16
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
17
+ */
18
+
19
+ class Mage_AdvancedGrids_Helper_Data
20
+ extends Mage_Core_Helper_Abstract
21
+ {
22
+
23
+ }
app/code/community/Mage/AdvancedGrids/Model/Mysql4/Setup.php ADDED
@@ -0,0 +1,23 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Copyright (C) 2011 Slawomir Iwanczuk
4
+ *
5
+ * This program is free software: you can redistribute it and/or modify
6
+ * it under the terms of the GNU General Public License as published by
7
+ * the Free Software Foundation, either version 3 of the License, or
8
+ * (at your option) any later version.
9
+ *
10
+ * This program is distributed in the hope that it will be useful,
11
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
+ * GNU General Public License for more details.
14
+ *
15
+ * You should have received a copy of the GNU General Public License
16
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
17
+ */
18
+
19
+ class Mage_AdvancedGrids_Model_Mysql4_Setup
20
+ extends Mage_AdvancedGrids_Model_Resource_Setup
21
+ {
22
+
23
+ }
app/code/community/Mage/AdvancedGrids/Model/Observer.php ADDED
@@ -0,0 +1,77 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Copyright (C) 2011 Slawomir Iwanczuk
4
+ *
5
+ * This program is free software: you can redistribute it and/or modify
6
+ * it under the terms of the GNU General Public License as published by
7
+ * the Free Software Foundation, either version 3 of the License, or
8
+ * (at your option) any later version.
9
+ *
10
+ * This program is distributed in the hope that it will be useful,
11
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
+ * GNU General Public License for more details.
14
+ *
15
+ * You should have received a copy of the GNU General Public License
16
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
17
+ */
18
+
19
+ class Mage_AdvancedGrids_Model_Observer
20
+ {
21
+ public function initOrderGridColumns($observer)
22
+ {
23
+ $resource = $observer->getEvent()->getResource();
24
+
25
+ $resource->addVirtualGridColumn(
26
+ 'product_name',
27
+ 'sales/order_item',
28
+ array('entity_id' => 'order_id'),
29
+ 'GROUP_CONCAT({{table}}.name SEPARATOR "\n")'
30
+ );
31
+
32
+ $resource->addVirtualGridColumn(
33
+ 'payment_method',
34
+ 'sales/order_payment',
35
+ array('entity_id' => 'parent_id'),
36
+ '{{table}}.method'
37
+ );
38
+ }
39
+
40
+ public function initInvoiceGridColumns($observer)
41
+ {
42
+ $resource = $observer->getEvent()->getResource();
43
+
44
+ $resource->addVirtualGridColumn(
45
+ 'customer_email',
46
+ 'sales/order',
47
+ array('order_id' => 'entity_id'),
48
+ '{{table}}.customer_email'
49
+ );
50
+
51
+ $resource->addVirtualGridColumn(
52
+ 'product_name',
53
+ 'sales/invoice_item',
54
+ array('entity_id' => 'parent_id'),
55
+ 'GROUP_CONCAT({{table}}.name SEPARATOR "\n")'
56
+ );
57
+ }
58
+
59
+ public function initShipmentGridColumns($observer)
60
+ {
61
+ $resource = $observer->getEvent()->getResource();
62
+
63
+ $resource->addVirtualGridColumn(
64
+ 'customer_email',
65
+ 'sales/order',
66
+ array('order_id' => 'entity_id'),
67
+ '{{table}}.customer_email'
68
+ );
69
+
70
+ $resource->addVirtualGridColumn(
71
+ 'product_name',
72
+ 'sales/shipment_item',
73
+ array('entity_id' => 'parent_id'),
74
+ 'GROUP_CONCAT({{table}}.name SEPARATOR "\n")'
75
+ );
76
+ }
77
+ }
app/code/community/Mage/AdvancedGrids/Model/Resource/Setup.php ADDED
@@ -0,0 +1,23 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Copyright (C) 2011 Slawomir Iwanczuk
4
+ *
5
+ * This program is free software: you can redistribute it and/or modify
6
+ * it under the terms of the GNU General Public License as published by
7
+ * the Free Software Foundation, either version 3 of the License, or
8
+ * (at your option) any later version.
9
+ *
10
+ * This program is distributed in the hope that it will be useful,
11
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
+ * GNU General Public License for more details.
14
+ *
15
+ * You should have received a copy of the GNU General Public License
16
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
17
+ */
18
+
19
+ class Mage_AdvancedGrids_Model_Resource_Setup
20
+ extends Mage_Core_Model_Resource_Setup
21
+ {
22
+
23
+ }
app/code/community/Mage/AdvancedGrids/etc/config.xml ADDED
@@ -0,0 +1,93 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <!--
3
+ /**
4
+ * Copyright (C) 2011 Slawomir Iwanczuk
5
+ *
6
+ * This program is free software: you can redistribute it and/or modify
7
+ * it under the terms of the GNU General Public License as published by
8
+ * the Free Software Foundation, either version 3 of the License, or
9
+ * (at your option) any later version.
10
+ *
11
+ * This program is distributed in the hope that it will be useful,
12
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
13
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
+ * GNU General Public License for more details.
15
+ *
16
+ * You should have received a copy of the GNU General Public License
17
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
18
+ */
19
+ -->
20
+ <config>
21
+ <modules>
22
+ <Mage_AdvancedGrids>
23
+ <version>1.0.0</version>
24
+ </Mage_AdvancedGrids>
25
+ </modules>
26
+ <global>
27
+ <models>
28
+ <advancedgrids>
29
+ <class>Mage_AdvancedGrids_Model</class>
30
+ <resourceModel>advancedgrids_resource</resourceModel>
31
+ </advancedgrids>
32
+ <advancedgrids_resource>
33
+ <class>Mage_AdvancedGrids_Model_Resource</class>
34
+ <deprecatedNode>advancedgrids_mysql4</deprecatedNode>
35
+ </advancedgrids_resource>
36
+ </models>
37
+ <resources>
38
+ <advancedgrids_setup>
39
+ <setup>
40
+ <module>Mage_AdvancedGrids</module>
41
+ <class>Mage_AdvancedGrids_Model_Resource_Setup</class>
42
+ </setup>
43
+ </advancedgrids_setup>
44
+ </resources>
45
+ <blocks>
46
+ <advancedgrids>
47
+ <class>Mage_AdvancedGrids_Block</class>
48
+ </advancedgrids>
49
+ <adminhtml>
50
+ <rewrite>
51
+ <sales_order_grid>Mage_AdvancedGrids_Block_Sales_Order_Grid</sales_order_grid>
52
+ <sales_invoice_grid>Mage_AdvancedGrids_Block_Sales_Invoice_Grid</sales_invoice_grid>
53
+ <sales_shipment_grid>Mage_AdvancedGrids_Block_Sales_Shipment_Grid</sales_shipment_grid>
54
+ <customer_edit_tab_orders>Mage_AdvancedGrids_Block_Customer_Edit_Tab_Orders</customer_edit_tab_orders>
55
+ </rewrite>
56
+ </adminhtml>
57
+ </blocks>
58
+ <helpers>
59
+ <advancedgrids>
60
+ <class>Mage_AdvancedGrids_Helper</class>
61
+ </advancedgrids>
62
+ </helpers>
63
+ <events>
64
+ <sales_order_resource_init_virtual_grid_columns>
65
+ <observers>
66
+ <advancedgrids>
67
+ <class>advancedgrids/observer</class>
68
+ <type>singleton</type>
69
+ <method>initOrderGridColumns</method>
70
+ </advancedgrids>
71
+ </observers>
72
+ </sales_order_resource_init_virtual_grid_columns>
73
+ <sales_order_invoice_resource_init_virtual_grid_columns>
74
+ <observers>
75
+ <advancedgrids>
76
+ <class>advancedgrids/observer</class>
77
+ <type>singleton</type>
78
+ <method>initInvoiceGridColumns</method>
79
+ </advancedgrids>
80
+ </observers>
81
+ </sales_order_invoice_resource_init_virtual_grid_columns>
82
+ <sales_order_shipment_resource_init_virtual_grid_columns>
83
+ <observers>
84
+ <advancedgrids>
85
+ <class>advancedgrids/observer</class>
86
+ <type>singleton</type>
87
+ <method>initShipmentGridColumns</method>
88
+ </advancedgrids>
89
+ </observers>
90
+ </sales_order_shipment_resource_init_virtual_grid_columns>
91
+ </events>
92
+ </global>
93
+ </config>
app/code/community/Mage/AdvancedGrids/sql/advancedgrids_setup/install-1.0.0.php ADDED
@@ -0,0 +1,179 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Copyright (C) 2011 Slawomir Iwanczuk
4
+ *
5
+ * This program is free software: you can redistribute it and/or modify
6
+ * it under the terms of the GNU General Public License as published by
7
+ * the Free Software Foundation, either version 3 of the License, or
8
+ * (at your option) any later version.
9
+ *
10
+ * This program is distributed in the hope that it will be useful,
11
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
+ * GNU General Public License for more details.
14
+ *
15
+ * You should have received a copy of the GNU General Public License
16
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
17
+ */
18
+
19
+ $installer = $this;
20
+
21
+ $installer->startSetup();
22
+
23
+ $installer->getConnection()
24
+ ->addColumn($installer->getTable('sales/order_grid'), 'customer_email', array(
25
+ 'type' => Varien_Db_Ddl_Table::TYPE_TEXT,
26
+ 'comment' => 'Customer Email',
27
+ 'length' => '255'
28
+ ));
29
+
30
+ $installer->getConnection()
31
+ ->addColumn($installer->getTable('sales/order_grid'), 'product_name', array(
32
+ 'type' => Varien_Db_Ddl_Table::TYPE_TEXT,
33
+ 'comment' => 'Product Name',
34
+ 'length' => '255'
35
+ ));
36
+
37
+ $installer->getConnection()
38
+ ->addColumn($installer->getTable('sales/order_grid'), 'payment_method', array(
39
+ 'type' => Varien_Db_Ddl_Table::TYPE_TEXT,
40
+ 'comment' => 'Payment Method',
41
+ 'length' => '255'
42
+ ));
43
+
44
+ $installer->getConnection()
45
+ ->addIndex($installer->getTable('sales/order_grid'),
46
+ $installer->getIdxName('sales/order_grid', array('customer_email')),
47
+ array('customer_email'));
48
+
49
+ $installer->getConnection()
50
+ ->addIndex($installer->getTable('sales/order_grid'),
51
+ $installer->getIdxName('sales/order_grid', array('product_name')),
52
+ array('product_name'));
53
+
54
+ $installer->getConnection()
55
+ ->addIndex($installer->getTable('sales/order_grid'),
56
+ $installer->getIdxName('sales/order_grid', array('payment_method')),
57
+ array('payment_method'));
58
+
59
+ $installer->getConnection()
60
+ ->addColumn($installer->getTable('sales/invoice_grid'), 'customer_email', array(
61
+ 'type' => Varien_Db_Ddl_Table::TYPE_TEXT,
62
+ 'comment' => 'Customer Email',
63
+ 'length' => '255'
64
+ ));
65
+
66
+ $installer->getConnection()
67
+ ->addColumn($installer->getTable('sales/invoice_grid'), 'product_name', array(
68
+ 'type' => Varien_Db_Ddl_Table::TYPE_TEXT,
69
+ 'comment' => 'Product Name',
70
+ 'length' => '255'
71
+ ));
72
+
73
+ $installer->getConnection()
74
+ ->addIndex($installer->getTable('sales/invoice_grid'),
75
+ $installer->getIdxName('sales/invoice_grid', array('customer_email')),
76
+ array('customer_email'));
77
+
78
+ $installer->getConnection()
79
+ ->addIndex($installer->getTable('sales/invoice_grid'),
80
+ $installer->getIdxName('sales/invoice_grid', array('product_name')),
81
+ array('product_name'));
82
+
83
+ $installer->getConnection()
84
+ ->addColumn($installer->getTable('sales/shipment_grid'), 'customer_email', array(
85
+ 'type' => Varien_Db_Ddl_Table::TYPE_TEXT,
86
+ 'comment' => 'Customer Email',
87
+ 'length' => '255'
88
+ ));
89
+
90
+ $installer->getConnection()
91
+ ->addColumn($installer->getTable('sales/shipment_grid'), 'product_name', array(
92
+ 'type' => Varien_Db_Ddl_Table::TYPE_TEXT,
93
+ 'comment' => 'Product Name',
94
+ 'length' => '255'
95
+ ));
96
+
97
+ $installer->getConnection()
98
+ ->addIndex($installer->getTable('sales/shipment_grid'),
99
+ $installer->getIdxName('sales/shipment_grid', array('customer_email')),
100
+ array('customer_email'));
101
+
102
+ $installer->getConnection()
103
+ ->addIndex($installer->getTable('sales/shipment_grid'),
104
+ $installer->getIdxName('sales/shipment_grid', array('product_name')),
105
+ array('product_name'));
106
+
107
+ $flatColumns = array_keys($installer->getConnection()->describeTable($installer->getTable('sales/order')));
108
+ $gridColumns = array_keys($installer->getConnection()->describeTable($installer->getTable('sales/order_grid')));
109
+
110
+ $flatColumnsToSelect = array_intersect($flatColumns, $gridColumns);
111
+
112
+ $select = $installer->getConnection()->select()
113
+ ->from($installer->getTable('sales/order'), $flatColumnsToSelect)
114
+ ->joinLeft(
115
+ $installer->getTable('sales/order_payment'),
116
+ $installer->getTable('sales/order').'.entity_id='.$installer->getTable('sales/order_payment').'.parent_id',
117
+ array('payment_method' => $installer->getTable('sales/order_payment').'.method')
118
+ )
119
+ ->joinLeft(
120
+ $installer->getTable('sales/order_item'),
121
+ $installer->getTable('sales/order').'.entity_id='.$installer->getTable('sales/order_item').'.order_id',
122
+ array('product_name' => new Zend_Db_Expr('GROUP_CONCAT('.$installer->getTable('sales/order_item').'.name SEPARATOR "\n")'))
123
+ )
124
+ ->group($installer->getTable('sales/order').'.entity_id');
125
+
126
+ $flatColumnsToSelect[] = 'payment_method';
127
+ $flatColumnsToSelect[] = 'product_name';
128
+
129
+ $installer->getConnection()->query($select->insertFromSelect($installer->getTable('sales/order_grid'), $flatColumnsToSelect, true));
130
+
131
+ $flatColumns = array_keys($installer->getConnection()->describeTable($installer->getTable('sales/invoice')));
132
+ $gridColumns = array_keys($installer->getConnection()->describeTable($installer->getTable('sales/invoice_grid')));
133
+
134
+ $flatColumnsToSelect = array_intersect($flatColumns, $gridColumns);
135
+
136
+ $select = $installer->getConnection()->select()
137
+ ->from($installer->getTable('sales/invoice'), $flatColumnsToSelect)
138
+ ->joinLeft(
139
+ $installer->getTable('sales/order'),
140
+ $installer->getTable('sales/invoice').'.order_id='.$installer->getTable('sales/order').'.entity_id',
141
+ array('customer_email' => $installer->getTable('sales/order').'.customer_email')
142
+ )
143
+ ->joinLeft(
144
+ $installer->getTable('sales/invoice_item'),
145
+ $installer->getTable('sales/invoice').'.entity_id='.$installer->getTable('sales/invoice_item').'.parent_id',
146
+ array('product_name' => new Zend_Db_Expr('GROUP_CONCAT('.$installer->getTable('sales/invoice_item').'.name SEPARATOR "\n")'))
147
+ )
148
+ ->group($installer->getTable('sales/invoice').'.entity_id');
149
+
150
+ $flatColumnsToSelect[] = 'customer_email';
151
+ $flatColumnsToSelect[] = 'product_name';
152
+
153
+ $installer->getConnection()->query($select->insertFromSelect($installer->getTable('sales/invoice_grid'), $flatColumnsToSelect, true));
154
+
155
+ $flatColumns = array_keys($installer->getConnection()->describeTable($installer->getTable('sales/shipment')));
156
+ $gridColumns = array_keys($installer->getConnection()->describeTable($installer->getTable('sales/shipment_grid')));
157
+
158
+ $flatColumnsToSelect = array_intersect($flatColumns, $gridColumns);
159
+
160
+ $select = $installer->getConnection()->select()
161
+ ->from($installer->getTable('sales/shipment'), $flatColumnsToSelect)
162
+ ->joinLeft(
163
+ $installer->getTable('sales/order'),
164
+ $installer->getTable('sales/shipment').'.order_id='.$installer->getTable('sales/order').'.entity_id',
165
+ array('customer_email' => $installer->getTable('sales/order').'.customer_email')
166
+ )
167
+ ->joinLeft(
168
+ $installer->getTable('sales/shipment_item'),
169
+ $installer->getTable('sales/shipment').'.entity_id='.$installer->getTable('sales/shipment_item').'.parent_id',
170
+ array('product_name' => new Zend_Db_Expr('GROUP_CONCAT('.$installer->getTable('sales/shipment_item').'.name SEPARATOR "\n")'))
171
+ )
172
+ ->group($installer->getTable('sales/shipment').'.entity_id');
173
+
174
+ $flatColumnsToSelect[] = 'customer_email';
175
+ $flatColumnsToSelect[] = 'product_name';
176
+
177
+ $installer->getConnection()->query($select->insertFromSelect($installer->getTable('sales/shipment_grid'), $flatColumnsToSelect, true));
178
+
179
+ $installer->endSetup();
app/etc/modules/Mage_AdvancedGrids.xml ADDED
@@ -0,0 +1,27 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <!--
3
+ /**
4
+ * Copyright (C) 2011 Slawomir Iwanczuk
5
+ *
6
+ * This program is free software: you can redistribute it and/or modify
7
+ * it under the terms of the GNU General Public License as published by
8
+ * the Free Software Foundation, either version 3 of the License, or
9
+ * (at your option) any later version.
10
+ *
11
+ * This program is distributed in the hope that it will be useful,
12
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
13
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
+ * GNU General Public License for more details.
15
+ *
16
+ * You should have received a copy of the GNU General Public License
17
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
18
+ */
19
+ -->
20
+ <config>
21
+ <modules>
22
+ <Mage_AdvancedGrids>
23
+ <active>true</active>
24
+ <codePool>community</codePool>
25
+ </Mage_AdvancedGrids>
26
+ </modules>
27
+ </config>
package.xml ADDED
@@ -0,0 +1,18 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <package>
3
+ <name>Mage_AdvancedGrids</name>
4
+ <version>1.0.0</version>
5
+ <stability>stable</stability>
6
+ <license>GPL v3</license>
7
+ <channel>community</channel>
8
+ <extends/>
9
+ <summary>Add useful features to the admin panel grids.</summary>
10
+ <description>Have you ever been tired of searching for particular order/invoice/shipment? This extension boosts your overall productivity by extending basic grids to more pleasent to use solution.</description>
11
+ <notes>N/A</notes>
12
+ <authors><author><name>S&#x142;awomir Iwa&#x144;czuk</name><user>ART3GA</user><email>slawomir@iwanczuk.co</email></author></authors>
13
+ <date>2011-10-06</date>
14
+ <time>20:53:13</time>
15
+ <contents><target name="mageetc"><dir name="modules"><file name="Mage_AdvancedGrids.xml" hash="e3ee3179b916c955347fbbcf8a0ccddd"/></dir></target><target name="magecommunity"><dir name="Mage"><dir name="AdvancedGrids"><dir name="Block"><dir name="Customer"><dir name="Edit"><dir name="Tab"><file name="Orders.php" hash="3e6ac0b7d72b249a827e9d3a7da59f39"/></dir></dir></dir><dir name="Sales"><dir name="Invoice"><file name="Grid.php" hash="ac62fa3d451646e285d1583f29585728"/></dir><dir name="Order"><file name="Grid.php" hash="da0177a181158848a33a2817a2e6ecf0"/></dir><dir name="Shipment"><file name="Grid.php" hash="27df5717e40657fc9c3ae955e1b0b298"/></dir></dir><dir name="Widget"><dir name="Grid"><dir name="Column"><dir name="Renderer"><file name="Productlist.php" hash="43f32b319c2a112d25163b9689fafcff"/></dir></dir></dir></dir></dir><dir name="Helper"><file name="Data.php" hash="c128d37432396efc8bd103fefdb67d04"/></dir><dir name="Model"><dir name="Mysql4"><file name="Setup.php" hash="bd785a0b3eb4153e315659fa7da308f4"/></dir><file name="Observer.php" hash="ed74d415b8928e8f2ac9e9e889006c4a"/><dir name="Resource"><file name="Setup.php" hash="b26efde28d6d753581a086d42ee1a076"/></dir></dir><dir name="etc"><file name="config.xml" hash="194274bdd392c12b5c1faea36330d277"/></dir><dir name="sql"><dir name="advancedgrids_setup"><file name="install-1.0.0.php" hash="019c10adb52fcf3e1e441613bd9ac469"/></dir></dir></dir></dir></target></contents>
16
+ <compatible/>
17
+ <dependencies><required><php><min>5.2.0</min><max>6.0.0</max></php><package><name>Mage_Core_Modules</name><channel>core</channel><min>1.6.0.0</min><max>1.6.1.0</max></package></required></dependencies>
18
+ </package>