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 613-620 sub get_template_and_user { Link Here
613
            suggestion                            => "" . C4::Context->preference("suggestion"),
611
            suggestion                            => "" . C4::Context->preference("suggestion"),
614
            virtualshelves                        => "" . C4::Context->preference("virtualshelves"),
612
            virtualshelves                        => "" . C4::Context->preference("virtualshelves"),
615
            OPACSerialIssueDisplayCount           => C4::Context->preference("OPACSerialIssueDisplayCount"),
613
            OPACSerialIssueDisplayCount           => C4::Context->preference("OPACSerialIssueDisplayCount"),
616
            OPACXSLTDetailsDisplay                => C4::Context->preference("OPACXSLTDetailsDisplay"),
617
            OPACXSLTResultsDisplay                => C4::Context->preference("OPACXSLTResultsDisplay"),
618
            SyndeticsClientCode                   => C4::Context->preference("SyndeticsClientCode"),
614
            SyndeticsClientCode                   => C4::Context->preference("SyndeticsClientCode"),
619
            SyndeticsEnabled                      => C4::Context->preference("SyndeticsEnabled"),
615
            SyndeticsEnabled                      => C4::Context->preference("SyndeticsEnabled"),
620
            SyndeticsCoverImages                  => C4::Context->preference("SyndeticsCoverImages"),
616
            SyndeticsCoverImages                  => C4::Context->preference("SyndeticsCoverImages"),
(-)a/C4/Search.pm (-55 / +4 lines)
Lines 1655-1671 sub searchResults { Link Here
1655
    my ($bibliotag,$bibliosubf)=GetMarcFromKohaField( 'biblio.biblionumber' );
1655
    my ($bibliotag,$bibliosubf)=GetMarcFromKohaField( 'biblio.biblionumber' );
1656
1656
1657
    # set stuff for XSLT processing here once, not later again for every record we retrieved
1657
    # set stuff for XSLT processing here once, not later again for every record we retrieved
1658
    my $xslfile;
1658
    my $xslsyspref = $is_opac ? 'OPACXSLTResultsDisplay' : 'XSLTResultsDisplay';
1659
    my $xslsyspref;
1659
    my $xslfile = C4::Context->preference( $xslsyspref ) || "default";
1660
    if( $is_opac ){
1660
    my $lang   = C4::Languages::getlanguage();
1661
        $xslsyspref = "OPACXSLTResultsDisplay";
1661
    my $sysxml = C4::XSLT::get_xslt_sysprefs();
1662
        $xslfile = C4::Context->preference( $xslsyspref );
1663
    } else {
1664
        $xslsyspref = "XSLTResultsDisplay";
1665
        $xslfile = C4::Context->preference( $xslsyspref ) || "default";
1666
    }
1667
    my $lang   = $xslfile ? C4::Languages::getlanguage()  : undef;
1668
    my $sysxml = $xslfile ? C4::XSLT::get_xslt_sysprefs() : undef;
1669
1662
1670
    my $userenv = C4::Context->userenv;
1663
    my $userenv = C4::Context->userenv;
1671
    my $logged_in_user
1664
    my $logged_in_user
Lines 1719-1768 sub searchResults { Link Here
1719
        # Build summary if there is one (the summary is defined in the itemtypes table)
1712
        # Build summary if there is one (the summary is defined in the itemtypes table)
1720
        $oldbiblio->{description} = $itemtype ? $itemtype->{translated_description} : q{};
1713
        $oldbiblio->{description} = $itemtype ? $itemtype->{translated_description} : q{};
1721
1714
1722
        # FIXME: this is only used in the deprecated non-XLST opac results
1723
        if ( !$xslfile && $is_opac && $itemtype && $itemtype->{summary} ) {
1724
            my $summary = $itemtypes{ $oldbiblio->{itemtype} }->{summary};
1725
            my @fields  = $marcrecord->fields();
1726
1727
            my $newsummary;
1728
            foreach my $line ( "$summary\n" =~ /(.*)\n/g ){
1729
                my $tags = {};
1730
                foreach my $tag ( $line =~ /\[(\d{3}[\w|\d])\]/ ) {
1731
                    $tag =~ /(.{3})(.)/;
1732
                    if($marcrecord->field($1)){
1733
                        my @abc = $marcrecord->field($1)->subfield($2);
1734
                        $tags->{$tag} = $#abc + 1 ;
1735
                    }
1736
                }
1737
1738
                # We catch how many times to repeat this line
1739
                my $max = 0;
1740
                foreach my $tag (keys(%$tags)){
1741
                    $max = $tags->{$tag} if($tags->{$tag} > $max);
1742
                 }
1743
1744
                # we replace, and repeat each line
1745
                for (my $i = 0 ; $i < $max ; $i++){
1746
                    my $newline = $line;
1747
1748
                    foreach my $tag ( $newline =~ /\[(\d{3}[\w|\d])\]/g ) {
1749
                        $tag =~ /(.{3})(.)/;
1750
1751
                        if($marcrecord->field($1)){
1752
                            my @repl = $marcrecord->field($1)->subfield($2);
1753
                            my $subfieldvalue = $repl[$i];
1754
                            $newline =~ s/\[$tag\]/$subfieldvalue/g;
1755
                        }
1756
                    }
1757
                    $newsummary .= "$newline\n";
1758
                }
1759
            }
1760
1761
            $newsummary =~ s/\[(.*?)]//g;
1762
            $newsummary =~ s/\n/<br\/>/g;
1763
            $oldbiblio->{summary} = $newsummary;
1764
        }
1765
1766
        # Pull out the items fields
1715
        # Pull out the items fields
1767
        my @fields = $marcrecord->field($itemtag);
1716
        my @fields = $marcrecord->field($itemtag);
1768
        my $marcflavor = C4::Context->preference("marcflavour");
1717
        my $marcflavor = C4::Context->preference("marcflavour");
(-)a/catalogue/detail.pl (-6 / +5 lines)
Lines 122-133 my $fw = GetFrameworkCode($biblionumber); Link Here
122
my $showallitems = $query->param('showallitems');
122
my $showallitems = $query->param('showallitems');
123
my $marcflavour  = C4::Context->preference("marcflavour");
123
my $marcflavour  = C4::Context->preference("marcflavour");
124
124
125
# XSLT processing of some stuff
125
{
126
my $xslfile = C4::Context->preference('XSLTDetailsDisplay') || "default";
126
    # XSLT processing of some stuff
127
my $lang   = $xslfile ? C4::Languages::getlanguage()  : undef;
127
    my $xslfile = C4::Context->preference('XSLTDetailsDisplay') || "default";
128
my $sysxml = $xslfile ? C4::XSLT::get_xslt_sysprefs() : undef;
128
    my $lang   = C4::Languages::getlanguage();
129
129
    my $sysxml = C4::XSLT::get_xslt_sysprefs();
130
if ( $xslfile ) {
131
130
132
    my $searcher = Koha::SearchEngine::Search->new(
131
    my $searcher = Koha::SearchEngine::Search->new(
133
        { index => $Koha::SearchEngine::BIBLIOS_INDEX }
132
        { 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 178-184 Link Here
178
[% INCLUDE 'opac-bottom.inc' %]
176
[% INCLUDE 'opac-bottom.inc' %]
179
[% BLOCK jsinclude %]
177
[% BLOCK jsinclude %]
180
<script>
178
<script>
181
[% IF ( OPACXSLTDetailsDisplay ) %]
182
    $(document).ready(function(){
179
    $(document).ready(function(){
183
        var loaded = 0;
180
        var loaded = 0;
184
        var toggle = 0;
181
        var toggle = 0;
Lines 211-216 Link Here
211
            }
208
            }
212
        });
209
        });
213
    });
210
    });
214
[% END %]
215
</script>
211
</script>
216
[% END %]
212
[% 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 447-544 Link Here
447
                                                    <span class="Z3988" title="[% SEARCH_RESULT.coins | html %]"></span>
447
                                                    <span class="Z3988" title="[% SEARCH_RESULT.coins | html %]"></span>
448
                                                [% END %]
448
                                                [% END %]
449
                                                <div id="title_summary_[% SEARCH_RESULT.biblionumber | html %]" class="title_summary">
449
                                                <div id="title_summary_[% SEARCH_RESULT.biblionumber | html %]" class="title_summary">
450
                                                [% IF ( OPACXSLTResultsDisplay ) %]
451
                                                    [% SEARCH_RESULT.XSLTResultsRecord | $raw %]
452
                                                [% ELSE %]
453
                                                    [% IF ( BiblioDefaultViewmarc ) %]
454
                                                        <a class="title" href="/cgi-bin/koha/opac-MARCdetail.pl?biblionumber=[% SEARCH_RESULT.biblionumber | url %]" title="View details for this title">
455
                                                    [% ELSE %]
456
                                                        [% IF ( BiblioDefaultViewisbd ) %]
457
                                                            <a class="title" href="/cgi-bin/koha/opac-ISBDdetail.pl?biblionumber=[% SEARCH_RESULT.biblionumber | url %]" title="View details for this title">
458
                                                        [% ELSE %]
459
                                                            <a class="title" href="/cgi-bin/koha/opac-detail.pl?biblionumber=[% SEARCH_RESULT.biblionumber | url %]" title="View details for this title">
460
                                                        [% END %]
461
                                                    [% END %]
462
463
                                                    [% INCLUDE 'biblio-title.inc' biblio=SEARCH_RESULT %]
464
450
465
                                                    [% IF ( SEARCH_RESULT.author ) %]
451
                                                [% SEARCH_RESULT.XSLTResultsRecord | $raw %]
466
                                                        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>
467
                                                    [% ELSE %]
468
                                                        &nbsp;
469
                                                    [% END %]
470
471
                                                    <span class="results_summary publisher">
472
                                                        <span class="label">Publication:</span>
473
                                                            [% IF ( SEARCH_RESULT.place ) %][% SEARCH_RESULT.place | html %] [% END %]
474
                                                            [% IF ( SEARCH_RESULT.publishercode ) %][% SEARCH_RESULT.publishercode | html %][% END %]
475
                                                            [% IF ( SEARCH_RESULT.publicationyear ) %]
476
                                                                [% SEARCH_RESULT.publicationyear | html %]
477
                                                            [% ELSE %]
478
                                                                [% IF ( SEARCH_RESULT.copyrightdate ) %]
479
                                                                    [% SEARCH_RESULT.copyrightdate | html %]
480
                                                                [% END %]
481
                                                            [% END %]
482
                                                            [% IF ( SEARCH_RESULT.pages ) %]. [% SEARCH_RESULT.pages | html %][% END %]
483
                                                            [% IF ( SEARCH_RESULT.notes ) %], [% SEARCH_RESULT.notes | html %][% END %]
484
                                                            [% IF ( SEARCH_RESULT.size ) %] [% SEARCH_RESULT.size | html %][% END %]
485
                                                            [% IF ( SEARCH_RESULT.timestamp ) %] <em>(modified on [% SEARCH_RESULT.timestamp | html %])</em>[% END %]
486
                                                    </span>
487
488
                                                    [% IF ( SEARCH_RESULT.summary ) %]
489
                                                        <span class="result_summary">
490
                                                            [% SEARCH_RESULT.summary | html %]
491
                                                        </span>
492
                                                    [% END %]
493
494
                                                    [% IF ( SEARCH_RESULT.copyrightdate ) %]
495
                                                        <span class="results_summary date">
496
                                                            <span class="label">Date:</span>
497
                                                            [% SEARCH_RESULT.copyrightdate | html %]
498
                                                        </span>
499
                                                    [% END %]
500
501
                                                    <span class="results_summary">
502
                                                        <span class="label">Availability:</span>
503
                                                            [% IF ( SEARCH_RESULT.available_items_loop.size() ) %]
504
                                                                <span class="available"><strong>Items available:</strong>
505
                                                                    [% FOREACH available_items_loo IN SEARCH_RESULT.available_items_loop %]
506
                                                                        <span>
507
                                                                        [% IF ( singleBranchMode ) %]
508
                                                                            <span class="shelvingloc">[% available_items_loo.location | html %]</span>
509
                                                                        [% ELSE %]
510
                                                                            [% available_items_loo.branchname | html %]
511
                                                                        [% END %]
512
513
                                                                        [% IF ( OPACItemsResultsDisplay ) %]
514
                                                                            [% UNLESS ( singleBranchMode ) %]<span class="shelvingloc">[% available_items_loo.location | html %]</span>[% END %]
515
                                                                            [% 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 %]
516
                                                                        [% END %]
517
                                                                        ([% available_items_loo.count | html %]),
518
                                                                        </span>
519
                                                                    [% END # / FOREACH available_items_loo %]
520
                                                                </span>
521
                                                            [% ELSE %]
522
                                                                [% IF ( SEARCH_RESULT.ALTERNATEHOLDINGS ) %]
523
                                                                    [% FOREACH ALTERNATEHOLDING IN SEARCH_RESULT.ALTERNATEHOLDINGS %]
524
                                                                        &nbsp;<span id="alternateholdings">[% ALTERNATEHOLDING.holding | html %]</span>,
525
                                                                    [% END %]
526
                                                                [% ELSE %]
527
                                                                    <span class="unavailable">No items available:</span>
528
                                                                [% END %]
529
                                                            [% END # / IF SEARCH_RESULT.available_items_loop.size %]
530
531
                                                            <span class="unavailable">
532
                                                                [% IF ( SEARCH_RESULT.onloancount ) %] Checked out ([% SEARCH_RESULT.onloancount | html %]), [% END %]
533
                                                                [% IF ( SEARCH_RESULT.withdrawncount ) %] Withdrawn ([% SEARCH_RESULT.withdrawncount | html %]), [% END %]
534
                                                                [% UNLESS ( SEARCH_RESULT.hidelostitems ) %][% IF ( SEARCH_RESULT.itemlostcount ) %] Lost ([% SEARCH_RESULT.itemlostcount | html %]),[% END %][% END %]
535
                                                                [% IF ( SEARCH_RESULT.damagedcount ) %] Damaged ([% SEARCH_RESULT.damagedcount | html %]),[% END %]
536
                                                                [% IF ( SEARCH_RESULT.orderedcount ) %] On order ([% SEARCH_RESULT.orderedcount | html %]),[% END %]
537
                                                                [% IF ( SEARCH_RESULT.onholdcount ) %] On hold ([% SEARCH_RESULT.onholdcount | html %]),[% END %]
538
                                                                [% IF ( SEARCH_RESULT.intransitcount ) %] In transit ([% SEARCH_RESULT.intransitcount | html %]),[% END %]
539
                                                            </span>
540
                                                    </span> <!-- / .results_summary -->
541
                                                [% END # / IF OPACXSLTResultsDisplay %]
542
452
543
                                                [% IF ( SEARCH_RESULT.score_avg ) %]
453
                                                [% IF ( SEARCH_RESULT.score_avg ) %]
544
                                                    <div class="results_summary">
454
                                                    <div class="results_summary">
(-)a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-shelves.tt (-60 / +1 lines)
Lines 480-546 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 IN itemsloo.ITEM_RESULTS %]
529
                                                                        [% item.homebranch | html %]
530
                                                                        [% SET location_opac = AuthorisedValues.GetByCode( 'LOC', item.location, 1 ) %]
531
                                                                        [% IF location_opac %]
532
                                                                            <span class="shelvingloc">[% location_opac | html %]</span>
533
                                                                        [% END %]
534
                                                                        [% IF item.itemcallnumber %]
535
                                                                            ([% item.itemcallnumber | html %])
536
                                                                                [% IF ( loop.last ) %].[% ELSE %],[% END %]
537
                                                                        [% END %]
538
                                                                    [% END %]
539
                                                                [% ELSE %]
540
                                                                    This record has no items.
541
                                                                [% END %]
542
                                                            </span>
543
                                                        [% END # / IF itemsloo.XSLTBloc %]
544
485
545
                                                        [% IF ( TagsShowEnabled && itemsloo.TagLoop.size ) %]
486
                                                        [% IF ( TagsShowEnabled && itemsloo.TagLoop.size ) %]
546
                                                            <div class="results_summary tags">
487
                                                            <div class="results_summary tags">
(-)a/opac/opac-detail.pl (-22 / +5 lines)
Lines 193-204 SetUTF8Flag($record); Link Here
193
my $marcflavour      = C4::Context->preference("marcflavour");
193
my $marcflavour      = C4::Context->preference("marcflavour");
194
my $ean = GetNormalizedEAN( $record, $marcflavour );
194
my $ean = GetNormalizedEAN( $record, $marcflavour );
195
195
196
# XSLT processing of some stuff
196
{
197
my $xslfile = C4::Context->preference('OPACXSLTDetailsDisplay');
198
my $lang   = $xslfile ? C4::Languages::getlanguage()  : undef;
199
my $sysxml = $xslfile ? C4::XSLT::get_xslt_sysprefs() : undef;
200
197
201
if ( $xslfile ) {
198
    # XSLT processing of some stuff
199
    my $xslfile = C4::Context->preference('OPACXSLTDetailsDisplay') || "default";
200
    my $lang   = C4::Languages::getlanguage();
201
    my $sysxml = C4::XSLT::get_xslt_sysprefs();
202
202
203
    my $searcher = Koha::SearchEngine::Search->new(
203
    my $searcher = Koha::SearchEngine::Search->new(
204
        { index => $Koha::SearchEngine::BIBLIOS_INDEX }
204
        { index => $Koha::SearchEngine::BIBLIOS_INDEX }
Lines 784-806 if (scalar(@itemloop) == 0 || scalar(@otheritemloop) == 0) { Link Here
784
    }
784
    }
785
}
785
}
786
786
787
## get notes and subjects from MARC record
788
if (!C4::Context->preference("OPACXSLTDetailsDisplay") ) {
789
    my $marcisbnsarray   = GetMarcISBN    ($record,$marcflavour);
790
    my $marcauthorsarray = GetMarcAuthors ($record,$marcflavour);
791
    my $marcsubjctsarray = GetMarcSubjects($record,$marcflavour);
792
    my $marcseriesarray  = GetMarcSeries  ($record,$marcflavour);
793
    my $marcurlsarray    = GetMarcUrls    ($record,$marcflavour);
794
795
    $template->param(
796
        MARCSUBJCTS => $marcsubjctsarray,
797
        MARCAUTHORS => $marcauthorsarray,
798
        MARCSERIES  => $marcseriesarray,
799
        MARCURLS    => $marcurlsarray,
800
        MARCISBNS   => $marcisbnsarray,
801
    );
802
}
803
804
my $marcnotesarray = $biblio->get_marc_notes({ marcflavour => $marcflavour, opac => 1 });
787
my $marcnotesarray = $biblio->get_marc_notes({ marcflavour => $marcflavour, opac => 1 });
805
788
806
if( C4::Context->preference('ArticleRequests') ) {
789
if( C4::Context->preference('ArticleRequests') ) {
(-)a/opac/opac-shelves.pl (-15 / +13 lines)
Lines 300-308 if ( $op eq 'view' ) { Link Here
300
            }
300
            }
301
301
302
            # Lists display falls back to search results configuration
302
            # Lists display falls back to search results configuration
303
            my $xslfile = C4::Context->preference('OPACXSLTListsDisplay');
303
            my $xslfile = C4::Context->preference('OPACXSLTListsDisplay') || "default";
304
            my $lang   = $xslfile ? C4::Languages::getlanguage()  : undef;
304
            my $lang   = C4::Languages::getlanguage();
305
            my $sysxml = $xslfile ? C4::XSLT::get_xslt_sysprefs() : undef;
305
            my $sysxml = C4::XSLT::get_xslt_sysprefs();
306
306
307
            my $record_processor = Koha::RecordProcessor->new({ filters => 'ViewPolicy' });
307
            my $record_processor = Koha::RecordProcessor->new({ filters => 'ViewPolicy' });
308
308
Lines 366-383 if ( $op eq 'view' ) { Link Here
366
                $this_item->{allow_onshelf_holds} = $allow_onshelf_holds;
366
                $this_item->{allow_onshelf_holds} = $allow_onshelf_holds;
367
                $this_item->{'ITEM_RESULTS'} = $items;
367
                $this_item->{'ITEM_RESULTS'} = $items;
368
368
369
                if ($xslfile) {
369
                my $variables = {
370
                    my $variables = {
370
                    anonymous_session => ($loggedinuser) ? 0 : 1
371
                        anonymous_session => ($loggedinuser) ? 0 : 1
371
                };
372
                    };
372
                $this_item->{XSLTBloc} = XSLTParse4Display(
373
                    $this_item->{XSLTBloc} = XSLTParse4Display(
373
                    $biblionumber,          $record,
374
                        $biblionumber,          $record,
374
                    "OPACXSLTListsDisplay", 1,
375
                        "OPACXSLTListsDisplay", 1,
375
                    undef,                 $sysxml,
376
                        undef,                 $sysxml,
376
                    $xslfile,              $lang,
377
                        $xslfile,              $lang,
377
                    $variables,            $items->reset
378
                        $variables,            $items->reset
378
                );
379
                    );
380
                }
381
379
382
                if ( grep {$_ eq $biblionumber} @cart_list) {
380
                if ( grep {$_ eq $biblionumber} @cart_list) {
383
                    $this_item->{incart} = 1;
381
                    $this_item->{incart} = 1;
(-)a/opac/opac-tags.pl (-16 / +14 lines)
Lines 285-306 if ($loggedinuser) { Link Here
285
        # BZ17530: 'Intelligent' guess if result can be article requested
285
        # BZ17530: 'Intelligent' guess if result can be article requested
286
        $tag->{artreqpossible} = ( $art_req_itypes->{ $tag->{itemtype} // q{} } || $art_req_itypes->{ '*' } ) ? 1 : q{};
286
        $tag->{artreqpossible} = ( $art_req_itypes->{ $tag->{itemtype} // q{} } || $art_req_itypes->{ '*' } ) ? 1 : q{};
287
287
288
        my $xslfile = C4::Context->preference('OPACXSLTResultsDisplay');
288
        my $xslfile = C4::Context->preference('OPACXSLTResultsDisplay') || "default";
289
        my $lang   = $xslfile ? C4::Languages::getlanguage()  : undef;
289
        my $lang   = C4::Languages::getlanguage();
290
        my $sysxml = $xslfile ? C4::XSLT::get_xslt_sysprefs() : undef;
290
        my $sysxml = C4::XSLT::get_xslt_sysprefs();
291
291
292
        if ($xslfile) {
292
        my $variables = {
293
            my $variables = {
293
            anonymous_session => ($loggedinuser) ? 0 : 1
294
                anonymous_session => ($loggedinuser) ? 0 : 1
294
        };
295
            };
295
        $tag->{XSLTBloc} = XSLTParse4Display(
296
            $tag->{XSLTBloc} = XSLTParse4Display(
296
            $tag->{biblionumber},     $record,
297
                $tag->{biblionumber},     $record,
297
            "OPACXSLTResultsDisplay", 1,
298
                "OPACXSLTResultsDisplay", 1,
298
            $hidden_items,            $sysxml,
299
                $hidden_items,            $sysxml,
299
            $xslfile,                 $lang,
300
                $xslfile,                 $lang,
300
            $variables
301
                $variables
301
        );
302
            );
303
        }
304
302
305
        my $date = $tag->{date_created} || '';
303
        my $date = $tag->{date_created} || '';
306
        $date =~ /\s+(\d{2}\:\d{2}\:\d{2})/;
304
        $date =~ /\s+(\d{2}\:\d{2}\:\d{2})/;
(-)a/virtualshelves/shelves.pl (-7 / +4 lines)
Lines 259-266 if ( $op eq 'view' ) { Link Here
259
            );
259
            );
260
260
261
            my $xslfile = C4::Context->preference('XSLTListsDisplay');
261
            my $xslfile = C4::Context->preference('XSLTListsDisplay');
262
            my $lang   = $xslfile ? C4::Languages::getlanguage()  : undef;
262
            my $lang   = C4::Languages::getlanguage();
263
            my $sysxml = $xslfile ? C4::XSLT::get_xslt_sysprefs() : undef;
263
            my $sysxml = C4::XSLT::get_xslt_sysprefs();
264
264
265
            my @items;
265
            my @items;
266
            while ( my $content = $contents->next ) {
266
            while ( my $content = $contents->next ) {
Lines 268-277 if ( $op eq 'view' ) { Link Here
268
                my $biblionumber = $content->biblionumber;
268
                my $biblionumber = $content->biblionumber;
269
                my $record       = GetMarcBiblio({ biblionumber => $biblionumber });
269
                my $record       = GetMarcBiblio({ biblionumber => $biblionumber });
270
270
271
                if ( $xslfile ) {
271
                $this_item->{XSLTBloc} = XSLTParse4Display( $biblionumber, $record, "XSLTListsDisplay",
272
                    $this_item->{XSLTBloc} = XSLTParse4Display( $biblionumber, $record, "XSLTListsDisplay",
272
                                                            1, undef, $sysxml, $xslfile, $lang);
273
                                                                1, undef, $sysxml, $xslfile, $lang);
274
                }
275
273
276
                my $marcflavour = C4::Context->preference("marcflavour");
274
                my $marcflavour = C4::Context->preference("marcflavour");
277
                my $itemtype = Koha::Biblioitems->search({ biblionumber => $content->biblionumber })->next->itemtype;
275
                my $itemtype = Koha::Biblioitems->search({ biblionumber => $content->biblionumber })->next->itemtype;
278
- 

Return to bug 12561