Bug 7477 - Duplicate calendar
Summary: Duplicate calendar
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Tools (show other bugs)
Version: 3.8
Hardware: All All
: P5 - low enhancement
Assignee: Jonathan Druart
QA Contact: Ian Walls
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-01-31 06:32 UTC by Srdjan Jankovic
Modified: 2013-12-05 19:53 UTC (History)
2 users (show)

See Also:
Change sponsored?: Sponsored
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
Circulation function:


Attachments
patch (7.96 KB, patch)
2012-01-31 23:47 UTC, Srdjan Jankovic
Details | Diff | Splinter Review
Set of holidays to copy to another library (33.27 KB, image/png)
2012-02-07 21:02 UTC, Owen Leonard
Details
Holidays copied to the other library (28.08 KB, image/png)
2012-02-07 21:04 UTC, Owen Leonard
Details
patch (8.75 KB, patch)
2012-02-09 01:12 UTC, Srdjan Jankovic
Details | Diff | Splinter Review
patch (8.91 KB, patch)
2012-02-09 01:32 UTC, Srdjan Jankovic
Details | Diff | Splinter Review
patch (8.95 KB, patch)
2012-02-10 00:14 UTC, Srdjan Jankovic
Details | Diff | Splinter Review
Set of holidays to copy to another library (37.35 KB, image/png)
2012-02-13 15:18 UTC, Owen Leonard
Details
Screenshot showing the holidays which were copied (36.36 KB, image/png)
2012-02-13 15:19 UTC, Owen Leonard
Details
[SIGNED-OFF] Bug 7477: Copy holidays from one branch to another (9.05 KB, patch)
2012-03-05 15:12 UTC, Owen Leonard
Details | Diff | Splinter Review
Bug 7477 Followup Fix perlcritic issues (3.00 KB, patch)
2012-03-08 11:44 UTC, Jonathan Druart
Details | Diff | Splinter Review
Followup: Fix perlcritic issues SIGN-OFF (3.05 KB, patch)
2012-03-09 00:46 UTC, Srdjan Jankovic
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
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