Bug 19970: Revise change of bug 19413 to work better for translations
authorOwen Leonard <oleonard@myacpl.org>
Thu, 31 May 2018 15:32:29 +0000 (15:32 +0000)
committerNick Clemens <nick@bywatersolutions.com>
Fri, 15 Jun 2018 10:35:41 +0000 (10:35 +0000)
This patch changes how the submit and cancel buttons appear in the MARC
008 plugin window. The controls are now displayed as buttons in a
floating toolbar.

To test you must have MARC tag 008 configured to use the
marc21_field_008.pl plugin.

- Apply the patch and open an existing or blank record in cataloging.
- Click the plugin link next to tag 008 to trigger the popup window.
- Confirm that "Save" and "Cancel" appear correctly in a toolbar.
- Scroll down the page to confirm that the toolbar "sticks" to the top
  of the window.
- Confirm that the "Save" and "Cancel" buttons work correctly.

Signed-off-by: Maryse Simard <maryse.simard@inlibro.com>
Followed the test plan and the patch works.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/marc21_field_008.tt

index f8746e5..d28c2c1 100644 (file)
 <h4 id="h4_result">&quot;[% result %]&quot;</h4>
 
 <form name="f_pop" id="f_pop" onsubmit="report()" action="">
-<fieldset class="action" id="fixedlengthbuilderaction"><input type="submit" value="OK" /> <a href="#" class="cancel close">Cancel</a></fieldset>
+    <div id="toolbar">
+        <div class="btn-group">
+            <button type="submit" class="btn btn-default btn-sm"><i class="fa fa-save"></i> Save</button>
+        </div>
+        <div class="btn-group">
+            <button type="button" class="btn btn-default btn-sm close_window"><i class="fa fa-remove"></i> Cancel</button>
+        </div>
+    </div>
+
 <input type="hidden" name="plugin_name" value="marc21_field_008.pl" />
 <input type="hidden" id="[% index %]" name="index" value="[% index %]" />
 <input type="hidden" name="result" id="result" value="[% result %]" />
 </form>
 
 [% MACRO jsinclude BLOCK %]
+    [% Asset.js("lib/jquery/plugins/jquery.fixFloat.js") %]
     [% Asset.js("js/xmlControlfield.js") %]
-    <script type="text/javascript">
+    <script>
+        $(document).ready(function(){
+            $('#toolbar').fixFloat();
+            $(".close_window").on("click", function(e){
+                e.preventDefault();
+                window.close();
+            });
+        });
         var objXmlControlField;
         var tr_result;
         var h4_result;