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('pre.php');
29 #require_once('common/tracker/ArtifactGroup.class');
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 =& group_get_object($group_id);
111 if (!$group || !is_object($group)) {
114 if ($group->isError()) {
115 if($group->isPermissionDeniedError()) {
116 exit_permission_denied($group->getErrorMessage());
118 exit_error(_('Error'), $group->getErrorMessage());
123 if (!$group_id && $form_grp) {
124 $group_id = $form_grp;
127 site_project_header(array('title'=>_('Project Member List'),'group'=>$group_id,'toptab'
130 echo _('<p>If you would like to contribute to this project by becoming a developer, contact one of the project admins, designated in bold text below.</p>');
133 $title_arr[]=_('Developer');
134 $title_arr[]=_('Summary');
135 $title_arr[]=_('Open Date');
136 $title_arr[]=_('Last Modified');
137 echo $GLOBALS['HTML']->listTableTop ($title_arr);
141 $query = "SELECT users.*,user_group.admin_flags,people_job_category.name AS role
142 FROM users,user_group
143 LEFT JOIN people_job_category ON user_group.member_role=people_job_category.category_id
144 WHERE users.user_id=user_group.user_id
145 AND user_group.group_id='$group_id'
147 ORDER BY users.user_name ";
149 $res_memb = db_query($query);
151 while ( $row_memb=db_fetch_array($res_memb) ) {
153 if ( trim($row_memb['admin_flags'])=='A' ) {
154 echo "\n\t\t<td><strong>".$row_memb['realname']."</strong></td>\n";
156 echo "\n\t\t<td>".$row_memb['realname']."</td>\n";
158 echo "\t\t<td><a href=\"".$GLOBALS['sys_urlprefix']."/sendmessage.php?touser=".$row_memb['user_id']."\">" . _('Contact') . "
160 "<a href=\"".$GLOBALS['sys_urlprefix']."/users/".
161 $row_memb['user_name']."/\">".$row_memb['user_name']."</a></td>
162 <td align=\"center\">".$row_memb['role']."</td>\n";
163 if($GLOBALS['sys_use_people']) {
164 echo "\t\t<td align=\"center\"><a href=\"".$GLOBALS['sys_urlprefix']."/people/viewprofile.php?user_id=".
165 $row_memb['user_id']."\">"._('View').
170 // print out all the artifacts assigned to this person
171 $artifact_group=db_query("SELECT group_artifact_id, name
172 FROM artifact_group_list
173 WHERE group_id=".$group_id."
174 ORDER BY group_artifact_id DESC");
176 while ( $artifact_type =db_fetch_array($artifact_group) ) {
177 $artifacts=db_query("SELECT * FROM artifact_vw
178 WHERE assigned_to=".$row_memb['user_id']."
180 AND group_artifact_id=".$artifact_type['group_artifact_id']."
181 ORDER BY priority DESC");
183 $num_artifacts=db_numrows($artifacts);
184 for ($m=0; $m < $num_artifacts; $m++) {
186 echo '<tr class="priority'.db_result($artifacts, $m, 'priority').'">';
188 echo '<td><a href="'.$GLOBALS['sys_urlprefix'].'/tracker/?func=detail&aid='.
189 db_result($artifacts, $m, 'artifact_id').
190 '&group_id='.$group_id.
191 '&atid='.$artifact_type['group_artifact_id'].
192 '">'.$artifact_type['name'].' '.db_result($artifacts, $m, 'artifact_id').
195 echo '<td>'.db_result($artifacts, $m, 'summary').'</td>';
198 echo '<td>'.GetTime( time() - db_result($artifacts, $m, 'open_date')) .'</td>';
199 # echo '<td>'. date($sys_datefmt,db_result($artifacts, $m, 'open_date')).'</td>';
201 $messages=db_query("select adddate FROM artifact_message_user_vw ".
202 "WHERE artifact_id='".db_result($artifacts, $m, 'artifact_id')."' ".
203 "ORDER by adddate DESC");
204 if ( db_numrows($messages)) {
205 echo '<td>'. GetTime( time () - db_result($messages, 0, 'adddate')).'</td>';
207 echo '<td>'. GetTime( time () - db_result($artifacts, $m, 'open_date')).'</td>';
212 $task_group=db_query("SELECT ptv.*,g.group_name,pgl.project_name
213 FROM project_task_vw ptv,
214 project_assigned_to pat,
216 project_group_list pgl
217 WHERE ptv.project_task_id=pat.project_task_id
218 AND pgl.group_id=".$group_id."
219 AND g.group_id=".$group_id."
220 AND pgl.group_project_id=ptv.group_project_id
222 AND pat.assigned_to_id='".$row_memb['user_id']."'
223 ORDER BY group_name,project_name");
225 while ( $task_type = db_fetch_array($task_group) ) {
226 if ( $task_type['percent_complete'] != 100 ) {
227 echo '<tr class="priority'.$task_type['priority'].'">';
229 echo '<td><a href="'.$GLOBALS['sys_urlprefix'].'/pm/task.php?func=detailtask&project_task_id='.
230 $task_type['project_task_id'].
231 '&group_id='.$group_id.
232 '&group_project_id='.$task_type['group_project_id'].
233 '">Task '.$task_type['project_task_id'].'</a></td>';
234 echo '<td>'.$task_type['summary'].'</td>';
236 echo '<td>'.GetTime(time()-$task_type['start_date']).'</td>';
237 echo '<td>'.$task_type['percent_complete'].'% done</td>';
241 echo "<tr><td><BR></td></tr>";
244 echo $HTML->boxBottom();
246 site_project_footer(array());