From 96abfb53662003c83cffcf7909a8547895c02936 Mon Sep 17 00:00:00 2001 From: Davide Franco Date: Fri, 1 Jul 2011 18:22:14 +0200 Subject: [PATCH] bacula-web: Improved job per page filter in jobs page and template --- gui/bacula-web/jobs.php | 15 +++++++-------- gui/bacula-web/templates/jobs.tpl | 13 ++----------- 2 files changed, 9 insertions(+), 19 deletions(-) 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();"} -   -- 2.39.5