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 1d84434a..4cad73f9 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 e5deb29b..5e89eb4a 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 e5deb29b..5e89eb4a 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 e5deb29b..78fecb9c 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 @@
+ +
+
+ + + +
+
+ +
+
+