Fix recent jobs

This commit is contained in:
Eike Foken
2011-08-31 10:16:54 +02:00
parent ad19320ad9
commit f87ebc828f
3 changed files with 4 additions and 2 deletions

View File

@@ -126,7 +126,7 @@ class Projects extends CI_Controller {
$data['project'] = $project; $data['project'] = $project;
$data['trials'] = $this->trial->getByProjectId($id); $data['trials'] = $this->trial->getByProjectId($id);
$data['jobs'] = $this->job->getRecent(); $data['jobs'] = $this->job->getRecent($id);
$this->load->view('projects/detail', $data); $this->load->view('projects/detail', $data);
} }

View File

@@ -76,7 +76,7 @@ class Job extends CI_Model {
public function getRecent($projectId = '') { public function getRecent($projectId = '') {
$this->db->select('jobs.*, trials.project_id, trials.name'); $this->db->select('jobs.*, trials.project_id, trials.name');
$this->db->join('trials', 'jobs.trial_id = trials.id', 'left'); $this->db->join('trials', 'jobs.trial_id = trials.id', 'left');
$this->db->where('finished_at', 0); //$this->db->where('finished_at', 0);
if (!empty($projectId)) { if (!empty($projectId)) {
$this->db->where('project_id', $projectId); $this->db->where('project_id', $projectId);

View File

@@ -84,6 +84,7 @@
<tr> <tr>
<th scope="col"><?=_('Trial');?></th> <th scope="col"><?=_('Trial');?></th>
<th scope="col"><?=_('Started');?></th> <th scope="col"><?=_('Started');?></th>
<th scope="col"><?=_('Finished');?></th>
<th scope="col"><?=_('Actions');?></th> <th scope="col"><?=_('Actions');?></th>
</tr> </tr>
</thead> </thead>
@@ -95,6 +96,7 @@
<tr> <tr>
<td><?=$job['name'];?></td> <td><?=$job['name'];?></td>
<td><?=$job['started_at'];?></td> <td><?=$job['started_at'];?></td>
<td><?=$job['finished_at'] != '0000-00-00 00:00:00' ? $job['finished_at'] : _('Currently running');?></td>
<td> <td>
<a href="<?=site_url('trials/results/' . $job['id']);?>" title="<?= sprintf(_('Show results for the trial &quot;%s&quot;'), $job['name']);?>"><?=_('Show results');?></a> | <a href="<?=site_url('trials/results/' . $job['id']);?>" title="<?= sprintf(_('Show results for the trial &quot;%s&quot;'), $job['name']);?>"><?=_('Show results');?></a> |
<a href="<?=site_url('trials/edit/' . $job['id']);?>" title="<?= sprintf(_('Edit trial &quot;%s&quot;'), $job['name']);?>"><?=_('Edit');?></td> <a href="<?=site_url('trials/edit/' . $job['id']);?>" title="<?= sprintf(_('Edit trial &quot;%s&quot;'), $job['name']);?>"><?=_('Edit');?></td>