blob: 8ba455caa1c3bf1ef6e558ddcbddb14d444da640 [file] [log] [blame]
Copybara botbe50d492023-11-30 00:16:42 +01001<?php
2require_once(__DIR__."/../core.php");
3security::checkType(security::WORKER, security::METHOD_NOTFOUND);
4security::checkWorkerUIEnabled();
5
6if (!isset($_GET["id"])) {
7 security::notFound();
8}
9
10$id = (int)$_GET["id"];
11
12$incident = incidents::get($id);
13if ($incident === false) security::notFound();
14
15$isAdmin = security::isAdminView();
16$status = incidents::getStatus($incident);
17if (($isAdmin && !in_array($status, incidents::$canRemoveStates)) || (!$isAdmin && !in_array($status, incidents::$workerCanRemoveStates))) security::notFound();
18?>
19
20<form action="dodeleteincident.php" method="POST" autocomplete="off">
21 <input type="hidden" name="id" value="<?=(int)$id?>">
22 <?php visual::addContinueInput(); ?>
23 <h4 class="mdl-dialog__title">Eliminar incidencia</h4>
24 <div class="mdl-dialog__content">
25 <p>¿Estás seguro que quieres eliminar esta incidencia? <span style="color:#EF5350;font-weight:bold;">Esta acción es irreversible</span></p>
26 </div>
27 <div class="mdl-dialog__actions">
28 <button type="submit" class="mdl-button mdl-js-button mdl-js-ripple-effect mdl-button--accent">Eliminar</button>
29 <button data-dyndialog-close class="mdl-button mdl-js-button mdl-js-ripple-effect cancel">Cancelar</button>
30 </div>
31</form>