From 426a055a07a6b8c019d71831f1cf7aca512ee592 Mon Sep 17 00:00:00 2001 From: Agustin Moyano Date: Mon, 28 Oct 2019 18:15:22 -0300 Subject: [PATCH] Bug 22581: Show and play musical inscripts MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit This patch adds musical inscripts to OPAC's detail page To test: 1. run previous patch test plan 2. apply this patch 3. edit a the marc structure of a MARC bibliographic framework, and in tag 031 enable the following subfiels to be visible in editor: 2, g, n, o, p, u 4. search the catalog for a record that belongs to that framework, and edit tag 031 with the following: * 2:pe * g:G-2 * n:xFCGD * o:3/8 * p:'6B/{8B+(6B''E'B})({AFD})/{6.E3G},8B-/({6'EGF})({FAG})({GEB})/4F6- * u:http://nonexistent.org/url/of/a/midi 5. save and click in opac view CHECK => even though you add a 031 tag there is no musical inscript shown in opac view 6. in admin module enable OPACShowMusicalInscripts preference 7. refresh opac view SUCCESS => it takes a few seconds to load, but you see a link that says 'Audio file' pointing to the URL you placed in 'u' subfield, and below you see the musical inscript 8. in admin module enable OPACPlayMusicalInscripts preference 9. refresh opac view SUCCESS => You see a play button below the musical inscript, and when you click, the song is played 10. sign off Sponsored-by: Biblioteca Provincial Fr. Mamerto Esquiú (Provincia Franciscana de la Asunción) Co-authored-by: Owen Leonard Signed-off-by: Martin Renvoize Signed-off-by: Katrin Fischer Signed-off-by: Martin Renvoize --- C4/XSLT.pm | 2 +- .../bootstrap/en/modules/opac-detail.tt | 11 + .../en/xslt/MARC21slim2OPACDetail.xsl | 50 ++ .../en/xslt/NORMARCslim2OPACDetail.xsl | 50 ++ .../en/xslt/UNIMARCslim2OPACDetail.xsl | 50 ++ koha-tmpl/opac-tmpl/bootstrap/js/verovio.js | 108 +++++ .../lib/verovio/000_acoustic_grand_piano.data | Bin 0 -> 1340706 bytes .../lib/verovio/000_acoustic_grand_piano.js | 29 ++ .../opac-tmpl/lib/verovio/midiplayer.css | 27 ++ koha-tmpl/opac-tmpl/lib/verovio/midiplayer.js | 439 ++++++++++++++++++ .../opac-tmpl/lib/verovio/verovio-toolkit.js | 230 +++++++++ opac/opac-detail.pl | 4 +- 12 files changed, 998 insertions(+), 2 deletions(-) create mode 100644 koha-tmpl/opac-tmpl/bootstrap/js/verovio.js create mode 100644 koha-tmpl/opac-tmpl/lib/verovio/000_acoustic_grand_piano.data create mode 100644 koha-tmpl/opac-tmpl/lib/verovio/000_acoustic_grand_piano.js create mode 100644 koha-tmpl/opac-tmpl/lib/verovio/midiplayer.css create mode 100644 koha-tmpl/opac-tmpl/lib/verovio/midiplayer.js create mode 100644 koha-tmpl/opac-tmpl/lib/verovio/verovio-toolkit.js diff --git a/C4/XSLT.pm b/C4/XSLT.pm index 648bab28ab..ac67fe570d 100644 --- a/C4/XSLT.pm +++ b/C4/XSLT.pm @@ -173,7 +173,7 @@ sub get_xslt_sysprefs { TrackClicks opacthemes IdRef OpacSuppression OPACResultsLibrary OPACShowOpenURL OpenURLResolverURL OpenURLImageLocation - OpenURLText / ) + OpenURLText OPACShowMusicalInscripts OPACPlayMusicalInscripts / ) { my $sp = C4::Context->preference( $syspref ); next unless defined($sp); diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt index b286e155e9..6b2e6336af 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt +++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt @@ -33,6 +33,9 @@ [% IF ( LibraryNameTitle ) %][% LibraryNameTitle | html %][% ELSE %]Koha online[% END %] catalog › Details for: [% INCLUDE 'biblio-title-head.inc' %] [% INCLUDE 'doc-head-close.inc' %] [% Asset.css("lib/emoji-picker/css/emoji.css") | $raw %] + [% IF ( Koha.Preference('OPACShowMusicalInscripts') ) %] + [% Asset.css("lib/verovio/midiplayer.css") | $raw %] + [% END %] [% BLOCK cssinclude %][% END %] [% INCLUDE 'bodytag.inc' bodyid='opac-detail' bodyclass='scrollto' %] @@ -1414,6 +1417,14 @@ [% Asset.js("lib/kjua/kjua.min.js") | $raw %] [% END %] +[% IF ( Koha.Preference('OPACShowMusicalInscripts') ) %] + + [% Asset.js("js/verovio.js") | $raw %] +[% END %] +