From efd4121941fb129adc57bca35483cd3334884820 Mon Sep 17 00:00:00 2001 From: Owen Leonard Date: Wed, 14 Aug 2019 21:50:00 +0000 Subject: [PATCH] Bug 23464: Update the process of quick spine label printing This patch makes changes to the way quick spine label printing works, either from the bibliographic details page or the Quick spine label creator page. To test, apply the patch and go to Tools -> Quick spine label creator. - Type or scan a barcode. Submitting the form should trigger a popup window with the spine label print page. The "print" button should be centered at the bottom of the window in a footer-like container. - If you have SpineLabelAutoPrint enabled, the print dialog should appear automatically. - After printing, the pop-up window should close and and focus should be returned to the barcode field. Enable the SpineLabelShowPrintOnBibDetails system preference. View the bibliographic details page for a record in the catalog. - In the holdings table, a "Spine label" column should appear as the second-to-last column. The column should contain "Print label" Bootstrap-style buttons. - Clicking a "Print label" button should trigger a pop-up window with the spine label print page. The behavior of the window should be the same as above. Signed-off-by: Maryse Simard Signed-off-by: Katrin Fischer Signed-off-by: Martin Renvoize --- .../intranet-tmpl/prog/css/spinelabel.css | 14 +++++++-- .../prog/en/modules/catalogue/detail.tt | 16 ++++++---- .../prog/en/modules/labels/spinelabel-home.tt | 12 +++++++- .../en/modules/labels/spinelabel-print.tt | 30 +++++++++++-------- 4 files changed, 50 insertions(+), 22 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/css/spinelabel.css b/koha-tmpl/intranet-tmpl/prog/css/spinelabel.css index f0e3ead39c..b62e8de688 100644 --- a/koha-tmpl/intranet-tmpl/prog/css/spinelabel.css +++ b/koha-tmpl/intranet-tmpl/prog/css/spinelabel.css @@ -20,8 +20,16 @@ body { top: 75px; } +#spinelabel { + +} + #print_button { - position: absolute; - top: 25px; - left: 500px; + bottom: 0; + padding: 1em; + position: absolute; + text-align: center; + width: 100%; + border-top: 1px solid #b9d8d9; + background-color: #e6f0f2; } \ No newline at end of file diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt index 3819628274..05f6ba3dcc 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt @@ -209,10 +209,10 @@ [% IF materials %]Materials specified[% END %] [% IF ( itemdata_itemnotes ) %]Public notes[% END %] [% IF ( itemdata_nonpublicnotes ) %]Non-public notes[% END %] - [% IF ( SpineLabelShowPrintOnBibDetails ) %]Spine label[% END %] [% IF ( hostrecords ) %]Host records[% END %] [% IF ( analyze ) %]Used in[% END %] [% IF ( ShowCourseReserves ) %]Course Reserves[% END %] + [% IF ( SpineLabelShowPrintOnBibDetails ) %]Spine label[% END %] [% IF ( CAN_user_editcatalogue_edit_items ) %] [% END %] @@ -365,9 +365,6 @@ [% IF itemdata_nonpublicnotes %] [% item.itemnotes_nonpublic | html %] [% END %] - [% IF ( SpineLabelShowPrintOnBibDetails ) %] - Print label - [% END %] [% IF ( hostrecords ) %] [% IF ( item.hostbiblionumber) %][% item.hosttitle | html %][% END %] [% END %] @@ -400,6 +397,11 @@ [% END %] [% END %] + + [% IF ( SpineLabelShowPrintOnBibDetails ) %] + Print label + [% END %] + [% IF CAN_user_editcatalogue_edit_items %] [% UNLESS item.cannot_be_edited %] @@ -937,7 +939,11 @@ } }); [% END %] - + $(".print-label").on("click", function(e){ + e.preventDefault(); + link = $(this).attr("href"); + openWindow(link,"Print spine label",400,400); + }); }); [% IF ( AmazonCoverImages || LocalCoverImages ) %]$(window).load(function() { diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/labels/spinelabel-home.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/labels/spinelabel-home.tt index 1e277c5169..78a6a666fe 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/labels/spinelabel-home.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/labels/spinelabel-home.tt @@ -17,7 +17,7 @@

Quick spine label creator

-
+
  1. @@ -40,6 +40,16 @@ [% MACRO jsinclude BLOCK %] [% Asset.js("js/tools-menu.js") | $raw %] + [% END %] [% INCLUDE 'intranet-bottom.inc' %] diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/labels/spinelabel-print.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/labels/spinelabel-print.tt index 3de990de1a..089a94d95b 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/labels/spinelabel-print.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/labels/spinelabel-print.tt @@ -1,11 +1,9 @@ [% USE raw %] [% USE Asset %] [% SET footerjs = 1 %] - -[% IF ( bidi ) %][% ELSE %][% END %] - +[% INCLUDE 'doc-head-open.inc' %] Koha › Tools › Spine labels - +[% INCLUDE 'doc-head-close.inc' popup => 1 %] [% Asset.css("css/spinelabel.css") | $raw %]