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:
@@ -29,6 +29,12 @@
|
||||
*/
|
||||
class destinations {
|
||||
|
||||
/**
|
||||
* declare constant variables
|
||||
*/
|
||||
const app_name = 'destinations';
|
||||
const app_uuid = '5ec89622-b19c-3559-64f0-afde802ab139';
|
||||
|
||||
/**
|
||||
* declare public variables
|
||||
*/
|
||||
@@ -57,30 +63,28 @@
|
||||
public function __construct($setting_array = []) {
|
||||
|
||||
//open a database connection
|
||||
if (empty($setting_array['database'])) {
|
||||
$this->database = database::new();
|
||||
} else {
|
||||
$this->database = $setting_array['database'];
|
||||
}
|
||||
if (empty($setting_array['database'])) {
|
||||
$this->database = database::new();
|
||||
} else {
|
||||
$this->database = $setting_array['database'];
|
||||
}
|
||||
|
||||
//set the domain details
|
||||
$this->domain_uuid = $_SESSION['domain_uuid'] ?? '';
|
||||
$this->user_uuid = $_SESSION['user_uuid'] ?? '';
|
||||
|
||||
//get the settings object
|
||||
if (empty($setting_array['settings'])) {
|
||||
$this->settings = new settings(['database' => $this->database, 'domain_uuid' => $this->domain_uuid, 'user_uuid' => $this->user_uuid]);
|
||||
} else {
|
||||
$this->settings = $setting_array['settings'];
|
||||
}
|
||||
if (empty($setting_array['settings'])) {
|
||||
$this->settings = new settings(['database' => $this->database, 'domain_uuid' => $this->domain_uuid, 'user_uuid' => $this->user_uuid]);
|
||||
} else {
|
||||
$this->settings = $setting_array['settings'];
|
||||
}
|
||||
|
||||
//assign private variables
|
||||
$this->app_name = 'destinations';
|
||||
$this->app_uuid = '5ec89622-b19c-3559-64f0-afde802ab139';
|
||||
$this->permission_prefix = 'destination_';
|
||||
$this->list_page = 'destinations.php';
|
||||
$this->table = 'destinations';
|
||||
$this->uuid_prefix = 'destination_';
|
||||
$this->permission_prefix = 'destination_';
|
||||
$this->list_page = 'destinations.php';
|
||||
$this->table = 'destinations';
|
||||
$this->uuid_prefix = 'destination_';
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1080,8 +1084,6 @@
|
||||
$p->add('dialplan_detail_delete', 'temp');
|
||||
|
||||
//execute delete
|
||||
$this->database->app_name = $this->app_name;
|
||||
$this->database->app_uuid = $this->app_uuid;
|
||||
$this->database->delete($array);
|
||||
unset($array);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user