From f11760d867844b9adf4ebc1ead2623253c87e38f Mon Sep 17 00:00:00 2001 From: naielv <109038805+naielv@users.noreply.github.com> Date: Sun, 7 Sep 2025 15:52:00 +0200 Subject: [PATCH] update --- src/app_modules.js | 9 - src/index.html | 15 -- src/page/aulas.js | 4 +- src/page/avisos.js | 2 +- src/page/comedor.js | 2 +- src/page/dataman.js | 104 ++++---- src/page/materiales.js | 3 +- src/page/notas.js | 2 +- src/page/personas.js | 2 +- src/page/supercafe.js | 549 +++++++++++++++++++++-------------------- 10 files changed, 337 insertions(+), 355 deletions(-) diff --git a/src/app_modules.js b/src/app_modules.js index b6837dc..2ea7e79 100644 --- a/src/app_modules.js +++ b/src/app_modules.js @@ -67,14 +67,6 @@ String.prototype.toHex = function() { return wheelcolors[hash % wheelcolors.length]; }; -// Test -console.log("hello".toHex()); -console.log("world".toHex()); -console.log("foo".toHex()); -console.log("bar".toHex()); - - - function stringToColour(str) { return str.toHex(); } @@ -1038,7 +1030,6 @@ function TS_IndexElement( } function BuildQR(mid, label) { - console.warn("BARCODE " + mid + " LABEL " + label) return ` TeleSec AztecQR diff --git a/src/index.html b/src/index.html index 367ae84..b47a4e7 100644 --- a/src/index.html +++ b/src/index.html @@ -95,21 +95,6 @@ - diff --git a/src/page/aulas.js b/src/page/aulas.js index 9f7071a..de8e0cc 100644 --- a/src/page/aulas.js +++ b/src/page/aulas.js @@ -141,7 +141,7 @@ PAGES.aulas = { load_data(data, "%E"); }); } else { - load_data(data); + load_data(data || {}); } }); document.getElementById(btn_guardar).onclick = () => { @@ -276,7 +276,7 @@ PAGES.aulas = { load_data(data, "%E"); }); } else { - load_data(data); + load_data(data || {}); } }); document.getElementById(btn_guardar).onclick = () => { diff --git a/src/page/avisos.js b/src/page/avisos.js index 9166fc0..c871686 100644 --- a/src/page/avisos.js +++ b/src/page/avisos.js @@ -124,7 +124,7 @@ PAGES.avisos = { load_data(data, "%E"); }); } else { - load_data(data); + load_data(data || {}); } }); document.getElementById(btn_guardar).onclick = () => { diff --git a/src/page/comedor.js b/src/page/comedor.js index aef35c4..ecb2c28 100644 --- a/src/page/comedor.js +++ b/src/page/comedor.js @@ -44,7 +44,7 @@ PAGES.comedor = { load_data(data, "%E"); }); } else { - load_data(data); + load_data(data || {}); } }); document.getElementById(btn_guardar).onclick = () => { diff --git a/src/page/dataman.js b/src/page/dataman.js index ac38563..37e92da 100644 --- a/src/page/dataman.js +++ b/src/page/dataman.js @@ -3,25 +3,25 @@ PAGES.dataman = { icon: "static/appico/Cogs.svg", AccessControl: true, Title: "Ajustes", - edit: function(mid) { + edit: function (mid) { switch (mid) { - case 'export': - PAGES.dataman.__export() + case "export": + PAGES.dataman.__export(); break; - case 'import': - PAGES.dataman.__import() + case "import": + PAGES.dataman.__import(); break; - case 'config': - PAGES.dataman.__config() + case "config": + PAGES.dataman.__config(); break; - case 'labels': - PAGES.dataman.__labels() + case "labels": + PAGES.dataman.__labels(); break; default: - // Tab to edit + // Tab to edit } }, - __config: function() { + __config: function () { var form = safeuuid(); container.innerHTML = `

Ajustes

