mirror of
https://github.com/Mibew/design.git
synced 2025-01-23 02:20:34 +03:00
show threads only for group members, show group name in the list
git-svn-id: https://webim.svn.sourceforge.net/svnroot/webim/trunk@437 c66351dc-e62f-0410-b875-e3a5c0b9693f
This commit is contained in:
parent
52e0299375
commit
2cd1dbe393
@ -53,6 +53,10 @@ function thread_to_xml($thread,$link) {
|
|||||||
$nextagent = $thread['nextagent'] != 0 ? operator_by_id_($thread['nextagent'],$link) : null;
|
$nextagent = $thread['nextagent'] != 0 ? operator_by_id_($thread['nextagent'],$link) : null;
|
||||||
$threadoperator = $nextagent ? get_operator_name($nextagent)
|
$threadoperator = $nextagent ? get_operator_name($nextagent)
|
||||||
: ($thread['agentName'] ? $thread['agentName'] : "-");
|
: ($thread['agentName'] ? $thread['agentName'] : "-");
|
||||||
|
|
||||||
|
if($threadoperator == "-" && $thread['groupname']) {
|
||||||
|
$threadoperator = "- ".$thread['groupname']." -";
|
||||||
|
}
|
||||||
|
|
||||||
if(!($thread['istate'] == $state_chatting && $thread['agentId'] != $operator['operatorid'] && !is_capable($can_takeover,$operator))) {
|
if(!($thread['istate'] == $state_chatting && $thread['agentId'] != $operator['operatorid'] && !is_capable($can_takeover,$operator))) {
|
||||||
$result .= " canopen=\"true\"";
|
$result .= " canopen=\"true\"";
|
||||||
@ -99,15 +103,22 @@ function thread_to_xml($thread,$link) {
|
|||||||
return $result;
|
return $result;
|
||||||
}
|
}
|
||||||
|
|
||||||
function print_pending_threads($since) {
|
function print_pending_threads($groupids,$since) {
|
||||||
global $webim_encoding;
|
global $webim_encoding, $settings;
|
||||||
$link = connect();
|
$link = connect();
|
||||||
|
|
||||||
$revision = $since;
|
$revision = $since;
|
||||||
$output = array();
|
$output = array();
|
||||||
$query = "select threadid, userName, agentName, unix_timestamp(dtmcreated), userTyping, ".
|
$query = "select threadid, userName, agentName, unix_timestamp(dtmcreated), userTyping, ".
|
||||||
"unix_timestamp(dtmmodified), lrevision, istate, remote, nextagent, agentId, userid, shownmessageid, userAgent ".
|
"unix_timestamp(dtmmodified), lrevision, istate, remote, nextagent, agentId, userid, shownmessageid, userAgent, (select vclocalname from chatgroup where chatgroup.groupid = chatthread.groupid) as groupname ".
|
||||||
"from chatthread where lrevision > $since ORDER BY threadid";
|
"from chatthread where lrevision > $since ".
|
||||||
|
($settings['enablegroups'] == '1'
|
||||||
|
? "AND (groupid is NULL".($groupids
|
||||||
|
? " OR groupid IN ($groupids)"
|
||||||
|
: "").
|
||||||
|
") "
|
||||||
|
: "").
|
||||||
|
"ORDER BY threadid";
|
||||||
$rows = select_multi_assoc($query, $link);
|
$rows = select_multi_assoc($query, $link);
|
||||||
foreach ($rows as $row) {
|
foreach ($rows as $row) {
|
||||||
$thread = thread_to_xml($row,$link);
|
$thread = thread_to_xml($row,$link);
|
||||||
@ -129,7 +140,8 @@ function print_pending_threads($since) {
|
|||||||
$since = verifyparam( "since", "/^\d{1,9}$/", 0);
|
$since = verifyparam( "since", "/^\d{1,9}$/", 0);
|
||||||
|
|
||||||
loadsettings();
|
loadsettings();
|
||||||
print_pending_threads($since);
|
$groupids = $_SESSION['operatorgroups'];
|
||||||
|
print_pending_threads($groupids,$since);
|
||||||
notify_operator_alive($operator['operatorid']);
|
notify_operator_alive($operator['operatorid']);
|
||||||
exit;
|
exit;
|
||||||
|
|
||||||
|
@ -19,6 +19,20 @@ $operator = check_login();
|
|||||||
|
|
||||||
notify_operator_alive($operator['operatorid']);
|
notify_operator_alive($operator['operatorid']);
|
||||||
|
|
||||||
|
loadsettings();
|
||||||
|
if($settings['enablegroups'] == '1') {
|
||||||
|
$link = connect();
|
||||||
|
$groupids = array();
|
||||||
|
$allgroups = select_multi_assoc("select groupid from chatgroupoperator where operatorid = ".$operator['operatorid']." order by groupid",$link);
|
||||||
|
foreach($allgroups as $g) {
|
||||||
|
$groupids[] = $g['groupid'];
|
||||||
|
}
|
||||||
|
$_SESSION['operatorgroups'] = implode(",", $groupids);
|
||||||
|
mysql_close($link);
|
||||||
|
} else {
|
||||||
|
$_SESSION['operatorgroups'] = "";
|
||||||
|
}
|
||||||
|
|
||||||
$page = array();
|
$page = array();
|
||||||
$page['havemenu'] = isset($_GET['nomenu']) ? "0" : "1";
|
$page['havemenu'] = isset($_GET['nomenu']) ? "0" : "1";
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user