1 <style type="text/css">
3 border-width: 1px 1px 1px 1px;
5 border-style: solid solid solid solid;
6 border-color: black black black black;
7 border-collapse: collapse;
8 background-color: white;
11 border-width: 1px 1px 1px 1px;
12 padding: 4px 4px 4px 4px;
13 border-style: solid solid solid solid;
14 border-color: gray gray gray gray;
15 background-color: white;
18 border-width: 1px 1px 1px 1px;
19 padding: 4px 4px 4px 4px;
20 border-style: solid solid solid solid;
21 border-color: gray gray gray gray;
22 background-color: white;
25 <div class='titlediv'>
26 <h1 class='newstitle'> __Jobs overview__ (<TMPL_VAR label>)</h1>
29 <table class='sample' id='report'>
36 <script type="text/javascript" language="JavaScript">
38 var table = document.getElementById('report');
40 var tr; var td; var img; var infos;
41 var all = new Array();
49 dates['<TMPL_VAR date>']='<TMPL_VAR num>';
50 infos['<TMPL_VAR date>'] = new Array('<TMPL_VAR num>', '<TMPL_VAR status>',
51 '<TMPL_VAR joberrors>', '<TMPL_VAR title>');
53 all.push({ name: "<TMPL_VAR name>", values: infos});
56 //infos = new Array();
57 //infos['2007-10-01'] = new Array(1, 'T', 8, '2007-10-01');
58 //infos['2007-10-02'] = new Array(2, 'T', 8, '2007-10-02');
59 //infos['2007-10-05'] = new Array(3, 'R', 8, '2007-10-05');
61 //all.push({ name: "zog", values: infos});
63 function init_tab() // initialize the table
66 var step = new Array();
67 // common steps in milliseconds
68 step['day'] = 86400000;
69 step['week'] = 604800000;
70 step['month'] = 2678400000;
74 // javascript can't do foreach $j (sort keys %dates)
75 var keys = new Array();
76 for (var j in dates) {
82 j = keys[j]; // get real key
83 if (!last_date) { // do it once
84 last_date = new Date(j.substr(0, 10));
87 var current_date = new Date(j.substr(0, 10));
89 // Try to find days where we have nothing reported
90 if (step['<TMPL_VAR type>']) {
91 last_date.setTime( last_date.getTime() + step['<TMPL_VAR type>'] * 1.25);
92 while ( last_date < current_date ) {
93 // Insert gap between current_date and last_date
94 last_date.setTime( last_date.getTime() + step['<TMPL_VAR type>']);
95 var t=document.createElement("TD");
96 t.setAttribute("id", "day" + i++); // should not be used
97 t.appendChild(document.createTextNode('?'));
98 document.getElementById("days").appendChild(t);
101 last_date = current_date;
102 var t=document.createElement("TD");
103 t.setAttribute("id", "day" + i);
105 dates_pos[j]=i++; // position in the tab
106 document.getElementById("days").appendChild(t);
111 function add_client(name, infos)
113 tr=document.createElement("TR"); // client row
114 table.appendChild(tr);
116 td=document.createElement("TD"); // client name
118 a=document.createElement("A");
119 a.setAttribute("href", "?action=<TMPL_VAR action>" + name);
120 a.appendChild(document.createTextNode(name));
124 for (var j in infos) { // one img for each days
125 while (cur_pos <= dates_pos[j]) { // create empty blocks
126 td=document.createElement("TD");
130 if (nodate[j] == 1) { // put the date in the first row if empty
131 var t = document.getElementById("day" + dates_pos[j]);
132 t.appendChild(document.createTextNode(infos[j][0]));
135 // a=document.createElement("A"); // create a link to action=job
136 // a.setAttribute('href', "?action=job;client_group=" + name);
137 img=document.createElement("IMG");
138 img.setAttribute("src", bweb_get_job_img(infos[j][1],infos[j][2], 'B'));
139 img.setAttribute("title", infos[j][3]);
140 // a.appendChild(img);
144 while (cur_pos++ < max_pos) {
145 td=document.createElement("TD");
152 for(var i=0; i<all.length; i++) {
154 add_client(elt['name'], elt['values']);