]> git.sur5r.net Git - bacula/bacula/commitdiff
bacula-web: Fixed bug with pgsql sql query
authorDavide Franco <bacula-dev@dflc.ch>
Mon, 27 Jun 2011 12:27:59 +0000 (14:27 +0200)
committerKern Sibbald <kern@sibbald.com>
Sat, 20 Apr 2013 12:49:17 +0000 (14:49 +0200)
 - Merged SQLite and MySQL query for Backup job list
 - Fixed list order

gui/bacula-web/includes/bweb.inc.php

index 8fd1693538c0c5f7f559dcbe7a850fbd4baffadd..52b26875858fa805affc61b6ff85e3488d2630ef 100644 (file)
@@ -331,7 +331,19 @@ class Bweb extends DB
        
        public function Get_BackupJob_Names()
        {
-               $query          = "SELECT job.name FROM job GROUP BY job.name";
+               $query  = '';
+               
+               switch( $this->driver )
+               {
+                       case 'sqlite':
+                       case 'mysql':
+                               $query          = "SELECT name FROM Job GROUP BY name ORDER BY name";
+                       break;
+                       case 'pgsql':
+                               $query          = "SELECT name FROM Job GROUP BY name ORDER BY name";
+                       break;
+               }
+               
                $backupjobs = array();
                
                $result = $this->db_link->query( $query );