[Koha-bugs] [Bug 17015] New Koha Calendar

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Wed Jan 18 17:23:05 CET 2017


https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17015

--- Comment #12 from Mehdi Hamidi <mehdi.hamidi at inlibro.com> ---
Hello everyone, this is our new Calendar. This calendar is the combination of
Koha::Calendar and C4::Calendar.
The current calendar is very slow, especially for returns past due date.
DateTime Objects are very huge and resource consuming.
Our new calendar creates a Database Table to keep track of dates, holidays,
open and close hours per branch.
This way we can keep information about past, current and future dates/holidays.
We also depend on the database to make the calculations instead of DateTime
Objects which makes our new calendar incredibly faster than the current one for
fines and check-ins.
The last patch if for performance purposes and it show improvement in
comparison to the current calendar

-What we added/changed:
1- New UI
2- Change open and close hours for single and on range dates.
- Holiday types:
    - Float : like Thanksgiving, holiday without a fixed date (same as
exception, might be removed)
    - Needs validation : When a day is added in the future and it was an
Exception or Floating holiday 365 days in the past.
        This day is considered opened, so if the holiday still applies, it
needs to be changed to correct holiday.
- Change holiday type, override existing holiday.
- Copy range of holidays :
    - 1 day to multiple dates.
    - 7 days to another 7 days , apply  day of the week to the same day of the
week.
    - Any number of dates to the same number of dates.
  PS: This will copy everything, isopened, open/close hours and notes.
- Delete repeated and weekly holidays for a single date or all of them.
- Delete holidays on the range without a type.
- Calculate hours opened between dates based on open and close hours of the
branch.
- Copy calendar to another branch.

UI tips and tricks:
- Open/close hour, date type inputs will be emptied when selecting a range that
doesn't share the same values. Only different values will be emptied.
- Leaving one these (open/close hour, date type) inputs empty means they won't
be updated.
- Leaving the title input empty means it will be empty/deleted.
- Only dates in discrete_calendar table are selectable on the calendar.
- You can't update the information about a past date, meaning you can only
update today and future dates. This also applies to weekly holidays
- Checking delete type, will delete all :
    - Weekly holidays of that day, example : all Sundays.
    - Repeatable holidays, example : all 1 of January.
- Weekly holidays will apply the same open/close hours for all the dates
affected unless these inputs are left empty,
    this can be used to update all open/close hours of a given day of the week,
then removing the holiday.

Scripts :
  - misc/generate_discrete_calendar.pl
      This script fills the table discrete_calendar based on tables :
repeatable_holidays, special_holidays and branches.
      The script, by default, will add 2 years from the past and 1 year in the
future in the table discrete_calendar.
      It also has an option to add more than 1 year in the future.
      Opening and closing hours are by default 9:00 and 17:00 respectively,
they can be changed using the UI
  - add_days_discrete_calendar.pl
      This script will be used to add days in the future for the calendar,
default is 1 day, this can be changed using -n option for the script.
      The add day will have the following values:
          - Open/close hours based on the same day of the week, a week beofre
it. Example : new day : Friday 2018-01-19, a week before Friday 2018-01-12
          - HolidayType based on the same day a year ago, however if the
holiday type was :
                Float/Exception : the holidaytype of the the new day will be
marked as Needs validation.
                Weekly : the new day will be marked as normal day(To discuss
further).
                Fixed  : the new day will be closed as fixed holiday.

Test plan :
1- Apply patch
2- Run installer/data/mysql/updatedatabase.pl
3- Have atleast these branches CPL, FFL, LPL for test purposes (specific test :
t/db_dependent/HoldsQueue.t)
4- Run the script misc/generate_discrete_calendar.pl (one time only, this may
take a while)
5- Run the script add_days_discrete_calendar.pl to add days into the future
    - Check if the max date is now today + 1 day
6- Generate schemas by running misc/devel/update_dbix_class_files.pl
7- Run test t/db_dependent/DiscreteCalendar.t
8- Run all koha test t/

Use Discrete Calendar in Tools.

-- 
You are receiving this mail because:
You are watching all bug changes.
You are the assignee for the bug.


More information about the Koha-bugs mailing list