* All apps: allow to log user-agent and action of all changes in history-log of entries (enable in Admin >> Site configuration)

This commit is contained in:
Ralf Becker 2013-07-11 13:09:23 +00:00
parent 70dbb95d6e
commit 92e0ee86a5
8 changed files with 29 additions and 2 deletions

View File

@ -378,6 +378,7 @@ limit to members of admin de beschränken auf Mitglieder von
list config settings admin de Konfigurationseinstellungen auflisten
list current sessions admin de aktive Sitzungen anzeigen
list of current users admin de Liste der gegenwärtigen Benutzer
log user-agent and action of changes in history-log of entries admin de Protokolliere Browser-Typ und Aktion von Änderungen in der History der Einträge
logged out admin de abgemeldet
login history admin de Login-Kontrolle
login message admin de Meldung der Login-Seite

View File

@ -379,6 +379,7 @@ limit to members of admin en Limit to members of
list config settings admin en List config settings
list current sessions admin en List current sessions
list of current users admin en List of current users
log user-agent and action of changes in history-log of entries admin en Log user-agent and action of changes in history-log of entries
logged out admin en Logged out
login history admin en Login history
login message admin en Login message

View File

@ -59,7 +59,17 @@
<tr class="row_on">
<td>{lang_Enter_the_VFS-Path_where_additional_images,_icons_or_logos_can be_placed_(and_found_by_EGroupwares_applications)._The_path_MUST_start_with_/,and_be_readable_by_all_users}:</td>
<td><input name="newsettings[vfs_image_dir]" value="{value_vfs_image_dir}"></td>
<td><input name="newsettings[vfs_image_dir]" value="{value_vfs_image_dir}" size="40"></td>
</tr>
<tr class="row_off">
<td>{lang_Log_user-agent_and_action_of_changes_in_history-log_of_entries}:</td>
<td>
<select name="newsettings[log_user_agent_action]">
<option value="">{lang_No}</option>
<option value="True"{selected_log_user_agent_action_True}>{lang_Yes}</option>
</select>
</td>
</tr>
<tr class="th">

View File

@ -395,12 +395,18 @@ abstract class bo_tracking
$changed_fields = self::changed_fields($data,$old);
//error_log(__METHOD__.__LINE__.' Changedfields:'.array2string($changed_fields));
}
if (!$changed_fields) return 0;
if (!$changed_fields && ($old || !$GLOBALS['egw_info']['server']['log_user_agent_action'])) return 0;
if (!is_object($this->historylog) || $this->historylog->user != $this->user)
{
$this->historylog = new historylog($this->app,$this->user);
}
// log user-agent and session-action
if ($GLOBALS['egw_info']['server']['log_user_agent_action'] && ($changed_fields || !$old))
{
$this->historylog->add('user_agent_action', $data[$this->id_field],
$_SERVER['HTTP_USER_AGENT'], $_SESSION[egw_session::EGW_SESSION_VAR]['session_action']);
}
foreach($changed_fields as $name)
{
$status = isset($this->field2history[$name]) ? $this->field2history[$name] : $name;

View File

@ -190,6 +190,7 @@ class historylog_widget
// Add in links
self::$status_widgets['~link~'] = 'link-entry';
$tmpl->sel_options[$status]['~link~'] = lang('link');
$tmpl->sel_options[$status]['user_agent_action'] = lang('User-agent & action');
// adding custom fields automatically to status-widgets, no need for each app to do that
foreach(config::get_customfields($app,true) as $cf_name => $cf_data)

View File

@ -221,6 +221,12 @@ var et2_historylog = et2_valueWidget.extend([et2_IDataProvider],
this.options.value['status-widgets']['~file~'] = 'vfs';
}
// Add in handling for user-agent & action
if(typeof this.options.value['status-widgets']['user_agent_action'] == 'undefined')
{
this.columns[this.FIELD].widget.optionValues['user_agent_action'] = this.egw().lang('User-agent & action');
}
// Per-field widgets - new value & old value
this.fields = {};

View File

@ -434,6 +434,7 @@ unlink etemplate de Lösen
update a single entry by passing the fields. etemplate de Aktualisiert einen einzelnen Eintrag über seine Felder.
update from version '%s' to etemplate de Update von Version '%s' auf
upload etemplate de Hochladen
user-agent & action etemplate de Browser-Typ & Aktion
valign etemplate de vAlign
value etemplate de Wert
value has to be at least '%1' !!! etemplate de Der Wert muss mindestens '%1' betragen !!!

View File

@ -437,6 +437,7 @@ unlink etemplate en Unlink
update a single entry by passing the fields. etemplate en Update a single entry by passing the fields
update from version '%s' to etemplate en Update from version '%s' to
upload etemplate en Upload
user-agent & action etemplate en User-agent & action
valign etemplate en vAlign
value etemplate en Value
value has to be at least '%1' !!! etemplate en Value has to be at least '%1' !