mirror of
				https://github.com/Mibew/i18n.git
				synced 2025-10-31 09:21:04 +03:00 
			
		
		
		
	referer notification, fix encoding in install, messages for agent, notify about connection problems, update thread time, reassign thread, do not open closed chat, history, version, locale changes
git-svn-id: https://webim.svn.sourceforge.net/svnroot/webim/trunk@16 c66351dc-e62f-0410-b875-e3a5c0b9693f
This commit is contained in:
		
							parent
							
								
									1f658bf8eb
								
							
						
					
					
						commit
						d5aa0774a8
					
				| @ -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" ) { | ||||
|  | ||||
| @ -13,6 +13,7 @@ | ||||
|  */ | ||||
| 
 | ||||
| require('../libs/common.php'); | ||||
| require('view_index.php'); | ||||
| 
 | ||||
| ?>
 | ||||
| start_html_output(); | ||||
| require('view_index.php'); | ||||
| ?>
 | ||||
|  | ||||
| @ -84,6 +84,7 @@ function create_tables() { | ||||
| drop_tables(); | ||||
| create_tables(); | ||||
| 
 | ||||
| start_html_output(); | ||||
| require('view_install.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 ); | ||||
|  | ||||
| @ -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; | ||||
| } | ||||
|  | ||||
| @ -27,11 +27,11 @@ function generate_pagination_image($id) { | ||||
| 	return "<img src=\"$webimroot/images/$id.gif\" border=\"0\"/>"; | ||||
| } | ||||
| 
 | ||||
| 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; | ||||
| 	 | ||||
|  | ||||
| @ -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; | ||||
| } | ||||
|  | ||||
| @ -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'); | ||||
| 
 | ||||
| ?>
 | ||||
							
								
								
									
										55
									
								
								src/webim/operator/history.php
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										55
									
								
								src/webim/operator/history.php
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,55 @@ | ||||
| <?php | ||||
| /* | ||||
|  * This file is part of Web Instant Messenger project. | ||||
|  * | ||||
|  * Copyright (c) 2005-2007 Internet Services Ltd. | ||||
|  * All rights reserved. This program and the accompanying materials | ||||
|  * are made available under the terms of the Eclipse Public License v1.0 | ||||
|  * which accompanies this distribution, and is available at | ||||
|  * http://www.eclipse.org/legal/epl-v10.html | ||||
|  * | ||||
|  * Contributors: | ||||
|  *    Pavel Petroshenko - initial API and implementation | ||||
|  */ | ||||
| 
 | ||||
| require('../libs/common.php'); | ||||
| require('../libs/operator.php'); | ||||
| require('../libs/chat.php'); | ||||
| require('../libs/pagination.php'); | ||||
| 
 | ||||
| $operator = check_login(); | ||||
| 
 | ||||
| $page = array( 'operator' => 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'); | ||||
| ?>
 | ||||
| @ -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 .= "<a href=\"/webim/operator/index.php?locale=$k\">$k</a>";
 | ||||
| } | ||||
| 
 | ||||
| $page['localeLinks'] = $localeLinks; | ||||
| 
 | ||||
| start_html_output(); | ||||
| require('../view/menu.php'); | ||||
|  | ||||
							
								
								
									
										32
									
								
								src/webim/operator/threadprocessor.php
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										32
									
								
								src/webim/operator/threadprocessor.php
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,32 @@ | ||||
| <?php | ||||
| /* | ||||
|  * This file is part of Web Instant Messenger project. | ||||
|  * | ||||
|  * Copyright (c) 2005-2007 Internet Services Ltd. | ||||
|  * All rights reserved. This program and the accompanying materials | ||||
|  * are made available under the terms of the Eclipse Public License v1.0 | ||||
|  * which accompanies this distribution, and is available at | ||||
|  * http://www.eclipse.org/legal/epl-v10.html | ||||
|  * | ||||
|  * Contributors: | ||||
|  *    Evgeny Gryaznov - initial API and implementation | ||||
|  */ | ||||
| 
 | ||||
| require('../libs/common.php'); | ||||
| require('../libs/operator.php'); | ||||
| require('../libs/chat.php'); | ||||
| 
 | ||||
| $operator = check_login(); | ||||
| 
 | ||||
