From c399e6866d8e7c2d035e9556167315ac72948926 Mon Sep 17 00:00:00 2001 From: Hector Castro Date: Mon, 11 Apr 2016 15:49:29 -0600 Subject: [PATCH] Bug 16243: Add Mendeley reference manager to OPAC Mendeley provides a mechanism for export bib records to a personal account in a free reference manager and academic social network (similar to Zotero) To test: - Apply patch - Run perl installer/data/mysql/updatedatabase.pl - On master, search for the syspref MendeleyReferenceManager - Enable the option - Do a search for books - Notice about the new option 'Save to Mendeley' in search result, cart, record, and your list pages - Create an account in Mendeley (Is free) - Click in new option and notice that you can save bib references in Mendeley NOTE: Fixed according with QA comment Sponsored-by: Universidad de El Salvador --- .../bug_16243-add_mendeley_reference_manager.sql | 1 + installer/data/mysql/sysprefs.sql | 3 ++- .../en/modules/admin/preferences/enhanced_content.pref | 8 ++++++++ .../bootstrap/en/includes/opac-detail-sidebar.inc | 5 +++++ koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-basket.tt | 7 +++++++ koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt | 3 +++ koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-results.tt | 8 +++++++- koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-shelves.tt | 7 +++++++ koha-tmpl/opac-tmpl/bootstrap/images/mendeley.png | Bin 0 -> 572 bytes koha-tmpl/opac-tmpl/bootstrap/js/mendeley.js | 13 +++++++++++++ 10 files changed, 53 insertions(+), 2 deletions(-) create mode 100644 installer/data/mysql/atomicupdate/bug_16243-add_mendeley_reference_manager.sql create mode 100644 koha-tmpl/opac-tmpl/bootstrap/images/mendeley.png create mode 100644 koha-tmpl/opac-tmpl/bootstrap/js/mendeley.js diff --git a/installer/data/mysql/atomicupdate/bug_16243-add_mendeley_reference_manager.sql b/installer/data/mysql/atomicupdate/bug_16243-add_mendeley_reference_manager.sql new file mode 100644 index 0000000..44bd641 --- /dev/null +++ b/installer/data/mysql/atomicupdate/bug_16243-add_mendeley_reference_manager.sql @@ -0,0 +1 @@ +INSERT IGNORE INTO systempreferences (variable,value,explanation,options,type) VALUES ('MendeleyReferenceManager',NULL,'Add Mendeley reference manager to search results and bibliographic detail pages on the OPAC.',NULL,'free'); diff --git a/installer/data/mysql/sysprefs.sql b/installer/data/mysql/sysprefs.sql index ef4c3f0..f81e20d 100644 --- a/installer/data/mysql/sysprefs.sql +++ b/installer/data/mysql/sysprefs.sql @@ -532,5 +532,6 @@ INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` ('XSLTDetailsDisplay','default','','Enable XSL stylesheet control over details page display on intranet','Free'), ('XSLTResultsDisplay','default','','Enable XSL stylesheet control over results page display on intranet','Free'), ('z3950AuthorAuthFields','701,702,700',NULL,'Define the MARC biblio fields for Personal Name Authorities to fill biblio.author','free'), -('z3950NormalizeAuthor','0','','If ON, Personal Name Authorities will replace authors in biblio.author','YesNo') +('z3950NormalizeAuthor','0','','If ON, Personal Name Authorities will replace authors in biblio.author','YesNo'), +('MendeleyReferenceManager',NULL,NULL,'Add Mendeley reference manager to search results and bibliographic detail pages on the OPAC.','free') ; diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/enhanced_content.pref b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/enhanced_content.pref index ce8bee3..24bfa9d 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/enhanced_content.pref +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/enhanced_content.pref @@ -367,3 +367,11 @@ Enhanced Content: aws: Amazon Web Services gb: Google Books ol: Open Library + Mendeley reference manager: + - + - pref: MendeleyReferenceManager + choices: + yes: Add + no: "Don't add" + - Mendeley reference manager to search results and bibliographic detail pages on the OPAC. + diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/includes/opac-detail-sidebar.inc b/koha-tmpl/opac-tmpl/bootstrap/en/includes/opac-detail-sidebar.inc index d02b4c2..967df0c 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/includes/opac-detail-sidebar.inc +++ b/koha-tmpl/opac-tmpl/bootstrap/en/includes/opac-detail-sidebar.inc @@ -58,6 +58,11 @@ [% END %] [% END %] + [% IF Koha.Preference( 'MendeleyReferenceManager' ) %] +
  • + Save to Mendeley +
  • + [% END %] diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-basket.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-basket.tt index fa7e496..9d104f5 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-basket.tt +++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-basket.tt @@ -29,6 +29,10 @@ Print Empty and close Hide window + [% IF Koha.Preference( 'MendeleyReferenceManager' ) %] + | + Save to Mendeley + [% END %]
    @@ -426,4 +430,7 @@ //]]> [% END # / IF print_basket %] +[% IF Koha.Preference( 'MendeleyReferenceManager' ) %] + +[% END %] [% END # / BLOCK jsinclude %] 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 8e7efe4..c3d70db 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt +++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt @@ -1873,4 +1873,7 @@ //]]> [% END # / IF OPACPopupAuthorsSearch %] +[% IF Koha.Preference( 'MendeleyReferenceManager' ) %] + +[% END %] [% END %] diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-results.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-results.tt index 061ceed..20663db 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-results.tt +++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-results.tt @@ -160,7 +160,6 @@ [% END %] - [% IF ( TagsInputEnabled && loggedinusername ) %] @@ -176,6 +175,10 @@
    [% END %] + [% IF Koha.Preference( 'MendeleyReferenceManager' ) %] + | + Save to Mendeley + [% END %] @@ -981,4 +984,7 @@ $("input.newtag").on('keydown', function(e){ }); //]]> +[% IF Koha.Preference( 'MendeleyReferenceManager' ) %] + +[% END %] [% END %] diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-shelves.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-shelves.tt index ab704ab..f22b57a 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-shelves.tt +++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-shelves.tt @@ -278,6 +278,10 @@ [% END %] + [% IF Koha.Preference( 'MendeleyReferenceManager' ) %] + | + Save to Mendeley + [% END %]
    @@ -962,4 +966,7 @@ function Check(f) { } //]]> +[% IF Koha.Preference( 'MendeleyReferenceManager' ) %] + +[% END %] [% END %] diff --git a/koha-tmpl/opac-tmpl/bootstrap/images/mendeley.png b/koha-tmpl/opac-tmpl/bootstrap/images/mendeley.png new file mode 100644 index 0000000000000000000000000000000000000000..1008143b362c1673ab2dbbd239924f04ff8549e6 GIT binary patch literal 572 zcmV-C0>k}@P)p5OFM((w zQKKXff0ArkT7rWGp}1tVlbayA3NCKCw38w@iEY5aA%U)4N`}&{DU<1jRRxrw^ zyf+qYL&8vD9mqR#$ZPjtEc$v<-Ps*Vw6f`*p_n8+swJ>PYBkElyTaR_U#36rzxi77 z1bb1+SH*3T2^^X)sK~tFFg&WlirGpjoE_7Z*|p=A)9lYr>FcfImWQV(C(6w$C7QY( zt@DF2Wqxl!T1p8xG4M)5#+KdG>VKD4jh&Aq#OG%E^DlKkRWx_hOJ+VR6v>VItYBq+ ziK1uLRx)eL#PfwhgmhZL^wL6Ke$qZ_{C8YY3?%r~Bk<$KYeqW|0Cs;;lPu~iHZ zk|Y&fn-_mR`BR)yAQ2~jk=&T1z##mCag#bXj}iSEy@>$=JOxkKJvr-n(f4Ehy?t^< ztea}xN++Gu-?b0BEytw?Y1u9js+(IkN55dNYXnRyOsjZK+Fsj;nFVeu;?tfYNFm`d z-7vVX)K)codfrSZeBc=OT7`OAQN>3?Lp_(EneEa|1fIb=0R{jzbsz2X(L5pm0000< KMNUMnLSTZ|qXJg| literal 0 HcmV?d00001 diff --git a/koha-tmpl/opac-tmpl/bootstrap/js/mendeley.js b/koha-tmpl/opac-tmpl/bootstrap/js/mendeley.js new file mode 100644 index 0000000..e9ad403 --- /dev/null +++ b/koha-tmpl/opac-tmpl/bootstrap/js/mendeley.js @@ -0,0 +1,13 @@ +//Call for Mendeley Reference Manager + +function getMendeleyModal(){ + document.getElementsByTagName('body')[0].appendChild(document.createElement('script')).setAttribute('src','https://www.mendeley.com/minified/bookmarklet.js'); +} + +$(document).ready(function(){ + $( "#mendeley_modal" ).click(function( event ){ + event.preventDefault(); + getMendeleyModal(); + return false; + }); +}); -- 1.7.10.4