[Rt-commit] rt branch, 4.4/stop-new-scripts-being-applied, created. rt-4.4.1-104-g3119fda

Dave Goehrig dave at bestpractical.com
Thu Aug 18 16:15:15 EDT 2016


The branch, 4.4/stop-new-scripts-being-applied has been created
        at  3119fda96578700f69ec829f1e0ebec3f7d50f46 (commit)

- Log -----------------------------------------------------------------
commit 3119fda96578700f69ec829f1e0ebec3f7d50f46
Author: Dave Goehrig <dave at bestpractical.com>
Date:   Thu Aug 18 16:14:45 2016 -0400

    Stop new scripts from being applied globally
    
    Change global scripts to not create ObjectScrip mapping.
    Remove checkbox to prevent create Scrip Disabled.
    
    Fixes: I#29129

diff --git a/lib/RT/Scrip.pm b/lib/RT/Scrip.pm
index 48547cc..11bc3bc 100644
--- a/lib/RT/Scrip.pm
+++ b/lib/RT/Scrip.pm
@@ -199,12 +199,16 @@ sub Create {
     );
     return ( $id, $msg ) unless $id;
 
-    (my $status, $msg) = RT::ObjectScrip->new( $self->CurrentUser )->Add(
-        Scrip    => $self,
-        Stage    => $args{'Stage'},
-        ObjectId => $args{'Queue'},
-    );
-    $RT::Logger->error( "Couldn't add scrip: $msg" ) unless $status;
+    # this prevents new scrips from being applied globally by default
+    # but scrips associated with a queue are automatically applied
+    if ($args{'Queue'}) {
+        (my $status, $msg) = RT::ObjectScrip->new( $self->CurrentUser )->Add(
+            Scrip    => $self,
+            Stage    => $args{'Stage'},
+            ObjectId => $args{'Queue'},
+        );
+        $RT::Logger->error( "Couldn't add scrip: $msg" ) unless $status;
+    }
 
     return ( $id, $self->loc('Scrip Created') );
 }
diff --git a/share/html/Admin/Scrips/Create.html b/share/html/Admin/Scrips/Create.html
index 7cc3406..cadf5e1 100644
--- a/share/html/Admin/Scrips/Create.html
+++ b/share/html/Admin/Scrips/Create.html
@@ -61,12 +61,6 @@
 <tr><td class="label"><&|/l&>Stage</&>:</td><td class="value">\
 <& /Admin/Elements/SelectStage, Default => $ARGS{"Stage"} &></td></tr>
 
-<tr><td class="label"> </td><td>
-<input type="hidden" class="hidden" name="SetEnabled" value="1" />
-<input type="checkbox" class="checkbox" name="Enabled" value="1" <% $ARGS{'Enabled'}? 'checked="checked"': '' |n%> />
-<label for="Enabled"><&|/l&>Enabled (Unchecking this box disables this scrip)</&></label>
-</td></tr>
-
 </table>
 </&>
 

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


More information about the rt-commit mailing list