| $page = array( 'operator' => 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'); | ||||
| ?>
 | ||||
| @ -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 .= "<name>".htmlspecialchars($thread['userName'])."</name>"; | ||||
| 	$result .= "<addr>".htmlspecialchars($thread['remote'])."</addr>"; | ||||
| 	$result .= "<agent>".htmlspecialchars($thread['agentName'] ? $thread['agentName'] : "-")."</agent>"; | ||||
| 	$result .= "<agent>".htmlspecialchars($threadoperator)."</agent>"; | ||||
| 	$result .= "<time>".$thread['unix_timestamp(dtmcreated)']."000</time>"; | ||||
| 	$result .= "<modified>".$thread['unix_timestamp(dtmmodified)']."000</modified>"; | ||||
| 	$result .= "</thread>"; | ||||
| @ -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)) { | ||||
|  | ||||
| @ -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 "<ping></ping>"; | ||||
| 	exit; | ||||
| 
 | ||||
| } else if( $act == "close" ) { | ||||
| 
 | ||||
| 	ping_thread($thread, $isuser); | ||||
| 	close_thread($thread, $isuser); | ||||
| 	start_xml_output(); | ||||
| 	echo "<closed></closed>"; | ||||
|  | ||||
| @ -87,7 +87,7 @@ var threadParams = { servl:"/webim/thread.php",frequency:2,<?php if( $page['user | ||||
| 				<tr> | ||||
| <?php if( $page['agent'] ) { ?>
 | ||||
| 				<td class="text" nowrap> | ||||
| 					<?php echo getstring("chat.window.chatting_with") ?> <b><a href="javascript:void(0)" onclick="return false;" title="<?php echo getstring("chat.window.chatting_with") ?> <?php echo $page['ct.user.name'] ?>"><?php echo $page['ct.user.name'] ?></a></b><br>
 | ||||
| 					<?php echo getstring("chat.window.chatting_with") ?> <b><a href="javascript:void(0)" onclick="return false;" title="<?php echo getstring("chat.window.chatting_with") ?> <?php echo $page['ct.user.name'] ?><?php echo $page['namePostfix'] ?>"><?php echo $page['ct.user.name'] ?></a></b><br>
 | ||||
| 				</td> | ||||
| <?php } ?><?php if( $page['user'] ) { ?>
 | ||||
| 				<td class="text" nowrap> | ||||
| @ -120,8 +120,9 @@ var threadParams = { servl:"/webim/thread.php",frequency:2,<?php if( $page['user | ||||
| 
 | ||||
| 			    <td><img src='/webim/images/buttondiv.gif' width="35" height="45" border="0" alt="" /></td> | ||||
| <?php if( $page['user'] ) { ?>
 | ||||
| 				<td><a href="<?php echo $page['selfLink'] ?>&page=mailthread" target="_blank" title="<?php echo getstring("chat.window.toolbar.mail_history") ?>" onclick="this.newWindow = window.open('<?php echo $page['selfLink'] ?>&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;"><img src='/webim/images/buttons/email.gif' width="25" height="25" border="0" alt="Mail "/></a></td> | ||||
| 				<td><a href="<?php echo $page['selfLink'] ?>&act=mailthread" target="_blank" title="<?php echo getstring("chat.window.toolbar.mail_history") ?>" onclick="this.newWindow = window.open('<?php echo $page['selfLink'] ?>&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;"><img src='/webim/images/buttons/email.gif' width="25" height="25" border="0" alt="Mail "/></a></td> | ||||
| <?php } ?>
 | ||||
| 
 | ||||
| 				<td><a id="refresh" href="javascript:void(0)" onclick="return false;" title="<?php echo getstring("chat.window.toolbar.refresh") ?>"> | ||||
| 				<img src='/webim/images/buttons/refresh.gif' width="25" height="25" border="0" alt="Refresh " /></a></td> | ||||
| 
 | ||||
| @ -248,3 +249,4 @@ var threadParams = { servl:"/webim/thread.php",frequency:2,<?php if( $page['user | ||||
| 
 | ||||
| </body> | ||||
| </html> | ||||
| 
 | ||||
|  | ||||
| @ -89,7 +89,7 @@ | ||||
| 
 | ||||
| 			    <td><img src='/webim/images/buttondiv.gif' width="35" height="45" border="0" alt="" /></td> | ||||
| 
 | ||||
| 				<td><a href="<?php echo $page['selfLink'] ?>&page=mailthread" target="_blank" title="<?php echo getstring("chat.window.toolbar.mail_history") ?>" onclick="this.newWindow = window.open('<?php echo $page['selfLink'] ?>&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;"><img src='/webim/images/buttons/email.gif' width="25" height="25" border="0" alt="Mail" /></a></td> | ||||
| 				<td><a href="<?php echo $page['selfLink'] ?>&act=mailthread" target="_blank" title="<?php echo getstring("chat.window.toolbar.mail_history") ?>" onclick="this.newWindow = window.open('<?php echo $page['selfLink'] ?>&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;"><img src='/webim/images/buttons/email.gif' width="25" height="25" border="0" alt="Mail" /></a></td> | ||||
| 
 | ||||
| 				<td><a id="refresh" href="javascript:void(0)" onclick="return false;" title="<?php echo getstring("chat.window.toolbar.refresh") ?>"> | ||||
| 				<img src='/webim/images/buttons/refresh.gif' width="25" height="25" border="0" alt="Refresh" /></a></td> | ||||
|  | ||||
| @ -58,10 +58,27 @@ | ||||
| 	<tr><td width='20' valign='top'><img src='/webim/images/lidiv.gif' width='5' height='45' border='0' alt=''></td><td valign='top' class='text'><a href='/webim/operator/users.php'><?php echo getstring('topMenu.users') ?></a><br><img src='/webim/images/free.gif' width='1' height='10' border='0' alt=''><br><?php echo getstring('page_client.pending_users') ?><br></td></tr><tr><td colspan='2' height='20'></td></tr>
 | ||||
| 
 | ||||
| 	<tr><td width='20' valign='top'><img src='/webim/images/lidiv.gif' width='5' height='45' border='0' alt=''></td><td valign='top' class='text'><a href='/webim/operator/getcode.php'><?php echo getstring('leftMenu.client_gen_button') ?></a><br><img src='/webim/images/free.gif' width='1' height='10' border='0' alt=''><br><?php echo getstring('admin.content.client_gen_button') ?><br></td></tr><tr><td colspan='2' height='20'></td></tr>
 | ||||
|          | ||||
|         <tr><td width='20' valign='top'><img src='/webim/images/lidiv.gif' width='5' height='45' border='0' alt=''></td><td valign='top' class='text'><a href='/webim/operator/history.php'><?php echo getstring('page_analysis.search.title') ?></a><br><img src='/webim/images/free.gif' width='1' height='10' border='0' alt=''><br><?php echo getstring('content.history') ?><br></td></tr><tr><td colspan='2' height='20'></td></tr>
 | ||||
| 
 | ||||
| 	<tr><td width='20' valign='top'><img src='/webim/images/lidiv.gif' width='5' height='45' border='0' alt=''></td><td valign='top' class='text'><a href='/webim/operator/logout.php'><?php echo getstring('topMenu.logoff') ?></a><br><img src='/webim/images/free.gif' width='1' height='10' border='0' alt=''><br><?php echo getstring('content.logoff') ?><br></td></tr><tr><td colspan='2' height='20'></td></tr>
 | ||||
| 
 | ||||
| </table> | ||||
| 
 | ||||
| <table width="200" cellspacing="0" cellpadding="0" border="0"> | ||||
| <tr> | ||||
|   <td height="10"></td> | ||||
| </tr> | ||||
| <tr> | ||||
|   <td bgcolor="#D6D6D6"><img src="/webim/images/free.gif" height="1" width="1" border="0" alt=""></td> | ||||
| </tr> | ||||
| <tr> | ||||
|   <td height="7"></td> | ||||
| </tr> | ||||
| </table> | ||||
| 
 | ||||
| Web Messenger/<?php echo $page['version'] ?> • <?php echo $page['localeLinks'] ?>
 | ||||
| 
 | ||||
| </td> | ||||
| </tr> | ||||
| </table> | ||||
|  | ||||
| @ -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=<b><font class="red">*</font></b> - 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. | ||||
|  | ||||
| @ -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=<b><font class="red">*</font></b> - ïîëÿ, îáÿçàòåëüíûå äëÿ çàïîëíåíèÿ | ||||
| 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=На данной странице можно осуществить поиск диалогов по имени пользователя или фразе, встречающейся в сообщении. | ||||
|  | ||||
							
								
								
									
										88
									
								
								src/webim/view/thread_log.php
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										88
									
								
								src/webim/view/thread_log.php
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,88 @@ | ||||
| <?php | ||||
| /* | ||||
|  * This file is part of Web Instant Messenger project. | ||||
|  * | ||||
|  * Copyright (c) 2005-2007 Internet Services Ltd. | ||||
|  * All rights reserved. This program and the accompanying materials | ||||
|  * are made available under the terms of the Eclipse Public License v1.0 | ||||
|  * which accompanies this distribution, and is available at | ||||
|  * http://www.eclipse.org/legal/epl-v10.html | ||||
|  * | ||||
|  * Contributors: | ||||
|  *    Evgeny Gryaznov - initial API and implementation | ||||
|  */ | ||||
| ?>
 | ||||
| <html> | ||||
| <head> | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| <link rel="stylesheet" type="text/css" media="all" href="/webim/styles.css" /> | ||||
| <link rel="stylesheet" type="text/css" media="all" href="/webim/chat.css" /> | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| <link rel="shortcut icon" href="/webim/images/favicon.ico" type="image/x-icon"/> | ||||
| <title> | ||||
| 	<?php echo getstring("app.title") ?>	- <?php echo getstring("thread.chat_log") ?>
 | ||||
| </title> | ||||
| 
 | ||||
| <meta http-equiv="keywords" content="<?php echo getstring("page.main_layout.meta_keyword") ?>"> | ||||
| <meta http-equiv="description" content="<?php echo getstring("page.main_layout.meta_description") ?>"> | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| </head> | ||||
| 
 | ||||
| <body bgcolor="#FFFFFF" text="#000000" link="#2971C1" vlink="#2971C1" alink="#2971C1"> | ||||
| 
 | ||||
| <table width="100%" cellpadding="2" cellspacing="0" border="0"> | ||||
| <tr> | ||||
| <td valign="top" class="text"> | ||||
| 	 | ||||
| 		<h1><?php echo getstring("thread.chat_log") ?></h1>
 | ||||
| 	 | ||||
| 
 | ||||
| 	 | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| <?php echo getstring("thread.intro") ?>
 | ||||
| 
 | ||||
| <br/><br/> | ||||
| 
 | ||||
| <table border="0" cellpadding="0" cellspacing="0"> | ||||
| <tr> | ||||
| 	<td class='table' bgcolor='#276db8' height='30'><span class='header'> | ||||
| 		<?php echo getstring("thread.chat_log") ?>
 | ||||
| 	</span></td> | ||||
| </tr> | ||||
| <tr> | ||||
| 	<td height='45' class='table'> | ||||
| 		<span class="message"> | ||||
|                         <?php foreach( $page['threadMessages'] as $message ) { ?>
 | ||||
|                         	<?php echo $message ?>	
 | ||||
|                         <?php } ?>			
 | ||||
| 		</span> | ||||
| 	</td> | ||||
| </tr> | ||||
| <tr><td height='2' colspan='1'></td></tr><tr><td bgcolor='#e1e1e1' colspan='1'><img width='1' height='1' border='0' alt='' src='/webim/images/free.gif'></td></tr><tr><td height='2' colspan='1'></td></tr> | ||||
| </table> | ||||
| 
 | ||||
| <br /> | ||||
| <a href="/webim/operator/history.php"> | ||||
| 	<?php echo getstring("thread.back_to_search") ?></a>
 | ||||
| <br /> | ||||
| 
 | ||||
| </td> | ||||
| </tr> | ||||
| </table> | ||||
| 
 | ||||
| </body> | ||||
| </html> | ||||
| 
 | ||||
							
								
								
									
										117
									
								
								src/webim/view/thread_search.php
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										117
									
								
								src/webim/view/thread_search.php
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,117 @@ | ||||
| <?php | ||||
| /* | ||||
|  * This file is part of Web Instant Messenger project. | ||||
|  * | ||||
|  * Copyright (c) 2005-2007 Internet Services Ltd. | ||||
|  * All rights reserved. This program and the accompanying materials | ||||
|  * are made available under the terms of the Eclipse Public License v1.0 | ||||
|  * which accompanies this distribution, and is available at | ||||
|  * http://www.eclipse.org/legal/epl-v10.html | ||||
|  * | ||||
|  * Contributors: | ||||
|  *    Evgeny Gryaznov - initial API and implementation | ||||
|  */ | ||||
| ?>
 | ||||
| <html> | ||||
| <head> | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| <link rel="stylesheet" type="text/css" media="all" href="/webim/styles.css" /> | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| <link rel="shortcut icon" href="/webim/images/favicon.ico" type="image/x-icon"/> | ||||
| <title> | ||||
| 	<?php echo getstring("app.title") ?>	- <?php echo getstring("page_analysis.search.title") ?>
 | ||||
| </title> | ||||
| 
 | ||||
| <meta http-equiv="keywords" content="<?php echo getstring("page.main_layout.meta_keyword") ?>"> | ||||
| <meta http-equiv="description" content="<?php echo getstring("page.main_layout.meta_description") ?>"> | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| </head> | ||||
| 
 | ||||
| <body bgcolor="#FFFFFF" text="#000000" link="#2971C1" vlink="#2971C1" alink="#2971C1"> | ||||
| 
 | ||||
| <table width="100%" cellpadding="2" cellspacing="0" border="0"> | ||||
| <tr> | ||||
| <td valign="top" class="text"> | ||||
| 	 | ||||
|  <table width="100%" cellpadding="0" cellspacing="0" border="0"><tr><td align="left" valign="top">  | ||||
| 		<h1><?php echo getstring("page_analysis.search.title") ?></h1>
 | ||||
|  </td><td align="right" class="text" valign="top"><table cellspacing="0" cellpadding="0" border="0"><tr><td class="textform"><?php echo getstring2("menu.operator",array($page['operator'])) ?></td><td class="textform"><img src='/webim/images/topdiv.gif' width="25" height="15" border="0" alt="|" /></td><td class="textform"><a href="/webim/operator/index.php" title="<?php echo getstring("menu.main") ?>"><?php echo getstring("menu.main") ?></a></td></tr></table></td></tr></table> 
 | ||||
| 	 | ||||
| 
 | ||||
| 	<?php echo getstring("page_search.intro") ?>
 | ||||
| <br /> | ||||
| <br /> | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| <form name="searchForm" method="get" action="/webim/operator/history.php"> | ||||
| <table cellspacing='0' cellpadding='0' border='0'><tr><td background='/webim/images/loginbg.gif'><table cellspacing='0' cellpadding='0' border='0'><tr><td><img src='/webim/images/logincrnlt.gif' width='16' height='16' border='0' alt=''></td><td></td><td><img src='/webim/images/logincrnrt.gif' width='16' height='16' border='0' alt=''></td></tr><tr><td></td><td align='center'><table border='0' cellspacing='0' cellpadding='0'> | ||||
| 	<tr> | ||||
| 		<td class="formauth" colspan="3"><?php echo getstring("page_analysis.full.text.search") ?></td>
 | ||||
| 	</tr> | ||||
| 	<tr> | ||||
| 		<td class="formauth"><input type="text" name="q" size="80" value="<?php echo form_value('q') ?>" class="formauth"/></td> | ||||
| 		<td width="10"><img src="/webim/images/free.gif" width="10" height="1" border="0" alt=""></td> | ||||
| 		<td class="formauth"> | ||||
| 			<input type="image" name="" src='<?php echo getstring("image.button.search") ?>' border="0" alt='<?php echo getstring("button.search") ?>'/> | ||||
| 		</td> | ||||
| 	</tr> | ||||
| </table></td><td></td></tr><tr><td><img src='/webim/images/logincrnlb.gif' width='16' height='16' border='0' alt=''></td><td></td><td><img src='/webim/images/logincrnrb.gif' width='16' height='16' border='0' alt=''></td></tr></table></td></tr></table> | ||||
| </form> | ||||
| 
 | ||||
| <br/> | ||||
| <?php if( $page['pagination'] && $page['pagination.items'] ) { ?>
 | ||||
| 	<table cellpadding="0" cellspacing="0" border="0" width="100%"> | ||||
| 		<tr> | ||||
| 			<td class='table' bgcolor='#276db8' height='30'><span class='header'><?php echo getstring("page.analysis.search.head_name") ?></span></td><td width='3'></td>
 | ||||
| 			<td class='table' bgcolor='#276db8' height='30'><span class='header'><?php echo getstring("page.analysis.search.head_host") ?></span></td><td width='3'></td>
 | ||||
| 			<td class='table' bgcolor='#276db8' height='30'><span class='header'><?php echo getstring("page.analysis.search.head_operator") ?></span></td><td width='3'></td>
 | ||||
| 			<td class='table' bgcolor='#276db8' height='30'><span class='header'><?php echo getstring("page.analysis.search.head_time") ?></span></td>
 | ||||
| 		</tr> | ||||
| 		<?php foreach( $page['pagination.items'] as $chatthread ) { ?>
 | ||||
| 			<tr> | ||||
| 				<td height='30' class='table'> | ||||
| 					<a href="/webim/operator/threadprocessor.php?threadid=<?php echo $chatthread['threadid'] ?>" target="_blank" onclick="this.newWindow = window.open('/webim/operator/threadprocessor.php?threadid=<?php echo $chatthread['threadid'] ?>', '', 'toolbar=0,scrollbars=1,location=0,status=1,menubar=0,width=600,height=420,resizable=1');this.newWindow.focus();this.newWindow.opener=window;return false;"><?php echo htmlspecialchars($chatthread['userName']) ?></a>
 | ||||
| 				</td><td background='/webim/images/tablediv3.gif'><img width='3' height='1' border='0' alt='' src='/webim/images/free.gif'></td> | ||||
| 				<td height='30' class='table'> | ||||
| 					<?php echo htmlspecialchars($chatthread['remote']) ?>
 | ||||
| 				</td><td background='/webim/images/tablediv3.gif'><img width='3' height='1' border='0' alt='' src='/webim/images/free.gif'></td> | ||||
| 				<td height='30' class='table'> | ||||
|         			<?php if( $chatthread['agentName'] ) { ?><?php echo htmlspecialchars($chatthread['agentName']) ?><?php } ?>
 | ||||
| 				</td><td background='/webim/images/tablediv3.gif'><img width='3' height='1' border='0' alt='' src='/webim/images/free.gif'></td> | ||||
| 				<td height='30' class='table'> | ||||
| 					<?php echo date("d M Y H:i:s", $chatthread['created']) ?>,  <?php echo date("d M Y H:i:s", $chatthread['modified']-$chatthread['created']) ?>
 | ||||
| 				</td> | ||||
| 			</tr> | ||||
| 			<tr><td height='2' colspan='7'></td></tr><tr><td bgcolor='#e1e1e1' colspan='7'><img width='1' height='1' border='0' alt='' src='/webim/images/free.gif'></td></tr><tr><td height='2' colspan='7'></td></tr> | ||||
| 		<?php } ?>
 | ||||
| 	</table> | ||||
| 	<br /> | ||||
| 	<?php echo generate_pagination($page['pagination']) ?>
 | ||||
| <?php } ?>
 | ||||
| <?php if( $page['pagination'] && !$page['pagination.items'] ) { ?>
 | ||||
| 	<br/><br/> | ||||
| 	<table cellspacing='0' cellpadding='0' border='0'><tr><td background='/webim/images/loginbg.gif'><table cellspacing='0' cellpadding='0' border='0'><tr><td><img src='/webim/images/logincrnlt.gif' width='16' height='16' border='0' alt=''></td><td></td><td><img src='/webim/images/logincrnrt.gif' width='16' height='16' border='0' alt=''></td></tr><tr><td></td><td align='center'><table border='0' cellspacing='0' cellpadding='0'> | ||||
| 		<span class="table"> | ||||
| 			<?php echo getstring("tag.pagination.no_items") ?>
 | ||||
| 		</span> | ||||
| 	</table></td><td></td></tr><tr><td><img src='/webim/images/logincrnlb.gif' width='16' height='16' border='0' alt=''></td><td></td><td><img src='/webim/images/logincrnrb.gif' width='16' height='16' border='0' alt=''></td></tr></table></td></tr></table> | ||||
| <?php } ?>
 | ||||
| 
 | ||||
| </td> | ||||
| </tr> | ||||
| </table> | ||||
| 
 | ||||
| </body> | ||||
| </html> | ||||
| 
 | ||||
		Loading…
	
		Reference in New Issue
	
	Block a user