5 * Copyright 2010, FusionForge Team
6 * Copyright (C) 2011 Alain Peyrat - Alcatel-Lucent
7 * http://fusionforge.org
9 * This file is part of FusionForge. FusionForge is free software;
10 * you can redistribute it and/or modify it under the terms of the
11 * GNU General Public License as published by the Free Software
12 * Foundation; either version 2 of the Licence, or (at your option)
15 * FusionForge is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU General Public License for more details.
20 * You should have received a copy of the GNU General Public License along
21 * with FusionForge; if not, write to the Free Software Foundation, Inc.,
22 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
26 require_once 'common/tracker/ArtifactWorkflow.class.php';
28 $from = getIntFromRequest('from');
29 $next = getIntFromRequest('next');
31 // FORM TO UPDATE ARTIFACT TYPES
34 List of possible user built Selection Boxes for an ArtifactType
36 $efarr = $ath->getExtraFields(array(ARTIFACT_EXTRAFIELDTYPE_STATUS));
37 if (count($efarr) === 0) {
38 // TODO: Normal status is not implemented right now.
40 } elseif (count($efarr) !== 1) {
45 $keys=array_keys($efarr);
48 $atw = new ArtifactWorkflow($ath, $field_id);
49 $roles = $atw->getAllowedRoles($from, $next);
51 $elearray = $ath->getExtraFieldElements($field_id);
52 foreach ($elearray as $e) {
53 $name[ $e['element_id'] ] = $e['element_name'];
56 $title = sprintf(_('Configuring allowed roles for the transitions from %1$s to %2$s'), $name[$from], $name[$next]);
57 $ath->adminHeader(array('title'=>$title,
58 'pagename'=>'tracker_admin_customize_liste',
59 'titlevals'=>array($ath->getName())));
61 <form action="<?php echo getStringFromServer('PHP_SELF').'?group_id='.$group_id.'&atid='.$ath->getID(); ?>" method="post">
62 <input type="hidden" name="field_id" value="<?php echo $field_id ?>" />
63 <input type="hidden" name="workflow_roles" value="1" />
64 <input type="hidden" name="from" value="<?php echo $from ?>" />
65 <input type="hidden" name="next" value="<?php echo $next ?>" />
68 $group_roles = $group->getRoles() ;
69 sortRoleList ($group_roles) ;
70 foreach ($group_roles as $role) {
71 $value = in_array($role->getID(), $roles)? ' checked="checked"' : '';
72 $str = '<input type="checkbox" name="role['.$role->getID().']"'.$value.' />';
73 $str .= ' '.$role->getDisplayableName($group);
78 <input type="submit" name="post_changes" value="<?php echo _('Submit') ?>" /></p>
82 $ath->footer(array());