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

(-)a/authorities/authorities-home.pl (+25 lines)
Lines 28-38 use C4::Auth qw( get_template_and_user ); Link Here
28
use C4::Output qw( output_and_exit pagination_bar output_html_with_http_headers );
28
use C4::Output qw( output_and_exit pagination_bar output_html_with_http_headers );
29
use C4::AuthoritiesMarc qw( DelAuthority );
29
use C4::AuthoritiesMarc qw( DelAuthority );
30
use C4::Search::History;
30
use C4::Search::History;
31
use C4::Languages;
31
32
32
use Koha::Authority::Types;
33
use Koha::Authority::Types;
33
use Koha::SearchEngine::Search;
34
use Koha::SearchEngine::Search;
34
use Koha::SearchEngine::QueryBuilder;
35
use Koha::SearchEngine::QueryBuilder;
35
use Koha::Token;
36
use Koha::Token;
37
use Koha::XSLT::Base;
36
use Koha::Z3950Servers;
38
use Koha::Z3950Servers;
37
39
38
my $query = CGI->new;
40
my $query = CGI->new;
Lines 173-178 if ( $op eq "do_search" ) { Link Here
173
        $to = $startfrom * $resultsperpage;
175
        $to = $startfrom * $resultsperpage;
174
    }
176
    }
175
177
178
    my $AuthorityXSLTResultsDisplay = C4::Context->preference('AuthorityXSLTResultsDisplay');
179
    if ($results && $AuthorityXSLTResultsDisplay) {
180
        my $lang = C4::Languages::getlanguage();
181
        foreach my $result (@$results) {
182
            my $authority = Koha::Authorities->find($result->{authid});
183
            next unless $authority;
184
185
            my $authtypecode = $authority->authtypecode;
186
            my $xsl = $AuthorityXSLTResultsDisplay;
187
            $xsl =~ s/\{langcode\}/$lang/g;
188
            $xsl =~ s/\{authtypecode\}/$authtypecode/g;
189
190
            my $xslt_engine = Koha::XSLT::Base->new;
191
            my $output = $xslt_engine->transform({ xml => $authority->marcxml, file => $xsl });
192
            if ($xslt_engine->err) {
193
                warn "XSL transformation failed ($xsl): " . $xslt_engine->err;
194
                next;
195
            }
196
197
            $result->{html} = $output;
198
        }
199
    }
200
176
    $template->param( result => $results ) if $results;
201
    $template->param( result => $results ) if $results;
177
202
178
    my $max_result_window = $searcher->max_result_window;
203
    my $max_result_window = $searcher->max_result_window;
(-)a/installer/data/mysql/atomicupdate/add-syspref-AuthorityXSLTResultsDisplay.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`) VALUES
5
        ('AuthorityXSLTResultsDisplay','','','Enable XSL stylesheet control over authority results page display on intranet','Free')
6
    });
7
8
    NewVersion($DBversion, '11083', 'Add syspref AuthorityXSLTResultsDisplay');
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
('AuthorityXSLTResultsDisplay','','','Enable XSL stylesheet control over authority results page display on intranet','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 (+5 lines)
Lines 1-5 Link Here
1
Staff interface:
1
Staff interface:
2
    Appearance:
2
    Appearance:
3
        -
4
            - 'Display authority results in the staff interface using XSLT stylesheet at: '
5
            - pref: AuthorityXSLTResultsDisplay
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'
3
        -
8
        -
4
            - "Display language selector on "
9
            - "Display language selector on "
5
            - pref: StaffLangSelectorMode
10
            - pref: StaffLangSelectorMode
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/authorities/searchresultlist.tt (-2 / +7 lines)
Lines 57-63 Link Here
57
      </tr>
57
      </tr>
58
    [% FOREACH resul IN result %]
58
    [% FOREACH resul IN result %]
59
    <tr data-authid="[% resul.authid | html %]">
59
    <tr data-authid="[% resul.authid | html %]">
60
      <td>[% PROCESS authresult summary=resul.summary authid=resul.authid %]</td>
60
      <td>
61
        [% IF resul.html %]
62
          [% resul.html | $raw %]
63
        [% ELSE %]
64
          [% PROCESS authresult summary=resul.summary authid=resul.authid %]
65
        [% END %]
66
      </td>
61
      <td>[% resul.authtype | html %]</td>
67
      <td>[% resul.authtype | html %]</td>
62
    [% UNLESS ( resul.isEDITORS ) %]
68
    [% UNLESS ( resul.isEDITORS ) %]
63
      <td>
69
      <td>
64
- 

Return to bug 11083