[Bps-public-commit] rt-extension-repeatticket branch, rt5, created. 1.11-3-gab30f36

? sunnavy sunnavy at bestpractical.com
Thu Jul 9 18:18:55 EDT 2020


The branch, rt5 has been created
        at  ab30f36891bf2e6cf0886f3493d0ccd85791154a (commit)

- Log -----------------------------------------------------------------
commit de096f2a68cc0ccdf3095914f74edb07fcf6238b
Author: sunnavy <sunnavy at bestpractical.com>
Date:   Fri Jul 10 03:13:53 2020 +0800

    Migrate to elevator themes for RT 5

diff --git a/html/Callbacks/RepeatTicket/Ticket/Create.html/AfterBasics b/html/Callbacks/RepeatTicket/Ticket/Create.html/AfterBasics
index 73faca6..a8cbcaa 100644
--- a/html/Callbacks/RepeatTicket/Ticket/Create.html/AfterBasics
+++ b/html/Callbacks/RepeatTicket/Ticket/Create.html/AfterBasics
@@ -1,4 +1,4 @@
-<&| /Widgets/TitleBox, title => loc("Recurrence"), class=>'ticket-info-repeat-recurrence', title_class => 'inverse' &>
+<&| /Widgets/TitleBox, title => loc("Recurrence"), class=>'ticket-info-repeat' &>
 <& /Ticket/Elements/EditRecurrence, ARGSRef => $ARGSRef, Initial => 1 &>
 </&>
 <%init>
diff --git a/html/Callbacks/RepeatTicket/Ticket/Elements/ShowSummary/LeftColumn b/html/Callbacks/RepeatTicket/Ticket/Elements/ShowSummary/LeftColumn
index 06f2ee4..62c70b5 100644
--- a/html/Callbacks/RepeatTicket/Ticket/Elements/ShowSummary/LeftColumn
+++ b/html/Callbacks/RepeatTicket/Ticket/Elements/ShowSummary/LeftColumn
@@ -1,4 +1,4 @@
-<&| /Widgets/TitleBox, title => loc("Recurrence"), class=>'ticket-info-repeat-recurrence', title_class => 'inverse',
+<&| /Widgets/TitleBox, title => loc("Recurrence"), class=>'ticket-info-repeat',
    ($can_modify ? (title_href => RT->Config->Get('WebPath')."/Ticket/ModifyRecurrence.html?id=".$Ticket->Id) : ()) &>
 <& /Ticket/Elements/EditRecurrence, Ticket => $Ticket, ReadOnly => 1 &>
 </&>
