[Koha-patches] [PATCH] Bug 14194: Restore the HH:MM to 23:59 for onsite-checkouts
Indranil Das Gupta
idgbpo at gmail.com
Wed May 13 17:53:00 CEST 2015
From: Jonathan Druart <jonathan.druart at koha-community.org>
(Introduced by bug 13601)
Test plan
=========
1/ enable 'OnSiteCheckouts' pref under Circulation Preferences
2/ go to the checkouts page and try to issue an item to any user.
3/ when the item barcode entry form shows, select the 'On-site
checkout' checkbox
4/ the default date due should show as today with 00:00 as HH:MM
5/ apply the patch
6/ repeat steps 2 - 3. The default date due should show today's
date with 23:59 as HH:MM.
7/ run koha-qa.pl -c 1 -v 2
Remarks: Testing result match expected test plan output. The QA tests
pass with "OK" for the commit.
Technical note: There is a confusion with iso and sql date formats at
some places in the code.
A better way should be provided (later) to fix globally the mismatch
between these 2 formats.
What happened before this patch: the DateTime was cast to a string and
the template received "YYYY-MM-DDTHH:MM:SS" which is an iso formatted
date. BUT this format is not managed by Koha::DateUtils::output_pref
("iso" and "sql" are considered as indentical which is wrong).
As I did not estimated the problem (how big it is) I prefer to fix it
easily (and dirty) for now.
Signed-off-by: Indranil Das Gupta (L2C2 Technologies) <indradg at gmail.com>
---
circ/circulation.pl | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/circ/circulation.pl b/circ/circulation.pl
index ab47895..ab6db3b 100755
--- a/circ/circulation.pl
+++ b/circ/circulation.pl
@@ -587,7 +587,7 @@ $template->param(
AllowRenewalLimitOverride => C4::Context->preference("AllowRenewalLimitOverride"),
canned_bor_notes_loop => $canned_notes,
debarments => GetDebarments({ borrowernumber => $borrowernumber }),
- todaysdate => dt_from_string()->set(hour => 23)->set(minute => 59),
+ todaysdate => output_pref( { dt => dt_from_string()->set(hour => 23)->set(minute => 59), dateformat => 'sql' } ),
);
output_html_with_http_headers $query, $cookie, $template->output;
--
1.9.1
More information about the Koha-patches
mailing list