1: <?php
2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25:
26:
27: 28: 29: 30: 31: 32: 33:
34: class Mage_Adminhtml_Block_System_Convert_Gui_Grid extends Mage_Adminhtml_Block_Widget_Grid
35: {
36:
37: public function __construct()
38: {
39: parent::__construct();
40: $this->setId('convertProfileGrid');
41: $this->setDefaultSort('profile_id');
42: }
43:
44: protected function _prepareCollection()
45: {
46: $collection = Mage::getResourceModel('dataflow/profile_collection')
47: ->addFieldToFilter('entity_type', array('notnull'=>''));
48:
49: $this->setCollection($collection);
50:
51: return parent::_prepareCollection();
52: }
53:
54: protected function _prepareColumns()
55: {
56: $this->addColumn('profile_id', array(
57: 'header' => Mage::helper('adminhtml')->__('ID'),
58: 'width' => '50px',
59: 'index' => 'profile_id',
60: ));
61: $this->addColumn('name', array(
62: 'header' => Mage::helper('adminhtml')->__('Profile Name'),
63: 'index' => 'name',
64: ));
65: $this->addColumn('direction', array(
66: 'header' => Mage::helper('adminhtml')->__('Profile Direction'),
67: 'index' => 'direction',
68: 'type' => 'options',
69: 'options' => array('import'=>'Import', 'export'=>'Export'),
70: 'width' => '120px',
71: ));
72: $this->addColumn('entity_type', array(
73: 'header' => Mage::helper('adminhtml')->__('Entity Type'),
74: 'index' => 'entity_type',
75: 'type' => 'options',
76: 'options' => array('product'=>'Products', 'customer'=>'Customers'),
77: 'width' => '120px',
78: ));
79:
80: $this->addColumn('store_id', array(
81: 'header' => Mage::helper('adminhtml')->__('Store'),
82: 'type' => 'options',
83: 'align' => 'center',
84: 'index' => 'store_id',
85: 'type' => 'store',
86: 'width' => '200px',
87: ));
88:
89: $this->addColumn('created_at', array(
90: 'header' => Mage::helper('adminhtml')->__('Created At'),
91: 'type' => 'datetime',
92: 'align' => 'center',
93: 'index' => 'created_at',
94: ));
95: $this->addColumn('updated_at', array(
96: 'header' => Mage::helper('adminhtml')->__('Updated At'),
97: 'type' => 'datetime',
98: 'align' => 'center',
99: 'index' => 'updated_at',
100: ));
101:
102: $this->addColumn('action', array(
103: 'header' => Mage::helper('adminhtml')->__('Action'),
104: 'width' => '60px',
105: 'align' => 'center',
106: 'sortable' => false,
107: 'filter' => false,
108: 'type' => 'action',
109: 'actions' => array(
110: array(
111: 'url' => $this->getUrl('*/*/edit') . 'id/$profile_id',
112: 'caption' => Mage::helper('adminhtml')->__('Edit')
113: )
114: )
115: ));
116:
117: return parent::_prepareColumns();
118: }
119:
120: public function getRowUrl($row)
121: {
122: return $this->getUrl('*/*/edit', array('id'=>$row->getId()));
123: }
124:
125: }
126:
127: