From 26f02b97fefa11b50f6f11388995721d7c26164b Mon Sep 17 00:00:00 2001 From: Josef Rokos Date: Thu, 3 Jul 2014 12:53:20 +0200 Subject: [PATCH] =?UTF-8?q?Nastaven=C3=AD=20prefix=C5=AF=20=C4=8D=C3=ADsel?= =?UTF-8?q?n=C3=BDch=20=C5=99ad.=20refs=20#101?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../info/bukova/isspst/ui/NavigationVM.java | 6 ++ .../isspst/ui/settings/NumberSeriesVM.java | 55 +++++++++++++++++++ .../WEB-INF/locales/zk-label.properties | 4 ++ src/main/webapp/app/navigation.zul | 1 + src/main/webapp/settings/numberSeries.zul | 27 +++++++++ 5 files changed, 93 insertions(+) create mode 100644 src/main/java/info/bukova/isspst/ui/settings/NumberSeriesVM.java create mode 100644 src/main/webapp/settings/numberSeries.zul 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