From 614d668f2d63a37736c5c2a016d2951727fc52b8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20V=C3=A9ron?= Date: Sun, 27 Sep 2015 08:34:02 +0200 Subject: [PATCH] Bug 14903 - Remove C4::Dates from circ/circulation.pl Patch to remove deprectated C4::Dates from circ/circulation.pl To test: - Apply patch - Go to the checkout site (Home > Circulation > Checkouts) - Verify that data displays properly (including for users with a card that expires in the near future, see syspref 'NotifyBorrowerDeparture') - Verify that due date works as before (with syspref 'SpecifyDueDate' on and off (Amended following comment #3) --- circ/circulation.pl | 17 +++++------------ .../intranet-tmpl/prog/en/modules/circ/circulation.tt | 8 ++++---- 2 files changed, 9 insertions(+), 16 deletions(-) diff --git a/circ/circulation.pl b/circ/circulation.pl index 8b2d8d8..07f87cb 100755 --- a/circ/circulation.pl +++ b/circ/circulation.pl @@ -30,7 +30,6 @@ use DateTime::Duration; use C4::Output; use C4::Print; use C4::Auth qw/:DEFAULT get_session haspermission/; -use C4::Dates qw/format_date/; use C4::Branch; # GetBranches use C4::Koha; # GetPrinter use C4::Circulation; @@ -167,12 +166,7 @@ if( $onsite_checkout && !$duedatespec_allow ) { $datedue .= ' 23:59:00'; } elsif( $duedatespec_allow ) { if ($duedatespec) { - if ($duedatespec =~ C4::Dates->regexp('syspref')) { - $datedue = dt_from_string($duedatespec); - } else { - $invalidduedate = 1; - $template->param(IMPOSSIBLE=>1, INVALID_DATE=>$duedatespec); - } + output_pref({ dt => dt_from_string( $duedatespec ), dateformat => 'iso', dateonly => 1 }); } } @@ -259,7 +253,7 @@ if ($borrowernumber) { noissues => ($force_allow_issue) ? 0 : "1", forceallow => $force_allow_issue, expired => "1", - renewaldate => format_date("$renew_year-$renew_month-$renew_day") + renewaldate => "$renew_year-$renew_month-$renew_day" ); } # check for NotifyBorrowerDeparture @@ -268,7 +262,7 @@ if ($borrowernumber) { Date_to_Days( $today_year, $today_month, $today_day ) ) { # borrower card soon to expire warn librarian - $template->param("warndeparture" => format_date($borrower->{dateexpiry}), + $template->param("warndeparture" => $borrower->{dateexpiry}, flagged => "1",); if (C4::Context->preference('ReturnBeforeExpiry')){ $template->param("returnbeforeexpiry" => 1); @@ -287,8 +281,7 @@ if ($borrowernumber) { ); if ( $borrower->{debarred} ne "9999-12-31" ) { - $template->param( 'userdebarreddate' => - C4::Dates::format_date( $borrower->{debarred} ) ); + $template->param( 'userdebarreddate' => $borrower->{debarred} ); } } @@ -531,7 +524,7 @@ $template->param( printer => $printer, printername => $printer, was_renewed => $query->param('was_renewed') ? 1 : 0, - expiry => format_date($borrower->{'dateexpiry'}), + expiry => $borrower->{'dateexpiry'}, roadtype => $roadtype, amountold => $amountold, barcode => $barcode, diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt index 064e308..4851ed6 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt @@ -190,7 +190,7 @@ $(document).ready(function() { -[% IF ( was_renewed ) %]
Patron's account has been renewed until [% expiry %]
[% END %] +[% IF ( was_renewed ) %]
Patron's account has been renewed until [% expiry | $KohaDates %]
[% END %] [% IF additional_materials %]
Note about the accompanying materials:
@@ -720,7 +720,7 @@ No patron matched [% message %] [% IF ( warndeparture ) %]
  • Expiration: Patron's card will expire soon. - Patron's card expires on [% expiry %] Renew or Edit Details + Patron's card expires on [% expiry | $KohaDates %] Renew or Edit Details
  • [% END %] @@ -733,7 +733,7 @@ No patron matched [% message %] [% IF ( expired ) %]
  • Expiration: Patron's card has expired. - [% IF ( expiry ) %]Patron's card expired on [% expiry %][% END %] Renew or Edit Details + [% IF ( expiry ) %]Patron's card expired on [% expiry | $KohaDates %][% END %] Renew or Edit Details
  • [% END %] @@ -751,7 +751,7 @@ No patron matched [% message %] Restricted: Patron's account is restricted [% IF ( userdebarreddate ) %] - until [% userdebarreddate %] + until [% userdebarreddate | $KohaDates %] [% END %] [% IF ( debarredcomment ) %] -- 1.7.10.4