View | Details | Raw Unified | Return to bug 16243
Collapse All | Expand All

(-)a/installer/data/mysql/atomicupdate/bug_16243-add_reference_managers.sql (+1 lines)
Line 0 Link Here
1
INSERT IGNORE INTO systempreferences (variable,value,explanation,options,type) VALUES ('OpacReferenceManager','mendeley,easybib','Select reference manager software options that should be available from OPAC detail, basket and list pages.','','multiple');
(-)a/installer/data/mysql/sysprefs.sql (-1 / +2 lines)
Lines 532-536 INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` Link Here
532
('XSLTDetailsDisplay','default','','Enable XSL stylesheet control over details page display on intranet','Free'),
532
('XSLTDetailsDisplay','default','','Enable XSL stylesheet control over details page display on intranet','Free'),
533
('XSLTResultsDisplay','default','','Enable XSL stylesheet control over results page display on intranet','Free'),
533
('XSLTResultsDisplay','default','','Enable XSL stylesheet control over results page display on intranet','Free'),
534
('z3950AuthorAuthFields','701,702,700',NULL,'Define the MARC biblio fields for Personal Name Authorities to fill biblio.author','free'),
534
('z3950AuthorAuthFields','701,702,700',NULL,'Define the MARC biblio fields for Personal Name Authorities to fill biblio.author','free'),
535
('z3950NormalizeAuthor','0','','If ON, Personal Name Authorities will replace authors in biblio.author','YesNo')
535
('z3950NormalizeAuthor','0','','If ON, Personal Name Authorities will replace authors in biblio.author','YesNo'),
536
('OpacReferenceManager','mendeley,easybib','','Select reference manager software options that should be available from OPAC detail, basket and list pages.','multiple')
536
;
537
;
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref (+6 lines)
Lines 258-263 OPAC: Link Here
258
              type: htmlarea
258
              type: htmlarea
259
              class: code
259
              class: code
260
        -
260
        -
261
            - 'Select reference manager software options that should be available from OPAC detail, basket and list pages:'
262
            - pref: OpacReferenceManager
263
              multiple:
264
                mendeley: Mendeley (Reference Manager Software)
265
                easybib: EasyBib (Free Bibliography Generator)
266
        -
261
            - pref: OpacAddMastheadLibraryPulldown
267
            - pref: OpacAddMastheadLibraryPulldown
262
              choices: 
268
              choices: 
263
                  yes: Add
269
                  yes: Add
(-)a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-results.tt (-1 / +56 lines)
Lines 160-166 Link Here
160
                                                <span class="addto"></span>
160
                                                <span class="addto"></span>
161
                                            [% END %]
161
                                            [% END %]
162
                                            <span id="placehold"><!-- input class="submit" type="submit" value="Place Hold"/ --></span>
162
                                            <span id="placehold"><!-- input class="submit" type="submit" value="Place Hold"/ --></span>
163
164
                                            [% IF ( TagsInputEnabled && loggedinusername ) %]
163
                                            [% IF ( TagsInputEnabled && loggedinusername ) %]
165
                                                <span id="tagsel_span">
164
                                                <span id="tagsel_span">
166
                                                    <input id="tagsel_tag" class="disabled" type="submit" value="Tag"/>
165
                                                    <input id="tagsel_tag" class="disabled" type="submit" value="Tag"/>
Lines 176-181 Link Here
176
                                                </div>
175
                                                </div>
177
                                            [% END %]
176
                                            [% END %]
178
                                        </span> <!-- / .links -->
177
                                        </span> <!-- / .links -->
178
    [% SET reference_manager_options = Koha.Preference('OpacReferenceManager').split(',') %]
179
    [% IF reference_manager_options.size %]
180
                                        <span class="sep">|</span>
181
        <li class="dropdown">
182
                    <a id="reference_manager" class="dropdown-toggle" role="button" data-toggle="dropdown" href="#">Export to Reference Manager <b class="caret"></b></a>
183
                        <ul class="dropdown-menu" role="menu" aria-labelledby="listsmenu">
184
                            [% FOREACH option IN reference_manager_options %]
185
                                [% IF option == 'mendeley' %]
186
                                <li role="presentation">
187
                                    <a role="menuitem" tabindex="-1" href="#" id="mendeley_modal"><img src="[% interface %]/[% theme %]/images/mendeley.png"/> Save to Mendeley</a>
188
                                </li>
189
                                [% ELSE %]
190
                                <li role="presentation">
191
                                    <a role="menuitem" tabindex="-1" href="#" data-toggle="modal" data-target="#exportModal_" id="easybib_modal"><img src="[% interface %]/[% theme %]/images/easybib.png"/> Cite on EasyBib</a>
192
                                </li>
193
                                [% END %]
194
                            [% END %]
195
                        </ul>
196
        </li>
197
    [% END %]
179
                                </div> <!-- / #selections-toolbar -->
198
                                </div> <!-- / #selections-toolbar -->
180
199
181
                                <!-- TABLE RESULTS START -->
200
                                <!-- TABLE RESULTS START -->
Lines 981-984 $("input.newtag").on('keydown', function(e){ Link Here
981
});
1000
});
982
//]]>
1001
//]]>
983
</script>
1002
</script>
1003
[% IF Koha.Preference( 'OpacReferenceManager' ) %]
1004
1005
<!-- Reference Manager Modal (EasyBib) -->
1006
<div class="modal hide" id="exportModal_" tabindex="-1" role="dialog" aria-labelledby="exportLabelexportModal_" aria-hidden="true">
1007
    <div class="modal-header">
1008
        <button type="button" class="closebtn" data-dismiss="modal" aria-hidden="true">&times;</button>
1009
        <h3 class="modal-title" id="exportModalLabel">Cite your sources on EasyBib</h3>
1010
    </div>
1011
    <form method="get" role="form" id="easybib_form">
1012
    <div class="modal-body">
1013
        <div id="selections-toolbar" class="toolbar">
1014
            <a id="CheckAllEasy" href="#">Select all</a>
1015
            <span class="sep">|</span>
1016
            <a id="CheckNoneEasy" href="#">Clear all</a>
1017
            <span class="sep">|</span>
1018
        </div>
1019
        <fieldset id="dc_fieldset">
1020
            <div id="content" class="checkbox">
1021
            </div>
1022
        <input name="format" value="ris" type="hidden">
1023
        </fieldset>
1024
    </div>
1025
    <div class="modal-footer">
1026
        <button type="submit" class="btn">Export</button>
1027
        <button class="btn btn-link" data-dismiss="modal" aria-hidden="true">Cancel</button>
1028
    </div>
1029
    </form>
1030
<form method="post" id="ris_form" action="http://www.easybib.com/impexport/index/add" target="_blank" style="display:none;">
1031
<textarea id="mytest" name="records"></textarea>
1032
<input type="submit">
1033
</form>
1034
</div>
1035
1036
<script type="text/javascript" src="[% interface %]/[% theme %]/js/reference_manager.js"></script>
1037
1038
[% END %]
984
[% END %]
1039
[% END %]
(-)a/koha-tmpl/opac-tmpl/bootstrap/js/reference_manager.js (+72 lines)
Line 0 Link Here
1
//Invoke for Mendeley Reference Manager
2
3
function getMendeleyModal(){
4
    document.getElementsByTagName('body')[0].appendChild(document.createElement('script')).setAttribute('src','https://www.mendeley.com/minified/bookmarklet.js');
5
}
6
7
$(document).ready(function(){
8
    $( "#mendeley_modal" ).click(function( event ){
9
        event.preventDefault();
10
        getMendeleyModal();
11
        return false;
12
    });
13
});
14
15
//EasyBib
16
17
$(document).ready(function(){
18
19
    $("#CheckAllEasy").click(function(){
20
        $( ".easycheck" ).prop( "checked", true );
21
    });
22
23
    $("#CheckNoneEasy").click(function(){
24
        $( ".easycheck" ).prop( "checked", false );
25
    });
26
27
    $("#easybib_modal").click(function(){
28
      $( ".cb" ).each(function( index ) {
29
      var value = $( this ).val();
30
      var id = "biblionumber" + value;
31
      var checkbox = "<input type='checkbox' name='bib' value='" + value + "' id='" + id + "' class='easycheck'>";
32
      $( checkbox ).appendTo( "#content" );
33
34
     $( ".title" ).each(function( i ) {
35
        var title = $( this ).text();
36
        var href = $( this ).attr("href");
37
        var url = "/cgi-bin/koha/opac-detail.pl?biblionumber=" + value + "&query_desc=";
38
        if ( href == url){
39
          var label = "<label for='" + id + "' class='label_dc'>" + title + "</label>";
40
          $( label ).appendTo( "#content" );
41
          $( "<br>" ).appendTo( "#content" );
42
          $( "<hr>" ).appendTo( "#content" );
43
        }
44
       });
45
      });
46
    });
47
});
48
49
$( "#easybib_form" ).submit(function( event ) {
50
    event.preventDefault();
51
    var recordSelected = [];
52
    var totalSeleceted;
53
        $.each($(".easycheck:checked"), function(){
54
            recordSelected.push($(this).val());
55
        });
56
        if ( recordSelected.length > 0 ) {
57
            totalSeleceted = recordSelected.join( "/" );
58
            $.ajax({
59
                url: "/cgi-bin/koha/opac-downloadcart.pl",
60
                contentType: "application/x-www-form-urlencoded; charset=UTF-8",
61
                type: "post",
62
                data: { format: "ris", bib_list: totalSeleceted },
63
                success: function( data ){
64
                    $( "#mytest" ).html(data);
65
                    $( "#ris_form" ).submit();
66
                    $( ".closebtn" ).click();
67
                }
68
            });
69
        } else {
70
            alert (_("Please select at least one title to cite on EasyBib") );
71
        }
72
});
(-)a/opac/opac-downloadcart.pl (-1 / +1 lines)
Lines 90-95 if ($bib_list && $format) { Link Here
90
    print $query->header(
90
    print $query->header(
91
                               -type => ($type) ? $type : 'application/octet-stream',
91
                               -type => ($type) ? $type : 'application/octet-stream',
92
        -'Content-Transfer-Encoding' => 'binary',
92
        -'Content-Transfer-Encoding' => 'binary',
93
                         -charset    => 'utf-8',
93
                         -attachment => ($extension) ? "cart.$format.$extension" : "cart.$format"
94
                         -attachment => ($extension) ? "cart.$format.$extension" : "cart.$format"
94
    );
95
    );
95
    print $output;
96
    print $output;
96
- 

Return to bug 16243