From d98d0e04d83b7e7f56a7122d7846819c17a3fbee Mon Sep 17 00:00:00 2001 From: Evgeny Gryaznov Date: Sat, 9 Jan 2010 21:33:33 +0000 Subject: [PATCH] service "Jabber notifications", hide operator jabber options when service is off, fix css git-svn-id: https://webim.svn.sourceforge.net/svnroot/webim/trunk@718 c66351dc-e62f-0410-b875-e3a5c0b9693f --- src/messenger/webim/default.css | 2 +- src/messenger/webim/libs/common.php | 1 + src/messenger/webim/locales/en/properties | 2 ++ src/messenger/webim/operator/features.php | 2 +- src/messenger/webim/operator/operator.php | 11 +++++++-- src/messenger/webim/view/agent.php | 6 +++++ src/messenger/webim/view/features.php | 27 +++++++++++++++-------- 7 files changed, 38 insertions(+), 13 deletions(-) diff --git a/src/messenger/webim/default.css b/src/messenger/webim/default.css index f622ccd2..203c415e 100644 --- a/src/messenger/webim/default.css +++ b/src/messenger/webim/default.css @@ -325,7 +325,7 @@ div.errinfo { font-weight: bold; } -.field .subfield .fieldinrow { +.field .subfield { padding-left: 30px; background: url(images/subitem.gif) no-repeat 10px 2px; } diff --git a/src/messenger/webim/libs/common.php b/src/messenger/webim/libs/common.php index 3a5ca4ff..f0128c0d 100644 --- a/src/messenger/webim/libs/common.php +++ b/src/messenger/webim/libs/common.php @@ -583,6 +583,7 @@ $settings = array( 'usercanchangename' => '1', 'enablegroups' => '0', 'enablestatistics' => '1', + 'enablejabber' => '0', 'enablepresurvey' => '1', 'surveyaskmail' => '0', 'surveyaskgroup' => '1', diff --git a/src/messenger/webim/locales/en/properties b/src/messenger/webim/locales/en/properties index 4dedc906..ea5026ae 100644 --- a/src/messenger/webim/locales/en/properties +++ b/src/messenger/webim/locales/en/properties @@ -414,6 +414,8 @@ settings.enableban.description=Using it you can block attacks from specific IPs settings.enableban=Enable feature "Malicious Visitors" settings.enablegroups.description=Use it to have separate queues for different questions. settings.enablegroups=Enable "Groups" +settings.enablejabber.description=Instant notification of new visitor (require Mibew Jabber software) +settings.enablejabber=Enable "Jabber notifications" settings.enablepresurvey.description=Forces user to fill out a special form to start chat. settings.enablepresurvey=Enable "Pre-chat survey" settings.enablessl.description=Please, note that your web server should be configured to support https requests. diff --git a/src/messenger/webim/operator/features.php b/src/messenger/webim/operator/features.php index cdfc6d12..cffe33c5 100644 --- a/src/messenger/webim/operator/features.php +++ b/src/messenger/webim/operator/features.php @@ -29,7 +29,7 @@ $page = array('agentId' => ''); $errors = array(); $options = array( - 'enableban', 'usercanchangename', 'enablegroups', 'enablestatistics', + 'enableban', 'usercanchangename', 'enablegroups', 'enablestatistics', 'enablejabber', 'enablessl', 'forcessl', 'enablepresurvey', 'surveyaskmail', 'surveyaskgroup', 'surveyaskmessage', 'enablepopupnotification', diff --git a/src/messenger/webim/operator/operator.php b/src/messenger/webim/operator/operator.php index 07fcfe85..6ca34a3f 100644 --- a/src/messenger/webim/operator/operator.php +++ b/src/messenger/webim/operator/operator.php @@ -29,6 +29,7 @@ $page = array('opid' => ''); $errors = array(); $opId = ''; +loadsettings(); if( isset($_POST['login']) && isset($_POST['password']) ) { $opId = verifyparam( "opid", "/^(\d{1,9})?$/", ""); $login = getparam('login'); @@ -58,8 +59,13 @@ if( isset($_POST['login']) && isset($_POST['password']) ) { if($jabber != '' && !is_valid_email($jabber)) $errors[] = wrong_field("form.field.jabber"); - if($jabbernotify && $jabber == '') - $errors[] = no_field("form.field.jabber"); + if($jabbernotify && $jabber == '') { + if( $settings['enablejabber'] == "1" ) { + $errors[] = no_field("form.field.jabber"); + } else { + $jabbernotify = false; + } + } if( !$opId && !$password ) $errors[] = no_field("form.field.password"); @@ -125,6 +131,7 @@ $canmodify = ($opId == $operator['operatorid'] && is_capable($can_modifyprofile, $page['stored'] = isset($_GET['stored']); $page['canmodify'] = $canmodify ? "1" : ""; +$page['showjabber'] = $settings['enablejabber'] == "1"; prepare_menu($operator); setup_operator_settings_tabs($opId,0); diff --git a/src/messenger/webim/view/agent.php b/src/messenger/webim/view/agent.php index edaa67a7..f834574d 100644 --- a/src/messenger/webim/view/agent.php +++ b/src/messenger/webim/view/agent.php @@ -45,6 +45,10 @@ require_once('inc_errors.php');
+ + + +
@@ -104,6 +108,7 @@ require_once('inc_errors.php');
+
@@ -121,6 +126,7 @@ require_once('inc_errors.php');

+
diff --git a/src/messenger/webim/view/features.php b/src/messenger/webim/view/features.php index 6de4407a..2e5d47e0 100644 --- a/src/messenger/webim/view/features.php +++ b/src/messenger/webim/view/features.php @@ -105,15 +105,6 @@ require_once('inc_errors.php');
-
-
-
- /> -
-
-
-
-
@@ -132,6 +123,24 @@ require_once('inc_errors.php');
+
+
+
+ /> +
+
+
+
+ +
+
+
+ /> +
+
+
+
+