I've been playing around with this all day, and came up with the following
which seems to work:
In html/RTIR/Elements/BaseQuery, changed:
<%INIT>
return '' unless $Queue;
return "Queue = '$Queue'";
</%INIT>
<%ARGS>
$Queue => ''
</%ARGS>
to:
<%INIT>
my $GroupObj = RT::Group->new( $session{ 'CurrentUser' } );
my $PrincipalObj = RT::Principal->new( $session{ 'CurrentUser' } );
$PrincipalObj->Load( $session{ 'CurrentUser' }->id );
$GroupObj->LoadUserDefinedGroup( 'DutyTeam A' );
my $HasMember = $GroupObj->HasMemberRecursively( $PrincipalObj );
return "Queue = '$Queue' AND 'CF.{Constituency}' = 'A'" if $HasMember;
$GroupObj->LoadUserDefinedGroup( 'DutyTeam B' );
$HasMember = $GroupObj->HasMemberRecursively( $PrincipalObj );
return "Queue = '$Queue' AND 'CF.{Constituency}' = 'B'" if $HasMember;
return '' unless $Queue;
return "Queue = '$Queue'";
</%INIT>
<%ARGS>
$Queue => ''
</%ARGS>
----- Original Message -----
From: "Chris Warren" <[email protected]>
To: [email protected]
Sent: Wednesday, September 19, 2012 12:33:53 PM
Subject: [Rtir] Constituencies and search results/home page
Hello all,
I'm running RT 3.8.9 with RTIR 2.6. I just started using constituencies, and
am seeing some odd behavior. Not sure if its a known issue, or if I might have
just messed something up...
I have 2 constituencies. Assume that there are 12 reports in 'constituency A',
and 14 reports in 'constituency B'. If I am logged in as a member of 'dutyteam
constituency A', the 'new unlinked incident reports' section displays only
reports from the correct constituency, but it seems like they are filtered
AFTER the query is run (number of results/pages corresponds to the total number
of reports in all constituencies).
Not a big deal, but lets say that 'constituency A' has 6 reports, then
'constituency B' gets 14, and 'constituency A' gets 6 more. In this situation,
a user in 'dutyteam constituency A' only sees 6 reports on the home page
(instead of 10), and has to go to the next page to see more. However, page 2
is totally empty, and we find the other 6 reports on page 3 (as if all the
reports were visible).
Refining the search to specify constituency works as expected, but I'd like to
eliminate as many steps as possible.
Anyone have any helpful tips?
Thanks!
Chris
_______________________________________________
Rtir mailing list
[email protected]
http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rtir
_______________________________________________
Rtir mailing list
[email protected]
http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rtir