Skip to content

Commit fe64ae9

Browse files
authored
Merge pull request #4 from BezaluLLC/upstream-nightly
PHP8 fix for Agent time detail report
2 parents f143048 + a1cd60e commit fe64ae9

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

www/vicidial/AST_agent_time_detail.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@
6161
# 220303-1427 - Added allow_web_debug system setting
6262
# 230526-1740 - Patch for user_group bug, related to Issue #1346
6363
# 240801-1130 - Code updates for PHP8 compatibility
64+
# 250912-1628 - PHP8 bug fixes
6465
#
6566

6667
$startMS = microtime();
@@ -658,7 +659,7 @@
658659

659660

660661
### BEGIN gather timeclock records per agent
661-
$stmt="select $userSQL,sum(login_sec) from ".$timeclock_log_table." where event IN('LOGIN','START') and event_date >= '$query_date_BEGIN' and event_date <= '$query_date_END' $TCuser_group_SQL group by user limit 10000000;";
662+
$stmt="select $userSQL,if(sum(login_sec) is null, 0, sum(login_sec)) from ".$timeclock_log_table." where event IN('LOGIN','START') and event_date >= '$query_date_BEGIN' and event_date <= '$query_date_END' $TCuser_group_SQL group by user limit 10000000;";
662663
$rslt=mysql_to_mysqli($stmt, $link);
663664
if ($DB) {echo "$stmt\n";}
664665
$punches_to_print = mysqli_num_rows($rslt);
@@ -795,6 +796,7 @@
795796
if ($uc < 1)
796797
{
797798
$Suser[$uc] = $user;
799+
$Scalls[$uc] = 0;
798800
$uc++;
799801
}
800802
$m=0;

0 commit comments

Comments
 (0)