'R' => array('value' => 'Running', 'description' => 'Running'),
'B' => array('value' => 'Blocked', 'description' => 'Blocked'),
'T' => array('value' => 'Terminated', 'description' =>'Terminated normally'),
- 'W' => array('value' => 'Terminated with warnings', 'description' =>'Terminated normally with warnings'),
+ 'W' => array('value' => 'Terminated', 'description' =>'Terminated normally with warnings'),
'E' => array('value' => 'Error', 'description' =>'Terminated in Error'),
'e' => array('value' => 'Non-fatal error', 'description' =>'Non-fatal error'),
'f' => array('value' => 'Fatal error', 'description' =>'Fatal error'),
}
return $name;
}
+
+ public function getJobStatusLetter($job) {
+ $statusLetter = '';
+ if (array_key_exists('jobstatus', $job)) {
+ $errors = intval($job['joberrors']);
+ if ($job['jobstatus'] === 'T' && $errors > 0) {
+ $job['jobstatus'] = 'W';
+ }
+ $statusLetter = $job['jobstatus'];
+ }
+ return $statusLetter;
+ }
+
+ public function getJobStatusValue($job) {
+ $statusValue = '';
+ $jobLetter = $this->getJobStatusLetter($job);
+ if (array_key_exists($jobLetter, $this->jobStates)) {
+ $statusValue = $this->jobStates[$jobLetter]['value'];
+ }
+ return $statusValue;
+ }
+
+ public function getJobStatusDescription($job) {
+ $statusDescription = '';
+ $jobLetter = $this->getJobStatusLetter($job);
+ if (array_key_exists($jobLetter, $this->jobStates)) {
+ $statusDescription = $this->jobStates[$jobLetter]['description'];
+ }
+ return $statusDescription;
+ }
}
?>
</com:TActiveTemplateColumn>
<com:TActiveTemplateColumn HeaderText="<%[ Job status ]%>" SortExpression="jobstatus">
<prop:ItemTemplate>
- <div class="job-status-<%=isset($this->getParent()->Data['jobstatus']) ? $this->getParent()->Data['jobstatus'] : ''%>" title="<%=isset($this->getPage()->JobWindow->jobStates[$this->getParent()->Data['jobstatus']]['description']) ? $this->getPage()->JobWindow->jobStates[$this->getParent()->Data['jobstatus']]['description'] : ''%>"><%=isset($this->getPage()->JobWindow->jobStates[$this->getParent()->Data['jobstatus']]['value']) ? $this->getPage()->JobWindow->jobStates[$this->getParent()->Data['jobstatus']]['value'] : ''%></div>
+ <div class="job-status-<%=$this->getPage()->JobWindow->getJobStatusLetter($this->getParent()->Data)%>" title="<%=$this->getPage()->JobWindow->getJobStatusDescription($this->getParent()->Data)%>"><%=$this->getPage()->JobWindow->getJobStatusValue($this->getParent()->Data)%></div>
</prop:ItemTemplate>
</com:TActiveTemplateColumn>
<com:TActiveTemplateColumn HeaderText="<%[ Size ]%>" SortExpression="jobbytes">