& /Elements/Header &> <& /Ticket/Elements/Tabs, id => $id &> <& /Elements/ListActions, actions => \@results &> <& /Elements/TitleBoxStart, title => 'Modify ticket #'.$TicketObj->Id, width => "100%" &> %#ACTION="" means submit to self.
<%INIT> my $field; my @results; # {{{ Load the ticket #If we get handed two ids, mason will make them an array. bleck. # We want teh first one. Just because there's no other sensible way # to deal my @id = (ref $id eq 'ARRAY') ? @{$id} : ($id); my $TicketObj = new RT::Ticket($session{'CurrentUser'}); $TicketObj->Load($id[0]) || $m->comp('/Elements/Error', Why => "Couldn't load ticket '$id'"); # }}} # {{{ Set basic fields my @fields = qw( Queue Owner Subject FinalPriority Priority Status TimeWorked TimeLeft ); #run through each field in this list. update the value if apropriate foreach $field (@fields) { my ($code, $msg); my $check = "if ((defined \$ARGS{$field}) and (\$ARGS{$field} ne \$TicketObj->$field)) { (\$code, \$msg) = \$TicketObj->Set$field(\$ARGS{'$field'}); push \@results, \"\$msg\"; }"; eval $check; if ($@) { $RT::Logger->err("Web/Ticket/Modify.html: $@\n"); } } # }}} %INIT> <%ARGS> $id => undef %ARGS>