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

(-)a/Koha/Template/Plugin/Filter.pm (+32 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 under the
6
# terms of the GNU General Public License as published by the Free Software
7
# Foundation; either version 3 of the License, or (at your option) any later
8
# version.
9
#
10
# Koha is distributed in the hope that it will be useful, but WITHOUT ANY
11
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
12
# A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
13
#
14
# You should have received a copy of the GNU General Public License along
15
# with Koha; if not, write to the Free Software Foundation, Inc.,
16
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
17
18
use Modern::Perl;
19
20
use Template::Plugin::Filter;
21
use base qw( Template::Plugin::Filter );
22
23
our $DYNAMIC = 1;
24
25
sub no_double_encode {
26
    my ( $self, $value ) = @_;
27
28
    $value =~ s/%25([0-9a-f]{2})/%$1/gi;
29
    return $value;
30
}
31
32
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 519-530 Note that permanent location is a code, and location may be an authval. Link Here
519
                    [% IF ( itemdata_uri ) %]
520
                    [% IF ( itemdata_uri ) %]
520
                        [% IF item.uri.split(' \| ').size > 1 %]
521
                        [% IF item.uri.split(' \| ').size > 1 %]
521
                            <td class="uri">
522
                            <td class="uri">
522
                                [% FOREACH uri IN item.uri.split(' \| ') %]<a href="[% uri | url %]">[% uri | html %]</a><br>[% END %]
523
                                [% FOREACH uri IN item.uri.split(' \| ') ~%]
524
                                    [%~ uri_url_filtered = BLOCK %][% uri | url ~%][% END %]
525
                                    <a href="[% Filter.no_double_encode( uri_url_filtered ) | $raw %]">[% uri | html %]</a><br>
526
                                [%~ END %]
523
                            </td>
527
                            </td>
524
                        [% ELSE %]
528
                        [% ELSE %]
525
                            <td class="uri">
529
                            <td class="uri">
526
                                [% IF item.uri %]
530
                                [% IF item.uri %]
527
                                    <a href="[% item.uri | url %]">[% IF Koha.Preference('URLLinkText') %][% Koha.Preference('URLLinkText') | html %][% ELSE %]Link to resource[% END %]</a>
531
                                    [%~ uri_url_filtered = BLOCK %][% item.uri | url ~%][% END %]
532
                                    <a href="[% Filter.no_double_encode( uri_url_filtered ) | $raw %]">[% IF Koha.Preference('URLLinkText') %][% Koha.Preference('URLLinkText') | html %][% ELSE %]Link to resource[% END %]</a>
528
                                [% END %]
533
                                [% END %]
529
                            </td>
534
                            </td>
530
                        [% END %]
535
                        [% 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