diff --git a/agc_2-X/trunk/www/vicidial/admin.php b/agc_2-X/trunk/www/vicidial/admin.php index 777b07a4..e7206571 100644 --- a/agc_2-X/trunk/www/vicidial/admin.php +++ b/agc_2-X/trunk/www/vicidial/admin.php @@ -5756,12 +5756,13 @@ if ($SSscript_remove_js > 0) # 211213-1619 - Fix for new phone inserts template_id issue on some MySQL setups # 211214-1157 - Fix for Queue Groups link issue #1343 # 211215-1806 - Added some User Group settings +# 211217-0732 - Fixes for PHP8, issue #1341 # # make sure you have added a user to the vicidial_users MySQL table with at least user_level 9 to access this page the first time -$admin_version = '2.14-837a'; -$build = '211215-1806'; +$admin_version = '2.14-838a'; +$build = '211217-0732'; $STARTtime = date("U"); $SQLdate = date("Y-m-d H:i:s"); @@ -7130,6 +7131,7 @@ if ( ( (strlen($ADD)>4) and ($ADD < 99998) ) or ($ADD==3) or (($ADD>20) and ($AD if ($ADD==41) { $p=0; + if (is_null($XFERgroups)) $XFERgroups = array(); $XFERgroup_ct = count($XFERgroups); while ($p < $XFERgroup_ct) { @@ -17156,6 +17158,7 @@ if ($ADD==48) else { $p=0; + if (is_null($qc_statuses)) $qc_statuses = array(); $qc_statuses_ct = count($qc_statuses); while ($p < $qc_statuses_ct) { @@ -17163,6 +17166,7 @@ if ($ADD==48) $p++; } $p=0; + if (is_null($qc_lists)) $qc_lists = array(); $qc_lists_ct = count($qc_lists); while ($p < $qc_lists_ct) { @@ -17754,6 +17758,7 @@ if ($ADD==4111 || $ADD==4811 || $ADD==4911) else { $p=0; + if (is_null($qc_statuses)) $qc_statuses = array(); $qc_statuses_ct = count($qc_statuses); while ($p < $qc_statuses_ct) { @@ -17761,6 +17766,7 @@ if ($ADD==4111 || $ADD==4811 || $ADD==4911) $p++; } $p=0; + if (is_null($qc_lists)) $qc_lists = array(); $qc_lists_ct = count($qc_lists); while ($p < $qc_lists_ct) { diff --git a/agc_2-X/trunk/www/vicidial/non_agent_api.php b/agc_2-X/trunk/www/vicidial/non_agent_api.php index cdcdc7d3..c2df4fb7 100644 --- a/agc_2-X/trunk/www/vicidial/non_agent_api.php +++ b/agc_2-X/trunk/www/vicidial/non_agent_api.php @@ -187,10 +187,11 @@ # 211027-0845 - Added lead_search function # 211107-1556 - Added optional phone_number search for lead_all_info function # 211118-1946 - Added 'delete_cf_data' setting to the update_lead function +# 211217-0733 - Fixes for PHP8, issue #1341 # -$version = '2.14-164'; -$build = '211118-1946'; +$version = '2.14-165'; +$build = '211217-0733'; $php_script='non_agent_api.php'; $api_url_log = 0; @@ -15477,16 +15478,16 @@ if ($function == 'call_status_stats') $campaign_rslt=mysql_to_mysqli($campaign_stmt, $link); while ($row=mysqli_fetch_row($campaign_rslt)) { - $outbound_array{"$row[0]"}[0]=0; - $outbound_array{"$row[0]"}[1]=0; + $outbound_array["$row[0]"][0]=0; + $outbound_array["$row[0]"][1]=0; } } else { for ($i=0; $i 0) { - ksort($temp_stat_array{"$key"}); + ksort($temp_stat_array["$key"]); # while(list($statkey, $statval)=each($temp_stat_array{"$key"})) - foreach($temp_stat_array{"$key"} as $statkey => $statval) + foreach($temp_stat_array["$key"] as $statkey => $statval) { - $status_str.=$statkey."-".$temp_stat_array{"$key"}{"$statkey"}.","; + $status_str.=$statkey."-".$temp_stat_array["$key"]["$statkey"].","; } } $status_str=substr($status_str, 0, -1); - echo $key."|".$outbound_array{$key}[0]."|".$outbound_array{$key}[1]."|".$hour_str."|".$status_str."|\n"; + echo $key."|".$outbound_array[$key][0]."|".$outbound_array[$key][1]."|".$hour_str."|".$status_str."|\n"; } # while(list($key, $val)=each($inbound_array)) { @@ -15608,24 +15610,25 @@ if ($function == 'call_status_stats') for ($i=0; $i<24; $i++) { $hrkey=substr("0$i", -2); - $hrs=$temp_hour_array{"$key"}{"$hrkey"}+=0; + $hrs=$temp_hour_array["$key"]["$hrkey"]+=0; $hour_str.="$hrkey-$hrs,"; } $hour_str=substr($hour_str, 0, -1); - $temp_ary_ct = count($temp_stat_array{"$key"}); + if (is_null($temp_stat_array["$key"])) $temp_stat_array["$key"] = array(); + $temp_ary_ct = count($temp_stat_array["$key"]); if ($temp_ary_ct > 0) { - ksort($temp_stat_array{"$key"}); + ksort($temp_stat_array["$key"]); # while(list($statkey, $statval)=each($temp_stat_array{"$key"})) - foreach($temp_stat_array{"$key"} as $statkey => $statval) + foreach($temp_stat_array["$key"] as $statkey => $statval) { - $status_str.=$statkey."-".$temp_stat_array{"$key"}{"$statkey"}.","; + $status_str.=$statkey."-".$temp_stat_array["$key"]["$statkey"].","; } } $status_str=substr($status_str, 0, -1); - echo $key."|".$inbound_array{$key}[0]."|".$inbound_array{$key}[1]."|".$hour_str."|".$status_str."|\n"; + echo $key."|".$inbound_array[$key][0]."|".$inbound_array[$key][1]."|".$hour_str."|".$status_str."|\n"; } $result = 'SUCCESS'; @@ -15645,7 +15648,7 @@ if ($function == 'call_status_stats') ################################################################################ if ($function == 'call_dispo_report') { - if(strlen($campaigns)<2 && strlen($ingroups)<2 && strlen($did_ids)<2 && strlen($did_patterns)<2) + if(strlen($campaigns)<2 && strlen($ingroups)<2 && strlen($did_ids)<1 && strlen($did_patterns)<2) { $result = 'ERROR'; $result_reason = "call_dispo_report INVALID OR MISSING CAMPAIGNS, INGROUPS, OR DIDS"; @@ -15740,7 +15743,8 @@ if ($function == 'call_dispo_report') } } } - + + if (is_null($did_id_array)) $did_id_array = array(); if (count($did_id_array)>0 && $skip_inbound) # DON'T DO A REPORT FOR INGROUPS AND DIDS YET. { $did_SQL="and did_id in ('".implode("', '", $did_id_array)."')"; @@ -15772,7 +15776,8 @@ if ($function == 'call_dispo_report') } } - if (count($status_array)>0) + if (is_null($status_array)) $status_array = array(); + if ($status_array && count($status_array)>0) { $status_SQL=" and status in ('".implode("', '", $status_array)."') "; if (in_array("ALLSTATUSES", $status_array) || preg_match('/\-\-\-ALL\-\-\-/', $statuses) || in_array("ALLCATEGORIES", $categories_array) || preg_match('/\-\-\-ALL\-\-\-/', $categories)) @@ -15798,7 +15803,8 @@ if ($function == 'call_dispo_report') } } } - if (count($user_array)>0) + if (is_null($user_array)) $user_array = array(); + if ($user_array && count($user_array)>0) { $user_SQL=" and user in ('".implode("', '", $user_array)."') "; if (in_array("ALLUSERS", $user_array) || preg_match('/\-\-\-ALL\-\-\-/', $users) || in_array("ALLGROUPS", $user_group_array) || preg_match('/\-\-\-ALL\-\-\-/', $user_groups)) @@ -15821,7 +15827,7 @@ if ($function == 'call_dispo_report') $rslt=mysql_to_mysqli($stmt, $link); while ($row=mysqli_fetch_row($rslt)) { - $outbound_ct_array{"$row[0]"}{"TOTAL CALLS"}+=$row[2]; + $outbound_ct_array["$row[0]"]["TOTAL CALLS"]+=$row[2]; $grand_total_calls+=$row[2]; if ($status_breakdown) { @@ -15829,8 +15835,8 @@ if ($function == 'call_dispo_report') { array_push($status_ct_array, "$row[1]"); } - $outbound_ct_array{"$row[0]"}{"$row[1]"}+=$row[2]; - $grand_total_array{"$row[1]"}+=$row[2]; + $outbound_ct_array["$row[0]"]["$row[1]"]+=$row[2]; + $grand_total_array["$row[1]"]+=$row[2]; } } } @@ -15841,7 +15847,7 @@ if ($function == 'call_dispo_report') $rslt=mysql_to_mysqli($stmt, $link); while ($row=mysqli_fetch_row($rslt)) { - $inbound_ct_array{"$row[0]"}{"TOTAL CALLS"}+=$row[2]; + $inbound_ct_array["$row[0]"]["TOTAL CALLS"]+=$row[2]; $grand_total_calls+=$row[2]; if ($status_breakdown) { @@ -15849,8 +15855,8 @@ if ($function == 'call_dispo_report') { array_push($status_ct_array, "$row[1]"); } - $inbound_ct_array{"$row[0]"}{"$row[1]"}+=$row[2]; - $grand_total_array{"$row[1]"}+=$row[2]; + $inbound_ct_array["$row[0]"]["$row[1]"]+=$row[2]; + $grand_total_array["$row[1]"]+=$row[2]; } } } @@ -15861,7 +15867,7 @@ if ($function == 'call_dispo_report') $rslt=mysql_to_mysqli($stmt, $link); while ($row=mysqli_fetch_row($rslt)) { - $did_ct_array{"$row[1]"}{"TOTAL CALLS"}+=$row[4]; + $did_ct_array["$row[1]"]["TOTAL CALLS"]+=$row[4]; $grand_total_calls+=$row[4]; if ($status_breakdown) { @@ -15869,12 +15875,13 @@ if ($function == 'call_dispo_report') { array_push($status_ct_array, "$row[3]"); } - $did_ct_array{"$row[1]"}{"$row[3]"}+=$row[4]; - $grand_total_array{"$row[3]"}+=$row[4]; + $did_ct_array["$row[1]"]["$row[3]"]+=$row[4]; + $grand_total_array["$row[3]"]+=$row[4]; } } } + if (is_null($status_ct_array)) $status_ct_array = array(); $rpt_str.="CAMPAIGN,TOTAL CALLS"; if ($status_breakdown) { @@ -15887,18 +15894,18 @@ if ($function == 'call_dispo_report') # while (list($key, $val)=each($outbound_ct_array)) foreach($outbound_ct_array as $key => $val) { - $total_calls=$outbound_ct_array{$key}{"TOTAL CALLS"}; - $rpt_str.="$key,".$outbound_ct_array{$key}{"TOTAL CALLS"}; - unset($outbound_ct_array{$key}{"TOTAL CALLS"}); + $total_calls=$outbound_ct_array[$key]["TOTAL CALLS"]; + $rpt_str.="$key,".$outbound_ct_array[$key]["TOTAL CALLS"]; + unset($outbound_ct_array[$key]["TOTAL CALLS"]); if ($status_breakdown) { for ($i=0; $i $val2) + foreach($outbound_ct_array[$key] as $key2 => $val2) { $rpt_str.=",$val2"; if ($show_percentages) @@ -15914,18 +15921,18 @@ if ($function == 'call_dispo_report') # while (list($key, $val)=each($inbound_ct_array)) foreach($inbound_ct_array as $key => $val) { - $total_calls=$inbound_ct_array{$key}{"TOTAL CALLS"}; - $rpt_str.="$key,".$inbound_ct_array{$key}{"TOTAL CALLS"}; - unset($inbound_ct_array{$key}{"TOTAL CALLS"}); + $total_calls=$inbound_ct_array[$key]["TOTAL CALLS"]; + $rpt_str.="$key,".$inbound_ct_array[$key]["TOTAL CALLS"]; + unset($inbound_ct_array[$key]["TOTAL CALLS"]); if ($status_breakdown) { for ($i=0; $i $val2) + foreach($inbound_ct_array[$key] as $key2 => $val2) { $rpt_str.=",$val2"; if ($show_percentages) @@ -15941,18 +15948,18 @@ if ($function == 'call_dispo_report') # while (list($key, $val)=each($did_ct_array)) foreach($did_ct_array as $key => $val) { - $total_calls=$did_ct_array{$key}{"TOTAL CALLS"}; - $rpt_str.="$key,".$did_ct_array{$key}{"TOTAL CALLS"}; - unset($did_ct_array{$key}{"TOTAL CALLS"}); + $total_calls=$did_ct_array[$key]["TOTAL CALLS"]; + $rpt_str.="$key,".$did_ct_array[$key]["TOTAL CALLS"]; + unset($did_ct_array[$key]["TOTAL CALLS"]); if ($status_breakdown) { for ($i=0; $i $val2) + foreach($did_ct_array[$key] as $key2 => $val2) { $rpt_str.=",$val2"; if ($show_percentages)