2 When the user tries to change a ticket's status to "resolved" through
3 the Update interface, check mandatory fields. If they aren't all set,
4 redirect to Ticket Basics instead of updating. Note that this will
5 lose any comments/time/other information the user has entered.
9 my $TicketObj = $ARGS{'Ticket'};
10 my $ARGSRef = $ARGS{'ARGSRef'};
11 my $oldStatus = $TicketObj->Status();
12 my $newStatus = $ARGSRef->{'Status'} || $ARGSRef->{'DefaultStatus'};
13 if( $oldStatus ne 'resolved' and
14 $newStatus eq 'resolved' and
15 $m->comp('/Ticket/Elements/CheckMandatoryFields',
19 RT::Interface::Web::Redirect(
20 RT->Config->Get('WebURL')."Ticket/Modify.html?id=".$TicketObj->Id."&resolve=1"