From d2aa1cbd9a85c284c9a3da841cf2f6f3f1a58cf3 Mon Sep 17 00:00:00 2001 From: Josef Rokos Date: Wed, 6 Jan 2016 11:55:28 +0100 Subject: [PATCH] =?UTF-8?q?Opraveno=20vyhodnocen=C3=AD=20sestavy=20pro=20p?= =?UTF-8?q?odpis,=20pokud=20je=20v=20agend=C4=9B=20v=C3=ADce=20sestav=20s?= =?UTF-8?q?=20podpisem.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/java/info/bukova/isspst/Constants.java | 5 +++++ .../requirement/RequirementBaseServiceImpl.java | 10 ++++++++-- src/main/webapp/admin/workgroups/workgroupForm.zul | 2 +- 3 files changed, 14 insertions(+), 3 deletions(-) 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" /> + >