From ab5ed127720e0b6d3985257ab3ea3840c676a3c4 Mon Sep 17 00:00:00 2001 From: Franta Pribyl Date: Wed, 1 Oct 2014 13:04:16 +0200 Subject: [PATCH] =?UTF-8?q?Po=C5=BEadavky=20na=20materi=C3=A1ly=20a=20slu?= =?UTF-8?q?=C5=BEby=20-=20do=20z=C3=A1lo=C5=BEek=20[M=C3=A1=20st=C5=99edis?= =?UTF-8?q?ka],=20[M=C3=A9=20komise]=20a=20[V=C5=A1e]=20p=C5=99id=C3=A1n?= =?UTF-8?q?=20sloupec=20[Vytvo=C5=99il]=20-=20opraveno=20pln=C4=9Bn=C3=AD?= =?UTF-8?q?=20a=20filtrov=C3=A1n=C3=AD=20st=C5=99edisek=20na=20v=C5=A1ech?= =?UTF-8?q?=20z=C3=A1lo=C5=BEk=C3=A1ch=20-=20slu=C5=BEba=20userService=20p?= =?UTF-8?q?=C5=99esunuta=20do=20t=C5=99=C3=ADdy=20RequirementSubpage?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit closes #144 --- .../isspst/filters/RequirementFilter.java | 6 ++- .../main/orders/requirements/ReqListMy.java | 6 +-- .../orders/requirements/ReqListMyAll.java | 6 +-- .../orders/requirements/ReqListMyCenters.java | 4 -- .../requirements/ReqListMyWorkgroups.java | 6 +-- .../ui/requirement/RequirementSubpage.java | 13 ++++++ .../TripRequirementListCentre.java | 5 +-- .../TripRequirementListWorkgroup.java | 6 +-- .../main/orders/requirements/reqListMy.zul | 19 ++++---- .../main/orders/requirements/reqListMyAll.zul | 45 +++++++++++++++---- .../orders/requirements/reqListMyCenters.zul | 45 +++++++++++++++---- .../requirements/reqListMyWorkgroups.zul | 45 +++++++++++++++---- 12 files changed, 148 insertions(+), 58 deletions(-) diff --git a/src/main/java/info/bukova/isspst/filters/RequirementFilter.java b/src/main/java/info/bukova/isspst/filters/RequirementFilter.java index 6a6296dd..4d857737 100644 --- a/src/main/java/info/bukova/isspst/filters/RequirementFilter.java +++ b/src/main/java/info/bukova/isspst/filters/RequirementFilter.java @@ -3,6 +3,8 @@ package info.bukova.isspst.filters; import info.bukova.isspst.DateTimeUtils; import info.bukova.isspst.StringUtils; import info.bukova.isspst.data.Requirement; +import info.bukova.isspst.data.User; +import info.bukova.isspst.data.Workgroup; import org.hamcrest.Description; import org.hamcrest.Factory; @@ -40,9 +42,11 @@ public class RequirementFilter implements Filter { boolean foundNumser = StringUtils.isEqualForFilter(item.getNumser(), condition.getNumser()); boolean foundReqDate = DateTimeUtils.isEqualByDateForFilter(item.getReqDate(), condition.getReqDate()); + boolean foundCenter = Workgroup.isEqualByWorkgroupForFilter(item.getCentre(), condition.getCentre()); boolean foundDescription = StringUtils.isEqualForFilter(item.getDescription(), condition.getDescription()); boolean foundDeliveryDate = DateTimeUtils.isEqualByDateForFilter(item.getDeliveryDate(), condition.getDeliveryDate()); - return foundNumser && foundReqDate && foundDescription && foundDeliveryDate; + boolean foundUser = User.isEqualByUserForFilter(item.getOwnedBy(), condition.getOwnedBy()); + return (foundNumser && foundReqDate && foundCenter && foundDescription && foundDeliveryDate && foundUser); } @Factory diff --git a/src/main/java/info/bukova/isspst/ui/main/orders/requirements/ReqListMy.java b/src/main/java/info/bukova/isspst/ui/main/orders/requirements/ReqListMy.java index bc13232f..a33e390c 100644 --- a/src/main/java/info/bukova/isspst/ui/main/orders/requirements/ReqListMy.java +++ b/src/main/java/info/bukova/isspst/ui/main/orders/requirements/ReqListMy.java @@ -4,7 +4,6 @@ import info.bukova.isspst.data.Requirement; import info.bukova.isspst.data.Workgroup; import info.bukova.isspst.filters.RequirementFilter; import info.bukova.isspst.services.requirement.RequirementService; -import info.bukova.isspst.services.users.UserService; import info.bukova.isspst.services.workgroups.WorkgroupService; import info.bukova.isspst.ui.requirement.RequirementSubpage; @@ -21,15 +20,12 @@ public class ReqListMy extends RequirementSubpage @WireVariable protected RequirementService requirementService; - @WireVariable - protected UserService userService; - @WireVariable protected WorkgroupService workgroupService; public List getCentres() { - return workgroupService.getUserCentres(userService.getCurrent()); + return workgroupService.getCentres(); } @Init diff --git a/src/main/java/info/bukova/isspst/ui/main/orders/requirements/ReqListMyAll.java b/src/main/java/info/bukova/isspst/ui/main/orders/requirements/ReqListMyAll.java index 5ffc7f2f..97d184fb 100644 --- a/src/main/java/info/bukova/isspst/ui/main/orders/requirements/ReqListMyAll.java +++ b/src/main/java/info/bukova/isspst/ui/main/orders/requirements/ReqListMyAll.java @@ -4,7 +4,6 @@ import info.bukova.isspst.data.Requirement; import info.bukova.isspst.data.Workgroup; import info.bukova.isspst.filters.RequirementFilter; import info.bukova.isspst.services.requirement.RequirementService; -import info.bukova.isspst.services.users.UserService; import info.bukova.isspst.services.workgroups.WorkgroupService; import info.bukova.isspst.ui.requirement.RequirementSubpage; @@ -23,15 +22,12 @@ public class ReqListMyAll extends RequirementSubpage @WireVariable protected RequirementService requirementService; - @WireVariable - protected UserService userService; - @WireVariable protected WorkgroupService workgroupService; public List getCentres() { - return workgroupService.getUserCentres(userService.getCurrent()); + return workgroupService.getCentres(); } @Init diff --git a/src/main/java/info/bukova/isspst/ui/main/orders/requirements/ReqListMyCenters.java b/src/main/java/info/bukova/isspst/ui/main/orders/requirements/ReqListMyCenters.java index 737d67c4..184b20ed 100644 --- a/src/main/java/info/bukova/isspst/ui/main/orders/requirements/ReqListMyCenters.java +++ b/src/main/java/info/bukova/isspst/ui/main/orders/requirements/ReqListMyCenters.java @@ -4,7 +4,6 @@ import info.bukova.isspst.data.Requirement; import info.bukova.isspst.data.Workgroup; import info.bukova.isspst.filters.RequirementFilter; import info.bukova.isspst.services.requirement.RequirementService; -import info.bukova.isspst.services.users.UserService; import info.bukova.isspst.services.workgroups.WorkgroupService; import info.bukova.isspst.ui.requirement.RequirementSubpage; @@ -23,9 +22,6 @@ public class ReqListMyCenters extends RequirementSubpage @WireVariable protected RequirementService requirementService; - @WireVariable - protected UserService userService; - @WireVariable protected WorkgroupService workgroupService; diff --git a/src/main/java/info/bukova/isspst/ui/main/orders/requirements/ReqListMyWorkgroups.java b/src/main/java/info/bukova/isspst/ui/main/orders/requirements/ReqListMyWorkgroups.java index 568bfd9e..9cf4f10d 100644 --- a/src/main/java/info/bukova/isspst/ui/main/orders/requirements/ReqListMyWorkgroups.java +++ b/src/main/java/info/bukova/isspst/ui/main/orders/requirements/ReqListMyWorkgroups.java @@ -4,7 +4,6 @@ import info.bukova.isspst.data.Requirement; import info.bukova.isspst.data.Workgroup; import info.bukova.isspst.filters.RequirementFilter; import info.bukova.isspst.services.requirement.RequirementService; -import info.bukova.isspst.services.users.UserService; import info.bukova.isspst.services.workgroups.WorkgroupService; import info.bukova.isspst.ui.requirement.RequirementSubpage; @@ -23,15 +22,12 @@ public class ReqListMyWorkgroups extends RequirementSubpage @WireVariable protected RequirementService requirementService; - @WireVariable - protected UserService userService; - @WireVariable protected WorkgroupService workgroupService; public List getCentres() { - return workgroupService.getUserCentres(userService.getCurrent()); + return workgroupService.getCentres(); } @Init 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 ce76f066..5a79f111 100644 --- a/src/main/java/info/bukova/isspst/ui/requirement/RequirementSubpage.java +++ b/src/main/java/info/bukova/isspst/ui/requirement/RequirementSubpage.java @@ -1,17 +1,30 @@ package info.bukova.isspst.ui.requirement; import info.bukova.isspst.data.RequirementBase; +import info.bukova.isspst.data.User; import info.bukova.isspst.services.requirement.RequirementBaseService; +import info.bukova.isspst.services.users.UserService; import info.bukova.isspst.ui.BigDecimalConverter; import info.bukova.isspst.ui.ListViewModel; +import java.util.List; + import org.zkoss.bind.BindUtils; import org.zkoss.bind.annotation.Command; import org.zkoss.bind.annotation.Init; import org.zkoss.bind.annotation.NotifyChange; +import org.zkoss.zk.ui.select.annotation.WireVariable; public class RequirementSubpage extends ListViewModel { + @WireVariable + protected UserService userService; + + public List getAllUsers() + { + return userService.getAll(); + } + private BigDecimalConverter bigDecimalConverter; public BigDecimalConverter getBigDecimalConverter() diff --git a/src/main/java/info/bukova/isspst/ui/requirement/TripRequirementListCentre.java b/src/main/java/info/bukova/isspst/ui/requirement/TripRequirementListCentre.java index bf50a9c6..cccf1a00 100644 --- a/src/main/java/info/bukova/isspst/ui/requirement/TripRequirementListCentre.java +++ b/src/main/java/info/bukova/isspst/ui/requirement/TripRequirementListCentre.java @@ -4,7 +4,6 @@ import info.bukova.isspst.data.TripRequirement; import info.bukova.isspst.data.Workgroup; import info.bukova.isspst.filters.TripRequirementFilter; import info.bukova.isspst.services.requirement.TripRequirementService; -import info.bukova.isspst.services.users.UserService; import info.bukova.isspst.services.workgroups.WorkgroupService; import java.util.ArrayList; @@ -21,10 +20,10 @@ public class TripRequirementListCentre extends RequirementSubpage myCentres; @Init diff --git a/src/main/java/info/bukova/isspst/ui/requirement/TripRequirementListWorkgroup.java b/src/main/java/info/bukova/isspst/ui/requirement/TripRequirementListWorkgroup.java index 7e96eca2..3aff0cfb 100644 --- a/src/main/java/info/bukova/isspst/ui/requirement/TripRequirementListWorkgroup.java +++ b/src/main/java/info/bukova/isspst/ui/requirement/TripRequirementListWorkgroup.java @@ -4,7 +4,6 @@ import info.bukova.isspst.data.TripRequirement; import info.bukova.isspst.data.Workgroup; import info.bukova.isspst.filters.TripRequirementFilter; import info.bukova.isspst.services.requirement.TripRequirementService; -import info.bukova.isspst.services.users.UserService; import info.bukova.isspst.services.workgroups.WorkgroupService; import java.util.ArrayList; @@ -21,11 +20,12 @@ public class TripRequirementListWorkgroup extends RequirementSubpage myCentres; + private List myWorkgroups; @Init diff --git a/src/main/webapp/main/orders/requirements/reqListMy.zul b/src/main/webapp/main/orders/requirements/reqListMy.zul index 16895e34..73d1beb8 100644 --- a/src/main/webapp/main/orders/requirements/reqListMy.zul +++ b/src/main/webapp/main/orders/requirements/reqListMy.zul @@ -8,28 +8,28 @@ + hflex="7" /> + hflex="13" /> + sort="auto(centre)" + hflex="15" /> + hflex="13" /> + hflex="10" /> + hflex="20" />
+ selectedItem="@bind(vm.filterTemplate.centre)"> diff --git a/src/main/webapp/main/orders/requirements/reqListMyAll.zul b/src/main/webapp/main/orders/requirements/reqListMyAll.zul index 1eab5acb..e99b8985 100644 --- a/src/main/webapp/main/orders/requirements/reqListMyAll.zul +++ b/src/main/webapp/main/orders/requirements/reqListMyAll.zul @@ -10,28 +10,32 @@ + hflex="7" /> + hflex="13" /> + sort="auto(centre)" + hflex="15" /> + hflex="13" /> + hflex="10" /> + hflex="20" /> +
+ selectedItem="@bind(vm.filterTemplate.centre)"> @@ -124,6 +131,27 @@
+ +
+
+ + + +
+
+ +
+
+
diff --git a/src/main/webapp/main/orders/requirements/reqListMyCenters.zul b/src/main/webapp/main/orders/requirements/reqListMyCenters.zul index 1eab5acb..e99b8985 100644 --- a/src/main/webapp/main/orders/requirements/reqListMyCenters.zul +++ b/src/main/webapp/main/orders/requirements/reqListMyCenters.zul @@ -10,28 +10,32 @@ + hflex="7" /> + hflex="13" /> + sort="auto(centre)" + hflex="15" /> + hflex="13" /> + hflex="10" /> + hflex="20" /> +
+ selectedItem="@bind(vm.filterTemplate.centre)"> @@ -124,6 +131,27 @@
+ +
+
+ + + +
+
+ +
+
+
diff --git a/src/main/webapp/main/orders/requirements/reqListMyWorkgroups.zul b/src/main/webapp/main/orders/requirements/reqListMyWorkgroups.zul index 1eab5acb..ce25ff94 100644 --- a/src/main/webapp/main/orders/requirements/reqListMyWorkgroups.zul +++ b/src/main/webapp/main/orders/requirements/reqListMyWorkgroups.zul @@ -10,28 +10,32 @@ + hflex="7" /> + hflex="13" /> + sort="auto(centre)" + hflex="15" /> + hflex="13" /> + hflex="10" /> + hflex="20" /> +
+ selectedItem="@bind(vm.filterTemplate.centre)"> @@ -124,6 +131,27 @@
+ +
+
+ + + +
+
+ +
+
+