diff --git a/navalplanner-webapp/src/main/java/org/navalplanner/web/planner/allocation/ResourceAllocationController.java b/navalplanner-webapp/src/main/java/org/navalplanner/web/planner/allocation/ResourceAllocationController.java index acf49823b..b7711b909 100644 --- a/navalplanner-webapp/src/main/java/org/navalplanner/web/planner/allocation/ResourceAllocationController.java +++ b/navalplanner-webapp/src/main/java/org/navalplanner/web/planner/allocation/ResourceAllocationController.java @@ -118,10 +118,13 @@ public class ResourceAllocationController extends GenericForwardComposer { private Label allTotalHours; private Label allConsolidatedHours; + private Label allocationSelectedItems; + private Label allTotalResourcesPerDay; private Label allConsolidatedResourcesPerDay; private Button applyButton; + private Button advancedAllocationButton; private NewAllocationSelector newAllocationSelector; @@ -154,6 +157,7 @@ public class ResourceAllocationController extends GenericForwardComposer { initAllocationLabels(); makeReadyInputsForCalculationTypes(); prepareCalculationTypesGrid(); + } private void initAllocationLabels() { @@ -331,11 +335,19 @@ public class ResourceAllocationController extends GenericForwardComposer { allocationSelector.addChoosen(); } finally { tbResourceAllocation.setSelected(true); + advancedAllocationButton.setVisible(true); + applyButton.setVisible(true); allocationSelector.clearAll(); Util.reloadBindings(allocationsGrid); } } + public void goToAdvancedSearch() { + advancedAllocationButton.setVisible(false); + applyButton.setVisible(false); + workerSearchTab.setSelected(true); + } + /** * Shows the extended view of the resources allocations */ @@ -372,6 +384,8 @@ public class ResourceAllocationController extends GenericForwardComposer { */ public void onCloseSelectWorkers() { tbResourceAllocation.setSelected(true); + advancedAllocationButton.setVisible(true); + applyButton.setVisible(true); newAllocationSelector.clearAll(); } diff --git a/navalplanner-webapp/src/main/java/org/navalplanner/web/resources/search/NewAllocationSelectorController.java b/navalplanner-webapp/src/main/java/org/navalplanner/web/resources/search/NewAllocationSelectorController.java index 5e13bf0d7..7a02a3780 100644 --- a/navalplanner-webapp/src/main/java/org/navalplanner/web/resources/search/NewAllocationSelectorController.java +++ b/navalplanner-webapp/src/main/java/org/navalplanner/web/resources/search/NewAllocationSelectorController.java @@ -70,6 +70,8 @@ public class NewAllocationSelectorController extends private Listbox listBoxResources; + private Label allocationSelectedItems; + private CriterionRenderer criterionRenderer = new CriterionRenderer(); private AllocationType currentAllocationType; @@ -139,8 +141,8 @@ public class NewAllocationSelectorController extends } private void doInitialSelection() { - currentAllocationType = AllocationType.SPECIFIC; - AllocationType.SPECIFIC.doTheSelectionOn(allocationTypeSelector); + currentAllocationType = AllocationType.GENERIC; + AllocationType.GENERIC.doTheSelectionOn(allocationTypeSelector); onType(currentAllocationType); } @@ -307,7 +309,7 @@ public class NewAllocationSelectorController extends } public List getAllocationTypes() { - return Arrays.asList(AllocationType.values()); + return Arrays.asList(AllocationType.GENERIC, AllocationType.SPECIFIC); } /** @@ -421,4 +423,26 @@ public class NewAllocationSelectorController extends listBoxResources.setMultiple(multiple); } + public void showSelectedAllocations() { + String result = "["; + + if (currentAllocationType == AllocationType.GENERIC) { + + for (Treeitem each : (Set) criterionsTree + .getSelectedItems()) { + Object node = ((CriterionTreeNode) each.getValue()).getData(); + if (node instanceof Criterion) { + result += ((Criterion) node).getCompleteName(); + } + } + } else { + for (Object each : listBoxResources.getSelectedItems()) { + result += ((Resource) ((Listitem) each).getValue()) + .getShortDescription(); + } + } + + allocationSelectedItems.setValue(result); + } + } diff --git a/navalplanner-webapp/src/main/resources/i18n/es.po b/navalplanner-webapp/src/main/resources/i18n/es.po index 679032a8f..98e631c67 100644 --- a/navalplanner-webapp/src/main/resources/i18n/es.po +++ b/navalplanner-webapp/src/main/resources/i18n/es.po @@ -4612,7 +4612,7 @@ msgstr "Etiqueta guardada" #: navalplanner-webapp/src/main/webapp/resources/search/allocation_selector_combo.zul:30 msgid "Select criteria or resources" -msgstr "Filtrar por recursos" +msgstr "Seleccionar criterios o recursos" #: navalplanner-webapp/src/main/webapp/orders/_orderElementTreeFilter.zul:23 #: navalplanner-webapp/src/main/webapp/orders/_orderFilter.zul:23 diff --git a/navalplanner-webapp/src/main/resources/i18n/gl.po b/navalplanner-webapp/src/main/resources/i18n/gl.po index 5bf06908a..402dc96e6 100644 --- a/navalplanner-webapp/src/main/resources/i18n/gl.po +++ b/navalplanner-webapp/src/main/resources/i18n/gl.po @@ -4599,7 +4599,7 @@ msgstr "Etiqueta gardada" #: navalplanner-webapp/src/main/webapp/resources/search/allocation_selector_combo.zul:30 msgid "Select criteria or resources" -msgstr "Filtrar por recursos" +msgstr "Seleccionar criterios ou recursos" #: navalplanner-webapp/src/main/webapp/orders/_orderElementTreeFilter.zul:23 #: navalplanner-webapp/src/main/webapp/orders/_orderFilter.zul:23 diff --git a/navalplanner-webapp/src/main/webapp/planner/_tabPanelLimitingResourceAllocation.zul b/navalplanner-webapp/src/main/webapp/planner/_tabPanelLimitingResourceAllocation.zul index e898ae06c..f853b9fdb 100644 --- a/navalplanner-webapp/src/main/webapp/planner/_tabPanelLimitingResourceAllocation.zul +++ b/navalplanner-webapp/src/main/webapp/planner/_tabPanelLimitingResourceAllocation.zul @@ -78,7 +78,8 @@ -