Summary: | There is no default value for the late orders | ||
---|---|---|---|
Product: | Koha | Reporter: | Jonathan Druart <jonathan.druart> |
Component: | Acquisitions | Assignee: | Jonathan Druart <jonathan.druart> |
Status: | CLOSED FIXED | QA Contact: | |
Severity: | enhancement | ||
Priority: | P5 - low | CC: | colin.campbell, mathilde.formery, paul.poulain |
Version: | 3.10 | ||
Hardware: | All | ||
OS: | All | ||
GIT URL: | Change sponsored?: | --- | |
Patch complexity: | --- | Documentation contact: | |
Documentation submission: | Text to go in the release notes: | ||
Version(s) released in: | Circulation function: | ||
Attachments: |
BUG 8652: Add a default value for the lateorders
Proposed Amended Patch Bug 8652: Followup: add a default value for date_from Bug 8652: Followup: add a default value for date_from |
Description
Jonathan Druart
2012-08-16 13:13:01 UTC
Created attachment 11640 [details] [review] BUG 8652: Add a default value for the lateorders - By default, the date from value is the today's date - Replace C4::Dates with Koha::DateUtils To test: Check the page displays the late orders by default. Add values for 'date from' and/or 'date to' and/or delay. The date interval is based on the estimated delivery date and the delay param is based on the closed date. The date manipulations is a little bit (very ?) dirty. If someone can do that with another way, he's welcome :) tested in a sandbox When I add a date in the field "Date from", I have an error message: Software error: Can not call method "strftime" without a package or object reference at / home / koha / src / Koha / DateUtils.pm line 119. " The date handling is wrong. dt_from_string returns a DateTime object. there is no need for the xxx_iso variables. if you need the date as a string in iso format you can retrieve that using DateTime's methods Created attachment 12142 [details] [review] Proposed Amended Patch I took the liberty of amending the Koha::DateUtils calls. I'm sure the logic could be further cleaned up. Requires testing Created attachment 12160 [details] [review] Bug 8652: Followup: add a default value for date_from (In reply to comment #5) > I took the liberty of amending the Koha::DateUtils calls. I'm sure the logic > could be further cleaned up. Requires testing Thanks Colin. This followup adds a parameter for the output_pref routine and reintroduces the default value for date_from if no other one is present. Patch tested with a sandbox, by MathildeF <mathilde.formery@ville-nimes.fr> Created attachment 12312 [details] [review] Bug 8652: Followup: add a default value for date_from This patchis add a third parameter to the output_pref routine. It allows to specify the output string with or without the hours and minutes (%H:%M) Signed-off-by: MathildeF <mathilde.formery@ville-nimes.fr> Comment on attachment 12160 [details] [review] Bug 8652: Followup: add a default value for date_from obsoleted by signoff QA comment: * both patches passes koha-qa.pl * 1st patch has a negligible side-effect risk, 2nd patch has a larger one * investigating patch 2 more deeply: - a new possible parameter is added to output_pref signature. Depending on it, the return is as previously, or with more information - for all calls to this sub, there is no change in the returned result - checking t/DateUtils.t = still OK after the test - however, it would be worth to have a test for this new parameter. I've added a small follow-up, that add 3 tests to t/DateUtils.t passed QA Patch pushed to master |