Bug 33667: Allow copying holidays to all libraries when editing
authorEmmi Takkinen <emmi.takkinen@koha-suomi.fi>
Tue, 23 May 2023 12:29:12 +0000 (15:29 +0300)
committerMartin Renvoize <martin.renvoize@ptfs-europe.com>
Mon, 17 Jul 2023 15:42:42 +0000 (16:42 +0100)
commit8a342549536ee92d4bcf84aaebff0a4e0f50e12c
tree1c67223112e8ba7b9e6bb1928862dc1e044f5c21
parent931e2b2d52514e013bf41f7bcce96c8600dde5df
Bug 33667: Allow copying holidays to all libraries when editing

When editing an existing holiday and checking the
"copy to all libraires" checkbox, the other calendars won't
get updates. Allow this by first checking if holiday exists
in target calendar and if not, add it.

To test:
1. Add unique holiday to branch A.
2. Don't check checkbox "Copy to all libraries".
3. Save.
4. Verify the holidays shows on all calendars as
a green box.
5. Edit the holiday, now check "Copy to all libraries"
and save.
=> Verify nothing has changed in other calendars:
only the green box, no holiday in list on the right
6. Edit again, make a change to description,
check checkbox, save.
=> Verify it's still not showing in the other
calendars.
9. Apply this patch.
10. Edit holiday again, check "Copy to all libraries"
and save.
=> Verify holiday is now added to other calendars.
11. Edit again, this time do not copy and save.
=> Verify holiday was edited just in branch A.
12. Again edit, check and save.
=> Verify holiday was edited in all libraries.

Sponsored-by: Koha-Suomi Oy
Signed-off-by: Sam Lau <samalau@gmail.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 83589f0317068a5cd2da7b5524ea6b6b738dfdfe)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
koha-tmpl/intranet-tmpl/prog/en/modules/tools/holidays.tt
tools/exceptionHolidays.pl