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)
committerTomas Cohen Arazi <tomascohen@theke.io>
Thu, 6 Jul 2023 13:08:45 +0000 (10:08 -0300)
commit83589f0317068a5cd2da7b5524ea6b6b738dfdfe
tree6164edf47e82c159d508545ad1ecb226868dd44b
parent7e1104da8340b3c62d3747fe75c13c8c5adea21d
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>
koha-tmpl/intranet-tmpl/prog/en/modules/tools/holidays.tt
tools/exceptionHolidays.pl