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-2016, Franck Villaume - TrivialDev
10 * Copyright 2016-2017, Stéphane-Eymeric Bredthauer - TrivialDev
12 * This file is part of FusionForge. FusionForge is free software;
13 * you can redistribute it and/or modify it under the terms of the
14 * GNU General Public License as published by the Free Software
15 * Foundation; either version 2 of the Licence, or (at your option)
18 * FusionForge is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU General Public License for more details.
23 * You should have received a copy of the GNU General Public License along
24 * with FusionForge; if not, write to the Free Software Foundation, Inc.,
25 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
31 if (getStringFromRequest('post_changes')) {
32 $name = getStringFromRequest('name');
33 $description = getStringFromRequest('description');
34 $email_all = getStringFromRequest('email_all');
35 $email_address = getStringFromRequest('email_address');
36 $due_period = getStringFromRequest('due_period');
37 $use_resolution = getStringFromRequest('use_resolution');
38 $submit_instructions = getStringFromRequest('submit_instructions');
39 $browse_instructions = getStringFromRequest('browse_instructions');
41 if (!forge_check_perm ('tracker_admin', $group->getID())) {
42 exit_permission_denied('','tracker');
45 if (getStringFromRequest('add_at')) {
46 $res=new ArtifactTypeHtml($group);
47 if (!$res->create($name,$description,$email_all,$email_address,
48 $due_period,$use_resolution,$submit_instructions,$browse_instructions)) {
49 exit_error($res->getErrorMessage(),'tracker');
51 $feedback .= _('Tracker created successfully');
52 $feedback .= html_e('br');
53 $feedback .= _("Please configure also the roles (by default, it's “No Access”)");
55 $group->normalizeAllRoles () ;
60 // Display existing artifact types
62 $atf = new ArtifactTypeFactoryHtml($group);
63 if (!$atf || !is_object($atf) || $atf->isError()) {
64 exit_error(_('Could Not Get ArtifactTypeFactory'),'tracker');
67 // Only keep the Artifacts where the user has admin rights.
68 $arr = $atf->getArtifactTypes();
70 for ($j = 0; $j < count($arr); $j++) {
71 if (forge_check_perm ('tracker', $arr[$j]->getID(), 'manager')) {
72 $at_arr[$i++] =& $arr[$j];
75 // If no more tracker now,
77 exit_permission_denied('','tracker');
80 //required params for site_project_header();
81 $params['group']=$group_id;
82 $params['toptab']='tracker';
83 if(isset($page_title)){
84 $params['title'] = $page_title;
86 $params['title'] = '';
89 $atf->header( array('title' => _('Trackers Administration')));
91 if (!isset($at_arr) || !$at_arr || empty($at_arr)) {
92 echo $HTML->warning_msg(_('No trackers found'));
95 echo html_e('p', array(), _('Choose a data type and you can set up prefs, categories, groups, users, and permissions').'.');
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 $cells[][] = util_make_link('/tracker/admin/?atid='.$at_arr[$j]->getID().'&group_id='.$group_id, $HTML->getFollowPic().' '.$at_arr[$j]->getName());
106 $cells[][] = $at_arr[$j]->getDescription();
107 echo $HTML->multiTableRow(array(), $cells);
109 echo $HTML->listTableBottom();
111 $roadmap_factory = new RoadmapFactory($group);
112 $roadmaps = $roadmap_factory->getRoadmaps(true);
113 if (!empty($roadmaps)) {
114 echo html_e('p', array('id' => 'roadmapadminlink'), util_make_link('/tracker/admin/?group_id='.$group_id.'&admin_roadmap=1', _('Manage your roadmaps.')));
119 // Set up blank ArtifactType
122 if (forge_check_perm ('tracker_admin', $group->getID())) {
123 echo html_e('h3', array(), _('Create a new tracker.'));
124 echo html_e('p', array(), _('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.'));
125 echo html_e('p', array(), _('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.'));
127 echo $HTML->openForm(array('method' => 'post', 'action' => '/tracker/admin/?group_id='.$group_id));
129 echo html_e('input', array('type'=>'hidden', 'name'=>'add_at', 'value'=>'y'));
132 echo html_e('label', array('for'=>'name'), html_e('strong',array(), _('Name')._(':')).' '._('(examples: meeting minutes, test results, RFP Docs)').utils_requiredField()).html_e('br');
133 echo html_e('input', array('type'=>'text', 'name'=>'name', 'value'=>'', 'required'=>'required'));
134 echo html_ac(html_ap()-1);
137 echo html_e('label', array('for'=>'description'), html_e('strong',array(), _('Description')._(':').utils_requiredField())).html_e('br');
138 echo html_e('input', array('type'=>'text', 'name'=>'description', 'value'=>'', 'size'=>'50', 'required'=>'required'));
139 echo html_ac(html_ap()-1);
142 echo html_e('label', array('for'=>'email_address'), html_e('strong',array(), _('Send email on new submission to address')._(':'))).html_e('br');
143 echo html_e('input', array('type'=>'text', 'name'=>'email_address', 'value'=>''));
144 echo html_ac(html_ap()-1);
147 echo html_e('input', array('type'=>'checkbox', 'name'=>'email_all', 'value'=>'1'));
148 echo html_e('label', array('for'=>'email_all'), html_e('strong',array(), _('Send email on all changes')));
149 echo html_ac(html_ap()-1);
152 echo html_e('label', array('for'=>'due_period'), html_e('strong',array(), _('Days till considered overdue')._(':'))).html_e('br');
153 echo html_e('input', array('type'=>'text', 'name'=>'due_period', 'value'=>'30'));
154 echo html_ac(html_ap()-1);
157 echo html_e('label', array('for'=>'status_timeout'), html_e('strong',array(), _('Days till pending tracker items time out')._(':'))).html_e('br');
158 echo html_e('input', array('type'=>'text', 'name'=>'status_timeout', 'value'=>'14'));
159 echo html_ac(html_ap()-1);
162 echo html_e('label', array('for'=>'submit_instructions'), html_e('strong',array(), _('Free form text for the “Submit New” page')._(':'))).html_e('br');
163 echo html_e('textarea', array('name'=>'submit_instructions', 'rows'=>'10', 'cols'=>'55'), '', false);
164 echo html_ac(html_ap()-1);
167 echo html_e('label', array('for'=>'browse_instructions'), html_e('strong',array(), _('Free form text for the Browse page')._(':'))).html_e('br');
168 echo html_e('textarea', array('name'=>'browse_instructions', 'rows'=>'10', 'cols'=>'55'), '', false);
169 echo html_ac(html_ap()-1);
172 echo html_e('input', array('type'=>'submit', 'name'=>'post_changes', 'value'=>_('Submit')));
173 echo html_ac(html_ap()-1);
175 echo $HTML->closeForm();
182 // c-file-style: "bsd"