]> git.sur5r.net Git - bacula/bacula/commitdiff
bacula-web: Added odd and even row in job list
authorDavide Franco <bacula-dev@dflc.ch>
Wed, 22 Jun 2011 15:55:11 +0000 (17:55 +0200)
committerKern Sibbald <kern@sibbald.com>
Sat, 20 Apr 2013 12:49:14 +0000 (14:49 +0200)
gui/bacula-web/backupjob-report.php
gui/bacula-web/templates/backupjob-report.tpl

index 04778602905fbafab681a284fdc6c015a49c64c8..843ac7b94c8642dab93a9174ebfde0fe658611cc 100644 (file)
   \r
   if( ! PEAR::isError( $result ) )\r
   {\r
-       while( $job = $result->fetchRow( DB_FETCHMODE_ASSOC ) ) {\r
+       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);\r
        }               
   }else\r
index 741eccaa03b64082bf021deaad4f9202541afb11..d58630f778cf2c1558962a4d5d4a8a46c58254d2 100644 (file)
                </tr>\r
                {foreach from=$jobs item=job}\r
                <tr>\r
-                       <td>{$job.JobId}</td>\r
-                       <td>{$job.Level}</td>\r
-                       <td>{$job.JobFiles}</td>\r
-                       <td>{$job.JobBytes}</td>\r
-                       <td>{$job.StartTime}</td>
-                       <td>{$job.EndTime}</td>\r
-                       <td>{$job.ElapsedTime}</td>
+                       <td class="{$job.row_class}">{$job.JobId}</td>
+                       <td class="{$job.row_class}">{$job.Level}</td>
+                       <td class="{$job.row_class}">{$job.JobFiles}</td>
+                       <td class="{$job.row_class}">{$job.JobBytes}</td>
+                       <td class="{$job.row_class}">{$job.StartTime}</td>
+                       <td class="{$job.row_class}">{$job.EndTime}</td>
+                       <td class="{$job.row_class}">{$job.ElapsedTime}</td>
                </tr>\r
                {/foreach}\r
        </table>\r