Jump to content

Add custom field in AdminEmployees


emiku90

Recommended Posts

Hello,

 

I am trying to add a new field in AdminEmployeesController.php, so I can add the employee's country.

 

I have already add a new column in my database and I add the following code to AdminEmployeesController.php:

 

$this->fields_list = array(
		'id_employee' => array('title' => $this->l('ID'), 'align' => 'center', 'width' => 25),
		'lastname' => array('title' => $this->l('Last name'), 'width' => 'auto'),
		'firstname' => array('title' => $this->l('First name'), 'width' => 130),
		'email' => array('title' => $this->l('E-mail address'), 'width' => 180),
		'profile' => array('title' => $this->l('Profile'), 'width' => 90, 'type' => 'select', 'list' => $this->profiles_array, 'filter_key' => 'pl!name'),
		'active' => array('title' => $this->l('Can log in'), 'align' => 'center', 'active' => 'status', 'type' => 'bool', 'width' => 30),
---------->		  'country' => array('title' => $this->l('Country'), 'width' => 3),
	);

 

And

 

  	 $this->fields_form = array(
		'legend' => array(
			'title' => $this->l('Employees'),
			'image' => '../img/admin/nav-user.gif'
		),
		'input' => array(		  
			array(
				'type' => 'text',
				'label' => $this->l('Country:'),
				'name' => 'country',
				'size' => 3,
				'required' => true
			),

 

When I add a new employee using admin panel, in database column "country" nothing is written. What am I doing wrong?

 

Thank you...!

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...