5 * Copyright 1999-2001 (c) VA Linux Systems
6 * Copyright 2010, FusionForge Team
7 * http://fusionforge.org
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 by
13 * the Free Software Foundation; either version 2 of the License, or
14 * (at your option) any later version.
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
22 * along with FusionForge; if not, write to the Free Software
23 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
27 * Assumes $user object for displayed user is present
30 require_once $gfwww.'include/vote_function.php';
32 $title = _('User Profile');
33 $HTML->header(array('title'=>$title));
35 echo $HTML->boxTop(_('Personal Information'), _('Personal Information')); ?>
37 <div about="" typeof="sioc:UserAccount" xmlns:sioc="http://rdfs.org/sioc/ns#">
39 <table width="100%" cellpadding="2" cellspacing="2" border="0">
41 <td width="150"><?php plugin_hook("user_logo", array('user_id' => $user_id, 'size' => 'l')); ?></td>
44 <table class="my-layout-table" id="user-profile-personal-info">
47 <?php echo _('User Id') ?>
52 //print '<div property ="foaf:member" content="fusionforge:ForgeCommunity" xmlns:fusionforge="http://fusionforge.org/fusionforge#">';
54 // description as a FusionForge Community member
55 //print '<div property ="dc:Identifier" content="'.$user_id.'" xmlns:dc="http://purl.org/dc/elements/1.1/">';
57 if (session_loggedin() && user_ismember(1)) {
58 echo util_make_link ('/admin/useredit.php?user_id='.$user_id,$user_id);
64 </strong><?php if(forge_get_config('use_people')) { ?>( <?php echo util_make_link ('/people/viewprofile.php?user_id='.$user_id,'<strong>'._('Skills Profile').'</strong>'); ?> )<?php } ?>
69 <td><?php echo _('Login name') ?></td>
70 <td><strong><span property="sioc:name"><?php
71 print $user->getUnixName();
72 ?></span></strong></td>
76 <td><?php echo _('Real name') ?> </td>
78 <div rev="foaf:account" xmlns:foaf="http://xmlns.com/foaf/0.1/">
79 <div about="#me" typeof="foaf:Person">
80 <strong><span property="foaf:name"><?php
81 $user_title = $user->getTitle();
82 print ($user_title ? $user_title .' ' :''). $user->getRealName();
89 <?php if(!isset($GLOBALS['sys_show_contact_info']) || $GLOBALS['sys_show_contact_info']) { ?>
91 <td><?php echo _('Your Email Address') ?>: </td>
94 $user_mail=$user->getEmail();
95 $user_mailsha1=$user->getSha1Email();
96 // Removed for privacy reasons
97 //print '<span property="sioc:email" content="'. $user_mail .'">';
98 print '<span property="sioc:email_sha1" content="'. $user_mailsha1 .'">';
99 echo util_make_link ('/sendmessage.php?touser='.$user_id, str_replace('@',' @nospam@ ',$user_mail));
104 <?php if ($user->getJabberAddress()) { ?>
106 <td><?php echo _('Jabber Address') ?></td>
108 <a href="jabber:<?php print $user->getJabberAddress(); ?>"><strong><?php print $user->getJabberAddress(); ?></strong></a>
113 <?php if ($user->getAddress() || $user->getAddress2()) { ?>
115 <td><?php echo _('Address:'); ?></td>
116 <td><?php echo $user->getAddress().'<br/>'.$user->getAddress2(); ?></td>
120 <?php if ($user->getPhone()) { ?>
122 <td><?php echo _('Phone:'); ?></td>
124 //print '<div property="foaf:phone" content="'.$user->getPhone().'">';
125 echo $user->getPhone();
131 <?php if ($user->getFax()) { ?>
133 <td><?php echo _('FAX:'); ?></td>
134 <td><?php echo $user->getFax(); ?></td>
141 <?php echo _('Site Member Since') ?>
143 <td><strong><?php print date(_('Y-m-d H:i'), $user->getAddDate()); ?></strong>
152 if (forge_get_config('use_ratings')) {
153 echo $HTML->boxMiddle(_('Peer Rating'), _('Peer Rating'));
154 echo '<table class="my-layout-table" id="user-profile-rating">';
155 if ($user->usesRatings()) {
156 echo vote_show_user_rating($user_id);
158 echo '<tr><td colspan="2">';
159 echo _('User chose not to participate in peer rating');
162 echo '</table><!-- id="user-profile-rating" -->';
165 if (forge_get_config('use_diary')) {
166 echo $HTML->boxMiddle(_('Diary and Notes'), _('Diary and Notes'));
170 Get their diary information
174 $res = db_query_params ('SELECT count(*) from user_diary WHERE user_id=$1 AND is_public=1',
176 echo _('Diary/Note entries:').' '.db_result($res,0,0).'
178 //.'<span rel="foaf:weblog">'
179 echo util_make_link ('/developer/diary.php?diary_user='.$user_id,_('View Diary & Notes'));
183 echo util_make_link ('/developer/monitor.php?diary_user='.$user_id,
184 html_image("ic/check.png",'15','13',array(),0) ._('Monitor this Diary')
187 $hookparams['user_id'] = $user_id;
188 plugin_hook("user_personal_links",$hookparams);
195 echo $HTML->boxMiddle(_('Project Info'), _('Project Info'));
197 $projects = $user->getGroups () ;
198 sortProjectList ($projects) ;
199 $roles = RBACEngine::getInstance()->getAvailableRolesForUser ($user) ;
200 sortRoleList ($roles) ;
202 // see if there were any groups
203 echo '<div xmlns:sioc="http://rdfs.org/sioc/ns#" xmlns:doap="http://usefulinc.com/ns/doap#">'."\n";
204 if (count ($projects) < 1) {
206 <p><?php echo _('This developer is not a member of any projects.') ?></p>
208 } else { // endif no groups
209 print "<p>"._('This developer is a member of the following projects:')."<br /> ";
211 foreach ($projects as $p) {
212 $project_link = util_make_link_g ($p->getUnixName(),$p->getID(),$p->getPublicName());
213 $project_uri = util_make_url_g ($p->getUnixName(),$p->getID());
214 // sioc:UserGroups for all members of a project are named after /projects/A_PROJECT/members/
215 $usergroup_uri = $project_uri .'members/';
218 print '<span rel="sioc:member_of">'."\n"
219 .'<div about="'. $usergroup_uri .'" typeof="sioc:UserGroup">'."\n"
220 .'<span rel="sioc:usergroup_of">'."\n"
221 .'<div about="'. $project_uri .'" typeof="sioc:Space">';
222 $role_names = array () ;
223 foreach ($roles as $r) {
224 if ($r instanceof RoleExplicit
225 && $r->getHomeProject() != NULL
226 && $r->getHomeProject()->getID() == $p->getID()) {
227 $role_names[] = $r->getName() ;
228 print '<div property="sioc:has_function" content= "'.$r->getName().'" xmlns:sioc="http://rdfs.org/sioc/ns#">';
232 print ('<br />' . $project_link .' ('.htmlspecialchars (implode (', ', $role_names)).')');
235 if (forge_check_perm_for_user ($user, 'project_admin', $p->getID())) {
236 print '<span rev="doap:maintainer" resource="#me"></span>';
239 print '<span rev="doap:developer" resource="#me"></span>';
242 echo "</div>\n"; // sioc:Space .../projects/A_PROJECT/
243 echo "</span>\n"; // sioc:usergroup_of
244 echo "</div>\n"; // sioc:UserGroup .../projects/A_PROJECT/members
245 echo "</span>\n"; // sioc:member_of
249 echo "</div>\n"; // prefixes
251 echo "</div>\n"; // end of about=""
253 $me = session_get_user();
254 if (forge_get_config('use_ratings')) {
255 if ($user->usesRatings() && (!$me || $me->usesRatings())) {
256 printf(_('<p>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.</p><p>The %1$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.</p>'), forge_get_config ('forge_name'));
259 <div class="align-center">
260 <?php echo vote_show_user_rate_box ($user_id, $me?$me->getID():0); ?>
263 <?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>'),
264 forge_get_config ('forge_name'),
265 util_make_url ("/account/"));
267 } else if ($me && !$me->usesRatings()) { ?>
270 <?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.'),
271 util_make_url ("/account")); ?>
277 echo $HTML->boxBottom();
279 $HTML->footer(array());
283 // c-file-style: "bsd"