forked from Simnation/Main
41 lines
No EOL
1.1 KiB
JavaScript
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
|
|
}
|
|
}
|
|
}
|
|
} |