mirror of
https://github.com/fusionpbx/fusionpbx.git
synced 2026-01-06 19:53:56 +00:00
Create database object if not set. (#6492)
* Create database object if not set.
This commit is contained in:
@@ -17,7 +17,7 @@
|
||||
|
||||
The Initial Developer of the Original Code is
|
||||
Mark J Crane <markjcrane@fusionpbx.com>
|
||||
Portions created by the Initial Developer are Copyright (C) 2017 - 2021
|
||||
Portions created by the Initial Developer are Copyright (C) 2017 - 2022
|
||||
the Initial Developer. All Rights Reserved.
|
||||
|
||||
Contributor(s):
|
||||
@@ -39,6 +39,11 @@
|
||||
$language = new text;
|
||||
$text = $language->get($_SESSION['domain']['language']['code'], 'app/extensions');
|
||||
|
||||
//connect to the database
|
||||
if (!isset($database)) {
|
||||
$database = new database;
|
||||
}
|
||||
|
||||
//add or update the database
|
||||
if (is_array($_POST['extensions']) && @sizeof($_POST['extensions']) != 0) {
|
||||
|
||||
@@ -89,7 +94,6 @@
|
||||
$p->add("extension_edit", "temp");
|
||||
|
||||
//save to the data
|
||||
$database = new database;
|
||||
$database->app_name = 'extensions';
|
||||
$database->app_uuid = 'e68d9689-2769-e013-28fa-6214bf47fca3';
|
||||
$database->save($array);
|
||||
@@ -136,7 +140,6 @@
|
||||
$sql .= "and destination_type = 'inbound' ";
|
||||
$sql .= "order by destination_caller_id_name asc, destination_caller_id_number asc";
|
||||
$parameters['domain_uuid'] = $_SESSION['domain_uuid'];
|
||||
$database = new database;
|
||||
$destinations = $database->select($sql, $parameters, 'all');
|
||||
unset($sql, $parameters);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user