[Rt-commit] rt branch, 4.4-trunk, updated. rt-4.4.4-468-g05e042f285

Jim Brandt jbrandt at bestpractical.com
Thu May 27 11:57:26 EDT 2021


The branch, 4.4-trunk has been updated
       via  05e042f2853e0aec4b185858816c9da39f5bb547 (commit)
       via  26c2125b8e53ebe58c662c0bcd928a44ce7e9d21 (commit)
       via  6f4651be57584065f36c9cb44f4f6665fa9b01da (commit)
       via  8b87cf76d4827dd9e069ab0206e30465dbc35c44 (commit)
      from  bede0d94a08ce08897d39ef362279be99e5cb392 (commit)

Summary of changes:
 lib/RT/CustomRoles.pm                              |  23 +++
 lib/RT/Record/Role/Roles.pm                        |   9 ++
 share/html/Admin/Elements/EditCustomRoles          | 170 +++++++++++++++++++++
 .../Topics.html => Queues/CustomRoles.html}        |  11 +-
 share/html/Elements/RT__CustomRole/ColumnMap       |  52 +++++++
 share/html/Elements/Tabs                           |   1 +
 t/customroles/sort_order.t                         |  69 +++++++++
 7 files changed, 328 insertions(+), 7 deletions(-)
 create mode 100644 share/html/Admin/Elements/EditCustomRoles
 copy share/html/Admin/{Global/Topics.html => Queues/CustomRoles.html} (88%)
 create mode 100644 t/customroles/sort_order.t

- Log -----------------------------------------------------------------
commit 05e042f2853e0aec4b185858816c9da39f5bb547
Merge: bede0d94a0 26c2125b8e
Author: Jim Brandt <jbrandt at bestpractical.com>
Date:   Thu May 27 11:49:00 2021 -0400

    Merge branch '4.4/custom-role-sort-order' into 4.4-trunk

diff --cc lib/RT/Record/Role/Roles.pm
index 4d4723a66a,da8dc508a3..e913a9a0e4
--- a/lib/RT/Record/Role/Roles.pm
+++ b/lib/RT/Record/Role/Roles.pm
@@@ -279,12 -279,18 +279,21 @@@ sub Roles 
      my $self = shift;
      my %attr = @_;
  
 -    return   map { $_->[0] }
 +    my $key  = join ',', @_;
 +    return @{ $self->{_Roles}{$key} } if ref($self) && $self->{_Roles}{$key};
 +
 +    my @roles =  map { $_->[0] }
              sort {   $a->[1]{SortOrder} <=> $b->[1]{SortOrder}
                    or $a->[0] cmp $b->[0] }
+             map {
+                 if ( ref $self && $self->Id && $_->[0] =~ /^RT::CustomRole-(\d+)/ ) {
+                     my $id  = $1;
+                     my $ocr = RT::ObjectCustomRole->new( $self->CurrentUser );
+                     $ocr->LoadByCols( ObjectId => $self->Id, CustomRole => $id );
+                     $_->[1]{SortOrder} = $ocr->SortOrder if $ocr->Id;
+                 }
+                 $_;
+             }
              grep {
                  my $ok = 1;
                  for my $k (keys %attr) {

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


More information about the rt-commit mailing list