Skip to content
Snippets Groups Projects
Commit 740ebc25 authored by srosse's avatar srosse
Browse files

Merge remote-tracking branch 'origin/OpenOLAT_12.5' into OpenOLAT_13.2

parents d322c800 cc968c21
No related branches found
No related tags found
No related merge requests found
......@@ -99,7 +99,12 @@ public class CancelRollCallConfirmationController extends FormBasicController {
}
}
if(!found) {
effectiveEndReasonEl.select(reasonKeyList.get(0), true);
if(reasonKeyList.isEmpty()) {
effectiveEndReasonEl.setEnabled(false);
effectiveEndReasonEl.setVisible(false);
} else {
effectiveEndReasonEl.select(reasonKeyList.get(0), true);
}
}
......@@ -120,7 +125,7 @@ public class CancelRollCallConfirmationController extends FormBasicController {
boolean allOk = true;
effectiveEndReasonEl.clearError();
if(!effectiveEndReasonEl.isOneSelected()) {
if(effectiveEndReasonEl.isEnabled() && !effectiveEndReasonEl.isOneSelected()) {
effectiveEndReasonEl.setErrorKey("error.reason.mandatory", null);
allOk &= false;
}
......@@ -131,9 +136,11 @@ public class CancelRollCallConfirmationController extends FormBasicController {
@Override
protected void formOK(UserRequest ureq) {
String before = lectureService.toAuditXml(lectureBlock);
Long reasonKey = new Long(effectiveEndReasonEl.getSelectedKey());
Reason selectedReason = lectureService.getReason(reasonKey);
lectureBlock.setReasonEffectiveEnd(selectedReason);
if(effectiveEndReasonEl.isEnabled()) {
Long reasonKey = Long.valueOf(effectiveEndReasonEl.getSelectedKey());
Reason selectedReason = lectureService.getReason(reasonKey);
lectureBlock.setReasonEffectiveEnd(selectedReason);
}
lectureBlock = lectureService.cancel(lectureBlock);
String after = lectureService.toAuditXml(lectureBlock);
lectureService.auditLog(LectureBlockAuditLog.Action.cancelLectureBlock, before, after, null, lectureBlock, null, lectureBlock.getEntry(), null, getIdentity());
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment