[Rt-commit] rt branch, rt4.4/untake-action, created. rt-4.4.1rc2-1-g12a56ac

Craig Kaiser craig at bestpractical.com
Thu Nov 30 16:24:58 EST 2017


The branch, rt4.4/untake-action has been created
        at  12a56ac6ae78c1d920b465dd2ae0f99359549de7 (commit)

- Log -----------------------------------------------------------------
commit 12a56ac6ae78c1d920b465dd2ae0f99359549de7
Author: Craig Kaiser <craig at bestpractical.com>
Date:   Thu Nov 30 16:19:23 2017 -0500

    Add Untake action to actions tab on Ticket

diff --git a/share/html/Elements/Tabs b/share/html/Elements/Tabs
index 866e8f2..8696e11 100644
--- a/share/html/Elements/Tabs
+++ b/share/html/Elements/Tabs
@@ -777,7 +777,7 @@ my $build_main_nav = sub {
                     my $key = $info->{'label'} || ucfirst($next);
                     $actions->child( $key => title => loc( $key ), path => $url);
                 }
-
+                my ($can_untake, $umsg) = $obj->CurrentUserCanSetOwner( );
                 my ($can_take, $tmsg) = $obj->CurrentUserCanSetOwner( Type => 'Take' );
                 my ($can_steal, $smsg) = $obj->CurrentUserCanSetOwner( Type => 'Steal' );
                 if ( $can_take ){
@@ -785,6 +785,9 @@ my $build_main_nav = sub {
                 }
                 elsif ( $can_steal ){
                     $actions->child( steal => title => loc('Steal'), path => "/Ticket/Display.html?Action=Steal;id=" . $id );
+                    my ($can_untake, $umsg) = $obj->CurrentUserCanSetOwner( );
+                }elsif ( $can_untake ){
+                       $actions->child( untake => title => loc('Untake'), path => "/Ticket/Display.html?Action=Untake;id=" . $id );
                 }
 
                 # TODO needs a "Can extract article into a class applied to this queue" check
diff --git a/share/html/Ticket/Display.html b/share/html/Ticket/Display.html
index 2ee8382..c22b24e 100644
--- a/share/html/Ticket/Display.html
+++ b/share/html/Ticket/Display.html
@@ -167,7 +167,7 @@ if ($ARGS{'id'} eq 'new') {
 
     if ( !$SkipProcessing ) {
         if ( defined $ARGS{'Action'} ) {
-            if ($ARGS{'Action'} =~ /^(Steal|Delete|Take|SetTold)$/) {
+            if ($ARGS{'Action'} =~ /^(Steal|Delete|Take||Untake|SetTold)$/) {
                 my $action = $1;
                 my ($res, $msg) = $TicketObj->$action();
                 push(@Actions, $msg);

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


More information about the rt-commit mailing list