feat: 6 nuevas funcionalidades - notas obligatorias turno, reporte enfermero, plantilla WhatsApp, adjuntar orden modal, roles solo lectura, fix valores copago
This commit is contained in:
+9
-6
@@ -9,9 +9,10 @@ if (!isUserLoggedIn()) {
|
||||
exit;
|
||||
}
|
||||
if (isEnfermero()) { header('Location: enfermero_portal.php'); exit; }
|
||||
$adminNombre = $_SESSION['admin_user']['full_name'] ?? $_SESSION['admin_user']['username'] ?? 'Admin';
|
||||
$ordenIdParam = (int)($_GET['id'] ?? 0);
|
||||
$estadoParam = $_GET['estado'] ?? '';
|
||||
$adminNombre = $_SESSION['admin_user']['full_name'] ?? $_SESSION['admin_user']['username'] ?? 'Admin';
|
||||
$puedeEscribir = hasModuleWrite('lab_ordenes');
|
||||
$ordenIdParam = (int)($_GET['id'] ?? 0);
|
||||
$estadoParam = $_GET['estado'] ?? '';
|
||||
?>
|
||||
<!DOCTYPE html>
|
||||
<html lang="es">
|
||||
@@ -182,8 +183,9 @@ let ordenSeleccionada = <?= $ordenIdParam ?: 'null' ?>;
|
||||
const modalAccion = new bootstrap.Modal('#modalAccion');
|
||||
const modalImg = new bootstrap.Modal('#modalImagen');
|
||||
|
||||
const FLUJO = ['pendiente','en_revision','autorizada','rechazada','en_domicilio','completada'];
|
||||
const COLOR = { pendiente:'warning', en_revision:'info', autorizada:'success', rechazada:'danger', en_domicilio:'primary', completada:'secondary' };
|
||||
const FLUJO = ['pendiente','en_revision','autorizada','rechazada','en_domicilio','completada'];
|
||||
const COLOR = { pendiente:'warning', en_revision:'info', autorizada:'success', rechazada:'danger', en_domicilio:'primary', completada:'secondary' };
|
||||
const PUEDE_ESCRIBIR = <?= $puedeEscribir ? 'true' : 'false' ?>;
|
||||
|
||||
// ── Lista ──────────────────────────────────────────────────────────────────
|
||||
async function cargarLista(pag = 1) {
|
||||
@@ -345,7 +347,7 @@ async function verOrden(id) {
|
||||
</div>`).join('') || '<p class="text-muted small mb-0">Sin historial</p>'}
|
||||
</div>
|
||||
|
||||
${o.estado === 'autorizada' ? `
|
||||
${o.estado === 'autorizada' && PUEDE_ESCRIBIR ? `
|
||||
<div class="mt-3">
|
||||
<a href="lab_domicilios.php?orden_id=${o.id}&paciente_id=${o.paciente_id}" class="btn btn-success w-100 btn-sm">
|
||||
<i class="fas fa-house-medical me-1"></i> Crear domicilio para esta orden
|
||||
@@ -357,6 +359,7 @@ async function verOrden(id) {
|
||||
}
|
||||
|
||||
function renderBotones(o) {
|
||||
if (!PUEDE_ESCRIBIR) return '';
|
||||
const btns = [];
|
||||
if (o.estado === 'pendiente')
|
||||
btns.push(`<button class="btn btn-sm btn-info" onclick="accion(${o.id},'en_revision')"><i class="fas fa-magnifying-glass me-1"></i>Iniciar revisión</button>`);
|
||||
|
||||
Reference in New Issue
Block a user