[Fusionforge-commits] r9378 - in trunk: . gforge/common/include gforge/www gforge/www/account gforge/www/include gforge/www/mail gforge/www/people gforge/www/project gforge/www/project/admin gforge/www/softwaremap gforge/www/tracker

Olivier Berger olberger at libremir.placard.fr.eu.org
Tue Apr 6 17:31:14 CEST 2010


Author: olberger
Date: 2010-04-06 17:31:13 +0200 (Tue, 06 Apr 2010)
New Revision: 9378

Modified:
   trunk/
   trunk/gforge/common/include/User.class.php
   trunk/gforge/common/include/utils.php
   trunk/gforge/www/account/first.php
   trunk/gforge/www/account/index.php
   trunk/gforge/www/include/features_boxes.php
   trunk/gforge/www/include/project_home.php
   trunk/gforge/www/include/project_summary.php
   trunk/gforge/www/include/trove.php
   trunk/gforge/www/include/user_home.php
   trunk/gforge/www/index.php
   trunk/gforge/www/mail/index.php
   trunk/gforge/www/mail/mail_utils.php
   trunk/gforge/www/people/people_utils.php
   trunk/gforge/www/project/admin/index.php
   trunk/gforge/www/project/index.php
   trunk/gforge/www/project/memberlist.php
   trunk/gforge/www/projects
   trunk/gforge/www/softwaremap/full_list.php
   trunk/gforge/www/softwaremap/trove_list.php
   trunk/gforge/www/tracker/browse.php
Log:
Add more RDFa for user's email, and members of project as sioc:UserGrou



Property changes on: trunk
___________________________________________________________________
Modified: svn:mergeinfo
   - /branches/Branch_4_7:6879,6881,6884,6897,6899,6902,6904,6906,6909,6911,6922,6932,6936,6939,6942,6944,6946-6948,6954,6956,6959,7000-7001,7012,7111,7130-7131,7133-7134,7138,7140-7142,7147-7148,7159-7160,7163,7168,7177,7179,7203,7205,7207,7210,7212,7251-7253,7255,7284,7287,7291,7293,7295-7296,7300,7355,7365-7366,7375-7376,7378,7395,7423-7426,7435,7458,7504,7567,7577,7623-7624,7638,7659-7660,7662,7665,7668,7674,7699,7746-7748,7771,7774,7786,7838
/branches/Branch_4_8:7334-7335,7344-7345,7382,7387,7389-7390,7396,7398,7401-7402,7428-7429,7437,7440,7443,7449-7455,7459,7462,7466,7469-7470,7476-7478,7480,7485,7490-7492,7505,7540,7556-7560,7568,7570-7571,7573,7576,7580,7609-7611,7613,7615,7618,7621-7622,7625-7627,7639,7658,7661,7663-7664,7666-7667,7673,7675,7678,7680,7685,7688-7689,7693,7700,7706-7708,7713,7725,7728-7742,7760,7763-7764,7767,7769-7770,7773,7776,7784-7785,7791,7797,7799,7802-7808,7810-7811,7816,7818,7825-7828,7839,7846-7847,7850,7894,7902,7920-7922,7927-7928,7932,7936-7937,7939,7942,7944-7945,7947,7951,7956,7958,7960,8064,8079-8080,8108,8113,8119,8121,8127-8128,8145,8197,8201-8202,8216,8224,8226,8228,8247-8250,8252,8271-8272,8310-8311,8328,8337,8339-8357,8361,8371,8373-8375,8378-8379,8383-8396,8415,8427-8431,8438-8441,8449,8452-8453,8458,8461,8477-8478,8480,8482,8492,8514,8530,8604-8605,8608,8637,8662,8674,8751,8754,8756,8760-8761,8812,8850,8945,8995,8998,9004-9006,9124,9137,9141
/branches/Branch_5_0:8892,8895,8897-8898,8900,8903-8904,8906-8907,8910,8915,8922,8924,8926,8929,8931-8933,8941,8946,8951,8955,8972-8977,8981,8997,8999,9002,9031-9032,9050,9080-9081,9084-9086,9093-9095,9102-9104,9108,9113-9115,9117-9118,9123,9125,9127-9131,9135-9136,9139,9146,9148-9150,9179-9191,9193-9195,9198,9200,9202,9204,9207,9209,9211,9213,9215,9220-9222,9231,9234-9235,9243,9251,9254
/trunk:8721-8727
   + /trunk:8721-8727
