Skip to content
Snippets Groups Projects
Commit 10cb6fe8 authored by Till Brehm's avatar Till Brehm
Browse files

Merge branch 'patch-enrich-datalog' into 'stable-3.1'

Enrich datalog view

See merge request ispconfig/ispconfig3!1048
parents c4e0790f aba983e1
No related branches found
No related tags found
No related merge requests found
......@@ -50,9 +50,48 @@ $id = intval($_GET['id']);
$record = $app->db->queryOneRecord('SELECT * FROM sys_datalog WHERE datalog_id = ?', $id);
$out['id'] = $id;
$out['username'] = $record['user'];
$out['timestamp'] = date($app->lng('conf_format_datetime'), $record['tstamp']);
$out['table'] = $record['dbtable'];
list($key, $value) = explode(':', $record['dbidx']);
if (!empty($value)) {
if ($record['action'] == 'd') {
// No link for deleted content.
$out['table_id'] = $record['dbidx'];
} else {
switch ($out['table']) {
case 'mail_forwarding':
$file = 'mail/mail_forward_edit.php';
break;
case 'mail_user':
$file = 'mail/mail_user_edit.php';
break;
case 'mail_domain':
$file = 'mail/mail_domain_edit.php';
break;
case 'web_domain':
$file = 'sites/web_vhost_domain_edit.php';
break;
case 'web_database':
$file = 'sites/database_edit.php';
break;
case 'web_database_user':
$file = 'sites/database_user_edit.php';
break;
// TODO Add a link per content type
default:
$file = '';
}
if (!empty($file)) {
$out['table_id'] = '<a href="#" data-load-content="' . $file . '?id=' . $value
. '" data-toggle="tooltip" data-placement="bottom" title="" data-original-title="link">'
. $record['dbidx'] . '</a>';
}
}
}
$out['action_char'] = $record['action'];
$out['action_name'] = $app->lng($record['action']);
......
......@@ -23,4 +23,5 @@ $wb['new_txt'] = 'New';
$wb['btn_cancel_txt'] = 'Back';
$wb['undo_txt'] = 'Undo action';
$wb['undo_confirmation_txt'] = 'Do you really want to undo this action?';
$wb['username_txt'] = 'Username';
?>
......@@ -12,13 +12,17 @@
</tr>
</thead>
<tbody>
<tr>
<td><tmpl_var name="username_txt"></td>
<td><tmpl_var name="username"></td>
</tr>
<tr>
<td><tmpl_var name="timestamp_txt"></td>
<td><tmpl_var name="timestamp"></td>
</tr>
<tr>
<td><tmpl_var name="table_txt"></td>
<td><tmpl_var name="table"></td>
<td><tmpl_var name="table"><tmpl_if name='table_id'> (<tmpl_var name="table_id">)</tmpl_if></td>
</tr>
<tr>
<td><tmpl_var name="action_txt"></td>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment