[Rt-commit] rt branch, 4.4/master-time-on-children, created. rt-4.4.2-74-g5cdeb8f3a
Craig Kaiser
craig at bestpractical.com
Mon Feb 12 16:42:32 EST 2018
The branch, 4.4/master-time-on-children has been created
at 5cdeb8f3ad15623fa5b2eab571b5db41ccd3e537 (commit)
- Log -----------------------------------------------------------------
commit 5cdeb8f3ad15623fa5b2eab571b5db41ccd3e537
Author: Craig Kaiser <craig at bestpractical.com>
Date: Mon Feb 12 16:40:35 2018 -0500
Display time left from Consulting Master on children
Time remaining from the Master ticket copied over to child Ticket. Only
copy over when one parent is present.
diff --git a/local/html/Callbacks/Craig/Ticket/Elements/ShowBasics/AfterQueue b/local/html/Callbacks/Craig/Ticket/Elements/ShowBasics/AfterQueue
new file mode 100644
index 000000000..d1ecf7cfc
--- /dev/null
+++ b/local/html/Callbacks/Craig/Ticket/Elements/ShowBasics/AfterQueue
@@ -0,0 +1,41 @@
+% if ( $show_master_time ) {
+<tr class="time left master">
+ <td class="label"><&|/l&>Master Ticket</&>
+ <br>
+ <&|/l&>Time Remaining</&>:</td>
+% if ( $time_left >= 0 ) {
+ <td class="value"><% $time_left %> Minutes</td>
+% } else {
+ <td class="value" style="color: red"><% $time_left %> Minutes</td>
+% }
+ </tr>
+% }
+
+<%INIT>
+my $show_master_time = 0;
+my $ticket_id = $Ticket->id;
+
+my $parent_links = $Ticket->MemberOf;
+
+my @parent_tickets;
+while ( my $link = $parent_links->Next ) {
+ push ( @parent_tickets, $link->TargetObj );
+ next;
+}
+
+my $time_left = 0;
+
+if ( scalar @parent_tickets == 1 ) {
+ $show_master_time = 1;
+ my $parent_ticket = $parent_tickets[0];
+ my $time_estimated = $parent_ticket->TimeEstimated ? $parent_ticket->TimeEstimated: 0;
+ my $time_worked = $parent_ticket->TimeWorked ? $parent_ticket->TimeWorked: 0;
+ $time_left = $time_estimated - $time_worked;
+} else {
+ RT::Logger->debug("Master Ticket Time Left - No single parent found")
+}
+
+</%INIT>
+<%ARGS>
+$Ticket
+</%ARGS>
\ No newline at end of file
-----------------------------------------------------------------------
More information about the rt-commit
mailing list