@@ -33,16 +33,16 @@ PAGES.dataman = { - ` + `; document.getElementById(form).onsubmit = (ev) => { - ev.preventDefault() - var ford = new FormData(document.getElementById(form)) + ev.preventDefault(); + var ford = new FormData(document.getElementById(form)); if (ford.get("block_add_account") == "yes") { - config["block_add_account"] = true + config["block_add_account"] = true; } - } + }; }, - __export: function() { + __export: function () { var select_type = safeuuid(); var textarea_content = safeuuid(); var button_export_local = safeuuid(); @@ -75,16 +75,15 @@ PAGES.dataman = { var value = entry[1]; if (value != null) { if (typeof value == "string") { - SEA.decrypt(value, SECRET, (data) => { - output[modul][key] = data; - }); + SEA.decrypt(value, SECRET, (data) => { + output[modul][key] = data; + }); } else { - output[modul][key] = value; + output[modul][key] = value; } } }); toastr.success("Exportado todo, descargando!"); - console.error(output); download( `Export TeleSec ${GROUPID}.json.txt`, JSON.stringify(output) @@ -97,7 +96,6 @@ PAGES.dataman = { document.getElementById(button_export_safe).onclick = () => { var download_data = (DATA) => { toastr.success("Exportado todo, descargado!"); - console.error(DATA); download( `Export TeleSec Encriptado ${GROUPID}.json.txt`, JSON.stringify(DATA) @@ -109,14 +107,13 @@ PAGES.dataman = { document.getElementById(button_export_safe_cloud).onclick = () => { var download_data = (DATA) => { toastr.info("Exportado todo, subiendo!"); - console.error(DATA); fetch( - "https://telesec-sync.tech.eus/upload_backup.php?table=" + GROUPID, - { - method: "POST", - body: JSON.stringify(DATA), - } - ) + "https://telesec-sync.tech.eus/upload_backup.php?table=" + GROUPID, + { + method: "POST", + body: JSON.stringify(DATA), + } + ) .then(() => { toastr.success("Subido correctamente!"); }) @@ -127,7 +124,7 @@ PAGES.dataman = { gun.get(TABLE).load(download_data); }; }, - __import: function() { + __import: function () { var select_type = safeuuid(); var textarea_content = safeuuid(); var button_import = safeuuid(); @@ -168,7 +165,7 @@ PAGES.dataman = { } setTimeout(() => { toastr.info("Importado todo!"); - + if (sel == "%telesec") { setUrlHash("inicio"); } else { @@ -177,29 +174,36 @@ PAGES.dataman = { }, 5000); }; }, - __labels: function(mid) { - var div_materiales = safeuuid() + __labels: function (mid) { + var div_materiales = safeuuid(); container.innerHTML = `

Imprimir Etiquetas AztecQR

Materiales



`; - div_materiales = document.getElementById(div_materiales) - gun.get(TABLE).get("materiales").map().once((data, key) => { - function add_row(data, key) { - if (data != null) { - div_materiales.innerHTML += BuildQR("materiales," + key, data["Nombre"] || key) + div_materiales = document.getElementById(div_materiales); + gun + .get(TABLE) + .get("materiales") + .map() + .once((data, key) => { + function add_row(data, key) { + if (data != null) { + div_materiales.innerHTML += BuildQR( + "materiales," + key, + data["Nombre"] || key + ); + } } - } - if (typeof data == "string") { - SEA.decrypt(data, SECRET, (data) => { + if (typeof data == "string") { + SEA.decrypt(data, SECRET, (data) => { + add_row(data, key); + }); + } else { add_row(data, key); - }); - } else { - add_row(data, key); - } - }) + } + }); }, index: function () { container.innerHTML = ` @@ -208,6 +212,6 @@ PAGES.dataman = { Exportar datos Imprimir etiquetas Ajustes - ` - } -}; \ No newline at end of file + `; + }, +}; diff --git a/src/page/materiales.js b/src/page/materiales.js index 87bd6e1..030d0d3 100644 --- a/src/page/materiales.js +++ b/src/page/materiales.js @@ -78,7 +78,7 @@ PAGES.materiales = { load_data(data, "%E"); }); } else { - load_data(data); + load_data(data || {}); } }); document.getElementById(btn_guardar).onclick = () => { @@ -176,7 +176,6 @@ PAGES.materiales = { document.getElementById("tableContainer"), undefined, function(data) { - console.log(data.Ubicacion, filtroUbicacion); if (data.Ubicacion == filtroUbicacion) {return false} if (filtroUbicacion == "") {return false} return true diff --git a/src/page/notas.js b/src/page/notas.js index f8d4fc6..2b81a88 100644 --- a/src/page/notas.js +++ b/src/page/notas.js @@ -74,7 +74,7 @@ PAGES.notas = { load_data(data, "%E"); }); } else { - load_data(data); + load_data(data || {}); } }); document.getElementById(btn_guardar).onclick = () => { diff --git a/src/page/personas.js b/src/page/personas.js index 7f87a75..d173da8 100644 --- a/src/page/personas.js +++ b/src/page/personas.js @@ -98,7 +98,7 @@ PAGES.personas = { load_data(data, "%E"); }); } else { - load_data(data); + load_data(data || {}); } }); document diff --git a/src/page/supercafe.js b/src/page/supercafe.js index 29a0b2c..03f552c 100644 --- a/src/page/supercafe.js +++ b/src/page/supercafe.js @@ -1,25 +1,28 @@ -PERMS["supercafe"] = "SuperCafé" -PERMS["supercafe:edit"] = "> Editar" +PERMS["supercafe"] = "SuperCafé"; +PERMS["supercafe:edit"] = "> Editar"; PAGES.supercafe = { - navcss: "btn4", - icon: "static/appico/Coffee.svg", - AccessControl: true, - Title: "SuperCafé", - edit: function (mid) { - if (!checkRole("supercafe:edit")) {setUrlHash("supercafe");return} - var nameh1 = safeuuid(); - var field_fecha = safeuuid(); - var field_persona = safeuuid(); - var field_comanda = safeuuid(); - var field_notas = safeuuid(); - var field_estado = safeuuid(); - var div_actions = safeuuid(); - var btn_pagos = safeuuid(); - var btn_cocina = safeuuid(); - var btn_guardar = safeuuid(); - var btn_guardar2 = safeuuid(); - var btn_borrar = safeuuid(); - container.innerHTML = ` + navcss: "btn4", + icon: "static/appico/Coffee.svg", + AccessControl: true, + Title: "SuperCafé", + edit: function (mid) { + if (!checkRole("supercafe:edit")) { + setUrlHash("supercafe"); + return; + } + var nameh1 = safeuuid(); + var field_fecha = safeuuid(); + var field_persona = safeuuid(); + var field_comanda = safeuuid(); + var field_notas = safeuuid(); + var field_estado = safeuuid(); + var div_actions = safeuuid(); + var btn_pagos = safeuuid(); + var btn_cocina = safeuuid(); + var btn_guardar = safeuuid(); + var btn_guardar2 = safeuuid(); + var btn_borrar = safeuuid(); + container.innerHTML = `

Comanda

@@ -53,113 +56,115 @@ PAGES.supercafe = {
`; - var currentData = {}; - var currentPersonaID = ""; - var divact = document.getElementById(div_actions); + var currentData = {}; + var currentPersonaID = ""; + var divact = document.getElementById(div_actions); - function loadActions() { - divact.innerHTML = ""; - addCategory_Personas(divact, SC_Personas, currentPersonaID, (value) => { - document.getElementById(field_persona).value = value; - }); - Object.entries(SC_actions).forEach((category) => { - addCategory( - divact, - category[0], - SC_actions_icons[category[0]], - category[1], - currentData, - (values) => { - document.getElementById(field_comanda).value = SC_parse(values); - } - ); - }); - } - loadActions(); - gun - .get(TABLE) - .get("supercafe") - .get(mid) - .once((data, key) => { - function load_data(data, ENC = "") { - document.getElementById(nameh1).innerText = key; - document.getElementById(field_fecha).value = data["Fecha"]; - document.getElementById(field_persona).value = - data["Persona"] || ""; - currentPersonaID = data["Persona"] || ""; - document.getElementById(field_comanda).value = - SC_parse(JSON.parse(data["Comanda"] || "{}")) || ""; - document.getElementById(field_notas).value = data["Notas"] || ""; - document.getElementById(field_estado).value = data["Estado"] || ""; - currentData = JSON.parse(data["Comanda"] || "{}"); + function loadActions() { + divact.innerHTML = ""; + addCategory_Personas(divact, SC_Personas, currentPersonaID, (value) => { + document.getElementById(field_persona).value = value; + }); + Object.entries(SC_actions).forEach((category) => { + addCategory( + divact, + category[0], + SC_actions_icons[category[0]], + category[1], + currentData, + (values) => { + document.getElementById(field_comanda).value = SC_parse(values); + } + ); + }); + } + loadActions(); + gun + .get(TABLE) + .get("supercafe") + .get(mid) + .once((data, key) => { + function load_data(data, ENC = "") { + document.getElementById(nameh1).innerText = key; + document.getElementById(field_fecha).value = data["Fecha"]; + document.getElementById(field_persona).value = data["Persona"] || ""; + currentPersonaID = data["Persona"] || ""; + document.getElementById(field_comanda).value = + SC_parse(JSON.parse(data["Comanda"] || "{}")) || ""; + document.getElementById(field_notas).value = data["Notas"] || ""; + document.getElementById(field_estado).value = data["Estado"] || ""; + currentData = JSON.parse(data["Comanda"] || "{}"); - loadActions(); - } - if (typeof data == "string") { - SEA.decrypt(data, SECRET, (data) => { - load_data(data, "%E"); - }); - } else { - load_data(data); - } - }); - document.getElementById(btn_guardar).onclick = () => { - if (document.getElementById(field_persona).value == "") { - alert("¡Hay que elegir una persona!"); - return; + loadActions(); } - var data = { - Fecha: document.getElementById(field_fecha).value, - Persona: document.getElementById(field_persona).value, - Comanda: JSON.stringify(currentData), - Notas: document.getElementById(field_notas).value, - Estado: document - .getElementById(field_estado) - .value.replace("%%", "Pedido"), - }; - var enc = SEA.encrypt(data, SECRET, (encrypted) => { - document.getElementById("actionStatus").style.display = "block"; - betterGunPut(gun.get(TABLE).get("supercafe").get(mid), encrypted); - toastr.success("Guardado!"); - setTimeout(() => { - document.getElementById("actionStatus").style.display = "none"; - setUrlHash("supercafe"); - }, 1500); - }); - }; - document.getElementById(btn_borrar).onclick = () => { - if ( - confirm( - "¿Quieres borrar esta comanda? - NO se actualizaran los puntos de la persona asignada." - ) == true - ) { - betterGunPut(gun.get(TABLE).get("supercafe").get(mid), null); - setTimeout(() => { - setUrlHash("supercafe"); - }, 1500); + if (typeof data == "string") { + SEA.decrypt(data, SECRET, (data) => { + load_data(data, "%E"); + }); + } else { + load_data(data || {}); } - }; - }, - index: function () { - if (!checkRole("supercafe")) {setUrlHash("index");return} - var tts = false; - var sc_nobtn = ""; - if (urlParams.get("sc_nobtn") == "yes") { - sc_nobtn = "pointer-events: none; opacity: 0.5"; + }); + document.getElementById(btn_guardar).onclick = () => { + if (document.getElementById(field_persona).value == "") { + alert("¡Hay que elegir una persona!"); + return; } - var ev = setTimeout(() => { - tts = true; - console.log("TTS Enabled"); - toastr.info("Texto a voz disponible"); - }, 6500); - EventListeners.Timeout.push(ev) - const tablebody = safeuuid(); - const tablebody2 = safeuuid(); - var btn_new = safeuuid(); - var totalprecio = safeuuid(); - var tts_check = safeuuid(); - var old = {}; - container.innerHTML = ` + var data = { + Fecha: document.getElementById(field_fecha).value, + Persona: document.getElementById(field_persona).value, + Comanda: JSON.stringify(currentData), + Notas: document.getElementById(field_notas).value, + Estado: document + .getElementById(field_estado) + .value.replace("%%", "Pedido"), + }; + var enc = SEA.encrypt(data, SECRET, (encrypted) => { + document.getElementById("actionStatus").style.display = "block"; + betterGunPut(gun.get(TABLE).get("supercafe").get(mid), encrypted); + toastr.success("Guardado!"); + setTimeout(() => { + document.getElementById("actionStatus").style.display = "none"; + setUrlHash("supercafe"); + }, 1500); + }); + }; + document.getElementById(btn_borrar).onclick = () => { + if ( + confirm( + "¿Quieres borrar esta comanda? - NO se actualizaran los puntos de la persona asignada." + ) == true + ) { + betterGunPut(gun.get(TABLE).get("supercafe").get(mid), null); + setTimeout(() => { + setUrlHash("supercafe"); + }, 1500); + } + }; + }, + index: function () { + if (!checkRole("supercafe")) { + setUrlHash("index"); + return; + } + var tts = false; + var sc_nobtn = ""; + if (urlParams.get("sc_nobtn") == "yes") { + sc_nobtn = "pointer-events: none; opacity: 0.5"; + } + var ev = setTimeout(() => { + tts = true; + console.log("TTS Enabled"); + toastr.info("Texto a voz disponible"); + }, 6500); + EventListeners.Timeout.push(ev); + const tablebody = safeuuid(); + const tablebody2 = safeuuid(); + var btn_new = safeuuid(); + var totalprecio = safeuuid(); + var tts_check = safeuuid(); + var old = {}; + container.innerHTML = `

SuperCafé - Total: 0c


@@ -178,157 +183,155 @@ PAGES.supercafe = {
`; - var config = [ - { - key: "Persona", - type: "persona", - default: "", - label: "Persona", - }, - { - key: "Estado", - type: "comanda-status", - default: "", - label: "Estado", - }, - { - key: "Comanda", - type: "comanda", - default: "", - label: "Comanda", - }, - ] - if (!checkRole("supercafe:edit")) { - config = [ - { - key: "Persona", - type: "persona", - default: "", - label: "Persona", - }, - { - key: "Comanda", - type: "comanda", - default: "", - label: "Comanda", - }, - ] - } - //Todas las comandas - var comandasTot = {} - function calcPrecio() { - var tot = 0 - Object.values(comandasTot).forEach(precio => { - tot += precio - }); - document.getElementById(totalprecio).innerText = tot - return tot - } - TS_IndexElement( - "supercafe", - config, - gun.get(TABLE).get("supercafe"), - document.querySelector("#cont1"), - (data, new_tr) => { - // new_tr.style.backgroundColor = "#FFCCCB"; - comandasTot[data._key] = SC_priceCalc(JSON.parse(data.Comanda))[0] - calcPrecio() - if (data.Estado == "Pedido") { - new_tr.style.backgroundColor = "#FFFFFF"; - } - if (data.Estado == "En preparación") { - new_tr.style.backgroundColor = "#FFCCCB"; - } - if (data.Estado == "Listo") { - new_tr.style.backgroundColor = "gold"; - } - if (data.Estado == "Entregado") { - new_tr.style.backgroundColor = "lightgreen"; - } - if (data.Estado == "Deuda") { - new_tr.style.backgroundColor = "#f5d3ff"; - } + var config = [ + { + key: "Persona", + type: "persona", + default: "", + label: "Persona", + }, + { + key: "Estado", + type: "comanda-status", + default: "", + label: "Estado", + }, + { + key: "Comanda", + type: "comanda", + default: "", + label: "Comanda", + }, + ]; + if (!checkRole("supercafe:edit")) { + config = [ + { + key: "Persona", + type: "persona", + default: "", + label: "Persona", }, - (data) => { - if (data.Estado == "Deuda") { - return true; - } - var key = data._key; - if (old[key] == undefined) { - old[key] = ""; - } - if (old[key] != data.Estado) { - if (tts && document.getElementById(tts_check).checked) { - var msg = `Comanda de ${SC_Personas[data.Persona].Region}. - ${ - JSON.parse(data.Comanda)["Selección"] - }. - ${SC_Personas[data.Persona].Nombre}. - ${data.Estado}`; - console.log("TTS: " + msg); - let utterance = new SpeechSynthesisUtterance(msg); - utterance.rate = 0.9; - // utterance.voice = speechSynthesis.getVoices()[7] - speechSynthesis.speak(utterance); - } - } - old[key] = data.Estado; - } - ); - - //Deudas - TS_IndexElement( - "supercafe", - config, - gun.get(TABLE).get("supercafe"), - document.querySelector("#cont2"), - (data, new_tr) => { - // new_tr.style.backgroundColor = "#FFCCCB"; - comandasTot[data._key] = 0 // No mostrar comandas en deuda. - calcPrecio() - - if (data.Estado == "Pedido") { - new_tr.style.backgroundColor = "#FFFFFF"; - } - if (data.Estado == "En preparación") { - new_tr.style.backgroundColor = "#FFCCCB"; - } - if (data.Estado == "Listo") { - new_tr.style.backgroundColor = "gold"; - } - if (data.Estado == "Entregado") { - new_tr.style.backgroundColor = "lightgreen"; - } - if (data.Estado == "Deuda") { - new_tr.style.backgroundColor = "#f5d3ff"; - } + { + key: "Comanda", + type: "comanda", + default: "", + label: "Comanda", }, - (data) => { - if (data.Estado != "Deuda") { - return true; - } - var key = data._key; - if (old[key] == undefined) { - old[key] = ""; - } - if (old[key] != data.Estado) { - if (tts && document.getElementById(tts_check).checked) { - var msg = `Comanda de ${SC_Personas[data.Persona].Region}. - ${ - JSON.parse(data.Comanda)["Selección"] - }. - ${SC_Personas[data.Persona].Nombre}. - ${data.Estado}`; - console.log("TTS: " + msg); - let utterance = new SpeechSynthesisUtterance(msg); - utterance.rate = 0.9; - // utterance.voice = speechSynthesis.getVoices()[7] - speechSynthesis.speak(utterance); - } - } - old[key] = data.Estado; + ]; + } + //Todas las comandas + var comandasTot = {}; + function calcPrecio() { + var tot = 0; + Object.values(comandasTot).forEach((precio) => { + tot += precio; + }); + document.getElementById(totalprecio).innerText = tot; + return tot; + } + TS_IndexElement( + "supercafe", + config, + gun.get(TABLE).get("supercafe"), + document.querySelector("#cont1"), + (data, new_tr) => { + // new_tr.style.backgroundColor = "#FFCCCB"; + comandasTot[data._key] = SC_priceCalc(JSON.parse(data.Comanda))[0]; + calcPrecio(); + if (data.Estado == "Pedido") { + new_tr.style.backgroundColor = "#FFFFFF"; } - ); - if (!checkRole("supercafe:edit")) { - document.getElementById(btn_new).style.display = "none" - } else { - document.getElementById(btn_new).onclick = () => { - setUrlHash("supercafe," + safeuuid("")); - }; + if (data.Estado == "En preparación") { + new_tr.style.backgroundColor = "#FFCCCB"; + } + if (data.Estado == "Listo") { + new_tr.style.backgroundColor = "gold"; + } + if (data.Estado == "Entregado") { + new_tr.style.backgroundColor = "lightgreen"; + } + if (data.Estado == "Deuda") { + new_tr.style.backgroundColor = "#f5d3ff"; + } + }, + (data) => { + if (data.Estado == "Deuda") { + return true; + } + var key = data._key; + if (old[key] == undefined) { + old[key] = ""; + } + if (old[key] != data.Estado) { + if (tts && document.getElementById(tts_check).checked) { + var msg = `Comanda de ${SC_Personas[data.Persona].Region}. - ${ + JSON.parse(data.Comanda)["Selección"] + }. - ${SC_Personas[data.Persona].Nombre}. - ${data.Estado}`; + let utterance = new SpeechSynthesisUtterance(msg); + utterance.rate = 0.9; + // utterance.voice = speechSynthesis.getVoices()[7] + speechSynthesis.speak(utterance); + } + } + old[key] = data.Estado; } - }, - } \ No newline at end of file + ); + + //Deudas + TS_IndexElement( + "supercafe", + config, + gun.get(TABLE).get("supercafe"), + document.querySelector("#cont2"), + (data, new_tr) => { + // new_tr.style.backgroundColor = "#FFCCCB"; + comandasTot[data._key] = 0; // No mostrar comandas en deuda. + calcPrecio(); + + if (data.Estado == "Pedido") { + new_tr.style.backgroundColor = "#FFFFFF"; + } + if (data.Estado == "En preparación") { + new_tr.style.backgroundColor = "#FFCCCB"; + } + if (data.Estado == "Listo") { + new_tr.style.backgroundColor = "gold"; + } + if (data.Estado == "Entregado") { + new_tr.style.backgroundColor = "lightgreen"; + } + if (data.Estado == "Deuda") { + new_tr.style.backgroundColor = "#f5d3ff"; + } + }, + (data) => { + if (data.Estado != "Deuda") { + return true; + } + var key = data._key; + if (old[key] == undefined) { + old[key] = ""; + } + if (old[key] != data.Estado) { + if (tts && document.getElementById(tts_check).checked) { + var msg = `Comanda de ${SC_Personas[data.Persona].Region}. - ${ + JSON.parse(data.Comanda)["Selección"] + }. - ${SC_Personas[data.Persona].Nombre}. - ${data.Estado}`; + let utterance = new SpeechSynthesisUtterance(msg); + utterance.rate = 0.9; + // utterance.voice = speechSynthesis.getVoices()[7] + speechSynthesis.speak(utterance); + } + } + old[key] = data.Estado; + } + ); + if (!checkRole("supercafe:edit")) { + document.getElementById(btn_new).style.display = "none"; + } else { + document.getElementById(btn_new).onclick = () => { + setUrlHash("supercafe," + safeuuid("")); + }; + } + }, +};