3 %# Copyright (c) 1996-2003 Jesse Vincent <jesse@bestpractical.com>
5 %# (Except where explictly superceded by other copyright notices)
7 %# This work is made available to you under the terms of Version 2 of
8 %# the GNU General Public License. A copy of that license should have
9 %# been provided with this software, but in any event can be snarfed
12 %# This work is distributed in the hope that it will be useful, but
13 %# WITHOUT ANY WARRANTY; without even the implied warranty of
14 %# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 %# General Public License for more details.
17 %# Unless otherwise specified, all modifications, corrections or
18 %# extensions to this work which alter its source code become the
19 %# property of Best Practical Solutions, LLC when submitted for
20 %# inclusion in the work.
24 <& /Admin/Elements/Header, Title => $title &>
26 <& /Admin/Elements/GroupTabs,
28 current_tab => $current_tab,
30 <& /Elements/ListActions, actions => \@results &>
34 <FORM ACTION="<%$RT::WebPath%>/Admin/Groups/Modify.html" METHOD=POST>
36 %unless ($Group->Id) {
37 <INPUT TYPE=HIDDEN NAME=id VALUE="new">
39 <INPUT TYPE=HIDDEN NAME=id VALUE="<%$Group->Id%>">
45 <TD><INPUT name="Name" value="<%$Group->Name%>"></TD>
48 <&|/l&>Description</&>:</TD><TD COLSPAN=3><INPUT name="Description" value="<%$Group->Description%>" size=60></TD>
51 <INPUT TYPE=HIDDEN NAME="SetEnabled" VALUE="1">
52 <INPUT TYPE=CHECKBOX NAME="Enabled" VALUE="1" <%$EnabledChecked%>> <&|/l&>Enabled (Unchecking this box disables this group)</&><BR>
55 <& /Elements/Submit, Caption => loc("Be sure to save your changes"), Reset => 1 &>
60 my ($title, @results, $Disabled, $EnabledChecked);
62 my $Group = RT::Group->new($session{'CurrentUser'});
65 $current_tab = 'Admin/Groups/Modify.html?Create=1';
66 $title = loc("Create a new group");
70 $current_tab = 'Admin/Groups/Modify.html?id='.$id;
73 my ($create_id, $create_msg) = $Group->CreateUserDefinedGroup(Name =>
76 Abort (loc("Group could not be created: [_1]", $create_msg));
81 $Group->Load($id) || Abort('Could not load group');
86 $title = loc("Modify the group [_1]", $Group->Name);
90 # If the create failed
92 $title = loc("Create a new group");
100 my @fields = qw(Description Name );
101 my @fieldresults = UpdateRecordObject ( AttributesRef => \@fields,
104 push (@results,@fieldresults);
107 #we're asking about enabled on the web page but really care about disabled.
114 if ( ($SetEnabled) and ( $Disabled != $Group->Disabled) ) {
115 my ($code, $msg) = $Group->SetDisabled($Disabled);
116 push @results, loc('Enabled status [_1]', loc_fuzzy($msg));
119 unless ($Group->Disabled()) {
120 $EnabledChecked ="CHECKED";
130 $Description => undef