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 517-528 Note that permanent location is a code, and location may be an authval. Link Here
517
                    [% IF ( itemdata_uri ) %]
518
                    [% IF ( itemdata_uri ) %]
518
                        [% IF item.uri.split(' \| ').size > 1 %]
519
                        [% IF item.uri.split(' \| ').size > 1 %]
519
                            <td class="uri">
520
                            <td class="uri">
520
                                [% FOREACH uri IN item.uri.split(' \| ') %]<a href="[% uri | url %]">[% uri | html %]</a><br>[% END %]
521
                                [% FOREACH uri IN item.uri.split(' \| ') ~%]
522
                                    [%~ uri_url_filtered = BLOCK %][% uri | url ~%][% END %]
523
                                    <a href="[% Filter.no_double_encode( uri_url_filtered ) | $raw %]">[% uri | html %]</a><br>
524
                                [%~ END %]
521
                            </td>
525
                            </td>
522
                        [% ELSE %]
526
                        [% ELSE %]
523
                            <td class="uri">
527
                            <td class="uri">
524
                                [% IF item.uri %]
528
                                [% IF item.uri %]
525
                                    <a href="[% item.uri | url %]">[% IF Koha.Preference('URLLinkText') %][% Koha.Preference('URLLinkText') | html %][% ELSE %]Link to resource[% END %]</a>
529
                                    [%~ uri_url_filtered = BLOCK %][% item.uri | url ~%][% END %]
530
                                    <a href="[% Filter.no_double_encode( uri_url_filtered ) | $raw %]">[% IF Koha.Preference('URLLinkText') %][% Koha.Preference('URLLinkText') | html %][% ELSE %]Link to resource[% END %]</a>
526
                                [% END %]
531
                                [% END %]
527
                            </td>
532
                            </td>
528
                        [% END %]
533
                        [% 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 1239-1252 Link Here
1239
                                [% IF trackclicks == 'track' || trackclicks == 'anonymous' %]
1240
                                [% IF trackclicks == 'track' || trackclicks == 'anonymous' %]
1240
                                    <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>
1241
                                    <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>
1241
                                [% ELSE %]
1242
                                [% ELSE %]
1242
                                    <a target="[% target_attr | html %]" rel="[% rel_attr | html %]" href="[% uri | url %]" property="url">[% uri | html %]</a>
1243
                                    [% uri_url_filtered = BLOCK %][% uri | url %][% END %]
1244
                                    <a target="[% target_attr | html %]" rel="[% rel_attr | html %]" href="[% Filter.no_double_encode( uri_url_filtered ) | $raw %]" property="url">[% uri | html %]</a>
1243
                                [% END %]
1245
                                [% END %]
1244
                            [% END %]
1246
                            [% END %]
1245
                        [% ELSE %]
1247
                        [% ELSE %]
1246
                            [% IF trackclicks == 'track' || trackclicks == 'anonymous' %]
1248
                            [% IF trackclicks == 'track' || trackclicks == 'anonymous' %]
1247
                                <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">
1249
                                <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">
1248
                            [% ELSE %]
1250
                            [% ELSE %]
1249
                                <a target="[% target_attr | html %]" rel="[% rel_attr | html %]" href="[% ITEM_RESULT.uri | url %]" property="url">
1251
                                [% uri_url_filtered = BLOCK %][% ITEM_RESULT.uri | url %][% END %]
1252
                                <a target="[% target_attr | html %]" rel="[% rel_attr | html %]" href="[% Filter.no_double_encode( uri_url_filtered ) | $raw %]" property="url">
1250
                            [% END %]
1253
                            [% END %]
1251
                                [% IF Koha.Preference('URLLinkText') %][% Koha.Preference('URLLinkText') | html %][% ELSE %]Link to resource[% END %]
1254
                                [% IF Koha.Preference('URLLinkText') %][% Koha.Preference('URLLinkText') | html %][% ELSE %]Link to resource[% END %]
1252
                            </a>
1255
                            </a>
1253
- 

Return to bug 22223