<& /Admin/Elements/Header, Title => $title &> <& /Admin/Elements/GroupTabs, GroupObj => $Group &> <& /Elements/ListActions, actions => \@results &> <& /Elements/TitleBoxStart, title => $title &>
%unless ($Group->Id) { % } else { % }
Name:
Description:
<& /Elements/TitleBoxEnd &> <& /Elements/Submit &>
<%INIT> my ($title); my (@results); my $Group = new RT::Group($session{'CurrentUser'}); if ($Create) { $title = "Create a new group"; } else { if ($id eq 'new' ) { $Group->Create(Name => "$Name") || Abort ("Group could not be created."); $id = $Group->Id; } else { $Group->Load($id) || Abort('Could not load group'); } $title = "Modify the group ". $Group->Name; } my @fields = qw(Description Name ); #Run through each field in this list. update the value if apropriate my $field; foreach $field (@fields) { my $check = "if ((defined \$$field) and (\$Group->$field ne \$$field)) { my (\$code, \$msg) = \$Group->Set$field(\$$field); push \@results, \$msg; }"; eval $check; } <%ARGS> $Create => undef $Name => undef $Description => undef $id => undef