From b8a734f817aab0222995e67f2ca5a63a0e3701b7 Mon Sep 17 00:00:00 2001 From: Josef Rokos Date: Sat, 18 Oct 2014 21:59:43 +0200 Subject: [PATCH] =?UTF-8?q?Pokud=20zad=C3=A1v=C3=A1=20po=C5=BEadavek=20u?= =?UTF-8?q?=C5=BEivatel,=20kter=C3=BD=20je=20z=C3=A1rove=C5=88=20prvn?= =?UTF-8?q?=C3=AD=20ze=20schvaluj=C3=ADc=C3=ADch=20(vedouc=C3=AD=20komise)?= =?UTF-8?q?,=20po=C5=BEadavek=20se=20za=20tohoto=20schvalovatele=20schv?= =?UTF-8?q?=C3=A1l=C3=AD=20automaticky=20hned=20p=C5=99i=20vytvo=C5=99en?= =?UTF-8?q?=C3=AD.=20closes=20#162?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../requirement/RequirementBaseServiceImpl.java | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) 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 b3adda62..82881c0f 100644 --- a/src/main/java/info/bukova/isspst/services/requirement/RequirementBaseServiceImpl.java +++ b/src/main/java/info/bukova/isspst/services/requirement/RequirementBaseServiceImpl.java @@ -68,7 +68,11 @@ public abstract class RequirementBaseServiceImpl exte super.add(entity); - this.sendToApprovers(entity); + if (canApprove(entity)) { + approve(entity); + } else { + this.sendToApprovers(entity); + } } private void checkEnable() { @@ -220,12 +224,10 @@ public abstract class RequirementBaseServiceImpl exte } else { e.setState(RequirementState.PARTIALLY); } - entity.setState(e.getState()); - entity.getAuthorization().add(auth); super.update(e); - if (!autoApprove(entity)) { + if (!autoApprove(e)) { this.sendToApprovers(e); SettingsData settings = settingsService.getSettings();