mirror of
https://github.com/opensourcepos/opensourcepos.git
synced 2026-02-18 14:48:42 -05:00
Update Employee.php
This commit is contained in:
@@ -364,7 +364,7 @@ class Employee extends Person
|
||||
|
||||
/*
|
||||
Determines whether the employee has access to at least one submodule
|
||||
*/
|
||||
*/
|
||||
public function has_module_grant($permission_id, $person_id)
|
||||
{
|
||||
$this->db->from('grants');
|
||||
@@ -431,8 +431,8 @@ class Employee extends Person
|
||||
}
|
||||
|
||||
/*
|
||||
Gets employee permission grants
|
||||
*/
|
||||
Gets employee permission grants
|
||||
*/
|
||||
public function get_employee_grants($person_id)
|
||||
{
|
||||
$this->db->from('grants');
|
||||
@@ -441,7 +441,6 @@ class Employee extends Person
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
Attempts to login employee and set session. Returns boolean based on outcome.
|
||||
*/
|
||||
@@ -471,20 +470,19 @@ class Employee extends Person
|
||||
{
|
||||
$success = FALSE;
|
||||
|
||||
if (ENVIRONMENT == 'testing') {
|
||||
return $success;
|
||||
if(ENVIRONMENT != 'testing')
|
||||
{
|
||||
//Run these queries as a transaction, we want to make sure we do all or nothing
|
||||
$this->db->trans_start();
|
||||
|
||||
$this->db->where('person_id', $employee_id);
|
||||
$success = $this->db->update('employees', $employee_data);
|
||||
|
||||
$this->db->trans_complete();
|
||||
|
||||
$success &= $this->db->trans_status();
|
||||
}
|
||||
|
||||
//Run these queries as a transaction, we want to make sure we do all or nothing
|
||||
$this->db->trans_start();
|
||||
|
||||
$this->db->where('person_id', $employee_id);
|
||||
$success = $this->db->update('employees', $employee_data);
|
||||
|
||||
$this->db->trans_complete();
|
||||
|
||||
$success &= $this->db->trans_status();
|
||||
|
||||
return $success;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user