diff --git a/src/messenger/webim/operator/userhistory.php b/src/messenger/webim/operator/userhistory.php index f3f400b4..58f52071 100644 --- a/src/messenger/webim/operator/userhistory.php +++ b/src/messenger/webim/operator/userhistory.php @@ -38,12 +38,11 @@ function threads_by_userid($userid) if ($userid == "") { return null; } - + return $db->query( - "select dtmcreated as created, " . - "dtmmodified as modified, threadid, remote, agentName, userName " . + "select {chatthread}.* " . "from {chatthread} " . - "where userid=? order by created DESC", + "where userid=? order by dtmcreated DESC", array($userid), array('return_rows' => Database::RETURN_ALL_ROWS) ); @@ -53,6 +52,9 @@ $found = threads_by_userid($userid); prepare_menu($operator); setup_pagination($found, 6); +foreach ($page['pagination.items'] as $key => $item) { + $page['pagination.items'][$key] = Thread::createFromDbInfo($item); +} start_html_output(); require('../view/userhistory.php'); ?> \ No newline at end of file diff --git a/src/messenger/webim/view/userhistory.php b/src/messenger/webim/view/userhistory.php index 437163e3..e7142da7 100644 --- a/src/messenger/webim/view/userhistory.php +++ b/src/messenger/webim/view/userhistory.php @@ -46,16 +46,16 @@ if( $page['pagination.items'] ) { foreach( $page['pagination.items'] as $chatthread ) { ?>