[rt-users] RT <-> Knowledge Base
Bruce Campbell
bruce_campbell at ripe.net
Thu Oct 24 18:53:53 EDT 2002
On Thu, 24 Oct 2002, Vivek Khera wrote:
> >>>>> "BC" == Bruce Campbell <bruce_campbell at ripe.net> writes:
>
> BC> At the moment, the StockAnswers in the contrib is the closest to what you
> BC> are looking for. Note the 'at the moment'.
>
> What about these, announced recently? I couldn't deal with every one
> of my possible 100+ canned responses being loaded into my page every
> time as with StockAnswers... I haven't tried this one, yet, though.
>
> http://www.fsck.com/pub/rt/contrib/2.0/TemplateAnswers-0.3.tar.gz
To be honest, I haven't tried it (well, completely missed the announcement
as was catching up with mail after Greece). Looking at it (cue download
and inspection), you've still got the caveat of the text of all of the
Queue's Templates being loaded into the HTML page and then being jiggled
around with javascript.
Hrm.. I'm not keen myself on having all of my queue's templates being
visible in the HTML (ie, I use a number of per-Queue templates for mail
templates etc), so I'd suggest adding the following line (+) in
TemplateAnswers-0.3/TemplateList to limit the possible Templates returned.
% while (my $TemplateObj = $Templates->Next ){
+ % next unless( $TemplateObj->Name =~ /^\s*QuickAnswer:/ );
% push @data, [$TemplateObj->Name, $TemplateObj->Content];
% }
Obviously, tag the Templates that you're using as QuickAnswers as
'QuickAnswer:' to begin the Name.
If your aim is to reduce the size of the answer page, another method that
you could use is to create /Ticket/Elements/TemplateFetch , and then have
the javascript in /Ticket/Elements/TemplateList merely supply a list of
possible templates (% push @data, [$TemplateObj->Name, $TemplateObj->id];)
, and retrieve /Ticket/Elements/TemplateFetch?id=numberselected . That
should cut down on the size of the page passed to the WebUI user.
TemplateFetch would read (warning, untested coconut margarita code):
% if( defined( $Template ) ){
% if( $Template->Name =~ /^\s*QuickAnswer:/ ){
% $Template->Content();
% }else{
You do not have permission to view template { $id }.
% }
% }else{
Template specified does not seem to exist
% }
<%INIT>
my $Template = new RT::Template( $session{'CurrentUser'} );
$Template->Load( $id );
</%INIT>
<%ARGS>
id => undef
</%ARGS>
I think something like this could go into TemplateAnswers 0.4 (Aaron?)
--
Bruce Campbell RIPE
Systems/Network Engineer NCC
www.ripe.net - PGP562C8B1B Operations/Security
More information about the rt-users
mailing list