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

(-)a/C4/Auth.pm (-4 lines)
Lines 492-499 sub get_template_and_user { Link Here
492
        item_level_itypes  => C4::Context->preference('item-level_itypes'),
492
        item_level_itypes  => C4::Context->preference('item-level_itypes'),
493
        patronimages       => C4::Context->preference("patronimages"),
493
        patronimages       => C4::Context->preference("patronimages"),
494
        singleBranchMode   => ( Koha::Libraries->search->count == 1 ),
494
        singleBranchMode   => ( Koha::Libraries->search->count == 1 ),
495
        XSLTDetailsDisplay => C4::Context->preference("XSLTDetailsDisplay"),
496
        XSLTResultsDisplay => C4::Context->preference("XSLTResultsDisplay"),
497
        noItemTypeImages   => C4::Context->preference("noItemTypeImages"),
495
        noItemTypeImages   => C4::Context->preference("noItemTypeImages"),
498
        marcflavour        => C4::Context->preference("marcflavour"),
496
        marcflavour        => C4::Context->preference("marcflavour"),
499
        OPACBaseURL        => C4::Context->preference('OPACBaseURL'),
497
        OPACBaseURL        => C4::Context->preference('OPACBaseURL'),
Lines 612-619 sub get_template_and_user { Link Here
612
            suggestion                            => "" . C4::Context->preference("suggestion"),
610
            suggestion                            => "" . C4::Context->preference("suggestion"),
613
            virtualshelves                        => "" . C4::Context->preference("virtualshelves"),
611
            virtualshelves                        => "" . C4::Context->preference("virtualshelves"),
614
            OPACSerialIssueDisplayCount           => C4::Context->preference("OPACSerialIssueDisplayCount"),
612
            OPACSerialIssueDisplayCount           => C4::Context->preference("OPACSerialIssueDisplayCount"),
615
            OPACXSLTDetailsDisplay                => C4::Context->preference("OPACXSLTDetailsDisplay"),
616
            OPACXSLTResultsDisplay                => C4::Context->preference("OPACXSLTResultsDisplay"),
617
            SyndeticsClientCode                   => C4::Context->preference("SyndeticsClientCode"),
613
            SyndeticsClientCode                   => C4::Context->preference("SyndeticsClientCode"),
618
            SyndeticsEnabled                      => C4::Context->preference("SyndeticsEnabled"),
614
            SyndeticsEnabled                      => C4::Context->preference("SyndeticsEnabled"),
619
            SyndeticsCoverImages                  => C4::Context->preference("SyndeticsCoverImages"),
615
            SyndeticsCoverImages                  => C4::Context->preference("SyndeticsCoverImages"),
(-)a/C4/Search.pm (-55 / +4 lines)
Lines 1661-1677 sub searchResults { Link Here
1661
    my ($bibliotag,$bibliosubf)=GetMarcFromKohaField( 'biblio.biblionumber' );
1661
    my ($bibliotag,$bibliosubf)=GetMarcFromKohaField( 'biblio.biblionumber' );
1662
1662
1663
    # set stuff for XSLT processing here once, not later again for every record we retrieved
1663
    # set stuff for XSLT processing here once, not later again for every record we retrieved
1664
    my $xslfile;
1664
    my $xslsyspref = $is_opac ? 'OPACXSLTResultsDisplay' : 'XSLTResultsDisplay';
1665
    my $xslsyspref;
1665
    my $xslfile = C4::Context->preference( $xslsyspref ) || "default";
1666
    if( $is_opac ){
1666
    my $lang   = C4::Languages::getlanguage();
1667
        $xslsyspref = "OPACXSLTResultsDisplay";
1667
    my $sysxml = C4::XSLT::get_xslt_sysprefs();
1668
        $xslfile = C4::Context->preference( $xslsyspref );
1669
    } else {
1670
        $xslsyspref = "XSLTResultsDisplay";
1671
        $xslfile = C4::Context->preference( $xslsyspref ) || "default";
1672
    }
1673
    my $lang   = $xslfile ? C4::Languages::getlanguage()  : undef;
1674
    my $sysxml = $xslfile ? C4::XSLT::get_xslt_sysprefs() : undef;
1675
1668
1676
    my $userenv = C4::Context->userenv;
1669
    my $userenv = C4::Context->userenv;
1677
    my $logged_in_user
1670
    my $logged_in_user
Lines 1725-1774 sub searchResults { Link Here
1725
        # Build summary if there is one (the summary is defined in the itemtypes table)
1718
        # Build summary if there is one (the summary is defined in the itemtypes table)
1726
        $oldbiblio->{description} = $itemtype ? $itemtype->{translated_description} : q{};
1719
        $oldbiblio->{description} = $itemtype ? $itemtype->{translated_description} : q{};
1727
1720
1728
        # FIXME: this is only used in the deprecated non-XLST opac results
1729
        if ( !$xslfile && $is_opac && $itemtype && $itemtype->{summary} ) {
1730
            my $summary = $itemtypes{ $oldbiblio->{itemtype} }->{summary};
1731
            my @fields  = $marcrecord->fields();
1732
1733
            my $newsummary;
1734
            foreach my $line ( "$summary\n" =~ /(.*)\n/g ){
1735
                my $tags = {};
1736
                foreach my $tag ( $line =~ /\[(\d{3}[\w|\d])\]/ ) {
1737
                    $tag =~ /(.{3})(.)/;
1738
                    if($marcrecord->field($1)){
1739
                        my @abc = $marcrecord->field($1)->subfield($2);
1740
                        $tags->{$tag} = $#abc + 1 ;
1741
                    }
1742
                }
1743
1744
                # We catch how many times to repeat this line
1745
                my $max = 0;
1746
                foreach my $tag (keys(%$tags)){
1747
                    $max = $tags->{$tag} if($tags->{$tag} > $max);
1748
                 }
1749
1750
                # we replace, and repeat each line
1751
                for (my $i = 0 ; $i < $max ; $i++){
1752
                    my $newline = $line;
1753
1754
                    foreach my $tag ( $newline =~ /\[(\d{3}[\w|\d])\]/g ) {
1755
                        $tag =~ /(.{3})(.)/;
1756
1757
                        if($marcrecord->field($1)){
1758
                            my @repl = $marcrecord->field($1)->subfield($2);
1759
                            my $subfieldvalue = $repl[$i];
1760
                            $newline =~ s/\[$tag\]/$subfieldvalue/g;
1761
                        }
1762
                    }
1763
                    $newsummary .= "$newline\n";
1764
                }
1765
            }
1766
1767
            $newsummary =~ s/\[(.*?)]//g;
1768
            $newsummary =~ s/\n/<br\/>/g;
1769
            $oldbiblio->{summary} = $newsummary;
1770
        }
1771
1772
        # Pull out the items fields
1721
        # Pull out the items fields
1773
        my @fields = $marcrecord->field($itemtag);
1722
        my @fields = $marcrecord->field($itemtag);
1774
        my $marcflavor = C4::Context->preference("marcflavour");
1723
        my $marcflavor = C4::Context->preference("marcflavour");
(-)a/catalogue/detail.pl (-6 / +5 lines)
Lines 117-128 my $fw = GetFrameworkCode($biblionumber); Link Here
117
my $showallitems = $query->param('showallitems');
117
my $showallitems = $query->param('showallitems');
118
my $marcflavour  = C4::Context->preference("marcflavour");
118
my $marcflavour  = C4::Context->preference("marcflavour");
119
119
120
# XSLT processing of some stuff
120
{
121
my $xslfile = C4::Context->preference('XSLTDetailsDisplay') || "default";
121
    # XSLT processing of some stuff
122
my $lang   = $xslfile ? C4::Languages::getlanguage()  : undef;
122
    my $xslfile = C4::Context->preference('XSLTDetailsDisplay') || "default";
123
my $sysxml = $xslfile ? C4::XSLT::get_xslt_sysprefs() : undef;
123
    my $lang   = C4::Languages::getlanguage();
124
124
    my $sysxml = C4::XSLT::get_xslt_sysprefs();
125
if ( $xslfile ) {
126
125
127
    my $searcher = Koha::SearchEngine::Search->new(
126
    my $searcher = Koha::SearchEngine::Search->new(
128
        { index => $Koha::SearchEngine::BIBLIOS_INDEX }
127
        { index => $Koha::SearchEngine::BIBLIOS_INDEX }
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref (-3 / +3 lines)
Lines 90-106 OPAC: Link Here
90
            - 'Display lists in the OPAC using XSLT stylesheet at: '
90
            - 'Display lists in the OPAC using XSLT stylesheet at: '
91
            - pref: OPACXSLTListsDisplay
91
            - pref: OPACXSLTListsDisplay
92
              class: file
92
              class: file
93
            - '<br />Options:<ul><li><a href="#" class="set_syspref" data-syspref="OPACXSLTListsDisplay" data-value="">leave empty</a> for "no xslt"</li><li>enter "<a href="#" class="set_syspref" data-syspref="OPACXSLTListsDisplay" data-value="default">default</a>" for the default one</li><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.'
93
            - '<br />Options:<ul><li>Enter "<a href="#" class="set_syspref" data-syspref="OPACXSLTListsDisplay" data-value="default">default</a>" for the default one</li><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.'
94
        -
94
        -
95
            - 'Display OPAC results using XSLT stylesheet at: '
95
            - 'Display OPAC results using XSLT stylesheet at: '
96
            - pref: OPACXSLTResultsDisplay
96
            - pref: OPACXSLTResultsDisplay
97
              class: file
97
              class: file
98
            - '<br />Options:<ul><li><a href="#" class="set_syspref" data-syspref="OPACXSLTResultsDisplay" data-value="">leave empty</a> for "no xslt"</li><li>enter "<a href="#" class="set_syspref" data-syspref="OPACXSLTResultsDisplay" data-value="default">default</a>" for the default one</li><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.'
98
            - '<br />Options:<ul><li>Enter "<a href="#" class="set_syspref" data-syspref="OPACXSLTResultsDisplay" data-value="default">default</a>" for the default one</li><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.'
99
        -
99
        -
100
            - 'Display OPAC details using XSLT stylesheet at: '
100
            - 'Display OPAC details using XSLT stylesheet at: '
101
            - pref: OPACXSLTDetailsDisplay
101
            - pref: OPACXSLTDetailsDisplay
102
              class: file
102
              class: file
103
            - '<br />Options:<ul><li><a href="#" class="set_syspref" data-syspref="OPACXSLTDetailsDisplay" data-value="">leave empty</a> for "no xslt"</li><li>enter "<a href="#" class="set_syspref" data-syspref="OPACXSLTDetailsDisplay" data-value="default">default</a>" for the default one</li><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.'
103
            - '<br />Options:<ul><li>Enter "<a href="#" class="set_syspref" data-syspref="OPACXSLTDetailsDisplay" data-value="default">default</a>" for the default one</li><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.'
104
        -
104
        -
105
            - "Show itemtype icons in the OPAC: "
105
            - "Show itemtype icons in the OPAC: "
106
            - pref: OpacNoItemTypeImages
106
            - pref: OpacNoItemTypeImages
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/staff_interface.pref (-1 / +1 lines)
Lines 71-77 Staff interface: Link Here
71
            - 'Display lists in the staff interface using XSLT stylesheet at: '
71
            - 'Display lists in the staff interface using XSLT stylesheet at: '
72
            - pref: XSLTListsDisplay
72
            - pref: XSLTListsDisplay
73
              class: file
73
              class: file
74
            - '<br />Options:<ul><li><a href="#" class="set_syspref" data-syspref="XSLTListsDisplay" data-value="">Leave empty</a> for "no xslt"</li><li>enter "<a href="#" class="set_syspref" data-syspref="XSLTListsDisplay" data-value="default">default</a>" for the default one</li><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'
74
            - '<br />Options:<ul><li>Enter "<a href="#" class="set_syspref" data-syspref="XSLTListsDisplay" data-value="default">default</a>" for the default one</li><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'
75
        -
75
        -
76
            - 'Display results in the staff interface using XSLT stylesheet at: '
76
            - 'Display results in the staff interface using XSLT stylesheet at: '
77
            - pref: XSLTResultsDisplay
77
            - pref: XSLTResultsDisplay
(-)a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-MARCdetail.tt (-6 / +2 lines)
Lines 33-42 Link Here
33
                            </div>
33
                            </div>
34
                            <h1 class="title">[% bibliotitle | html %] (Record no. [% biblio.biblionumber | html %])</h1>
34
                            <h1 class="title">[% bibliotitle | html %] (Record no. [% biblio.biblionumber | html %])</h1>
35
35
36
                            [% IF ( OPACXSLTDetailsDisplay ) %]
36
                            <div id="switchview_div">[ <a id="switchview" href="/cgi-bin/koha/opac-showmarc.pl?id=[% biblio.biblionumber | html %]&amp;viewas=html">view plain</a> ]</div>
37
                                <div id="switchview_div">[ <a id="switchview" href="/cgi-bin/koha/opac-showmarc.pl?id=[% biblio.biblionumber | html %]&amp;viewas=html">view plain</a> ]</div>
37
                            <div id="plainmarc"></div>
38
                                <div id="plainmarc"></div>
39
                            [% END %]
40
38
41
                            <div id="labeledmarc">
39
                            <div id="labeledmarc">
42
                                <table id="marc" class="table table-bordered table-striped">
40
                                <table id="marc" class="table table-bordered table-striped">
Lines 177-183 Link Here
177
[% INCLUDE 'opac-bottom.inc' %]
175
[% INCLUDE 'opac-bottom.inc' %]
178
[% BLOCK jsinclude %]
176
[% BLOCK jsinclude %]
179
<script>
177
<script>
180
[% IF ( OPACXSLTDetailsDisplay ) %]
181
    $(document).ready(function(){
178
    $(document).ready(function(){
182
        var loaded = 0;
179
        var loaded = 0;
183
        var toggle = 0;
180
        var toggle = 0;
Lines 210-215 Link Here
210
            }
207
            }
211
        });
208
        });
212
    });
209
    });
213
[% END %]
214
</script>
210
</script>
215
[% END %]
211
[% END %]
(-)a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt (-154 / +1 lines)
Lines 138-298 Link Here
138
                            <span class="view"><a id="ISBDview" class="btn btn-link" href="/cgi-bin/koha/opac-ISBDdetail.pl?biblionumber=[% biblio.biblionumber | html %]"><i class="fa fa-list-ul" aria-hidden="true"></i> ISBD view</a></span>
138
                            <span class="view"><a id="ISBDview" class="btn btn-link" href="/cgi-bin/koha/opac-ISBDdetail.pl?biblionumber=[% biblio.biblionumber | html %]"><i class="fa fa-list-ul" aria-hidden="true"></i> ISBD view</a></span>
139
                            [% END %]
139
                            [% END %]
140
                    </div>
140
                    </div>
141
                    [% IF ( OPACXSLTDetailsDisplay ) %]
142
                        [% XSLTBloc | $raw %]
143
                    [% ELSE %]
144
                        <h1 class="title">[% INCLUDE 'biblio-title.inc' %]</h1>
145
                        [% IF ( author ) %]
146
                            <span class="results_summary author h3">by <a class="contributors" href="/cgi-bin/koha/opac-search.pl?q=au:[% author |url %]">[% author | html %]</a></span>
147
                        [% END %]
148
149
                        <span class="results_summary">
150
                            [% IF ( unititle ) %], [% unititle | html %][% END %]
151
                        </span>
152
153
                        [% IF ( MARCAUTHORS ) %]
154
                            <div class="results_summary">
155
                                <span class="label">Additional authors:</span>
156
                                [% FOREACH MARCAUTHOR IN MARCAUTHORS %]
157
                                    [% FOREACH MARCAUTHOR_SUBFIELDS_LOO IN MARCAUTHOR.MARCAUTHOR_SUBFIELDS_LOOP %]
158
                                        [% MARCAUTHOR_SUBFIELDS_LOO.separator | html %]
159
                                        [% IF ( MARCAUTHOR.authoritylink ) %]
160
                                            <a title="‡[% MARCAUTHOR_SUBFIELDS_LOO.code | html %] [% MARCAUTHOR_SUBFIELDS_LOO.value | html %]" class="contributors authority_link" data-authid="[% MARCAUTHOR.authoritylink | html %]" href="/cgi-bin/koha/opac-search.pl?q=[% FOREACH link_loo IN MARCAUTHOR_SUBFIELDS_LOO.link_loop %][% link_loo.operator |url %][% link_loo.limit |url %]:[% link_loo.link |url %][% END %]">
161
                                        [% ELSE %]
162
                                            <a title="‡[% MARCAUTHOR_SUBFIELDS_LOO.code | html %] [% MARCAUTHOR_SUBFIELDS_LOO.value | html %]" class="contributors" href="/cgi-bin/koha/opac-search.pl?q=[% FOREACH link_loo IN MARCAUTHOR_SUBFIELDS_LOO.link_loop %][% link_loo.operator |url %][% link_loo.limit |url %]:[% link_loo.link |url %][% END %]">
163
                                        [% END %]
164
                                        [% MARCAUTHOR_SUBFIELDS_LOO.value | html %]</a>
165
                                    [% END %]
166
                                    [% IF (MARCAUTHOR.authoritylink) %]
167
                                        <a class="authlink" href="/cgi-bin/koha/opac-authoritiesdetail.pl?authid=[% MARCAUTHOR.authoritylink | html %]"><i class="fa fa-search" aria-hidden="true"></i></a>
168
                                    [% END %]
169
                                    [% IF IDREF and MARCAUTHOR.unimarc3 %]
170
                                        <a href="/cgi-bin/koha/opac-idref.pl?unimarc3=[% MARCAUTHOR.unimarc3 | uri %]" title="IdRef" rel="gb_page_center[600,500]">IdRef</a>
171
                                    [% END %]
172
                                    [% UNLESS ( loop.last ) %]|[% END %]
173
                                [% END # /FOREACH MARCAUTHORS %]
174
                            </div>
175
                        [% END # IF MARCAUTHORS %]
176
177
                        [% IF ( MARCSERIES ) %]
178
                            <span class="results_summary series"><span class="label">Series:</span>
179
                                [% FOREACH MARCSERIE IN MARCSERIES %]
180
                                    [% FOREACH MARCSERIES_SUBFIELDS_LOO IN MARCSERIE.MARCSERIES_SUBFIELDS_LOOP %]
181
                                        [% IF ( MARCSERIES_SUBFIELDS_LOO.value ) %]
182
                                            <a href="/cgi-bin/koha/opac-search.pl?q=se:[% MARCSERIES_SUBFIELDS_LOO.value |url %]">[% MARCSERIES_SUBFIELDS_LOO.value | html %]</a>
183
                                        [% END %]
184
                                        [% IF ( MARCSERIES_SUBFIELDS_LOO.volumenum ) %]
185
                                            . [% MARCSERIES_SUBFIELDS_LOO.volumenum | html %]
186
                                        [% END %]
187
                                    [% END %]
188
                                    [% UNLESS ( loop.last ) %]|[% END %]
189
                                [% END # / FOREACH MARCSERIES %]
190
                            </span>
191
                        [% END # /MARCSERIES %]
192
193
                        [% IF ( editionstatement ) %]
194
                            <span class="results_summary edition"><span class="label">Edition statement:</span>[% editionstatement | html %][% IF ( editionresponsibility ) %]/[% editionresponsibility | html %][% END %]</span>
195
                        [% END %]
196
                        [% IF ( publishercode ) %]
197
                            <span class="results_summary publisher"><span class="label">Published by :</span>
198
                                <a href="/cgi-bin/koha/opac-search.pl?q=pb:[% publishercode |url %] ">
199
                                    [% publishercode | html %]
200
                                </a> [% IF ( place ) %]([% place | html %])[% END %] [% IF ( publicationyear ) %], [% publicationyear | html %][% END %]
201
                            </span>
202
                        [% END %]
203
204
                        [% IF ( pages ) %]
205
                            <span class="results_summary physical"><span class="label">Physical details:</span> [% pages | html %] [% illus | html %] [% size | html %]</span>
206
                        [% END %]
207
208
                        [% IF ( MARCISBNS ) %]
209
                            <span class="results_summary isbn"><span class="label">ISBN:</span>[% FOREACH MARCISBN IN MARCISBNS %][% MARCISBN | html %][% IF ( loop.last ) %].[% ELSE %]; [% END %][% END %]</span>
210
                        [% ELSE %]
211
                            [% IF ( normalized_isbn ) %]
212
                                <span class="results_summary isbn"><span class="label">ISBN: </span>[% normalized_isbn | html %]</span>
213
                            [% END %]
214
                        [% END %]
215
216
                        [% IF ( issn ) %]
217
                            <span class="results_summary issn"><span class="label">ISSN:</span>[% issn | html %]</span>
218
                        [% END %]
219
220
                        [% IF ( collectiontitle ) %]
221
                            <span class="results_summary collection"><span class="label">Collection: </span>
222
                                [% collectiontitle | html %]
223
                                [% IF ( collectionissn ) %] [% ', ISSN ' _  collectionissn | html %][% END %]
224
                                [% IF ( collectionvolume ) %] [% ' ; ' _ collectionvolume | html %] [% END %]
225
141
226
                            </span>
142
                    [% XSLTBloc | $raw %]
227
                        [% END %]
228
229
                        [% IF ( unititles ) %]
230
                            <span class="results_summary unititle"><span class="label">Uniform titles:</span>
231
                                [% FOREACH unititle IN unititles %]
232
                                    [% unititle.unititle | html %] ;
233
                                [% END %]
234
                            </span>
235
                        [% END %]
236
237
                        [% IF ( MARCSUBJCTS ) %]
238
                            <div class="results_summary subjects">
239
                                <span class="label">Subject(s):</span>
240
241
                                [% FOREACH MARCSUBJCT IN MARCSUBJCTS %]
242
                                    [% subjectsloop = loop %]
243
                                    [% FOREACH SUBFIELD IN MARCSUBJCT.MARCSUBJECT_SUBFIELDS_LOOP %]
244
                                        [% SUBFIELD.separator | html %]
245
                                        <a title="[% '$' _ SUBFIELD.code _ ' ' _ SUBFIELD.value | html %]" class="subject" href="/cgi-bin/koha/opac-search.pl?q=[% FOREACH link_loo IN SUBFIELD.link_loop %][% link_loo.operator |url %][% link_loo.limit |url %]:[% link_loo.link |url %][% END %]">[% SUBFIELD.value | html %]</a>
246
                                    [% END %]
247
                                    [% IF (MARCSUBJCT.authoritylink) %]
248
                                        <a class="authlink" href="/cgi-bin/koha/opac-authoritiesdetail.pl?authid=[% MARCSUBJCT.authoritylink | html %]"><i class="fa fa-search" aria-hidden="true"></i></a>
249
                                    [% END %]
250
                                    [% UNLESS ( loop.last ) %] | [% END %]
251
                                [% END # / FOREACH MARCSUBJCTS %]
252
                            </div>
253
                        [% ELSE # /IF MARCSUBJCTS %]
254
                            [% IF ( subjects ) %]
255
                                <span class="results_summary subjects"><span class="label">Subject(s):</span> [% FOREACH subject IN subjects %]<a class="subject" href="/cgi-bin/koha/opac-search.pl?q=su:[% subject.subject |url %]">[% subject.subject | html %]</a> | [% END %]</span>
256
                            [% END %]
257
                        [% END # /IF MARCSUBJCTS %]
258
259
                        [% IF ( copyrightdate ) %]
260
                            <span class="results_summary year"><span class="label">Year: </span>[% copyrightdate | html %]</span>
261
                        [% END %]
262
263
                        [% IF ( MARCURLS ) %]
264
                            <div class="results_summary online_resources"><span class="label">Online resources:</span>
265
                                <ul>
266
                                    [% FOREACH MARCurl IN MARCURLS %]
267
                                        <li>[% IF ( MARCurl.part ) %][% MARCurl.part | html %]<br />[% END %]
268
269
                                        [% IF ( OPACURLOpenInNewWindow ) %]
270
                                            [% IF trackclicks == 'track' || trackclicks == 'anonymous' %]
271
                                                <a href="/cgi-bin/koha/tracklinks.pl?uri=[% MARCurl.MARCURL | uri %]&amp;biblionumber=[% biblio.biblionumber | uri %]" title="[% MARCurl.MARCURL | html %]" target="_blank" rel="noreferrer">
272
                                            [% ELSE %]
273
                                                <a href="[% MARCurl.MARCURL | url %]" title="[% MARCurl.MARCURL | html %]" target="_blank" rel="noreferrer">
274
                                            [% END %]
275
                                        [% ELSE %]
276
                                            [% IF trackclicks == 'track' || trackclicks == 'anonymous' %]
277
                                                <a href="/cgi-bin/koha/tracklinks.pl?uri=[% MARCurl.MARCURL | uri %]&amp;biblionumber=[% biblio.biblionumber | uri %]" title="[% MARCurl.MARCURL | html %]">
278
                                            [% ELSE %]
279
                                                <a href="[% MARCurl.MARCURL | url %]" title="[% MARCurl.MARCURL | html %]">
280
                                            [% END %]
281
                                        [% END %]
282
                                        [% MARCurl.linktext | html %]</a>
283
                                            [% IF ( MARCurl.notes ) %]
284
                                                <ul>
285
                                                    [% FOREACH note IN MARCurl.notes %]
286
                                                        <li>[% note.note | html %]</li>
287
                                                    [% END %]
288
                                                </ul>
289
                                            [% END %]
290
                                        </li>
291
                                    [% END # /FOREACH MARCURLS %]
292
                                </ul>
293
                            </div>
294
                        [% END # / IF MARCURLS %]
295
                    [% END # / IF OPACXSLTDetailsDisplay %]
296
143
297
                    [% IF ( !item_level_itypes || Koha.Preference('BiblioItemtypeInfo') ) %]
144
                    [% IF ( !item_level_itypes || Koha.Preference('BiblioItemtypeInfo') ) %]
298
                        <span class="results_summary itemtype"><span class="label">Item type: </span>
145
                        <span class="results_summary itemtype"><span class="label">Item type: </span>
(-)a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-results.tt (-91 / +1 lines)
Lines 445-542 Link Here
445
                                                    <span class="Z3988" title="[% SEARCH_RESULT.coins | html %]"></span>
445
                                                    <span class="Z3988" title="[% SEARCH_RESULT.coins | html %]"></span>
446
                                                [% END %]
446
                                                [% END %]
447
                                                <div id="title_summary_[% SEARCH_RESULT.biblionumber | html %]" class="title_summary">
447
                                                <div id="title_summary_[% SEARCH_RESULT.biblionumber | html %]" class="title_summary">
448
                                                [% IF ( OPACXSLTResultsDisplay ) %]
449
                                                    [% SEARCH_RESULT.XSLTResultsRecord | $raw %]
450
                                                [% ELSE %]
451
                                                    [% IF ( BiblioDefaultViewmarc ) %]
452
                                                        <a class="title" href="/cgi-bin/koha/opac-MARCdetail.pl?biblionumber=[% SEARCH_RESULT.biblionumber | url %]" title="View details for this title">
453
                                                    [% ELSE %]
454
                                                        [% IF ( BiblioDefaultViewisbd ) %]
455
                                                            <a class="title" href="/cgi-bin/koha/opac-ISBDdetail.pl?biblionumber=[% SEARCH_RESULT.biblionumber | url %]" title="View details for this title">
456
                                                        [% ELSE %]
457
                                                            <a class="title" href="/cgi-bin/koha/opac-detail.pl?biblionumber=[% SEARCH_RESULT.biblionumber | url %]" title="View details for this title">
458
                                                        [% END %]
459
                                                    [% END %]
460
461
                                                    [% INCLUDE 'biblio-title.inc' biblio=SEARCH_RESULT %]
462
448
463
                                                    [% IF ( SEARCH_RESULT.author ) %]
449
                                                [% SEARCH_RESULT.XSLTResultsRecord | $raw %]
464
                                                        by <a href="/cgi-bin/koha/opac-search.pl?q=au:[% SEARCH_RESULT.author | url %]" title="Search for works by this author" class="author">[% SEARCH_RESULT.author | html %]</a>
465
                                                    [% ELSE %]
466
                                                        &nbsp;
467
                                                    [% END %]
468
469
                                                    <span class="results_summary publisher">
470
                                                        <span class="label">Publication:</span>
471
                                                            [% IF ( SEARCH_RESULT.place ) %][% SEARCH_RESULT.place | html %] [% END %]
472
                                                            [% IF ( SEARCH_RESULT.publishercode ) %][% SEARCH_RESULT.publishercode | html %][% END %]
473
                                                            [% IF ( SEARCH_RESULT.publicationyear ) %]
474
                                                                [% SEARCH_RESULT.publicationyear | html %]
475
                                                            [% ELSE %]
476
                                                                [% IF ( SEARCH_RESULT.copyrightdate ) %]
477
                                                                    [% SEARCH_RESULT.copyrightdate | html %]
478
                                                                [% END %]
479
                                                            [% END %]
480
                                                            [% IF ( SEARCH_RESULT.pages ) %]. [% SEARCH_RESULT.pages | html %][% END %]
481
                                                            [% IF ( SEARCH_RESULT.notes ) %], [% SEARCH_RESULT.notes | html %][% END %]
482
                                                            [% IF ( SEARCH_RESULT.size ) %] [% SEARCH_RESULT.size | html %][% END %]
483
                                                            [% IF ( SEARCH_RESULT.timestamp ) %] <em>(modified on [% SEARCH_RESULT.timestamp | html %])</em>[% END %]
484
                                                    </span>
485
486
                                                    [% IF ( SEARCH_RESULT.summary ) %]
487
                                                        <span class="result_summary">
488
                                                            [% SEARCH_RESULT.summary | html %]
489
                                                        </span>
490
                                                    [% END %]
491
492
                                                    [% IF ( SEARCH_RESULT.copyrightdate ) %]
493
                                                        <span class="results_summary date">
494
                                                            <span class="label">Date:</span>
495
                                                            [% SEARCH_RESULT.copyrightdate | html %]
496
                                                        </span>
497
                                                    [% END %]
498
499
                                                    <span class="results_summary">
500
                                                        <span class="label">Availability:</span>
501
                                                            [% IF ( SEARCH_RESULT.available_items_loop.size() ) %]
502
                                                                <span class="available"><strong>Items available:</strong>
503
                                                                    [% FOREACH available_items_loo IN SEARCH_RESULT.available_items_loop %]
504
                                                                        <span>
505
                                                                        [% IF ( singleBranchMode ) %]
506
                                                                            <span class="shelvingloc">[% available_items_loo.location | html %]</span>
507
                                                                        [% ELSE %]
508
                                                                            [% available_items_loo.branchname | html %]
509
                                                                        [% END %]
510
511
                                                                        [% IF ( OPACItemsResultsDisplay ) %]
512
                                                                            [% UNLESS ( singleBranchMode ) %]<span class="shelvingloc">[% available_items_loo.location | html %]</span>[% END %]
513
                                                                            [% IF ( available_items_loo.itemcallnumber ) %][<a href="/cgi-bin/koha/opac-search.pl?q=callnum:%22[% available_items_loo.itemcallnumber | url %]%22">[% available_items_loo.itemcallnumber | html %]</a>][% END %]
514
                                                                        [% END %]
515
                                                                        ([% available_items_loo.count | html %]),
516
                                                                        </span>
517
                                                                    [% END # / FOREACH available_items_loo %]
518
                                                                </span>
519
                                                            [% ELSE %]
520
                                                                [% IF ( SEARCH_RESULT.ALTERNATEHOLDINGS ) %]
521
                                                                    [% FOREACH ALTERNATEHOLDING IN SEARCH_RESULT.ALTERNATEHOLDINGS %]
522
                                                                        &nbsp;<span id="alternateholdings">[% ALTERNATEHOLDING.holding | html %]</span>,
523
                                                                    [% END %]
524
                                                                [% ELSE %]
525
                                                                    <span class="unavailable">No items available:</span>
526
                                                                [% END %]
527
                                                            [% END # / IF SEARCH_RESULT.available_items_loop.size %]
528
529
                                                            <span class="unavailable">
530
                                                                [% IF ( SEARCH_RESULT.onloancount ) %] Checked out ([% SEARCH_RESULT.onloancount | html %]), [% END %]
531
                                                                [% IF ( SEARCH_RESULT.withdrawncount ) %] Withdrawn ([% SEARCH_RESULT.withdrawncount | html %]), [% END %]
532
                                                                [% UNLESS ( SEARCH_RESULT.hidelostitems ) %][% IF ( SEARCH_RESULT.itemlostcount ) %] Lost ([% SEARCH_RESULT.itemlostcount | html %]),[% END %][% END %]
533
                                                                [% IF ( SEARCH_RESULT.damagedcount ) %] Damaged ([% SEARCH_RESULT.damagedcount | html %]),[% END %]
534
                                                                [% IF ( SEARCH_RESULT.orderedcount ) %] On order ([% SEARCH_RESULT.orderedcount | html %]),[% END %]
535
                                                                [% IF ( SEARCH_RESULT.onholdcount ) %] On hold ([% SEARCH_RESULT.onholdcount | html %]),[% END %]
536
                                                                [% IF ( SEARCH_RESULT.intransitcount ) %] In transit ([% SEARCH_RESULT.intransitcount | html %]),[% END %]
537
                                                            </span>
538
                                                    </span> <!-- / .results_summary -->
539
                                                [% END # / IF OPACXSLTResultsDisplay %]
540
450
541
                                                [% IF ( SEARCH_RESULT.score_avg ) %]
451
                                                [% IF ( SEARCH_RESULT.score_avg ) %]
542
                                                    <div class="results_summary">
452
                                                    <div class="results_summary">
(-)a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-shelves.tt (-59 / +1 lines)
Lines 480-545 Link Here
480
                                                            [% END %]
480
                                                            [% END %]
481
481
482
                                                        </div>
482
                                                        </div>
483
                                                        [% IF ( itemsloo.XSLTBloc ) %]
484
                                                            [% itemsloo.XSLTBloc | $raw %]
485
                                                        [% ELSE %]
486
487
                                                            [% IF ( itemsloo.BiblioDefaultViewmarc ) %]
488
                                                                <a class="title" href="/cgi-bin/koha/opac-MARCdetail.pl?biblionumber=[% itemsloo.biblionumber |url %]" title="View details for this title">
489
                                                            [% ELSE %]
490
                                                                [% IF ( itemsloo.BiblioDefaultViewisbd ) %]
491
                                                                    <a class="title" href="/cgi-bin/koha/opac-ISBDdetail.pl?biblionumber=[% itemsloo.biblionumber |url %]" title="View details for this title">
492
                                                                [% ELSE %]
493
                                                                    <a class="title" href="/cgi-bin/koha/opac-detail.pl?biblionumber=[% itemsloo.biblionumber |url %]" title="View details for this title">
494
                                                                [% END %]
495
                                                            [% END %]
496
497
                                                            [% INCLUDE 'biblio-title.inc' biblio=itemsloo %]
498
                                                            </a>
499
483
500
                                                            [% IF ( itemsloo.author ) %]
484
                                                        [% itemsloo.XSLTBloc | $raw %]
501
                                                                by <a href="/cgi-bin/koha/opac-search.pl?q=au:[% itemsloo.author |url %]" title="Search for works by this author" class="author">[% itemsloo.author | html %]</a>
502
                                                            [% ELSE %]
503
                                                                &nbsp;
504
                                                            [% END %]
505
506
                                                            <span class="results_summary">
507
                                                                <span class="label">Publication:</span>
508
                                                                [% IF ( itemsloo.place ) %]
509
                                                                    [% itemsloo.place | html %]
510
                                                                [% END %]
511
                                                                [% IF ( itemsloo.publishercode ) %]
512
                                                                    [% itemsloo.publishercode | html %]
513
                                                                [% END %]
514
                                                                [% IF ( itemsloo.publicationyear ) %]
515
                                                                    [% itemsloo.publicationyear | html %]
516
                                                                [% ELSE %]
517
                                                                    [% IF ( itemsloo.copyrightdate ) %]
518
                                                                        [% itemsloo.copyrightdate | html %]
519
                                                                    [% END %]
520
                                                                [% END %]
521
                                                                [% IF ( itemsloo.pages ) %]. [% itemsloo.pages | html %][% END %]
522
                                                                [% IF ( itemsloo.notes ) %], [% itemsloo.notes | html %][% END %]
523
                                                                [% IF ( itemsloo.item('size') ) %] [% itemsloo.item('size') | html %][% END %]
524
                                                            </span>
525
                                                            <span class="results_summary">
526
                                                                <span class="label">Holdings:</span>
527
                                                                [% IF ( itemsloo.ITEM_RESULTS ) %]
528
                                                                    [% FOREACH ITEM_RESULT IN itemsloo.ITEM_RESULTS %]
529
                                                                        [% ITEM_RESULT.homebranch | html %]
530
                                                                        [% IF ( ITEM_RESULT.location_opac ) %]
531
                                                                            <span class="shelvingloc">[% ITEM_RESULT.location_opac | html %]</span>
532
                                                                        [% END %]
533
                                                                        [% IF ( ITEM_RESULT.itemcallnumber ) %]
534
                                                                            ([% ITEM_RESULT.itemcallnumber | html %])
535
                                                                                [% IF ( loop.last ) %].[% ELSE %],[% END %]
536
                                                                        [% END %]
537
                                                                    [% END %]
538
                                                                [% ELSE %]
539
                                                                    This record has no items.
540
                                                                [% END %]
541
                                                            </span>
542
                                                        [% END # / IF itemsloo.XSLTBloc %]
543
485
544
                                                        [% IF ( TagsShowEnabled && itemsloo.TagLoop.size ) %]
486
                                                        [% IF ( TagsShowEnabled && itemsloo.TagLoop.size ) %]
545
                                                            <div class="results_summary tags">
487
                                                            <div class="results_summary tags">
(-)a/opac/opac-detail.pl (-22 / +5 lines)
Lines 173-184 SetUTF8Flag($record); Link Here
173
my $marcflavour      = C4::Context->preference("marcflavour");
173
my $marcflavour      = C4::Context->preference("marcflavour");
174
my $ean = GetNormalizedEAN( $record, $marcflavour );
174
my $ean = GetNormalizedEAN( $record, $marcflavour );
175
175
176
# XSLT processing of some stuff
176
{
177
my $xslfile = C4::Context->preference('OPACXSLTDetailsDisplay');
178
my $lang   = $xslfile ? C4::Languages::getlanguage()  : undef;
179
my $sysxml = $xslfile ? C4::XSLT::get_xslt_sysprefs() : undef;
180
177
181
if ( $xslfile ) {
178
    # XSLT processing of some stuff
179
    my $xslfile = C4::Context->preference('OPACXSLTDetailsDisplay') || "default";
180
    my $lang   = C4::Languages::getlanguage();
181
    my $sysxml = C4::XSLT::get_xslt_sysprefs();
182
182
183
    my $searcher = Koha::SearchEngine::Search->new(
183
    my $searcher = Koha::SearchEngine::Search->new(
184
        { index => $Koha::SearchEngine::BIBLIOS_INDEX }
184
        { index => $Koha::SearchEngine::BIBLIOS_INDEX }
Lines 764-786 if (scalar(@itemloop) == 0 || scalar(@otheritemloop) == 0) { Link Here
764
    }
764
    }
765
}
765
}
766
766
767
## get notes and subjects from MARC record
768
if (!C4::Context->preference("OPACXSLTDetailsDisplay") ) {
769
    my $marcisbnsarray   = GetMarcISBN    ($record,$marcflavour);
770
    my $marcauthorsarray = GetMarcAuthors ($record,$marcflavour);
771
    my $marcsubjctsarray = GetMarcSubjects($record,$marcflavour);
772
    my $marcseriesarray  = GetMarcSeries  ($record,$marcflavour);
773
    my $marcurlsarray    = GetMarcUrls    ($record,$marcflavour);
774
775
    $template->param(
776
        MARCSUBJCTS => $marcsubjctsarray,
777
        MARCAUTHORS => $marcauthorsarray,
778
        MARCSERIES  => $marcseriesarray,
779
        MARCURLS    => $marcurlsarray,
780
        MARCISBNS   => $marcisbnsarray,
781
    );
782
}
783
784
my $marcnotesarray = $biblio->get_marc_notes({ marcflavour => $marcflavour, opac => 1 });
767
my $marcnotesarray = $biblio->get_marc_notes({ marcflavour => $marcflavour, opac => 1 });
785
768
786
if( C4::Context->preference('ArticleRequests') ) {
769
if( C4::Context->preference('ArticleRequests') ) {
(-)a/opac/opac-shelves.pl (-15 / +13 lines)
Lines 293-301 if ( $op eq 'view' ) { Link Here
293
            }
293
            }
294
294
295
            # Lists display falls back to search results configuration
295
            # Lists display falls back to search results configuration
296
            my $xslfile = C4::Context->preference('OPACXSLTListsDisplay');
296
            my $xslfile = C4::Context->preference('OPACXSLTListsDisplay') || "default";
297
            my $lang   = $xslfile ? C4::Languages::getlanguage()  : undef;
297
            my $lang   = C4::Languages::getlanguage();
298
            my $sysxml = $xslfile ? C4::XSLT::get_xslt_sysprefs() : undef;
298
            my $sysxml = C4::XSLT::get_xslt_sysprefs();
299
299
300
            my $record_processor = Koha::RecordProcessor->new({ filters => 'ViewPolicy' });
300
            my $record_processor = Koha::RecordProcessor->new({ filters => 'ViewPolicy' });
301
301
Lines 317-334 if ( $op eq 'view' ) { Link Here
317
                });
317
                });
318
                $record_processor->process($record);
318
                $record_processor->process($record);
319
319
320
                if ($xslfile) {
320
                my $variables = {
321
                    my $variables = {
321
                    anonymous_session => ($loggedinuser) ? 0 : 1
322
                        anonymous_session => ($loggedinuser) ? 0 : 1
322
                };
323
                    };
323
                $this_item->{XSLTBloc} = XSLTParse4Display(
324
                    $this_item->{XSLTBloc} = XSLTParse4Display(
324
                    $biblionumber,          $record,
325
                        $biblionumber,          $record,
325
                    "OPACXSLTListsDisplay", 1,
326
                        "OPACXSLTListsDisplay", 1,
326
                    undef,                  $sysxml,
327
                        undef,                  $sysxml,
327
                    $xslfile,               $lang,
328
                        $xslfile,               $lang,
328
                    $variables
329
                        $variables
329
                );
330
                    );
331
                }
332
330
333
                my $marcflavour = C4::Context->preference("marcflavour");
331
                my $marcflavour = C4::Context->preference("marcflavour");
334
                my $itemtype = Koha::Biblioitems->search({ biblionumber => $content->biblionumber })->next->itemtype;
332
                my $itemtype = Koha::Biblioitems->search({ biblionumber => $content->biblionumber })->next->itemtype;
(-)a/opac/opac-tags.pl (-16 / +14 lines)
Lines 287-308 if ($loggedinuser) { Link Here
287
        # BZ17530: 'Intelligent' guess if result can be article requested
287
        # BZ17530: 'Intelligent' guess if result can be article requested
288
        $tag->{artreqpossible} = ( $art_req_itypes->{ $tag->{itemtype} // q{} } || $art_req_itypes->{ '*' } ) ? 1 : q{};
288
        $tag->{artreqpossible} = ( $art_req_itypes->{ $tag->{itemtype} // q{} } || $art_req_itypes->{ '*' } ) ? 1 : q{};
289
289
290
        my $xslfile = C4::Context->preference('OPACXSLTResultsDisplay');
290
        my $xslfile = C4::Context->preference('OPACXSLTResultsDisplay') || "default";
291
        my $lang   = $xslfile ? C4::Languages::getlanguage()  : undef;
291
        my $lang   = C4::Languages::getlanguage();
292
        my $sysxml = $xslfile ? C4::XSLT::get_xslt_sysprefs() : undef;
292
        my $sysxml = C4::XSLT::get_xslt_sysprefs();
293
293
294
        if ($xslfile) {
294
        my $variables = {
295
            my $variables = {
295
            anonymous_session => ($loggedinuser) ? 0 : 1
296
                anonymous_session => ($loggedinuser) ? 0 : 1
296
        };
297
            };
297
        $tag->{XSLTBloc} = XSLTParse4Display(
298
            $tag->{XSLTBloc} = XSLTParse4Display(
298
            $tag->{biblionumber},     $record,
299
                $tag->{biblionumber},     $record,
299
            "OPACXSLTResultsDisplay", 1,
300
                "OPACXSLTResultsDisplay", 1,
300
            $hidden_items,            $sysxml,
301
                $hidden_items,            $sysxml,
301
            $xslfile,                 $lang,
302
                $xslfile,                 $lang,
302
            $variables
303
                $variables
303
        );
304
            );
305
        }
306
304
307
        my $date = $tag->{date_created} || '';
305
        my $date = $tag->{date_created} || '';
308
        $date =~ /\s+(\d{2}\:\d{2}\:\d{2})/;
306
        $date =~ /\s+(\d{2}\:\d{2}\:\d{2})/;
(-)a/virtualshelves/shelves.pl (-7 / +4 lines)
Lines 254-261 if ( $op eq 'view' ) { Link Here
254
            );
254
            );
255
255
256
            my $xslfile = C4::Context->preference('XSLTListsDisplay');
256
            my $xslfile = C4::Context->preference('XSLTListsDisplay');
257
            my $lang   = $xslfile ? C4::Languages::getlanguage()  : undef;
257
            my $lang   = C4::Languages::getlanguage();
258
            my $sysxml = $xslfile ? C4::XSLT::get_xslt_sysprefs() : undef;
258
            my $sysxml = C4::XSLT::get_xslt_sysprefs();
259
259
260
            my @items;
260
            my @items;
261
            while ( my $content = $contents->next ) {
261
            while ( my $content = $contents->next ) {
Lines 263-272 if ( $op eq 'view' ) { Link Here
263
                my $biblionumber = $content->biblionumber;
263
                my $biblionumber = $content->biblionumber;
264
                my $record       = GetMarcBiblio({ biblionumber => $biblionumber });
264
                my $record       = GetMarcBiblio({ biblionumber => $biblionumber });
265
265
266
                if ( $xslfile ) {
266
                $this_item->{XSLTBloc} = XSLTParse4Display( $biblionumber, $record, "XSLTListsDisplay",
267
                    $this_item->{XSLTBloc} = XSLTParse4Display( $biblionumber, $record, "XSLTListsDisplay",
267
                                                            1, undef, $sysxml, $xslfile, $lang);
268
                                                                1, undef, $sysxml, $xslfile, $lang);
269
                }
270
268
271
                my $marcflavour = C4::Context->preference("marcflavour");
269
                my $marcflavour = C4::Context->preference("marcflavour");
272
                my $itemtype = Koha::Biblioitems->search({ biblionumber => $content->biblionumber })->next->itemtype;
270
                my $itemtype = Koha::Biblioitems->search({ biblionumber => $content->biblionumber })->next->itemtype;
273
- 

Return to bug 12561