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:
FusionPBX
2025-09-30 21:37:09 -06:00
committed by GitHub
parent 6485b18822
commit 2fe8b65988
69 changed files with 2571 additions and 2809 deletions

View File

@@ -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)) {