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

Dave Goehrig dave at bestpractical.com
Wed Sep 14 16:30:09 EDT 2016


The branch, master has been updated
       via  d05c042888b621231d0d9024bb77388c03dc242d (commit)
      from  7edf5d23d124ff933ae32dcc6ec6d70a604ed158 (commit)

Summary of changes:
 README                                                 | 18 ++++++++++++++++++
 .../Reply/index.html/AfterHidden}                      |  0
 .../Reply/index.html}/BeforeDisplay                    |  0
 patches/patch-rtir-3.2.patch                           | 13 +++++++++++++
 4 files changed, 31 insertions(+)
 copy html/Callbacks/RT-Extension-TimeTracking-Automatic/RTIR/{Update.html/AfterWorked => Incident/Reply/index.html/AfterHidden} (100%)
 copy html/Callbacks/RT-Extension-TimeTracking-Automatic/RTIR/{Update.html => Incident/Reply/index.html}/BeforeDisplay (100%)

- Log -----------------------------------------------------------------
commit d05c042888b621231d0d9024bb77388c03dc242d
Author: Dave Goehrig <dave at bestpractical.com>
Date:   Wed Sep 14 16:29:37 2016 -0400

    add incident reply time tracking

diff --git a/README b/README
index 9fe4775..f0fda29 100644
--- a/README
+++ b/README
@@ -16,6 +16,24 @@ INSTALLATION
 
             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.
+
+    Patching RTIR
+        If you are using RTIR-3.2 it is necessary to patch RTIR/Update.html
+        to enable automatic time tracking:
+
+                patch -d /path/to/rtir -p1 < patches/patch-rtir-3.2.patch
+                cd /path/to/rtir && make install
+
+        This will simply add a callback to the update ticket page, and is
+        safe to leave should you disable automatic time tracking.
+
     Clear the mason cache
         To clear your cache run the following command:
 
diff --git a/html/Callbacks/RT-Extension-TimeTracking-Automatic/RTIR/Incident/Reply/index.html/AfterHidden b/html/Callbacks/RT-Extension-TimeTracking-Automatic/RTIR/Incident/Reply/index.html/AfterHidden
new file mode 100644
index 0000000..bfc7108
--- /dev/null
+++ b/html/Callbacks/RT-Extension-TimeTracking-Automatic/RTIR/Incident/Reply/index.html/AfterHidden
@@ -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/Incident/Reply/index.html/BeforeDisplay b/html/Callbacks/RT-Extension-TimeTracking-Automatic/RTIR/Incident/Reply/index.html/BeforeDisplay
new file mode 100644
index 0000000..a80ef2e
--- /dev/null
+++ b/html/Callbacks/RT-Extension-TimeTracking-Automatic/RTIR/Incident/Reply/index.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>
diff --git a/patches/patch-rtir-3.2.patch b/patches/patch-rtir-3.2.patch
index 570ba3a..ea09ef8 100644
--- a/patches/patch-rtir-3.2.patch
+++ b/patches/patch-rtir-3.2.patch
@@ -11,3 +11,16 @@ index 4847cef..05736d9 100644
  <& /Ticket/Elements/EditTransactionCustomFields,
      %ARGS, TicketObj => $Ticket, InTable => 1,
  &>
+diff --git a/html/RTIR/Incident/Reply/index.html b/html/RTIR/Incident/Reply/index.html
+index cec521e..a69ec45 100644
+--- a/html/RTIR/Incident/Reply/index.html
++++ b/html/RTIR/Incident/Reply/index.html
+@@ -64,6 +64,8 @@
+ <input type="hidden" name="All" value="<% $All %>" />
+ <input type="hidden" name="Query" value="<% $Query %>" />
+ 
++% $m->callback(CallbackName => 'AfterHidden', Ticket => $IncidentObj );
++
+ <& /Elements/Crypt/SignEncryptWidget:ShowIssues, self => $gnupg_widget &>
+ 
+ <h2><&|/l&>Reporters</&></h2>

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


More information about the Bps-public-commit mailing list