From 4cefe0827250aecf2d7aa665a915e68ea0d6fb48 Mon Sep 17 00:00:00 2001 From: Evgeny Gryaznov Date: Sun, 8 Feb 2009 00:28:33 +0000 Subject: [PATCH] push context into the chat git-svn-id: https://webim.svn.sourceforge.net/svnroot/webim/trunk@347 c66351dc-e62f-0410-b875-e3a5c0b9693f --- src/messenger/webim/client.php | 5 +++++ src/messenger/webim/leavemessage.php | 4 +++- src/messenger/webim/locales/en/properties | 3 ++- src/messenger/webim/locales/names/level1 | 1 + .../webim/styles/default/templates/leavemessage.tpl | 1 + .../webim/styles/original/templates/leavemessage.tpl | 1 + 6 files changed, 13 insertions(+), 2 deletions(-) diff --git a/src/messenger/webim/client.php b/src/messenger/webim/client.php index 61c64de8..0932c63e 100644 --- a/src/messenger/webim/client.php +++ b/src/messenger/webim/client.php @@ -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']; diff --git a/src/messenger/webim/leavemessage.php b/src/messenger/webim/leavemessage.php index 790f17e0..092b9665 100644 --- a/src/messenger/webim/leavemessage.php +++ b/src/messenger/webim/leavemessage.php @@ -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']; diff --git a/src/messenger/webim/locales/en/properties b/src/messenger/webim/locales/en/properties index 7d0021d3..ffc9ce1c 100644 --- a/src/messenger/webim/locales/en/properties +++ b/src/messenger/webim/locales/en/properties @@ -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 Update wizard to adjust your data installed.login_link=Proceed to login page installed.message=Application installed successfully. installed.notice=You can logon as admin with empty password.

!!! For security reasons, please 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.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. diff --git a/src/messenger/webim/locales/names/level1 b/src/messenger/webim/locales/names/level1 index d1ac5657..cd3a1e73 100644 --- a/src/messenger/webim/locales/names/level1 +++ b/src/messenger/webim/locales/names/level1 @@ -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 diff --git a/src/messenger/webim/styles/default/templates/leavemessage.tpl b/src/messenger/webim/styles/default/templates/leavemessage.tpl index 5f8deac9..22d0a128 100644 --- a/src/messenger/webim/styles/default/templates/leavemessage.tpl +++ b/src/messenger/webim/styles/default/templates/leavemessage.tpl @@ -44,6 +44,7 @@
+
diff --git a/src/messenger/webim/styles/original/templates/leavemessage.tpl b/src/messenger/webim/styles/original/templates/leavemessage.tpl index 1dbddc26..ba43e692 100644 --- a/src/messenger/webim/styles/original/templates/leavemessage.tpl +++ b/src/messenger/webim/styles/original/templates/leavemessage.tpl @@ -28,6 +28,7 @@ +