%# Things are more like they used to be than they are now.
<& /Work/Tickets/Elements/ShowBasics, Ticket => $Ticket &> % if ($Role) { % } <& /Work/Tickets/Elements/EditCustomFields, Ticket => $Ticket, ReadOnly => ($IsRequestor or !$Role), Loc => 1 &> %# Info {{{ %# }}} <& /Work/Tickets/Elements/AddAttachments &> %# Content {{{ %# }}}

<&|/l&>Owner

% my $owner = ($ARGS{'Owner'} || $Ticket->OwnerObj->Id()); % $owner = $session{CurrentUser}->UserObj->Id if $ARGS{'Action-Resolve'}; <& SelectOwner, Name=>"Owner", Default => $owner, QueueObj => $Ticket->QueueObj, TicketObj => $Ticket, ReadOnly => ($IsRequestor or !$Role), Mandatory => 1 &>

<&|/l&>Current Status

% my $status = $ARGS{'Status'} || $ARGS{'DefaultStatus'} || $Ticket->Status; <& SelectStatus, Name=>"Status", Default => $status, ReadOnly => ($IsRequestor or !$Role), id => $id &>

<&|/l&>Update Type

% if ($CanComment) { type="radio" name="UpdateType" value="private" <%$CommentDefault%>><&|/l&>Comments (Not sent to requestors) % } % if ($CanRespond) { type="radio" name="UpdateType" value="response" <%$ResponseDefault%>><&|/l&>Response to requestors % }

<&|/l&>Cc % if ($RT::OIN104) {

% unless ($IsRequestor) { Id), 650, 500 &>" style="width:50px"> % } % } else {


% }

<&|/l&>Bcc


<&|/l&>(Sends a blind carbon-copy of this update to a comma-delimited list of email addresses. Does not change who will receive future updates.)

<&|/l&>Content

% if (exists $ARGS{UpdateContent}) { <& /Work/Elements/MessageBox, Name=>"UpdateContent", Default=>$ARGS{UpdateContent}, %ARGS&> % } else { <& /Work/Elements/MessageBox, Name=>"UpdateContent", %ARGS &> %}



<%INIT> my $CanRespond = 0; my $CanComment = 0; my $title; my $Ticket = LoadTicket($id); my $QueueObj = $Ticket->QueueObj; my $OwnerObj = $Ticket->OwnerObj; foreach my $key (reverse sort keys %ARGS) { next unless $key =~ /^Action-(.+?)(?:\.[xy])?(?:-(\d+))?(?:-(\w+))?$/; $Action = $1; $ARGS{QuoteTransaction} = $2; $ARGS{$3} = 1; last; } if ($Action eq 'Open') { return $m->comp('Display.html', %ARGS, Status => 'open', Owner => $session{CurrentUser}->UserObj->Id); } elsif ($Action eq 'Links') { ProcessTicketLinks( TicketObj => $Ticket, ARGSRef => \%ARGS); return $m->comp('Display.html', %ARGS); } elsif ($Action eq 'People') { ProcessTicketLinks( TicketObj => $Ticket, ARGSRef => \%ARGS); if ($ARGS{OnlySearchForPeople} or $ARGS{OnlySearchForGroup}) { $ARGS{Show} = 'People'; } else { ProcessTicketBasics( TicketObj => $Ticket, ARGSRef => \%ARGS); ProcessTicketWatchers( TicketObj => $Ticket, ARGSRef => \%ARGS); } return $m->comp('Display.html', %ARGS); } elsif ($Action eq 'Basics') { ProcessTicketBasics(TicketObj => $Ticket, ARGSRef => \%ARGS); ProcessTicketDates( TicketObj => $Ticket, ARGSRef => \%ARGS); $ARGS{Queue} = $Ticket->Queue; return $m->comp('Display.html', %ARGS); } elsif ( $Action eq 'Resolve' ) { $Action = 'Comment'; $ARGS{Status} = 'resolved'; } $DefaultStatus = $ARGS{Status} if exists $ARGS{Status}; if ($DefaultStatus eq 'resolved') { $title = loc("Resolve ticket #[_1] ([_2])", $Ticket->id, $Ticket->Subject); } else { $title = loc("Update ticket #[_1] ([_2])", $Ticket->id, $Ticket->Subject); } # Things needed in the template - we'll do the processing here, just # for the convenience: my ($CommentDefault, $ResponseDefault); if (($Action eq 'Comment') or ($ARGS{'UpdateType'} eq 'private')) { $CommentDefault = "CHECKED"; } else { $ResponseDefault = "CHECKED"; } $DefaultStatus = $Ticket->Status() unless ($DefaultStatus); $CanRespond = 1 if ( $Ticket->CurrentUserHasRight('ReplyToTicket') or $Ticket->CurrentUserHasRight('ModifyTicket') ); $CanComment = 1 if ( $Ticket->CurrentUserHasRight('CommentOnTicket') or $Ticket->CurrentUserHasRight('ModifyTicket') ); # {{{ deal with deleting uploaded attachments foreach my $key (keys %ARGS) { if ($key =~ m/^DeleteAttach-(.+)$/) { delete $session{'Attachments'}{$1}; } $session{'Attachments'} = { %{$session{'Attachments'} || {}} }; } # {{{ store the uploaded attachment in session if ($ARGS{'Attach'}) { # attachment? $session{'Attachments'} = {} unless defined $session{'Attachments'}; my $subject = "$ARGS{'Attach'}"; # since CGI.pm deutf8izes the magic field, we need to add it back. Encode::_utf8_on($subject); # strip leading directories $subject =~ s#^.*[\\/]##; my $attachment = MakeMIMEEntity( Subject => $subject, Body => "", AttachmentFieldName => 'Attach' ); $session{'Attachments'} = { %{$session{'Attachments'} || {}}, $ARGS{'Attach'} => $attachment }; } # }}} # delete temporary storage entry to make WebUI clean unless (keys %{$session{'Attachments'}} and $ARGS{'UpdateAttach'}) { delete $session{'Attachments'}; } # }}} # XXX: select and entry untested! $Role ||= $m->comp('Display.html', %ARGS, NoUI => -1); ProcessTicketCustomFieldUpdates( ARGSRef => \%ARGS, TicketObj => $Ticket ) if $Role eq 'owner'; if ( !$ARGS{AddMoreAttach} and !$Action) { $m->comp('Display.html', %ARGS, TicketObj => $Ticket); return; } my $IsRequestor = ($Role eq 'requestor'); <%ARGS> $id => undef $Role => undef $Action => undef $DefaultStatus => undef $QuoteTransaction => undef