diff --git a/html/Ticket/Elements/EditRecurrence b/html/Ticket/Elements/EditRecurrence
index 480c70f..4607790 100644
--- a/html/Ticket/Elements/EditRecurrence
+++ b/html/Ticket/Elements/EditRecurrence
@@ -12,8 +12,8 @@ jQuery( function () {
  
     jQuery('div.repeat input[name=repeat-type]').change( function () {
         var val = jQuery(this).val();
-        jQuery('div.repeat td.repeat-details:not(.repeat-details-'+val+')').addClass('hidden');
-        jQuery('div.repeat td.repeat-details-' +val ).removeClass('hidden');
+        jQuery('div.repeat .repeat-details:not(.repeat-details-'+val+')').addClass('hidden');
+        jQuery('div.repeat .repeat-details-' +val ).removeClass('hidden');
     } );
 
 % if ( $ReadOnly ) {
@@ -22,190 +22,204 @@ jQuery( function () {
 } );
 </script>
 <div class="repeat">
-<label><input name="repeat-enabled" type="checkbox" value="1" <% $ARGSRef->{'repeat-enabled'} ? 'checked="checked"' : '' |n %>/> <&|/l&>Enable Recurrence?</&></label>
-
-<div class="repeat-toggle <% $ARGSRef->{'repeat-enabled'} ? '' : 'hidden' %> ">
-
-<label><&|/l&>Ticket lead time (days)</&>:
-<input size="3" name="repeat-lead-time" type="text" value="<% $ARGSRef->{'repeat-lead-time'} %>" /></label>
-<label><&|/l&>Concurrent active tickets</&>:
-<input size="3" name="repeat-coexistent-number" type="text" value="<% $ARGSRef->{'repeat-coexistent-number'} %>" /></label>
-
-<fieldset>
-<legend><&|/l&>Recurrence pattern</&></legend>
-<table width="100%" border="0">
-<tr>
-<td width="100px">
-  <table border="0">
-    <tr>
-        <td width="100px">
-            <label><input name="repeat-type" type="radio" value="daily" <% ($ARGSRef->{'repeat-type'} || '') eq 'daily' ? 'checked="checked"' : '' |n  %> /> <&|/l&>Daily</&></label>
-        </td>
-        <td width="1" rowspan="4" bgcolor="#aaa"><br></td>
-    </tr>
-    <tr>
-        <td width="100px">
-            <label><input name="repeat-type" type="radio" value="weekly" <% ($ARGSRef->{'repeat-type'} || '') eq 'weekly' ?  'checked="checked"' : '' |n %>/> <&|/l&>Weekly</&></label>
-        </td>
-    </tr>
-    <tr>
-        <td width="100px">
-            <label><input name="repeat-type" type="radio" value="monthly" <% ($ARGSRef->{'repeat-type'} || '') eq 'monthly' ?  'checked="checked"' : '' |n %>/> <&|/l&>Monthly</&></label>
-        </td>
-    </tr>
-    <tr>
-        <td width="100px">
-            <label><input name="repeat-type" type="radio" value="yearly" <% ($ARGSRef->{'repeat-type'} || '') eq 'yearly' ?  'checked="checked"' : '' |n %>/> <&|/l&>Yearly</&></label>
-        </td>
-    </tr>
-  </table>
-</td>
-<td class="repeat-details repeat-details-daily <% ($ARGSRef->{'repeat-type'} || '' ) eq 'daily' ? '' : 'hidden' %>">
-  <table border="0">
-    <tr>
-        <td>
-            <label><input name="repeat-details-daily" type="radio" value="day" <% ($ARGSRef->{'repeat-details-daily'} || '') eq 'day' ?  'checked="checked"' : '' |n %>/>
-            <&|/l_unsafe, $input->("repeat-details-daily-day") &>Every [_1] Day(s)</&></label>
-        </td>
-    </tr>
-    <tr>
-        <td>
-            <label><input name="repeat-details-daily" type="radio" value="weekday" <% ($ARGSRef->{'repeat-details-daily'} || '') eq 'weekday' ?  'checked="checked"' : '' |n %>/>
-            <&|/l&>Every Weekday</&></label>
-        </td>
-    </tr>
-    <tr>
-        <td>
-            <label><input name="repeat-details-daily" type="radio" value="complete" <% ($ARGSRef->{'repeat-details-daily'} || '') eq 'complete' ?  'checked="checked"' : '' |n %>/>
-            <&|/l_unsafe, $input->("repeat-details-daily-complete") &>Create new task [_1] day(s) after each task is completed</&></label>
-        </td>
-    </tr>
-  </table>
-</td>
-
-<td class="repeat-details repeat-details-weekly  <% ($ARGSRef->{'repeat-type'} || '' ) eq 'weekly' ? '' : 'hidden' %>">
-  <table border="0">
-    <tr>
-        <td colspan="5">
-            <label><input name="repeat-details-weekly" type="radio" value="week" <% ($ARGSRef->{'repeat-details-weekly'} || '') eq 'week' ?  'checked="checked"' : '' |n %> />
-            <&|/l_unsafe, $input->("repeat-details-weekly-week") &>Recur every [_1] week(s) on</&>:</label>
-        </td>
-    </tr>
-    <tr>
-        <td width="10px" />
-% for my $number ( 0 .. 6 ) {
-        <td>
-    <label><input name="repeat-details-weekly-weeks" type="checkbox" value="<% $week_values[$number] %>"
-% if ( defined $ARGSRef->{'repeat-details-weekly-weeks'} && (
-%   ( ref $ARGSRef->{'repeat-details-weekly-weeks'} && grep { $_ eq $week_values[$number] }
-%         @{$ARGSRef->{'repeat-details-weekly-weeks'}} ) ||
-%           ( $ARGSRef->{'repeat-details-weekly-weeks'} eq $week_values[$number] ) ) ) {
-    checked="checked"
-% }
 
-/><% loc($week_labels[$number]) %></label>
-        </td>
-% if ( $number == 3 ) {
-    </tr>
-    <tr>
-        <td width="10px" />
-% }
-% }
-    </tr>
-    <tr>
-        <td colspan="5">
-            <label><input name="repeat-details-weekly" type="radio" value="complete" <% ($ARGSRef->{'repeat-details-weekly'} || '') eq 'complete' ?  'checked="checked"' : '' |n%>/>
-            <&|/l_unsafe, $input->("repeat-details-weekly-complete") &>Create new task [_1] week(s) after each task is completed</&></label>
-        </td>
-    </tr>
-  </table>
-</td>
-
-<td class="repeat-details repeat-details-monthly  <% ($ARGSRef->{'repeat-type'} || '' ) eq 'monthly' ? '' : 'hidden' %>">
-  <table border="0">
-    <tr>
-        <td>
-            <label><input name="repeat-details-monthly" type="radio" value="day" <% ($ARGSRef->{'repeat-details-monthly'} || '') eq 'day' ?  'checked="checked"' : '' |n %> /><&|/l_unsafe, $input->("repeat-details-monthly-day-day"), $input->("repeat-details-monthly-day-month") &>Day [_1] of every [_2] month(s)</&></label>
-        </td>
-    </tr>
-    <tr>
-        <td>
-            <label><input name="repeat-details-monthly" type="radio" value="week" <% ($ARGSRef->{'repeat-details-monthly'} || '') eq 'week' ?  'checked="checked"' : '' |n %> /><&|/l_unsafe, $nth->("repeat-details-monthly-week-number"), $wday->("repeat-details-monthly-week-week"), $input->("repeat-details-monthly-week-month") &>The [_1] [_2] of every [_3] month(s)</&></label>
-        </td>
-    </tr>
-    <tr>
-        <td>
-            <label><input name="repeat-details-monthly" type="radio" value="complete" <% ($ARGSRef->{'repeat-details-monthly'} || '') eq 'complete' ? 'checked="checked"' : '' |n %> />
-            <&|/l_unsafe, $input->("repeat-details-monthly-complete") &>Create new task [_1] month(s) after each task is completed</&></label>
-        </td>
-    </tr>
-  </table>
-</td>
-
-<td class="repeat-details repeat-details-yearly <% ($ARGSRef->{'repeat-type'} || '' ) eq 'yearly' ? '' : 'hidden' %>">
-  <table border="0">
-    <tr>
-        <td>
-            <label><input name="repeat-details-yearly" type="radio" value="day" <% ($ARGSRef->{'repeat-details-yearly'} || '') eq 'day' ?  'checked="checked"' : '' |n %> /><&|/l_unsafe, $month->("repeat-details-yearly-day-month"), $input->("repeat-details-yearly-day-day") &>Every [_1] [_2]</&></label>
-        </td>
-    </tr>
-    <tr>
-        <td>
-            <label><input name="repeat-details-yearly" type="radio" value="week" <% ($ARGSRef->{'repeat-details-yearly'} || '') eq 'week' ?  'checked="checked"' : '' |n %> /><&|/l_unsafe, $nth->("repeat-details-yearly-week-number"), $wday->("repeat-details-yearly-week-week"), $month->("repeat-details-yearly-week-month") &>The [_1] [_2] of [_3]</&></label>
-        </td>
-    </tr>
-    <tr>
-        <td>
-            <label><input name="repeat-details-yearly" type="radio" value="complete" <% ($ARGSRef->{'repeat-details-yearly'} || '') eq 'complete' ?  'checked="checked"' : '' |n %> />
-            <&|/l_unsafe, $input->("repeat-details-yearly-complete") &>Create new task [_1] year(s) after each task is completed</&></label>
-        </td>
-    </tr>
-  </table>
-</td>
-
-</tr>
-</table>
-</fieldset>
-
-
-<fieldset>
-<legend><&|/l&>Range of recurrence</&></legend>
-<table width="100%" border="0">
-<tr>
-    <td rowspan="3">
-        <label>
-        <&|/l&>Start</&>:
+  <div class="form-row">
+    <div class="label col-4"></div>
+    <div class="value col-auto">
+      <div class="custom-control custom-checkbox">
+        <input type="checkbox" id="repeat-enabled" name="repeat-enabled" class="custom-control-input" value="1" <% $ARGSRef->{'repeat-enabled'} ? ' checked="checked"': '' |n %>>
+        <label class="custom-control-label" for="repeat-enabled"><&|/l&>Enable Recurrence?</&></label>
+      </div>
+    </div>
+  </div>
+
+  <div class="repeat-toggle <% $ARGSRef->{'repeat-enabled'} ? '' : 'hidden' %> ">
+
+    <div class="form-row">
+      <div class="label input col-4">
+        <&|/l&>Ticket lead time (days)</&>:
+      </div>
+      <div class="value col-auto">
+        <input class="form-control" size="3" name="repeat-lead-time" type="text" value="<% $ARGSRef->{'repeat-lead-time'} %>" />
+      </div>
+    </div>
+
+    <div class="form-row">
+      <div class="label input col-4">
+        <&|/l&>Concurrent active tickets</&>:
+      </div>
+      <div class="value col-auto">
+        <input class="form-control" size="3" name="repeat-coexistent-number" type="text" value="<% $ARGSRef->{'repeat-coexistent-number'} %>" />
+      </div>
+    </div>
+
+    <div class="form-row">
+      <div class="label input col-4">
+        <&|/l&>Recurrence pattern</&>:
+      </div>
+      <div class="value col-auto">
+
+        <div class="form-check form-check-inline">
+          <div class="custom-control custom-radio">
+            <input type="radio" id="repeat-type-daily" name="repeat-type" class="custom-control-input" value="daily" <% ($ARGSRef->{'repeat-type'} || '') eq 'daily' ? ' checked="checked"': '' |n %>>
+            <label class="custom-control-label" for="repeat-type-daily"><&|/l&>Daily</&></label>
+          </div>
+        </div>
+
+        <div class="form-check form-check-inline">
+          <div class="custom-control custom-radio">
+            <input type="radio" id="repeat-type-weekly" name="repeat-type" class="custom-control-input" value="weekly" <% ($ARGSRef->{'repeat-type'} || '') eq 'weekly' ? ' checked="checked"': '' |n %>>
+            <label class="custom-control-label" for="repeat-type-weekly"><&|/l&>Weekly</&></label>
+          </div>
+        </div>
+
+        <div class="form-check form-check-inline">
+          <div class="custom-control custom-radio">
+            <input type="radio" id="repeat-type-monthly" name="repeat-type" class="custom-control-input" value="monthly" <% ($ARGSRef->{'repeat-type'} || '') eq 'monthly' ? ' checked="checked"': '' |n %>>
+            <label class="custom-control-label" for="repeat-type-monthly"><&|/l&>Monthly</&></label>
+          </div>
+        </div>
+
+        <div class="form-check form-check-inline">
+          <div class="custom-control custom-radio">
+            <input type="radio" id="repeat-type-yearly" name="repeat-type" class="custom-control-input" value="yearly" <% ($ARGSRef->{'repeat-type'} || '') eq 'yearly' ? ' checked="checked"': '' |n %>>
+            <label class="custom-control-label" for="repeat-type-yearly"><&|/l&>Yearly</&></label>
+          </div>
+
+        </div>
+
+        <div class="mt-3 repeat-details repeat-details-daily <% ($ARGSRef->{'repeat-type'} || '' ) eq 'daily' ? '' : 'hidden' %>">
+
+          <div class="custom-control custom-radio">
+            <input type="radio" id="repeat-details-daily-day" name="repeat-details-daily" class="custom-control-input" value="day" <% ($ARGSRef->{'repeat-details-daily'} || '') eq 'day' ? ' checked="checked"': '' |n %>>
+            <label class="custom-control-label has-text-input" for="repeat-details-daily-day"><&|/l_unsafe, $input->("repeat-details-daily-day") &>Every [_1] Day(s)</&></label>
+          </div>
+
+          <div class="mt-1 custom-control custom-radio">
+            <input type="radio" id="repeat-details-daily-weekday" name="repeat-details-daily" class="custom-control-input" value="weekday" <% ($ARGSRef->{'repeat-details-daily'} || '') eq 'weekday' ? ' checked="checked"': '' |n %>>
+            <label class="custom-control-label" for="repeat-details-daily-weekday"><&|/l&>Every Weekday</&></label>
+          </div>
+
+          <div class="mt-1 custom-control custom-radio">
+            <input type="radio" id="repeat-details-daily-complete" name="repeat-details-daily" class="custom-control-input" value="complete" <% ($ARGSRef->{'repeat-details-daily'} || '') eq 'complete' ? ' checked="checked"': '' |n %>>
+            <label class="custom-control-label has-text-input" for="repeat-details-daily-complete"><&|/l_unsafe, $input->("repeat-details-daily-complete") &>Create new task [_1] day(s) after each task is completed</&></label>
+          </div>
+
+        </div>
+
+        <div class="mt-3 repeat-details repeat-details-weekly <% ($ARGSRef->{'repeat-type'} || '' ) eq 'weekly' ? '' : 'hidden' %>">
+          <div class="custom-control custom-radio">
+            <input type="radio" id="repeat-details-weekly-week" name="repeat-details-weekly" class="custom-control-input" value="week" <% ($ARGSRef->{'repeat-details-weekly'} || '') eq 'week' ? ' checked="checked"': '' |n %>>
+            <label class="custom-control-label has-text-input" for="repeat-details-weekly-week"><&|/l_unsafe, $input->("repeat-details-weekly-week") &>Recur every [_1] week(s) on</&>:</label>
+          </div>
+
+          <div class="ml-4">
+%         for my $number ( 0 .. 6 ) {
+            <div class="form-check form-check-inline">
+              <div class="custom-control custom-checkbox">
+                <input id="name=repeat-details-weekly-weeks-<% $week_values[$number] %>" name="repeat-details-weekly-weeks" type="checkbox" class="custom-control-input" value="<% $week_values[$number] %>"
+%             if ( defined $ARGSRef->{'repeat-details-weekly-weeks'} && (
+%               ( ref $ARGSRef->{'repeat-details-weekly-weeks'} && grep { $_ eq $week_values[$number] }
+%               @{$ARGSRef->{'repeat-details-weekly-weeks'}} ) ||
+%               ( $ARGSRef->{'repeat-details-weekly-weeks'} eq $week_values[$number] ) ) ) {
+                  checked="checked"
+%             }
+                />
+                <label class="custom-control-label" for="name=repeat-details-weekly-weeks-<% $week_values[$number] %>"><% loc($week_labels[$number]) %></label>
+              </div>
+            </div>
+%       }
+          </div>
+
+          <div class="mt-1 custom-control custom-radio">
+            <input type="radio" id="repeat-details-weekly-complete" name="repeat-details-weekly" class="custom-control-input" value="complete" <% ($ARGSRef->{'repeat-details-weekly'} || '') eq 'complete' ? ' checked="checked"': '' |n %>>
+            <label class="custom-control-label has-text-input" for="repeat-details-weekly-complete"><&|/l_unsafe, $input->("repeat-details-weekly-complete") &>Create new task [_1] week(s) after each task is completed</&></label>
+          </div>
+
+        </div>
+
+        <div class="mt-3 repeat-details repeat-details-monthly <% ($ARGSRef->{'repeat-type'} || '' ) eq 'monthly' ? '' : 'hidden' %>">
+
+          <div class="custom-control custom-radio">
+            <input type="radio" id="repeat-details-monthly-day" name="repeat-details-monthly" class="custom-control-input" value="day" <% ($ARGSRef->{'repeat-details-monthly'} || '') eq 'day' ? ' checked="checked"': '' |n %>>
+            <label class="custom-control-label has-text-input" for="repeat-details-monthly-day"><&|/l_unsafe, $input->("repeat-details-monthly-day-day"), $input->("repeat-details-monthly-day-month") &>Day [_1] of every [_2] month(s)</&></label>
+          </div>
+
+          <div class="mt-1 custom-control custom-radio">
+            <input type="radio" id="repeat-details-monthly-week" name="repeat-details-monthly" class="custom-control-input" value="week" <% ($ARGSRef->{'repeat-details-monthly'} || '') eq 'week' ? ' checked="checked"': '' |n %>>
+            <label class="custom-control-label has-text-input" for="repeat-details-monthly-week"><&|/l_unsafe, $nth->("repeat-details-monthly-week-number"), $wday->("repeat-details-monthly-week-week"), $input->("repeat-details-monthly-week-month") &>The [_1] [_2] of every [_3] month(s)</&></label>
+          </div>
+
+          <div class="mt-1 custom-control custom-radio">
+            <input type="radio" id="repeat-details-monthly-complete" name="repeat-details-monthly" class="custom-control-input" value="complete" <% ($ARGSRef->{'repeat-details-monthly'} || '') eq 'complete' ? ' checked="checked"': '' |n %>>
+            <label class="custom-control-label has-text-input" for="repeat-details-monthly-complete"><&|/l_unsafe, $input->("repeat-details-monthly-complete") &>Create new task [_1] month(s) after each task is completed</&></label>
+          </div>
+
+        </div>
+
+        <div class="mt-3 repeat-details repeat-details-yearly <% ($ARGSRef->{'repeat-type'} || '' ) eq 'yearly' ? '' : 'hidden' %>">
+
+          <div class="custom-control custom-radio">
+            <input type="radio" id="repeat-details-yearly-day" name="repeat-details-yearly" class="custom-control-input" value="day" <% ($ARGSRef->{'repeat-details-yearly'} || '') eq 'day' ? ' checked="checked"': '' |n %>>
+            <label class="custom-control-label has-text-input" for="repeat-details-yearly-day"><&|/l_unsafe, $month->("repeat-details-yearly-day-month"), $input->("repeat-details-yearly-day-day") &>Every [_1] [_2]</&></label>
+          </div>
+
+          <div class="mt-1 custom-control custom-radio">
+            <input type="radio" id="repeat-details-yearly-week" name="repeat-details-yearly" class="custom-control-input" value="week" <% ($ARGSRef->{'repeat-details-yearly'} || '') eq 'week' ? ' checked="checked"': '' |n %>>
+            <label class="custom-control-label has-text-input" for="repeat-details-yearly-week"><&|/l_unsafe, $nth->("repeat-details-yearly-week-number"), $wday->("repeat-details-yearly-week-week"), $month->("repeat-details-yearly-week-month") &>The [_1] [_2] of [_3]</&></label>
+          </div>
+
+          <div class="mt-1 custom-control custom-radio">
+            <input type="radio" id="repeat-details-yearly-complete" name="repeat-details-yearly" class="custom-control-input" value="complete" <% ($ARGSRef->{'repeat-details-yearly'} || '') eq 'complete' ? ' checked="checked"': '' |n %>>
+            <label class="custom-control-label has-text-input" for="repeat-details-yearly-complete"><&|/l_unsafe, $input->("repeat-details-yearly-complete") &>Create new task [_1] year(s) after each task is completed</&></label>
+          </div>
+
+        </div>
+
+      </div>
+    </div>
+
+    <div class="form-row mt-2">
+      <div class="label input col-4">
+        <&|/l&>Start of recurrence</&>:
+      </div>
+      <div class="value col-auto">
         <& /Elements/SelectDate, Name => 'repeat-start-date', ShowTime => 0, Default => $ARGSRef->{'repeat-start-date'} || '' &>
-        </label>
-    </td>
-    <td>
-        <label>
-        <input type="radio" name="repeat-end" value="none" <% ($ARGSRef->{'repeat-end'} || '') eq 'none' ? 'checked="checked"' : '' |n %>> <&|/l&>No end date</&>
-        </label>
-    </td>
-</tr>
-<tr>
-    <td>
-        <label><input type="radio" name="repeat-end" value="number" <% ($ARGSRef->{'repeat-end'} || '') eq 'number' ? 'checked="checked"' : '' |n %>>
-        <&|/l_unsafe, $input->("repeat-end-number",6,10) &>End after [_1] occurrence(s)</&>
-% if ( $Initial ) {
-    <input name="repeat-occurrences" type="hidden" value="1">
-% } else {
-    <&|/l&>Current</&>: <input size="6" type="text" name="repeat-occurrences" readonly="readonly" value="<% $ARGSRef->{'repeat-occurrences'} %>"></label>
-% }
-    </td>
-</tr>
-<tr>
-    <td>
-        <label><input type="radio" name="repeat-end" value="date" <% ($ARGSRef->{'repeat-end'} || '') eq 'date' ? 'checked="checked"' : '' |n %>> <&|/l&>End by</&>:
-        <& /Elements/SelectDate, Name => 'repeat-end-date', ShowTime => 0, Default => $ARGSRef->{'repeat-end-date'} || '' &></label>
-    </td>
-</tr>
-</table>
-</fieldset>
+      </div>
+    </div>
 
-</div>
+    <div class="form-row">
+      <div class="label input col-4">
+        <&|/l&>End of recurrence </&>:
+      </div>
+      <div class="value col-auto form-check">
+
+        <div class="custom-control custom-radio">
+          <input type="radio" id="repeat-end-none" name="repeat-end" class="custom-control-input" value="none" <% ($ARGSRef->{'repeat-end'} || '') eq 'none' ? ' checked="checked"': '' |n %>>
+          <label class="custom-control-label" for="repeat-end-none"><&|/l&>No end date</&></label>
+        </div>
+
+        <div class="mt-1 custom-control custom-radio">
+          <input type="radio" id="repeat-end-number" name="repeat-end" class="custom-control-input" value="number" <% ($ARGSRef->{'repeat-end'} || '') eq 'number' ? ' checked="checked"': '' |n %>>
+          <label class="custom-control-label has-text-input" for="repeat-end-number"><&|/l_unsafe, $input->("repeat-end-number",6,10) &>End after [_1] occurrence(s)</&>
+%         if ( $Initial ) {
+            <input name="repeat-occurrences" type="hidden" value="1">
+%         } else {
+            <&|/l&>Current</&>: <input size="6" type="text" name="repeat-occurrences" readonly="readonly" value="<% $ARGSRef->{'repeat-occurrences'} %>">
+%         }
+          </label>
+        </div>
+
+        <div class="mt-1 custom-control custom-radio">
+          <input type="radio" id="repeat-end-date" name="repeat-end" class="custom-control-input" value="number" <% ($ARGSRef->{'repeat-end'} || '') eq 'date' ? ' checked="checked"': '' |n %>>
+          <label class="custom-control-label has-text-input" for="repeat-end-date">
+            <&|/l&>End by</&>: <& /Elements/SelectDate, Name => 'repeat-end-date', ShowTime => 0, Default => $ARGSRef->{'repeat-end-date'} || '' &>
+          </label>
+        </div>
 
+      </div>
+    </div>
+  </div>
 </div>
 
 <%init>
@@ -242,7 +256,7 @@ my $input = sub {
     my ($name, $width, $default) = (@_);
     $width ||= 4; $default ||= 1;
     my $escaped = $m->interp->apply_escapes($name, "h");
-    return qq|<input name="$escaped" type="text" size="$width" value="|
+    return qq|<input name="$escaped" type="text" size="$width" class="form-control" value="|
          . $m->interp->apply_escapes($ARGSRef->{$name} || $default, "h")
          . qq|" />|;
 };
@@ -250,7 +264,7 @@ my $input = sub {
 my $nth = sub {
     my ($name) = @_;
     my $escaped = $m->interp->apply_escapes($name, "h");
-    my $str = qq|<select name="$escaped">|;
+    my $str = qq|<select class="form-control selectpicker" name="$escaped">|;
     for my $number ( 1 .. 4, -1 ) {
         $str .= qq|<option value="$number" |
               . (($ARGSRef->{$name} || '') eq $number ? 'selected="selected"' : '') . ">"
@@ -263,7 +277,7 @@ my $nth = sub {
 my $wday = sub {
     my ($name) = @_;
     my $escaped = $m->interp->apply_escapes($name, "h");
-    my $str = qq|<select name="$escaped">|;
+    my $str = qq|<select class="form-control selectpicker" name="$escaped">|;
     for my $number ( 0 .. 6 ) {
         $str .= qq|<option value="$week_values[$number]" |
               . (($ARGSRef->{$name} || '') eq $week_values[$number] ? 'selected="selected"' : '' ) . ">"
@@ -276,7 +290,7 @@ my $wday = sub {
 my $month = sub {
     my ($name) = @_;
     my $escaped = $m->interp->apply_escapes($name, "h");
-    my $str = qq|<select name="$escaped">|;
+    my $str = qq|<select class="form-control selectpicker" name="$escaped">|;
     for my $number ( 1 .. 12 ) {
         $str .= qq|<option value="$number" |
               . (($ARGSRef->{$name} || '') eq $number ? 'selected="selected"' : '') . ">"
diff --git a/html/Ticket/ModifyRecurrence.html b/html/Ticket/ModifyRecurrence.html
index de8e100..9821c63 100644
--- a/html/Ticket/ModifyRecurrence.html
+++ b/html/Ticket/ModifyRecurrence.html
@@ -4,12 +4,17 @@
 <& /Elements/ListActions, actions => \@results &>
 
 % unless ( $skip ) {
-<form method="post" name="ModifyRecurrence" action="ModifyRecurrence.html">
+<form method="post" name="ModifyRecurrence" action="ModifyRecurrence.html" class="mx-auto max-width-lg">
 <input type="hidden" class="hidden" name="id" value="<%$TicketObj->Id%>" />
 <&| /Widgets/TitleBox,title => loc('Modify recurrence for ticket # [_1]', $TicketObj->Id), class=> 'ticket-info-repeat' &>
 <& Elements/EditRecurrence, Ticket => $TicketObj, ARGSRef => $ARGSRef &>
 </&>
-<& /Elements/Submit, Name => 'SubmitTicket', Label => loc('Save Changes') &>
+
+  <div class="form-row">
+    <div class="col-12">
+      <& /Elements/Submit, Name => 'SubmitTicket', Label => loc('Save Changes') &>
+    </div>
+  </div>
 </form>
 % }
 
diff --git a/static/css/repeat-ticket.css b/static/css/repeat-ticket.css
index b8d1460..4d17888 100644
--- a/static/css/repeat-ticket.css
+++ b/static/css/repeat-ticket.css
@@ -1 +1,22 @@
-.ticket-info-repeat-recurrence .titlebox .titlebox-title .left { background-color: #B23 }
+.ticket-info-repeat-recurrence .titlebox.card {
+  border-top: 3px solid #B23;
+}
+
+.ticket-info-repeat .form-row .form-check {
+  margin-top: 5px;
+}
+
+
+.ticket-info-repeat .custom-control-label.has-text-input::before,
+.ticket-info-repeat .custom-control-label.has-text-input::after {
+  top: 0.5rem;
+}
+
+.ticket-info-repeat .form-control {
+  display: inline;
+  width: auto;
+}
+
+.ticket-info-repeat .bootstrap-select > .dropdown-toggle {
+  width: auto;
+}

commit 902b83852b0adbe6ecdf7518a53c673449a1f877
Author: sunnavy <sunnavy at bestpractical.com>
Date:   Fri Jul 10 05:53:01 2020 +0800

    Update tests to make them pass on RT 5

diff --git a/xt/cf.t b/xt/cf.t
index ea291f2..3b2308f 100644
--- a/xt/cf.t
+++ b/xt/cf.t
@@ -13,11 +13,7 @@ my ( $baseurl, $m ) = RT::Test->started_ok();
 
 ok( $m->login( 'root', 'password' ), 'logged in' );
 
-$m->submit_form_ok({
-    form_name => 'CreateTicketInQueue',
-    fields    => {
-       'Queue' => 'General' },
-    }, 'Click to create ticket');
+$m->submit_form_ok( { form_name => 'CreateTicketInQueue' }, 'Click to create ticket' );
 
 $m->content_contains('Enable Recurrence');
 
@@ -38,6 +34,7 @@ $m->submit_form_ok(
             'repeat-details-daily'                                 => 'day',
             'repeat-details-daily-day'                             => 1,
         },
+        button => 'SubmitTicket',
     },
     'Create'
 );
diff --git a/xt/daily.t b/xt/daily.t
index 862cb71..061b17e 100644
--- a/xt/daily.t
+++ b/xt/daily.t
@@ -79,26 +79,26 @@ sub run_tests{
 
     ok( $m->login( 'root', 'password' ), 'logged in' );
 
-    $m->submit_form_ok({
-                        form_name => 'CreateTicketInQueue',
-                        fields    => {
-                                      'Queue' => 'General' },
-                       }, 'Click to create ticket');
+    $m->submit_form_ok( { form_name => 'CreateTicketInQueue', }, 'Click to create ticket' );
 
     $m->content_contains('Enable Recurrence');
 
     diag "Create a ticket with a recurrence in the General queue.";
 
-    $m->submit_form_ok({
-                        form_name => 'TicketCreate',
-                        fields    => {
-                                      'Subject' => 'Set up recurring aperture maintenance',
-                                      'Content' => 'Perform work on portals once per day',
-                                      'repeat-enabled' => 1,
-                                      'repeat-type' => 'daily',
-                                      'repeat-details-daily' => 'day',
-                                      'repeat-details-daily-day' => 1,
-                                     },}, 'Create');
+    $m->submit_form_ok(
+        {   form_name => 'TicketCreate',
+            fields    => {
+                'Subject'                  => 'Set up recurring aperture maintenance',
+                'Content'                  => 'Perform work on portals once per day',
+                'repeat-enabled'           => 1,
+                'repeat-type'              => 'daily',
+                'repeat-details-daily'     => 'day',
+                'repeat-details-daily-day' => 1,
+            },
+            button => 'SubmitTicket',
+        },
+        'Create'
+    );
 
     $m->text_like( qr/Ticket\s(\d+)\screated in queue/);
 
diff --git a/xt/end_conditions.t b/xt/end_conditions.t
index cae27a9..7f66a7a 100644
--- a/xt/end_conditions.t
+++ b/xt/end_conditions.t
@@ -101,26 +101,26 @@ sub run_tests{
 
     ok( $m->login( 'root', 'password' ), 'logged in' );
 
-    $m->submit_form_ok({
-                        form_name => 'CreateTicketInQueue',
-                        fields    => {
-                                      'Queue' => 'General' },
-                       }, 'Click to create ticket');
+    $m->submit_form_ok( { form_name => 'CreateTicketInQueue', }, 'Click to create ticket' );
 
     $m->content_contains('Enable Recurrence');
 
     diag "Create a ticket with a recurrence in the General queue.";
 
-    $m->submit_form_ok({
-                        form_name => 'TicketCreate',
-                        fields    => {
-                                      'Subject' => 'Set up recurring aperture maintenance',
-                                      'Content' => 'Perform work on portals once per day',
-                                      'repeat-enabled' => 1,
-                                      'repeat-type' => 'daily',
-                                      'repeat-details-daily' => 'day',
-                                      'repeat-details-daily-day' => 1,
-                                     },}, 'Create');
+    $m->submit_form_ok(
+        {   form_name => 'TicketCreate',
+            fields    => {
+                'Subject'                  => 'Set up recurring aperture maintenance',
+                'Content'                  => 'Perform work on portals once per day',
+                'repeat-enabled'           => 1,
+                'repeat-type'              => 'daily',
+                'repeat-details-daily'     => 'day',
+                'repeat-details-daily-day' => 1,
+            },
+            button => 'SubmitTicket',
+        },
+        'Create'
+    );
 
     $m->text_like( qr/Ticket\s(\d+)\screated in queue/);
 
diff --git a/xt/monthly.t b/xt/monthly.t
index 33ec223..78548aa 100644
--- a/xt/monthly.t
+++ b/xt/monthly.t
@@ -12,29 +12,29 @@ my ( $baseurl, $m ) = RT::Test->started_ok();
 
 ok( $m->login( 'root', 'password' ), 'logged in' );
 
-$m->submit_form_ok({
-    form_name => 'CreateTicketInQueue',
-    fields    => {
-       'Queue' => 'General' },
-    }, 'Click to create ticket');
+$m->submit_form_ok( { form_name => 'CreateTicketInQueue', }, 'Click to create ticket' );
 
 $m->content_contains('Enable Recurrence');
 
 diag "Create a ticket with a recurrence in the General queue.";
 
 my $day = DateTime->now;
-$m->submit_form_ok({
-    form_name => 'TicketCreate',
-    fields    => {
-        'Subject' => 'Set up monthly aperture maintenance',
-        'Content' => 'Perform work on portals on the first of each month',
-        'repeat-lead-time' => 14,
-        'repeat-coexistent-number' => 1,
-        'repeat-enabled' => 1,
-        'repeat-type' => 'monthly',
-        'repeat-details-monthly-day-day' => $day->day,
-        'repeat-details-monthly-day-month' => 1,
-     },}, 'Create');
+$m->submit_form_ok(
+    {   form_name => 'TicketCreate',
+        fields    => {
+            'Subject'                          => 'Set up monthly aperture maintenance',
+            'Content'                          => 'Perform work on portals on the first of each month',
+            'repeat-lead-time'                 => 14,
+            'repeat-coexistent-number'         => 1,
+            'repeat-enabled'                   => 1,
+            'repeat-type'                      => 'monthly',
+            'repeat-details-monthly-day-day'   => $day->day,
+            'repeat-details-monthly-day-month' => 1,
+        },
+        button => 'SubmitTicket',
+    },
+    'Create'
+);
 
 $m->text_like( qr/Ticket\s(\d+)\screated in queue/);
 
diff --git a/xt/on_complete.t b/xt/on_complete.t
index 04bc090..cd97521 100644
--- a/xt/on_complete.t
+++ b/xt/on_complete.t
@@ -10,27 +10,27 @@ my ( $baseurl, $m ) = RT::Test->started_ok();
 
 ok( $m->login( 'root', 'password' ), 'logged in' );
 
-$m->submit_form_ok({
-    form_name => 'CreateTicketInQueue',
-    fields    => {
-       'Queue' => 'General' },
-    }, 'Click to create ticket');
+$m->submit_form_ok( { form_name => 'CreateTicketInQueue', }, 'Click to create ticket' );
 
 $m->content_contains('Enable Recurrence');
 
 diag "Create a recurrence that starts based on completion of previous ticket.";
 
 my $day = DateTime->now;
-$m->submit_form_ok({
-    form_name => 'TicketCreate',
-    fields    => {
-        'Subject' => 'Set up monthly aperture maintenance',
-        'Content' => 'Perform work on portals on the first of each month',
-        'repeat-enabled' => 1,
-        'repeat-type' => 'monthly',
-        'repeat-details-monthly' => 'complete',
-        'repeat-details-monthly-complete' => 0,
-     },}, 'Create');
+$m->submit_form_ok(
+    {   form_name => 'TicketCreate',
+        fields    => {
+            'Subject'                         => 'Set up monthly aperture maintenance',
+            'Content'                         => 'Perform work on portals on the first of each month',
+            'repeat-enabled'                  => 1,
+            'repeat-type'                     => 'monthly',
+            'repeat-details-monthly'          => 'complete',
+            'repeat-details-monthly-complete' => 0,
+        },
+        button => 'SubmitTicket',
+    },
+    'Create'
+);
 
 $m->text_like( qr/Ticket\s(\d+)\screated in queue/);
 
diff --git a/xt/start_date.t b/xt/start_date.t
index 69476e8..c85620d 100644
--- a/xt/start_date.t
+++ b/xt/start_date.t
@@ -10,11 +10,7 @@ my ( $baseurl, $m ) = RT::Test->started_ok();
 
 ok( $m->login( 'root', 'password' ), 'logged in' );
 
-$m->submit_form_ok({
-    form_name => 'CreateTicketInQueue',
-    fields    => {
-       'Queue' => 'General' },
-    }, 'Click to create ticket');
+$m->submit_form_ok( { form_name => 'CreateTicketInQueue', }, 'Click to create ticket' );
 
 $m->content_contains('Enable Recurrence');
 
@@ -23,20 +19,24 @@ diag "Create a ticket with a recurrence in the General queue.";
 my $day = DateTime->now->add( days => 14 ); # Start in two weeks
 diag "Repeat start date is: " . $day->ymd;
 
-$m->submit_form_ok({
-    form_name => 'TicketCreate',
-    fields    => {
-        'Subject' => 'Set up recurring aperture maintenance',
-        'Content' => 'Perform work on portals on Thursday',
-        'repeat-lead-time' => 7,
-        'repeat-coexistent-number' => 2,
-        'repeat-enabled' => 1,
-        'repeat-type' => 'weekly',
-        'repeat-details-weekly' => 'week',
-        'repeat-details-weekly-week' => 1,
-        'repeat-details-weekly-weeks' => 'th',
-        'repeat-start-date' => $day->ymd,
-     },}, 'Create');
+$m->submit_form_ok(
+    {   form_name => 'TicketCreate',
+        fields    => {
+            'Subject'                     => 'Set up recurring aperture maintenance',
+            'Content'                     => 'Perform work on portals on Thursday',
+            'repeat-lead-time'            => 7,
+            'repeat-coexistent-number'    => 2,
+            'repeat-enabled'              => 1,
+            'repeat-type'                 => 'weekly',
+            'repeat-details-weekly'       => 'week',
+            'repeat-details-weekly-week'  => 1,
+            'repeat-details-weekly-weeks' => 'th',
+            'repeat-start-date'           => $day->ymd,
+        },
+        button => 'SubmitTicket',
+    },
+    'Create'
+);
 
 $m->text_like( qr/Ticket\s(\d+)\screated in queue/);
 
diff --git a/xt/weekly.t b/xt/weekly.t
index 8767b65..51790db 100644
--- a/xt/weekly.t
+++ b/xt/weekly.t
@@ -10,29 +10,29 @@ my ( $baseurl, $m ) = RT::Test->started_ok();
 
 ok( $m->login( 'root', 'password' ), 'logged in' );
 
-$m->submit_form_ok({
-    form_name => 'CreateTicketInQueue',
-    fields    => {
-       'Queue' => 'General' },
-    }, 'Click to create ticket');
+$m->submit_form_ok( { form_name => 'CreateTicketInQueue', }, 'Click to create ticket' );
 
 $m->content_contains('Enable Recurrence');
 
 diag "Create a ticket with a recurrence in the General queue.";
 
-$m->submit_form_ok({
-    form_name => 'TicketCreate',
-    fields    => {
-        'Subject' => 'Set up recurring aperture maintenance',
-        'Content' => 'Perform work on portals on Tuesday and Thursday',
-        'repeat-lead-time' => 7,
-        'repeat-coexistent-number' => 2,
-        'repeat-enabled' => 1,
-        'repeat-type' => 'weekly',
-        'repeat-details-weekly' => 'week',
-        'repeat-details-weekly-week' => 1,
-        'repeat-details-weekly-weeks' => 'th',
-     },}, 'Create');
+$m->submit_form_ok(
+    {   form_name => 'TicketCreate',
+        fields    => {
+            'Subject'                     => 'Set up recurring aperture maintenance',
+            'Content'                     => 'Perform work on portals on Tuesday and Thursday',
+            'repeat-lead-time'            => 7,
+            'repeat-coexistent-number'    => 2,
+            'repeat-enabled'              => 1,
+            'repeat-type'                 => 'weekly',
+            'repeat-details-weekly'       => 'week',
+            'repeat-details-weekly-week'  => 1,
+            'repeat-details-weekly-weeks' => 'th',
+        },
+        button => 'SubmitTicket',
+    },
+    'Create'
+);
 
 $m->text_like( qr/Ticket\s(\d+)\screated in queue/);
 
diff --git a/xt/yearly.t b/xt/yearly.t
index ff3ed94..0d65f6a 100644
--- a/xt/yearly.t
+++ b/xt/yearly.t
@@ -10,29 +10,29 @@ my ( $baseurl, $m ) = RT::Test->started_ok();
 
 ok( $m->login( 'root', 'password' ), 'logged in' );
 
-$m->submit_form_ok({
-    form_name => 'CreateTicketInQueue',
-    fields    => {
-       'Queue' => 'General' },
-    }, 'Click to create ticket');
+$m->submit_form_ok( { form_name => 'CreateTicketInQueue', }, 'Click to create ticket' );
 
 $m->content_contains('Enable Recurrence');
 
 diag "Create a ticket with a recurrence in the General queue.";
 
 my $day = DateTime->now;
-$m->submit_form_ok({
-    form_name => 'TicketCreate',
-    fields    => {
-        'Subject' => 'Set up monthly aperture maintenance',
-        'Content' => 'Perform work on portals on the first of each month',
-        'repeat-lead-time' => 21,
-        'repeat-coexistent-number' => 1,
-        'repeat-enabled' => 1,
-        'repeat-type' => 'yearly',
-        'repeat-details-yearly-day-month' => $day->month,
-        'repeat-details-yearly-day-day' => $day->day,
-     },}, 'Create');
+$m->submit_form_ok(
+    {   form_name => 'TicketCreate',
+        fields    => {
+            'Subject'                         => 'Set up monthly aperture maintenance',
+            'Content'                         => 'Perform work on portals on the first of each month',
+            'repeat-lead-time'                => 21,
+            'repeat-coexistent-number'        => 1,
+            'repeat-enabled'                  => 1,
+            'repeat-type'                     => 'yearly',
+            'repeat-details-yearly-day-month' => $day->month,
+            'repeat-details-yearly-day-day'   => $day->day,
+        },
+        button => 'SubmitTicket',
+    },
+    'Create'
+);
 
 $m->text_like( qr/Ticket\s(\d+)\screated in queue/);
 

commit ab30f36891bf2e6cf0886f3493d0ccd85791154a
Author: sunnavy <sunnavy at bestpractical.com>
Date:   Fri Jul 10 05:54:47 2020 +0800

    Remove unnecessary "undef $m"

diff --git a/xt/cf.t b/xt/cf.t
index 3b2308f..7bb9ab0 100644
--- a/xt/cf.t
+++ b/xt/cf.t
@@ -70,5 +70,4 @@ ok( RT::Extension::RepeatTicket::SetRepeatAttribute(
 is( $ticket->FirstCustomFieldValue('Original Ticket'),
     undef, 'Original Ticket is unset' );
 
-undef $m;
 done_testing;
diff --git a/xt/daily.t b/xt/daily.t
index 061b17e..e220327 100644
--- a/xt/daily.t
+++ b/xt/daily.t
@@ -112,5 +112,4 @@ sub run_tests{
     return $daily_id;
 }
 
-undef $m;
 done_testing;
diff --git a/xt/monthly.t b/xt/monthly.t
index 78548aa..be27f1b 100644
--- a/xt/monthly.t
+++ b/xt/monthly.t
@@ -64,5 +64,4 @@ is( $ticket2->DueObj->ISO(Time => 0), $day->ymd, 'Due on: ' . $day->ymd);
 is( $ticket2->Subject, $ticket2->DueObj->AsString . ' Set up monthly aperture maintenance',
     'Ticket subject matches subject configuration: ' . $ticket2->Subject);
 
-undef $m;
 done_testing;

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


More information about the Bps-public-commit mailing list