Added to configuration class accessors for automatic budget properties

FEA: ItEr77S17AutomaticBudgeting
This commit is contained in:
Lorenzo Tilve Álvaro 2013-06-06 21:18:48 +02:00
parent 024f30ab0b
commit 15883806f5
5 changed files with 52 additions and 11 deletions

View file

@ -116,6 +116,10 @@ public class Configuration extends BaseEntity {
private Integer secondsPlanningWarning = 30; private Integer secondsPlanningWarning = 30;
private TypeOfWorkHours budgetDefaultTypeOfWorkHours;
private Boolean enabledAutomaticBudget = false;
/** /**
* Maximum users configurable directly in database for SaaS products. If * Maximum users configurable directly in database for SaaS products. If
* zero it means that there isn't any limitation. * zero it means that there isn't any limitation.
@ -128,6 +132,7 @@ public class Configuration extends BaseEntity {
*/ */
private Integer maxResources = 0; private Integer maxResources = 0;
public void setDefaultCalendar(BaseCalendar defaultCalendar) { public void setDefaultCalendar(BaseCalendar defaultCalendar) {
this.defaultCalendar = defaultCalendar; this.defaultCalendar = defaultCalendar;
} }
@ -477,11 +482,11 @@ public class Configuration extends BaseEntity {
} }
public TypeOfWorkHours getBudgetDefaultTypeOfWorkHours() { public TypeOfWorkHours getBudgetDefaultTypeOfWorkHours() {
return personalTimesheetsTypeOfWorkHours; return budgetDefaultTypeOfWorkHours;
} }
public void setBudgetDefaultTypeOfWorkHours(TypeOfWorkHours typeOfWorkHours) { public void setBudgetDefaultTypeOfWorkHours(TypeOfWorkHours typeOfWorkHours) {
personalTimesheetsTypeOfWorkHours = typeOfWorkHours; budgetDefaultTypeOfWorkHours = typeOfWorkHours;
} }
public PersonalTimesheetsPeriodicityEnum getPersonalTimesheetsPeriodicity() { public PersonalTimesheetsPeriodicityEnum getPersonalTimesheetsPeriodicity() {
@ -511,4 +516,12 @@ public class Configuration extends BaseEntity {
this.secondsPlanningWarning = secondsPlanningWarning; this.secondsPlanningWarning = secondsPlanningWarning;
} }
public Boolean isEnabledAutomaticBudget() {
return enabledAutomaticBudget;
}
public void setEnabledAutomaticBudget(Boolean enabledAutomaticBudget) {
this.enabledAutomaticBudget = enabledAutomaticBudget;
}
} }

View file

@ -1010,6 +1010,14 @@ public class ConfigurationController extends GenericForwardComposer {
configurationModel.setBudgetDefaultTypeOfWorkHours(typeOfWorkHours); configurationModel.setBudgetDefaultTypeOfWorkHours(typeOfWorkHours);
} }
public Boolean getEnabledAutomaticBudget() {
return configurationModel.getEnabledAutomaticBudget();
}
public void setEnabledAutomaticBudget(Boolean enabledAutomaticBudget) {
configurationModel.setEnabledAutomaticBudget(enabledAutomaticBudget);
}
public List<PersonalTimesheetsPeriodicityEnum> getPersonalTimesheetsPeriodicities() { public List<PersonalTimesheetsPeriodicityEnum> getPersonalTimesheetsPeriodicities() {
return Arrays.asList(PersonalTimesheetsPeriodicityEnum.values()); return Arrays.asList(PersonalTimesheetsPeriodicityEnum.values());
} }

View file

@ -733,4 +733,20 @@ public class ConfigurationModel implements IConfigurationModel {
configuration.setBudgetDefaultTypeOfWorkHours(typeOfWorkHours); configuration.setBudgetDefaultTypeOfWorkHours(typeOfWorkHours);
} }
} }
@Override
public Boolean getEnabledAutomaticBudget() {
if (configuration == null) {
return null;
}
return (configuration.isEnabledAutomaticBudget());
}
@Override
public void setEnabledAutomaticBudget(Boolean enabledAutomaticBudget) {
if (configuration != null) {
configuration.setEnabledAutomaticBudget(enabledAutomaticBudget);
}
}
} }

View file

@ -196,4 +196,8 @@ public interface IConfigurationModel {
void setBudgetDefaultTypeOfWorkHours(TypeOfWorkHours typeOfWorkHours); void setBudgetDefaultTypeOfWorkHours(TypeOfWorkHours typeOfWorkHours);
Boolean getEnabledAutomaticBudget();
void setEnabledAutomaticBudget(Boolean enabledAutomaticBudget);
} }

View file

@ -214,16 +214,16 @@
<row> <row>
<label <label
value="${i18n:_('Automatic budget')}" /> value="${i18n:_('Automatic budget')}" />
<hbox> <hbox align="pack">
<label <label
value="${i18n:_('Hours type')}" /> value="${i18n:_('Hours type')}" />
<bandboxSearch <bandboxSearch
finder="TypeOfWorkHoursBandboxFinder" finder="TypeOfWorkHoursBandboxFinder"
selectedElement="@{configurationController.budgetDefaultTypeOfWorkHours, access='both'}" /> selectedElement="@{configurationController.budgetDefaultTypeOfWorkHours, access='both'}" />
<checkbox <checkbox
label="${i18n:_('calculate based on task criteria and cost categories')}" label="${i18n:_('calculate based on task criteria and cost categories')}"
checked="@{configurationController.enabledAutomaticBudget}" /> checked="@{configurationController.enabledAutomaticBudget}" />
</hbox> </hbox>
</row> </row>
<row> <row>
<label <label