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.
---------
RT 4.4 and RTIR training sessions, and a new workshop day! 
https://bestpractical.com/training
* Boston - October 24-26
* Los Angeles - Q1 2017

Reply via email to