class InvestigationEntry{ constructor(){ this.name = "investigationentry"; } static GetCustomDestination(data, dest){ return data.investigation_id > 0 ? "investigation.view" : dest; } static GetCustomDestID(data, destID){ return data.investigation_id ?? destID; } static TableDataCreate(row, key){ if(key == "is_important_entry"){ if(row[key]){ return ` ` ; } else{ return "" } } else if(key == "creator"){ return `${System.buildEmployeeName(row[key])}`; } else{ if(row[key].includes(" ")){ //todo everywhere return `${row[key].replace(/\n/g,"
")}`; } else{ return `${row[key].replace(/\n/g,"
")}`; } } } static GetColumns(){ return ["creator","content","is_important_entry"] } static GetEdit(data={}){ return { "investigation_id": { "val" : data.investigation_id ?? "-1" ,"type" : "hidden" ,"isRow": true ,"mandatory":true }, "content": { "val" : data.content ?? "" ,"type" : "textarea" ,"isRow": true ,"mandatory":true ,autogrow: true ,rows:3 } ,"is_important_entry": { "val" : data.is_important_entry ?? "" ,"type" : "dropdown" ,"isRow": true ,"mandatory":true ,"options":System.GetBooleanOptions() } } } }