<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Kevin Falcone wrote:
<blockquote cite="mid:20100526155322.GH595@jibsheet.com" type="cite">
<pre wrap="">On Wed, May 26, 2010 at 09:46:42AM +0200, Wolfram Huettermann wrote:
</pre>
<blockquote type="cite">
<pre wrap="">Hello,
I am dealing with Ticket/Display.html. What I found out:
- there is NO change in the page source the when you change the
Mason-block
- I cannot get any information of the callback-functions used.
My task was to limit the size of the layers in which you can see the
metadata and the history of the ticket. It is more user-friendly to
scroll them.
Has anybody an idea how it could work anyway? Or is it just impossible?
</pre>
</blockquote>
<pre wrap=""><!---->
Without knowing what you did, it is impossible to know what is wrong.
However, it sounds like Christian Loos has already implemented a
similar module
<a class="moz-txt-link-freetext" href="http://github.com/cloos/rt-extension-briefhistory">http://github.com/cloos/rt-extension-briefhistory</a>
-kevin
</pre>
<pre wrap="">
<hr size="4" width="90%">
Discover RT's hidden secrets with RT Essentials from O'Reilly Media.
Buy a copy at <a class="moz-txt-link-freetext" href="http://rtbook.bestpractical.com">http://rtbook.bestpractical.com</a></pre>
</blockquote>
<br>
Hi Kevin, <br>
<br>
I wanted to change the module Ticket/Display.html in the HTML-block.
But its appearance and its source code remained the same, even after
I had cut this block. It seems that the <%init%>-block creates
the module and overlays the HTML-code. <br>
<br>
I even haven't got any information of the callback-functions in that
block. Here is the init-block of Ticket/Display.html. <br>
<font face="monospace"><%INIT><br>
$m->callback( TicketObj => $TicketObj, ARGSRef => \%ARGS,
CallbackName => 'Initial' );<br>
my (@Actions, $Tickets); <br>
<br>
<br>
unless ($id || $TicketObj) {<br>
Abort('No ticket specified');<br>
}<br>
<br>
if ($ARGS{'id'} eq 'new') {<br>
# {{{ Create a new ticket<br>
<br>
my $Queue = new RT::Queue( $session{'CurrentUser'} );<br>
$Queue->Load($ARGS{'Queue'});<br>
unless ( $Queue->id ) {<br>
Abort('Queue not found');<br>
}<br>
<br>
unless ( $Queue->CurrentUserHasRight('CreateTicket') ) {<br>
Abort('You have no permission to create tickets in that
queue.');<br>
}<br>
<br>
($TicketObj, @Actions) = CreateTicket(<br>
Attachments => delete $session{'Attachments'},<br>
%ARGS,<br>
);<br>
unless ( $TicketObj->CurrentUserHasRight('ShowTicket') ) {<br>
Abort("No permission to view newly created ticket
#".$TicketObj->id.".");<br>
}<br>
# }}}<br>
} else { <br>
$TicketObj ||= LoadTicket($ARGS{'id'});<br>
<br>
$m->callback( CallbackName => 'BeforeProcessArguments',<br>
TicketObj => $TicketObj, Tickets => $Tickets,<br>
ActionsRef => \@Actions, ARGSRef => \%ARGS );<br>
if ( defined $ARGS{'Action'} ) {<br>
if ($ARGS{'Action'} =~ /^(Steal|Kill|Take|SetTold)$/) {<br>
my $action = $1;<br>
my ($res, $msg) = $TicketObj->$action();<br>
push(@Actions, $msg);<br>
}<br>
}<br>
<br>
$m->callback(CallbackName => 'ProcessArguments', <br>
Ticket => $TicketObj, <br>
ARGSRef => \%ARGS, <br>
Actions => \@Actions);<br>
<br>
$ARGS{UpdateAttachments} = $session{'Attachments'};<br>
push @Actions,<br>
ProcessUpdateMessage(<br>
ARGSRef => \%ARGS,<br>
Actions => \@Actions,<br>
TicketObj => $TicketObj,<br>
);<br>
delete $session{'Attachments'};<br>
<br>
#Process status updates<br>
push @Actions, ProcessTicketWatchers(ARGSRef => \%ARGS,
TicketObj => $TicketObj );<br>
push @Actions, ProcessTicketBasics( ARGSRef => \%ARGS,
TicketObj => $TicketObj );<br>
push @Actions, ProcessTicketLinks( ARGSRef => \%ARGS,
TicketObj => $TicketObj );<br>
push @Actions, ProcessTicketDates( ARGSRef => \%ARGS,
TicketObj => $TicketObj );<br>
push @Actions, ProcessObjectCustomFieldUpdates(ARGSRef =>
\%ARGS, TicketObj => $TicketObj );<br>
<br>
# XXX: we shouldn't block actions here if user has no right to see
the ticket,<br>
# but we should allow him to see actions he has done<br>
unless ($TicketObj->CurrentUserHasRight('ShowTicket')) {<br>
Abort("No permission to view ticket");<br>
}<br>
if ( $ARGS{'MarkAsSeen'} ) {<br>
$TicketObj->SetAttribute(<br>
Name => 'User-'. $TicketObj->CurrentUser->id
.'-SeenUpTo',<br>
Content => $TicketObj->LastUpdated,<br>
);<br>
push @Actions, loc('Marked all messages as seen');<br>
}<br>
}<br>
<br>
$m->callback(<br>
CallbackName => 'BeforeDisplay',<br>
TicketObj => \$TicketObj,<br>
Tickets => \$Tickets,<br>
Actions => \@Actions,<br>
ARGSRef => \%ARGS,<br>
);<br>
<br>
# This code does automatic redirection if any updates happen. <br>
<br>
if (@Actions) {<br>
<br>
# We've done something, so we need to clear the decks to avoid<br>
# resubmission on refresh.<br>
# But we need to store Actions somewhere too, so we don't lose them.<br>
my $key = Digest::MD5::md5_hex( rand(1024) );<br>
push @{ $session{"Actions"}->{$key} ||= [] }, @Actions;<br>
$session{'i'}++;<br>
RT::Interface::Web::Redirect( RT->Config->Get('WebURL') .
"Ticket/Display.html?id=" . $TicketObj->id . "&results=" . $key
);<br>
<br>
}<br>
<br>
my $attachments = $m->comp('Elements/FindAttachments', Ticket =>
$TicketObj, Tickets => $Tickets);<br>
my $attachment_content = $m->comp('Elements/LoadTextAttachments',
Ticket => $TicketObj);<br>
<br>
my %link_rel;<br>
if (defined $session{'tickets'} and ($ARGS{'Query'} or
$session{'CurrentSearchHash'}->{'Query'})) {<br>
my $item_map = $session{'tickets'}->ItemMap;<br>
$link_rel{first} = "Ticket/Display.html?id=" .
$item_map->{first} if
$item_map->{$TicketObj->Id}{prev};<br>
$link_rel{prev} = "Ticket/Display.html?id=" .
$item_map->{$TicketObj->Id}{prev} if
$item_map->{$TicketObj->Id}{prev};<br>
$link_rel{next} = "Ticket/Display.html?id=" .
$item_map->{$TicketObj->Id}{next} if
$item_map->{$TicketObj->Id}{next};<br>
$link_rel{last} = "Ticket/Display.html?id=" .
$item_map->{last} if
$item_map->{$TicketObj->Id}{next};<br>
}<br>
</%INIT><br>
<br>
</font> Thank you for your advice. <br>
<br>
Wolfram<br>
<br>
<br>
</body>
</html>