5 * Copyright 2010-2011, Franck Villaume - Capgemini
6 * Copyright (C) 2011 Alain Peyrat - Alcatel-Lucent
7 * http://fusionforge.org/
9 * This file is part of FusionForge. FusionForge is free software;
10 * you can redistribute it and/or modify it under the terms of the
11 * GNU General Public License as published by the Free Software
12 * Foundation; either version 2 of the Licence, or (at your option)
15 * FusionForge is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU General Public License for more details.
20 * You should have received a copy of the GNU General Public License along
21 * with FusionForge; if not, write to the Free Software Foundation, Inc.,
22 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
25 $atf = new ArtifactTypeFactoryHtml($group);
26 if (!$group || !is_object($group) || $group->isError()) {
27 exit_error(_('Could Not Get ArtifactTypeFactory'),'tracker');
30 $at_arr = $atf->getArtifactTypes();
31 if ($at_arr === false) {
32 exit_permission_denied('tracker');
35 use_javascript('/js/sortable.js');
37 //required params for site_project_header();
38 $params['group']=$group_id;
39 $params['title']=sprintf(_('Trackers for %1$s'), $group->getPublicName());
40 $params['toptab']='tracker';
42 if (forge_check_perm('tracker_admin', $group_id)) {
44 $menu_links = array();
45 $menu_text[] = _('Administration');
46 $menu_links[] = '/tracker/admin/?group_id='.$group_id;
47 $menu_attr[] = array('title' => _('Global administration for trackers. Create, clone, workflow, fields ...'), 'class' => 'tabtitle-nw');
48 echo $HTML->subMenu($menu_text, $menu_links, $menu_attr);
53 if (!$at_arr || count($at_arr) < 1) {
54 echo '<div class="warning">'._('No Accessible Trackers Found').'</div>';
55 printf(_('<p><strong>No trackers have been set up, or you cannot view them.</strong></p><p><span class="important">The Admin for this project will have to set up data types using the %1$s admin page %2$s</span></p>'), '<a href="'.util_make_url ('/tracker/admin/?group_id='.$group_id).'">', '</a>');
58 plugin_hook ("blocks", "tracker index");
60 echo '<p>'._('Choose a tracker and you can browse/edit/add items to it.').'</p>';
63 Put the result set (list of trackers for this group) into a column with folders
65 $tablearr = array(_('Tracker'),_('Description'),_('Open'),_('Total'));
67 echo $HTML->listTableTop($tablearr, false, 'sortable_table_tracker', 'sortable_table_tracker');
69 for ($j = 0; $j < count($at_arr); $j++) {
70 if (!is_object($at_arr[$j])) {
72 } elseif ($at_arr[$j]->isError()) {
73 echo $at_arr[$j]->getErrorMessage();
77 <td><a href="'.util_make_uri('/tracker/?atid='.$at_arr[$j]->getID().'&group_id='.$group_id.'&func=browse').'">'.
78 html_image("ic/tracker20w.png","20","20").' '.
79 $at_arr[$j]->getName() .'</a>
81 <td>' . $at_arr[$j]->getDescription() .'
83 <td style="text-align:center">'. (int) $at_arr[$j]->getOpenCount() . '
85 <td style="text-align:center">'. (int) $at_arr[$j]->getTotalCount() .'
90 echo $HTML->listTableBottom();
97 // c-file-style: "bsd"