Hi All,
I am new to RT2 hacking - just trying to get my feet wet.
I am trying to add a box that displays the oldest 25 unowned
tickets. I added an Elements/Orphans file, added a link in
index.html, and things are working fine so far. But I have
to hardcode the Id of Nobody in my code.
This is what it looks like:
<%INIT>
my $OrphanedTickets;
$OrphanedTickets = new RT::Tickets ($session{âCurrentUserâ});
$OrphanedTickets->LimitOwner(VALUE => 2);
$OrphanedTickets->LimitStatus(VALUE => ânewâ);
$OrphanedTickets->OrderBy(FIELD => âIdâ, ORDER => âASCâ);
$OrphanedTickets->RowsPerPage(25);
</%INIT>
-
Why do I have to use $session{âCurrentUserâ} ? Since the
list of tickets generated has nothing to do with CurrentUser
anyway. What do I use here? (I just copy/pasted that from
the MyTickets file there, btw).
-
How do I give the name (âNobodyâ) rather than VALUE => 2 in
the next line?
-
Does anyone have any pointers to documentation of the
RT::*.pm modules? Or is it RTFS?
RT is 2.0.13, Apache with mod_fastcgi on Redhat 7.2+updates.
Thanks,
Binand
Binand Raj S. wrote:
<%INIT>
my $OrphanedTickets;
$OrphanedTickets = new RT::Tickets ($session{âCurrentUserâ});
$OrphanedTickets->LimitOwner(VALUE => 2);
$OrphanedTickets->LimitStatus(VALUE => ânewâ);
$OrphanedTickets->OrderBy(FIELD => âIdâ, ORDER => âASCâ);
$OrphanedTickets->RowsPerPage(25);
</%INIT>
- Why do I have to use $session{âCurrentUserâ} ? Since the
list of tickets generated has nothing to do with CurrentUser
anyway. What do I use here? (I just copy/pasted that from
the MyTickets file there, btw).
$session{âCurrentUserâ} is the correct thing to use, for
arcane reasons. (Actually, reading the code, I suspect this
is not actually used by anything, but thatâs not important.)
- How do I give the name (âNobodyâ) rather than VALUE => 2 in
the next line?
You can actually do LimitOwner(VALUE => âNobodyâ), although the
doco doesnât clearly state that you can.
- Does anyone have any pointers to documentation of the
RT::*.pm modules? Or is it RTFS?
man RT::Tickets
etc.
Phil Homewood, Systems Janitor, www.SnapGear.com
pdh@snapgear.com Ph: +61 7 3435 2810 Fx: +61 7 3891 3630
SnapGear - Custom Embedded Solutions and Security Appliances