mirror of
https://github.com/fusionpbx/fusionpbx.git
synced 2025-12-30 00:53:50 +00:00
Define app_name and app_uuid as constants (#7534)
* Set a constant on each class for app_name and app_uuid * Update the database class to use the app_uuid and app_name * Update the classes to use the database::new() * Remove the instances of 'new database'
This commit is contained in:
@@ -30,17 +30,34 @@
|
||||
class basic_operator_panel {
|
||||
|
||||
/**
|
||||
* Define the variables
|
||||
* declare constant variables
|
||||
*/
|
||||
const app_name = 'basic_operator_panel';
|
||||
const app_uuid = 'dd3d173a-5d51-4231-ab22-b18c5b712bb2';
|
||||
|
||||
/**
|
||||
* declare public variables
|
||||
*/
|
||||
public $domain_uuid;
|
||||
|
||||
/**
|
||||
* declare private variables
|
||||
*/
|
||||
private $database;
|
||||
|
||||
/**
|
||||
* Called when the object is created
|
||||
*/
|
||||
public function __construct() {
|
||||
//assign public variables
|
||||
if (!isset($this->domain_uuid)) {
|
||||
$this->domain_uuid = $_SESSION['domain_uuid'];
|
||||
}
|
||||
|
||||
//connect to the database
|
||||
if (empty($this->database)) {
|
||||
$this->database = database::new();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -71,8 +88,7 @@
|
||||
$sql .= "order by ";
|
||||
$sql .= "e.extension asc ";
|
||||
$parameters['domain_uuid'] = $_SESSION['domain_uuid'];
|
||||
$database = new database;
|
||||
$extensions = $database->select($sql, $parameters);
|
||||
$extensions = $this->database->select($sql, $parameters);
|
||||
|
||||
//store extension status by user uuid
|
||||
if (isset($extensions)) {
|
||||
|
||||
Reference in New Issue
Block a user