This is a bug that i have, i don't know if this is a real bug, can anyone here confirm?
Here is the problem:
1) i have 3 departments for the live support (general, tech, commercial)
2) tech and commercial are set to PRIVATE, general to PUBLIC
3) when there's no staff in general connected, but 1 in tech the status on the client side is "online"
4) they click on chat but they see: general(offline)... so they can't go on.
The purpose of my general department is to filter the request and forward them to the good staff.
So the status on the client side should be offline when the online departments are all private
If this isn't a configuration bug here is my fix:
in
modules/livesupport/functions_livesupport.php
find near line 257 (in
function isStaffMonitorOnline($departmentid) )
PHP Code:
$dbCore->query("SELECT staff.staffid, staff.groupassigns, staffgroup.staffgroupid, sessions.status FROM `". TABLE_PREFIX ."sessions` AS sessions LEFT JOIN `". TABLE_PREFIX ."staff` AS staff ON (sessions.typeid = staff.staffid) LEFT JOIN `". TABLE_PREFIX ."staffgroup` AS staffgroup ON (staff.staffgroupid = staffgroup.staffgroupid) WHERE sessions.sessiontype IN('". SESSION_WINAPP ."', '". SESSION_MONITOR ."') and sessions.lastactivity >= '". (DATENOW-180) ."';");
replace by
PHP Code:
$departmentsstatus=getDepartmentsStatus(null);
foreach ($departmentsstatus["online"] AS $value)
{
$departmentsstatuslive[]=$value["departmentid"];
}
$dbCore->query("SELECT staff.staffid, staff.groupassigns, staffgroup.staffgroupid, sessions.status FROM `". TABLE_PREFIX ."sessions` AS sessions LEFT JOIN `". TABLE_PREFIX ."staff` AS staff ON (sessions.typeid = staff.staffid) LEFT JOIN `". TABLE_PREFIX ."staffgroup` AS staffgroup ON (staff.staffgroupid = staffgroup.staffgroupid) LEFT JOIN `". TABLE_PREFIX ."staffassigns` AS staffassigns ON (staff.staffid=staffassigns.staffid) WHERE sessions.sessiontype IN('". SESSION_WINAPP ."', '". SESSION_MONITOR ."') and sessions.lastactivity >= '". (DATENOW-180) ."' AND staffassigns.departmentid IN (".buildIN($departmentsstatuslive).");");