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_Grid_User extends Mage_Adminhtml_Block_Widget_Grid
00035 {
00036
00037 public function __construct()
00038 {
00039 parent::__construct();
00040 $this->setId('customerGrid');
00041 $this->setSaveParametersInSession(true);
00042 $this->setDefaultSort('username');
00043 $this->setDefaultDir('asc');
00044 }
00045
00046 protected function _prepareCollection()
00047 {
00048 $collection = Mage::getModel("permissions/users")->getCollection();
00049 $this->setCollection($collection);
00050
00051 return parent::_prepareCollection();
00052 }
00053
00054 protected function _prepareColumns()
00055 {
00056 $this->addColumn('user_id', array(
00057 'header' =>Mage::helper('adminhtml')->__('ID'),
00058 'width' =>5,
00059 'align' =>'right',
00060 'sortable' =>true,
00061 'index' =>'user_id'
00062 ));
00063 $this->addColumn('username', array(
00064 'header' =>Mage::helper('adminhtml')->__('User Name'),
00065 'index' =>'username'
00066 ));
00067 $this->addColumn('firstname', array(
00068 'header' =>Mage::helper('adminhtml')->__('First Name'),
00069 'index' =>'firstname'
00070 ));
00071 $this->addColumn('lastname', array(
00072 'header' =>Mage::helper('adminhtml')->__('Last Name'),
00073 'index' =>'lastname'
00074 ));
00075 $this->addColumn('email', array(
00076 'header' =>Mage::helper('adminhtml')->__('Email'),
00077 'width' =>40,
00078 'align' =>'left',
00079 'index' =>'email'
00080 ));
00081
00082 return parent::_prepareColumns();
00083 }
00084
00085 public function getRowUrl($row)
00086 {
00087 return $this->getUrl('*/*/edituser', array('id' => $row->getUserId()));
00088 }
00089
00090 }
00091