1: <?php
2: /**
3: * Magento
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 Mage
22: * @package Mage_Adminhtml
23: * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
24: * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25: */
26:
27: /**
28: * Adminhtml tags detail for product report grid block
29: *
30: * @category Mage
31: * @package Mage_Adminhtml
32: * @author Magento Core Team <core@magentocommerce.com>
33: */
34: class Mage_Adminhtml_Block_Report_Tag_Popular_Detail_Grid extends Mage_Adminhtml_Block_Widget_Grid
35: {
36:
37: public function __construct()
38: {
39: parent::__construct();
40: $this->setId('tag_grid');
41: }
42:
43: /**
44: * Prepare collection for grid
45: *
46: * @return Mage_Adminhtml_Block_Report_Tag_Popular_Detail_Grid
47: */
48: protected function _prepareCollection()
49: {
50: /* @var $collection Mage_Reports_Model_Resource_Tag_Customer_Collection */
51: $collection = Mage::getResourceModel('reports/tag_customer_collection');
52: $collection->addStatusFilter(Mage::getModel('tag/tag')->getApprovedStatus())
53: ->addTagFilter($this->getRequest()->getParam('id'))
54: ->addDescOrder()
55: ->addProductName();
56:
57: $this->setCollection($collection);
58:
59: return parent::_prepareCollection();
60: }
61:
62: /**
63: * Form columns for the grid
64: *
65: * @return Mage_Adminhtml_Block_Report_Tag_Popular_Detail_Grid
66: */
67: protected function _prepareColumns()
68: {
69:
70: $this->addColumn('firstname', array(
71: 'header' =>Mage::helper('reports')->__('First Name'),
72: 'sortable' => false,
73: 'index' =>'firstname'
74: ));
75:
76: $this->addColumn('lastname', array(
77: 'header' =>Mage::helper('reports')->__('Last Name'),
78: 'sortable' => false,
79: 'index' =>'lastname'
80: ));
81:
82: $this->addColumn('product', array(
83: 'header' =>Mage::helper('reports')->__('Product Name'),
84: 'sortable' => false,
85: 'index' =>'product'
86: ));
87:
88: if (!Mage::app()->isSingleStoreMode()) {
89: $this->addColumn('added_in', array(
90: 'header' => Mage::helper('reports')->__('Submitted In'),
91: 'sortable' => false,
92: 'index' => 'store_id',
93: 'type' => 'store',
94: 'store_view'=> true
95: ));
96: }
97:
98: $this->setFilterVisibility(false);
99:
100: $this->addExportType('*/*/exportTagDetailCsv', Mage::helper('reports')->__('CSV'));
101: $this->addExportType('*/*/exportTagDetailExcel', Mage::helper('reports')->__('Excel XML'));
102:
103: return parent::_prepareColumns();
104: }
105:
106: }
107: