mirror of
https://github.com/opensourcepos/opensourcepos.git
synced 2026-04-14 03:50:33 -04:00
Formatting
- Convert indents to tabs - Remove unnecessary else statement - Correct PHPDoc formatting
This commit is contained in:
committed by
Steve Ireland
parent
dfa50382cb
commit
e1fb285da7
@@ -19,9 +19,9 @@ class Home extends Secure_Controller
|
||||
$this->employee->logout();
|
||||
}
|
||||
|
||||
/*
|
||||
Load "change employee password" form
|
||||
*/
|
||||
/**
|
||||
* Load "change employee password" form
|
||||
*/
|
||||
public function change_password(int $employee_id = -1): void //TODO: Replace -1 with a constant
|
||||
{
|
||||
$person_info = $this->employee->get_info($employee_id);
|
||||
@@ -34,9 +34,9 @@ class Home extends Secure_Controller
|
||||
echo view('home/form_change_password', $data);
|
||||
}
|
||||
|
||||
/*
|
||||
Change employee password
|
||||
*/
|
||||
/**
|
||||
* Change employee password
|
||||
*/
|
||||
public function save(int $employee_id = -1): void //TODO: Replace -1 with a constant
|
||||
{
|
||||
if($this->request->getPost('current_password') != '' && $employee_id != -1)
|
||||
@@ -84,4 +84,4 @@ class Home extends Secure_Controller
|
||||
]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -16,48 +16,48 @@ use Config\Services;
|
||||
*/
|
||||
class Load_config
|
||||
{
|
||||
/**
|
||||
* Loads configuration from database into App CI config and then applies those settings
|
||||
*/
|
||||
public function load_config()
|
||||
{
|
||||
//Migrations
|
||||
$migration_config = config('Migrations');
|
||||
$migration = new MY_Migration($migration_config);
|
||||
/**
|
||||
* Loads configuration from database into App CI config and then applies those settings
|
||||
*/
|
||||
public function load_config()
|
||||
{
|
||||
//Migrations
|
||||
$migration_config = config('Migrations');
|
||||
$migration = new MY_Migration($migration_config);
|
||||
|
||||
$this->session = session();
|
||||
$this->session = session();
|
||||
|
||||
//Database Configuration
|
||||
$config = config('OSPOS');
|
||||
$appconfig = model(Appconfig::class);
|
||||
//Database Configuration
|
||||
$config = config('OSPOS');
|
||||
$appconfig = model(Appconfig::class);
|
||||
|
||||
if (!$migration->is_latest())
|
||||
{
|
||||
$this->session->destroy();
|
||||
}
|
||||
{
|
||||
$this->session->destroy();
|
||||
}
|
||||
|
||||
$config->settings['application_version'] = $migration->get_current_version();
|
||||
foreach($appconfig->get_all()->getResult() as $app_config)
|
||||
{
|
||||
$config->settings[$app_config->key] = $app_config->value;
|
||||
}
|
||||
foreach($appconfig->get_all()->getResult() as $app_config)
|
||||
{
|
||||
$config->settings[$app_config->key] = $app_config->value;
|
||||
}
|
||||
|
||||
//Language
|
||||
//Language
|
||||
helper('locale');
|
||||
$language_exists = file_exists('../app/Language/' . current_language_code());
|
||||
$language_exists = file_exists('../app/Language/' . current_language_code());
|
||||
|
||||
if(current_language_code() == null || current_language() == null || !$language_exists) //TODO: current_language() is undefined
|
||||
{
|
||||
$config->language = 'english';
|
||||
$config->language_code = 'en-US';
|
||||
}
|
||||
if(current_language_code() == null || current_language() == null || !$language_exists) //TODO: current_language() is undefined
|
||||
{
|
||||
$config->language = 'english';
|
||||
$config->language_code = 'en-US';
|
||||
}
|
||||
|
||||
$language = Services::language();
|
||||
$language->setLocale($config->settings['language_code']);
|
||||
$language = Services::language();
|
||||
$language->setLocale($config->settings['language_code']);
|
||||
|
||||
//Time Zone
|
||||
date_default_timezone_set($config->timezone ?? 'America/New_York');
|
||||
//Time Zone
|
||||
date_default_timezone_set($config->timezone ?? 'America/New_York');
|
||||
|
||||
bcscale(max(2, totals_decimals() + tax_decimals()));
|
||||
}
|
||||
bcscale(max(2, totals_decimals() + tax_decimals()));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -80,20 +80,18 @@ class Employee extends Person
|
||||
{
|
||||
return $query->getRow();
|
||||
}
|
||||
else //TODO: No need for this else statement. Just put it's contents outside of the else since the if has a return in it.
|
||||
|
||||
//Get empty base parent object, as $employee_id is NOT an employee
|
||||
$person_obj = parent::get_info(-1); //TODO: Replace -1 with a constant
|
||||
|
||||
//Get all the fields from employee table
|
||||
//append those fields to base parent object, we have a complete empty object
|
||||
foreach($this->db->getFieldNames('employees') as $field)
|
||||
{
|
||||
//Get empty base parent object, as $employee_id is NOT an employee
|
||||
$person_obj = parent::get_info(-1); //TODO: Replace -1 with a constant
|
||||
|
||||
//Get all the fields from employee table
|
||||
//append those fields to base parent object, we have a complete empty object
|
||||
foreach($this->db->getFieldNames('employees') as $field)
|
||||
{
|
||||
$person_obj->$field = '';
|
||||
}
|
||||
|
||||
return $person_obj;
|
||||
$person_obj->$field = '';
|
||||
}
|
||||
|
||||
return $person_obj;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -547,4 +545,4 @@ class Employee extends Person
|
||||
|
||||
return $success;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user