Add option to track operators like any other visitors.

Fixes #46
This commit is contained in:
Dmitriy Simushev 2014-07-23 13:28:35 +00:00
parent 86f8cb5100
commit d04f703f35
5 changed files with 27 additions and 1 deletions

View File

@ -114,6 +114,7 @@ class FeaturesController extends AbstractController
'enablepopupnotification',
'showonlineoperators',
'enablecaptcha',
'trackoperators',
);
}
}

View File

@ -44,7 +44,10 @@ class WidgetController extends AbstractController
'data' => array(),
);
if (Settings::get('enabletracking') == '1') {
$tracking_allowed = (Settings::get('enabletracking') == '1')
&& (Settings::get('trackoperators') == '1' || !$this->getOperator());
if ($tracking_allowed) {
$entry = $request->query->get('entry', '');
$referer = $request->server->get('HTTP_REFERER', '');

View File

@ -106,6 +106,7 @@ class Settings
'visitors_limit' => 20, /* Number of visitors to look over */
'invitation_lifetime' => 60, /* Lifetime for invitation to chat */
'tracking_lifetime' => 600, /* Time to store tracked old visitors' data */
'trackoperators' => '0',
'cron_key' => DEFAULT_CRON_KEY,
// System values are listed below. They cannot be changed via
// administrative interface. Start names for these values from

View File

@ -31,6 +31,14 @@
}
}
function updateTracking() {
if ($("#enabletracking").is(":checked")) {
$(".undertracking").show();
} else {
$(".undertracking").hide();
}
}
$(function() {
$("#enablepresurvey").change(function() {
updateSurvey();
@ -41,8 +49,12 @@
$("#enablegroups").change(function() {
updateGroups();
});
$("#enabletracking").change(function() {
updateTracking();
});
updateSurvey();
updateSSL();
updateGroups();
updateTracking();
});
})(jQuery);

View File

@ -94,6 +94,15 @@
</div>
<label for="enabletracking" class="fdescr"> &mdash; {{l10n "Enable tracking of visitors' activity on your site and ability to invite visitors to chat."}}</label>
<br clear="all"/>
<div class="subfield undertracking">
<label for="trackoperators" class="flabel">{{l10n "Track operators"}}</label>
<div class="fvalue">
<input id="trackoperators" type="checkbox" name="trackoperators" value="on"{{#if formtrackoperators}} checked="checked"{{/if}}{{#unless canmodify}} disabled="disabled"{{/unless}}/>
</div>
<label for="trackoperators" class="fdescr"> &mdash; {{l10n "Track operators like any other visitors."}}</label>
<br clear="all"/>
</div>
</div>
<div class="field">