]> git.sur5r.net Git - bacula/bacula/commitdiff
bacula-web: Improved job per page filter in jobs page and template
authorDavide Franco <bacula-dev@dflc.ch>
Fri, 1 Jul 2011 16:22:14 +0000 (18:22 +0200)
committerKern Sibbald <kern@sibbald.com>
Sat, 20 Apr 2013 12:49:19 +0000 (14:49 +0200)
gui/bacula-web/jobs.php
gui/bacula-web/templates/jobs.tpl

index ed1268ad2ce52082c66c3ea092e0e62447cea480..23745877ee9b80b4c4a6aa73db945edde9c0aedc 100644 (file)
                                           
   $dbSql->tpl->assign( 'job_status', $job_status );
   
-  // Jobs per page
-  $jobs_per_page = array( 25,50,75,100,150 );
-  $dbSql->tpl->assign( 'jobs_per_page', $jobs_per_page );
-
   // Global variables
   $job_level = array( 'D' => 'Diff', 'I' => 'Incr', 'F' => 'Full' );
   
   // order by
   $query .= "ORDER BY Job.JobId DESC ";
   
+  // Jobs per page
+  $jobs_per_page = array( 25 => '25', 50 => '50', 75 => '75', 100 => '100', 150 => '150' );
+    
   // Determine how many jobs to display
-  if( isset($_POST['jobs_per_page']) )
+  if( isset($_POST['jobs_per_page']) ) {
        $query .= "LIMIT " . $_POST['jobs_per_page'];
-  else
+    $dbSql->tpl->assign( 'jobs_per_page_selected', $_POST['jobs_per_page'] );
+  }else
        $query .= "LIMIT 25 ";
-  
-  //echo $query . '<br />';
+  $dbSql->tpl->assign( 'jobs_per_page', $jobs_per_page );
   
   $jobsresult = $dbSql->db_link->query( $query );
   
index 21c9bb9eda15d78af587fcd44e7de48370b4234d..f9925a7037ed8d1a83da9c21618437204560330b 100644 (file)
            <td class="info" width="200">
                        {$total_jobs} jobs found
                </td>
-               <td class="info" colspan="5">
+               <td class="info" colspan="5" width="160">
                        Jobs / Page
-                       <select name="jobs_per_page">
-                         {foreach from=$jobs_per_page item=nb_jobs}
-                           <option value="{$nb_jobs}" {if $smarty.post.jobs_per_page == $nb_jobs}Selected{/if} >{$nb_jobs}
-                         {/foreach}
-                       </select>
+                       {html_options name=jobs_per_page options=$jobs_per_page selected=$jobs_per_page_selected onChange="submit();"}
                </td>
                <td class="info" width="160">
                        Job status
                        {html_options name=status values=$job_status options=$job_status selected=$job_status_filter onChange="submit();"}
                </td>
-               <!--
-               <td class="info" width="120">
-                       <input type="submit" value="Update" />
-               </td>
-               -->
          </tr>
          <tr>
                <td colspan="8">&nbsp;</td>