3 * FusionForge User's Personal Page
5 * Copyright 1999-2001, VA Linux Systems, Inc.
6 * Copyright 2002-2004, GForge Team
7 * Copyright 2009, Roland Mas
9 * This file is part of FusionForge.
11 * FusionForge is free software; you can redistribute it and/or modify
12 * it under the terms of the GNU General Public License as published
13 * by the Free Software Foundation; either version 2 of the License,
14 * or (at your option) any later version.
16 * FusionForge is distributed in the hope that it will be useful, but
17 * WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19 * General Public License for more details.
21 * You should have received a copy of the GNU General Public License
22 * along with FusionForge; if not, write to the Free Software
23 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
27 require_once('../env.inc.php');
28 require_once $gfwww.'include/pre.php';
29 require_once $gfwww.'include/vote_function.php';
30 require_once $gfcommon.'tracker/ArtifactsForUser.class.php';
31 require_once $gfcommon.'forum/ForumsForUser.class.php';
32 require_once $gfcommon.'pm/ProjectTasksForUser.class.php';
34 if (!session_loggedin()) { // || $sf_user_hash) {
39 echo site_user_header(array('title'=>sprintf(_('Personal Page For %s'),user_getname())));
42 <script type="text/javascript" src="<?php echo util_make_url ('/tabber/tabber.js'); ?>"></script>
43 <div id="tabber" class="tabber" <?php plugin_hook('call_user_js');?>>
44 <?php if ($GLOBALS['sys_use_tracker']) { ?>
45 <div class="tabbertab"
46 title="<?php echo _('Assigned Artifacts'); ?>">
52 $order_name_arr=array();
53 $order_name_arr[]=_('ID');
54 $order_name_arr[]=_('Priority');
55 $order_name_arr[]=_('Summary');
56 echo $HTML->listTableTop($order_name_arr,'',$tabcnt);
58 $artifactsForUser = new ArtifactsForUser(session_get_user());
59 $assignedArtifacts =& $artifactsForUser->getAssignedArtifactsByGroup();
60 if (count($assignedArtifacts) > 0) {
62 foreach($assignedArtifacts as $art) {
63 if ($art->ArtifactType->getID() != $last_group) {
65 <tr><td colspan="3" class="tablecontent">'.
66 util_make_link ( '/tracker/?group_id='.$art->ArtifactType->Group->getID().'&atid='.$art->ArtifactType->getID(), $art->ArtifactType->Group->getPublicName().' - '.$art->ArtifactType->getName()).'</td></tr>';
70 <tr '. $HTML->boxGetAltRowStyle($i++) .'>
71 <td width="10%">'.$art->getID().'</td>
72 <td width="10%" class="priority'.$art->getPriority().'">'.$art->getPriority().'</td>
74 util_make_link ('/tracker/?func=detail&aid='.$art->getID().'&group_id='.$art->ArtifactType->Group->getID().'&atid='.$art->ArtifactType->getID(),$art->getSummary()).'</td></tr>';
76 $last_group = $art->ArtifactType->getID();
80 <tr><td colspan="3">'._('You have no open tracker items assigned to you.').'</td></tr>';
82 echo $HTML->listTableBottom();
86 <?php if ($GLOBALS['sys_use_pm']) { ?>
87 <div class="tabbertab"
88 title="<?php echo _('Assigned Tasks'); ?>">
95 $order_name_arr=array();
96 $order_name_arr[]=_('ID');
97 $order_name_arr[]=_('Priority');
98 $order_name_arr[]=_('Summary');
99 echo $HTML->listTableTop($order_name_arr,'',$tabcnt);
100 $projectTasksForUser = new ProjectTasksForUser(session_get_user());
101 $userTasks =& $projectTasksForUser->getTasksByGroupProjectName();
103 if (count($userTasks) > 0) {
105 foreach ($userTasks as $task) {
106 /* Deduce summary style */
109 if ($task->getPercentComplete()==100) {
110 $style_begin='<span style="text-decoration:underline">';
111 $style_end='</span>';
113 //if ($task->getProjectGroup()->getID() != $last_group) {
114 $projectGroup =& $task->getProjectGroup();
115 // Hack to prevent errors when there is an error.
118 $group =& $projectGroup->getGroup();
119 if ($projectGroup->getID() != $last_group) {
121 <tr><td colspan="3" class="tablecontent">'.
122 util_make_link ('/pm/task.php?group_id='.$group->getID().'&group_project_id='.$projectGroup->getID(),$group->getPublicName().' - '.$projectGroup->getName()).'</td></tr>';
125 <tr '. $HTML->boxGetAltRowStyle($i++) .'>
126 <td width="10%">'.$task->getID().'</td>
127 <td width="10%" class="priority'.$task->getPriority().'">'.$task->getPriority().'</td>
128 <td>'.util_make_link ('/pm/task.php?func=detailtask&project_task_id='.$task->getID().'&group_id='.$group->getID().'&group_project_id='.$projectGroup->getID(),$style_begin.$task->getSummary().$style_end).'</td></tr>';
130 $last_group = $projectGroup->getID();
134 <tr><td colspan="3" class="tablecontent">'._('You have no open tasks assigned to you.').'</td></tr>';
137 echo $HTML->listTableBottom();
141 <?php if ($GLOBALS['sys_use_tracker']) { ?>
142 <div class="tabbertab"
143 title="<?php echo _('Submitted Artifacts'); ?>">
147 $order_name_arr=array();
148 $order_name_arr[]=_('ID');
149 $order_name_arr[]=_('Priority');
150 $order_name_arr[]=_('Summary');
151 echo $HTML->listTableTop($order_name_arr,'',$tabcnt);
152 $artifactsForUser = new ArtifactsForUser(session_get_user());
153 $submittedArtifacts =& $artifactsForUser->getSubmittedArtifactsByGroup();
154 if (count($submittedArtifacts) > 0) {
156 foreach ($submittedArtifacts as $art) {
157 if ($art->ArtifactType->getID() != $last_group) {
159 <tr><td colspan="3" class="tablecontent">'.
160 util_make_link ('/tracker/?group_id='.$art->ArtifactType->Group->getID().'&atid='.$art->ArtifactType->getID(),$art->ArtifactType->Group->getPublicName().' - '.$art->ArtifactType->getName()).'</td></tr>';
163 <tr '. $HTML->boxGetAltRowStyle($i++) .'>
164 <td width="10%">'.$art->getID().'</td>
165 <td width="10%" class="priority'.$art->getPriority().'">'.$art->getPriority().'</td>
166 <td>'.util_make_link ('/tracker/?func=detail&aid='.$art->getID().'&group_id='.$art->ArtifactType->Group->getID().'&atid='.$art->ArtifactType->getID(),$art->getSummary()).'</td></tr>';
168 $last_group = $art->ArtifactType->getID();
172 <tr><td colspan="3" class="tablecontent">'._('You have no open tracker items submitted by you.').'</td></tr>';
174 echo $HTML->listTableBottom();
178 <?php if ($GLOBALS['sys_use_forum'] || $GLOBALS['sys_use_frs'] || $GLOBALS['sys_use_tracker']) { ?>
179 <div class="tabbertab" title="<?php echo _('Monitored Items'); ?>" >
182 Trackers that are actively monitored
184 if ($GLOBALS['sys_use_tracker']) {
188 $display_col=array('summary'=>1,
196 $order_name_arr=array();
198 $order_name_arr[]=_('Remove');
199 $order_name_arr[]=_('Monitored trackers');
201 echo $HTML->listTableTop($order_name_arr,'',$tabcnt);
203 $result = db_query_params ('SELECT groups.group_name,groups.group_id,groups.unix_group_name,groups.status,groups.type_id,user_group.admin_flags,role.role_name
204 FROM groups,user_group,role
205 WHERE groups.group_id=user_group.group_id
206 AND user_group.user_id=$1
208 AND user_group.role_id=role.role_id
209 ORDER BY group_name',
212 $rows = db_numrows ($result);
214 if ($result && $rows >= 1) {
216 for ($i=0; $i<$rows; $i++) {
217 $admin_flags = db_result($result, $i, 'admin_flags');
219 if (db_result($result, $i, 'type_id')==2) {
225 $group_id = db_result($result,$i,'group_id');
227 // get the Group object
229 $group =& group_get_object($group_id);
230 if (!$group || !is_object($group) || $group->isError()) {
234 $atf = new ArtifactTypeFactory($group);
235 if (!$group || !is_object($group) || $group->isError()) {
236 exit_error('Error','Could Not Get ArtifactTypeFactory');
239 $at_arr =& $atf->getArtifactTypes();
241 if (count ($at_arr) >= 1) {
242 foreach($at_arr as $at) {
243 if (!$at->isMonitoring()) {
247 if ($group->getID() != $last_group) {
249 <tr '. $HTML->boxGetAltRowStyle(1) .'><td colspan="2">'.util_make_link ('/tracker/?group_id='.$group->getID(),$group->getPublicName()).'</td></tr>';
251 $last_group = $group->getID() ;
253 echo '<tr '. $HTML->boxGetAltRowStyle(0) .'><td align="center">' ;
254 echo util_make_link ('/tracker/?group_id='.$group->getID().'&atid='.$at->getID().'&func=monitor',
255 '<img src="'. $HTML->imgroot . '/ic/trash.png" height="16" width="16" '.'border="0" alt="'._('Stop monitoring').'" />') ;
256 echo '</td><td width="99%">' ;
257 echo util_make_link ('/tracker/?group_id='.$group->getID().'&atid='.$at->getID(),
265 echo '<tr><td colspan="2" bgcolor="#FFFFFF"><center><strong>'._('You are not monitoring any trackers.').'</strong></center></td></tr>';
267 echo $HTML->listTableBottom();
270 Forums that are actively monitored
272 if ($GLOBALS['sys_use_forum']) {
275 $order_name_arr=array();
276 $order_name_arr[]=_('Remove');
277 $order_name_arr[]=_('Monitored Forums');
278 echo $HTML->listTableTop($order_name_arr,'',$tabcnt);
279 $forumsForUser = new ForumsForUser(session_get_user());
280 $forums = $forumsForUser->getMonitoredForums();
281 if (count($forums) < 1) {
282 echo '<tr><td colspan="2" bgcolor="#FFFFFF"><center><strong>'._('You are not monitoring any forums.').'</strong></center></td></tr>';
284 echo '<tr><td colspan="2" bgcolor="#FFFFFF"><center><strong>'.util_make_link ('/forum/myforums.php',_('My Monitored Forums')).'</strong></center></td></tr>';
285 foreach ($forums as $f) {
286 $group = $f->getGroup();
287 if ($group->getID() != $last_group) {
289 <tr '. $HTML->boxGetAltRowStyle(1) .'><td colspan="2">'.util_make_link ('/forum/?group_id='.$group->getID(),$group->getPublicName()).'</td></tr>';
293 <tr '. $HTML->boxGetAltRowStyle(0) .'><td align="center"><a href="'.util_make_url ('/forum/monitor.php?forum_id='.$f->getID().'&stop=1&group_id='.$group->getID()).'"><img src="'. $HTML->imgroot . '/ic/trash.png" height="16" width="16" '.
294 'border="0" alt="" /></a></td><td width="99%">'.util_make_link ('/forum/forum.php?forum_id='.$f->getID(),$f->getName()).'</td></tr>';
296 $last_group= $group->getID();
299 echo $HTML->listTableBottom();
302 Filemodules that are actively monitored
304 if ($GLOBALS['sys_use_frs']) {
307 $order_name_arr=array();
308 $order_name_arr[]=_('Remove');
309 $order_name_arr[]=_('Monitored FileModules');
310 echo $HTML->listTableTop($order_name_arr,'',$tabcnt);
313 $result=db_query_params ('SELECT groups.group_name,groups.unix_group_name,groups.group_id,frs_package.name,filemodule_monitor.filemodule_id
314 FROM groups,filemodule_monitor,frs_package
315 WHERE groups.group_id=frs_package.group_id AND groups.status = $1
316 AND frs_package.package_id=filemodule_monitor.filemodule_id
317 AND filemodule_monitor.user_id=$2 ORDER BY group_name DESC',
320 $rows=db_numrows($result);
321 if (!$result || $rows < 1) {
322 echo '<tr><td colspan="2" bgcolor="#FFFFFF"><center><strong>'._('You are not monitoring any files.').'</strong></center></td></tr>';
324 for ($i=0; $i<$rows; $i++) {
325 if (db_result($result,$i,'group_id') != $last_group) {
327 <tr '. $HTML->boxGetAltRowStyle($i) .'><td colspan="2">'.util_make_link_g (db_result($result,$i,'unix_group_name'),db_result($result,$i,'group_id'),db_result($result,$i,'group_name')).'</td></tr>';
330 <tr '. $HTML->boxGetAltRowStyle($i) .'><td style="text-align:center"><a href="'.util_make_url ('/frs/monitor.php?filemodule_id='.db_result($result,$i,'filemodule_id').'&group_id='.db_result($result,$i,'group_id').'&stop=1').'"><img src="'. $HTML->imgroot.'/ic/trash.png" height="16" width="16" '.
331 'border="0" alt=""/></a></td><td width="99%">'.util_make_link ('/frs/?group_id='.db_result($result,$i,'group_id'),db_result($result,$i,'name')).'</td></tr>';
333 $last_group=db_result($result,$i,'group_id');
336 echo $HTML->listTableBottom();
341 <?php if ($GLOBALS['sys_use_bookmarks']) { ?>
342 <div class="tabbertab" title="<?php echo _('My Bookmarks'); ?>" >
347 echo $HTML->boxTop(_('My Bookmarks'),false,false);
349 echo '<a href="'.util_make_url ('/my/bookmark_add.php').'">'._('Add bookmark').'</a><br/><br/>';
350 $result = db_query_params ('SELECT bookmark_url, bookmark_title, bookmark_id from user_bookmarks where
351 user_id=$1 ORDER BY bookmark_title',
352 array(user_getid() ));
353 $rows=db_numrows($result);
354 if (!$result || $rows < 1) {
356 <strong>'._('You currently do not have any bookmarks saved.').'</strong>';
359 for ($i=0; $i<$rows; $i++) {
361 <tr '. $HTML->boxGetAltRowStyle($i) .'><td style="text-align:center">
362 <a href="'.util_make_url ('/my/bookmark_delete.php?bookmark_id='. db_result($result,$i,'bookmark_id')).'">
363 <img src="'.$HTML->imgroot.'/ic/trash.png" height="16" width="16" border="0" alt="" /></a></td>
364 <td><strong><a href="'. db_result($result,$i,'bookmark_url') .'">'.
365 db_result($result,$i,'bookmark_title') .'</a></strong> '.
366 util_make_link ('/my/bookmark_edit.php?bookmark_id='. db_result($result,$i,'bookmark_id'),_('[Edit]'));
369 echo $HTML->boxBottom();
373 <div class="tabbertab" title="<?php echo _('Projects'); ?>" >
380 $order_name_arr=array();
381 $order_name_arr[]=_('Remove');
382 $order_name_arr[]=_('My Projects');
383 $order_name_arr[]=_('My Roles');
384 echo $HTML->listTableTop($order_name_arr,'',$tabcnt);
386 // Include both groups and foundries; developers should be similarly
387 // aware of membership in either.
388 $result = db_query_params ('SELECT groups.group_name,groups.group_id,groups.unix_group_name,groups.status,groups.type_id,user_group.admin_flags,role.role_name
389 FROM groups,user_group,role
390 WHERE groups.group_id=user_group.group_id
391 AND user_group.user_id=$1
393 AND user_group.role_id=role.role_id
394 ORDER BY group_name',
397 $rows=db_numrows($result);
398 if (!$result || $rows < 1) {
399 echo '<tr><td colspan="3" bgcolor="#FFFFFF"><strong>'._('You\'re not a member of any active projects').'</strong></td></tr>';
402 for ($i=0; $i<$rows; $i++) {
403 $admin_flags = db_result($result, $i, 'admin_flags');
404 if (stristr($admin_flags, 'A')) {
410 <tr '. $HTML->boxGetAltRowStyle($i) .'><td style="text-align:center">' ;
411 echo util_make_link ("/my/rmproject.php?group_id=" . db_result($result,$i,'group_id'),
412 '<img src="'.$HTML->imgroot.'ic/'.$img.'" alt="'._('Delete').'" height="16" width="16" border="0" />') ;
415 <td>'.util_make_link_g (db_result($result,$i,'unix_group_name'),db_result($result,$i,'group_id'),db_result($result,$i,'group_name')).'</td>
416 <td>'. htmlspecialchars(db_result($result,$i,'role_name')) .'</td></tr>';
419 echo $HTML->listTableBottom();
424 plugin_hook('call_user_cal') ;
428 echo site_user_footer(array());
434 // c-file-style: "bsd"