summaryrefslogtreecommitdiff
path: root/rt/share/html/Callbacks/CheckMandatoryFields/Ticket/Update.html
diff options
context:
space:
mode:
authormark <mark>2010-09-01 23:39:23 +0000
committermark <mark>2010-09-01 23:39:23 +0000
commit8c5a780343e027058a51692d8b9b8140c88ce6c7 (patch)
treece5cd525de2adebbc463fb63795716aa61812d35 /rt/share/html/Callbacks/CheckMandatoryFields/Ticket/Update.html
parent60a603adb62f03d90391b16ce5b89242adf9c1d5 (diff)
RT mandatory custom fields, RT#9260
Diffstat (limited to 'rt/share/html/Callbacks/CheckMandatoryFields/Ticket/Update.html')
-rw-r--r--rt/share/html/Callbacks/CheckMandatoryFields/Ticket/Update.html/BeforeDisplay24
1 files changed, 24 insertions, 0 deletions
diff --git a/rt/share/html/Callbacks/CheckMandatoryFields/Ticket/Update.html/BeforeDisplay b/rt/share/html/Callbacks/CheckMandatoryFields/Ticket/Update.html/BeforeDisplay
new file mode 100644
index 000000000..0d69bc27b
--- /dev/null
+++ b/rt/share/html/Callbacks/CheckMandatoryFields/Ticket/Update.html/BeforeDisplay
@@ -0,0 +1,24 @@
+<%doc>
+When the user tries to change a ticket's status to "resolved" through
+the Update interface, check mandatory fields. If they aren't all set,
+redirect to Ticket Basics instead of updating. Note that this will
+lose any comments/time/other information the user has entered.
+</%doc>
+
+<%init>
+my $TicketObj = $ARGS{'Ticket'};
+my $ARGSRef = $ARGS{'ARGSRef'};
+my $oldStatus = $TicketObj->Status();
+my $newStatus = $ARGSRef->{'Status'} || $ARGSRef->{'DefaultStatus'};
+if( $oldStatus ne 'resolved' and
+ $newStatus eq 'resolved' and
+ $m->comp('/Ticket/Elements/CheckMandatoryFields',
+ Ticket => $TicketObj
+ ) ) {
+ $m->clear_buffer;
+ RT::Interface::Web::Redirect(
+ RT->Config->Get('WebURL')."Ticket/Modify.html?id=".$TicketObj->Id."&resolve=1"
+ );
+ $m->abort;
+}
+</%init>