Repository navigation
Description
Module @ 1dc33d6 (v1.0) checked against web2project master @ 418936fe (PHP 8.3.6).
Does the module still have a purpose? Yes. Core only knows which weekdays are working days (cal_working_days). This module is the only source of date-specific exceptions: public holidays, company closures, make-up working days and staff vacations. Core already calls it from w2p_Utilities_Date::isWorkingDay(), which drives calendar shading, calcFinish() / calcDuration(), dependency shifting and the cost reports.
Today it's harmful on 5.0: activating it makes every page that calls isWorkingDay() fatal (#2).
Required to run on 5.0 / PHP 8.3
- A1: Enabling the module makes calendars and task scheduling fatal (getLibraryClass() removed) #2 A1: Enabling the module makes calendars and task scheduling fatal (getLibraryClass() removed)
- A2: Replace the bundled PEAR Date_Holidays; it can't run on PHP 8 #3 A2: Replace the bundled PEAR Date_Holidays; it can't run on PHP 8
- A3: Curly-brace string offsets are a parse error on PHP 8 #4 A3: Curly-brace string offsets are a parse error on PHP 8
- A4: CTabBox no longer exists; use w2p_Theme_TabBox #5 A4: CTabBox no longer exists; use w2p_Theme_TabBox
- A5: Settings save uses removed w2p_Core_Config and misreads store()'s result #6 A5: Settings save uses removed w2p_Core_Config and misreads store()'s result
- A6: delete($AppUI) deletes holiday row 1 instead of the current row #7 A6: delete($AppUI) deletes holiday row 1 instead of the current row
- A7: setup.php: install fails under strict sql_mode; upgrade uses removed db_* helpers #8 A7: setup.php: install fails under strict sql_mode; upgrade uses removed db_* helpers
Security
- C1: SQL injection through user_id and holiday_annual in do_holiday_aed #9 C1: SQL injection through user_id and holiday_annual in do_holiday_aed
- C2: No authorization in the save handlers #10 C2: No authorization in the save handlers
- C3: Stored XSS in holiday descriptions and the user picker #11 C3: Stored XSS in holiday descriptions and the user picker
Behaviour and data
- B1: User vacations never affect scheduling (decision needed) #12 B1: User vacations never affect scheduling (decision needed)
- B2: isHoliday() runs two queries per day checked #13 B2: isHoliday() runs two queries per day checked
- B3: Annual entries that cross New Year never match #14 B3: Annual entries that cross New Year never match
- B4: Holiday names don't appear on core calendars; iCal feed gets only the current month #15 B4: Holiday names don't appear on core calendars; iCal feed gets only the current month
- B6: Settings tab duplicates System Admin's working-day settings #16 B6: Settings tab duplicates System Admin's working-day settings
5.0 conventions
- D1: Bootstrap theme support and jQuery UI #17 D1: Bootstrap theme support and jQuery UI
- D3: Version, README and docs for 5.0 #18 D3: Version, README and docs for 5.0
Suggested order: #2–#11 except #3 (about a day: loads and is safe, automatic calendars off) → #3 (Yasumi, 1–2 days) → #13, #14, #15, #16 → decisions on #12 and #17.
Core follow-ups (not filed here):
- The task form's JavaScript Calculate Finish Date / Duration (
modules/tasks/addedit.js) uses only the weekday list, so with holidays the browser and server compute different dates. - Optional: replace the hard-coded
modules/holiday/holiday_functions.class.phplookup inisWorkingDay()with a hook, so any module can supply non-working dates.
Effort: XS < 15 min · S < 1 h · M ≈ half a day · L = days. Found by reading the code and php -l; not yet run on a live install.
Activity