[Fusionforge-commits] r8579 - in trunk/gforge/plugins/contribtracker: common www

Roland Mas lolando at libremir.placard.fr.eu.org
Fri Dec 18 18:40:35 CET 2009


Author: lolando
Date: 2009-12-18 18:40:35 +0100 (Fri, 18 Dec 2009)
New Revision: 8579

Removed:
   trunk/gforge/plugins/contribtracker/www/show_actor.php
Modified:
   trunk/gforge/plugins/contribtracker/common/ContribTrackerPlugin.class.php
   trunk/gforge/plugins/contribtracker/www/index.php
Log:
Moved display of actors into index.php

Modified: trunk/gforge/plugins/contribtracker/common/ContribTrackerPlugin.class.php
===================================================================
--- trunk/gforge/plugins/contribtracker/common/ContribTrackerPlugin.class.php	2009-12-18 17:40:22 UTC (rev 8578)
+++ trunk/gforge/plugins/contribtracker/common/ContribTrackerPlugin.class.php	2009-12-18 17:40:35 UTC (rev 8579)
@@ -140,7 +140,7 @@
 						$parts = $c->getParticipations () ;
 						foreach ($parts as $p) {
 							echo '<tr><td></td><td></td><td>' ;
-							echo (util_make_link ('/plugins/'.$this->name.'/show_actor.php?actor_id='.$p->getActor()->getId (),
+							echo (util_make_link ('/plugins/'.$this->name.'/index.php?actor_id='.$p->getActor()->getId (),
 									      htmlspecialchars ($p->getActor()->getName()))) ;
 							echo '</td><td>' ;
 							echo htmlspecialchars ($p->getRole()->getName()) ;

Modified: trunk/gforge/plugins/contribtracker/www/index.php
===================================================================
--- trunk/gforge/plugins/contribtracker/www/index.php	2009-12-18 17:40:22 UTC (rev 8578)
+++ trunk/gforge/plugins/contribtracker/www/index.php	2009-12-18 17:40:35 UTC (rev 8579)
@@ -39,7 +39,7 @@
 		print '<li>' ;
 		printf (_('%s: %s (%s)'),
 			htmlspecialchars ($p->getRole()->getName()),
-			util_make_link ('/plugins/contribtracker/show_actor.php?actor_id='.$p->getActor()->getId (),
+			util_make_link ('/plugins/contribtracker/index.php?actor_id='.$p->getActor()->getId (),
 					htmlspecialchars ($p->getActor()->getName())),
 			htmlspecialchars ($p->getActor()->getLegalStructure()->getName())) ;
 		print '</li>' ;
@@ -48,6 +48,7 @@
 }
 	
 $group_id = getIntFromRequest ('group_id') ;
+$actor_id = getIntFromRequest ('actor_id') ;
 if ($group_id) {
 	$group = group_get_object ($group_id) ;
 	if(!$group || !is_object ($group)) {
@@ -104,6 +105,49 @@
 			}
 		}
 	}
+} elseif ($actor_id) {
+	$actor = new ContribTrackerActor ($actor_id) ;
+	if (!is_object ($actor) || $actor->isError()) {
+		exit_error (_('Invalid actor'),
+			    _('Invalid actor specified')) ;
+	}
+
+	$HTML->header(array('title'=>_('Actor details'),'pagename'=>'contribtracker'));
+	
+	print '<h1>'.sprintf(_('Actor details for %s'),
+			     htmlspecialchars($actor->getName())).'</h1>' ;
+	print '<ul>' ;
+	print '<li><strong>'._('Name:').'</strong> '.htmlspecialchars($actor->getName()).'</li>' ;
+	print '<li><strong>'._('Address:').'</strong> '.htmlspecialchars($actor->getAddress()).'</li>' ;
+	print '<li><strong>'._('Email:').'</strong> '.htmlspecialchars($actor->getEmail()).'</li>' ;
+	print '<li><strong>'._('Legal structure:').'</strong> '.htmlspecialchars($actor->getLegalStructure()->getName()).'</li>' ;
+	print '<li><strong>'._('Description:').'</strong> '.htmlspecialchars($actor->getDescription()).'</li>' ;
+	print '</ul>' ;
+	
+	$participations = $actor->getParticipations () ;
+	
+	if (count ($participations) == 0) {
+		printf (_("%s hasn't been involved in any contributions yet"),
+			htmlspecialchars($actor->getName())) ;
+	} else {
+		print '<h1>'.sprintf(ngettext('Contribution by %s',
+					      'Contributions by %s',
+					      count($participations)),
+				     htmlspecialchars($actor->getName())).'</h1>' ;
+		
+		foreach ($participations as $p) {
+			$c = $p->getContribution () ;
+			print '<h3>' . util_make_link ('/plugins/contribtracker/index.php?group_id='.$c->getGroup()->getId().'&contrib_id='.$c->getId (),
+						       htmlspecialchars ($c->getName())) . '</h3>' ;
+			print '<strong>'._('Group:').'</strong> ' ;
+			print util_make_link_g ($c->getGroup()->getUnixName(),
+						$c->getGroup()->getId(),
+						$c->getGroup()->getPublicName()) ;
+			print '<br /><strong>'._('Role:').'</strong> ' ;
+			print htmlspecialchars ($p->getRole()->getName()) ;
+		}
+	}
+	site_project_footer(array());
 } else {			// Latest contributions, globally
 	$HTML->header(array('title'=>_('Contributions'),'pagename'=>'contribtracker'));
 	

Deleted: trunk/gforge/plugins/contribtracker/www/show_actor.php
===================================================================
--- trunk/gforge/plugins/contribtracker/www/show_actor.php	2009-12-18 17:40:22 UTC (rev 8578)
+++ trunk/gforge/plugins/contribtracker/www/show_actor.php	2009-12-18 17:40:35 UTC (rev 8579)
@@ -1,64 +0,0 @@
-<?php
-
-/*
- * ContribTracker plugin
- *
- * Copyright 2009, Roland Mas
- *
- */
-
-require_once('../../env.inc.php');
-require_once $gfwww.'include/pre.php';
-
-$plugin = plugin_get_object ('contribtracker') ;
-
-$actor_id = getIntFromRequest ('actor_id') ;
-$actor = new ContribTrackerActor ($actor_id) ;
-if (!$actor || !is_object ($actor) || $actor->isError()) {
-	exit_error (_('No actor'),
-		    _('No actor or invalid actor specified')) ;
-}
-
-$HTML->header(array('title'=>_('Actor details'),'pagename'=>'contribtracker'));
-
-print '<h1>'.sprintf(_('Actor details for %s'),
-		     htmlspecialchars($actor->getName())).'</h1>' ;
-print '<ul>' ;
-print '<li><strong>'._('Name:').'</strong> '.htmlspecialchars($actor->getName()).'</li>' ;
-print '<li><strong>'._('Address:').'</strong> '.htmlspecialchars($actor->getAddress()).'</li>' ;
-print '<li><strong>'._('Email:').'</strong> '.htmlspecialchars($actor->getEmail()).'</li>' ;
-print '<li><strong>'._('Legal structure:').'</strong> '.htmlspecialchars($actor->getLegalStructure()->getName()).'</li>' ;
-print '<li><strong>'._('Description:').'</strong> '.htmlspecialchars($actor->getDescription()).'</li>' ;
-print '</ul>' ;
-
-$participations = $actor->getParticipations () ;
-
-if (count ($participations) == 0) {
-	printf (_("%s hasn't been involved in any contributions yet"),
-		htmlspecialchars($actor->getName())) ;
-} else {
-	print '<h1>'.sprintf(ngettext('Contribution by %s',
-				      'Contributions by %s',
-				      count($participations)),
-			     htmlspecialchars($actor->getName())).'</h1>' ;
-
-	foreach ($participations as $p) {
-		$c = $p->getContribution () ;
-		print '<h3>' . util_make_link ('/plugins/contribtracker/index.php?group_id='.$c->getGroup()->getId().'&contrib_id='.$c->getId (),
-					       htmlspecialchars ($c->getName())) . '</h3>' ;
-		print '<strong>'._('Group:').'</strong> ' ;
-		print util_make_link_g ($c->getGroup()->getUnixName(),
-					$c->getGroup()->getId(),
-					$c->getGroup()->getPublicName()) ;
-		print '<br /><strong>'._('Role:').'</strong> ' ;
-		print htmlspecialchars ($p->getRole()->getName()) ;
-	}
-}
-site_project_footer(array());
-
-// Local Variables:
-// mode: php
-// c-file-style: "bsd"
-// End:
-
-?>




More information about the Fusionforge-commits mailing list