View | Details | Raw Unified | Return to bug 21330
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-AuthorityXSLTOpacDetailsDisplay.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 ('AuthorityXSLTOpacDetailsDisplay','','','Enable XSL stylesheet control over authority results page display on intranet','Free')
6
    });
7
8
    NewVersion($DBversion, '11083', 'Add syspref AuthorityXSLTOpacDetailsDisplay');
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
('AuthorityXSLTOpacDetailsDisplay','','','Enable XSL stylesheet control over authority details 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 details in the opac interface using XSLT stylesheet at: '
5
            - pref: AuthorityXSLTOpacDetailsDisplay
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-auth-detail.tt (-86 / +91 lines)
Lines 60-162 Link Here
60
60
61
                        <div class="usedin">
61
                        <div class="usedin">
62
                            [% IF count %]<a href="/cgi-bin/koha/opac-search.pl?type=opac&amp;q=[% authid | uri %]&amp;idx=an,phr">Number of records used in: [% count | html %]</a>[% ELSE %]This authority is not used in any records.[% END %]
62
                            [% IF count %]<a href="/cgi-bin/koha/opac-search.pl?type=opac&amp;q=[% authid | uri %]&amp;idx=an,phr">Number of records used in: [% count | html %]</a>[% ELSE %]This authority is not used in any records.[% END %]
63
                        </div>
63
                        </div><br>
64
65
                        [% IF authresult.html %]
66
                            [% authresult.html | $raw %]
67
                        [% ELSE %]
68
                            <div class="authstanza">
69
                                [% FOREACH authorize IN summary.authorized %]
70
                                    <div class="heading authorized auth[% seefro.field | html %]">
71
                                        <span class="label">Preferred form: </span>
72
                                        <span class="authorized">[% authorize.heading | html %]</span>
73
                                    </div>
74
                                [% END %]
75
                                [% PROCESS otherscript headings=summary.otherscript wantcategory='preferred' %]
76
                            </div>
64
77
65
                        <div class="authstanza">
78
                            [% IF summary.seefrom.size %]
66
                            [% FOREACH authorize IN summary.authorized %]
79
                                <div class="authstanza seefrom">
67
                                <div class="heading authorized auth[% seefro.field | html %]">
80
                                    <div class="authstanzaheading">Used for/see from:</div>
68
                                    <span class="label">Preferred form: </span>
81
                                    <ul class="seefrom">
69
                                    <span class="authorized">[% authorize.heading | html %]</span>
82
                                        [% FOREACH seefro IN summary.seefrom %]
83
                                            <li class="heading seefrom auth[% seefro.field | html %]">
84
                                                [% IF seefro.type && seefro.type != 'seefrom' %]
85
                                                    <span class="label">[% PROCESS authtypelabel type=seefro.type | trim %]:</span>
86
                                                [% END %]
87
                                                <span class="seefrom">[% PROCESS authheadingdisplay heading=seefro.heading search=seefrosearch authid=seefro.authid %]</span>
88
                                            </li>
89
                                        [% END %]
90
                                        [% PROCESS otherscript headings=summary.otherscript wantcategory='seefrom' %]
91
                                    </ul>
70
                                </div>
92
                                </div>
71
                            [% END %]
93
                            [% END %]
72
                            [% PROCESS otherscript headings=summary.otherscript wantcategory='preferred' %]
73
                        </div>
74
94
75
                        [% IF summary.seefrom.size %]
95
                            [% IF summary.seealso.size %]
76
                            <div class="authstanza seefrom">
96
                                <div class="authstanza seealso">
77
                                <div class="authstanzaheading">Used for/see from:</div>
97
                                    <div class="authstanzaheading">See also:</div>
78
                                <ul class="seefrom">
98
                                    <ul class="seelso">
79
                                    [% FOREACH seefro IN summary.seefrom %]
99
                                        [% FOREACH seeals IN summary.seealso %]
80
                                        <li class="heading seefrom auth[% seefro.field | html %]">
100
                                            <li class="heading seealso auth[% seeals.field | html %]">
81
                                            [% IF seefro.type && seefro.type != 'seefrom' %]
101
                                                [% IF seeals.type && seeals.type != 'seealso' %]
82
                                                <span class="label">[% PROCESS authtypelabel type=seefro.type | trim %]:</span>
102
                                                    <span class="label">[% PROCESS authtypelabel type=seeals.type | trim %]:</span>
83
                                            [% END %]
103
                                                [% END %]
84
                                            <span class="seefrom">[% PROCESS authheadingdisplay heading=seefro.heading search=seefrosearch authid=seefro.authid %]</span>
104
                                                <span class="seealso">[% PROCESS authheadingdisplay heading=seeals.heading search=seeals.search authid=seeals.authid %]</span>
85
                                        </li>
105
                                            </li>
86
                                    [% END %]
106
                                        [% END %]
87
                                    [% PROCESS otherscript headings=summary.otherscript wantcategory='seefrom' %]
107
                                        [% PROCESS otherscript headings=summary.otherscript wantcategory='seealso' %]
88
                                </ul>
108
                                    </ul>
89
                            </div>
109
                                </div>
90
                        [% END %]
110
                            [% END %]
91
111
92
                        [% IF summary.seealso.size %]
112
                            [% IF marcflavour == 'UNIMARC' && summary.otherscript %]
93
                            <div class="authstanza seealso">
113
                                <div class="authstanza">
94
                                <div class="authstanzaheading">See also:</div>
114
                                    <div class="authstanzaheading">Other forms:</div>
95
                                <ul class="seelso">
115
                                    <ul>
96
                                    [% FOREACH seeals IN summary.seealso %]
116
                                        [% FOREACH otherscrip IN summary.otherscript %]
97
                                        <li class="heading seealso auth[% seeals.field | html %]">
117
                                            <li>
98
                                            [% IF seeals.type && seeals.type != 'seealso' %]
118
                                                [% PROCESS language lang=otherscrip.lang | trim %]:
99
                                                <span class="label">[% PROCESS authtypelabel type=seeals.type | trim %]:</span>
119
                                                <span class="otherscript">[% otherscrip.term | html %]</span>
100
                                            [% END %]
120
                                            </li>
101
                                            <span class="seealso">[% PROCESS authheadingdisplay heading=seeals.heading search=seeals.search authid=seeals.authid %]</span>
121
                                        [% END %]
102
                                        </li>
122
                                    </ul>
103
                                    [% END %]
123
                                </div>
104
                                    [% PROCESS otherscript headings=summary.otherscript wantcategory='seealso' %]
124
                            [% END %]
105
                                </ul>
106
                            </div>
107
                        [% END %]
108
125
109
                        [% IF marcflavour == 'UNIMARC' && summary.otherscript %]
126
                            [% IF ( MARCURLS ) %]
110
                            <div class="authstanza">
127
                                <div class="authstanza online_resources">
111
                                <div class="authstanzaheading">Other forms:</div>
128
                                    <span class="label">Online resources:</span>
112
                                <ul>
129
                                    <ul>
113
                                    [% FOREACH otherscrip IN summary.otherscript %]
130
                                        [% FOREACH MARCurl IN MARCURLS %]
114
                                        <li>
131
                                            <li>[% IF ( MARCurl.part ) %][% MARCurl.part | html %]<br />[% END %]
115
                                            [% PROCESS language lang=otherscrip.lang | trim %]:
132
                                                [% IF ( Koha.Preference('OPACURLOpenInNewWindow') ) %]
116
                                            <span class="otherscript">[% otherscrip.term | html %]</span>
133
                                                    <a href="[% MARCurl.MARCURL | url %]" title="[% MARCurl.MARCURL | html %]" target="_blank" rel="noreferrer">
117
                                        </li>
134
                                                [% ELSE %]
118
                                    [% END %]
135
                                                    <a href="[% MARCurl.MARCURL | url %]" title="[% MARCurl.MARCURL | html %]">
119
                                </ul>
136
                                                [% END %]
120
                            </div>
137
                                                [% MARCurl.linktext | html %]</a>
121
                        [% END %]
138
                                                [% IF ( MARCurl.notes ) %]
139
                                                    <ul>
140
                                                        [% FOREACH note IN MARCurl.notes %]
141
                                                            <li>[% note.note | html %]</li>
142
                                                        [% END %]
143
                                                    </ul>
144
                                                [% END %]
145
                                            </li>
146
                                        [% END # /FOREACH MARCURLS %]
147
                                    </ul>
148
                                </div>
149
                            [% END # / IF MARCURLS %]
122
150
123
                        [% IF ( MARCURLS ) %]
151
                            <div id="authdescriptions" class="toptabs">
124
                            <div class="authstanza online_resources">
125
                                <span class="label">Online resources:</span>
126
                                <ul>
152
                                <ul>
127
                                    [% FOREACH MARCurl IN MARCURLS %]
153
                                    <li id="tab_descriptions"><a href="#descriptions">Notes</a></li>
128
                                        <li>[% IF ( MARCurl.part ) %][% MARCurl.part | html %]<br />[% END %]
129
                                            [% IF ( Koha.Preference('OPACURLOpenInNewWindow') ) %]
130
                                                <a href="[% MARCurl.MARCURL | url %]" title="[% MARCurl.MARCURL | html %]" target="_blank" rel="noreferrer">
131
                                            [% ELSE %]
132
                                                <a href="[% MARCurl.MARCURL | url %]" title="[% MARCurl.MARCURL | html %]">
133
                                            [% END %]
134
                                            [% MARCurl.linktext | html %]</a>
135
                                            [% IF ( MARCurl.notes ) %]
136
                                                <ul>
137
                                                    [% FOREACH note IN MARCurl.notes %]
138
                                                        <li>[% note.note | html %]</li>
139
                                                    [% END %]
140
                                                </ul>
141
                                            [% END %]
142
                                        </li>
143
                                    [% END # /FOREACH MARCURLS %]
144
                                </ul>
154
                                </ul>
145
                            </div>
155
                                <div id="descriptions">
146
                        [% END # / IF MARCURLS %]
156
                                    <div class="content_set">
147
157
                                        [% FOREACH note IN summary.notes %]
148
                        <div id="authdescriptions" class="toptabs">
158
                                            <p class="note auth[% note.field | html %]">[% note.note | html %]</p>
149
                            <ul>
159
                                        [% END %]
150
                                <li id="tab_descriptions"><a href="#descriptions">Notes</a></li>
160
                                    </div>
151
                            </ul>
152
                            <div id="descriptions">
153
                                <div class="content_set">
154
                                    [% FOREACH note IN summary.notes %]
155
                                        <p class="note auth[% note.field | html %]">[% note.note | html %]</p>
156
                                    [% END %]
157
                                </div>
161
                                </div>
158
                            </div>
162
                            </div>
159
                        </div>
163
164
                        [% END %]
160
                    </div> <!-- / .#userauthdetails -->
165
                    </div> <!-- / .#userauthdetails -->
161
                </div> <!-- / .col-lg-10/12 -->
166
                </div> <!-- / .col-lg-10/12 -->
162
            </div> <!-- / .row -->
167
            </div> <!-- / .row -->
(-)a/opac/opac-authoritiesdetail.pl (-6 / +24 lines)
Lines 69-76 my ( $template, $loggedinuser, $cookie ) = get_template_and_user( Link Here
69
69
70
my $authid = $query->param('authid');
70
my $authid = $query->param('authid');
71
$authid = int($authid);
71
$authid = int($authid);
72
my $record = GetAuthority( $authid );
72
my $authresult = GetAuthority( $authid );
73
if ( ! $record ) {
73
if ( ! $authresult ) {
74
    print $query->redirect("/cgi-bin/koha/errors/404.pl"); # escape early
74
    print $query->redirect("/cgi-bin/koha/errors/404.pl"); # escape early
75
    exit;
75
    exit;
76
}
76
}
Lines 86-92 if ($display_hierarchy){ Link Here
86
my $count = $authority ? $authority->get_usage_count : 0;
86
my $count = $authority ? $authority->get_usage_count : 0;
87
87
88
my $authority_types = Koha::Authority::Types->search( {}, { order_by => ['authtypecode'] } );
88
my $authority_types = Koha::Authority::Types->search( {}, { order_by => ['authtypecode'] } );
89
my $marcurlsarray = GetMarcUrls( $record, $marcflavour );
89
my $marcurlsarray = GetMarcUrls( $authresult, $marcflavour );
90
91
my $AuthorityXSLTOpacDetailsDisplay = C4::Context->preference('AuthorityXSLTOpacDetailsDisplay');
92
    if ($authresult && $AuthorityXSLTOpacDetailsDisplay) {
93
        my $lang = C4::Languages::getlanguage();
94
95
        my $xsl = $AuthorityXSLTOpacDetailsDisplay;
96
97
        $xsl =~ s/\{langcode\}/$lang/g;
98
        $xsl =~ s/\{authtypecode\}/$authtypecode/g;
99
        my $xslt_engine = Koha::XSLT::Base->new;
100
        my $output = $xslt_engine->transform({ xml => $authority->marcxml, file => $xsl });
101
        if ($xslt_engine->err) {
102
            warn "XSL transformation failed ($xsl): " . $xslt_engine->err;
103
            next;
104
        }
105
        $authresult->{html} = $output;
106
107
    }
90
108
91
$template->param(
109
$template->param(
92
    authority_types => $authority_types,
110
    authority_types => $authority_types,
Lines 94-99 $template->param( Link Here
94
    authid          => $authid,
112
    authid          => $authid,
95
    count           => $count,
113
    count           => $count,
96
    MARCURLS        => $marcurlsarray,
114
    MARCURLS        => $marcurlsarray,
115
    authresult      => $authresult,
97
);
116
);
98
117
99
# find the marc field/subfield used in biblio by this authority
118
# find the marc field/subfield used in biblio by this authority
Lines 114-120 if ($show_marc) { Link Here
114
    my @loop_data = ();
133
    my @loop_data = ();
115
134
116
# loop through each tag
135
# loop through each tag
117
    my @fields    = $record->fields();
136
    my @fields    = $authresult->fields();
118
    foreach my $field (@fields) {
137
    foreach my $field (@fields) {
119
        my @subfields_data;
138
        my @subfields_data;
120
139
Lines 166-172 if ($show_marc) { Link Here
166
    }
185
    }
167
    $template->param( "Tab0XX" => \@loop_data );
186
    $template->param( "Tab0XX" => \@loop_data );
168
} else {
187
} else {
169
    my $summary = BuildSummary($record, $authid, $authtypecode);
188
    my $summary = BuildSummary($authresult, $authid, $authtypecode);
170
    $template->{VARS}->{'summary'} = $summary;
189
    $template->{VARS}->{'summary'} = $summary;
171
}
190
}
172
191
173
- 

Return to bug 21330