[Fusionforge-commits] FusionForge branch Branch_5_3 updated. 5dd62b91cf3f3b127b73e7de0a4d2d03158a6e34

Franck VILLAUME nerville at fusionforge.org
Thu Jan 30 15:56:17 CET 2014


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, Branch_5_3 has been updated
       via  5dd62b91cf3f3b127b73e7de0a4d2d03158a6e34 (commit)
       via  80c541df5c86ea0465e0dba0e4c5c38388d94e30 (commit)
       via  f03b98c0b95f4e63cd7a8bc8a1828ac222147e91 (commit)
       via  fb305ae293389d05632ff11ff1f56e01e8730d00 (commit)
      from  3fd1568049a3f3a1886cf4599863183efdb4da3d (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 5dd62b91cf3f3b127b73e7de0a4d2d03158a6e34
Author: Franck Villaume <franck.villaume at trivialdev.com>
Date:   Thu Jan 30 15:54:02 2014 +0100

    people: ugly hack to handle private project in project opening public page

diff --git a/src/www/people/people_utils.php b/src/www/people/people_utils.php
index bcfe930..a14257c 100644
--- a/src/www/people/people_utils.php
+++ b/src/www/people/people_utils.php
@@ -351,26 +351,51 @@ function people_show_category_table() {
 	//show a list of categories in a table
 	//provide links to drill into a detail page that shows these categories
 
-	$title_arr=array();
-	$title_arr[]=_('Category');
-
-	$return = $GLOBALS['HTML']->listTableTop ($title_arr);
-
-	$result= db_query_params('SELECT pjc.category_id, pjc.name, COUNT(pj.category_id) AS total
-FROM people_job_category pjc LEFT JOIN people_job pj
-ON pjc.category_id=pj.category_id
-WHERE pjc.private_flag=0
-AND (pj.status_id=1 OR pj.status_id IS NULL)
-GROUP BY pjc.category_id, pjc.name', array());
-
-	$rows=db_numrows($result);
-	if (!$result || $rows < 1) {
-		$return .= '<tr><td><h2>'._('No Categories Found').'</h2></td></tr>';
+	$title_arr = array();
+	$title_arr[] = _('Category');
+
+	$result= db_query_params('SELECT pjc.category_id, pjc.name, COUNT(pj.category_id) AS total, pj.group_id
+				FROM people_job_category pjc LEFT JOIN people_job pj
+				ON pjc.category_id=pj.category_id
+				WHERE pjc.private_flag=0
+				AND (pj.status_id=1 OR pj.status_id IS NULL)
+				GROUP BY pjc.category_id, pjc.name, pj.group_id', array());
+
+	$categories = array();
+	$i = 0;
+	while ($arr = db_fetch_array($result)) {
+		$added = 0;
+		if (empty($arr['group_id']) || forge_check_perm('project_read', $arr['group_id'])) {
+			$categories[$i] = $arr;
+			$added = 1;
+		}
+		if ($added && ((count($categories) - 1) > 0)) {
+			for ($j = 0; $j < (count($categories) - 1); $j++) {
+				$found = 0;
+				if ( $categories[$j]['category_id'] == $categories[$i]['category_id'] ) {
+					$categories[$j]['total'] += $categories[$i]['total'];
+					$found = 1;
+					break;
+				}
+			}
+			if ($found) {
+				array_pop($categories);
+				$added = 0;
+				$i--;
+			}
+		}
+		if ($added) {
+			$i++;
+		}
+	}
+	if (count($categories) < 1) {
+		$return = '<p class="warning" >'._('No categories found.').'</p>';
 	} else {
-		for ($i=0; $i<$rows; $i++) {
-			echo db_error();
-			$return .= '<tr '. $GLOBALS['HTML']->boxGetAltRowStyle($i) .'><td>'
-			.util_make_link ('/people/?category_id='.  db_result($result,$i,'category_id'), db_result($result,$i,'name')) .' ('. db_result($result,$i,'total') .')</td></tr>';
+		$return = $GLOBALS['HTML']->listTableTop($title_arr);
+		for ($i = 0; $i< count($categories); $i++) {
+			$return .= '<tr '. $GLOBALS['HTML']->boxGetAltRowStyle($i) .'>
+				<td>'.util_make_link('/people/?category_id='.$categories[$i]['category_id'], $categories[$i]['name']).' ('.$categories[$i]['total'].')</td>
+				</tr>';
 		}
 	}
 	$return .= $GLOBALS['HTML']->listTableBottom();
@@ -380,11 +405,11 @@ GROUP BY pjc.category_id, pjc.name', array());
 function people_show_project_jobs($group_id) {
 	//show open jobs for this project
 	$result = db_query_params('SELECT people_job.group_id,people_job.job_id,groups.group_name,groups.unix_group_name,people_job.title,people_job.post_date,people_job_category.name AS category_name
-FROM people_job,people_job_category,groups
-WHERE people_job.group_id=$1
-AND people_job.group_id=groups.group_id
-AND people_job.category_id=people_job_category.category_id
-AND people_job.status_id=1 ORDER BY post_date DESC', array($group_id));
+				FROM people_job,people_job_category,groups
+				WHERE people_job.group_id=$1
+				AND people_job.group_id=groups.group_id
+				AND people_job.category_id=people_job_category.category_id
+				AND people_job.status_id=1 ORDER BY post_date DESC', array($group_id));
 
 	return people_show_job_list($result);
 }
@@ -392,11 +417,11 @@ AND people_job.status_id=1 ORDER BY post_date DESC', array($group_id));
 function people_show_category_jobs($category_id) {
 	//show open jobs for this category
 	$result=db_query_params('SELECT people_job.group_id,people_job.job_id,groups.unix_group_name,groups.group_name,people_job.title,people_job.post_date,people_job_category.name AS category_name
-FROM people_job,people_job_category,groups
-WHERE people_job.category_id=$1
-AND people_job.group_id=groups.group_id
-AND people_job.category_id=people_job_category.category_id
-AND people_job.status_id=1 ORDER BY post_date DESC', array($category_id));
+				FROM people_job,people_job_category,groups
+				WHERE people_job.category_id=$1
+				AND people_job.group_id=groups.group_id
+				AND people_job.category_id=people_job_category.category_id
+				AND people_job.status_id=1 ORDER BY post_date DESC', array($category_id));
 
 	return people_show_job_list($result);
 }
@@ -406,31 +431,34 @@ function people_show_job_list($result) {
 
 	//query must contain 'group_id', 'job_id', 'title', 'category_name' and 'status_name'
 
-	$title_arr=array();
-	$title_arr[]=_('Title');
-	$title_arr[]=_('Category');
-	$title_arr[]=_('Date Opened');
-	$title_arr[]= sprintf(_('%s project'), forge_get_config ('forge_name'));
+	$title_arr = array();
+	$title_arr[] = _('Title');
+	$title_arr[] = _('Category');
+	$title_arr[] = _('Date Opened');
+	$title_arr[] = sprintf(_('%s project'), forge_get_config('forge_name'));
 
-	$return = $GLOBALS['HTML']->listTableTop ($title_arr);
+	$projects = array();
+	while ($arr = db_fetch_array($result)) {
+		if (forge_check_perm('project_read', $arr['group_id'])) {
+			$projects[] = $arr;
+		}
+	}
 
-	$rows=db_numrows($result);
-	if (!isset($i)){$i=1;}
-	if ($rows < 1) {
-		$return .= '<tr '. $GLOBALS['HTML']->boxGetAltRowStyle($i) .'><td class="warning" colspan="4">'._('None Found'). db_error() .'</td></tr>';
+	if (count($projects) < 1) {
+		$return = '<p class="warning" >'._('None Found').'</p>';
 	} else {
-		for ($i=0; $i < $rows; $i++) {
+		$return = $GLOBALS['HTML']->listTableTop ($title_arr);
+		for ($i = 0; $i < count($projects); $i++) {
 			$return .= '
-				<tr '. $GLOBALS['HTML']->boxGetAltRowStyle($i) .
-					'><td>'.util_make_link ('/people/viewjob.php?group_id='. db_result($result,$i,'group_id') .'&job_id='.  db_result($result,$i,'job_id'), db_result($result,$i,'title')) .'</td><td>'.
-					db_result($result,$i,'category_name') .'</td><td>'.
-					date(_('Y-m-d H:i'),db_result($result,$i,'post_date')) .
-					'</td><td>'.util_make_link_g (strtolower(db_result($result,$i,'unix_group_name')),db_result($result,$i,'group_id'),db_result($result,$i,'group_name')) .'</td></tr>';
+				<tr '. $GLOBALS['HTML']->boxGetAltRowStyle($i) . '>
+					<td>'.util_make_link('/people/viewjob.php?group_id='.$projects[$i]['group_id'].'&job_id='.$projects[$i]['job_id'], $projects[$i]['title']) .'</td>
+					<td>'.$projects[$i]['category_name'].'</td>
+					<td>'.date(_('Y-m-d H:i'), $projects[$i]['post_date']).'</td>
+					<td>'.util_make_link_g(strtolower($projects[$i]['unix_group_name']), $projects[$i]['group_id'], $projects[$i]['group_name']).'</td>
+				</tr>';
 		}
+		$return .= $GLOBALS['HTML']->listTableBottom();
 	}
-
-	$return .= $GLOBALS['HTML']->listTableBottom();
-
 	return $return;
 }
 

commit 80c541df5c86ea0465e0dba0e4c5c38388d94e30
Author: Franck Villaume <franck.villaume at trivialdev.com>
Date:   Thu Jan 30 14:57:07 2014 +0100

    people admin index: fix html

diff --git a/src/www/people/admin/index.php b/src/www/people/admin/index.php
index 7914940..8ef6154 100644
--- a/src/www/people/admin/index.php
+++ b/src/www/people/admin/index.php
@@ -89,7 +89,7 @@ if (forge_check_global_perm('forge_admin')) {
 		$result=db_query_params('SELECT category_id,name FROM people_job_category', array());
 		echo "<p>";
 		if ($result && db_numrows($result) > 0) {
-			ShowResultSet($result,_('Existing Categories'),'people_cat');
+			ShowResultSet($result,_('Existing Categories'), 'people_cat');
 		} else {
 			echo '<p class="error">'._('No job categories').'</p>';
 			echo db_error();
@@ -115,7 +115,7 @@ if (forge_check_global_perm('forge_admin')) {
 		/*
 			Show people_groups and blank row
 		*/
-		people_header(array('title'=>_('Add/Change People Skills')));
+		people_header(array('title' => _('Add/Change People Skills')));
 
 		/*
 			List of possible people_groups for this group
@@ -123,7 +123,7 @@ if (forge_check_global_perm('forge_admin')) {
 		$result=db_query_params('SELECT skill_id,name FROM people_skill', array());
 		echo "<p>";
 		if ($result && db_numrows($result) > 0) {
-			ShowResultSet($result,_('Existing Skills'),"people_skills");
+			ShowResultSet($result,_('Existing Skills'), 'people_skills');
 		} else {
 			echo db_error();
 			echo "\n<h2>"._('No Skills Found').'</h2>';
@@ -150,14 +150,15 @@ if (forge_check_global_perm('forge_admin')) {
 			Show main page
 		*/
 
-		people_header(array('title'=>_('People Administration')));
+		people_header(array('title' => _('People Administration')));
 
 		echo '<p>
-			<a href="'.getStringFromServer('PHP_SELF').'?people_cat=1">'._('Add Job Categories').'</a><br />';
+			<a href="'.getStringFromServer('PHP_SELF').'?people_cat=1" >'._('Add Job Categories').'</a><br />';
 	//	echo "\nAdd categories of bugs like, 'mail module','gant chart module','interface', etc<p>";
 
 		echo "\n".'<a href="'.getStringFromServer('PHP_SELF').'?people_skills=1" >'._('Add Job Skills').'</a><br />';
 	//	echo "\nAdd Groups of bugs like 'future requests','unreproducible', etc<p>";
+		echo '</p>';
 
 		people_footer(array());
 	}

commit f03b98c0b95f4e63cd7a8bc8a1828ac222147e91
Author: Franck Villaume <franck.villaume at trivialdev.com>
Date:   Thu Jan 30 14:40:50 2014 +0100

    fix project_summary: check for usesFRS and usesTracker

diff --git a/src/www/include/project_summary.php b/src/www/include/project_summary.php
index 0be80b6..fde1785 100644
--- a/src/www/include/project_summary.php
+++ b/src/www/include/project_summary.php
@@ -4,6 +4,7 @@
  *
  * Copyright 1999-2001 (c) VA Linux Systems
  * Copyright 2010, FusionForge Team
+ * Copyright 2014, Franck Villaume - TrivialDev
  * http://fusionforge.org
  *
  * This file is part of FusionForge. FusionForge is free software;
@@ -116,29 +117,31 @@ function project_summary($group_id, $mode, $no_table) {
 
 	// ################## ArtifactTypes
 
-	$return .= '<a href="'.util_make_url ('/tracker/?group_id='.$group_id).'">';
-	$return .= html_image("ic/tracker20g.png",'20','20',array('alt'=>'Tracker'));
-	$return .= ' Tracker</a>';
-
-	if ($mode != 'compact') {
-		$result=db_query_params ('SELECT agl.*,aca.count,aca.open_count
-		FROM artifact_group_list agl
-		LEFT JOIN artifact_counts_agg aca USING (group_artifact_id)
-		WHERE agl.group_id=$1
-		AND agl.is_public=1
-		ORDER BY group_artifact_id ASC',
-			array($group_id));
+	if ($project->usesTracker()) {
+		$return .= '<a href="'.util_make_url ('/tracker/?group_id='.$group_id).'">';
+		$return .= html_image("ic/tracker20g.png",'20','20',array('alt'=>'Tracker'));
+		$return .= ' Tracker</a>';
+
+		if ($mode != 'compact') {
+			$result=db_query_params ('SELECT agl.*,aca.count,aca.open_count
+			FROM artifact_group_list agl
+			LEFT JOIN artifact_counts_agg aca USING (group_artifact_id)
+			WHERE agl.group_id=$1
+			AND agl.is_public=1
+			ORDER BY group_artifact_id ASC',
+				array($group_id));
 
-		$rows = db_numrows($result);
+			$rows = db_numrows($result);
 
-		if (!$result || $rows < 1) {
-			$return .= '<br /><em>'._('There are no public trackers available').'</em>';
-		} else {
-			for ($j = 0; $j < $rows; $j++) {
-				$return .= '<p>
-				 - '.util_make_link ('/tracker/?atid='. db_result($result, $j, 'group_artifact_id') . '&group_id='.$group_id.'&func=browse',db_result($result, $j, 'name'));
-				$return .= sprintf(ngettext('(<strong>%1$s</strong> open / <strong>%2$s</strong> total)', '(<strong>%1$s</strong> open / <strong>%2$s</strong> total)', (int) db_result($result, $j, 'open_count')), (int) db_result($result, $j, 'open_count'), (int) db_result($result, $j, 'count')) ;
-				$return .= '</p>';
+			if (!$result || $rows < 1) {
+				$return .= '<br /><em>'._('There are no public trackers available').'</em>';
+			} else {
+				for ($j = 0; $j < $rows; $j++) {
+					$return .= '<p>
+					 - '.util_make_link ('/tracker/?atid='. db_result($result, $j, 'group_artifact_id') . '&group_id='.$group_id.'&func=browse',db_result($result, $j, 'name'));
+					$return .= sprintf(ngettext('(<strong>%1$s</strong> open / <strong>%2$s</strong> total)', '(<strong>%1$s</strong> open / <strong>%2$s</strong> total)', (int) db_result($result, $j, 'open_count')), (int) db_result($result, $j, 'open_count'), (int) db_result($result, $j, 'count')) ;
+					$return .= '</p>';
+				}
 			}
 		}
 	}
@@ -255,7 +258,7 @@ function project_summary($group_id, $mode, $no_table) {
 
 	// ######################## Released Files
 
-	if ($project->isActive()) {
+	if ($project->usesFRS()) {
 		$return .= '
 
 			<hr />';

commit fb305ae293389d05632ff11ff1f56e01e8730d00
Author: Franck Villaume <franck.villaume at trivialdev.com>
Date:   Thu Jan 30 14:11:01 2014 +0100

    people: fix edit job: category none is not an option

diff --git a/src/www/people/people_utils.php b/src/www/people/people_utils.php
index aadcfe7..bcfe930 100644
--- a/src/www/people/people_utils.php
+++ b/src/www/people/people_utils.php
@@ -83,7 +83,7 @@ function people_job_status_box($name='status_id',$checked='xyxy') {
 
 function people_job_category_box($name='category_id',$checked='xyxy') {
 	$result=db_query_params("SELECT category_id,name FROM people_job_category WHERE private_flag=0", array());
-	return html_build_select_box ($result,$name,$checked);
+	return html_build_select_box($result, $name, $checked, false);
 }
 
 function people_add_to_skill_inventory($skill_id,$skill_level_id,$skill_year_id) {

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

Summary of changes:
 src/www/include/project_summary.php |   47 +++++++------
 src/www/people/admin/index.php      |   11 +--
 src/www/people/people_utils.php     |  126 +++++++++++++++++++++--------------
 3 files changed, 108 insertions(+), 76 deletions(-)


hooks/post-receive
-- 
FusionForge



More information about the Fusionforge-commits mailing list