diff --git a/src/messenger/webim/default.css b/src/messenger/webim/default.css
index cac44539..20f54fd3 100644
--- a/src/messenger/webim/default.css
+++ b/src/messenger/webim/default.css
@@ -412,10 +412,27 @@ input.formauth {
font-size: 0.85em;
font-weight:bold;
max-width: 700px;
- margin: 0px 2px 10px;
+ margin: -10px 2px 10px;
color: #515151;
}
+#offwarn {
+ border: 1px solid #4CD496;
+ background-color: #E7F9F1;
+ color: #515151;
+ padding: 8px 11px;
+ font-size: 0.85em;
+ font-weight:bold;
+ line-height: 140%;
+ margin: 0px;
+}
+
+#offwarn img {
+ margin-top: .4em;
+ float: left;
+ padding-right: 10px;
+}
+
.asterisk {
padding: 10px 20px;
}
@@ -720,6 +737,8 @@ table.awaiting td.visitor {
.dashitem img, #dashlocalesPopup h2 img {
float: left;
padding-right:10px;
+ width: 24px;
+ height: 24px;
}
#dashlocalesPopup h2 img {
@@ -836,7 +855,7 @@ table.awaiting td.visitor {
/* rtl rules */
-.lrtl .dashitem img, .lrtl #dashlocalesPopup h2 img {
+.lrtl .dashitem img, .lrtl #dashlocalesPopup h2 img, .lrtl #offwarn img {
float: right;
padding-right:0px;
padding-left:10px;
diff --git a/src/messenger/webim/images/dash/notifications.gif b/src/messenger/webim/images/dash/notifications.gif
new file mode 100644
index 00000000..d52e47cc
Binary files /dev/null and b/src/messenger/webim/images/dash/notifications.gif differ
diff --git a/src/messenger/webim/images/dash/warn.gif b/src/messenger/webim/images/dash/warn.gif
new file mode 100644
index 00000000..a775a52d
Binary files /dev/null and b/src/messenger/webim/images/dash/warn.gif differ
diff --git a/src/messenger/webim/libs/common.php b/src/messenger/webim/libs/common.php
index acb7f288..5c9b3929 100644
--- a/src/messenger/webim/libs/common.php
+++ b/src/messenger/webim/libs/common.php
@@ -592,15 +592,14 @@ $settings = array(
$settingsloaded = false;
$settings_in_db = array();
-function loadsettings() {
+function loadsettings_($link) {
global $settingsloaded, $settings_in_db, $settings;
if($settingsloaded) {
return;
}
$settingsloaded = true;
- $link = connect();
- $sqlresult = mysql_query('select vckey,vcvalue from chatconfig',$link) or die(' Query failed: '.mysql_error().": ".$query);
+ $sqlresult = mysql_query('select vckey,vcvalue from chatconfig',$link) or die(' Query failed: '.mysql_error($link).": ".$query);
while ($row = mysql_fetch_array($sqlresult, MYSQL_ASSOC)) {
$name = $row['vckey'];
@@ -608,9 +607,17 @@ function loadsettings() {
$settings_in_db[$name] = true;
}
mysql_free_result($sqlresult);
- mysql_close($link);
}
+function loadsettings() {
+ global $settingsloaded;
+ if(!$settingsloaded) {
+ $link = connect();
+ loadsettings_($link);
+ mysql_close($link);
+ }
+}
+
function getchatstyle() {
global $settings;
$chatstyle = verifyparam( "style", "/^\w+$/", "");
diff --git a/src/messenger/webim/libs/operator.php b/src/messenger/webim/libs/operator.php
index ff0957f9..7ad85973 100644
--- a/src/messenger/webim/libs/operator.php
+++ b/src/messenger/webim/libs/operator.php
@@ -136,6 +136,15 @@ function has_online_operators($groupid="") {
return $row['time'] < $settings['online_timeout'] && $row['total'] > 0;
}
+function is_operator_online($operatorid, $link) {
+ global $settings;
+ loadsettings_($link);
+ $query = "select count(*) as total, min(unix_timestamp(CURRENT_TIMESTAMP)-unix_timestamp(dtmlastvisited)) as time ".
+ "from chatoperator where operatorid = $operatorid";
+ $row = select_one_row($query,$link);
+ return $row['time'] < $settings['online_timeout'] && $row['total'] == 1;
+}
+
function get_operator_name($operator) {
global $home_locale, $current_locale;
if( $home_locale == $current_locale )
diff --git a/src/messenger/webim/locales/en/properties b/src/messenger/webim/locales/en/properties
index 7ec20db4..9e9a3b18 100644
--- a/src/messenger/webim/locales/en/properties
+++ b/src/messenger/webim/locales/en/properties
@@ -216,11 +216,13 @@ mailthread.title=Send chat history
by mail
menu.agents=Operators list
menu.blocked=Blocked visitors
menu.canned=Canned Messages
+menu.goonline=You are Offline.
Connect..
menu.groups.content=Department or skill based operator groups.
menu.groups=Groups
menu.locale.content=Change locale.
menu.locale=Language
menu.main=Main
+menu.notifications.content=All notifications sent by messenger.
menu.notifications=Notifications
menu.operator=You are {0}
menu.profile.content=You can change your personal information on this page.
diff --git a/src/messenger/webim/locales/ru/properties b/src/messenger/webim/locales/ru/properties
index af2946e4..768563d3 100644
--- a/src/messenger/webim/locales/ru/properties
+++ b/src/messenger/webim/locales/ru/properties
@@ -216,11 +216,13 @@ mailthread.title=
menu.agents=Список операторов
menu.blocked=Нежелательные посетители
menu.canned=Шаблоны ответов
+menu.goonline=Вы Оффлайн.
Подключиться..
menu.groups.content=Объединения операторов на основе отделов или областей знаний.
menu.groups=Группы
menu.locale.content=Выбрать язык системы.
menu.locale=Язык
menu.main=Главная
+menu.notifications.content=История всех отправленных уведомлений.
menu.notifications=Уведомления
menu.operator=Вы {0}
menu.profile.content=На этой странице вы можете отредактировать свою персональную информацию.
diff --git a/src/messenger/webim/operator/index.php b/src/messenger/webim/operator/index.php
index f20af42b..4ffe6b73 100644
--- a/src/messenger/webim/operator/index.php
+++ b/src/messenger/webim/operator/index.php
@@ -23,7 +23,11 @@ require_once('../libs/common.php');
require_once('../libs/operator.php');
$operator = check_login();
-loadsettings();
+
+$link = connect();
+loadsettings_($link);
+$isonline = is_operator_online($operator['operatorid'], $link);
+mysql_close($link);
$page = array(
'version' => $version,
@@ -32,6 +36,7 @@ $page = array(
'updateWizard' => "$webimroot/install/",
'newFeatures' => $settings['featuresversion'] != $featuresversion,
'featuresPage' => "$webimroot/operator/features.php",
+ 'isOnline' => $isonline
);
prepare_menu($operator);
diff --git a/src/messenger/webim/view/inc_menu.php b/src/messenger/webim/view/inc_menu.php
index 4956c2c7..8f0f7638 100644
--- a/src/messenger/webim/view/inc_menu.php
+++ b/src/messenger/webim/view/inc_menu.php
@@ -28,6 +28,12 @@ function menuli($name) {
}
function tpl_menu() { global $page, $webimroot, $errors;
+ if(isset($page['isOnline']) && !$page['isOnline']) { ?>
+