[rt-devel] Trying to expand WebRT
Jaime Kikpole
jkikpole at cairodurham.org
Sun Dec 15 01:56:37 EST 2002
I'm trying to write additional web fronts to RT. I picked up a
book on Mason and read as much as I could in the last day or so. So I
tried to test my new knowledge (I tried to write a simple script) and hit
a problem. I'm hoping that someone here can show me what I'm
over-looking.
Code in /path/to/rt/local/WebRT/html/NoAuth/test7.html:
<& /Elements/Header &>
Ticket: <% $ticket->Id %>
<BR>
Owner: <% $ticket->OwnerObj->RealName %>
<BR>
%#Subject: <% $ticket->Subject %>
<BR>
%#Status: <% $ticket->Status %>
<%ARGS>
$id => undef
</%ARGS>
<%INIT>
#my $user = new RT::CurrentUser('guest');
my $ticket = new RT::Ticket('guest');
$ticket->Load($id);
</%INIT>
This more or less works. The Header file is included just to show
me who is "logged in" on the page. Then I uncomment the line that
displays the subject. (i.e. "%#Subject: <% $ticket->Subject %>" has the
leading "%#" removed) This causes the following error message:
Mason error
error in file: /usr/local/rt-2-0-6/lib/RT/Ticket.pm
line 2836: Can't locate object method "UserObj" via package "guest"
context: ...
2832: sub CurrentUserHasRight {
2833: my $self = shift;
2834: my $right = shift;
2835:
2836: return ($self->HasRight( Principal=> $self->CurrentUser->UserObj(),
2837: Right => "$right"));
2838:
2839: }
2840:
...
component stack: /NoAuth/test7.html [local]
/autohandler [standard]
code stack: /usr/local/rt-2-0-6/lib/RT/Ticket.pm:2786
/usr/local/lib/perl5/site_perl/5.005/DBIx/SearchBuilder/Record.pm:405
/usr/local/rt-2-0-6/WebRT/data/obj/STANDARD/autohandler:18
raw_error
I'm kind of new to OOP, so I'm probably missing something obvious.
Can anyone explain what I did wrong?
Thanks in advance,
Jaime
--
Network Administrator
Cairo-Durham Central School District
More information about the Rt-devel
mailing list