class TrainingsParticipants{ constructor(){ this.name = "trainingsparticipants"; } static allowEditEmployeeTrainings(){ return userrights.has("trainingsemployees.edit") } static GetColumns(){ return ["name","action","passed","id"] } static TableDataCreate(row, key){ if(key == "id"){ if(row.passed > -1){ let btn = ``; if(this.allowEditEmployeeTrainings()){ btn = ` `; } return ` ${btn} `; } else{ return ``; } } else if(key == "action"){ let disabled = ""; let content = ``; if(row.participate > 0){ disabled = " disabled" } if(this.allowEditEmployeeTrainings()){ content = `` } return ` ${content} `; } else if(key == "passed"){ let content = ""; if(row[key] == -1 && this.allowEditEmployeeTrainings()){ content = ` ` ; } else if(row[key] == 0){ content = ``; } else if(row[key] == 1){ content = ``; } return ` ${content} `; } else if(key == "name"){ return ` ${System.buildEmployeeName(row[key])} `; } else{ return `${row[key]}`; } } }