diff --git a/src/main/java/info/bukova/isspst/Constants.java b/src/main/java/info/bukova/isspst/Constants.java index fe13529a..f8c60ee8 100644 --- a/src/main/java/info/bukova/isspst/Constants.java +++ b/src/main/java/info/bukova/isspst/Constants.java @@ -150,6 +150,11 @@ public class Constants { new ReportMapping(MOD_TRIPREQUIREMENTS, new Report(7, true, "Žádost o SC", "tripRequirementApp", false, true)), new ReportMapping(MOD_REQUIREMENTS, new Report(8, true, "Protokol o kontrole", "orderRequirement", false, true)) }; + + public final static Map, Integer> SIGN_REPORT_MAP = Collections.unmodifiableMap(new HashMap, Integer>() {{ + put(TripBillApproval.class, 4); + put(TripRequirement.class, 7); + }}); public final static String REQTYPE_ORDER = "ORDER"; public final static String REQTYPE_BUSINESSTRIP = "BUSINESSTRIP"; diff --git a/src/main/java/info/bukova/isspst/services/requirement/RequirementBaseServiceImpl.java b/src/main/java/info/bukova/isspst/services/requirement/RequirementBaseServiceImpl.java index d58f9f0e..2db68aac 100644 --- a/src/main/java/info/bukova/isspst/services/requirement/RequirementBaseServiceImpl.java +++ b/src/main/java/info/bukova/isspst/services/requirement/RequirementBaseServiceImpl.java @@ -542,11 +542,17 @@ public abstract class RequirementBaseServiceImpl exte private Report getSignReport(T entity) { Module module = ModuleUtils.getModule(entityForSignReport(entity), servletContext); Report report = null; + int reportId = Constants.SIGN_REPORT_MAP.get(entity.getClass()) == null ? 0 : Constants.SIGN_REPORT_MAP.get(entity.getClass()); for (Report r : module.getReports()) { if (r.isSignable()) { - report = r; - break; + if (reportId == 0) { + report = r; + break; + } else if (reportId == r.getReportId()) { + report = r; + break; + } } } diff --git a/src/main/webapp/admin/workgroups/workgroupForm.zul b/src/main/webapp/admin/workgroups/workgroupForm.zul index bcd98bdf..df255553 100644 --- a/src/main/webapp/admin/workgroups/workgroupForm.zul +++ b/src/main/webapp/admin/workgroups/workgroupForm.zul @@ -60,7 +60,7 @@ width="300px" /> + >