Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/bestpractical/rt.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJim Brandt <jbrandt@bestpractical.com>2017-05-03 21:05:01 +0300
committersunnavy <sunnavy@bestpractical.com>2022-10-19 00:25:59 +0300
commitc8911b2fae995e46bef76b02236c820209ef0e2d (patch)
tree5ef6f505ff46dc791561898dffbf9bb09268d81a
parent4598f1a1041c3f2ecb60c2eea6c3a8682665f37d (diff)
Add lookup type to custom role admin page listing
-rw-r--r--share/html/Admin/CustomRoles/index.html7
-rw-r--r--share/html/Elements/RT__CustomRole/ColumnMap11
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 @@
<em><&|/l&>No custom roles matching search criteria found.</&></em>
% } 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;
</%INIT>
<%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 => {