[rt-devel] Question about extending

Andrew Stribblehill a.d.stribblehill at durham.ac.uk
Tue Nov 18 04:26:58 EST 2003


Quoting Bob Goldstein <bobg at uic.edu> (2003-11-17 16:37:18 GMT):
> >
> >you actually want to use either callbacks or "overlay" html files in
> >your local/html tree to override the core versions.
> >
> >	-j
> 
>   Are there any docs about how to do this?  I did check what
>   docs I could find, as well as the list archive. I must
>   not be looking in the right place.
> 
>   I understand overalys for lib/RT/*.pm from reading the code.
>   They enable me to replace (or add) perl code on a per-subroutine
>   basis.  But the way I read the html overlays, I'd have
>   to overlay the core code on a per-file basis.  That's
>   only marginally more attractive then using cvs to track
>   changes and actually replacing the core code when I upgrade.
> 
>   Unless I change a bit of the core code to call out to new
>   code I write in the local tree.  Which is what I presume
>   the existing callbacks do?  Is there a list of existing
>   callbacks, with defaults and intent?  And if I change
>   the core code to add more callbacks, I'm back to putting
>   those changes into overlays?

Jesse told us in December[0] that if we want extra callbacks, we're to
post the 'diff -u' to rt-3.0-bugs at fsck.com and he'll probably roll
them in.

Please be aware that the Callbacks now work slightly differently from
the reference; they actually call
/Callbacks/*/<component>/<callback-name> where <component> is the Web
component you're extending and <callback-name> is the value of Name
in the callback, or else  it's 'Default'.

As an example of using a Callback, I put the following into
<local-html-root>/Callbacks/local/Elements/Tabs/Default:

<%init>
$topactions->{'A'} = { html => $m->scomp('/Elements/GotoQueue') };
</%init>
<%args>
$topactions =>undef
</%args>

[Whilst this is beside the main point of the email,
/Elements/GotoQueue is attached.]

This has the effect of replacing the "New Ticket" dropdown with "Go
to queue". Had I said $topactions->{'A0'} or anything asciibetically
between A and B, it would have inserted 'Go to queue' between 'New
Ticket' and 'Search'.

----
[0] http://lists.fsck.com/pipermail/rt-devel/2002-December/002833.html

-- 
VIKING NORTH UTSIRE SOUTH UTSIRE
SOUTHWEST BACKING SOUTH OR SOUTHEAST FOR A TIME, 4 OR 5 INCREASING
6 TO GALE 8. RAIN OR SHOWERS. MODERATE OR GOOD
-------------- next part --------------
%# BEGIN LICENSE BLOCK
%# 
%# Copyright (c) 1996-2003 Jesse Vincent <jesse at bestpractical.com>
%# 
%# (Except where explictly superceded by other copyright notices)
%# 
%# This work is made available to you under the terms of Version 2 of
%# the GNU General Public License. A copy of that license should have
%# been provided with this software, but in any event can be snarfed
%# from www.gnu.org.
%# 
%# This work is distributed in the hope that it will be useful, but
%# WITHOUT ANY WARRANTY; without even the implied warranty of
%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
%# General Public License for more details.
%# 
%# Unless otherwise specified, all modifications, corrections or
%# extensions to this work which alter its source code become the
%# property of Best Practical Solutions, LLC when submitted for
%# inclusion in the work.
%# 
%# 
%# END LICENSE BLOCK
<FORM ACTION="<%$RT::WebPath%>/Search/Listing.html">
<input type="submit" value="Goto queue">&nbsp;
<&|/l, $m->comp('/Elements/SelectQueue', ShowNullOption => 0, Name => "ValueOfQueue")&>
  <input type="hidden" name="QueueOp" value="=">
  <input type="hidden" name="ValueOfStatus" value="open">
  <input type="hidden" name="ValueOfStatus" value="new">
  <input type="hidden" name="StatusOp" value="=">
  <input type="hidden" name="RowsPerPage" value="50">
  <input type="hidden" name="NewSearch" value="1">
</&>
</FORM>


More information about the Rt-devel mailing list