[rt-users] Communicate a message to web UI from inside Scrip?
Raed El-Hames
Raed.El-Hames at daisygroupplc.com
Fri Jan 7 09:46:23 EST 2011
Hi Jeff:
Stupid question by where did you put your callback call??
I added
% $m->callback(CallbackName => 'BeforeDisplay',TicketObj => \$TicketObj,Tickets => \$Tickets,Actions => \@Actions,ARGSRef => \%ARGS);
Just above :
% $m->callback(CallbackName => 'BeforeActionList', %ARGS, Actions => \@Actions, ARGSRef => \%ARGS, Ticket => $TicketObj);
And it works:
[Fri Jan 7 14:31:09 2011] [debug]: In Callback/Display.html/BeforeDisplay (/opt/rt3/local/html/Callbacks/MyCallbacks/Ticket/Display.html/BeforeDisplay:3)
By the way going back to your original query regarding not allowing closure until certain CFs are populated, I had to do something similar a couple of months back using a different approach , the way I done it is by not including @InactiveStatus list if these CFs are not populated, so basically modifying
local/html/Elements/SelectStatus
if ($CanResolve == 0) {
@status = RT->Config->Get('ActiveStatus') ;
push @status,"deleted" ;
} else {
@status = $queue->StatusArray();
}
$CanResolve is a variable pushed to the SelectStatus from various pages such as Update.html, Modify.html , Display.html etc ..
It included changes in few places, I had very little time to do it in (1 day), so did not use callbacks, if you are interested I can send you more details.
I've been following this thread hoping to use whatever you come up with if its better.
Regards;
Roy
> -----Original Message-----
> From: rt-users-bounces at lists.bestpractical.com [mailto:rt-users-
> bounces at lists.bestpractical.com] On Behalf Of Jeff Blaine
> Sent: 07 January 2011 03:17
> To: rt-users at lists.bestpractical.com
> Subject: Re: [rt-users] Communicate a message to web UI from inside Scrip?
>
> Pulling my hair out here. Why is this callback not being
> tickled? I see nothing in my logs.
>
> RT 3.8.7
>
> Mason cache cleared and server restarted a million times.
>
> The call to the callback in Ticket/Display.html is:
>
> $m->callback(
> CallbackName => 'BeforeDisplay',
> TicketObj => \$TicketObj,
> Tickets => \$Tickets,
> Actions => \@Actions,
> ARGSRef => \%ARGS,
> );
>
> And my setup is:
>
> [root at rtdev1 Display.html]# pwd
> /rt/local/html/Callbacks/MyCallbacks/Ticket/Display.html
> [root at rtdev1 Display.html]# ls -l BeforeDisplay
> -rw-r--r-- 1 rt root 689 Jan 6 22:06 BeforeDisplay
> [root at rtdev1 Display.html]# cat BeforeDisplay
> <%INIT>
> $RT::Logger->info("In Callback/Display.html/BeforeDisplay\n");
> return 1;
> </%INIT>
> <%ARGS>
> $Actions => []
> </%ARGS>
More information about the rt-users
mailing list