You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
AssignColorsByDayOfWeek is a Kanboard plugin that automatically assigns task card
colors based on the day of the week of a task's due date, triggered at task
creation time. The color is determined by which day of the week the due date falls on
— not the creation date. Colors are configured per-project via Kanboard's standard
automatic action UI.
System Context
This plugin operates entirely within the Kanboard plugin ecosystem. It registers a
single automatic action that Kanboard's ActionManager invokes when tasks are created.
Registers the action with Kanboard's ActionManager
Plugin.php
AssignColorsByDayOfWeek action
Event handling, condition checking, color resolution, task update
Action/AssignColorsByDayOfWeek.php
Data Flow
A task is created in Kanboard (TaskModel::EVENT_CREATE fires)
Kanboard's ActionManager pre-populates $this->params with this action instance's
configured day→color and Timezone values from action_has_params, then calls
hasRequiredCondition() on the action
The action verifies: task has the default color; task has a non-zero due date; and the
color configured for that due date's day of week (resolved via resolveDayOfWeek() +
getParam($day)) is a non-empty, non-sentinel value
If the condition passes, doAction() is called unconditionally
getColorForDay() reads the color for the resolved day via $this->getParam($day) —
no additional DB query is needed because ActionManager has already populated the params
The due date timestamp is converted to an English day name (e.g., 'Monday') using
the configured Timezone parameter (falls back to date_default_timezone_get())
The resolved color ID is applied to the task via TaskModificationModel::update()
Key Design Decisions
Decision
Rationale
ADR
PHP as primary language
Required by the Kanboard plugin API
—
Extend Kanboard\Action\Base
Provides DI container access and standard action lifecycle hooks
—
Use $this->getParam() API (not raw SQL)
ActionManager pre-populates $this->params before execute() is called; getParam() reads the current action instance's parameters without extra DB queries
—
Fixed English parameter keys (no t() on keys)
DateTime::format('l') always returns English day names; using translated keys causes an unresolvable lookup mismatch in non-English installations
—
Configurable Timezone parameter
Replaces hardcoded America/New_York; defaults to date_default_timezone_get() so a task due at midnight is classified by the server/user's local day, not ET
—
Color determined by due date's day of week
Users configure "I want Monday-due tasks to be red"; the action fires on creation so the relevant date is the due date, not the creation timestamp