[Bps-public-commit] rt-extension-timetracking branch add-output-time-format-options created. 0.23-2-g6e0571c

BPS Git Server git at git.bestpractical.com
Wed Mar 1 19:13:23 UTC 2023


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "rt-extension-timetracking".

The branch, add-output-time-format-options has been created
        at  6e0571c7c477fe330d7d923d9adc635e3a8d8d52 (commit)

- Log -----------------------------------------------------------------
commit 6e0571c7c477fe330d7d923d9adc635e3a8d8d52
Author: Ronaldo Richieri <ronaldo at bestpractical.com>
Date:   Wed Mar 1 16:11:59 2023 -0300

    Add option to show estimated time column
    
    Add checkbox to select if estimated time column should be shown or not.

diff --git a/html/Tools/TimeSearch.html b/html/Tools/TimeSearch.html
index 6af8950..3646eff 100644
--- a/html/Tools/TimeSearch.html
+++ b/html/Tools/TimeSearch.html
@@ -49,6 +49,11 @@
       <div class="col-3 label"><&|/l&>Include All Children?</&></div>
       <div class="col-9 value"><& /Widgets/Form/Boolean:InputOnly, Name => 'IncludeChildren', CurrentValue => $IncludeChildren &></div>
   </div>
+  <div class="form-row output-estimated">
+    <div class="col-3 label"><&|/l&>Display Estimated Time?</&></div>
+    <div class="col-9 value"><& /Widgets/Form/Boolean:InputOnly, Name => 'TimeEstimated', CurrentValue => $TimeEstimated &>
+    </div>
+  </div>
   <div class="form-row">
     <div class="col-12">
       <& /Elements/Submit, Name => 'DoSearch', Label => loc("Search") &>
@@ -72,7 +77,9 @@
         <th class="collection-as-table"><% $display_cf %></th>
 % }
         <th class="collection-as-table"><&|/l&>Time Worked</&></th>
+% if ( $TimeEstimated ){
         <th class="collection-as-table"><&|/l&>Time Estimated</&></th>
+% }
     </tr>
 % my $i = 1;
 % for my $ticket_id ( sort { $a <=> $b } keys %ticket_worked ) {
@@ -92,7 +99,9 @@
         <td class="collection-as-table"><% $ticket->FirstCustomFieldValue($display_cf) %></td>
 % }
         <td class="collection-as-table"><& /Ticket/Elements/ShowTime, minutes => $entry->{time_worked} &></td>
+% if ( $TimeEstimated ){
         <td class="collection-as-table"><& /Ticket/Elements/ShowTime, minutes => $ticket->TimeEstimated &></td>
+% }
     </tr>
 % }
 </table>
@@ -275,4 +284,5 @@ $StartDate => undef
 $EndDate => undef
 $IncludeChildren => 1
 $TimeWorkedDisplay => 1
+$TimeEstimated => 1
 </%ARGS>
diff --git a/static/css/time_tracking.css b/static/css/time_tracking.css
index 6627c70..6e3a3c0 100644
--- a/static/css/time_tracking.css
+++ b/static/css/time_tracking.css
@@ -38,6 +38,7 @@ div.time_tracking h2 {
     margin-top: 30px;
 }
 
-div.time_tracking div.include-children div.value {
+div.time_tracking div.include-children div.value,
+div.time_tracking div.output-estimated div.value {
     margin-top: 5px;
 }

commit cdd2440af004d8eae6b59f37d1551b8e463f52ca
Author: Ronaldo Richieri <ronaldo at bestpractical.com>
Date:   Wed Mar 1 16:02:37 2023 -0300

    Add option to specify output time format
    
    User can specify output time format in the TimeSearch tool between
    fractional time, rounded up and rounded to the nearest hour.

diff --git a/html/Tools/TimeSearch.html b/html/Tools/TimeSearch.html
index 3d14aea..6af8950 100644
--- a/html/Tools/TimeSearch.html
+++ b/html/Tools/TimeSearch.html
@@ -19,6 +19,32 @@
       <div class="col-3 label"><&|/l&>End Date</&>:</div>
       <div class="col-9 value"><& /Elements/SelectDate, ShowTime => 0, Name => 'EndDate', Default => $end_date->Date(Format=>'ISO', Timezone => 'user') &></div>
   </div>
+  <div class="form-row">
+      <div class="col-3 label"><&|/l&>Time Worked Display</&>:</div>
+      <div class="col-9 value">
+          <div class="custom-control custom-radio">
+            <input type="radio" name="TimeWorkedDisplay" value="1" class="custom-control-input"
+                    id="TimeWorkedDisplay1"
+                    <% $TimeWorkedDisplay == 1 ? 'checked="checked"' : '' %> />
+            <label for="TimeWorkedDisplay1"
+                class="custom-control-label"><&|/l&>Exact time, hours and minutes</&></label><br>
+          </div>
+          <div class="custom-control custom-radio">
+            <input type="radio" name="TimeWorkedDisplay" value="2" class="custom-control-input"
+                    id="TimeWorkedDisplay2"
+                    <% $TimeWorkedDisplay == 2 ? 'checked="checked"' : '' %> />
+            <label for="TimeWorkedDisplay2"
+                class="custom-control-label"><&|/l&>Hours only, rounded up</&></label><br>
+          </div>
+          <div class="custom-control custom-radio">
+            <input type="radio" name="TimeWorkedDisplay" value="3" class="custom-control-input"
+                    id="TimeWorkedDisplay3"
+                    <% $TimeWorkedDisplay == 3 ? 'checked="checked"' : '' %> />
+            <label for="TimeWorkedDisplay3"
+                class="custom-control-label"><&|/l&>Hours only, rounded to nearest hour</&></label><br>
+          </div>
+      </div>
+  </div>
   <div class="form-row include-children">
       <div class="col-3 label"><&|/l&>Include All Children?</&></div>
       <div class="col-9 value"><& /Widgets/Form/Boolean:InputOnly, Name => 'IncludeChildren', CurrentValue => $IncludeChildren &></div>
@@ -76,7 +102,16 @@
 
 <hr />
 <div class="time_worked">
-<span class="label"><&|/l&>Total Time Worked</&>:</span> <span class="value"><& /Ticket/Elements/ShowTime, minutes => $total_time_worked &></span>
+% if ( $TimeWorkedDisplay == 1 ) {
+<span class="label"><&|/l&>Total Time Worked</&>:</span>
+<span class="value"><& /Ticket/Elements/ShowTime, minutes => $total_time_worked &></span>
+% } elsif ( $TimeWorkedDisplay == 2 ) {
+<span class="label"><&|/l&>Total Time Worked</&>:</span>
+<span class="value"><% int( ($total_time_worked / 60) + 0.99 ) %> (<% $total_time_worked %> <&|/l&>minutes</&>)</span>
+% } elsif ( $TimeWorkedDisplay == 3 ) {
+<span class="label"><&|/l&>Total Time Worked</&>:</span>
+<span class="value"><% int( ($total_time_worked / 60) + 0.5 ) %> (<% $total_time_worked %> <&|/l&>minutes</&>)</span>
+% }
 </div>
 % }
 
@@ -239,4 +274,5 @@ $Query => undef
 $StartDate => undef
 $EndDate => undef
 $IncludeChildren => 1
+$TimeWorkedDisplay => 1
 </%ARGS>

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


hooks/post-receive
-- 
rt-extension-timetracking


More information about the Bps-public-commit mailing list