[rt-users] 10 newest unowned tickets per queue? SOLVED
Florian Hochstrasser
florian.hochstrasser at swisslog.com
Thu Jan 26 07:28:19 EST 2006
Thanks for the code Eric, it worked perfect, except that I copied the
file MyRequests to local/html/Elements
Regards, Florian
-----Original Message-----
From: rt-users-bounces at lists.bestpractical.com
[mailto:rt-users-bounces at lists.bestpractical.com] On Behalf Of Florian
Hochstrasser
Sent: Donnerstag, 26. Januar 2006 11:52
To: Schultz, Eric
Cc: RT USERS
Subject: RE: [rt-users] 10 newest unowned tickets per queue?
Alright, thanks a lot. I'll try this today and post my results.
Florian
-----Original Message-----
From: Schultz, Eric [mailto:ESchultz at corp.untd.com]
Sent: Mittwoch, 25. Januar 2006 17:03
To: Florian Hochstrasser
Cc: RT USERS
Subject: RE: [rt-users] 10 newest unowned tickets per queue?
I'm not sure that will work... It only seems like it will give you a
query that is the last queue of all queues.
What I did was "only show me unowned tickets in queues that I can own
tickets". Here's the code for what I did in
share/html/Elements/MyRequests (from 3.4.1, diff -c):
*** MyRequests 2005/07/05 23:47:16 1.11
--- MyRequests 2005/10/04 21:56:46 1.12
***************
*** 77,90 ****
<%init>
my $rows = $RT::MyRequestsLength;
! my $Query = "Owner = 'Nobody' AND ( Status = 'new' OR Status =
'open')";
my $QueryString = '?' . $m->comp('/Elements/QueryString',
Query => $Query,
--- 77,102 ----
<%init>
my $rows = $RT::MyRequestsLength;
! # This next section of code will limit unowned tickets to only be
! # those that are in a queue that a user can own tickets in.
! my $q = new RT::Queues($session{'CurrentUser'});
! $q->UnLimit;
! my @queues;
!
! while (my $queue = $q->Next) {
! if ($queue->CurrentUserHasRight( 'OwnTicket' )) {
! push( @queues, "Queue = \'" . $queue->Name . "\'" );
! }
! }
+ my $Query = "Owner = 'Nobody' AND ( Status = 'new' OR Status = 'open')
AND ( " . join( " OR ", @queues ) . " )";
+
my $QueryString = '?' . $m->comp('/Elements/QueryString',
Query => $Query,
> -----Original Message-----
> From: rt-users-bounces at lists.bestpractical.com
> [mailto:rt-users-bounces at lists.bestpractical.com] On Behalf
> Of Drew Barnes
> Sent: Wednesday, January 25, 2006 7:09 AM
> To: Florian Hochstrasser
> Cc: RT USERS
> Subject: Re: [rt-users] 10 newest unowned tickets per queue?
>
> I did this in a pretty ugly, tossed-together-in-10-minutes
> way. Works on
> 3.2.2, may need a little tweaking for 3.4.4. I can't remember if that
> was one of the ones I had to fix.
>
> Feel free to clean this up or fix it. I stopped when it
> started working
> for me.
> http://wiki.bestpractical.com/index.cgi?TicketsPerQueue
>
>
> DB
>
> Florian Hochstrasser wrote:
> >
> > Hi all
> >
> > As our setup is growing continually, we ran into a problem
> regarding
> > the display of the 10 newest unowned tickets on the Home
> screen. The
> > problem is that the overall ten newest tickets get into
> that list. But
> > all the tickets of queues that one has no permission to
> don't show up.
> >
> > That means, if there are 10 new tickets in other queues
> which I don't
> > have permission for and the 11^th would be one in my queue,
> the list
> > appears to be empty, even though I have a new ticket to
> work on. How
> > can this be fixed so that this list is built on tickets of queues
> > which one has access to?
> >
> > TIA, Florian
____________________________________________________________
This message has been checked for all known viruses by Messagelabs.
____________________________________________________________
This message may contain legally privileged or confidential
information and is therefore addressed to the named persons only.
The recipient should inform the sender and delete this message,
if he/she is not named as addressee.
The sender disclaims any and all liability for the integrity
and punctuality of this message.
The sender has activated an automatic virus scanning by
Messagelabs, but does not guarantee the virus free
transmission of this message.
_______________________________________________
http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-users
Be sure to check out the RT Wiki at http://wiki.bestpractical.com
Download a free sample chapter of RT Essentials from O'Reilly Media at
http://rtbook.bestpractical.com
WE'RE COMING TO YOUR TOWN SOON - RT Training in Amsterdam, Boston and
San Francisco - Find out more at
http://bestpractical.com/services/training.html
____________________________________________________________
This message has been checked for all known viruses by Messagelabs.
____________________________________________________________
This message may contain legally privileged or confidential
information and is therefore addressed to the named persons only.
The recipient should inform the sender and delete this message,
if he/she is not named as addressee.
The sender disclaims any and all liability for the integrity
and punctuality of this message.
The sender has activated an automatic virus scanning by
Messagelabs, but does not guarantee the virus free
transmission of this message.
More information about the rt-users
mailing list