Bug 7477

Summary: Duplicate calendar
Product: Koha Reporter: Srdjan Jankovic <srdjan>
Component: ToolsAssignee: Jonathan Druart <jonathan.druart>
Status: CLOSED FIXED QA Contact: Ian Walls <koha.sekjal>
Severity: enhancement    
Priority: P5 - low CC: paul.poulain, stephane.delaye
Version: 3.8   
Hardware: All   
OS: All   
Change sponsored?: Sponsored Patch complexity: ---
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
Circulation function:
Attachments: patch
Set of holidays to copy to another library
Holidays copied to the other library
patch
patch
patch
Set of holidays to copy to another library
Screenshot showing the holidays which were copied
[SIGNED-OFF] Bug 7477: Copy holidays from one branch to another
Bug 7477 Followup Fix perlcritic issues
Followup: Fix perlcritic issues SIGN-OFF

Description Srdjan Jankovic 2012-01-31 06:32:53 UTC
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
Comment 1 Srdjan Jankovic 2012-01-31 23:47:54 UTC Comment hidden (obsolete)
Comment 2 Owen Leonard 2012-02-07 21:02:36 UTC Comment hidden (obsolete)
Comment 3 Owen Leonard 2012-02-07 21:04:43 UTC Comment hidden (obsolete)
Comment 4 Srdjan Jankovic 2012-02-09 01:12:04 UTC Comment hidden (obsolete)
Comment 5 Srdjan Jankovic 2012-02-09 01:32:12 UTC Comment hidden (obsolete)
Comment 6 Owen Leonard 2012-02-09 13:58:30 UTC
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
Comment 7 Srdjan Jankovic 2012-02-09 23:48:53 UTC
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.
Comment 8 Srdjan Jankovic 2012-02-09 23:55:54 UTC
Please disregard the last comment.
Comment 9 Srdjan Jankovic 2012-02-10 00:14:32 UTC Comment hidden (obsolete)
Comment 10 Owen Leonard 2012-02-13 15:18:24 UTC Comment hidden (obsolete)
Comment 11 Owen Leonard 2012-02-13 15:19:24 UTC Comment hidden (obsolete)
Comment 12 Srdjan Jankovic 2012-02-13 22:58:17 UTC
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.
Comment 13 Owen Leonard 2012-03-05 15:12:51 UTC
Created attachment 8013 [details] [review]
[SIGNED-OFF] Bug 7477: Copy holidays from one branch to another

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Comment 14 Jonathan Druart 2012-03-08 11:44:46 UTC Comment hidden (obsolete)
Comment 15 Srdjan Jankovic 2012-03-09 00:46:19 UTC
Created attachment 8105 [details] [review]
Followup: Fix perlcritic issues SIGN-OFF
Comment 16 Jonathan Druart 2012-03-16 11:08:32 UTC
marked as Passed QA
Comment 17 delaye 2012-03-19 11:29:51 UTC
it's ok for me
Comment 18 Paul Poulain 2012-03-19 17:17:33 UTC
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