From f4fe974931b5c4658b6d06df4d18045d856c4a34 Mon Sep 17 00:00:00 2001 From: Josef Rokos Date: Thu, 15 Jan 2015 15:09:11 +0100 Subject: [PATCH 1/3] =?UTF-8?q?Do=20UserServis=20byla=20p=C5=99id=C3=A1na?= =?UTF-8?q?=20metoda=20getUsersForCombo,=20kter=C3=A1=20vr=C3=A1t=C3=AD=20?= =?UTF-8?q?seznam=20u=C5=BEivatel=C5=AF=20podle=20abecedy.=20Vol=C3=A1=20s?= =?UTF-8?q?e=20pro=20pln=C4=9Bn=C3=AD=20combobox=C5=AF=20u=20filtr=C5=AF?= =?UTF-8?q?=20a=20na=20formul=C3=A1=C5=99i=20pro=20zad=C3=A1n=C3=AD=20?= =?UTF-8?q?=C5=BE=C3=A1dosti=20o=20slu=C5=BEebn=C3=AD=20cestu-=20combo=20s?= =?UTF-8?q?polucestuj=C3=ADc=C3=AD.=20closes=20#191?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../info/bukova/isspst/services/users/UserService.java | 1 + .../bukova/isspst/services/users/UserServiceImpl.java | 8 ++++++++ .../bukova/isspst/ui/requirement/RequirementSubpage.java | 2 +- .../bukova/isspst/ui/requirement/TripRequirementForm.java | 2 +- src/main/webapp/WEB-INF/locales/zk-label.properties | 1 + .../webapp/main/trips/requirements/requirementsForm.zul | 2 +- 6 files changed, 13 insertions(+), 3 deletions(-) diff --git a/src/main/java/info/bukova/isspst/services/users/UserService.java b/src/main/java/info/bukova/isspst/services/users/UserService.java index d5f729ce..d574c9db 100644 --- a/src/main/java/info/bukova/isspst/services/users/UserService.java +++ b/src/main/java/info/bukova/isspst/services/users/UserService.java @@ -27,5 +27,6 @@ public interface UserService extends UserDetailsService, Service { public void setUserSettings(UserSettingsData settings); public void setAuthMethod(AuthMethod method); public AuthMethod getAuthMethod(); + public List getUsersForCombo(); } diff --git a/src/main/java/info/bukova/isspst/services/users/UserServiceImpl.java b/src/main/java/info/bukova/isspst/services/users/UserServiceImpl.java index 514b1978..25faf30b 100644 --- a/src/main/java/info/bukova/isspst/services/users/UserServiceImpl.java +++ b/src/main/java/info/bukova/isspst/services/users/UserServiceImpl.java @@ -230,4 +230,12 @@ public class UserServiceImpl extends AbstractService implements UserServic } } + @SuppressWarnings("unchecked") + @Override + @Transactional + public List getUsersForCombo() { + Query q = dao.getQuery("from User u order by u.lastName"); + return q.list(); + } + } diff --git a/src/main/java/info/bukova/isspst/ui/requirement/RequirementSubpage.java b/src/main/java/info/bukova/isspst/ui/requirement/RequirementSubpage.java index 780b41d8..42f59983 100644 --- a/src/main/java/info/bukova/isspst/ui/requirement/RequirementSubpage.java +++ b/src/main/java/info/bukova/isspst/ui/requirement/RequirementSubpage.java @@ -25,7 +25,7 @@ public class RequirementSubpage extends ListViewModel public List getAllUsers() { - return userService.getAll(); + return userService.getUsersForCombo(); } private BigDecimalConverter bigDecimalConverter; diff --git a/src/main/java/info/bukova/isspst/ui/requirement/TripRequirementForm.java b/src/main/java/info/bukova/isspst/ui/requirement/TripRequirementForm.java index ecaae786..a39ec9fe 100644 --- a/src/main/java/info/bukova/isspst/ui/requirement/TripRequirementForm.java +++ b/src/main/java/info/bukova/isspst/ui/requirement/TripRequirementForm.java @@ -42,7 +42,7 @@ public class TripRequirementForm extends FormViewModel { public void init() { tripRequirementService.loadType(getDataBean()); centres = reqTypeService.filterCentres(getDataBean().getType(), workgroupService.getUserCentres(userService.getCurrent())); - users = userService.getAll(); + users = userService.getUsersForCombo(); passengers = getDataBean().getPassengers(); validator = new TripRequirementFormValidator(); } diff --git a/src/main/webapp/WEB-INF/locales/zk-label.properties b/src/main/webapp/WEB-INF/locales/zk-label.properties index 7caf1dca..f4ccef91 100644 --- a/src/main/webapp/WEB-INF/locales/zk-label.properties +++ b/src/main/webapp/WEB-INF/locales/zk-label.properties @@ -312,6 +312,7 @@ DateTimeFormat=dd. MM. yyyy, HH:MM:ss AddItem=Přidat položku SelectGroup=Vybrat skupinu... RemoveItem=Smazat +Confirm=Potvrdit StudentProject = Studentský projekt StudentProjectAbr = St. projekt diff --git a/src/main/webapp/main/trips/requirements/requirementsForm.zul b/src/main/webapp/main/trips/requirements/requirementsForm.zul index 8e916917..4402d87f 100644 --- a/src/main/webapp/main/trips/requirements/requirementsForm.zul +++ b/src/main/webapp/main/trips/requirements/requirementsForm.zul @@ -129,7 +129,7 @@ -