[Fusionforge-commits] r10093 - in trunk/plugins/coclico/hudson: include www www/themes/default/css

Alain Peyrat aljeux at libremir.placard.fr.eu.org
Fri Jun 18 18:40:45 CEST 2010


Author: aljeux
Date: 2010-06-18 18:40:45 +0200 (Fri, 18 Jun 2010)
New Revision: 10093

Modified:
   trunk/plugins/coclico/hudson/include/hudsonPlugin.class.php
   trunk/plugins/coclico/hudson/include/hudsonViews.class.php
   trunk/plugins/coclico/hudson/include/hudson_Widget_JobBuildHistory.class.php
   trunk/plugins/coclico/hudson/include/hudson_Widget_JobLastArtifacts.class.php
   trunk/plugins/coclico/hudson/include/hudson_Widget_JobLastBuilds.class.php
   trunk/plugins/coclico/hudson/include/hudson_Widget_JobTestResults.class.php
   trunk/plugins/coclico/hudson/include/hudson_Widget_JobTestTrend.class.php
   trunk/plugins/coclico/hudson/www/test_result_pie_chart.php
   trunk/plugins/coclico/hudson/www/themes/default/css/style.css
Log:
Mass patches around hudson plugin.
* Renamed to Hudson for clarity.
* xhtml & css fixes
* Several bugs fixed.

