diff --git a/src/messenger/webim/operator/threadprocessor.php b/src/messenger/webim/operator/threadprocessor.php index a026d7ee..b4a85ec8 100644 --- a/src/messenger/webim/operator/threadprocessor.php +++ b/src/messenger/webim/operator/threadprocessor.php @@ -29,15 +29,18 @@ setlocale(LC_TIME, getstring("time.locale")); function thread_info($id) { $db = Database::getInstance(); - return $db->query( - "select userName,agentName,remote,userAgent," . - "dtmmodified as modified, dtmcreated as created," . - "vclocalname as groupName " . + $thread_info = $db->query( + "select {chatthread}.*, {chatgroup}.vclocalname as groupName " . "from {chatthread} left join {chatgroup} on {chatthread}.groupid = {chatgroup}.groupid " . "where threadid = ?", array($id), array('return_rows' => Database::RETURN_ONE_ROW) ); + $thread = Thread::createFromDbInfo($thread_info); + return array( + 'thread' => $thread, + 'groupName' => $thread_info['groupName'] + ); } @@ -45,7 +48,7 @@ if (isset($_GET['threadid'])) { $threadid = verifyparam("threadid", "/^(\d{1,9})?$/", ""); $lastid = -1; $page['threadMessages'] = get_messages($threadid, "html", false, $lastid); - $page['thread'] = thread_info($threadid); + $page['thread_info'] = thread_info($threadid); } prepare_menu($operator, false); diff --git a/src/messenger/webim/view/thread_log.php b/src/messenger/webim/view/thread_log.php index 39f37141..da2d9d10 100644 --- a/src/messenger/webim/view/thread_log.php +++ b/src/messenger/webim/view/thread_log.php @@ -18,7 +18,8 @@ $page['title'] = getlocal("thread.chat_log"); function tpl_content() { global $page, $webimroot, $errors; -$chatthread = $page['thread']; +$chatthreadinfo = $page['thread_info']; +$chatthread = $page['thread_info']['thread']; ?> @@ -32,7 +33,7 @@ $chatthread = $page['thread']; :
- + userName)) ?>

@@ -40,7 +41,7 @@ $chatthread = $page['thread']; :
- + remote)) ?>

@@ -48,26 +49,26 @@ $chatthread = $page['thread']; :
- + userAgent)) ?>

- +
:
- +

- + agentName ) { ?>
:
- + agentName)) ?>

@@ -76,8 +77,8 @@ $chatthread = $page['thread']; :
- - () + modified-$chatthread->created) ?> + (created) ?>)