[Rt-commit] rt branch, 4.2/single-queue-search-contextobj, repushed
Alex Vandiver
alexmv at bestpractical.com
Mon Jan 6 18:09:26 EST 2014
The branch 4.2/single-queue-search-contextobj was deleted and repushed:
was a83610776ca6ad18076d899e24126a615be8b879
now 2078d6b5f98d98979044724970844d5ddc111bf3
1: a836107 ! 1: 2078d6b Allow queue CF rights to apply on single-queue searches
@@ -47,9 +47,12 @@
--- a/share/html/Search/Elements/BuildFormatString
+++ b/share/html/Search/Elements/BuildFormatString
@@
+ # Gotta load up the $queue object, since queues get stored by name now.
my $queue = RT::Queue->new($session{'CurrentUser'});
$queue->Load($id);
- $CustomFields->LimitToQueue($queue->Id) if $queue->Id;
+- $CustomFields->LimitToQueue($queue->Id) if $queue->Id;
++ next unless $queue->Id;
++ $CustomFields->LimitToQueue($queue->Id);
+ $CustomFields->SetContextObject( $queue ) if keys %queues == 1;
}
$CustomFields->LimitToGlobal;
@@ -59,9 +62,12 @@
--- a/share/html/Search/Elements/PickObjectCFs
+++ b/share/html/Search/Elements/PickObjectCFs
@@
+ foreach my $name (keys %queues) {
my $queue = RT::Queue->new($session{'CurrentUser'});
$queue->Load($name);
- $CustomFields->LimitToObjectId($queue->Id) if $queue->Id;
+- $CustomFields->LimitToObjectId($queue->Id) if $queue->Id;
++ next unless $queue->Id;
++ $CustomFields->LimitToObjectId($queue->Id);
+ $CustomFields->SetContextObject( $queue ) if keys %queues == 1;
}
@@ -71,10 +77,13 @@
--- a/share/html/Search/Elements/PickTicketCFs
+++ b/share/html/Search/Elements/PickTicketCFs
@@
+ # Gotta load up the $queue object, since queues get stored by name now.
my $queue = RT::Queue->new($session{'CurrentUser'});
$queue->Load($id);
- $CustomFields->LimitToQueue($queue->Id) if $queue->Id;
-+ $CustomFields->SetContextObject($queue) if keys %queues == 1;
+- $CustomFields->LimitToQueue($queue->Id) if $queue->Id;
++ next unless $queue->Id;
++ $CustomFields->LimitToQueue($queue->Id);
++ $CustomFields->SetContextObject( $queue ) if keys %queues == 1;
}
$CustomFields->LimitToGlobal;
$CustomFields->OrderBy( FIELD => 'Name', ORDER => 'ASC' );
More information about the rt-commit
mailing list