3 * SourceForge User's Personal Page
5 * SourceForge: Breaking Down the Barriers to Open Source Development
6 * Copyright 1999-2001 (c) VA Linux Systems
7 * http://sourceforge.net
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 US
28 require_once('pre.php');
29 require_once('vote_function.php');
30 require_once('common/tracker/ArtifactsForUser.class');
31 require_once('common/forum/ForumsForUser.class');
32 require_once('common/pm/ProjectTasksForUser.class');
34 if (!session_loggedin()) { // || $sf_user_hash) {
42 //needs security audit
43 * If user has valid "remember-me" hash, instantiate not-logged in
46 if (!session_loggedin()) {
47 list($user_id,$hash)=explode('_',$sf_user_hash);
50 WHERE user_id='".$user_id."' AND user_pw LIKE '".$hash."%'";
52 $result=db_query($sql);
53 $rows=db_numrows($result);
54 if (!$result || $rows != 1) {
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())));
65 <?php echo $Language->getText('my', 'about_blurb'); ?>
67 <table width="100%" border="0">
68 <tr><td valign="top" width="50%">
74 echo $HTML->boxTop($Language->getText('my', 'assigneditems'));
75 $artifactsForUser = new ArtifactsForUser(session_get_user());
76 $assignedArtifacts = $artifactsForUser->getAssignedArtifactsByGroup();
77 if (count($assignedArtifacts) > 0) {
78 foreach($assignedArtifacts as $art) {
80 if ($art->ArtifactType->getID() != $last_group) {
82 <tr><td colspan="2"><strong><a href="/tracker/?group_id='.
83 $art->ArtifactType->Group->getID().'&atid='.
84 $art->ArtifactType->getID().'">'.
85 $art->ArtifactType->Group->getPublicName().' - '.
86 $art->ArtifactType->getName().'</a></strong></td></tr>';
90 <tr style="background-color:'.html_get_priority_color($art->getPriority()).'">
91 <td><a href="/tracker/?func=detail&aid='.
93 '&group_id='.$art->ArtifactType->Group->getID().
94 '&atid='.$art->ArtifactType->getID().'">'.
96 <td>' . $art->getSummary();
98 $last_group = $art->ArtifactType->getID();
102 <strong>'.$Language->getText('my', 'no_tracker_items_assigned').'</strong>';
106 echo $HTML->boxMiddle($Language->getText('my', 'submitteditems'),false,false);
107 $submittedArtifacts = $artifactsForUser->getSubmittedArtifactsByGroup();
108 if (count($submittedArtifacts) > 0) {
109 foreach ($submittedArtifacts as $art) {
111 if ($art->ArtifactType->getID() != $last_group) {
113 <tr><td colspan="2"><strong><a href="/tracker/?group_id='.
114 $art->ArtifactType->Group->getID().'&atid='.
115 $art->ArtifactType->getID().'">'.
116 $art->ArtifactType->Group->getPublicName().' - '.
117 $art->ArtifactType->getName().'</a></strong></td></tr>';
120 <tr style="background-color:'.html_get_priority_color($art->getPriority()).'">
121 <td>'.$art->getID().'</td>
122 <td><a href="/tracker/?func=detail&aid='.
124 '&group_id='.$art->ArtifactType->Group->getID().
125 '&atid='.$art->ArtifactType->getID().'">' . $art->getSummary() .'</a>';
127 $last_group = $art->ArtifactType->getID();
131 <strong>'.$Language->getText('my', 'no_tracker_items_submitted').'</strong>';
135 Forums that are actively monitored
138 echo $HTML->boxMiddle($Language->getText('my', 'monitoredforum'),false,false);
139 $forumsForUser = new ForumsForUser(session_get_user());
140 $forums =& $forumsForUser->getMonitoredForums();
141 if (count($forums) < 1) {
142 echo '<strong>'.$Language->getText('my', 'no_monitored_forums').'</strong>'.$Language->getText('my', 'no_monitored_forums_details');
144 foreach ($forums as $f) {
146 $group = $f->getGroup();
147 if ($group->getID() != $last_group) {
149 <tr '. $HTML->boxGetAltRowStyle($i) .'><td colspan="2"><strong><a href="/forum/?group_id='.
150 $group->getID().'">'.
151 $group->getPublicName().'</a></strong></td></tr';
155 <tr '. $HTML->boxGetAltRowStyle($i) .'><td align="center"><a href="/forum/monitor.php?forum_id='.$f->getID().
156 '&stop=1&group_id='.$group->getID().'"><img src="'. $HTML->imgroot . '/ic/trash.png" height="16" width="16" '.
157 'border="0" alt="" /></a></td><td width="99%"><a href="/forum/forum.php?forum_id='.
159 $f->getName().'</a>';
161 $last_group= $group->getID();
166 Filemodules that are actively monitored
170 echo $HTML->boxMiddle($Language->getText('my', 'monitoredfile'),false,false);
172 $sql="SELECT groups.group_name,groups.group_id,frs_package.name,filemodule_monitor.filemodule_id ".
173 "FROM groups,filemodule_monitor,frs_package ".
174 "WHERE groups.group_id=frs_package.group_id AND groups.status = 'A' ".
175 "AND frs_package.package_id=filemodule_monitor.filemodule_id ".
176 "AND filemodule_monitor.user_id='".user_getid()."' ORDER BY group_name DESC";
177 $result=db_query($sql);
178 $rows=db_numrows($result);
179 if (!$result || $rows < 1) {
180 echo '<strong>'.$Language->getText('my', 'no_monitored_filemodules').'</strong>'.$Language->getText('my', 'no_monitored_filemodules_details');
182 for ($i=0; $i<$rows; $i++) {
184 if (db_result($result,$i,'group_id') != $last_group) {
186 <tr '. $HTML->boxGetAltRowStyle($i) .'><td colspan="2"><strong><a href="/project/?group_id='.
187 db_result($result,$i,'group_id').'">'.
188 db_result($result,$i,'group_name').'</a></td></tr>';
191 <tr '. $HTML->boxGetAltRowStyle($i) .'><td align="MIDDLE"><a href="/frs/monitor.php?filemodule_id='.
192 db_result($result,$i,'filemodule_id').
193 '&group_id='.db_result($result,$i,'group_id'). '&stop=1"><img src="'. $HTML->imgroot.'/ic/trash.png" height="16" width="16" '.
194 'BORDER=0"></a></td><td width="99%"><a href="/frs/?group_id='.
195 db_result($result,$i,'group_id').'">'.
196 db_result($result,$i,'name').'</a>';
198 $last_group=db_result($result,$i,'group_id');
202 echo $HTML->boxBottom();
204 //second column of "my" page
207 </td><td valign="top" width="50%">
213 echo $HTML->boxTop($Language->getText('my', 'tasks'));
214 $projectTasksForUser = new ProjectTasksForUser(session_get_user());
215 $userTasks =& $projectTasksForUser->getTasksByGroupProjectName();
217 if (count($userTasks) > 0) {
218 foreach ($userTasks as $task) {
220 /* Deduce summary style */
223 if ($task->getPercentComplete()==100) {
224 $style_begin='<span style="text-decoration:underline">';
225 $style_end='</span>';
227 //if ($task->getProjectGroup()->getID() != $last_group) {
228 $projectGroup =& $task->getProjectGroup();
229 $group =& $projectGroup->getGroup();
230 if ($projectGroup->getID() != $last_group) {
232 <tr><td colspan="2"><strong><a href="/pm/task.php?group_id='.
234 '&group_project_id='.
235 $projectGroup->getID().'">'.
236 $group->getPublicName().' - '.
237 $projectGroup->getName().'</a></strong></td></tr>';
240 <tr style="background-color:'.html_get_priority_color($task->getPriority()).'">
241 <td><a href="/pm/task.php?func=detailtask&project_task_id='.
243 '&group_id='.$group->getID().
244 '&group_project_id='.$projectGroup->getID().'">'.
245 $task->getID().'</td>
246 <td>'.$style_begin.$task->getSummary().$style_end;
248 $last_group = $projectGroup->getID();
252 <strong>'.$Language->getText('my', 'no_open_tasks').'</strong>';
260 This needs to be updated manually to display any given survey
263 $sql="SELECT * from survey_responses ".
264 "WHERE survey_id='1' AND user_id='".user_getid()."' AND group_id='1'";
266 $result=db_query($sql);
268 echo $HTML->boxMiddle($Language->getText('my', 'survey'),false,false);
270 if (db_numrows($result) < 1) {
274 <strong>'.$Language->getText('my','survey_taken').'</strong>';
278 * Pending projects and news bytes
280 $admingroup = group_get_object (1) ;
281 exit_assert_object($admingroup,'Group');
282 $perm =& $admingroup->getPermission( session_get_user() );
283 if ($perm && is_object($perm) && $perm->isAdmin()) {
284 $sql="SELECT group_name FROM groups where status='P';";
285 $result=db_query($sql);
286 $rows=db_numrows($result);
288 echo $HTML->boxMiddle($Language->getText('my','pending_projects'), false, false);
291 echo $Language->getText('my','pending_projects_1');
293 echo $Language->getText('my','pending_projects_2',$rows);
296 echo " <a href=\"/admin/approve-pending.php\">";
297 echo $Language->getText('my','pending_projects_3');
301 $newsgroup = group_get_object ($GLOBALS['sys_news_group']) ;
302 exit_assert_object($newsgroup,'Group');
303 $perm =& $newsgroup->getPermission( session_get_user() );
304 if ($perm && is_object($perm) && $perm->isAdmin()) {
305 $sql="SELECT * FROM news_bytes nb, groups g WHERE nb.is_approved=0 and nb.group_id = g.group_id and g.status = 'A'";
306 $result=db_query($sql);
307 $rows=db_numrows($result);
309 echo $HTML->boxMiddle($Language->getText('my','pending_news_bytes'), false, false);
312 echo $Language->getText('my','pending_news_bytes_1');
314 echo $Language->getText('my','pending_news_bytes_2',$rows);
317 echo " <a href=\"/news/admin/?group_id=".$GLOBALS['sys_news_group']."\">";
319 echo $Language->getText('my','pending_news_bytes_3');
326 echo $HTML->boxMiddle($Language->getText('my', 'bookmarks'),false,false);
328 $result = db_query("SELECT bookmark_url, bookmark_title, bookmark_id from user_bookmarks where ".
329 "user_id='". user_getid() ."' ORDER BY bookmark_title");
330 $rows=db_numrows($result);
331 if (!$result || $rows < 1) {
333 <strong>'.$Language->getText('my', 'no_bookmarks').'</strong>';
336 for ($i=0; $i<$rows; $i++) {
338 <tr '. $HTML->boxGetAltRowStyle($i) .'><td align="center">
339 <a href="/my/bookmark_delete.php?bookmark_id='. db_result($result,$i,'bookmark_id') .'">
340 <img src="'.$HTML->imgroot.'/ic/trash.png" height="16" width="16" border="0" alt="" /></a></td>
341 <td><strong><a href="'. db_result($result,$i,'bookmark_url') .'">'.
342 db_result($result,$i,'bookmark_title') .'</a></strong>
343 <span style="font-size:small"><a href="/my/bookmark_edit.php?bookmark_id='. db_result($result,$i,'bookmark_id') .'">['.$Language->getText('general','edit').']</a></span>';
351 echo $HTML->boxMiddle($Language->getText('my', 'projects'),false,false);
352 // Include both groups and foundries; developers should be similarly
353 // aware of membership in either.
354 $result = db_query("SELECT groups.group_name,"
356 . "groups.unix_group_name,"
359 . "user_group.admin_flags "
360 . "FROM groups,user_group "
361 . "WHERE groups.group_id=user_group.group_id "
362 . "AND user_group.user_id='". user_getid() ."' "
363 . "AND groups.status='A' "
364 . "ORDER BY group_name");
365 $rows=db_numrows($result);
366 if (!$result || $rows < 1) {
367 echo '<strong>'.$Language->getText('my', 'no_projects').'</strong>';
370 for ($i=0; $i<$rows; $i++) {
372 $admin_flags = db_result($result, $i, 'admin_flags');
373 if (stristr($admin_flags, 'A')) {
379 if (db_result($result, $i, 'type_id')==2) {
386 <tr '. $HTML->boxGetAltRowStyle($i) .'><td align="center">
387 <a href="rmproject.php?group_id='. db_result($result,$i,'group_id') .'">
388 <img src="'.$HTML->imgroot.'ic/'.$img.'" alt="Delete" height="16" width="16" border="0" /></a></td>
389 <td><a href="/'.$type.'/'. db_result($result,$i,'unix_group_name') .'/">'. htmlspecialchars(db_result($result,$i,'group_name')) .'</a>';
392 echo $HTML->boxBottom();
400 <tr><td colspan="2">';
402 echo show_priority_colors_key();
409 echo site_user_footer(array());