From: Davide Franco Date: Fri, 1 Jul 2011 16:22:14 +0000 (+0200) Subject: bacula-web: Improved job per page filter in jobs page and template X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=96abfb53662003c83cffcf7909a8547895c02936;p=bacula%2Fbacula bacula-web: Improved job per page filter in jobs page and template --- diff --git a/gui/bacula-web/jobs.php b/gui/bacula-web/jobs.php index ed1268ad2c..23745877ee 100644 --- a/gui/bacula-web/jobs.php +++ b/gui/bacula-web/jobs.php @@ -39,10 +39,6 @@ $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' ); @@ -77,13 +73,16 @@ // 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 . '
'; + $dbSql->tpl->assign( 'jobs_per_page', $jobs_per_page ); $jobsresult = $dbSql->db_link->query( $query ); diff --git a/gui/bacula-web/templates/jobs.tpl b/gui/bacula-web/templates/jobs.tpl index 21c9bb9eda..f9925a7037 100644 --- a/gui/bacula-web/templates/jobs.tpl +++ b/gui/bacula-web/templates/jobs.tpl @@ -24,23 +24,14 @@ {$total_jobs} jobs found - + Jobs / Page - + {html_options name=jobs_per_page options=$jobs_per_page selected=$jobs_per_page_selected onChange="submit();"} Job status {html_options name=status values=$job_status options=$job_status selected=$job_status_filter onChange="submit();"} -