[Fusionforge-commits] r8584 - trunk/gforge/plugins/contribtracker/www

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


Author: lolando
Date: 2009-12-18 18:41:34 +0100 (Fri, 18 Dec 2009)
New Revision: 8584

Modified:
   trunk/gforge/plugins/contribtracker/www/project_admin.php
Log:
UI?\194?\160to add/remove participants to a contribution

Modified: trunk/gforge/plugins/contribtracker/www/project_admin.php
===================================================================
--- trunk/gforge/plugins/contribtracker/www/project_admin.php	2009-12-18 17:41:24 UTC (rev 8583)
+++ trunk/gforge/plugins/contribtracker/www/project_admin.php	2009-12-18 17:41:34 UTC (rev 8584)
@@ -47,7 +47,7 @@
 function check_part_id ($p_id, $c_id) {
 	$part = new ContribTrackerParticipation ($p_id) ;
 	if (!$part || !is_object ($part)
-	    || $part->getContrib()->getId() != $c_id) {
+	    || $part->getContribution()->getId() != $c_id) {
 		exit_permission_denied () ;
 	}
 }
@@ -165,9 +165,65 @@
 	 break ;
 case 'edit_contrib':
 	print '<h1>'._('Edit a contribution').'</h1>' ;
+	  print '<h3>'._('Add a participant').'</h3>' ;
+	
 	$contrib = new ContribTrackerContribution ($contrib_id) ;
 ?>
 <form action="<?php echo util_make_url ('/plugins/'.$plugin->name.'/project_admin.php') ?>" method="post">
+<input type="hidden" name="action" value="add_part" />
+<input type="hidden" name="group_id" value="<?php echo $group_id ?>" />
+<input type="hidden" name="contrib_id" value="<?php echo $contrib->getId() ?>" />
+<select name="actor_id">
+<?php
+	$actors = $plugin->getActors () ;
+	foreach ($actors as $a) {
+		print '<option value="'.$a->getId().'">'.htmlspecialchars($a->getName()).'</option>' ;
+	}
+?>
+</select>
+<select name="role_id">
+<?php
+	$roles = $plugin->getRoles () ;
+	foreach ($roles as $r) {
+		print '<option value="'.$r->getId().'">'.htmlspecialchars($r->getName()).'</option>' ;
+	}
+?>
+</select>
+<input type="submit" name="submit" value="<?php echo _('Add participant') ?>" />
+</form>
+<?php
+	  print '<h3>'._('Current participants').'</h3>' ;
+	  
+	$parts = $contrib->getParticipations () ;
+	print '<strong>'.ngettext('Participant:',
+				  'Participants:',
+				  count ($parts)).'</strong> ' ;
+	print '<br />' ;
+	print '<ul>' ;
+	foreach ($parts as $p) {
+		print '<li>' ;
+		printf (_('%s: %s (%s)'),
+			htmlspecialchars ($p->getRole()->getName()),
+			util_make_link ('/plugins/'.$plugin->name.'/?actor_id='.$p->getActor()->getId (),
+					htmlspecialchars ($p->getActor()->getName())),
+			htmlspecialchars ($p->getActor()->getLegalStructure()->getName())) ;
+?>
+<form action="<?php echo util_make_url ('/plugins/'.$plugin->name.'/project_admin.php') ?>" method="post">
+<input type="hidden" name="action" value="del_part" />
+<input type="hidden" name="group_id" value="<?php echo $group_id ?>" />
+<input type="hidden" name="contrib_id" value="<?php echo $contrib->getId() ?>" />
+<input type="hidden" name="part_id" value="<?php echo $p->getId() ?>" />
+<input type="submit" name="submit" value="<?php echo _('Delete') ?>" />
+</form>
+<?php
+		print '</li>' ;
+	}
+	print '</ul>' ;
+	
+	  print '<h3>'._('Contribution details').'</h3>' ;
+
+?>
+<form action="<?php echo util_make_url ('/plugins/'.$plugin->name.'/project_admin.php') ?>" method="post">
 <input type="hidden" name="action" value="post_edit_contrib" />
 <input type="hidden" name="group_id" value="<?php echo $group_id ?>" />
 <input type="hidden" name="contrib_id" value="<?php echo $contrib->getId() ?>" />
@@ -175,10 +231,10 @@
 <?php echo _('Contribution date:') ?> <input type="text" name="date" value="<?php echo strftime($date_format,time()) ?>" /><br />
 <?php echo _('Contribution description:') ?><br />
 <textarea name="contrib_desc" rows="20" cols="80"><?php echo htmlspecialchars ($contrib->getDescription()) ?></textarea>
-<input type="submit" name="submit" value="<?php echo _('Submit') ?>" />
+<input type="submit" name="submit" value="<?php echo _('Save') ?>" />
 </form>
+<?php
 
-<?php
 	 break ;
 case 'display':
 ?>




More information about the Fusionforge-commits mailing list