Revamped advanced resources search for task allocations

FEA: ItEr60S04ValidacionEProbasFuncionaisItEr59S04
This commit is contained in:
Lorenzo Tilve 2010-09-17 16:10:30 +02:00
parent f2a1c28048
commit 907f9f085a
9 changed files with 107 additions and 47 deletions

View file

@ -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();
}

View file

@ -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<AllocationType> 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<Treeitem>) 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);
}
}

View file

@ -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

View file

@ -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

View file

@ -78,7 +78,8 @@
<separator spacing="10px"/>
<hbox>
<newAllocationSelectorCombo id="limitingNewAllocationSelectorCombo" />
<button label="${i18n:_('Select')}" onClick="limitingAllocationController.onSelectWorkers(limitingNewAllocationSelectorCombo)" />
<button label="${i18n:_('Add')}" onClick="limitingAllocationController.onSelectWorkers(limitingNewAllocationSelectorCombo)" />
<button label="${i18n:_('Advanced search')}" onClick="tabLimitingWorkerSearch.setSelected(true);" />
</hbox>
<separator spacing="10px"/>
<grid id="gridLimitingAllocations"

View file

@ -31,8 +31,8 @@
<tabpanel id="resourceAllocationTabpanel">
<tabbox mold="accordion">
<tabs>
<tab id="tbResourceAllocation" label="${i18n:_('Non limiting resource allocation')}" image="common/img/collapse.gif" />
<tab id="workerSearchTab" label="${i18n:_('Resources search')}" image="common/img/collapse.gif"/>
<tab id="tbResourceAllocation" />
<tab id="workerSearchTab" />
</tabs>
<tabpanels>
<tabpanel>
@ -64,7 +64,7 @@
</vbox>
</groupbox>
<groupbox sclass="assignedresources" closable="false" width="310px" height="170px" >
<groupbox sclass="assignedresources" closable="false" width="340px" height="170px" >
<caption label="${i18n:_('Allocation configuration')}" />
<hbox>
@ -95,9 +95,10 @@
<!-- Multiple allocation selector -->
<separator spacing="10px"/>
<hbox>
<hbox align="bottom">
<newAllocationSelectorCombo id="newAllocationSelectorCombo" />
<button label="${i18n:_('Select')}" onClick="allocationController.onSelectWorkers(newAllocationSelectorCombo)" />
<button label="${i18n:_('Add')}" onClick="allocationController.onSelectWorkers(newAllocationSelectorCombo)" />
<button label="${i18n:_('Advanced search')}" onClick="allocationController.goToAdvancedSearch()" />
</hbox>
<separator spacing="20px"/>
<grid id="allocationsGrid"
@ -142,7 +143,7 @@
<!-- Control buttons -->
<hbox>
<button label="${i18n:_('Apply tab changes')}" id="applyButton" sclass="global-action" />
<button label="${i18n:_('Go to advanced Allocation')}"
<button label="${i18n:_('Go to advanced Allocation')}" id="advancedAllocationButton"
onClick="editController.goToAdvancedAllocation();" sclass="global-action" />
</hbox>
</tabpanel>

View file

@ -22,10 +22,14 @@
<tabpanel id="${arg.id}">
<grid>
<columns>
<column width="300px"/>
<column />
</columns>
<rows>
<row>
<label value="${i18n:_('Name')}" />
<textbox id="name" value="@{propertiesController.ganttTaskDTO.name}" />
<textbox id="name" value="@{propertiesController.ganttTaskDTO.name}" width="400px" />
</row>
<row>
<label value="${i18n:_('Start')}" />
@ -43,7 +47,7 @@
</row>
<row>
<label value="${i18n:_('Notes')}" />
<textbox id="notes" value="@{propertiesController.ganttTaskDTO.notes}" />
<textbox id="notes" value="@{propertiesController.ganttTaskDTO.notes}" width="400px" rows="3"/>
</row>
<row>
<label value="${i18n:_('Hours')}" />
@ -56,7 +60,7 @@
<row id="startConstraint">
<label value="${i18n:_('Constraint')}" />
<vbox>
<combobox id="startConstraintTypes" />
<combobox id="startConstraintTypes" width="300px" />
<datebox id="startConstraintDate" constraint ="no empty"
value="@{editController.startConstraintDate}" />
</vbox>

