Copybara bot | be50d49 | 2023-11-30 00:16:42 +0100 | [diff] [blame] | 1 | <?php |
| 2 | require_once(__DIR__."/../core.php"); |
| 3 | security::checkType(security::WORKER, security::METHOD_NOTFOUND); |
| 4 | security::checkWorkerUIEnabled(); |
| 5 | |
| 6 | if (!isset($_GET["id"])) { |
| 7 | security::notFound(); |
| 8 | } |
| 9 | |
| 10 | $id = (int)$_GET["id"]; |
| 11 | |
| 12 | $incident = incidents::get($id); |
| 13 | if ($incident === false) security::notFound(); |
| 14 | |
| 15 | $isAdmin = security::isAdminView(); |
| 16 | $status = incidents::getStatus($incident); |
| 17 | if (($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> |