[Bps-public-commit] rt-extension-timetracking-automatic branch, track-creation-time, created. 4431749003cb567bb860948016f0e8a6b572f82a
Dave Goehrig
dave at bestpractical.com
Mon Oct 3 14:18:58 EDT 2016
The branch, track-creation-time has been created
at 4431749003cb567bb860948016f0e8a6b572f82a (commit)
- Log -----------------------------------------------------------------
commit 4431749003cb567bb860948016f0e8a6b572f82a
Author: Dave Goehrig <dave at bestpractical.com>
Date: Mon Oct 3 14:17:59 2016 -0400
track creation time for tickets
diff --git a/html/Callbacks/RT-Extension-TimeTracking-Automatic/Ticket/Create.html/FormStart b/html/Callbacks/RT-Extension-TimeTracking-Automatic/Ticket/Create.html/FormStart
new file mode 100644
index 0000000..2037130
--- /dev/null
+++ b/html/Callbacks/RT-Extension-TimeTracking-Automatic/Ticket/Create.html/FormStart
@@ -0,0 +1,5 @@
+<%ARGS>
+</%ARGS>
+<%INIT>
+</%INIT>
+<input type="hidden" class="hidden" name="TimeTrackingAutomatic" value="<% time %>" /> <!-- time that we start creating this ticket -->
diff --git a/html/Callbacks/RT-Extension-TimeTracking-Automatic/Ticket/Display.html/Initial b/html/Callbacks/RT-Extension-TimeTracking-Automatic/Ticket/Display.html/Initial
new file mode 100644
index 0000000..95a48ef
--- /dev/null
+++ b/html/Callbacks/RT-Extension-TimeTracking-Automatic/Ticket/Display.html/Initial
@@ -0,0 +1,14 @@
+<%args>
+$ARGSRef
+</%args>
+<%init>
+if ($$ARGSRef{'TimeTrackingAutomatic'} && $$ARGSRef{id} eq 'new') {
+ use Data::Dumper;
+ RT->Logger->debug(Dumper($ARGSRef));
+ my $adjustment = RT->Config->Get("TimeTrackingAdjustment") || 0;
+ my $worked = POSIX::ceil((time - $$ARGSRef{'TimeTrackingAutomatic'})/60) + $adjustment; # at least 1 minute
+ $$ARGSRef{'TimeWorked'} = $worked;
+ RT->Logger->debug("time tracking automatic " . $$ARGSRef{'TimeTrackingAutomatic'});
+ RT->Logger->debug("time worked " . $$ARGSRef{'TimeWorked'});
+}
+</%init>
diff --git a/html/Callbacks/RT-Extension-TimeTracking-Automatic/Ticket/Update.html/AfterWorked b/html/Callbacks/RT-Extension-TimeTracking-Automatic/Ticket/Update.html/AfterWorked
index bfc7108..27e070e 100644
--- a/html/Callbacks/RT-Extension-TimeTracking-Automatic/Ticket/Update.html/AfterWorked
+++ b/html/Callbacks/RT-Extension-TimeTracking-Automatic/Ticket/Update.html/AfterWorked
@@ -2,6 +2,5 @@
$Ticket
</%args>
<%init>
-my $time = time;
</%init>
<input type="hidden" class="hidden" name="TimeTrackingAutomatic" value="<% time %>" /> <!-- time that this update was started -->
-----------------------------------------------------------------------
More information about the Bps-public-commit
mailing list