1 # Copyright 1999-2001 Jesse Vincent <jesse@fsck.com>
2 # Released under the terms of the GNU Public License
3 # $Header: /home/cvs/cvsroot/freeside/rt/lib/RT/Scrips.pm,v 1.1 2002-08-12 06:17:07 ivan Exp $
7 RT::Scrips - a collection of RT Scrip objects
21 ok (require RT::TestHarness);
22 ok (require RT::Scrips);
31 @ISA= qw(RT::EasySearch);
37 $self->{'table'} = "Scrips";
38 $self->{'primary_key'} = "id";
39 return ( $self->SUPER::_Init(@_));
43 # {{{ sub LimitToQueue
47 Takes a queue id (numerical) as its only argument. Makes sure that
48 Scopes it pulls out apply to this queue (or another that you've selected with
49 another call to this method
57 $self->Limit (ENTRYAGGREGATOR => 'OR',
65 # {{{ sub LimitToGlobal
70 Scopes it pulls out apply to all queues (or another that you've selected with
71 another call to this method or LimitToQueue
79 $self->Limit (ENTRYAGGREGATOR => 'OR',
90 return(new RT::Scrip($self->CurrentUser));
98 Returns the next scrip that this user can see.
106 my $Scrip = $self->SUPER::Next();
107 if ((defined($Scrip)) and (ref($Scrip))) {
109 if ($Scrip->CurrentUserHasRight('ShowScrips')) {
113 #If the user doesn't have the right to show this scrip
115 return($self->Next());
118 #if there never was any scrip