Hi Aaron!
I’ve put
<& Elements/ShowStock/Requests &>
<& /Elements/MessageBox, Name=> “Content” &>
into an otherwise unmodified Create.html copied to
/usr/local/rt2/local/WebRT/html/SelfService/
I’ve modified StockAnswers0.2 to create StockRequests in
/usr/local/rt2/local/WebRT/html/SelfService/Elements/
I’ll include the modified StockAnswers below. My problem is that I don’t
get anything into the drop down list. I’m not a programmer, so I’d
appreciate any advise you can give me!
Thanks!
Mike
<%doc>
$Id: ShowStockRequests,v 1.0 2002/04/29 15:52:33 mkbrown Exp $
</%doc>
<%args>
$Queue => “”
</%args>
Stock Requests...
% $i = 0;
% for (@data) {
% my ($n,$t) = @$_;
<% $n %>
%}
<%init>
my
$templateDir=“$RT::MasonLocalComponentRoot/…/…/templates/StockRequests”;
my @templates = ();
my @data;
push (@templates, glob( $templateDir . $Queue . “/*” ))
if ($Queue && -d $templateDir . $Queue );
special case for the global directory
push (@templates, glob( $templateDir . “global/*” ))
if (-d $templateDir . “global”);
@templates = grep { !/(?:/|,v|~)$/ } @templates;
for my $n (@templates) {
open(IN,“<$n”) or next;
local $/ = “”;
my $t = join(‘’, ); $t =~ s/\n/\n/gs; $t =~ s/'/\'/gs;
$n =~ m{^.+/(.+?)/(.+?)$}; my ($dir,$name) = ($1,$2);
if ($t =~ s/^$title:\s*(.+?)\n//) { $name = $1; }
$n = “$dir:$name”;
push @data, [$n,$t];
}
</%init>From: Aaron T Porter [mailto:atporter@primate.net]
Sent: April 29, 2002 17:04
To: Michael K Brown
Cc: rt-users@lists.fsck.com
Subject: Re: [rt-users] Anyone modify StockAnswers for use in the
SelfService page?
I’m trying to modify the Stock Answers contrib to make a “Stock Requests”;
a
way for users creating tickets to enter pre-formatted text. I’m not
having
much luck so far… I can’t seem to get it working. I’m just wondering if
anyone else has done this yet? Am I breaking new ground that makes the
hairpulling worth while?
Michael, could you tell us specifically which URL you're trying to
insert the questions into? From there it should be quite simple to insert
the text.