Work to be done: * tools/holidays: - create a form "Copy to <library>" that will select target library - add a handler for copying holidays from the currently selected library to the target library How to test: * Copy calendar from one library to another and check that all days/dates are copied
Created attachment 7401 [details] [review] patch
Created attachment 7494 [details] Set of holidays to copy to another library Using this tool copied these categories of holiday: - Holiday repeating yearly - Holiday exception But not these: - Holiday repeating weekly - Unique holidays. This attachment shows the holidays I tried to copy to another library.
Created attachment 7495 [details] Holidays copied to the other library Not especially that the "repeating weekly" holiday from the first library appears under the "repeating yearly" heading with the date "00/00"
Created attachment 7520 [details] [review] patch Weekday copy was a bit of a flop, but Unique Holidays copy worked for me. Can you please retest.
Created attachment 7521 [details] [review] patch
Now when I try to create a holiday repeating on the same day every week I get an error: No weekday at /home/oleonard/kohaclone/tools/newHolidays.pl line 81 at /home/oleonard/kohaclone/C4/Calendar.pm line 198 C4::Calendar::insert_week_day_holiday('C4::Calendar=HASH(0xb3f9400)', 'weekday', 0, 'title', 'Closed Sunday', 'description', '') called at /home/oleonard/kohaclone/tools/newHolidays.pl line 81 main::add_holiday('weekday', 'APL', 0, 5, 2, 2012, 'Closed Sunday', '') called at /home/oleonard/kohaclone/tools/newHolidays.pl line 66
Owen, that probably means you have a corrupt entry in your database, maybe left from previous testing. Can you please check repeatable_holidays table, and see if you have an entry with all weekday, day and month NULL.
Please disregard the last comment.
Created attachment 7547 [details] [review] patch Good ol' 0 Sunday... one is never to old to fall for that.
Created attachment 7626 [details] Set of holidays to copy to another library Screenshot of the set of holidays I entered to be copied to another library.
Created attachment 7627 [details] Screenshot showing the holidays which were copied It looks like everything copied except the unique holiday on 1 Feb.
That is because 01/02/2012 was gone, so I thought there was no point copying it. If there's a reason to copy past holidays, I'll change that.
Created attachment 8013 [details] [review] [SIGNED-OFF] Bug 7477: Copy holidays from one branch to another Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Created attachment 8083 [details] [review] Bug 7477 Followup Fix perlcritic issues QA comment: Hi Srdjan ! Your patch redefine the daysBetween routine: perl -wc C4/Calendar.pm Subroutine daysBetween redefined at C4/Calendar.pm line 663. And does not passed the perlcritic: Subroutine prototypes used at line 663, column 1. See page 194 of PBP. (Severity: 5) "return" statement with explicit "undef" at line 664, column 30. See page 199 of PBP. (Severity: 5) "return" statement with explicit "undef" at line 665, column 30. See page 199 of PBP. (Severity: 5) I submit a new patch to fix these issues. Could you signed off it please ?
Created attachment 8105 [details] [review] Followup: Fix perlcritic issues SIGN-OFF
marked as Passed QA
it's ok for me
patch pushed. I appreciate that an existing holiday in a branch is not deleted when the branch is overwritten: * branch B, set today as closed * switch to branch A, where today is not closed * copy holidays to branch B * today is still closed for branch B that's important to notice for the documentation