push context into the chat

git-svn-id: https://webim.svn.sourceforge.net/svnroot/webim/trunk@347 c66351dc-e62f-0410-b875-e3a5c0b9693f
This commit is contained in:
Evgeny Gryaznov 2009-02-08 00:28:33 +00:00
parent b87223a3ee
commit 4cefe08272
6 changed files with 13 additions and 2 deletions

View File

@ -20,6 +20,7 @@ require_once('libs/expand.php');
if( !isset($_GET['token']) || !isset($_GET['thread']) ) {
$chatstyle = verifyparam( "style", "/^\w+$/", "");
$info = isset($_GET['info']) ? $_GET['info'] : "";
$thread = NULL;
if( isset($_SESSION['threadid']) ) {
$thread = reopen_thread($_SESSION['threadid']);
@ -28,6 +29,7 @@ if( !isset($_GET['token']) || !isset($_GET['thread']) ) {
if( !$thread ) {
if(!has_online_operators()) {
setup_logo();
$page['info'] = topage($info);
expand("styles", getchatstyle(), "leavemessage.tpl");
exit;
}
@ -51,6 +53,9 @@ if( !isset($_GET['token']) || !isset($_GET['thread']) ) {
post_message($thread['threadid'],$kind_for_agent,getstring2('chat.came.from',array($referer)));
}
post_message($thread['threadid'],$kind_info,getstring('chat.wait'));
if($info) {
post_message($thread['threadid'],$kind_for_agent,getstring2('chat.visitor.info',array($info)));
}
}
$threadid = $thread['threadid'];
$token = $thread['ltoken'];

View File

@ -22,6 +22,7 @@ $page = array();
$email = getparam('email');
$visitor_name = getparam('name');
$message = getparam('message');
$info = getparam('info');
if( !$email ) {
$errors[] = no_field("form.field.email");
@ -39,13 +40,14 @@ if( count($errors) > 0 ) {
$page['formname'] = topage($visitor_name);
$page['formemail'] = $email;
$page['formmessage'] = topage($message);
$page['info'] = $info;
setup_logo();
expand("styles", getchatstyle(), "leavemessage.tpl");
exit;
}
$subject = getstring2_("leavemail.subject", array($visitor_name), $webim_messages_locale);
$body = getstring2_("leavemail.body", array($visitor_name,$email,$message), $webim_messages_locale);
$body = getstring2_("leavemail.body", array($visitor_name,$email,$message,$info ? "$info\n" : ""), $webim_messages_locale);
loadsettings();
$inbox_mail = $settings['email'];

View File

@ -46,6 +46,7 @@ chat.thread.state_closed=Closed
chat.thread.state_loading=Loading
chat.thread.state_wait=In queue
chat.thread.state_wait_for_another_agent=Waiting for operator
chat.visitor.info=Info: {0}
chat.wait=Thank you for contacting us. An operator will be with you shortly...
chat.window.chatting_with=You chat with:
chat.window.close_title=Close chat
@ -144,7 +145,7 @@ install.updatedb=Please, run <a href="{0}">Update wizard</a> to adjust your data
installed.login_link=Proceed to login page
installed.message=<b>Application installed successfully.</b>
installed.notice=You can logon as admin with empty password.<br/><br/><font color="#c13030"><b>!!! For security reasons, please change your password immediately and remove /webim/install folder from your server.</b></font>
leavemail.body=Your have a message from {0}:\n\n{2}\n\nHis email: {1}\n\n--- \nYours site messenger
leavemail.body=Your have a message from {0}:\n\n{2}\n\nHis email: {1}\n{3}\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.

View File

@ -18,6 +18,7 @@ chat.status.user.changedname
chat.status.user.dead
chat.status.user.left
chat.status.user.reopenedthread
chat.visitor.info
chat.wait
chat.window.chatting_with
chat.window.close_title

View File

@ -44,6 +44,7 @@
<form name="leaveMessageForm" method="post" action="${webimroot}/leavemessage.php">
<input type="hidden" name="style" value="${styleid}"/>
<input type="hidden" name="info" value="${page:info}"/>
<table width="100%" cellspacing="0" cellpadding="0" border="0">
<tr>
<td valign="top" height="150" style="padding:5px">

View File

@ -28,6 +28,7 @@
<form name="leaveMessageForm" method="post" action="${webimroot}/leavemessage.php">
<input type="hidden" name="style" value="${styleid}"/>
<input type="hidden" name="info" value="${page:info}"/>
<table width="100%" height="100%" cellspacing="0" cellpadding="0" border="0">
<tr><td colspan="3" height="15"></td></tr>
<tr>