[Rt-commit] rt branch, 4.4/asset-custom-roles, updated. rt-4.4.1-10-g03ded03

Jim Brandt jbrandt at bestpractical.com
Wed May 3 14:17:40 EDT 2017


The branch, 4.4/asset-custom-roles has been updated
       via  03ded030430f6269e0d9250b33427a07ea93a9d1 (commit)
      from  bb684f6f65251d78b4a46984507e5307142330fa (commit)

Summary of changes:
 share/html/Admin/CustomRoles/index.html      |  7 +++++--
 share/html/Elements/RT__CustomRole/ColumnMap | 11 ++++++++++-
 2 files changed, 15 insertions(+), 3 deletions(-)

- Log -----------------------------------------------------------------
commit 03ded030430f6269e0d9250b33427a07ea93a9d1
Author: Jim Brandt <jbrandt at bestpractical.com>
Date:   Wed May 3 14:05:01 2017 -0400

    Add lookup type to custom role admin page listing

diff --git a/share/html/Admin/CustomRoles/index.html b/share/html/Admin/CustomRoles/index.html
index c6fe18a..19cb165 100644
--- a/share/html/Admin/CustomRoles/index.html
+++ b/share/html/Admin/CustomRoles/index.html
@@ -75,11 +75,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(
@@ -94,6 +95,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(
@@ -112,6 +114,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 262bd15..ba06cdf 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 => {

-----------------------------------------------------------------------


More information about the rt-commit mailing list