mirror of
https://github.com/Mibew/java.git
synced 2025-01-22 17:40:35 +03:00
user history
git-svn-id: https://webim.svn.sourceforge.net/svnroot/webim/trunk@152 c66351dc-e62f-0410-b875-e3a5c0b9693f
This commit is contained in:
parent
33b50cdb67
commit
74180e61ba
BIN
src/messenger/webim/images/buttons/history.gif
Normal file
BIN
src/messenger/webim/images/buttons/history.gif
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.3 KiB |
@ -93,6 +93,8 @@ page.analysis.search.head_host=Visitor's address
|
||||
page.analysis.search.head_operator=Operator
|
||||
page.analysis.search.head_messages=Visitor's messages
|
||||
page.analysis.search.head_time=Time in chat
|
||||
page.analysis.userhistory.title=Visits history
|
||||
page.analysis.userhistory.intro=You can find chat history of your visitors here.
|
||||
common.asterisk_explanation=<b><font class="red">*</font></b> - mandatory fields
|
||||
page_agents.title=Agents
|
||||
page_agents.agents=Agents full list:
|
||||
|
@ -93,6 +93,8 @@ page.analysis.search.head_host=
|
||||
page.analysis.search.head_operator=Îïåðàòîð
|
||||
page.analysis.search.head_messages=Ñîîáùåíèé ïîñåòèòåëÿ
|
||||
page.analysis.search.head_time=Âðåìÿ â äèàëîãå
|
||||
page.analysis.userhistory.title=История диалогов
|
||||
page.analysis.userhistory.intro=На данной странице Вы можете увидеть все диалоги с Вашим посетителем.
|
||||
common.asterisk_explanation=<b><font class="red">*</font></b> - ïîëÿ, îáÿçàòåëüíûå äëÿ çàïîëíåíèÿ
|
||||
page_agents.title=Àãåíòû
|
||||
page_agents.agents=Ïîëíûé ñïèñîê àãåíòîâ:
|
||||
|
57
src/messenger/webim/operator/userhistory.php
Normal file
57
src/messenger/webim/operator/userhistory.php
Normal file
@ -0,0 +1,57 @@
|
||||
<?php
|
||||
/*
|
||||
* This file is part of Web Instant Messenger project.
|
||||
*
|
||||
* Copyright (c) 2005-2008 Web Messenger Community
|
||||
* 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_once('../libs/common.php');
|
||||
require_once('../libs/operator.php');
|
||||
require_once('../libs/chat.php');
|
||||
require_once('../libs/pagination.php');
|
||||
|
||||
$operator = check_login();
|
||||
|
||||
$page = array( 'operator' => topage(get_operator_name($operator)) );
|
||||
|
||||
$userid = "";
|
||||
if( isset($_GET['userid'])) {
|
||||
$userid = verifyparam( "userid", "/^.{0,63}$/", "");
|
||||
}
|
||||
|
||||
function threads_by_userid($userid) {
|
||||
if ($userid == "") {
|
||||
return null;
|
||||
}
|
||||
$link = connect();
|
||||
|
||||
$query = sprintf("select unix_timestamp(dtmcreated) as created, unix_timestamp(dtmmodified) as modified, ".
|
||||
" threadid, remote, agentName, userName ".
|
||||
"from chatthread ".
|
||||
"where userid=\"$userid\" order by created DESC", $userid);
|
||||
|
||||
$result = mysql_query($query, $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);
|
||||
return $foundThreads;
|
||||
}
|
||||
|
||||
$found = threads_by_userid($userid);
|
||||
|
||||
setup_pagination($found,6);
|
||||
start_html_output();
|
||||
require('../view/userhistory.php');
|
||||
?>
|
@ -103,8 +103,14 @@ var threadParams = { servl:"<?php echo $webimroot ?>/thread.php",wroot:"<?php ec
|
||||
<tr>
|
||||
<?php if( $page['agent'] ) { ?>
|
||||
<td class="text" nowrap>
|
||||
<?php if( $page['historyParams'] ) { ?>
|
||||
<?php echo getlocal("chat.window.chatting_with") ?>
|
||||
<a href="<?php echo add_params($webimroot."/operator/userhistory.php",$page['historyParams']) ?>" target="_blank" title="<?php echo getlocal("page.analysis.userhistory.title") ?>" onclick="this.newWindow = window.open('<?php echo add_params($webimroot."/operator/userhistory.php",$page['historyParams']) ?>', 'UserHistory', 'toolbar=0,scrollbars=0,location=0,statusbar=1,menubar=0,width=703,height=380,resizable=1');this.newWindow.focus();this.newWindow.opener=window;return false;"><?php echo htmlspecialchars($page['ct.user.name']) ?></a>
|
||||
<?php } ?>
|
||||
<?php if( !$page['historyParams'] ) { ?>
|
||||
<?php echo getlocal("chat.window.chatting_with") ?> <b><?php echo htmlspecialchars($page['ct.user.name']) ?></b>
|
||||
</td>
|
||||
<?php } ?>
|
||||
</td>
|
||||
<?php } ?>
|
||||
<?php if( $page['user'] && $page['canChangeName'] ) { ?>
|
||||
<td class="text" nowrap>
|
||||
@ -149,7 +155,9 @@ var threadParams = { servl:"<?php echo $webimroot ?>/thread.php",wroot:"<?php ec
|
||||
<td><a href="<?php echo $page['selfLink'] ?>&act=redirect" title="<?php echo getlocal("chat.window.toolbar.redirect_user") ?>">
|
||||
<img src='<?php echo $webimroot ?>/images/buttons/send.gif' width="25" height="25" border="0" alt="Redirect " /></a></td>
|
||||
<?php } ?>
|
||||
|
||||
<?php if( $page['agent'] && $page['historyParams'] ) { ?>
|
||||
<td><a href="<?php echo add_params($webimroot."/operator/userhistory.php",$page['historyParams']) ?>" target="_blank" title="<?php echo getlocal("page.analysis.userhistory.title") ?>" onclick="this.newWindow = window.open('<?php echo add_params($webimroot."/operator/userhistory.php",$page['historyParams']) ?>', 'UserHistory', 'toolbar=0,scrollbars=0,location=0,statusbar=1,menubar=0,width=703,height=380,resizable=1');this.newWindow.focus();this.newWindow.opener=window;return false;"><img src='<?php echo $webimroot ?>/images/buttons/history.gif' width="25" height="25" border="0" alt="History "/></a></td>
|
||||
<?php } ?>
|
||||
<td><a id="refresh" href="javascript:void(0)" onclick="return false;" title="<?php echo getlocal("chat.window.toolbar.refresh") ?>">
|
||||
<img src='<?php echo $webimroot ?>/images/buttons/refresh.gif' width="25" height="25" border="0" alt="Refresh " /></a></td>
|
||||
|
||||
|
92
src/messenger/webim/view/userhistory.php
Normal file
92
src/messenger/webim/view/userhistory.php
Normal file
@ -0,0 +1,92 @@
|
||||
<?php
|
||||
/*
|
||||
* This file is part of Web Instant Messenger project.
|
||||
*
|
||||
* Copyright (c) 2005-2008 Web Messenger Community
|
||||
* 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="<?php echo $webimroot ?>/styles.css" />
|
||||
|
||||
|
||||
<link rel="shortcut icon" href="<?php echo $webimroot ?>/images/favicon.ico" type="image/x-icon"/>
|
||||
<title>
|
||||
<?php echo getlocal("app.title") ?> - <?php echo getlocal("page.analysis.userhistory.title") ?>
|
||||
</title>
|
||||
|
||||
<meta http-equiv="keywords" content="<?php echo getlocal("page.main_layout.meta_keyword") ?>">
|
||||
<meta http-equiv="description" content="<?php echo getlocal("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 getlocal("page.analysis.userhistory.title") ?></h1>
|
||||
</td><td align="right" class="text" valign="top"><table cellspacing="0" cellpadding="0" border="0"><tr><td class="textform"><?php echo getlocal2("menu.operator",array($page['operator'])) ?></td></tr></table></td></tr></table>
|
||||
|
||||
|
||||
|
||||
<?php echo getlocal("page.analysis.userhistory.intro") ?>
|
||||
|
||||
<br/><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 getlocal("page.analysis.search.head_name") ?></span></td><td width='3'></td>
|
||||
<td class='table' bgcolor='#276db8' height='30'><span class='header'><?php echo getlocal("page.analysis.search.head_host") ?></span></td><td width='3'></td>
|
||||
<td class='table' bgcolor='#276db8' height='30'><span class='header'><?php echo getlocal("page.analysis.search.head_operator") ?></span></td><td width='3'></td>
|
||||
<td class='table' bgcolor='#276db8' height='30'><span class='header'><?php echo getlocal("page.analysis.search.head_time") ?></span></td>
|
||||
</tr>
|
||||
<?php foreach( $page['pagination.items'] as $chatthread ) { ?>
|
||||
<tr>
|
||||
<td height='30' class='table'>
|
||||
<a href="<?php echo $webimroot ?>/operator/threadprocessor.php?threadid=<?php echo $chatthread['threadid'] ?>" target="_blank" onclick="this.newWindow = window.open('<?php echo $webimroot ?>/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(topage($chatthread['userName'])) ?></a>
|
||||
</td><td background='<?php echo $webimroot ?>/images/tablediv3.gif'><img width='3' height='1' border='0' alt='' src='<?php echo $webimroot ?>/images/free.gif'></td>
|
||||
<td height='30' class='table'>
|
||||
<?php echo htmlspecialchars(topage($chatthread['remote'])) ?>
|
||||
</td><td background='<?php echo $webimroot ?>/images/tablediv3.gif'><img width='3' height='1' border='0' alt='' src='<?php echo $webimroot ?>/images/free.gif'></td>
|
||||
<td height='30' class='table'>
|
||||
<?php if( $chatthread['agentName'] ) { ?><?php echo htmlspecialchars(topage($chatthread['agentName'])) ?><?php } ?>
|
||||
</td><td background='<?php echo $webimroot ?>/images/tablediv3.gif'><img width='3' height='1' border='0' alt='' src='<?php echo $webimroot ?>/images/free.gif'></td>
|
||||
<td height='30' class='table'>
|
||||
<?php echo strftime("%B, %d %Y %H:%M:%S", $chatthread['created']) ?>, <?php echo date_diff($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='<?php echo $webimroot ?>/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='<?php echo $webimroot ?>/images/loginbg.gif'><table cellspacing='0' cellpadding='0' border='0'><tr><td><img src='<?php echo $webimroot ?>/images/logincrnlt.gif' width='16' height='16' border='0' alt=''></td><td></td><td><img src='<?php echo $webimroot ?>/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 getlocal("tag.pagination.no_items") ?>
|
||||
</span>
|
||||
</table></td><td></td></tr><tr><td><img src='<?php echo $webimroot ?>/images/logincrnlb.gif' width='16' height='16' border='0' alt=''></td><td></td><td><img src='<?php echo $webimroot ?>/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