Read the working days from Redmine's own configuration - #50
Merged
mboremski merged 2 commits intoAug 27, 2026
Conversation
Fixes xmera-circle#30 The plugin kept its own set of weekday checkboxes although Redmine already has `Setting.non_working_week_days` under Administration -> Settings -> Issue tracking. Two places to answer the same question means they can disagree, and then the workload calculation contradicts the rest of Redmine without anyone being told. `WlDateTools.working_days` now derives from the core setting, which uses the same cwday numbering the plugin already used. The seven `general_workday_*` plugin settings and their fieldset are gone; the settings page points to the core setting instead. BREAKING for installations whose plugin settings differed from Redmine's: their working days change to whatever Redmine says. Everyone who left both at their defaults (Monday to Friday) sees no difference. The stored `general_workday_*` values are left untouched in the settings hash. They are simply no longer read, so nothing is lost if this has to be reverted. Tests: the four suites that configured the plugin settings now set `Setting.non_working_week_days`. Three of them were spelling out Monday to Friday, which is Redmine's default anyway. Added a case for an empty setting, where every day is a working day. The `workload_settings_general_workdays_*` day name keys stay in the locales; `app/views/wl_user_datas/_workday.html.erb` still refers to them. That partial is an unfinished per-user feature and is not rendered anywhere, so it was left alone.
`WlDateTools.working_days_in_time_span` caches per user and time span with `expires_in: 12.hours`. With the plugin's own checkboxes that was already true but rarely noticed; now that the days come from Redmine's own settings, more people will change them and wonder why the workload view does not follow. Rather than rebuilding the caching, name it where it bites: a warning on the plugin settings page next to the link, and a note in the README with the two ways out (restart, or clear the cache). The note also mentions that holidays and vacations go through the same cache.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #30
The plugin kept its own set of weekday checkboxes although Redmine already
has
Setting.non_working_week_daysunder Administration -> Settings ->Issue tracking. Two places to answer the same question means they can
disagree, and then the workload calculation contradicts the rest of
Redmine without anyone being told.
WlDateTools.working_daysnow derives from the core setting, which usesthe same cwday numbering the plugin already used. The seven
general_workday_*plugin settings and their fieldset are gone; thesettings page points to the core setting instead.
BREAKING for installations whose plugin settings differed from Redmine's:
their working days change to whatever Redmine says. Everyone who left both
at their defaults (Monday to Friday) sees no difference.
The stored
general_workday_*values are left untouched in the settingshash. They are simply no longer read, so nothing is lost if this has to be
reverted.
Tests: the four suites that configured the plugin settings now set
Setting.non_working_week_days. Three of them were spelling out Monday toFriday, which is Redmine's default anyway. Added a case for an empty
setting, where every day is a working day.
The
workload_settings_general_workdays_*day name keys stay in thelocales;
app/views/wl_user_datas/_workday.html.erbstill refers to them.That partial is an unfinished per-user feature and is not rendered
anywhere, so it was left alone.