ItEr56S14GraficaInferiorPantallaCargaRecursos: Show/hide load chart at resource load view depending on configuration.
This commit is contained in:
parent
cce3f2296c
commit
7a94a31baa
4 changed files with 27 additions and 5 deletions
|
|
@ -44,6 +44,7 @@ import org.zkoss.zk.ui.HtmlMacroComponent;
|
|||
import org.zkoss.zk.ui.event.Event;
|
||||
import org.zkoss.zk.ui.event.EventListener;
|
||||
import org.zkoss.zk.ui.event.Events;
|
||||
import org.zkoss.zkex.zul.api.South;
|
||||
import org.zkoss.zul.Button;
|
||||
import org.zkoss.zul.Comboitem;
|
||||
import org.zkoss.zul.ListModel;
|
||||
|
|
@ -99,11 +100,14 @@ public class ResourcesLoadPanel extends HtmlMacroComponent {
|
|||
private WeakReferencedListeners<IChartVisibilityChangedListener> chartVisibilityListeners = WeakReferencedListeners
|
||||
.create();
|
||||
|
||||
public ResourcesLoadPanel(List<LoadTimeLine> groups,
|
||||
TimeTracker timeTracker, Component componentOnWhichGiveFeedback) {
|
||||
this.componentOnWhichGiveFeedback = componentOnWhichGiveFeedback;
|
||||
init(groups, timeTracker);
|
||||
private final boolean expandResourceLoadViewCharts;
|
||||
|
||||
public ResourcesLoadPanel(List<LoadTimeLine> groups,
|
||||
TimeTracker timeTracker, Component componentOnWhichGiveFeedback,
|
||||
boolean expandResourceLoadViewCharts) {
|
||||
this.componentOnWhichGiveFeedback = componentOnWhichGiveFeedback;
|
||||
this.expandResourceLoadViewCharts = expandResourceLoadViewCharts;
|
||||
init(groups, timeTracker);
|
||||
}
|
||||
|
||||
public void init(List<LoadTimeLine> groups, TimeTracker timeTracker) {
|
||||
|
|
@ -312,6 +316,9 @@ public class ResourcesLoadPanel extends HtmlMacroComponent {
|
|||
}
|
||||
|
||||
getFellow("insertionPointChart").appendChild(loadChart);
|
||||
|
||||
this.visibleChart = expandResourceLoadViewCharts;
|
||||
((South) getFellow("graphics")).setOpen(this.visibleChart);
|
||||
}
|
||||
|
||||
public void clearComponents() {
|
||||
|
|
|
|||
|
|
@ -68,4 +68,6 @@ public interface IResourceLoadModel {
|
|||
|
||||
List<Resource> getResources();
|
||||
|
||||
boolean isExpandResourceLoadViewCharts();
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -253,7 +253,8 @@ public class ResourceLoadController implements Composer {
|
|||
}
|
||||
} else {
|
||||
resourcesLoadPanel = new ResourcesLoadPanel(resourceLoadModel
|
||||
.getLoadTimeLines(), timeTracker, parent);
|
||||
.getLoadTimeLines(), timeTracker, parent, resourceLoadModel
|
||||
.isExpandResourceLoadViewCharts());
|
||||
resourcesLoadPanel.setLoadChart(buildChart());
|
||||
if(filterBy == null) {
|
||||
addWorkersBandbox();
|
||||
|
|
|
|||
|
|
@ -39,6 +39,7 @@ import org.joda.time.LocalDate;
|
|||
import org.navalplanner.business.calendars.daos.IBaseCalendarDAO;
|
||||
import org.navalplanner.business.calendars.entities.ResourceCalendar;
|
||||
import org.navalplanner.business.common.BaseEntity;
|
||||
import org.navalplanner.business.common.daos.IConfigurationDAO;
|
||||
import org.navalplanner.business.common.exceptions.InstanceNotFoundException;
|
||||
import org.navalplanner.business.orders.daos.IOrderDAO;
|
||||
import org.navalplanner.business.orders.daos.IOrderElementDAO;
|
||||
|
|
@ -121,6 +122,9 @@ public class ResourceLoadModel implements IResourceLoadModel {
|
|||
@Autowired
|
||||
private IBaseCalendarDAO baseCalendarDAO;
|
||||
|
||||
@Autowired
|
||||
private IConfigurationDAO configurationDAO;
|
||||
|
||||
@Override
|
||||
@Transactional(readOnly = true)
|
||||
public void initGlobalView(boolean filterByResources) {
|
||||
|
|
@ -777,6 +781,14 @@ public class ResourceLoadModel implements IResourceLoadModel {
|
|||
}
|
||||
return resources;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(readOnly = true)
|
||||
public boolean isExpandResourceLoadViewCharts() {
|
||||
return configurationDAO.getConfiguration()
|
||||
.isExpandResourceLoadViewCharts();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
class PeriodsBuilder {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue