From 7673eb3ebfdd702250e9842e585c4f61c2100f58 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20V=C3=A9ron?= Date: Tue, 15 Dec 2015 00:11:01 +0100 Subject: [PATCH] Bug 15374 - Translatability: Fix issues on OPAC summary page Fix several issues on opac-user.tt with sentences splitted by tags, leading to odd translations. Additionally, fix a broken link that should point to opac-account.pl To test: - Apply patch - Log in to OPAC - with blocked /debarred user (with and without comment and date) - with user who has to much fines - with user who has his card marked as lost - with user with an account that is about to expire - with user with expired account - with user with uncertain address information - with user who has got a circulation message (from checkout page) - with user who has a OPAC note - Verify that information is correct and displays nicely and that links in messages work - Carefully examine code - Search for regressions (Amended to add price formatting in fines tab label) Can see the warning message now :) signing off Signed-off-by: Aleisha (Amended to make patches apply, see comment #12) Signed-off-by: Aleisha (Amended to make it apply and to fix BORROWER.INF -> BORROWER->INFO. Needs new sign-off. / MV) --- .../opac-tmpl/bootstrap/en/modules/opac-user.tt | 32 ++++++++++++-------- opac/opac-user.pl | 8 ++--- 2 files changed, 24 insertions(+), 16 deletions(-) diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-user.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-user.tt index 28b237e..bf08e9b 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-user.tt +++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-user.tt @@ -1,5 +1,6 @@ [% USE Koha %] [% USE KohaDates %] +[% USE Price %] [% INCLUDE 'doc-head-open.inc' %] [% IF ( LibraryNameTitle ) %][% LibraryNameTitle %][% ELSE %]Koha online[% END %] catalog › Your library home @@ -31,8 +32,8 @@
    [% FOREACH bor_messages_loo IN bor_messages_loop %]
  • - [% bor_messages_loo.message.raw %]
    -    Written on [% bor_messages_loo.message_date | $KohaDates %] by [% bor_messages_loo.branchname %] + [% bor_messages_loo.message %]
    + [% bor_messages_loo.message_date | $KohaDates %] [% bor_messages_loo.branchname %]
  • [% END %] @@ -89,16 +90,23 @@
      [% IF ( userdebarred ) %] -
    • Please note: Your account has been frozen[% IF ( BORROWER_INFO.userdebarreddate ) %] until [% BORROWER_INFO.userdebarreddate | $KohaDates %][% END %][% IF ( BORROWER_INFO.debarredcomment ) %] with the comment "[% BORROWER_INFO.debarredcomment.raw %]"[% END %]. Usually the reason for freezing an account is old overdues or damage fees. If your account page shows your account to be clear, please contact the library.
    • +
    • Please note: Your account has been frozen. + [% IF ( BORROWER_INFO.debarredcomment ) %] Comment: "[% BORROWER_INFO.debarredcomment %]"[% END %] + [% IF ( BORROWER_INFO.userdebarreddate ) %] End date: [% BORROWER_INFO.userdebarreddate | $KohaDates %][% END %] + Usually the reason for freezing an account is old overdues or damage fees. If shows your account to be clear, please contact the library. Go to your account page
    • [% END %] [% IF ( BORROWER_INFO.gonenoaddress ) %] -
    • Please note: According to our records, we don't have up-to-date [% UNLESS OPACPatronDetails %]contact information[% ELSE %]contact information[% END %] on file. Please contact the library[% IF OPACPatronDetails %] or use the online update form to submit current information (Please note: there may be a delay in restoring your account if you submit online)[% END %].
    • +
    • Please note: According to our records, we don't have up-to-date contact information. Please contact the library. + [% IF ( Koha.Preference('OPACPatronDetails') ) %]Update your contact information[% ELSE %]Go to your contact information[% END %] + [% IF ( Koha.Preference('OPACPatronDetails') ) %](Please note: there may be a delay in restoring your account if you submit online.)[% END %] +
    • [% END %] [% IF ( BORROWER_INFO.lost ) %] -
    • Please note: Your library card has been marked as lost or stolen. If this is an error, please contact the library.
    • +
    • Please note: Your library card has been marked as lost or stolen. If this is an error, please contact the library.
    • [% END %] - [% IF ( renewal_blocked_fines ) && ( OpacRenewalAllowed ) %] -
    • Please note: Since you have [% IF renewal_blocked_fines != "0.00" %] more than [% renewal_blocked_fines %] in [% END %] fines, you cannot renew your books online. Please pay your fines if you wish to renew your books.
    • + [% IF ( renewal_blocked_fines.defined ) && ( OpacRenewalAllowed ) %] +
    • Please note: You cannot renew your books online. Reason: [% IF ( renewal_blocked_fines ) > 0 %]Your fines exceed [% renewal_blocked_fines | $Price %].[% ELSE %]You have fines.[% END %] + Please pay your fines if you wish to renew your books. Go to your account page
    • [% END %]
    @@ -112,9 +120,9 @@ [% IF relatives %]
  • Relatives' checkouts
  • [% END %] [% IF ( overdues_count ) %]
  • Overdue ([% overdues_count %])
  • [% END %] [% IF ( OPACFinesTab ) %] - [% IF ( BORROWER_INFO.amountoverfive ) %]
  • Fines ([% BORROWER_INFO.amountoutstanding %])
  • [% END %] - [% IF ( BORROWER_INFO.amountoverzero ) %]
  • Fines ([% BORROWER_INFO.amountoutstanding %])
  • [% END %] - [% IF ( BORROWER_INFO.amountlessthanzero ) %]
  • Credits ([% BORROWER_INFO.amountoutstanding %])
  • [% END %] + [% IF ( BORROWER_INFO.amountoverfive ) %]
  • Fines ([% BORROWER_INFO.amountoutstanding | $Price %])
  • [% END %] + [% IF ( BORROWER_INFO.amountoverzero ) %]
  • Fines ([% BORROWER_INFO.amountoutstanding | $Price %])
  • [% END %] + [% IF ( BORROWER_INFO.amountlessthanzero ) %]
  • Credits ([% BORROWER_INFO.amountoutstanding | $Price %])
  • [% END %] [% END %] [% IF ( RESERVES.count ) %]
  • Holds ([% RESERVES.count %])
  • [% END %]
@@ -297,7 +305,7 @@ You currently owe fines and charges amounting to: - [% BORROWER_INFO.amountoutstanding %] + [% BORROWER_INFO.amountoutstanding | $Price %] @@ -324,7 +332,7 @@ Amount - You have a credit of:[% BORROWER_INFO.amountoutstanding %] + You have a credit of:[% BORROWER_INFO.amountoutstanding | $Price %] diff --git a/opac/opac-user.pl b/opac/opac-user.pl index 8349b6f..22ab092 100755 --- a/opac/opac-user.pl +++ b/opac/opac-user.pl @@ -117,9 +117,8 @@ if ( C4::Context->preference('OpacRenewalAllowed') $borr->{'flagged'} = 1; $canrenew = 0; $template->param( - renewal_blocked_fines => sprintf( '%.02f', $no_renewal_amt ), - renewal_blocked_fines_amountoutstanding => - sprintf( '%.02f', $borr->{amountoutstanding} ), + renewal_blocked_fines => $no_renewal_amt, + renewal_blocked_fines_amountoutstanding => $borr->{amountoutstanding}, ); } @@ -128,7 +127,8 @@ if ( $borr->{'amountoutstanding'} < 0 ) { $borr->{'amountoutstanding'} = -1 * ( $borr->{'amountoutstanding'} ); } -$borr->{'amountoutstanding'} = sprintf "%.02f", $borr->{'amountoutstanding'}; +my @bordat; +$bordat[0] = $borr; # Warningdate is the date that the warning starts appearing if ( $borr->{'dateexpiry'} && C4::Context->preference('NotifyBorrowerDeparture') ) { -- 1.7.10.4