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
10 * This file is part of FusionForge. FusionForge is free software;
11 * you can redistribute it and/or modify it under the terms of the
12 * GNU General Public License as published by the Free Software
13 * Foundation; either version 2 of the Licence, or (at your option)
16 * FusionForge is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 * GNU General Public License for more details.
21 * You should have received a copy of the GNU General Public License along
22 * with FusionForge; if not, write to the Free Software Foundation, Inc.,
23 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
27 if (getStringFromRequest('post_changes')) {
28 $name = getStringFromRequest('name');
29 $description = getStringFromRequest('description');
30 $email_all = getStringFromRequest('email_all');
31 $email_address = getStringFromRequest('email_address');
32 $due_period = getStringFromRequest('due_period');
33 $use_resolution = getStringFromRequest('use_resolution');
34 $submit_instructions = getStringFromRequest('submit_instructions');
35 $browse_instructions = getStringFromRequest('browse_instructions');
37 if (!forge_check_perm ('tracker_admin', $group->getID())) {
38 exit_permission_denied('','tracker');
41 if (getStringFromRequest('add_at')) {
42 $res=new ArtifactTypeHtml($group);
43 if (!$res->create($name,$description,0,0,$email_all,$email_address,
44 $due_period,$use_resolution,$submit_instructions,$browse_instructions)) {
45 exit_error($res->getErrorMessage(),'tracker');
47 $feedback .= _('Tracker created successfully');
49 $feedback .= _('Please configure also the roles (by default, it\'s \'No Access\')');
51 $group->normalizeAllRoles () ;
57 // Display existing artifact types
59 $atf = new ArtifactTypeFactoryHtml($group);
60 if (!$atf || !is_object($atf) || $atf->isError()) {
61 exit_error(_('Could Not Get ArtifactTypeFactory'),'tracker');
64 // Only keep the Artifacts where the user has admin rights.
65 $arr = $atf->getArtifactTypes();
67 for ($j = 0; $j < count($arr); $j++) {
68 if (forge_check_perm ('tracker', $arr[$j]->getID(), 'manager')) {
69 $at_arr[$i++] =& $arr[$j];
72 // If no more tracker now,
74 exit_permission_denied('','tracker');
77 //required params for site_project_header();
78 $params['group']=$group_id;
79 $params['toptab']='tracker';
80 if(isset($page_title)){
81 $params['title'] = $page_title;
83 $params['title'] = '';
86 $atf->header( array('title' => _('Trackers Administration')));
93 '/tracker/reporting/?group_id='.$group_id,
94 '/tracker/admin/?group_id='.$group_id
97 array('title' => _('Various graph about statistics'), 'class' => 'tabtitle-nw'),
98 array('title' => _('Global administration for trackers. Create, clone, workflow, fields ...'), 'class' => 'tabtitle')
102 if (!isset($at_arr) || !$at_arr || count($at_arr) < 1) {
103 echo '<div class="warning">'._('No trackers found').'</div>';
107 <p>'._('Choose a data type and you can set up prefs, categories, groups, users, and permissions').'.</p>';
110 Put the result set (list of forums for this group) into a column with folders
112 $tablearr=array(_('Tracker'),_('Description'));
113 echo $HTML->listTableTop($tablearr);
115 for ($j = 0; $j < count($at_arr); $j++) {
117 <tr '. $HTML->boxGetAltRowStyle($j) . '>
118 <td><a href="'.util_make_url ('/tracker/admin/?atid='. $at_arr[$j]->getID() . '&group_id='.$group_id).'">' .
119 html_image("ic/tracker20w.png","20","20") . ' '.
120 $at_arr[$j]->getName() .'</a>
122 <td>'.$at_arr[$j]->getDescription() .'
126 echo $HTML->listTableBottom();
130 // Set up blank ArtifactType
133 if (forge_check_perm ('tracker_admin', $group->getID())) {
134 ?><?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>') ?>
135 <form action="<?php echo getStringFromServer('PHP_SELF').'?group_id='.$group_id; ?>" method="post">
136 <input type="hidden" name="add_at" value="y" />
138 <?php echo _('<strong> Name:</strong> (examples: meeting minutes, test results, RFP Docs)') ?><br />
139 <input type="text" name="name" value="" /></p>
141 <strong><?php echo _('Description') ?>:</strong><br />
142 <input type="text" name="description" value="" size="50" /></p>
144 <strong><?php echo _('Send email on new submission to address') ?>:</strong><br />
145 <input type="text" name="email_address" value="" /></p>
147 <input type="checkbox" name="email_all" value="1" /> <strong><?php echo _('Send email on all changes') ?></strong></p>
149 <strong><?php echo _('Days till considered overdue') ?>:</strong><br />
150 <input type="text" name="due_period" value="30" /></p>
152 <strong><?php echo _('Days till pending tracker items time out') ?>:</strong><br />
153 <input type="text" name="status_timeout" value="14" /></p>
155 <strong><?php echo _('Free form text for the "submit new item" page') ?>:</strong><br />
156 <textarea name="submit_instructions" rows="10" cols="55"></textarea></p>
158 <strong><?php echo _('Free form text for the "browse items" page') ?>:</strong><br />
159 <textarea name="browse_instructions" rows="10" cols="55"></textarea></p>
161 <input type="submit" name="post_changes" value="<?php echo _('Submit') ?>" /></p>
170 // c-file-style: "bsd"