Included in the interface new settings to enable automatic budgeting and the type of hour to use on it

FEA: ItEr77S17AutomaticBudgeting
This commit is contained in:
Lorenzo Tilve Álvaro 2013-06-06 21:06:25 +02:00
parent 2b4ac1c3ed
commit 024f30ab0b
5 changed files with 47 additions and 0 deletions

View file

@ -476,6 +476,14 @@ public class Configuration extends BaseEntity {
personalTimesheetsTypeOfWorkHours = typeOfWorkHours;
}
public TypeOfWorkHours getBudgetDefaultTypeOfWorkHours() {
return personalTimesheetsTypeOfWorkHours;
}
public void setBudgetDefaultTypeOfWorkHours(TypeOfWorkHours typeOfWorkHours) {
personalTimesheetsTypeOfWorkHours = typeOfWorkHours;
}
public PersonalTimesheetsPeriodicityEnum getPersonalTimesheetsPeriodicity() {
return personalTimesheetsPeriodicity;
}

View file

@ -1002,6 +1002,14 @@ public class ConfigurationController extends GenericForwardComposer {
configurationModel.setPersonalTimesheetsTypeOfWorkHours(typeOfWorkHours);
}
public TypeOfWorkHours getBudgetDefaultTypeOfWorkHours() {
return configurationModel.getBudgetDefaultTypeOfWorkHours();
}
public void setBudgetDefaultTypeOfWorkHours(TypeOfWorkHours typeOfWorkHours) {
configurationModel.setBudgetDefaultTypeOfWorkHours(typeOfWorkHours);
}
public List<PersonalTimesheetsPeriodicityEnum> getPersonalTimesheetsPeriodicities() {
return Arrays.asList(PersonalTimesheetsPeriodicityEnum.values());
}

View file

@ -161,6 +161,7 @@ public class ConfigurationModel implements IConfigurationModel {
private void forceLoad(Configuration configuration) {
forceLoad(configuration.getDefaultCalendar());
forceLoad(configuration.getPersonalTimesheetsTypeOfWorkHours());
forceLoad(configuration.getBudgetDefaultTypeOfWorkHours());
}
private void forceLoad(BaseCalendar calendar) {
@ -721,4 +722,15 @@ public class ConfigurationModel implements IConfigurationModel {
return jobSchedulerModel.scheduleOrUnscheduleJobs(connector);
}
@Override
public TypeOfWorkHours getBudgetDefaultTypeOfWorkHours() {
return configuration.getBudgetDefaultTypeOfWorkHours();
}
@Override
public void setBudgetDefaultTypeOfWorkHours(TypeOfWorkHours typeOfWorkHours) {
if (configuration != null) {
configuration.setBudgetDefaultTypeOfWorkHours(typeOfWorkHours);
}
}
}

View file

@ -192,4 +192,8 @@ public interface IConfigurationModel {
boolean scheduleOrUnscheduleJobs(Connector connector);
TypeOfWorkHours getBudgetDefaultTypeOfWorkHours();
void setBudgetDefaultTypeOfWorkHours(TypeOfWorkHours typeOfWorkHours);
}

View file

@ -210,6 +210,21 @@
label="${i18n:_('MonteCarlo method')}"
checked="@{configurationController.monteCarloMethodTabVisible}" />
</row>
<!-- Automatic budget -->
<row>
<label
value="${i18n:_('Automatic budget')}" />
<hbox>
<label
value="${i18n:_('Hours type')}" />
<bandboxSearch
finder="TypeOfWorkHoursBandboxFinder"
selectedElement="@{configurationController.budgetDefaultTypeOfWorkHours, access='both'}" />
<checkbox
label="${i18n:_('calculate based on task criteria and cost categories')}"
checked="@{configurationController.enabledAutomaticBudget}" />
</hbox>
</row>
<row>
<label
value="${i18n:_('Seconds planning warning')}" />