From 74180e61ba00112ec64dcdff5f2aed8e32644130 Mon Sep 17 00:00:00 2001 From: Evgeny Gryaznov Date: Fri, 3 Oct 2008 15:20:36 +0000 Subject: [PATCH] user history git-svn-id: https://webim.svn.sourceforge.net/svnroot/webim/trunk@152 c66351dc-e62f-0410-b875-e3a5c0b9693f --- .../webim/images/buttons/history.gif | Bin 0 -> 1281 bytes src/messenger/webim/locales/en/properties | 2 + src/messenger/webim/locales/ru/properties | 2 + src/messenger/webim/operator/userhistory.php | 57 +++++++++++ src/messenger/webim/view/chat_ajaxed.php | 12 ++- src/messenger/webim/view/userhistory.php | 92 ++++++++++++++++++ 6 files changed, 163 insertions(+), 2 deletions(-) create mode 100644 src/messenger/webim/images/buttons/history.gif create mode 100644 src/messenger/webim/operator/userhistory.php create mode 100644 src/messenger/webim/view/userhistory.php diff --git a/src/messenger/webim/images/buttons/history.gif b/src/messenger/webim/images/buttons/history.gif new file mode 100644 index 0000000000000000000000000000000000000000..6eafd6716af90666f770a12c64fc01e03c310dfc GIT binary patch literal 1281 zcmV+c1^)U+Nk%w1VHp4!0Qdg@;H5L)q%i;e`2YU=;G{6)tU~0nP~fF9;HEO*qAB2| zF6g~!;G-|%sXOGdPTid()t4aOp(*35L;u@a*_t8Xr7_>3D&@6Q<+N1gwN>G!Gv1&m z+?*rju~O*0X2FUb%8(!CwprGgAoJX==eJztvs2=!KI5!J;;KL5sXX%At=pU<|M%JC zvr*!#L;vow>cMm4u0`RfI@+5e<+NAYoh9O`JmjxR=CxPbnYE?8t%8lOO-v zT+NXht%57hk{IO3{6=CxM! z+?^!FjUDmUqW|^M?#__mrZoTb&!m4g;ifX$pDq9N&b5j)|Nj1{fjHo&Hsh^A-JT=n zx?snR9_zz**q9;f#CY`Hw61|G=D1#$axdVcE$hdC+ngZvcn^Q*{7FxH07~R>EqVBg&ga}cx`iC^-nrG7A+LQMdxo6V8D|< z=ec6(y=$j@D)r*L>A-K|syg-Iz2vh};GrzBge>jNi}m8Z=euP0>CE4wET4NeD%9p$%K;G-=6+gadD|J`QwP7yf3A2ce(hA|tVB9oLIpT;b( zMS=#hZ=w7R5Xi6$KYz8*q*_HH#H$j294Il+LV_|T44L{fw5yGzCiUL5iqyaciUN2b z?K`jpRoH(FpNzm@;+(J;{$$8VafH$hb|)4^nRAyR4;2?A)H%SgK?)Qn$d&k|A;*Vo zjr}ER=BR*;h9>64VAKIg9(Wu+oC&?AkAVUiL%67*0E&}6q4~%&kdfhm0LH*13l>^j zzYaGXT=U=o#}@z<0Ne|(ZAG_Jp%--Cy3pcXnBx9s zLBoXxEL8v?U;qsPLk$Hr01;Xtm~es*00=}#KmY{#V?hMcK;Vrop*ipfH(n6HfQSk( zpoWEZ6d^(!LBJ8(Jft+BKmzt8kiZ5+Jix&UWb|N-GpeK!8U~kaK!FINXaWu!iahW@ z4iNkxix7IWb5~7CWPyk~vn&IOI?O6c7MAg$J%Q literal 0 HcmV?d00001 diff --git a/src/messenger/webim/locales/en/properties b/src/messenger/webim/locales/en/properties index 7242f82c..4513820f 100644 --- a/src/messenger/webim/locales/en/properties +++ b/src/messenger/webim/locales/en/properties @@ -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=* - mandatory fields page_agents.title=Agents page_agents.agents=Agents full list: diff --git a/src/messenger/webim/locales/ru/properties b/src/messenger/webim/locales/ru/properties index f92b1f82..333c43c2 100644 --- a/src/messenger/webim/locales/ru/properties +++ b/src/messenger/webim/locales/ru/properties @@ -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=* - поля, обязательные для заполнения page_agents.title=Агенты page_agents.agents=Полный список агентов: diff --git a/src/messenger/webim/operator/userhistory.php b/src/messenger/webim/operator/userhistory.php new file mode 100644 index 00000000..f7e152e9 --- /dev/null +++ b/src/messenger/webim/operator/userhistory.php @@ -0,0 +1,57 @@ + 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'); +?> \ No newline at end of file diff --git a/src/messenger/webim/view/chat_ajaxed.php b/src/messenger/webim/view/chat_ajaxed.php index fdb86792..f12d23c9 100644 --- a/src/messenger/webim/view/chat_ajaxed.php +++ b/src/messenger/webim/view/chat_ajaxed.php @@ -103,8 +103,14 @@ var threadParams = { servl:"/thread.php",wroot:" + + + " target="_blank" title="" onclick="this.newWindow = window.open('', '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;"> + + - + + @@ -149,7 +155,9 @@ var threadParams = { servl:"/thread.php",wroot:""> Redirect  - + + " target="_blank" title="" onclick="this.newWindow = window.open('', '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;">History  + "> Refresh  diff --git a/src/messenger/webim/view/userhistory.php b/src/messenger/webim/view/userhistory.php new file mode 100644 index 00000000..a8574b8e --- /dev/null +++ b/src/messenger/webim/view/userhistory.php @@ -0,0 +1,92 @@ + + + + + + + + + + + + <?php echo getlocal("app.title") ?> - <?php echo getlocal("page.analysis.userhistory.title") ?> + + +"> +"> + + + + + + + + +
+ +
+

+
+ + + + + +

+ + + + + + + + + + + + + + + + + + +
+ + + + + + + , +
+
+ + + +

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