forked from Simnation/Main
45 lines
No EOL
1.1 KiB
JavaScript
45 lines
No EOL
1.1 KiB
JavaScript
class EmployeesEntry{
|
|
constructor(){
|
|
this.name = "employeesentry";
|
|
}
|
|
|
|
static GetCustomDestination(data, dest){
|
|
return (data.employee_id ?? "" != "" ? "employees.view" : "employees.overview");
|
|
}
|
|
|
|
static GetCustomDestID(data, destID){
|
|
return data.employee_id ?? destID;
|
|
}
|
|
|
|
static GetColumns(){
|
|
return [];
|
|
}
|
|
|
|
static TableDataCreate(row, key){
|
|
return `<td>${row[key]}</td>`;
|
|
}
|
|
|
|
static GetEdit(data = {}){
|
|
return {
|
|
"employee_id": {
|
|
"val" : data.employee_id ?? ""
|
|
,"type" : "hidden"
|
|
,"mandatory":true
|
|
}
|
|
,"content": {
|
|
"val" : data.content ?? ""
|
|
,"type" : "textarea"
|
|
,"mandatory":true
|
|
,"isRow":true
|
|
,autogrow: true
|
|
}
|
|
,"type_of_entry": {
|
|
"val" : data.type_of_entry ?? 0
|
|
,"type" : "dropdown"
|
|
,"mandatory":true
|
|
,"isRow":true
|
|
,"options":System.getEmployeeEntryTypesOptions()
|
|
}
|
|
};
|
|
}
|
|
} |