3 * Project Members Information
5 * Portions Copyright 1999-2001 (c) VA Linux Systems
6 * The rest Copyright 2002-2004 (c) GForge Team
10 * This file is part of GForge.
12 * GForge is free software; you can redistribute it and/or modify
13 * it under the terms of the GNU General Public License as published by
14 * the Free Software Foundation; either version 2 of the License, or
15 * (at your option) any later version.
17 * GForge is distributed in the hope that it will be useful,
18 * but WITHOUT ANY WARRANTY; without even the implied warranty of
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 * GNU General Public License for more details.
22 * You should have received a copy of the GNU General Public License
23 * along with GForge; if not, write to the Free Software
24 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
27 require_once('../../env.inc.php');
28 require_once $gfwww.'include/pre.php';
29 #require_once('common/tracker/ArtifactGroup.class.php');
31 function GetTime ($timedifference) {
33 if ($timedifference >= 0) {
35 $mval = ($timedifference / 2592000);
36 $monthval = intval($mval);
38 return "$monthval Months Ago";
41 $wval = ($timedifference / 604800);
42 $weektime = intval($wval);
44 return "$weektime Weeks Ago";
47 $dval = ($timedifference / 86400) ;
48 $daytime = intval($dval);
50 return "$daytime Days Ago";
53 $hval = ($timedifference / 3600);
54 $hourtime = intval($hval);
56 return "$hourtime Hours Ago";
59 $mval = ($timedifference / 60);
60 $minutetime = intval($mval);
61 if ( $minutetime > 1 ) {
62 return "$minutetime Minutes Ago";
65 return "$timedifference Seconds Ago";
69 $timedifference=abs($timedifference);
71 $mval = ($timedifference / 2592000);
72 $monthval = intval($mval);
74 return "Next $monthval Months";
77 $wval = ($timedifference / 604800);
78 $weektime = intval($wval);
80 return "Next $weektime Weeks";
83 $dval = ($timedifference / 86400) ;
84 $daytime = intval($dval);
86 return "Next $daytime Days";
89 $hval = ($timedifference / 3600);
90 $hourtime = intval($hval);
92 return "Next $hourtime Hours";
95 $mval = ($timedifference / 60);
96 $minutetime = intval($mval);
97 if ( $minutetime > 1 ) {
98 return "Next $minutetime Minutes";
101 return "Next $timedifference Seconds";
108 // get the Group object
110 $group_id = getIntFromRequest('group_id');
112 $group =& group_get_object($group_id);
113 if (!$group || !is_object($group)) {
116 if ($group->isError()) {
117 if($group->isPermissionDeniedError()) {
118 exit_permission_denied($group->getErrorMessage());
120 exit_error(_('Error'), $group->getErrorMessage());
125 if (!$group_id && $form_grp) {
126 $group_id = $form_grp;
129 site_project_header(array('title'=>_('Project Member List'),'group'=>$group_id,'toptab'=>'memberlist'));
132 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.');
136 $title_arr[]=_('Developer');
137 $title_arr[]=_('Summary');
138 $title_arr[]=_('Open Date');
139 $title_arr[]=_('Last Modified');
140 echo $GLOBALS['HTML']->listTableTop ($title_arr);
144 $res_memb = db_query_params("SELECT users.*,user_group.admin_flags,people_job_category.name AS role
145 FROM users,user_group
146 LEFT JOIN people_job_category ON user_group.member_role=people_job_category.category_id
147 WHERE users.user_id=user_group.user_id
148 AND user_group.group_id=$1
150 ORDER BY users.user_name ", array($group_id));
152 while ( $row_memb=db_fetch_array($res_memb) ) {
155 if ( trim($row_memb['admin_flags'])=='A' ) {
157 <td><strong>'.$row_memb['realname'].'</strong></td>';
160 <td>'.$row_memb['realname'].'</td>';
164 util_make_link ('/sendmessage.php?touser='.$row_memb['user_id'],_('Contact')).' '.
165 util_make_link_u ($row_memb['user_name'],$row_memb['user_id'],$row_memb['user_name']).'
167 <td align="center">'.$row_memb['role'].'
169 if(forge_get_config('use_people')) {
171 <td align="center">'.util_make_link('/people/viewprofile.php?user_id='.$row_memb['user_id'],_('View')).'
177 // print out all the artifacts assigned to this person
178 $artifact_group=db_query_params("SELECT group_artifact_id, name
179 FROM artifact_group_list
181 ORDER BY group_artifact_id DESC", array($group_id));
183 while ( $artifact_type =db_fetch_array($artifact_group) ) {
184 $artifacts=db_query_params("SELECT * FROM artifact_vw
187 AND group_artifact_id=$2
188 ORDER BY priority DESC", array($row_memb['user_id'], $artifact_type['group_artifact_id']));
190 $num_artifacts=db_numrows($artifacts);
191 for ($m=0; $m < $num_artifacts; $m++) {
193 <tr class="priority'.db_result($artifacts, $m, 'priority').'">
194 <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')).'
196 <td>'.db_result($artifacts, $m, 'summary').'</td>';
198 <td>'.GetTime( time() - db_result($artifacts, $m, 'open_date')) .'
201 $messages=db_query_params("select adddate FROM artifact_message_user_vw ".
202 "WHERE artifact_id=$1 ".
203 "ORDER by adddate DESC", array(db_result($artifacts, $m, 'artifact_id')));
204 if ( db_numrows($messages)) {
206 <td>'. GetTime( time () - db_result($messages, 0, 'adddate')).'</td>';
209 <td>'. GetTime( time () - db_result($artifacts, $m, 'open_date')).'</td>';
215 $task_group=db_query_params("SELECT ptv.*,g.group_name,pgl.project_name
216 FROM project_task_vw ptv,
217 project_assigned_to pat,
219 project_group_list pgl
220 WHERE ptv.project_task_id=pat.project_task_id
223 AND pgl.group_project_id=ptv.group_project_id
225 AND pat.assigned_to_id=$2
226 ORDER BY group_name,project_name",
227 array($group_id, $row_memb['user_id']));
229 while ( $task_type = db_fetch_array($task_group) ) {
230 if ( $task_type['percent_complete'] != 100 ) {
232 <tr class="priority'.$task_type['priority'].'">
233 <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']).'
235 <td>'.$task_type['summary'].'
237 <td>'.GetTime(time()-$task_type['start_date']).'
239 <td>'.$task_type['percent_complete'].'% done'.'
250 echo $HTML->boxBottom();
252 site_project_footer(array());