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

(-)a/Koha/Template/Plugin/Expand.pm (+58 lines)
Line 0 Link Here
1
package Koha::Template::Plugin::Expand;
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 Koha::I18N;
21
22
use base qw( Template::Plugin::Filter );
23
24
our $DYNAMIC = 1;
25
26
=head1 SYNOPSIS
27
28
    [% USE Expand %]
29
    [% PROCESS 'i18n.inc' %]
30
31
    [% t('Hello {name}') | html | $Expand name = "<strong>World !</strong>" %]
32
33
=head1 DESCRIPTION
34
35
This module is a Template::Toolkit filter that allows to replace portions of
36
text enclosed in braces by the content of a variable
37
38
Its main purpose is to be used with i18n macros : it allows translations to be
39
filtered (with the html filter for instance) while allowing variables to have
40
content that should not be filtered
41
42
=cut
43
44
=head1 METHODS
45
46
=head2 filter
47
48
See L<Template::Plugin::Filter>
49
50
=cut
51
52
sub filter {
53
    my ( $self, $text, $args, $conf ) = @_;
54
55
    return Koha::I18N::_expand($text, %$conf);
56
}
57
58
1;
(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/i18n.inc (-9 / +9 lines)
Lines 2-38 Link Here
2
[% USE raw %]
2
[% USE raw %]
3
3
4
[% MACRO t(msgid) BLOCK %]
4
[% MACRO t(msgid) BLOCK %]
5
    [% I18N.t(msgid) | $raw %]
5
    [%~ I18N.t(msgid) | $raw ~%]
6
[% END %]
6
[% END %]
7
7
8
[% MACRO tx(msgid, vars) BLOCK %]
8
[% MACRO tx(msgid, vars) BLOCK %]
9
    [% I18N.tx(msgid, vars) | $raw %]
9
    [%~ I18N.tx(msgid, vars) | $raw ~%]
10
[% END %]
10
[% END %]
11
11
12
[% MACRO tn(msgid, msgid_plural, count) BLOCK %]
12
[% MACRO tn(msgid, msgid_plural, count) BLOCK %]
13
    [% I18N.tn(msgid, msgid_plural, count) | $raw %]
13
    [%~ I18N.tn(msgid, msgid_plural, count) | $raw ~%]
14
[% END %]
14
[% END %]
15
15
16
[% MACRO tnx(msgid, msgid_plural, count, vars) BLOCK %]
16
[% MACRO tnx(msgid, msgid_plural, count, vars) BLOCK %]
17
    [% I18N.tnx(msgid, msgid_plural, count, vars) | $raw %]
17
    [%~ I18N.tnx(msgid, msgid_plural, count, vars) | $raw ~%]
18
[% END %]
18
[% END %]
19
19
20
[% MACRO txn(msgid, msgid_plural, count, vars) BLOCK %]
20
[% MACRO txn(msgid, msgid_plural, count, vars) BLOCK %]
21
    [% I18N.txn(msgid, msgid_plural, count, vars) | $raw %]
21
    [%~ I18N.txn(msgid, msgid_plural, count, vars) | $raw ~%]
22
[% END %]
22
[% END %]
23
23
24
[% MACRO tp(msgctxt, msgid) BLOCK %]
24
[% MACRO tp(msgctxt, msgid) BLOCK %]
25
    [% I18N.tp(msgctxt, msgid) | $raw %]
25
    [%~ I18N.tp(msgctxt, msgid) | $raw ~%]
26
[% END %]
26
[% END %]
27
27
28
[% MACRO tpx(msgctxt, msgid, vars) BLOCK %]
28
[% MACRO tpx(msgctxt, msgid, vars) BLOCK %]
29
    [% I18N.tpx(msgctxt, msgid, vars) | $raw %]
29
    [%~ I18N.tpx(msgctxt, msgid, vars) | $raw ~%]
30
[% END %]
30
[% END %]
31
31
32
[% MACRO tnp(msgctxt, msgid, msgid_plural, count) BLOCK %]
32
[% MACRO tnp(msgctxt, msgid, msgid_plural, count) BLOCK %]
33
    [% I18N.tnp(msgctxt, msgid, msgid_plural, count) | $raw %]
33
    [%~ I18N.tnp(msgctxt, msgid, msgid_plural, count) | $raw ~%]
34
[% END %]
34
[% END %]
35
35
36
[% MACRO tnpx(msgctxt, msgid, msgid_plural, count, vars) BLOCK %]
36
[% MACRO tnpx(msgctxt, msgid, msgid_plural, count, vars) BLOCK %]
37
    [% I18N.tnpx(msgctxt, msgid, msgid_plural, count, vars) | $raw %]
37
    [%~ I18N.tnpx(msgctxt, msgid, msgid_plural, count, vars) | $raw ~%]
38
[% END %]
38
[% END %]
(-)a/koha-tmpl/opac-tmpl/bootstrap/en/includes/i18n.inc (-9 / +9 lines)
Lines 2-38 Link Here
2
[% USE raw %]
2
[% USE raw %]
3
3
4
[% MACRO t(msgid) BLOCK %]
4
[% MACRO t(msgid) BLOCK %]
5
    [% I18N.t(msgid) | $raw %]
5
    [%~ I18N.t(msgid) | $raw ~%]
6
[% END %]
6
[% END %]
7
7
8
[% MACRO tx(msgid, vars) BLOCK %]
8
[% MACRO tx(msgid, vars) BLOCK %]
9
    [% I18N.tx(msgid, vars) | $raw %]
9
    [%~ I18N.tx(msgid, vars) | $raw ~%]
10
[% END %]
10
[% END %]
11
11
12
[% MACRO tn(msgid, msgid_plural, count) BLOCK %]
12
[% MACRO tn(msgid, msgid_plural, count) BLOCK %]
13
    [% I18N.tn(msgid, msgid_plural, count) | $raw %]
13
    [%~ I18N.tn(msgid, msgid_plural, count) | $raw ~%]
14
[% END %]
14
[% END %]
15
15
16
[% MACRO tnx(msgid, msgid_plural, count, vars) BLOCK %]
16
[% MACRO tnx(msgid, msgid_plural, count, vars) BLOCK %]
17
    [% I18N.tnx(msgid, msgid_plural, count, vars) | $raw %]
17
    [%~ I18N.tnx(msgid, msgid_plural, count, vars) | $raw ~%]
18
[% END %]
18
[% END %]
19
19
20
[% MACRO txn(msgid, msgid_plural, count, vars) BLOCK %]
20
[% MACRO txn(msgid, msgid_plural, count, vars) BLOCK %]
21
    [% I18N.txn(msgid, msgid_plural, count, vars) | $raw %]
21
    [%~ I18N.txn(msgid, msgid_plural, count, vars) | $raw ~%]
22
[% END %]
22
[% END %]
23
23
24
[% MACRO tp(msgctxt, msgid) BLOCK %]
24
[% MACRO tp(msgctxt, msgid) BLOCK %]
25
    [% I18N.tp(msgctxt, msgid) | $raw %]
25
    [%~ I18N.tp(msgctxt, msgid) | $raw ~%]
26
[% END %]
26
[% END %]
27
27
28
[% MACRO tpx(msgctxt, msgid, vars) BLOCK %]
28
[% MACRO tpx(msgctxt, msgid, vars) BLOCK %]
29
    [% I18N.tpx(msgctxt, msgid, vars) | $raw %]
29
    [%~ I18N.tpx(msgctxt, msgid, vars) | $raw ~%]
30
[% END %]
30
[% END %]
31
31
32
[% MACRO tnp(msgctxt, msgid, msgid_plural, count) BLOCK %]
32
[% MACRO tnp(msgctxt, msgid, msgid_plural, count) BLOCK %]
33
    [% I18N.tnp(msgctxt, msgid, msgid_plural, count) | $raw %]
33
    [%~ I18N.tnp(msgctxt, msgid, msgid_plural, count) | $raw ~%]
34
[% END %]
34
[% END %]
35
35
36
[% MACRO tnpx(msgctxt, msgid, msgid_plural, count, vars) BLOCK %]
36
[% MACRO tnpx(msgctxt, msgid, msgid_plural, count, vars) BLOCK %]
37
    [% I18N.tnpx(msgctxt, msgid, msgid_plural, count, vars) | $raw %]
37
    [%~ I18N.tnpx(msgctxt, msgid, msgid_plural, count, vars) | $raw ~%]
38
[% END %]
38
[% END %]
(-)a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-main.tt (-29 / +46 lines)
Lines 1-3 Link Here
1
[% PROCESS 'i18n.inc' %]
1
[% USE raw %]
2
[% USE raw %]
2
[% USE Koha %]
3
[% USE Koha %]
3
[% USE KohaDates %]
4
[% USE KohaDates %]
Lines 5-15 Link Here
5
[% USE Categories %]
6
[% USE Categories %]
6
[% USE Price %]
7
[% USE Price %]
7
[% USE KohaNews %]
8
[% USE KohaNews %]
9
[% USE Expand %]
8
[% SET OpacNavRight = KohaNews.get( location => "OpacNavRight", lang => lang, library => branchcode ) %]
10
[% SET OpacNavRight = KohaNews.get( location => "OpacNavRight", lang => lang, library => branchcode ) %]
9
[% SET OpacMainUserBlock = KohaNews.get( location => "OpacMainUserBlock", lang => lang, library => branchcode ) %]
11
[% SET OpacMainUserBlock = KohaNews.get( location => "OpacMainUserBlock", lang => lang, library => branchcode ) %]
10
[% SET OpacLoginInstructions = KohaNews.get( location => "OpacLoginInstructions", lang => lang, library => branchcode ) %]
12
[% SET OpacLoginInstructions = KohaNews.get( location => "OpacLoginInstructions", lang => lang, library => branchcode ) %]
11
[% INCLUDE 'doc-head-open.inc' %]
13
[% INCLUDE 'doc-head-open.inc' %]
12
<title>[% IF ( LibraryNameTitle ) %][% LibraryNameTitle | html %][% ELSE %]Koha online[% END %] catalog</title>
14
<title>[% IF ( LibraryNameTitle ) %][% tx('{LibraryNameTitle} catalog', LibraryNameTitle = LibraryNameTitle) | html %][% ELSE %][% t('Koha online catalog') | html %][% END %]</title>
13
[% INCLUDE 'doc-head-close.inc' %]
15
[% INCLUDE 'doc-head-close.inc' %]
14
[% BLOCK cssinclude %][% END %]
16
[% BLOCK cssinclude %][% END %]
15
</head>
17
</head>
Lines 21-34 Link Here
21
        <ul class="breadcrumb">
23
        <ul class="breadcrumb">
22
            [% IF news_item %]
24
            [% IF news_item %]
23
                <li class="breadcrumb-item">
25
                <li class="breadcrumb-item">
24
                    <a href="/cgi-bin/koha/opac-main.pl">Home</a>
26
                    <a href="/cgi-bin/koha/opac-main.pl">[% t('Home') | html %]</a>
25
                </li>
27
                </li>
26
                <li class="breadcrumb-item active" aria-current="page">
28
                <li class="breadcrumb-item active" aria-current="page">
27
                    [% news_item.title | html %]
29
                    [% news_item.title | html %]
28
                </li>
30
                </li>
29
            [% ELSE %]
31
            [% ELSE %]
30
                <li class="breadcrumb-item active" aria-current="page">
32
                <li class="breadcrumb-item active" aria-current="page">
31
                    <a href="/cgi-bin/koha/opac-main.pl">Home</a>
33
                    <a href="/cgi-bin/koha/opac-main.pl">[% t('Home') | html %]</a>
32
                </li>
34
                </li>
33
            [% END %]
35
            [% END %]
34
        </ul>
36
        </ul>
Lines 68-79 Link Here
68
        [% IF Koha.Preference( 'OpacNewsLibrarySelect' ) %]
70
        [% IF Koha.Preference( 'OpacNewsLibrarySelect' ) %]
69
            [% UNLESS news_item %]
71
            [% UNLESS news_item %]
70
                <form id="news-branch-select" class="form-inline" name="news-branch-select" method="get" action="/cgi-bin/koha/opac-main.pl">
72
                <form id="news-branch-select" class="form-inline" name="news-branch-select" method="get" action="/cgi-bin/koha/opac-main.pl">
71
                    <label for="news-branch">Display news for: </label>
73
                    <label for="news-branch">[% t('Display news for:') | html %] </label>
72
                    <select id="news-branch" name="branch">
74
                    <select id="news-branch" name="branch">
73
                        [% IF ( branchcode == "" ) %]
75
                        [% IF ( branchcode == "" ) %]
74
                            <option value="" selected="selected">System-wide only</option>
76
                            <option value="" selected="selected">[% t('System-wide only') | html %]</option>
75
                        [% ELSE %]
77
                        [% ELSE %]
76
                            <option value="">System-wide only</option>
78
                            <option value="">[% t('System-wide only') | html %]</option>
77
                        [% END %]
79
                        [% END %]
78
                        [% PROCESS options_for_libraries libraries => Branches.all( selected => branchcode, unfiltered => 1, ) %]
80
                        [% PROCESS options_for_libraries libraries => Branches.all( selected => branchcode, unfiltered => 1, ) %]
79
                    </select>
81
                    </select>
Lines 86-92 Link Here
86
            [% IF single_news_error %]
88
            [% IF single_news_error %]
87
89
88
                <div class="alert alert-error">
90
                <div class="alert alert-error">
89
                    This news item does not exist.
91
                    [% t('This news item does not exist.') | html %]
90
                </div>
92
                </div>
91
93
92
            [% ELSE %]
94
            [% ELSE %]
Lines 104-115 Link Here
104
                            </h4>
106
                            </h4>
105
                            <div class="newsbody">[% koha_new.content | $raw %]</div>
107
                            <div class="newsbody">[% koha_new.content | $raw %]</div>
106
                            <div class="newsfooter">
108
                            <div class="newsfooter">
107
                                Published on [% koha_new.published_on | $KohaDates %]
109
                                [% published_on = BLOCK %][% koha_new.published_on | $KohaDates %][% END %]
108
                                [% IF ( (newsdisp == 'opac' || newsdisp == 'both') && koha_new.borrowernumber ) %]
110
                                [% author = BLOCK %]
109
                                    by <span class="newsauthor_title">[% koha_new.author_title | html %] </span>[% koha_new.author_firstname | html %] [% koha_new.author_surname | html %]
111
                                    [% IF ( (newsdisp == 'opac' || newsdisp == 'both') && koha_new.borrowernumber ) %]
112
                                        <span class="newsauthor_title">[% koha_new.author_title | html %] </span>[% koha_new.author_firstname | html %] [% koha_new.author_surname | html %]
113
                                    [% END %]
114
                                [% END %]
115
                                [% IF author %]
116
                                    [% t('Published on {published_on} by {author}') | html | $Expand published_on = published_on, author = author %]
117
                                [% ELSE %]
118
                                    [% t('Published on {published_on}') | html | $Expand published_on = published_on %]
110
                                [% END %]
119
                                [% END %]
111
                                [% IF ( news_item ) %]
120
                                [% IF ( news_item ) %]
112
                                    &bull; <a href="/cgi-bin/koha/opac-main.pl">Show all news</a>
121
                                    &bull; <a href="/cgi-bin/koha/opac-main.pl">[% t('Show all news') | html %]</a>
113
                                [% END %]
122
                                [% END %]
114
                            </div>
123
                            </div>
115
                        </div>
124
                        </div>
Lines 122-136 Link Here
122
                                <i class="fa fa-rss" aria-hidden="true"></i>
131
                                <i class="fa fa-rss" aria-hidden="true"></i>
123
                                [% IF Branches.all.size == 1 %]
132
                                [% IF Branches.all.size == 1 %]
124
                                    [% IF branchcode %]
133
                                    [% IF branchcode %]
125
                                        RSS feed for [% Branches.GetName( branchcode ) | html %] library news
134
                                        [% libraryName = BLOCK %][% Branches.GetName(branchcode) | html %][% END %]
135
                                        [% t('RSS feed for {libraryName} library news') | html | $Expand libraryName = libraryName %]
126
                                    [% ELSE %]
136
                                    [% ELSE %]
127
                                        RSS feed for library news
137
                                        [% t('RSS feed for library news') | html %]
128
                                    [% END %]
138
                                    [% END %]
129
                                [% ELSE %]
139
                                [% ELSE %]
130
                                    [% IF branchcode %]
140
                                    [% IF branchcode %]
131
                                        RSS feed for [% Branches.GetName( branchcode ) | html %] and system-wide library news
141
                                        [% libraryName = BLOCK %][% Branches.GetName(branchcode) | html %][% END %]
142
                                        [% t('RSS feed for {libraryName} and system-wide library news') | html | $Expand libraryName = libraryName %]
132
                                    [% ELSE %]
143
                                    [% ELSE %]
133
                                        RSS feed for system-wide library news
144
                                        [% t('RSS feed for system-wide library news') | html %]
134
                                    [% END %]
145
                                    [% END %]
135
                                [% END %]
146
                                [% END %]
136
                            </a>
147
                            </a>
Lines 144-150 Link Here
144
            [% IF Koha.Preference( 'OpacNewsLibrarySelect' ) %]
155
            [% IF Koha.Preference( 'OpacNewsLibrarySelect' ) %]
145
                <div id="news" class="newscontainer">
156
                <div id="news" class="newscontainer">
146
                    <div class="newsitem">
157
                    <div class="newsitem">
147
                        <div class="newsbody">No news to display.</div>
158
                        <div class="newsbody">[% t('No news to display.') | html %]</div>
148
                        <div class="newsfooter"></div>
159
                        <div class="newsfooter"></div>
149
                    </div>
160
                    </div>
150
                </div>
161
                </div>
Lines 155-161 Link Here
155
        [% UNLESS news_item # Don't show under single news item %]
166
        [% UNLESS news_item # Don't show under single news item %]
156
            [% IF ( daily_quote ) %]
167
            [% IF ( daily_quote ) %]
157
                <div id="daily-quote">
168
                <div id="daily-quote">
158
                    <h3>Quote of the day</h3>
169
                    <h3>[% t('Quote of the day') | html %]</h3>
159
                    <div>
170
                    <div>
160
                        <span id="daily-quote-text">[% daily_quote.text | html %]</span><span id="daily-quote-sep"> ~ </span><span id="daily-quote-source">[% daily_quote.source | html %]</span>
171
                        <span id="daily-quote-text">[% daily_quote.text | html %]</span><span id="daily-quote-sep"> ~ </span><span id="daily-quote-source">[% daily_quote.source | html %]</span>
161
                    </div>
172
                    </div>
Lines 180-192 Link Here
180
                                <form action="/cgi-bin/koha/opac-user.pl" method="post" name="auth" id="auth" autocomplete="off">
191
                                <form action="/cgi-bin/koha/opac-user.pl" method="post" name="auth" id="auth" autocomplete="off">
181
                                    <input type="hidden" name="koha_login_context" value="opac" />
192
                                    <input type="hidden" name="koha_login_context" value="opac" />
182
                                    <fieldset class="brief">
193
                                    <fieldset class="brief">
183
                                        <legend>Log in to your account:</legend>
194
                                        <legend>[% t('Log in to your account:') | html %]</legend>
184
                                        <label for="userid">Login:</label>
195
                                        <label for="userid">[% t('Login:') | html %]</label>
185
                                        <input class="form-control" type="text" id="userid" name="userid" />
196
                                        <input class="form-control" type="text" id="userid" name="userid" />
186
                                        <label for="password">Password:</label>
197
                                        <label for="password">[% t('Password:') | html %]</label>
187
                                        <input class="form-control" type="password" id="password" name="password" />
198
                                        <input class="form-control" type="password" id="password" name="password" />
188
                                        <fieldset class="action">
199
                                        <fieldset class="action">
189
                                            <input type="submit" value="Log in" class="btn btn-primary" />
200
                                            <input type="submit" value="[% t('Log in') | html %]" class="btn btn-primary" />
190
                                        </fieldset>
201
                                        </fieldset>
191
                                        [% IF ( OpacLoginInstructions ) %]
202
                                        [% IF ( OpacLoginInstructions ) %]
192
                                            <div id="nologininstructions-main" class="nologininstructions">
203
                                            <div id="nologininstructions-main" class="nologininstructions">
Lines 195-206 Link Here
195
                                        [% END %]
206
                                        [% END %]
196
                                        [% IF Koha.Preference('OpacPasswordChange') && Categories.can_any_reset_password %]
207
                                        [% IF Koha.Preference('OpacPasswordChange') && Categories.can_any_reset_password %]
197
                                            <div id="forgotpassword-main" class="forgotpassword">
208
                                            <div id="forgotpassword-main" class="forgotpassword">
198
                                                <p><a href="/cgi-bin/koha/opac-password-recovery.pl">Forgot your password?</a></p>
209
                                                <p><a href="/cgi-bin/koha/opac-password-recovery.pl">[% t('Forgot your password?') | html %]</a></p>
199
                                            </div>
210
                                            </div>
200
                                        [% END %]
211
                                        [% END %]
201
                                        [% IF PatronSelfRegistration && PatronSelfRegistrationDefaultCategory %]
212
                                        [% IF PatronSelfRegistration && PatronSelfRegistrationDefaultCategory %]
202
                                            <div id="patronregistration-main" class="patronregistration">
213
                                            <div id="patronregistration-main" class="patronregistration">
203
                                                <p>Don't have an account? <a href="/cgi-bin/koha/opac-memberentry.pl">Register here.</a></p>
214
                                                <p>[% t('Don\'t have an account?') | html %] <a href="/cgi-bin/koha/opac-memberentry.pl">[% t('Register here.') | html %]</a></p>
204
                                            </div>
215
                                            </div>
205
                                        [% END %]
216
                                        [% END %]
206
                                    </fieldset>
217
                                    </fieldset>
Lines 210-231 Link Here
210
                    [% ELSE %]
221
                    [% ELSE %]
211
                        [% IF Koha.Preference('OPACUserSummary') && dashboard_info %]
222
                        [% IF Koha.Preference('OPACUserSummary') && dashboard_info %]
212
                            <div id="user_summary">
223
                            <div id="user_summary">
213
                                <h3>Welcome, <a href="/cgi-bin/koha/opac-user.pl"><span class="loggedinusername">[% INCLUDE 'patron-title.inc' patron = logged_in_user %]</span></a></h3>
224
                                [% user = BLOCK %]<a href="/cgi-bin/koha/opac-user.pl"><span class="loggedinusername">[% INCLUDE 'patron-title.inc' patron = logged_in_user %]</span></a>[% END %]
225
                                <h3>[% t('Welcome, {user}') | html | $Expand user = user %]</h3>
214
                                <ul id="user_summary_shortcuts">
226
                                <ul id="user_summary_shortcuts">
215
                                    [% IF checkouts && checkouts > 0 %]
227
                                    [% IF checkouts && checkouts > 0 %]
216
                                        <li><a href="/cgi-bin/koha/opac-user.pl#opac-user-checkouts"><span class="user_checkouts_count count_label">[% checkouts | html %]</span> checkout(s)</a></li>
228
                                        [% count = BLOCK %]<span class="user_checkouts_count count_label">[% checkouts | html %]</span>[% END %]
229
                                        <li><a href="/cgi-bin/koha/opac-user.pl#opac-user-checkouts">[% tn('{count} checkout', '{count} checkouts', checkouts) | html | $Expand count = count %]</a></li>
217
                                    [% END %]
230
                                    [% END %]
218
                                    [% IF overdues && overdues > 0 %]
231
                                    [% IF overdues && overdues > 0 %]
219
                                        <li><a href="/cgi-bin/koha/opac-user.pl#opac-user-overdues"><span class="user_overdues_count count_label">[% overdues | html %]</span> overdue(s)</a></li>
232
                                        [% count = BLOCK %]<span class="user_overdues_count count_label">[% overdues | html %]</span>[% END %]
233
                                        <li><a href="/cgi-bin/koha/opac-user.pl#opac-user-overdues">[% tn('{count} overdue', '{count} overdues', overdues) | html | $Expand count = count %]</a></li>
220
                                    [% END %]
234
                                    [% END %]
221
                                    [% IF holds_pending && holds_pending > 0 %]
235
                                    [% IF holds_pending && holds_pending > 0 %]
222
                                        <li><a href="/cgi-bin/koha/opac-user.pl#opac-user-holds"><span class="user_holds_pending_count count_label">[% holds_pending | html %]</span> hold(s) pending</a></li>
236
                                        [% count = BLOCK %]<span class="user_holds_pending_count count_label">[% holds_pending | html %]</span>[% END %]
237
                                        <li><a href="/cgi-bin/koha/opac-user.pl#opac-user-holds">[% tn('{count} hold pending', '{count} holds pending', holds_pending) | html | $Expand count = count %]</a></li>
223
                                    [% END %]
238
                                    [% END %]
224
                                    [% IF holds_waiting && holds_waiting > 0 %]
239
                                    [% IF holds_waiting && holds_waiting > 0 %]
225
                                        <li><a href="/cgi-bin/koha/opac-user.pl#opac-user-holds"><span class="user_holds_waiting_count count_label">[% holds_waiting | html %]</span> hold(s) waiting</a></li>
240
                                        [% count = BLOCK %]<span class="user_holds_waiting_count count_label">[% holds_waiting | html %]</span>[% END %]
241
                                        <li><a href="/cgi-bin/koha/opac-user.pl#opac-user-holds">[% tn('{count} hold waiting', '{count} holds waiting', holds_waiting) | html | $Expand count = count %]</a></li>
226
                                    [% END %]
242
                                    [% END %]
227
                                    [% IF total_owing && total_owing > 0 %]
243
                                    [% IF total_owing && total_owing > 0 %]
228
                                        <li><a href="/cgi-bin/koha/opac-account.pl"><span class="user_fines_count count_label">[% total_owing | $Price with_symbol => 1 %]</span> due in fines and charges</a></li>
244
                                        [% amount = BLOCK %]<span class="user_fines_count count_label">[% total_owing | $Price with_symbol => 1 %]</span>[% END %]
245
                                        <li><a href="/cgi-bin/koha/opac-account.pl">[% t('{amount} due in fines and charges') | html | $Expand amount = amount %]</a></li>
229
                                    [% END %]
246
                                    [% END %]
230
                                </ul>
247
                                </ul>
231
                            </div>
248
                            </div>
(-)a/t/Koha/Template/Plugin/Expand.t (-1 / +11 lines)
Line 0 Link Here
0
- 
1
#!/usr/bin/env perl
2
3
use Modern::Perl;
4
5
use Test::More tests => 1;
6
use Koha::Template::Plugin::Expand;
7
8
my $filter = Koha::Template::Plugin::Expand->new();
9
10
my $filtered = $filter->filter('Hello, {name}', [], { name => 'World!' });
11
is($filtered, 'Hello, World!', '{name} was replaced by World!');

Return to bug 26392