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

(-)a/authorities/detail.pl (-4 / +24 lines)
Lines 38-53 parameters tables. Link Here
38
38
39
use Modern::Perl;
39
use Modern::Perl;
40
40
41
use CGI qw ( -utf8 );
42
41
use C4::Auth qw( get_template_and_user );
43
use C4::Auth qw( get_template_and_user );
42
use C4::AuthoritiesMarc qw( GetAuthority GenerateHierarchy GetTagsLabels );
44
use C4::AuthoritiesMarc qw( GetAuthority GenerateHierarchy GetTagsLabels );
43
use C4::Context;
45
use C4::Context;
44
use C4::Output qw( output_html_with_http_headers );
45
use CGI qw ( -utf8 );
46
use C4::Koha;
46
use C4::Koha;
47
use Koha::Authorities;
47
use C4::Languages;
48
use C4::Output qw( output_html_with_http_headers );
48
49
50
use Koha::Authorities;
49
use Koha::Authority::Types;
51
use Koha::Authority::Types;
50
use Koha::Token;
52
use Koha::Token;
53
use Koha::XSLT::Base;
51
use Koha::Z3950Servers;
54
use Koha::Z3950Servers;
52
55
53
our ($tagslib);
56
our ($tagslib);
Lines 213-219 while (my ($tagfield) = $sth->fetchrow) { Link Here
213
}
216
}
214
chop $biblio_fields if $biblio_fields;
217
chop $biblio_fields if $biblio_fields;
215
218
216
build_tabs ($template, $record, $dbh,"",$query);
219
my $AuthorityXSLTDetailsDisplay = C4::Context->preference('AuthorityXSLTDetailsDisplay');
220
if ( $AuthorityXSLTDetailsDisplay ) {
221
    my $xsl = $AuthorityXSLTDetailsDisplay;
222
    my $lang = C4::Languages::getlanguage();
223
    $xsl =~ s/\{langcode\}/$lang/g;
224
    $xsl =~ s/\{authtypecode\}/$authtypecode/g;
225
226
    my $xslt_engine = Koha::XSLT::Base->new;
227
    my $output = $xslt_engine->transform({ xml => $authobj->marcxml, file => $xsl });
228
    if ($xslt_engine->err) {
229
        warn "XSL transformation failed ($xsl): " . $xslt_engine->err;
230
        next;
231
    }
232
233
    $template->param( html => $output );
234
} else {
235
    build_tabs ($template, $record, $dbh,"",$query);
236
}
217
237
218
my $servers = Koha::Z3950Servers->search(
238
my $servers = Koha::Z3950Servers->search(
219
    {
239
    {
(-)a/installer/data/mysql/atomicupdate/bug_35305.pl (+15 lines)
Line 0 Link Here
1
use Modern::Perl;
2
3
return {
4
    bug_number  => "35305",
5
    description => "Add XSLT for authority details display in staff interface",
6
    up          => sub {
7
        my ($args) = @_;
8
        my ( $dbh, $out ) = @$args{qw(dbh out)};
9
        $dbh->do(q{
10
            INSERT IGNORE INTO systempreferences (`variable`, `value`, `options`, `explanation`, `type`)
11
            VALUES ('AuthorityXSLTDetailsDisplay','','','Enable XSL stylesheet control over authority details page display on intranet','Free')
12
        });
13
        say $out "Added new system preference 'AuthorityXSLTDetailsDisplay'";
14
    },
15
};
(-)a/installer/data/mysql/mandatory/sysprefs.sql (+1 lines)
Lines 78-83 INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` Link Here
78
('AuthoritySeparator','--','10','Used to separate a list of authorities in a display. Usually --','free'),
78
('AuthoritySeparator','--','10','Used to separate a list of authorities in a display. Usually --','free'),
79
('AuthorityXSLTOpacDetailsDisplay','','','Enable XSL stylesheet control over authority details page in the OPAC','Free'),
79
('AuthorityXSLTOpacDetailsDisplay','','','Enable XSL stylesheet control over authority details page in the OPAC','Free'),
80
('AuthorityXSLTOpacResultsDisplay','','','Enable XSL stylesheet control over authority results page in the OPAC','Free'),
80
('AuthorityXSLTOpacResultsDisplay','','','Enable XSL stylesheet control over authority results page in the OPAC','Free'),
81
('AuthorityXSLTDetailsDisplay','','','Enable XSL stylesheet control over authority details page display on intranet','Free'),
81
('AuthorityXSLTResultsDisplay','','','Enable XSL stylesheet control over authority results page display on intranet','Free'),
82
('AuthorityXSLTResultsDisplay','','','Enable XSL stylesheet control over authority results page display on intranet','Free'),
82
('AuthorLinkSortBy','default','call_number|pubdate|acqdate|title','Specify the default field used for sorting when click author links','Choice'),
83
('AuthorLinkSortBy','default','call_number|pubdate|acqdate|title','Specify the default field used for sorting when click author links','Choice'),
83
('AuthorLinkSortOrder','asc','asc|dsc|az|za','Specify the default sort order for author links','Choice'),
84
('AuthorLinkSortOrder','asc','asc|dsc|az|za','Specify the default sort order for author links','Choice'),
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/staff_interface.pref (+5 lines)
Lines 5-10 Staff interface: Link Here
5
            - pref: AuthorityXSLTResultsDisplay
5
            - pref: AuthorityXSLTResultsDisplay
6
              class: file
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'
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'
8
        -
9
            - 'Display authority details in the staff interface using XSLT stylesheet at: '
10
            - pref: AuthorityXSLTDetailsDisplay
11
              class: file
12
            - '<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'
8
        -
13
        -
9
            - "Display language selector on "
14
            - "Display language selector on "
10
            - pref: StaffLangSelectorMode
15
            - pref: StaffLangSelectorMode
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/authorities/detail.tt (-1 / +5 lines)
Lines 75-80 Link Here
75
                    [% END %]
75
                    [% END %]
76
                </div>
76
                </div>
77
77
78
                [% IF html %]
79
                    [% html | $raw %]
80
                [% ELSE %]
81
78
                [% WRAPPER tabs id= "authoritiestabs" %]
82
                [% WRAPPER tabs id= "authoritiestabs" %]
79
                    [% WRAPPER tabs_nav %]
83
                    [% WRAPPER tabs_nav %]
80
                        [% FOREACH BIG_LOO IN BIG_LOOP %]
84
                        [% FOREACH BIG_LOO IN BIG_LOOP %]
Lines 128-133 Link Here
128
                        [% END # /FOREACH BIG_LOO %]
132
                        [% END # /FOREACH BIG_LOO %]
129
                    [% END # /WRAPPER tab_panels %]
133
                    [% END # /WRAPPER tab_panels %]
130
                [% END # /WRAPPER tabs %]
134
                [% END # /WRAPPER tabs %]
135
                [% END # /IF html %]
131
136
132
            [% END # /IF ( unknownauthid ) %]
137
            [% END # /IF ( unknownauthid ) %]
133
        </div> <!-- /.col-md-8 offset-md-2 -->
138
        </div> <!-- /.col-md-8 offset-md-2 -->
134
- 

Return to bug 35305