Modified: trunk/plugins/coclico/hudson/include/hudsonPlugin.class.php
===================================================================
--- trunk/plugins/coclico/hudson/include/hudsonPlugin.class.php	2010-06-18 12:22:32 UTC (rev 10092)
+++ trunk/plugins/coclico/hudson/include/hudsonPlugin.class.php	2010-06-18 16:40:45 UTC (rev 10093)
@@ -16,8 +16,8 @@
 	function hudsonPlugin($id=0) {
 		$this->Plugin($id);
 		$this->name = "hudson" ;
-		$this->text = _('Continuous Integration') ; // To show in the tabs, use...
-		$this->_addHook("user_personal_links");//to make a link to the user�s personal part of the plugin
+		$this->text = _('Hudson'); // To show in the tabs, use...
+		$this->_addHook("user_personal_links"); //to make a link to the user's personal part of the plugin
 		$this->_addHook("usermenu") ;
 		$this->_addHook("groupmenu");	// To put into the project tabs
 		$this->_addHook("groupisactivecheckbox") ; // The "use ..." checkbox in editgroupinfo
@@ -42,7 +42,7 @@
 		if ($hookname == "usermenu") {
 			$text = $this->text; // this is what shows in the tab
 			if ($G_SESSION->usesPlugin("hudson")) {
-				$param = '?type=user&id=' . $G_SESSION->getId() . "&pluginname=" . $this->name; // we indicate the part we�re calling is the user one
+				$param = '?type=user&id=' . $G_SESSION->getId() . "&pluginname=" . $this->name; // we indicate the part we're calling is the user one
 				echo ' | ' . $HTML->PrintSubMenu (array ($text),
 						array ('/plugins/hudson/index.php' . $param ));				
 			}
@@ -60,7 +60,7 @@
 			}
 			if ( $project->usesPlugin ( $this->name ) ) {
 				$params['TITLES'][]=$this->text;
-				$params['DIRS'][]='/plugins/hudson/index.php?group_id=' . $group_id . "&pluginname=" . $this->name; // we indicate the part we�re calling is the project one
+				$params['DIRS'][]='/plugins/hudson/index.php?group_id=' . $group_id . "&pluginname=" . $this->name; // we indicate the part we're calling is the project one
 			} 
 			(($params['toptab'] == $this->name) ? $params['selected']=(count($params['TITLES'])-1) : '' );
 
@@ -73,12 +73,12 @@
 			$group = &group_get_object($group_id);
 			echo "<tr>";
 			echo "<td>";
-			echo ' <input type="CHECKBOX" name="use_hudsonplugin" value="1" ';
-			// CHECKED OR UNCHECKED?
+			echo '<input type="checkbox" name="use_hudsonplugin" value="1" ';
+			// checked or unchecked?
 			if ( $group->usesPlugin ( $this->name ) ) {
-				echo "CHECKED";
+				echo 'checked="checked"';
 			}
-			echo "><br/>";
+			echo " /><br />";
 			echo "</td>";
 			echo "<td>";
 			echo "<strong>Use ".$this->text." Plugin</strong>";
@@ -101,16 +101,16 @@
 			$user = $params['user'];
 			echo "<tr>";
 			echo "<td>";
-			echo ' <input type="CHECKBOX" name="use_hudsonplugin" value="1" ';
-			// CHECKED OR UNCHECKED?
+			echo '<input type="checkbox" name="use_hudsonplugin" value="1" ';
+			// checked or unchecked?
 			if ( $user->usesPlugin ( $this->name ) ) {
-				echo "CHECKED";
+				echo 'checked="checked"';
 			}
-			echo ">    Use ".$this->text." Plugin";
+			echo " />Use ".$this->text." Plugin";
 			echo "</td>";
 			echo "</tr>";
 		} elseif ($hookname == "userisactivecheckboxpost") {
-			// this code actually activates/deactivates the plugin after the form was submitted in the user account manteinance page
+			// this code actually activates/deactivates the plugin after the form was submitted in the user account maintenance page
 			$user = $params['user'];
 			$use_hudsonplugin = getStringFromRequest('use_hudsonplugin');
 			if ( $use_hudsonplugin == 1 ) {
@@ -120,13 +120,14 @@
 			}
 			echo "<tr>";
 			echo "<td>";
-			echo ' <input type="CHECKBOX" name="use_hudsonplugin" value="1" ';
-			// CHECKED OR UNCHECKED?
+			echo '<input type="checkbox" name="use_hudsonplugin" value="1" ';
+			// checked or unchecked?
 			if ( $user->usesPlugin ( $this->name ) ) {
-				echo "CHECKED";
+				echo 'checked="checked"';
 			}
-			echo ">    Use ".$this->text." Plugin";
+			echo " />Use ".$this->text." Plugin";
 			echo "</td>";
+			echo "</tr>";
 		} elseif ($hookname == "cssfile") {
 			$this->cssFile($params);
 		} elseif ($hookname == "javascript_file") {

Modified: trunk/plugins/coclico/hudson/include/hudsonViews.class.php
===================================================================
--- trunk/plugins/coclico/hudson/include/hudsonViews.class.php	2010-06-18 12:22:32 UTC (rev 10092)
+++ trunk/plugins/coclico/hudson/include/hudsonViews.class.php	2010-06-18 16:40:45 UTC (rev 10093)
@@ -1,6 +1,7 @@
 <?php
 /**
  * Copyright (c) Xerox Corporation, Codendi Team, 2001-2009. All rights reserved
+ * Copyright (c) 2010 Alcatel-Lucent
  *
  * This file is a part of Codendi.
  *
@@ -37,11 +38,12 @@
 
 	function header() {
 		parent::header();
-		echo $this->_getHelp();
-		echo '<h2>'.$this->_getTitle().'</h2>';
+//		echo $this->_getHelp();
+		echo '<h1>'.$this->_getTitle().'</h1>';
 	}
 	function _getTitle() {
-		return _("Continuous Integration");
+//		return _("Continuous Integration");
+		return _("Hudson");
 	}
 	function _getHelp($section = '', $questionmark = false) {
 		if (trim($section) !== '' && $section{0} !== '#') {
@@ -384,14 +386,14 @@
 		echo '<a href="#" onclick="toggle_addurlform(); return false;">' . getIcon("ic/add.png") . ' '._("Add job").'</a>';
 		echo ' '.$this->_getHelp('HudsonService', true);
 		echo '<div id="hudson_add_job">';
-		echo ' <form>';
-		echo '   <label for="hudson_job_url">'._("Job URL:").'</label>';
-		echo '   <input id="hudson_job_url" name="hudson_job_url" type="text" size="64" />';
-		echo '   <input type="hidden" name="group_id" value="'.$group_id.'" />';
-		echo '   <input type="hidden" name="action" value="add_job" />';
+		echo ' <form action="">'."\n";
+		echo '   <label for="hudson_job_url">'._("Job URL:").'</label>'."\n";
+		echo '   <input id="hudson_job_url" name="hudson_job_url" type="text" size="64" />'."\n";
+		echo '   <input type="hidden" name="group_id" value="'.$group_id.'" />'."\n";
+		echo '   <input type="hidden" name="action" value="add_job" />'."\n";
+		echo '   <br />'."\n";
+		echo '   <span class="legend">'._("eg: http://myCIserver/hudson/job/myJob").'</span>'."\n";
 		echo '   <br />';
-		echo '   <span class="legend">'._("eg: http://myCIserver/hudson/job/myJob").'</span>';
-		echo '   <br />';
 		//echo '  <p>';
 		if ($project->usesService('scmsvn') || $project->usesService('svn')) {
 			echo _("Trigger a build after commits:");
@@ -413,7 +415,7 @@
 		echo '   <input type="submit" value="Add job" />';
 		echo ' </form>';
 		echo '</div>';
-		echo "<script>Element.toggle('hudson_add_job', 'slide');</script>";
+		echo "<script type=\"text/javascript\">Element.toggle('hudson_add_job', 'slide');</script>\n";
 	}
 
 	function _display_iframe($url = '') {
@@ -422,7 +424,7 @@
 		echo '</div>';
 	}
 	function _hide_iframe() {
-		echo "<script>Element.toggle('hudson_iframe_div', 'slide');</script>";
+		echo "<script type=\"text/javascript\">Element.toggle('hudson_iframe_div', 'slide');</script>";
 	}
 }
 

Modified: trunk/plugins/coclico/hudson/include/hudson_Widget_JobBuildHistory.class.php
===================================================================
--- trunk/plugins/coclico/hudson/include/hudson_Widget_JobBuildHistory.class.php	2010-06-18 12:22:32 UTC (rev 10092)
+++ trunk/plugins/coclico/hudson/include/hudson_Widget_JobBuildHistory.class.php	2010-06-18 16:40:45 UTC (rev 10093)
@@ -43,7 +43,7 @@
     function getTitle() {
         $title = '';
         if ($this->job) {
-            $title .= vsprintf(_("%s Builds History"),  $this->job->getName());
+            $title .= sprintf(_("%s Builds History"), $this->job->getName());
         } else {
             $title .= _("Builds History");
         }

Modified: trunk/plugins/coclico/hudson/include/hudson_Widget_JobLastArtifacts.class.php
===================================================================
--- trunk/plugins/coclico/hudson/include/hudson_Widget_JobLastArtifacts.class.php	2010-06-18 12:22:32 UTC (rev 10092)
+++ trunk/plugins/coclico/hudson/include/hudson_Widget_JobLastArtifacts.class.php	2010-06-18 16:40:45 UTC (rev 10093)
@@ -46,9 +46,9 @@
     function getTitle() {
         $title = '';
         if ($this->job) {
-            $title .= vsprintf(_("%s Last Artifacts"),  array($this->job->getName()));
+            $title .= sprintf(_('%s Last Artifacts'), $this->job->getName());
         } else {
-             $title .= _("%s Last Artifacts");
+             $title .= _('Last Artifacts');
         }
         return  $title;
     }

Modified: trunk/plugins/coclico/hudson/include/hudson_Widget_JobLastBuilds.class.php
===================================================================
--- trunk/plugins/coclico/hudson/include/hudson_Widget_JobLastBuilds.class.php	2010-06-18 12:22:32 UTC (rev 10092)
+++ trunk/plugins/coclico/hudson/include/hudson_Widget_JobLastBuilds.class.php	2010-06-18 16:40:45 UTC (rev 10093)
@@ -43,9 +43,9 @@
     function getTitle() {
         $title = '';
         if ($this->job) {
-            $title .= vsprintf(_("%s Last Builds"),  array($this->job->getName()));
+            $title .= sprintf(_('%s Last Builds'), $this->job->getName());
         } else {
-            $title .= _("Last Builds");
+            $title .= _('Last Builds');
         }
         return  $title;
     }

Modified: trunk/plugins/coclico/hudson/include/hudson_Widget_JobTestResults.class.php
===================================================================
--- trunk/plugins/coclico/hudson/include/hudson_Widget_JobTestResults.class.php	2010-06-18 12:22:32 UTC (rev 10092)
+++ trunk/plugins/coclico/hudson/include/hudson_Widget_JobTestResults.class.php	2010-06-18 16:40:45 UTC (rev 10093)
@@ -46,11 +46,12 @@
     function getTitle() {
         $title = '';
         if ($this->job && $this->test_result) {
-            $title .= TODOBETTERvsprintf(_("%s Test Results (%s / %s)"),  array($this->job->getName(), $this->test_result->getPassCount(), $this->test_result->getTotalCount()));
+            $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 .= vsprintf(_("%s Test Results"),  array($this->job->getName()));
+            $title .= sprintf(_('%1$s Test Results'), $this->job->getName());
         } else {
-            $title .= _("Test Results");
+            $title .= _('Test Results');
         }
         return  $title;
     }

Modified: trunk/plugins/coclico/hudson/include/hudson_Widget_JobTestTrend.class.php
===================================================================
--- trunk/plugins/coclico/hudson/include/hudson_Widget_JobTestTrend.class.php	2010-06-18 12:22:32 UTC (rev 10092)
+++ trunk/plugins/coclico/hudson/include/hudson_Widget_JobTestTrend.class.php	2010-06-18 16:40:45 UTC (rev 10093)
@@ -43,13 +43,11 @@
     }
     
     function getTitle() {
-        $title = '';
         if ($this->job) {
-            $title .= vsprintf(_("%s Test Result Trend"),  array($this->job->getName()));
+            return sprintf(_('%s Test Result Trend'), $this->job->getName());
         } else {
-             $title .= _("%s Test Result Trend");
+            return _('Test Result Trend');
         }
-        return  $title;
     }
     
     function getDescription() {

Modified: trunk/plugins/coclico/hudson/www/test_result_pie_chart.php
===================================================================
--- trunk/plugins/coclico/hudson/www/test_result_pie_chart.php	2010-06-18 12:22:32 UTC (rev 10092)
+++ trunk/plugins/coclico/hudson/www/test_result_pie_chart.php	2010-06-18 16:40:45 UTC (rev 10093)
@@ -3,9 +3,10 @@
 require_once('pre.php');
 require_once('preplugins.php');
 
-require_once($GLOBALS['jpgraph_dir'].'/jpgraph.php');
-require_once($GLOBALS['jpgraph_dir'].'/jpgraph_pie.php');
+require_once($sys_path_to_jpgraph.'/jpgraph.php');
+require_once($sys_path_to_jpgraph.'/jpgraph_pie.php');
 
+$request =& HTTPRequest::instance();
 $pass_count = $request->get('p');
 $fail_count = $request->get('f');
 $skip_count = $request->get('s');

Modified: trunk/plugins/coclico/hudson/www/themes/default/css/style.css
===================================================================
--- trunk/plugins/coclico/hudson/www/themes/default/css/style.css	2010-06-18 12:22:32 UTC (rev 10092)
+++ trunk/plugins/coclico/hudson/www/themes/default/css/style.css	2010-06-18 16:40:45 UTC (rev 10093)
@@ -17,7 +17,6 @@
 }
 
 td.widget_lastbuilds_weather {
-	align: right; 
 	text-align: right;
 }
 img.widget_lastbuilds_weather_img {




More information about the Fusionforge-commits mailing list