From 94547432f400802ae77eb429cc0d1e2438a82e58 Mon Sep 17 00:00:00 2001 From: Owen Leonard Date: Sat, 5 Dec 2015 08:44:02 -0500 Subject: [PATCH] Bug 15318 - Use Bootstrap modal for MARC and Card preview when ordering an external source MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 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 page in Acquisitions for ordering from an external source so that the "MARC" and "Card" previews display in Bootstrap modals. This patch also fixes a bug where the in-table popup menu points to the wrong record (fixed in Cataloging by Bug 6367). To test: 1. Apply the patch and navigate to Acquisitions. 2. Locate an exsiting basket or create a new one. 3. Add to the basket using the option to order from an external source.. 4. Perform a search which will return multiple results. 5. Test the "MARC" and "Card" links for multiple results and confirm that the correct data is shown each time. 6. Click anywhere in the results table to show the hidden menu and test the "MARC" and "Card" links it displays, confirming that the data looks correct and corresponds correctly to the title you selected. Followed test plan, works as expected. Signed-off-by: Marc Véron Signed-off-by: Jonathan Druart Signed-off-by: Kyle M Hall --- .../prog/en/modules/acqui/z3950_search.tt | 43 +++++++++++++++---- 1 file changed, 34 insertions(+), 9 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/z3950_search.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/z3950_search.tt index 9b89e91892..6e1ad43475 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/z3950_search.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/z3950_search.tt @@ -1,6 +1,5 @@ [% INCLUDE 'doc-head-open.inc' %] Koha › Acquisitions › [% IF ( opsearch ) %]Order from external source[% ELSE %]Order from external source › Search results[% END %] -[% INCLUDE 'greybox.inc' %] [% INCLUDE 'doc-head-close.inc' %] [% INCLUDE 'datatables.inc' %] @@ -40,19 +39,31 @@ /* Inline edit/delete links */ $("td").click(function(event){ var $tgt = $(event.target); + var row = $(this).parent(); $(".linktools").hide(); $("tr").removeClass("selected"); - if($tgt.is("a")||$tgt.is(":nth-child(5)")||$tgt.is(":nth-child(6)")||$tgt.is(":nth-child(7)")||$tgt.is(":nth-child(8)")){ - return true; + row.addClass("selected"); + if($tgt.is("a")||$tgt.is(":nth-child(6)")||$tgt.is(":nth-child(7)")){ + //Don't show inline links for cells containing links of their own. } else { var position = $(this).offset(); var top = position.top+5; var left = position.left+5; $(".linktools",row).show().css("position","absolute").css("top",top).css("left",left); } - var row = $(this).parent(); - row.addClass("selected"); }); + $(".previewData").on("click", function(e){ + e.preventDefault(); + var ltitle = $(this).text(); + var page = $(this).attr("href"); + $("#dataPreviewLabel").text(ltitle); + $("#dataPreview .modal-body").load(page + " div"); + $('#dataPreview').modal({show:true}); + }); + $("#dataPreview").on("hidden", function(){ + $("#dataPreviewLabel").html(""); + $("#dataPreview .modal-body").html("
\"\" "+_("Loading")+"
"); + }); }); [% IF ( total_pages ) %] @@ -78,7 +89,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 !important; } +tr.selected { background-color : #FFFFCC; } tr.selected td { background-color : transparent !important; } #dataPreview { width : 80%; margin-left : -40%; } @media (max-width: 767px) { #dataPreview { margin: 0; width : auto; } } @@ -174,13 +185,13 @@ tr.selected { background-color : #FFFFCC; } tr.selected td { background-color : [% FOREACH breeding_loo IN breeding_loop %] [% IF ( breeding_loo.breedingid ) %] - [% IF ( breeding_loo.toggle ) %][% ELSE %][% END %] - [% breeding_loo.server %] + + [% breeding_loo.server %] [% breeding_loo.title |html %] [% breeding_loo.author %] [% breeding_loo.isbn %] [% breeding_loo.lccn %] - MARC | Card + MARC | Card Order @@ -188,6 +199,20 @@ tr.selected { background-color : #FFFFCC; } tr.selected td { background-color : [% END %] + + +
-- 2.39.5