/branches/Branch_4_7:6879,6881,6884,6897,6899,6902,6904,6906,6909,6911,6922,6932,6936,6939,6942,6944,6946-6948,6954,6956,6959,7000-7001,7012,7111,7130-7131,7133-7134,7138,7140-7142,7147-7148,7159-7160,7163,7168,7177,7179,7203,7205,7207,7210,7212,7251-7253,7255,7284,7287,7291,7293,7295-7296,7300,7355,7365-7366,7375-7376,7378,7395,7423-7426,7435,7458,7504,7567,7577,7623-7624,7638,7659-7660,7662,7665,7668,7674,7699,7746-7748,7771,7774,7786,7838
/branches/Branch_4_8:7334-7335,7344-7345,7382,7387,7389-7390,7396,7398,7401-7402,7428-7429,7437,7440,7443,7449-7455,7459,7462,7466,7469-7470,7476-7478,7480,7485,7490-7492,7505,7540,7556-7560,7568,7570-7571,7573,7576,7580,7609-7611,7613,7615,7618,7621-7622,7625-7627,7639,7658,7661,7663-7664,7666-7667,7673,7675,7678,7680,7685,7688-7689,7693,7700,7706-7708,7713,7725,7728-7742,7760,7763-7764,7767,7769-7770,7773,7776,7784-7785,7791,7797,7799,7802-7808,7810-7811,7816,7818,7825-7828,7839,7846-7847,7850,7894,7902,7920-7922,7927-7928,7932,7936-7937,7939,7942,7944-7945,7947,7951,7956,7958,7960,8064,8079-8080,8108,8113,8119,8121,8127-8128,8145,8197,8201-8202,8216,8224,8226,8228,8247-8250,8252,8271-8272,8310-8311,8328,8337,8339-8357,8361,8371,8373-8375,8378-8379,8383-8396,8415,8427-8431,8438-8441,8449,8452-8453,8458,8461,8477-8478,8480,8482,8492,8514,8530,8604-8605,8608,8637,8662,8674,8751,8754,8756,8760-8761,8812,8850,8945,8995,8998,9004-9006,9124,9137,9141
/branches/Branch_5_0:8892,8895,8897-8898,8900,8903-8904,8906-8907,8910,8915,8922,8924,8926,8929,8931-8933,8941,8946,8951,8955,8972-8977,8981,8997,8999,9002,9031-9032,9050,9080-9081,9084-9086,9093-9095,9102-9104,9108,9113-9115,9117-9118,9123,9125,9127-9131,9135-9136,9139,9146,9148-9150,9179-9191,9193-9195,9198,9200,9202,9204,9207,9209,9211,9213,9215,9220-9222,9231,9234-9235,9243,9251,9254


Modified: trunk/gforge/common/include/User.class.php
===================================================================
--- trunk/gforge/common/include/User.class.php	2010-04-06 14:52:10 UTC (rev 9377)
+++ trunk/gforge/common/include/User.class.php	2010-04-06 15:31:13 UTC (rev 9378)
@@ -818,6 +818,15 @@
 	function getEmail() {
 		return $this->data_array['email'];
 	}
