Bug 8330: Overdue email link contains untranslatable 'Overdue:'
authorKatrin Fischer <Katrin.Fischer.83@web.de>
Sun, 7 Jun 2015 22:55:22 +0000 (00:55 +0200)
committerTomas Cohen Arazi <tomascohen@unc.edu.ar>
Mon, 22 Jun 2015 14:50:48 +0000 (11:50 -0300)
The translation scripts don't pick up text from href attributes,
which is what we want, with a small exception for this script.

Patch uses a TT trick to make the Overdue: in the subject
of the mailto: link translatable.

Regression test:
- Make sure you have an overdue item
- Go to Circulation > Overdues
- Verify the [email] link works and a subject
  with 'Overdue: <title>' is generated
- Apply patch and repeat steps

Bonus: Verify the branch name now shows instead of
       the branchcode in the table

To test translatability:
- cd misc/translator
- perl translate update de-DE
- Open file po/de-DE-staff-prog.po
- Search for Overdue:
- Translate string, remove 'fuzzy' marker
- perl translate install de-DE
- Test again, subject should now be translated

Signed-off-by: Nick Clemens <nick@quecheelibrary.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
koha-tmpl/intranet-tmpl/prog/en/modules/circ/overdue.tt

index 553bcf8..c1aa428 100644 (file)
@@ -2,6 +2,7 @@
 <title>Koha &rsaquo; Circulation &rsaquo; Items overdue as of [% todaysdate %]</title>
 [% INCLUDE 'doc-head-close.inc' %]
 [% INCLUDE 'calendar.inc' %]
+[%- USE Branches -%]
 <script type="text/javascript">
  //<![CDATA[
      function clone_parent(node) {
@@ -106,13 +107,15 @@ overdue as of [% todaysdate %][% IF ( isfiltered ) %] <span style="font-size:70%
     <th>Price</th>
 </tr></thead>
 
+[%- BLOCK subject -%]Overdue:[%- END -%]
+
 <tbody>[% FOREACH overdueloo IN overdueloop %]
     <tr>
         <td>[% overdueloo.duedate %]</td>
         <td><a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% overdueloo.borrowernumber %]">[% overdueloo.surname %][% IF (overdueloo.firstname) %], [% overdueloo.firstname %][% END %] ([% overdueloo.cardnumber %])</a>
-        [% IF ( overdueloo.email ) %][<a href="mailto:[% overdueloo.email %]?subject=Overdue: [% overdueloo.title |html %]">email</a>][% END %]
+        [% IF ( overdueloo.email ) %][<a href="mailto:[% overdueloo.email %]?subject=[% INCLUDE subject %] [% overdueloo.title |html %]">email</a>][% END %]
         [% IF ( overdueloo.phone ) %]([% overdueloo.phone %])[% ELSIF ( overdueloo.mobile ) %]([% overdueloo.mobile %])[% ELSIF ( overdueloo.phonepro ) %]([% overdueloo.phonepro %])[% END %]</td>
-        <td>[% overdueloo.branchcode %]</td>
+        <td>[% IF overdueloo.branchcode %][% Branches.GetName( overdueloo.branchcode ) %][% END %]</td>
         <td>[% INCLUDE 'biblio-default-view.inc' biblionumber = overdueloo.biblionumber %][% overdueloo.title |html %]  [% overdueloo.subtitle %]</a> [% IF ( overdueloo.author ) %], by [% overdueloo.author %][% END %][% IF ( overdueloo.enumchron ) %], [% overdueloo.enumchron %][% END %]
         </td>
                <td><a href="/cgi-bin/koha/catalogue/moredetail.pl?biblionumber=[% overdueloo.biblionumber %]&amp;itemnumber=[% overdueloo.itemnum %]#item[% overdueloo.itemnum %]">[% overdueloo.barcode %]</a></td>