From 533c9bc657812a18c9479d01419418d7c38ec889 Mon Sep 17 00:00:00 2001 From: Owen Leonard Date: Mon, 26 Nov 2012 09:24:28 -0500 Subject: [PATCH] Bug 9140 - Untranslatable strings in item circulation history This patch removes the text of a message from the script to the template. The lastmove sub now returns either the date or 0, and the template displays the "no transfers" message if the date doesn't exist. To test, view the circulation history for items which do and do not have a transfer history. A date should be displayed for items which have a transfer history. A messages should be displayed for those which do not. This patch also adds a around the text "Never" which was not getting picked up by the translation script. To test this change, run "perl translate update " from misc/translator, then check if the string shows up in the po file. (Thanks kf!) Signed-off-by: Kyle M Hall Signed-off-by: Jared Camins-Esakov --- circ/bookcount.pl | 6 +++--- koha-tmpl/intranet-tmpl/prog/en/modules/circ/bookcount.tt | 5 +++-- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/circ/bookcount.pl b/circ/bookcount.pl index 228772efe8..8405ff2735 100755 --- a/circ/bookcount.pl +++ b/circ/bookcount.pl @@ -89,7 +89,7 @@ $template->param( biblioitemnumber => $bi, homebranch => $homebranch, holdingbranch => $holdingbranch, - lastdate => $lastdate ? format_date($lastdate) : $message, + lastdate => $lastdate ? format_date($lastdate) : 0, count => $count, branchloop => $branchloop, ); @@ -112,13 +112,13 @@ sub lastmove { ); $sth->execute($itemnumber); my ($date) = $sth->fetchrow_array; - return ( 0, "Item has no branch transfers record" ) if not $date; + return ( 0, 1 ) if not $date; $sth = $dbh->prepare( "SELECT * FROM branchtransfers WHERE branchtransfers.itemnumber=? and branchtransfers.datearrived=?" ); $sth->execute( $itemnumber, $date ); my ($data) = $sth->fetchrow_hashref; - return ( 0, "Item has no branch transfers record" ) if not $data; + return ( 0, 1 ) if not $data; return ( $data, "" ); } diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/bookcount.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/bookcount.tt index b53cffbefd..cabb45c648 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/bookcount.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/bookcount.tt @@ -28,7 +28,7 @@ $(document).ready(function(){ [% homebranch %] [% holdingbranch %] - [% lastdate %] + [% IF ( lastdate ) %][% lastdate %][% ELSE %]Item has no transfer record[% END %] [% count %] @@ -50,7 +50,8 @@ $(document).ready(function(){ [% branchloo.seen %][% branchloo.seentime %] [% branchloo.seen %] [% branchloo.seentime %] - [% ELSE %]Never + [% ELSE %] + Never [% END %] -- 2.39.5