+	
+	/**
+	 * getSha1Email - a SHA1 encoded hash of the email URI (including mailto: prefix)
+	 * 
+	 * @return string The SHA1 encoded value for the email
+	 */
+	function getSha1Email() {
+		return sha1('mailto:'.$this->getEmail());
+	}
 
 	/**
 	 *	getNewEmail - while changing an email address, it is stored here until confirmation.
@@ -929,7 +938,8 @@
 	 *	@return	string	This user's real name.
 	 */
 	function getRealName() {
-		return $this->getFirstName(). ' ' .$this->getLastName();
+		$last_name = $this->getLastName();
+		return $this->getFirstName(). ($last_name ? ' ' .$last_name:'');
 	}
 
 	/**

Modified: trunk/gforge/www/include/project_home.php
===================================================================
--- trunk/gforge/www/include/project_home.php	2010-04-06 14:52:10 UTC (rev 9377)
+++ trunk/gforge/www/include/project_home.php	2010-04-06 15:31:13 UTC (rev 9378)
@@ -56,6 +56,8 @@
 
 // insert an empty <span /> which seems to be better if not compacted
 print '<span property="doap:name" content="'. $project->getUnixName() .'"></span>'."\n";
+// print '<span property="coclico:hosted_by">' ...
+//print '<div property="sioc:has_container" xmlns:sioc="http://rdfs.org/sioc/ns#" content="fusionforge:ForgeProjects" xmlns:fusionforge="http://fusionforge.org/fusionforge#">';
 
 $project_description = $project->getDescription();
 if ($project_description) {
@@ -136,6 +138,11 @@
 						 $num),
 					util_make_url ('/people/?group_id='.$group_id),
 					db_result($jobs_res,0,"name"));
+//print '<div rel="fusionforge:has_job" typeof="fusionforge:Job" xmlns:fusionforge="http://fusionforge.org/fusionforge#">';
+//print '<span rel="dc:title" content="'. db_result($jobs_res,0,"name").'" xmlns:dc="http://purl.org/dc/elements/1.1/">'; 
+//print '</span>';
+//echo '</div>';
+//end of job description part
 			}
 	}
 }
@@ -172,7 +179,7 @@
 		$developer_url = util_make_url_u ($row_admin['user_name'],$row_admin['user_id']);
 		echo '<div typeof="foaf:Person" xmlns:foaf="http://xmlns.com/foaf/0.1/" about="'.
 			$developer_url.'#me' .'" >'."\n";
-		echo '<div rel="foaf:holdsAccount">'."\n";
+		echo '<div rel="foaf:account">'."\n";
 		echo '<div typeof="sioc:UserAccount" about="'.
         	$developer_url.
         	'" xmlns:sioc="http://rdfs.org/sioc/ns#">'."\n";
@@ -188,9 +195,14 @@
 }
 
 $members = $project->getUsers();
-echo '<p>';
+echo '<p><span rel="sioc:has_usergroup" xmlns:sioc="http://rdfs.org/sioc/ns#">';
+echo '<div about="members/" typeof="sioc:UserGroup">';
+echo '<span rel="http://www.w3.org/2002/07/owl#sameAs">';
 echo util_make_link ('/project/memberlist.php?group_id='.$group_id,sprintf(_('View the %1$d Member(s)'),count($members)));
-echo '</p>';
+echo '</span>';
+echo '</div>';
+echo '</span></p>';
+// end of project usergroup description
 
 if (!$iam_member) {
 	echo '<p>'.util_make_link ('/project/request.php?group_id='.$group_id,_('Request to join')).'</p>';
@@ -276,6 +288,7 @@
 							<strong>' . $package_name . '</strong>
 						</td>';
 					// Releases to display
+//print '<div about="" xmlns:sioc="http://rdfs.org/sioc/ns#" rel="container_of" resource="'.util_make_link ('/frs/?group_id=' . $group_id . '&amp;release_id=' . db_result($res_files,$f,'release_id').'">';
 					echo '
                         <td>'
 						.$package_release.'
@@ -284,6 +297,7 @@
 						. $rel_date["month"] . ' ' . $rel_date["mday"] . ', ' . $rel_date["year"] .
 						'</td>
 						<td class="align-center">';
+//echo '</div>';
 					
 					// -> notes
 					// accessibility: image is a link, so alt must be unique in page => construct a unique alt
@@ -384,6 +398,7 @@
 
 if ($project->usesForum()) {
 	echo '<div class="public-area-box">';
+//	print '<hr size="1" /><a rel="sioc:container_of" xmlns:sioc="http://rdfs.org/sioc/ns#" href="'.util_make_url ('/forum/?group_id='.$group_id).'">';
     $link_content = $HTML->getForumPic('') . '&nbsp;' . _('Public Forums');
     echo util_make_link ( '/forum/?group_id=' . $group_id, $link_content);
 	print ' (';
@@ -401,6 +416,7 @@
 if ($project->usesDocman()) {
 	echo '<div class="public-area-box">';
 	$link_content = $HTML->getDocmanPic('') . '&nbsp;' . _('DocManager: Project Documentation');
+//	<a rel="sioc:container_of" xmlns:sioc="http://rdfs.org/sioc/ns#" href="'.util_make_url ('/docman/?group_id='.$group_id).'">';
 	print util_make_link( '/docman/?group_id='.$group_id, $link_content);
 	echo '</div>';
 }
@@ -457,6 +473,7 @@
 	echo '<div class="public-area-box">';
 
 	$link_content = $HTML->getScmPic('') . '&nbsp;' . _('SCM Repository');
+//	print '<hr size="1" /><a rel="doap:repository" href="'.util_make_url ('/scm/?group_id='.$group_id).'">';
 	print util_make_link( '/scm/?group_id='.$group_id, $link_content);
 
 	$hook_params = array () ;
@@ -479,6 +496,7 @@
 		echo '<div class="public-area-box">';
 		
 		$link_content = $HTML->getFtpPic('') . '&nbsp;' . _('Anonymous FTP Space');
+//		print '<a rel="doap:anonymous root" href="ftp://' . $project->getUnixName() . '.' . $GLOBALS['sys_default_domain'] . '/pub/'. $project->getUnixName() .'/">';
         print util_make_link('ftp://' . $project->getUnixName() . '.' . $GLOBALS['sys_default_domain'] . '/pub/'. $project->getUnixName(), $link_content, false, true);
 		echo '</div>';
 	}

Modified: trunk/gforge/www/include/user_home.php
===================================================================
--- trunk/gforge/www/include/user_home.php	2010-04-06 14:52:10 UTC (rev 9377)
+++ trunk/gforge/www/include/user_home.php	2010-04-06 15:31:13 UTC (rev 9378)
@@ -17,6 +17,8 @@
 
 echo $HTML->boxTop(_('Personal Information'), _('Personal Information')); ?>
 
+<div about="" typeof="sioc:UserAccount" xmlns:sioc="http://rdfs.org/sioc/ns#">
+
 <table class="my-layout-table" id="user-profile-personal-info">
 <tr> 
 	<td>
@@ -25,10 +27,16 @@
 	<td>
 		<strong>
 <?php
+//print '<div property ="foaf:member" content="fusionforge:ForgeCommunity" xmlns:fusionforge="http://fusionforge.org/fusionforge#">';
+//echo '</div>';
+// description as a FusionForge Community member
+//print '<div property ="dc:Identifier" content="'.$user_id.'" xmlns:dc="http://purl.org/dc/elements/1.1/">';
+
 	if (session_loggedin() && user_ismember(1)) {
 		echo util_make_link ('/admin/useredit.php?user_id='.$user_id,$user_id);
 	} else {
 		echo $user_id;
+//echo '</div>';
 	}
 ?>
 		</strong><?php if($GLOBALS['sys_use_people']) { ?>( <?php echo util_make_link ('/people/viewprofile.php?user_id='.$user_id,'<strong>'._('Skills Profile').'</strong>'); ?> )<?php } ?>
@@ -37,19 +45,38 @@
 
 <tr>
 	<td><?php echo _('Login name') ?></td>
-	<td><strong><?php print $user->getUnixName(); ?></strong></td>
+	<td><strong><span property="sioc:name"><?php 
+		print $user->getUnixName(); 
+		?></span></strong></td>
 </tr>
 
 <tr>
 	<td><?php echo _('Real name') ?> </td>
-	<td><strong><?php print $user->getTitle() .' '. $user->getRealName(); ?></strong></td>
+	<td>
+		<div rev="foaf:account" xmlns:foaf="http://xmlns.com/foaf/0.1/">
+			<div about="#me" typeof="foaf:Person">
+				<strong><span property="foaf:name"><?php 
+				$user_title = $user->getTitle();
+				print ($user_title ? $user_title .' ' :''). $user->getRealName(); 
+				?></span></strong>
+			</div>
+		</div>
+	</td>
 </tr>
 
 <?php if(!isset($GLOBALS['sys_show_contact_info']) || $GLOBALS['sys_show_contact_info']) { ?>
 <tr>
 	<td><?php echo _('Your Email Address') ?>: </td>
 	<td>
-	<strong><?php echo util_make_link ('/sendmessage.php?touser='.$user_id, str_replace('@',' @nospam@ ',$user->getEmail())); ?></strong>
+	<strong><?php 
+		//$user_mail=$user->getEmail();
+		$user_mailsha1=$user->getSha1Email();
+		// Removed for privacy reasons
+		//print '<span property="sioc:email" content="'. $user_mail .'">';
+		print '<span property="sioc:email_sha1" content="'. $user_mailsha1 .'">';
+		echo util_make_link ('/sendmessage.php?touser='.$user_id, str_replace('@',' @nospam@ ',$user_mail)); 
+		echo '</span>'; 
+	?></strong>
 	</td>
 </tr>
 <?php if ($user->getJabberAddress()) { ?>
@@ -71,7 +98,11 @@
 <?php if ($user->getPhone()) { ?>
 <tr>
 	<td><?php echo _('Phone:'); ?></td>
-	<td><?php echo $user->getPhone(); ?></td>
+	<td><?php 
+//print '<div property="foaf:phone" content="'.$user->getPhone().'">';
+echo $user->getPhone(); 
+//echo '</div>'; 
+?></td>
 </tr>
 <?php } ?>
 
@@ -118,8 +149,12 @@
 		$res = db_query_params ('SELECT count(*) from user_diary WHERE user_id=$1 AND is_public=1',
 					array ($user_id));
 		echo _('Diary/Note entries:').' '.db_result($res,0,0).'
-		<p>'.util_make_link ('/developer/diary.php?diary_user='.$user_id,_('View Diary & Notes')).'</p>
 		<p>';
+		//.'<span rel="foaf:weblog">'
+		echo util_make_link ('/developer/diary.php?diary_user='.$user_id,_('View Diary & Notes'));
+		//.'</span>'.
+		echo '</p>
+		<p>';
 		echo util_make_link ('/developer/monitor.php?diary_user='.$user_id,
 						html_image("ic/check.png",'15','13',array(),0) ._('Monitor this Diary')
 			) ;
@@ -155,11 +190,19 @@
 } else { // endif no groups
 	print "<p>"._('This developer is a member of the following projects:')."<br />&nbsp;";
 	while ($row_cat = db_fetch_array($res_cat)) {
-		print ('<br />' . util_make_link_g ($row_cat['unix_group_name'],$row_cat['group_id'],$row_cat['group_name']).' ('.$row_cat['role_name'].')');
+		$project_link = util_make_link_g ($row_cat['unix_group_name'],$row_cat['group_id'],$row_cat['group_name']);
+		// sioc:UserGroups for all members of a project are named after /projects/A_PROJECT/members/ 
+		$project_uri = util_make_url_g ($row_cat['unix_group_name'],$row_cat['group_id']);
+		print '<span rel="sioc:member_of" resource="'. $project_uri .'members/">';
+//print '<div property="sioc:has_function" content= "'.$row_cat['role_name'].'" xmlns:sioc="http://rdfs.org/sioc/ns#">';
+		print ('<br />' . $project_link .' ('.$row_cat['role_name'].')');
 		print "\n";
+		echo '</span>';
 	}
 	print '</p>';
 } // end if groups
+//</div>
+// end of community member description block 
 
 
 $me = session_get_user(); 

Modified: trunk/gforge/www/project/memberlist.php
===================================================================
--- trunk/gforge/www/project/memberlist.php	2010-04-06 14:52:10 UTC (rev 9377)
+++ trunk/gforge/www/project/memberlist.php	2010-04-06 15:31:13 UTC (rev 9378)
@@ -38,6 +38,14 @@
 echo '<h1>' . _('Project Member List') . '</h1>';
 
 echo '<p>' . _('If you would like to contribute to this project by becoming a developer, contact one of the project admins, designated in bold text below.') . '</p>';
+// beginning of the user descripion block
+$project =& group_get_object($group_id);
+$project_stdzd_uri = util_make_url_g ($project->getUnixName(), $group_id);
+$usergroup_stdzd_uri = $project_stdzd_uri.'members/';
+print '<div about="'. $usergroup_stdzd_uri .'" typeof="sioc:UserGroup" xmlns:sioc="http://rdfs.org/sioc/ns#">';
+print '<span rel="http://www.w3.org/2002/07/owl#sameAs" resource=""></span>';
+print '<span rev="sioc:has_usergroup" resource="'. $project_stdzd_uri . '"></span>';
+print '</div>';
 
 $title_arr=array();
 $title_arr[]=_('Member');
@@ -57,23 +65,41 @@
 	AND user_group.group_id=$1
 	AND users.status='A'
 	ORDER BY users.user_name ", array($group_id));
+
 $i=0;
 while ( $row_memb=db_fetch_array($res_memb) ) {
-	echo '<tr '.$HTML->boxGetAltRowStyle($i++).'>';
+	echo '<tr '.$HTML->boxGetAltRowStyle($i++).'>'."\n";
+	// RDFa
+	$member_uri = util_make_url_u ($row_memb['user_name'],$row_memb['user_id']);
+	print '<div about="'. $member_uri .'" typeof="sioc:UserAccount">';
+	print '<span rev="sioc:has_member" resource="'. $usergroup_stdzd_uri .'"></span>';
+	print '<span property="sioc:name" content="'. $row_memb['user_name'] .'"></span>';
 	if ( trim($row_memb['admin_flags'])=='A' ) {
+//                echo '<div rev="doap:developer" typeof="doap:Project" xmlns:doap="http://usefulinc.com/ns/doap#">';
 		echo '		<td><strong>'.$row_memb['realname'].'</strong></td>';
+//                echo '</div>';
 	} else {
+//		echo '<div rev="doap:maintainer" typeof="doap:Project" xmlns:doap="http://usefulinc.com/ns/doap#">';
 		echo '		<td>'.$row_memb['realname'].'</td>';
+//                echo '</div>';
 	}
-
+	
+	/*
+        print '<span property ="dc:Identifier" content="'.$row_memb['user_id'].'" xmlns:dc="http://purl.org/dc/elements/1.1/">';
+        echo '</span>';
+        print '<span property="foaf:accountName" content="'.$row_memb['user_name'].'">';
+        echo '</span>';
+        print '<span property="fusionforge:has_job" content="'.$row_memb['role'].'" xmlns:fusionforge="http://fusionforge.org/fusionforge#">';
+        echo '</span>';*/
 	echo '<td align="center">'.util_make_link_u ($row_memb['user_name'],$row_memb['user_id'],$row_memb['user_name']).'</td>
 	<td align="center">'.$row_memb['role'].'</td>';
 	if($GLOBALS['sys_use_people']) {
 		echo '<td align="center">'.util_make_link ('/people/viewprofile.php?user_id='.$row_memb['user_id'],_('View')).'</td>';
 	}
-	echo '</tr>';
+	print '</div>';
+   	echo '</tr>';
 }
-
+// end of community member description block 
 echo $GLOBALS['HTML']->listTableBottom();
 
 site_project_footer(array());




More information about the Fusionforge-commits mailing list