[Fusionforge-commits] FusionForge branch master updated. v6.0.1-144-ga091ba7

Franck Villaume nerville at libremir.placard.fr.eu.org
Tue Jul 14 10:01:35 CEST 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, master has been updated
       via  a091ba7a1c1074673160cdf6416e29cfebf747db (commit)
      from  f70c2a06dedcf1680320b70665152559986179a7 (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=a091ba7a1c1074673160cdf6416e29cfebf747db

commit a091ba7a1c1074673160cdf6416e29cfebf747db
Author: Franck Villaume <franck.villaume at trivialdev.com>
Date:   Tue Jul 14 09:59:56 2015 +0200

    implement [#783]: add capability to edit/add status in PM module

diff --git a/src/common/pm/ProjectTaskFactory.class.php b/src/common/pm/ProjectTaskFactory.class.php
index 5e4a2ae..d450e0b 100644
--- a/src/common/pm/ProjectTaskFactory.class.php
+++ b/src/common/pm/ProjectTaskFactory.class.php
@@ -200,7 +200,7 @@ class ProjectTaskFactory extends Error {
 							array ($this->ProjectGroup->getID()));
 		}
 
-		if ($this->status == 1 || $this->status == 2 || $this->status == 3) {
+		if ($this->status && ($this->status != 100)) {
 			$qpa = db_construct_qpa($qpa, ' AND project_task_vw.status_id = $1 ', array($this->status));
 		}
 
diff --git a/src/common/reporting/ReportSetup.class.php b/src/common/reporting/ReportSetup.class.php
index 1fac1d1..925b25a 100644
--- a/src/common/reporting/ReportSetup.class.php
+++ b/src/common/reporting/ReportSetup.class.php
@@ -3,6 +3,7 @@
  * FusionForge reporting system
  *
  * Copyright 2003-2004, Tim Perdue/GForge, LLC
+ * Copyright 2015, nitendra tripathi
  *
  * This file is part of FusionForge. FusionForge is free software;
  * you can redistribute it and/or modify it under the terms of the
@@ -1369,6 +1370,32 @@ class ReportSetup extends Report {
 				array($category_name,
 				$time_code));
 	}
+
+
+
+	/**
+	 * Add a row to the project_status table.
+	 *
+	 *	@param	string	$status_name The Status name.
+	 *	@return	boolean	Success.
+	 */
+	function addStatusId($status_name) {
+		return db_query_params ('INSERT INTO project_status (status_name) VALUES ($1)',
+			array($status_name));
+	}
+
+	/**
+	 * Update the project_status table.
+	 *
+	 *	@param	integer	$status_id
+	 *	@param	string	$status_name The category name.
+	 *	@return	boolean	Success.
+	 */
+	function updateStatusId($status_id, $status_name) {
+		return db_query_params ('UPDATE project_status SET status_name=$1 WHERE status_id=$2',
+				array($status_name,
+				$status_id));
+	}
 }
 
 // Local Variables:
diff --git a/src/www/pm/browse_task.php b/src/www/pm/browse_task.php
index 4bfeb6b..9e9ab50 100644
--- a/src/www/pm/browse_task.php
+++ b/src/www/pm/browse_task.php
@@ -8,6 +8,7 @@
  * Copyright (C) 2011 Alain Peyrat - Alcatel-Lucent
  * Copyright 2014, Franck Villaume - TrivialDev
  * Copyright 2014, Stéphane-Eymeric Bredthauer
+ * Copyright 2015, nitendra tripathi
  * http://fusionforge.org
  *
  * This file is part of FusionForge. FusionForge is free software;
@@ -240,13 +241,17 @@ if ($rows < 1) {
 		'percent_complete'=>1,
 		'category'=>0,
 		'assigned_to'=>0,
-		'priority'=>0);
+		'priority'=>0,
+		'status' => 1
+		);
 
 	$title_arr=array();
 	$title_arr[] = "";
 	$title_arr[]=_('Task Id');
 	if ($display_col['summary'])
 		$title_arr[]=_('Task Summary');
+	if ($display_col['status'])
+		$title_arr[]=_('Status');
 	if ($display_col['start_date'])
 		$title_arr[]=_('Start Date');
 	if ($display_col['end_date'])
