Bug 14920 - Remove C4::Dates from circ/reserveratios.pl
Summary: Remove C4::Dates from circ/reserveratios.pl
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Architecture, internals, and plumbing (show other bugs)
Version: master
Hardware: All All
: P5 - low enhancement (vote)
Assignee: Marc Véron
QA Contact: Testopia
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 14870
  Show dependency treegraph
 
Reported: 2015-09-29 12:21 UTC by Marc Véron
Modified: 2016-06-21 21:40 UTC (History)
2 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Small patch
Bot Control: ---
When did the bot last check this:
Who signed the patch off:
Text to go in the release notes:


Attachments
Bug 14920 - Remove C4::Dates from circ/reserveratios.pl (3.72 KB, patch)
2015-09-29 12:29 UTC, Marc Véron
Details | Diff | Splinter Review
Bug 14920 - Remove C4::Dates from circ/reserveratios.pl (3.72 KB, patch)
2015-09-29 12:36 UTC, Marc Véron
Details | Diff | Splinter Review
Bug 14920 - Remove C4::Dates from circ/reserveratios.pl (3.73 KB, patch)
2015-09-29 12:41 UTC, Marc Véron
Details | Diff | Splinter Review
Bug 14920 - Remove C4::Dates from circ/reserveratios.pl (5.96 KB, patch)
2015-10-12 21:22 UTC, Marc Véron
Details | Diff | Splinter Review
Bug 14956 - (follow) Prevent patrons to insert invalid dates in opac-memberentry.tt (2.15 KB, patch)
2015-10-12 21:34 UTC, Marc Véron
Details | Diff | Splinter Review
[SIGNED-OFF] Bug 14920 - Remove C4::Dates from circ/reserveratios.pl (6.10 KB, patch)
2015-10-12 21:36 UTC, Héctor Eduardo Castro Avalos
Details | Diff | Splinter Review
Bug 14920 - Remove C4::Dates from circ/reserveratios.pl (6.15 KB, patch)
2015-10-13 10:48 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 14920: Simplify the date management on reserveratios (2.83 KB, patch)
2015-10-13 10:48 UTC, Jonathan Druart
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Marc Véron 2015-09-29 12:21:50 UTC
This patch removes C4::Dates from circ/reserveratios.pl
Comment 1 Marc Véron 2015-09-29 12:29:46 UTC Comment hidden (obsolete)
Comment 2 Marc Véron 2015-09-29 12:36:20 UTC Comment hidden (obsolete)
Comment 3 Marc Véron 2015-09-29 12:41:05 UTC Comment hidden (obsolete)
Comment 4 Héctor Eduardo Castro Avalos 2015-10-12 16:20:43 UTC
Hi Marc

Datepicker fails in refine results.

This is the error launched:

The 'day' parameter ("32") to DateTime::new did not pass the 'an integer which is a possible valid day of month' callback
 at /usr/lib/perl5/DateTime.pm line 199
	DateTime::new(undef, 'hour', 0, 'minute', 0, 'second', 0, 'month', 10, ...) called at /home/koha/kohaclone/Koha/DateUtils.pm line 164
	Koha::DateUtils::dt_from_string('2014-10-32') called at /home/koha/kohaclone/circ/reserveratios.pl line 87
Comment 5 Marc Véron 2015-10-12 21:21:49 UTC
Hi Héctor, thank you for testing!

I refactured the date handling. 
Patch follows. Can you please test again?
Comment 6 Marc Véron 2015-10-12 21:22:28 UTC Comment hidden (obsolete)
Comment 7 Marc Véron 2015-10-12 21:34:21 UTC Comment hidden (obsolete)
Comment 8 Héctor Eduardo Castro Avalos 2015-10-12 21:36:29 UTC Comment hidden (obsolete)
Comment 9 Marc Véron 2015-10-12 21:36:35 UTC
Comment on attachment 43360 [details] [review]
Bug 14956 - (follow) Prevent patrons to insert invalid dates in opac-memberentry.tt

Wrong bug number. Sorry for the noise.
Comment 10 Jonathan Druart 2015-10-13 10:48:51 UTC
Created attachment 43376 [details] [review]
Bug 14920 - Remove C4::Dates from circ/reserveratios.pl

This patch removes C4::Dates from circ/reserveratios.pl

To test:
- Make sure you have many holds for biblios with not so much items (e.g. 5 holds, 1 item)
  or follow hint below
- Go to Home > Circulation > Hold ratios
- Verify that everything works the same without an dwith patch

Hint: To get a big table you can set 'Hod ratio' in the filter to 0.1  (default value is 3).
This was will trigger biblios with less holds than items.

Signed-off-by: Hector Castro <hector.hecaxmmx@gmail.com>
Works as advertised. Tested with dateformat syspref, datepiker Ok

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Comment 11 Jonathan Druart 2015-10-13 10:48:54 UTC
Created attachment 43377 [details] [review]
Bug 14920: Simplify the date management on reserveratios

Note that the previous patch was wrong, the start date defaulted to yesterday,
the original behavior is to default to last year.

This patch removes some unecessary variable declarations and tests.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Comment 12 Tomás Cohen Arazi 2015-10-13 15:16:57 UTC
Patches pushed to master.

Thanks Marc!