blob: 6a775be0572e887403cafa4348e21c1418266ead [file] [log] [blame]
Copybara botbe50d492023-11-30 00:16:42 +01001<?php
Adrià Vilanova Martínez5af86512023-12-02 20:44:16 +01002/*
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 botbe50d492023-11-30 00:16:42 +010021require_once(__DIR__."/../core.php");
22security::checkType(security::ADMIN, security::METHOD_NOTFOUND);
23
24$pending = incidents::numPending();
25?>
26<header class="mdl-layout__header mdl-layout__header--scroll<?=(visual::isMDColor() ? security::htmlsafe(" mdl-color--".$conf["backgroundColor"]) : "")?>"<?=(!visual::isMDColor() ? " style=\"background-color: ".security::htmlsafe($conf["backgroundColor"]).";\"" : "")?>>
27 <div class="mdl-layout__header-row">
28 <!-- Title -->
29 <?php if (isset($mdHeaderRowBefore)) { echo $mdHeaderRowBefore; } ?>
30 <span class="mdl-layout-title">Panel de control</span>
31 <?php if (isset($mdHeaderRowMore)) { echo $mdHeaderRowMore; } ?>
32 </div>
33 <?php if (isset($mdHeaderMore)) { echo $mdHeaderMore; } ?>
34</header>
35<div class="mdl-layout__drawer">
36 <span class="mdl-layout-title"><?=(!empty($conf["logo"] ?? "") ? "<img class=\"logo\" src=\"".security::htmlsafe($conf["logo"])."\">" : "")?> <?=security::htmlsafe($conf["appName"])?></span>
37 <span class="subtitle mdl-color-text--grey-700"><?=security::htmlsafe(people::userData("name"))?></span>
38 <nav class="mdl-navigation">
39 <a class="mdl-navigation__link mdl-js-button mdl-js-ripple-effect" href="home.php"><i class="material-icons">dashboard</i> <span>Panel de Control</span></a>
40 <a class="mdl-navigation__link mdl-js-button mdl-js-ripple-effect" href="users.php"><i class="material-icons">group</i> <span>Personas</span></a>
41 <a class="mdl-navigation__link mdl-js-button mdl-js-ripple-effect" href="workers.php"><i class="material-icons">work</i> <span>Trabajadores</span></a>
42 <a class="mdl-navigation__link mdl-js-button mdl-js-ripple-effect" href="incidents.php?goTo=today"><i class="material-icons mdl-badge<?=($pending > 0 ? ' mdl-badge--overlap' : '')?>" <?=($pending > 0 ? 'data-badge="'.$pending.'"' : '')?>>assignment_late</i> <span>Incidencias</span></a>
43 <a class="mdl-navigation__link mdl-js-button mdl-js-ripple-effect" href="registry.php"><i class="material-icons">list</i> <span>Registro</span></a>
44 <a class="mdl-navigation__link mdl-js-button mdl-js-ripple-effect" href="export.php"><i class="material-icons">cloud_download</i> <span>Exportar registro</span></a>
45 <a class="mdl-navigation__link mdl-js-button mdl-js-ripple-effect" href="settings.php"><i class="material-icons">settings</i> <span>Configuración</span></a>
46 <?php
47 if ($conf["enableWorkerUI"]) {
48 ?>
49 <a class="mdl-navigation__link mdl-js-button mdl-js-ripple-effect" href="workerhome.php"><i class="material-icons">open_in_browser</i> <span>Vista de trabajador</span></a>
50 <?php
51 } elseif (secondFactor::isAvailable()) {
52 ?>
53 <a class="mdl-navigation__link mdl-js-button mdl-js-ripple-effect" href="security.php"><i class="material-icons">security</i> <span>Seguridad</span></a>
54 <?php
55 } else {
56 ?>
57 <a class="mdl-navigation__link mdl-js-button mdl-js-ripple-effect" href="changepassword.php"><i class="material-icons">account_circle</i> <span>Cambiar contraseña</span></a>
58 <?php
59 }
60 ?>
61 <a class="mdl-navigation__link mdl-js-button mdl-js-ripple-effect" class="mdl-navigation__link" href="logout.php"><i class="material-icons">power_settings_new</i> <span>Cerrar sesión</span></a>
62 </nav>
63</div>