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