Nastavení prefixů číselných řad.

refs #101
multitenant
Josef Rokos 11 years ago
parent 1283fe627d
commit 26f02b97fe

@ -22,6 +22,12 @@ public class NavigationVM {
window.doModal(); window.doModal();
} }
@Command
public void numSeries() {
Window window = (Window)Executions.createComponents("/settings/numberSeries.zul", null, null);
window.doModal();
}
public String getContextPath() { public String getContextPath() {
return contextPath; return contextPath;
} }

@ -0,0 +1,55 @@
package info.bukova.isspst.ui.settings;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.zkoss.bind.annotation.BindingParam;
import org.zkoss.bind.annotation.Command;
import org.zkoss.bind.annotation.Init;
import org.zkoss.zk.ui.select.annotation.WireVariable;
import org.zkoss.zul.Window;
import info.bukova.isspst.Constants;
import info.bukova.isspst.Module;
import info.bukova.isspst.data.NumberSeries;
import info.bukova.isspst.services.numberseries.NumberSeriesService;
public class NumberSeriesVM {
@WireVariable
private NumberSeriesService numericSeriesService;
private List<NumberSeries> numberSeriesList;
private Map<String, Module> moduleMap;
@Init
public void init() {
numberSeriesList = new ArrayList<NumberSeries>(numericSeriesService.getAll());
moduleMap = new HashMap<String, Module>();
for (Module m : Constants.MODULES) {
moduleMap.put(m.getId(), m);
}
}
public List<NumberSeries> getNumberSeriesList() {
return numberSeriesList;
}
public boolean isCanSave() {
return true;
}
@Command
public void save(@BindingParam("window") Window window) {
for (NumberSeries ns : numberSeriesList) {
numericSeriesService.update(ns);
}
window.detach();
}
public Map<String, Module> getModuleMap() {
return moduleMap;
}
}

@ -108,6 +108,10 @@ LimitFormTitle=Limit pro schválení
Limit=Limit: Limit=Limit:
OverLimit=Pouze nadlimitní OverLimit=Pouze nadlimitní
NumberSeriesFormTitle=Číselné řady
Number=Číslo:
Prefix=Prefix:
CentresForRequirements=Střediska, pro která lze vkládat požadavky CentresForRequirements=Střediska, pro která lze vkládat požadavky
WorkgroupMembership=Členství v komisích WorkgroupMembership=Členství v komisích
LogedInUser=Přihlášený uživatel: LogedInUser=Přihlášený uživatel:

@ -39,6 +39,7 @@
<tabpanel> <tabpanel>
<menubar orient="vertical"> <menubar orient="vertical">
<menuitem label="${labels.AgendaWorkflow}" href="/settings/workflow" disabled="${not sec:isAllGranted('PERM_EDIT_WORKFLOW')}"/> <menuitem label="${labels.AgendaWorkflow}" href="/settings/workflow" disabled="${not sec:isAllGranted('PERM_EDIT_WORKFLOW')}"/>
<menuitem label="Číselné řady" onClick="@command('numSeries')"/>
<menuitem label="Limity částek"/> <menuitem label="Limity částek"/>
<menuitem label="E-maily" /> <menuitem label="E-maily" />
</menubar> </menubar>

@ -0,0 +1,27 @@
<?page title="NumberSeriesFormTitle" contentType="text/html;charset=UTF-8"?>
<zk>
<window id="editWin" border="normal" apply="org.zkoss.bind.BindComposer"
viewModel="@id('vm') @init('info.bukova.isspst.ui.settings.NumberSeriesVM')" closable="true" width="400px">
<caption zclass="form-caption" label="${labels.NumberSeriesFormTitle}" />
<!-- <combobox></combobox> -->
<grid model="@load(vm.numberSeriesList)">
<columns>
<column hflex="min"/>
<column/>
<column hflex="min"/>
<column hflex="min"/>
</columns>
<rows>
<template name="model">
<row>
<label value="@load(vm.moduleMap[each.module].name.concat(' - ').concat(labels.Prefix))"/>
<textbox value="@bind(each.prefix)"/>
<label value="${labels.Number}"/>
<label value="@load(each.number)"/>
</row>
</template>
</rows>
</grid>
<include src="/app/formButtons.zul"/>
</window>
</zk>
Loading…
Cancel
Save