]> git.ipfire.org Git - thirdparty/bacula.git/commitdiff
baculum: Add client, pool, fileset and fileset content properties to jobs objects...
authorMarcin Haba <marcin.haba@bacula.pl>
Mon, 3 Apr 2023 11:17:15 +0000 (13:17 +0200)
committerMarcin Haba <marcin.haba@bacula.pl>
Thu, 20 Apr 2023 10:00:26 +0000 (12:00 +0200)
gui/baculum/protected/API/Modules/JobManager.php

index 9c0ed5af4ac4b0ae8524123e39f1d8d44374af33..eb025a663702121ea4adb5d10fe830f9151fe5ce 100644 (file)
@@ -216,8 +216,17 @@ LEFT JOIN FileSet USING (FilesetId)'
                        }
                        $where = Database::getWhere($criteria);
                        $sql = 'CREATE ' . $table_type . ' TABLE ' . $jobid_jobstatus_tname . ' AS
-                               SELECT JobId, JobStatus, JobErrors
+                               SELECT  Job.JobId,
+                                       Job.JobStatus,
+                                       Job.JobErrors,
+                                       Client.Name AS client,
+                                       Pool.Name AS pool,
+                                       FileSet.FileSet AS fileset,
+                                       FileSet.Content AS content
                                FROM Job
+                               JOIN Client USING (ClientId)
+                               LEFT JOIN Pool USING (PoolId)
+                               LEFT JOIN FileSet USING (FilesetId)
                                ' . $where['where'];
 
                        Database::execute($sql, $where['params']);
@@ -244,6 +253,7 @@ LEFT JOIN FileSet USING (FilesetId)'
                                $job_record = implode(',', $this->basic_mode_job_props);
                                $obj_record = implode(',', ObjectManager::$basic_mode_obj_props);
                        }
+                       $job_record .= ',' . $jobid_jobstatus_tname . '.client, ' . $jobid_jobstatus_tname . '.pool, ' . $jobid_jobstatus_tname . '.fileset, ' . $jobid_jobstatus_tname . '.content';
                        $sql = 'SELECT JobId, ' . $obj_record . ' 
                                FROM Object
                                JOIN ' . $jobid_jobstatus_tname . ' USING (JobId)