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_XmlConnect
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: * XmlConnect application history grid
29: *
30: * @category Mage
31: * @package Mage_XmlConnect
32: * @author Magento Core Team <core@magentocommerce.com>
33: */
34: class Mage_XmlConnect_Block_Adminhtml_History_Grid extends Mage_Adminhtml_Block_Widget_Grid
35: {
36: /**
37: * Constructor
38: *
39: * Setting grid_id, sort order and sort direction
40: */
41: public function __construct()
42: {
43: parent::__construct();
44: $this->setId('app_history_grid');
45: $this->setDefaultSort('created_at');
46: $this->setDefaultDir('ASC');
47: }
48:
49: /**
50: * Setting collection to show
51: *
52: * @return Mage_Adminhtml_Block_Widget_Grid
53: */
54: protected function _prepareCollection()
55: {
56: $collection = Mage::getModel('xmlconnect/history')->getCollection();
57: $this->setCollection($collection);
58: return parent::_prepareCollection();
59: }
60:
61: /**
62: * Configuration of grid
63: *
64: * @return Mage_Adminhtml_Block_Widget_Grid
65: */
66: protected function _prepareColumns()
67: {
68: $this->addColumn('title', array(
69: 'header' => $this->__('App Title'),
70: 'align' => 'left',
71: 'index' => 'title',
72: 'type' => 'text',
73: 'escape' => true
74: ));
75:
76: $this->addColumn('name', array(
77: 'header' => $this->__('App Name'),
78: 'align' => 'left',
79: 'index' => 'name',
80: 'escape' => true
81: ));
82:
83: $this->addColumn('code', array(
84: 'header' => $this->__('App Code'),
85: 'align' => 'left',
86: 'index' => 'code',
87: 'escape' => true
88: ));
89:
90: $this->addColumn('created_at', array(
91: 'header' => $this->__('Date Submitted'),
92: 'align' => 'left',
93: 'index' => 'created_at',
94: 'type' => 'datetime'
95: ));
96:
97: $this->addColumn('activation_key', array(
98: 'header' => $this->__('Activation Key'),
99: 'align' => 'left',
100: 'index' => 'activation_key',
101: 'escape' => true
102: ));
103: return parent::_prepareColumns();
104: }
105:
106: /**
107: * Remove row click url
108: *
109: * @param Mage_Catalog_Model_Product|Varien_Object $row
110: * @return string
111: */
112: public function getRowUrl($row)
113: {
114: return '';
115: }
116: }
117: