diff --git a/src/main/java/info/bukova/isspst/ui/NavigationVM.java b/src/main/java/info/bukova/isspst/ui/NavigationVM.java index e857a06b..0f6ae109 100644 --- a/src/main/java/info/bukova/isspst/ui/NavigationVM.java +++ b/src/main/java/info/bukova/isspst/ui/NavigationVM.java @@ -22,6 +22,12 @@ public class NavigationVM { window.doModal(); } + @Command + public void numSeries() { + Window window = (Window)Executions.createComponents("/settings/numberSeries.zul", null, null); + window.doModal(); + } + public String getContextPath() { return contextPath; } diff --git a/src/main/java/info/bukova/isspst/ui/settings/NumberSeriesVM.java b/src/main/java/info/bukova/isspst/ui/settings/NumberSeriesVM.java new file mode 100644 index 00000000..7e739c1a --- /dev/null +++ b/src/main/java/info/bukova/isspst/ui/settings/NumberSeriesVM.java @@ -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 numberSeriesList; + private Map moduleMap; + + @Init + public void init() { + numberSeriesList = new ArrayList(numericSeriesService.getAll()); + moduleMap = new HashMap(); + for (Module m : Constants.MODULES) { + moduleMap.put(m.getId(), m); + } + } + + public List 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 getModuleMap() { + return moduleMap; + } +} diff --git a/src/main/webapp/WEB-INF/locales/zk-label.properties b/src/main/webapp/WEB-INF/locales/zk-label.properties index 8a66b098..24e07edf 100644 --- a/src/main/webapp/WEB-INF/locales/zk-label.properties +++ b/src/main/webapp/WEB-INF/locales/zk-label.properties @@ -108,6 +108,10 @@ LimitFormTitle=Limit pro schválení Limit=Limit: OverLimit=Pouze nadlimitní +NumberSeriesFormTitle=Číselné řady +Number=Číslo: +Prefix=Prefix: + CentresForRequirements=Střediska, pro která lze vkládat požadavky WorkgroupMembership=Členství v komisích LogedInUser=Přihlášený uživatel: diff --git a/src/main/webapp/app/navigation.zul b/src/main/webapp/app/navigation.zul index c115ee0d..a01cd11f 100644 --- a/src/main/webapp/app/navigation.zul +++ b/src/main/webapp/app/navigation.zul @@ -39,6 +39,7 @@ + diff --git a/src/main/webapp/settings/numberSeries.zul b/src/main/webapp/settings/numberSeries.zul new file mode 100644 index 00000000..972bf296 --- /dev/null +++ b/src/main/webapp/settings/numberSeries.zul @@ -0,0 +1,27 @@ + + + + + + + + + + + + + + + + + + + \ No newline at end of file