%# Tact, n.: %# The unsaid part of what you're thinking. <& /Edit/Elements/104Header, %ARGS, Buttons => [ Add => "index.html?Action-Add=1&Show=$Show", Save => ($Group ? "javascript:document.getElementById('mainform').submit()" : ''), Delete => 1, Copy => '', Search => '', ], Method => 'POST', Action => 'index.html', &>

<& $Tab, Text => 'Groups' &>
<& /Edit/Elements/Tabs, Name => 'Map2', Map => $ARGS{Map2}, URL => ($ARGS{URL} || '/Edit/Groups/') &>
<& Top, Item => $Item &> <& List, Delete => sub { !$_[0]->Description }, List => $List, Begin => $Begin, Item => $Item, ARGS => \%ARGS &> |  |
<& $Show, Map => $ARGS{Map}, List => $List, Item => $Item, %ARGS, Show => $Show &>

<%INIT> if ($Action eq 'Add') { my $GroupObj = RT::Group->new($session{'CurrentUser'}); $GroupObj->CreateUserDefinedGroup(Name => "(new)"); $GroupObj->UpdateCompany if $GroupObj->can('UpdateCompany'); $Group = $GroupObj->Id; delete $ARGS{'Action-Add'}; } my $Item = $RT::Nothing; if ($Group) { $Item = RT::Group->new($session{'CurrentUser'}); $Item->Load( $Group ); } if ($Action eq 'Save') { $Item->SetName($Name) if length($Name); $Item->SetDisabled($Disabled) if length($Disabled); } elsif ($Action eq 'Delete') { foreach my $Id (@ListDelete) { my $item = RT::Group->new($session{'CurrentUser'}); $item->Load($Id); $item->Delete; } $Item = $RT::Nothing; $Group = $Begin = 0; } $Show ||= 'Member'; $Show = 'Member' unless $Item and !$Item->Description; my $List = RT::Groups->HRMSUserDefinedGroups( $session{'CurrentUser'} ); $List->{find_disabled_rows}++; <%ARGS> $Group => 0 $Begin => 0 $Show => 'Member' $Action => '' $Name => '' $Disabled => '' @ListDelete => () $Tab => '/Edit/Elements/Tab'