Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 352955

Summary: AbstractPlannerField: inconsistent handling of boundary conditions
Product: z_Archived Reporter: Otmar Caduff <otmar.caduff>
Component: ScoutAssignee: Project Inbox <scout.core-inbox>
Status: CLOSED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: mvi, stephan.leichtvogt, zimmermann
Version: unspecifiedFlags: zimmermann: juno+
Target Milestone: ---   
Hardware: PC   
OS: Windows 7   
Whiteboard:
Attachments:
Description Flags
Scout Application to reproduce the bug.
none
Possible patch.
none
Possible patch 2.
zimmermann: iplog+
Patch that handles boundaries for PLANNING_MODE_DAY and PLANNING_MODE_WEEK correctly mvi: iplog+

Description Otmar Caduff CLA 2011-07-24 12:39:33 EDT
Build Identifier: 

When using an AbstractPlannerField with PLANNING_MODE_WEEK, the following time ranges are not shown correctly:
- A time range having the same start and end date and occurring on the first day displayed in the AbstractPlannerField -> The week is not marked appropriately.
- A time range of at least two days, whose end date is the first day of a second week -> The second week is not marked appropriately.


Reproducible: Always

Steps to Reproduce:
The attached scout application (ZIP file of the workspace) reproduces the failure (red marked rows).
The attached patch solves this issue. However, this patch was made with only PLANNING_MODE_WEEK in mind, not other planning modes. Different implementations of the method org.eclipse.scout.rt.client.ui.basic.activitymap.TimeScale.getRangeOf(Date, Date) for differend planning modes might make sense.
Comment 1 Otmar Caduff CLA 2011-07-24 12:42:26 EDT
Created attachment 200243 [details]
Scout Application to reproduce the bug.
Comment 2 Otmar Caduff CLA 2011-07-24 12:43:01 EDT
Created attachment 200244 [details]
Possible patch.
Comment 3 Stephan Leicht Vogt CLA 2011-07-26 09:15:54 EDT
Fixed and commited to branch 2011-Jun for the release 3.7.1 and to trunk for release 3.8.0.
Comment 4 Stephan Leicht Vogt CLA 2011-07-29 04:54:41 EDT
I had to revert this changes. The Display was correct with this patch, but try to select one week. It does not work. Please correct it. If you need help, we can look over this bug together.
Comment 5 Otmar Caduff CLA 2011-08-04 02:01:25 EDT
We came to the conclusion that we can not fix the problem with the attatched patch, because it also affects the behaviour of the selection box. As a workaround, we came to the conclusion that the client has to provide the data for the planner field such that the information is displayed correctly. However, this is not a viable solution in the long run; the concerned code (AbstractPlannerField/TimeScale/TimeScaleBuilder) should be redesigned.
Comment 6 Otmar Caduff CLA 2011-09-01 04:11:14 EDT
Created attachment 202591 [details]
Possible patch 2.

Patch contains both a proposed fix and a test form.
Comment 7 Stephan Leicht Vogt CLA 2011-09-02 06:33:37 EDT
Committed patch to trunk for release 3.8.0.
Comment 8 Ken Lee CLA 2012-02-10 10:15:54 EST
Created attachment 210856 [details]
Patch that handles boundaries for PLANNING_MODE_DAY and PLANNING_MODE_WEEK correctly

When using modes PLANNING_MODE_DAY or PLANNING_MODE_WEEK the selected columns are not handled correctly due to the used values at the end boundaries of the MinorColunns.
During construction of a MinorColumn, 1ms is subtracted from the end boundary. When fetching the column index for a given end time, it has to be checked if the given end time fits into the begin and end time interval of the column. Otherwise, the previous column has to be returned.
Comment 9 Matthias Villiger CLA 2012-02-14 17:30:57 EST
patch applied for Juno. thank you Ken!
Comment 10 Matthias Zimmermann CLA 2012-05-23 11:09:23 EDT
Comment on attachment 202591 [details]
Possible patch 2.

added iplog flag for this patch
Comment 11 Matthias Zimmermann CLA 2012-07-09 06:49:50 EDT
ticket closed.
deliverd as part of eclipse scout 3.8.0 (juno release train)