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

(-)a/authorities/authorities-home.pl (+25 lines)
Lines 31-41 use C4::Acquisition; Link Here
31
use C4::Koha;
31
use C4::Koha;
32
use C4::Biblio;
32
use C4::Biblio;
33
use C4::Search::History;
33
use C4::Search::History;
34
use C4::Languages;
34
35
35
use Koha::Authority::Types;
36
use Koha::Authority::Types;
36
use Koha::SearchEngine::Search;
37
use Koha::SearchEngine::Search;
37
use Koha::SearchEngine::QueryBuilder;
38
use Koha::SearchEngine::QueryBuilder;
38
use Koha::Token;
39
use Koha::Token;
40
use Koha::XSLT::Base;
39
use Koha::Z3950Servers;
41
use Koha::Z3950Servers;
40
42
41
my $query = CGI->new;
43
my $query = CGI->new;
Lines 178-183 if ( $op eq "do_search" ) { Link Here
178
        $to = $startfrom * $resultsperpage;
180
        $to = $startfrom * $resultsperpage;
179
    }
181
    }
180
182
183
    my $AuthorityXSLTResultsDisplay = C4::Context->preference('AuthorityXSLTResultsDisplay');
184
    if ($results && $AuthorityXSLTResultsDisplay) {
185
        my $lang = C4::Languages::getlanguage();
186
        foreach my $result (@$results) {
187
            my $authority = Koha::Authorities->find($result->{authid});
188
            next unless $authority;
189
190
            my $authtypecode = $authority->authtypecode;
191
            my $xsl = $AuthorityXSLTResultsDisplay;
192
            $xsl =~ s/\{langcode\}/$lang/g;
193
            $xsl =~ s/\{authtypecode\}/$authtypecode/g;
194
195
            my $xslt_engine = Koha::XSLT::Base->new;
196
            my $output = $xslt_engine->transform({ xml => $authority->marcxml, file => $xsl });
197
            if ($xslt_engine->err) {
198
                warn "XSL transformation failed ($xsl): " . $xslt_engine->err;
199
                next;
200
            }
201
202
            $result->{html} = $output;
203
        }
204
    }
205
181
    $template->param( result => $results ) if $results;
206
    $template->param( result => $results ) if $results;
182
207
183
    my $max_result_window = $searcher->max_result_window;
208
    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 68-73 INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` Link Here
68
('AuthorityMergeLimit','50',NULL,'Maximum number of biblio records updated immediately when an authority record has been modified.','integer'),
68
('AuthorityMergeLimit','50',NULL,'Maximum number of biblio records updated immediately when an authority record has been modified.','integer'),
69
('AuthorityMergeMode','loose','loose|strict','Authority merge mode','Choice'),
69
('AuthorityMergeMode','loose','loose|strict','Authority merge mode','Choice'),
70
('AuthoritySeparator','--','10','Used to separate a list of authorities in a display. Usually --','free'),
70
('AuthoritySeparator','--','10','Used to separate a list of authorities in a display. Usually --','free'),
71
('AuthorityXSLTResultsDisplay','','','Enable XSL stylesheet control over authority results page display on intranet','Free'),
71
('AuthSuccessLog','0',NULL,'If enabled, log successful authentications','YesNo'),
72
('AuthSuccessLog','0',NULL,'If enabled, log successful authentications','YesNo'),
72
('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'),
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'),
73
('AutoCreateAuthorities','0',NULL,'Automatically create authorities that do not exist when cataloging records.','YesNo'),
74
('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 55-61 Link Here
55
      </tr>
55
      </tr>
56
    [% FOREACH resul IN result %]
56
    [% FOREACH resul IN result %]
57
    <tr data-authid="[% resul.authid | html %]">
57
    <tr data-authid="[% resul.authid | html %]">
58
      <td>[% PROCESS authresult summary=resul.summary authid=resul.authid %]</td>
58
      <td>
59
        [% IF resul.html %]
60
          [% resul.html | $raw %]
61
        [% ELSE %]
62
          [% PROCESS authresult summary=resul.summary authid=resul.authid %]
63
        [% END %]
64
      </td>
59
      <td>[% resul.authtype | html %]</td>
65
      <td>[% resul.authtype | html %]</td>
60
    [% UNLESS ( resul.isEDITORS ) %]
66
    [% UNLESS ( resul.isEDITORS ) %]
61
      <td>
67
      <td>
62
- 

Return to bug 11083