From c8911b2fae995e46bef76b02236c820209ef0e2d Mon Sep 17 00:00:00 2001 From: Jim Brandt Date: Wed, 3 May 2017 14:05:01 -0400 Subject: Add lookup type to custom role admin page listing --- share/html/Admin/CustomRoles/index.html | 7 +++++-- share/html/Elements/RT__CustomRole/ColumnMap | 11 ++++++++++- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/share/html/Admin/CustomRoles/index.html b/share/html/Admin/CustomRoles/index.html index c366cfbab7..f308d6b4af 100644 --- a/share/html/Admin/CustomRoles/index.html +++ b/share/html/Admin/CustomRoles/index.html @@ -92,11 +92,12 @@ <&|/l&>No custom roles matching search criteria found. % } else { <& /Elements/CollectionList, - OrderBy => 'Name', - Order => 'ASC', + OrderBy => 'LookupType|Name', + Order => 'ASC|ASC', Rows => $Rows, %ARGS, Format => $Format, + DisplayFormat => ($Type? '' : '__FriendlyLookupType__,'). $Format, Collection => $roles, AllowSorting => 1, PassArguments => [qw( @@ -110,6 +111,7 @@ my $title = loc("Select a Custom Role"); my $roles = RT::CustomRoles->new($session{'CurrentUser'}); $roles->FindAllRows if $FindDisabled; +$roles->LimitToLookupType( $Type ) if $Type; if ( defined $SearchString && length $SearchString ) { $roles->Limit( @@ -128,6 +130,7 @@ my $Rows = RT->Config->Get('AdminSearchResultRows')->{'CustomRoles'} || 50; <%ARGS> +$Type => '' $FindDisabled => 0 $Format => undef diff --git a/share/html/Elements/RT__CustomRole/ColumnMap b/share/html/Elements/RT__CustomRole/ColumnMap index 758b24bd89..2c2f7ba6e2 100644 --- a/share/html/Elements/RT__CustomRole/ColumnMap +++ b/share/html/Elements/RT__CustomRole/ColumnMap @@ -63,7 +63,16 @@ my $COLUMN_MAP = { title => $c, attribute => $c, value => sub { return $_[0]->$c() }, } } - qw(Name Description EntryHint) + qw(Name Description LookupType EntryHint) + ), + + map( + { my $c = $_; my $short = $c; $short =~ s/^Friendly//; + $c => { + title => $short, attribute => $short, + value => sub { return $_[0]->$c() }, + } } + qw(FriendlyLookupType FriendlyType FriendlyPattern) ), MaxValues => { -- cgit v1.2.3