@@ -260,6 +265,7 @@ if ($rows < 1) {
 	if ($display_col['priority'])
 		$title_arr[]=_('Priority');
 
+
 	echo $HTML->listTableTop($title_arr);
 
 	$now=time();
@@ -279,6 +285,8 @@ if ($rows < 1) {
 			$pt_arr[$i]->getID() ."</td>\n";
 		if ($display_col['summary'])
 			echo '<td>'.util_make_link($url,$pt_arr[$i]->getSummary())."</td>\n";
+		if ($display_col['status'])
+			echo '<td>'. $pt_arr[$i]->getStatusName() ."</td>\n";
 		if ($display_col['start_date'])
 			echo '<td>'.date(_('Y-m-d H:i'), $pt_arr[$i]->getStartDate() )."</td>\n";
 		if ($display_col['end_date'])
@@ -309,7 +317,6 @@ if ($rows < 1) {
 			<tr class="priority'.$pt_arr[$i]->getPriority() .'">
 				<td> </td><td colspan="'.(count($title_arr)-1).'">'. nl2br( $pt_arr[$i]->getDetails() ) .'</td>
 			</tr>';
-
 		}
 	}
 
diff --git a/src/www/reporting/customstatus.php b/src/www/reporting/customstatus.php
new file mode 100644
index 0000000..a4ad336
--- /dev/null
+++ b/src/www/reporting/customstatus.php
@@ -0,0 +1,120 @@
+<?php
+/**
+ * Reporting System
+ *
+ * Copyright 2003-2004 (c) GForge LLC
+ * Copyright (C) 2010 Alain Peyrat - Alcatel-Lucent
+ * Copyright 2015, nitendra tripathi
+ * http://fusionforge.org
+ *
+ * This file is part of FusionForge. 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 Licence, or (at your option)
+ * any later version.
+ *
+ * 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, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+
+require_once '../env.inc.php';
+require_once $gfcommon.'include/pre.php';
+require_once $gfcommon.'reporting/report_utils.php';
+require_once $gfcommon.'reporting/ReportSetup.class.php';
+
+session_require_global_perm ('forge_stats', 'admin') ;
+
+$status_id = getIntFromRequest('status_id');
+$status_name = trim(getStringFromRequest('status_name'));
+
+if (getStringFromRequest('submit')) {
+	if (getStringFromRequest('add')) {
+
+		$r = new ReportSetup();
+		if (!$r->addStatusId($status_name)) {
+			$error_msg = $r->getErrorMessage();
+		} else {
+			$feedback = _('Successfully Added');
+		}
+
+	} elseif (getStringFromRequest('update')) {
+
+		$r = new ReportSetup();
+
+		if (!$r->updateStatusID($status_id,$status_name)) {
+			$error_msg = $r->getErrorMessage();
+		} else {
+			$feedback = _('Update Successful');
+		}
+
+		$status_id=false;
+		$status_name='';
+	}
+}
+
+report_header(_('Manage Project Task's Statuses'));
+
+if ($status_id) {
+	$res1=db_query_params ('SELECT * FROM project_status WHERE status_id=$1',
+			array($status_id));
+	$status_name=db_result($res1,0,'status_name');
+}
+$res = db_query_params('SELECT * FROM project_status ORDER BY status_id', array());
+
+$arr[]=_('Status Id');
+$arr[]=_('Status Name');
+
+if ($status_id) {
+	echo '[ <a href="customstatus.php">Add</a> ]';
+}
+
+echo $HTML->listTableTop($arr);
+
+for ($i=0; $i<db_numrows($res); $i++) {
+	echo '<tr '.$HTML->boxGetAltRowStyle($i).'><td>'.db_result($res,$i,'status_id').'</td>
+		<td><a href="customstatus.php?status_id='.db_result($res,$i,'status_id').'">'.db_result($res,$i,'status_name').'</a></td></tr>';
+}
+
+echo $HTML->listTableBottom();
+
+?>
+<p>
+<?php echo _('You can create statuses to classify a particular task's status. Examples of statuses include "Open", "Close", "Deleted".'); ?>
+</p>
+<form action="<?php echo getStringFromServer('PHP_SELF'); ?>" method="post">
+<p>
+<input type="hidden" name="submit" value="1" />
+<input type="hidden" name="status_id" value="<?php echo $status_id; ?>" />
+<label for="status_name">
+<strong><?php echo _('Status Name')._(':'); ?></strong><br />
+<input required="required" type="text" id="status_name" name="status_name"
+	   value="<?php echo $status_name; ?>" />
+</label>
+</p>
+<p>
+<?php
+
+if ($status_id) {
+	echo '<input type="submit" name="update" value="'._('Update').'" />';
+} else {
+	echo '<input type="submit" name="add" value="'._('Add').'" />';
+}
+
+?>
+</p>
+</form>
+
+<?php
+
+report_footer();
+
+// Local Variables:
+// mode: php
+// c-file-style: "bsd"
+// End:
diff --git a/src/www/reporting/index.php b/src/www/reporting/index.php
index a09398d..6413233 100644
--- a/src/www/reporting/index.php
+++ b/src/www/reporting/index.php
@@ -83,6 +83,7 @@ report_header(_('Main Page'));
 <ul>
 <li><a href="rebuild.php"><?php echo _('Initialize / Rebuild Reporting Tables'); ?></a></li>
 <li><a href="timecategory.php"><?php echo _('Manage Time Tracker Categories'); ?></a></li>
+<li><a href="customstatus.php"><?php echo _('Manage Project Task's Statuses'); ?></a></li>
 </ul>
 </div>
 <?php

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

Summary of changes:
 src/common/pm/ProjectTaskFactory.class.php         |  2 +-
 src/common/reporting/ReportSetup.class.php         | 27 ++++++++++++
 src/www/pm/browse_task.php                         | 11 ++++-
 .../{timecategory.php => customstatus.php}         | 51 ++++++++++++----------
 src/www/reporting/index.php                        |  1 +
 5 files changed, 66 insertions(+), 26 deletions(-)
 copy src/www/reporting/{timecategory.php => customstatus.php} (61%)


hooks/post-receive
-- 
FusionForge



More information about the Fusionforge-commits mailing list