Skip to content
Snippets Groups Projects
Commit 98c60899 authored by srosse's avatar srosse
Browse files

OO-4150: add placeholder message for teachers in user tool

parent d9d1e034
No related branches found
No related tags found
No related merge requests found
...@@ -22,6 +22,7 @@ package org.olat.modules.coach; ...@@ -22,6 +22,7 @@ package org.olat.modules.coach;
import java.util.List; import java.util.List;
import java.util.Locale; import java.util.Locale;
import org.olat.basesecurity.IdentityRef;
import org.olat.core.id.Identity; import org.olat.core.id.Identity;
import org.olat.course.assessment.UserEfficiencyStatement; import org.olat.course.assessment.UserEfficiencyStatement;
import org.olat.group.BusinessGroup; import org.olat.group.BusinessGroup;
...@@ -43,6 +44,9 @@ import org.olat.user.propertyhandlers.UserPropertyHandler; ...@@ -43,6 +44,9 @@ import org.olat.user.propertyhandlers.UserPropertyHandler;
public interface CoachingService { public interface CoachingService {
public CoachingSecurity isCoach(Identity identity); public CoachingSecurity isCoach(Identity identity);
//TODO absence remove it in a few weeks
public boolean isTeacher(IdentityRef identity);
public List<RepositoryEntry> getStudentsCourses(Identity coach, Identity student); public List<RepositoryEntry> getStudentsCourses(Identity coach, Identity student);
......
...@@ -27,6 +27,7 @@ import java.util.Locale; ...@@ -27,6 +27,7 @@ import java.util.Locale;
import java.util.Map; import java.util.Map;
import org.olat.basesecurity.GroupRoles; import org.olat.basesecurity.GroupRoles;
import org.olat.basesecurity.IdentityRef;
import org.olat.core.id.Identity; import org.olat.core.id.Identity;
import org.olat.course.assessment.UserEfficiencyStatement; import org.olat.course.assessment.UserEfficiencyStatement;
import org.olat.course.assessment.manager.EfficiencyStatementManager; import org.olat.course.assessment.manager.EfficiencyStatementManager;
...@@ -75,6 +76,11 @@ public class CoachingServiceImpl implements CoachingService { ...@@ -75,6 +76,11 @@ public class CoachingServiceImpl implements CoachingService {
return new CoachingSecurity(masterCoach, coach, teacher); return new CoachingSecurity(masterCoach, coach, teacher);
} }
@Override
public boolean isTeacher(IdentityRef identity) {
return coachingDao.isTeacher(identity);
}
@Override @Override
public List<RepositoryEntry> getStudentsCourses(Identity coach, Identity student) { public List<RepositoryEntry> getStudentsCourses(Identity coach, Identity student) {
return coachingDao.getStudentsCourses(coach, student); return coachingDao.getStudentsCourses(coach, student);
......
...@@ -508,6 +508,7 @@ warning.choose.at.least.one.appeal=Sie m\u00FCssen mindestens einen Rekurs w\u00 ...@@ -508,6 +508,7 @@ warning.choose.at.least.one.appeal=Sie m\u00FCssen mindestens einen Rekurs w\u00
warning.choose.at.least.one.notice=Sie m\u00FCssen mindestens eine Absenz/Dispens w\u00E4hlen. warning.choose.at.least.one.notice=Sie m\u00FCssen mindestens eine Absenz/Dispens w\u00E4hlen.
warning.edit.lecture=Absenzenerfassung ist deaktiviert. warning.edit.lecture=Absenzenerfassung ist deaktiviert.
warning.repositoryentry.deleted=$org.olat.repository\:repositoryentry.deleted warning.repositoryentry.deleted=$org.olat.repository\:repositoryentry.deleted
warning.teacher.user.tool=
warning.teachers.at.least.one.contact=Es gibt kein Dozent zu kontaktieren warning.teachers.at.least.one.contact=Es gibt kein Dozent zu kontaktieren
whole.day=ganzer Tag whole.day=ganzer Tag
wizard.entries.label.block=<strong>{0}</strong> <small>{1}</small> ({2} Lektionenblock) wizard.entries.label.block=<strong>{0}</strong> <small>{1}</small> ({2} Lektionenblock)
......
...@@ -508,6 +508,7 @@ warning.choose.at.least.one.appeal=You need to choose at least one appeal ...@@ -508,6 +508,7 @@ warning.choose.at.least.one.appeal=You need to choose at least one appeal
warning.choose.at.least.one.notice=You need to choose at least one absence/dispensation warning.choose.at.least.one.notice=You need to choose at least one absence/dispensation
warning.edit.lecture=Roll call is deactivated. warning.edit.lecture=Roll call is deactivated.
warning.repositoryentry.deleted=$org.olat.repository\:repositoryentry.deleted warning.repositoryentry.deleted=$org.olat.repository\:repositoryentry.deleted
warning.teacher.user.tool=
warning.teachers.at.least.one.contact=There isn't any teacher to contact warning.teachers.at.least.one.contact=There isn't any teacher to contact
whole.day=Whole day whole.day=Whole day
wizard.entries.label.block=<strong>{0}</strong> <small>{1}</small> ({2} lectures block) wizard.entries.label.block=<strong>{0}</strong> <small>{1}</small> ({2} lectures block)
......
...@@ -508,6 +508,7 @@ warning.choose.at.least.one.appeal=S'il-vous-pla\u00EEt, s\u00E9lectionnez au mo ...@@ -508,6 +508,7 @@ warning.choose.at.least.one.appeal=S'il-vous-pla\u00EEt, s\u00E9lectionnez au mo
warning.choose.at.least.one.notice=Vous devez s\u00E9lectionner au moins une absence / dispense. warning.choose.at.least.one.notice=Vous devez s\u00E9lectionner au moins une absence / dispense.
warning.edit.lecture=Le contr\u00F4le d'absence est d\u00E9sactiv\u00E9. warning.edit.lecture=Le contr\u00F4le d'absence est d\u00E9sactiv\u00E9.
warning.repositoryentry.deleted=$org.olat.repository\:repositoryentry.deleted warning.repositoryentry.deleted=$org.olat.repository\:repositoryentry.deleted
warning.teacher.user.tool=
warning.teachers.at.least.one.contact=Il n'y a pas de charg\u00E9s de cours \u00E0 contacter. warning.teachers.at.least.one.contact=Il n'y a pas de charg\u00E9s de cours \u00E0 contacter.
whole.day=Journ\u00E9e enti\u00E8re whole.day=Journ\u00E9e enti\u00E8re
wizard.entries.label.block=<strong>{0}</strong> <small>{1}</small> ({2} cours bloc) wizard.entries.label.block=<strong>{0}</strong> <small>{1}</small> ({2} cours bloc)
......
...@@ -355,3 +355,4 @@ total=Total ...@@ -355,3 +355,4 @@ total=Total
unoverride.lecture=Interromper altera\u00E7\u00E3o/sobreposi\u00E7\u00E3o unoverride.lecture=Interromper altera\u00E7\u00E3o/sobreposi\u00E7\u00E3o
warning.edit.lecture=Chamada (Roll Call) est\u00E1 inativa warning.edit.lecture=Chamada (Roll Call) est\u00E1 inativa
warning.repositoryentry.deleted=$org.olat.repository\:repositoryentry.deleted warning.repositoryentry.deleted=$org.olat.repository\:repositoryentry.deleted
warning.teacher.user.tool=S
...@@ -41,11 +41,14 @@ import org.olat.core.gui.control.generic.wizard.StepsMainRunController; ...@@ -41,11 +41,14 @@ import org.olat.core.gui.control.generic.wizard.StepsMainRunController;
import org.olat.core.id.Identity; import org.olat.core.id.Identity;
import org.olat.core.id.context.ContextEntry; import org.olat.core.id.context.ContextEntry;
import org.olat.core.id.context.StateEntry; import org.olat.core.id.context.StateEntry;
import org.olat.core.util.StringHelper;
import org.olat.core.util.Util; import org.olat.core.util.Util;
import org.olat.modules.coach.CoachingService;
import org.olat.modules.lecture.AbsenceNoticeType; import org.olat.modules.lecture.AbsenceNoticeType;
import org.olat.modules.lecture.model.EditAbsenceNoticeWrapper; import org.olat.modules.lecture.model.EditAbsenceNoticeWrapper;
import org.olat.modules.lecture.ui.AppealListRepositoryController; import org.olat.modules.lecture.ui.AppealListRepositoryController;
import org.olat.modules.lecture.ui.LectureRepositoryAdminController; import org.olat.modules.lecture.ui.LectureRepositoryAdminController;
import org.olat.modules.lecture.ui.LectureRoles;
import org.olat.modules.lecture.ui.LecturesSecurityCallback; import org.olat.modules.lecture.ui.LecturesSecurityCallback;
import org.olat.modules.lecture.ui.ParticipantLecturesOverviewController; import org.olat.modules.lecture.ui.ParticipantLecturesOverviewController;
import org.olat.modules.lecture.ui.coach.DispensationsController; import org.olat.modules.lecture.ui.coach.DispensationsController;
...@@ -53,6 +56,7 @@ import org.olat.modules.lecture.ui.wizard.AbsenceNotice3LecturesEntriesStep; ...@@ -53,6 +56,7 @@ import org.olat.modules.lecture.ui.wizard.AbsenceNotice3LecturesEntriesStep;
import org.olat.modules.lecture.ui.wizard.AbsenceNoticeCancelStepCallback; import org.olat.modules.lecture.ui.wizard.AbsenceNoticeCancelStepCallback;
import org.olat.modules.lecture.ui.wizard.AbsenceNoticeFinishStepCallback; import org.olat.modules.lecture.ui.wizard.AbsenceNoticeFinishStepCallback;
import org.olat.user.DisplayPortraitController; import org.olat.user.DisplayPortraitController;
import org.springframework.beans.factory.annotation.Autowired;
/** /**
* *
...@@ -84,6 +88,9 @@ public class IdentityProfileController extends BasicController implements Activa ...@@ -84,6 +88,9 @@ public class IdentityProfileController extends BasicController implements Activa
private DailyOverviewProfilController dailyOverviewCtrl; private DailyOverviewProfilController dailyOverviewCtrl;
private ParticipantLecturesOverviewController lecturesCtrl; private ParticipantLecturesOverviewController lecturesCtrl;
@Autowired
private CoachingService coachingService;
public IdentityProfileController(UserRequest ureq, WindowControl wControl, Identity profiledIdentity, public IdentityProfileController(UserRequest ureq, WindowControl wControl, Identity profiledIdentity,
LecturesSecurityCallback secCallback, boolean withBack) { LecturesSecurityCallback secCallback, boolean withBack) {
super(ureq, wControl, Util.createPackageTranslator(LectureRepositoryAdminController.class, ureq.getLocale())); super(ureq, wControl, Util.createPackageTranslator(LectureRepositoryAdminController.class, ureq.getLocale()));
...@@ -103,6 +110,14 @@ public class IdentityProfileController extends BasicController implements Activa ...@@ -103,6 +110,14 @@ public class IdentityProfileController extends BasicController implements Activa
listenTo(userDescr); listenTo(userDescr);
mainVC.put("userDescr", userDescr.getInitialComponent()); mainVC.put("userDescr", userDescr.getInitialComponent());
//TODO absences remove in a few weeks
if(secCallback.viewAs() == LectureRoles.participant) {
String msg = translate("warning.teacher.user.tool");
if(StringHelper.containsNonWhitespace(msg) && coachingService.isTeacher(getIdentity())) {
mainVC.contextPut("teacherMessage", msg);
}
}
//new absence, new notice of absence, new dispensation //new absence, new notice of absence, new dispensation
addAbsence = LinkFactory.createButton("add.absence", mainVC, this); addAbsence = LinkFactory.createButton("add.absence", mainVC, this);
addAbsence.setIconLeftCSS("o_icon o_icon_add"); addAbsence.setIconLeftCSS("o_icon o_icon_add");
......
#if($r.available("back")) #if($r.available("back"))
<div class="o_block">$r.render("back")</div> <div class="o_block">$r.render("back")</div>
#end #end
#if($r.isNotEmpty($teacherMessage))
<div class="o_info">$teacherMessage</div>
#end
<div class="o_user_infos row"> <div class="o_user_infos row">
<div class="o_user_portrait">$r.render("portrait")</div> <div class="o_user_portrait">$r.render("portrait")</div>
<div class="o_user_infos_inner">$r.render("userDescr")</div> <div class="o_user_infos_inner">$r.render("userDescr")</div>
......
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