3 * GForge Project Management Facility
5 * Copyright 2002 GForge, LLC
12 By Tim Perdue, Sourceforge, 11/99
13 Heavy rewrite by Tim Perdue April 2000
15 Total rewrite in OO and GForge coding guidelines 12/2002 by Tim Perdue
18 require_once('../env.inc.php');
19 require_once $gfwww.'include/pre.php';
20 require_once $gfwww.'pm/include/ProjectGroupHTML.class.php';
21 require_once $gfcommon.'pm/ProjectGroupFactory.class.php';
23 $group_id = getIntFromRequest('group_id');
28 $g =& group_get_object($group_id);
29 if (!$g || !is_object($g)) {
31 } elseif ($g->isError()) {
32 exit_error('Error',$g->getErrorMessage());
35 $pgf = new ProjectGroupFactory($g);
36 if (!$pgf || !is_object($pgf)) {
37 exit_error('Error','Could Not Get Factory');
38 } elseif ($pgf->isError()) {
39 exit_error('Error',$pgf->getErrorMessage());
42 $pg_arr =& $pgf->getProjectGroups();
43 if ($pg_arr && $pgf->isError()) {
44 exit_error('Error',$pgf->getErrorMessage());
47 pm_header(array('title'=>_('Subprojects and Tasks')));
49 plugin_hook("blocks", "tasks index");
51 $perm =& $g->getPermission( session_get_user() );
52 if ($perm->isPMAdmin()) {
55 $menu_text[]=_('Admin');
56 $menu_links[]='/pm/admin/?group_id='.$group_id;
57 echo $HTML->subMenu($menu_text,$menu_links);
60 if (count($pg_arr) < 1 || $pg_arr == false) {
61 echo '<div class="warning_msg">'._('No Subprojects Found').'</div>';
62 echo '<p>'._('No subprojects have been set up, or you cannot view them.').'</p>';
63 echo '<p class="important">'._('The Admin for this project will have to set up subprojects using the admin page.').'</p>';
66 <p>'._('Choose a Subproject and you can browse/edit/add tasks to it.').'</p>';
69 Put the result set (list of projects for this group) into a column with folders
71 $tablearr=array(_('Subproject Name'),
74 _('Total Number of Tasks'));
75 echo $HTML->listTableTop($tablearr);
77 for ($j = 0; $j < count($pg_arr); $j++) {
78 if (!is_object($pg_arr[$j])) {
80 } elseif ($pg_arr[$j]->isError()) {
81 echo $pg_arr[$j]->getErrorMessage();
84 <tr '. $HTML->boxGetAltRowStyle($j) . '>
85 <td><a href="'.util_make_url ('/pm/task.php?group_project_id='. $pg_arr[$j]->getID().'&group_id='.$group_id.'&func=browse').'">' .
86 html_image("ic/taskman20w.png","20","20",array("border"=>"0", "align"=>"middle")) . ' '.
87 $pg_arr[$j]->getName() .'</a></td>
88 <td>'.$pg_arr[$j]->getDescription() .'</td>
89 <td style="text-align:right">'. (int) $pg_arr[$j]->getOpenCount().'</td>
90 <td style="text-align:right">'. (int) $pg_arr[$j]->getTotalCount().'</td>
94 echo $HTML->listTableBottom();