Commit 2620658d authored by Alex Vandiver's avatar Alex Vandiver
Browse files

Merge branch '4.2/new-admin-search-result-rows-config' into 4.2-trunk

parents f170ce08 f3637f6f
......@@ -2909,6 +2909,23 @@ Set(%AdminSearchResultFormat,
.q{,__Description__,__Disabled__},
);
=item C<%AdminSearchResultRows>
Use C<%AdminSearchResultRows> to define the search result rows in the admin
interface on a per-RT-class basis.
=cut
Set(%AdminSearchResultRows,
Queues => 50,
Groups => 50,
Users => 50,
CustomFields => 50,
Scrips => 50,
Templates => 50,
Classes => 50,
);
=back
......
......@@ -85,7 +85,7 @@
Order => 'ASC',
%ARGS,
Collection => $not_applied,
Rows => 50,
Rows => $rows,
Format => $format,
DisplayFormat => "'__CheckBox.{AddClass-". $Class->id ."}__',". $format,
AllowSorting => 1,
......@@ -143,6 +143,7 @@ $collection_class =~ s/^RT:://;
my $format = RT->Config->Get('AdminSearchResultFormat')->{$collection_class}
|| '__id__,__Name__';
my $rows = RT->Config->Get('AdminSearchResultRows')->{$collection_class} || 50;
my $title = loc('Modify associated objects for [_1]', $Class->Name);
......
......@@ -56,6 +56,7 @@
<& /Elements/CollectionList,
OrderBy => 'Name',
Order => 'ASC',
Rows => $Rows,
%ARGS,
Format => $Format,
Collection => $Classes,
......@@ -84,6 +85,7 @@ if ($FindDisabledClasses) {
}
$Format ||= RT->Config->Get('AdminSearchResultFormat')->{'Classes'};
my $Rows = RT->Config->Get('AdminSearchResultRows')->{'Classes'} || 50;
</%INIT>
<%ARGS>
......
......@@ -87,7 +87,7 @@
Order => 'ASC',
%ARGS,
Collection => $not_added,
Rows => 50,
Rows => $rows,
Format => $format,
DisplayFormat => "'__CheckBox.{AddCustomField-". $CF->id ."}__',". $format,
AllowSorting => 1,
......@@ -149,6 +149,7 @@ $collection_class =~ s/^RT:://;
my $format = RT->Config->Get('AdminSearchResultFormat')->{$collection_class}
|| '__id__,__Name__';
my $rows = RT->Config->Get('AdminSearchResultRows')->{$collection_class} || 50;
my $title = loc('Modify associated objects for [_1]', $CF->Name);
......
......@@ -72,7 +72,7 @@
<& /Elements/CollectionList,
OrderBy => 'LookupType|Name',
Order => 'ASC|ASC',
Rows => 50,
Rows => $Rows,
%ARGS,
Collection => $CustomFields,
Format => $Format,
......@@ -101,5 +101,6 @@ $CustomFields->LimitToLookupType( $Type ) if $Type;
$m->callback(CallbackName => 'MassageCustomFields', CustomFields => $CustomFields);
$Format ||= RT->Config->Get('AdminSearchResultFormat')->{'CustomFields'};
my $Rows = RT->Config->Get('AdminSearchResultRows')->{'CustomFields'} || 50;
</%INIT>
......@@ -74,7 +74,7 @@
Order => 'ASC',
%ARGS,
Collection => $not_added_cfs,
Rows => 50,
Rows => $rows,
Format => $format,
DisplayFormat => "'__CheckBox.{AddCustomField}__',". $format,
AllowSorting => 1,
......@@ -163,6 +163,7 @@ $not_added_cfs->LimitToLookupType($lookup);
$not_added_cfs->LimitToNotAdded( $id ? ($id, 0) : (0) );
my $format = RT->Config->Get('AdminSearchResultFormat')->{'CustomFields'};
my $rows = RT->Config->Get('AdminSearchResultRows')->{'CustomFields'} || 50;
my $display_format = $id
? ("'__RemoveCheckBox.{$id}__',". $format .", '__MoveCF.{$id}__'")
......
......@@ -75,7 +75,7 @@
<h2><&|/l&>Not applied scrips</&></h2>
% $scrips = $find_scrips->(Added => 0);
<& /Elements/CollectionList,
Rows => 50,
Rows => $Rows,
Page => 1,
%ARGS,
Collection => $scrips,
......@@ -121,6 +121,7 @@ my $find_scrips = sub {
};
$Format ||= RT->Config->Get('AdminSearchResultFormat')->{'Scrips'};
my $Rows = RT->Config->Get('AdminSearchResultRows')->{'Scrips'} || 50;
my $DisplayFormat = $Format;
if ( $id ) {
$DisplayFormat = "__RemoveCheckBox__, $DisplayFormat";
......
......@@ -58,6 +58,7 @@
<& /Elements/CollectionList,
OrderBy => 'id',
Order => 'ASC',
Rows => $Rows,
%ARGS,
DisplayFormat => '__CheckBox.{DeleteTemplates}__,'. $Format,
Format => $Format,
......@@ -74,6 +75,7 @@
<%INIT>
$Format ||= RT->Config->Get('AdminSearchResultFormat')->{'Templates'};
my $Rows = RT->Config->Get('AdminSearchResultRows')->{'Templates'} || 50;
my $QueueObj = RT::Queue->new( $session{'CurrentUser'} );
$QueueObj->Load( $id ) if $id;
......
......@@ -58,7 +58,7 @@
OrderBy => 'Name',
Order => 'ASC',
%ARGS,
Rows => 20,
Rows => $Rows,
DisplayFormat => "__CheckBox.{Delete}__,$Format",
Format => $Format,
Collection => $is_member,
......@@ -71,7 +71,7 @@
<& /Elements/CollectionList,
OrderBy => 'Name',
Order => 'ASC',
Rows => 20,
Rows => $Rows,
%ARGS,
DisplayFormat => "__CheckBox.{Add}__,'__HasMemberRecursively.{$id}__/TITLE:Recursive member',$Format",
Format => $Format,
......@@ -129,6 +129,7 @@ $is_not_member->WithoutMember( PrincipalId => $id );
$is_not_member->Limit( FIELD => 'id', OPERATOR => '!=', VALUE => $id );
$Format ||= RT->Config->Get('AdminSearchResultFormat')->{'Groups'};
my $Rows = RT->Config->Get('AdminSearchResultRows')->{'Groups'} || 50;
my $title;
if ( $principal->IsUser ) {
......
......@@ -79,7 +79,7 @@ jQuery(function(){
<& /Elements/CollectionList,
OrderBy => 'Name',
Order => 'ASC',
Rows => 100,
Rows => $Rows,
%ARGS,
Format => $Format,
Collection => $Groups,
......@@ -122,6 +122,7 @@ else {
}
$Format ||= RT->Config->Get('AdminSearchResultFormat')->{'Groups'};
my $Rows = RT->Config->Get('AdminSearchResultRows')->{'Groups'} || 50;
</%INIT>
<%ARGS>
......
......@@ -77,7 +77,7 @@
<& /Elements/CollectionList,
OrderBy => 'Name',
Order => 'ASC',
Rows => 50,
Rows => $Rows,
%ARGS,
Format => $Format,
Collection => $queues,
......@@ -113,6 +113,7 @@ if ( defined $QueueString && length $QueueString ) {
}
$Format ||= RT->Config->Get('AdminSearchResultFormat')->{'Queues'};
my $Rows = RT->Config->Get('AdminSearchResultRows')->{'Queues'} || 50;
</%INIT>
<%ARGS>
......
......@@ -95,7 +95,7 @@
Order => 'ASC',
%ARGS,
Collection => $not_added,
Rows => 50,
Rows => $rows,
Format => $format,
DisplayFormat => "'__CheckBox.{AddScrip-". $id ."}__',". $format,
AllowSorting => 1,
......@@ -165,6 +165,7 @@ my $added = $scrip->AddedTo;
my $not_added = $scrip->NotAddedTo;
my $format = RT->Config->Get('AdminSearchResultFormat')->{'Queues'};
my $rows = RT->Config->Get('AdminSearchResultRows')->{'Queues'} || 50;
my $title = loc('Modify associated objects for scrip #[_1]', $id);
......
......@@ -51,7 +51,7 @@
<& /Elements/CollectionList,
OrderBy => 'Description',
Order => 'ASC',
Rows => 50,
Rows => $Rows,
%ARGS,
Collection => $scrips,
Format => $Format,
......@@ -68,4 +68,5 @@ $scrips->UnLimit;
$m->callback(CallbackName => 'Massage', Scrips => $scrips);
$Format ||= RT->Config->Get('AdminSearchResultFormat')->{'Scrips'};
my $Rows = RT->Config->Get('AdminSearchResultRows')->{'Scrips'} || 50;
</%INIT>
......@@ -89,7 +89,7 @@ jQuery(function(){
<& /Elements/CollectionList,
OrderBy => 'Name',
Order => 'ASC',
Rows => 100,
Rows => $Rows,
%ARGS,
Format => $Format,
Collection => $users,
......@@ -129,6 +129,7 @@ else {
}
$Format ||= RT->Config->Get('AdminSearchResultFormat')->{'Users'};
my $Rows = RT->Config->Get('AdminSearchResultRows')->{'Users'} || 50;
# Build up the list of fields to display for searching
my $i = 0;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment