Content
View differences
Updated by Parimal Satyal over 4 years ago
**As** an OpenProject user
**I want** to calculate the work package start and end dates based on the duration
**so** that I only have to set the duration.
# **Acceptance criteria:**
The duration feature affects a range of views and modules:
### Work package attributes and date picker
* In the date picker modal there is a text form field `duration`.
* When the user enters entering a duration, duration the dates are derived.
* The contrary is also true: when a user enters dates, the duration is derived.
* More precise scenarios for what is derived/calculated as a result of what input (in which order), are [presented below](https://community.openproject.org/#scenarios). derived
* **\[open\]** The duration represents the amount of days between the start and the finish date (inclusive): with the day of the finish date included, e.g:
* Monday to Tuesday: 2 days
* Monday to Monday (same day): 1 day
* **\[open\]** Once configuring non-working non working days is are implemented (<mention class="mention" data-id="18416" data-type="work_package" data-text="#18416">#18416</mention>), these non-working (#18416), days are _skipped_ _over_ and defined to be non working days do not count towards when calculating the total duration: duration or dates based on the duration, e.g:
* Friday to Monday: 2 days _(Saturday and Sunday are skipped over)_
* **\[open\]** The user In the work packages list there is able to override configured non-working days per work package; a column "duration". When clicking on this means non-working can be optionally included, in which case they are _not_ skipped and count towards the date and duration count.
* **\[open\]** This requires manual scheduling to be checked (to be explored) modal with the date picker is opened.
* In all cases, cases the duration is consistent with the start and the finish date. Updating dates will update duration, and updating duration will update dates.
* It will is not possible, for example, possible to specify create a duration of 8 days for a task that starts and finishes in the same week.
* The duration as well as start and due dates can not be configured via the form configuration. They are always present at the same place within the bar representing a work package show page and form.
* Work packages have an empty (not set) default duration.
* Setting start _and_ end dates automatically sets duration.
* Setting only one of the dates does not automatically set duration (unable to derive)
* Setting only of the dates and duration derives the other date.
* **\[open\]** Duration, once set, cannot be removed unless at least one of the dates (start/finish) is also removed; else, duration is derived (as described above)
* Milestone-typed work packages don't have a duration field.
* **\[open\]** On the GANNT and Team planner, they represent 1 day.
* The user has to to be informed when:
* Dates are automatically derived from relations (notably from parents or children),
* **\[open\]** The user must be given a way width according to view relations (a link to a GANTT view?)
* these automatically derived dates can not be modified, _unless:_
* Manual scheduling is enabled, and thus relations are ignored and
* Configured non-working days maybe optionally included in the calculation of total work package's duration and start/end dates.
### Work package table view
* In the work packages list there is (if defined) while dragging a column "duration". When clicking on this the date modal with the date picker is opened.
* **\[open\]** With the focus on the duration field.
* Filtering by duration is possible
* Sorting by duration is possible
### GANTT chart
* For work packages package without start/finish start and end dates but _with_ duration, the width of a "strip" representing such a work package has a width that is relative to its total duration when dragging to the the GANTT chart.
* "Relative" because width depends for placement on the zoom level of the GANTT chart. gantt chart and planning board
* **\[open\]** If the user modifies a the work package via the drag handles on the left/right edges border of the strips cards/strips representing the work package in Gantt chart, chart/Team planner, both the start/finish date as well as the duration are is altered in lockstep.
### Team planner
lockstep
* For work packages without start/finish dates but _with_ duration, the width of a card that Filtering by duration is dragged onto the team planner (from the left-hand "Add Existing" panel, for example) is relative to the total duration of that work package.
possible
* "Relative" because width depends on the zoom level/view of the team planner calendar. Sorting by duration is possible
* If the user modifies a work package via the drag handles on the left/right edges of the cards on the Team planner, both the start/finish date The duration as well as start and due dates can not be configured via the duration form configuration. They are altered in lockstep. always present at the same place within the work package show page and form.
* **\[open\]** The user is able to modify the view such that non-workin days are not displayed on the team planner.
Work packages have an empty (not set) default duration
* Even when non-working days are not displayed, they are nevertheless represented (although with much narrower column widths and without Milestone typed work packages don't have a header).
* This is especially important because manual scheduling nevertheless allows users to include non-working days into the date and duration count. field
# Open
* Visuals for the rework of the dates & duration to be a fixed (not configurable) part of the work package show page and form (<mention class="mention" data-id="40539" data-type="work_package" data-text="#40539">#40539</mention>) (##40539)
* Inheritance of the duration between a work package and its children
* e.g. can a work package have a duration that is less than the duration of its child
# Visuals needed Examples
* Date picker with duration field
* Warning/Information when dates are derived from relations
* Warning/information about manual scheduling
* Option to include configured non-working days
* Work package table view with duration column
* GANTT view
* Team planner
* with option to switch on and off the display of non-working days in week/2-week view
# Scenarios
## Scenario 1:
* Setup
* Start date: Monday, February 8 2021
* Finish date: empty
* Duration: empty
* Change
* User enters a duration of 10 days
* Expected result:
* The finish date is changed to Friday, February 19 2021
## Scenario 2
* Setup
* Start date: empty
* Finish date: empty
* Duration: empty
* Change
* User enters a duration of 10 days
* Expected result:
* No date is added
## Scenario 3
* Setup
* Start date: empty
* Finish date: Friday, February 19, 2021
* Duration: empty
* Change
* User enters a duration of 10 days
* Expected result:
* The start date is changed to Monday, February 8, 2021
## Scenario 4
* Setup
* Start date: Monday, February 8, 2021
* Finish date: Friday, February 19, 2021
* Duration: 10
* Change
* User enters a duration of 11 days
* Expected result:
* The finish date is changed to Monday, February, 22 2021
## Scenario 5
* Setup
* Start date: Monday, February 8, 2021
* Finish date: Monday, February 22, 2021
* Duration: 11
* Change
* User enters a duration of 10 days
* Expected result:
* The finish date is changed to Friday, February, 19, 2021
## Scenario 6
* Setup
* Two work packages
* Task 1: Monday - Tuesday
* Task 2: no dates, no duration
* Change
* Task 2 follows Task 1
* Expected result
* Task 2: Starts Wednesday, Finish Date Wednesday, Duration = 1
## Scenario 7
* Setup
* Start date: Monday, February 9, 2021
* Finish date: Wednesday, February 11, 2021
* Duration: 3
* Change
* User alters the start date to Tuesday 10, 2021
* Expected result
* Finish date is changed to Thursday, Feb 12, 2021
## Scenario 8
* Setup
* Start date: Tuesday, February 10, 2021
* Finish date: Thursday, February 12, 2021
* Duration: 3
* Change
* User alters the finish date to Feb 11, 2021
* Expected result
* Start date is changed to Monday, Feb 9, 2021
## Scenario 9
* Setup
* Start date: Monday, February 9, 2021
* Finish date: Wednesday, February 11, 2021
* Duration: 3
* Change
* User moves the drag handle on the left border (start date) of the box representing the work package in Gantt chart and Team planner one day to the right (to Feb 10, 2021)
* Expected result
* The duration is reduced to 2. The start date is set to Feb 10, 2021. The Finish date is left unchanged.
## Scenario 10
* Setup
* Start date: empty
* Finish date: Wednesday, February 11, 2021
* Duration: empty
* Change
* User enters the start date of Monday, February 09, 2021
* Expected result
* **\[open\]** Duration is set to 3
# Visuals
<figure class="image op-uc-figure"><div class="op-uc-figure--content"><img class="op-uc-image" src="/api/v3/attachments/27172/content"></div></figure>
# Seed Data
**Static queries in section "Default data":**
* Gantt chart: Add duration column after column finish date:
**Queries in section favorite views**
* Project plan (Query ID 1): Add duration column after column finish date
* Project plan (Query ID 14): Add duration column after column finish date
# Full screen view
* Currently the status selection is below the subject at the same position for all work package types.
* We also move the dates and the curation to this area (visuals tbd).
* For milestones there is no duration by definition.
# Out-of-Scope
* Consider weekends and holidays (for this ticket, will normally already have been dealth by <mention class="mention" data-id="18416" data-type="work_package" data-text="#18416">#18416</mention>) (##18416)
* Summing duration _(need clarification)_ durations
* Grouping by durations _(need clarification)_
# Implementation notes
* Frontend:
* include duration in date picker
* There is no duration form field for milestones.
* Restyling dates section (start & due date & duration) so that dates are always visible (no longer configurable via form configuration) similar to status
* Adapt specs that break by doing this
* Display longer bar in gantt chart and planning board while dragging a work package without start & end dates
* Backend:
* Introduce into data layer & contracts
* Disallow setting duration for milestone typed work packages
* Services
* **Open** inheritance within hierarchy
* Include in API
* Exclude for milestone typed work packages (should be covered by non writable property in contract)
* Calculates start/end dates on scheduling and on setting duration/start/end-dates
* Filter for duration ("Everything longer than")
* Sort
* Seeding and default configurations
* Migration for removing the dates from existing form configurations as they can no longer be configured.
* Migration for setting a duration for all work packages having start and end date set.
**I want** to calculate the work package start and end dates based on the duration
**so** that I only have to set the duration.
# **Acceptance criteria:**
The duration feature affects a range of views and modules:
### Work package attributes and date picker
* In the date picker modal there is a text
* When the user enters
* The contrary is also true: when a user enters dates, the duration is derived.
* More precise scenarios for what is derived/calculated as a result of what input (in which order), are [presented below](https://community.openproject.org/#scenarios).
*
* Monday to Tuesday: 2 days
* Monday to Monday (same day): 1 day
*
* Friday to Monday: 2 days _(Saturday and Sunday are skipped over)_
* **\[open\]** This requires manual scheduling to be checked (to be explored)
* In all cases,
* It will
* The duration as well as start and due dates can not be configured via the form configuration. They are always present at the same place within the
* Work packages have an empty (not set) default duration.
* Setting start _and_ end dates automatically sets duration.
* Setting only one of the dates does not automatically set duration (unable to derive)
* Setting only of the dates and duration derives the other date.
* **\[open\]** Duration, once set, cannot be removed unless at least one of the dates (start/finish) is also removed; else, duration is derived (as described above)
* Milestone-typed work packages don't have a duration field.
* **\[open\]** On the GANNT and Team planner, they represent 1 day.
* The user has to to be informed when:
* Dates are automatically derived from relations (notably from parents or children),
* **\[open\]** The user must be given a way
* these automatically derived dates can not be modified, _unless:_
* Manual scheduling is enabled, and thus relations are ignored and
* Configured non-working days maybe optionally included in the calculation of total
### Work package table view
* In the work packages list there is
* **\[open\]** With the focus on the duration field.
* Filtering by duration is possible
* Sorting by duration is possible
### GANTT chart
* For work packages
* "Relative" because width depends
*
### Team planner
* If the user modifies a work package via the drag handles on the left/right edges of the cards on the Team planner, both the start/finish date
* **\[open\]** The user is able to modify the view such that non-workin days are not displayed on the team planner.
* This is especially important because manual scheduling nevertheless allows users to include non-working days into the date and duration count.
# Open
* Visuals for the rework of the dates & duration to be a fixed (not configurable) part of the work package show page and form (<mention class="mention" data-id="40539" data-type="work_package" data-text="#40539">#40539</mention>)
* Inheritance of the duration between a work package and its children
* e.g. can a work package have a duration that is less than the duration of its child
# Visuals needed
* Date picker with duration field
* Warning/Information when dates are derived from relations
* Warning/information about manual scheduling
* Option to include configured non-working days
* Work package table view with duration column
* GANTT view
* Team planner
* with option to switch on and off the display of non-working days in week/2-week view
# Scenarios
## Scenario 1:
* Setup
* Start date: Monday, February 8 2021
* Finish date: empty
* Duration: empty
* Change
* User enters a duration of 10 days
* Expected result:
* The finish date is changed to Friday, February 19 2021
## Scenario 2
* Setup
* Start date: empty
* Finish date: empty
* Duration: empty
* Change
* User enters a duration of 10 days
* Expected result:
* No date is added
## Scenario 3
* Setup
* Start date: empty
* Finish date: Friday, February 19, 2021
* Duration: empty
* Change
* User enters a duration of 10 days
* Expected result:
* The start date is changed to Monday, February 8, 2021
## Scenario 4
* Setup
* Start date: Monday, February 8, 2021
* Finish date: Friday, February 19, 2021
* Duration: 10
* Change
* User enters a duration of 11 days
* Expected result:
* The finish date is changed to Monday, February, 22 2021
## Scenario 5
* Setup
* Start date: Monday, February 8, 2021
* Finish date: Monday, February 22, 2021
* Duration: 11
* Change
* User enters a duration of 10 days
* Expected result:
* The finish date is changed to Friday, February, 19, 2021
## Scenario 6
* Setup
* Two work packages
* Task 1: Monday - Tuesday
* Task 2: no dates, no duration
* Change
* Task 2 follows Task 1
* Expected result
* Task 2: Starts Wednesday, Finish Date Wednesday, Duration = 1
## Scenario 7
* Setup
* Start date: Monday, February 9, 2021
* Finish date: Wednesday, February 11, 2021
* Duration: 3
* Change
* User alters the start date to Tuesday 10, 2021
* Expected result
* Finish date is changed to Thursday, Feb 12, 2021
## Scenario 8
* Setup
* Start date: Tuesday, February 10, 2021
* Finish date: Thursday, February 12, 2021
* Duration: 3
* Change
* User alters the finish date to Feb 11, 2021
* Expected result
* Start date is changed to Monday, Feb 9, 2021
## Scenario 9
* Setup
* Start date: Monday, February 9, 2021
* Finish date: Wednesday, February 11, 2021
* Duration: 3
* Change
* User moves the drag handle on the left border (start date) of the box representing the work package in Gantt chart and Team planner one day to the right (to Feb 10, 2021)
* Expected result
* The duration is reduced to 2. The start date is set to Feb 10, 2021. The Finish date is left unchanged.
## Scenario 10
* Setup
* Start date: empty
* Finish date: Wednesday, February 11, 2021
* Duration: empty
* Change
* User enters the start date of Monday, February 09, 2021
* Expected result
* **\[open\]** Duration is set to 3
# Visuals
<figure class="image op-uc-figure"><div class="op-uc-figure--content"><img class="op-uc-image" src="/api/v3/attachments/27172/content"></div></figure>
# Seed Data
**Static queries in section "Default data":**
* Gantt chart: Add duration column after column finish date:
**Queries in section favorite views**
* Project plan (Query ID 1): Add duration column after column finish date
* Project plan (Query ID 14): Add duration column after column finish date
# Full screen view
* Currently the status selection is below the subject at the same position for all work package types.
* We also move the dates and the curation to this area (visuals tbd).
* For milestones there is no duration by definition.
# Out-of-Scope
* Consider weekends and holidays (for this ticket, will normally already have been dealth by <mention class="mention" data-id="18416" data-type="work_package" data-text="#18416">#18416</mention>)
* Summing duration _(need clarification)_
* Grouping by durations _(need clarification)_
# Implementation notes
* Frontend:
* include duration in date picker
* There is no duration form field for milestones.
* Restyling dates section (start & due date & duration) so that dates are always visible (no longer configurable via form configuration) similar to status
* Adapt specs that break by doing this
* Display longer bar in gantt chart and planning board while dragging a work package without start & end dates
* Backend:
* Introduce into data layer & contracts
* Disallow setting duration for milestone typed work packages
* Services
* **Open** inheritance within hierarchy
* Include in API
* Exclude for milestone typed work packages (should be covered by non writable property in contract)
* Calculates start/end dates on scheduling and on setting duration/start/end-dates
* Filter for duration ("Everything longer than")
* Sort
* Seeding and default configurations
* Migration for removing the dates from existing form configurations as they can no longer be configured.
* Migration for setting a duration for all work packages having start and end date set.