3 * GForge User's Personal Page
5 * Copyright 1999-2001 (c) VA Linux Systems
6 * The rest Copyright 2002-2004 (c) GForge Team
11 * This file is part of GForge.
13 * GForge is free software; you can redistribute it and/or modify
14 * it under the terms of the GNU General Public License as published by
15 * the Free Software Foundation; either version 2 of the License, or
16 * (at your option) any later version.
18 * GForge is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU General Public License for more details.
23 * You should have received a copy of the GNU General Public License
24 * along with GForge; if not, write to the Free Software
25 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
28 require_once('../env.inc.php');
29 require_once('pre.php');
30 require_once('vote_function.php');
31 require_once('common/tracker/ArtifactsForUser.class');
32 require_once('common/forum/ForumsForUser.class');
33 require_once('common/pm/ProjectTasksForUser.class');
35 if (!session_loggedin()) { // || $sf_user_hash) {
43 //needs security audit
44 * If user has valid "remember-me" hash, instantiate not-logged in
47 if (!session_loggedin()) {
48 list($user_id,$hash)=explode('_',$sf_user_hash);
51 WHERE user_id='".$user_id."' AND user_pw LIKE '".$hash."%'";
53 $result=db_query($sql);
54 $rows=db_numrows($result);
55 if (!$result || $rows != 1) { exit_not_logged_in();
57 $user_id=db_result($result,0,'user_id');
58 session_get_user()=user_get_object($user_id,$result);
61 echo site_user_header(array('title'=>$Language->getText('my','title',user_getname())));
64 <script type="text/javascript" src="<?php echo $GLOBALS['sys_urlprefix']; ?>/tabber/tabber.js"></script>
65 <div id="tabber" class="tabber" <? plugin_hook('call_user_js');?>>
66 <div class="tabbertab"
67 title="<?php echo $Language->getText('my','assignedartifacts'); ?>">
73 $order_name_arr=array();
74 $order_name_arr[]=$Language->getText('tracker','id');
75 $order_name_arr[]=$Language->getText('tracker','priority');
76 $order_name_arr[]=$Language->getText('tracker','summary');
77 echo $HTML->listTableTop($order_name_arr,'',$tabcnt);
79 $artifactsForUser = new ArtifactsForUser(session_get_user());
80 $assignedArtifacts =& $artifactsForUser->getAssignedArtifactsByGroup();
81 if (count($assignedArtifacts) > 0) {
83 foreach($assignedArtifacts as $art) {
84 if ($art->ArtifactType->getID() != $last_group) {
86 <tr><td colspan="3" class="tablecontent"><a href="'.$GLOBALS['sys_urlprefix'].'/tracker/?group_id='.
87 $art->ArtifactType->Group->getID().'&atid='.
88 $art->ArtifactType->getID().'">'.
89 $art->ArtifactType->Group->getPublicName().' - '.
90 $art->ArtifactType->getName().'</a></td></tr>';
94 <tr '. $HTML->boxGetAltRowStyle($i++) .'>
95 <td width="10%">'.$art->getID().'</td>
96 <td width="10%" class="priority'.$art->getPriority().'">'.$art->getPriority().'</td>
97 <td><a href="'.$GLOBALS['sys_urlprefix'].'/tracker/?func=detail&aid='.
99 '&group_id='.$art->ArtifactType->Group->getID().
100 '&atid='.$art->ArtifactType->getID().'">' . $art->getSummary() . '</a>';
103 $last_group = $art->ArtifactType->getID();
107 <tr><td colspan="3">'.$Language->getText('my', 'no_tracker_items_assigned').'</td></tr>';
109 echo $HTML->listTableBottom();
113 <div class="tabbertab"
114 title="<?php echo $Language->getText('my','assignedtasks'); ?>">
121 $order_name_arr=array();
122 $order_name_arr[]=$Language->getText('tracker','id');
123 $order_name_arr[]=$Language->getText('tracker','priority');
124 $order_name_arr[]=$Language->getText('tracker','summary');
125 echo $HTML->listTableTop($order_name_arr,'',$tabcnt);
126 $projectTasksForUser = new ProjectTasksForUser(session_get_user());
127 $userTasks =& $projectTasksForUser->getTasksByGroupProjectName();
129 if (count($userTasks) > 0) {
131 foreach ($userTasks as $task) {
132 /* Deduce summary style */
135 if ($task->getPercentComplete()==100) {
136 $style_begin='<span style="text-decoration:underline">';
137 $style_end='</span>';
139 //if ($task->getProjectGroup()->getID() != $last_group) {
140 $projectGroup =& $task->getProjectGroup();
141 $group =& $projectGroup->getGroup();
142 if ($projectGroup->getID() != $last_group) {
144 <tr><td colspan="3" class="tablecontent"><a href="'.$GLOBALS['sys_urlprefix'].'/pm/task.php?group_id='.
146 '&group_project_id='.
147 $projectGroup->getID().'">'.
148 $group->getPublicName().' - '.
149 $projectGroup->getName().'</a></td></tr>';
152 <tr '. $HTML->boxGetAltRowStyle($i++) .'>
153 <td width="10%">'.$task->getID().'</td>
154 <td width="10%" class="priority'.$task->getPriority().'">'.$task->getPriority().'</td>
155 <td><a href="'.$GLOBALS['sys_urlprefix'].'/pm/task.php?func=detailtask&project_task_id='.
157 '&group_id='.$group->getID().
158 '&group_project_id='.$projectGroup->getID().'">'.$style_begin.$task->getSummary().$style_end.'</a>';
161 $last_group = $projectGroup->getID();
165 <tr><td colspan="3" class="tablecontent">'.$Language->getText('my', 'no_open_tasks').'</td></tr>';
168 echo $HTML->listTableBottom();
171 <div class="tabbertab"
172 title="<?php echo $Language->getText('my','submittedartifacts'); ?>">
176 $order_name_arr=array();
177 $order_name_arr[]=$Language->getText('tracker','id');
178 $order_name_arr[]=$Language->getText('tracker','priority');
179 $order_name_arr[]=$Language->getText('tracker','summary');
180 echo $HTML->listTableTop($order_name_arr,'',$tabcnt);
181 $submittedArtifacts =& $artifactsForUser->getSubmittedArtifactsByGroup();
182 if (count($submittedArtifacts) > 0) {
184 foreach ($submittedArtifacts as $art) {
185 if ($art->ArtifactType->getID() != $last_group) {
187 <tr><td colspan="3" class="tablecontent"><a href="'.$GLOBALS['sys_urlprefix'].'/tracker/?group_id='.
188 $art->ArtifactType->Group->getID().'&atid='.
189 $art->ArtifactType->getID().'">'.
190 $art->ArtifactType->Group->getPublicName().' - '.
191 $art->ArtifactType->getName().'</a></td></tr>';
194 <tr '. $HTML->boxGetAltRowStyle($i++) .'>
195 <td width="10%">'.$art->getID().'</td>
196 <td width="10%" class="priority'.$art->getPriority().'">'.$art->getPriority().'</td>
197 <td><a href="'.$GLOBALS['sys_urlprefix'].'/tracker/?func=detail&aid='.
199 '&group_id='.$art->ArtifactType->Group->getID().
200 '&atid='.$art->ArtifactType->getID().'">' . $art->getSummary() .'</a>';
203 $last_group = $art->ArtifactType->getID();
207 <tr><td colspan="3" class="tablecontent">'.$Language->getText('my', 'no_tracker_items_submitted').'</td></tr>';
209 echo $HTML->listTableBottom();
212 <div class="tabbertab" title="<?php echo $Language->getText('mytab','monitoring'); ?>" >
215 Forums that are actively monitored
219 $order_name_arr=array();
220 $order_name_arr[]=$Language->getText('general','remove');
221 $order_name_arr[]=$Language->getText('my','monitoredforum');
222 echo $HTML->listTableTop($order_name_arr,'',$tabcnt);
223 $forumsForUser = new ForumsForUser(session_get_user());
224 $forums =& $forumsForUser->getMonitoredForums();
225 if (count($forums) < 1) {
226 echo '<tr><td colspan="2" bgcolor="#FFFFFF"><center><strong>'.$Language->getText('my', 'no_monitored_forums').'</strong></center></td></tr>';
228 echo '<tr><td colspan="2" bgcolor="#FFFFFF"><center><strong><a href="'.$GLOBALS['sys_urlprefix'].'/forum/myforums.php">' . $Language->getText('forum_myforums','myforums') . '</a></strong></center></td></tr>';
229 foreach ($forums as $f) {
230 $group = $f->getGroup();
231 if ($group->getID() != $last_group) {
233 <tr '. $HTML->boxGetAltRowStyle($i) .'><td colspan="2"><a href="'.$GLOBALS['sys_urlprefix'].'/forum/?group_id='.
234 $group->getID().'">'.
235 $group->getPublicName().'</a></td></tr>';
239 <tr '. $HTML->boxGetAltRowStyle($i) .'><td align="center"><a href="'.$GLOBALS['sys_urlprefix'].'/forum/monitor.php?forum_id='.$f->getID().
240 '&stop=1&group_id='.$group->getID().'"><img src="'. $HTML->imgroot . '/ic/trash.png" height="16" width="16" '.
241 'border="0" alt="" /></a></td><td width="99%"><a href="'.$GLOBALS['sys_urlprefix'].'/forum/forum.php?forum_id='.
243 $f->getName().'</a></td></tr>';
245 $last_group= $group->getID();
248 echo $HTML->listTableBottom();
251 Filemodules that are actively monitored
255 $order_name_arr=array();
256 $order_name_arr[]=$Language->getText('general','remove');
257 $order_name_arr[]=$Language->getText('my','monitoredfile');
258 echo $HTML->listTableTop($order_name_arr,'',$tabcnt);
260 $sql="SELECT groups.group_name,groups.group_id,frs_package.name,filemodule_monitor.filemodule_id ".
261 "FROM groups,filemodule_monitor,frs_package ".
262 "WHERE groups.group_id=frs_package.group_id AND groups.status = 'A' ".
263 "AND frs_package.package_id=filemodule_monitor.filemodule_id ".
264 "AND filemodule_monitor.user_id='".user_getid()."' ORDER BY group_name DESC";
265 $result=db_query($sql);
266 $rows=db_numrows($result);
267 if (!$result || $rows < 1) {
268 echo '<tr><td colspan="2" bgcolor="#FFFFFF"><center><strong>'.$Language->getText('my', 'no_monitored_filemodules').'</strong></center></td></tr>';
270 for ($i=0; $i<$rows; $i++) {
271 if (db_result($result,$i,'group_id') != $last_group) {
273 <tr '. $HTML->boxGetAltRowStyle($i) .'><td colspan="2"><a href="'.$GLOBALS['sys_urlprefix'].'/project/?group_id='.
274 db_result($result,$i,'group_id').'">'.
275 db_result($result,$i,'group_name').'</a></td></tr>';
278 <tr '. $HTML->boxGetAltRowStyle($i) .'><td align="center"><a href="'.$GLOBALS['sys_urlprefix'].'/frs/monitor.php?filemodule_id='.
279 db_result($result,$i,'filemodule_id').
280 '&group_id='.db_result($result,$i,'group_id'). '&stop=1"><img src="'. $HTML->imgroot.'/ic/trash.png" height="16" width="16" '.
281 'border="0" alt=""/></a></td><td width="99%"><a href="'.$GLOBALS['sys_urlprefix'].'/frs/?group_id='.
282 db_result($result,$i,'group_id').'">'.
283 db_result($result,$i,'name').'</a></td></tr>';
285 $last_group=db_result($result,$i,'group_id');
288 echo $HTML->listTableBottom();
292 <div class="tabbertab" title="<?php echo $Language->getText('mytab','project'); ?>" >
297 echo $HTML->boxMiddle($Language->getText('my', 'bookmarks'),false,false);
299 $result = db_query("SELECT bookmark_url, bookmark_title, bookmark_id from user_bookmarks where ".
300 "user_id='". user_getid() ."' ORDER BY bookmark_title");
301 $rows=db_numrows($result);
302 if (!$result || $rows < 1) {
304 <strong>'.$Language->getText('my', 'no_bookmarks').'</strong>';
307 for ($i=0; $i<$rows; $i++) {
309 <tr '. $HTML->boxGetAltRowStyle($i) .'><td align="center">
310 <a href="'.$GLOBALS['sys_urlprefix'].'/my/bookmark_delete.php?bookmark_id='. db_result($result,$i,'bookmark_id') .'">
311 <img src="'.$HTML->imgroot.'/ic/trash.png" height="16" width="16" border="0" alt="" /></a></td>
312 <td><strong><a href="'. db_result($result,$i,'bookmark_url') .'">'.
313 db_result($result,$i,'bookmark_title') .'</a></strong>
314 <a href="'.$GLOBALS['sys_urlprefix'].'/my/bookmark_edit.php?bookmark_id='. db_result($result,$i,'bookmark_id') .'">['.$Language->getText('general','edit').']</a>';
322 $order_name_arr=array();
323 $order_name_arr[]=$Language->getText('general','remove');
324 $order_name_arr[]=$Language->getText('my','projects');
325 echo $HTML->listTableTop($order_name_arr,'',$tabcnt);
327 // Include both groups and foundries; developers should be similarly
328 // aware of membership in either.
329 $result = db_query("SELECT groups.group_name,"
331 . "groups.unix_group_name,"
334 . "user_group.admin_flags "
335 . "FROM groups,user_group "
336 . "WHERE groups.group_id=user_group.group_id "
337 . "AND user_group.user_id='". user_getid() ."' "
338 . "AND groups.status='A' "
339 . "ORDER BY group_name");
340 $rows=db_numrows($result);
341 if (!$result || $rows < 1) {
342 echo '<tr><td colspan="2" bgcolor="#FFFFFF"><strong>'.$Language->getText('my', 'no_projects').'</strong></td></tr>';
345 for ($i=0; $i<$rows; $i++) {
346 $admin_flags = db_result($result, $i, 'admin_flags');
347 if (stristr($admin_flags, 'A')) {
354 <tr '. $HTML->boxGetAltRowStyle($i) .'><td align="center">
355 <a href="rmproject.php?group_id='. db_result($result,$i,'group_id') .'">
356 <img src="'.$HTML->imgroot.'ic/'.$img.'" alt="Delete" height="16" width="16" border="0" /></a></td>
357 <td><a href="'.$GLOBALS['sys_urlprefix'].'/projects/'. db_result($result,$i,'unix_group_name') .'/">'. htmlspecialchars(db_result($result,$i,'group_name')) .'</a></td></tr>';
360 echo $HTML->listTableBottom();
365 plugin_hook('call_user_cal') ;
369 echo site_user_footer(array());