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_Profile_Edit_Tab_History extends Mage_Adminhtml_Block_Widget_Grid
35: {
36: public function __construct()
37: {
38: parent::__construct();
39: $this->setId('history_grid');
40: $this->setDefaultSort('performed_at', 'desc');
41: $this->setUseAjax(true);
42: }
43:
44: protected function _prepareCollection()
45: {
46: $collection = Mage::getResourceModel('dataflow/profile_history_collection')
47: ->joinAdminUser()
48: ->addFieldToFilter('profile_id', Mage::registry('current_convert_profile')->getId());
49: $this->setCollection($collection);
50: return parent::_prepareCollection();
51: }
52:
53: protected function _prepareColumns()
54: {
55: $this->addColumn('action_code', array(
56: 'header' => Mage::helper('adminhtml')->__('Profile Action'),
57: 'index' => 'action_code',
58: 'filter' => 'adminhtml/system_convert_profile_edit_filter_action',
59: 'renderer' => 'adminhtml/system_convert_profile_edit_renderer_action',
60: ));
61:
62: $this->addColumn('performed_at', array(
63: 'header' => Mage::helper('adminhtml')->__('Performed At'),
64: 'type' => 'datetime',
65: 'index' => 'performed_at',
66: 'width' => '150px',
67: ));
68:
69: $this->addColumn('firstname', array(
70: 'header' => Mage::helper('adminhtml')->__('First Name'),
71: 'index' => 'firstname',
72: ));
73:
74: $this->addColumn('lastname', array(
75: 'header' => Mage::helper('adminhtml')->__('Last Name'),
76: 'index' => 'lastname',
77: ));
78:
79: return parent::_prepareColumns();
80: }
81:
82: public function getGridUrl()
83: {
84: return $this->getUrl('*/*/history', array('_current' => true));
85: }
86: }
87: