Bug 27773

Summary: Hide unique holidays and exceptions which have passed
Product: Koha Reporter: Owen Leonard <oleonard>
Component: ToolsAssignee: Owen Leonard <oleonard>
Status: CLOSED FIXED QA Contact: Testopia <testopia>
Severity: enhancement    
Priority: P5 - low CC: fridolin.somers, jonathan.druart, pascale.nalon, pascale.nalon, severine.queune
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:
21.05.00
Circulation function:
Attachments: Bug 27773: Hide unique holidays and exceptions which have passed
Bug 27773: Hide unique holidays and exceptions which have passed
Bug 27773: Hide unique holidays and exceptions which have passed
Bug 27773: Hide unique holidays and exceptions which have passed

Description Owen Leonard 2021-02-24 13:30:19 UTC
Similar to Bug 27766, I think it would improve the calendar interface if we hid unique holidays and holiday exceptions which are in the past. Checking a checkbox would show the hidden entries.
Comment 1 Owen Leonard 2021-02-24 13:41:58 UTC Comment hidden (obsolete)
Comment 2 Séverine Queune 2021-04-01 12:21:14 UTC
Sorry Owen, the patch doesn't apply :/

Apply? [(y)es, (n)o, (i)nteractive] y
Applying: Bug 27773: Hide unique holidays and exceptions which have passed
error: sha1 information is lacking or useless (koha-tmpl/intranet-tmpl/prog/en/modules/tools/holidays.tt).
error: could not build fake ancestor
Patch failed at 0001 Bug 27773: Hide unique holidays and exceptions which have passed
The copy of the patch that failed is found in: .git/rebase-apply/patch
Comment 3 Owen Leonard 2021-04-01 13:36:32 UTC Comment hidden (obsolete)
Comment 4 Owen Leonard 2021-04-01 13:37:15 UTC
(In reply to Séverine Queune from comment #2)
> Sorry Owen, the patch doesn't apply :/

My fault, I forgot to squash two patches!
Comment 5 Pascale Nalon 2021-04-01 14:59:48 UTC
Test done this day on a ptfs sandbox : everything works fine.
Comment 6 Pascale Nalon 2021-04-02 07:43:14 UTC
Test plan done :
- Apply the patch and go to Tools -> Calendar
 - In the tables of existing holidays, check that no dates in the past
   appear in the "Exceptions" or "Unique holidays" tables.
 - Checking the checkbox at the top of each of these tables should
   trigger the display of the hidden rows.
Comment 7 Katrin Fischer 2021-04-02 16:15:27 UTC
Owen, can you please check?

 FAIL	koha-tmpl/intranet-tmpl/prog/en/modules/tools/holidays.tt
   FAIL	  filters
		asset_must_be_raw at line 8 ([% Asset.css("css/calendar.css") %])
Comment 8 Owen Leonard 2021-04-07 17:43:57 UTC
Created attachment 119310 [details] [review]
Bug 27773: Hide unique holidays and exceptions which have passed

This patch modifies the display of unique holidays and holiday
exceptions so that dates in the past are hidden by default. A
corresponding "Show past entries" checkbox can be checked to show the
hidden entries.

To test you should have some unique holidays and holiday exceptions in
your system from the past and in the future.

 - Apply the patch and go to Tools -> Calendar
 - In the tables of existing holidays, check that no dates in the past
   appear in the "Exceptions" or "Unique holidays" tables.
 - Checking the checkbox at the top of each of these tables should
   trigger the display of the hidden rows.
Comment 9 Jonathan Druart 2021-04-14 09:14:10 UTC
Algorithmically speaking it would have been better to not build "date_past" (and so compare today with the holiday date) every time we draw the table, but only once when initiated (using data-past='1' for instance).
Regarding the mess in the template, and the unnecessary complicated date handling (DATE_SORT and date formatting), I would not consider it blocker.
Comment 10 Jonathan Druart 2021-04-14 09:15:35 UTC
Created attachment 119552 [details] [review]
Bug 27773: Hide unique holidays and exceptions which have passed

This patch modifies the display of unique holidays and holiday
exceptions so that dates in the past are hidden by default. A
corresponding "Show past entries" checkbox can be checked to show the
hidden entries.

To test you should have some unique holidays and holiday exceptions in
your system from the past and in the future.

 - Apply the patch and go to Tools -> Calendar
 - In the tables of existing holidays, check that no dates in the past
   appear in the "Exceptions" or "Unique holidays" tables.
 - Checking the checkbox at the top of each of these tables should
   trigger the display of the hidden rows.

Signed-off-by: Pascale Nalon <pascale.nalon@ensmp.fr>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Comment 11 Jonathan Druart 2021-04-14 13:36:20 UTC
Pushed to master for 21.05, thanks to everybody involved!
Comment 12 Fridolin Somers 2021-04-19 12:59:18 UTC
Enhancement not pushed to 20.11.x