Custom field for admin user

Please LogIn to Reply!

Post By: admin | 26-01-2012 06:35 Reply

 

I have created different admin for different store. I want a custom filed ‘Store’ while adding a new admin user with select box. And need to use its value everywhere in admin.
I m using 1.3.2.4.

 

I got my self smile , it may be usefull to others..

1)

Find :
appcodecore\MageAdminhtmlBlockPermissionsUserEditTabMain.php

Add this under the email fieldset - approx line no 90

$fieldset->addField('new''text', array(
            
'name'  => 'new',
            
'label' => 'new',
            
'id'    => 'new',
            
'title' => 'new',
            
'required' => true,
        ));

2) appcodecoreMageAdminModelUser.php

Change this :-

public function save()
    
{
        $this
->_beforeSave();
        
$data = array(
            
'firstname' => $this->getFirstname(),
            
'lastname'  => $this->getLastname(),
            
'email'     => $this->getEmail(),
            
'modified'  => now(),
            
'extra'     => serialize($this->getExtra())
        );

To this :-

public function save()
    
{
        $this
->_beforeSave();
        
$data = array(
            
'firstname' => $this->getFirstname(),
            
'lastname'  => $this->getLastname(),
            
'email'     => $this->getEmail(),
            
'new'     => $this->getNew(),  // newlly added
            
'modified'  => now(),
            
'extra'     => serialize($this->getExtra())
        );

3) Create new column in ‘admin_user’ database table ‘new’

ALTER TABLE  `admin_userADD  `new1VARCHAR255 NULL DEFAULT  '0';

(you can override the methods)

`Reply Or Comment!
Please LogIn to Reply!