> Instead of building the nice HTML table with the open tickets for that
> group to view it spits back the code:
>
>        <%$ticket->Id%>
>
> Which used to fill a table cell with the ticket ID number.  Or  `%
> print $CF1;`  where the IP address used to go, etc.
>
> If this isn't a supported mechanism (I inherited this RT system) is
> there a way to provide local users access to the same type of data in
> a page that can be protected with htaccess instead of browsing full
> ticket details inside of RT?

I suppose I should include the full contents of the page so you can
see what we were/are actually doing:

building.html:

<html>
  <head>
<link rel="stylesheet" href="/NoAuth/webrt.css" type="text/css">
<title>Open Incidents at test.edu</title>
  </head>

  <body><center>
    <h1> Open Security Incidents by Building</h1>

<TABLE WIDTH=98% CELLSPACING=2 CELLPADDING=5 border=2>

<%PERL>
my $tickets = new RT::Tickets($user);
$tickets->OrderBy(FIELD => 'id', ALIAS => 'main', ORDER => 'DESC');
$tickets->LimitStatus(VALUE => 'open');
$tickets->LimitStatus(VALUE => 'new');
$tickets->LimitStatus(VALUE => 'stalled');
</%PERL>
% if ($tickets->Count) {

<TR>
<TD BGCOLOR=#336699><FONT COLOR="#FFFFFF">
<b>ID<b>
</TD>
<TD BGCOLOR=#336699><FONT COLOR="#FFFFFF">
<b>Subject<b>
</TD>
<TD BGCOLOR=#336699><FONT COLOR="#FFFFFF">
<b>Status<b>
</TD>
<TD BGCOLOR=#336699><FONT COLOR="#FFFFFF">

<b>Created<b>
</TD>
<TD BGCOLOR=#336699><FONT COLOR="#FFFFFF">
<b>IP Address<b>
</TD>
<TD BGCOLOR=#336699><FONT COLOR="#FFFFFF">
<b>MAC<B>
</TD>
<TD BGCOLOR=#336699><FONT COLOR="#FFFFFF">
<b>Port<B>
</TD>
<TD BGCOLOR=#336699><FONT COLOR="#FFFFFF">
<b>Room<b>

</TD>
<TD BGCOLOR=#336699><FONT COLOR="#FFFFFF">
<b>Building<b>
</TD>
<TD BGCOLOR=#336699><FONT COLOR="#FFFFFF">
<b>Category<b>
</TD>
<TD BGCOLOR=#336699><FONT COLOR="#FFFFFF">
<b>Network Status<b>
</TD>
<TD BGCOLOR=#336699><FONT COLOR="#FFFFFF">
<b>Jack<b>
</TD>

<td BGCOLOR=#336699><FONT COLOR="#FFFFFF">
<b>userID<b>
</TD>
</TR>



%       while (my $ticket = $tickets->Next) {

%               $status = 1;
%               $building = 1;
%               $restrict = 1;

%               my $Field1 = $ticket->CustomFieldValues(11);

%               while (my $Test1 = $Field1->Next()) {
%                       $status = $Test1->Content;
%               }


%               my $Field2 = $ticket->CustomFieldValues(3);

%               while (my $Test2 = $Field2->Next()) {
%                       $building = $Test2->Content;
%               }

%               my $Field3 = $ticket->CustomFieldValues(13);

%               while (my $Test3 = $Field3->Next()) {
%                       $restrict = $Test3->Content;
%                       $Test3 = 1;     
%               }



%               if($building eq $bid && $restrict ne 'True') {
%               $i++;


<TR
% if ($i%2) {
BGCOLOR="#dddddd"
%}
>
%               my $CF;
%               my $CFValue;
%               $CF =  $ticket->CustomFieldValues(1); while ($CFValue
= $CF->Next()){$CF1=$CFValue->Content;}
%               $CF =  $ticket->CustomFieldValues(5); while ($CFValue
= $CF->Next()){$CF5=$CFValue->Content;}
%               $CF =  $ticket->CustomFieldValues(2); while ($CFValue
= $CF->Next()){$CF2=$CFValue->Content;}
%               $CF =  $ticket->CustomFieldValues(3); while ($CFValue
= $CF->Next()){$CF3=$CFValue->Content;}
%               $CF =  $ticket->CustomFieldValues(6); while ($CFValue
= $CF->Next()){$CF6=$CFValue->Content;}
%               $CF =  $ticket->CustomFieldValues(10); while ($CFValue
= $CF->Next()){$CF10=$CFValue->Content}
%               $CF =  $ticket->CustomFieldValues(7); while ($CFValue
= $CF->Next()){$CF7=$CFValue->Content;}
%               $CF =  $ticket->CustomFieldValues(12); while ($CFValue
= $CF->Next()){$CF12=$CFValue->Content};

<TD>
<%$ticket->Id%>
</TD>
<TD>

<%$ticket->Subject%>
</TD>
<TD>
<%$ticket->Status%>
</TD>
<TD>
<% $ticket->CreatedObj->AsString %></TD>
</TD>
<TD>
% print $CF1;
</TD>
<TD>
% print $CF5;
</TD>
<TD>
% print $CF6;

</TD>
<tD>
% print $CF2;
</TD>
<TD>
% print $CF3;
</TD>
<TD>
% print $CF10;
</TD>
<TD>
% print $status;
</TD>
<TD>
% print $CF7;
</TD>
<TD>

% print $CF12;
</TD>
% ($CF5,$CF6,$CF2,$CF3,$CF4,$CF10,$CF7,$CF12) = ("","","","","","","","");
</TR>
% }
% }
% }

</TABLE>


%if ($i == 0){
<BR>
<H2>
There are currently no disabled ports in this building.
%}

</center>
  </body>
</html>
<%ARGS>
$bid => undef

</%ARGS>

<%INIT>
my $user = new RT::CurrentUser('guest');
my $queue = new RT::Queue($user);
my $i = 0;
my $status;
my $building;
my $restrict;
my $CF1; my $CF5; my $CF6; my $CF2; my $CF3; my $CF4; my $CF10; my
$CF7; my $CF12;
</%INIT>

end

It would be great if we didn't need to develop a new set of pages to
get this type of view out to the helpdesk and building contacts, but
like I said I'm open to suggestions if there is a better way.  I'm
very curious as to why this doesn't work anymore in 3.8 with fastcgi
however.
_______________________________________________
http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-users

Community help: http://wiki.bestpractical.com
Commercial support: [email protected]

2010 RT Training Sessions!
San Francisco, CA, USA - Feb 22 & 23
Dublin, Ireland - Mar 15 & 16
Boston, MA, USA - April 5 & 6
Washington DC, USA - Oct 25 & 26

Discover RT's hidden secrets with RT Essentials from O'Reilly Media. 
Buy a copy at http://rtbook.bestpractical.com

Reply via email to