3 * FusionForge FRS: Link Tracker Roadmaps to FRS Release
5 * Copyright 2016,2021, Franck Villaume - TrivialDev
6 * http://fusionforge.org/
8 * This file is part of FusionForge. FusionForge is free software;
9 * you can redistribute it and/or modify it under the terms of the
10 * GNU General Public License as published by the Free Software
11 * Foundation; either version 2 of the Licence, or (at your option)
14 * FusionForge is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
19 * You should have received a copy of the GNU General Public License along
20 * with FusionForge; if not, write to the Free Software Foundation, Inc.,
21 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
24 /* please do not add require here : use www/frs/index.php to add require */
25 /* global variables used */
26 global $HTML; // html object
27 global $group_id; // id of group
28 global $g; // group object
29 global $frsr; // FRS release object
32 echo html_e('h2', array(), _('Attach/Detach Roadmaps To This Release'));
33 $rf = new RoadmapFactory($g);
34 $enabledRoadmaps = $rf->getRoadmaps(true);
36 if (count($enabledRoadmaps)) {
38 //$title_arr[] = html_e('input', array('id' => 'checkallroadactive', 'type' => 'checkbox', 'title' => _('Select / Deselect all roadmaps for massaction'), 'onClick' => 'controllerFRS.checkAll("checkedrelidroadactive", "roadactive")'));
39 $title_arr[] = _('Name');
40 $title_arr[] = _('Actions');
41 echo $HTML->listTableTop($title_arr, array(), '', '', array(), array(), array(array('style' => 'width: 30%')));
42 echo '<tr><td colspan="3" style="padding:0;">';
44 foreach ($enabledRoadmaps as $enabledRoadmap) {
45 $releaseRoadmaps = $enabledRoadmap->getReleases();
46 if (count($releaseRoadmaps)) {
47 foreach ($releaseRoadmaps as $releaseRoadmap) {
48 if ($frsr->isLinkedRoadmapRelease($releaseRoadmap)) {
50 $labelInput = _('Detach this roadmap from this release');
53 $labelInput = _('Attach this roadmap from this release');
55 echo $HTML->openForm(array('action' => '/frs/?group_id='.$group_id.'&release_id='.$release_id.'&package_id='.$package_id.'&roadmap_id='.$enabledRoadmap->getID().'&action=linkroadmap&type='.$type, 'method' => 'post', 'id' => 'roadmap'.$enabledRoadmap->getID()));
56 echo $HTML->listTableTop();
59 //$cells[] = array(html_e('input', array('type' => 'checkbox', 'value' => $enabledRoadmap->getID(), 'class' => 'checkedrelidroadactive', 'title' => _('Select / Deselect this roadmap for massaction'), 'onClick' => 'controllerFRS.checkgeneral("roadactive")')), 'style' => 'width: 2%; padding: 0px;');
60 $cells[] = array($enabledRoadmap->getName().' - '.$releaseRoadmap, 'style' => 'white-space: nowrap; width: 30%');
61 $cells[][] = '<input type="hidden" name="roadmap_release" value="'.$releaseRoadmap.'"><input type="submit" name="submit" value="'.$labelInput.'" />';
62 echo $HTML->multiTableRow(array(), $cells);
63 echo $HTML->listTableBottom();
64 echo $HTML->closeForm();
70 echo $HTML->listTableBottom();
72 echo $HTML->information(_('No Roadmap available'));