diff --git a/src/messenger/webim/images/buttons/history.gif b/src/messenger/webim/images/buttons/history.gif new file mode 100644 index 00000000..6eafd671 Binary files /dev/null and b/src/messenger/webim/images/buttons/history.gif differ 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:"
+
+
+ + +
+ + + + + |
+