From 372814e4b33553d1d019e57a0003debb73cd3aac Mon Sep 17 00:00:00 2001 From: Josef Rokos Date: Fri, 5 Sep 2014 08:41:56 +0200 Subject: [PATCH] =?UTF-8?q?Opravena=20editace=20existuj=C3=ADc=C3=ADch=20p?= =?UTF-8?q?olo=C5=BEek=20po=C5=BEadavk=C5=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../services/requirement/RequirementTypeServiceImpl.java | 2 +- .../isspst/ui/main/orders/requirements/RequirementForm.java | 5 +++++ .../bukova/isspst/ui/requirement/TripRequirementForm.java | 4 ++++ 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/src/main/java/info/bukova/isspst/services/requirement/RequirementTypeServiceImpl.java b/src/main/java/info/bukova/isspst/services/requirement/RequirementTypeServiceImpl.java index 62de731d..9b6750bf 100644 --- a/src/main/java/info/bukova/isspst/services/requirement/RequirementTypeServiceImpl.java +++ b/src/main/java/info/bukova/isspst/services/requirement/RequirementTypeServiceImpl.java @@ -21,7 +21,7 @@ public class RequirementTypeServiceImpl extends AbstractOwnedService filterCentres(RequirementType reqType, List source) { - if (!reqType.getLimitCentres()) { + if (reqType.getLimitCentres() == null || !reqType.getLimitCentres()) { return source; } diff --git a/src/main/java/info/bukova/isspst/ui/main/orders/requirements/RequirementForm.java b/src/main/java/info/bukova/isspst/ui/main/orders/requirements/RequirementForm.java index 794d0d7b..f809d82f 100644 --- a/src/main/java/info/bukova/isspst/ui/main/orders/requirements/RequirementForm.java +++ b/src/main/java/info/bukova/isspst/ui/main/orders/requirements/RequirementForm.java @@ -5,6 +5,7 @@ import info.bukova.isspst.data.Requirement; import info.bukova.isspst.data.RequirementItem; import info.bukova.isspst.data.RequirementSubject; import info.bukova.isspst.data.Workgroup; +import info.bukova.isspst.services.requirement.RequirementService; import info.bukova.isspst.services.requirement.RequirementTypeService; import info.bukova.isspst.services.users.UserService; import info.bukova.isspst.services.workgroups.WorkgroupService; @@ -40,6 +41,9 @@ public class RequirementForm extends FormViewModel @WireVariable private RequirementTypeService reqTypeService; + + @WireVariable + private RequirementService requirementService; private RequirementItem selectedItem; @@ -105,6 +109,7 @@ public class RequirementForm extends FormViewModel this.setBigDecimalConverter(new BigDecimalConverter()); this.setRequirementFormValidator(new RequirementFormValidator()); this.setSyncItems(this.getDataBean().getItems()); + requirementService.loadType(getDataBean()); this.centres = reqTypeService.filterCentres(getDataBean().getType(), workgroupService.getUserCentres(userService.getCurrent())); } 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 872a9cc1..ecaae786 100644 --- a/src/main/java/info/bukova/isspst/ui/requirement/TripRequirementForm.java +++ b/src/main/java/info/bukova/isspst/ui/requirement/TripRequirementForm.java @@ -13,6 +13,7 @@ import info.bukova.isspst.data.TripRequirement; import info.bukova.isspst.data.User; import info.bukova.isspst.data.Workgroup; import info.bukova.isspst.services.requirement.RequirementTypeService; +import info.bukova.isspst.services.requirement.TripRequirementService; import info.bukova.isspst.services.settings.GlobalSettingsService; import info.bukova.isspst.services.users.UserService; import info.bukova.isspst.services.workgroups.WorkgroupService; @@ -29,6 +30,8 @@ public class TripRequirementForm extends FormViewModel { private GlobalSettingsService settingsService; @WireVariable private RequirementTypeService reqTypeService; + @WireVariable + private TripRequirementService tripRequirementService; private List centres; private List users; private List passengers; @@ -37,6 +40,7 @@ public class TripRequirementForm extends FormViewModel { @Init(superclass = true) public void init() { + tripRequirementService.loadType(getDataBean()); centres = reqTypeService.filterCentres(getDataBean().getType(), workgroupService.getUserCentres(userService.getCurrent())); users = userService.getAll(); passengers = getDataBean().getPassengers();