Bug 8845

Summary: Add ability search patrons by date of birth
Product: Koha Reporter: Kyle M Hall (khall) <kyle>
Component: PatronsAssignee: Kyle M Hall (khall) <kyle>
Status: CLOSED FIXED QA Contact: Jonathan Druart <jonathan.druart>
Severity: enhancement    
Priority: P5 - low CC: gmcharlt, jonathan.druart, kyle.m.hall, veron
Version: Main   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: Small patch
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
Circulation function:
Bug Depends on:    
Bug Blocks: 10835    
Attachments: Bug 8845 - Add ability search patrons by date of birth
Bug 8845 - Add ability search patrons by date of birth
Bug 8845 - Add ability search patrons by date of birth - Add tooltip
Bug 8845: Followup Allow to give a date using the syspref format
Bug 8845: Followup Allow to give a date using the syspref format
Bug 8845 - Add ability search patrons by date of birth - Add tooltip
Bug 8845 - Add ability search patrons by date of birth - Add tooltip
Bug 8845 - Add ability search patrons by date of birth - Add tooltip
Bug 8845 - Add ability search patrons by date of birth
Bug 8845: Followup Allow to give a date using the syspref format
Bug 8845 - Add ability search patrons by date of birth - Add tooltip
Bug 8845 - Add ability search patrons by date of birth
Bug 8845: Followup Allow to give a date using the syspref format
Bug 8845 - Add ability search patrons by date of birth - Add tooltip
Bug 8845 - Add ability search patrons by date of birth
Bug 8845: Followup Allow to give a date using the syspref format
Bug 8845 - Add ability search patrons by date of birth - Add tooltip
Bug 8845: FIX dateonly is the 4th parameter, not 3rd!

Description Kyle M Hall (khall) 2012-09-28 17:47:10 UTC
Some librarians would like to be able to search for patrons by date of birth.
Comment 1 Kyle M Hall (khall) 2012-09-28 17:48:27 UTC Comment hidden (obsolete)
Comment 2 Marc Véron 2012-09-29 16:53:51 UTC Comment hidden (obsolete)
Comment 3 Owen Leonard 2012-10-02 12:27:30 UTC
I think it's a problem that this patch doesn't take varying date formats into account. What about searches by DD-MM-YYYY or MM-DD-YYYY? A couple of possibilities for mitigating the problem, if the patch can't be amended to accept multiple formats:

- Offer a hint about the date format required
- Offer a datepicker which will return the correct format

Both could be triggered upon selection of the "date of birth" option.
Comment 4 Marc Véron 2012-10-02 13:33:34 UTC
I think the problem with coding is that e.g. 03-09-2012 would be ambiguous (3. September or 9. March?).

Thats why I propose to give a hint, the best place would be in the selection itself, e.g.
<option value='dateofbirth'>Date of birth (YYYYMMDD)</option>

