Copybara bot | be50d49 | 2023-11-30 00:16:42 +0100 | [diff] [blame] | 1 | <?php |
Adrià Vilanova Martínez | 5af8651 | 2023-12-02 20:44:16 +0100 | [diff] [blame^] | 2 | /* |
| 3 | * hores |
| 4 | * Copyright (c) 2023 Adrià Vilanova Martínez |
| 5 | * |
| 6 | * This program is free software: you can redistribute it and/or modify |
| 7 | * it under the terms of the GNU Affero General Public License as |
| 8 | * published by the Free Software Foundation, either version 3 of the |
| 9 | * License, or (at your option) any later version. |
| 10 | * |
| 11 | * This program is distributed in the hope that it will be useful, |
| 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 14 | * GNU Affero General Public License for more details. |
| 15 | * |
| 16 | * You should have received a copy of the GNU Affero General Public |
| 17 | * License along with this program. |
| 18 | * If not, see http://www.gnu.org/licenses/. |
| 19 | */ |
| 20 | |
Copybara bot | be50d49 | 2023-11-30 00:16:42 +0100 | [diff] [blame] | 21 | require_once(__DIR__."/../core.php"); |
| 22 | security::checkType(security::WORKER, security::METHOD_NOTFOUND); |
| 23 | security::checkWorkerUIEnabled(); |
| 24 | |
| 25 | $isAdmin = security::isAllowed(security::ADMIN); |
| 26 | |
| 27 | if (!isset($_GET["id"])) { |
| 28 | security::notFound(); |
| 29 | } |
| 30 | |
| 31 | $id = (int)$_GET["id"]; |
| 32 | |
| 33 | $record = registry::get($id, true); |
| 34 | if ($record === false) security::notFound(); |
| 35 | |
| 36 | if (!$isAdmin) registry::checkRecordIsFromPerson($record["id"]); |
| 37 | ?> |
| 38 | |
| 39 | <style> |
| 40 | #dynDialog { |
| 41 | max-width: 380px; |
| 42 | width: auto; |
| 43 | } |
| 44 | </style> |
| 45 | |
| 46 | <h4 class="mdl-dialog__title">Autoría del elemento del registro</h4> |
| 47 | <div class="mdl-dialog__content"> |
| 48 | <ul> |
| 49 | <li><b>Creador:</b> <?=($record["creator"] == -1 ? "<span style='font-family: monospace;'>cron</span>" : security::htmlsafe(people::userData("name", $record["creator"])))?></li> |
| 50 | <li><b>Fecha de creación:</b> <?=date("d/m/Y H:i", $record["created"])?></li> |
| 51 | <?php if ($record["invalidatedby"] != -1) { ?><li><b>Invalidado por:</b> <?=security::htmlsafe(people::userData("name", $record["invalidatedby"]))?></li><?php } ?> |
| 52 | <?php |
| 53 | if ($record["state"] == registry::STATE_VALIDATED_BY_WORKER) { |
| 54 | $validation = json_decode($record["workervalidation"], true); |
| 55 | validationsView::renderValidationInfo($validation); |
| 56 | } |
| 57 | ?> |
| 58 | </ul> |
| 59 | </div> |
| 60 | <div class="mdl-dialog__actions"> |
| 61 | <button data-dyndialog-close class="mdl-button mdl-js-button mdl-js-ripple-effect mdl-button--accent">Cerrar</button> |
| 62 | </div> |