Skip to content

Read the working days from Redmine's own configuration - #50

Merged
mboremski merged 2 commits into
xmera-circle:developfrom
mboremski:feature/workdays-from-core
Aug 27, 2026
Merged

Read the working days from Redmine's own configuration#50
mboremski merged 2 commits into
xmera-circle:developfrom
mboremski:feature/workdays-from-core

Conversation

@mboremski

Copy link
Copy Markdown
Collaborator

Fixes #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.

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.
@mboremski mboremski self-assigned this Aug 27, 2026
@mboremski
mboremski merged commit a1826d2 into xmera-circle:develop Aug 27, 2026
3 checks passed
@mboremski
mboremski deleted the feature/workdays-from-core branch August 27, 2026 14:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant