Skip to content

Commit 10cb6fe

Browse files
author
Till Brehm
committed
Merge branch 'patch-enrich-datalog' into 'stable-3.1'
Enrich datalog view See merge request ispconfig/ispconfig3!1048
2 parents c4e0790 + aba983e commit 10cb6fe

File tree

3 files changed

+45
-1
lines changed

3 files changed

+45
-1
lines changed

interface/web/monitor/dataloghistory_view.php

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,48 @@
5050
$record = $app->db->queryOneRecord('SELECT * FROM sys_datalog WHERE datalog_id = ?', $id);
5151

5252
$out['id'] = $id;
53+
$out['username'] = $record['user'];
5354

5455
$out['timestamp'] = date($app->lng('conf_format_datetime'), $record['tstamp']);
5556
$out['table'] = $record['dbtable'];
57+
list($key, $value) = explode(':', $record['dbidx']);
58+
if (!empty($value)) {
59+
if ($record['action'] == 'd') {
60+
// No link for deleted content.
61+
$out['table_id'] = $record['dbidx'];
62+
} else {
63+
switch ($out['table']) {
64+
case 'mail_forwarding':
65+
$file = 'mail/mail_forward_edit.php';
66+
break;
67+
case 'mail_user':
68+
$file = 'mail/mail_user_edit.php';
69+
break;
70+
case 'mail_domain':
71+
$file = 'mail/mail_domain_edit.php';
72+
break;
73+
case 'web_domain':
74+
$file = 'sites/web_vhost_domain_edit.php';
75+
break;
76+
case 'web_database':
77+
$file = 'sites/database_edit.php';
78+
break;
79+
case 'web_database_user':
80+
$file = 'sites/database_user_edit.php';
81+
break;
82+
83+
// TODO Add a link per content type
84+
default:
85+
$file = '';
86+
}
87+
88+
if (!empty($file)) {
89+
$out['table_id'] = '<a href="#" data-load-content="' . $file . '?id=' . $value
90+
. '" data-toggle="tooltip" data-placement="bottom" title="" data-original-title="link">'
91+
. $record['dbidx'] . '</a>';
92+
}
93+
}
94+
}
5695

5796
$out['action_char'] = $record['action'];
5897
$out['action_name'] = $app->lng($record['action']);

interface/web/monitor/lib/lang/en_dataloghistory_view.lng

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,4 +23,5 @@ $wb['new_txt'] = 'New';
2323
$wb['btn_cancel_txt'] = 'Back';
2424
$wb['undo_txt'] = 'Undo action';
2525
$wb['undo_confirmation_txt'] = 'Do you really want to undo this action?';
26+
$wb['username_txt'] = 'Username';
2627
?>

interface/web/monitor/templates/dataloghistory_view.htm

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,17 @@ <h1><tmpl_var name="list_head_txt"></h1>
1212
</tr>
1313
</thead>
1414
<tbody>
15+
<tr>
16+
<td><tmpl_var name="username_txt"></td>
17+
<td><tmpl_var name="username"></td>
18+
</tr>
1519
<tr>
1620
<td><tmpl_var name="timestamp_txt"></td>
1721
<td><tmpl_var name="timestamp"></td>
1822
</tr>
1923
<tr>
2024
<td><tmpl_var name="table_txt"></td>
21-
<td><tmpl_var name="table"></td>
25+
<td><tmpl_var name="table"><tmpl_if name='table_id'> (<tmpl_var name="table_id">)</tmpl_if></td>
2226
</tr>
2327
<tr>
2428
<td><tmpl_var name="action_txt"></td>

0 commit comments

Comments
 (0)