View file

@ -48,12 +48,14 @@
</zscript>
<window id="editTaskWindow"
sclass="edit-task-window"
apply="${arg.editController}"
title="${i18n:_('Edit task')}"
border="normal"
width="870px"
border="0"
width="980px"
visible="false"
closable="true"
sizable="true"
onClose="editController.close(event)" >
<vbox id="messagesContainer" />
@ -75,9 +77,9 @@
<hbox>
<button id="ok" label="${i18n:_('Accept')}"
onClick="editController.accept()" />
onClick="editController.accept()" sclass="save-button global-action" />
<button id="cancel" label="${i18n:_('Cancel')}"
onClick="editController.cancel()" />
onClick="editController.cancel()" sclass="cancel-button global-action" />
</hbox>
</window>

View file

@ -27,6 +27,42 @@
<vbox apply="${selectorController}">
<groupbox style="margin-top: 5px" closable="false">
<caption label="${i18n:_('Select criteria set or specific resources for allocation')}" />
<hbox>
<vbox sclass="allocation-criterion-selector">
<!-- Criteria -->
<tree id="criterionsTree" width="420px"
height="340px" vflex="true" multiple="true"
model="@{selectorController.criterions}"
zclass="z-dottree" style="margin-top:5px;margin-bottom:5px;">
<attribute name="onSelect"><![CDATA[ selectorController.showSelectedAllocations() ]]></attribute>
<treecols>
<treecol label="${i18n:_('Criteria')}" tooltiptext="${i18n:_('Criteria (Hold CTRL for multiple selection)')}" />
</treecols>
</tree>
</vbox>
<vbox>
<!--Matchings -->
<listbox id="listBoxResources" width="420px"
vflex="true" multiple="true" height="340px"
itemRenderer="@{selectorController.listitemRenderer}" style="margin:5px;"
onFocus="selectorController.showSelectedAllocations()" >
<attribute name="onSelect"><![CDATA[
selectorController.showSelectedAllocations();
]]></attribute>
<listhead>
<listheader label="${i18n:_('Found resources')}" tooltiptext="${i18n:_('Resources matching selected criteria')}" sort="auto" />
</listhead>
</listbox>
</vbox>
</hbox>
<grid fixedLayout="true">
<columns>
<column width="200px" />
@ -39,36 +75,14 @@
<radio forEach="${selectorController.allocationTypes}"
label="${each.name}" value="${each}" />
</radiogroup>
</row>
</row>
<row>
<label value="${i18n:_('Current selection')}" />
<label id="allocationSelectedItems" value="${i18n:_('[generic all resources]')}" />
</row>
</rows></grid>
<hbox>
<vbox sclass="allocation-criterion-selector">
<!-- Criteria -->
<tree id="criterionsTree" width="400px"
height="400px" vflex="true" multiple="true"
model="@{selectorController.criterions}"
zclass="z-dottree">
<treecols>
<treecol label="${i18n:_('Criteria')}" tooltiptext="${i18n:_('Criteria (Hold CTRL for multiple selection)')}" />
</treecols>
</tree>
</vbox>
<vbox>
<!--Matchings -->
<listbox id="listBoxResources" width="400px"
vflex="true" multiple="true" height="400px"
itemRenderer="@{selectorController.listitemRenderer}">
<listhead>
<listheader label="${i18n:_('Resources')}" tooltiptext="${i18n:_('Resources matching selected criteria')}" sort="auto" />
</listhead>
</listbox>
</vbox>
</hbox>
</groupbox>
<popup id="allocation-type-popup" width="700px" >