From 80e02f01f54c8fb84e624a49e64ed3cc9a798fc0 Mon Sep 17 00:00:00 2001 From: Julian Maurice Date: Mon, 19 Mar 2012 14:28:03 +0100 Subject: [PATCH] Bug 7743: Update opac-user.pl to use KohaDates TT plugin Signed-off-by: Marijana Glavica fixed conflict --- .../opac-tmpl/prog/en/modules/opac-user.tt | 22 ++++++++++--------- opac/opac-user.pl | 14 +++--------- 2 files changed, 15 insertions(+), 21 deletions(-) diff --git a/koha-tmpl/opac-tmpl/prog/en/modules/opac-user.tt b/koha-tmpl/opac-tmpl/prog/en/modules/opac-user.tt index 8fc13d9726..79556e25a0 100644 --- a/koha-tmpl/opac-tmpl/prog/en/modules/opac-user.tt +++ b/koha-tmpl/opac-tmpl/prog/en/modules/opac-user.tt @@ -1,3 +1,5 @@ +[% USE KohaDates %] + [% INCLUDE 'doc-head-open.inc' %] [% IF ( LibraryNameTitle ) %][% LibraryNameTitle %][% ELSE %]Koha Online[% END %] Catalog › Your library home [% INCLUDE 'doc-head-close.inc' %] @@ -62,7 +64,7 @@ $.tablesorter.addParser({ [% FOREACH bor_messages_loo IN bor_messages_loop %]
  • [% bor_messages_loo.message %]
    -    Written on [% bor_messages_loo.message_date_formatted %] by [% bor_messages_loo.branchname %] +    Written on [% bor_messages_loo.message_date | $KohaDates %] by [% bor_messages_loo.branchname %]
  • [% END %] @@ -89,7 +91,7 @@ $.tablesorter.addParser({
      [% IF ( userdebarred ) %] -
    • Please note: Your account has been frozen[% IF ( BORROWER_INF.userdebarreddate ) %] until [% BORROWER_INF.userdebarreddate %][% END %][% IF ( BORROWER_INF.debarredcomment ) %] with the comment "[% BORROWER_INF.debarredcomment %]"[% 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_INF.userdebarreddate ) %] until [% BORROWER_INF.userdebarreddate | $KohaDates %][% END %][% IF ( BORROWER_INF.debarredcomment ) %] with the comment "[% BORROWER_INF.debarredcomment %]"[% 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.
    • [% END %] [% IF ( BORROWER_INF.gonenoaddress ) %]
    • Please note: According to our records, we don't have up-to-date [% UNLESS ( BORROWER_INF.OPACPatronDetails ) %]contact information[% ELSE %]contact information[% END %] on file. Please contact the library[% IF ( BORROWER_INF.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 %].
    • @@ -169,7 +171,7 @@ $.tablesorter.addParser({ [% WAITIN.author %] - [% WAITIN.reservedate %] + [% WAITIN.reservedate | $KohaDates %] [% IF ( WAITIN.atdestination ) %]Waiting at [% WAITIN.branch %] [% ELSE %] In transit from [% WAITIN.holdingbranch %] to [% WAITIN.branch %] @@ -234,9 +236,9 @@ $.tablesorter.addParser({ [% ISSUE.author %] [% IF ( ISSUE.overdue ) %] - [% ISSUE.date_due %] + [% ISSUE.date_due | $KohaDates %] [% ELSE %] - [% ISSUE.date_due %] + [% ISSUE.date_due | $KohaDates %] [% END %] [% UNLESS ( item_level_itypes ) %][% IF ( ISSUE.imageurl ) %][% ISSUE.description %][% END %] [% ISSUE.description %][% END %] [% IF ( show_barcode ) %][% ISSUE.barcode %][% END %] @@ -320,7 +322,7 @@ $.tablesorter.addParser({ [% UNLESS ( item_level_itypes ) %][% IF ( OVERDUE.imageurl ) %][% OVERDUE.description %][% END %] [% OVERDUE.description %][% END %] [% IF ( show_barcode ) %][% OVERDUE.barcode %][% END %] [% OVERDUE.itemcallnumber %] -[% OVERDUE.date_due %] +[% OVERDUE.date_due | $KohaDates %] [% IF ( OpacRenewalAllowed ) %] [% IF ( OVERDUE.debarred ) %]Account Frozen @@ -373,8 +375,8 @@ $.tablesorter.addParser({ [% RESERVE.reserves_title %] [% RESERVE.author %] - [% RESERVE.reservedate %] - [% IF ( RESERVE.expirationdate ) %][% RESERVE.expirationdate %][% ELSE %]Never Expires[% END %] + [% RESERVE.reservedate | $KohaDates %] + [% IF ( RESERVE.expirationdate ) %][% RESERVE.expirationdate | $KohaDates %][% ELSE %]Never Expires[% END %] [% RESERVE.branch %] [% IF ( showpriority ) %] [% RESERVE.priority %] @@ -383,7 +385,7 @@ $.tablesorter.addParser({ [% IF ( RESERVE.wait ) %] [% IF ( RESERVE.atdestination ) %] [% IF ( RESERVE.found ) %] - Item waiting at [% RESERVE.wbrname %][% IF ( RESERVE.formattedwaitingdate ) %] since [% RESERVE.formattedwaitingdate %][% END %] + Item waiting at [% RESERVE.wbrname %][% IF ( RESERVE.formattedwaitingdate ) %] since [% RESERVE.waitingdate | $KohaDates %][% END %] [% ELSE %] Item waiting to be pulled from [% RESERVE.wbrname %] @@ -394,7 +396,7 @@ $.tablesorter.addParser({ [% ELSE %] [% IF ( RESERVE.intransit ) %] Item in transit from [% RESERVE.frombranch %] since - [% RESERVE.datesent %] + [% RESERVE.datesent | $KohaDates %] [% ELSE %] Pending [% END %] diff --git a/opac/opac-user.pl b/opac/opac-user.pl index 655f812828..78b155c638 100755 --- a/opac/opac-user.pl +++ b/opac/opac-user.pl @@ -33,7 +33,6 @@ use C4::Output; use C4::Overdues qw/CheckBorrowerDebarred/; use C4::Biblio; use C4::Items; -use C4::Dates qw/format_date/; use C4::Letters; use C4::Branch; # GetBranches use Koha::DateUtils; @@ -76,9 +75,6 @@ my ( $borr ) = GetMemberDetails( $borrowernumber ); my ( $today_year, $today_month, $today_day) = Today(); my ($warning_year, $warning_month, $warning_day) = split /-/, $borr->{'dateexpiry'}; -for (qw(dateenrolled dateexpiry dateofbirth)) { - ($borr->{$_}) and $borr->{$_} = format_date($borr->{$_}); -} $borr->{'ethnicity'} = fixEthnicity( $borr->{'ethnicity'} ); my $debar = CheckBorrowerDebarred($borrowernumber); @@ -88,7 +84,7 @@ if ($debar) { $userdebarred = 1; $template->param( 'userdebarred' => $userdebarred ); if ( $debar ne "9999-12-31" ) { - $borr->{'userdebarreddate'} = C4::Dates::format_date($debar); + $borr->{'userdebarreddate'} = $debar; } } @@ -254,18 +250,14 @@ $template->param( branchloop => \@branch_loop ); # now the reserved items.... my @reserves = GetReservesFromBorrowernumber( $borrowernumber ); foreach my $res (@reserves) { - $res->{'reservedate'} = format_date( $res->{'reservedate'} ); - if ( $res->{'expirationdate'} ne '0000-00-00' ) { - $res->{'expirationdate'} = format_date( $res->{'expirationdate'} ) - } else { + if ( $res->{'expirationdate'} eq '0000-00-00' ) { $res->{'expirationdate'} = ''; } my $publictype = $res->{'publictype'}; $res->{$publictype} = 1; $res->{'waiting'} = 1 if $res->{'found'} eq 'W'; - $res->{'formattedwaitingdate'} = format_date($res->{'waitingdate'}); $res->{'branch'} = $branches->{ $res->{'branchcode'} }->{'branchname'}; my $biblioData = GetBiblioData($res->{'biblionumber'}); $res->{'reserves_title'} = $biblioData->{'title'}; @@ -311,7 +303,7 @@ foreach my $res (@reserves) { my ($transfertwhen, $transfertfrom, $transfertto) = GetTransfers( $res->{'itemnumber'} ); if ($transfertwhen) { $res->{intransit} = 1; - $res->{datesent} = format_date($transfertwhen); + $res->{datesent} = $transfertwhen; $res->{frombranch} = GetBranchName($transfertfrom); } } -- 2.39.5