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_uri ('/tabber/tabber.js'); ?>"></script>
43 <div id="tabber" class="tabber tabber-user-homepage" <?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);
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'); ?>">
94 $order_name_arr=array();
95 $order_name_arr[]=_('ID');
96 $order_name_arr[]=_('Priority');
97 $order_name_arr[]=_('Summary');
98 echo $HTML->listTableTop($order_name_arr);
99 $projectTasksForUser = new ProjectTasksForUser(session_get_user());
100 $userTasks =& $projectTasksForUser->getTasksByGroupProjectName();
102 if (count($userTasks) > 0) {
104 foreach ($userTasks as $task) {
105 /* Deduce summary style */
108 if ($task->getPercentComplete()==100) {
109 $style_begin='<span style="text-decoration:underline">';
110 $style_end='</span>';
112 //if ($task->getProjectGroup()->getID() != $last_group) {
113 $projectGroup =& $task->getProjectGroup();
114 // Hack to prevent errors when there is an error.
117 $group =& $projectGroup->getGroup();
118 if ($projectGroup->getID() != $last_group) {
120 <tr><td colspan="3" class="tablecontent">'.
121 util_make_link ('/pm/task.php?group_id='.$group->getID().'&group_project_id='.$projectGroup->getID(),$group->getPublicName().' - '.$projectGroup->getName()).'</td></tr>';
124 <tr '. $HTML->boxGetAltRowStyle($i++) .'>
125 <td width="10%">'.$task->getID().'</td>
126 <td width="10%" class="priority'.$task->getPriority().'">'.$task->getPriority().'</td>
127 <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>';
129 $last_group = $projectGroup->getID();
133 <tr><td colspan="3" class="tablecontent">'._('You have no open tasks assigned to you.').'</td></tr>';
136 echo $HTML->listTableBottom();
140 <?php if ($GLOBALS['sys_use_tracker']) { ?>
141 <div class="tabbertab"
142 title="<?php echo _('Submitted Artifacts'); ?>">
145 $order_name_arr=array();
146 $order_name_arr[]=_('ID');
147 $order_name_arr[]=_('Priority');
148 $order_name_arr[]=_('Summary');
149 echo $HTML->listTableTop($order_name_arr);
150 $artifactsForUser = new ArtifactsForUser(session_get_user());
151 $submittedArtifacts =& $artifactsForUser->getSubmittedArtifactsByGroup();
152 if (count($submittedArtifacts) > 0) {
154 foreach ($submittedArtifacts as $art) {
155 if ($art->ArtifactType->getID() != $last_group) {
157 <tr><td colspan="3" class="tablecontent">'.
158 util_make_link ('/tracker/?group_id='.$art->ArtifactType->Group->getID().'&atid='.$art->ArtifactType->getID(),$art->ArtifactType->Group->getPublicName().' - '.$art->ArtifactType->getName()).'</td></tr>';
161 <tr '. $HTML->boxGetAltRowStyle($i++) .'>
162 <td width="10%">'.$art->getID().'</td>
163 <td width="10%" class="priority'.$art->getPriority().'">'.$art->getPriority().'</td>
164 <td>'.util_make_link ('/tracker/?func=detail&aid='.$art->getID().'&group_id='.$art->ArtifactType->Group->getID().'&atid='.$art->ArtifactType->getID(),$art->getSummary()).'</td></tr>';
166 $last_group = $art->ArtifactType->getID();
170 <tr><td colspan="3" class="tablecontent">'._('You have no open tracker items submitted by you.').'</td></tr>';
172 echo $HTML->listTableBottom();
176 <?php if ($GLOBALS['sys_use_forum'] || $GLOBALS['sys_use_frs'] || $GLOBALS['sys_use_tracker']) { ?>
177 <div class="tabbertab" title="<?php echo _('Monitored Items'); ?>" >
180 Trackers that are actively monitored
182 if ($GLOBALS['sys_use_tracker']) {
185 $display_col=array('summary'=>1,
193 $order_name_arr=array();
195 $order_name_arr[]=_('Remove');
196 $order_name_arr[]=_('Monitored trackers');
198 echo $HTML->listTableTop($order_name_arr);
200 $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
201 FROM groups,user_group,role
202 WHERE groups.group_id=user_group.group_id
203 AND user_group.user_id=$1
205 AND user_group.role_id=role.role_id
206 ORDER BY group_name',
209 $rows = db_numrows ($result);
211 if ($result && $rows >= 1) {
213 for ($i=0; $i<$rows; $i++) {
214 $admin_flags = db_result($result, $i, 'admin_flags');
216 if (db_result($result, $i, 'type_id')==2) {
222 $group_id = db_result($result,$i,'group_id');
224 // get the Group object
226 $group =& group_get_object($group_id);
227 if (!$group || !is_object($group) || $group->isError()) {
231 $atf = new ArtifactTypeFactory($group);
232 if (!$group || !is_object($group) || $group->isError()) {
233 exit_error('Error','Could Not Get ArtifactTypeFactory');
236 $at_arr =& $atf->getArtifactTypes();
238 if (count ($at_arr) >= 1) {
239 foreach($at_arr as $at) {
240 if (!$at->isMonitoring()) {
244 if ($group->getID() != $last_group) {
246 <tr '. $HTML->boxGetAltRowStyle(1) .'><td colspan="2">'.util_make_link ('/tracker/?group_id='.$group->getID(),$group->getPublicName()).'</td></tr>';
248 $last_group = $group->getID() ;
250 echo '<tr '. $HTML->boxGetAltRowStyle(0) .'><td align="center">' ;
251 echo util_make_link ('/tracker/?group_id='.$group->getID().'&atid='.$at->getID().'&func=monitor',
252 '<img src="'. $HTML->imgroot . '/ic/trash.png" height="16" width="16" '.'border="0" alt="'._('Stop monitoring').'" />') ;
253 echo '</td><td width="99%">' ;
254 echo util_make_link ('/tracker/?group_id='.$group->getID().'&atid='.$at->getID(),
262 echo '<tr><td colspan="2" bgcolor="#FFFFFF"><center><strong>'._('You are not monitoring any trackers.').'</strong></center></td></tr>';
264 echo $HTML->listTableBottom();
267 Forums that are actively monitored
269 if ($GLOBALS['sys_use_forum']) {
271 $order_name_arr=array();
272 $order_name_arr[]=_('Remove');
273 $order_name_arr[]=_('Monitored Forums');
274 echo $HTML->listTableTop($order_name_arr);
275 $forumsForUser = new ForumsForUser(session_get_user());
276 $forums = $forumsForUser->getMonitoredForums();
277 if (count($forums) < 1) {
278 echo '<tr><td colspan="2"><strong>'._('You are not monitoring any forums.').'</strong></td></tr>';
280 echo '<tr><td colspan="2"><strong>'.util_make_link ('/forum/myforums.php',_('My Monitored Forums')).'</strong></td></tr>';
281 foreach ($forums as $f) {
282 $group = $f->getGroup();
283 if ($group->getID() != $last_group) {
285 <tr '. $HTML->boxGetAltRowStyle(1) .'><td colspan="2">'.util_make_link ('/forum/?group_id='.$group->getID(),$group->getPublicName()).'</td></tr>';
289 <tr '. $HTML->boxGetAltRowStyle(0) .'><td class="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" '.
290 'border="0" alt="" /></a></td><td width="99%">'.util_make_link ('/forum/forum.php?forum_id='.$f->getID(),$f->getName()).'</td></tr>';
292 $last_group= $group->getID();
295 echo $HTML->listTableBottom();
298 Filemodules that are actively monitored
300 if ($GLOBALS['sys_use_frs']) {
302 $order_name_arr=array();
303 $order_name_arr[]=_('Remove');
304 $order_name_arr[]=_('Monitored FileModules');
305 echo $HTML->listTableTop($order_name_arr);
308 $result=db_query_params ('SELECT groups.group_name,groups.unix_group_name,groups.group_id,frs_package.name,filemodule_monitor.filemodule_id
309 FROM groups,filemodule_monitor,frs_package
310 WHERE groups.group_id=frs_package.group_id AND groups.status = $1
311 AND frs_package.package_id=filemodule_monitor.filemodule_id
312 AND filemodule_monitor.user_id=$2 ORDER BY group_name DESC',
315 $rows=db_numrows($result);
316 if (!$result || $rows < 1) {
317 echo '<tr><td colspan="2"><strong>'._('You are not monitoring any files.').'</strong></td></tr>';
319 for ($i=0; $i<$rows; $i++) {
320 if (db_result($result,$i,'group_id') != $last_group) {
322 <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>';
325 <tr '. $HTML->boxGetAltRowStyle($i) .'><td class="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" '.
326 '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>';
328 $last_group=db_result($result,$i,'group_id');
331 echo $HTML->listTableBottom();
333 plugin_hook ("monitored_element",false);
337 <?php if ($GLOBALS['sys_use_bookmarks']) { ?>
338 <div class="tabbertab" title="<?php echo _('My Bookmarks'); ?>" >
343 echo $HTML->boxTop(_('My Bookmarks'), 'My_Bookmarks');
345 echo '<a href="'.util_make_url ('/my/bookmark_add.php').'">'._('Add bookmark').'</a><br/><br/>';
346 $result = db_query_params ('SELECT bookmark_url, bookmark_title, bookmark_id from user_bookmarks where
347 user_id=$1 ORDER BY bookmark_title',
348 array(user_getid() ));
349 $rows=db_numrows($result);
350 if (!$result || $rows < 1) {
352 <strong>'._('You currently do not have any bookmarks saved.').'</strong>';
355 for ($i=0; $i<$rows; $i++) {
357 <tr '. $HTML->boxGetAltRowStyle($i) .'><td class="align-center">
358 <a href="'.util_make_url ('/my/bookmark_delete.php?bookmark_id='. db_result($result,$i,'bookmark_id')).'">
359 <img src="'.$HTML->imgroot.'/ic/trash.png" height="16" width="16" border="0" alt="" /></a></td>
360 <td><strong><a href="'. db_result($result,$i,'bookmark_url') .'">'.
361 db_result($result,$i,'bookmark_title') .'</a></strong> '.
362 util_make_link ('/my/bookmark_edit.php?bookmark_id='. db_result($result,$i,'bookmark_id'),_('[Edit]'));
365 echo $HTML->boxBottom();
369 <div class="tabbertab" title="<?php echo _('Projects'); ?>" >
375 $order_name_arr=array();
376 $order_name_arr[]=_('Remove');
377 $order_name_arr[]=_('My Projects');
378 $order_name_arr[]=_('My Roles');
379 echo $HTML->listTableTop($order_name_arr);
381 // Include both groups and foundries; developers should be similarly
382 // aware of membership in either.
383 $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
384 FROM groups,user_group,role
385 WHERE groups.group_id=user_group.group_id
386 AND user_group.user_id=$1
388 AND user_group.role_id=role.role_id
389 ORDER BY group_name',
392 $rows=db_numrows($result);
393 if (!$result || $rows < 1) {
394 echo '<tr><td colspan="3"><strong>'._('You\'re not a member of any active projects').'</strong></td></tr>';
397 for ($i=0; $i<$rows; $i++) {
398 $admin_flags = db_result($result, $i, 'admin_flags');
399 if (stristr($admin_flags, 'A')) {
405 <tr '. $HTML->boxGetAltRowStyle($i) .'><td class="align-center">' ;
406 echo util_make_link ("/my/rmproject.php?group_id=" . db_result($result,$i,'group_id'),
407 '<img src="'.$HTML->imgroot.'ic/'.$img.'" alt="'._('Delete').'" height="16" width="16" border="0" />') ;
410 <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>
411 <td>'. htmlspecialchars(db_result($result,$i,'role_name')) .'</td></tr>';
414 echo $HTML->listTableBottom();
419 plugin_hook('call_user_cal') ;
423 echo site_user_footer(array());
429 // c-file-style: "bsd"