<?php
/**
* Copyright (c) Xerox Corporation, Codendi Team, 2001-2009. All rights reserved
- * Copyright 2014, Franck Villaume - TrivialDev
+ * Copyright 2014,2016,2019,2021, Franck Villaume - TrivialDev
*
* This file is a part of Fusionforge.
*
var $_global_status_icon;
var $content;
- function hudson_Widget_ProjectJobsOverview($plugin) {
- $this->Widget('plugin_hudson_project_jobsoverview');
+ function __construct($plugin) {
+ parent::__construct('plugin_hudson_project_jobsoverview');
$this->plugin = $plugin;
- $request =& HTTPRequest::instance();
- $this->group_id = $request->get('group_id');
+ $this->group_id = getIntFromRequest('group_id');
- if ($this->_use_global_status == "true") {
+ if ($this->_use_global_status === true) {
$this->_all_status = array(
'grey' => 0,
'blue' => 0,
}
if (forge_check_perm('hudson', $this->group_id, 'read')) {
$this->content['title'] = '';
- if ($this->_use_global_status == "true") {
+ if ($this->_use_global_status === true) {
$this->content['title'] = '<img src="'.$this->_global_status_icon.'" title="'.$this->_global_status.'" alt="'.$this->_global_status.'" /> ';
}
$this->content['title'] .= _("Hudson Jobs");
}
if ($this->_all_status['grey'] > 0 || $this->_all_status['red'] > 0) {
$this->_global_status = _("One or more failure or pending job");
- $this->_global_status_icon = '/'.$this->plugin->getThemePath() . "/images/ic/status_red.png";
+ $this->_global_status_icon = '/'.$this->plugin->getIconsPath() . "status_red.png";
} elseif ($this->_all_status['yellow'] > 0) {
$this->_global_status = _("One or more unstable job");
- $this->_global_status_icon = '/'.$this->plugin->getThemePath() . "/images/ic/status_yellow.png";
+ $this->_global_status_icon = '/'.$this->plugin->getIconsPath() . "status_yellow.png";
} else {
$this->_global_status = _("Success");
- $this->_global_status_icon = '/'.$this->plugin->getThemePath() . "/images/ic/status_blue.png";
+ $this->_global_status_icon = '/'.$this->plugin->getIconsPath() . "status_blue.png";
}
} else {
- $this->_use_global_status == false;
+ $this->_use_global_status = false;
}
}
$cells = array();
$cells[][] = html_abs_image($job->getStatusIcon(), '15', '15', array('title' => $job->getStatus()));
$cells[] = array(util_make_link('/plugins/hudson/?action=view_job&group_id='.$this->group_id.'&job_id='.$job_id, $job->getName()), 'style' => 'width: 99%');
- $html .= $HTML->multiTableRow(array('class' => $HTML->boxGetAltRowStyle($job_id, true)), $cells);
+ $html .= $HTML->multiTableRow(array(), $cells);
} catch (Exception $e) {
// Do not display wrong jobs
}