diff --git a/src/webim/client.php b/src/webim/client.php index 6e632adf..e2e7a35a 100644 --- a/src/webim/client.php +++ b/src/webim/client.php @@ -29,7 +29,11 @@ if( !isset($_GET['token']) || !isset($_GET['thread']) ) { $thread = create_thread($userName, $remote, $referer,$current_locale); $_SESSION['threadid'] = $thread['threadid']; + if( $referer ) { + post_message($thread['threadid'],$kind_for_agent,getstring2('chat.came.from',array($referer))); + } post_message($thread['threadid'],$kind_info,getstring('chat.wait')); + } $threadid = $thread['threadid']; $token = $thread['ltoken']; @@ -52,7 +56,7 @@ if( !$thread || !isset($thread['ltoken']) || $token != $thread['ltoken'] ) { setup_chatview_for_user($thread, $level); start_html_output(); -$pparam = verifyparam( "page", "/^(mailthread)$/", "default"); +$pparam = verifyparam( "act", "/^(mailthread)$/", "default"); if( $pparam == "mailthread" ) { require('view/chat_mailthread.php'); } else if( $level == "ajaxed" ) { diff --git a/src/webim/install/index.php b/src/webim/install/index.php index 6ee0cc8f..0e4f02df 100644 --- a/src/webim/install/index.php +++ b/src/webim/install/index.php @@ -13,6 +13,7 @@ */ require('../libs/common.php'); -require('view_index.php'); -?> \ No newline at end of file +start_html_output(); +require('view_index.php'); +?> diff --git a/src/webim/install/install.php b/src/webim/install/install.php index 1e0f3378..b47e3929 100644 --- a/src/webim/install/install.php +++ b/src/webim/install/install.php @@ -84,6 +84,7 @@ function create_tables() { drop_tables(); create_tables(); +start_html_output(); require('view_install.php'); ?> \ No newline at end of file diff --git a/src/webim/libs/chat.php b/src/webim/libs/chat.php index 02acfb8d..d070bf6a 100644 --- a/src/webim/libs/chat.php +++ b/src/webim/libs/chat.php @@ -10,8 +10,11 @@ * * Contributors: * Evgeny Gryaznov - initial API and implementation + * Pavel Petroshenko - history search */ +$connection_timeout = 30; # sec + $namecookie = "WEBIM_Name"; $state_queue = 0; @@ -21,13 +24,16 @@ $state_closed = 3; $kind_user = 1; $kind_agent = 2; +$kind_for_agent = 3; $kind_info = 4; $kind_conn = 5; $kind_events = 6; -$kind_to_string = array( $kind_user => "user", $kind_agent => "agent", +$kind_to_string = array( $kind_user => "user", $kind_agent => "agent", $kind_for_agent => "hidden", $kind_info => "inf", $kind_conn => "conn", $kind_events => "event" ); + + function next_token() { return rand(99999,99999999); } @@ -38,17 +44,21 @@ function next_revision($link) { return $val; } -function post_message($threadid,$kind,$message,$from=null) { - $link = connect(); - +function post_message_($threadid,$kind,$message,$link,$from=null,$time=null) { $query = sprintf( - "insert into chatmessage (threadid,ikind,tmessage,tname,dtmcreated) values (%s, %s,'%s',%s,CURRENT_TIMESTAMP)", + "insert into chatmessage (threadid,ikind,tmessage,tname,dtmcreated) values (%s, %s,'%s',%s,%s)", $threadid, $kind, mysql_real_escape_string($message), - $from ? "'".mysql_real_escape_string($from)."'" : "null" ); + $from ? "'".mysql_real_escape_string($from)."'" : "null", + $time ? "FROM_UNIXTIME($time)" : "CURRENT_TIMESTAMP" ); perform_query($query,$link); +} + +function post_message($threadid,$kind,$message,$from=null) { + $link = connect(); + post_message_($threadid,$kind,$message,$link,$from); mysql_close($link); } @@ -84,13 +94,14 @@ function message_to_text($msg) { } } -function get_messages($threadid,$meth,&$lastid) { +function get_messages($threadid,$meth,$isuser,&$lastid) { + global $kind_for_agent; $link = connect(); $query = sprintf( "select messageid,ikind,unix_timestamp(dtmcreated) as created,tname,tmessage from chatmessage ". - "where threadid = %s and messageid > %s order by messageid", - $threadid, $lastid ); + "where threadid = %s and messageid > %s %s order by messageid", + $threadid, $lastid, $isuser ? "and ikind <> $kind_for_agent" : "" ); $messages = array(); $result = mysql_query($query,$link) or die(' Query failed: ' .mysql_error().": ".$query); @@ -109,7 +120,7 @@ function get_messages($threadid,$meth,&$lastid) { function print_thread_mesages($threadid, $token, $lastid, $isuser,$format) { global $webim_encoding, $webimroot; - $output = get_messages( $threadid, "html", $lastid ); + $output = get_messages($threadid,"html",$isuser,$lastid); if( $format == "xml" ) { start_xml_output(); @@ -162,7 +173,7 @@ function setup_chatview_for_user($thread,$level) { } function setup_chatview_for_operator($thread) { - global $page; + global $page, $webimroot; $page = array(); $page['agent'] = true; $page['user'] = false; @@ -172,6 +183,9 @@ function setup_chatview_for_operator($thread) { $page['ct.user.name'] = $thread['userName']; $page['ct.company.name'] = "Test company"; $page['ct.company.chatLogoURL'] = ""; + + // TODO + $page['namePostfix'] = ""; } function is_ajax_browser($name,$ver,$useragent) { @@ -221,19 +235,55 @@ function get_remote_level($useragent) { return "simple"; } -function ping_thread($thread, $isuser) { - $link = connect(); - $query = sprintf( - "update chatthread set %s = CURRENT_TIMESTAMP where threadid = %s", - $isuser ? "lastpinguser" : "lastpingagent", - $thread['threadid']); +function update_thread_access($threadid, $params, $link) { + $clause = ""; + foreach( $params as $k => $v ) { + if( strlen($clause) > 0 ) + $clause .= ", "; + $clause .= $k."=".$v; + } + perform_query( + "update chatthread set $clause ". + "where threadid = ".$threadid,$link); +} - perform_query($query,$link); +function get_access_time($threadid, $isuser, $link) { + return select_one_row(sprintf( + "select unix_timestamp(%s) as lastping, ". + "unix_timestamp(CURRENT_TIMESTAMP) as current ". + "from chatthread where threadid = %s", + $isuser ? "lastpinguser" : "lastpingagent", + $threadid), $link); +} + +function ping_thread($thread, $isuser) { + global $kind_for_agent, $state_chatting, $state_waiting, $kind_conn, $connection_timeout; + $link = connect(); + $params = array(($isuser ? "lastpinguser" : "lastpingagent") => "CURRENT_TIMESTAMP" ); + + $access = get_access_time($thread['threadid'], !$isuser, $link); + if( $access['lastping'] > 0 && abs($access['current']-$access['lastping']) > $connection_timeout ) { + $params[$isuser ? "lastpingagent" : "lastpinguser"] = "0"; + if( !$isuser ) { + $message_to_post = getstring_("chat.status.user.dead", $thread['locale']); + post_message_($thread['threadid'],$kind_for_agent,$message_to_post,$link,null,$access['lastping']+$connection_timeout); + } else if( $thread['istate'] == $state_chatting ) { + + $message_to_post = getstring_("chat.status.operator.dead", $thread['locale']); + post_message_($thread['threadid'],$kind_conn,$message_to_post,$link,null,$access['lastping']+$connection_timeout); + $params['istate'] = $state_waiting; + commit_thread($thread['threadid'], $params, $link); + mysql_close($link); + return; + } + } + + update_thread_access($thread['threadid'], $params, $link); mysql_close($link); } function commit_thread($threadid,$params,$link) { - $query = "update chatthread set lrevision = ".next_revision($link); + $query = "update chatthread set lrevision = ".next_revision($link).", dtmmodified = CURRENT_TIMESTAMP"; foreach( $params as $k => $v ) { $query .= ", ".$k."=".$v; } @@ -273,7 +323,7 @@ function create_thread($username,$remote,$referer,$lang) { $link = connect(); $query = sprintf( - "insert into chatthread (userName,ltoken,remote,referer,lrevision,locale,dtmcreated,dtmmodified) values ('%s',%s,'%s','%s',%s,'%s',CURRENT_TIMESTAMP,CURRENT_TIMESTAMP)", + "insert into chatthread (userName,"."ltoken,remote,referer,lrevision,locale,dtmcreated,dtmmodified) values ('%s','%s',%s,'%s','%s',%s,'%s',CURRENT_TIMESTAMP,CURRENT_TIMESTAMP)", mysql_real_escape_string($username), next_token(), mysql_real_escape_string($remote), @@ -289,26 +339,29 @@ function create_thread($username,$remote,$referer,$lang) { return $newthread; } -function do_take_thread($threadid,$operator) { +function do_take_thread($threadid,$operatorName) { global $state_chatting; $link = connect(); commit_thread( $threadid, array("istate" => $state_chatting, - "agentName" => "'".mysql_real_escape_string($operator)."'"), $link); + "agentName" => "'".mysql_real_escape_string($operatorName)."'"), $link); mysql_close($link); } function reopen_thread($threadid) { - global $state_queue,$state_waiting,$state_chatting,$kind_events; + global $state_queue,$state_waiting,$state_chatting,$state_closed,$kind_events; $thread = thread_by_id($threadid); if( !$thread ) return FALSE; + if( $thread['istate'] == $state_closed ) + return FALSE; + if( $thread['istate'] != $state_chatting && $thread['istate'] != $state_queue ) { $link = connect(); commit_thread( $threadid, - array("istate" => $state_waiting), $link); + array("istate" => $state_waiting ), $link); mysql_close($link); } @@ -317,20 +370,26 @@ function reopen_thread($threadid) { } function take_thread($thread,$operator) { - global $state_queue, $state_waiting, - $state_chatting, $kind_events; + global $state_queue, $state_waiting, $state_chatting, $kind_events, $home_locale; $state = $thread['istate']; $threadid = $thread['threadid']; $message_to_post = ""; + $operatorName = ($thread['locale'] == $home_locale) ? $operator['vclocalename'] : $operator['vccommonname']; + if( $state == $state_queue || $state == $state_waiting) { - do_take_thread($threadid, $operator); - $message_to_post = getstring2_("chat.status.operator.joined", array($operator), $thread['locale']); + do_take_thread($threadid, $operatorName); + + if( $state == $state_waiting ) { + $message_to_post = getstring2_("chat.status.operator.changed", array($operatorName,$thread['agentName']), $thread['locale']); + } else { + $message_to_post = getstring2_("chat.status.operator.joined", array($operatorName), $thread['locale']); + } } else if( $state == $state_chatting ) { - if( $operator != $thread['agentName'] ) { - do_take_thread($threadid, $operator); - $message_to_post = getstring2_("chat.status.operator.changed", array($operator, $thread['agentName']), $thread['locale']); + if( $operatorName != $thread['agentName'] ) { + do_take_thread($threadid, $operatorName); + $message_to_post = getstring2_("chat.status.operator.changed", array($operatorName, $thread['agentName']), $thread['locale']); } } else { die("cannot take thread"); @@ -340,6 +399,17 @@ function take_thread($thread,$operator) { post_message($threadid,$kind_events,$message_to_post); } +function check_for_reassign($thread,$operator) { + global $state_waiting, $home_locale, $kind_events; + $operatorName = ($thread['locale'] == $home_locale) ? $operator['vclocalename'] : $operator['vccommonname']; + if( $thread['istate'] == $state_waiting && + ( $thread['agentName'] == $operatorName )) { + do_take_thread($thread['threadid'], $operatorName); + $message_to_post = getstring2_("chat.status.operator.changed", array($operatorName,$thread['agentName']), $thread['locale']); + post_message($thread['threadid'],$kind_events,$message_to_post); + } +} + function thread_by_id($id) { $link = connect(); $thread = select_one_row("select * from chatthread where threadid = ". $id, $link ); diff --git a/src/webim/libs/operator.php b/src/webim/libs/operator.php index d2a944db..29cbe48e 100644 --- a/src/webim/libs/operator.php +++ b/src/webim/libs/operator.php @@ -15,7 +15,19 @@ function operator_by_login($login) { $link = connect(); $operator = select_one_row( - "select * from chatoperator where vclogin = '".mysql_real_escape_string($login)."'", $link ); + "select * from chatoperator where vclogin = '".mysql_real_escape_string($login)."'", $link ); + mysql_close($link); + return $operator; +} + +function operator_by_id_($id,$link) { + return select_one_row( + "select * from chatoperator where operatorid = $id", $link ); +} + +function operator_by_id($id) { + $link = connect(); + $operator = operator_by_id_($id,$link); mysql_close($link); return $operator; } diff --git a/src/webim/libs/pagination.php b/src/webim/libs/pagination.php index 52a6fa0e..627de9cf 100644 --- a/src/webim/libs/pagination.php +++ b/src/webim/libs/pagination.php @@ -27,11 +27,11 @@ function generate_pagination_image($id) { return ""; } -function setup_pagination($items) { +function setup_pagination($items,$default_items_per_page=15) { global $page; if( $items ) { - $items_per_page = verifyparam("items", "/^\d{1,3}$/", 2); + $items_per_page = verifyparam("items", "/^\d{1,3}$/", $default_items_per_page); if( $items_per_page < 2 ) $items_per_page = 2; diff --git a/src/webim/mail.php b/src/webim/mail.php index 1f3b0120..89fffbb4 100644 --- a/src/webim/mail.php +++ b/src/webim/mail.php @@ -30,7 +30,7 @@ $page['email'] = $mail; $history = ""; $lastid = -1; -$output = get_messages( $threadid, "text", $lastid ); +$output = get_messages( $threadid,"text",true,$lastid ); foreach( $output as $msg ) { $history .= $msg; } diff --git a/src/webim/operator/agent.php b/src/webim/operator/agent.php index 471dd790..04e16d45 100644 --- a/src/webim/operator/agent.php +++ b/src/webim/operator/agent.php @@ -31,9 +31,7 @@ if( !isset($_GET['token']) ) { die("wrong thread"); } - $operatorName = ($thread['locale'] == $home_locale) ? $operator['vclocalename'] : $operator['vccommonname']; - - take_thread($thread,$operatorName); + take_thread($thread,$operator); $token = $thread['ltoken']; header("Location: ".$_SERVER['PHP_SELF']."?thread=$threadid&token=$token"); @@ -50,6 +48,8 @@ if( !$thread || !isset($thread['ltoken']) || $token != $thread['ltoken'] ) { setup_chatview_for_operator($thread); start_html_output(); -require('../view/chat_ajaxed.php'); + + + require('../view/chat_ajaxed.php'); ?> \ No newline at end of file diff --git a/src/webim/operator/history.php b/src/webim/operator/history.php new file mode 100644 index 00000000..052a4b91 --- /dev/null +++ b/src/webim/operator/history.php @@ -0,0 +1,55 @@ + get_operator_name($operator) ); +$query = isset($_GET['q']) ? $_GET['q'] : false; + +if($query !== false) { + $link = connect(); + + $result = mysql_query( + "select DISTINCT unix_timestamp(chatthread.dtmcreated) as created, ". + "unix_timestamp(chatthread.dtmmodified) as modified, chatthread.threadid, ". + "chatthread.remote, chatthread.agentName, chatthread.userName ". + "from chatthread, chatmessage ". + "where chatmessage.threadid = chatthread.threadid and ". + "((chatthread.userName LIKE '%%$query%%') or ". + " (chatmessage.tmessage LIKE '%%$query%%'))". + "order by created DESC", $link) + or die(' Query failed: ' .mysql_error().": ".$query); + + $foundThreads = array(); + while ($thread = mysql_fetch_array($result, MYSQL_ASSOC)) { + $foundThreads[] = $thread; + } + + mysql_free_result($result); + mysql_close($link); + + $page['formq'] = $query; + setup_pagination($foundThreads); +} else { + setup_empty_pagination(); +} + +start_html_output(); +require('../view/thread_search.php'); +?> \ No newline at end of file diff --git a/src/webim/operator/index.php b/src/webim/operator/index.php index 0f82d3e0..7cb3c7f4 100644 --- a/src/webim/operator/index.php +++ b/src/webim/operator/index.php @@ -17,7 +17,22 @@ require('../libs/operator.php'); $operator = check_login(); -$page = array( 'operator' => get_operator_name($operator) ); +$page = array( + 'operator' => get_operator_name($operator), + 'version' => 'v1.0.7' +); + +$localeLinks = ""; +foreach($available_locales as $k) { + if( strlen($localeLinks) > 0 ) + $localeLinks .= " • "; + if( $k == $current_locale ) + $localeLinks .= $k; + else + $localeLinks .= "$k"; +} + +$page['localeLinks'] = $localeLinks; start_html_output(); require('../view/menu.php'); diff --git a/src/webim/operator/threadprocessor.php b/src/webim/operator/threadprocessor.php new file mode 100644 index 00000000..e87d88ec --- /dev/null +++ b/src/webim/operator/threadprocessor.php @@ -0,0 +1,32 @@ + get_operator_name($operator) ); + + +if( isset($_GET['threadid'])) { + $threadid = verifyparam( "threadid", "/^(\d{1,9})?$/", ""); + $lastid = -1; + $page['threadMessages'] = get_messages($threadid,"html",false,$lastid); +} + +start_html_output(); +require('../view/thread_log.php'); +?> \ No newline at end of file diff --git a/src/webim/operator/update.php b/src/webim/operator/update.php index 67fbf8e7..d92393c7 100644 --- a/src/webim/operator/update.php +++ b/src/webim/operator/update.php @@ -45,10 +45,12 @@ function thread_to_xml($thread) { return $result."/>"; $state = getstring($threadstate_key[$thread['istate']]); + $threadoperator = ($thread['agentName'] ? $thread['agentName'] : "-"); + $result .= " canopen=\"true\" state=\"$state\">"; $result .= "".htmlspecialchars($thread['userName']).""; $result .= "".htmlspecialchars($thread['remote']).""; - $result .= "".htmlspecialchars($thread['agentName'] ? $thread['agentName'] : "-").""; + $result .= "".htmlspecialchars($threadoperator).""; $result .= ""; $result .= "".$thread['unix_timestamp(dtmmodified)']."000"; $result .= ""; @@ -61,7 +63,9 @@ function print_pending_threads($since) { $revision = $since; $output = array(); - $query = "select threadid, userName, agentName, unix_timestamp(dtmcreated), unix_timestamp(dtmmodified), lrevision, istate, remote from chatthread where lrevision > $since ORDER BY threadid"; + $query = "select threadid, userName, agentName, unix_timestamp(dtmcreated), ". + "unix_timestamp(dtmmodified), lrevision, istate, remote ". + "from chatthread where lrevision > $since ORDER BY threadid"; $result = mysql_query($query,$link) or die(' Query failed: ' .mysql_error().": ".$query); while ($row = mysql_fetch_array($result, MYSQL_ASSOC)) { diff --git a/src/webim/thread.php b/src/webim/thread.php index 905830c4..32c4aabe 100644 --- a/src/webim/thread.php +++ b/src/webim/thread.php @@ -14,6 +14,7 @@ require('libs/common.php'); require('libs/chat.php'); +require('libs/operator.php'); $act = verifyparam( "act", "/^(refresh|post|rename|close|ping)$/"); $token = verifyparam( "token", "/^\d{1,9}$/"); @@ -26,9 +27,18 @@ if( !$thread || !isset($thread['ltoken']) || $token != $thread['ltoken'] ) { die("wrong thread"); } +# This code helps in simulation of operator connection problems +# if( !$isuser ) die("error"); + +ping_thread($thread, $isuser); + +if( !$isuser && $act != "rename" ) { + $operator = check_login(); + check_for_reassign($thread,$operator); +} + if( $act == "refresh" ) { $lastid = verifyparam( "lastid", "/^\d{1,9}$/", -1); - ping_thread($thread, $isuser); print_thread_mesages($threadid, $token, $lastid, $isuser,$outformat); exit; @@ -40,14 +50,12 @@ if( $act == "refresh" ) { $from = $isuser ? $thread['userName'] : $thread['agentName']; post_message($threadid,$kind,$message,$from); - ping_thread($thread, $isuser); print_thread_mesages($threadid, $token, $lastid, $isuser, $outformat); exit; } else if( $act == "rename" ) { $newname = getrawparam('name'); - ping_thread($thread, $isuser); rename_user($thread, $newname); setcookie($namecookie, $newname, time()+60*60*24*365); start_xml_output(); @@ -56,14 +64,12 @@ if( $act == "refresh" ) { } else if( $act == "ping" ) { - ping_thread($thread, $isuser); start_xml_output(); echo ""; exit; } else if( $act == "close" ) { - ping_thread($thread, $isuser); close_thread($thread, $isuser); start_xml_output(); echo ""; diff --git a/src/webim/view/chat_ajaxed.php b/src/webim/view/chat_ajaxed.php index 56d06161..6388f79b 100644 --- a/src/webim/view/chat_ajaxed.php +++ b/src/webim/view/chat_ajaxed.php @@ -87,7 +87,7 @@ var threadParams = { servl:"/webim/thread.php",frequency:2, - ">
+ ">
@@ -120,8 +120,9 @@ var threadParams = { servl:"/webim/thread.php",frequency:2, - " onclick="this.newWindow = window.open('&page=mailthread', 'ForwardMail', 'toolbar=0,scrollbars=0,location=0,statusbar=1,menubar=0,width=603,height=204,resizable=0');this.newWindow.focus();this.newWindow.opener=window;return false;">Mail  + " onclick="this.newWindow = window.open('&act=mailthread', 'ForwardMail', 'toolbar=0,scrollbars=0,location=0,statusbar=1,menubar=0,width=603,height=204,resizable=0');this.newWindow.focus();this.newWindow.opener=window;return false;">Mail  + "> Refresh  @@ -248,3 +249,4 @@ var threadParams = { servl:"/webim/thread.php",frequency:2, + diff --git a/src/webim/view/chat_simple.php b/src/webim/view/chat_simple.php index 934ace01..d5d1376f 100644 --- a/src/webim/view/chat_simple.php +++ b/src/webim/view/chat_simple.php @@ -89,7 +89,7 @@ - " onclick="this.newWindow = window.open('&page=mailthread', 'ForwardMail', 'toolbar=0,scrollbars=0,location=0,statusbar=1,menubar=0,width=603,height=204,resizable=0');this.newWindow.focus();this.newWindow.opener=window;return false;">Mail + " onclick="this.newWindow = window.open('&act=mailthread', 'ForwardMail', 'toolbar=0,scrollbars=0,location=0,statusbar=1,menubar=0,width=603,height=204,resizable=0');this.newWindow.focus();this.newWindow.opener=window;return false;">Mail "> Refresh diff --git a/src/webim/view/menu.php b/src/webim/view/menu.php index 7e45b2cf..945292cd 100644 --- a/src/webim/view/menu.php +++ b/src/webim/view/menu.php @@ -58,10 +58,27 @@





+ +





+ + + + + + + + + + + +
+ +Web Messenger/ + diff --git a/src/webim/view/properties_en b/src/webim/view/properties_en index 79aabaeb..1948eebc 100644 --- a/src/webim/view/properties_en +++ b/src/webim/view/properties_en @@ -26,6 +26,8 @@ chat.client.name=Your name: chat.client.changename=Change name chat.status.operator.left=Operator {0} left the chat chat.status.user.left=Visitor {0} left the chat +chat.status.user.dead=Visitor closed chat window +chat.status.operator.dead=Operator has connection issues, we temporarily moved you to foreground queue. Sorry for keeping you waiting. chat.status.operator.joined=Operator {0} joined the chat chat.status.user.changedname=Visitor changed the name {0} to {1} chat.status.user.reopenedthread=Visitor joined chat again @@ -67,6 +69,14 @@ pending.table.head.etc=Misc pending.table.speak=Click to chat with the visitor pending.table.view=Watch the chat pending.table.ban=Ban the visitor +thread.chat_log=Chat log +thread.back_to_search=Go to search +thread.intro=The page displays chat +page_analysis.search.title=Chats history +page.analysis.search.head_name=Name +page.analysis.search.head_host=Visitor's address +page.analysis.search.head_operator=Operator +page.analysis.search.head_time=Time in chat common.asterisk_explanation=* - mandatory fields page_agents.title=Agents page_agents.agents=Agents full list: @@ -108,10 +118,16 @@ form.field.password=Password form.field.password.description= button.enter=Enter button.save=Save +button.search=Search +tag.pagination.info=Page {0} of {1}, {2}-{3} from {4} +tag.pagination.no_items=Found 0 elements image.chat.history=/webim/images/en/history.gif image.chat.message=/webim/images/en/message.gif image.button.login=/webim/images/en/login.gif image.button.save=/webim/images/en/save.gif +image.button.search=/webim/images/en/search.gif +chat.came.from=Vistor came from page {0} +content.history=Search the dialogs history content.logoff=Log out of the system. form.field.agent_commonname=International name (Latin) form.field.agent_commonname.description=This name will be seen by your visitors @@ -128,3 +144,5 @@ menu.operator=You are {0} no_such_operator=No such operator page_agent.create_new=Here you can create new operator page_agents.agent_commonname=International name +page_analysis.full.text.search=User name or message text search: +page_search.intro=Search for chat history of a specified user or a specified phrase in a message. diff --git a/src/webim/view/properties_ru b/src/webim/view/properties_ru index 919d3427..486ec4fe 100644 --- a/src/webim/view/properties_ru +++ b/src/webim/view/properties_ru @@ -26,6 +26,8 @@ chat.client.name= chat.client.changename=Изменить имя chat.status.operator.left=Оператор {0} покинул диалог chat.status.user.left=Посетитель {0} покинул диалог +chat.status.user.dead=Посетитель закрыл окно диалога +chat.status.operator.dead=У оператора возникли проблемы со связью, мы временно перевели Вас в приоритетную очередь. Приносим извинения за Ваше ожидание. chat.status.operator.joined=Оператор {0} включился в разговор chat.status.user.changedname=Посетитель сменил имя {0} на {1} chat.status.user.reopenedthread=Посетитель заново вошел в диалог @@ -67,6 +69,14 @@ pending.table.head.etc= pending.table.speak=Нажмите для того, чтобы обслужить посетителя pending.table.view=Подключиться к диалогу в режиме просмотра pending.table.ban=Пометить посетителя как нежелательного +thread.chat_log=Протокол разговора +thread.back_to_search=Перейти в поиск +thread.intro=На данной странице Вы можете просмотреть диалог. +page_analysis.search.title=История диалогов +page.analysis.search.head_name=Имя +page.analysis.search.head_host=Адрес посетителя +page.analysis.search.head_operator=Оператор +page.analysis.search.head_time=Время в диалоге common.asterisk_explanation=* - поля, обязательные для заполнения page_agents.title=Агенты page_agents.agents=Полный список агентов: @@ -108,10 +118,16 @@ form.field.password= form.field.password.description= button.enter=Войти button.save=Сохранить +button.search=Искать +tag.pagination.info=Страница {0} из {1}, показаны {2}-{3} из {4} +tag.pagination.no_items=Ничего не найдено image.chat.history=/webim/images/ru/history.gif image.chat.message=/webim/images/ru/message.gif image.button.login=/webim/images/ru/login.gif image.button.save=/webim/images/ru/save.gif +image.button.search=/webim/images/ru/search.gif +chat.came.from=Посетитель пришел со страницы {0} +content.history=Поиск по истории диалогов content.logoff=Покинуть систему. form.field.agent_commonname=Интернациональное имя (латиницей) form.field.agent_commonname.description=Под этим именем Вас увидят ваши посетители из других стран @@ -130,3 +146,5 @@ page.gen_button.choose_image= page.gen_button.choose_locale=Для какой локали создавать кнопку page_agent.create_new=Создание нового оператора page_agents.agent_commonname=Интернациональное имя +page_analysis.full.text.search=Поиск по имени посетителя или по тексту сообщения: +page_search.intro=На данной странице можно осуществить поиск диалогов по имени пользователя или фразе, встречающейся в сообщении. diff --git a/src/webim/view/thread_log.php b/src/webim/view/thread_log.php new file mode 100644 index 00000000..08e6b1c0 --- /dev/null +++ b/src/webim/view/thread_log.php @@ -0,0 +1,88 @@ + + + + + + + + + + + + + + + + <?php echo getstring("app.title") ?> - <?php echo getstring("thread.chat_log") ?> + + +"> +"> + + + + + + + + + + + + +
+ +

+ + + + + + + + + + +

+ + + + + + + + + +
+ +
+ + + + + +
+ +
+ + +
+ +
+ + + + diff --git a/src/webim/view/thread_search.php b/src/webim/view/thread_search.php new file mode 100644 index 00000000..c4b1698f --- /dev/null +++ b/src/webim/view/thread_search.php @@ -0,0 +1,117 @@ + + + + + + + + + + + + + + + <?php echo getstring("app.title") ?> - <?php echo getstring("page_analysis.search.title") ?> + + +"> +"> + + + + + + + + + + + + +
+ +
+

+
|">
+ + + +
+
+ + + + +
+
+ + + + + + + + +
+ +
+
+ +
+ + + + + + + + + + + + + + + + + +
+ + + + + + + , +
+
+ + + +

+
+ + + +
+ + +
+ + + +