-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathgrouphistory.php
135 lines (113 loc) · 4.04 KB
/
grouphistory.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
<?php
/*
* Manage the tables groups history
*/
// Include application functions
include_once('./libraries/lib.inc.php');
/********************************************************************************************************
* Callback functions
*******************************************************************************************************/
// Callback function to dynamicaly add an icon to each group history row
function renderHistoryGraphic($val) {
global $misc, $lang;
$parts = explode('#', $val);
$title = $lang[$parts[0]];
$icon = $misc->icon($parts[1]);
$div = "<div title=\"$title\"><img src=\"$icon\" alt=\"$icon\" title=\"$title\" class=\"fullsizecellicon\" /></div>";
return $div;
}
/********************************************************************************************************
* Main functions displaying pages
*******************************************************************************************************/
/**
* Displays the history of the tables group, ie. group creation, drop, start and stop events
*/
function show_history_group() {
global $misc, $lang, $emajdb;
$misc->printHeader('emaj', 'emajgroup', 'emajhistory');
$misc->printTitle(sprintf($lang['strgrouphistory'], htmlspecialchars($_REQUEST['group'])));
$groupHistory = $emajdb->getHistoryGroup($_REQUEST['group']);
if ($groupHistory->recordCount() < 1) {
// There is no history to display
echo "<p>" . sprintf($lang['stremajnohistory'], htmlspecialchars($_REQUEST['group'])) . "</p>\n";
} else {
echo "<p>{$lang['strgrouphistoryorder']}</p>\n";
$columns = array(
'graphic' => array(
'title' => '',
'field' => field('graphic'),
'type' => 'callback',
'params'=> array('function' => 'renderHistoryGraphic'),
'class' => 'nopadding center',
'filter'=> false,
),
'createdroptime' => array(
'title' => $lang['strgroupcreateddroppedat'],
'field' => field('create_drop_time'),
'type' => 'spanned',
'params'=> array(
'dateformat' => $lang['stroldtimestampformat'],
'locale' => $lang['applocale'],
'class' => 'tooltip left-aligned-tooltip',
),
'sorter_text_extraction' => 'span_text',
),
'nb_log_sessions' => array(
'title' => $lang['strnblogsessions'],
'field' => field('grph_log_sessions'),
'type' => 'numeric'
),
'starttime' => array(
'title' => $lang['strgroupstartedat'],
'field' => field('start_time'),
'type' => 'spanned',
'params'=> array(
'dateformat' => $lang['stroldtimestampformat'],
'locale' => $lang['applocale'],
'class' => 'tooltip left-aligned-tooltip',
),
'sorter_text_extraction' => 'span_text',
),
'stoptime' => array(
'title' => $lang['strgroupstoppedat'],
'field' => field('stop_time'),
'type' => 'spanned',
'params'=> array(
'dateformat' => $lang['stroldtimestampformat'],
'locale' => $lang['applocale'],
'class' => 'tooltip left-aligned-tooltip',
),
'sorter_text_extraction' => 'span_text',
),
'nb_marks' => array(
'title' => $lang['strmarks'],
'field' => field('lses_marks'),
'type' => 'numeric'
),
'nb_log_rows' => array(
'title' => $lang['strchanges'],
'field' => field('lses_log_rows'),
'type' => 'numeric'
),
);
$actions = array ();
echo "<p></p>";
$misc->printTable($groupHistory, $columns, $actions, 'groupHistory', null, null, array('sorter' => false, 'filter' => true));
}
}
/********************************************************************************************************
* Main piece of code
*******************************************************************************************************/
$action = (isset($_REQUEST['action'])) ? $_REQUEST['action'] : '';
if (!isset($msg)) $msg = '';
$misc->printHtmlHeader($lang['strgroupsmanagement']);
$misc->printBody();
switch ($action) {
case 'show_history_group':
show_history_group();
break;
default:
show_history_group();
}
$misc->printFooter();
?>