When editing an existing holiday and checking the "copy to all libraires" checkbox, the other calendars won't get updates. To test: A: * Add a new unique holiday to branch A * Check 'Copy to all libraries' checkbox * Save * Verify the entry shows on all calendars, within the calendar and in list on the right B: * Add another unique holiday to branch A * Don't check checkbox 'Copy to all libraries' * Save * Verify the holidays shows on all calendars as a green box (?) * Edit the holiday, now check 'copy to all libraries' * Verify nothing has changed in other calendars: only the green box, no holiday in list on the right * Edit again, make a change to description, check checkbox, save * Verify it's still not showing in the other calendars
Emmi, can you have a look at this one please?
Modifying holidays only affects to existing holidays and since holiday created and edited in branch A doesn't exists in branches B, C etc. "Copy changes to all libraries" has no effect. Maybe we could call "isHoliday" before calling e.g. "ModDaymonthholiday" and then add holiday if it doesn't exists?
I think it would be great to at least have some visual clue or not to provide the option if the holiday is not present in all other branches. I believe the use case here is: * add a new holiday * realize I forgot to set the checkbox * try to fix it with editing (because it looks like it will work) So either we make it work... or make it somehow clear it won't and you need to delete first. I don't know the code well enough to make a recommendation or helpful comment in that part. :(
Imo, it would probably be far more simpler just to make it work instead of checking every calendar for matching holiday.
You are probably right. Does it need a little hint/warning maybe: may overwrite existing holidays in other calendars?
(In reply to Katrin Fischer from comment #5) > You are probably right. Does it need a little hint/warning maybe: may > overwrite existing holidays in other calendars? Good idea. I'll assign myself on this for now. Hopefully I'm able to work on this soon.
Created attachment 151562 [details] [review] 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
Created attachment 151602 [details] [review] 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>
Created attachment 152889 [details] [review] 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>
Pushed to master for 23.11. Nice work everyone, thanks!
Thanks for all the hard work! Pushed to 23.05.x for the next release
Nice work everyone! Pushed to oldstable for 22.11.x