Create database object if not set. (#6492)

* Create database object if not set.
This commit is contained in:
FusionPBX
2022-11-08 09:40:12 -07:00
committed by GitHub
parent 4a1913b447
commit 88bc541d0d
10 changed files with 42 additions and 40 deletions

View File

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