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 () ;
58 // Display existing artifact types
60 $atf = new ArtifactTypeFactoryHtml($group);
61 if (!$atf || !is_object($atf) || $atf->isError()) {
62 exit_error(_('Could Not Get ArtifactTypeFactory'),'tracker');
65 // Only keep the Artifacts where the user has admin rights.
66 $arr = $atf->getArtifactTypes();
68 for ($j = 0; $j < count($arr); $j++) {
69 if (forge_check_perm ('tracker', $arr[$j]->getID(), 'manager')) {
70 $at_arr[$i++] =& $arr[$j];
73 // If no more tracker now,
75 exit_permission_denied('','tracker');
78 //required params for site_project_header();
79 $params['group']=$group_id;
80 $params['toptab']='tracker';
81 if(isset($page_title)){
82 $params['title'] = $page_title;
84 $params['title'] = '';
87 $atf->header( array('title' => _('Trackers Administration')));
89 if (!isset($at_arr) || !$at_arr || count($at_arr) < 1) {
90 echo '<div class="warning">'._('No trackers found').'</div>';
94 <p>'._('Choose a data type and you can set up prefs, categories, groups, users, and permissions').'.</p>';
97 Put the result set (list of forums for this group) into a column with folders
99 $tablearr=array(_('Tracker'),_('Description'));
100 echo $HTML->listTableTop($tablearr);
102 for ($j = 0; $j < count($at_arr); $j++) {
104 <tr '. $HTML->boxGetAltRowStyle($j) . '>
105 <td><a href="'.util_make_url ('/tracker/admin/?atid='. $at_arr[$j]->getID() . '&group_id='.$group_id).'">' .
106 html_image("ic/tracker20w.png","20","20") . ' '.
107 $at_arr[$j]->getName() .'</a>
109 <td>'.$at_arr[$j]->getDescription() .'
113 echo $HTML->listTableBottom();
115 $roadmap_factory = new RoadmapFactory($group);
116 $roadmaps = $roadmap_factory->getRoadmaps(true);
117 if (!empty($roadmaps)) {
118 echo ' <p id="roadmapadminlink">
119 <a href="'.util_make_url('/tracker/admin/?group_id='.$group_id.'&admin_roadmap=1').'" >'._('Manage your roadmaps.').'</a>
125 // Set up blank ArtifactType
128 if (forge_check_perm ('tracker_admin', $group->getID())) { ?>
129 <h3><?php echo _('Create a new tracker') ?></h3>
130 <p><?php echo _('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>
131 <p><?php echo _('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>
133 <form action="<?php echo getStringFromServer('PHP_SELF').'?group_id='.$group_id; ?>" method="post">
134 <input type="hidden" name="add_at" value="y" />
136 <?php echo _('<strong> Name:</strong> (examples: meeting minutes, test results, RFP Docs)') ?><br />
137 <input type="text" name="name" value="" /></p>
139 <strong><?php echo _('Description') ?>:</strong><br />
140 <input type="text" name="description" value="" size="50" /></p>
142 <strong><?php echo _('Send email on new submission to address') ?>:</strong><br />
143 <input type="text" name="email_address" value="" /></p>
145 <input type="checkbox" name="email_all" value="1" /> <strong><?php echo _('Send email on all changes') ?></strong></p>
147 <strong><?php echo _('Days till considered overdue') ?>:</strong><br />
148 <input type="text" name="due_period" value="30" /></p>
150 <strong><?php echo _('Days till pending tracker items time out') ?>:</strong><br />
151 <input type="text" name="status_timeout" value="14" /></p>
153 <strong><?php echo _('Free form text for the “Submit New” page') ?>:</strong><br />
154 <textarea name="submit_instructions" rows="10" cols="55"></textarea></p>
156 <strong><?php echo _('Free form text for the Browse page') ?>:</strong><br />
157 <textarea name="browse_instructions" rows="10" cols="55"></textarea></p>
159 <input type="submit" name="post_changes" value="<?php echo _('Submit') ?>" /></p>
168 // c-file-style: "bsd"