Bug 18035: Front-end changes to serials -> numbering patterns
authorAleisha Amohia <aleishaamohia@hotmail.com>
Thu, 2 Feb 2017 03:44:27 +0000 (03:44 +0000)
committerKyle M Hall <kyle@bywatersolutions.com>
Tue, 9 May 2017 20:55:56 +0000 (20:55 +0000)
This patch:
1) Uses datatables functionality on numbering patterns table
2) Shows breadcrumbs when using the form to add or modify numbering
patterns
3) Updates the Save, Reset, and Test Pattern buttons in the form to be
bootstrap 3 buttons

To test:
1) Confirm that datatable sorting works on all columns EXCEPT Actions
column
2) Click 'New numbering pattern'
3) Confirm breadcrumbs reads 'New numbering pattern'
4) Go back to numbering patterns and Edit an existing one
5) Confirm breadcrumbs reads 'Modifying number pattern '<name of
numbering pattern>'
6) Confirm Save, Reset and Test pattern buttons now show as bootstrap3
buttons
7) Confirm all buttons work as expected

Sponsored-by: Catalyst IT

Followed test plan works as expected.
Signed-off-by: Marc VĂ©ron <veron@veron.ch>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>

koha-tmpl/intranet-tmpl/prog/en/modules/serials/subscription-numberpatterns.tt

index 70b0503..1d76890 100644 (file)
@@ -2,6 +2,8 @@
 <title>Koha &rsaquo; Serials &rsaquo; Numbering patterns</title>
 [% INCLUDE 'doc-head-close.inc' %]
 [% INCLUDE 'calendar.inc' %]
+<link rel="stylesheet" type="text/css" href="[% interface %]/[% theme %]/css/datatables.css" />
+[% INCLUDE 'datatables.inc' %]
 <script type="text/javascript">
 //<![CDATA[
 
@@ -63,6 +65,14 @@ function show_blocking_subs() {
     $("#blocking_subs").show();
 }
 $(document).ready(function(){
+
+    $("#numberpatternst").dataTable($.extend(true, {}, dataTablesDefaults, {
+        "aoColumnDefs": [
+            { "aTargets": [ -1 ], "bSortable": false, "bSearchable": false },
+        ],
+        "sPaginationType": "four_button"
+    }));
+
     $(".delete_pattern").on("click",function(){
         return confirmDelete();
     });
@@ -86,6 +96,11 @@ $(document).ready(function(){
     <a href="/cgi-bin/koha/mainpage.pl">Home</a> &rsaquo;
     <a href="/cgi-bin/koha/serials/serials-home.pl">Serials</a> &rsaquo;
     <a href="/cgi-bin/koha/serials/subscription-numberpatterns.pl">Numbering patterns</a>
+    [% IF ( new ) %]
+        &rsaquo; New numbering pattern
+    [% ELSIF ( modify ) %]
+        &rsaquo; Modifying numbering pattern '[% label %]'
+    [% END %]
 </div>
 
 <div id="doc3" class="yui-t2">
@@ -223,8 +238,8 @@ $(document).ready(function(){
               </table>
             </fieldset>
             <fieldset class="action">
-              <input type="submit" value="Save" />
-              <input type="reset" value="Reset" />
+              <button type="submit" class="btn btn-default btn-sm">Save</button>
+              <button type="reset" class="btn btn-default btn-sm">Reset</button>
               <a class="cancel" href="/cgi-bin/koha/serials/subscription-numberpatterns.pl">Cancel</a>
             </fieldset>
           </form>
@@ -291,7 +306,7 @@ $(document).ready(function(){
                 </tbody>
               </table>
               <fieldset class="action">
-              <input type="button" id="test_pattern" value="Test pattern" />
+                  <button type="button" id="test_pattern" class="btn btn-default btn-sm">Test pattern</button>
               </fieldset>
               <div id="predictionpattern"></div>
             </fieldset>