* Copyright 2010, FusionForge Team
* Copyright (C) 2011 Alain Peyrat - Alcatel-Lucent
* Copyright 2012, Franck Villaume - TrivialDev
- * http://fusionforge.org
+ * Copyright © 2012
+ * Thorsten Glaser <t.glaser@tarent.de>
*
* This file is part of FusionForge. FusionForge is free software;
* you can redistribute it and/or modify it under the terms of the
* Assumes $user object for displayed user is present
*/
-
require_once $gfwww.'include/user_profile.php';
-
require_once $gfwww.'include/vote_function.php';
$title = _('User Profile');
$HTML->header(array('title'=>$title));
-echo $HTML->boxTop(_('Personal Information'), _('Personal Information'));
+echo $HTML->boxTop(_('Personal Information'), _('Personal Information'));
?>
<?php
-
+
echo user_personal_information($user);
-
+
if (forge_get_config('use_ratings')) {
echo $HTML->boxMiddle(_('Peer Rating'), _('Peer Rating'));
echo '<table class="my-layout-table" id="user-profile-rating">';
print "<p>"._('This developer is a member of the following projects:')."</p>\n";
foreach ($projects as $p) {
- $display = 0;
- if (!$p->isPublic()) {
- $currentUser = session_get_user();
- if ($currentUser) {
- $pMembers = $p->getMembers();
- foreach ($pMembers as $pMember) {
- if ($pMember->getID() == $currentUser->getID()) {
- $display = 1;
- }
- }
- }
- } else {
- $display = 1;
+ if (!forge_check_perm('project_read', $p->getID())) {
+ continue;
}
- if ($display) {
- $project_link = util_make_link_g ($p->getUnixName(),$p->getID(),$p->getPublicName());
- $project_uri = util_make_url_g ($p->getUnixName(),$p->getID());
- // sioc:UserGroups for all members of a project are named after /projects/A_PROJECT/members/
- $usergroup_uri = $project_uri .'members/';
-
- print '<div rel="sioc:member_of">'."\n"
- .'<div about="'. $usergroup_uri .'" typeof="sioc:UserGroup">'."\n"
- .'<div rel="sioc:usergroup_of">'."\n"
- .'<div about="'. $project_uri .'" typeof="sioc:Space">';
- $role_names = array () ;
- $sioc_has_function_close = "";
- foreach ($roles as $r) {
- if ($r instanceof RoleExplicit
- && $r->getHomeProject() != NULL
- && $r->getHomeProject()->getID() == $p->getID()) {
- $role_names[] = $r->getName() ;
- print '<div property="sioc:has_function" content= "'.$r->getName().'">';
- $sioc_has_function_close .= "</div>";
- }
- }
-
- print ('<br />' . $project_link .' ('.htmlspecialchars (implode (', ', $role_names)).')');
- print "\n";
- if (forge_check_perm_for_user ($user, 'project_admin', $p->getID())) {
- print '<span rev="doap:maintainer" resource="#me"></span>';
- }
- else {
- print '<span rev="doap:developer" resource="#me"></span>';
+ $project_link = util_make_link_g ($p->getUnixName(),$p->getID(),$p->getPublicName());
+ $project_uri = util_make_url_g ($p->getUnixName(),$p->getID());
+ // sioc:UserGroups for all members of a project are named after /projects/A_PROJECT/members/
+ $usergroup_uri = $project_uri .'members/';
+
+ print '<div rel="sioc:member_of">'."\n"
+ .'<div about="'. $usergroup_uri .'" typeof="sioc:UserGroup">'."\n"
+ .'<div rel="sioc:usergroup_of">'."\n"
+ .'<div about="'. $project_uri .'" typeof="sioc:Space">';
+ $role_names = array () ;
+ $sioc_has_function_close = "";
+ foreach ($roles as $r) {
+ if ($r instanceof RoleExplicit
+ && $r->getHomeProject() != NULL
+ && $r->getHomeProject()->getID() == $p->getID()) {
+ $role_names[] = $r->getName() ;
+ print '<div property="sioc:has_function" content= "'.$r->getName().'">';
+ $sioc_has_function_close .= "</div>";
}
+ }
- echo $sioc_has_function_close."\n"; // sioc:has_function
- echo "</div>\n"; // sioc:Space .../projects/A_PROJECT/
- echo "</div>\n"; // sioc:usergroup_of
- echo "</div>\n"; // sioc:UserGroup .../projects/A_PROJECT/members
- echo "</div>\n"; // sioc:member_of
+ print ('<br />' . $project_link .' ('.htmlspecialchars (implode (', ', $role_names)).')');
+ print "\n";
+
+ if (forge_check_perm_for_user ($user, 'project_admin', $p->getID())) {
+ print '<span rev="doap:maintainer" resource="#me"></span>';
+ }
+ else {
+ print '<span rev="doap:developer" resource="#me"></span>';
}
+
+ echo $sioc_has_function_close."\n"; // sioc:has_function
+ echo "</div>\n"; // sioc:Space .../projects/A_PROJECT/
+ echo "</div>\n"; // sioc:usergroup_of
+ echo "</div>\n"; // sioc:UserGroup .../projects/A_PROJECT/members
+ echo "</div>\n"; // sioc:member_of
}
} // end if groups
echo "</div>\n"; // prefixes
forge_get_config ('forge_name'),
util_make_url ("/account/"));
-} else if ($me && !$me->usesRatings()) { ?>
+} elseif ($me && !$me->usesRatings()) { ?>
<p>
<em>
<?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.'),
// mode: php
// c-file-style: "bsd"
// End:
-
-?>