[rt-users] stop form submit on ticket reply
Emmanuel Lacour
elacour at easter-eggs.com
Tue Aug 23 18:22:32 EDT 2016
Le 23/08/2016 à 22:59, Hugo Escobar a écrit :
> Hi,
>
> I need to be able to stop submitting a "Public Reply" correspondence
> based on a evaluation that returns a Boolean value.
>
> This decision must be taken when the user clicks the "Update Ticket" button
>
> Everything I have tried fails because the form is always submitted.
>
> Any help will be highly appreciated
>
>
create a file named
..../rt/local/html/Callbacks/YourOrg/Ticket/Update.html/BeforeUpdate
with a content such as:
<%init>
if ( exists $ARGSRef->{SubmitTicket} ) {
# Write here your evaluation, you can use submitted values in
%$ARGSRef and the ticket object $TicketObj
if ( !$evaluation ) {
push @$results, loc("Message that should be displayed to user");
$$skip_update = 1;
}
}
</%init>
<%args>
$TicketObj => undef
$skip_update => undef
$results => undef
$ARGSRef => undef
</%args>
don't forget to cleanup your mason cache and restart your webserver.
More information about the rt-users
mailing list