5 * Copyright 1999-2001 (c) VA Linux Systems
6 * Copyright 2010, FusionForge Team
7 * Copyright (C) 2011 Alain Peyrat - Alcatel-Lucent
8 * http://fusionforge.org
10 * This file is part of FusionForge. FusionForge is free software;
11 * you can redistribute it and/or modify it under the terms of the
12 * GNU General Public License as published by the Free Software
13 * Foundation; either version 2 of the Licence, or (at your option)
16 * FusionForge 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 along
22 * with FusionForge; if not, write to the Free Software Foundation, Inc.,
23 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
27 * Assumes $user object for displayed user is present
30 require_once $gfwww.'include/user_profile.php';
31 require_once $gfwww.'include/vote_function.php';
33 $title = _('User Profile');
34 $HTML->header(array('title'=>$title));
36 echo $HTML->boxTop(_('Personal Information'), _('Personal Information'));
40 <div about="" typeof="sioc:UserAccount">
45 echo user_personal_information($user);
47 if (forge_get_config('use_ratings')) {
48 echo $HTML->boxMiddle(_('Peer Rating'), _('Peer Rating'));
49 echo '<table class="my-layout-table" id="user-profile-rating">';
50 if ($user->usesRatings()) {
51 echo vote_show_user_rating($user_id);
53 echo '<tr><td colspan="2">';
54 echo _('User chose not to participate in peer rating');
57 echo '</table><!-- id="user-profile-rating" -->';
60 if (forge_get_config('use_diary')) {
61 echo $HTML->boxMiddle(_('Diary and Notes'), _('Diary and Notes'));
64 Get their diary information
67 $res = db_query_params('SELECT count(*) from user_diary WHERE user_id=$1 AND is_public=1',
69 echo _('Diary/Note entries:').' '.db_result($res, 0, 0).'
71 //.'<span rel="foaf:weblog">'
72 echo util_make_link('/developer/diary.php?diary_user='.$user_id,htmlentities(_('View Diary & Notes')));
76 echo util_make_link('/developer/monitor.php?diary_user='.$user_id,
77 html_image("ic/check.png",'15','13',array(),0) ._('Monitor this Diary')
80 $hookparams['user_id'] = $user_id;
81 plugin_hook("user_personal_links", $hookparams);
88 echo $HTML->boxMiddle(_('Project Info'), _('Project Info'));
90 $projects = $user->getGroups () ;
91 sortProjectList ($projects) ;
92 $roles = RBACEngine::getInstance()->getAvailableRolesForUser ($user) ;
93 sortRoleList ($roles) ;
95 // see if there were any groups
97 if (count ($projects) < 1) {
99 <p><?php echo _('This developer is not a member of any projects.') ?></p>
101 } else { // endif no groups
102 print "<p>"._('This developer is a member of the following projects:')."</p>\n";
104 foreach ($projects as $p) {
105 $project_link = util_make_link_g ($p->getUnixName(),$p->getID(),$p->getPublicName());
106 $project_uri = util_make_url_g ($p->getUnixName(),$p->getID());
107 // sioc:UserGroups for all members of a project are named after /projects/A_PROJECT/members/
108 $usergroup_uri = $project_uri .'members/';
110 print '<div rel="sioc:member_of">'."\n"
111 .'<div about="'. $usergroup_uri .'" typeof="sioc:UserGroup">'."\n"
112 .'<div rel="sioc:usergroup_of">'."\n"
113 .'<div about="'. $project_uri .'" typeof="sioc:Space">';
114 $role_names = array () ;
115 $sioc_has_function_close = "";
116 foreach ($roles as $r) {
117 if ($r instanceof RoleExplicit
118 && $r->getHomeProject() != NULL
119 && $r->getHomeProject()->getID() == $p->getID()) {
120 $role_names[] = $r->getName() ;
121 print '<div property="sioc:has_function" content= "'.$r->getName().'">';
122 $sioc_has_function_close .= "</div>";
126 print ('<br />' . $project_link .' ('.htmlspecialchars (implode (', ', $role_names)).')');
129 if (forge_check_perm_for_user ($user, 'project_admin', $p->getID())) {
130 print '<span rev="doap:maintainer" resource="#me"></span>';
133 print '<span rev="doap:developer" resource="#me"></span>';
136 echo $sioc_has_function_close."\n"; // sioc:has_function
137 echo "</div>\n"; // sioc:Space .../projects/A_PROJECT/
138 echo "</div>\n"; // sioc:usergroup_of
139 echo "</div>\n"; // sioc:UserGroup .../projects/A_PROJECT/members
140 echo "</div>\n"; // sioc:member_of
143 echo "</div>\n"; // prefixes
145 echo "</div>\n"; // end of about=""
147 $me = session_get_user();
148 if (forge_get_config('use_ratings')) {
149 if ($user->usesRatings() && (!$me || $me->usesRatings())) {
152 print _('If you are familiar with this user, please take a moment to rate him/her on the following criteria. Keep in mind, that your rating will be visible to the user and others.');
156 printf(_('The %s Peer Rating system is based on concepts from <a href="http://www.advogato.com/">Advogato.</a> The system has been re-implemented and expanded in a few ways.'), forge_get_config ('forge_name'));
160 <div class="align-center">
161 <?php echo vote_show_user_rate_box ($user_id, $me?$me->getID():0); ?>
164 <?php printf(_('<p>The Peer rating box shows all rating averages (and response levels) for each individual criteria. Due to the math and processing required to do otherwise, these numbers incoporate responses from both "trusted" and "non-trusted" users.</p><ul><li>The "Sitewide Rank" field shows the user\'s rank compared to all ranked %1$s users.</li><li>The "Aggregate Score" shows an average, weighted overall score, based on trusted-responses only.</li><li>The "Personal Importance" field shows the weight that users ratings of other developers will be given (between 1 and 1.5) -- higher rated user\'s responses are given more weight.</li></ul><p>If you would like to opt-out from peer rating system (this will affect your ability to both rate and be rated), refer to <a href="%2$s">your account maintenance page</a>. If you choose not to participate, your ratings of other users will be permanently deleted and the \'Peer Rating\' box will disappear from your user page.</p>'),
165 forge_get_config ('forge_name'),
166 util_make_url ("/account/"));
168 } else if ($me && !$me->usesRatings()) { ?>
171 <?php printf (_('You opted-out from peer rating system, otherwise you would have a chance to rate the user. Refer to <a href="%1$s">your account maintenance page</a> for more information.'),
172 util_make_url ("/account")); ?>
178 echo $HTML->boxBottom();
180 $HTML->footer(array());
184 // c-file-style: "bsd"