[rt-users] Re-Display Ticket with added warning if owner changed during responding
Jim Brandt
jbrandt at bestpractical.com
Fri Jun 24 08:19:27 EDT 2016
On 6/23/16 8:19 AM, David Schmidt wrote:
> Hello
>
> In case someone takes the ticket ownership wile I am composing a
> response I would like to redisplay the ticket (the submitted response
> shouldnt be deleted) and add a warning informing the user about the
> change in ownership.
>
> I guess this is the correct callback
>
> html/Callbacks/RT-Extension-WarnTicketTaken/Ticket/Update.html/BeforeSubmit
>
> but /Ticket/Update.html is quite the monster for an unexperienced RT
> dev. :)
>
> Where can I get the response text from so it doesnt get lost and how do
> I add a warning?
I might try the BeforeUpdate callback. You should be able to use the
validation code to add your new check. You can make the page redisplay
by setting $checks_failure to 1 and you can display a message by adding
it to @results. BeforeUpdate gives you both of those. You can see an
example above after the call to ValidateCustomFields.
unless ( $status ) {
push @results, @msg;
$checks_failure = 1;
}
You shouldn't need to worry about re-adding input values yourself, it
should happen automatically.
You didn't mention your RT version, but this should be similar across
most current versions.
More information about the rt-users
mailing list