[Rt-commit] rt branch, 4.4/disable-parent-worked-scrip, created. rt-4.4.1-319-g1219854

Dave Goehrig dave at bestpractical.com
Wed Mar 8 13:58:21 EST 2017


The branch, 4.4/disable-parent-worked-scrip has been created
        at  121985407688da54fc6aa576100ed46b3cc4fcdf (commit)

- Log -----------------------------------------------------------------
commit 121985407688da54fc6aa576100ed46b3cc4fcdf
Author: Dave Goehrig <dave at bestpractical.com>
Date:   Mon Mar 6 15:02:03 2017 -0500

    Disable update parent time worked
    
    This patches the initialdata and the upgrade to disable
    the scrip which updates parent tickets time worked by
    default.  This change allows the new total time worked
    feature to be used to roll up the time worked.
    
    The documentation was added to discuss how to renable
    this feature if you don't want to use the new feature.

diff --git a/etc/initialdata b/etc/initialdata
index e81f82d..e2f8f22 100644
--- a/etc/initialdata
+++ b/etc/initialdata
@@ -841,7 +841,8 @@ Hour:         { $SubscriptionObj->SubValue('Hour') }
     {  Description    => 'On TimeWorked Change Update Parent TimeWorked',
        ScripCondition => 'On TimeWorked Change',
        ScripAction    => 'Update Parent TimeWorked',
-       Template       => 'Blank' },
+       Template       => 'Blank',
+       Disabled => 1 },
     {  Description    => 'On TimeWorked Change Update User TimeWorked',
        ScripCondition => 'On TimeWorked Change',
        ScripAction    => 'Update User TimeWorked',
diff --git a/etc/upgrade/4.4.2/content b/etc/upgrade/4.4.2/content
index fbf5fb5..ec3a549 100644
--- a/etc/upgrade/4.4.2/content
+++ b/etc/upgrade/4.4.2/content
@@ -56,5 +56,12 @@ our @Initial = (
             );
         }
     },
+
+    # disable the 'On TimeWorked Change Update Parent TimeWorked' scrip so that 'Total Time Worked' works
+    sub {
+        my $scrip = RT::Scrip->new(RT->SystemUser);
+        $scrip->LoadByCols(Description => 'On TimeWorked Change Update Parent TimeWorked');
+        $scrip->SetDisabled(1);
+    }, 
 );
 
diff --git a/lib/RT/Action/UpdateParentTimeWorked.pm b/lib/RT/Action/UpdateParentTimeWorked.pm
index 29d4c8f..7ee261d 100644
--- a/lib/RT/Action/UpdateParentTimeWorked.pm
+++ b/lib/RT/Action/UpdateParentTimeWorked.pm
@@ -65,6 +65,18 @@ When it fires it finds a ticket's parent tickets and increments the time on
 those tickets along with the built in behavior of incrementing the TimeWorked
 on the current ticket.
 
+With the addition of the 'Total Time Worked' setting, the associated Scrip
+is now installed 'Disabled' by default.  To enable this feature, under
+
+    Admin >> Scrips >> Select
+
+check the "Include disabled scrips in listing" checkbox and press Go.
+Then click on the "On TimeWorked Change Update Parent TimeWorked" link, and
+check the "Enabled" checkbox, saving changes.  This will renable the old
+behavior.  Please note, that if you want to use the 'Total Time Worked'
+setting all tickets created with this Scrip enabled will display the wrong
+totals.
+
 =cut
 
 sub Prepare {

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


More information about the rt-commit mailing list