From 4073d95c0601041c7f3e5a37349c01af043f716a Mon Sep 17 00:00:00 2001 From: Owen Leonard Date: Mon, 15 Oct 2018 15:10:28 +0000 Subject: [PATCH] Bug 21573: Move lists barcode and biblionumber entry form to modal This patch modifies the staff client lists page so that the barcode/biblionumber entry form from the left hand sidebar into a modal window, triggered by a button in the toolbar. To test, apply the patch and rebuild the staff client CSS (https://wiki.koha-community.org/wiki/Working_with_SCSS_in_the_OPAC_and_staff_client). - View the contents of a list in the staff client, logged in as a user who has permission to add items. - Click the "Add items" button. A modal window should appear with the barcode/biblionumber entry form. - Submit barcodes and/or biblionumbers and confirm that the correct titles are added to the list. - Log in again as a user who does not have permission to add to the list. Confirm that the button isn't present. --- .../intranet-tmpl/prog/css/src/staff-global.scss | 8 ++ .../prog/en/includes/virtualshelves-toolbar.inc | 8 ++ .../prog/en/modules/virtualshelves/shelves.tt | 85 ++++++++++++---------- 3 files changed, 62 insertions(+), 39 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/css/src/staff-global.scss b/koha-tmpl/intranet-tmpl/prog/css/src/staff-global.scss index 8fc9058..d5d6920 100644 --- a/koha-tmpl/intranet-tmpl/prog/css/src/staff-global.scss +++ b/koha-tmpl/intranet-tmpl/prog/css/src/staff-global.scss @@ -3466,6 +3466,14 @@ label { .modal-body { background-color: #FFF; overflow-y: auto; + + fieldset, + ol { + background-color: transparent; + border: 0; + margin: 0; + padding: 0; + } } .modal-content { diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/virtualshelves-toolbar.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/virtualshelves-toolbar.inc index 8d2df29..af366dc 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/virtualshelves-toolbar.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/virtualshelves-toolbar.inc @@ -3,6 +3,14 @@
+ [% IF ( can_add_biblios ) %] +
+ +
+ [% END %] + [% IF shelf AND op == 'view' %] [% IF can_manage_shelf %]
diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/virtualshelves/shelves.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/virtualshelves/shelves.tt index 2dce377..9506c48 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/virtualshelves/shelves.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/virtualshelves/shelves.tt @@ -59,16 +59,10 @@ [% IF op == 'view' %]› Contents of [% shelf.shelfname | html %][% END %][% IF op == 'add_form' %] › Create new list[% END %][% IF op == 'edit_form' %] › Edit list [% shelf.shelfname | html %][% END %]
-[% IF ( can_add_biblios ) %] -
-
-
-[% ELSE %]
-
-[% END %] -
+
+
[% INCLUDE 'virtualshelves-toolbar.inc' %] @@ -393,38 +387,48 @@
- [% IF ( can_add_biblios ) %] -
- -
- [% END %]
+[% IF ( can_add_biblios ) %] + + +[% END %] + [% MACRO jsinclude BLOCK %] [% INCLUDE 'datatables.inc' %] [% Asset.js("lib/jquery/plugins/jquery.dataTables.columnFilter.js") | $raw %] @@ -453,8 +457,8 @@ [% ELSE %] var type = [% PRIVATE | html %]; [% END %] - var dtListResults = $("#listresultst").dataTable($.extend(true, {}, dataTablesDefaults, { + var dtListResults = $("#listresultst").dataTable($.extend(true, {}, dataTablesDefaults, { "aaSorting": [[ 5, "asc" ]], 'bServerSide': true, 'sAjaxSource': "/cgi-bin/koha/svc/virtualshelves/search", @@ -612,6 +616,9 @@ e.preventDefault(); } }); + $("#addToList").on("shown.bs.modal", function(e){ + $("#barcodes").focus(); + }); }); [% END %] -- 2.1.4