[Fusionforge-commits] FusionForge branch master updated. 4d6891f9fca8ce88e5ac182d29fd5d77006240a5

Franck Villaume nerville at fusionforge.org
Thu Aug 21 18:25:02 CEST 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, master has been updated
       via  4d6891f9fca8ce88e5ac182d29fd5d77006240a5 (commit)
       via  cce71ddf38fd1a24f88668ab1ab96d4ef5d2a5be (commit)
       via  32ef1be88060f137cc051895f2053ce4734bbe6d (commit)
       via  6878f49575260fd85707e6c47b542fb07c47c1e0 (commit)
       via  4d8accbb0df610b5fb1f4a35ce86c288c28dc2d8 (commit)
      from  845b969719789a7eee168265cc7bf4c5f3a9eb67 (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 4d6891f9fca8ce88e5ac182d29fd5d77006240a5
Author: Franck Villaume <franck.villaume at trivialdev.com>
Date:   Thu Aug 21 18:23:20 2014 +0200

    use HTML helpers

diff --git a/src/www/project/report/index.php b/src/www/project/report/index.php
index acd7bcb..e3b44d4 100644
--- a/src/www/project/report/index.php
+++ b/src/www/project/report/index.php
@@ -4,6 +4,7 @@
  *
  * Copyright 1999-2001 (c) VA Linux Systems
  * Copyright 2002-2004 (c) GForge Team
+ * Copyright 2014, Franck Villaume - TrivialDev
  * http://fusionforge.org/
  *
  * This file is part of FusionForge. FusionForge is free software;
@@ -24,7 +25,8 @@
 
 require_once '../../env.inc.php';
 require_once $gfcommon.'include/pre.php';
-#require_once('common/tracker/ArtifactGroup.class.php');
+
+global $HTML;
 
 function GetTime ($timedifference) {
 
@@ -126,32 +128,25 @@ if (!$group_id && $form_grp) {
 $title = _('Project Member List');
 site_project_header(array('title'=>$title,'group'=>$group_id,'toptab'=>'memberlist'));
 
-echo '<p>';
-echo _('If you would like to contribute to this project by becoming a member, contact one of the project admins, designated in bold text below.');
-echo '</p>';
+echo html_e('p', array(), _('If you would like to contribute to this project by becoming a member, contact one of the project admins, designated in bold text below.'));
 
-        $title_arr=array();
-        $title_arr[]=_('Developer');
-        $title_arr[]=_('Summary');
-        $title_arr[]=_('Open Date');
-        $title_arr[]=_('Last Modified');
-echo $GLOBALS['HTML']->listTableTop ($title_arr);
+$title_arr=array();
+$title_arr[]=_('Developer');
+$title_arr[]=_('Summary');
+$title_arr[]=_('Open Date');
+$title_arr[]=_('Last Modified');
+echo $HTML->listTableTop($title_arr);
 
 // list members
 foreach ($group->getUsers() as $member) {
-	echo '
-		<tr><td>';
+	$cells = array();
 	$link = util_make_link_u ($member->getUnixName(), $member->getID(), $member->getRealName()) ;
 	if ( RBACEngine::getInstance()->isActionAllowedForUser($member,'project_admin',$group->getID())) {
-		echo '<strong>'.$link.'</strong>' ;
+		$cells[][] = html_e('strong', array(), $link);
 	} else {
-		echo $link ;
+		$cells[][] = $link;
 	}
-	echo '
-			</td><td>'.
-		util_make_link ('/sendmessage.php?touser='.$member->getId(),
-				sprintf (_('Contact %s'),$member->getRealName())).'
-			</td>';
+	$cells[][] = util_make_link('/sendmessage.php?touser='.$member->getId(), sprintf(_('Contact %s'), $member->getRealName()));
 	$roles = RBACEngine::getInstance()->getAvailableRolesForUser ($member) ;
 	sortRoleList ($roles) ;
 	$role_names = array () ;
@@ -161,91 +156,74 @@ foreach ($group->getUsers() as $member) {
 		}
 	}
 	$role_string = implode (', ', $role_names) ;
-
-				echo '
-			<td class="align-center">'.$role_string.'
-			</td>';
+	$cells[] = array($role_string, 'class' => 'align-center');
 	if(forge_get_config('use_people')) {
-		echo '
-			<td class="align-center">'.util_make_link('/people/viewprofile.php?user_id='.$member->getID(),_('View')).'
-			</td>';
+		$cells[] = array(util_make_link('/people/viewprofile.php?user_id='.$member->getID(),_('View')), 'class' => 'align-center');
+	} else {
+		$cells[][] = '';
 	}
-	echo '
-		</tr>';
+	echo $HTML->multiTableRow(array(), $cells);
 
 	// print out all the artifacts assigned to this person
-        $artifact_group=db_query_params("SELECT group_artifact_id, name
-                                  FROM artifact_group_list
-                                  WHERE group_id=$1
-                                  ORDER BY group_artifact_id DESC", array($group_id));
+	$artifact_group=db_query_params("SELECT group_artifact_id, name
+				FROM artifact_group_list
+				WHERE group_id=$1
+				ORDER BY group_artifact_id DESC", array($group_id));
 
- 	while ( $artifact_type =db_fetch_array($artifact_group) ) {
+	while ( $artifact_type =db_fetch_array($artifact_group) ) {
 		$artifacts=db_query_params("SELECT * FROM artifact_vw
-                                     WHERE assigned_to=$1
-                                       AND status_id='1'
-                                       AND group_artifact_id=$2
-                                     ORDER BY priority DESC", array($member->getID(), $artifact_type['group_artifact_id']));
-
-                $num_artifacts=db_numrows($artifacts);
-                for ($m=0; $m < $num_artifacts; $m++) {
-			echo '
-		<tr class="priority'.db_result($artifacts, $m, 'priority').'">
-			<td>'.util_make_link('/tracker/?func=detail&aid='. db_result($artifacts, $m, 'artifact_id') .'&group_id='.$group_id.'&atid='.$artifact_type['group_artifact_id'], $artifact_type['name'].' '.db_result($artifacts, $m, 'artifact_id')).'
-			</td>
-			<td>'.db_result($artifacts, $m, 'summary').'</td>';
-			echo '
-			<td>'.GetTime( time() - db_result($artifacts, $m, 'open_date'))	.'
-			</td>';
-
-			$messages=db_query_params("select adddate FROM artifact_message_user_vw ".
+					WHERE assigned_to=$1
+					AND status_id='1'
+					AND group_artifact_id=$2
+					ORDER BY priority DESC", array($member->getID(), $artifact_type['group_artifact_id']));
+
+		$num_artifacts=db_numrows($artifacts);
+		for ($m=0; $m < $num_artifacts; $m++) {
+			$cells = array();
+			$cells[][] = util_make_link('/tracker/?func=detail&aid='. db_result($artifacts, $m, 'artifact_id') .'&group_id='.$group_id.'&atid='.$artifact_type['group_artifact_id'], $artifact_type['name'].' '.db_result($artifacts, $m, 'artifact_id'));
+			$cells[][] = db_result($artifacts, $m, 'summary');
+			$cells[][] = GetTime( time() - db_result($artifacts, $m, 'open_date'));
+
+			$messages = db_query_params("select adddate FROM artifact_message_user_vw ".
 						"WHERE artifact_id=$1 ".
 						"ORDER by adddate DESC", array(db_result($artifacts, $m, 'artifact_id')));
 			if ( db_numrows($messages)) {
-				echo '
-			<td>'. GetTime( time () - db_result($messages, 0, 'adddate')).'</td>';
+				$cells[][] = GetTime( time () - db_result($messages, 0, 'adddate'));
 			} else {
-				echo '
-			<td>'. GetTime( time () - db_result($artifacts, $m, 'open_date')).'</td>';
+				$cells[][] = GetTime( time () - db_result($artifacts, $m, 'open_date'));;
 			}
-			echo '
-		</tr>';
+			echo $HTML->multiTableRow(array('class' => 'priority'.db_result($artifacts, $m, 'priority')), $cells);
                 }
 	}
 	$task_group=db_query_params("SELECT ptv.*,g.group_name,pgl.project_name
-                        FROM project_task_vw ptv,
-                                project_assigned_to pat,
-                                groups g,
-                                project_group_list pgl
-                        WHERE ptv.project_task_id=pat.project_task_id
-                                AND pgl.group_id=$1
-                                AND g.group_id=$1
-                                AND pgl.group_project_id=ptv.group_project_id
-                                AND ptv.status_id=1
-                                AND pat.assigned_to_id=$2
-                        ORDER BY group_name,project_name",
-                        array($group_id, $member->getID()));
+				FROM project_task_vw ptv,
+					project_assigned_to pat,
+					groups g,
+					project_group_list pgl
+				WHERE ptv.project_task_id=pat.project_task_id
+					AND pgl.group_id=$1
+					AND g.group_id=$1
+					AND pgl.group_project_id=ptv.group_project_id
+					AND ptv.status_id=1
+					AND pat.assigned_to_id=$2
+				ORDER BY group_name,project_name",
+				array($group_id, $member->getID()));
 
 	while ( $task_type = db_fetch_array($task_group) ) {
 		if ( $task_type['percent_complete'] != 100 ) {
-                	echo '
-		<tr class="priority'.$task_type['priority'].'">
-			<td>'.util_make_link('/pm/task.php?func=detailtask&project_task_id='. $task_type['project_task_id'].'&group_id='.$group_id.'&group_project_id='.$task_type['group_project_id'],_('Task').' '.$task_type['project_task_id']).'
-			</td>
-			<td>'.$task_type['summary'].'
-			</td>
-			<td>'.GetTime(time()-$task_type['start_date']).'
-			</td>
-			<td>'.$task_type['percent_complete'].'% done'.'
-			</td>
-		</tr>';
+			$cells = array();
+			$cells[][] = util_make_link('/pm/task.php?func=detailtask&project_task_id='. $task_type['project_task_id'].'&group_id='.$group_id.'&group_project_id='.$task_type['group_project_id'],_('Task').' '.$task_type['project_task_id']);
+			$cells[][] = $task_type['summary'];
+			$cells[][] = GetTime(time()-$task_type['start_date']);
+			$cells[][] = $task_type['percent_complete'].'% '._('done');
+			echo $HTML->multiTableRow(array('class' => 'priority'.$task_type['priority']), $cells);
 		}
 	}
-	echo '
-		<tr>
-			<td></td>
-		</tr>';
+	$cells = array();
+	$cells[] = array('', 'colspan' => 4);
+	echo $HTML->multiTableRow(array(), $cells);
 }
 
-echo $GLOBALS['HTML']->listTableBottom();
+echo $HTML->listTableBottom();
 
 site_project_footer();

commit cce71ddf38fd1a24f88668ab1ab96d4ef5d2a5be
Author: Franck Villaume <franck.villaume at trivialdev.com>
Date:   Thu Aug 21 18:02:53 2014 +0200

    fix php syntax

diff --git a/src/www/project/stats/index.php b/src/www/project/stats/index.php
index 8b7dd2d..de1261f 100644
--- a/src/www/project/stats/index.php
+++ b/src/www/project/stats/index.php
@@ -113,7 +113,6 @@ echo $HTML->openForm(array('action' => getStringFromServer('PHP_SELF'), 'method'
 </table>
 <?php
 echo $HTML->closeForm();
-<?php
 if ($start == $end) {
 	echo $HTML->error_msg(_('Start and end dates must be different'));
 } elseif (!report_actgraph('project', $SPAN, $start, $end, $group_id, $area)) {

commit 32ef1be88060f137cc051895f2053ce4734bbe6d
Author: Franck Villaume <franck.villaume at trivialdev.com>
Date:   Thu Aug 21 17:51:05 2014 +0200

    use HTML helpers & remove useless sql query

diff --git a/src/www/project/stats/index.php b/src/www/project/stats/index.php
index 569c26e..8b7dd2d 100644
--- a/src/www/project/stats/index.php
+++ b/src/www/project/stats/index.php
@@ -57,11 +57,8 @@ $SPAN = getIntFromRequest('SPAN', REPORT_TYPE_MONTHLY);
 $start = getIntFromRequest('start');
 $end = getIntFromRequest('end');
 
-/*
- * Set the start date to birth of the project.
- */
-$res = db_query_params('SELECT register_time FROM groups WHERE group_id=$1', array($group_id));
-$report->site_start_date = db_result($res,0,'register_time');
+// Set the start date to birth of the project.
+$report->site_start_date = $group->getStartDate();
 
 if (!$start || !$end) $z =& $report->getMonthStartArr();
 
@@ -100,8 +97,8 @@ project_admin_header(array('title'=>sprintf(_('Project Statistics for %s'), $gro
 //
 // BEGIN PAGE CONTENT CODE
 //
+echo $HTML->openForm(array('action' => getStringFromServer('PHP_SELF'), 'method' => 'get'));
 ?>
-<form action="<?php echo getStringFromServer('PHP_SELF'); ?>" method="get">
 <table class="centered">
 <tr>
 <td><strong><?php echo _('Area')._(':'); ?></strong><br /><?php echo report_area_box('area',$area,$group); ?></td>
@@ -114,12 +111,13 @@ project_admin_header(array('title'=>sprintf(_('Project Statistics for %s'), $gro
 </td>
 </tr>
 </table>
-</form>
+<?php
+echo $HTML->closeForm();
 <?php
 if ($start == $end) {
 	echo $HTML->error_msg(_('Start and end dates must be different'));
 } elseif (!report_actgraph('project', $SPAN, $start, $end, $group_id, $area)) {
-		echo $HTML->error_msg(_('Error during graphic computation.'));
+	echo $HTML->error_msg(_('Error during graphic computation.'));
 }
 
 site_project_footer();

commit 6878f49575260fd85707e6c47b542fb07c47c1e0
Author: Franck Villaume <franck.villaume at trivialdev.com>
Date:   Thu Aug 21 17:45:02 2014 +0200

    use HTML helpers

diff --git a/src/www/project/request.php b/src/www/project/request.php
index b924213..2140393 100644
--- a/src/www/project/request.php
+++ b/src/www/project/request.php
@@ -3,7 +3,7 @@
  * Project Membership Request
  *
  * Copyright 2005 (c) GForge, L.L.C.
- * Copyright 2012, Franck Villaume - TrivialDev
+ * Copyright 2012,2014, Franck Villaume - TrivialDev
  * http://fusionforge.org/
  *
  * This file is part of FusionForge. FusionForge is free software;
@@ -44,10 +44,11 @@ if ($submit) {
 	$gjr=new GroupJoinRequest($group);
 	$usr=&session_get_user();
 	if (!$gjr->create($usr->getId(),$comments)) {
-		session_redirect('/projects/'.$group->getUnixName().'/?error_msg='.urlencode($gjr->getErrorMessage()));
+		$error_msg = $gjr->getErrorMessage();
+		session_redirect('/projects/'.$group->getUnixName());
 	} else {
 		$feedback = _('Your request has been submitted.');
-		session_redirect('/projects/'.$group->getUnixName().'/?feedback='.urlencode($feedback));
+		session_redirect('/projects/'.$group->getUnixName());
 	}
 }
 
@@ -56,20 +57,12 @@ $title = _('Request to join project') . ' '.$group->getPublicName();
 site_project_header(array('title'=>$title,'group'=>$group_id,'toptab'=>'summary'));
 
 plugin_hook ("blocks", "request_join");
-
-?>
-<p><?php
 $nbadmins = count($group->getAdmins());
-echo ngettext('You can request to join a project by clicking the submit button. The administrator will be emailed to approve or deny your request.', 'You can request to join a project by clicking the submit button. The administrators will be emailed to approve or deny your request.', $nbadmins); ?></p>
-<form action="<?php echo getStringFromServer('PHP_SELF')."?group_id=$group_id"; ?>" method="post">
-<p>
-<?php echo ngettext('You must send a comment to the administrator:', 'You must send a comment to the administrators:',$nbadmins); echo utils_requiredField(); ?>
-</p>
-<textarea name="comments" required="required" rows="15" cols="60"><?php echo $comments ?></textarea>
-<p>
-	<input type="submit" name="submit" value="<?php echo _('Submit'); ?>" />
-</p>
-</form>
-<?php
-
+echo html_e('p', array(), ngettext('You can request to join a project by clicking the submit button. The administrator will be emailed to approve or deny your request.', 'You can request to join a project by clicking the submit button. The administrators will be emailed to approve or deny your request.', $nbadmins));
+echo $HTML->openForm(array('action' => getStringFromServer('PHP_SELF').'?group_id='.$group_id, 'method' => 'post'));
+echo html_e('p', array(), ngettext('You must send a comment to the administrator:', 'You must send a comment to the administrators:',$nbadmins).utils_requiredField());
+echo html_e('textarea', array('name' => 'comments', 'required' => 'required', 'rows' => 15, 'cols' => 60), $comments);
+echo html_e('p', array(), html_e('input', 'type' => 'submit', 'name' => 'submit', 'value' => _('Submit')));
+echo $HTML->closeForm();
+echo $HTML->addRequiredFieldsInfoBox();
 site_project_footer();

commit 4d8accbb0df610b5fb1f4a35ce86c288c28dc2d8
Author: Franck Villaume <franck.villaume at trivialdev.com>
Date:   Thu Aug 21 17:27:53 2014 +0200

    use HTML helpers

diff --git a/src/www/project/memberlist.php b/src/www/project/memberlist.php
index 0a1e92e..2427235 100644
--- a/src/www/project/memberlist.php
+++ b/src/www/project/memberlist.php
@@ -26,6 +26,8 @@
 require_once '../env.inc.php';
 require_once $gfcommon.'include/pre.php';
 
+global $HTML;
+
 $group_id = getIntFromGet("group_id");
 $form_grp = getIntFromGet("form_grp");
 
@@ -37,16 +39,15 @@ session_require_perm('project_read', $group_id);
 
 site_project_header(array('title'=>_('Project Member List'),'group'=>$group_id,'toptab'=>'memberlist'));
 
-echo '<p>' . _('If you would like to contribute to this project by becoming a member, contact one of the project admins, designated in bold text below.') . '</p>';
+echo html_e('p', array(), _('If you would like to contribute to this project by becoming a member, contact one of the project admins, designated in bold text below.'));
 
 // beginning of the user descripion block
 $project = group_get_object($group_id);
 $project_stdzd_uri = util_make_url_g ($project->getUnixName(), $group_id);
 $usergroup_stdzd_uri = $project_stdzd_uri.'members/';
-print '<div about="'. $usergroup_stdzd_uri .'" typeof="sioc:UserGroup">';
-print '<span rel="http://www.w3.org/2002/07/owl#sameAs" resource=""></span>';
-print '<span rev="sioc:has_usergroup" resource="'. $project_stdzd_uri . '"></span>';
-print '</div>';
+$content = html_e('span', array('rel' => 'http://www.w3.org/2002/07/owl#sameAs', 'resource' => ''), '', false);
+$content .= html_e('span', array('rev' => 'sioc:has_usergroup', 'resource' => $project_stdzd_uri), '', false);
+echo html_e('div', array('about' => $usergroup_stdzd_uri, 'typeof' => 'sioc:UserGroup'), $content);
 
 $title_arr=array();
 $title_arr[]=_('Member');
@@ -56,39 +57,25 @@ if(forge_get_config('use_people')) {
 	$title_arr[]=_('Skills');
 }
 
-echo $GLOBALS['HTML']->listTableTop ($title_arr);
+echo $HTML->listTableTop($title_arr);
 
 // list members
 $members = $project->getUsers() ;
 
 $i=0;
 foreach ($members as $user) {
-	echo '<tr '.$HTML->boxGetAltRowStyle($i++).'>'."\n";
+	$cells = array();
 	// RDFa
-	$member_uri = util_make_url_u ($user->getUnixName(),$user->getID());
-	echo "		<td>\n";
-	print '<div about="'. $member_uri .'" typeof="sioc:UserAccount">';
-	print '<span rev="sioc:has_member" resource="'. $usergroup_stdzd_uri .'"></span>';
-	print '<span property="sioc:name" content="'. $user->getUnixName() .'"></span>';
-	if ( RBACEngine::getInstance()->isActionAllowedForUser($user,'project_admin',$project->getID())) {
-//                echo '<div rev="doap:developer" typeof="doap:Project" xmlns:doap="http://usefulinc.com/ns/doap#">';
-		echo '<strong>'.$user->getRealName().'</strong>';
-//                echo '</div>';
+	$member_uri = util_make_url_u($user->getUnixName(), $user->getID());
+	$content = html_e('span', array('rev' => 'sioc:has_member', 'resource' => $usergroup_stdzd_uri), '', false);
+	$content .= html_e('span', array('property' => 'sioc:name', 'content' => $user->getUnixName()), '', false);
+	if (RBACEngine::getInstance()->isActionAllowedForUser($user, 'project_admin', $project->getID())) {
+		$content .= html_e('strong', array(), $user->getRealName());
 	} else {
-//		echo '<div rev="doap:maintainer" typeof="doap:Project" xmlns:doap="http://usefulinc.com/ns/doap#">';
-		echo $user->getRealName();
-//                echo '</div>';
+		$content .= $user->getRealName();
 	}
-	echo "</div>\n";
-	echo '</td>';
-
-	/*
-        print '<span property ="dc:Identifier" content="'.$user->getID().'">';
-        echo '</span>';
-        print '<span property="foaf:accountName" content="'.$user->getUnixName().'">';
-        echo '</span>';
-        print '<span property="fusionforge:has_job" content="'.$role_string.'">';
-        echo '</span>';*/
+	$cells[][] = html_e('div', array('about' => $member_uri, 'typeof' => 'sioc:UserAccount'), $content);
+	$cells[][] = util_display_user($user->getUnixName(),$user->getID(),$user->getUnixName(), 's');
 
 	$roles = RBACEngine::getInstance()->getAvailableRolesForUser ($user) ;
 	sortRoleList ($roles) ;
@@ -99,17 +86,13 @@ foreach ($members as $user) {
 		}
 	}
 	$role_string = implode (', ', $role_names) ;
-
-	echo '<td>';
-	echo util_display_user($user->getUnixName(),$user->getID(),$user->getUnixName(), 's');
-	echo '</td>';
-	echo '<td class="align-center">'.$role_string.'</td>';
+	$cells[] = array($role_string, 'class' => 'align-center');
 	if (forge_get_config('use_people')) {
-		echo '<td class="align-center">'.util_make_link('/people/viewprofile.php?user_id='.$user->getID(),_('View')).'</td>';
+		$cells[] = array(util_make_link('/people/viewprofile.php?user_id='.$user->getID(), _('View')), 'class' => 'align-center');
 	}
-	echo '</tr>';
+	echo $HTML->multiTableRow(array('class' => $HTML->boxGetAltRowStyle($i++, true)), $cells);
 }
 // end of community member description block
-echo $GLOBALS['HTML']->listTableBottom();
+echo $HTML->listTableBottom();
 
 site_project_footer();

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

Summary of changes:
 src/www/project/memberlist.php   |   57 ++++++---------
 src/www/project/report/index.php |  146 ++++++++++++++++----------------------
 src/www/project/request.php      |   29 +++-----
 src/www/project/stats/index.php  |   13 ++--
 4 files changed, 98 insertions(+), 147 deletions(-)


hooks/post-receive
-- 
FusionForge



More information about the Fusionforge-commits mailing list