$plugin = plugin_get_object ('contribtracker') ;
function display_contribution ($c, $show_groups = false) {
- print '<h3>'.$c->getName().'</h3>' ;
+ global $plugin ;
+ print '<h2>'.$c->getName().'</h2>' ;
if ($show_groups) {
- print '<strong>'._('Group:').'</strong> ' ;
+ print '<strong>'._('Project:').'</strong> ' ;
print util_make_link_g ($c->getGroup()->getUnixName(),
$c->getGroup()->getId(),
htmlspecialchars ($c->getGroup()->getPublicName())) ;
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/'.$plugin->name.'/?actor_id='.$p->getActor()->getId (),
htmlspecialchars ($p->getActor()->getName())),
htmlspecialchars ($p->getActor()->getLegalStructure()->getName())) ;
+ if ($p->getActor()->getLogo() != '') {
+ print ' ';
+ print util_make_link ('/plugins/'.$plugin->name.'/?actor_id='.$p->getActor()->getId (),
+ '<img type="image/png" src="'.util_make_url ('/plugins/'.$plugin->name.'/actor_logo.php?actor_id='.$p->getActor()->getId ()).'" />') ;
+ }
print '</li>' ;
}
print '</ul>' ;
}
$group_id = getIntFromRequest ('group_id') ;
+$actor_id = getIntFromRequest ('actor_id') ;
if ($group_id) {
$group = group_get_object ($group_id) ;
if(!$group || !is_object ($group)) {
site_project_header ($params) ;
$contribs = $plugin->getContributionsByGroup ($group) ;
- usort ($contribs, array ($plugin, "ContribComparator")) ;
if (count ($contribs) == 0) {
print '<h1>'._('No contributions').'</h1>' ;
print _('No contributions have been recorded for this project yet.') ;
} else {
- print '<h1>'._('Latest contributions').'</h1>' ;
+ print '<h1>'.sprintf (_('Contributions for project %s'),
+ htmlspecialchars ($group->getPublicName())).'</h1>' ;
foreach ($contribs as $c) {
display_contribution ($c) ;
+ print '<hr />' ;
}
}
}
+} 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>'._('URL:').'</strong> ' ;
+ if ($actor->getUrl() != '') {
+ print '<a href="'.htmlspecialchars($actor->getUrl()).'">'.htmlspecialchars($actor->getUrl()).'</a>';
+ }
+ print '</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>' ;
+ if ($actor->getLogo() != '') {
+ if ($actor->getUrl() != '') {
+ print '<a href="'.htmlspecialchars($actor->getUrl()).'"><img type="image/png" src="'.util_make_url ('/plugins/'.$plugin->name.'/actor_logo.php?actor_id='.$actor->getId ()).'" /></a>' ;
+ } else {
+ print '<img type="image/png" src="'.util_make_url ('/plugins/'.$plugin->name.'/actor_logo.php?actor_id='.$actor->getId ()).'" />' ;
+ }
+ }
+
+ $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 '<h2>' . util_make_link ('/plugins/'.$plugin->name.'/?group_id='.$c->getGroup()->getId().'&contrib_id='.$c->getId (),
+ htmlspecialchars ($c->getName())) . '</h2>' ;
+ print '<strong>'._('Project:').'</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()) ;
+ print '<hr />' ;
+ }
+ }
} else { // Latest contributions, globally
$HTML->header(array('title'=>_('Contributions'),'pagename'=>'contribtracker'));
$contribs = $plugin->getContributions () ;
- usort ($contribs, array ($plugin, "ContribComparator")) ;
-
if (count ($contribs) == 0) {
print '<h1>'._('No contributions').'</h1>' ;
print _('No contributions have been recorded yet.') ;
$i = 1 ;
foreach ($contribs as $c) {
display_contribution ($c, true) ;
+ print '<hr />' ;
$i++ ;
if ($i > 20) {
break ;
}
}
-
site_project_footer(array());
// Local Variables: