Plugin() ; $this->name = "contribtracker" ; $this->text = "Contribution Tracker" ; // To show in the tabs, use... $this->hooks[] = "groupmenu" ; // To put into the project tabs $this->hooks[] = "groupisactivecheckbox" ; // The "use ..." checkbox in editgroupinfo $this->hooks[] = "groupisactivecheckboxpost" ; // $this->hooks[] = "project_admin_plugins"; // to show up in the admin page for group $this->hooks[] = "project_before_frs"; // project summary page $this->hooks[] = "site_admin_option_hook"; // to show in the site admin page } function CallHook ($hookname, $params) { if ($hookname == "groupmenu") { $group_id=$params['group']; $project = &group_get_object($group_id); if (!$project || !is_object($project)) { return; } if ($project->isError()) { return; } if (!$project->isProject()) { return; } if ( $project->usesPlugin ( $this->name ) ) { $params['TITLES'][] = _('Contribution tracker') ; $params['DIRS'][]='/plugins/'.$this->name.'/?group_id=' . $group_id ; } (($params['toptab'] == $this->name) ? $params['selected']=(count($params['TITLES'])-1) : '' ); } elseif ($hookname == "groupisactivecheckbox") { //Check if the group is active // this code creates the checkbox in the project edit public info page to activate/deactivate the plugin $group_id=$params['group']; $group = &group_get_object($group_id); echo "
'._('Date').' | '._('Contribution').' | '._('Contributor').' | '._('Role').' | |
---|---|---|---|---|
'._('No contributions have been recorded for this project yet.').' | ||||
' ; echo strftime (_('%Y-%m-%d'), $c->getDate ()) ; echo ' | ' ; echo '' ; echo util_make_link ('/plugins/'.$this->name.'/?group_id='.$group_id.'&contrib_id='.$c->getId(),htmlspecialchars($c->getName())) ; echo ' | ' ; } // Actors involved echo '' ; if ($p->getActor()->getLogo() != '') { print ' '; print util_make_link ('/plugins/'.$this->name.'/?actor_id='.$p->getActor()->getId (), '') ; } echo ' | ' ; printf (_('%s (%s)'), util_make_link ('/plugins/'.$this->name.'/?actor_id='.$p->getActor()->getId (), htmlspecialchars ($p->getActor()->getName())), htmlspecialchars ($p->getActor()->getLegalStructure()->getName())) ; echo ' | ' ; echo htmlspecialchars ($p->getRole()->getName()) ; echo ' | ' ; echo '