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,59 @@
|
|||
class ControlCentreEmployees{
|
||||
constructor(){
|
||||
this.name = "controlcentreemployees";
|
||||
}
|
||||
|
||||
static allowEdit(){
|
||||
return userrights.has("controlcentre.take");
|
||||
}
|
||||
|
||||
static isCustom(){
|
||||
return true;
|
||||
}
|
||||
|
||||
static GetColumns(){
|
||||
return ["name","radio_short_name","id"]
|
||||
}
|
||||
|
||||
static TableDataCreate(row, key){
|
||||
let FgColor = System.GetFgColorByBgColor(row["radio_color"]);
|
||||
|
||||
if(row["radio_color"] == ""){
|
||||
row["radio_color"] = "#FFFFFF";
|
||||
}
|
||||
|
||||
if(key == "id"){
|
||||
if(!this.allowEdit()){
|
||||
return `<td></td>`
|
||||
}
|
||||
return `
|
||||
<td style="color:${FgColor}; background:${row["radio_color"]}">
|
||||
<button type="button" class="btn btn-sm btn-primary" onclick="resetEmployeeRadio('${row["id"]}')">
|
||||
<i class="fa-solid fa-delete-left"></i>
|
||||
</button>
|
||||
<button type="button" class="btn btn-sm btn-warning" onclick="loadPage('employeevehicle.edit', '${row["id"]}')">
|
||||
<i class="fa-solid fa-car-on"></i>
|
||||
</button>
|
||||
<button type="button" class="btn btn-sm btn-warning" onclick="loadPage('employeeradio.edit', '${row["id"]}')">
|
||||
<i class="fa-solid fa-tower-broadcast"></i>
|
||||
</button>
|
||||
</td>`;
|
||||
}
|
||||
|
||||
else if(key == "radio_short_name"){
|
||||
return `
|
||||
<td style="color:${FgColor}; background:${row["radio_color"]}">
|
||||
${row[key] == "" ? getTranslation("emergency_vehicles_no_radio") : row[key]}
|
||||
</td>`;
|
||||
}
|
||||
else if(key == "name"){
|
||||
return `
|
||||
<td style="color:${FgColor}; background:${row["radio_color"]}">
|
||||
${row["serviceno"] ?? System.getServiceNo(row.id)} - ${System.buildEmployeeName(row[key])}
|
||||
</td>`;
|
||||
}
|
||||
else {
|
||||
return `<td style="color:${FgColor}; background:${row["radio_color"]}">${row[key]}</td>`;
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue