From f5668ad4a27842611fcde8aaee693e724ce64e80 Mon Sep 17 00:00:00 2001 From: Owen Leonard Date: Sat, 5 Dec 2015 14:33:59 -0500 Subject: [PATCH] Bug 15316 - Use Bootstrap modal for authority Z39.50 search results preview MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit In order to reduce the number of dependencies for common interactions we should attempt to use Bootstrap modals in place of Greybox ones. This patch modifies the authorities Z39.50 search results page so that MARC previews are displayed in Bootstrap modals. This patch also modifies the authorities toolbar include file to make the Z39.50 search popup size match that in cataloging. Because the modal is triggered from a pop-up window, the modal has been reformated to exclude the footer and reduce the size of the modal header. To test: 1. Apply the patch and navigate to Authorities. 2. Click the "New from Z39.50" button to open the search window. 3. Perform any search which will return multiple results. 4. Test the visible "MARC" link for multiple results and confirm that the correct data is shown each time. 5. Click anywhere in the results table to show the hidden menu and test the "MARC" link it displays. Signed-off-by: Frédéric Demians --- .../prog/en/includes/authorities-toolbar.inc | 4 +-- .../en/modules/cataloguing/z3950_auth_search.tt | 29 +++++++++++++++++++--- 2 files changed, 27 insertions(+), 6 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/authorities-toolbar.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/authorities-toolbar.inc index 7f7d0b7..be37e50 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/authorities-toolbar.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/authorities-toolbar.inc @@ -9,10 +9,10 @@ $("#z3950submit").click(function(){ [% IF ( authid ) %] if (confirm(_("Please note that this Z39.50 search could replace the current record."))){ - window.open("/cgi-bin/koha/cataloguing/z3950_auth_search.pl?authid=[% authid %]","z3950search",'width=740,height=450,location=yes,toolbar=no,scrollbars=yes,resize=yes'); + window.open("/cgi-bin/koha/cataloguing/z3950_auth_search.pl?authid=[% authid %]","z3950search",'width=800,height=500,location=yes,toolbar=no,scrollbars=yes,resize=yes'); } [% ELSE %] - window.open("/cgi-bin/koha/cataloguing/z3950_auth_search.pl","z3950search",'width=740,height=450,location=yes,toolbar=no,scrollbars=yes,resize=yes'); + window.open("/cgi-bin/koha/cataloguing/z3950_auth_search.pl","z3950search",'width=800,height=500,location=yes,toolbar=no,scrollbars=yes,resize=yes'); [% END %] return false; }); diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/z3950_auth_search.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/z3950_auth_search.tt index bb21af7..de1c781 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/z3950_auth_search.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/z3950_auth_search.tt @@ -1,6 +1,5 @@ [% INCLUDE 'doc-head-open.inc' %] Koha › Z39.50 search results -[% INCLUDE 'greybox.inc' %] [% INCLUDE 'doc-head-close.inc' %] @@ -62,6 +61,18 @@ $(document).ready(function(){ e.preventDefault(); $("form[name='f']").find("input[type=text]").val(""); }); + $(".previewMARC").on("click", function(e){ + e.preventDefault(); + var ltitle = $(this).text(); + var page = $(this).attr("href"); + $("#marcPreviewLabel").text(ltitle); + $("#marcPreview .modal-body").load(page + " pre"); + $('#marcPreview').modal({show:true}); + }); + $("#marcPreview").on("hidden", function(){ + $("#marcPreviewLabel").html(""); + $("#marcPreview .modal-body").html("
\"\" "+_("Loading")+"
"); + }); }); [% IF ( total_pages ) %] @@ -87,7 +98,7 @@ function validate_goto_page(){ .linktools { background-color:#FFF;border-top:1px solid #DDD; border-left: 1px solid #DDD; border-right: 1px solid #666; border-bottom:1px solid #666;display: none; white-space: nowrap;} .linktools a { font-size : 85%; text-decoration:none; padding:.3em;;background-color:#FFF; display:block;float:left;border-right:1px solid #DDD;} .linktools a:hover { background-color:#EEE;color:#CC3300;border-right:1px solid #CCC;} -tr.selected { background-color : #FFFFCC; } tr.selected td { background-color : transparent; } +tr.selected { background-color : #FFFFCC; } tr.selected td { background-color : transparent; } #marcPreview { width : 90%; margin-left : -45%; top: 5%; } .modal-body { max-height: 380px; } .modal-header { padding: 0 14px; } @media (max-width: 767px) { #marcPreview { margin: 0; width : auto; } } [% IF ( opsearch ) %] @@ -164,10 +175,10 @@ tr.selected { background-color : #FFFFCC; } tr.selected td { background-color : [% FOREACH breeding_loo IN breeding_loop %] [% IF ( breeding_loo.breedingid ) %] - [% breeding_loo.server %] + [% breeding_loo.server %] [% breeding_loo.heading %] [% breeding_loo.heading_code %] - MARC + MARC Import @@ -175,6 +186,16 @@ tr.selected { background-color : #FFFFCC; } tr.selected td { background-color : [% END %] + +
-- 2.6.2