[Fusionforge-commits] FusionForge branch feature/taskboard-plugin updated. 3bfd9fc674c6bf3722f8a03de404612c60a50641

Franck Villaume nerville at fusionforge.org
Wed Mar 11 19:20:51 CET 2015


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, feature/taskboard-plugin has been updated
       via  3bfd9fc674c6bf3722f8a03de404612c60a50641 (commit)
      from  c350c08cab8c889c76af8ffbf9e0cdefabd57996 (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 3bfd9fc674c6bf3722f8a03de404612c60a50641
Author: Vitaliy Pylypiv <pylypiv at integramedia.eu>
Date:   Mon Mar 9 18:48:06 2015 +0200

    Fixes after 6.0 migration. Only artifact title now is shown on the card.

diff --git a/src/plugins/taskboard/common/TaskBoard.class.php b/src/plugins/taskboard/common/TaskBoard.class.php
index 8f3c2d4..de4cf0f 100644
--- a/src/plugins/taskboard/common/TaskBoard.class.php
+++ b/src/plugins/taskboard/common/TaskBoard.class.php
@@ -315,7 +315,7 @@ class TaskBoard extends Error {
 	function fetchDataByGroup() {
 		$res = db_query_params('SELECT * FROM plugin_taskboard WHERE group_id=$1', array ($this->Group->getID()));
 		if (!$res || db_numrows($res) < 1) {
-			$this->setError(_('TaskBoard')._(': ')._('Not configured for this project yet.'));
+			$this->setError(_('TaskBoard')._(': ')._('Not configured for this project yet. Please, initialize plugin on the plugin admin page.'));
 			return false;
 		}
 		$this->data_array = db_fetch_array($res);
@@ -986,16 +986,21 @@ class TaskBoard extends Error {
 	 * @return	array
 	 */
 	function getUnusedResolutions() {
-		$all_resolutions = $this->getAvailableResolutions();
-		$used_resolutions = $this->getUsedResolutions();
-
-		$resolutions = array();
-		if( $all_resolutions && count( $used_resolutions ) > 0 ) {
-			$resolutions = array_diff( $all_resolutions, $used_resolutions );
-		} else {
-			$resolutions = $all_resolutions;
+		static $resolutions = NULL;
+		
+		if( !$resolutions ) {
+			$all_resolutions = $this->getAvailableResolutions();
+			$used_resolutions = $this->getUsedResolutions();
+	
+			$resolutions = array();
+			if( $all_resolutions && count( $used_resolutions ) > 0 ) {
+				$resolutions = array_diff( $all_resolutions, $used_resolutions );
+			} else {
+				$resolutions = $all_resolutions;
+			}
 		}
 
+
 		return $resolutions;
 	}
 }
diff --git a/src/plugins/taskboard/common/actions/edit_column.php b/src/plugins/taskboard/common/actions/edit_column.php
index 19c9d77..8259cdd 100644
--- a/src/plugins/taskboard/common/actions/edit_column.php
+++ b/src/plugins/taskboard/common/actions/edit_column.php
@@ -58,4 +58,4 @@ if (getStringFromRequest('post_changes')) {
 		session_redirect('/plugins/'.$pluginTaskboard->name.'/admin/?group_id='.$group_id.'&view=edit_column&column_id='.$column_id);
 	}
 }
-session_redirect('/plugins/'.$pluginTaskboard->name.'/admin/?group_id='.$group_id);
+session_redirect('/plugins/'.$pluginTaskboard->name.'/admin/?group_id='.$group_id.'&view=columns');
diff --git a/src/plugins/taskboard/common/views/admin/columns.php b/src/plugins/taskboard/common/views/admin/columns.php
index ee1555a..c3035c0 100644
--- a/src/plugins/taskboard/common/views/admin/columns.php
+++ b/src/plugins/taskboard/common/views/admin/columns.php
@@ -54,7 +54,7 @@ if (count($taskboard->getUsedTrackersIds()) == 0) {
 		$cells[][] = html_e('div', array('style' => 'float: left; border: 1px solid grey; height: 30px; width: 20px; background-color: '.$column->getColumnBackgroundColor().'; margin-right: 10px;'), html_e('div', array('style' => 'width: 100%; height: 10px; background-color: '.$column->getTitleBackgroundColor()), '', false)).
 					util_make_link('/plugins/'.$pluginTaskboard->name.'/admin/?group_id='.$group_id.'&view=edit_column&column_id='.$column->getID(),
 					$column->getTitle());
-		$cells[][] = $column->getMaxTasks();
+		$cells[][] = ( $column->getMaxTasks() ? $column->getMaxTasks() : ' ' );
 		$cells[][] = implode(', ', array_values($column->getResolutions()));
 		$cells[][] = $column->getResolutionByDefault();
 		echo $HTML->multiTableRow(array('valign' => 'middle'), $cells);
@@ -83,7 +83,8 @@ if (count($taskboard->getUsedTrackersIds()) == 0) {
 	echo $HTML->multiTableRow(array(), $cells);
 	$cells = array();
 	$cells[][] = html_e('strong', array(), _('Drop resolution by default').utils_requiredField()._(':'));
-	$cells[][] = html_build_select_box_from_arrays($taskboard->getUnusedResolutions(), $taskboard->getUnusedResolutions(), 'resolution');
+	$unused_resolutions = array_values( $taskboard->getUnusedResolutions() );	
+	$cells[][] = html_build_select_box_from_arrays( $unused_resolutions, $unused_resolutions, 'resolution_by_default', NULL, false);
 	echo $HTML->multiTableRow(array(), $cells);
 	echo $HTML->listTableBottom();
 	echo html_e('p', array(), html_e('input', array('type' => 'submit', 'name' => 'post_changes', 'value' => _('Submit'))));
diff --git a/src/plugins/taskboard/common/views/admin/delete_column.php b/src/plugins/taskboard/common/views/admin/delete_column.php
index 025fa12..a6bc3b6 100644
--- a/src/plugins/taskboard/common/views/admin/delete_column.php
+++ b/src/plugins/taskboard/common/views/admin/delete_column.php
@@ -38,13 +38,13 @@ $taskboard->header(
 if($taskboard->isError()) {
 	echo $HTML->error_msg($taskboard->getErrorMessage());
 } else {
-	echo $html_e('div', array('id' => 'messages', 'style' => 'display: none;'), '', false);
+	echo html_e('div', array('id' => 'messages', 'style' => 'display: none;'), '', false);
 }
 
 echo $HTML->openForm(array('action' => '/plugins/'.$pluginTaskboard->name.'/admin/?group_id='.$group_id.'&action=delete_column', 'method' => 'post'));
 echo html_e('input', array('type' => 'hidden', 'name' => 'column_id', 'value' => $column_id));
 echo html_e('h1', array(), _('Column')." '".$column->getTitle() ."'");
 echo html_e('div', array(), _('You are about to permanently and irretrievably delete this column!'));
-echo html_e('div', array(), html_e('input', array('type' => 'checkbox', 'value' => 'y', 'name' => 'confirmed')), ._('I am Sure'));
+echo html_e('div', array(), html_e('input', array('type' => 'checkbox', 'value' => 'y', 'name' => 'confirmed')), _('I am Sure'));
 echo html_e('p', array(), html_e('input', array('type' => 'submit', 'name' => 'post_delete', 'value' => _('Delete'))));
 echo $HTML->closeForm();
diff --git a/src/plugins/taskboard/common/views/admin/edit_column.php b/src/plugins/taskboard/common/views/admin/edit_column.php
index 9540053..480dfa0 100644
--- a/src/plugins/taskboard/common/views/admin/edit_column.php
+++ b/src/plugins/taskboard/common/views/admin/edit_column.php
@@ -94,7 +94,8 @@ if ($column_id) {
 		echo $HTML->multiTableRow(array(), $cells);
 		$cells = array();
 		$cells[][] = html_e('strong', array(), _('Alert message'));
-		$cells[][] = html_e('textarea', array('name' => 'alert', 'cols' => 79, 'rows' => 5), htmlspecialchars($drop_rules_by_default->getAlertText()));
+		error_log($drop_rules_by_default->getAlertText());
+		$cells[][] = html_e('textarea', array('name' => 'alert', 'cols' => 79, 'rows' => 5), htmlspecialchars($drop_rules_by_default->getAlertText()), false);
 		echo $HTML->multiTableRow(array(), $cells);
 		echo $HTML->listTableBottom();
 		echo html_e('p', array(), html_e('input', array('type' => 'submit', 'name' => 'post_changes', 'value' => _('Submit'))));
@@ -112,9 +113,13 @@ jQuery(function($){
 
 		var str = '';
 		$('input:checked[name="resolutions[]"]').each( function(i, e) {
-			str +='<option value="'+ e.value +'"'+ ( e.value == selected ? 'selected' : '' ) +'>'+ e.value +'</option>';
+			if( e.value ) {
+				str +='<option value="'+ e.value +'"'+ ( e.value == selected ? 'selected' : '' ) +'>'+ e.value +'</option>';
+			}
 		});
-		$('select[name=' + select_name + ']').empty().html(str);
+		if( str ) {
+			$('select[name=' + select_name + ']').empty().html(str);
+		}
 	}
 
 
diff --git a/src/plugins/taskboard/common/views/admin/trackers.php b/src/plugins/taskboard/common/views/admin/trackers.php
index 72933a0..9e115d3 100644
--- a/src/plugins/taskboard/common/views/admin/trackers.php
+++ b/src/plugins/taskboard/common/views/admin/trackers.php
@@ -93,6 +93,7 @@ if (!$atf || !is_object($atf) || $atf->isError()) {
 			echo $HTML->error_msg(_('There are no any tracker having "resolution" field.'));
 		}
 
+
 		echo html_e('script', array('type' => 'text/javascript', 'src' => '/plugins/'.$pluginTaskboard->name.'/js/agile-board.js'), '', false);
 		echo $HTML->openForm(array('action' => '/plugins/'.$pluginTaskboard->name.'/admin/?group_id='.$group_id.'&action=trackers', 'method' => 'post'));
 		echo html_e('input', array('type' => 'hidden', 'name' => 'post_changes', 'value' => 'y'));
@@ -130,7 +131,7 @@ if (!$atf || !is_object($atf) || $atf->isError()) {
 		$innercells[][] = html_e('select', array('name' => 'user_stories_tracker'), html_e('option', array('value' => ''), _('Not defined')));
 		$content .= $HTML->multiTableRow(array(), $innercells);
 		$innercells = array();
-		$innercells[][] = html_e('strong', array(), _('User stories reference field')).' '.html_e('span', array('id' => 'usrefreq', 'style' => (!$user_stories_tracker) ? 'display: none;' : '' ), '', false).utils_requiredField();
+		$innercells[][] = html_e('strong', array(), _('User stories reference field')).' '.html_e('span', array('id' => 'usrefreq', 'style' => (!intval($user_stories_tracker)) ? 'display: none;' : '' ), utils_requiredField(), false);
 		$innercells[][] = html_e('select', array('name' => 'user_stories_reference_field'), html_e('option', array('value' => ''), _('Not defined')));
 		$content .= $HTML->multiTableRow(array(), $innercells);
 		$innercells = array();
diff --git a/src/plugins/taskboard/etc/taskboard.ini b/src/plugins/taskboard/etc/taskboard.ini
index 37e4a66..e7ac718 100644
--- a/src/plugins/taskboard/etc/taskboard.ini
+++ b/src/plugins/taskboard/etc/taskboard.ini
@@ -1,4 +1,4 @@
 [taskboard]
 trackers_adapter_class = TaskBoardBasicAdapter
-plugin_status = 'to be validated by dev'
+plugin_status = valid 
 
diff --git a/src/plugins/taskboard/www/admin/ajax.php b/src/plugins/taskboard/www/admin/ajax.php
index 69e1763..ac4eaa0 100644
--- a/src/plugins/taskboard/www/admin/ajax.php
+++ b/src/plugins/taskboard/www/admin/ajax.php
@@ -20,8 +20,10 @@
  */
 
 global $gfwww;
+global $gfcommon;
 
-require_once $gfwww."env.inc.php";
+require_once '../../../env.inc.php';
+//require_once $gfwww."env.inc.php";
 require_once $gfcommon.'include/pre.php';
 
 global $gfplugins;
diff --git a/src/plugins/taskboard/www/css/agile-board.css b/src/plugins/taskboard/www/css/agile-board.css
index 7066704..beb0d4b 100644
--- a/src/plugins/taskboard/www/css/agile-board.css
+++ b/src/plugins/taskboard/www/css/agile-board.css
@@ -71,6 +71,10 @@
 	box-shadow: 0 4px 8px rgba(0,0,0,0.5);
 }
 
+.agile-sticker textarea{
+	font-size: 10px;
+}
+
 .agile-sticker-header, .agile-sticker-footer {
 	background-color: #AAAAAA;
 	padding: 2px;
@@ -84,6 +88,7 @@
 	padding: 2px;
 	height: 108px;
 	width: 98%;
+	overflow: hidden;
 }
 
 .agile-sticker-user-story {
diff --git a/src/plugins/taskboard/www/js/agile-board.js b/src/plugins/taskboard/www/js/agile-board.js
index 6236961..9b16e81 100644
--- a/src/plugins/taskboard/www/js/agile-board.js
+++ b/src/plugins/taskboard/www/js/agile-board.js
@@ -201,9 +201,9 @@ function drawUserStories() {
 			start=1;
 			l_sHtml += '<td class="agile-phase"><div class="agile-sticker-container">';
 			l_sHtml += '<div class="agile-sticker agile-sticker-user-story" id="user-story-' + us.id + '">';
-			l_sHtml += '<div class="agile-sticker-header"><a href="' + us.url + '" target="_blank">' + us.id + '</a> : <span>' + us.title + "</span>";
+			l_sHtml += '<div class="agile-sticker-header"><a href="' + us.url + '" target="_blank">' + us.id + '</a>';
 			l_sHtml += '<div style="float: right";>[<a href="" class="agile-toolbar-add-task" user_story_id="' +us.id+ '">+</a>]</div></div>\n';
-			l_sHtml += '<div class="agile-sticker-body">' + us.description + "</div>\n";
+			l_sHtml += '<div class="agile-sticker-body">' + us.title + "</div>\n";
 			l_sHtml += "</div>\n";
 			l_sHtml += "</td>\n";
 		}
@@ -386,9 +386,9 @@ function drawTasks( oUserStory, sPhaseId ) {
 			l_sHtml += '<div class="agile-sticker-container">';
 			l_sHtml += '<div class="agile-sticker agile-sticker-task agile-sticker-task-' + tsk.user_story + '" id="task-' + tsk.id + '" >';
 			l_sHtml += '<div class="agile-sticker-header" style="background-color: ' + tsk.background + ';">';
-			l_sHtml += '<a href="' + tsk.url  +  '" target="_blank">' + tsk.id + '</a> : <span>' + tsk.title + '</span>';
+			l_sHtml += '<a href="' + tsk.url  +  '" target="_blank">' + tsk.id + '</a>';
 			l_sHtml += "</div>\n";
-			l_sHtml += '<div class="agile-sticker-body">' + tsk.description + '</div>';
+			l_sHtml += '<div class="agile-sticker-body">' + tsk.title + '</div>';
  			l_sHtml += "</div></div>\n";
 		}
 	}
@@ -420,92 +420,31 @@ function initEditable() {
 		return;
 	}
 
-	// title
-	jQuery("div.agile-sticker-header span").dblclick( function () {
-		if( jQuery(this).children('input').length == 0 ) {	
-			jQuery('#text_description').trigger('focusout');
-			jQuery('#text_title').trigger('focusout');
-
-
-			var l_oTitle = jQuery(this);
-			var l_sTitle = l_oTitle.text();
-			var l_nTaskId = jQuery(this).parent().parent().data('task_id');
-
-			jQuery(this).html( '<input id="text_title" name="title" type="text">');
-			jQuery('#text_title')
-				.val( l_sTitle )
-				.css('width', '80%')
-				.focus()
-				.focusout(function() {
-					l_oTitle.text( l_sTitle );
-				}) ;
-
-			jQuery('#text_title').keydown(function(e) {
-				if( e.keyCode == 27 ) {
-					// ESC == cancel
-					l_oTitle.text( l_sTitle );
-					e.preventDefault();
-				} else if ( e.keyCode == 13 && !e.shiftKey) {
-					e.preventDefault();
-					// ENTER - submit
-					var textField = this;
-					jQuery.ajax({
-						type: 'POST',
-						url: gAjaxUrl,
-						dataType: 'json',
-						data : {
-							action   : 'update',
-							group_id : gGroupId,
-							task_id : l_nTaskId,
-							title : jQuery(this).val()
-						},
-						async: true
-					}).done(function( answer ) {
-						if(answer['message']) {
-							showMessage(answer['message'], 'error');
-						}
-
-						if(answer['action'] == 'reload') {
-							// reload whole board
-							loadTaskboard( gGroupId );
-						}
-
-						l_oTitle.text( jQuery(textField).val() );
-					}).fail(function( jqxhr, textStatus, error ) {
-						var err = textStatus + ', ' + error;
-						alert(err);
-					});
-				}
-			});
-		}
-	});
-
 	// description
 	jQuery("div.agile-sticker-body").dblclick( function () {
 		if( jQuery(this).children('textarea').length == 0 ) {
 			// close open textarea
-			jQuery('#text_description').trigger('focusout');
 			jQuery('#text_title').trigger('focusout');
 
 
-			var l_oDesc = jQuery(this);
-			var l_sDescription = l_oDesc.html();
+			var l_oTitle = jQuery(this);
+			var l_sTitle = l_oTitle.html();
 			var l_nTaskId = jQuery(this).parent().data('task_id');
-			jQuery(this).html( '<textarea id="text_description" name="description" rows="11"></textarea>');
+			jQuery(this).html( '<textarea id="text_title" name="title" rows="11"></textarea>');
 
 			
-			jQuery('#text_description')
-				.html( l_sDescription.replace(/<br>/g, "\n") )
+			jQuery('#text_title')
+				.html( l_sTitle.replace(/<br>/g, "\n") )
 				.css('width', '98%')
 				.css('height', '95%')
 				.focus()
 				.focusout(function() {
-					l_oDesc.html( l_sDescription );
+					l_oTitle.html( l_sTitle );
 				}) ;
-			jQuery('#text_description').keydown(function(e) {
+			jQuery('#text_title').keydown(function(e) {
 				if( e.keyCode == 27 ) {
 					// ESC == cancel
-					l_oDesc.html( l_sDescription );
+					l_oTitle.html( l_sTitle );
 					e.preventDefault();
 				} else if ( e.keyCode == 13 && !e.shiftKey) {
 					e.preventDefault();
@@ -519,7 +458,7 @@ function initEditable() {
 							action   : 'update',
 							group_id : gGroupId,
 							task_id : l_nTaskId,
-							desc : jQuery(this).val()
+							title : jQuery(this).val()
 						},
 						async: true 
 					}).done(function( answer ) {
@@ -532,7 +471,7 @@ function initEditable() {
 							loadTaskboard( gGroupId );
 						}
 
-						l_oDesc.html(jQuery(textField).val().replace(/&/g, '&').replace(/</g, '<').replace(/>/g, '>').replace(/\n/g, '<br>') );
+						l_oTitle.html(jQuery(textField).val().replace(/&/g, '&').replace(/</g, '<').replace(/>/g, '>').replace(/\n/g, '<br>') );
 					}).fail(function( jqxhr, textStatus, error ) {
 						var err = textStatus + ', ' + error;
 						alert(err);

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

Summary of changes:
 src/plugins/taskboard/common/TaskBoard.class.php   |   23 +++--
 .../taskboard/common/actions/edit_column.php       |    2 +-
 .../taskboard/common/views/admin/columns.php       |    5 +-
 .../taskboard/common/views/admin/delete_column.php |    4 +-
 .../taskboard/common/views/admin/edit_column.php   |   11 ++-
 .../taskboard/common/views/admin/trackers.php      |    3 +-
 src/plugins/taskboard/etc/taskboard.ini            |    2 +-
 src/plugins/taskboard/www/admin/ajax.php           |    4 +-
 src/plugins/taskboard/www/css/agile-board.css      |    5 ++
 src/plugins/taskboard/www/js/agile-board.js        |   89 +++-----------------
 10 files changed, 53 insertions(+), 95 deletions(-)


hooks/post-receive
-- 
FusionForge



More information about the Fusionforge-commits mailing list