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

(-)a/Koha/Template/Plugin/Filter.pm (+31 lines)
Line 0 Link Here
1
package Koha::Template::Plugin::Filter;
2
3
# This file is part of Koha.
4
#
5
# Koha is free software; you can redistribute it and/or modify it
6
# under the terms of the GNU General Public License as published by
7
# the Free Software Foundation; either version 3 of the License, or
8
# (at your option) any later version.
9
#
10
# Koha is distributed in the hope that it will be useful, but
11
# WITHOUT ANY WARRANTY; without even the implied warranty of
12
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
# GNU General Public License for more details.
14
#
15
# You should have received a copy of the GNU General Public License
16
# along with Koha; if not, see <http://www.gnu.org/licenses>.
17
18
use Modern::Perl;
19
20
use base qw( Template::Plugin::Filter );
21
22
our $DYNAMIC = 1;
23
24
sub no_double_encode {
25
    my ( $self, $value ) = @_;
26
27
    $value =~ s/%25([0-9a-f]{2})/%$1/gi;
28
    return $value;
29
}
30
31
1;
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt (-2 / +7 lines)
Lines 2-7 Link Here
2
[% USE Asset %]
2
[% USE Asset %]
3
[% USE Koha %]
3
[% USE Koha %]
4
[% USE KohaDates %]
4
[% USE KohaDates %]
5
[% USE Filter %]
5
[% USE KohaPlugins %]
6
[% USE KohaPlugins %]
6
[% USE AuthorisedValues %]
7
[% USE AuthorisedValues %]
7
[% USE Branches %]
8
[% USE Branches %]
Lines 537-548 Note that permanent location is a code, and location may be an authval. Link Here
537
                    [% IF ( itemdata_uri ) %]
538
                    [% IF ( itemdata_uri ) %]
538
                        [% IF item.uri.split(' \| ').size > 1 %]
539
                        [% IF item.uri.split(' \| ').size > 1 %]
539
                            <td class="uri">
540
                            <td class="uri">
540
                                [% FOREACH uri IN item.uri.split(' \| ') %]<a href="[% uri | url %]">[% uri | html %]</a><br>[% END %]
541
                                [% FOREACH uri IN item.uri.split(' \| ') ~%]
542
                                    [%~ uri_url_filtered = BLOCK %][% uri | url ~%][% END %]
543
                                    <a href="[% Filter.no_double_encode( uri_url_filtered ) | $raw %]">[% uri | html %]</a><br>
544
                                [%~ END %]
541
                            </td>
545
                            </td>
542
                        [% ELSE %]
546
                        [% ELSE %]
543
                            <td class="uri">
547
                            <td class="uri">
544
                                [% IF item.uri %]
548
                                [% IF item.uri %]
545
                                    <a href="[% item.uri | url %]">[% IF Koha.Preference('URLLinkText') %][% Koha.Preference('URLLinkText') | html %][% ELSE %]Link to resource[% END %]</a>
549
                                    [%~ uri_url_filtered = BLOCK %][% item.uri | url ~%][% END %]
550
                                    <a href="[% Filter.no_double_encode( uri_url_filtered ) | $raw %]">[% IF Koha.Preference('URLLinkText') %][% Koha.Preference('URLLinkText') | html %][% ELSE %]Link to resource[% END %]</a>
546
                                [% END %]
551
                                [% END %]
547
                            </td>
552
                            </td>
548
                        [% END %]
553
                        [% END %]
(-)a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt (-3 / +5 lines)
Lines 3-8 Link Here
3
[% USE Math %]
3
[% USE Math %]
4
[% USE Koha %]
4
[% USE Koha %]
5
[% USE KohaDates %]
5
[% USE KohaDates %]
6
[% USE Filter %]
6
[% USE Branches %]
7
[% USE Branches %]
7
[% USE TablesSettings %]
8
[% USE TablesSettings %]
8
[% USE AuthorisedValues %]
9
[% USE AuthorisedValues %]
Lines 1298-1311 Link Here
1298
                                [% IF trackclicks == 'track' || trackclicks == 'anonymous' %]
1299
                                [% IF trackclicks == 'track' || trackclicks == 'anonymous' %]
1299
                                    <a target="[% target_attr | html %]" rel="[% rel_attr | html %]" href="/cgi-bin/koha/tracklinks.pl?uri=[% uri | uri %]&amp;biblionumber=[% biblio.biblionumber | html %]&amp;itemnumber=[% ITEM_RESULT.itemnumber | html %]" property="url">[% uri | html %]</a>
1300
                                    <a target="[% target_attr | html %]" rel="[% rel_attr | html %]" href="/cgi-bin/koha/tracklinks.pl?uri=[% uri | uri %]&amp;biblionumber=[% biblio.biblionumber | html %]&amp;itemnumber=[% ITEM_RESULT.itemnumber | html %]" property="url">[% uri | html %]</a>
1300
                                [% ELSE %]
1301
                                [% ELSE %]
1301
                                    <a target="[% target_attr | html %]" rel="[% rel_attr | html %]" href="[% uri | url %]" property="url">[% uri | html %]</a>
1302
                                    [% uri_url_filtered = BLOCK %][% uri | url %][% END %]
1303
                                    <a target="[% target_attr | html %]" rel="[% rel_attr | html %]" href="[% Filter.no_double_encode( uri_url_filtered ) | $raw %]" property="url">[% uri | html %]</a>
1302
                                [% END %]
1304
                                [% END %]
1303
                            [% END %]
1305
                            [% END %]
1304
                        [% ELSE %]
1306
                        [% ELSE %]
1305
                            [% IF trackclicks == 'track' || trackclicks == 'anonymous' %]
1307
                            [% IF trackclicks == 'track' || trackclicks == 'anonymous' %]
1306
                                <a target="[% target_attr | html %]" rel="[% rel_attr | html %]" href="/cgi-bin/koha/tracklinks.pl?uri=[% ITEM_RESULT.uri | uri %]&amp;biblionumber=[% biblio.biblionumber | html %]&amp;itemnumber=[% ITEM_RESULT.itemnumber | html %]" property="url">
1308
                                <a target="[% target_attr | html %]" rel="[% rel_attr | html %]" href="/cgi-bin/koha/tracklinks.pl?uri=[% ITEM_RESULT.uri | uri %]&amp;biblionumber=[% biblio.biblionumber | html %]&amp;itemnumber=[% ITEM_RESULT.itemnumber | html %]" property="url">
1307
                            [% ELSE %]
1309
                            [% ELSE %]
1308
                                <a target="[% target_attr | html %]" rel="[% rel_attr | html %]" href="[% ITEM_RESULT.uri | url %]" property="url">
1310
                                [% uri_url_filtered = BLOCK %][% ITEM_RESULT.uri | url %][% END %]
1311
                                <a target="[% target_attr | html %]" rel="[% rel_attr | html %]" href="[% Filter.no_double_encode( uri_url_filtered ) | $raw %]" property="url">
1309
                            [% END %]
1312
                            [% END %]
1310
                                [% IF Koha.Preference('URLLinkText') %][% Koha.Preference('URLLinkText') | html %][% ELSE %]Link to resource[% END %]
1313
                                [% IF Koha.Preference('URLLinkText') %][% Koha.Preference('URLLinkText') | html %][% ELSE %]Link to resource[% END %]
1311
                            </a>
1314
                            </a>
1312
- 

Return to bug 22223