[Rt-commit] r17931 - rt/3.8/trunk/share/html/Search
elacour at bestpractical.com
elacour at bestpractical.com
Tue Jan 27 04:23:12 EST 2009
Author: elacour
Date: Tue Jan 27 04:23:12 2009
New Revision: 17931
Modified:
rt/3.8/trunk/share/html/Search/Bulk.html
Log:
Reduce the list of owners from SelectOwner in bulk update to queues where
current user can create or modify tickets.
Modified: rt/3.8/trunk/share/html/Search/Bulk.html
==============================================================================
--- rt/3.8/trunk/share/html/Search/Bulk.html (original)
+++ rt/3.8/trunk/share/html/Search/Bulk.html Tue Jan 27 04:23:12 2009
@@ -87,7 +87,7 @@
<td valign="top">
<table>
<tr><td class="label"> <&|/l&>Make Owner</&>: </td>
-<td class="value"> <& /Elements/SelectOwner, Name => "Owner" &> (<input type="checkbox" class="checkbox" name="ForceOwnerChange" /> <&|/l&>Force change</&>) </td></tr>
+<td class="value"> <& /Elements/SelectOwner, Name => "Owner", QueueObj => @OwnerQueues &> (<input type="checkbox" class="checkbox" name="ForceOwnerChange" /> <&|/l&>Force change</&>) </td></tr>
<tr><td class="label"> <&|/l&>Add Requestor</&>: </td>
<td class="value"> <input name="AddRequestor" size="20" /> </td></tr>
<tr><td class="label"> <&|/l&>Remove Requestor</&>: </td>
@@ -221,6 +221,18 @@
<%INIT>
+
+# Queues to give to SelectOwner to restrict it
+my @OwnerQueues;
+my $Queues = RT::Queues->new( $session{'CurrentUser'} );
+$Queues->UnLimit;
+while ( my $Queue = $Queues->Next() ) {
+ my $Can = $session{CurrentUser}->HasRight( Right => 'CreateTicket', Object => $Queue )
+ || $session{CurrentUser}->HasRight( Right => 'ModifyTicket', Object => $Queue );
+ push( @OwnerQueues, $Queue ) if ( $Can );
+}
+
+
unless ( defined $Rows ) {
$Rows = $RowsPerPage;
$ARGS{Rows} = $RowsPerPage;
More information about the Rt-commit
mailing list