Marc
Comment 5 Owen Leonard 2012-10-02 13:37:50 UTC
(In reply to comment #4)
> I think the problem with coding is that e.g. 03-09-2012 would be ambiguous
> (3. September or 9. March?).

Unless you used the dateformat system preference as a rule by which you parse the date. Does Koha have existing code for handling varying date inputs?

Otherwise, I agree that putting a hint in the <option> is a good idea.
Comment 6 Kyle M Hall (khall) 2012-10-02 14:01:53 UTC Comment hidden (obsolete)
Comment 7 Jared Camins-Esakov 2012-10-06 04:31:09 UTC
Changing target version so this bug report will show up in the list of
3.12-targeted features and doesn't get lost in the shuffle during feature
freeze.
Comment 8 Jonathan Druart 2012-11-09 13:42:53 UTC
Last patch needs a SO
Comment 9 Jonathan Druart 2012-12-27 13:19:27 UTC Comment hidden (obsolete)
Comment 10 Jonathan Druart 2012-12-27 13:21:34 UTC
Comment on attachment 14293 [details] [review]
Bug 8845: Followup Allow to give a date using the syspref format

Kyle,
This patch allows to enter a date given the syspref format.
I let you decide if it is better or not.
I mark it as obsolete in order to not interfere with your last patch.
Comment 11 Kyle M Hall (khall) 2013-01-02 18:36:06 UTC Comment hidden (obsolete)
Comment 12 Kyle M Hall (khall) 2013-01-02 18:55:06 UTC Comment hidden (obsolete)
Comment 13 Kyle M Hall (khall) 2013-01-02 18:56:39 UTC
I think that is a great followup! I've updated the tooltip patch, if you can SO that patch, we can set the status to signed-off!

(In reply to comment #10)
> Comment on attachment 14293 [details] [review]
> Bug 8845: Followup Allow to give a date using the syspref format
> 
> Kyle,
> This patch allows to enter a date given the syspref format.
> I let you decide if it is better or not.
> I mark it as obsolete in order to not interfere with your last patch.
Comment 14 Jonathan Druart 2013-01-03 10:32:42 UTC
Kyle, your patch does not work: the dateformat variable is not set in the template (the tooltip is 'Dates of birth should be entered in the format ""').
(/!\ Work in progress in Bug 9108)
Comment 15 Kyle M Hall (khall) 2013-01-03 13:31:13 UTC Comment hidden (obsolete)
Comment 16 Kyle M Hall (khall) 2013-01-03 13:32:11 UTC
Sorry about that! Please retest this updated patch!
Comment 17 Jonathan Druart 2013-01-03 13:52:11 UTC Comment hidden (obsolete)
Comment 18 Katrin Fischer 2013-02-17 15:34:59 UTC
Bug 8845: Followup Allow to give a date using the syspref format

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
--------------------------
Apply? [y]es/[n]o/[e]dit/[v]iew patch/[a]ccept all y
Applying: Bug 8845: Followup Allow to give a date using the syspref format
Using index info to reconstruct a base tree...
Falling back to patching base and 3-way merge...
Auto-merging members/member.pl
CONFLICT (content): Merge conflict in members/member.pl
Failed to merge in the changes.
Patch failed at 0001 Bug 8845: Followup Allow to give a date using the syspref format
When you have resolved this problem run "git am --resolved".
If you would prefer to skip this patch, instead run "git am --skip".
To restore the original branch and stop patching run "git am --abort".
Comment 19 Kyle M Hall (khall) 2013-02-19 17:32:04 UTC Comment hidden (obsolete)
Comment 20 Kyle M Hall (khall) 2013-02-19 17:32:12 UTC Comment hidden (obsolete)
Comment 21 Kyle M Hall (khall) 2013-02-19 17:32:19 UTC Comment hidden (obsolete)
Comment 22 Jonathan Druart 2013-05-28 15:33:10 UTC
QA comment:

This patch adds a new entry in the search fields dropdown list: date of birth.
The functionality deals with all date formats and works as expected.

Marked as Passed QA.
Comment 23 Jonathan Druart 2013-05-28 15:33:34 UTC Comment hidden (obsolete)
Comment 24 Jonathan Druart 2013-05-28 15:33:41 UTC Comment hidden (obsolete)
Comment 25 Jonathan Druart 2013-05-28 15:33:51 UTC Comment hidden (obsolete)
Comment 26 Galen Charlton 2013-05-29 16:00:39 UTC
The patches do not apply.  The base patch needs to be rebased to take 065fe316e into account, while the tooltip patch needs to be adjusted now that 7e10f6fb was pushed.
Comment 27 Jonathan Druart 2013-05-30 10:16:23 UTC
Created attachment 18508 [details] [review]
Bug 8845 - Add ability search patrons by date of birth

Adds the ability to search by dates of birth in iso format.

Signed-off-by: Marc Veron <veron@veron.ch>

Searched with following formats: YYYYMMDD , YYYY-MM-DD , YYYY.MM.DD
All searches are OK

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Comment 28 Jonathan Druart 2013-05-30 10:16:30 UTC
Created attachment 18509 [details] [review]
Bug 8845: Followup Allow to give a date using the syspref format

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Comment 29 Jonathan Druart 2013-05-30 10:16:34 UTC
Created attachment 18510 [details] [review]
Bug 8845 - Add ability search patrons by date of birth - Add tooltip

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Works with all date formats

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Comment 30 Jonathan Druart 2013-05-30 10:16:39 UTC
Created attachment 18511 [details] [review]
Bug 8845: FIX dateonly is the 4th parameter, not 3rd!
Comment 31 Jonathan Druart 2013-05-30 10:17:32 UTC
Rebased patches.
I added a patch in order to fix a variable order.
Comment 32 Galen Charlton 2013-05-30 15:33:30 UTC
Pushed to master.  Thanks, Kyle and Jonathan!