Page 1 of 1

Agent Status Detail Report - Display as HTML - Not Working

PostPosted: Thu Mar 10, 2016 3:51 am
by ZibiX
Hi.

I have noticed problem in Agent Status Report. When I Submit a report to display as TEXT - it is working fine. But when I do the same as HTML I get:
CALLS
CI/CALLS
DNC/CI
SALE3

and that's all. No NI A or any other status. When i click on SALE3 it breaks all report (bars are going to the edge of the screen even when 1 SALE3 is made).

SALE3 is custom status (same as SALE) in Campaign Statuses.

There are no errors in apache log error when this happened.

Apache is working on custom port (not 80).

System is Vicibox 6.0.4 SVN 2442

I have the same problem on many systems (SVN 2368, 2480) but not on 2263.

What can be the problem?

Re: Agent Status Detail Report - Display as HTML - Not Worki

PostPosted: Thu Mar 10, 2016 9:11 pm
by jjohnson78
In your version of AST_agent_status_detail.php, this is a snippet of code that starts at around line 550. Note the bolded red variable:

##########
$status_rows_to_print=0;
while($status_row=mysqli_fetch_row($status_rslt))
{
$current_status=$status_row[0];

if ($show_defunct_users)
{
$stmt="SELECT count(*) as calls,'' as full_name,user,status from ".$agent_log_table." where event_time <= '$query_date_END' and event_time >= '$query_date_BEGIN' and status='$current_status' $group_SQL $user_group_SQL group by user,full_name,status order by full_name,user,status desc limit 500000;";
}
else
{
$stmt="SELECT count(*) as calls,full_name,vicidial_users.user,status from vicidial_users,".$agent_log_table." where event_time <= '$query_date_END' and event_time >= '$query_date_BEGIN' and vicidial_users.user=".$agent_log_table.".user and status='$current_status' $group_SQL $user_group_SQL group by user,full_name,status order by full_name,user,status desc limit 500000;";
}
$rslt=mysql_to_mysqli($stmt, $link);
if ($DB) {echo "$stmt\n";}
$status_rows_to_print = mysqli_num_rows($rslt);
$rows_to_print+=$status_rows_to_print;
$i=0; $sub_status_count=0;
while ($i < $status_rows_to_print)
{
##########

Move that one red, bolded variable to where the "$status_rows_to_print=0;" variable is printed, like so:

##########
$status_rows_to_print=0; $sub_status_count=0;
while($status_row=mysqli_fetch_row($status_rslt))
{
$current_status=$status_row[0];

if ($show_defunct_users)
{
$stmt="SELECT count(*) as calls,'' as full_name,user,status from ".$agent_log_table." where event_time <= '$query_date_END' and event_time >= '$query_date_BEGIN' and status='$current_status' $group_SQL $user_group_SQL group by user,full_name,status order by full_name,user,status desc limit 500000;";
}
else
{
$stmt="SELECT count(*) as calls,full_name,vicidial_users.user,status from vicidial_users,".$agent_log_table." where event_time <= '$query_date_END' and event_time >= '$query_date_BEGIN' and vicidial_users.user=".$agent_log_table.".user and status='$current_status' $group_SQL $user_group_SQL group by user,full_name,status order by full_name,user,status desc limit 500000;";
}
$rslt=mysql_to_mysqli($stmt, $link);
if ($DB) {echo "$stmt\n";}
$status_rows_to_print = mysqli_num_rows($rslt);
$rows_to_print+=$status_rows_to_print;
$i=0;
while ($i < $status_rows_to_print)
{
##########

See if that helps.

Re: Agent Status Detail Report - Display as HTML - Not Worki

PostPosted: Wed Mar 30, 2016 1:14 pm
by ZibiX
In the latest SVN it has been fixed. Confirmed working now.