[Rt-commit] rt branch, 4.4/improve-add-custom-role-message, created. rt-4.4.2-38-g6a62dba
Maureen Mirville
maureen at bestpractical.com
Fri Sep 29 11:35:38 EDT 2017
The branch, 4.4/improve-add-custom-role-message has been created
at 6a62dba26b9a75ffb45eeb3c1f9d4aeee59c0bec (commit)
- Log -----------------------------------------------------------------
commit 6a62dba26b9a75ffb45eeb3c1f9d4aeee59c0bec
Author: Maureen E. Mirville <maureen at bestpractical.com>
Date: Wed Aug 30 10:46:17 2017 -0400
Improve message when adding/removing custom roles from queues
When user is adding or removing a custom role from a queue, previous
message after making a change, "Object created" or "Object deleted"
was unclear. Message updated to make it clear user added a role or
removed a role from a queue.
Fixes: I#32695
diff --git a/lib/RT/CustomRole.pm b/lib/RT/CustomRole.pm
index 2bab313..745bd66 100644
--- a/lib/RT/CustomRole.pm
+++ b/lib/RT/CustomRole.pm
@@ -411,7 +411,11 @@ sub AddToObject {
unless $queue->CurrentUserHasRight('AdminCustomRoles');
my $rec = RT::ObjectCustomRole->new( $self->CurrentUser );
- return $rec->Add( %args, CustomRole => $self );
+ my ( $status, $add ) = $rec->Add( %args, CustomRole => $self );
+ my $msg;
+ $msg = $self->loc("[_1] added to queue [_2]", $self->Name, $queue->Name) if $status;
+
+ return ( $add, $msg );
}
=head2 RemoveFromObject
@@ -444,11 +448,14 @@ sub RemoveFromObject {
return ( 0, $self->loc('Permission Denied') )
unless $queue->CurrentUserHasRight('AdminCustomRoles');
-
my $rec = RT::ObjectCustomRole->new( $self->CurrentUser );
$rec->LoadByCols( CustomRole => $self->id, ObjectId => $args{'ObjectId'} );
return (0, $self->loc('Custom role is not added') ) unless $rec->id;
- return $rec->Delete;
+ my ( $status, $delete ) = $rec->Delete;
+ my $msg;
+ $msg = $self->loc("[_1] removed from queue [_2]", $self->Name, $queue->Name) if $status;
+
+ return ( $delete, $msg );
}
=head2 SingleValue
-----------------------------------------------------------------------
More information about the rt-commit
mailing list