[rt-users] stop form submit on ticket reply

Hugo Escobar hescobar at afslc.com
Wed Aug 24 11:06:18 EDT 2016


Thanks Emmanuel for your response.

My initial post was a little inaccurate, I forgot to mention some details:

1.    The user wants to add a ticket reply
2.    The user writes (and prepares her message, attachments, etc)
3.    The user presses the "Update Ticket", some condition is evaluated two
possible outcomes (true, false)
3.1   If false => submit reply
3.2   If true  => the user is asked if the reply should be submitted
3.2.1 User wants to continue => reply submitted
3.2.2 User decides to abort reply submission => no ticket reply should be
added

I tried to implement something in javascript to handle "3.2.2" but the
reply is always submitted

I'm thinking now in a variation of your proposed solution. Perhaps bouncing
the ticket reply including an 'onload'
javascript alert for steps 3.2.1 of 3.2.2



On Tue, Aug 23, 2016 at 6:22 PM, Emmanuel Lacour <elacour at easter-eggs.com>
wrote:

> 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
>



-- 
Regards,

Hugo Escobar

<http://www.associationfinancialservices.com/>

4770 Biscayne Blvd, Ste 700
Miami, FL 33137

main: 305.677.0022
support: 305.921.4620
email: hescobar at afslc.com

Follow us on Facebook and Linked-In
<http://www.facebook.com/pages/Miami-FL/ASSOCIATION-FINANCIAL/64952991864>
<http://www.linkedin.com/companies/1006276>

NOTICE: This email and any attachment to this email may contain
confidential information. If you are not the intended recipient, you must
not review, retransmit, convert to hard copy, photocopy, use or disseminate
this email or any attachments to it. If you have received this email in
error, please notify us immediately by return email and delete this
message. Please note that if this email contains a forwarded message or is
a reply to a prior message, some or all of the contents of this message or
any attachments may not have been produced by our firm. *As our firm may be
deemed a debt collector, if your payment is in default, we may be
attempting to collect a debt on behalf of the association, and any
information obtained may be used for that purpose.*
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.bestpractical.com/pipermail/rt-users/attachments/20160824/1544dd86/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: AFS_logo.png
Type: image/png
Size: 3183 bytes
Desc: not available
URL: <http://lists.bestpractical.com/pipermail/rt-users/attachments/20160824/1544dd86/attachment.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: linkedin-24x24.png
Type: image/png
Size: 875 bytes
Desc: not available
URL: <http://lists.bestpractical.com/pipermail/rt-users/attachments/20160824/1544dd86/attachment-0001.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: facebook-24x24.png
Type: image/png
Size: 814 bytes
Desc: not available
URL: <http://lists.bestpractical.com/pipermail/rt-users/attachments/20160824/1544dd86/attachment-0002.png>


More information about the rt-users mailing list