Bugzilla – Attachment 130312 Details for
Bug 30041
Add MARC and Card preview to biblio search results
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 30041: Add MARC and Card preview to biblio search results
Bug-30041-Add-MARC-and-Card-preview-to-biblio-sear.patch (text/plain), 4.65 KB, created by
Lucas Gass (lukeg)
on 2022-02-08 16:36:45 UTC
(
hide
)
Description:
Bug 30041: Add MARC and Card preview to biblio search results
Filename:
MIME Type:
Creator:
Lucas Gass (lukeg)
Created:
2022-02-08 16:36:45 UTC
Size:
4.65 KB
patch
obsolete
>From 3187a61f78c6672e6dd320387af5e602194fb8db Mon Sep 17 00:00:00 2001 >From: Aleisha Amohia <aleishaamohia@hotmail.com> >Date: Tue, 8 Feb 2022 00:52:55 +0000 >Subject: [PATCH] Bug 30041: Add MARC and Card preview to biblio search results > >This enhancement adds MARC preview and Card preview links to the normal >catalogue search results. > >To test: >1) Do a catalogue search in the staff client (use the 'Search the > catalogue' tab, do not do a search that searches both the catalogue > and the reservoir). >2) Notice there is no quick way to view the MARC and Card previews for >each search result. >3) Apply patch and refresh the search results page >4) Confirm there are now links for both the MARC and Card previews >5) Confirm these popups show details of the records as expected > >Sponsored-by: Education Services Australia SCIS > >Signed-off-by: Lucas Gass <lucas@bywatersolutions.com> >--- > .../prog/en/modules/catalogue/results.tt | 40 +++++++++++++++++++ > 1 file changed, 40 insertions(+) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/results.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/results.tt >index 59def93d62..2985aac865 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/results.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/results.tt >@@ -541,6 +541,14 @@ > | <a href="[% Koha.Preference('OPACBaseURL') | url %]/cgi-bin/koha/opac-detail.pl?biblionumber=[% SEARCH_RESULT.biblionumber | uri %]" target="_blank">OPAC view</a> > </span> > [% END %] >+ >+ <span class="marc-preview"> >+ | <a href="/cgi-bin/koha/catalogue/showmarc.pl?id=[% SEARCH_RESULT.biblionumber | uri %]" class="previewData">MARC preview</a> >+ </span> >+ >+ <span class="card-preview"> >+ | <a href="/cgi-bin/koha/catalogue/showmarc.pl?viewas=card&&id=[% SEARCH_RESULT.biblionumber | uri %]" class="previewData">Card preview</a> >+ </span> > </p> <!-- /.holds --> > </td> > >@@ -683,6 +691,24 @@ > </form> > > </main> >+ >+ <div id="dataPreview" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="dataPreviewLabel" aria-hidden="true"> >+ <div class="modal-dialog"> >+ <div class="modal-content"> >+ <div class="modal-header"> >+ <button type="button" class="closebtn" data-dismiss="modal" aria-hidden="true">Ã</button> >+ <h3 id="dataPreviewLabel">Preview</h3> >+ </div> >+ <div class="modal-body"> >+ <div id="loading"> <img src="[% interface | html %]/[% theme | html %]/img/spinner-small.gif" alt="" /> Loading </div> >+ </div> >+ <div class="modal-footer"> >+ <button class="btn btn-default" data-dismiss="modal" aria-hidden="true">Close</button> >+ </div> >+ </div> <!-- /.modal-content --> >+ </div> <!-- /.modal-dialog --> >+ </div> <!-- /#dataPreview --> >+ > </div> <!-- /.col-sm-10.col-sm-push-2 --> > > <div class="col-sm-2 col-sm-pull-10"> >@@ -738,6 +764,20 @@ > first_biblionumber: "[% SEARCH_RESULTS.first.biblionumber | html %]", > last_biblionumber: "[% SEARCH_RESULTS.last.biblionumber | html %]", > } >+ $(document).ready(function(){ >+ $(".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.bs.modal", function(){ >+ $("#dataPreviewLabel").html(""); >+ $("#dataPreview .modal-body").html("<div id=\"loading\"><img src=\"[% interface | html %]/[% theme | html %]/img/spinner-small.gif\" alt=\"\" /> "+_("Loading")+"</div>"); >+ }); >+ }); > </script> > [% Asset.js("js/pages/results.js") | $raw %] > [% END %] >-- >2.20.1
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 30041
:
130251
| 130312