diff --git a/src/messenger/webim/default.css b/src/messenger/webim/default.css
index ffa17d6d..a8ea9231 100644
--- a/src/messenger/webim/default.css
+++ b/src/messenger/webim/default.css
@@ -388,7 +388,17 @@ input.formauth {
padding-left: 4px;
}
-table.list, table.translate {
+.tabletitle {
+ background: url(images/graydot.gif) repeat-x left bottom;
+ font-family: "Lucida Sans Unicode", "Lucida Grande", Sans-Serif;
+ font-size: 1.4em;
+ margin: 10px 0px 20px;
+ padding-bottom: 10px;
+ color: #1D485E;
+ font-weight: bold;
+}
+
+table.list, table.translate, table.statistics {
font-family: "Lucida Sans Unicode", "Lucida Grande", Sans-Serif;
background: #fff;
width: 100%;
@@ -396,15 +406,17 @@ table.list, table.translate {
text-align: left;
}
-table.list th, table.translate th {
+table.list th, table.translate th, table.statistics th {
font-size: 1.2em;
font-weight: normal;
- color: #1D485E;
padding: 10px 8px;
border-bottom: 2px solid #2F7598;
}
-table.list td {
+table.list th, table.translate th { color: #1D485E; }
+table.statistics th { color: #2F7598; }
+
+table.list td, table.statistics td {
color: #2f7599;
padding: 10px 8px;
border-bottom: 1px solid #ccc;
@@ -423,7 +435,7 @@ table.list td a.man {
padding-left: 15px;
}
-table.list tbody tr:hover td, table.list tbody tr:hover td a {
+table.list tbody tr:hover td, table.list tbody tr:hover td a, table.statistics tbody tr:hover td {
color: #1D485E;
}
@@ -508,6 +520,13 @@ table.awaiting td.visitor {
padding-right:5px;
}
+.searchctrl {
+ float: left;
+ margin:7px 20px 5px 0px;
+ padding-right:5px;
+ display: inline;
+}
+
#searchtext input {
width: 100%;
margin: 0px;
diff --git a/src/messenger/webim/images/dash/stat.gif b/src/messenger/webim/images/dash/stat.gif
new file mode 100644
index 00000000..9594d59b
Binary files /dev/null and b/src/messenger/webim/images/dash/stat.gif differ
diff --git a/src/messenger/webim/libs/operator.php b/src/messenger/webim/libs/operator.php
index f38a7d4e..bd5ba6df 100644
--- a/src/messenger/webim/libs/operator.php
+++ b/src/messenger/webim/libs/operator.php
@@ -221,6 +221,7 @@ function prepare_menu($operator,$hasright=true) {
loadsettings();
$page['showban'] = $settings['enableban'] == "1";
$page['showdep'] = $settings['enabledepartments'] == "1";
+ $page['showstat'] = true; //$settings['enablestatistics'] == "1";
$page['showadmin'] = is_capable($can_administrate, $operator);
}
}
diff --git a/src/messenger/webim/locales/en/properties b/src/messenger/webim/locales/en/properties
index 8e908fa9..6e4dac32 100644
--- a/src/messenger/webim/locales/en/properties
+++ b/src/messenger/webim/locales/en/properties
@@ -295,6 +295,18 @@ permission.takeover=Take over chat thread
permission.viewthreads=View another operator's chat thread
permissions.intro=Here you can control operator's permissions
permissions.title=Permissions
+report.bydate.1=Date
+report.bydate.2=Chat threads
+report.bydate.3=Messages from operators
+report.bydate.4=Messages from visitors
+report.bydate.title=Usage statistics for each date
+report.byoperator.1=Operator
+report.byoperator.2=Chat Threads
+report.byoperator.3=Messages
+report.byoperator.4=Average message length (in chars)
+report.byoperator.title=Threads by operator
+report.no_items=Not enough data
+report.total=Total:
right.administration=Administration
right.main=Main
right.other=Other
@@ -330,6 +342,12 @@ settings.usernamepattern=Visitor's identifier
settings.wrong.email=Enter proper email address
site.title=openwebim.org
site.url=http://openwebim.org
+statistics.dates=Select dates
+statistics.description=Daily usage reports
+statistics.from=From:
+statistics.till=Till:
+statistics.title=Statistics
+statistics.wrong.dates=You have selected From date after Till date
tag.pagination.info=Page {0} of {1}, {2}-{3} from {4}
tag.pagination.next=next
tag.pagination.no_items.elements=No elements
diff --git a/src/messenger/webim/locales/ru/properties b/src/messenger/webim/locales/ru/properties
index 844e776b..f33ed679 100644
--- a/src/messenger/webim/locales/ru/properties
+++ b/src/messenger/webim/locales/ru/properties
@@ -277,6 +277,18 @@ permissions.title=
right.administration=Управление
right.main=Посетители
right.other=Остальное
+report.bydate.1=Дата
+report.bydate.2=Диалогов
+report.bydate.3=Сообщений операторов
+report.bydate.4=Сообщений посетителей
+report.bydate.title=Использование мессенджера по дням
+report.byoperator.1=Оператор
+report.byoperator.2=Диалогов
+report.byoperator.3=Сообщений
+report.byoperator.4=Средняя длина сообщения (в символах)
+report.byoperator.title=Статистика по операторам
+report.no_items=Мало данных
+report.total=Итого:
settings.chat.title.description=Например, название отдела вашей компании
settings.chat.title=Заголовок в чат окне
settings.chatstyle.description=Предпросмотр всех страниц каждого стиля доступен здесь
@@ -307,6 +319,12 @@ settings.usernamepattern=
settings.wrong.email=Введите правильный адрес электронной почты
site.title=openwebim.org
site.url=http://openwebim.org
+statistics.dates=Выберите даты
+statistics.description=Различные отчеты по посетителям и использованию мессенджера
+statistics.from=С:
+statistics.till=По:
+statistics.title=Статистика
+statistics.wrong.dates=Вы выбрали дату для начала отчета после даты конца
tag.pagination.info=Страница {0} из {1}, показаны {2}-{3} из {4}
tag.pagination.next=следующая
tag.pagination.no_items.elements=Нет элементов для отображения.
diff --git a/src/messenger/webim/operator/statistics.php b/src/messenger/webim/operator/statistics.php
new file mode 100644
index 00000000..bf894e6f
--- /dev/null
+++ b/src/messenger/webim/operator/statistics.php
@@ -0,0 +1,80 @@
+ $end ) {
+ $errors[] = getlocal("statistics.wrong.dates");
+}
+
+$link = connect();
+
+$page['reportByDate'] = select_multi_assoc("select DATE(dtmcreated) as date, COUNT(distinct threadid) as threads, SUM(chatmessage.ikind = $kind_agent) as agents, SUM(chatmessage.ikind = $kind_user) as users ".
+ "from chatmessage where unix_timestamp(dtmcreated) >= $start AND unix_timestamp(dtmcreated) < $end group by DATE(dtmcreated) order by dtmcreated desc", $link);
+
+$page['reportByDateTotal'] = select_one_row("select COUNT(distinct threadid) as threads, SUM(chatmessage.ikind = $kind_agent) as agents, SUM(chatmessage.ikind = $kind_user) as users ".
+ "from chatmessage where unix_timestamp(dtmcreated) >= $start AND unix_timestamp(dtmcreated) < $end", $link);
+
+$page['reportByAgent'] = select_multi_assoc("select vclocalename as name, COUNT(distinct threadid) as threads, SUM(ikind = $kind_agent) as msgs, AVG(CHAR_LENGTH(tmessage)) as avglen ".
+ "from chatmessage, chatoperator ".
+ "where agentId = operatorid AND unix_timestamp(dtmcreated) >= $start AND unix_timestamp(dtmcreated) < $end group by operatorid", $link);
+
+$page['showresults'] = count($errors) == 0;
+
+mysql_close($link);
+
+prepare_menu($operator);
+start_html_output();
+require('../view/statistics.php');
+?>
\ No newline at end of file
diff --git a/src/messenger/webim/view/inc_menu.php b/src/messenger/webim/view/inc_menu.php
index 32b26e7b..a5ef1fed 100644
--- a/src/messenger/webim/view/inc_menu.php
+++ b/src/messenger/webim/view/inc_menu.php
@@ -15,6 +15,9 @@ function tpl_menu() { global $page, $webimroot, $errors;
>
>
>
+
+ >
+
>
diff --git a/src/messenger/webim/view/menu.php b/src/messenger/webim/view/menu.php
index f9079046..27e1a64f 100644
--- a/src/messenger/webim/view/menu.php
+++ b/src/messenger/webim/view/menu.php
@@ -59,6 +59,16 @@ function tpl_content() { global $page, $webimroot, $current_locale, $menuItemsCo
$menuItemsCount = 2;
if( $page['showban'] ) {
?>
+
+
+
+
+
+
+
+ |
+
+
diff --git a/src/messenger/webim/view/statistics.php b/src/messenger/webim/view/statistics.php
new file mode 100644
index 00000000..eb074319
--- /dev/null
+++ b/src/messenger/webim/view/statistics.php
@@ -0,0 +1,148 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ |
+
+ |
+
+ |
+
+ |
+
+
+
+
+
+ |
+ |
+ |
+ |
+
+
+
+ |
+ |
+ |
+ |
+
+
+
+
+
+ |
+
+
+
+
+
+
+
+
+
+
+
+
+
+ |
+
+ |
+
+ |
+
+ |
+
+
+
+
+
+ |
+ |
+ |
+ |
+
+
+
+
+
+
+ |
+
+
+
+
+
+
+
+
\ No newline at end of file
|