[Bps-public-commit] rt-extension-timetracking-automatic branch, master, updated. 9d4dd7045fa443deec713797334f99a3f4109057

Dave Goehrig dave at bestpractical.com
Wed Sep 14 11:32:00 EDT 2016


The branch, master has been updated
       via  9d4dd7045fa443deec713797334f99a3f4109057 (commit)
      from  23200e39a10663fbd7feee01cad1610970aee53a (commit)

Summary of changes:
 README                                                             | 7 +++++--
 .../Ticket/Update.html/BeforeDisplay                               | 3 ++-
 lib/RT/Extension/TimeTracking/Automatic.pm                         | 7 +++++++
 3 files changed, 14 insertions(+), 3 deletions(-)

- Log -----------------------------------------------------------------
commit 9d4dd7045fa443deec713797334f99a3f4109057
Author: Dave Goehrig <dave at bestpractical.com>
Date:   Wed Sep 14 11:31:56 2016 -0400

    Add default time adjustment

diff --git a/README b/README
index 5aa385d..9fe4775 100644
--- a/README
+++ b/README
@@ -19,14 +19,17 @@ INSTALLATION
     Clear the mason cache
         To clear your cache run the following command:
 
-            rm -rf /opt/rt4/var/mason_data/obj
+            rm -rf /opt/rt4/var/mason_data/obj/*
 
     Restart the webserver
         Restart the websever to have the extension take affect.
 
 DESCRIPTION
     RT::Extension::TimeTracking::Automatic automatically tracks the time
-    taken
+    taken commenting on or replying to a ticket. The time spent editing the
+    ticket will update the TimeWorked on the Ticket itself, and create a
+    transaction logging how long the user took to comment on or reply to the
+    ticket.
 
 AUTHOR
     Best Practical Solutions, LLC <modules at bestpractical.com>
diff --git a/html/Callbacks/RT-Extension-TimeTracking-Automatic/Ticket/Update.html/BeforeDisplay b/html/Callbacks/RT-Extension-TimeTracking-Automatic/Ticket/Update.html/BeforeDisplay
index 5007fc4..a80ef2e 100644
--- a/html/Callbacks/RT-Extension-TimeTracking-Automatic/Ticket/Update.html/BeforeDisplay
+++ b/html/Callbacks/RT-Extension-TimeTracking-Automatic/Ticket/Update.html/BeforeDisplay
@@ -3,6 +3,7 @@ $Ticket
 $ARGSRef
 </%args>
 <%init>
-my $worked = POSIX::ceil((time - $$ARGSRef{TimeTrackingAutomatic})/60);	# at least 1 minute
+my $adjustment = RT->Config->Get("TimeTrackingAdjustment") || 0;
+my $worked = POSIX::ceil((time - $$ARGSRef{TimeTrackingAutomatic})/60) + $adjustment;	# at least 1 minute
 $Ticket->SetTimeWorked( $worked + $Ticket->TimeWorked );
 </%init>
diff --git a/lib/RT/Extension/TimeTracking/Automatic.pm b/lib/RT/Extension/TimeTracking/Automatic.pm
index 9f006d3..b9c50a4 100644
--- a/lib/RT/Extension/TimeTracking/Automatic.pm
+++ b/lib/RT/Extension/TimeTracking/Automatic.pm
@@ -32,6 +32,13 @@ To enable the extension add the following line to the F<RT_SiteConfig.pm> file:
 
     Plugin('RT::Extension::TimeTracking::Automatic');
 
+If you would like to set a default amount of time to account for basic overhead
+you can set a config value to the number of minutes to add by default:
+
+    Set($TimeTrackingAdjustment, 10);	# automatically add 10 minutes to each update
+
+This setting is optional and will default to 0 additional minutes.
+
 =item Clear the mason cache
 
 To clear your cache run the following command:

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


More information about the Bps-public-commit mailing list