3 * GForge User's Personal Page
5 * Copyright 1999-2001 (c) VA Linux Systems
6 * The rest Copyright 2002-2004 (c) GForge Team
9 * This file is part of GForge.
11 * GForge is free software; you can redistribute it and/or modify
12 * it under the terms of the GNU General Public License as published by
13 * the Free Software Foundation; either version 2 of the License, or
14 * (at your option) any later version.
16 * GForge is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 * GNU General Public License for more details.
21 * You should have received a copy of the GNU General Public License
22 * along with GForge; if not, write to the Free Software
23 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
26 require_once('../env.inc.php');
27 require_once $gfwww.'include/pre.php';
28 require_once $gfwww.'include/vote_function.php';
29 require_once $gfcommon.'tracker/ArtifactsForUser.class.php';
30 require_once $gfcommon.'forum/ForumsForUser.class.php';
31 require_once $gfcommon.'pm/ProjectTasksForUser.class.php';
33 if (!session_loggedin()) { // || $sf_user_hash) {
41 //needs security audit
42 * If user has valid "remember-me" hash, instantiate not-logged in
45 if (!session_loggedin()) {
46 list($user_id,$hash)=explode('_',$sf_user_hash);
49 WHERE user_id='".$user_id."' AND user_pw LIKE '".$hash."%'";
51 $result=db_query($sql);
52 $rows=db_numrows($result);
53 if (!$result || $rows != 1) { exit_not_logged_in();
55 $user_id=db_result($result,0,'user_id');
56 session_get_user()=user_get_object($user_id,$result);
59 echo site_user_header(array('title'=>sprintf(_('Personal Page For %s'),user_getname())));
62 <script type="text/javascript" src="<?php echo util_make_url ('/tabber/tabber.js'); ?>"></script>
63 <div id="tabber" class="tabber" <?php plugin_hook('call_user_js');?>>
64 <?php if ($GLOBALS['sys_use_tracker']) { ?>
65 <div class="tabbertab"
66 title="<?php echo _('Assigned Artifacts'); ?>">
72 $order_name_arr=array();
73 $order_name_arr[]=_('ID');
74 $order_name_arr[]=_('Priority');
75 $order_name_arr[]=_('Summary');
76 echo $HTML->listTableTop($order_name_arr,'',$tabcnt);
78 $artifactsForUser = new ArtifactsForUser(session_get_user());
79 $assignedArtifacts =& $artifactsForUser->getAssignedArtifactsByGroup();
80 if (count($assignedArtifacts) > 0) {
82 foreach($assignedArtifacts as $art) {
83 if ($art->ArtifactType->getID() != $last_group) {
85 <tr><td colspan="3" class="tablecontent">'.
86 util_make_link ( '/tracker/?group_id='.$art->ArtifactType->Group->getID().'&atid='.$art->ArtifactType->getID(), $art->ArtifactType->Group->getPublicName().' - '.$art->ArtifactType->getName()).'</td></tr>';
90 <tr '. $HTML->boxGetAltRowStyle($i++) .'>
91 <td width="10%">'.$art->getID().'</td>
92 <td width="10%" class="priority'.$art->getPriority().'">'.$art->getPriority().'</td>
94 util_make_link ('/tracker/?func=detail&aid='.$art->getID().'&group_id='.$art->ArtifactType->Group->getID().'&atid='.$art->ArtifactType->getID(),$art->getSummary()).'</td></tr>';
96 $last_group = $art->ArtifactType->getID();
100 <tr><td colspan="3">'._('You have no open tracker items assigned to you.').'</td></tr>';
102 echo $HTML->listTableBottom();
106 <?php if ($GLOBALS['sys_use_pm']) { ?>
107 <div class="tabbertab"
108 title="<?php echo _('Assigned Tasks'); ?>">
115 $order_name_arr=array();
116 $order_name_arr[]=_('ID');
117 $order_name_arr[]=_('Priority');
118 $order_name_arr[]=_('Summary');
119 echo $HTML->listTableTop($order_name_arr,'',$tabcnt);
120 $projectTasksForUser = new ProjectTasksForUser(session_get_user());
121 $userTasks =& $projectTasksForUser->getTasksByGroupProjectName();
123 if (count($userTasks) > 0) {
125 foreach ($userTasks as $task) {
126 /* Deduce summary style */
129 if ($task->getPercentComplete()==100) {
130 $style_begin='<span style="text-decoration:underline">';
131 $style_end='</span>';
133 //if ($task->getProjectGroup()->getID() != $last_group) {
134 $projectGroup =& $task->getProjectGroup();
135 $group =& $projectGroup->getGroup();
136 if ($projectGroup->getID() != $last_group) {
138 <tr><td colspan="3" class="tablecontent">'.
139 util_make_link ('/pm/task.php?group_id='.$group->getID().'&group_project_id='.$projectGroup->getID(),$group->getPublicName().' - '.$projectGroup->getName()).'</td></tr>';
142 <tr '. $HTML->boxGetAltRowStyle($i++) .'>
143 <td width="10%">'.$task->getID().'</td>
144 <td width="10%" class="priority'.$task->getPriority().'">'.$task->getPriority().'</td>
145 <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>';
147 $last_group = $projectGroup->getID();
151 <tr><td colspan="3" class="tablecontent">'._('You have no open tasks assigned to you.').'</td></tr>';
154 echo $HTML->listTableBottom();
158 <?php if ($GLOBALS['sys_use_tracker']) { ?>
159 <div class="tabbertab"
160 title="<?php echo _('Submitted Artifacts'); ?>">
164 $order_name_arr=array();
165 $order_name_arr[]=_('ID');
166 $order_name_arr[]=_('Priority');
167 $order_name_arr[]=_('Summary');
168 echo $HTML->listTableTop($order_name_arr,'',$tabcnt);
169 $artifactsForUser = new ArtifactsForUser(session_get_user());
170 $submittedArtifacts =& $artifactsForUser->getSubmittedArtifactsByGroup();
171 if (count($submittedArtifacts) > 0) {
173 foreach ($submittedArtifacts as $art) {
174 if ($art->ArtifactType->getID() != $last_group) {
176 <tr><td colspan="3" class="tablecontent">'.
177 util_make_link ('/tracker/?group_id='.$art->ArtifactType->Group->getID().'&atid='.$art->ArtifactType->getID(),$art->ArtifactType->Group->getPublicName().' - '.$art->ArtifactType->getName()).'</td></tr>';
180 <tr '. $HTML->boxGetAltRowStyle($i++) .'>
181 <td width="10%">'.$art->getID().'</td>
182 <td width="10%" class="priority'.$art->getPriority().'">'.$art->getPriority().'</td>
183 <td>'.util_make_link ('/tracker/?func=detail&aid='.$art->getID().'&group_id='.$art->ArtifactType->Group->getID().'&atid='.$art->ArtifactType->getID(),$art->getSummary()).'</td></tr>';
185 $last_group = $art->ArtifactType->getID();
189 <tr><td colspan="3" class="tablecontent">'._('You have no open tracker items submitted by you.').'</td></tr>';
191 echo $HTML->listTableBottom();
195 <?php if ($GLOBALS['sys_use_forum'] || $GLOBALS['sys_use_frs']) { ?>
196 <div class="tabbertab" title="<?php echo _('Monitored Items'); ?>" >
199 Forums that are actively monitored
201 if ($GLOBALS['sys_use_forum']) {
204 $order_name_arr=array();
205 $order_name_arr[]=_('Remove');
206 $order_name_arr[]=_('Monitored Forums');
207 echo $HTML->listTableTop($order_name_arr,'',$tabcnt);
208 $forumsForUser = new ForumsForUser(session_get_user());
209 $forums = $forumsForUser->getMonitoredForums();
210 if (count($forums) < 1) {
211 echo '<tr><td colspan="2" bgcolor="#FFFFFF"><center><strong>'._('You are not monitoring any forums.').'</strong></center></td></tr>';
213 echo '<tr><td colspan="2" bgcolor="#FFFFFF"><center><strong>'.util_make_link ('/forum/myforums.php',_('My Monitored Forums')).'</strong></center></td></tr>';
214 foreach ($forums as $f) {
215 $group = $f->getGroup();
216 if ($group->getID() != $last_group) {
218 <tr '. $HTML->boxGetAltRowStyle(1) .'><td colspan="2">'.util_make_link ('/forum/?group_id='.$group->getID(),$group->getPublicName()).'</td></tr>';
222 <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" '.
223 'border="0" alt="" /></a></td><td width="99%">'.util_make_link ('/forum/forum.php?forum_id='.$f->getID(),$f->getName()).'</td></tr>';
225 $last_group= $group->getID();
228 echo $HTML->listTableBottom();
231 Filemodules that are actively monitored
233 if ($GLOBALS['sys_use_frs']) {
236 $order_name_arr=array();
237 $order_name_arr[]=_('Remove');
238 $order_name_arr[]=_('Monitored FileModules');
239 echo $HTML->listTableTop($order_name_arr,'',$tabcnt);
241 $sql="SELECT groups.group_name,groups.unix_group_name,groups.group_id,frs_package.name,filemodule_monitor.filemodule_id ".
242 "FROM groups,filemodule_monitor,frs_package ".
243 "WHERE groups.group_id=frs_package.group_id AND groups.status = 'A' ".
244 "AND frs_package.package_id=filemodule_monitor.filemodule_id ".
245 "AND filemodule_monitor.user_id='".user_getid()."' ORDER BY group_name DESC";
246 $result=db_query($sql);
247 $rows=db_numrows($result);
248 if (!$result || $rows < 1) {
249 echo '<tr><td colspan="2" bgcolor="#FFFFFF"><center><strong>'._('You are not monitoring any files.').'</strong></center></td></tr>';
251 for ($i=0; $i<$rows; $i++) {
252 if (db_result($result,$i,'group_id') != $last_group) {
254 <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>';
257 <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" '.
258 '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>';
260 $last_group=db_result($result,$i,'group_id');
263 echo $HTML->listTableBottom();
268 <?php if ($GLOBALS['sys_use_bookmarks']) { ?>
269 <div class="tabbertab" title="<?php echo _('My Bookmarks'); ?>" >
274 echo $HTML->boxTop(_('My Bookmarks'),false,false);
276 echo '<a href="'.util_make_url ('/my/bookmark_add.php').'">'._('Add bookmark').'</a><br/><br/>';
277 $result = db_query("SELECT bookmark_url, bookmark_title, bookmark_id from user_bookmarks where ".
278 "user_id='". user_getid() ."' ORDER BY bookmark_title");
279 $rows=db_numrows($result);
280 if (!$result || $rows < 1) {
282 <strong>'._('You currently do not have any bookmarks saved.').'</strong>';
285 for ($i=0; $i<$rows; $i++) {
287 <tr '. $HTML->boxGetAltRowStyle($i) .'><td style="text-align:center">
288 <a href="'.util_make_url ('/my/bookmark_delete.php?bookmark_id='. db_result($result,$i,'bookmark_id')).'">
289 <img src="'.$HTML->imgroot.'/ic/trash.png" height="16" width="16" border="0" alt="" /></a></td>
290 <td><strong><a href="'. db_result($result,$i,'bookmark_url') .'">'.
291 db_result($result,$i,'bookmark_title') .'</a></strong> '.
292 util_make_link ('/my/bookmark_edit.php?bookmark_id='. db_result($result,$i,'bookmark_id'),_('[Edit]'));
295 echo $HTML->boxBottom();
299 <div class="tabbertab" title="<?php echo _('Projects'); ?>" >
306 $order_name_arr=array();
307 $order_name_arr[]=_('Remove');
308 $order_name_arr[]=_('My Projects');
309 $order_name_arr[]=_('My Roles');
310 echo $HTML->listTableTop($order_name_arr,'',$tabcnt);
312 // Include both groups and foundries; developers should be similarly
313 // aware of membership in either.
314 $result = db_query("SELECT groups.group_name,"
316 . "groups.unix_group_name,"
319 . "user_group.admin_flags,"
321 . "FROM groups,user_group,role "
322 . "WHERE groups.group_id=user_group.group_id "
323 . "AND user_group.user_id='". user_getid() ."' "
324 . "AND groups.status='A' "
325 . "AND user_group.role_id=role.role_id "
326 . "ORDER BY group_name");
327 $rows=db_numrows($result);
328 if (!$result || $rows < 1) {
329 echo '<tr><td colspan="3" bgcolor="#FFFFFF"><strong>'._('You\'re not a member of any active projects').'</strong></td></tr>';
332 for ($i=0; $i<$rows; $i++) {
333 $admin_flags = db_result($result, $i, 'admin_flags');
334 if (stristr($admin_flags, 'A')) {
340 <tr '. $HTML->boxGetAltRowStyle($i) .'><td style="text-align:center">' ;
341 echo util_make_link ("/my/rmproject.php?group_id=" . db_result($result,$i,'group_id'),
342 '<img src="'.$HTML->imgroot.'ic/'.$img.'" alt="'._('Delete').'" height="16" width="16" border="0" />') ;
345 <td>'.util_make_link_g (db_result($result,$i,'unix_group_name'),db_result($result,$i,'group_id'),htmlspecialchars(db_result($result,$i,'group_name'))).'</td>
346 <td>'. htmlspecialchars(db_result($result,$i,'role_name')) .'</td></tr>';
349 echo $HTML->listTableBottom();
354 plugin_hook('call_user_cal') ;
358 echo site_user_footer(array());
364 // c-file-style: "bsd"