mirror of
https://github.com/Mibew/tray.git
synced 2024-11-15 09:24:12 +03:00
leave message, check email, db encoding
git-svn-id: https://webim.svn.sourceforge.net/svnroot/webim/trunk@38 c66351dc-e62f-0410-b875-e3a5c0b9693f
This commit is contained in:
parent
d7af7d5e06
commit
31613b60db
@ -14,6 +14,7 @@
|
|||||||
|
|
||||||
require('libs/common.php');
|
require('libs/common.php');
|
||||||
require('libs/chat.php');
|
require('libs/chat.php');
|
||||||
|
require('libs/operator.php');
|
||||||
|
|
||||||
if( !isset($_GET['token']) || !isset($_GET['thread']) ) {
|
if( !isset($_GET['token']) || !isset($_GET['thread']) ) {
|
||||||
|
|
||||||
@ -23,6 +24,12 @@ if( !isset($_GET['token']) || !isset($_GET['thread']) ) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if( !$thread ) {
|
if( !$thread ) {
|
||||||
|
if(!has_online_operators()) {
|
||||||
|
start_html_output();
|
||||||
|
require('view/chat_leavemsg.php');
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
|
||||||
$referer = isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : "";
|
$referer = isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : "";
|
||||||
$remote = isset($_SERVER['REMOTE_HOST']) ? $_SERVER['REMOTE_HOST'] : $_SERVER['REMOTE_ADDR'];
|
$remote = isset($_SERVER['REMOTE_HOST']) ? $_SERVER['REMOTE_HOST'] : $_SERVER['REMOTE_ADDR'];
|
||||||
$visitor = $remote_visitor();
|
$visitor = $remote_visitor();
|
||||||
@ -65,4 +72,4 @@ if( $pparam == "mailthread" ) {
|
|||||||
require('view/chat_oldbrowser.php');
|
require('view/chat_oldbrowser.php');
|
||||||
}
|
}
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
@ -27,7 +27,7 @@ $dbtables = array(
|
|||||||
"referer" => "text",
|
"referer" => "text",
|
||||||
"locale" => "varchar(8)",
|
"locale" => "varchar(8)",
|
||||||
"lastpinguser" => "datetime DEFAULT 0",
|
"lastpinguser" => "datetime DEFAULT 0",
|
||||||
"lastpingagent" => "datetime DEFAULT 0"
|
"lastpingagent" => "datetime DEFAULT 0",
|
||||||
),
|
),
|
||||||
|
|
||||||
"chatmessage" => array(
|
"chatmessage" => array(
|
||||||
@ -56,7 +56,7 @@ $dbtables = array(
|
|||||||
|
|
||||||
$dbtables_can_update = array(
|
$dbtables_can_update = array(
|
||||||
"chatthread" => array("agentId"),
|
"chatthread" => array("agentId"),
|
||||||
"chatmessage" => array("agentId")
|
"chatmessage" => array("agentId"),
|
||||||
);
|
);
|
||||||
|
|
||||||
function show_install_err($text) {
|
function show_install_err($text) {
|
||||||
|
@ -71,6 +71,7 @@ if($act == "createdb") {
|
|||||||
runsql("ALTER TABLE chatthread ADD agentId int NOT NULL DEFAULT 0 AFTER agentName", $link);
|
runsql("ALTER TABLE chatthread ADD agentId int NOT NULL DEFAULT 0 AFTER agentName", $link);
|
||||||
runsql("update chatthread,chatoperator set agentId = operatorid where agentId = 0 AND (vclocalename = agentName OR vccommonname = agentName)", $link);
|
runsql("update chatthread,chatoperator set agentId = operatorid where agentId = 0 AND (vclocalename = agentName OR vccommonname = agentName)", $link);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
58
src/webim/leavemessage.php
Normal file
58
src/webim/leavemessage.php
Normal file
@ -0,0 +1,58 @@
|
|||||||
|
<?php
|
||||||
|
/*
|
||||||
|
* This file is part of Web Instant Messenger project.
|
||||||
|
*
|
||||||
|
* Copyright (c) 2005-2007 Internet Services Ltd.
|
||||||
|
* All rights reserved. This program and the accompanying materials
|
||||||
|
* are made available under the terms of the Eclipse Public License v1.0
|
||||||
|
* which accompanies this distribution, and is available at
|
||||||
|
* http://www.eclipse.org/legal/epl-v10.html
|
||||||
|
*
|
||||||
|
* Contributors:
|
||||||
|
* Evgeny Gryaznov - initial API and implementation
|
||||||
|
*/
|
||||||
|
|
||||||
|
require('libs/common.php');
|
||||||
|
require('libs/chat.php');
|
||||||
|
|
||||||
|
$errors = array();
|
||||||
|
$page = array();
|
||||||
|
|
||||||
|
$mail = getparam('email');
|
||||||
|
$name = getparam('name');
|
||||||
|
$message = getparam('message');
|
||||||
|
|
||||||
|
if( !$mail ) {
|
||||||
|
$errors[] = no_field("form.field.email");
|
||||||
|
} else if( !$name ) {
|
||||||
|
$errors[] = no_field("form.field.name");
|
||||||
|
} else if( !$message ) {
|
||||||
|
$errors[] = no_field("form.field.message");
|
||||||
|
} else {
|
||||||
|
if( !is_valid_email($mail)) {
|
||||||
|
$errors[] = wrong_field("form.field.email");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if( count($errors) > 0 ) {
|
||||||
|
$page['formname'] = $name;
|
||||||
|
$page['formemail'] = $mail;
|
||||||
|
$page['formmessage'] = $message;
|
||||||
|
start_html_output();
|
||||||
|
require('view/chat_leavemsg.php');
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
|
||||||
|
$subject = getstring2_("leavemail.subject", array($name), $webim_messages_encoding);
|
||||||
|
$body = getstring2_("leavemail.body", array($name,$mail,$message), $webim_messages_encoding);
|
||||||
|
|
||||||
|
$headers = 'From: '.$webim_from_email."\r\n" .
|
||||||
|
'Reply-To: '.$mail."\r\n" .
|
||||||
|
'X-Mailer: PHP/'.phpversion();
|
||||||
|
|
||||||
|
mail($webim_messages_mail,$subject,wordwrap($body,70),$headers);
|
||||||
|
|
||||||
|
|
||||||
|
start_html_output();
|
||||||
|
require('view/chat_leavemsgsent.php');
|
||||||
|
?>
|
@ -55,12 +55,14 @@ function post_message_($threadid,$kind,$message,$link,$from=null,$time=null,$opi
|
|||||||
$time ? "FROM_UNIXTIME($time)" : "CURRENT_TIMESTAMP" );
|
$time ? "FROM_UNIXTIME($time)" : "CURRENT_TIMESTAMP" );
|
||||||
|
|
||||||
perform_query($query,$link);
|
perform_query($query,$link);
|
||||||
|
return mysql_insert_id($link);
|
||||||
}
|
}
|
||||||
|
|
||||||
function post_message($threadid,$kind,$message,$from=null,$agentid=null) {
|
function post_message($threadid,$kind,$message,$from=null,$agentid=null) {
|
||||||
$link = connect();
|
$link = connect();
|
||||||
post_message_($threadid,$kind,$message,$link,$from,null,$agentid);
|
$id = post_message_($threadid,$kind,$message,$link,$from,null,$agentid);
|
||||||
mysql_close($link);
|
mysql_close($link);
|
||||||
|
return $id;
|
||||||
}
|
}
|
||||||
|
|
||||||
function prepare_html_message($text) {
|
function prepare_html_message($text) {
|
||||||
@ -110,8 +112,9 @@ function get_messages($threadid,$meth,$isuser,&$lastid) {
|
|||||||
while ($msg = mysql_fetch_array($result, MYSQL_ASSOC)) {
|
while ($msg = mysql_fetch_array($result, MYSQL_ASSOC)) {
|
||||||
$message = ($meth == 'text') ? message_to_text($msg) : message_to_html($msg);
|
$message = ($meth == 'text') ? message_to_text($msg) : message_to_html($msg);
|
||||||
$messages[] = $message;
|
$messages[] = $message;
|
||||||
if( $msg['messageid'] > $lastid )
|
if( $msg['messageid'] > $lastid ) {
|
||||||
$lastid = $msg['messageid'];
|
$lastid = $msg['messageid'];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
mysql_free_result($result);
|
mysql_free_result($result);
|
||||||
|
@ -185,7 +185,7 @@ function connect() {
|
|||||||
or die('Could not connect: ' . mysql_error());
|
or die('Could not connect: ' . mysql_error());
|
||||||
mysql_select_db($mysqldb,$link) or die('Could not select database');
|
mysql_select_db($mysqldb,$link) or die('Could not select database');
|
||||||
if( $force_charset_in_connection ) {
|
if( $force_charset_in_connection ) {
|
||||||
mysql_query("SET character set $dbencoding", $link);
|
mysql_query("SET NAMES '$dbencoding'", $link);
|
||||||
}
|
}
|
||||||
return $link;
|
return $link;
|
||||||
}
|
}
|
||||||
@ -249,6 +249,10 @@ function no_field($key) {
|
|||||||
return getstring2("errors.required",array(getstring($key)));
|
return getstring2("errors.required",array(getstring($key)));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function wrong_field($key) {
|
||||||
|
return getstring2("errors.wrong_field",array(getstring($key)));
|
||||||
|
}
|
||||||
|
|
||||||
function get_popup($href,$message,$title,$wndName,$options) {
|
function get_popup($href,$message,$title,$wndName,$options) {
|
||||||
return "<a href=\"$href\" target=\"_blank\" ".($title?"title=\"$title\" ":"")."onclick=\"this.newWindow = window.open('$href', '$wndName', '$options');this.newWindow.focus();this.newWindow.opener=window;return false;\">$message</a>";
|
return "<a href=\"$href\" target=\"_blank\" ".($title?"title=\"$title\" ":"")."onclick=\"this.newWindow = window.open('$href', '$wndName', '$options');this.newWindow.focus();this.newWindow.opener=window;return false;\">$message</a>";
|
||||||
}
|
}
|
||||||
@ -302,6 +306,10 @@ function date_diff($seconds) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function is_valid_email($mail) {
|
||||||
|
return preg_match("/^[^@]+@[^\.]+(\.[^\.]+)*$/", $mail);
|
||||||
|
}
|
||||||
|
|
||||||
function quote_smart($value,$link) {
|
function quote_smart($value,$link) {
|
||||||
if (get_magic_quotes_gpc()) {
|
if (get_magic_quotes_gpc()) {
|
||||||
$value = stripslashes($value);
|
$value = stripslashes($value);
|
||||||
|
@ -51,6 +51,12 @@ $force_charset_in_connection = true;
|
|||||||
*/
|
*/
|
||||||
$webim_from_email = "webim@yourdomain.com"; // email from field
|
$webim_from_email = "webim@yourdomain.com"; // email from field
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Inbox for left messages
|
||||||
|
*/
|
||||||
|
$webim_messages_mail = "operators@yourdomain.com";
|
||||||
|
$webim_messages_encoding = "en";
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Company international name.
|
* Company international name.
|
||||||
*/
|
*/
|
||||||
|
@ -102,7 +102,7 @@ page.gen_button.code=HTML code
|
|||||||
page.gen_button.sample=Example
|
page.gen_button.sample=Example
|
||||||
page.gen_button.code.description=<strong>Caution!</strong> Please don't change<br/> the code manually because<br/> we don't guarantee that<br/> it will work!
|
page.gen_button.code.description=<strong>Caution!</strong> Please don't change<br/> the code manually because<br/> we don't guarantee that<br/> it will work!
|
||||||
mail.user.history.subject=Web Messenger: dialog history
|
mail.user.history.subject=Web Messenger: dialog history
|
||||||
mail.user.history.body=Hello, {0}!\n\nYour chat history: \n\n{1}\n--- \nKind Regards,\nThe I-Services Support Team
|
mail.user.history.body=Hello, {0}!\n\nYour chat history: \n\n{1}\n--- \nKind Regards,\nWeb Messenger
|
||||||
errors.header=<font color="#c13030"><b>Correct the mistakes:</b><br/><ul>
|
errors.header=<font color="#c13030"><b>Correct the mistakes:</b><br/><ul>
|
||||||
errors.prefix=<li class="error">
|
errors.prefix=<li class="error">
|
||||||
errors.suffix=</li>
|
errors.suffix=</li>
|
||||||
@ -129,8 +129,12 @@ image.button.search=/locales/en/images/search.gif
|
|||||||
chat.came.from=Vistor came from page {0}
|
chat.came.from=Vistor came from page {0}
|
||||||
content.history=Search the dialogs history
|
content.history=Search the dialogs history
|
||||||
content.logoff=Log out of the system.
|
content.logoff=Log out of the system.
|
||||||
|
errors.wrong_field=Please fill "{0}" correctly.
|
||||||
form.field.agent_commonname=International name (Latin)
|
form.field.agent_commonname=International name (Latin)
|
||||||
form.field.agent_commonname.description=This name will be seen by your visitors
|
form.field.agent_commonname.description=This name will be seen by your visitors
|
||||||
|
form.field.email=Your email
|
||||||
|
form.field.message=Message
|
||||||
|
form.field.name=Your name
|
||||||
install.1.connected=You are connected to MySQL server version {0}
|
install.1.connected=You are connected to MySQL server version {0}
|
||||||
install.2.create=Create database "{0}"
|
install.2.create=Create database "{0}"
|
||||||
install.2.db_exists=Database "{0}" is created.
|
install.2.db_exists=Database "{0}" is created.
|
||||||
@ -153,6 +157,15 @@ install.title=Installation
|
|||||||
installed.login_link=Proceed to login page
|
installed.login_link=Proceed to login page
|
||||||
installed.message=<b>Application installed successfully.</b>
|
installed.message=<b>Application installed successfully.</b>
|
||||||
installed.notice=You can logon as admin with empty password. For security reasons, please <br/>change your password immediately and remove /webim/install folder from your server.
|
installed.notice=You can logon as admin with empty password. For security reasons, please <br/>change your password immediately and remove /webim/install folder from your server.
|
||||||
|
leavemail.body=Your have a message from {0}:\n\n{2}\n\nHis email: {1}\n\n--- \nYours site messenger
|
||||||
|
leavemail.subject=Question from {0}
|
||||||
|
leavemessage.close=Close
|
||||||
|
leavemessage.descr=Sorry, no operator is available at the moment. Please, try again later or ask your question in this form.
|
||||||
|
leavemessage.perform=Submit
|
||||||
|
leavemessage.sent.message=Thank you for using our service. We'll answer you by mail as soon as possible.
|
||||||
|
leavemessage.sent.title=Your message is sent
|
||||||
|
leavemessage.title=Leave your message
|
||||||
|
localeid=English (en)
|
||||||
menu.agents=Agents list
|
menu.agents=Agents list
|
||||||
menu.main=Main
|
menu.main=Main
|
||||||
menu.operator=You are {0}
|
menu.operator=You are {0}
|
||||||
|
@ -102,7 +102,7 @@ page.gen_button.code=HTML-
|
|||||||
page.gen_button.sample=Пример
|
page.gen_button.sample=Пример
|
||||||
page.gen_button.code.description=<strong>Внимание!</strong> При внесении<br/> каких-либо изменений<br/> в этот код работоспособность<br/> кнопки не гарантируется!
|
page.gen_button.code.description=<strong>Внимание!</strong> При внесении<br/> каких-либо изменений<br/> в этот код работоспособность<br/> кнопки не гарантируется!
|
||||||
mail.user.history.subject=Вэб Мессенджер: история диалога
|
mail.user.history.subject=Вэб Мессенджер: история диалога
|
||||||
mail.user.history.body=Здраствуйте, {0}!\n\nПо Вашему запросу, высылаем историю: \n\n{1}\n--- \nС уважением,\nСлужба поддержки i-services.ru
|
mail.user.history.body=Здраствуйте, {0}!\n\nПо Вашему запросу, высылаем историю: \n\n{1}\n--- \nС уважением,\nВэб Мессенджер
|
||||||
errors.header=<font color="#c13030"><b>Исправьте ошибки:</b><br/><ul>
|
errors.header=<font color="#c13030"><b>Исправьте ошибки:</b><br/><ul>
|
||||||
errors.prefix=<li class="error">
|
errors.prefix=<li class="error">
|
||||||
errors.suffix=</li>
|
errors.suffix=</li>
|
||||||
@ -129,8 +129,12 @@ image.button.search=/locales/ru/images/search.gif
|
|||||||
chat.came.from=Посетитель пришел со страницы {0}
|
chat.came.from=Посетитель пришел со страницы {0}
|
||||||
content.history=Поиск по истории диалогов
|
content.history=Поиск по истории диалогов
|
||||||
content.logoff=Покинуть систему.
|
content.logoff=Покинуть систему.
|
||||||
|
errors.wrong_field=Неправильно заполнено поле "{0}"
|
||||||
form.field.agent_commonname=Интернациональное имя (латиницей)
|
form.field.agent_commonname=Интернациональное имя (латиницей)
|
||||||
form.field.agent_commonname.description=Под этим именем Вас увидят ваши посетители из других стран
|
form.field.agent_commonname.description=Под этим именем Вас увидят ваши посетители из других стран
|
||||||
|
form.field.email=Ваш email
|
||||||
|
form.field.message=Сообщение
|
||||||
|
form.field.name=Ваше имя
|
||||||
install.1.connected=Вы подсоединены к серверу MySQL версии {0}.
|
install.1.connected=Вы подсоединены к серверу MySQL версии {0}.
|
||||||
install.2.create=Создать базу данных "{0}"
|
install.2.create=Создать базу данных "{0}"
|
||||||
install.2.db_exists=Создана база данных "{0}".
|
install.2.db_exists=Создана база данных "{0}".
|
||||||
@ -153,6 +157,15 @@ install.title=
|
|||||||
installed.login_link=Войти в систему
|
installed.login_link=Войти в систему
|
||||||
installed.message=<b>Установка успешно завершена. </b>
|
installed.message=<b>Установка успешно завершена. </b>
|
||||||
installed.notice=Вы можете войти в систему как admin с пустым паролем.<br/>В целях безопасности, удалите, пожалуйста, каталог /webim/install с вашего сервера и поменяйте пароль.
|
installed.notice=Вы можете войти в систему как admin с пустым паролем.<br/>В целях безопасности, удалите, пожалуйста, каталог /webim/install с вашего сервера и поменяйте пароль.
|
||||||
|
leavemail.body=Ваш посетитель {0} оставил сообщение:\n\n{2}\n\nЕго email: {1}\n\n--- \nС уважением,\nВаш вэб-мессенджер
|
||||||
|
leavemail.subject=Вопрос от {0}
|
||||||
|
leavemessage.close=Закрыть
|
||||||
|
leavemessage.descr=К сожалению, сейчас нет ни одного доступного оператора. Попробуйте обратиться позже или оставьте нам свой вопрос и мы свяжемся с Вами по оставленному адресу.
|
||||||
|
leavemessage.perform=Передать
|
||||||
|
leavemessage.sent.message=Спасибо за ваш вопрос, мы постараемся ответить на него как можно быстрее.
|
||||||
|
leavemessage.sent.title=Ваше сообщение сохранено
|
||||||
|
leavemessage.title=Оставьте ваше сообщение
|
||||||
|
localeid=Russian (ru)
|
||||||
menu.agents=Список агентов
|
menu.agents=Список агентов
|
||||||
menu.main=Главная
|
menu.main=Главная
|
||||||
menu.operator=Вы {0}
|
menu.operator=Вы {0}
|
||||||
|
@ -15,6 +15,9 @@
|
|||||||
require('libs/common.php');
|
require('libs/common.php');
|
||||||
require('libs/chat.php');
|
require('libs/chat.php');
|
||||||
|
|
||||||
|
$errors = array();
|
||||||
|
$page = array();
|
||||||
|
|
||||||
$token = verifyparam( "token", "/^\d{1,8}$/");
|
$token = verifyparam( "token", "/^\d{1,8}$/");
|
||||||
$threadid = verifyparam( "thread", "/^\d{1,8}$/");
|
$threadid = verifyparam( "thread", "/^\d{1,8}$/");
|
||||||
|
|
||||||
@ -26,7 +29,21 @@ if( !$thread || !isset($thread['ltoken']) || $token != $thread['ltoken'] ) {
|
|||||||
$mail = getparam('email');
|
$mail = getparam('email');
|
||||||
$page['email'] = $mail;
|
$page['email'] = $mail;
|
||||||
|
|
||||||
// TODO check email
|
if( !$mail ) {
|
||||||
|
$errors[] = no_field("form.field.email");
|
||||||
|
} else if( !is_valid_email($mail)) {
|
||||||
|
$errors[] = wrong_field("form.field.email");
|
||||||
|
}
|
||||||
|
|
||||||
|
if( count($errors) > 0 ) {
|
||||||
|
$page['formemail'] = $mail;
|
||||||
|
$page['ct.chatThreadId'] = $thread['threadid'];
|
||||||
|
$page['ct.token'] = $thread['ltoken'];
|
||||||
|
$page['level'] = "";
|
||||||
|
start_html_output();
|
||||||
|
require('view/chat_mailthread.php');
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
|
||||||
$history = "";
|
$history = "";
|
||||||
$lastid = -1;
|
$lastid = -1;
|
||||||
|
@ -31,8 +31,7 @@ if( !isset($_GET['token']) ) {
|
|||||||
die("wrong thread");
|
die("wrong thread");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
take_thread($thread,$operator);
|
||||||
take_thread($thread,$operator);
|
|
||||||
|
|
||||||
$token = $thread['ltoken'];
|
$token = $thread['ltoken'];
|
||||||
header("Location: ".$_SERVER['PHP_SELF']."?thread=$threadid&token=$token");
|
header("Location: ".$_SERVER['PHP_SELF']."?thread=$threadid&token=$token");
|
||||||
|
@ -48,12 +48,14 @@ function thread_to_xml($thread) {
|
|||||||
$threadoperator = ($thread['agentName'] ? $thread['agentName'] : "-");
|
$threadoperator = ($thread['agentName'] ? $thread['agentName'] : "-");
|
||||||
|
|
||||||
$result .= " canopen=\"true\"";
|
$result .= " canopen=\"true\"";
|
||||||
|
|
||||||
$result .= " state=\"$state\">";
|
$result .= " state=\"$state\">";
|
||||||
$result .= "<name>".htmlspecialchars(htmlspecialchars(get_user_name($thread['userName'])))."</name>";
|
$result .= "<name>".htmlspecialchars(htmlspecialchars(get_user_name($thread['userName'])))."</name>";
|
||||||
$result .= "<addr>".htmlspecialchars(htmlspecialchars($thread['remote']))."</addr>";
|
$result .= "<addr>".htmlspecialchars(htmlspecialchars($thread['remote']))."</addr>";
|
||||||
$result .= "<agent>".htmlspecialchars(htmlspecialchars($threadoperator))."</agent>";
|
$result .= "<agent>".htmlspecialchars(htmlspecialchars($threadoperator))."</agent>";
|
||||||
$result .= "<time>".$thread['unix_timestamp(dtmcreated)']."000</time>";
|
$result .= "<time>".$thread['unix_timestamp(dtmcreated)']."000</time>";
|
||||||
$result .= "<modified>".$thread['unix_timestamp(dtmmodified)']."000</modified>";
|
$result .= "<modified>".$thread['unix_timestamp(dtmmodified)']."000</modified>";
|
||||||
|
|
||||||
$result .= "</thread>";
|
$result .= "</thread>";
|
||||||
return $result;
|
return $result;
|
||||||
}
|
}
|
||||||
|
@ -76,8 +76,11 @@ if( $act == "refresh" ) {
|
|||||||
exit;
|
exit;
|
||||||
|
|
||||||
} else if( $act == "close" ) {
|
} else if( $act == "close" ) {
|
||||||
|
|
||||||
|
if( $isuser || $thread['agentId'] == $operator['operatorid']) {
|
||||||
|
close_thread($thread, $isuser);
|
||||||
|
}
|
||||||
|
|
||||||
close_thread($thread, $isuser);
|
|
||||||
start_xml_output();
|
start_xml_output();
|
||||||
echo "<closed></closed>";
|
echo "<closed></closed>";
|
||||||
exit;
|
exit;
|
||||||
|
@ -120,7 +120,7 @@ var threadParams = { servl:"<?php echo $webimroot ?>/thread.php",wroot:"<?php ec
|
|||||||
|
|
||||||
<td><img src='<?php echo $webimroot ?>/images/buttondiv.gif' width="35" height="45" border="0" alt="" /></td>
|
<td><img src='<?php echo $webimroot ?>/images/buttondiv.gif' width="35" height="45" border="0" alt="" /></td>
|
||||||
<?php if( $page['user'] ) { ?>
|
<?php if( $page['user'] ) { ?>
|
||||||
<td><a href="<?php echo $page['selfLink'] ?>&act=mailthread" target="_blank" title="<?php echo getstring("chat.window.toolbar.mail_history") ?>" onclick="this.newWindow = window.open('<?php echo $page['selfLink'] ?>&act=mailthread', 'ForwardMail', 'toolbar=0,scrollbars=0,location=0,statusbar=1,menubar=0,width=603,height=204,resizable=0');this.newWindow.focus();this.newWindow.opener=window;return false;"><img src='<?php echo $webimroot ?>/images/buttons/email.gif' width="25" height="25" border="0" alt="Mail "/></a></td>
|
<td><a href="<?php echo $page['selfLink'] ?>&act=mailthread" target="_blank" title="<?php echo getstring("chat.window.toolbar.mail_history") ?>" onclick="this.newWindow = window.open('<?php echo $page['selfLink'] ?>&act=mailthread', 'ForwardMail', 'toolbar=0,scrollbars=0,location=0,statusbar=1,menubar=0,width=603,height=254,resizable=0');this.newWindow.focus();this.newWindow.opener=window;return false;"><img src='<?php echo $webimroot ?>/images/buttons/email.gif' width="25" height="25" border="0" alt="Mail "/></a></td>
|
||||||
<?php } ?>
|
<?php } ?>
|
||||||
|
|
||||||
<td><a id="refresh" href="javascript:void(0)" onclick="return false;" title="<?php echo getstring("chat.window.toolbar.refresh") ?>">
|
<td><a id="refresh" href="javascript:void(0)" onclick="return false;" title="<?php echo getstring("chat.window.toolbar.refresh") ?>">
|
||||||
|
146
src/webim/view/chat_leavemsg.php
Normal file
146
src/webim/view/chat_leavemsg.php
Normal file
@ -0,0 +1,146 @@
|
|||||||
|
<?php
|
||||||
|
/*
|
||||||
|
* This file is part of Web Instant Messenger project.
|
||||||
|
*
|
||||||
|
* Copyright (c) 2005-2007 Internet Services Ltd.
|
||||||
|
* All rights reserved. This program and the accompanying materials
|
||||||
|
* are made available under the terms of the Eclipse Public License v1.0
|
||||||
|
* which accompanies this distribution, and is available at
|
||||||
|
* http://www.eclipse.org/legal/epl-v10.html
|
||||||
|
*
|
||||||
|
* Contributors:
|
||||||
|
* Evgeny Gryaznov - initial API and implementation
|
||||||
|
*/
|
||||||
|
?>
|
||||||
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<title><?php echo getstring("leavemessage.title") ?></title>
|
||||||
|
<link rel="shortcut icon" href="<?php echo $webimroot ?>/images/favicon.ico" type="image/x-icon"/>
|
||||||
|
<link rel="stylesheet" type="text/css" href="<?php echo $webimroot ?>/chat.css" />
|
||||||
|
</head>
|
||||||
|
<body bgcolor="#FFFFFF" background="<?php echo $webimroot ?>/images/bg.gif" text="#000000" link="#C28400" vlink="#C28400" alink="#C28400" marginwidth="0" marginheight="0" leftmargin="0" rightmargin="0" topmargin="0" bottommargin="0">
|
||||||
|
<table width="100%" height="100%" cellspacing="0" cellpadding="0" border="0">
|
||||||
|
<tr>
|
||||||
|
<td valign="top">
|
||||||
|
|
||||||
|
<form name="leaveMessageForm" method="post" action="<?php echo $webimroot ?>/leavemessage.php">
|
||||||
|
|
||||||
|
<table width="100%" height="100%" cellspacing="0" cellpadding="0" border="0">
|
||||||
|
<tr><td colspan="3" height="15"></td></tr>
|
||||||
|
<tr>
|
||||||
|
<td height="40"></td>
|
||||||
|
<td class="window">
|
||||||
|
<h1><?php echo getstring("leavemessage.title") ?></h1>
|
||||||
|
</td>
|
||||||
|
<td></td>
|
||||||
|
</tr>
|
||||||
|
<tr><td></td>
|
||||||
|
<td height="25">
|
||||||
|
<?php if( isset($errors) && count($errors) > 0 ) { ?>
|
||||||
|
<table cellspacing="0" cellpadding="0" border="0">
|
||||||
|
<tr>
|
||||||
|
<td valign="top"><img src='<?php echo $webimroot ?>/images/icon_err.gif' width="40" height="40" border="0" alt="" /></td>
|
||||||
|
<td width="10"></td>
|
||||||
|
<td class="text">
|
||||||
|
<?php if( isset($errors) && count($errors) > 0 ) {
|
||||||
|
print getstring("errors.header");
|
||||||
|
foreach( $errors as $e ) {
|
||||||
|
print getstring("errors.prefix");
|
||||||
|
print $e;
|
||||||
|
print getstring("errors.suffix");
|
||||||
|
}
|
||||||
|
print getstring("errors.footer");
|
||||||
|
} ?>
|
||||||
|
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
<?php } ?>
|
||||||
|
</td><td></td>
|
||||||
|
</tr>
|
||||||
|
|
||||||
|
<tr>
|
||||||
|
<td height="60"></td>
|
||||||
|
<td>
|
||||||
|
|
||||||
|
<table cellspacing="0" cellpadding="0" border="0"><tr><td width="15"><img src="<?php echo $webimroot ?>/images/wincrnlt.gif" width="15" height="15" border="0" alt="" /></td><td width="100%" background="<?php echo $webimroot ?>/images/winbg.gif" class="bgcy"><img src="<?php echo $webimroot ?>/images/free.gif" width="1" height="1" border="0" alt="" /></td><td width="15"><img src="<?php echo $webimroot ?>/images/wincrnrt.gif" width="15" height="15" border="0" alt="" /></td></tr><tr><td height="100%" bgcolor="#FED840"><img src="<?php echo $webimroot ?>/images/free.gif" width="1" height="1" border="0" alt="" /></td><td background="<?php echo $webimroot ?>/images/winbg.gif" class="bgcy"><table cellspacing="0" cellpadding="0" border="0">
|
||||||
|
<tr>
|
||||||
|
<td colspan="3" class="text"><?php echo getstring("leavemessage.descr") ?></td>
|
||||||
|
</tr>
|
||||||
|
<tr><td height="20" colspan="3"></td></tr>
|
||||||
|
<tr>
|
||||||
|
<td class="text"><?php echo getstring("form.field.email") ?>:</td>
|
||||||
|
<td width="20"></td>
|
||||||
|
<td><input type="text" name="email" size="50" value="<?php echo form_value('email') ?>" class="username"/></td>
|
||||||
|
</tr>
|
||||||
|
<tr><td height="7" colspan="3"></td></tr>
|
||||||
|
<tr>
|
||||||
|
<td class="text"><?php echo getstring("form.field.name") ?>:</td>
|
||||||
|
<td width="20"></td>
|
||||||
|
<td><input type="text" name="name" size="50" value="<?php echo form_value('name') ?>" class="username"/></td>
|
||||||
|
</tr>
|
||||||
|
<tr><td height="7" colspan="3"></td></tr>
|
||||||
|
<tr>
|
||||||
|
<td class="text"><?php echo getstring("form.field.message") ?>:</td>
|
||||||
|
<td width="20"></td>
|
||||||
|
<td height="120" valign="top"><table width="100%" height="100%" cellspacing="0" cellpadding="0" border="0"><tr><td colspan="3" bgcolor="#A1A1A1"><img src="<?php echo $webimroot ?>/images/free.gif" width="1" height="1" border="0" alt="" /></td></tr><tr><td bgcolor="#A1A1A1"><img src="<?php echo $webimroot ?>/images/free.gif" width="1" height="1" border="0" alt="" /></td><td width="100%" height="100%" bgcolor="#FFFFFF" valign="top">
|
||||||
|
<textarea name="message" class="message" tabindex="0"><?php echo form_value('message') ?></textarea>
|
||||||
|
</td><td bgcolor="#A1A1A1"><img src="<?php echo $webimroot ?>/images/free.gif" width="1" height="1" border="0" alt="" /></td></tr><tr><td colspan="3" bgcolor="#A1A1A1"><img src="<?php echo $webimroot ?>/images/free.gif" width="1" height="1" border="0" alt="" /></td></tr></table></td>
|
||||||
|
</tr>
|
||||||
|
</table></td><td bgcolor="#E8A400"><img src="<?php echo $webimroot ?>/images/free.gif" width="1" height="1" border="0" alt="" /></td></tr><tr><td><img src="<?php echo $webimroot ?>/images/wincrnlb.gif" width="15" height="15" border="0" alt="" /></td><td background="<?php echo $webimroot ?>/images/winbg.gif" class="bgcy"><img src="<?php echo $webimroot ?>/images/free.gif" width="1" height="1" border="0" alt="" /></td><td><img src="<?php echo $webimroot ?>/images/wincrnrb.gif" width="15" height="15" border="0" alt=""/></td></tr></table>
|
||||||
|
|
||||||
|
</td>
|
||||||
|
<td></td>
|
||||||
|
</tr>
|
||||||
|
|
||||||
|
<tr>
|
||||||
|
<td height="70"></td>
|
||||||
|
<td>
|
||||||
|
|
||||||
|
<table width="100%" cellspacing="0" cellpadding="0" border="0">
|
||||||
|
<tr>
|
||||||
|
<td width="50%">
|
||||||
|
<table cellspacing="0" cellpadding="0" border="0">
|
||||||
|
<tr>
|
||||||
|
<td><a href="javascript:document.leaveMessageForm.submit();" title="<?php echo getstring("leavemessage.perform") ?>"><img src='<?php echo $webimroot ?>/images/submit.gif' width="40" height="35" border="0" alt="" /></a></td>
|
||||||
|
<td background="<?php echo $webimroot ?>/images/submitbg.gif" valign="top" class="submit">
|
||||||
|
<img src='<?php echo $webimroot ?>/images/free.gif' width="1" height="10" border="0" alt="" /><br>
|
||||||
|
<a href="javascript:document.leaveMessageForm.submit();" title="<?php echo getstring("leavemessage.perform") ?>"><?php echo getstring("leavemessage.perform") ?></a><br>
|
||||||
|
</td>
|
||||||
|
<td width="10"><a href="javascript:document.leaveMessageForm.submit();" title="<?php echo getstring("leavemessage.perform") ?>"><img src='<?php echo $webimroot ?>/images/submitrest.gif' width="10" height="35" border="0" alt="" /></a></td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</td>
|
||||||
|
<td width="50%" align="right">
|
||||||
|
<table cellspacing="0" cellpadding="0" border="0">
|
||||||
|
<tr>
|
||||||
|
<td><a href="javascript:window.close();" title="<?php echo getstring("leavemessage.close") ?>"><img src='<?php echo $webimroot ?>/images/buttons/back.gif' width="25" height="25" border="0" alt="" /></a></td>
|
||||||
|
<td width="5"></td>
|
||||||
|
<td class="button"><a href="javascript:window.close();" title="<?php echo getstring("leavemessage.close") ?>"><?php echo getstring("leavemessage.close") ?></a></td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
|
||||||
|
</td>
|
||||||
|
<td></td>
|
||||||
|
</tr>
|
||||||
|
|
||||||
|
<tr>
|
||||||
|
<td width="30"><img src='<?php echo $webimroot ?>/images/free.gif' width="30" height="1" border="0" alt="" /></td>
|
||||||
|
<td width="100%"><img src='<?php echo $webimroot ?>/images/free.gif' width="540" height="1" border="0" alt="" /></td>
|
||||||
|
<td width="30"><img src='<?php echo $webimroot ?>/images/free.gif' width="30" height="1" border="0" alt="" /></td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
|
||||||
|
</form>
|
||||||
|
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
|
|
102
src/webim/view/chat_leavemsgsent.php
Normal file
102
src/webim/view/chat_leavemsgsent.php
Normal file
@ -0,0 +1,102 @@
|
|||||||
|
<?php
|
||||||
|
/*
|
||||||
|
* This file is part of Web Instant Messenger project.
|
||||||
|
*
|
||||||
|
* Copyright (c) 2005-2007 Internet Services Ltd.
|
||||||
|
* All rights reserved. This program and the accompanying materials
|
||||||
|
* are made available under the terms of the Eclipse Public License v1.0
|
||||||
|
* which accompanies this distribution, and is available at
|
||||||
|
* http://www.eclipse.org/legal/epl-v10.html
|
||||||
|
*
|
||||||
|
* Contributors:
|
||||||
|
* Evgeny Gryaznov - initial API and implementation
|
||||||
|
*/
|
||||||
|
?>
|
||||||
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<title><?php echo getstring("leavemessage.sent.title") ?></title>
|
||||||
|
<link rel="shortcut icon" href="<?php echo $webimroot ?>/images/favicon.ico" type="image/x-icon"/>
|
||||||
|
<link rel="stylesheet" type="text/css" href="<?php echo $webimroot ?>/chat.css" />
|
||||||
|
</head>
|
||||||
|
<body bgcolor="#FFFFFF" background="<?php echo $webimroot ?>/images/bg.gif" text="#000000" link="#C28400" vlink="#C28400" alink="#C28400" marginwidth="0" marginheight="0" leftmargin="0" rightmargin="0" topmargin="0" bottommargin="0">
|
||||||
|
<table width="100%" height="100%" cellspacing="0" cellpadding="0" border="0">
|
||||||
|
<tr>
|
||||||
|
<td valign="top">
|
||||||
|
|
||||||
|
<table width="100%" height="100%" cellspacing="0" cellpadding="0" border="0">
|
||||||
|
<tr>
|
||||||
|
<td height="75"></td>
|
||||||
|
<td class="window">
|
||||||
|
<h1><?php echo getstring("leavemessage.sent.title") ?></h1>
|
||||||
|
</td>
|
||||||
|
<td></td>
|
||||||
|
</tr>
|
||||||
|
|
||||||
|
<tr>
|
||||||
|
<td height="100%"></td>
|
||||||
|
<td>
|
||||||
|
|
||||||
|
<table width="100%" height="100%" cellspacing="0" cellpadding="0" border="0">
|
||||||
|
<tr>
|
||||||
|
<td width="15"><img src='<?php echo $webimroot ?>/images/wincrnlt.gif' width="15" height="15" border="0" alt="" /></td>
|
||||||
|
<td width="100%" background="<?php echo $webimroot ?>/images/winbg.gif" class="bgcy"><img src='<?php echo $webimroot ?>/images/free.gif' width="1" height="1" border="0" alt="" /></td>
|
||||||
|
<td width="15"><img src='<?php echo $webimroot ?>/images/wincrnrt.gif' width="15" height="15" border="0" alt="" /></td>
|
||||||
|
</tr>
|
||||||
|
|
||||||
|
<tr>
|
||||||
|
<td height="100%" bgcolor="#FED840"><img src='<?php echo $webimroot ?>/images/free.gif' width="1" height="1" border="0" alt="" /></td>
|
||||||
|
<td background="<?php echo $webimroot ?>/images/winbg.gif" class="bgcy">
|
||||||
|
|
||||||
|
<?php echo getstring("leavemessage.sent.message") ?><br/>
|
||||||
|
</td>
|
||||||
|
<td bgcolor="#E8A400"><img src='<?php echo $webimroot ?>/images/free.gif' width="1" height="1" border="0" alt="" /></td>
|
||||||
|
</tr>
|
||||||
|
|
||||||
|
<tr>
|
||||||
|
<td><img src='<?php echo $webimroot ?>/images/wincrnlb.gif' width="15" height="15" border="0" alt="" /></td>
|
||||||
|
<td background="<?php echo $webimroot ?>/images/winbg.gif" class="bgcy"><img src='<?php echo $webimroot ?>/images/free.gif' width="1" height="1" border="0" alt="" /></td>
|
||||||
|
<td><img src='<?php echo $webimroot ?>/images/wincrnrb.gif' width="15" height="15" border="0" alt="" /></td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
|
||||||
|
</td>
|
||||||
|
<td></td>
|
||||||
|
</tr>
|
||||||
|
|
||||||
|
<tr>
|
||||||
|
<td height="70"></td>
|
||||||
|
<td>
|
||||||
|
|
||||||
|
<table width="100%" cellspacing="0" cellpadding="0" border="0">
|
||||||
|
<tr>
|
||||||
|
<td width="100%" align="right">
|
||||||
|
<table cellspacing="0" cellpadding="0" border="0">
|
||||||
|
<tr>
|
||||||
|
<td><a href="javascript:window.close();" title="<?php echo getstring("chat.mailthread.sent.close") ?>"><img src='<?php echo $webimroot ?>/images/buttons/back.gif' width="25" height="25" border="0" alt="" /></a></td>
|
||||||
|
<td width="5"></td>
|
||||||
|
<td class="button"><a href="javascript:window.close();" title="<?php echo getstring("chat.mailthread.sent.close") ?>"><?php echo getstring("chat.mailthread.sent.close") ?></a></td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
|
||||||
|
</td>
|
||||||
|
<td></td>
|
||||||
|
</tr>
|
||||||
|
|
||||||
|
<tr>
|
||||||
|
<td width="30"><img src='<?php echo $webimroot ?>/images/free.gif' width="30" height="1" border="0" alt="" /></td>
|
||||||
|
<td width="100%"><img src='<?php echo $webimroot ?>/images/free.gif' width="540" height="1" border="0" alt="" /></td>
|
||||||
|
<td width="30"><img src='<?php echo $webimroot ?>/images/free.gif' width="30" height="1" border="0" alt="" /></td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
|
|
@ -35,6 +35,30 @@
|
|||||||
</td>
|
</td>
|
||||||
<td></td>
|
<td></td>
|
||||||
</tr>
|
</tr>
|
||||||
|
<tr><td></td>
|
||||||
|
<td height="25">
|
||||||
|
<?php if( isset($errors) && count($errors) > 0 ) { ?>
|
||||||
|
<table cellspacing="0" cellpadding="0" border="0">
|
||||||
|
<tr>
|
||||||
|
<td valign="top"><img src='<?php echo $webimroot ?>/images/icon_err.gif' width="40" height="40" border="0" alt="" /></td>
|
||||||
|
<td width="10"></td>
|
||||||
|
<td class="text">
|
||||||
|
<?php if( isset($errors) && count($errors) > 0 ) {
|
||||||
|
print getstring("errors.header");
|
||||||
|
foreach( $errors as $e ) {
|
||||||
|
print getstring("errors.prefix");
|
||||||
|
print $e;
|
||||||
|
print getstring("errors.suffix");
|
||||||
|
}
|
||||||
|
print getstring("errors.footer");
|
||||||
|
} ?>
|
||||||
|
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
<?php } ?>
|
||||||
|
</td><td></td>
|
||||||
|
</tr>
|
||||||
|
|
||||||
<tr>
|
<tr>
|
||||||
<td height="60"></td>
|
<td height="60"></td>
|
||||||
|
@ -89,7 +89,7 @@
|
|||||||
|
|
||||||
<td><img src='<?php echo $webimroot ?>/images/buttondiv.gif' width="35" height="45" border="0" alt="" /></td>
|
<td><img src='<?php echo $webimroot ?>/images/buttondiv.gif' width="35" height="45" border="0" alt="" /></td>
|
||||||
|
|
||||||
<td><a href="<?php echo $page['selfLink'] ?>&act=mailthread" target="_blank" title="<?php echo getstring("chat.window.toolbar.mail_history") ?>" onclick="this.newWindow = window.open('<?php echo $page['selfLink'] ?>&act=mailthread', 'ForwardMail', 'toolbar=0,scrollbars=0,location=0,statusbar=1,menubar=0,width=603,height=204,resizable=0');this.newWindow.focus();this.newWindow.opener=window;return false;"><img src='<?php echo $webimroot ?>/images/buttons/email.gif' width="25" height="25" border="0" alt="Mail" /></a></td>
|
<td><a href="<?php echo $page['selfLink'] ?>&act=mailthread" target="_blank" title="<?php echo getstring("chat.window.toolbar.mail_history") ?>" onclick="this.newWindow = window.open('<?php echo $page['selfLink'] ?>&act=mailthread', 'ForwardMail', 'toolbar=0,scrollbars=0,location=0,statusbar=1,menubar=0,width=603,height=254,resizable=0');this.newWindow.focus();this.newWindow.opener=window;return false;"><img src='<?php echo $webimroot ?>/images/buttons/email.gif' width="25" height="25" border="0" alt="Mail" /></a></td>
|
||||||
|
|
||||||
<td><a id="refresh" href="javascript:void(0)" onclick="return false;" title="<?php echo getstring("chat.window.toolbar.refresh") ?>">
|
<td><a id="refresh" href="javascript:void(0)" onclick="return false;" title="<?php echo getstring("chat.window.toolbar.refresh") ?>">
|
||||||
<img src='<?php echo $webimroot ?>/images/buttons/refresh.gif' width="25" height="25" border="0" alt="Refresh" /></a></td>
|
<img src='<?php echo $webimroot ?>/images/buttons/refresh.gif' width="25" height="25" border="0" alt="Refresh" /></a></td>
|
||||||
|
Loading…
Reference in New Issue
Block a user