[Fusionforge-commits] FusionForge branch master updated. v6.0.5-1858-g68f1787

Franck Villaume nerville at libremir.placard.fr.eu.org
Fri May 26 14:05:12 CEST 2017


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  68f17875d0ed42c25b9def0db8f307953596cb77 (commit)
       via  8bfe413fccdb0e392eb6ee8315ea231a791cfaf8 (commit)
       via  7c8314751d000d902f287737a800edfb12f15eb1 (commit)
      from  763043b23e26ee4a3581085c4d8371efa1de93f8 (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 -----------------------------------------------------------------
https://scm.fusionforge.org/anonscm/gitweb/?p=fusionforge/fusionforge.git;a=commitdiff;h=68f17875d0ed42c25b9def0db8f307953596cb77

commit 68f17875d0ed42c25b9def0db8f307953596cb77
Author: Franck Villaume <franck.villaume at trivialdev.com>
Date:   Fri May 26 14:04:42 2017 +0200

    plugin taskboard: numerous fixes when referenced artifact tracker is deleted

diff --git a/src/plugins/taskboard/common/TaskBoard.class.php b/src/plugins/taskboard/common/TaskBoard.class.php
index 5200c1d..be80ea7 100644
--- a/src/plugins/taskboard/common/TaskBoard.class.php
+++ b/src/plugins/taskboard/common/TaskBoard.class.php
@@ -567,7 +567,7 @@ class TaskBoard extends FFError {
 	 * @return	array
 	 */
 	function getUserStories($release = NULL, $assigned_to = NULL) {
-		$stories=array(
+		$stories = array(
 			'0' => array(
 				'id' => 0,
 				'title' => _('Unlinked tasks'),
@@ -581,6 +581,10 @@ class TaskBoard extends FFError {
 			$tasks_trackers = $this->getUsedTrackersData();
 			foreach($tasks_trackers as $tasks_tracker_data) {
 				$tasks = $this->TrackersAdapter->getTasks($tasks_tracker_data['group_artifact_id'], $assigned_to, NULL, NULL);
+				if (!$tasks) {
+					$this->setError($this->TrackersAdapter->getErrorMessage());
+					return false;
+				}
 				foreach($tasks as $task) {
 					$task_maped = $this->getMappedTask($task);
 					if ($task_maped['user_story']==0) {
diff --git a/src/plugins/taskboard/common/TaskBoardRelease.class.php b/src/plugins/taskboard/common/TaskBoardRelease.class.php
index 49b8f94..e0ae515 100644
--- a/src/plugins/taskboard/common/TaskBoardRelease.class.php
+++ b/src/plugins/taskboard/common/TaskBoardRelease.class.php
@@ -250,8 +250,7 @@ class TaskBoardRelease extends FFError {
 	 */
 	function getVolume() {
 		$user_stories = $this->Taskboard->getUserStories($this->getTitle());
-		$columns = $this->Taskboard->getColumns($this->getTitle());
-
+		$columns = $this->Taskboard->getColumns();
 		$_columns_num = count($columns);
 		$ret = array(
 			'user_stories' => 0,
@@ -264,6 +263,11 @@ class TaskBoardRelease extends FFError {
 			'completed_man_days'=> 0,
 		);
 
+		if (!$user_stories) {
+			$this->setError($this->Taskboard->getErrorMessage());
+			return false;
+		}
+
 		foreach( $user_stories as $us ) {
 			$completed_us = true;
 
diff --git a/src/plugins/taskboard/common/adapters/TaskBoardBasicAdapter.class.php b/src/plugins/taskboard/common/adapters/TaskBoardBasicAdapter.class.php
index 5922c82..d0ddb9d 100644
--- a/src/plugins/taskboard/common/adapters/TaskBoardBasicAdapter.class.php
+++ b/src/plugins/taskboard/common/adapters/TaskBoardBasicAdapter.class.php
@@ -25,7 +25,7 @@ require_once $gfcommon.'tracker/ArtifactTypeFactory.class.php';
 require_once $gfcommon.'tracker/ArtifactFactory.class.php';
 require_once $gfcommon.'tracker/ArtifactExtraField.class.php';
 
-class TaskBoardBasicAdapter {
+class TaskBoardBasicAdapter extends FFError {
 	/**
 	 * The TaskBoard object.
 	 *
@@ -90,9 +90,11 @@ class TaskBoardBasicAdapter {
 		$at = $this->getUserStoriesTracker();
 		$af = new ArtifactFactory($at);
 		if (!$af || !is_object($af)) {
-			exit_error('Error','Could Not Get Factory');
+			$this->setError('Could Not Get Factory');
+			return false;
 		} elseif ($af->isError()) {
-			exit_error('Error',$af->getErrorMessage());
+			$this->setError($af->getErrorMessage());
+			return false;
 		}
 
 		$_status = 1;
@@ -204,9 +206,11 @@ class TaskBoardBasicAdapter {
 		if ($at) {
 			$af = new ArtifactFactory($at);
 			if (!$af || !is_object($af)) {
-				exit_error('Error','Could Not Get Factory');
+				$this->setError('Could Not Get Factory');
+				return false;
 			} elseif ($af->isError()) {
-				exit_error('Error',$af->getErrorMessage());
+				$this->setError($af->getErrorMessage());
+				return false;
 			}
 
 			$_status = 1;
diff --git a/src/plugins/taskboard/common/views/ind.php b/src/plugins/taskboard/common/views/ind.php
index e07e41f..0237f2e 100644
--- a/src/plugins/taskboard/common/views/ind.php
+++ b/src/plugins/taskboard/common/views/ind.php
@@ -29,7 +29,7 @@ require_once $gfplugins.'taskboard/common/include/TaskBoardFactoryHtml.class.php
 
 $taskboardFactory = new TaskBoardFactoryHtml($group);
 if (!$taskboardFactory || !is_object($taskboardFactory) || $taskboardFactory->isError()) {
-	exit_error(_('Could Not Get TaskBoardFactory'),'taskboard');
+	exit_error(_('Could Not Get TaskBoardFactory'), 'taskboard');
 }
 //$group_id = $group->getID();
 $tb_arr = $taskboardFactory->getTaskboards();
diff --git a/src/plugins/taskboard/common/views/releases/burndown.php b/src/plugins/taskboard/common/views/releases/burndown.php
index ee86cd1..43116df 100644
--- a/src/plugins/taskboard/common/views/releases/burndown.php
+++ b/src/plugins/taskboard/common/views/releases/burndown.php
@@ -2,6 +2,7 @@
 /**
  * Copyright (C) 2015 Vitaliy Pylypiv <vitaliy.pylypiv at gmail.com>
  * Copyright 2016, St├ęphane-Eymeric Bredtthauer - TrivialDev
+ * Copyright 2017, Franck Villaume - TrivialDev
  *
  * This file is part of FusionForge.
  *
@@ -24,7 +25,7 @@ global $group_id, $group, $taskboard;
 
 $release_id = getIntFromRequest('release_id', NULL);
 
-$release = new TaskBoardRelease( $taskboard, $release_id );
+$release = new TaskBoardRelease($taskboard, $release_id);
 
 html_use_jqueryjqplotpluginCanvas();
 html_use_jqueryjqplotplugindateAxisRenderer();
@@ -45,16 +46,21 @@ if ($taskboard->isError()) {
 	echo html_e('div', array('id' => 'messages', 'style' => 'display: none;'), '', false);
 }
 
+
 // $xaxisData is used to have an every date on the X axis
 $xaxisData = array();
 $chartDate = $release->getStartDate();
-while( $chartDate <= $release->getEndDate() ) {
-	$xaxisData[] = array(  date( 'r', $chartDate) , 0);
+while($chartDate <= $release->getEndDate()) {
+	$xaxisData[] = array(date( 'r', $chartDate) , 0);
 	$chartDate += 86400;
 }
 
 $release_volume = $release->getVolume();
 
+if (!$release_volume) {
+	echo $HTML->error_msg($taskboard->getErrorMessage());
+}
+
 // ideal burndown
 $dataIdeal = array(
 	array( $release->getStartDate() * 1000,  $release_volume['tasks']),
@@ -65,19 +71,17 @@ $release_snapshots = $release->getSnapshots();
 $dataRemainingTasks = array();
 $dataRemainingEfforts = array();
 
-foreach( $release_snapshots as $snapshot ) {
-	if( count($dataRemainingTasks) == 0 && $snapshot['snapshot_date'] != $release->getStartDate() ) {
+foreach ($release_snapshots as $snapshot) {
+	if (count($dataRemainingTasks) == 0 && $snapshot['snapshot_date'] != $release->getStartDate()) {
 		// initialize start point if snapshot is missing for the first day
-		$dataRemainingTasks[] = array( $release->getStartDate() * 1000, $release_volume['tasks'] );
-		$dataRemainingEfforts[] = array( $release->getStartDate() * 1000, $release_volume['man_days'] );
+		$dataRemainingTasks[] = array($release->getStartDate() * 1000, $release_volume['tasks']);
+		$dataRemainingEfforts[] = array($release->getStartDate() * 1000, $release_volume['man_days']);
 	}
 
-	$dataRemainingTasks[] = array( $snapshot['snapshot_date'] * 1000, ( $release_volume['tasks'] - $snapshot['completed_tasks'] ) );
-	$dataRemainingEfforts[] = array( $snapshot['snapshot_date'] * 1000, ( $release_volume['man_days'] -  $snapshot['completed_man_days'] ) );
+	$dataRemainingTasks[] = array($snapshot['snapshot_date'] * 1000, ($release_volume['tasks'] - $snapshot['completed_tasks']));
+	$dataRemainingEfforts[] = array($snapshot['snapshot_date'] * 1000, ($release_volume['man_days'] - $snapshot['completed_man_days']));
 }
 
-
-
 ?>
 <div id="taskboard-burndown-chart-nav">
 	<button id="taskboard-view-btn"><?php echo _('Task Board'); ?></button>
@@ -85,21 +89,21 @@ foreach( $release_snapshots as $snapshot ) {
 </div>
 
 <figure>
-	<figcaption><?php echo  _("Burndown chart") . ' : ' . $release->getTitle() ?></figcaption>
+	<figcaption><?php echo  _("Burndown chart")._(': ').$release->getTitle() ?></figcaption>
 	<div id="taskboard-burndown-chart">
 	</div>
 </figure>
 
 <script>
 	var burndownChart;
-	var xaxisData = <?php echo json_encode( $xaxisData ); ?>;
-	var dataRemainingTasks = <?php echo json_encode( $dataRemainingTasks ); ?>;
-	var dataRemainingEfforts = <?php echo json_encode( $dataRemainingEfforts ); ?>;
-	var dataRemainingIdeal = <?php echo json_encode( $dataIdeal ); ?>;
+	var xaxisData = <?php echo json_encode($xaxisData); ?>;
+	var dataRemainingTasks = <?php echo json_encode($dataRemainingTasks); ?>;
+	var dataRemainingEfforts = <?php echo json_encode($dataRemainingEfforts); ?>;
+	var dataRemainingIdeal = <?php echo json_encode($dataIdeal); ?>;
 
 	jQuery( document ).ready(function( $ ) {
 		jQuery('#taskboard-view-btn').click( function ( e ) {
-			window.location = '<?php echo util_make_url ('/plugins/'.$pluginTaskboard->name.'/?group_id='.$group_id.'&taskboard_id='.$taskboard->getID().'&_release='.$release_id ); ?>';
+			window.location = '<?php echo util_make_url('/plugins/'.$pluginTaskboard->name.'/?group_id='.$group_id.'&taskboard_id='.$taskboard->getID().'&_release='.$release_id ); ?>';
 			e.preventDefault();
 		});
 
diff --git a/src/plugins/taskboard/common/views/releases/ind.php b/src/plugins/taskboard/common/views/releases/ind.php
index 4065394..c1369f6 100644
--- a/src/plugins/taskboard/common/views/releases/ind.php
+++ b/src/plugins/taskboard/common/views/releases/ind.php
@@ -22,6 +22,17 @@
 
 global $taskboard, $group, $group_id, $pluginTaskboard, $HTML;
 
+if (!$taskboard->getReleaseField()) {
+	exit_error(_('Release field is not configured'));
+}
+
+$taskboard_id = $taskboard->getID();
+$taskboardReleases = $taskboard->getReleases();
+
+if ($taskboardReleases === false) {
+	exit_error($taskboard->getErrorMessage());
+}
+
 $taskboard->header(
 	array(
 		'title' => $taskboard->getName()._(': ')._('Releases'),
@@ -31,23 +42,14 @@ $taskboard->header(
 	)
 );
 
-?>
+echo html_e('link', array('rel' => 'stylesheet', 'type' => 'text/css', 'href' => util_make_uri('/plugins/'.$pluginTaskboard->name.'/css/agile-board.css')));
 
-<link rel="stylesheet" type="text/css" href="/plugins/taskboard/css/agile-board.css">
+?>
 
 <div id="messages" class="warning" style="display: none;"></div>
 <br/>
 <?php
-if (!$taskboard->getReleaseField()) {
-	exit_error(_('Release field is not configured'));
-}
 
-$taskboard_id = $taskboard->getID();
-$taskboardReleases = $taskboard->getReleases();
-
-if ($taskboardReleases === false) {
-	exit_error($taskboard->getErrorMessage());
-}
 
 echo html_e('p', array(), util_make_link('/plugins/'.$pluginTaskboard->name.'/releases/?group_id='.$group_id.'&taskboard_id='.$taskboard_id.'&view=add_release', html_e('strong', array(), _('Add release'))));
 
@@ -79,7 +81,7 @@ foreach ($taskboardReleases as $release) {
 		<td>'.date("Y-m-d", $release->getEndDate()).'</td>
 		<td>'.htmlspecialchars( $release->getGoals() ).'</td>
 		<td>'. ( $release->getPageUrl() ? '<a href="'.$release->getPageUrl().'" target="_blank">'.htmlspecialchars( $release->getPageUrl() ).'</a>' : '' ).'</td>
-		<td><a href="/plugins/'.$pluginTaskboard->name.'/releases/?group_id='.$group_id.'&taskboard_id='.$taskboard_id.'&release_id='.$release->getID().'&view=burndown">'._('Burndown').'</a>'.'</td>
+		<td>'. util_make_link('/plugins/'.$pluginTaskboard->name.'/releases/?group_id='.$group_id.'&taskboard_id='.$taskboard_id.'&release_id='.$release->getID().'&view=burndown', _('Burndown')).'</td>
 	</tr>
 	';
 }
diff --git a/src/plugins/taskboard/www/releases/index.php b/src/plugins/taskboard/www/releases/index.php
index 10b6dea..ea2a590 100644
--- a/src/plugins/taskboard/www/releases/index.php
+++ b/src/plugins/taskboard/www/releases/index.php
@@ -22,8 +22,6 @@
 
 require_once '../../../env.inc.php';
 require_once $gfcommon.'include/pre.php';
-
-global $gfplugins;
 require_once $gfplugins.'taskboard/common/include/TaskBoardHtml.class.php';
 
 $group_id = getIntFromRequest('group_id');
@@ -55,7 +53,7 @@ if (!$group_id) {
 		$allowedViews = array('add_release', 'delete_release', 'edit_release', 'burndown');
 		$view = getStringFromRequest('view');
 
-		if( in_array($view, $allowedViews) ) {
+		if (in_array($view, $allowedViews)) {
 			include($gfplugins.$pluginTaskboard->name.'/common/views/releases/'.$view.'.php' );
 		} else {
 			include($gfplugins.$pluginTaskboard->name.'/common/views/releases/ind.php' );

https://scm.fusionforge.org/anonscm/gitweb/?p=fusionforge/fusionforge.git;a=commitdiff;h=8bfe413fccdb0e392eb6ee8315ea231a791cfaf8

commit 8bfe413fccdb0e392eb6ee8315ea231a791cfaf8
Author: Franck Villaume <franck.villaume at trivialdev.com>
Date:   Fri May 26 13:21:00 2017 +0200

    fix HTML syntax & clean-up

diff --git a/src/plugins/taskboard/common/views/taskboard.php b/src/plugins/taskboard/common/views/taskboard.php
index 0819353..0448bea 100644
--- a/src/plugins/taskboard/common/views/taskboard.php
+++ b/src/plugins/taskboard/common/views/taskboard.php
@@ -130,16 +130,13 @@ if ($taskboard->getReleaseField()) {
 			$release_name_arr[] = $release_name;
 		}
 
-		$release_box=html_build_select_box_from_arrays ($release_id_arr,$release_name_arr,'_release',$current_release_title, false, 'none', true);
+		$release_box = html_build_select_box_from_arrays ($release_id_arr, $release_name_arr, '_release', $current_release_title, false, 'none', true);
 	}
 }
 
-$colspan=0;
+$colspan = 0;
 if ($release_box) {
 	$colspan = 2;
-	if ( forge_check_perm('tracker_admin', $group_id ) ) {
-		$colspan = 3;
-	}
 }
 ?>
 
@@ -202,7 +199,7 @@ if ($release_box) {
 			</td>
 		</tr>
 		<tr class="middle">
-			<td>
+			<td colspan="2">
 				<?php
 					echo html_build_checkbox('hide-unlinked-task-chk', false, false);
 					echo html_e('label', array('for'=>'hide-unlinked-task-chk'), _('Hide unlinked tasks'));
@@ -281,7 +278,7 @@ var gGroupId = <?php echo $group_id ?>;
 var gTaskboardId = <?php echo $taskboard_id ?>;
 var gIsManager = <?php echo ( $taskboard->TrackersAdapter->isManager() ? 'true' : 'false' ) ?>;
 var gIsTechnician = <?php echo ( $taskboard->TrackersAdapter->isTechnician() ? 'true' : 'false' ) ?>;
-var gAjaxUrl = '<?php echo util_make_url ('/plugins/'.$pluginTaskboard->name.'/ajax.php') ; ?>';
+var gAjaxUrl = '<?php echo util_make_url('/plugins/'.$pluginTaskboard->name.'/ajax.php') ?>';
 var gMessages = {
 	'notasks' : "<?php echo _('There are no tasks found.') ?>",
 	'progressByTasks' : "<?php echo _('Progress by tasks') ?>",
@@ -303,9 +300,9 @@ var gThemeRoot = "<?php echo $HTML->imgroot ?>";
 		);
 	}
 ?>
-var gReleases = <?php echo json_encode($releases) ;?>
+var gReleases = <?php echo json_encode($releases) ?>
 
-bShowUserStories = <?php echo $taskboard->getUserStoriesTrackerID() ? 'true' : 'false' ?>;
+bShowUserStories = <?php echo ( $taskboard->getUserStoriesTrackerID() ? 'true' : 'false' ) ?>;
 aUserStories = [];
 aPhases = []
 
@@ -438,7 +435,7 @@ jQuery( document ).ready(function( $ ) {
 
 		e.preventDefault();
 	});
-	<?php }?>
+	<?php } ?>
 
 
 	<?php } ?>

https://scm.fusionforge.org/anonscm/gitweb/?p=fusionforge/fusionforge.git;a=commitdiff;h=7c8314751d000d902f287737a800edfb12f15eb1

commit 7c8314751d000d902f287737a800edfb12f15eb1
Author: Franck Villaume <franck.villaume at trivialdev.com>
Date:   Fri May 26 13:13:12 2017 +0200

    use CSS & missing translation

diff --git a/src/plugins/hudson/include/hudsonViews.class.php b/src/plugins/hudson/include/hudsonViews.class.php
index a62b743..cedc26a 100644
--- a/src/plugins/hudson/include/hudsonViews.class.php
+++ b/src/plugins/hudson/include/hudsonViews.class.php
@@ -339,18 +339,18 @@ class hudsonViews extends Views {
 					} else {
 						echo '  <td> </td>';
 					}
-					echo '  <td align="center"><a href="'.$job->getUrl().'/rssAll" onclick="toggle_iframe(this); return false;"><img src="'.$this->getControler()->getIconsPath().'rss_feed.png" alt="'.vsprintf(_("RSS feed of all builds for %s job"),  array($row['name'])).'" title="'.vsprintf(_("RSS feed of all builds for %s job"),  array($row['name'])).'" /></a></td>'."\n";
+					echo '  <td class="align-center"><a href="'.$job->getUrl().'/rssAll" onclick="toggle_iframe(this); return false;"><img src="'.$this->getControler()->getIconsPath().'rss_feed.png" alt="'.vsprintf(_("RSS feed of all builds for %s job"),  array($row['name'])).'" title="'.vsprintf(_("RSS feed of all builds for %s job"),  array($row['name'])).'" /></a></td>'."\n";
 
 					if ($project->usesService('svn')) {
 						if ($row['use_svn_trigger'] == 1) {
-							echo '  <td align="center"><img src="'.$this->getControler()->getIconsPath().'server_lightning.png" alt="'._("SVN commit will trigger a build").'" title="'._("SVN commit will trigger a build").'" /></td>';
+							echo '  <td class="align-center"><img src="'.$this->getControler()->getIconsPath().'server_lightning.png" alt="'._("SVN commit will trigger a build").'" title="'._("SVN commit will trigger a build").'" /></td>';
 						} else {
 							echo '  <td> </td>';
 						}
 					}
 					if ($project->usesService('cvs')) {
 						if ($row['use_cvs_trigger'] == 1) {
-							echo '  <td align="center"><img src="'.$this->getControler()->getIconsPath().'server_lightning.png" alt="'._("CVS commit will trigger a build").'" title="'._("CVS commit will trigger a build").'" /></td>';
+							echo '  <td class="align-center"><img src="'.$this->getControler()->getIconsPath().'server_lightning.png" alt="'._("CVS commit will trigger a build").'" title="'._("CVS commit will trigger a build").'" /></td>';
 						} else {
 							echo '  <td> </td>';
 						}
@@ -431,7 +431,7 @@ class hudsonViews extends Views {
 			//echo '  </p>';
 			echo '   <br />';
 		}
-		echo '   <input type="submit" value="Add job" />';
+		echo '   <input type="submit" value="'._('Add job').'" />';
 		echo ' </form>';
 		echo '</div>';
 		//echo "<script type=\"text/javascript\">jQuery('#hudson_add_job').slideToggle();</script>\n";

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

Summary of changes:
 src/plugins/hudson/include/hudsonViews.class.php   |  8 ++---
 src/plugins/taskboard/common/TaskBoard.class.php   |  6 +++-
 .../taskboard/common/TaskBoardRelease.class.php    |  8 +++--
 .../adapters/TaskBoardBasicAdapter.class.php       | 14 +++++---
 src/plugins/taskboard/common/views/ind.php         |  2 +-
 .../taskboard/common/views/releases/burndown.php   | 38 ++++++++++++----------
 .../taskboard/common/views/releases/ind.php        | 26 ++++++++-------
 src/plugins/taskboard/common/views/taskboard.php   | 17 ++++------
 src/plugins/taskboard/www/releases/index.php       |  4 +--
 9 files changed, 68 insertions(+), 55 deletions(-)


hooks/post-receive
-- 
FusionForge



More information about the Fusionforge-commits mailing list