Commit 2b83ab1a46229532bbfd1d3f6bf652552287b36f
1 parent
a125e4f0
Exists in
master
and in
64 other branches
improve job tooltip
Showing
1 changed file
with
38 additions
and
12 deletions
Show diff stats
src/InputOutput/IHMImpl/Tools/IHMJobsManagerClass.php
@@ -274,7 +274,9 @@ class IHMJobsManagerClass { | @@ -274,7 +274,9 @@ class IHMJobsManagerClass { | ||
274 | // Data mining | 274 | // Data mining |
275 | case 'condition': | 275 | case 'condition': |
276 | $name = 'datamining_'.time(); | 276 | $name = 'datamining_'.time(); |
277 | - $infos['Name'] = $obj['name']; | 277 | + if($obj['name'] != '') { |
278 | + $infos['Name'] = $obj['name']; | ||
279 | + } | ||
278 | $infos['Condition'] = $obj['expression']; | 280 | $infos['Condition'] = $obj['expression']; |
279 | $infos['Start date'] = $obj['startDate']; | 281 | $infos['Start date'] = $obj['startDate']; |
280 | $infos['Stop date'] = $obj['stopDate']; | 282 | $infos['Stop date'] = $obj['stopDate']; |
@@ -282,9 +284,36 @@ class IHMJobsManagerClass { | @@ -282,9 +284,36 @@ class IHMJobsManagerClass { | ||
282 | 284 | ||
283 | case 'statistics': | 285 | case 'statistics': |
284 | $name = 'statistics_'.time(); | 286 | $name = 'statistics_'.time(); |
285 | - $infos['Name'] = $obj['name']; | ||
286 | - $infos['Start date'] = $obj['startDate']; | ||
287 | - $infos['Stop date'] = $obj['stopDate']; | 287 | + $infos['Name'] = $obj['name']; // TODO: name toujours égal à 'test' (?) |
288 | + | ||
289 | + // TODO : lire data/user/TT/tt_0.xml -> trouver ttname + nbIntervals | ||
290 | + | ||
291 | + if(array_key_exists('timeTables', $obj)) { | ||
292 | + $ttXml = new DomDocument(); | ||
293 | + $ttXml->load(USERWSDIR . 'Tt.xml'); | ||
294 | + | ||
295 | + $ttIntervals = []; | ||
296 | + foreach ($ttXml->getElementsByTagName('timetab') as $tt) { | ||
297 | + $ttIntervals[$tt->getAttribute('name')] = $tt->getAttribute('intervals'); | ||
298 | + } | ||
299 | + | ||
300 | + if(count($obj['timeTables']) == 1) { | ||
301 | + $infos['Time table'] = $obj['timeTables'][0]->timeTableName; | ||
302 | + $infos['Nb Intervals'] = $ttIntervals[$infos['Time table']]; | ||
303 | + } else { | ||
304 | + foreach ($obj['timeTables'] as $tt) { | ||
305 | + if($tt === reset($obj['timeTables'])) { | ||
306 | + $infos['Time tables'] = $tt->timeTableName . '(' . $ttIntervals[$tt->timeTableName] . ' int.)'; | ||
307 | + } else { | ||
308 | + $infos['Time tables'] .= ', ' . $tt->timeTableName . '(' . $ttIntervals[$tt->timeTableName] . ' int.)'; | ||
309 | + } | ||
310 | + } | ||
311 | + } | ||
312 | + } else { | ||
313 | + $infos['Start date'] = $obj['startDate']; | ||
314 | + $infos['Stop date'] = $obj['stopDate']; | ||
315 | + } | ||
316 | + | ||
288 | if(array_key_exists('expression', $obj)) { | 317 | if(array_key_exists('expression', $obj)) { |
289 | $infos['Expression'] = $obj['expression']; | 318 | $infos['Expression'] = $obj['expression']; |
290 | } | 319 | } |
@@ -325,16 +354,13 @@ class IHMJobsManagerClass { | @@ -325,16 +354,13 @@ class IHMJobsManagerClass { | ||
325 | $infos['Stop date'] = $tab->stopDate; | 354 | $infos['Stop date'] = $tab->stopDate; |
326 | 355 | ||
327 | $strPanels = []; | 356 | $strPanels = []; |
357 | + | ||
328 | foreach ($tab->panels as $panel) { | 358 | foreach ($tab->panels as $panel) { |
329 | - $axes = []; | ||
330 | - foreach ($panel->axes as $axe) { | ||
331 | - $axes[] = $axe->id; | ||
332 | - } | ||
333 | - $params = []; | 359 | + $strParams = ''; |
334 | foreach ($panel->params as $param) { | 360 | foreach ($panel->params as $param) { |
335 | - $params[] = $param->paramid; | 361 | + $strParams .= $param->paramid . ($param === end($panel->params) ? '' : ', '); |
336 | } | 362 | } |
337 | - $strPanels[] = join(', ', $params) . ' (' . join(', ', $axes) . ')'; | 363 | + $strPanels[] = $strParams; |
338 | } | 364 | } |
339 | 365 | ||
340 | if(count($strPanels) == 1) { | 366 | if(count($strPanels) == 1) { |
@@ -355,7 +381,7 @@ class IHMJobsManagerClass { | @@ -355,7 +381,7 @@ class IHMJobsManagerClass { | ||
355 | 381 | ||
356 | $strInfo = ''; | 382 | $strInfo = ''; |
357 | foreach ($infos as $key => $info) { | 383 | foreach ($infos as $key => $info) { |
358 | - $strInfo .= '<b>' . $key . '</b>: ' . $info . '<br/>'; | 384 | + $strInfo .= ($key == 'Started at' ? '<hr/>' : '') . '<b>' . $key . '</b>: ' . $info . '<br/>'; |
359 | } | 385 | } |
360 | 386 | ||
361 | $newJob = $this->jobXml->createElement('job'); | 387 | $newJob = $this->jobXml->createElement('job'); |