Merge pull request #2 from lmann99/add-planner-view-user-preferences
Add to user preferences ability to set default show/hide button state
This commit is contained in:
commit
de6f27c6fd
16 changed files with 516 additions and 23 deletions
|
|
@ -243,6 +243,8 @@ public class FunctionalityExposedForExtensions<T> implements IContext<T> {
|
||||||
result.setShowingReportedHours(planner.showReportedHoursRightNow());
|
result.setShowingReportedHours(planner.showReportedHoursRightNow());
|
||||||
result.setShowingMoneyCostBar(planner.showMoneyCostBarRightNow());
|
result.setShowingMoneyCostBar(planner.showMoneyCostBarRightNow());
|
||||||
result.setShowingAdvances(planner.showAdvancesRightNow());
|
result.setShowingAdvances(planner.showAdvancesRightNow());
|
||||||
|
result.setShowingLabels(planner.showLabelsRightNow());
|
||||||
|
result.setShowingResources(planner.showResourcesRightNow());
|
||||||
|
|
||||||
mapper.register(position, result, data);
|
mapper.register(position, result, data);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -156,6 +156,10 @@ public class Planner extends HtmlMacroComponent {
|
||||||
|
|
||||||
private boolean shownMoneyCostBarByDefault = false;
|
private boolean shownMoneyCostBarByDefault = false;
|
||||||
|
|
||||||
|
private boolean shownLabelsByDefault = false;
|
||||||
|
|
||||||
|
private boolean shownResourcesByDefault = false;
|
||||||
|
|
||||||
private FilterAndParentExpandedPredicates predicate;
|
private FilterAndParentExpandedPredicates predicate;
|
||||||
|
|
||||||
private boolean visibleChart;
|
private boolean visibleChart;
|
||||||
|
|
@ -430,6 +434,27 @@ public class Planner extends HtmlMacroComponent {
|
||||||
showMoneyCostBarButton.setVisible(false);
|
showMoneyCostBarButton.setVisible(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// view buttons toggle state so set all off prior to toggling
|
||||||
|
if ( configuration.isShowResourcesOn() ) {
|
||||||
|
showAllResources();
|
||||||
|
}
|
||||||
|
|
||||||
|
if ( configuration.isShowAdvancesOn() ) {
|
||||||
|
showAdvances();
|
||||||
|
}
|
||||||
|
|
||||||
|
if ( configuration.isShowReportedHoursOn() ) {
|
||||||
|
showReportedHours();
|
||||||
|
}
|
||||||
|
|
||||||
|
if ( configuration.isShowLabelsOn() ) {
|
||||||
|
showAllLabels();
|
||||||
|
}
|
||||||
|
|
||||||
|
if ( configuration.isShowMoneyCostBarOn() ) {
|
||||||
|
showMoneyCostBar();
|
||||||
|
}
|
||||||
|
|
||||||
listZoomLevels.setSelectedIndex(getZoomLevel().ordinal());
|
listZoomLevels.setSelectedIndex(getZoomLevel().ordinal());
|
||||||
|
|
||||||
this.visibleChart = configuration.isExpandPlanningViewCharts();
|
this.visibleChart = configuration.isExpandPlanningViewCharts();
|
||||||
|
|
@ -656,7 +681,6 @@ public class Planner extends HtmlMacroComponent {
|
||||||
public void showReportedHours() {
|
public void showReportedHours() {
|
||||||
Button showReportedHoursButton = (Button) getFellow("showReportedHours");
|
Button showReportedHoursButton = (Button) getFellow("showReportedHours");
|
||||||
if ( disabilityConfiguration.isReportedHoursEnabled() ) {
|
if ( disabilityConfiguration.isReportedHoursEnabled() ) {
|
||||||
|
|
||||||
if ( isShowingReportedHours ) {
|
if ( isShowingReportedHours ) {
|
||||||
context.hideReportedHours();
|
context.hideReportedHours();
|
||||||
diagramGraph.removePostGraphChangeListener(showReportedHoursOnChange);
|
diagramGraph.removePostGraphChangeListener(showReportedHoursOnChange);
|
||||||
|
|
@ -694,28 +718,33 @@ public class Planner extends HtmlMacroComponent {
|
||||||
|
|
||||||
public void showAllLabels() {
|
public void showAllLabels() {
|
||||||
Button showAllLabelsButton = (Button) getFellow("showAllLabels");
|
Button showAllLabelsButton = (Button) getFellow("showAllLabels");
|
||||||
if ( isShowingLabels ) {
|
if ( disabilityConfiguration.isLabelsEnabled() ) {
|
||||||
Clients.evalJavaScript("ganttz.TaskList.getInstance().hideAllTaskLabels()");
|
if ( isShowingLabels ) {
|
||||||
showAllLabelsButton.setSclass("planner-command show-labels");
|
Clients.evalJavaScript("ganttz.TaskList.getInstance().hideAllTaskLabels()");
|
||||||
} else {
|
showAllLabelsButton.setSclass("planner-command show-labels");
|
||||||
Clients.evalJavaScript("ganttz.TaskList.getInstance().showAllTaskLabels()");
|
} else {
|
||||||
showAllLabelsButton.setSclass("planner-command show-labels clicked");
|
Clients.evalJavaScript("ganttz.TaskList.getInstance().showAllTaskLabels()");
|
||||||
}
|
showAllLabelsButton.setSclass("planner-command show-labels clicked");
|
||||||
|
}
|
||||||
|
|
||||||
isShowingLabels = !isShowingLabels;
|
isShowingLabels = !isShowingLabels;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void showAllResources() {
|
public void showAllResources() {
|
||||||
Button showAllLabelsButton = (Button) getFellow("showAllResources");
|
Button showAllLabelsButton = (Button) getFellow("showAllResources");
|
||||||
if ( isShowingResources ) {
|
if ( disabilityConfiguration.isResourcesEnabled() ) {
|
||||||
Clients.evalJavaScript("ganttz.TaskList.getInstance().hideResourceTooltips()");
|
if ( isShowingResources ) {
|
||||||
showAllLabelsButton.setSclass("planner-command show-resources");
|
Clients.evalJavaScript("ganttz.TaskList.getInstance().hideResourceTooltips()");
|
||||||
} else {
|
showAllLabelsButton.setSclass("planner-command show-resources");
|
||||||
Clients.evalJavaScript("ganttz.TaskList.getInstance().showResourceTooltips()");
|
} else {
|
||||||
showAllLabelsButton.setSclass("planner-command show-resources clicked");
|
Clients.evalJavaScript("ganttz.TaskList.getInstance().showResourceTooltips()");
|
||||||
}
|
showAllLabelsButton.setSclass("planner-command show-resources clicked");
|
||||||
|
}
|
||||||
|
|
||||||
isShowingResources = !isShowingResources;
|
isShowingResources = !isShowingResources;
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void print() {
|
public void print() {
|
||||||
|
|
@ -752,7 +781,6 @@ public class Planner extends HtmlMacroComponent {
|
||||||
|
|
||||||
public void setAreShownAdvancesByDefault(boolean shownAdvanceByDefault) {
|
public void setAreShownAdvancesByDefault(boolean shownAdvanceByDefault) {
|
||||||
this.shownAdvanceByDefault = shownAdvanceByDefault;
|
this.shownAdvanceByDefault = shownAdvanceByDefault;
|
||||||
this.isShowingAdvances = shownAdvanceByDefault;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setAreShownReportedHoursByDefault(boolean shownReportedHoursByDefault) {
|
public void setAreShownReportedHoursByDefault(boolean shownReportedHoursByDefault) {
|
||||||
|
|
@ -779,6 +807,30 @@ public class Planner extends HtmlMacroComponent {
|
||||||
return areShownMoneyCostBarByDefault() || isShowingMoneyCostBar;
|
return areShownMoneyCostBarByDefault() || isShowingMoneyCostBar;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void setAreShownLabelsByDefault(boolean shownLabelsByDefault) {
|
||||||
|
this.shownLabelsByDefault = shownLabelsByDefault;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean areShownLabelsByDefault() {
|
||||||
|
return shownLabelsByDefault;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean showLabelsRightNow() {
|
||||||
|
return areShownLabelsByDefault() || isShowingLabels;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setAreShownResourcesByDefault(boolean shownResourcesByDefault) {
|
||||||
|
this.shownResourcesByDefault = shownResourcesByDefault;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean areShownResourcesByDefault() {
|
||||||
|
return shownResourcesByDefault;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean showResourcesRightNow() {
|
||||||
|
return areShownResourcesByDefault() || isShowingResources;
|
||||||
|
}
|
||||||
|
|
||||||
public void expandAll() {
|
public void expandAll() {
|
||||||
Button expandAllButton = (Button) getFellow(EXPAND_ALL_BUTTON);
|
Button expandAllButton = (Button) getFellow(EXPAND_ALL_BUTTON);
|
||||||
if ( disabilityConfiguration.isExpandAllEnabled() ) {
|
if ( disabilityConfiguration.isExpandAllEnabled() ) {
|
||||||
|
|
|
||||||
|
|
@ -42,6 +42,10 @@ public interface IDisabilityConfiguration {
|
||||||
|
|
||||||
public boolean isMoneyCostBarEnabled();
|
public boolean isMoneyCostBarEnabled();
|
||||||
|
|
||||||
|
public boolean isLabelsEnabled();
|
||||||
|
|
||||||
|
public boolean isResourcesEnabled();
|
||||||
|
|
||||||
public boolean isExpandAllEnabled();
|
public boolean isExpandAllEnabled();
|
||||||
|
|
||||||
public boolean isFlattenTreeEnabled();
|
public boolean isFlattenTreeEnabled();
|
||||||
|
|
|
||||||
|
|
@ -157,6 +157,10 @@ public class PlannerConfiguration<T> implements IDisabilityConfiguration {
|
||||||
|
|
||||||
private boolean moneyCostBarEnabled = true;
|
private boolean moneyCostBarEnabled = true;
|
||||||
|
|
||||||
|
private boolean labelsEnabled = true;
|
||||||
|
|
||||||
|
private boolean ResourcesEnabled = true;
|
||||||
|
|
||||||
private boolean expandAllEnabled = true;
|
private boolean expandAllEnabled = true;
|
||||||
|
|
||||||
private boolean flattenTreeEnabled = true;
|
private boolean flattenTreeEnabled = true;
|
||||||
|
|
@ -167,6 +171,16 @@ public class PlannerConfiguration<T> implements IDisabilityConfiguration {
|
||||||
|
|
||||||
private boolean treeEditable = true;
|
private boolean treeEditable = true;
|
||||||
|
|
||||||
|
private boolean showResourcesOn = false;
|
||||||
|
|
||||||
|
private boolean showAdvancesOn = false;
|
||||||
|
|
||||||
|
private boolean showReportedHoursOn = false;
|
||||||
|
|
||||||
|
private boolean showLabelsOn = false;
|
||||||
|
|
||||||
|
private boolean showMoneyCostBarOn = false;
|
||||||
|
|
||||||
private IDetailItemModifier firstLevelModifiers = SeveralModifiers.empty();
|
private IDetailItemModifier firstLevelModifiers = SeveralModifiers.empty();
|
||||||
|
|
||||||
private IDetailItemModifier secondLevelModifiers = SeveralModifiers.empty();
|
private IDetailItemModifier secondLevelModifiers = SeveralModifiers.empty();
|
||||||
|
|
@ -355,6 +369,24 @@ public class PlannerConfiguration<T> implements IDisabilityConfiguration {
|
||||||
return moneyCostBarEnabled;
|
return moneyCostBarEnabled;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void setLabelsEnabled(boolean labelsEnabled) {
|
||||||
|
this.labelsEnabled = labelsEnabled;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean isLabelsEnabled() {
|
||||||
|
return labelsEnabled;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setResourcesEnabled(boolean ResourcesEnabled) {
|
||||||
|
this.ResourcesEnabled = ResourcesEnabled;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean isResourcesEnabled() {
|
||||||
|
return ResourcesEnabled;
|
||||||
|
}
|
||||||
|
|
||||||
public void setExpandAllEnabled(boolean expandAllEnabled) {
|
public void setExpandAllEnabled(boolean expandAllEnabled) {
|
||||||
this.expandAllEnabled = expandAllEnabled;
|
this.expandAllEnabled = expandAllEnabled;
|
||||||
}
|
}
|
||||||
|
|
@ -495,4 +527,44 @@ public class PlannerConfiguration<T> implements IDisabilityConfiguration {
|
||||||
this.scheduleBackwards = scheduleBackwards;
|
this.scheduleBackwards = scheduleBackwards;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean isShowResourcesOn() {
|
||||||
|
return showResourcesOn;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setShowResourcesOn(boolean showResourcesOn) {
|
||||||
|
this.showResourcesOn = showResourcesOn;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isShowAdvancesOn() {
|
||||||
|
return showAdvancesOn;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setShowAdvancesOn(boolean showAdvancesOn) {
|
||||||
|
this.showAdvancesOn = showAdvancesOn;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isShowReportedHoursOn() {
|
||||||
|
return showReportedHoursOn;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setShowReportedHoursOn(boolean showReportedHoursOn) {
|
||||||
|
this.showReportedHoursOn = showReportedHoursOn;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isShowLabelsOn() {
|
||||||
|
return showLabelsOn;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setShowLabelsOn(boolean showLabelsOn) {
|
||||||
|
this.showLabelsOn = showLabelsOn;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isShowMoneyCostBarOn() {
|
||||||
|
return showMoneyCostBarOn;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setShowMoneyCostBarOn(boolean showMoneyCostBarOn) {
|
||||||
|
this.showMoneyCostBarOn = showMoneyCostBarOn;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -73,6 +73,10 @@ public abstract class Task implements ITaskFundamentalProperties {
|
||||||
|
|
||||||
private PropertyChangeSupport moneyCostBarProperty = new PropertyChangeSupport(this);
|
private PropertyChangeSupport moneyCostBarProperty = new PropertyChangeSupport(this);
|
||||||
|
|
||||||
|
private PropertyChangeSupport labelsProperty = new PropertyChangeSupport(this);
|
||||||
|
|
||||||
|
private PropertyChangeSupport resourcesProperty = new PropertyChangeSupport(this);
|
||||||
|
|
||||||
private final ITaskFundamentalProperties fundamentalProperties;
|
private final ITaskFundamentalProperties fundamentalProperties;
|
||||||
|
|
||||||
private boolean visible = true;
|
private boolean visible = true;
|
||||||
|
|
@ -85,6 +89,10 @@ public abstract class Task implements ITaskFundamentalProperties {
|
||||||
|
|
||||||
private boolean showingMoneyCostBar = false;
|
private boolean showingMoneyCostBar = false;
|
||||||
|
|
||||||
|
private boolean showingLabels = false;
|
||||||
|
|
||||||
|
private boolean showingResources = false;
|
||||||
|
|
||||||
private ConstraintViolationNotificator<GanttDate> violationNotificator = ConstraintViolationNotificator.create();
|
private ConstraintViolationNotificator<GanttDate> violationNotificator = ConstraintViolationNotificator.create();
|
||||||
|
|
||||||
private IDependenciesEnforcerHook dependenciesEnforcerHook = GanttDiagramGraph.doNothingHook();
|
private IDependenciesEnforcerHook dependenciesEnforcerHook = GanttDiagramGraph.doNothingHook();
|
||||||
|
|
@ -231,6 +239,26 @@ public abstract class Task implements ITaskFundamentalProperties {
|
||||||
return showingMoneyCostBar;
|
return showingMoneyCostBar;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void setShowingResources(boolean showingResources) {
|
||||||
|
boolean previousValue = this.showingResources;
|
||||||
|
this.showingResources = showingResources;
|
||||||
|
resourcesProperty.firePropertyChange("showingResources", previousValue, this.showingResources);
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isShowingResources() {
|
||||||
|
return showingResources;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setShowingLabels(boolean showingLabels) {
|
||||||
|
boolean previousValue = this.showingLabels;
|
||||||
|
this.showingLabels = showingLabels;
|
||||||
|
labelsProperty.firePropertyChange("showingLabels", previousValue, this.showingLabels);
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isShowingLabels() {
|
||||||
|
return showingLabels;
|
||||||
|
}
|
||||||
|
|
||||||
public String getName() {
|
public String getName() {
|
||||||
return fundamentalProperties.getName();
|
return fundamentalProperties.getName();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -99,6 +99,16 @@ public class User extends BaseEntity implements IHumanIdentifiable{
|
||||||
|
|
||||||
private Integer resourcesLoadFilterPeriodTo;
|
private Integer resourcesLoadFilterPeriodTo;
|
||||||
|
|
||||||
|
private boolean showResourcesOn = false;
|
||||||
|
|
||||||
|
private boolean showAdvancesOn = false;
|
||||||
|
|
||||||
|
private boolean showReportedHoursOn = false;
|
||||||
|
|
||||||
|
private boolean showLabelsOn = false;
|
||||||
|
|
||||||
|
private boolean showMoneyCostBarOn = false;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Necessary for Hibernate. Please, do not call it.
|
* Necessary for Hibernate. Please, do not call it.
|
||||||
*/
|
*/
|
||||||
|
|
@ -450,4 +460,44 @@ public class User extends BaseEntity implements IHumanIdentifiable{
|
||||||
resourcesLoadFilterPeriodTo = period;
|
resourcesLoadFilterPeriodTo = period;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean isShowResourcesOn() {
|
||||||
|
return showResourcesOn;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setShowResourcesOn(boolean showResourcesOn) {
|
||||||
|
this.showResourcesOn = showResourcesOn;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isShowAdvancesOn() {
|
||||||
|
return showAdvancesOn;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setShowAdvancesOn(boolean showAdvancesOn) {
|
||||||
|
this.showAdvancesOn = showAdvancesOn;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isShowReportedHoursOn() {
|
||||||
|
return showReportedHoursOn;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setShowReportedHoursOn(boolean showReportedHoursOn) {
|
||||||
|
this.showReportedHoursOn = showReportedHoursOn;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isShowLabelsOn() {
|
||||||
|
return showLabelsOn;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setShowLabelsOn(boolean showLabelsOn) {
|
||||||
|
this.showLabelsOn = showLabelsOn;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isShowMoneyCostBarOn() {
|
||||||
|
return showMoneyCostBarOn;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setShowMoneyCostBarOn(boolean showMoneyCostBarOn) {
|
||||||
|
this.showMoneyCostBarOn = showMoneyCostBarOn;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
92
libreplan-business/src/main/resources/db.changelog-1.6.xml
Normal file
92
libreplan-business/src/main/resources/db.changelog-1.6.xml
Normal file
|
|
@ -0,0 +1,92 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<databaseChangeLog xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
|
||||||
|
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
|
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog
|
||||||
|
http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.1.xsd">
|
||||||
|
|
||||||
|
<changeSet id="add-new-column-show-reported-hours" author="lmann">
|
||||||
|
<comment>Add columns to store user default setting of show/hide reported hours button</comment>
|
||||||
|
<addColumn tableName="user_table">
|
||||||
|
<column name="show_reported_hours_on" type="BOOLEAN" />
|
||||||
|
</addColumn>
|
||||||
|
</changeSet>
|
||||||
|
|
||||||
|
<changeSet id="add-new-columns-show-resources" author="lmann">
|
||||||
|
<comment>Add columns to store user default setting of show/hide resources button</comment>
|
||||||
|
<addColumn tableName="user_table">
|
||||||
|
<column name="show_resources_on" type="BOOLEAN" />
|
||||||
|
</addColumn>
|
||||||
|
</changeSet>
|
||||||
|
|
||||||
|
<changeSet id="add-new-columns-show-advances" author="lmann">
|
||||||
|
<comment>Add columns to store user default setting of show/hide advances button</comment>
|
||||||
|
<addColumn tableName="user_table">
|
||||||
|
<column name="show_advances_on" type="BOOLEAN" />
|
||||||
|
</addColumn>
|
||||||
|
</changeSet>
|
||||||
|
|
||||||
|
<changeSet id="add-new-columns-show-labels" author="lmann">
|
||||||
|
<comment>Add columns to store user default setting of show/hide labels button</comment>
|
||||||
|
<addColumn tableName="user_table">
|
||||||
|
<column name="show_labels_on" type="BOOLEAN" />
|
||||||
|
</addColumn>
|
||||||
|
</changeSet>
|
||||||
|
|
||||||
|
<changeSet id="add-new-columns-show-moneycostbar" author="lmann">
|
||||||
|
<comment>Add columns to store user default setting of show/hide moneycostbar button</comment>
|
||||||
|
<addColumn tableName="user_table">
|
||||||
|
<column name="show_money_cost_bar_on" type="BOOLEAN" />
|
||||||
|
</addColumn>
|
||||||
|
</changeSet>
|
||||||
|
|
||||||
|
<changeSet id="set-default-value-show-reported-hours" author="lmann">
|
||||||
|
<addDefaultValue tableName="user_table"
|
||||||
|
columnName="show_reported_hours_on"
|
||||||
|
defaultValueBoolean="FALSE" />
|
||||||
|
<addNotNullConstraint tableName="user_table"
|
||||||
|
columnName="show_reported_hours_on"
|
||||||
|
defaultNullValue="FALSE"
|
||||||
|
columnDataType="BOOLEAN" />
|
||||||
|
</changeSet>
|
||||||
|
|
||||||
|
<changeSet id="set-default-value-show-resources" author="lmann">
|
||||||
|
<addDefaultValue tableName="user_table"
|
||||||
|
columnName="show_resources_on"
|
||||||
|
defaultValueBoolean="FALSE" />
|
||||||
|
<addNotNullConstraint tableName="user_table"
|
||||||
|
columnName="show_resources_on"
|
||||||
|
defaultNullValue="FALSE"
|
||||||
|
columnDataType="BOOLEAN" />
|
||||||
|
</changeSet>
|
||||||
|
|
||||||
|
<changeSet id="set-default-value-show-advances" author="lmann">
|
||||||
|
<addDefaultValue tableName="user_table"
|
||||||
|
columnName="show_advances_on"
|
||||||
|
defaultValueBoolean="FALSE" />
|
||||||
|
<addNotNullConstraint tableName="user_table"
|
||||||
|
columnName="show_advances_on"
|
||||||
|
defaultNullValue="FALSE"
|
||||||
|
columnDataType="BOOLEAN" />
|
||||||
|
</changeSet>
|
||||||
|
|
||||||
|
<changeSet id="set-default-value-show-labels" author="lmann">
|
||||||
|
<addDefaultValue tableName="user_table"
|
||||||
|
columnName="show_labels_on"
|
||||||
|
defaultValueBoolean="FALSE" />
|
||||||
|
<addNotNullConstraint tableName="user_table"
|
||||||
|
columnName="show_labels_on"
|
||||||
|
defaultNullValue="FALSE"
|
||||||
|
columnDataType="BOOLEAN" />
|
||||||
|
</changeSet>
|
||||||
|
|
||||||
|
<changeSet id="set-default-value-show-money_cost_bar" author="lmann">
|
||||||
|
<addDefaultValue tableName="user_table"
|
||||||
|
columnName="show_money_cost_bar_on"
|
||||||
|
defaultValueBoolean="FALSE" />
|
||||||
|
<addNotNullConstraint tableName="user_table"
|
||||||
|
columnName="show_money_cost_bar_on"
|
||||||
|
defaultNullValue="FALSE"
|
||||||
|
columnDataType="BOOLEAN" />
|
||||||
|
</changeSet>
|
||||||
|
|
||||||
|
</databaseChangeLog>
|
||||||
|
|
@ -12,4 +12,5 @@
|
||||||
<include file="db.changelog-1.3.xml"/>
|
<include file="db.changelog-1.3.xml"/>
|
||||||
<include file="db.changelog-1.4.xml"/>
|
<include file="db.changelog-1.4.xml"/>
|
||||||
<include file="db.changelog-1.5.xml"/>
|
<include file="db.changelog-1.5.xml"/>
|
||||||
|
<include file="db.changelog-1.6.xml"/>
|
||||||
</databaseChangeLog>
|
</databaseChangeLog>
|
||||||
|
|
|
||||||
|
|
@ -70,6 +70,16 @@
|
||||||
|
|
||||||
<property name="resourcesLoadFilterPeriodTo" column="resources_load_filter_period_to"/>
|
<property name="resourcesLoadFilterPeriodTo" column="resources_load_filter_period_to"/>
|
||||||
|
|
||||||
|
<property name="showResourcesOn" column="show_resources_on"/>
|
||||||
|
|
||||||
|
<property name="showAdvancesOn" column="show_advances_on"/>
|
||||||
|
|
||||||
|
<property name="showReportedHoursOn" column="show_reported_hours_on"/>
|
||||||
|
|
||||||
|
<property name="showLabelsOn" column="show_labels_on"/>
|
||||||
|
|
||||||
|
<property name="showMoneyCostBarOn" column="show_money_cost_bar_on"/>
|
||||||
|
|
||||||
<many-to-one name="projectsFilterLabel" cascade="none" lazy="false" column="projects_filter_label_id" />
|
<many-to-one name="projectsFilterLabel" cascade="none" lazy="false" column="projects_filter_label_id" />
|
||||||
|
|
||||||
<many-to-one name="resourcesLoadFilterCriterion" cascade="none" lazy="false"
|
<many-to-one name="resourcesLoadFilterCriterion" cascade="none" lazy="false"
|
||||||
|
|
|
||||||
|
|
@ -218,6 +218,7 @@ public class CompanyPlanningModel implements ICompanyPlanningModel {
|
||||||
addAdditionalCommands(additional, configuration);
|
addAdditionalCommands(additional, configuration);
|
||||||
addPrintSupport(configuration);
|
addPrintSupport(configuration);
|
||||||
disableSomeFeatures(configuration);
|
disableSomeFeatures(configuration);
|
||||||
|
setDefaultButtonState(configuration,user);
|
||||||
|
|
||||||
planner.setInitialZoomLevel(getZoomLevel(configuration));
|
planner.setInitialZoomLevel(getZoomLevel(configuration));
|
||||||
|
|
||||||
|
|
@ -247,6 +248,23 @@ public class CompanyPlanningModel implements ICompanyPlanningModel {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void setDefaultButtonState(PlannerConfiguration<TaskElement> configuration, User user) {
|
||||||
|
|
||||||
|
// set initial button show mode
|
||||||
|
if ( user.isShowAdvancesOn() ) {
|
||||||
|
configuration.setShowAdvancesOn(user.isShowAdvancesOn());
|
||||||
|
}
|
||||||
|
|
||||||
|
if ( user.isShowReportedHoursOn() ) {
|
||||||
|
configuration.setShowReportedHoursOn(user.isShowReportedHoursOn());
|
||||||
|
}
|
||||||
|
|
||||||
|
if ( user.isShowLabelsOn() ) {
|
||||||
|
configuration.setShowLabelsOn(user.isShowLabelsOn());
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
private ZoomLevel getZoomLevel(PlannerConfiguration<TaskElement> configuration) {
|
private ZoomLevel getZoomLevel(PlannerConfiguration<TaskElement> configuration) {
|
||||||
ZoomLevel sessionZoom = FilterUtils.readZoomLevelCompanyView();
|
ZoomLevel sessionZoom = FilterUtils.readZoomLevelCompanyView();
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -354,6 +354,8 @@ public class OrderPlanningModel implements IOrderPlanningModel {
|
||||||
chartComponent.setHeight("200px");
|
chartComponent.setHeight("200px");
|
||||||
appendTabs(chartComponent);
|
appendTabs(chartComponent);
|
||||||
|
|
||||||
|
setDefaultButtonState(configuration,user);
|
||||||
|
|
||||||
configuration.setChartComponent(chartComponent);
|
configuration.setChartComponent(chartComponent);
|
||||||
configureModifiers(planningState.getOrder(), configuration);
|
configureModifiers(planningState.getOrder(), configuration);
|
||||||
long setConfigurationTime = System.currentTimeMillis();
|
long setConfigurationTime = System.currentTimeMillis();
|
||||||
|
|
@ -395,6 +397,36 @@ public class OrderPlanningModel implements IOrderPlanningModel {
|
||||||
PROFILING_LOG.debug("overallProgressContent took: " + (System.currentTimeMillis() - overallProgressContentTime));
|
PROFILING_LOG.debug("overallProgressContent took: " + (System.currentTimeMillis() - overallProgressContentTime));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void setDefaultButtonState(PlannerConfiguration<TaskElement> configuration, User user) {
|
||||||
|
|
||||||
|
// set initial button show mode
|
||||||
|
if ( !planner.areShownAdvancesByDefault() && user.isShowAdvancesOn() ) {
|
||||||
|
configuration.setShowAdvancesOn(user.isShowAdvancesOn());
|
||||||
|
planner.setAreShownAdvancesByDefault(user.isShowAdvancesOn());
|
||||||
|
}
|
||||||
|
|
||||||
|
if ( !planner.areShownReportedHoursByDefault() && user.isShowReportedHoursOn() ) {
|
||||||
|
configuration.setShowReportedHoursOn(user.isShowReportedHoursOn());
|
||||||
|
planner.setAreShownReportedHoursByDefault(user.isShowReportedHoursOn());
|
||||||
|
}
|
||||||
|
|
||||||
|
if ( !planner.areShownMoneyCostBarByDefault() && user.isShowMoneyCostBarOn() ) {
|
||||||
|
configuration.setShowMoneyCostBarOn(user.isShowMoneyCostBarOn());
|
||||||
|
planner.setAreShownMoneyCostBarByDefault(user.isShowMoneyCostBarOn());
|
||||||
|
}
|
||||||
|
|
||||||
|
if ( !planner.areShownLabelsByDefault() && user.isShowLabelsOn() ) {
|
||||||
|
configuration.setShowLabelsOn(user.isShowLabelsOn());
|
||||||
|
planner.setAreShownLabelsByDefault(user.isShowLabelsOn());
|
||||||
|
}
|
||||||
|
|
||||||
|
if ( !planner.areShownResourcesByDefault() && user.isShowResourcesOn() ) {
|
||||||
|
configuration.setShowResourcesOn(user.isShowResourcesOn());
|
||||||
|
planner.setAreShownResourcesByDefault(user.isShowResourcesOn());
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
private ZoomLevel getZoomLevel(PlannerConfiguration<TaskElement> configuration, Order order) {
|
private ZoomLevel getZoomLevel(PlannerConfiguration<TaskElement> configuration, Order order) {
|
||||||
ZoomLevel sessionZoom = FilterUtils.readZoomLevel(order);
|
ZoomLevel sessionZoom = FilterUtils.readZoomLevel(order);
|
||||||
if ( sessionZoom != null ) {
|
if ( sessionZoom != null ) {
|
||||||
|
|
|
||||||
|
|
@ -101,4 +101,23 @@ public interface ISettingsModel {
|
||||||
|
|
||||||
void setResourcesLoadFilterCriterion(Criterion criterion);
|
void setResourcesLoadFilterCriterion(Criterion criterion);
|
||||||
|
|
||||||
|
boolean isShowResourcesOn();
|
||||||
|
|
||||||
|
void setShowResourcesOn(boolean showResourcesOn);
|
||||||
|
|
||||||
|
boolean isShowAdvancesOn();
|
||||||
|
|
||||||
|
void setShowAdvancesOn(boolean showAdvancesOn);
|
||||||
|
|
||||||
|
boolean isShowReportedHoursOn();
|
||||||
|
|
||||||
|
void setShowReportedHoursOn(boolean showReportedHoursOn);
|
||||||
|
|
||||||
|
boolean isShowLabelsOn();
|
||||||
|
|
||||||
|
void setShowLabelsOn(boolean showLabelsOn);
|
||||||
|
|
||||||
|
boolean isShowMoneyCostBarOn();
|
||||||
|
|
||||||
|
void setShowMoneyCostBarOn(boolean showMoneyCostBarOn);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -314,4 +314,43 @@ public class SettingsController extends GenericForwardComposer {
|
||||||
settingsModel.setResourcesLoadFilterCriterion(criterion);
|
settingsModel.setResourcesLoadFilterCriterion(criterion);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean isShowResourcesOn() {
|
||||||
|
return settingsModel.isShowResourcesOn();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setShowResourcesOn(boolean showResourcesOn) {
|
||||||
|
settingsModel.setShowResourcesOn(showResourcesOn);
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isShowAdvancesOn() {
|
||||||
|
return settingsModel.isShowAdvancesOn();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setShowAdvancesOn(boolean showAdvancesOn) {
|
||||||
|
settingsModel.setShowAdvancesOn(showAdvancesOn);
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isShowReportedHoursOn() {
|
||||||
|
return settingsModel.isShowReportedHoursOn();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setShowReportedHoursOn(boolean showReportedHoursOn) {
|
||||||
|
settingsModel.setShowReportedHoursOn(showReportedHoursOn);
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isShowLabelsOn() {
|
||||||
|
return settingsModel.isShowLabelsOn();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setShowLabelsOn(boolean showLabelsOn) {
|
||||||
|
settingsModel.setShowLabelsOn(showLabelsOn);
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isShowMoneyCostBarOn() {
|
||||||
|
return settingsModel.isShowMoneyCostBarOn();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setShowMoneyCostBarOn(boolean showMoneyCostBarOn) {
|
||||||
|
settingsModel.setShowMoneyCostBarOn(showMoneyCostBarOn);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -311,4 +311,53 @@ public class SettingsModel implements ISettingsModel {
|
||||||
user.setResourcesLoadFilterCriterion(criterion);
|
user.setResourcesLoadFilterCriterion(criterion);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean isShowResourcesOn() {
|
||||||
|
return user.isShowResourcesOn();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void setShowResourcesOn(boolean showResourcesOn) {
|
||||||
|
user.setShowResourcesOn(showResourcesOn);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean isShowAdvancesOn() {
|
||||||
|
return user.isShowAdvancesOn();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void setShowAdvancesOn(boolean showAdvancesOn) {
|
||||||
|
user.setShowAdvancesOn(showAdvancesOn);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean isShowReportedHoursOn() {
|
||||||
|
return user.isShowReportedHoursOn();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void setShowReportedHoursOn(boolean showReportedHoursOn) {
|
||||||
|
user.setShowReportedHoursOn(showReportedHoursOn);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean isShowLabelsOn() {
|
||||||
|
return user.isShowLabelsOn();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void setShowLabelsOn(boolean showLabelsOn) {
|
||||||
|
user.setShowLabelsOn(showLabelsOn);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean isShowMoneyCostBarOn() {
|
||||||
|
return user.isShowMoneyCostBarOn();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void setShowMoneyCostBarOn(boolean showMoneyCostBarOn) {
|
||||||
|
user.setShowMoneyCostBarOn(showMoneyCostBarOn);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,9 +1,5 @@
|
||||||
<zk>
|
<zk>
|
||||||
<log>
|
<desktop-config>
|
||||||
<log-base/>
|
|
||||||
</log>
|
|
||||||
|
|
||||||
<desktop-config>
|
|
||||||
<!--
|
<!--
|
||||||
Seconds it takes between requests for a desktop to be invalidated.
|
Seconds it takes between requests for a desktop to be invalidated.
|
||||||
A timer is introduced to avoid invalidation of pages still open.
|
A timer is introduced to avoid invalidation of pages still open.
|
||||||
|
|
|
||||||
|
|
@ -121,6 +121,35 @@
|
||||||
</rows>
|
</rows>
|
||||||
</grid>
|
</grid>
|
||||||
</row>
|
</row>
|
||||||
|
<row>
|
||||||
|
<label value="${i18n:_('Planning view modes on')}" />
|
||||||
|
<grid>
|
||||||
|
<columns>
|
||||||
|
<column />
|
||||||
|
<column />
|
||||||
|
<column />
|
||||||
|
</columns>
|
||||||
|
<rows>
|
||||||
|
<row>
|
||||||
|
<checkbox id="showResourcesOn"
|
||||||
|
label="${i18n:_('Show resources')}"
|
||||||
|
checked="@{settingsController.showResourcesOn}"/>
|
||||||
|
<checkbox id="showAdvancesOn"
|
||||||
|
label="${i18n:_('Show progress')}"
|
||||||
|
checked="@{settingsController.showAdvancesOn}"/>
|
||||||
|
<checkbox id="showReportedHoursOn"
|
||||||
|
label="${i18n:_('Show reported hours')}"
|
||||||
|
checked="@{settingsController.showReportedHoursOn}"/>
|
||||||
|
<checkbox id="showLabelsOn"
|
||||||
|
label="${i18n:_('Show labels')}"
|
||||||
|
checked="@{settingsController.showLabelsOn}"/>
|
||||||
|
<checkbox id="showMoneyCostBarOn"
|
||||||
|
label="${i18n:_('Show money cost bar')}"
|
||||||
|
checked="@{settingsController.showMoneyCostBarOn}"/>
|
||||||
|
</row>
|
||||||
|
</rows>
|
||||||
|
</grid>
|
||||||
|
</row>
|
||||||
<row>
|
<row>
|
||||||
<label value="${i18n:_('Projects view filtering')}" />
|
<label value="${i18n:_('Projects view filtering')}" />
|
||||||
<hbox>
|
<hbox>
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue