forked from Simnation/Main
ed
This commit is contained in:
parent
48a36209b5
commit
884f3df7cf
262 changed files with 223207 additions and 2 deletions
|
@ -0,0 +1,41 @@
|
|||
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
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue