From b98987ef2ab8cb09bbfb8f342396a1d5449115a0 Mon Sep 17 00:00:00 2001 From: Davide Franco Date: Wed, 22 Jun 2011 17:55:11 +0200 Subject: [PATCH] bacula-web: Added odd and even row in job list --- gui/bacula-web/backupjob-report.php | 11 ++++++++++- gui/bacula-web/templates/backupjob-report.tpl | 14 +++++++------- 2 files changed, 17 insertions(+), 8 deletions(-) diff --git a/gui/bacula-web/backupjob-report.php b/gui/bacula-web/backupjob-report.php index 0477860290..843ac7b94c 100644 --- a/gui/bacula-web/backupjob-report.php +++ b/gui/bacula-web/backupjob-report.php @@ -97,9 +97,18 @@ if( ! PEAR::isError( $result ) ) { - while( $job = $result->fetchRow( DB_FETCHMODE_ASSOC ) ) { + while( $job = $result->fetchRow( DB_FETCHMODE_ASSOC ) ) + { + // Job level description $job['Level'] = $joblevel[ $job['Level'] ]; + + // Job execution execution time $job['ElapsedTime'] = TimeUtils::Get_Elapsed_Time( $job['StartTime'], $job['EndTime'] ); + + // odd and even row + if( count($jobs) % 2) + $job['row_class'] = 'odd'; + array_push( $jobs, $job); } }else diff --git a/gui/bacula-web/templates/backupjob-report.tpl b/gui/bacula-web/templates/backupjob-report.tpl index 741eccaa03..d58630f778 100644 --- a/gui/bacula-web/templates/backupjob-report.tpl +++ b/gui/bacula-web/templates/backupjob-report.tpl @@ -54,13 +54,13 @@ {foreach from=$jobs item=job} - {$job.JobId} - {$job.Level} - {$job.JobFiles} - {$job.JobBytes} - {$job.StartTime} - {$job.EndTime} - {$job.ElapsedTime} + {$job.JobId} + {$job.Level} + {$job.JobFiles} + {$job.JobBytes} + {$job.StartTime} + {$job.EndTime} + {$job.ElapsedTime} {/foreach} -- 2.39.5