Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Request Tracker: Devel

A couple of API questions

 

 

Request Tracker devel RSS feed   Index | Next | Previous | View Threaded


fran at cis

Sep 23, 2009, 9:20 AM

Post #1 of 4 (1025 views)
Permalink
A couple of API questions

I am in the process of creating an extension and have a couple of
questions.

1. I would like the users to be able to select one or more queues as
input for the report. Right now I am doing a SelectQueue Element, which
only allows the choice of one queue. What would be the best way to
achieve "select one or more queues" functionality? I browsed the
available Elements and nothing jumped out on first pass.

2. If I already have a queue's ID, is there an easier way to retrieve
the object for that queue than what I am doing now:

my $queues = new RT::Queues($session{CurrentUser});
$queues->Limit(FIELD => "Id", OPERATOR => "=", VALUE => $queueId);
my $queueobj = $queues->Next;

I have the same question for users, given the user's Name value. I was
wondering if there was something like my $queueobj = new RT::Queue(Id =>
$queueId) or similar, but wasn't able to find anything similar in the
perldoc.

Thanks,
Fran

--
Fran Fabrizio
Senior Systems Analyst
Department of Computer and Information Sciences
University of Alabama at Birmingham
http://www.cis.uab.edu/
205.934.0653

_______________________________________________
List info: http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-devel


falcone at bestpractical

Sep 23, 2009, 9:59 AM

Post #2 of 4 (943 views)
Permalink
Re: A couple of API questions [In reply to]

On Wed, Sep 23, 2009 at 11:20:16AM -0500, Fran Fabrizio wrote:
> 1. I would like the users to be able to select one or more queues as
> input for the report. Right now I am doing a SelectQueue Element, which
> only allows the choice of one queue. What would be the best way to
> achieve "select one or more queues" functionality? I browsed the
> available Elements and nothing jumped out on first pass.

You'll probably need to make a custom selectqueue for that

> 2. If I already have a queue's ID, is there an easier way to retrieve
> the object for that queue than what I am doing now:
>
> my $queues = new RT::Queues($session{CurrentUser});
> $queues->Limit(FIELD => "Id", OPERATOR => "=", VALUE => $queueId);
> my $queueobj = $queues->Next;
>
> I have the same question for users, given the user's Name value. I was
> wondering if there was something like my $queueobj = new RT::Queue(Id =>
> $queueId) or similar, but wasn't able to find anything similar in the
> perldoc.

You want the Load function, which you can find implemented on a number
of objects and also in DBIx::SearchBuilder.

-kevin
_______________________________________________
List info: http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-devel


fran at cis

Sep 23, 2009, 10:58 AM

Post #3 of 4 (943 views)
Permalink
Re: A couple of API questions [In reply to]

Kevin Falcone wrote:
> On Wed, Sep 23, 2009 at 11:20:16AM -0500, Fran Fabrizio wrote:
>
>> 1. I would like the users to be able to select one or more queues as
>> input for the report. Right now I am doing a SelectQueue Element, which
>> only allows the choice of one queue. What would be the best way to
>> achieve "select one or more queues" functionality? I browsed the
>> available Elements and nothing jumped out on first pass.
>>
>
> You'll probably need to make a custom selectqueue for that
>
Ok, I'll try to start from SelectQueue and see if I can make sense of
how to create custom Elements.

>
>> [SNIP]
>>
>
> You want the Load function, which you can find implemented on a number
> of objects and also in DBIx::SearchBuilder.
>
Thanks!!

--
Fran Fabrizio
Senior Systems Analyst
Department of Computer and Information Sciences
University of Alabama at Birmingham
http://www.cis.uab.edu/
205.934.0653

_______________________________________________
List info: http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-devel


ruslan.zakirov at gmail

Sep 24, 2009, 12:42 AM

Post #4 of 4 (931 views)
Permalink
Re: A couple of API questions [In reply to]

On Wed, Sep 23, 2009 at 9:58 PM, Fran Fabrizio <fran [at] cis> wrote:
> Kevin Falcone wrote:
>> On Wed, Sep 23, 2009 at 11:20:16AM -0500, Fran Fabrizio wrote:
>>
>>> 1. I would like the users to be able to select one or more queues as
>>> input for the report.  Right now I am doing a SelectQueue Element, which
>>> only allows the choice of one queue.  What would be the best way to
>>> achieve "select one or more queues" functionality?  I browsed the
>>> available Elements and nothing jumped out on first pass.
>>>
>>
>> You'll probably need to make a custom selectqueue for that
>>
> Ok, I'll try to start from SelectQueue and see if I can make sense of
> how to create custom Elements.

It is very easy, just set multiple on select box that is rendered by
SelectQueue and then you can get them as list in mason component.
Probably additional argument in SelectQueue to allow people to select
multiple queues can be even comitted into the core.

--
Best regards, Ruslan.
_______________________________________________
List info: http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-devel

Request Tracker devel RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.