class SharedFiles{ constructor(){ this.name = "sharedfiles"; } static allowAddNew(){ return false; } static allowEdit(){ return false; } static allowDelete(){ return false; } static GetColumns(){ return ["fromsystem","name","state","id"]; } static GetExtraForView(data){ let retval = { top:"", bottom:"", initTableButtons:false, } let temp = Files.GetFileEntryHTML(data, false) retval.bottom += temp.html; return retval; } static TableDataCreate(row, key){ if(key == "state"){ let badges = ``; if(row[key] != ""){ badges += `
${getTranslation("tag_" + row[key])}
`; } return `${badges}`; } else if(key == "fromsystem"){ return `${row[key]}`; } else if(key == "id"){ return ` ${Form.getViewButtonIcon(row[key] + "|##|" + row.real_from_system, this.name + ".view")} `; } else{ return `${row[key]}`; } } static GetEdit(data = {}){ if(data.fromsystem == "police"){ return { "name": { "val" : data.name ?? "" ,"type" : "text" ,"mandatory":true } ,"alias": { "val" : data.alias ?? "" ,"type" : "text" ,"mandatory":true } ,"sex": { "val" : data.sex ?? "" ,"type" : "dropdown" ,"mandatory":true ,"options":[ {id:0, name:getTranslation("unknown")}, {id:1, name:getTranslation("male")}, {id:2, name:getTranslation("female")}, {id:3, name:getTranslation("diverse")} ] } ,"phone": { "val" : data.phone ?? "" ,"type" : "text" ,"mandatory":false } ,"size": { "val" : data.size ?? "" ,"type" : "number" ,"mandatory":false } ,"birth": { "val" : data.birth ?? "" ,"type" : "date" ,"mandatory":false } ,"eyecolor": { "val" : data.eyecolor ?? "" ,"type" : "text" ,"mandatory":false } ,"haircolor": { "val" : data.haircolor ?? "" ,"type" : "text" ,"mandatory":false } }; } else if(data.fromsystem == "medic"){ return { "name": { "val" : data.name ?? "" ,"type" : "text" ,"mandatory":true ,"isRow":true } ,"blood_type": { "val" : data.blood_type ?? "A" ,"type" : "dropdown" ,"mandatory":true ,options:[ {id:"A", name:"A+"}, {id:"A-", name:"A-"}, {id:"B", name:"B+"}, {id:"B-", name:"B-"}, {id:"AB", name:"AB+"}, {id:"AB-", name:"AB-"}, {id:"0", name:"0+"}, {id:"0-", name:"0-"}, ] } ,"sex": { "val" : data.sex ?? "" ,"type" : "dropdown" ,"mandatory":true ,"options":[ {id:0, name:getTranslation("unknown")}, {id:1, name:getTranslation("male")}, {id:2, name:getTranslation("female")}, {id:3, name:getTranslation("diverse")} ] } ,"phone": { "val" : data.phone ?? "" ,"type" : "text" ,"mandatory":false } ,"birth": { "val" : data.birth ?? "" ,"type" : "date" ,"mandatory":false } ,"size": { "val" : data.size ?? "" ,"type" : "number" ,"mandatory":false } ,"weight": { "val" : data.weight ?? "" ,"type" : "number" ,"mandatory":false } ,"allergies": { "val" : data.allergies ?? "" ,"type" : "textarea" ,"mandatory":false ,rows:3 } ,"known_illnesses": { "val" : data.known_illnesses ?? "" ,"type" : "textarea" ,"mandatory":false ,rows:3 } }; } } }