3 * FusionForge Tracker Listing
5 * Copyright 2000, Quentin Cregan/Sourceforge
6 * Copyright 2002-2003, Tim Perdue/GForge, LLC
7 * Copyright 2010, FusionForge Team
8 * Copyright 2011, Franck Villaume - Capgemini
9 * Copyright 2012-2013, Franck Villaume - TrivialDev
11 * This file is part of FusionForge. FusionForge is free software;
12 * you can redistribute it and/or modify it under the terms of the
13 * GNU General Public License as published by the Free Software
14 * Foundation; either version 2 of the Licence, or (at your option)
17 * FusionForge is distributed in the hope that it will be useful,
18 * but WITHOUT ANY WARRANTY; without even the implied warranty of
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 * GNU General Public License for more details.
22 * You should have received a copy of the GNU General Public License along
23 * with FusionForge; if not, write to the Free Software Foundation, Inc.,
24 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
29 if (getStringFromRequest('post_changes')) {
30 $name = getStringFromRequest('name');
31 $description = getStringFromRequest('description');
32 $email_all = getStringFromRequest('email_all');
33 $email_address = getStringFromRequest('email_address');
34 $due_period = getStringFromRequest('due_period');
35 $use_resolution = getStringFromRequest('use_resolution');
36 $submit_instructions = getStringFromRequest('submit_instructions');
37 $browse_instructions = getStringFromRequest('browse_instructions');
39 if (!forge_check_perm ('tracker_admin', $group->getID())) {
40 exit_permission_denied('','tracker');
43 if (getStringFromRequest('add_at')) {
44 $res=new ArtifactTypeHtml($group);
45 if (!$res->create($name,$description,$email_all,$email_address,
46 $due_period,$use_resolution,$submit_instructions,$browse_instructions)) {
47 exit_error($res->getErrorMessage(),'tracker');
49 $feedback .= _('Tracker created successfully');
51 $feedback .= _('Please configure also the roles (by default, it\'s \'No Access\')');
53 $group->normalizeAllRoles () ;
59 // Display existing artifact types
61 $atf = new ArtifactTypeFactoryHtml($group);
62 if (!$atf || !is_object($atf) || $atf->isError()) {
63 exit_error(_('Could Not Get ArtifactTypeFactory'),'tracker');
66 // Only keep the Artifacts where the user has admin rights.
67 $arr = $atf->getArtifactTypes();
69 for ($j = 0; $j < count($arr); $j++) {
70 if (forge_check_perm ('tracker', $arr[$j]->getID(), 'manager')) {
71 $at_arr[$i++] =& $arr[$j];
74 // If no more tracker now,
76 exit_permission_denied('','tracker');
79 //required params for site_project_header();
80 $params['group']=$group_id;
81 $params['toptab']='tracker';
82 if(isset($page_title)){
83 $params['title'] = $page_title;
85 $params['title'] = '';
88 $atf->header( array('title' => _('Trackers Administration')));
90 if (!isset($at_arr) || !$at_arr || count($at_arr) < 1) {
91 echo '<div class="warning">'._('No trackers found').'</div>';
95 <p>'._('Choose a data type and you can set up prefs, categories, groups, users, and permissions').'.</p>';
98 Put the result set (list of forums for this group) into a column with folders
100 $tablearr=array(_('Tracker'),_('Description'));
101 echo $HTML->listTableTop($tablearr);
103 for ($j = 0; $j < count($at_arr); $j++) {
105 <tr '. $HTML->boxGetAltRowStyle($j) . '>
106 <td><a href="'.util_make_url ('/tracker/admin/?atid='. $at_arr[$j]->getID() . '&group_id='.$group_id).'">' .
107 html_image("ic/tracker20w.png","20","20") . ' '.
108 $at_arr[$j]->getName() .'</a>
110 <td>'.$at_arr[$j]->getDescription() .'
114 echo $HTML->listTableBottom();
116 $roadmap_factory = new RoadmapFactory($group);
117 $roadmaps = $roadmap_factory->getRoadmaps(true);
118 if (!empty($roadmaps)) {
119 echo ' <p id="roadmapadminlink">
120 <a href="'.util_make_url('/tracker/admin/?group_id='.$group_id.'&admin_roadmap=1').'" >'._('Manage your roadmaps.').'</a>
126 // Set up blank ArtifactType
129 if (forge_check_perm ('tracker_admin', $group->getID())) {
130 ?><?php echo _('<h3>Create a new tracker</h3><p>You can use this system to track virtually any kind of data, with each tracker having separate user, group, category, and permission lists. You can also easily move items between trackers when needed.</p><p>Trackers are referred to as "Artifact Types" and individual pieces of data are "Artifacts". "Bugs" might be an Artifact Type, whiles a bug report would be an Artifact. You can create as many Artifact Types as you want, but remember you need to set up categories, groups, and permission for each type, which can get time-consuming.</p>') ?>
131 <form action="<?php echo getStringFromServer('PHP_SELF').'?group_id='.$group_id; ?>" method="post">
132 <input type="hidden" name="add_at" value="y" />
134 <?php echo _('<strong> Name:</strong> (examples: meeting minutes, test results, RFP Docs)') ?><br />
135 <input type="text" name="name" value="" /></p>
137 <strong><?php echo _('Description') ?>:</strong><br />
138 <input type="text" name="description" value="" size="50" /></p>
140 <strong><?php echo _('Send email on new submission to address') ?>:</strong><br />
141 <input type="text" name="email_address" value="" /></p>
143 <input type="checkbox" name="email_all" value="1" /> <strong><?php echo _('Send email on all changes') ?></strong></p>
145 <strong><?php echo _('Days till considered overdue') ?>:</strong><br />
146 <input type="text" name="due_period" value="30" /></p>
148 <strong><?php echo _('Days till pending tracker items time out') ?>:</strong><br />
149 <input type="text" name="status_timeout" value="14" /></p>
151 <strong><?php echo _('Free form text for the "submit new item" page') ?>:</strong><br />
152 <textarea name="submit_instructions" rows="10" cols="55"></textarea></p>
154 <strong><?php echo _('Free form text for the "browse items" page') ?>:</strong><br />
155 <textarea name="browse_instructions" rows="10" cols="55"></textarea></p>
157 <input type="submit" name="post_changes" value="<?php echo _('Submit') ?>" /></p>
166 // c-file-style: "bsd"