00001 <?php
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034 class Mage_Adminhtml_Block_Permissions_User_Grid extends Mage_Adminhtml_Block_Widget_Grid
00035 {
00036
00037 public function __construct()
00038 {
00039 parent::__construct();
00040 $this->setId('permissionsUserGrid');
00041 $this->setDefaultSort('username');
00042 $this->setDefaultDir('asc');
00043 $this->setUseAjax(true);
00044 }
00045
00046 protected function _prepareCollection()
00047 {
00048 $collection = Mage::getResourceModel('admin/user_collection');
00049 $this->setCollection($collection);
00050 return parent::_prepareCollection();
00051 }
00052
00053 protected function _prepareColumns()
00054 {
00055 $this->addColumn('user_id', array(
00056 'header' => Mage::helper('adminhtml')->__('ID'),
00057 'width' => 5,
00058 'align' => 'right',
00059 'sortable' => true,
00060 'index' => 'user_id'
00061 ));
00062
00063 $this->addColumn('username', array(
00064 'header' => Mage::helper('adminhtml')->__('User Name'),
00065 'index' => 'username'
00066 ));
00067
00068 $this->addColumn('firstname', array(
00069 'header' => Mage::helper('adminhtml')->__('First Name'),
00070 'index' => 'firstname'
00071 ));
00072
00073 $this->addColumn('lastname', array(
00074 'header' => Mage::helper('adminhtml')->__('Last Name'),
00075 'index' => 'lastname'
00076 ));
00077
00078 $this->addColumn('email', array(
00079 'header' => Mage::helper('adminhtml')->__('Email'),
00080 'width' => 40,
00081 'align' => 'left',
00082 'index' => 'email'
00083 ));
00084
00085 $this->addColumn('is_active', array(
00086 'header' => Mage::helper('adminhtml')->__('Status'),
00087 'index' => 'is_active',
00088 'type' => 'options',
00089 'options' => array('1' => Mage::helper('adminhtml')->__('Active'), '0' => Mage::helper('adminhtml')->__('Inactive')),
00090 ));
00091
00092 return parent::_prepareColumns();
00093 }
00094
00095 public function getRowUrl($row)
00096 {
00097 return $this->getUrl('*/*/edit', array('user_id' => $row->getId()));
00098 }
00099
00100 public function getGridUrl()
00101 {
00102
00103 return $this->getUrl('*/*/roleGrid', array());
00104 }
00105
00106 }