Added some string related to threads error to localization

This commit is contained in:
Dmitriy Simushev 2012-02-06 19:58:36 +00:00
parent 96c4727be2
commit 1f4582ab20
4 changed files with 28 additions and 6 deletions

View File

@ -682,13 +682,14 @@ function take_thread($thread, $operator)
$message_to_post = getstring2_("chat.status.operator.changed", array($operatorName, $thread['agentName']), $thread['locale']); $message_to_post = getstring2_("chat.status.operator.changed", array($operatorName, $thread['agentName']), $thread['locale']);
} }
} else { } else {
die("cannot take thread"); return false;
} }
if ($message_to_post) { if ($message_to_post) {
post_message($threadid, $kind_events, $message_to_post); post_message($threadid, $kind_events, $message_to_post);
post_message($threadid, $kind_avatar, $operator['vcavatar'] ? $operator['vcavatar'] : ""); post_message($threadid, $kind_avatar, $operator['vcavatar'] ? $operator['vcavatar'] : "");
} }
return true;
} }
function check_for_reassign($thread, $operator) function check_for_reassign($thread, $operator)

View File

@ -542,6 +542,11 @@ tag.pagination.no_items=Found 0 elements
tag.pagination.previous=previous tag.pagination.previous=previous
thread.back_to_search=Go to search thread.back_to_search=Go to search
thread.chat_log=Chat log thread.chat_log=Chat log
thread.error.cannot_take=Cannot take thread
thread.error.cannot_take_over=Cannot take over
thread.error.cannot_view=Cannot view threads
thread.error.old_browser=Old browser is used, please update it
thread.error.wrong_thread=Wrong thread
thread.intro=This page displays chat details and content. thread.intro=This page displays chat details and content.
time.dateformat=%B %d, %Y time.dateformat=%B %d, %Y
time.locale=en_US time.locale=en_US

View File

@ -540,6 +540,11 @@ tag.pagination.no_items=
tag.pagination.previous=ïðåäûäóùàÿ tag.pagination.previous=ïðåäûäóùàÿ
thread.back_to_search=Ïåðåéòè â ïîèñê thread.back_to_search=Ïåðåéòè â ïîèñê
thread.chat_log=Ïðîòîêîë ðàçãîâîðà thread.chat_log=Ïðîòîêîë ðàçãîâîðà
thread.error.cannot_take=Невозможно установить диалог
thread.error.cannot_take_over=Вы не можете перехватывать диалоги
thread.error.cannot_view=Вы не можете просматривать диалоги
thread.error.old_browser=Вы используете устаревший браузер, пожалуйста, обновите его
thread.error.wrong_thread=Диалог не существует
thread.intro=Íà äàííîé ñòðàíèöå Âû ìîæåòå ïðîñìîòðåòü äèàëîã. thread.intro=Íà äàííîé ñòðàíèöå Âû ìîæåòå ïðîñìîòðåòü äèàëîã.
time.dateformat=%d %B %Y, time.dateformat=%d %B %Y,
time.locale=ru_RU.UTF-8 time.locale=ru_RU.UTF-8

View File

@ -48,12 +48,18 @@ if (!isset($_GET['token'])) {
$remote_level = get_remote_level($_SERVER['HTTP_USER_AGENT']); $remote_level = get_remote_level($_SERVER['HTTP_USER_AGENT']);
if ($remote_level != "ajaxed") { if ($remote_level != "ajaxed") {
die("old browser is used, please update it"); $errors = array(getlocal("thread.error.old_browser"));
start_html_output();
expand("../styles/dialogs", getchatstyle(), "error.tpl");
exit;
} }
$thread = thread_by_id($threadid); $thread = thread_by_id($threadid);
if (!$thread || !isset($thread['ltoken'])) { if (!$thread || !isset($thread['ltoken'])) {
die("wrong thread"); $errors = array(getlocal("thread.error.wrong_thread"));
start_html_output();
expand("../styles/dialogs", getchatstyle(), "error.tpl");
exit;
} }
$viewonly = verifyparam("viewonly", "/^true$/", false); $viewonly = verifyparam("viewonly", "/^true$/", false);
@ -62,7 +68,7 @@ if (!isset($_GET['token'])) {
if (!$viewonly && $thread['istate'] == $state_chatting && $operator['operatorid'] != $thread['agentId']) { if (!$viewonly && $thread['istate'] == $state_chatting && $operator['operatorid'] != $thread['agentId']) {
if (!is_capable($can_takeover, $operator)) { if (!is_capable($can_takeover, $operator)) {
$errors = array("Cannot take over"); $errors = array(getlocal("thread.error.cannot_take_over"));
start_html_output(); start_html_output();
expand("../styles/dialogs", getchatstyle(), "error.tpl"); expand("../styles/dialogs", getchatstyle(), "error.tpl");
exit; exit;
@ -79,9 +85,14 @@ if (!isset($_GET['token'])) {
} }
if (!$viewonly) { if (!$viewonly) {
take_thread($thread, $operator); if(! take_thread($thread, $operator)){
$errors = array(getlocal("thread.error.cannot_take"));
start_html_output();
expand("../styles/dialogs", getchatstyle(), "error.tpl");
exit;
}
} else if (!is_capable($can_viewthreads, $operator)) { } else if (!is_capable($can_viewthreads, $operator)) {
$errors = array("Cannot view threads"); $errors = array(getlocal("thread.error.cannot_view"));
start_html_output(); start_html_output();
expand("../styles/dialogs", getchatstyle(), "error.tpl"); expand("../styles/dialogs", getchatstyle(), "error.tpl");
exit; exit;