import BaseController from "lectures/controller/BaseController" ; import { CalendarDayType } from "sap/ui/unified/library" ; namespace export default class Formatter { public lectureDetails ( this , courseDescr , profFirstname , profLastname , profTitle , roomName ) { const name = this . formatter . professorName ( profFirstname , profLastname , profTitle ) ; const course = courseDescr ? courseDescr : "" ; const room = roomName ? `[${ roomName }]` : "" ; return [ course , room , name ] . join ( ' ' ) ; } public professorName ( firstname , lastname , title ) { if ( ! firstname && ! lastname ) return "" ; let name = `${ firstname } ${ lastname }` ; if ( title ) { name += `, ${ title }` ; } return name ; } public appointmentTitle ( this , courseName , roomName ) { return courseName ? courseName : this . resourceBundle . getText ( "lecture" , [ roomName ] ) ; } public hasAdminRole ( infoLoaded , roles ) { if ( infoLoaded ) return roles ? roles . includes ( "LectureScheduleAdmin" ) : false ; return true ; } public userInitials ( firstname , lastname ) { return ( firstname && lastname ) ? firstname . substring ( 0 , 1 ) + lastname . substring ( 0 , 1 ) : "" ; } public lectureType ( allday ) { return allday ? CalendarDayType . Type05 : CalendarDayType . Type07 ; } public lectureIcon ( allday ) { return allday ? "sap-icon://marketing-campaign" : "sap-icon://education" ; } }