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

(-)a/.gitignore (-1 / +1 lines)
Lines 4-7 Link Here
4
/pm_to_blib
4
/pm_to_blib
5
node_modules/
5
node_modules/
6
koha-tmpl/opac-tmpl/bootstrap/css/maps/
6
koha-tmpl/opac-tmpl/bootstrap/css/maps/
7
koha-tmpl/intranet-tmpl/prog/css/maps/
7
koha-tmpl/intranet-tmpl/prog/css/maps/
(-)a/installer/data/mysql/atomicupdate/add-syspref-AuthorityXSLTOpacResultsDisplay.perl (+9 lines)
Line 0 Link Here
1
$DBversion = 'XXX';
2
if (CheckVersion($DBversion)) {
3
    $dbh->do(q{
4
        INSERT IGNORE INTO systempreferences (`variable`, `value`, `options`, `explanation`, `type`)
5
        VALUES ('AuthorityXSLTOpacResultsDisplay','','','Enable XSL stylesheet control over authority results page display on opac','Free')
6
    });
7
8
    NewVersion($DBversion, '11083', 'Add syspref AuthorityXSLTOpacResultsDisplay');
9
}
(-)a/installer/data/mysql/mandatory/sysprefs.sql (+1 lines)
Lines 69-74 INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` Link Here
69
('AuthorityMergeLimit','50',NULL,'Maximum number of biblio records updated immediately when an authority record has been modified.','integer'),
69
('AuthorityMergeLimit','50',NULL,'Maximum number of biblio records updated immediately when an authority record has been modified.','integer'),
70
('AuthorityMergeMode','loose','loose|strict','Authority merge mode','Choice'),
70
('AuthorityMergeMode','loose','loose|strict','Authority merge mode','Choice'),
71
('AuthoritySeparator','--','10','Used to separate a list of authorities in a display. Usually --','free'),
71
('AuthoritySeparator','--','10','Used to separate a list of authorities in a display. Usually --','free'),
72
('AuthorityXSLTOpacResultsDisplay','','','Enable XSL stylesheet control over authority results page display on opac','Free'),
72
('AuthSuccessLog','0',NULL,'If enabled, log successful authentications','YesNo'),
73
('AuthSuccessLog','0',NULL,'If enabled, log successful authentications','YesNo'),
73
('autoBarcode','OFF','incremental|annual|hbyymmincr|EAN13|OFF','Used to autogenerate a barcode: incremental will be of the form 1, 2, 3; annual of the form 2007-0001, 2007-0002; hbyymmincr of the form HB08010001 where HB=Home Branch','Choice'),
74
('autoBarcode','OFF','incremental|annual|hbyymmincr|EAN13|OFF','Used to autogenerate a barcode: incremental will be of the form 1, 2, 3; annual of the form 2007-0001, 2007-0002; hbyymmincr of the form HB08010001 where HB=Home Branch','Choice'),
74
('AutoCreateAuthorities','0',NULL,'Automatically create authorities that do not exist when cataloging records.','YesNo'),
75
('AutoCreateAuthorities','0',NULL,'Automatically create authorities that do not exist when cataloging records.','YesNo'),
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/staff_interface.pref (+4 lines)
Lines 1-6 Link Here
1
Staff interface:
1
Staff interface:
2
    Appearance:
2
    Appearance:
3
        -
3
        -
4
            - 'Display authority results in the opac interface using XSLT stylesheet at: '
5
            - pref: AuthorityXSLTOpacResultsDisplay
6
              class: file
7
            - '<br />Options:<ul><li>Put a path to define a xslt file</li><li>Put an URL for an external specific stylesheet.</li></ul>{langcode} will be replaced with current interface language and {authtypecode} will be replaced by the authority type code'
4
            - "Display language selector on "
8
            - "Display language selector on "
5
            - pref: StaffLangSelectorMode
9
            - pref: StaffLangSelectorMode
6
              choices:
10
              choices:
(-)a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-authoritiessearchresultlist.tt (-1 / +7 lines)
Lines 105-111 Link Here
105
                                    <tbody>
105
                                    <tbody>
106
                                        [% FOREACH resul IN result %]
106
                                        [% FOREACH resul IN result %]
107
                                            <tr>
107
                                            <tr>
108
                                                <td>[% PROCESS authresult summary=resul.summary %]</td>
108
                                                <td>
109
                                                    [% IF resul.html %]
110
                                                        [% resul.html | $raw %]
111
                                                    [% ELSE %]
112
                                                        [% PROCESS authresult summary=resul.summary authid=resul.authid %]
113
                                                    [% END %]
114
                                                </td>
109
                                                <td><a href="/cgi-bin/koha/opac-authoritiesdetail.pl?authid=[% resul.authid | uri %]">Details</a>
115
                                                <td><a href="/cgi-bin/koha/opac-authoritiesdetail.pl?authid=[% resul.authid | uri %]">Details</a>
110
                                                <td>[% resul.authtype | html %]</td>
116
                                                <td>[% resul.authtype | html %]</td>
111
                                                [% UNLESS ( resul.isEDITORS ) %]
117
                                                [% UNLESS ( resul.isEDITORS ) %]
(-)a/opac/opac-authorities-home.pl (-1 / +23 lines)
Lines 28-33 use C4::Context; Link Here
28
use C4::Output qw( pagination_bar output_html_with_http_headers );
28
use C4::Output qw( pagination_bar output_html_with_http_headers );
29
use C4::Koha;
29
use C4::Koha;
30
use C4::Search::History;
30
use C4::Search::History;
31
use C4::Languages;
32
use Koha::XSLT::Base;
31
33
32
use Koha::Authority::Types;
34
use Koha::Authority::Types;
33
use Koha::SearchEngine::Search;
35
use Koha::SearchEngine::Search;
Lines 100-105 if ( $op eq "do_search" ) { Link Here
100
        $to = $startfrom * $resultsperpage;
102
        $to = $startfrom * $resultsperpage;
101
    }
103
    }
102
104
105
    my $AuthorityXSLTOpacResultsDisplay = C4::Context->preference('AuthorityXSLTOpacResultsDisplay');
106
    if ($results && $AuthorityXSLTOpacResultsDisplay) {
107
        my $lang = C4::Languages::getlanguage();
108
        foreach my $result (@$results) {
109
            my $authority = Koha::Authorities->find($result->{authid});
110
            next unless $authority;
111
            my $authtypecode = $authority->authtypecode;
112
            my $xsl = $AuthorityXSLTOpacResultsDisplay;
113
114
            $xsl =~ s/\{langcode\}/$lang/g;
115
            $xsl =~ s/\{authtypecode\}/$authtypecode/g;
116
            my $xslt_engine = Koha::XSLT::Base->new;
117
            my $output = $xslt_engine->transform({ xml => $authority->marcxml, file => $xsl });
118
            if ($xslt_engine->err) {
119
                warn "XSL transformation failed ($xsl): " . $xslt_engine->err;
120
                next;
121
            }
122
            $result->{html} = $output;
123
        }
124
    }
125
103
    $template->param( result => $results ) if $results;
126
    $template->param( result => $results ) if $results;
104
127
105
    $template->param(
128
    $template->param(
106
- 

Return to bug 30036