The goal is to increase confidence in fusionpbx, one step is to run by default with error_reporting (E_ALL ^ E_NOTICE);
So, please find in this set numerous small changes which eliminate numerous php warning messages. Also, a small bug fix in an sql statistics routine, naming a count(*) field as count, so displaying correct detail. If any of the proposed changes are omitted, the relevant page will experience php warnings. There are no doubt fusionpbx pages I've yet to visit that still generate warnings, this set is nearly certainly not comprehensive.
This commit is contained in:
@@ -29,7 +29,7 @@ class destinations {
|
||||
}
|
||||
$i = 0;
|
||||
foreach ($apps as $x => &$app) {
|
||||
foreach ($app['destinations'] as &$row) {
|
||||
if (isset($app['destinations'])) foreach ($app['destinations'] as &$row) {
|
||||
$this->destinations[] = $row;
|
||||
}
|
||||
}
|
||||
@@ -277,4 +277,4 @@ echo $obj->select('ivr', 'example5', '');
|
||||
echo $obj->select('ivr', 'example6', '');
|
||||
*/
|
||||
|
||||
?>
|
||||
?>
|
||||
|
||||
@@ -138,7 +138,7 @@ if (!class_exists('domains')) {
|
||||
}
|
||||
|
||||
//get the user settings
|
||||
if (strlen($_SESSION["domain_uuid"]) > 0 && strlen($_SESSION["user_uuid"]) > 0) {
|
||||
if (array_key_exists("domain_uuid",$_SESSION) and array_key_exists("user_uuid",$_SESSION) and strlen($_SESSION["domain_uuid"]) > 0 && strlen($_SESSION["user_uuid"]) > 0) {
|
||||
$sql = "select * from v_user_settings ";
|
||||
$sql .= "where domain_uuid = '" . $_SESSION["domain_uuid"] . "' ";
|
||||
$sql .= "and user_uuid = '" . $_SESSION["user_uuid"] . "' ";
|
||||
|
||||
@@ -164,7 +164,7 @@ class event_socket {
|
||||
|
||||
public function close() {
|
||||
if ($this->fp) {
|
||||
fclose($fp);
|
||||
fclose($fp->fp);
|
||||
$this->fp = false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -203,7 +203,7 @@ if (!class_exists('menu')) {
|
||||
//if there are no groups listed in v_menu_item_groups under menu_item_uuid then add the default groups
|
||||
foreach($apps as $app) {
|
||||
foreach ($app['menu'] as $sub_row) {
|
||||
foreach ($sub_row['groups'] as $group) {
|
||||
if (isset($sub_row['groups'])) foreach ($sub_row['groups'] as $group) {
|
||||
$sql = "select count(*) as count from v_menu_item_groups ";
|
||||
$sql .= "where menu_item_uuid = '".$sub_row['uuid']."' ";
|
||||
$sql .= "and menu_uuid = '".$this->menu_uuid."' ";
|
||||
@@ -547,7 +547,7 @@ if (!class_exists('menu')) {
|
||||
//set the default menu_uuid
|
||||
$this->menu_uuid = 'b4750c3f-2a86-b00d-b7d0-345c14eca286';
|
||||
//check to see if any menu exists
|
||||
$sql = "select count(*) from v_menus ";
|
||||
$sql = "select count(*) as count from v_menus ";
|
||||
$sql .= "where menu_uuid = '".$this->menu_uuid."' ";
|
||||
$prep_statement = $this->db->prepare(check_sql($sql));
|
||||
$prep_statement->execute();
|
||||
|
||||
@@ -67,15 +67,14 @@ if (!class_exists('switch_settings')) {
|
||||
}
|
||||
}
|
||||
|
||||
//connect to event socket
|
||||
$esl = new event_socket;
|
||||
$esl->connect($this->event_socket_ip_address, $this->event_socket_port, $this->event_socket_password);
|
||||
{ //connect to event socket
|
||||
$esl = new event_socket;
|
||||
$esl->connect($this->event_socket_ip_address, $this->event_socket_port, $this->event_socket_password);
|
||||
|
||||
//run the api command
|
||||
$result = $esl->request('api global_getvar');
|
||||
//run the api command
|
||||
$result = $esl->request('api global_getvar');
|
||||
} //close event socket
|
||||
|
||||
//close event socket
|
||||
fclose($fp);
|
||||
|
||||
//set the result as a named array
|
||||
$vars = array();
|
||||
@@ -284,4 +283,4 @@ if (!class_exists('switch_settings')) {
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
?>
|
||||
|
||||
Reference in New Issue
Block a user