From c82df5175c60b841c29369d419ca3df49ca1389b Mon Sep 17 00:00:00 2001 From: Ignacio Diaz Teijido Date: Tue, 14 Feb 2012 18:19:03 +0100 Subject: [PATCH] Bug #1348: Added effort to predefined calendar exception types FEA: ItEr76S04BugFixing --- .../PredefinedCalendarExceptionTypes.java | 20 +++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/libreplan-business/src/main/java/org/libreplan/business/calendars/entities/PredefinedCalendarExceptionTypes.java b/libreplan-business/src/main/java/org/libreplan/business/calendars/entities/PredefinedCalendarExceptionTypes.java index d25442180..19c8ac945 100644 --- a/libreplan-business/src/main/java/org/libreplan/business/calendars/entities/PredefinedCalendarExceptionTypes.java +++ b/libreplan-business/src/main/java/org/libreplan/business/calendars/entities/PredefinedCalendarExceptionTypes.java @@ -21,6 +21,7 @@ package org.libreplan.business.calendars.entities; +import org.libreplan.business.workingday.EffortDuration; /** * Defines the default {@link CalendarExceptionType}. @@ -29,19 +30,26 @@ package org.libreplan.business.calendars.entities; */ public enum PredefinedCalendarExceptionTypes { - RESOURCE_HOLIDAY("RESOURCE_HOLIDAY", CalendarExceptionTypeColor.YELLOW, true), - LEAVE("LEAVE", CalendarExceptionTypeColor.MAGENTA, true), - STRIKE("STRIKE", CalendarExceptionTypeColor.PURPLE, true), - BANK_HOLIDAY("BANK_HOLIDAY", CalendarExceptionTypeColor.DEFAULT, true), - HALF_DAY_HOLIDAY("HALF_DAY_HOLIDAY", CalendarExceptionTypeColor.ORANGE, false); + RESOURCE_HOLIDAY("RESOURCE_HOLIDAY", CalendarExceptionTypeColor.YELLOW, true, + EffortDuration.zero()), + LEAVE("LEAVE", CalendarExceptionTypeColor.MAGENTA, true, + EffortDuration.zero()), + STRIKE("STRIKE", CalendarExceptionTypeColor.PURPLE, true, + EffortDuration.zero()), + BANK_HOLIDAY("BANK_HOLIDAY", CalendarExceptionTypeColor.DEFAULT, true, + EffortDuration.zero()), + HALF_DAY_HOLIDAY("HALF_DAY_HOLIDAY", CalendarExceptionTypeColor.ORANGE, false, + EffortDuration.hours(4)); private CalendarExceptionType calendarExceptionType; private PredefinedCalendarExceptionTypes(String name, - CalendarExceptionTypeColor color, Boolean notAssignable) { + CalendarExceptionTypeColor color, Boolean notAssignable, + EffortDuration duration) { // Using the name as code in order to be more human friendly calendarExceptionType = CalendarExceptionType.create(name, name, color, notAssignable); + calendarExceptionType.setDuration(duration); } public CalendarExceptionType getCalendarExceptionType() {