diff --git a/src/messenger/webim/default.css b/src/messenger/webim/default.css index 53c5fedf..d78dac37 100644 --- a/src/messenger/webim/default.css +++ b/src/messenger/webim/default.css @@ -527,6 +527,19 @@ table.awaiting td.visitor { margin: 10px 10px; } +#connlinks { + margin: 10px 10px; +} + +#connlinks a { + color: #777; + text-decoration: none; +} + +#connlinks a:hover { + text-decoration: underline; +} + /* search */ #searchtext { diff --git a/src/messenger/webim/install/dbinfo.php b/src/messenger/webim/install/dbinfo.php index e733697d..82f8dfe0 100644 --- a/src/messenger/webim/install/dbinfo.php +++ b/src/messenger/webim/install/dbinfo.php @@ -63,6 +63,7 @@ $dbtables = array( "vclocalename" => "varchar(64) NOT NULL", "vccommonname" => "varchar(64) NOT NULL", "dtmlastvisited" => "datetime DEFAULT 0", + "istatus" => "int DEFAULT 0", /* 0 - online, 1 - away */ "vcavatar" => "varchar(255)", "vcjabbername" => "varchar(255)", "iperm" => "int DEFAULT 65535", @@ -105,7 +106,7 @@ $memtables = array(); $dbtables_can_update = array( "chatthread" => array("agentId", "userTyping", "agentTyping", "messageCount", "nextagent", "shownmessageid", "userid", "userAgent", "groupid"), "chatmessage" => array("agentId"), - "chatoperator" => array("vcavatar", "vcjabbername", "iperm"), + "chatoperator" => array("vcavatar", "vcjabbername", "iperm", "istatus"), "chatban" => array(), "chatgroup" => array(), "chatgroupoperator" => array(), diff --git a/src/messenger/webim/install/dbperform.php b/src/messenger/webim/install/dbperform.php index dece7476..a3ae3425 100644 --- a/src/messenger/webim/install/dbperform.php +++ b/src/messenger/webim/install/dbperform.php @@ -111,6 +111,10 @@ if ($act == "silentcreateall") { runsql("ALTER TABLE chatoperator ADD iperm int DEFAULT 65535", $link); } + if( in_array("chatoperator.istatus", $absent) ) { + runsql("ALTER TABLE chatoperator ADD istatus int DEFAULT 0", $link); + } + if( in_array("chatoperator.vcavatar", $absent) ) { runsql("ALTER TABLE chatoperator ADD vcavatar varchar(255)", $link); } @@ -127,10 +131,9 @@ if ($act == "silentcreateall") { runsql("ALTER TABLE chatthread ADD userAgent varchar(255)", $link); } - $res = runsql("select null from information_schema.statistics where table_name = 'chatmessage' and index_name = 'idx_agentid'", $link); - if(mysql_num_rows($res) == 0) { + $res = mysql_query("select null from information_schema.statistics where table_name = 'chatmessage' and index_name = 'idx_agentid'", $link); + if($res && mysql_num_rows($res) == 0) { runsql("ALTER TABLE chatmessage ADD INDEX idx_agentid (agentid)", $link); - } } } diff --git a/src/messenger/webim/js/source/common.js b/src/messenger/webim/js/source/common.js index 476ee765..983eef5a 100644 --- a/src/messenger/webim/js/source/common.js +++ b/src/messenger/webim/js/source/common.js @@ -12,7 +12,7 @@ //- onComplete, obj, params, $apply$ //- threadParams, servl, frequency, user, threadid, token, cssfile -//- updaterOptions, url, company, agentservl, noclients, wroot, havemenu, showpopup, ignorectrl +//- updaterOptions, url, company, agentservl, noclients, wroot, havemenu, showpopup, ignorectrl, istatus var Class = { diff --git a/src/messenger/webim/js/source/users.js b/src/messenger/webim/js/source/users.js index 2eedc04f..d02cc636 100644 --- a/src/messenger/webim/js/source/users.js +++ b/src/messenger/webim/js/source/users.js @@ -117,7 +117,7 @@ Class.inherit( Ajax.ThreadListUpdater, Ajax.Base, { }, updateParams: function() { - return "company=" + this._options.company + "&since=" + this._options.lastrevision; + return "since=" + this._options.lastrevision + "&status=" + this._options.istatus; }, setStatus: function(msg) { @@ -272,7 +272,7 @@ Class.inherit( Ajax.ThreadListUpdater, Ajax.Base, { } } }, - + updateContent: function(root) { var newAdded = false; if( root.tagName == 'threads' ) { @@ -292,7 +292,7 @@ Class.inherit( Ajax.ThreadListUpdater, Ajax.Base, { } this.updateQueueMessages(); this.updateTimers(); - this.setStatus( "Up to date" ); + this.setStatus(this._options.istatus ? "Away" : "Up to date"); if( newAdded ) { playSound(webimRoot+'/sounds/new_user.wav'); window.focus(); @@ -322,6 +322,8 @@ if($("sidebar") && $("wcontent") && $("togglemenu")) { } } +var webimRoot = ""; + Behaviour.register({ '#togglemenu' : function(el) { el.onclick = function() { @@ -330,11 +332,9 @@ Behaviour.register({ } }); -var webimRoot = ""; - EventHelper.register(window, 'onload', function(){ webimRoot = updaterOptions.wroot; - new Ajax.ThreadListUpdater(({table:$("threadlist"),status:$("connstatus")}).extend(updaterOptions || {})); + new Ajax.ThreadListUpdater(({table:$("threadlist"),status:$("connstatus"),istatus:0}).extend(updaterOptions || {})); if(!updaterOptions.havemenu) { togglemenu(); } diff --git a/src/messenger/webim/js/users.js b/src/messenger/webim/js/users.js index 20dc560d..b209f5e6 100644 --- a/src/messenger/webim/js/users.js +++ b/src/messenger/webim/js/users.js @@ -1 +1 @@ -sq.zh=mn.nn();mn.sn(sq.zh,sq.lq,{qn:function(pq){this.oq(pq);this.pq.onComplete=this.ft.on(this);this.pq.jr=this.gt.on(this);this.pq.hr=this._q.on(this);this.pq.timeout=(4693+307);this.frequency=(this.pq.frequency||2);this.at={} ;this._t();} ,gt:function(mu,nu){if(this.pq.ou)this.pq.ou("offline, reconnecting");this.ru();this.su=setTimeout(this._t.on(this),(832+168));} ,_q:function(mu){if(this.pq.ou)this.pq.ou("timeout, reconnecting");this.ru();this.su=setTimeout(this._t.on(this),01750);} ,ru:function(){if(this.at.pq)this.at.pq.onComplete=undefined;clearTimeout(this.su);} ,_t:function(){if(this.pq.$h)this.pq.fq=(this.pq.$h)();this.at=new sq.vq(this.pq.url,this.pq);} ,ft:function(fu){try{var ku=sq.uq(fu);if(ku){(this.pq.lu||sq.kq)(ku);} else{if(this.pq.ou)this.pq.ou("reconnecting");} } catch(e){} this.su=setTimeout(this._t.on(this),this.frequency*(704+296));} } );var _h={mi:function(link,title,ni,qi,width,height,ri){return''+qi+'';} ,si:function(content){return''+content+'
';} ,ti:function(ui,hi,id,ii,ji,ki,yt,li){var oi=2;var link=hi+"?thread="+id;var pi='';if(ji||ii){pi+=_h.mi((li||!ii)?link:link+"&viewonly=true",localized[ji?0:1],"ImCenter"+id,ui,(501+139),(295+185),null);} else{pi+=''+ui+'';} pi+='';if(ji){pi+='';pi+=_h.mi(link,localized[0],"ImCenter"+id,''+localized[0]+'',01200,(437+43),null);pi+='';oi++;} if(ii){pi+='';pi+=_h.mi(link+"&viewonly=true",localized[1],"ImCenter"+id,''+localized[1]+'',(485+155),(375+105),null);pi+='';oi++;} if(yt!=""){pi+='';pi+=yt.length>036?yt.substring(0,(19+11))+'...':yt;pi+='';} return _h.si(pi);} ,di:function(id,ei){return''+_h.mi(qh+'/operator/ban.php?'+(ei?'id='+ei:'thread='+id),localized[2],"ban"+id,''+localized[2]+'',01320,(417+63),null)+'';} } ;sq.fi=mn.nn();mn.sn(sq.fi,sq.lq,{qn:function(pq){this.oq(pq);this.pq.$h=this.$h.on(this);this.pq.ou=this.ou.on(this);this.pq.lu=this.lu.on(this);this.pq.gi=0;this.ai=new Object();this.bi=0;this.t=this.pq.ci;this.vi=new sq.zh(this.pq);} ,$h:function(){return"company="+this.pq.company+"&since="+this.pq.gi;} ,qu:function(du){this.pq.status.innerHTML=du;} ,ou:function(s){this.qu(s);} ,wi:function(ih){var id,xi,yi,ii=false,ji=false,zi=false,ki=null,ei=null;for(var i=0;i';if(ki!=null){hj=''+qs.rs(ih,"reason")+'';} if(zi){hj+=_h.di(id,ei);} hj=_h.si(hj);var ij=ls.os("t"+xi,this.t);var jj=ls.os("t"+xi+"end",this.t);if(mj!=null&&(mj.rowIndex<=ij.rowIndex||mj.rowIndex>=jj.rowIndex)){this.t.deleteRow(mj.rowIndex);this.ai[id]=null;mj=null;} if(mj==null){mj=this.t.insertRow(ij.rowIndex+1);mj.className=(ki=="blocked"&&xi!="chat")?"ban":"in"+xi;mj.id="thr"+id;this.ai[id]=new Array(sj,uj,xi);ls.insertCell(mj,"name","visitor",null,null,_h.ti(qj,this.pq.agentservl,id,ii,ji,ki,yt,xi!='chat'));ls.insertCell(mj,"contid","visitor","center",null,rj);ls.insertCell(mj,"state","visitor","center",null,yi);ls.insertCell(mj,"op","visitor","center",null,tj);ls.insertCell(mj,"time","visitor","center",null,this.kj(sj));ls.insertCell(mj,"wait","visitor","center",null,(xi!='chat'?this.kj(uj):'-'));ls.insertCell(mj,"etc","visitor","center",null,hj);if(xi=='wait'||xi=='prio')return true;} else{this.ai[id]=new Array(sj,uj,xi);mj.className=(ki=="blocked"&&xi!="chat")?"ban":"in"+xi;_i(this.t,mj,"name",_h.ti(qj,this.pq.agentservl,id,ii,ji,ki,yt,xi!='chat'));_i(this.t,mj,"contid",rj);_i(this.t,mj,"state",yi);_i(this.t,mj,"op",tj);_i(this.t,mj,"time",this.kj(sj));_i(this.t,mj,"wait",(xi!='chat'?this.kj(uj):'-'));_i(this.t,mj,"etc",hj);} return false;} ,lj:function(){function oj(t,id){var ij=$(id);var jj=$(id+"end");if(ij==null||jj==null){return false;} return ij.rowIndex+1=074){var bj=Math.floor(gj/(46+14));gj=gj%0x3c;if(gj<012)gj="0"+gj;aj=bj+":";} return aj+gj+":"+fj;} ,cj:function(){for(var i in this.ai){if(this.ai[i]!=null){var value=this.ai[i];var mj=ls.os("thr"+i,this.t);if(mj!=null){function _i(ds,mj,id,nj){var ws=ls.fs(id,mj,ds);if(ws)ws.innerHTML=nj;} _i(this.t,mj,"time",this.kj(value[0]));_i(this.t,mj,"wait",(value[2]!='chat'?this.kj(value[1]):'-'));} } } } ,lu:function(vj){var wj=false;if(vj.tagName=='threads'){var xj=qs.ks(vj,"time");var yj=qs.ks(vj,"revision");if(xj)this.bi=(new Date()).getTime()-xj;if(yj)this.pq.gi=yj;for(var i=0;i'+qi+'';} ,si:function(content){return''+content+'
';} ,ti:function(ui,hi,id,ii,ji,ki,yt,li){var oi=2;var link=hi+"?thread="+id;var pi='';if(ji||ii){pi+=_h.mi((li||!ii)?link:link+"&viewonly=true",localized[ji?0:1],"ImCenter"+id,ui,(501+139),(295+185),null);} else{pi+=''+ui+'';} pi+='';if(ji){pi+='';pi+=_h.mi(link,localized[0],"ImCenter"+id,''+localized[0]+'',01200,(437+43),null);pi+='';oi++;} if(ii){pi+='';pi+=_h.mi(link+"&viewonly=true",localized[1],"ImCenter"+id,''+localized[1]+'',(485+155),(375+105),null);pi+='';oi++;} if(yt!=""){pi+='';pi+=yt.length>036?yt.substring(0,(19+11))+'...':yt;pi+='';} return _h.si(pi);} ,di:function(id,ei){return''+_h.mi(qh+'/operator/ban.php?'+(ei?'id='+ei:'thread='+id),localized[2],"ban"+id,''+localized[2]+'',01320,(417+63),null)+'';} } ;sq.fi=mn.nn();mn.sn(sq.fi,sq.lq,{qn:function(pq){this.oq(pq);this.pq.$h=this.$h.on(this);this.pq.ou=this.ou.on(this);this.pq.lu=this.lu.on(this);this.pq.gi=0;this.ai=new Object();this.bi=0;this.t=this.pq.ci;this.vi=new sq.zh(this.pq);} ,$h:function(){return"since="+this.pq.gi+"&status="+this.pq.istatus;} ,qu:function(du){this.pq.status.innerHTML=du;} ,ou:function(s){this.qu(s);} ,wi:function(ih){var id,xi,yi,ii=false,ji=false,zi=false,ki=null,ei=null;for(var i=0;i';if(ki!=null){hj=''+qs.rs(ih,"reason")+'';} if(zi){hj+=_h.di(id,ei);} hj=_h.si(hj);var ij=ls.os("t"+xi,this.t);var jj=ls.os("t"+xi+"end",this.t);if(mj!=null&&(mj.rowIndex<=ij.rowIndex||mj.rowIndex>=jj.rowIndex)){this.t.deleteRow(mj.rowIndex);this.ai[id]=null;mj=null;} if(mj==null){mj=this.t.insertRow(ij.rowIndex+1);mj.className=(ki=="blocked"&&xi!="chat")?"ban":"in"+xi;mj.id="thr"+id;this.ai[id]=new Array(sj,uj,xi);ls.insertCell(mj,"name","visitor",null,null,_h.ti(qj,this.pq.agentservl,id,ii,ji,ki,yt,xi!='chat'));ls.insertCell(mj,"contid","visitor","center",null,rj);ls.insertCell(mj,"state","visitor","center",null,yi);ls.insertCell(mj,"op","visitor","center",null,tj);ls.insertCell(mj,"time","visitor","center",null,this.kj(sj));ls.insertCell(mj,"wait","visitor","center",null,(xi!='chat'?this.kj(uj):'-'));ls.insertCell(mj,"etc","visitor","center",null,hj);if(xi=='wait'||xi=='prio')return true;} else{this.ai[id]=new Array(sj,uj,xi);mj.className=(ki=="blocked"&&xi!="chat")?"ban":"in"+xi;_i(this.t,mj,"name",_h.ti(qj,this.pq.agentservl,id,ii,ji,ki,yt,xi!='chat'));_i(this.t,mj,"contid",rj);_i(this.t,mj,"state",yi);_i(this.t,mj,"op",tj);_i(this.t,mj,"time",this.kj(sj));_i(this.t,mj,"wait",(xi!='chat'?this.kj(uj):'-'));_i(this.t,mj,"etc",hj);} return false;} ,lj:function(){function oj(t,id){var ij=$(id);var jj=$(id+"end");if(ij==null||jj==null){return false;} return ij.rowIndex+1=074){var bj=Math.floor(gj/(46+14));gj=gj%0x3c;if(gj<012)gj="0"+gj;aj=bj+":";} return aj+gj+":"+fj;} ,cj:function(){for(var i in this.ai){if(this.ai[i]!=null){var value=this.ai[i];var mj=ls.os("thr"+i,this.t);if(mj!=null){function _i(ds,mj,id,nj){var ws=ls.fs(id,mj,ds);if(ws)ws.innerHTML=nj;} _i(this.t,mj,"time",this.kj(value[0]));_i(this.t,mj,"wait",(value[2]!='chat'?this.kj(value[1]):'-'));} } } } ,lu:function(vj){var wj=false;if(vj.tagName=='threads'){var xj=qs.ks(vj,"time");var yj=qs.ks(vj,"revision");if(xj)this.bi=(new Date()).getTime()-xj;if(yj)this.pq.gi=yj;for(var i=0;i $threadid, 'token' => $token); foreach($operators as $agent) { $params['nextAgent'] = $agent['operatorid']; - $online = $agent['time'] < $settings['online_timeout'] ? getlocal("char.redirect.operator.online_suff") : ""; + $status = $agent['time'] < $settings['online_timeout'] + ? ($agent['istatus'] == 0 + ? getlocal("char.redirect.operator.online_suff") + : getlocal("char.redirect.operator.away_suff") + ) + : ""; $agent_list .= "
  • ". topage(get_operator_name($agent)). - " $online
  • "; + " $status"; } $page['redirectToAgent'] = $agent_list; @@ -236,11 +243,15 @@ function setup_redirect_links($threadid,$token) { continue; } $params['nextGroup'] = $group['groupid']; - $online = $group['ilastseen'] < $settings['online_timeout'] ? getlocal("char.redirect.operator.online_suff") : ""; + $status = $group['ilastseen'] !== NULL && $group['ilastseen'] < $settings['online_timeout'] + ? getlocal("char.redirect.operator.online_suff") + : ($group['ilastseenaway'] !== NULL && $group['ilastseenaway'] < $settings['online_timeout'] + ? getlocal("char.redirect.operator.away_suff") + : ""); $group_list .= "
  • ". topage(get_group_name($group)). - " $online
  • "; + " $status"; } } $page['redirectToGroup'] = $group_list; @@ -279,17 +290,23 @@ function prepare_menu($operator,$hasright=true) { } } -function get_groups($link,$countagents, $checkonline=false) { +function get_all_groups($link) { + $query = "select chatgroup.groupid as groupid, vclocalname, vclocaldescription from chatgroup order by vclocalname"; + return select_multi_assoc($query, $link); +} + +function get_groups($link,$checkaway) { $query = "select chatgroup.groupid as groupid, vclocalname, vclocaldescription". - ($countagents - ? ", (SELECT count(*) from chatgroupoperator where chatgroup.groupid = chatgroupoperator.groupid) as inumofagents" - : ""). - ($checkonline - ? ", (SELECT min(unix_timestamp(CURRENT_TIMESTAMP)-unix_timestamp(dtmlastvisited)) as time ". - "from chatgroupoperator, chatoperator where chatgroup.groupid = chatgroupoperator.groupid ". - "and chatgroupoperator.operatorid = chatoperator.operatorid) as ilastseen" - : ""). - + ", (SELECT count(*) from chatgroupoperator where chatgroup.groupid = chatgroupoperator.groupid) as inumofagents". + ", (SELECT min(unix_timestamp(CURRENT_TIMESTAMP)-unix_timestamp(dtmlastvisited)) as time ". + "from chatgroupoperator, chatoperator where istatus = 0 and chatgroup.groupid = chatgroupoperator.groupid ". + "and chatgroupoperator.operatorid = chatoperator.operatorid) as ilastseen". + ($checkaway + ? ", (SELECT min(unix_timestamp(CURRENT_TIMESTAMP)-unix_timestamp(dtmlastvisited)) as time ". + "from chatgroupoperator, chatoperator where istatus <> 0 and chatgroup.groupid = chatgroupoperator.groupid ". + "and chatgroupoperator.operatorid = chatoperator.operatorid) as ilastseenaway" + : "" + ). " from chatgroup order by vclocalname"; return select_multi_assoc($query, $link); } diff --git a/src/messenger/webim/locales/en/properties b/src/messenger/webim/locales/en/properties index d940cb7f..b5a46705 100644 --- a/src/messenger/webim/locales/en/properties +++ b/src/messenger/webim/locales/en/properties @@ -29,6 +29,7 @@ cannededit.title=Edit Message cannednew.descr=Add new message. cannednew.title=New Message char.redirect.operator.online_suff=(online) +char.redirect.operator.away_suff=(away) chat.came.from=Vistor came from page {0} chat.client.changename=Change name chat.client.name=You are @@ -292,6 +293,7 @@ page_agents.agents=Full list of operators: page_agents.confirm=Are you sure that you want to delete operator "{0}"? page_agents.intro=This page displays a list of company operators. page_agents.isonline=Online +page_agents.isaway=Away page_agents.login=Login page_agents.new_agent=Add operator... page_agents.status=Last active @@ -325,7 +327,9 @@ page_settings.tab.main=General page_settings.tab.themes=Themes preview pending.menu.hide=Hide menu >> pending.menu.show=Show menu >> -pending.popup_notification=New visitor is waiting for an answer. +pending.popup_notification=New visitor is waiting for an answer. +pending.status.setaway=Set "Away" status +pending.status.setonline=Set "Available" status pending.table.ban=Ban the visitor pending.table.head.contactid=Visitor's address pending.table.head.etc=Misc diff --git a/src/messenger/webim/operator/canned.php b/src/messenger/webim/operator/canned.php index 2aaa0d5d..d5e663c1 100644 --- a/src/messenger/webim/operator/canned.php +++ b/src/messenger/webim/operator/canned.php @@ -82,7 +82,7 @@ if($settings['enablegroups'] == '1') { } $link = connect(); - $allgroups = get_groups($link, false); + $allgroups = get_all_groups($link); mysql_close($link); $page['groups'] = array(); $page['groups'][] = array('groupid' => '', 'vclocalname' => getlocal("page.gen_button.default_group")); diff --git a/src/messenger/webim/operator/getcode.php b/src/messenger/webim/operator/getcode.php index a6705fcd..c46a8c8b 100644 --- a/src/messenger/webim/operator/getcode.php +++ b/src/messenger/webim/operator/getcode.php @@ -93,7 +93,7 @@ $page['availableStyles'] = $stylelist; if($settings['enablegroups'] == '1') { $link = connect(); - $allgroups = get_groups($link,false); + $allgroups = get_all_groups($link); mysql_close($link); $page['groups'] = array(); $page['groups'][] = array('groupid' => '', 'vclocalname' => getlocal("page.gen_button.default_group")); diff --git a/src/messenger/webim/operator/groups.php b/src/messenger/webim/operator/groups.php index c218814f..1dde3a21 100644 --- a/src/messenger/webim/operator/groups.php +++ b/src/messenger/webim/operator/groups.php @@ -42,12 +42,18 @@ if( isset($_GET['act']) && $_GET['act'] == 'del' ) { function is_online($group) { global $settings; - return $group['ilastseen'] && $group['ilastseen'] < $settings['online_timeout'] ? "1" : ""; + return $group['ilastseen'] !== NULL && $group['ilastseen'] < $settings['online_timeout'] ? "1" : ""; } +function is_away($group) { + global $settings; + return $group['ilastseenaway'] !== NULL && $group['ilastseenaway'] < $settings['online_timeout'] ? "1" : ""; +} + + $page = array(); $link = connect(); -$page['groups'] = get_groups($link, true, true); +$page['groups'] = get_groups($link, true); mysql_close($link); $page['canmodify'] = is_capable($can_administrate, $operator); diff --git a/src/messenger/webim/operator/operators.php b/src/messenger/webim/operator/operators.php index 69cf95ea..9dbeb966 100644 --- a/src/messenger/webim/operator/operators.php +++ b/src/messenger/webim/operator/operators.php @@ -54,13 +54,18 @@ if( isset($_GET['act']) && $_GET['act'] == 'del' ) { function is_online($operator) { global $settings; - return $operator['time'] < $settings['online_timeout'] ? "1" : ""; + return $operator['istatus'] == 0 && $operator['time'] < $settings['online_timeout'] ? "1" : ""; +} + +function is_away($operator) { + global $settings; + return $operator['istatus'] != 0 && $operator['time'] < $settings['online_timeout'] ? "1" : ""; } function get_operators() { $link = connect(); - $query = "select operatorid, vclogin, vclocalename, vccommonname, (unix_timestamp(CURRENT_TIMESTAMP)-unix_timestamp(dtmlastvisited)) as time ". + $query = "select operatorid, vclogin, vclocalename, vccommonname, istatus, (unix_timestamp(CURRENT_TIMESTAMP)-unix_timestamp(dtmlastvisited)) as time ". "from chatoperator order by vclogin"; $operators = select_multi_assoc($query, $link); mysql_close($link); diff --git a/src/messenger/webim/operator/opgroups.php b/src/messenger/webim/operator/opgroups.php index 64fb04de..6c088787 100644 --- a/src/messenger/webim/operator/opgroups.php +++ b/src/messenger/webim/operator/opgroups.php @@ -31,7 +31,7 @@ function update_operator_groups($operatorid,$newvalue) { $opId = verifyparam( "op","/^\d{1,9}$/"); $page = array('opid' => $opId); $link = connect(); -$page['groups'] = get_groups($link, false); +$page['groups'] = get_all_groups($link); mysql_close($link); $errors = array(); diff --git a/src/messenger/webim/operator/update.php b/src/messenger/webim/operator/update.php index 9bf1f229..c27053cf 100644 --- a/src/messenger/webim/operator/update.php +++ b/src/messenger/webim/operator/update.php @@ -141,11 +141,12 @@ function print_pending_threads($groupids,$since) { } $since = verifyparam( "since", "/^\d{1,9}$/", 0); +$status = verifyparam( "status", "/^\d{1,2}$/", 0); loadsettings(); $groupids = $_SESSION['operatorgroups']; print_pending_threads($groupids,$since); -notify_operator_alive($operator['operatorid']); +notify_operator_alive($operator['operatorid'], $status); exit; ?> diff --git a/src/messenger/webim/operator/users.php b/src/messenger/webim/operator/users.php index 96a251b5..bf9aa913 100644 --- a/src/messenger/webim/operator/users.php +++ b/src/messenger/webim/operator/users.php @@ -16,8 +16,9 @@ require_once('../libs/common.php'); require_once('../libs/operator.php'); $operator = check_login(); +$status = isset($_GET['away']) ? 1 : 0; -notify_operator_alive($operator['operatorid']); +notify_operator_alive($operator['operatorid'], $status); loadsettings(); if($settings['enablegroups'] == '1') { @@ -37,6 +38,7 @@ $page = array(); $page['havemenu'] = isset($_GET['nomenu']) ? "0" : "1"; $page['showpopup'] = $settings['enablepopupnotification'] == '1' ? "1" : "0"; $page['frequency'] = $settings['updatefrequency_operator']; +$page['istatus'] = $status; prepare_menu($operator); start_html_output(); diff --git a/src/messenger/webim/view/agents.php b/src/messenger/webim/view/agents.php index 47e3c58a..ac2e4a94 100644 --- a/src/messenger/webim/view/agents.php +++ b/src/messenger/webim/view/agents.php @@ -71,6 +71,8 @@ require_once('inc_errors.php'); + + diff --git a/src/messenger/webim/view/groups.php b/src/messenger/webim/view/groups.php index a07e1cbf..7570ddd7 100644 --- a/src/messenger/webim/view/groups.php +++ b/src/messenger/webim/view/groups.php @@ -75,6 +75,8 @@ if(count($page['groups']) > 0) { + + diff --git a/src/messenger/webim/view/pending_users.php b/src/messenger/webim/view/pending_users.php index 11489930..a24fd446 100644 --- a/src/messenger/webim/view/pending_users.php +++ b/src/messenger/webim/view/pending_users.php @@ -31,7 +31,7 @@ var localized = new Array( ); var updaterOptions = { url:"/operator/update.php",wroot:"", - agentservl:"/operator/agent.php", frequency:, + agentservl:"/operator/agent.php", frequency:, istatus:, noclients:"", havemenu: , showpopup: }; //--> @@ -81,7 +81,13 @@ function tpl_content() { global $page, $webimroot;
    - +