[Bps-public-commit] rt-extension-timetracking-automatic branch, track-creation-time, updated. d2ca73553e4220396403e3c3986acffc47f38d80
Dave Goehrig
dave at bestpractical.com
Tue Oct 4 19:34:04 EDT 2016
The branch, track-creation-time has been updated
via d2ca73553e4220396403e3c3986acffc47f38d80 (commit)
from 4431749003cb567bb860948016f0e8a6b572f82a (commit)
Summary of changes:
.../FormStart => RTIR/Create.html/AfterRequestors} | 0
.../RTIR/Create.html/BeforeDisplay | 10 ++++++++++
.../Initial => RTIR/Display.html/BeforeActionList} | 12 ++++++++----
.../AfterWorked => RTIR/Incident/Create.html/AfterHidden} | 9 ++++-----
.../Initial => RTIR/Incident/Create.html/ProcessArguments} | 0
5 files changed, 22 insertions(+), 9 deletions(-)
copy html/Callbacks/RT-Extension-TimeTracking-Automatic/{Ticket/Create.html/FormStart => RTIR/Create.html/AfterRequestors} (100%)
create mode 100644 html/Callbacks/RT-Extension-TimeTracking-Automatic/RTIR/Create.html/BeforeDisplay
copy html/Callbacks/RT-Extension-TimeTracking-Automatic/{Ticket/Display.html/Initial => RTIR/Display.html/BeforeActionList} (78%)
copy html/Callbacks/RT-Extension-TimeTracking-Automatic/{Ticket/Update.html/AfterWorked => RTIR/Incident/Create.html/AfterHidden} (75%)
copy html/Callbacks/RT-Extension-TimeTracking-Automatic/{Ticket/Display.html/Initial => RTIR/Incident/Create.html/ProcessArguments} (100%)
- Log -----------------------------------------------------------------
commit d2ca73553e4220396403e3c3986acffc47f38d80
Author: Dave Goehrig <dave at bestpractical.com>
Date: Tue Oct 4 19:33:50 2016 -0400
Add rtir support for creation time worked
diff --git a/html/Callbacks/RT-Extension-TimeTracking-Automatic/RTIR/Create.html/AfterRequestors b/html/Callbacks/RT-Extension-TimeTracking-Automatic/RTIR/Create.html/AfterRequestors
new file mode 100644
index 0000000..2037130
--- /dev/null
+++ b/html/Callbacks/RT-Extension-TimeTracking-Automatic/RTIR/Create.html/AfterRequestors
@@ -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/RTIR/Create.html/BeforeDisplay b/html/Callbacks/RT-Extension-TimeTracking-Automatic/RTIR/Create.html/BeforeDisplay
new file mode 100644
index 0000000..02d8d9a
--- /dev/null
+++ b/html/Callbacks/RT-Extension-TimeTracking-Automatic/RTIR/Create.html/BeforeDisplay
@@ -0,0 +1,10 @@
+<%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
+$$ARGSRef{'TimeWorked'} = $worked;
+</%init>
+
diff --git a/html/Callbacks/RT-Extension-TimeTracking-Automatic/RTIR/Display.html/BeforeActionList b/html/Callbacks/RT-Extension-TimeTracking-Automatic/RTIR/Display.html/BeforeActionList
new file mode 100644
index 0000000..ba117bd
--- /dev/null
+++ b/html/Callbacks/RT-Extension-TimeTracking-Automatic/RTIR/Display.html/BeforeActionList
@@ -0,0 +1,18 @@
+<%ARGS>
+$Ticket
+$ARGSRef
+$Actions
+</%ARGS>
+<%INIT>
+RT->Logger->debug("time tracking automatic " . $$ARGSRef{'TimeTrackingAutomatic'});
+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/RTIR/Incident/Create.html/AfterHidden b/html/Callbacks/RT-Extension-TimeTracking-Automatic/RTIR/Incident/Create.html/AfterHidden
new file mode 100644
index 0000000..4f99185
--- /dev/null
+++ b/html/Callbacks/RT-Extension-TimeTracking-Automatic/RTIR/Incident/Create.html/AfterHidden
@@ -0,0 +1,5 @@
+<%ARGS>
+</%ARGS>
+<%INIT>
+</%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/Create.html/ProcessArguments b/html/Callbacks/RT-Extension-TimeTracking-Automatic/RTIR/Incident/Create.html/ProcessArguments
new file mode 100644
index 0000000..95a48ef
--- /dev/null
+++ b/html/Callbacks/RT-Extension-TimeTracking-Automatic/RTIR/Incident/Create.html/ProcessArguments
@@ -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>
-----------------------------------------------------------------------
More information about the Bps-public-commit
mailing list