diff --git a/src/messenger/webim/design/default/redirect.tpl b/src/messenger/webim/design/default/redirect.tpl
new file mode 100644
index 00000000..c1dbf408
--- /dev/null
+++ b/src/messenger/webim/design/default/redirect.tpl
@@ -0,0 +1,110 @@
+
+
+
+${msg:chat.window.title.agent}
+
+
+
+
+
+
+
+
+
+
+
+ |
+
+
+
+ ${msg:chat.redirect.title} |
+
+ ${msg:chat.redirect.choose_operator}
+
+ |
+
+
+ |
+ |
+
+
+
+ |
+
+
+
+
+ |
+ |
+ |
+
+
+
+ |
+
+
+
+
+
+
+
+ ${page:pagination_list}
+
+
+ |
+
+
+
+ |
+ |
+
+
+
+ |
+ |
+ |
+
+
+
+ |
+ |
+
+
+
+ |
+
+
+
+
+
+ ${pagination}
+ |
+
+
+ |
+
+
+
+ |
+ |
+
+
+
+ |
+ |
+ |
+
+
+
+ |
+
+
+
+
+
diff --git a/src/messenger/webim/design/default/redirected.tpl b/src/messenger/webim/design/default/redirected.tpl
new file mode 100644
index 00000000..5c9da09b
--- /dev/null
+++ b/src/messenger/webim/design/default/redirected.tpl
@@ -0,0 +1,89 @@
+
+
+
+${msg:chat.window.title.agent}
+
+
+
+
+
+
+
+
+
+
+ |
+
+ ${msg:chat.redirected.title}
+ |
+ |
+
+
+
+ |
+
+
+
+
+ |
+ |
+
+
+
+ |
+
+
+
+
+ |
+ |
+
+
+
+ |
+ |
+ |
+
+
+
+ |
+
+
+
+
+
diff --git a/src/messenger/webim/libs/expand.php b/src/messenger/webim/libs/expand.php
index 0c2f5280..e7f7e298 100644
--- a/src/messenger/webim/libs/expand.php
+++ b/src/messenger/webim/libs/expand.php
@@ -40,6 +40,8 @@ function expand_var($matches) {
if(!$prefix) {
if($var == 'webimroot') {
return $webimroot;
+ } else if($var == 'pagination') {
+ return generate_pagination($page['pagination']);
} else if($var == 'errors') {
if( isset($errors) && count($errors) > 0 ) {
$result = getlocal("errors.header");
diff --git a/src/messenger/webim/operator/agent.php b/src/messenger/webim/operator/agent.php
index 82daa83a..a63a55ce 100644
--- a/src/messenger/webim/operator/agent.php
+++ b/src/messenger/webim/operator/agent.php
@@ -69,8 +69,17 @@ $pparam = verifyparam( "act", "/^(redirect)$/", "default");
if( $pparam == "redirect" ) {
$found = get_operators();
setup_pagination($found);
- $page['params'] = array('thread' => $threadid, 'token' => $token);
- require('../view/redirect.php');
+
+ $agent_list = "";
+ $params = array('thread' => $threadid, 'token' => $token);
+ for( $indagent = 0; $indagent < count($page['pagination.items']); $indagent += 1 ) {
+ $agent = $page['pagination.items'][$indagent];
+ $params['nextAgent'] = $agent['operatorid'];
+ $agent_list .= "".topage($agent['vclocalename'])."";
+ }
+ $page['pagination_list'] = $agent_list;
+
+ expand("../design/default/redirect.tpl");
} else {
expand("../design/default/chat.tpl");
}
diff --git a/src/messenger/webim/operator/redirect.php b/src/messenger/webim/operator/redirect.php
index 2a66142d..060f2ea0 100644
--- a/src/messenger/webim/operator/redirect.php
+++ b/src/messenger/webim/operator/redirect.php
@@ -15,6 +15,7 @@
require_once('../libs/common.php');
require_once('../libs/operator.php');
require_once('../libs/chat.php');
+require_once('../libs/expand.php');
$operator = check_login();
@@ -49,11 +50,10 @@ if( $nextOperator ) {
$errors[] = "Unknown operator"; // FIXME
}
-start_html_output();
if( count($errors) > 0 ) {
- require('../view/chat_error.php');
+ expand("../design/default/error.tpl");
} else {
- require('../view/redirected.php');
+ expand("../design/default/redirected.tpl");
}
?>
\ No newline at end of file
diff --git a/src/messenger/webim/view/redirect.php b/src/messenger/webim/view/redirect.php
deleted file mode 100644
index 1b2f35e7..00000000
--- a/src/messenger/webim/view/redirect.php
+++ /dev/null
@@ -1,148 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- |
-
-
-
- |
-
-
-
- |
-
-
- |
- |
-
-
-
- |
-
-
-
-
- |
- |
- |
-
-
-
- |
-
-
-
-
- |
- |
-
-
-
- |
- |
- |
-
-
-
- |
- |
-
-
-
- |
-
-
-
-
- |
- |
-
-
-
- |
- |
- |
-
-
-
- |
-
-
-
-
-
diff --git a/src/messenger/webim/view/redirected.php b/src/messenger/webim/view/redirected.php
deleted file mode 100644
index cafc6ec2..00000000
--- a/src/messenger/webim/view/redirected.php
+++ /dev/null
@@ -1,103 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- |
-
-
- |
- |
-
-
-
- |
-
-
-
-
- |
- |
- |
-
-
-
- |
-
-
-
-
-
- |
- |
-
-
-
- |
- |
- |
-
-
-
- |
- |
-
-
-
- |
-
-
-
-
- |
- |
-
-
-
- |
- |
- |
-
-
-
- |
-
-
-
-
-