This commit was generated by cvs2svn to compensate for changes in r2523,
[freeside.git] / rt / webrt / Admin / Groups / Modify.html
1 <& /Admin/Elements/Header, Title => $title &>
2
3 <& /Admin/Elements/GroupTabs, GroupObj => $Group &>
4 <& /Elements/ListActions, actions => \@results &>
5
6
7 <& /Elements/TitleBoxStart, title => $title &>
8
9 <FORM ACTION="<%$RT::WebPath%>/Admin/Groups/Modify.html" METHOD=POST>
10
11 %unless ($Group->Id) {
12 <INPUT TYPE=HIDDEN NAME=id VALUE="new">
13 % } else {
14 <INPUT TYPE=HIDDEN NAME=id VALUE="<%$Group->Id%>">
15 % }
16 <TABLE>
17 <TR><TD ALIGN=RIGHT>
18 Name: 
19 </TD>
20 <TD><INPUT name="Name" value="<%$Group->Name%>"></TD>
21 </TR><TR>
22 <TD ALIGN=RIGHT>
23 Description:</TD><TD COLSPAN=3><INPUT name="Description" value="<%$Group->Description%>" size=60></TD></TR>
24 </TABLE>
25 <& /Elements/TitleBoxEnd &>
26
27 <& /Elements/Submit &>
28 </form>
29 <%INIT>
30
31 my ($title);
32 my (@results);
33
34 my $Group = new RT::Group($session{'CurrentUser'});
35
36 if ($Create) {
37     $title = "Create a new group";
38
39
40 else {
41     
42     if ($id eq 'new' ) {
43         
44         $Group->Create(Name => "$Name") || Abort ("Group could not be created.");
45         $id = $Group->Id;
46     }
47     else {
48         $Group->Load($id) || Abort('Could not load group');
49     }
50
51
52     if ($id) {
53         $title = "Modify the group ". $Group->Name;
54
55     }   
56
57     # If the create failed
58     else {
59         $title = "Create a new group";
60         $Create = 1;
61     }    
62     
63 }
64
65 if ($id) {
66     
67     my @fields = qw(Description Name );
68     my @fieldresults = UpdateRecordObject ( AttributesRef => \@fields,
69                                             Object => $Group,
70                                             ARGSRef => \%ARGS );
71     push (@results,@fieldresults);
72 }
73
74
75 </%INIT>
76
77
78 <%ARGS>
79 $Create => undef
80 $Name => undef
81 $Description => undef
82 $id => undef
83 </%ARGS>