Browse Source

Bug 15320 - Use Bootstrap modal for MARC preview when ordering from an existing record

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
existing record so that the "View MARC" preview is displayed in
Bootstrap modals.

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 search for an existing
   record.
4. Perform any search which will return results.
5. Test the "View MARC" link for multiple results and confirm
   that the correct data is shown each time.

Signed-off-by: Marc Véron <veron@veron.ch>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
new_12478_elasticsearch
Owen Leonard 9 years ago
committed by Kyle M Hall
parent
commit
c0e6b9b14a
  1. 27
      koha-tmpl/intranet-tmpl/prog/en/modules/acqui/neworderbiblio.tt

27
koha-tmpl/intranet-tmpl/prog/en/modules/acqui/neworderbiblio.tt

@ -1,7 +1,6 @@
[% INCLUDE 'doc-head-open.inc' %]
<title>Koha &rsaquo; Acquisitions &rsaquo; Search existing records</title>
<link rel="stylesheet" type="text/css" href="[% themelang %]/css/datatables.css" />
[% INCLUDE 'greybox.inc' %]
[% INCLUDE 'doc-head-close.inc' %]
[% INCLUDE 'datatables.inc' %]
<script type="text/javascript">
@ -14,6 +13,18 @@
'bInfo': false,
'bSort': false,
} ) );
$(".previewMARC").on("click", function(e){
e.preventDefault();
var ltitle = $(this).text();
var page = $(this).attr("href");
$("#marcPreviewLabel").text(ltitle);
$("#marcPreview .modal-body").load(page + " table");
$('#marcPreview').modal({show:true});
});
$("#marcPreview").on("hidden", function(){
$("#marcPreviewLabel").html("");
$("#marcPreview .modal-body").html("<div id=\"loading\"><img src=\"[% interface %]/[% theme %]/img/loading-small.gif\" alt=\"\" /> "+_("Loading")+"</div>");
});
});
//]]>
</script>
@ -79,7 +90,7 @@
[% biblio.copyrightdate %]
</td>
<td>
<a href="/cgi-bin/koha/catalogue/showmarc.pl?id=[% biblio.biblionumber %]" title="MARC" rel="gb_page_center[600,500]">View MARC</a>
<a href="/cgi-bin/koha/catalogue/showmarc.pl?id=[% biblio.biblionumber %]&amp;viewas=html" class="previewMARC">View MARC</a>
</td>
<td>
<a href="/cgi-bin/koha/acqui/neworderempty.pl?booksellerid=[% booksellerid %]&amp;basketno=[% basketno %]&amp;biblionumber=[% biblio.biblionumber %]" title="Order this one">
@ -90,6 +101,18 @@
[% END %]
</tbody>
</table>
<div id="marcPreview" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="marcPreviewLabel" aria-hidden="true">
<div class="modal-header">
<button type="button" class="closebtn" data-dismiss="modal" aria-hidden="true">×</button>
<h3 id="marcPreviewLabel">MARC preview</h3>
</div>
<div class="modal-body">
<div id="loading"> <img src="[% interface %]/[% theme %]/img/loading-small.gif" alt="" /> Loading </div>
</div>
<div class="modal-footer">
<button class="btn" data-dismiss="modal" aria-hidden="true">Close</button>
</div>
</div>
</div>
[% END %]

Loading…
Cancel
Save