[Fusionforge-commits] FusionForge branch master updated. 29a3323d813e860cf8b53a9192697d87e4ffa8b7

Franck VILLAUME nerville at fusionforge.org
Sun Aug 25 22:43:17 CEST 2013


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "FusionForge".

The branch, master has been updated
       via  29a3323d813e860cf8b53a9192697d87e4ffa8b7 (commit)
      from  d29a8f8c536aa0a4dff13d36fb961fa7d4401ecd (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 29a3323d813e860cf8b53a9192697d87e4ffa8b7
Author: Franck Villaume <franck.villaume at trivialdev.com>
Date:   Sun Aug 25 22:42:40 2013 +0200

    indent

diff --git a/src/common/include/UserManager.class.php b/src/common/include/UserManager.class.php
index fc29012..33b0a3e 100644
--- a/src/common/include/UserManager.class.php
+++ b/src/common/include/UserManager.class.php
@@ -2,20 +2,20 @@
 /**
  * Copyright (c) Xerox Corporation, Codendi Team, 2001-2009. All rights reserved
  *
- * This file is a part of Codendi.
+ * This file is a part of Fusionforge.
  *
- * Codendi is free software; you can redistribute it and/or modify
+ * Fusionforge is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
  * the Free Software Foundation; either version 2 of the License, or
  * (at your option) any later version.
  *
- * Codendi is distributed in the hope that it will be useful,
+ * Fusionforge is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
- * along with Codendi. If not, see <http://www.gnu.org/licenses/>.
+ * along with Fusionforge. If not, see <http://www.gnu.org/licenses/>.
  */
 
 require_once 'User.class.php';
@@ -23,50 +23,49 @@ require_once 'User.class.php';
 
 class UserManager {
 
+	protected function __construct() {
+	}
 
-    protected function __construct() {
-    }
+	protected static $_instance;
+	public static function instance() {
+		if (!isset(self::$_instance)) {
+			$c = __CLASS__;
+			self::$_instance = new $c();
+		}
+		return self::$_instance;
+	}
 
-    protected static $_instance;
-    public static function instance() {
-        if (!isset(self::$_instance)) {
-            $c = __CLASS__;
-            self::$_instance = new $c();
-        }
-        return self::$_instance;
-    }
+	/**
+	 * @param $session_hash string Optional parameter. If given, this will force
+	 *                             the load of the user with the given session_hash.
+	 *                             else it will check from the user cookies & ip
+	 * @return User the user currently logged in (who made the request)
+	 */
+	function getCurrentUser($session_hash = false) {
+		if (!session_get_user()) {
+			return new GFUser();
+		}
+		return session_get_user();
+	}
 
+	function getUserById($user_id) {
+		return user_get_object($user_id);
+	}
 
-    /**
-     * @param $session_hash string Optional parameter. If given, this will force
-     *                             the load of the user with the given session_hash.
-     *                             else it will check from the user cookies & ip
-     * @return User the user currently logged in (who made the request)
-     */
-    function getCurrentUser($session_hash = false) {
-    	if (!session_get_user()) {
-    		return new GFUser();
-    	}
-    	return session_get_user();
-    }
+	function getUserByEmail($user_id) {
+		return user_get_object_by_email($user_id);
+	}
 
-    function getUserById($user_id) {
-    	return user_get_object($user_id);
-    }
-
-    function getUserByEmail($user_id) {
-	    return user_get_object_by_email($user_id);
-    }
-    function existEmail ($email) {
-	    if (!validate_email($email)) {
-		    return false;
-	    }
-	    $res = db_query_params('SELECT * FROM users WHERE email=$1', array($email));
-	    if (!$res || db_numrows($res)<1) {
-		    return false;
-	    }
-	    else {
-		    return $email;
-	    }
-    }
+	function existEmail ($email) {
+		if (!validate_email($email)) {
+			return false;
+		}
+		$res = db_query_params('SELECT * FROM users WHERE email=$1', array($email));
+		if (!$res || db_numrows($res)<1) {
+			return false;
+		}
+		else {
+			return $email;
+		}
+	}
 }
diff --git a/src/plugins/hudson/include/HudsonBuild.class.php b/src/plugins/hudson/include/HudsonBuild.class.php
index 0a7f61a..adf6d0e 100644
--- a/src/plugins/hudson/include/HudsonBuild.class.php
+++ b/src/plugins/hudson/include/HudsonBuild.class.php
@@ -2,21 +2,22 @@
 /**
  * Copyright (c) Xerox Corporation, Codendi Team, 2001-2009. All rights reserved
  *
- * This file is a part of Codendi.
+ * This file is a part of Fusionforge.
  *
- * Codendi is free software; you can redistribute it and/or modify
+ * Fusionforge is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
  * the Free Software Foundation; either version 2 of the License, or
  * (at your option) any later version.
  *
- * Codendi is distributed in the hope that it will be useful,
+ * Fusionforge is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
- * along with Codendi. If not, see <http://www.gnu.org/licenses/>.
+ * along with Fusionforge. If not, see <http://www.gnu.org/licenses/>.
  */
+
 require_once 'hudson.class.php';
 require_once 'HudsonJobURLMalformedException.class.php';
 require_once 'HudsonJobURLFileException.class.php';
@@ -24,89 +25,93 @@ require_once 'HudsonJobURLFileNotFoundException.class.php';
 
 class HudsonBuild {
 
-    protected $hudson_build_url;
-    protected $dom_build;
-
-    private $context;
-
-    /**
-     * Construct an Hudson build from a build URL
-     */
-    function HudsonBuild($hudson_build_url) {
-        $parsed_url = parse_url($hudson_build_url);
-
-        if ( ! $parsed_url || ! array_key_exists('scheme', $parsed_url) ) {
-            throw new HudsonJobURLMalformedException(vsprintf(_("Wrong Job URL: %s"),  array($hudson_build_url)));
-        }
-
-        $this->hudson_build_url = $hudson_build_url . "/api/xml";
-
-        $this->_setStreamContext();
-
-        $this->buildBuildObject();
-
-    }
-
-    public function buildBuildObject() {
-        $this->dom_build = $this->_getXMLObject($this->hudson_build_url);
-    }
-
-    protected function _getXMLObject($hudson_build_url) {
-        $xmlstr = @file_get_contents($hudson_build_url, false, $this->context);
-        if ($xmlstr !== false) {
-            $xmlobj = simplexml_load_string($xmlstr);
-            if ($xmlobj !== false) {
-                return $xmlobj;
-            } else {
-                throw new HudsonJobURLFileException(vsprintf(_("Unable to read file at URL: %s"),  array($hudson_build_url)));
-            }
-        } else {
-            throw new HudsonJobURLFileNotFoundException(vsprintf(_("File not found at URL: %s"),  array($hudson_build_url)));
-        }
-    }
-
-    private function _setStreamContext() {
-        if (array_key_exists('sys_proxy', $GLOBALS) && $GLOBALS['sys_proxy']) {
-            $context_opt = array(
-                'http' => array(
-                    'method' => 'GET',
-                    'proxy' => $GLOBALS['sys_proxy'],
-                    'request_fulluri' => True,
-                    'timeout' => 5.0,
-                ),
-            );
-            $this->context = stream_context_create($context_opt);
-        } else {
-            $this->context = null;
-        }
-    }
-
-    function getDom() {
-        return $this->dom_build;
-    }
-
-    function getBuildStyle() {
-        return $this->dom_build->getName();
-    }
-    function isBuilding() {
-        return ($this->dom_build->building == "true");
-    }
-    function getUrl() {
-        return $this->dom_build->url;
-    }
-    function getResult() {
-        return $this->dom_build->result;
-    }
-    function getNumber() {
-        return $this->dom_build->number;
-    }
-    function getDuration() {
-        return $this->dom_build->duration;
-    }
-    function getTimestamp() {
-        return $this->dom_build->timestamp;
-    }
-    function getBuildTime() {
-        return format_date(_("Y-m-d H:i"), substr($this->getTimestamp(), 0, -3));
-    }
+	protected $hudson_build_url;
+	protected $dom_build;
+
+	private $context;
+
+	/**
+	 * Construct an Hudson build from a build URL
+	 */
+	function HudsonBuild($hudson_build_url) {
+		$parsed_url = parse_url($hudson_build_url);
+
+		if ( ! $parsed_url || ! array_key_exists('scheme', $parsed_url) ) {
+			throw new HudsonJobURLMalformedException(vsprintf(_("Wrong Job URL: %s"),  array($hudson_build_url)));
+		}
+
+		$this->hudson_build_url = $hudson_build_url . "/api/xml";
+		$this->_setStreamContext();
+		$this->buildBuildObject();
+	}
+
+	public function buildBuildObject() {
+		$this->dom_build = $this->_getXMLObject($this->hudson_build_url);
+	}
+
+	protected function _getXMLObject($hudson_build_url) {
+		$xmlstr = @file_get_contents($hudson_build_url, false, $this->context);
+		if ($xmlstr !== false) {
+			$xmlobj = simplexml_load_string($xmlstr);
+			if ($xmlobj !== false) {
+				return $xmlobj;
+			} else {
+				throw new HudsonJobURLFileException(vsprintf(_("Unable to read file at URL: %s"),  array($hudson_build_url)));
+			}
+		} else {
+			throw new HudsonJobURLFileNotFoundException(vsprintf(_("File not found at URL: %s"),  array($hudson_build_url)));
+		}
+	}
+
+	private function _setStreamContext() {
+		if (array_key_exists('sys_proxy', $GLOBALS) && $GLOBALS['sys_proxy']) {
+			$context_opt = array(
+					'http' => array(
+							'method' => 'GET',
+							'proxy' => $GLOBALS['sys_proxy'],
+							'request_fulluri' => True,
+							'timeout' => 5.0,
+							),
+					);
+			$this->context = stream_context_create($context_opt);
+		} else {
+			$this->context = null;
+		}
+	}
+
+	function getDom() {
+		return $this->dom_build;
+	}
+
+	function getBuildStyle() {
+		return $this->dom_build->getName();
+	}
+
+	function isBuilding() {
+		return ($this->dom_build->building == "true");
+	}
+
+	function getUrl() {
+		return $this->dom_build->url;
+	}
+
+	function getResult() {
+		return $this->dom_build->result;
+	}
+
+	function getNumber() {
+		return $this->dom_build->number;
+	}
+
+	function getDuration() {
+		return $this->dom_build->duration;
+	}
+
+	function getTimestamp() {
+		return $this->dom_build->timestamp;
+	}
+
+	function getBuildTime() {
+		return format_date(_("Y-m-d H:i"), substr($this->getTimestamp(), 0, -3));
+	}
 }
diff --git a/src/plugins/hudson/include/HudsonJob.class.php b/src/plugins/hudson/include/HudsonJob.class.php
index d8b6fd3..f61c45e 100644
--- a/src/plugins/hudson/include/HudsonJob.class.php
+++ b/src/plugins/hudson/include/HudsonJob.class.php
@@ -2,21 +2,22 @@
 /**
  * Copyright (c) Xerox Corporation, Codendi Team, 2001-2009. All rights reserved
  *
- * This file is a part of Codendi.
+ * This file is a part of Fusionforge.
  *
- * Codendi is free software; you can redistribute it and/or modify
+ * Fusionforge is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
  * the Free Software Foundation; either version 2 of the License, or
  * (at your option) any later version.
  *
- * Codendi is distributed in the hope that it will be useful,
+ * Fusionforge is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
- * along with Codendi. If not, see <http://www.gnu.org/licenses/>.
+ * along with Fusionforge. If not, see <http://www.gnu.org/licenses/>.
  */
+
 require_once 'hudson.class.php';
 require_once 'HudsonJobURLMalformedException.class.php';
 require_once 'HudsonJobURLFileException.class.php';
@@ -24,305 +25,310 @@ require_once 'HudsonJobURLFileNotFoundException.class.php';
 
 class HudsonJob {
 
-    protected $hudson_job_url;
-    protected $hudson_dobuild_url;
-    protected $hudson_config_job_url;
-    protected $dom_job;
-    protected $config_job;
-    private $icons_path;
+	protected $hudson_job_url;
+	protected $hudson_dobuild_url;
+	protected $hudson_config_job_url;
+	protected $dom_job;
+	protected $config_job;
+	private $icons_path;
+	private $context;
+
+	/**
+	 * Construct an Hudson job from a job URL
+	 */
+	function HudsonJob($hudson_job_url) {
+		$parsed_url = parse_url($hudson_job_url);
 
-    private $context;
+		if ( ! $parsed_url || ! array_key_exists('scheme', $parsed_url) ) {
+			throw new HudsonJobURLMalformedException(vsprintf(_("Wrong Job URL: %s"),  array($hudson_job_url)));
+		}
 
-    /**
-     * Construct an Hudson job from a job URL
-     */
-    function HudsonJob($hudson_job_url) {
-        $parsed_url = parse_url($hudson_job_url);
+		$this->hudson_job_url = $hudson_job_url . "/api/xml";
+		$this->hudson_dobuild_url = $hudson_job_url . "/build";
+		$this->hudson_config_job_url = $hudson_job_url . "/config.xml";
+		$controler = $this->getHudsonControler();
+		$this->icons_path = $controler->getIconsPath();
+		$this->_setStreamContext();
+		$this->buildJobObject();
+	}
 
-        if ( ! $parsed_url || ! array_key_exists('scheme', $parsed_url) ) {
-            throw new HudsonJobURLMalformedException(vsprintf(_("Wrong Job URL: %s"),  array($hudson_job_url)));
-        }
+	function getHudsonControler() {
+		return new hudson();
+	}
 
-        $this->hudson_job_url = $hudson_job_url . "/api/xml";
-        $this->hudson_dobuild_url = $hudson_job_url . "/build";
-        $this->hudson_config_job_url = $hudson_job_url . "/config.xml";
+	public function buildJobObject() {
+		$this->dom_job = $this->_getXMLObject($this->hudson_job_url);
+	}
+
+	public function configJobObject() {
+		if ($this->config_job) {
+			return;
+		}
+		$this->config_job = $this->_getXMLObject($this->hudson_config_job_url);
+	}
 
-        $controler = $this->getHudsonControler();
-        $this->icons_path = $controler->getIconsPath();
+	protected function _getXMLObject($hudson_job_url) {
+		// If enabled, use APC cache (1sec) to reduce RSS fetching that may cause big delays.
+		if (function_exists('apc_fetch')) {
+			$xmlstr = apc_fetch($hudson_job_url);
+			if ($xmlstr === false) {
+				$xmlstr = @file_get_contents($hudson_job_url, false, $this->context);
+				apc_store($hudson_job_url, $xmlstr, 1);
+			}
+		} else {
+			$xmlstr = @file_get_contents($hudson_job_url, false, $this->context);
+		}
 
-        $this->_setStreamContext();
+		if ($xmlstr !== false) {
+			$xmlobj = simplexml_load_string($xmlstr);
+			if ($xmlobj !== false) {
+				return $xmlobj;
+			} else {
+				throw new HudsonJobURLFileException(vsprintf(_("Unable to read file at URL: %s"),  array($hudson_job_url)));
+			}
+		} else {
+			throw new HudsonJobURLFileNotFoundException(vsprintf(_("File not found at URL: %s"),  array($hudson_job_url)));
+		}
+	}
 
-        $this->buildJobObject();
+	private function _setStreamContext() {
+		if (array_key_exists('sys_proxy', $GLOBALS) && $GLOBALS['sys_proxy']) {
+			$context_opt = array(
+				'http' => array(
+						'method' => 'GET',
+						'proxy' => $GLOBALS['sys_proxy'],
+						'request_fulluri' => True,
+						'timeout' => 5.0,
+						),
+					);
+			$this->context = stream_context_create($context_opt);
+		} else {
+			$this->context = null;
+		}
+	}
 
-    }
-    function getHudsonControler() {
-        return new hudson();
-    }
+	function getProjectStyle() {
+		return $this->dom_job->getName();
+	}
 
-    public function buildJobObject() {
-        $this->dom_job = $this->_getXMLObject($this->hudson_job_url);
-    }
+	function getName() {
+		return $this->dom_job->name;
+	}
 
-    public function configJobObject() {
-		if ($this->config_job) {
-	    	return;
+	function getUrl() {
+		return $this->dom_job->url;
+	}
+
+	function getColor() {
+		return $this->dom_job->color;
+	}
+
+	function getColorNoAnime() {
+		$color = $this->getColor();
+		if (strpos($color, "_anime")) {
+			$color = substr($color, 0, strpos($color, "_anime"));
+		}
+		return $color;
+	}
+
+	function getStatus() {
+		switch ($this->getColor()) {
+			case "blue":
+				// The last build was successful.
+				return _("Success");
+				break;
+			case "blue_anime":
+				// The last build was successful. A new build is in progress.
+				return _("In progress");
+				break;
+			case "yellow":
+				// The last build was successful but unstable. This is primarily used to represent test failures.
+				return _("Unstable");
+				break;
+			case "yellow_anime":
+				// The last build was successful but unstable. This is primarily used to represent test failures. A new build is in progress.
+				return _("In progress");
+				break;
+			case "red":
+				// The last build fatally failed.
+				return _("Failure");
+				break;
+			case "red_anime":
+				// The last build fatally failed. A new build is in progress.
+				return _("In progress");
+				break;
+			case "grey":
+				// The project has never been built before, or the project is disabled.
+				return _("Pending");
+				break;
+			case "grey_anime":
+				// The project has never been built before, or the project is disabled. The first build of this project is in progress.
+				return _("In progress");
+				break;
+			default:
+				// Can we have anime icons here?
+				return _("Unknown status");
+				break;
+		}
+	}
+
+	function getIconsPath() {
+		return $this->icons_path;
+	}
+
+	function getStatusIcon() {
+		switch ($this->getColor()) {
+			case "blue":
+				// The last build was successful.
+				return $this->getIconsPath()."status_blue.png";
+				break;
+			case "blue_anime":
+				// The last build was successful. A new build is in progress.
+				return $this->getIconsPath()."status_blue.png";
+				break;
+			case "yellow":
+				// The last build was successful but unstable. This is primarily used to represent test failures.
+				return $this->getIconsPath()."status_yellow.png";
+				break;
+			case "yellow_anime":
+				// The last build was successful but unstable. A new build is in progress.
+				return $this->getIconsPath()."status_yellow.png";
+				break;
+			case "red":
+				// The last build fatally failed.
+				return $this->getIconsPath()."status_red.png";
+				break;
+			case "red_anime":
+				// The last build fatally failed. A new build is in progress.
+				return $this->getIconsPath()."status_red.png";
+				break;
+			case "grey":
+				// The project has never been built before, or the project is disabled.
+				return $this->getIconsPath()."status_grey.png";
+				break;
+			case "grey_anime":
+				// The first build of the project is in progress.
+				return $this->getIconsPath()."status_grey.png";
+				break;
+			default:
+				// Can we have anime icons here?
+				return $this->getIconsPath()."status_unknown.png";
+				break;
 		}
-        $this->config_job = $this->_getXMLObject($this->hudson_config_job_url);
-    }
-
-    protected function _getXMLObject($hudson_job_url) {
-
-        // If enabled, use APC cache (1sec) to reduce RSS fetching that may cause big delays.
-        if (function_exists('apc_fetch')) {
-            $xmlstr = apc_fetch($hudson_job_url);
-            if ($xmlstr === false) {
-        		$xmlstr = @file_get_contents($hudson_job_url, false, $this->context);
-                apc_store($hudson_job_url, $xmlstr, 1);
-            }
-        } else {
-            $xmlstr = @file_get_contents($hudson_job_url, false, $this->context);
-        }
-
-        if ($xmlstr !== false) {
-            $xmlobj = simplexml_load_string($xmlstr);
-            if ($xmlobj !== false) {
-                return $xmlobj;
-            } else {
-                throw new HudsonJobURLFileException(vsprintf(_("Unable to read file at URL: %s"),  array($hudson_job_url)));
-            }
-        } else {
-            throw new HudsonJobURLFileNotFoundException(vsprintf(_("File not found at URL: %s"),  array($hudson_job_url)));
-        }
-    }
-
-    private function _setStreamContext() {
-        if (array_key_exists('sys_proxy', $GLOBALS) && $GLOBALS['sys_proxy']) {
-            $context_opt = array(
-                'http' => array(
-                    'method' => 'GET',
-                    'proxy' => $GLOBALS['sys_proxy'],
-                    'request_fulluri' => True,
-                    'timeout' => 5.0,
-                ),
-            );
-            $this->context = stream_context_create($context_opt);
-        } else {
-            $this->context = null;
-        }
-    }
-
-    function getProjectStyle() {
-        return $this->dom_job->getName();
-    }
-    function getName() {
-        return $this->dom_job->name;
-    }
-    function getUrl() {
-        return $this->dom_job->url;
-    }
-    function getColor() {
-        return $this->dom_job->color;
-    }
-    function getColorNoAnime() {
-        $color = $this->getColor();
-        if (strpos($color, "_anime")) {
-            $color = substr($color, 0, strpos($color, "_anime"));
-        }
-        return $color;
-    }
-    function getStatus() {
-        switch ($this->getColor()) {
-            case "blue":
-                // The last build was successful.
-                return _("Success");
-                break;
-            case "blue_anime":
-                // The last build was successful. A new build is in progress.
-                return _("In progress");
-                break;
-            case "yellow":
-                // The last build was successful but unstable. This is primarily used to represent test failures.
-                return _("Unstable");
-                break;
-            case "yellow_anime":
-                // The last build was successful but unstable. This is primarily used to represent test failures. A new build is in progress.
-                return _("In progress");
-                break;
-            case "red":
-                // The last build fatally failed.
-                return _("Failure");
-                break;
-            case "red_anime":
-                // The last build fatally failed. A new build is in progress.
-                return _("In progress");
-                break;
-            case "grey":
-                // The project has never been built before, or the project is disabled.
-                return _("Pending");
-                break;
-            case "grey_anime":
-                // The project has never been built before, or the project is disabled. The first build of this project is in progress.
-                return _("In progress");
-                break;
-            default:
-                // Can we have anime icons here?
-                return _("Unknown status");
-                break;
-        }
-    }
-
-    function getIconsPath() {
-        return $this->icons_path;
-    }
-    function getStatusIcon() {
-        switch ($this->getColor()) {
-            case "blue":
-                // The last build was successful.
-                return $this->getIconsPath()."status_blue.png";
-                break;
-            case "blue_anime":
-                // The last build was successful. A new build is in progress.
-                return $this->getIconsPath()."status_blue.png";
-                break;
-            case "yellow":
-                // The last build was successful but unstable. This is primarily used to represent test failures.
-                return $this->getIconsPath()."status_yellow.png";
-                break;
-            case "yellow_anime":
-                // The last build was successful but unstable. A new build is in progress.
-                return $this->getIconsPath()."status_yellow.png";
-                break;
-            case "red":
-                // The last build fatally failed.
-                return $this->getIconsPath()."status_red.png";
-                break;
-            case "red_anime":
-                // The last build fatally failed. A new build is in progress.
-                return $this->getIconsPath()."status_red.png";
-                break;
-            case "grey":
-                // The project has never been built before, or the project is disabled.
-                return $this->getIconsPath()."status_grey.png";
-                break;
-            case "grey_anime":
-                // The first build of the project is in progress.
-                return $this->getIconsPath()."status_grey.png";
-                break;
-            default:
-                // Can we have anime icons here?
-                return $this->getIconsPath()."status_unknown.png";
-                break;
-        }
-    }
-
-    function isBuildable() {
-        return ($this->dom_job->buildable == "true");
-    }
-
-    function hasBuilds() {
-        return ((int)$this->getLastBuildNumber() !== 0);
-    }
-
-    function getLastBuildNumber() {
-        return $this->dom_job->lastBuild->number;
-    }
-    function getLastBuildUrl() {
-        return $this->dom_job->lastBuild->url;
-    }
-
-    function getLastSuccessfulBuildNumber() {
-        return $this->dom_job->lastSuccessfulBuild->number;
-    }
-    function getLastSuccessfulBuildUrl() {
-        return $this->dom_job->lastSuccessfulBuild->url;
-    }
-
-    function getLastFailedBuildNumber() {
-        return $this->dom_job->lastFailedBuild->number;
-    }
-    function getLastFailedBuildUrl() {
-        return $this->dom_job->lastFailedBuild->url;
-    }
-
-    function getNextBuildNumber() {
-        return $this->dom_job->nextBuildNumber;
-    }
-
-    function getHealthScores() {
-        $scores = array();
-        foreach ($this->dom_job->healthReport as $health_report) {
-            $scores[] = $health_report->score;
-        }
-        return $scores;
-    }
-    function getHealthDescriptions() {
-        $descs = array();
-        foreach ($this->dom_job->healthReport as $health_report) {
-            $scores[] = $health_report->description;
-        }
-        return $descs;
-    }
-    function getHealthAverageScore() {
-        $arr = $this->getHealthScores();
-        $sum = 0;
-        foreach ($arr as $score) {
-            $sum += (int)$score;
-        }
-        $num = sizeof($arr);
-        if ($num != 0) {
-            return floor($sum/$num);
-        } else {
-            return null;
-        }
-    }
-
-    function getWeatherReportIcon() {
-        $score = $this->getHealthAverageScore();
-        if ($score >= 80) {
-            return $this->getIconsPath()."health_80_plus.gif";
-        } elseif ($score >= 60) {
-            return $this->getIconsPath()."health_60_to_79.gif";
-        } elseif ($score >= 40) {
-            return $this->getIconsPath()."health_40_to_59.gif";
-        } elseif ($score >= 20) {
-            return $this->getIconsPath()."health_20_to_39.gif";
-        } else {
-            return $this->getIconsPath()."health_00_to_19.gif";
-        }
-    }
-
-    function getSvnLocation() {
-        $this->configJobObject();
-        return $this->config_job->scm->locations->{'hudson.scm.SubversionSCM_-ModuleLocation'}->remote;
-    }
-
-    /**
-     * Launch a Build for this job on the Continuous Integration server.
-     *
-     * @exception if unable to open build URL or if response is an error
-     *
-     * @param  string   $token if CI server has activated security (login/password), then a token is mandatory to build jobs. This token is defined in the job configuration.
-     * @return response of build call.
-     */
-    function launchBuild($token = null) {
-        $url = $this->hudson_dobuild_url;
-        if ($token != null) {
-            $url .= '?token='.$token;
-        }
-        $params = array('http' => array(
-                     'method' => 'POST',
-                     'content' => ''
-                ));
-        $ctx = stream_context_create($params);
-        $fp = fopen($url, 'rb', false, $ctx);
-        if (!$fp) {
-            throw new Exception("Problem with $url");
-        }
-        $response = stream_get_contents($fp);
-        if ($response === false) {
-            throw new Exception("Problem reading data from $url");
-        }
-        return $response;
-    }
+	}
+
+	function isBuildable() {
+		return ($this->dom_job->buildable == "true");
+	}
+
+	function hasBuilds() {
+		return ((int)$this->getLastBuildNumber() !== 0);
+	}
+
+	function getLastBuildNumber() {
+		return $this->dom_job->lastBuild->number;
+	}
 
+	function getLastBuildUrl() {
+		return $this->dom_job->lastBuild->url;
+	}
+
+	function getLastSuccessfulBuildNumber() {
+		return $this->dom_job->lastSuccessfulBuild->number;
+	}
+
+	function getLastSuccessfulBuildUrl() {
+		return $this->dom_job->lastSuccessfulBuild->url;
+	}
+
+	function getLastFailedBuildNumber() {
+		return $this->dom_job->lastFailedBuild->number;
+	}
+
+	function getLastFailedBuildUrl() {
+		return $this->dom_job->lastFailedBuild->url;
+	}
+
+	function getNextBuildNumber() {
+		return $this->dom_job->nextBuildNumber;
+	}
+
+	function getHealthScores() {
+		$scores = array();
+		foreach ($this->dom_job->healthReport as $health_report) {
+			$scores[] = $health_report->score;
+		}
+		return $scores;
+	}
+
+	function getHealthDescriptions() {
+		$descs = array();
+		foreach ($this->dom_job->healthReport as $health_report) {
+			$scores[] = $health_report->description;
+		}
+		return $descs;
+	}
+
+	function getHealthAverageScore() {
+		$arr = $this->getHealthScores();
+		$sum = 0;
+		foreach ($arr as $score) {
+			$sum += (int)$score;
+		}
+		$num = sizeof($arr);
+		if ($num != 0) {
+			return floor($sum/$num);
+		} else {
+			return null;
+		}
+	}
+
+	function getWeatherReportIcon() {
+		$score = $this->getHealthAverageScore();
+		if ($score >= 80) {
+			return $this->getIconsPath()."health_80_plus.gif";
+		} elseif ($score >= 60) {
+			return $this->getIconsPath()."health_60_to_79.gif";
+		} elseif ($score >= 40) {
+			return $this->getIconsPath()."health_40_to_59.gif";
+		} elseif ($score >= 20) {
+			return $this->getIconsPath()."health_20_to_39.gif";
+		} else {
+			return $this->getIconsPath()."health_00_to_19.gif";
+		}
+	}
+
+	function getSvnLocation() {
+		$this->configJobObject();
+		return $this->config_job->scm->locations->{'hudson.scm.SubversionSCM_-ModuleLocation'}->remote;
+	}
+
+	/**
+	 * Launch a Build for this job on the Continuous Integration server.
+	 *
+	 * @exception if unable to open build URL or if response is an error
+	 *
+	 * @param  string   $token if CI server has activated security (login/password), then a token is mandatory to build jobs. This token is defined in the job configuration.
+	 * @return response of build call.
+	 */
+	function launchBuild($token = null) {
+		$url = $this->hudson_dobuild_url;
+		if ($token != null) {
+			$url .= '?token='.$token;
+		}
+		$params = array('http' => array(
+					'method' => 'POST',
+					'content' => ''
+				));
+		$ctx = stream_context_create($params);
+		$fp = fopen($url, 'rb', false, $ctx);
+		if (!$fp) {
+			throw new Exception("Problem with $url");
+		}
+		$response = stream_get_contents($fp);
+		if ($response === false) {
+			throw new Exception("Problem reading data from $url");
+		}
+		return $response;
+	}
 }
diff --git a/src/plugins/hudson/include/HudsonJobURLFileException.class.php b/src/plugins/hudson/include/HudsonJobURLFileException.class.php
index eda96fc..2824796 100644
--- a/src/plugins/hudson/include/HudsonJobURLFileException.class.php
+++ b/src/plugins/hudson/include/HudsonJobURLFileException.class.php
@@ -2,21 +2,22 @@
 /**
  * Copyright (c) Xerox Corporation, Codendi Team, 2001-2009. All rights reserved
  *
- * This file is a part of Codendi.
+ * This file is a part of Fusionforge.
  *
- * Codendi is free software; you can redistribute it and/or modify
+ * Fusionforge is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
  * the Free Software Foundation; either version 2 of the License, or
  * (at your option) any later version.
  *
- * Codendi is distributed in the hope that it will be useful,
+ * Fusionforge is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
- * along with Codendi. If not, see <http://www.gnu.org/licenses/>.
+ * along with Fusionforge. If not, see <http://www.gnu.org/licenses/>.
  */
+
 class HudsonJobURLFileException extends Exception {
 
 }
diff --git a/src/plugins/hudson/include/HudsonJobURLFileNotFoundException.class.php b/src/plugins/hudson/include/HudsonJobURLFileNotFoundException.class.php
index d6df138..68b2675 100644
--- a/src/plugins/hudson/include/HudsonJobURLFileNotFoundException.class.php
+++ b/src/plugins/hudson/include/HudsonJobURLFileNotFoundException.class.php
@@ -2,21 +2,22 @@
 /**
  * Copyright (c) Xerox Corporation, Codendi Team, 2001-2009. All rights reserved
  *
- * This file is a part of Codendi.
+ * This file is a part of Fusionforge.
  *
- * Codendi is free software; you can redistribute it and/or modify
+ * Fusionforge is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
  * the Free Software Foundation; either version 2 of the License, or
  * (at your option) any later version.
  *
- * Codendi is distributed in the hope that it will be useful,
+ * Fusionforge is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
- * along with Codendi. If not, see <http://www.gnu.org/licenses/>.
+ * along with Fusionforge. If not, see <http://www.gnu.org/licenses/>.
  */
+
 class HudsonJobURLFileNotFoundException extends HudsonJobURLFileException {
 
 }
diff --git a/src/plugins/hudson/include/HudsonJobURLMalformedException.class.php b/src/plugins/hudson/include/HudsonJobURLMalformedException.class.php
index efe88dd..1d352fe 100644
--- a/src/plugins/hudson/include/HudsonJobURLMalformedException.class.php
+++ b/src/plugins/hudson/include/HudsonJobURLMalformedException.class.php
@@ -2,21 +2,22 @@
 /**
  * Copyright (c) Xerox Corporation, Codendi Team, 2001-2009. All rights reserved
  *
- * This file is a part of Codendi.
+ * This file is a part of Fusionforge.
  *
- * Codendi is free software; you can redistribute it and/or modify
+ * Fusionforge is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
  * the Free Software Foundation; either version 2 of the License, or
  * (at your option) any later version.
  *
- * Codendi is distributed in the hope that it will be useful,
+ * Fusionforge is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
- * along with Codendi. If not, see <http://www.gnu.org/licenses/>.
+ * along with Fusionforge. If not, see <http://www.gnu.org/licenses/>.
  */
+
 class HudsonJobURLMalformedException extends Exception {
 
 }
diff --git a/src/plugins/hudson/include/HudsonJobWidget.class.php b/src/plugins/hudson/include/HudsonJobWidget.class.php
index 3aa5acb..566bc86 100644
--- a/src/plugins/hudson/include/HudsonJobWidget.class.php
+++ b/src/plugins/hudson/include/HudsonJobWidget.class.php
@@ -2,124 +2,125 @@
 /**
  * Copyright (c) Xerox Corporation, Codendi Team, 2001-2009. All rights reserved
  *
- * This file is a part of Codendi.
+ * This file is a part of Fusionforge.
  *
- * Codendi is free software; you can redistribute it and/or modify
+ * Fusionforge is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
  * the Free Software Foundation; either version 2 of the License, or
  * (at your option) any later version.
  *
- * Codendi is distributed in the hope that it will be useful,
+ * Fusionforge is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
- * along with Codendi. If not, see <http://www.gnu.org/licenses/>.
+ * along with Fusionforge. If not, see <http://www.gnu.org/licenses/>.
  */
+
 require_once 'HudsonWidget.class.php';
 require_once 'common/widget/Widget.class.php';
 require_once 'PluginHudsonJobDao.class.php';
 
 abstract class HudsonJobWidget extends HudsonWidget {
 
-    var $widget_id;
-    var $group_id;
-
-    var $job;
-    var $job_url;
-    var $job_id;
+	var $widget_id;
+	var $group_id;
+	var $job;
+	var $job_url;
+	var $job_id;
 
-    function isUnique() {
-        return false;
-    }
+	function isUnique() {
+		return false;
+	}
 
-    function create(&$request) {
-        $content_id = false;
-        $vId = new Valid_Uint('job_id');
-        $vId->setErrorMessage("Can't add empty job id");
-        $vId->required();
-        if ($request->valid($vId)) {
-            $job_id = $request->get('job_id');
-            $sql = 'INSERT INTO plugin_hudson_widget (widget_name, owner_id, owner_type, job_id) VALUES ($1,$2,$3,$4)';
-            $res = db_query_params($sql,array($this->id,$this->owner_id,$this->owner_type,$job_id));
-            $content_id = db_insertid($res,'plugin_hudson_widget','id');
-        }
-        return $content_id;
-    }
+	function create(&$request) {
+		$content_id = false;
+		$vId = new Valid_Uint('job_id');
+		$vId->setErrorMessage("Can't add empty job id");
+		$vId->required();
+		if ($request->valid($vId)) {
+			$job_id = $request->get('job_id');
+			$sql = 'INSERT INTO plugin_hudson_widget (widget_name, owner_id, owner_type, job_id) VALUES ($1,$2,$3,$4)';
+			$res = db_query_params($sql,array($this->id,$this->owner_id,$this->owner_type,$job_id));
+			$content_id = db_insertid($res,'plugin_hudson_widget','id');
+		}
+		return $content_id;
+	}
 
-    function destroy($id) {
-        $sql = 'DELETE FROM plugin_hudson_widget WHERE id = $1 AND owner_id = $2 AND owner_type = $3';
-        db_query_params($sql,array($id,$this->owner_id,$this->owner_type));
-    }
+	function destroy($id) {
+		$sql = 'DELETE FROM plugin_hudson_widget WHERE id = $1 AND owner_id = $2 AND owner_type = $3';
+		db_query_params($sql,array($id,$this->owner_id,$this->owner_type));
+	}
 
-    function getInstallPreferences() {
-        $prefs  = '';
-        $prefs .= '<strong>'._("Monitored job:").'</strong><br />';
-        $jobs = $this->getAvailableJobs();
+	function getInstallPreferences() {
+		$prefs  = '';
+		$prefs .= '<strong>'._("Monitored job:").'</strong><br />';
+		$jobs = $this->getAvailableJobs();
 		$selected_jobs_id = $this->getSelectedJobsId();
 
-        foreach ($jobs as $job_id => $job) {
-            if (in_array($job_id, $selected_jobs_id)) {
-    			$options = ' disabled="disabled"';
-    			$comment = ' <em>('._('Already used') .')</em>';
-    		} else {
-    			$options = '';
-    			$comment = '';
-            }
-    		$prefs .= '<input type="radio" name="job_id" value="'.$job_id.'"'.$options.'/> '.$job->getName().$comment;
-            $prefs .= '<br />';
-        }
-        return $prefs;
-    }
-    function hasPreferences() {
-        return true;
-    }
-    function getPreferences() {
-        $prefs  = '';
-        $prefs .= '<strong>'._("Monitored job:").'</strong><br />';
-        $jobs = $this->getAvailableJobs();
-    	$selected_jobs_id = $this->getSelectedJobsId();
+		foreach ($jobs as $job_id => $job) {
+			if (in_array($job_id, $selected_jobs_id)) {
+				$options = ' disabled="disabled"';
+				$comment = ' <em>('._('Already used') .')</em>';
+			} else {
+				$options = '';
+				$comment = '';
+			}
+			$prefs .= '<input type="radio" name="job_id" value="'.$job_id.'"'.$options.'/> '.$job->getName().$comment;
+			$prefs .= '<br />';
+		}
+		return $prefs;
+	}
 
-        foreach ($jobs as $job_id => $job) {
-    		if (in_array($job_id, $selected_jobs_id)) {
-    			$options = ' disabled="disabled"';
-    			$comment = ' <em>('._('Already used') .')</em>';
-    		} else {
-    			$options = '';
-    			$comment = '';
-    		}
-    		if ($job_id == $this->job_id) {
-    			$options = ' checked="checked"';
-    			$comment = ' <em>('._('Current used') .')</em>';
-    		}
-    		$prefs .= '<input type="radio" name="' . $this->id . '" value="'.$job_id.'"' . $options . '> '.$job->getName().$comment.'<br />';
-        }
-        return $prefs;
-    }
+	function hasPreferences() {
+		return true;
+	}
 
-    function updatePreferences(&$request) {
-        $request->valid(new Valid_String('cancel'));
-        if (!$request->exist('cancel')) {
-            $job_id = $request->get($this->id);
-            $sql = "UPDATE plugin_hudson_widget SET job_id=$1 WHERE owner_id = $2 AND owner_type = $3 AND id = $4";
-            $res = db_query_params($sql,array($job_id,$this->owner_id,$this->owner_type,(int)$request->get('content_id')));
-        }
-        return true;
-    }
-	/**
-     * Returns the jobs selected for this widget
-     */
-    function getSelectedJobsId() {
-        $sql = "SELECT job_id FROM plugin_hudson_widget WHERE widget_name=$1 AND owner_id=$2 AND owner_type=$3";
-        $res = db_query_params($sql,array($this->widget_id,$this->owner_id,$this->owner_type));
+	function getPreferences() {
+		$prefs  = '';
+		$prefs .= '<strong>'._("Monitored job:").'</strong><br />';
+		$jobs = $this->getAvailableJobs();
+		$selected_jobs_id = $this->getSelectedJobsId();
+
+		foreach ($jobs as $job_id => $job) {
+			if (in_array($job_id, $selected_jobs_id)) {
+				$options = ' disabled="disabled"';
+				$comment = ' <em>('._('Already used') .')</em>';
+			} else {
+				$options = '';
+				$comment = '';
+			}
+			if ($job_id == $this->job_id) {
+				$options = ' checked="checked"';
+				$comment = ' <em>('._('Current used') .')</em>';
+			}
+			$prefs .= '<input type="radio" name="' . $this->id . '" value="'.$job_id.'"' . $options . '> '.$job->getName().$comment.'<br />';
+		}
+		return $prefs;
+	}
 
-        $selected_jobs_id = array();
-        while ($data = db_fetch_array($res)) {
-                $selected_jobs_id[] = $data['job_id'];
-        }
-        return $selected_jobs_id;
-    }
+	function updatePreferences(&$request) {
+		$request->valid(new Valid_String('cancel'));
+		if (!$request->exist('cancel')) {
+			$job_id = $request->get($this->id);
+			$sql = "UPDATE plugin_hudson_widget SET job_id=$1 WHERE owner_id = $2 AND owner_type = $3 AND id = $4";
+			$res = db_query_params($sql,array($job_id,$this->owner_id,$this->owner_type,(int)$request->get('content_id')));
+		}
+		return true;
+	}
 
+	/**
+	 * Returns the jobs selected for this widget
+	 */
+	function getSelectedJobsId() {
+		$sql = "SELECT job_id FROM plugin_hudson_widget WHERE widget_name=$1 AND owner_id=$2 AND owner_type=$3";
+		$res = db_query_params($sql,array($this->widget_id,$this->owner_id,$this->owner_type));
 
+		$selected_jobs_id = array();
+		while ($data = db_fetch_array($res)) {
+			$selected_jobs_id[] = $data['job_id'];
+		}
+		return $selected_jobs_id;
+	}
 }
diff --git a/src/plugins/hudson/include/HudsonOverviewWidget.class.php b/src/plugins/hudson/include/HudsonOverviewWidget.class.php
index 37d1b1a..bd0549a 100644
--- a/src/plugins/hudson/include/HudsonOverviewWidget.class.php
+++ b/src/plugins/hudson/include/HudsonOverviewWidget.class.php
@@ -2,27 +2,27 @@
 /**
  * Copyright (c) Xerox Corporation, Codendi Team, 2001-2009. All rights reserved
  *
- * This file is a part of Codendi.
+ * This file is a part of Fusionforge.
  *
- * Codendi is free software; you can redistribute it and/or modify
+ * Fusionforge is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
  * the Free Software Foundation; either version 2 of the License, or
  * (at your option) any later version.
  *
- * Codendi is distributed in the hope that it will be useful,
+ * Fusionforge is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
- * along with Codendi. If not, see <http://www.gnu.org/licenses/>.
+ * along with Fusionforge. If not, see <http://www.gnu.org/licenses/>.
  */
+
 require_once 'HudsonWidget.class.php';
 
 abstract class HudsonOverviewWidget extends HudsonWidget {
 
-    function isUnique() {
-        return true;
-    }
-
+	function isUnique() {
+		return true;
+	}
 }
diff --git a/src/plugins/hudson/include/HudsonTestResult.class.php b/src/plugins/hudson/include/HudsonTestResult.class.php
index 1e26994..7e68b5f 100644
--- a/src/plugins/hudson/include/HudsonTestResult.class.php
+++ b/src/plugins/hudson/include/HudsonTestResult.class.php
@@ -18,6 +18,7 @@
  * You should have received a copy of the GNU General Public License
  * along with Fusionforge. If not, see <http://www.gnu.org/licenses/>.
  */
+
 require_once 'hudson.class.php';
 require_once 'HudsonJobURLMalformedException.class.php';
 require_once 'HudsonJobURLFileException.class.php';
@@ -30,8 +31,8 @@ class HudsonTestResult {
 	private $context;
 
 	/**
-	* Construct an Hudson job from a job URL
-	*/
+	 * Construct an Hudson job from a job URL
+	 */
 	function HudsonTestResult($hudson_job_url) {
 		$parsed_url = parse_url($hudson_job_url);
 
diff --git a/src/plugins/hudson/include/HudsonWidget.class.php b/src/plugins/hudson/include/HudsonWidget.class.php
index 995c271..d4b96db 100644
--- a/src/plugins/hudson/include/HudsonWidget.class.php
+++ b/src/plugins/hudson/include/HudsonWidget.class.php
@@ -2,78 +2,79 @@
 /**
  * Copyright (c) Xerox Corporation, Codendi Team, 2001-2009. All rights reserved
  *
- * This file is a part of Codendi.
+ * This file is a part of Fusionforge.
  *
- * Codendi is free software; you can redistribute it and/or modify
+ * Fusionforge is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
  * the Free Software Foundation; either version 2 of the License, or
  * (at your option) any later version.
  *
- * Codendi is distributed in the hope that it will be useful,
+ * Fusionforge is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
- * along with Codendi. If not, see <http://www.gnu.org/licenses/>.
+ * along with Fusionforge. If not, see <http://www.gnu.org/licenses/>.
  */
+
 require_once 'common/widget/Widget.class.php';
 require_once 'PluginHudsonJobDao.class.php';
 require_once 'common/widget/WidgetLayoutManager.class.php';
 
 abstract class HudsonWidget extends Widget {
 
-    function getCategory() {
-        return _('Hudson');
-    }
+	function getCategory() {
+		return _('Hudson');
+	}
 
-    protected function getAvailableJobs() {
-        $jobs = array();
-        if ($this->owner_type == WidgetLayoutManager::OWNER_TYPE_USER) {
-            $jobs = $this->getJobsByUser($user = UserManager::instance()->getCurrentUser()->getId());
-        } else {
-            $jobs = $this->getJobsByGroup($this->group_id);
-        }
-        return $jobs;
-    }
+	protected function getAvailableJobs() {
+		$jobs = array();
+		if ($this->owner_type == WidgetLayoutManager::OWNER_TYPE_USER) {
+			$jobs = $this->getJobsByUser($user = UserManager::instance()->getCurrentUser()->getId());
+		} else {
+			$jobs = $this->getJobsByGroup($this->group_id);
+		}
+		return $jobs;
+	}
 
-    protected function getJobsByGroup($group_id) {
-    	$dao = CodendiDataAccess::instance();
-        $job_dao = new PluginHudsonJobDao($dao);
-        $dar = $job_dao->searchByGroupID($group_id);
-        $jobs = array();
-        while ($dar->valid()) {
-            $row = $dar->current();
-            try {
-                $job = new Hudsonjob($row['job_url']);
-                $jobs[$row['job_id']] = $job;
-            } catch (exception $e) {
-                // Do not add unvalid jobs
-            }
-            $dar->next();
-        }
-        return $jobs;
-    }
+	protected function getJobsByGroup($group_id) {
+		$dao = CodendiDataAccess::instance();
+		$job_dao = new PluginHudsonJobDao($dao);
+		$dar = $job_dao->searchByGroupID($group_id);
+		$jobs = array();
+		while ($dar->valid()) {
+		$row = $dar->current();
+			try {
+				$job = new Hudsonjob($row['job_url']);
+				$jobs[$row['job_id']] = $job;
+			} catch (exception $e) {
+				// Do not add unvalid jobs
+			}
+			$dar->next();
+		}
+		return $jobs;
+	}
 
-    protected function getJobsByUser($user_id) {
-        $job_dao = new PluginHudsonJobDao(CodendiDataAccess::instance());
-        $dar = $job_dao->searchByUserID($user_id);
-        $jobs = array();
-        while ($dar->valid()) {
-            $row = $dar->current();
-            try {
-                $job = new Hudsonjob($row['job_url']);
-                $jobs[$row['job_id']] = $job;
-            } catch (exception $e) {
-                // Do not add unvalid jobs
-            }
-            $dar->next();
-        }
-        return $jobs;
-    }
+	protected function getJobsByUser($user_id) {
+		$job_dao = new PluginHudsonJobDao(CodendiDataAccess::instance());
+		$dar = $job_dao->searchByUserID($user_id);
+		$jobs = array();
+		while ($dar->valid()) {
+			$row = $dar->current();
+			try {
+				$job = new Hudsonjob($row['job_url']);
+				$jobs[$row['job_id']] = $job;
+			} catch (exception $e) {
+				// Do not add unvalid jobs
+			}
+			$dar->next();
+		}
+		return $jobs;
+	}
 
-    function isAjax() {
-        return true;
-    }
+	function isAjax() {
+		return true;
+	}
 
 }
diff --git a/src/plugins/hudson/include/PluginHudsonJobDao.class.php b/src/plugins/hudson/include/PluginHudsonJobDao.class.php
index b9dfeec..3d1935e 100644
--- a/src/plugins/hudson/include/PluginHudsonJobDao.class.php
+++ b/src/plugins/hudson/include/PluginHudsonJobDao.class.php
@@ -2,21 +2,22 @@
 /**
  * Copyright (c) Xerox Corporation, Codendi Team, 2001-2009. All rights reserved
  *
- * This file is a part of Codendi.
+ * This file is a part of Fusionforge.
  *
- * Codendi is free software; you can redistribute it and/or modify
+ * Fusionforge is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
  * the Free Software Foundation; either version 2 of the License, or
  * (at your option) any later version.
  *
- * Codendi is distributed in the hope that it will be useful,
+ * Fusionforge is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
- * along with Codendi. If not, see <http://www.gnu.org/licenses/>.
+ * along with Fusionforge. If not, see <http://www.gnu.org/licenses/>.
  */
+
 require_once 'common/dao/include/DataAccessObject.class.php';
 
 /**
diff --git a/src/plugins/hudson/include/hudson.class.php b/src/plugins/hudson/include/hudson.class.php
index ef7066d..8171294 100644
--- a/src/plugins/hudson/include/hudson.class.php
+++ b/src/plugins/hudson/include/hudson.class.php
@@ -2,20 +2,20 @@
 /**
  * Copyright (c) Xerox Corporation, Codendi Team, 2001-2009. All rights reserved
  *
- * This file is a part of Codendi.
+ * This file is a part of Fusionforge.
  *
- * Codendi is free software; you can redistribute it and/or modify
+ * Fusionforge is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
  * the Free Software Foundation; either version 2 of the License, or
  * (at your option) any later version.
  *
- * Codendi is distributed in the hope that it will be useful,
+ * Fusionforge is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
- * along with Codendi. If not, see <http://www.gnu.org/licenses/>.
+ * along with Fusionforge. If not, see <http://www.gnu.org/licenses/>.
  */
 
 require_once 'common/mvc/Controler.class.php';
@@ -25,116 +25,115 @@ require_once 'hudsonActions.class.php';
  * hudson */
 class hudson extends Controler {
 
-    private $themePath;
+	private $themePath;
 
-    function hudson() {
-        $p = PluginManager::instance()->getPluginByName('hudson');
-        $this->themePath = $p->getThemePath();
-    }
+	function hudson() {
+		$p = PluginManager::instance()->getPluginByName('hudson');
+		$this->themePath = $p->getThemePath();
+	}
 
-    function getThemePath() {
-        return $this->themePath;
-    }
-    function getIconsPath() {
-        return $this->themePath . "/images/ic/";
-    }
+	function getThemePath() {
+		return $this->themePath;
+	}
+	function getIconsPath() {
+		return $this->themePath . "/images/ic/";
+	}
 
-    function request() {
+	function request() {
 		global $feedback, $error_msg;
-        $request =& HTTPRequest::instance();
-        $vgi = new Valid_GroupId();
-        $vgi->required();
-        if ($request->valid($vgi)) {
-            $group_id = $request->get('group_id');
-            $pm = ProjectManager::instance();
-            $project = $pm->getProject($group_id);
-            if ($project->usesService('hudson')) {
-                $user = UserManager::instance()->getCurrentUser();
-                if ($user->isMember($group_id)) {
-                    switch($request->get('action')) {
-                        case 'add_job':
-                            if ($user->isMember($group_id, 'A')) {
-                                if ( $request->exist('hudson_job_url') && trim($request->get('hudson_job_url') != '') ) {
-                                    $this->action = 'addJob';
-                                } else {
-                                    $error_msg .= _("Missing Hudson job url (eg: http://myCIserver:8080/hudson/job/MyJob)");
-                                }
-                                $this->view = 'projectOverview';
-                            } else {
-                                $error_msg .= _("Permission Denied");
-                                $this->view = 'projectOverview';
-                            }
-                            break;
-                        case 'edit_job':
-                            if ($user->isMember($group_id,'A')) {
-                                if ($request->exist('job_id')) {
-                                    $this->view = 'editJob';
-                                } else {
-                                    $error_msg .= _("Missing Hudson job ID");
-                                }
-                            } else {
-                                $error_msg .= _("Permission Denied");
-                                $this->view = 'projectOverview';
-                            }
-                            break;
-                        case 'update_job':
-                            if ($user->isMember($group_id,'A')) {
-                                if ($request->exist('job_id')) {
-                                    if ($request->exist('new_hudson_job_url') && $request->get('new_hudson_job_url') != '') {
-                                        $this->action = 'updateJob';
-                                    } else {
-                                        $error_msg .= _("Missing Hudson job url (eg: http://myCIserver:8080/hudson/job/MyJob)");
-                                    }
-                                } else {
-                                    $error_msg .= _("Missing Hudson job ID");
-                                }
-                                $this->view = 'projectOverview';
-                            } else {
-                                $error_msg .= _("Permission Denied");
-                                $this->view = 'projectOverview';
-                            }
-                            break;
-                        case 'delete_job':
-                            if ($user->isMember($group_id,'A')) {
-                                if ($request->exist('job_id')) {
-                                    $this->action = 'deleteJob';
-                                } else {
-                                    $error_msg .= _("Missing Hudson job ID");
-                                }
-                                $this->view = 'projectOverview';
-                            } else {
-                                $error_msg .= _("Permission Denied");
-                                $this->view = 'projectOverview';
-                            }
-                            break;
-                        case "view_job":
-                            $this->view = 'job_details';
-                            break;
-                        case "view_build":
-                            $this->view = 'build_number';
-                            break;
-                        case "view_last_build":
-                            $this->view = 'last_build';
-                            break;
-                        case "view_last_test_result":
-                            $this->view = 'last_test_result';
-                            break;
-                        case "view_test_trend":
-                            $this->view = 'test_trend';
-                            break;
-                        default:
-                            $this->view = 'projectOverview';
-                            break;
-                    }
-                } else {
-                    $error_msg .= _("Permission Denied");
-                }
-
-            } else {
-                $error_msg .= _("Hudson service is not enabled");
-            }
-        } else {
-            $error_msg .= _("Missing group_id parameter.");
-        }
-    }
+		$request =& HTTPRequest::instance();
+		$vgi = new Valid_GroupId();
+		$vgi->required();
+		if ($request->valid($vgi)) {
+			$group_id = $request->get('group_id');
+			$pm = ProjectManager::instance();
+			$project = $pm->getProject($group_id);
+			if ($project->usesService('hudson')) {
+				$user = UserManager::instance()->getCurrentUser();
+				if ($user->isMember($group_id)) {
+					switch($request->get('action')) {
+						case 'add_job':
+							if ($user->isMember($group_id, 'A')) {
+								if ( $request->exist('hudson_job_url') && trim($request->get('hudson_job_url') != '') ) {
+								$this->action = 'addJob';
+								} else {
+								$error_msg .= _("Missing Hudson job url (eg: http://myCIserver:8080/hudson/job/MyJob)");
+								}
+								$this->view = 'projectOverview';
+							} else {
+								$error_msg .= _("Permission Denied");
+								$this->view = 'projectOverview';
+							}
+							break;
+						case 'edit_job':
+							if ($user->isMember($group_id,'A')) {
+								if ($request->exist('job_id')) {
+								$this->view = 'editJob';
+								} else {
+								$error_msg .= _("Missing Hudson job ID");
+								}
+							} else {
+								$error_msg .= _("Permission Denied");
+								$this->view = 'projectOverview';
+							}
+							break;
+						case 'update_job':
+							if ($user->isMember($group_id,'A')) {
+								if ($request->exist('job_id')) {
+								if ($request->exist('new_hudson_job_url') && $request->get('new_hudson_job_url') != '') {
+									$this->action = 'updateJob';
+								} else {
+									$error_msg .= _("Missing Hudson job url (eg: http://myCIserver:8080/hudson/job/MyJob)");
+								}
+								} else {
+								$error_msg .= _("Missing Hudson job ID");
+								}
+								$this->view = 'projectOverview';
+							} else {
+								$error_msg .= _("Permission Denied");
+								$this->view = 'projectOverview';
+							}
+							break;
+						case 'delete_job':
+							if ($user->isMember($group_id,'A')) {
+								if ($request->exist('job_id')) {
+								$this->action = 'deleteJob';
+								} else {
+								$error_msg .= _("Missing Hudson job ID");
+								}
+								$this->view = 'projectOverview';
+							} else {
+								$error_msg .= _("Permission Denied");
+								$this->view = 'projectOverview';
+							}
+							break;
+						case "view_job":
+							$this->view = 'job_details';
+							break;
+						case "view_build":
+							$this->view = 'build_number';
+							break;
+						case "view_last_build":
+							$this->view = 'last_build';
+							break;
+						case "view_last_test_result":
+							$this->view = 'last_test_result';
+							break;
+						case "view_test_trend":
+							$this->view = 'test_trend';
+							break;
+						default:
+							$this->view = 'projectOverview';
+							break;
+					}
+				} else {
+					$error_msg .= _("Permission Denied");
+				}
+			} else {
+				$error_msg .= _("Hudson service is not enabled");
+			}
+		} else {
+			$error_msg .= _("Missing group_id parameter.");
+		}
+	}
 }
diff --git a/src/plugins/hudson/include/hudsonActions.class.php b/src/plugins/hudson/include/hudsonActions.class.php
index 68542e9..70fb509 100644
--- a/src/plugins/hudson/include/hudsonActions.class.php
+++ b/src/plugins/hudson/include/hudsonActions.class.php
@@ -2,26 +2,24 @@
 /**
  * Copyright (c) Xerox Corporation, Codendi Team, 2001-2009. All rights reserved
  *
- * This file is a part of Codendi.
+ * This file is a part of Fusionforge.
  *
- * Codendi is free software; you can redistribute it and/or modify
+ * Fusionforge is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
  * the Free Software Foundation; either version 2 of the License, or
  * (at your option) any later version.
  *
- * Codendi is distributed in the hope that it will be useful,
+ * Fusionforge is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
- * along with Codendi. If not, see <http://www.gnu.org/licenses/>.
+ * along with Fusionforge. If not, see <http://www.gnu.org/licenses/>.
  */
 
-
 require_once 'common/mvc/Actions.class.php';
 require_once 'common/include/HTTPRequest.class.php';
-
 require_once 'HudsonJob.class.php';
 require_once 'PluginHudsonJobDao.class.php';
 
@@ -29,74 +27,74 @@ require_once 'PluginHudsonJobDao.class.php';
  * hudsonActions
  */
 class hudsonActions extends Actions {
-    function hudsonActions(&$controler, $view=null) {
-        $this->Actions($controler);
+
+	function hudsonActions(&$controler, $view=null) {
+		$this->Actions($controler);
 	}
 
-	// {{{ Actions
-    function addJob() {
-        global $feedback, $error_msg;
-        $request =& HTTPRequest::instance();
-        $group_id = $request->get('group_id');
-        $job_url = $request->get('hudson_job_url');
-        try {
-            $job = new HudsonJob($job_url);
-            $use_svn_trigger = ($request->get('hudson_use_svn_trigger') === 'on');
-            $use_cvs_trigger = ($request->get('hudson_use_cvs_trigger') === 'on');
-            if ($use_svn_trigger || $use_cvs_trigger) {
-                $token = $request->get('hudson_trigger_token');
-            } else {
-                $token = null;
-            }
-            $job_dao = new PluginHudsonJobDao(CodendiDataAccess::instance());
-            if ( ! $job_dao->createHudsonJob($group_id, $job_url, $job->getName(), $use_svn_trigger, $use_cvs_trigger, $token)) {
-                $error_msg .= _("Unable to add Hudson job.");
-            } else {
-                $feedback .= _("Hudson job added.");
-                $feedback .= ' '._('Please wait 1 hour for triggers to be updated.');
-            }
-        } catch (Exception $e) {
-            $error_msg .= $e->getMessage();
-        }
-    }
-    function updateJob() {
-        global $feedback, $error_msg;
-        $request =& HTTPRequest::instance();
-        $group_id = $request->get('group_id');
-        $job_id = $request->get('job_id');
-        $new_job_url = $request->get('new_hudson_job_url');
-        $new_job_name = $request->get('new_hudson_job_name');
-        if (strpos($new_job_name, " ") !== false) {
-            $new_job_name = str_replace(" ", "_", $new_job_name);
-            $error_msg .= _('Spaces are not allowed in job name. They were replaced by "_".');
-        }
-        $new_use_svn_trigger = ($request->get('new_hudson_use_svn_trigger') === 'on');
-        $new_use_cvs_trigger = ($request->get('new_hudson_use_cvs_trigger') === 'on');
-        if ($new_use_svn_trigger || $new_use_cvs_trigger) {
-            $new_token = $request->get('new_hudson_trigger_token');
-        } else {
-            $new_token = null;
-        }
-        $job_dao = new PluginHudsonJobDao(CodendiDataAccess::instance());
-        if ( ! $job_dao->updateHudsonJob($job_id, $new_job_url, $new_job_name, $new_use_svn_trigger, $new_use_cvs_trigger, $new_token)) {
-            $error_msg .= _("Unable to update Hudson job");
-        } else {
-            $feedback .= _("Hudson job updated.");
-            $feedback .= ' '._('Please wait 1 hour for triggers to be updated.');
-        }
-    }
-    function deleteJob() {
-        global $feedback, $error_msg;
-        $request =& HTTPRequest::instance();
-        $group_id = $request->get('group_id');
-        $job_id = $request->get('job_id');
-        $job_dao = new PluginHudsonJobDao(CodendiDataAccess::instance());
-        if ( ! $job_dao->deleteHudsonJob($job_id)) {
-            $error_msg .= _("Unable to delete Hudson job");
-        } else {
-            $feedback .= _("Hudson job deleted.");
-        }
-    }
-    // }}}
+	function addJob() {
+		global $feedback, $error_msg;
+		$request =& HTTPRequest::instance();
+		$group_id = $request->get('group_id');
+		$job_url = $request->get('hudson_job_url');
+		try {
+			$job = new HudsonJob($job_url);
+			$use_svn_trigger = ($request->get('hudson_use_svn_trigger') === 'on');
+			$use_cvs_trigger = ($request->get('hudson_use_cvs_trigger') === 'on');
+			if ($use_svn_trigger || $use_cvs_trigger) {
+				$token = $request->get('hudson_trigger_token');
+			} else {
+				$token = null;
+			}
+			$job_dao = new PluginHudsonJobDao(CodendiDataAccess::instance());
+			if ( ! $job_dao->createHudsonJob($group_id, $job_url, $job->getName(), $use_svn_trigger, $use_cvs_trigger, $token)) {
+				$error_msg .= _("Unable to add Hudson job.");
+			} else {
+				$feedback .= _("Hudson job added.");
+				$feedback .= ' '._('Please wait 1 hour for triggers to be updated.');
+			}
+		} catch (Exception $e) {
+			$error_msg .= $e->getMessage();
+		}
+	}
 
+	function updateJob() {
+		global $feedback, $error_msg;
+		$request =& HTTPRequest::instance();
+		$group_id = $request->get('group_id');
+		$job_id = $request->get('job_id');
+		$new_job_url = $request->get('new_hudson_job_url');
+		$new_job_name = $request->get('new_hudson_job_name');
+		if (strpos($new_job_name, " ") !== false) {
+			$new_job_name = str_replace(" ", "_", $new_job_name);
+			$error_msg .= _('Spaces are not allowed in job name. They were replaced by "_".');
+		}
+		$new_use_svn_trigger = ($request->get('new_hudson_use_svn_trigger') === 'on');
+		$new_use_cvs_trigger = ($request->get('new_hudson_use_cvs_trigger') === 'on');
+		if ($new_use_svn_trigger || $new_use_cvs_trigger) {
+			$new_token = $request->get('new_hudson_trigger_token');
+		} else {
+			$new_token = null;
+		}
+		$job_dao = new PluginHudsonJobDao(CodendiDataAccess::instance());
+		if ( ! $job_dao->updateHudsonJob($job_id, $new_job_url, $new_job_name, $new_use_svn_trigger, $new_use_cvs_trigger, $new_token)) {
+			$error_msg .= _("Unable to update Hudson job");
+		} else {
+			$feedback .= _("Hudson job updated.");
+			$feedback .= ' '._('Please wait 1 hour for triggers to be updated.');
+		}
+	}
+
+	function deleteJob() {
+		global $feedback, $error_msg;
+		$request =& HTTPRequest::instance();
+		$group_id = $request->get('group_id');
+		$job_id = $request->get('job_id');
+		$job_dao = new PluginHudsonJobDao(CodendiDataAccess::instance());
+		if ( ! $job_dao->deleteHudsonJob($job_id)) {
+			$error_msg .= _("Unable to delete Hudson job");
+		} else {
+			$feedback .= _("Hudson job deleted.");
+		}
+	}
 }
diff --git a/src/plugins/hudson/include/hudsonPlugin.class.php b/src/plugins/hudson/include/hudsonPlugin.class.php
index df94af5..1de9f2f 100644
--- a/src/plugins/hudson/include/hudsonPlugin.class.php
+++ b/src/plugins/hudson/include/hudsonPlugin.class.php
@@ -1,13 +1,25 @@
 <?php
 /**
- * @copyright Copyright (c) Xerox Corporation, Codendi 2007-2008.
+ * hudsonPlugin
+ *
+ * Copyright (c) Xerox Corporation, Codendi 2007-2008.
+ * @author Marc Nazarian <marc.nazarian at xrce.xerox.com>
  * Copyright (C) 2010-2011 Alain Peyrat - Alcatel-Lucent
  *
- * This file is licensed under the GNU General Public License version 2. See the file COPYING.
+ * This file is a part of Fusionforge.
  *
- * @author Marc Nazarian <marc.nazarian at xrce.xerox.com>
+ * Fusionforge is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
  *
- * HudsonPlugin
+ * Fusionforge is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with Fusionforge. If not, see <http://www.gnu.org/licenses/>.
  */
 
 require_once 'PluginHudsonJobDao.class.php';
@@ -28,15 +40,13 @@ class hudsonPlugin extends Plugin {
 		$this->_addHook("project_admin_plugins"); // to show up in the admin page fro group
 		$this->_addHook('javascript',  false);
 		$this->_addHook('cssfile', 'cssFile', false);
-
 		$this->_addHook('project_is_deleted', 'projectIsDeleted', false);
-
 		$this->_addHook('widget_instance', 'myPageBox', false);
 		$this->_addHook('widgets', 'widgets', false);
-
 		$this->_addHook('get_available_reference_natures', 'getAvailableReferenceNatures', false);
 		$this->_addHook('ajax_reference_tooltip', 'ajax_reference_tooltip', false);
 	}
+
 	function CallHook ($hookname, &$params) {
 		global $G_SESSION,$HTML;
 		if ($hookname == "usermenu") {
@@ -81,7 +91,6 @@ class hudsonPlugin extends Plugin {
 			$this->getAvailableReferenceNatures($params);
 		} elseif ($hookname == "ajax_reference_tooltip") {
 			$this->ajax_reference_tooltip($params);
-
 		}
 	}
 	
@@ -174,6 +183,7 @@ class hudsonPlugin extends Plugin {
 			$params['instance'] = new hudson_Widget_JobLastArtifacts(WidgetLayoutManager::OWNER_TYPE_GROUP, $GLOBALS['group_id']);
 		}
 	}
+
 	function widgets($params) {
 		$group = group_get_object($GLOBALS['group_id']);
 		if ( !$group || !$group->usesPlugin ( $this->name ) ) {
diff --git a/src/plugins/hudson/include/hudsonPluginDescriptor.class.php b/src/plugins/hudson/include/hudsonPluginDescriptor.class.php
index 0c6d978..9e3bbfe 100644
--- a/src/plugins/hudson/include/hudsonPluginDescriptor.class.php
+++ b/src/plugins/hudson/include/hudsonPluginDescriptor.class.php
@@ -2,26 +2,27 @@
 /**
  * Copyright (c) Xerox Corporation, Codendi Team, 2001-2009. All rights reserved
  *
- * This file is a part of Codendi.
+ * This file is a part of Fusionforge.
  *
- * Codendi is free software; you can redistribute it and/or modify
+ * Fusionforge is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
  * the Free Software Foundation; either version 2 of the License, or
  * (at your option) any later version.
  *
- * Codendi is distributed in the hope that it will be useful,
+ * Fusionforge is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
- * along with Codendi. If not, see <http://www.gnu.org/licenses/>.
+ * along with Fusionforge. If not, see <http://www.gnu.org/licenses/>.
  */
+
 require_once 'common/plugin/PluginDescriptor.class.php';
 
 class hudsonPluginDescriptor extends PluginDescriptor {
 
-    function hudsonPluginDescriptor() {
-        $this->PluginDescriptor(_("Continuous Integration"), '1.0', _("Continuous Integration with Hudson"));
-    }
+	function hudsonPluginDescriptor() {
+		$this->PluginDescriptor(_("Continuous Integration"), '1.0', _("Continuous Integration with Hudson"));
+	}
 }
diff --git a/src/plugins/hudson/include/hudsonPluginInfo.class.php b/src/plugins/hudson/include/hudsonPluginInfo.class.php
index 8287528..5da3a15 100644
--- a/src/plugins/hudson/include/hudsonPluginInfo.class.php
+++ b/src/plugins/hudson/include/hudsonPluginInfo.class.php
@@ -2,20 +2,20 @@
 /**
  * Copyright (c) Xerox Corporation, Codendi Team, 2001-2009. All rights reserved
  *
- * This file is a part of Codendi.
+ * This file is a part of Fusionforge.
  *
- * Codendi is free software; you can redistribute it and/or modify
+ * Fusionforge is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
  * the Free Software Foundation; either version 2 of the License, or
  * (at your option) any later version.
  *
- * Codendi is distributed in the hope that it will be useful,
+ * Fusionforge is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
- * along with Codendi. If not, see <http://www.gnu.org/licenses/>.
+ * along with Fusionforge. If not, see <http://www.gnu.org/licenses/>.
  */
 
 require_once 'common/plugin/PluginInfo.class.php';
@@ -23,9 +23,9 @@ require_once 'hudsonPluginDescriptor.class.php';
 
 class hudsonPluginInfo extends PluginInfo {
 
-    function hudsonPluginInfo(&$plugin) {
-        $this->PluginInfo($plugin);
-        $this->setPluginDescriptor(new hudsonPluginDescriptor());
-    }
+	function hudsonPluginInfo(&$plugin) {
+		$this->PluginInfo($plugin);
+		$this->setPluginDescriptor(new hudsonPluginDescriptor());
+	}
 
 }
diff --git a/src/plugins/hudson/include/hudsonViews.class.php b/src/plugins/hudson/include/hudsonViews.class.php
index 6d90775..a01a4de 100644
--- a/src/plugins/hudson/include/hudsonViews.class.php
+++ b/src/plugins/hudson/include/hudsonViews.class.php
@@ -4,20 +4,20 @@
  * Copyright (c) 2010 Alcatel-Lucent
  * Copyright (C) 2011 Alain Peyrat - Alcatel-Lucent
  *
- * This file is a part of Codendi.
+ * This file is a part of Fusionforge.
  *
- * Codendi is free software; you can redistribute it and/or modify
+ * Fusionforge is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
  * the Free Software Foundation; either version 2 of the License, or
  * (at your option) any later version.
  *
- * Codendi is distributed in the hope that it will be useful,
+ * Fusionforge is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
- * along with Codendi. If not, see <http://www.gnu.org/licenses/>.
+ * along with Fusionforge. If not, see <http://www.gnu.org/licenses/>.
  */
 
 require_once 'common/mvc/Views.class.php';
@@ -45,10 +45,12 @@ class hudsonViews extends Views {
 //		echo $this->_getHelp();
 //		echo '<h1>'.$this->_getTitle().'</h1>';
 	}
+
 	function _getTitle() {
 //		return _("Continuous Integration");
 		return _("Hudson");
 	}
+
 	function _getHelp($section = '', $questionmark = false) {
 		if (trim($section) !== '' && $section{0} !== '#') {
 			$section = '#'.$section;
@@ -60,6 +62,7 @@ class hudsonViews extends Views {
 		}
 		return '<b><a href="javascript:help_window(\''.get_server_url().'help/guide/ContinuousIntegrationIntroduction.html'.$section.'\');">'.$help_label.'</a></b>';
 	}
+
 	function footer() {
 		parent::footer();
 	}
@@ -426,6 +429,7 @@ class hudsonViews extends Views {
 		htmlIframe($url, array('id' => 'hudson_iframe', 'class' => 'iframe_service'));
 		echo '</div>';
 	}
+
 	function _hide_iframe() {
 		echo "<script type=\"text/javascript\">Element.toggle('hudson_iframe_div', 'slide');</script>";
 	}
diff --git a/src/plugins/hudson/include/hudson_Widget_JobBuildHistory.class.php b/src/plugins/hudson/include/hudson_Widget_JobBuildHistory.class.php
index c6d5fd4..4d3976b 100644
--- a/src/plugins/hudson/include/hudson_Widget_JobBuildHistory.class.php
+++ b/src/plugins/hudson/include/hudson_Widget_JobBuildHistory.class.php
@@ -2,20 +2,20 @@
 /**
  * Copyright (c) Xerox Corporation, Codendi Team, 2001-2009. All rights reserved
  *
- * This file is a part of Codendi.
+ * This file is a part of Fusionforge.
  *
- * Codendi is free software; you can redistribute it and/or modify
+ * Fusionforge is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
  * the Free Software Foundation; either version 2 of the License, or
  * (at your option) any later version.
  *
- * Codendi is distributed in the hope that it will be useful,
+ * Fusionforge is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
- * along with Codendi. If not, see <http://www.gnu.org/licenses/>.
+ * along with Fusionforge. If not, see <http://www.gnu.org/licenses/>.
  */
 
 
@@ -26,79 +26,74 @@ require_once 'HudsonJob.class.php';
 
 class hudson_Widget_JobBuildHistory extends HudsonJobWidget {
 
-    function hudson_Widget_JobBuildHistory($owner_type, $owner_id) {
-        $request =& HTTPRequest::instance();
-        if ($owner_type == WidgetLayoutManager::OWNER_TYPE_USER) {
-            $this->widget_id = 'plugin_hudson_my_jobbuildhistory';
-            $this->group_id = $owner_id;
-        } else {
-            $this->widget_id = 'plugin_hudson_project_jobbuildhistory';
-            $this->group_id = $request->get('group_id');
-        }
-        $this->Widget($this->widget_id);
-
-        $this->setOwner($owner_id, $owner_type);
-    }
-
-    function getTitle() {
-        $title = '';
-        if ($this->job) {
-            $title .= sprintf(_("%s Builds History"), $this->job->getName());
-        } else {
-            $title .= _("Builds History");
-        }
-        return  $title;
-    }
-
-    function getDescription() {
-        return _("Show the build history of the selected job, under the form of RSS feed. For each build of the list, you can see the build number, the status and the date the build has been scheduled.");
-    }
-
-    function loadContent($id) {
-        $sql = "SELECT * FROM plugin_hudson_widget WHERE widget_name=$1 AND owner_id = $2 AND owner_type = $3 AND id = $4";
-        $res = db_query_params($sql,array($this->widget_id,$this->owner_id,$this->owner_type,$id));
-        if ($res && db_numrows($res)) {
-            $data = db_fetch_array($res);
-            $this->job_id    = $data['job_id'];
-            $this->content_id = $id;
-
-            $jobs = $this->getAvailableJobs();
-
-            if (array_key_exists($this->job_id, $jobs)) {
-                $used_job = $jobs[$this->job_id];
-                $this->job_url = $used_job->getUrl();
-                $this->job = $used_job;
-            } else {
-                $this->job = null;
-            }
-
-        }
-    }
-
-    function getContent() {
-        $html = '';
-        if ($this->job != null) {
-
-            $job = $this->job;
-
-            $buildHistoryRSSWidget = new Widget_ProjectRss();
-            $buildHistoryRSSWidget->rss_url = $job->getUrl().'/rssAll';
-            $html .= $buildHistoryRSSWidget->getContent();
-
-        } else {
-            $html .= _("Job not found.");
-        }
-        return $html;
-    }
-
-    function hasRss() {
-        return true;
-    }
-    function getRssUrl($owner_id, $owner_type) {
-        if ($this->job) {
-            return $this->job->getUrl().'/rssAll';
-        } else {
-            return null;
-        }
-    }
+	function hudson_Widget_JobBuildHistory($owner_type, $owner_id) {
+		$request =& HTTPRequest::instance();
+		if ($owner_type == WidgetLayoutManager::OWNER_TYPE_USER) {
+			$this->widget_id = 'plugin_hudson_my_jobbuildhistory';
+			$this->group_id = $owner_id;
+		} else {
+			$this->widget_id = 'plugin_hudson_project_jobbuildhistory';
+			$this->group_id = $request->get('group_id');
+		}
+		$this->Widget($this->widget_id);
+		$this->setOwner($owner_id, $owner_type);
+	}
+
+	function getTitle() {
+		$title = '';
+		if ($this->job) {
+			$title .= sprintf(_("%s Builds History"), $this->job->getName());
+		} else {
+			$title .= _("Builds History");
+		}
+		return  $title;
+	}
+
+	function getDescription() {
+		return _("Show the build history of the selected job, under the form of RSS feed. For each build of the list, you can see the build number, the status and the date the build has been scheduled.");
+	}
+
+	function loadContent($id) {
+		$sql = "SELECT * FROM plugin_hudson_widget WHERE widget_name=$1 AND owner_id = $2 AND owner_type = $3 AND id = $4";
+		$res = db_query_params($sql,array($this->widget_id,$this->owner_id,$this->owner_type,$id));
+		if ($res && db_numrows($res)) {
+			$data = db_fetch_array($res);
+			$this->job_id    = $data['job_id'];
+			$this->content_id = $id;
+			$jobs = $this->getAvailableJobs();
+
+			if (array_key_exists($this->job_id, $jobs)) {
+				$used_job = $jobs[$this->job_id];
+				$this->job_url = $used_job->getUrl();
+				$this->job = $used_job;
+			} else {
+				$this->job = null;
+			}
+		}
+	}
+
+	function getContent() {
+		$html = '';
+		if ($this->job != null) {
+			$job = $this->job;
+			$buildHistoryRSSWidget = new Widget_ProjectRss();
+			$buildHistoryRSSWidget->rss_url = $job->getUrl().'/rssAll';
+			$html .= $buildHistoryRSSWidget->getContent();
+		} else {
+			$html .= _("Job not found.");
+		}
+		return $html;
+	}
+
+	function hasRss() {
+		return true;
+	}
+
+	function getRssUrl($owner_id, $owner_type) {
+		if ($this->job) {
+			return $this->job->getUrl().'/rssAll';
+		} else {
+			return null;
+		}
+	}
 }
diff --git a/src/plugins/hudson/include/hudson_Widget_JobLastArtifacts.class.php b/src/plugins/hudson/include/hudson_Widget_JobLastArtifacts.class.php
index 2efdd65..95d9be1 100644
--- a/src/plugins/hudson/include/hudson_Widget_JobLastArtifacts.class.php
+++ b/src/plugins/hudson/include/hudson_Widget_JobLastArtifacts.class.php
@@ -2,20 +2,20 @@
 /**
  * Copyright (c) Xerox Corporation, Codendi Team, 2001-2009. All rights reserved
  *
- * This file is a part of Codendi.
+ * This file is a part of Fusionforge.
  *
- * Codendi is free software; you can redistribute it and/or modify
+ * Fusionforge is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
  * the Free Software Foundation; either version 2 of the License, or
  * (at your option) any later version.
  *
- * Codendi is distributed in the hope that it will be useful,
+ * Fusionforge is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
- * along with Codendi. If not, see <http://www.gnu.org/licenses/>.
+ * along with Fusionforge. If not, see <http://www.gnu.org/licenses/>.
  */
 
 
@@ -26,86 +26,78 @@ require_once 'HudsonBuild.class.php';
 
 class hudson_Widget_JobLastArtifacts extends HudsonJobWidget {
 
-    var $build;
-    var $last_build_url;
-
-    function hudson_Widget_JobLastArtifacts($owner_type, $owner_id) {
-        $request =& HTTPRequest::instance();
-        if ($owner_type == WidgetLayoutManager::OWNER_TYPE_USER) {
-            $this->widget_id = 'plugin_hudson_my_joblastartifacts';
-            $this->group_id = $owner_id;
-        } else {
-            $this->widget_id = 'plugin_hudson_project_joblastartifacts';
-            $this->group_id = $request->get('group_id');
-        }
-        $this->Widget($this->widget_id);
-
-        $this->setOwner($owner_id, $owner_type);
-    }
-
-    function getTitle() {
-        $title = '';
-        if ($this->job) {
-            $title .= sprintf(_('%s Last Artifacts'), $this->job->getName());
-        } else {
-             $title .= _('Last Artifacts');
-        }
-        return  $title;
-    }
-
-    function getDescription() {
-        return _("Show the last successfully published artifacts of one job. To display something, your job needs to publish artifacts.");
-    }
-
-    function loadContent($id) {
-        $sql = "SELECT * FROM plugin_hudson_widget WHERE widget_name=$1 AND owner_id=$2 AND owner_type=$3 AND id=$4";
-        $res = db_query_params($sql,array($this->widget_id,$this->owner_id,$this->owner_type,$id));
-        if ($res && db_numrows($res)) {
-            $data = db_fetch_array($res);
-            $this->job_id    = $data['job_id'];
-            $this->content_id = $id;
-
-            $jobs = $this->getAvailableJobs();
-
-            if (array_key_exists($this->job_id, $jobs)) {
-                $used_job = $jobs[$this->job_id];
-                $this->job_url = $used_job->getUrl();
-                $this->job = $used_job;
-
-                $this->last_build_url = $this->job_url.'/lastBuild/';
-
-                try {
-                    $this->build = new HudsonBuild($this->last_build_url);
-                } catch (Exception $e) {
-                    $this->build = null;
-                }
-            } else {
-                $this->job = null;
-                $this->build = null;
-            }
-
-        }
-    }
-
-    function getContent() {
-        $html = '';
-        if ($this->job != null && $this->build != null) {
-
-            $build = $this->build;
-
-            $html .= '<ul>';
-            $dom = $build->getDom();
-            foreach ($dom->artifact as $artifact) {
-                $html .= ' <li><a href="'.$build->getUrl().'/artifact/'.$artifact->relativePath.'">'.$artifact->displayPath.'</a></li>';
-            }
-            $html .= '</ul>';
-        } else {
-            if ($this->job != null) {
-                $html .= _("No build found for this job.");
-            } else {
-                $html .= _("Job not found.");
-            }
-        }
-        return $html;
-    }
+	var $build;
+	var $last_build_url;
+
+	function hudson_Widget_JobLastArtifacts($owner_type, $owner_id) {
+		$request =& HTTPRequest::instance();
+		if ($owner_type == WidgetLayoutManager::OWNER_TYPE_USER) {
+			$this->widget_id = 'plugin_hudson_my_joblastartifacts';
+			$this->group_id = $owner_id;
+		} else {
+			$this->widget_id = 'plugin_hudson_project_joblastartifacts';
+			$this->group_id = $request->get('group_id');
+		}
+		$this->Widget($this->widget_id);
+		$this->setOwner($owner_id, $owner_type);
+	}
+
+	function getTitle() {
+		$title = '';
+		if ($this->job) {
+			$title .= sprintf(_('%s Last Artifacts'), $this->job->getName());
+		} else {
+			$title .= _('Last Artifacts');
+		}
+		return  $title;
+	}
+
+	function getDescription() {
+		return _("Show the last successfully published artifacts of one job. To display something, your job needs to publish artifacts.");
+	}
+
+	function loadContent($id) {
+		$sql = "SELECT * FROM plugin_hudson_widget WHERE widget_name=$1 AND owner_id=$2 AND owner_type=$3 AND id=$4";
+		$res = db_query_params($sql,array($this->widget_id,$this->owner_id,$this->owner_type,$id));
+		if ($res && db_numrows($res)) {
+			$data = db_fetch_array($res);
+			$this->job_id    = $data['job_id'];
+			$this->content_id = $id;
+			$jobs = $this->getAvailableJobs();
+			if (array_key_exists($this->job_id, $jobs)) {
+				$used_job = $jobs[$this->job_id];
+				$this->job_url = $used_job->getUrl();
+				$this->job = $used_job;
+				$this->last_build_url = $this->job_url.'/lastBuild/';
+				try {
+					$this->build = new HudsonBuild($this->last_build_url);
+				} catch (Exception $e) {
+					$this->build = null;
+				}
+			} else {
+				$this->job = null;
+				$this->build = null;
+			}
+		}
+	}
+
+	function getContent() {
+		$html = '';
+		if ($this->job != null && $this->build != null) {
+			$build = $this->build;
+			$html .= '<ul>';
+			$dom = $build->getDom();
+			foreach ($dom->artifact as $artifact) {
+				$html .= ' <li><a href="'.$build->getUrl().'/artifact/'.$artifact->relativePath.'">'.$artifact->displayPath.'</a></li>';
+			}
+			$html .= '</ul>';
+			} else {
+				if ($this->job != null) {
+					$html .= _("No build found for this job.");
+				} else {
+				$html .= _("Job not found.");
+			}
+		}
+		return $html;
+	}
 }
diff --git a/src/plugins/hudson/include/hudson_Widget_JobLastBuilds.class.php b/src/plugins/hudson/include/hudson_Widget_JobLastBuilds.class.php
index 9442916..09f6b36 100644
--- a/src/plugins/hudson/include/hudson_Widget_JobLastBuilds.class.php
+++ b/src/plugins/hudson/include/hudson_Widget_JobLastBuilds.class.php
@@ -2,20 +2,20 @@
 /**
  * Copyright (c) Xerox Corporation, Codendi Team, 2001-2009. All rights reserved
  *
- * This file is a part of Codendi.
+ * This file is a part of Fusionforge.
  *
- * Codendi is free software; you can redistribute it and/or modify
+ * Fusionforge is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
  * the Free Software Foundation; either version 2 of the License, or
  * (at your option) any later version.
  *
- * Codendi is distributed in the hope that it will be useful,
+ * Fusionforge is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
- * along with Codendi. If not, see <http://www.gnu.org/licenses/>.
+ * along with Fusionforge. If not, see <http://www.gnu.org/licenses/>.
  */
 
 
@@ -26,82 +26,76 @@ require_once 'HudsonJob.class.php';
 
 class hudson_Widget_JobLastBuilds extends HudsonJobWidget {
 
-    function hudson_Widget_JobLastBuilds($owner_type, $owner_id) {
-        $request =& HTTPRequest::instance();
-        if ($owner_type == WidgetLayoutManager::OWNER_TYPE_USER) {
-            $this->widget_id = 'plugin_hudson_my_joblastbuilds';
-            $this->group_id = $owner_id;
-        } else {
-            $this->widget_id = 'plugin_hudson_project_joblastbuilds';
-            $this->group_id = $request->get('group_id');
-        }
-        $this->Widget($this->widget_id);
+	function hudson_Widget_JobLastBuilds($owner_type, $owner_id) {
+		$request =& HTTPRequest::instance();
+		if ($owner_type == WidgetLayoutManager::OWNER_TYPE_USER) {
+			$this->widget_id = 'plugin_hudson_my_joblastbuilds';
+			$this->group_id = $owner_id;
+		} else {
+			$this->widget_id = 'plugin_hudson_project_joblastbuilds';
+			$this->group_id = $request->get('group_id');
+		}
+		$this->Widget($this->widget_id);
+		$this->setOwner($owner_id, $owner_type);
+	}
 
-        $this->setOwner($owner_id, $owner_type);
-    }
+	function getTitle() {
+		$title = '';
+		if ($this->job) {
+			$title .= sprintf(_('%s Last Builds'), $this->job->getName());
+		} else {
+			$title .= _('Last Builds');
+		}
+		return  $title;
+	}
 
-    function getTitle() {
-        $title = '';
-        if ($this->job) {
-            $title .= sprintf(_('%s Last Builds'), $this->job->getName());
-        } else {
-            $title .= _('Last Builds');
-        }
-        return  $title;
-    }
+	function getDescription() {
+		return _("Show the last builds for this job (last one, last successfull, last failed) and the weather report. The trend is represented by a weather report (sun, thunder, etc.) meaning that the trend is good or not.");
+	}
 
-    function getDescription() {
-        return _("Show the last builds for this job (last one, last successfull, last failed) and the weather report. The trend is represented by a weather report (sun, thunder, etc.) meaning that the trend is good or not.");
-    }
+	function loadContent($id) {
+		$sql = "SELECT * FROM plugin_hudson_widget WHERE widget_name=$1 AND owner_id=$2 AND owner_type=$3 AND id=$4";
+		$res = db_query_params($sql,array($this->widget_id,$this->owner_id,$this->owner_type,$id));
+		if ($res && db_numrows($res)) {
+			$data = db_fetch_array($res);
+			$this->job_id    = $data['job_id'];
+			$this->content_id = $id;
+			$jobs = $this->getAvailableJobs();
+			if (array_key_exists($this->job_id, $jobs)) {
+				$used_job = $jobs[$this->job_id];
+				$this->job_url = $used_job->getUrl();
+				$this->job = $used_job;
+			} else {
+				$this->job = null;
+			}
+		}
+	}
 
-    function loadContent($id) {
-        $sql = "SELECT * FROM plugin_hudson_widget WHERE widget_name=$1 AND owner_id=$2 AND owner_type=$3 AND id=$4";
-        $res = db_query_params($sql,array($this->widget_id,$this->owner_id,$this->owner_type,$id));
-        if ($res && db_numrows($res)) {
-            $data = db_fetch_array($res);
-            $this->job_id    = $data['job_id'];
-            $this->content_id = $id;
-
-            $jobs = $this->getAvailableJobs();
-
-            if (array_key_exists($this->job_id, $jobs)) {
-                $used_job = $jobs[$this->job_id];
-                $this->job_url = $used_job->getUrl();
-                $this->job = $used_job;
-            } else {
-                $this->job = null;
-            }
-
-        }
-    }
-
-    function getContent() {
-        $html = '';
-        if ($this->job != null) {
-            $job = $this->job;
-
-            $html .= '<table class="fullwidth">';
-            $html .= ' <tr>';
-            $html .= '  <td>';
-            $html .= '   <ul>';
-            if ($job->hasBuilds()) {
-                $html .= ' <li>'._("Last Build:").' <a href="/plugins/hudson/?action=view_build&group_id='.$this->group_id.'&job_id='.$this->job_id.'&build_id='.$job->getLastBuildNumber().'"># '.$job->getLastBuildNumber().'</a></li>';
-                $html .= ' <li>'._("Last Success:").' <a href="/plugins/hudson/?action=view_build&group_id='.$this->group_id.'&job_id='.$this->job_id.'&build_id='.$job->getLastSuccessfulBuildNumber().'"># '.$job->getLastSuccessfulBuildNumber().'</a></li>';
-                $html .= ' <li>'._("Last Failure:").' <a href="/plugins/hudson/?action=view_build&group_id='.$this->group_id.'&job_id='.$this->job_id.'&build_id='.$job->getLastFailedBuildNumber().'"># '.$job->getLastFailedBuildNumber().'</a></li>';
-            } else {
-                $html .= ' <li>'. _("No build found for this job.") . '</li>';
-            }
-            $html .= '   </ul>';
-            $html .= '  </td>';
-            $html .= '  <td class="widget_lastbuilds_weather">';
-            $html .= _("Weather Report:").'<img src="'.$job->getWeatherReportIcon().'" class="widget_lastbuilds_weather_img" />';
-            $html .= '  </td>';
-            $html .= ' </tr>';
-            $html .= '</table>';
-        } else {
-            $html .= _("Job not found.");
-        }
-
-        return $html;
-    }
+	function getContent() {
+		$html = '';
+		if ($this->job != null) {
+			$job = $this->job;
+			$html .= '<table class="fullwidth">';
+			$html .= ' <tr>';
+			$html .= '  <td>';
+			$html .= '   <ul>';
+			if ($job->hasBuilds()) {
+				$html .= ' <li>'._("Last Build:").' <a href="/plugins/hudson/?action=view_build&group_id='.$this->group_id.'&job_id='.$this->job_id.'&build_id='.$job->getLastBuildNumber().'"># '.$job->getLastBuildNumber().'</a></li>';
+				$html .= ' <li>'._("Last Success:").' <a href="/plugins/hudson/?action=view_build&group_id='.$this->group_id.'&job_id='.$this->job_id.'&build_id='.$job->getLastSuccessfulBuildNumber().'"># '.$job->getLastSuccessfulBuildNumber().'</a></li>';
+				$html .= ' <li>'._("Last Failure:").' <a href="/plugins/hudson/?action=view_build&group_id='.$this->group_id.'&job_id='.$this->job_id.'&build_id='.$job->getLastFailedBuildNumber().'"># '.$job->getLastFailedBuildNumber().'</a></li>';
+			} else {
+				$html .= ' <li>'. _("No build found for this job.") . '</li>';
+			}
+			$html .= '   </ul>';
+			$html .= '  </td>';
+			$html .= '  <td class="widget_lastbuilds_weather">';
+			$html .= _("Weather Report:").'<img src="'.$job->getWeatherReportIcon().'" class="widget_lastbuilds_weather_img" />';
+			$html .= '  </td>';
+			$html .= ' </tr>';
+			$html .= '</table>';
+		} else {
+			$html .= _("Job not found.");
+		}
+		return $html;
+	}
 }
diff --git a/src/plugins/hudson/include/hudson_Widget_JobTestResults.class.php b/src/plugins/hudson/include/hudson_Widget_JobTestResults.class.php
index 95e115c..49fca67 100644
--- a/src/plugins/hudson/include/hudson_Widget_JobTestResults.class.php
+++ b/src/plugins/hudson/include/hudson_Widget_JobTestResults.class.php
@@ -2,20 +2,20 @@
 /**
  * Copyright (c) Xerox Corporation, Codendi Team, 2001-2009. All rights reserved
  *
- * This file is a part of Codendi.
+ * This file is a part of Fusionforge.
  *
- * Codendi is free software; you can redistribute it and/or modify
+ * Fusionforge is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
  * the Free Software Foundation; either version 2 of the License, or
  * (at your option) any later version.
  *
- * Codendi is distributed in the hope that it will be useful,
+ * Fusionforge is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
- * along with Codendi. If not, see <http://www.gnu.org/licenses/>.
+ * along with Fusionforge. If not, see <http://www.gnu.org/licenses/>.
  */
 
 
@@ -27,87 +27,78 @@ require_once 'HudsonTestResult.class.php';
 
 class hudson_Widget_JobTestResults extends HudsonJobWidget {
 
-    var $test_result;
-
-    function hudson_Widget_JobTestResults($owner_type, $owner_id) {
-        $request =& HTTPRequest::instance();
-        if ($owner_type == WidgetLayoutManager::OWNER_TYPE_USER) {
-            $this->widget_id = 'plugin_hudson_my_jobtestresults';
-            $this->group_id = $owner_id;
-        } else {
-            $this->widget_id = 'plugin_hudson_project_jobtestresults';
-            $this->group_id = $request->get('group_id');
-        }
-        $this->Widget($this->widget_id);
-
-        $this->setOwner($owner_id, $owner_type);
-    }
-
-    function getTitle() {
-        $title = '';
-        if ($this->job && $this->test_result) {
-            $title .= vsprintf(_('%1$s Test Results (%2$s / %3$s)'),
-            	array($this->job->getName(), $this->test_result->getPassCount(), $this->test_result->getTotalCount()));
-        } elseif ($this->job && ! $this->test_result) {
-            $title .= sprintf(_('%1$s Test Results'), $this->job->getName());
-        } else {
-            $title .= _('Test Results');
-        }
-        return  $title;
-    }
-
-    function getDescription() {
-        return _("Show the test results of the latest build for the selected job.To display something, your job needs to execute tests and publish them. The result is shown on a pie chart.");
-    }
-
-    function loadContent($id) {
-        $sql = "SELECT * FROM plugin_hudson_widget WHERE widget_name=$1 AND owner_id=$2 AND owner_type=$3 AND id=$4";
-        $res = db_query_params($sql,array($this->widget_id,$this->owner_id,$this->owner_type,$id));
-        if ($res && db_numrows($res)) {
-            $data = db_fetch_array($res);
-            $this->job_id    = $data['job_id'];
-            $this->content_id = $id;
-
-            $jobs = $this->getAvailableJobs();
-
-            if (array_key_exists($this->job_id, $jobs)) {
-                $used_job = $jobs[$this->job_id];
-                $this->job_url = $used_job->getUrl();
-                $this->job = $used_job;
-
-                try {
-                    $this->test_result = new HudsonTestResult($this->job_url);
-                } catch (Exception $e) {
-                    $this->test_result = null;
-                }
-
-            } else {
-                $this->job = null;
-                $this->test_result = null;
-            }
-
-        }
-    }
-
-    function getContent() {
-        $html = '';
-        if ($this->job != null && $this->test_result != null) {
-
-            $job = $this->job;
-            $test_result = $this->test_result;
-
-            $html .= '<div style="padding: 20px;">';
-            $html .= ' <a href="/plugins/hudson/?action=view_last_test_result&group_id='.$this->group_id.'&job_id='.$this->job_id.'">'.$test_result->getTestResultPieChart().'</a>';
-            $html .= '</div>';
-
-        } else {
-            if ($this->job != null) {
-                $html .= _("No test found for this job.");
-            } else {
-                $html .= _("Job not found.");
-            }
-        }
-
-        return $html;
-    }
+	var $test_result;
+
+	function hudson_Widget_JobTestResults($owner_type, $owner_id) {
+		$request =& HTTPRequest::instance();
+		if ($owner_type == WidgetLayoutManager::OWNER_TYPE_USER) {
+			$this->widget_id = 'plugin_hudson_my_jobtestresults';
+			$this->group_id = $owner_id;
+		} else {
+			$this->widget_id = 'plugin_hudson_project_jobtestresults';
+			$this->group_id = $request->get('group_id');
+		}
+		$this->Widget($this->widget_id);
+		$this->setOwner($owner_id, $owner_type);
+	}
+
+	function getTitle() {
+		$title = '';
+		if ($this->job && $this->test_result) {
+			$title .= vsprintf(_('%1$s Test Results (%2$s / %3$s)'),
+					array($this->job->getName(), $this->test_result->getPassCount(), $this->test_result->getTotalCount()));
+		} elseif ($this->job && ! $this->test_result) {
+			$title .= sprintf(_('%1$s Test Results'), $this->job->getName());
+		} else {
+			$title .= _('Test Results');
+		}
+		return  $title;
+	}
+
+	function getDescription() {
+		return _("Show the test results of the latest build for the selected job.To display something, your job needs to execute tests and publish them. The result is shown on a pie chart.");
+	}
+
+	function loadContent($id) {
+		$sql = "SELECT * FROM plugin_hudson_widget WHERE widget_name=$1 AND owner_id=$2 AND owner_type=$3 AND id=$4";
+		$res = db_query_params($sql,array($this->widget_id,$this->owner_id,$this->owner_type,$id));
+		if ($res && db_numrows($res)) {
+			$data = db_fetch_array($res);
+			$this->job_id    = $data['job_id'];
+			$this->content_id = $id;
+			$jobs = $this->getAvailableJobs();
+			if (array_key_exists($this->job_id, $jobs)) {
+				$used_job = $jobs[$this->job_id];
+				$this->job_url = $used_job->getUrl();
+				$this->job = $used_job;
+				try {
+					$this->test_result = new HudsonTestResult($this->job_url);
+				} catch (Exception $e) {
+					$this->test_result = null;
+				}
+
+			} else {
+				$this->job = null;
+				$this->test_result = null;
+			}
+		}
+	}
+
+	function getContent() {
+		$html = '';
+		if ($this->job != null && $this->test_result != null) {
+			$job = $this->job;
+			$test_result = $this->test_result;
+			$html .= '<div style="padding: 20px;">';
+			$html .= ' <a href="/plugins/hudson/?action=view_last_test_result&group_id='.$this->group_id.'&job_id='.$this->job_id.'">'.$test_result->getTestResultPieChart().'</a>';
+			$html .= '</div>';
+		} else {
+			if ($this->job != null) {
+				$html .= _("No test found for this job.");
+			} else {
+				$html .= _("Job not found.");
+			}
+		}
+		return $html;
+	}
 }
diff --git a/src/plugins/hudson/include/hudson_Widget_JobTestTrend.class.php b/src/plugins/hudson/include/hudson_Widget_JobTestTrend.class.php
index 53e8e19..4360313 100644
--- a/src/plugins/hudson/include/hudson_Widget_JobTestTrend.class.php
+++ b/src/plugins/hudson/include/hudson_Widget_JobTestTrend.class.php
@@ -2,20 +2,20 @@
 /**
  * Copyright (c) Xerox Corporation, Codendi Team, 2001-2009. All rights reserved
  *
- * This file is a part of Codendi.
+ * This file is a part of Fusionforge.
  *
- * Codendi is free software; you can redistribute it and/or modify
+ * Fusionforge is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
  * the Free Software Foundation; either version 2 of the License, or
  * (at your option) any later version.
  *
- * Codendi is distributed in the hope that it will be useful,
+ * Fusionforge is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
- * along with Codendi. If not, see <http://www.gnu.org/licenses/>.
+ * along with Fusionforge. If not, see <http://www.gnu.org/licenses/>.
  */
 
 
@@ -28,81 +28,72 @@ require_once 'HudsonTestResult.class.php';
 
 class hudson_Widget_JobTestTrend extends HudsonJobWidget {
 
-    function hudson_Widget_JobTestTrend($owner_type, $owner_id) {
-        $request =& HTTPRequest::instance();
-        if ($owner_type == WidgetLayoutManager::OWNER_TYPE_USER) {
-            $this->widget_id = 'plugin_hudson_my_jobtesttrend';
-            $this->group_id = $owner_id;
-        } else {
-            $this->widget_id = 'plugin_hudson_project_jobtesttrend';
-            $this->group_id = $request->get('group_id');
-        }
-        $this->Widget($this->widget_id);
-
-        $this->setOwner($owner_id, $owner_type);
-    }
-
-    function getTitle() {
-        if ($this->job) {
-            return sprintf(_('%s Test Result Trend'), $this->job->getName());
-        } else {
-            return _('Test Result Trend');
-        }
-    }
-
-    function getDescription() {
-        return _("Show the test result trend for the selected job. To display something, your job needs to have tests. The graph will show the number of tests (failed and successfull) along  time. The number of tests is increasing while the number of build and commits are increasing too.");
-    }
-
-    function loadContent($id) {
-        $sql = "SELECT * FROM plugin_hudson_widget WHERE widget_name=$1 AND owner_id=$2 AND owner_type=$3 AND id=$4";
-        $res = db_query_params($sql,array($this->widget_id,$this->owner_id,$this->owner_type,$id));
-        if ($res && db_numrows($res)) {
-            $data = db_fetch_array($res);
-            $this->job_id    = $data['job_id'];
-            $this->content_id = $id;
-
-            $jobs = $this->getAvailableJobs();
-
-            if (array_key_exists($this->job_id, $jobs)) {
-                $used_job = $jobs[$this->job_id];
-                $this->job_url = $used_job->getUrl();
-                $this->job = $used_job;
-
-                try {
-                    $this->test_result = new HudsonTestResult($this->job_url);
-                } catch (Exception $e) {
-                    $this->test_result = null;
-                }
-
-            } else {
-                $this->job = null;
-                $this->test_result = null;
-            }
-
-        }
-    }
-
-    function getContent() {
-        $html = '';
-        if ($this->job != null && $this->test_result != null) {
-
-            $job = $this->job;
-
-            $html .= '<div style="padding: 20px;">';
-            $html .= '<a href="/plugins/hudson/?action=view_test_trend&group_id='.$this->group_id.'&job_id='.$this->job_id.'">';
-            $html .= '<img src="'.$job->getUrl().'/test/trend?width=320&height=240" alt="'.vsprintf(_("%s Test Result Trend"),  array($this->job->getName())).'" title="'.vsprintf(_("%s Test Result Trend"),  array($this->job->getName())).'" />';
-            $html .= '</a>';
-            $html .= '</div>';
-
-        } else {
-            if ($this->job != null) {
-                $html .= _("No test found for this job.");
-            } else {
-                $html .= _("Job not found.");
-            }
-        }
-
-        return $html;
-    }
+	function hudson_Widget_JobTestTrend($owner_type, $owner_id) {
+		$request =& HTTPRequest::instance();
+		if ($owner_type == WidgetLayoutManager::OWNER_TYPE_USER) {
+			$this->widget_id = 'plugin_hudson_my_jobtesttrend';
+			$this->group_id = $owner_id;
+		} else {
+			$this->widget_id = 'plugin_hudson_project_jobtesttrend';
+			$this->group_id = $request->get('group_id');
+		}
+		$this->Widget($this->widget_id);
+		$this->setOwner($owner_id, $owner_type);
+	}
+
+	function getTitle() {
+		if ($this->job) {
+			return sprintf(_('%s Test Result Trend'), $this->job->getName());
+		} else {
+			return _('Test Result Trend');
+		}
+	}
+
+	function getDescription() {
+		return _("Show the test result trend for the selected job. To display something, your job needs to have tests. The graph will show the number of tests (failed and successfull) along  time. The number of tests is increasing while the number of build and commits are increasing too.");
+	}
+
+	function loadContent($id) {
+		$sql = "SELECT * FROM plugin_hudson_widget WHERE widget_name=$1 AND owner_id=$2 AND owner_type=$3 AND id=$4";
+		$res = db_query_params($sql,array($this->widget_id,$this->owner_id,$this->owner_type,$id));
+		if ($res && db_numrows($res)) {
+			$data = db_fetch_array($res);
+			$this->job_id    = $data['job_id'];
+			$this->content_id = $id;
+			$jobs = $this->getAvailableJobs();
+			if (array_key_exists($this->job_id, $jobs)) {
+				$used_job = $jobs[$this->job_id];
+				$this->job_url = $used_job->getUrl();
+				$this->job = $used_job;
+
+				try {
+					$this->test_result = new HudsonTestResult($this->job_url);
+				} catch (Exception $e) {
+					$this->test_result = null;
+				}
+			} else {
+				$this->job = null;
+				$this->test_result = null;
+			}
+		}
+	}
+
+	function getContent() {
+		$html = '';
+		if ($this->job != null && $this->test_result != null) {
+			$job = $this->job;
+			$html .= '<div style="padding: 20px;">';
+			$html .= '<a href="/plugins/hudson/?action=view_test_trend&group_id='.$this->group_id.'&job_id='.$this->job_id.'">';
+			$html .= '<img src="'.$job->getUrl().'/test/trend?width=320&height=240" alt="'.vsprintf(_("%s Test Result Trend"),  array($this->job->getName())).'" title="'.vsprintf(_("%s Test Result Trend"),  array($this->job->getName())).'" />';
+			$html .= '</a>';
+			$html .= '</div>';
+		} else {
+			if ($this->job != null) {
+				$html .= _("No test found for this job.");
+			} else {
+				$html .= _("Job not found.");
+			}
+		}
+		return $html;
+	}
 }
diff --git a/src/plugins/hudson/include/hudson_Widget_MyMonitoredJobs.class.php b/src/plugins/hudson/include/hudson_Widget_MyMonitoredJobs.class.php
index 0b0f1a5..8d38f13 100644
--- a/src/plugins/hudson/include/hudson_Widget_MyMonitoredJobs.class.php
+++ b/src/plugins/hudson/include/hudson_Widget_MyMonitoredJobs.class.php
@@ -2,20 +2,20 @@
 /**
  * Copyright (c) Xerox Corporation, Codendi Team, 2001-2009. All rights reserved
  *
- * This file is a part of Codendi.
+ * This file is a part of Fusionforge.
  *
- * Codendi is free software; you can redistribute it and/or modify
+ * Fusionforge is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
  * the Free Software Foundation; either version 2 of the License, or
  * (at your option) any later version.
  *
- * Codendi is distributed in the hope that it will be useful,
+ * Fusionforge is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
- * along with Codendi. If not, see <http://www.gnu.org/licenses/>.
+ * along with Fusionforge. If not, see <http://www.gnu.org/licenses/>.
  */
 
 
@@ -27,43 +27,41 @@ require_once 'HudsonJob.class.php';
 
 class hudson_Widget_MyMonitoredJobs extends HudsonOverviewWidget {
 
-    var $plugin;
-
-    var $_not_monitored_jobs;
-    var $_use_global_status;
-    var $_all_status;
-    var $_global_status;
-    var $_global_status_icon;
-
-    function hudson_Widget_MyMonitoredJobs($plugin) {
-        $this->Widget('plugin_hudson_my_jobs');
-        $this->plugin = $plugin;
-	$user=UserManager::instance()->getCurrentUser();
-
-        $this->_not_monitored_jobs = $user->getPreference('plugin_hudson_my_not_monitored_jobs');
-        if ($this->_not_monitored_jobs === false) {
-            $this->_not_monitored_jobs = array();
-        } else {
-            $this->_not_monitored_jobs = explode(",", $this->_not_monitored_jobs);
-        }
-
-        $this->_use_global_status = $user->getPreference('plugin_hudson_use_global_status');
-        if ($this->_use_global_status === false) {
-            $this->_use_global_status = "false";
-            $user->setPreference('plugin_hudson_use_global_status', $this->_use_global_status);
-        }
-
-        if ($this->_use_global_status == "true") {
-            $this->_all_status = array(
-                'grey' => 0,
-                'blue' => 0,
-                'yellow' => 0,
-                'red' => 0,
-            );
-            $this->computeGlobalStatus();
-        }
-
-    }
+	var $plugin;
+
+	var $_not_monitored_jobs;
+	var $_use_global_status;
+	var $_all_status;
+	var $_global_status;
+	var $_global_status_icon;
+
+	function hudson_Widget_MyMonitoredJobs($plugin) {
+		$this->Widget('plugin_hudson_my_jobs');
+		$this->plugin = $plugin;
+		$user=UserManager::instance()->getCurrentUser();
+		$this->_not_monitored_jobs = $user->getPreference('plugin_hudson_my_not_monitored_jobs');
+		if ($this->_not_monitored_jobs === false) {
+			$this->_not_monitored_jobs = array();
+		} else {
+			$this->_not_monitored_jobs = explode(",", $this->_not_monitored_jobs);
+		}
+
+		$this->_use_global_status = $user->getPreference('plugin_hudson_use_global_status');
+		if ($this->_use_global_status === false) {
+			$this->_use_global_status = "false";
+			$user->setPreference('plugin_hudson_use_global_status', $this->_use_global_status);
+		}
+
+		if ($this->_use_global_status == "true") {
+			$this->_all_status = array(
+						'grey' => 0,
+						'blue' => 0,
+						'yellow' => 0,
+						'red' => 0,
+						);
+			$this->computeGlobalStatus();
+		}
+	}
 
     function computeGlobalStatus() {
         $monitored_jobs = $this->_getMonitoredJobsByUser();
@@ -93,129 +91,127 @@ class hudson_Widget_MyMonitoredJobs extends HudsonOverviewWidget {
         }
     }
 
-    function getTitle() {
-        $title = '';
-        if ($this->_use_global_status == "true") {
-            $title = '<img src="'.$this->_global_status_icon.'" title="'.$this->_global_status.'" alt="'.$this->_global_status.'" /> ';
-        }
-        $title .= _("My Hudson Jobs");
-        return  $title;
-    }
-
-    function getDescription() {
-        return _("Show an overview of all the jobs of all the projects you're member of. You can of course select the jobs you wish to display by selecting the preferences link of the widget.");
-    }
-
-    function updatePreferences(&$request) {
-        $request->valid(new Valid_String('cancel'));
-        if (!$request->exist('cancel')) {
-            $monitored_jobs = $request->get('myhudsonjobs');
-
-            $user = UserManager::instance()->getCurrentUser();
-            $job_dao = new PluginHudsonJobDao(CodendiDataAccess::instance());
-            $dar = $job_dao->searchByUserID($user->getId());
-            $not_monitored_jobs = array();
-            while ($dar->valid()) {
-                $row = $dar->current();
-                if ( ! in_array($row['job_id'], $monitored_jobs)) {
-                    $not_monitored_jobs[] = $row['job_id'];
-                }
-                $dar->next();
-            }
-
-            $this->_not_monitored_jobs = $not_monitored_jobs;
-
-            $user->setPreference('plugin_hudson_my_not_monitored_jobs', implode(",", $this->_not_monitored_jobs));
-
-            $use_global_status = $request->get('use_global_status');
-            $this->_use_global_status = ($use_global_status !== false)?"true":"false";
-            $user->setPreference('plugin_hudson_use_global_status', $this->_use_global_status);
-        }
-        return true;
-    }
-    function hasPreferences() {
-        return true;
-    }
-    function getPreferences() {
-        $prefs  = '';
-        // Monitored jobs
-        $prefs .= '<strong>'._("Monitored jobs:").'</strong><br />';
-        $user = UserManager::instance()->getCurrentUser();
-        $job_dao = new PluginHudsonJobDao(CodendiDataAccess::instance());
-        $dar = $job_dao->searchByUserID($user->getId());
-        while ($dar->valid()) {
-            $row = $dar->current();
-            try {
-                $job = new Hudsonjob($row['job_url']);
-                $prefs .= '<input type="checkbox" name="myhudsonjobs[]" value="'.$row['job_id'].'" '.(in_array($row['job_id'], $this->_not_monitored_jobs)?'':'checked="checked"').'> '.$job->getName().'<br />';
-            } catch (Exception $e) {
-                // Do not display wrong jobs
-            }
-            $dar->next();
-        }
-
-        // Use global status
-        $prefs .= '<strong>'._("Use global status:").'</strong>';
-        $prefs .= '<input type="checkbox" name="use_global_status" value="use_global" '.(($this->_use_global_status == "true")?'checked="checked"':'').'><br />';
-        return $prefs;
-    }
-
-    function getContent() {
-        $monitored_jobs = $this->_getMonitoredJobsByUser();
-        if (sizeof($monitored_jobs) > 0) {
-            $html = '';
-            $html .= '<table style="width:100%">';
-            $cpt = 1;
-
-            foreach ($monitored_jobs as $monitored_job) {
-                try {
-
-                    $job_dao = new PluginHudsonJobDao(CodendiDataAccess::instance());
-                    $dar = $job_dao->searchByJobID($monitored_job);
-                    if ($dar->valid()) {
-                        $row = $dar->current();
-                        $job_url = $row['job_url'];
-                        $job_id = $row['job_id'];
-                        $group_id = $row['group_id'];
-                        $job = new HudsonJob($job_url);
-                        if ($cpt % 2 == 0) {
-					$class="boxitemalt bgcolor-white";
-				} else {
-					$class="boxitem bgcolor-grey";
+	function getTitle() {
+		$title = '';
+		if ($this->_use_global_status == "true") {
+			$title = '<img src="'.$this->_global_status_icon.'" title="'.$this->_global_status.'" alt="'.$this->_global_status.'" /> ';
+		}
+		$title .= _("My Hudson Jobs");
+		return  $title;
+	}
+
+	function getDescription() {
+		return _("Show an overview of all the jobs of all the projects you're member of. You can of course select the jobs you wish to display by selecting the preferences link of the widget.");
+	}
+
+	function updatePreferences(&$request) {
+		$request->valid(new Valid_String('cancel'));
+		if (!$request->exist('cancel')) {
+			$monitored_jobs = $request->get('myhudsonjobs');
+			$user = UserManager::instance()->getCurrentUser();
+			$job_dao = new PluginHudsonJobDao(CodendiDataAccess::instance());
+			$dar = $job_dao->searchByUserID($user->getId());
+			$not_monitored_jobs = array();
+			while ($dar->valid()) {
+				$row = $dar->current();
+				if ( ! in_array($row['job_id'], $monitored_jobs)) {
+					$not_monitored_jobs[] = $row['job_id'];
 				}
-
-                        $html .= '<tr class="'. $class .'">';
-                        $html .= ' <td>';
-                        $html .= ' <img src="'.$job->getStatusIcon().'" title="'.$job->getStatus().'" >';
-                        $html .= ' </td>';
-                        $html .= ' <td style="width:99%">';
-                        $html .= '  <a href="/plugins/hudson/?action=view_job&group_id='.$group_id.'&job_id='.$job_id.'">'.$job->getName().'</a><br />';
-                        $html .= ' </td>';
-                        $html .= '</tr>';
-
-                        $cpt++;
-                    }
-                } catch (Exception $e) {
-                    // Do not display wrong jobs
-                }
-            }
-            $html .= '</table>';
-            return $html;
-        }
-    }
-
-    function _getMonitoredJobsByUser() {
-        $user = UserManager::instance()->getCurrentUser();
-        $job_dao = new PluginHudsonJobDao(CodendiDataAccess::instance());
-        $dar = $job_dao->searchByUserID($user->getId());
-        $monitored_jobs = array();
-        while ($dar->valid()) {
-            $row = $dar->current();
-            if ( ! in_array($row['job_id'], $this->_not_monitored_jobs)) {
-                $monitored_jobs[] = $row['job_id'];
-            }
-            $dar->next();
-        }
-        return $monitored_jobs;
-    }
+				$dar->next();
+			}
+
+			$this->_not_monitored_jobs = $not_monitored_jobs;
+			$user->setPreference('plugin_hudson_my_not_monitored_jobs', implode(",", $this->_not_monitored_jobs));
+			$use_global_status = $request->get('use_global_status');
+			$this->_use_global_status = ($use_global_status !== false)?"true":"false";
+			$user->setPreference('plugin_hudson_use_global_status', $this->_use_global_status);
+		}
+		return true;
+	}
+
+	function hasPreferences() {
+		return true;
+	}
+
+	function getPreferences() {
+		$prefs  = '';
+		// Monitored jobs
+		$prefs .= '<strong>'._("Monitored jobs:").'</strong><br />';
+		$user = UserManager::instance()->getCurrentUser();
+		$job_dao = new PluginHudsonJobDao(CodendiDataAccess::instance());
+		$dar = $job_dao->searchByUserID($user->getId());
+		while ($dar->valid()) {
+			$row = $dar->current();
+			try {
+				$job = new Hudsonjob($row['job_url']);
+				$prefs .= '<input type="checkbox" name="myhudsonjobs[]" value="'.$row['job_id'].'" '.(in_array($row['job_id'], $this->_not_monitored_jobs)?'':'checked="checked"').'> '.$job->getName().'<br />';
+			} catch (Exception $e) {
+				// Do not display wrong jobs
+			}
+			$dar->next();
+		}
+
+		// Use global status
+		$prefs .= '<strong>'._("Use global status:").'</strong>';
+		$prefs .= '<input type="checkbox" name="use_global_status" value="use_global" '.(($this->_use_global_status == "true")?'checked="checked"':'').'><br />';
+		return $prefs;
+	}
+
+	function getContent() {
+		$monitored_jobs = $this->_getMonitoredJobsByUser();
+		if (sizeof($monitored_jobs) > 0) {
+			$html = '';
+			$html .= '<table style="width:100%">';
+			$cpt = 1;
+
+			foreach ($monitored_jobs as $monitored_job) {
+				try {
+				$job_dao = new PluginHudsonJobDao(CodendiDataAccess::instance());
+				$dar = $job_dao->searchByJobID($monitored_job);
+				if ($dar->valid()) {
+					$row = $dar->current();
+					$job_url = $row['job_url'];
+					$job_id = $row['job_id'];
+					$group_id = $row['group_id'];
+					$job = new HudsonJob($job_url);
+					if ($cpt % 2 == 0) {
+						$class="boxitemalt bgcolor-white";
+					} else {
+						$class="boxitem bgcolor-grey";
+					}
+
+					$html .= '<tr class="'. $class .'">';
+					$html .= ' <td>';
+					$html .= ' <img src="'.$job->getStatusIcon().'" title="'.$job->getStatus().'" >';
+					$html .= ' </td>';
+					$html .= ' <td style="width:99%">';
+					$html .= '  <a href="/plugins/hudson/?action=view_job&group_id='.$group_id.'&job_id='.$job_id.'">'.$job->getName().'</a><br />';
+					$html .= ' </td>';
+					$html .= '</tr>';
+
+					$cpt++;
+				}
+				} catch (Exception $e) {
+				// Do not display wrong jobs
+			}
+		}
+		$html .= '</table>';
+		return $html;
+		}
+	}
+
+	function _getMonitoredJobsByUser() {
+		$user = UserManager::instance()->getCurrentUser();
+		$job_dao = new PluginHudsonJobDao(CodendiDataAccess::instance());
+		$dar = $job_dao->searchByUserID($user->getId());
+		$monitored_jobs = array();
+		while ($dar->valid()) {
+			$row = $dar->current();
+			if ( ! in_array($row['job_id'], $this->_not_monitored_jobs)) {
+				$monitored_jobs[] = $row['job_id'];
+			}
+			$dar->next();
+		}
+		return $monitored_jobs;
+	}
 }
diff --git a/src/plugins/hudson/include/hudson_Widget_ProjectJobsOverview.class.php b/src/plugins/hudson/include/hudson_Widget_ProjectJobsOverview.class.php
index bb816e0..59bf8f0 100644
--- a/src/plugins/hudson/include/hudson_Widget_ProjectJobsOverview.class.php
+++ b/src/plugins/hudson/include/hudson_Widget_ProjectJobsOverview.class.php
@@ -2,23 +2,22 @@
 /**
  * Copyright (c) Xerox Corporation, Codendi Team, 2001-2009. All rights reserved
  *
- * This file is a part of Codendi.
+ * This file is a part of Fusionforge.
  *
- * Codendi is free software; you can redistribute it and/or modify
+ * Fusionforge is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
  * the Free Software Foundation; either version 2 of the License, or
  * (at your option) any later version.
  *
- * Codendi is distributed in the hope that it will be useful,
+ * Fusionforge is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
- * along with Codendi. If not, see <http://www.gnu.org/licenses/>.
+ * along with Fusionforge. If not, see <http://www.gnu.org/licenses/>.
  */
 
-
 require_once 'HudsonOverviewWidget.class.php';
 require_once 'common/include/HTTPRequest.class.php';
 require_once 'PluginHudsonJobDao.class.php';
@@ -26,97 +25,95 @@ require_once 'HudsonJob.class.php';
 
 class hudson_Widget_ProjectJobsOverview extends HudsonOverviewWidget {
 
-    var $plugin;
-    var $group_id;
-
-    var $_not_monitored_jobs;
-    var $_use_global_status = true;
-    var $_all_status;
-    var $_global_status;
-    var $_global_status_icon;
-
-    function hudson_Widget_ProjectJobsOverview($plugin) {
-        $this->Widget('plugin_hudson_project_jobsoverview');
-        $this->plugin = $plugin;
-
-        $request =& HTTPRequest::instance();
-        $this->group_id = $request->get('group_id');
-
-        if ($this->_use_global_status == "true") {
-            $this->_all_status = array(
-                'grey' => 0,
-                'blue' => 0,
-                'yellow' => 0,
-                'red' => 0,
-            );
-            $this->computeGlobalStatus();
-        }
-
-    }
-
-    function computeGlobalStatus() {
-        $jobs = $this->getJobsByGroup($this->group_id);
-        foreach ($jobs as $job) {
-            $this->_all_status[(string)$job->getColorNoAnime()] = $this->_all_status[(string)$job->getColorNoAnime()] + 1;
-        }
-        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";
-        } 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";
-        } else {
-            $this->_global_status = _("Success");
-            $this->_global_status_icon = $this->plugin->getThemePath() . "/images/ic/" . "status_blue.png";
-        }
-    }
-
-    function getTitle() {
-        $title = '';
-        if ($this->_use_global_status == "true") {
-            $title = '<img src="'.$this->_global_status_icon.'" title="'.$this->_global_status.'" alt="'.$this->_global_status.'" /> ';
-        }
-        $title .= _("Hudson Jobs");
-        return  $title;
-    }
-
-    function getDescription() {
-        return _("Shows an overview of all the jobs associated with this project. You can always choose the ones you want to display in the widget (preferences link).");
-    }
-
-    function getContent() {
-        $jobs = $this->getJobsByGroup($this->group_id);
-        if (sizeof($jobs) > 0) {
-            $html = '';
-            $html .= '<table style="width:100%">';
-            $cpt = 1;
-
-            foreach ($jobs as $job_id => $job) {
-		if ($cpt % 2 == 0) {
-                        $class="boxitemalt bgcolor-white";
-                } else {
-                        $class="boxitem bgcolor-grey";
-                }
-
-                try {
-
-                    $html .= '<tr class="'. $class .'">';
-                    $html .= ' <td>';
-                    $html .= ' <img src="'.$job->getStatusIcon().'" title="'.$job->getStatus().'" >';
-                    $html .= ' </td>';
-                    $html .= ' <td style="width:99%">';
-                    $html .= '  <a href="/plugins/hudson/?action=view_job&group_id='.$this->group_id.'&job_id='.$job_id.'">'.$job->getName().'</a><br />';
-                    $html .= ' </td>';
-                    $html .= '</tr>';
-
-                    $cpt++;
-
-                } catch (Exception $e) {
-                    // Do not display wrong jobs
-                }
-            }
-            $html .= '</table>';
-            return $html;
-        }
-    }
+	var $plugin;
+	var $group_id;
+	var $_not_monitored_jobs;
+	var $_use_global_status = true;
+	var $_all_status;
+	var $_global_status;
+	var $_global_status_icon;
+
+	function hudson_Widget_ProjectJobsOverview($plugin) {
+		$this->Widget('plugin_hudson_project_jobsoverview');
+		$this->plugin = $plugin;
+
+		$request =& HTTPRequest::instance();
+		$this->group_id = $request->get('group_id');
+
+		if ($this->_use_global_status == "true") {
+			$this->_all_status = array(
+						'grey' => 0,
+						'blue' => 0,
+						'yellow' => 0,
+						'red' => 0,
+						);
+		$this->computeGlobalStatus();
+		}
+	}
+
+	function computeGlobalStatus() {
+		$jobs = $this->getJobsByGroup($this->group_id);
+		foreach ($jobs as $job) {
+			$this->_all_status[(string)$job->getColorNoAnime()] = $this->_all_status[(string)$job->getColorNoAnime()] + 1;
+		}
+		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";
+		} 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";
+		} else {
+			$this->_global_status = _("Success");
+			$this->_global_status_icon = $this->plugin->getThemePath() . "/images/ic/" . "status_blue.png";
+		}
+	}
+
+	function getTitle() {
+		$title = '';
+		if ($this->_use_global_status == "true") {
+			$title = '<img src="'.$this->_global_status_icon.'" title="'.$this->_global_status.'" alt="'.$this->_global_status.'" /> ';
+		}
+		$title .= _("Hudson Jobs");
+		return  $title;
+	}
+
+	function getDescription() {
+		return _("Shows an overview of all the jobs associated with this project. You can always choose the ones you want to display in the widget (preferences link).");
+	}
+
+	function getContent() {
+		$jobs = $this->getJobsByGroup($this->group_id);
+		if (sizeof($jobs) > 0) {
+			$html = '';
+			$html .= '<table style="width:100%">';
+			$cpt = 1;
+
+			foreach ($jobs as $job_id => $job) {
+				if ($cpt % 2 == 0) {
+					$class="boxitemalt bgcolor-white";
+				} else {
+					$class="boxitem bgcolor-grey";
+				}
+
+				try {
+
+				$html .= '<tr class="'. $class .'">';
+				$html .= ' <td>';
+				$html .= ' <img src="'.$job->getStatusIcon().'" title="'.$job->getStatus().'" >';
+				$html .= ' </td>';
+				$html .= ' <td style="width:99%">';
+				$html .= '  <a href="/plugins/hudson/?action=view_job&group_id='.$this->group_id.'&job_id='.$job_id.'">'.$job->getName().'</a><br />';
+				$html .= ' </td>';
+				$html .= '</tr>';
+
+				$cpt++;
+
+				} catch (Exception $e) {
+				// Do not display wrong jobs
+				}
+			}
+			$html .= '</table>';
+			return $html;
+		}
+	}
 }

-----------------------------------------------------------------------

Summary of changes:
 src/common/include/UserManager.class.php           |   89 ++-
 src/plugins/hudson/include/HudsonBuild.class.php   |  183 +++---
 src/plugins/hudson/include/HudsonJob.class.php     |  592 ++++++++++----------
 .../include/HudsonJobURLFileException.class.php    |    9 +-
 .../HudsonJobURLFileNotFoundException.class.php    |    9 +-
 .../HudsonJobURLMalformedException.class.php       |    9 +-
 .../hudson/include/HudsonJobWidget.class.php       |  185 +++---
 .../hudson/include/HudsonOverviewWidget.class.php  |   16 +-
 .../hudson/include/HudsonTestResult.class.php      |    5 +-
 src/plugins/hudson/include/HudsonWidget.class.php  |  105 ++--
 .../hudson/include/PluginHudsonJobDao.class.php    |    9 +-
 src/plugins/hudson/include/hudson.class.php        |  223 ++++----
 src/plugins/hudson/include/hudsonActions.class.php |  144 +++--
 src/plugins/hudson/include/hudsonPlugin.class.php  |   26 +-
 .../include/hudsonPluginDescriptor.class.php       |   15 +-
 .../hudson/include/hudsonPluginInfo.class.php      |   16 +-
 src/plugins/hudson/include/hudsonViews.class.php   |   12 +-
 .../hudson_Widget_JobBuildHistory.class.php        |  153 +++--
 .../hudson_Widget_JobLastArtifacts.class.php       |  164 +++---
 .../include/hudson_Widget_JobLastBuilds.class.php  |  150 +++--
 .../include/hudson_Widget_JobTestResults.class.php |  165 +++---
 .../include/hudson_Widget_JobTestTrend.class.php   |  153 +++--
 .../hudson_Widget_MyMonitoredJobs.class.php        |  326 ++++++-----
 .../hudson_Widget_ProjectJobsOverview.class.php    |  193 ++++---
 24 files changed, 1468 insertions(+), 1483 deletions(-)


hooks/post-receive
-- 
FusionForge



More information about the Fusionforge-commits mailing list