%# Never call a man a fool; borrow from him. % if (!$ARGS{url}) { % } % if ($SelectOwner and $role eq 'owner') { <%PERL> my $text = $m->scomp( $url, %ARGS, NoUI => 1, Role => $role, Loc => 1, Queue => $Queue ); my $so = qq(

@{[ loc("Owner") ]}

@{[ $m->scomp("SelectOwner", Name => "Owner", QueueObj => $queue, Mandatory => 1) ]}
); $text =~ /table/g; # maybe a little faster than the non-greedy version ? $text =~ /table/g; $text =~ />/g; $text =~ s/\G()/$so/; # insert here $m->print($text); % } else { <& $url, %ARGS, NoUI => 1, Role => $role, Loc => 1, Queue => $Queue &> % } <%INIT> my $role = ($RT::Guest ? 'guest' : ''); my $Ticket = RT::Ticket->new($session{'CurrentUser'}); if ($id eq 'new') { $role = 'requestor'; } elsif ($id) { $Ticket->Load($id); if ($Ticket->OwnerObj and $Ticket->OwnerObj->Id eq $session{'CurrentUser'}->Id) { $role = 'owner'; } elsif ( eval { $Ticket->FirstRequestor->Id } eq $session{'CurrentUser'}->Id ) { $role = 'requestor'; } $Queue = $Ticket->Queue; } my $queue = RT::Queue->new($session{'CurrentUser'}); $queue->Load($Queue); $m->notes(QueueObj => $queue); if ( $session{CurrentUser}->UserObj->Name eq 'root' or $queue->HasWatcher($session{CurrentUser}->UserObj) ) { $role = 'owner'; } return $role if $NoUI == -1; <%ARGS> $Queue => 0 $url => '/Work/Tickets/Display.html' $id => 0 $NoUI => 0 $SelectOwner=> 0