1
0
Fork 0
forked from Simnation/Main
Main/resources/[jobs]/[mdt]/myEmergency/html/js/modules/Licenses.js
2025-08-14 13:21:51 +02:00

41 lines
No EOL
1.1 KiB
JavaScript

class Licenses{
constructor(){
this.name = "licenses";
}
static GetColumns(){
return ["name","id"]
}
static allowAddNew(){
return userrights.has("licenses.edit") && (!sync.isActive("licenses") || currentSystem == "medic")
}
static allowEdit(){
return userrights.has("licenses.edit") && (!sync.isActive("licenses") || currentSystem == "medic")
}
static allowDelete(){
return userrights.has("licenses.delete") && (!sync.isActive("licenses") || currentSystem == "medic")
}
static TableDataCreate(row, key){
if(key == "id"){
return `
<td>
${Form.getEditButtonIcon(row[key] , this.name + ".edit", this.allowEdit())}
${Form.getDeleteButtonIcon(row[key], this.name, this.allowDelete())}
</td>`;
}
else{
return `<td>${row[key]}</td>`;
}
}
static GetEdit(data={}){
return {
"name": {
"val" : data.name ?? ""
,"type" : "text"
,"isRow": true
,"mandatory":true
}
}
}
}