From 7556956763688c18f42a7ba8765d9b4638716800 Mon Sep 17 00:00:00 2001 From: fusionate Date: Mon, 13 May 2024 10:27:34 -0600 Subject: [PATCH] CDR - Details: Mitigate PHP 8.x warnings. --- app/xml_cdr/resources/classes/xml_cdr.php | 22 +++++++++++----------- app/xml_cdr/xml_cdr_details.php | 16 +++++++++------- 2 files changed, 20 insertions(+), 18 deletions(-) diff --git a/app/xml_cdr/resources/classes/xml_cdr.php b/app/xml_cdr/resources/classes/xml_cdr.php index 2bedd7dcf7..af16f2b5c4 100644 --- a/app/xml_cdr/resources/classes/xml_cdr.php +++ b/app/xml_cdr/resources/classes/xml_cdr.php @@ -1203,7 +1203,7 @@ if (!class_exists('xml_cdr')) { } //call centers - if ($app['application'] == 'call_centers') { + if (!empty($app['application']) && $app['application'] == 'call_centers') { if (isset($row["caller_profile"]["transfer_source"])) { $app['status'] = 'answered'; //Out } @@ -1213,22 +1213,22 @@ if (!class_exists('xml_cdr')) { } //call flows - if ($app['application'] == 'call_flows') { + if (!empty($app['application']) && $app['application'] == 'call_flows') { $app['status'] = 'routed'; } //conferences - if ($app['application'] == 'conferences') { + if (!empty($app['application']) && $app['application'] == 'conferences') { $app['status'] = 'answered'; } //destinations - if ($app['application'] == 'destinations') { + if (!empty($app['application']) && $app['application'] == 'destinations') { $app['status'] = 'routed'; } //extensions - if ($app['application'] == 'extensions') { + if (!empty($app['application']) && $app['application'] == 'extensions') { if ($this->billsec == 0) { $app['status'] = 'missed'; } @@ -1238,7 +1238,7 @@ if (!class_exists('xml_cdr')) { } //ivr menus - if ($app['application'] == 'ivr_menus') { + if (!empty($app['application']) && $app['application'] == 'ivr_menus') { $app['status'] = 'routed'; } @@ -1254,12 +1254,12 @@ if (!class_exists('xml_cdr')) { } //ring groups - if ($app['application'] == 'ring_groups') { + if (!empty($app['application']) && $app['application'] == 'ring_groups') { $app['status'] = 'waited'; } //time conditions - if ($app['application'] == 'time_conditions') { + if (!empty($app['application']) && $app['application'] == 'time_conditions') { $app['status'] = 'routed'; } @@ -1295,12 +1295,12 @@ if (!class_exists('xml_cdr')) { } //conference - if ($app['application'] == 'conferences') { + if (!empty($app['application']) && $app['application'] == 'conferences') { $skip_row = true; } //voicemails - if ($app['application'] == 'voicemails') { + if (!empty($app['application']) && $app['application'] == 'voicemails') { $app['status'] = 'voicemail'; } @@ -1331,7 +1331,7 @@ if (!class_exists('xml_cdr')) { $call_flow_summary[$x]["destination_number"] = $row["caller_profile"]["destination_number"]; $call_flow_summary[$x]["destination_label"] = $app['label']; $call_flow_summary[$x]["destination_status"] = $app['status']; - $call_flow_summary[$x]["destination_description"] = $app['description']; + $call_flow_summary[$x]["destination_description"] = $app['description'] ?? ''; //$call_flow_summary[$x]["application"] = $app; //set the start and epoch diff --git a/app/xml_cdr/xml_cdr_details.php b/app/xml_cdr/xml_cdr_details.php index d49bca594f..62314b4d07 100644 --- a/app/xml_cdr/xml_cdr_details.php +++ b/app/xml_cdr/xml_cdr_details.php @@ -17,7 +17,7 @@ The Initial Developer of the Original Code is Mark J Crane - Portions created by the Initial Developer are Copyright (C) 2008-2023 + Portions created by the Initial Developer are Copyright (C) 2008-2024 the Initial Developer. All Rights Reserved. Contributor(s): @@ -447,7 +447,7 @@ echo " ".escape($row["start_stamp"])."\n"; echo " ".escape($row["end_stamp"])."\n"; echo " ".escape($row["duration_formatted"])."\n"; - echo " ".escape($text['label-'.$row["destination_status"]])."\n"; + echo " ".escape($text['label-'.$row["destination_status"]] ?? '')."\n"; echo "\n"; //alternate $c @@ -489,11 +489,13 @@ echo " ".$vk."    \n"; echo " \n"; echo " \n"; - foreach ($arrays as $k => $v) { - echo " \n"; - echo " \n"; - echo " \n"; - echo " \n"; + if (!empty($arrays) && is_array($arrays)) { + foreach ($arrays as $k => $v) { + echo " \n"; + echo " \n"; + echo " \n"; + echo " \n"; + } } echo "
".$k."    ".$v."
".$k."    ".$v."
\n"; echo " \n";