[Bps-public-commit] rt-extension-timetracking-automatic branch, master, updated. 5414a8fd8249090fb326c4a45c38a6e825c6471b

Dave Goehrig dave at bestpractical.com
Wed Sep 14 11:58:39 EDT 2016


The branch, master has been updated
       via  5414a8fd8249090fb326c4a45c38a6e825c6471b (commit)
      from  9d4dd7045fa443deec713797334f99a3f4109057 (commit)

Summary of changes:
 .../{Ticket => RTIR}/Update.html/AfterWorked                              | 0
 .../{Ticket => RTIR}/Update.html/BeforeDisplay                            | 0
 2 files changed, 0 insertions(+), 0 deletions(-)
 copy html/Callbacks/RT-Extension-TimeTracking-Automatic/{Ticket => RTIR}/Update.html/AfterWorked (100%)
 copy html/Callbacks/RT-Extension-TimeTracking-Automatic/{Ticket => RTIR}/Update.html/BeforeDisplay (100%)

- Log -----------------------------------------------------------------
commit 5414a8fd8249090fb326c4a45c38a6e825c6471b
Author: Dave Goehrig <dave at bestpractical.com>
Date:   Wed Sep 14 11:58:33 2016 -0400

    adding RTIR related callbacks

diff --git a/html/Callbacks/RT-Extension-TimeTracking-Automatic/RTIR/Update.html/AfterWorked b/html/Callbacks/RT-Extension-TimeTracking-Automatic/RTIR/Update.html/AfterWorked
new file mode 100644
index 0000000..bfc7108
--- /dev/null
+++ b/html/Callbacks/RT-Extension-TimeTracking-Automatic/RTIR/Update.html/AfterWorked
@@ -0,0 +1,7 @@
+<%args>
+$Ticket
+</%args>
+<%init>
+my $time = time;
+</%init>
+<input type="hidden" class="hidden" name="TimeTrackingAutomatic" value="<% time %>" /> <!-- time that this update was started -->
diff --git a/html/Callbacks/RT-Extension-TimeTracking-Automatic/RTIR/Update.html/BeforeDisplay b/html/Callbacks/RT-Extension-TimeTracking-Automatic/RTIR/Update.html/BeforeDisplay
new file mode 100644
index 0000000..a80ef2e
--- /dev/null
+++ b/html/Callbacks/RT-Extension-TimeTracking-Automatic/RTIR/Update.html/BeforeDisplay
@@ -0,0 +1,9 @@
+<%args>
+$Ticket
+$ARGSRef
+</%args>
+<%init>
+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>

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


More information about the Bps-public-commit mailing list