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_Permissions_Grid_User extends Mage_Adminhtml_Block_Widget_Grid
35: {
36:
37: public function __construct()
38: {
39: parent::__construct();
40: $this->setId('customerGrid');
41: $this->setSaveParametersInSession(true);
42: $this->setDefaultSort('username');
43: $this->setDefaultDir('asc');
44: }
45:
46: protected function _prepareCollection()
47: {
48: $collection = Mage::getModel("permissions/users")->getCollection();
49: $this->setCollection($collection);
50:
51: return parent::_prepareCollection();
52: }
53:
54: protected function _prepareColumns()
55: {
56: $this->addColumn('user_id', array(
57: 'header' =>Mage::helper('adminhtml')->__('ID'),
58: 'width' =>5,
59: 'align' =>'right',
60: 'sortable' =>true,
61: 'index' =>'user_id'
62: ));
63: $this->addColumn('username', array(
64: 'header' =>Mage::helper('adminhtml')->__('User Name'),
65: 'index' =>'username'
66: ));
67: $this->addColumn('firstname', array(
68: 'header' =>Mage::helper('adminhtml')->__('First Name'),
69: 'index' =>'firstname'
70: ));
71: $this->addColumn('lastname', array(
72: 'header' =>Mage::helper('adminhtml')->__('Last Name'),
73: 'index' =>'lastname'
74: ));
75: $this->addColumn('email', array(
76: 'header' =>Mage::helper('adminhtml')->__('Email'),
77: 'width' =>40,
78: 'align' =>'left',
79: 'index' =>'email'
80: ));
81:
82: return parent::_prepareColumns();
83: }
84:
85: public function getRowUrl($row)
86: {
87: return $this->getUrl('*/*/edituser', array('id' => $row->getUserId()));
88: }
89:
90: }
91:
92: