3 * Project Members Information
5 * Copyright 1999-2001 (c) VA Linux Systems
6 * Copyright 2002-2004 (c) GForge Team
7 * http://fusionforge.org/
9 * This file is part of FusionForge. FusionForge is free software;
10 * you can redistribute it and/or modify it under the terms of the
11 * GNU General Public License as published by the Free Software
12 * Foundation; either version 2 of the Licence, or (at your option)
15 * FusionForge is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU General Public License for more details.
20 * You should have received a copy of the GNU General Public License along
21 * with FusionForge; if not, write to the Free Software Foundation, Inc.,
22 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
26 require_once('../../env.inc.php');
27 require_once $gfcommon.'include/pre.php';
28 #require_once('common/tracker/ArtifactGroup.class.php');
30 function GetTime ($timedifference) {
32 if ($timedifference >= 0) {
34 $mval = ($timedifference / 2592000);
35 $monthval = intval($mval);
37 return "$monthval Months Ago";
40 $wval = ($timedifference / 604800);
41 $weektime = intval($wval);
43 return "$weektime Weeks Ago";
46 $dval = ($timedifference / 86400) ;
47 $daytime = intval($dval);
49 return "$daytime Days Ago";
52 $hval = ($timedifference / 3600);
53 $hourtime = intval($hval);
55 return "$hourtime Hours Ago";
58 $mval = ($timedifference / 60);
59 $minutetime = intval($mval);
60 if ( $minutetime > 1 ) {
61 return "$minutetime Minutes Ago";
64 return "$timedifference Seconds Ago";
68 $timedifference=abs($timedifference);
70 $mval = ($timedifference / 2592000);
71 $monthval = intval($mval);
73 return "Next $monthval Months";
76 $wval = ($timedifference / 604800);
77 $weektime = intval($wval);
79 return "Next $weektime Weeks";
82 $dval = ($timedifference / 86400) ;
83 $daytime = intval($dval);
85 return "Next $daytime Days";
88 $hval = ($timedifference / 3600);
89 $hourtime = intval($hval);
91 return "Next $hourtime Hours";
94 $mval = ($timedifference / 60);
95 $minutetime = intval($mval);
96 if ( $minutetime > 1 ) {
97 return "Next $minutetime Minutes";
100 return "Next $timedifference Seconds";
107 // get the Project object
109 $group_id = getIntFromRequest('group_id');
111 $group = group_get_object($group_id);
112 if (!$group || !is_object($group)) {
115 if ($group->isError()) {
116 if($group->isPermissionDeniedError()) {
117 exit_permission_denied($group->getErrorMessage(),'admin');
119 exit_error($group->getErrorMessage(),'admin');
123 if (!$group_id && $form_grp) {
124 $group_id = $form_grp;
127 $title = _('Project Member List');
128 site_project_header(array('title'=>$title,'group'=>$group_id,'toptab'=>'memberlist'));
131 echo _('If you would like to contribute to this project by becoming a developer, contact one of the project admins, designated in bold text below.');
135 $title_arr[]=_('Developer');
136 $title_arr[]=_('Summary');
137 $title_arr[]=_('Open Date');
138 $title_arr[]=_('Last Modified');
139 echo $GLOBALS['HTML']->listTableTop ($title_arr);
142 foreach ($group->getUsers() as $member) {
145 $link = util_make_link_u ($member->getUnixName(), $member->getID(), $member->getRealName()) ;
146 if ( RBACEngine::getInstance()->isActionAllowedForUser($member,'project_admin',$group->getID())) {
147 echo '<strong>'.$link.'</strong>' ;
153 util_make_link ('/sendmessage.php?touser='.$member->getId(),
154 sprintf (_('Contact %s'),$member->getRealName())).'
157 $roles = RBACEngine::getInstance()->getAvailableRolesForUser ($member) ;
158 sortRoleList ($roles) ;
159 $role_names = array () ;
160 foreach ($roles as $role) {
161 if ($role->getHomeProject() && $role->getHomeProject()->getID() == $group->getID()) {
162 $role_names[] = $role->getName() ;
165 $role_string = implode (', ', $role_names) ;
167 $role_string = $user->getRole ($group)->getName() ;
171 <td align="center">'.$role_string.'
173 if(forge_get_config('use_people')) {
175 <td align="center">'.util_make_link('/people/viewprofile.php?user_id='.$member->getID(),_('View')).'
181 // print out all the artifacts assigned to this person
182 $artifact_group=db_query_params("SELECT group_artifact_id, name
183 FROM artifact_group_list
185 ORDER BY group_artifact_id DESC", array($group_id));
187 while ( $artifact_type =db_fetch_array($artifact_group) ) {
188 $artifacts=db_query_params("SELECT * FROM artifact_vw
191 AND group_artifact_id=$2
192 ORDER BY priority DESC", array($member->getID(), $artifact_type['group_artifact_id']));
194 $num_artifacts=db_numrows($artifacts);
195 for ($m=0; $m < $num_artifacts; $m++) {
197 <tr class="priority'.db_result($artifacts, $m, 'priority').'">
198 <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')).'
200 <td>'.db_result($artifacts, $m, 'summary').'</td>';
202 <td>'.GetTime( time() - db_result($artifacts, $m, 'open_date')) .'
205 $messages=db_query_params("select adddate FROM artifact_message_user_vw ".
206 "WHERE artifact_id=$1 ".
207 "ORDER by adddate DESC", array(db_result($artifacts, $m, 'artifact_id')));
208 if ( db_numrows($messages)) {
210 <td>'. GetTime( time () - db_result($messages, 0, 'adddate')).'</td>';
213 <td>'. GetTime( time () - db_result($artifacts, $m, 'open_date')).'</td>';
219 $task_group=db_query_params("SELECT ptv.*,g.group_name,pgl.project_name
220 FROM project_task_vw ptv,
221 project_assigned_to pat,
223 project_group_list pgl
224 WHERE ptv.project_task_id=pat.project_task_id
227 AND pgl.group_project_id=ptv.group_project_id
229 AND pat.assigned_to_id=$2
230 ORDER BY group_name,project_name",
231 array($group_id, $member->getID()));
233 while ( $task_type = db_fetch_array($task_group) ) {
234 if ( $task_type['percent_complete'] != 100 ) {
236 <tr class="priority'.$task_type['priority'].'">
237 <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']).'
239 <td>'.$task_type['summary'].'
241 <td>'.GetTime(time()-$task_type['start_date']).'
243 <td>'.$task_type['percent_complete'].'% done'.'
254 echo $GLOBALS['HTML']->listTableBottom();
256 site_project_footer(array());