diff options
| author | Philipp Schüttlöffel <schuettloeffel@zqs.uni-hannover.de> | 2024-09-24 10:53:31 +0200 |
|---|---|---|
| committer | Philipp Schüttlöffel <schuettloeffel@zqs.uni-hannover.de> | 2024-09-24 10:53:31 +0200 |
| commit | 4459dd7917f4d1c34f40bb68f0e991e9c3d53e4c (patch) | |
| tree | 5c07151ae61276d334e88f6309c30d439a85c12e /app/views/admin | |
| parent | da0022e5c1abbf9825ae76debaabdff7e8623bb4 (diff) | |
| parent | 97a188592c679890a25c37ab78463add76a52ff7 (diff) | |
Merge branch 'main' into issue-3911issue-3911
Diffstat (limited to 'app/views/admin')
20 files changed, 43 insertions, 686 deletions
diff --git a/app/views/admin/api/config.php b/app/views/admin/api/config.php deleted file mode 100644 index 83d2ae5..0000000 --- a/app/views/admin/api/config.php +++ /dev/null @@ -1,35 +0,0 @@ -<?php -/** - * @var Admin_ApiController $controller - * @var array $config - */ -use Studip\Button, Studip\LinkButton; -?> - -<form class="default" action="<?= $controller->url_for('admin/api/config') ?>" method="post"> - <fieldset> - <legend><?= _('Konfiguration') ?></legend> - - <input type="hidden" name="active" value="0"> - <label> - <input type="checkbox" name="active" value="1" <? if ($config['API_ENABLED']) echo 'checked'; ?>> - <?= _('REST-API aktiviert') ?> - </label> - - - <label class="caption" for="auth"> - <?= _('Standard-Authentifizierung beim Login') ?> - <select name="auth" id="auth"> - <? foreach ($GLOBALS['STUDIP_AUTH_PLUGIN'] as $plugin): ?> - <option <? if ($config['API_OAUTH_AUTH_PLUGIN'] === $plugin) echo 'selected'; ?>> - <?= $plugin ?> - </option> - <? endforeach; ?> - </select> - </label> - </fieldset> - <footer> - <?= Button::createAccept(_('Speichern')) ?> - <?= LinkButton::createCancel(_('Abbrechen'), $controller->url_for('admin/api')) ?> - </footer> -</form> diff --git a/app/views/admin/api/edit.php b/app/views/admin/api/edit.php deleted file mode 100644 index f1c7e03..0000000 --- a/app/views/admin/api/edit.php +++ /dev/null @@ -1,136 +0,0 @@ -<?php -/** - * @var Admin_ApiController $controller - * @var RESTAPI\Consumer\Base $consumer - * @var array $types - */ -use Studip\Button, Studip\LinkButton; -?> - -<? if ($consumer->id): ?> - <h1> - <?= sprintf( - _('Registrierte Applikation "%s" bearbeiten'), - htmlReady($consumer->title) - ) ?> - </h1> -<? else: ?> - <h1 class="hide-in-dialog"> - <?= _('Neue Applikation registrieren') ?> - </h1> -<? endif; ?> - -<form class="settings default" - action="<?= $controller->url_for('admin/api/edit', $consumer->id) ?>" method="post"> - <?= CSRFProtection::tokenTag() ?> - - <fieldset> - <legend><?= _('Grundeinstellungen') ?></legend> - - <label for="active"> - <input type="checkbox" class="switch" id="active" name="active" value="1" - <?= $consumer->active ? 'checked' : '' ?>> - <?= _('Aktiviert') ?> - </label> - - - <label for="title"> - <?= _('Titel') ?> - <input required type="text" id="title" name="title" - placeholder="<?= _('Beispiel-Applikation') ?>" - value="<?= htmlReady($consumer->title) ?>" - maxlength="128"> - </label> - - <label for="contact"> - <?= _('Kontaktperson') ?> - <input required type="text" id="contact" name="contact" - placeholder="John Doe" - value="<?= htmlReady($consumer->contact) ?>" - maxlength="255"> - </label> - - <label for="email"> - <?= _('Kontaktadresse') ?> - <input required type="text" id="email" name="email" - placeholder="support@appsite.tld" - value="<?= htmlReady($consumer->email) ?>" - maxlength="255"> - </label> - - <label for="callback"> - <?= _('Callback URL') ?> - <input required type="text" id="callback" name="callback" - placeholder="http://appsite.tld/auth" - value="<?= htmlReady($consumer->callback) ?>" - maxlength="255"> - </label> - - <? if ($consumer->id): ?> - <label for="consumer_key"> - <?= _('Consumer Key') ?> - <input readonly type="text" id="consumer_key" - value="<?= htmlReady($consumer->auth_key) ?>"> - </label> - - <label for="consumer_secret"> - <?= _('Consumer Secret') ?> - <input readonly type="text" id="consumer_secret" - value="<?= htmlReady($consumer->auth_secret) ?>"> - </label> - - <div class="centered"> - <?= strftime(_('Erstellt am %d.%m.%Y %H:%M:%S'), $consumer->mkdate) ?><br> - <? if ($consumer->mkdate != $consumer->chdate): ?> - <?= strftime(_('Zuletzt geändert am %d.%m.%Y %H:%M:%S'), $consumer->chdate) ?> - <? endif; ?> - </div> - <? endif; ?> - </fieldset> - - <fieldset> - <legend><?= _('Applikation-Details') ?></legend> - - <label for="commercial"> - <input type="checkbox" class="switch" id="commercial" name="commercial" value="1" - <?= $consumer->commercial ? 'checked' : '' ?>> - <?= _('Kommerziell') ?> - </label> - - <label for="description"> - <?= _('Beschreibung') ?> - <textarea id="description" name="description" maxlength="65535"><?= htmlReady($consumer->description) ?></textarea> - </label> - - <label for="url"> - <?= _('URL') ?> - <input type="text" id="url" name="url" - placeholder="http://appsite.tld" - value="<?= htmlReady($consumer->url) ?>" - maxlength="255"> - </label> - - <label for="type"> - <?= _('Typ') ?> - <select name="type" id="type"> - <option value="">- <?= _('Keine Angabe') ?> -</option> - <? foreach ($types as $type => $label): ?> - <option value="<?= $type ?>" <?= $consumer->type == $type ? 'selected' : '' ?>> - <?= $label ?> - </option> - <? endforeach; ?> - </select> - </label> - - - <label for="notes"> - <?= _('Notizen') ?> - <textarea id="notes" name="notes" maxlength="65535"><?= htmlReady($consumer->notes) ?></textarea> - </label> - </fieldset> - - <footer data-dialog-button> - <?= Button::createAccept(_('Speichern'), 'store') ?> - <?= LinkButton::createCancel(_('Abbrechen'), $controller->url_for('admin/api')) ?> - </footer> -</form> diff --git a/app/views/admin/api/index.php b/app/views/admin/api/index.php deleted file mode 100644 index 132deac..0000000 --- a/app/views/admin/api/index.php +++ /dev/null @@ -1,77 +0,0 @@ -<?php -/** - * @var Admin_ApiController $controller - * @var RESTAPI\Consumer\Base[] $consumers - * @var array $types - */ -?> -<? if (!empty($consumers)): ?> -<form action="#" method="post" class="default"> -<table class="default"> - <caption><?= _('Registrierte Applikationen') ?></caption> - <thead> - <tr> - <th><?= ('Aktiv') ?></th> - <th><?= _('Name') ?></th> - <th><?= _('Typ') ?></th> - <th><?= _('Kontakt') ?></th> - <th><?= _('Kommerziell') ?></th> - <th> </th> - </tr> - </thead> - <tbody> -<? foreach ($consumers as $consumer): ?> - <tr> - <td id="<?= $consumer->id ?>"> - <a href="<?= $controller->url_for('admin/api/toggle', $consumer->id, $consumer->active ? 'off' : 'on') ?>"> - <?= Icon::create('checkbox-' . ($consumer->active ? '' : 'un') . 'checked', 'clickable')->asImg() ?> - </a> - </td> - <td> - <? if ($consumer->url): ?> - <a href="<?= htmlReady($consumer->url) ?>" target="_blank" rel="noopener noreferrer"> - <?= htmlReady($consumer->title) ?> - </a> - <? else: ?> - <?= htmlReady($consumer->title) ?> - <? endif; ?> - </td> - <td><?= $types[$consumer->type] ?? ' ' ?></td> - <td> - <a href="mailto:<?= htmlReady($consumer->email) ?>"> - <?= htmlReady($consumer->contact) ?> - </a> - </td> - - <td><?= Icon::create('checkbox-' . ($consumer->commercial ? '' : 'un') . 'checked', 'clickable')->asImg() ?></td> - <td class="actions"> - <a href="<?= $controller->url_for('admin/api/keys', $consumer->id) ?>" - data-dialog="size=auto" - title="<?= htmlReady(sprintf(_('Schlüssel anzeigen für Applikation "%s"'), $consumer->title)) ?>"> - <?= Icon::create('info-circle', 'clickable')->asImg() ?> - </a> - <a href="<?= $controller->url_for('admin/api/edit', $consumer->id) ?>" title="<?= _('Applikation bearbeiten') ?>" data-dialog> - <?= Icon::create('edit', 'clickable')->asImg() ?> - </a> - <a href="<?= $controller->url_for('admin/api/permissions', $consumer->id) ?>" title="<?= _('Zugriffsberechtigungen verwalten') ?>"> - <?= Icon::create('admin', 'clickable')->asImg() ?> - </a> - <?= Icon::create('trash')->asInput([ - 'formaction' => $controller->url_for('admin/api/delete/', $consumer->id), - 'title' => sprintf(_('Applikation "%s" entfernen'), $consumer->title), - 'data-confirm' => '', - 'style' => 'vertical-align: middle' - ]) ?> - </td> - </tr> -<? endforeach; ?> - </tbody> -</table> -</form> - -<? else: ?> -<p> - <?= MessageBox::info(_('Es wurde noch keine Applikation registriert.'), - [sprintf(_('Klicken Sie <a href="%s">hier</a>, um eine Applikation zu registrieren.'), $controller->url_for('admin/api/edit'))]) ?> -</p> -<? endif; ?> diff --git a/app/views/admin/api/permissions.php b/app/views/admin/api/permissions.php deleted file mode 100644 index 9eb48e3..0000000 --- a/app/views/admin/api/permissions.php +++ /dev/null @@ -1,62 +0,0 @@ -<?php -/** - * @var Admin_ApiController $controller - * @var RESTAPI\ConsumerPermissions $permissions - * @var string $consumer_id - * @var array $routes - * @var bool $global - */ -?> -<form action="<?= $controller->url_for('admin/api/permissions', $consumer_id) ?>" method="post" class="default"> -<table class="default"> - <thead> - <tr> - <th><?= _('Zugriff') ?></th> - <th><?= _('Route') ?></th> - <th><?= _('Methoden') ?></th> - <th><?= _('Zugriff auf') ?></th> - <th><?= _('Quelle') ?></th> - </tr> - </thead> -<? foreach ($routes as $route => $methods): ?> - <tbody> - - <? $i = 0; ?> - <? foreach ($methods as $method => $info): ?> - <tr style="vertical-align: top;"> - <td> - <input type="hidden" name="permission[<?= urlencode($route) ?>][<?= urlencode($method) ?>]" value="0"> - <input type="checkbox" name="permission[<?= urlencode($route) ?>][<?= urlencode($method) ?>]" - <? if (!$global || $global->check($route, $method)): ?> - <? if ($permissions->check($route, $method)) echo 'checked'; ?> - <? else: ?> - disabled - <? endif; ?> - value="1"> - </td> - <? if ($i++): ?> - <td> </td> - <? else: ?> - <td><?= htmlReady($route) ?></td> - <? endif; ?> - <td><?= htmlReady($method) ?></td> - <td><?= htmlReady($info['description']) ?></td> - <td><?= $info['source'] ?></td> - </tr> - <? endforeach; ?> - </tbody> -<? endforeach; ?> - <tfoot> - <tr> - <td> - <label> - <input type="checkbox" data-proxyfor="[name^=permission]:checkbox"> <?= _('Alle') ?> - </label> - </td> - <td colspan="4"> - <?= Studip\Button::createAccept(_('Speichern'), 'store') ?> - </td> - </tr> - </tfoot> -</table> -</form> diff --git a/app/views/admin/autoinsert/manual.php b/app/views/admin/autoinsert/manual.php index dd0f834..a4f5f5e 100644 --- a/app/views/admin/autoinsert/manual.php +++ b/app/views/admin/autoinsert/manual.php @@ -114,14 +114,14 @@ <? foreach ($values[$type] as $key => $value): ?> <? if (is_array($value)): ?> <option value="<?= $key ?>" - class="nested-item-header" <?= in_array($key, (array)@$filter[$type]) ? 'selected="selected"' : '' ?>><?= htmlReady($value['name']) ?></option> + class="nested-item-header" <?= in_array($key, $filter[$type] ?? []) ? 'selected' : '' ?>><?= htmlReady($value['name']) ?></option> <? foreach ($value['values'] as $k => $v): ?> <option value="<?= $k ?>" - class="nested-item" <?= in_array($k, (array)@$filter[$type]) ? 'selected="selected"' : '' ?>><?= htmlReady($v) ?></option> + class="nested-item" <?= in_array($k, $filter[$type] ?? []) ? 'selected' : '' ?>><?= htmlReady($v) ?></option> <? endforeach; ?> <? else: ?> <option - value="<?= $key ?>" <?= in_array($key, (array)@$filter[$type]) ? 'selected="selected"' : '' ?>><?= htmlReady($value) ?></option> + value="<?= $key ?>" <?= in_array($key, $filter[$type] ?? []) ? 'selected' : '' ?>><?= htmlReady($value) ?></option> <? endif ?> <? endforeach; ?> </select> diff --git a/app/views/admin/configuration/table-row.php b/app/views/admin/configuration/table-row.php index 12769ed..a0725a5 100644 --- a/app/views/admin/configuration/table-row.php +++ b/app/views/admin/configuration/table-row.php @@ -9,12 +9,16 @@ ?> <tr id="field-<?= htmlReady($field) ?>"> <td> + <? if (!Config::get()->fromEnv($field)): ?> <a data-dialog href="<?= $controller->link_for($linkchunk, compact('field')) ?>"> <?= htmlReady($field) ?> </a> - <? if (!empty($description)): ?> - <br><small><?= htmlReady($description) ?></small> - <? endif; ?> + <? else: ?> + <?= htmlReady($field) ?> + <? endif; ?> + <? if (!empty($description)): ?> + <br><small><?= htmlReady($description) ?></small> + <? endif; ?> </td> <td class="wrap-content"> <? if ($type === 'string' || $type === 'i18n'): ?> @@ -31,8 +35,14 @@ </td> <td><?= htmlReady($type) ?></td> <td class="actions"> + <? if (!Config::get()->fromEnv($field)): ?> <a data-dialog="size=auto" href="<?= $controller->link_for($linkchunk, compact('field')) ?>"> <?= Icon::create('edit')->asImg(['title' => _('Konfigurationsparameter bearbeiten')]) ?> </a> + <? else: ?> + <?= Icon::create('ufo', Icon::ROLE_INFO)->asImg([ + 'title' => _('Wert wurde über eine Umgebungsvariable gesetzt und kann an dieser Stelle nicht verändert werden.'), + ]) ?> + <? endif; ?> </td> </tr> diff --git a/app/views/admin/configuration/type-edit.php b/app/views/admin/configuration/type-edit.php index 9fddb45..1cec3f0 100644 --- a/app/views/admin/configuration/type-edit.php +++ b/app/views/admin/configuration/type-edit.php @@ -16,7 +16,7 @@ <input name="value" type="number" id="item-value" value="<?= htmlReady($value) ?>"> <? elseif ($type === 'array') : ?> - <?php $v = version_compare(PHP_VERSION, '5.4.0', '>=') ? json_encode($value, JSON_UNESCAPED_UNICODE) : json_encode($value) ?> + <?php $v = json_encode($value, JSON_UNESCAPED_UNICODE) ?> <textarea cols="80" rows="5" name="value" id="item-value"><?= htmlReady($v, true, true) ?></textarea> <? elseif ($type === 'i18n'): ?> <?= I18N::textarea('value', $value, [ diff --git a/app/views/admin/courseplanning/pick_color.php b/app/views/admin/courseplanning/pick_color.php index dbd93a8..61cc7fc 100644 --- a/app/views/admin/courseplanning/pick_color.php +++ b/app/views/admin/courseplanning/pick_color.php @@ -13,10 +13,12 @@ <div id="event-color-picker"></div> +<? if (!empty($semtype)): ?> <label> <input name="event_color_semtype" type="checkbox" value="1"> <?= sprintf(_('Farbtyp für alle VA dieses Typs (%s) übernehmen'), htmlReady($semtype)) ?> </label> +<? endif; ?> <div data-dialog-button> <?= Studip\Button::createAccept(_('Speichern'), 'save') ?> diff --git a/app/views/admin/courses/courses.php b/app/views/admin/courses/courses.php deleted file mode 100644 index d225270..0000000 --- a/app/views/admin/courses/courses.php +++ /dev/null @@ -1,270 +0,0 @@ -<?php -/** - * @var string $selected_action - * @var array $view_filter - * @var Semester $semester - * @var int $count_courses - * @var string $sortby - * @var string $sortFlag - * @var int $nav_elements - * @var array $courses - */ - -$colspan = 2 -?> - -<? if (!empty($actions[$selected_action]['multimode'])) : ?> - <form action="<?= URLHelper::getLink($actions[$selected_action]['url']) ?>" method="post" - <?= !empty($actions[$selected_action]['dialogform']) ? ' data-dialog="auto"' : '' ?>> -<? endif ?> -<?= CSRFProtection::tokenTag() ?> -<table class="default course-admin"> - <colgroup> - <col style="width: 2%"> - <? if (in_array('number', $view_filter)) : ?> - <? $colspan++ ?> - <col style="width: 8%"> - <? endif ?> - <? if (in_array('name', $view_filter)) : ?> - <? $colspan++ ?> - <col> - <? endif ?> - <? if (in_array('type', $view_filter)) : ?> - <? $colspan++ ?> - <col style="width: 10%"> - <? endif ?> - <? if (in_array('room_time', $view_filter)) : ?> - <? $colspan++ ?> - <col style="width: 30%"> - <? endif ?> - <? if (in_array('semester', $view_filter)) : ?> - <? $colspan++ ?> - <col style="width: 10%"> - <? endif ?> - <? if (in_array('institute', $view_filter)) : ?> - <? $colspan++ ?> - <col style="width: 10%"> - <? endif ?> - <? if (in_array('requests', $view_filter)) : ?> - <? $colspan++ ?> - <col style="width: 5%"> - <? endif ?> - <? if (in_array('teachers', $view_filter)) : ?> - <? $colspan++ ?> - <col style="width: 10%"> - <? endif ?> - <? if (in_array('members', $view_filter)) : ?> - <? $colspan++ ?> - <col style="width: 3%"> - <? endif ?> - <? if (in_array('waiting', $view_filter)) : ?> - <? $colspan++ ?> - <col style="width: 5%"> - <? endif ?> - <? if (in_array('preliminary', $view_filter)) : ?> - <? $colspan++ ?> - <col style="width: 5%"> - <? endif ?> - <? if (in_array('contents', $view_filter)) : ?> - <? $colspan++ ?> - <col style="width: 8%"> - <? endif ?> - <? if (in_array('last_activity', $view_filter)) : ?> - <? $colspan++ ?> - <col style="width: 8%"> - <? endif ?> - <? foreach (PluginManager::getInstance()->getPlugins("AdminCourseContents") as $plugin) : ?> - <? foreach ($plugin->adminAvailableContents() as $index => $label) : ?> - <? if (in_array($plugin->getPluginId()."_".$index, $view_filter)) : ?> - <? $colspan++ ?> - <col style="width: 8%"> - <? endif ?> - <? endforeach ?> - <? endforeach ?> - <col style="width: 15%"> - - </colgroup> - <caption> - <? if (!$GLOBALS['user']->cfg->MY_COURSES_SELECTED_CYCLE) : ?> - <?= _('Veranstaltungen') ?> - <? else : ?> - <?= htmlReady(sprintf(_('Veranstaltungen im %s'), $semester->name)) ?> - <? endif ?> - <span class="actions"> - <?= sprintf('%u %s', $count_courses, $count_courses > 1 ? _('Veranstaltungen') : _('Veranstaltung')) ?> - </span> - </caption> - <thead> - <tr class="sortable"> - <? if (Config::get()->ADMIN_COURSES_SHOW_COMPLETE): ?> - <th <? if ($sortby === 'completion') printf('class="sort%s"', mb_strtolower($sortFlag)) ?>> - <a href="<?= URLHelper::getLink('', ['sortby' => 'completion', 'sortFlag' => mb_strtolower($sortFlag)]) ?>" class="course-completion" title="<?= _('Bearbeitungsstatus') ?>"> - <?= _('Bearbeitungsstatus') ?> - </a> - </th> - <? else: ?> - <th> - - </th> - <? endif; ?> - <? if (in_array('number', $view_filter)) : ?> - <th <?= ($sortby == 'VeranstaltungsNummer') ? sprintf('class="sort%s"', mb_strtolower($sortFlag)) : '' ?>> - <a href="<?= - URLHelper::getLink('', ['sortby' => 'VeranstaltungsNummer', - 'sortFlag' => mb_strtolower($sortFlag)]) ?>"> - <?= _('Nr.') ?> - </a> - </th> - <? endif ?> - <? if (in_array('name', $view_filter)) : ?> - <th <?= ($sortby == 'Name') ? sprintf('class="sort%s"', mb_strtolower($sortFlag)) : '' ?>> - <a href="<?= - URLHelper::getLink('', ['sortby' => 'Name', - 'sortFlag' => mb_strtolower($sortFlag)]) ?>"> - <?= _('Name') ?> - </a> - </th> - <? endif ?> - <? if (in_array('type', $view_filter)) : ?> - <th <?= ($sortby == 'status') ? sprintf('class="sort%s"', mb_strtolower($sortFlag)) : '' ?>> - <a href="<?= - URLHelper::getLink('', ['sortby' => 'status', - 'sortFlag' => mb_strtolower($sortFlag)]) ?>"> - <?= _("VA-Typ") ?> - </a> - </th> - <? endif ?> - <? if (in_array('room_time', $view_filter)) : ?> - <th><?= _('Raum/Zeit') ?></th> - <? endif ?> - <? if (in_array('semester', $view_filter)) : ?> - <th <?= ($sortby == 'start_time') ? sprintf('class="sort%s"', mb_strtolower($sortFlag)) : '' ?>> - <a href="<?= URLHelper::getLink('', ['sortby' => 'start_time', 'sortFlag' => mb_strtolower($sortFlag)]) ?>"> - <?= _('Semester') ?> - </a> - </th> - <? endif ?> - <? if (in_array('institute', $view_filter)) : ?> - <th <?= ($sortby == 'institute') ? sprintf('class="sort%s"', mb_strtolower($sortFlag)) : '' ?>> - <a href="<?= URLHelper::getLink('', ['sortby' => 'institute', 'sortFlag' => mb_strtolower($sortFlag)]) ?>"> - <?= _('Einrichtung') ?> - </a> - </th> - <? endif ?> - <? if (in_array('requests', $view_filter)) : ?> - <th <?= ($sortby == 'requests') ? sprintf('class="sort%s"', mb_strtolower($sortFlag)) : '' ?>> - <a href="<?= - URLHelper::getLink('', ['sortby' => 'requests', - 'sortFlag' => mb_strtolower($sortFlag)]) ?>"> - <abbr title="<?= _('Raumanfragen') ?>"> - <?= _('RA') ?> - </abbr> - </a> - </th> - <? endif ?> - <? if (in_array('teachers', $view_filter)) : ?> - <th><?= _('Lehrende') ?></th> - <? endif ?> - <? if (in_array('members', $view_filter)) : ?> - <th <?= ($sortby == 'teilnehmer') ? sprintf('class="sort%s"', mb_strtolower($sortFlag)) : '' ?>> - <a href="<?= URLHelper::getLink('', ['sortby' => 'teilnehmer', - 'sortFlag' => mb_strtolower($sortFlag)]) ?>"> - <abbr title="<?= _('Teilnehmende') ?>"> - <?= _('TN') ?> - </abbr> - </a> - </th> - <? endif ?> - <? if (in_array('waiting', $view_filter)) : ?> - <th <? if ($sortby == 'waiting') printf('class="sort%s"', mb_strtolower($sortFlag)); ?>> - <a href="<?= URLHelper::getLink('', ['sortby' => 'waiting', - 'sortFlag' => mb_strtolower($sortFlag)]) ?>"> - <?= _('Warteliste') ?> - </a> - </th> - <? endif ?> - <? if (in_array('preliminary', $view_filter)) : ?> - <th <?= ($sortby == 'prelim') ? sprintf('class="sort%s"', mb_strtolower($sortFlag)) : '' ?>> - <a href="<?= - URLHelper::getLink('', ['sortby' => 'prelim', - 'sortFlag' => mb_strtolower($sortFlag)]) ?>"><?= _('Vorläufig') ?></a> - </th> - <? endif ?> - <? if (in_array('contents', $view_filter)) : ?> - <th style="width: <?= $nav_elements * 27 ?>px"> - <?= _('Inhalt') ?> - </th> - <? endif ?> - <? if (in_array('last_activity', $view_filter)) : ?> - <th style="width: <?= $nav_elements * 27 ?>px"> - <?= _('letzte Aktivität') ?> - </th> - <? endif ?> - <? foreach (PluginManager::getInstance()->getPlugins("AdminCourseContents") as $plugin) : ?> - <? foreach ($plugin->adminAvailableContents() as $index => $label) : ?> - <? if (in_array($plugin->getPluginId()."_".$index, $view_filter)) : ?> - <th style="width: <?= $nav_elements * 27 ?>px"><?= htmlReady($label) ?></th> - <? endif ?> - <? endforeach ?> - <? endforeach ?> - <th style="text-align: center" class="actions"> - <?= _('Aktion') ?> - </th> - </tr> - <? if (!empty($actions[$selected_action]['multimode'])) : ?> - <?= $this->render_partial('admin/courses/additional_inputs.php', compact('colspan')) ?> - <? if (count($courses) > 10): ?> - <tr> - <th colspan="<?= $colspan ?>" style="text-align: right"> - <? if (is_a($actions[$selected_action]['multimode'], "\\Studip\\Button")) : ?> - <?= $actions[$selected_action]['multimode'] ?> - <? else : ?> - <?= Studip\Button::createAccept( - is_string($actions[$selected_action]['multimode']) - ? $actions[$selected_action]['multimode'] - : $actions[$selected_action]['title'], - 'save_action', - $selected_action == 16 ? ['data-dialog' => 1] : null) ?> - <? endif ?> - </th> - </tr> - <? endif; ?> - <? endif ?> - </thead> - <tbody> - <? foreach ($courses as $semid => $values) : ?> - <?= $this->render_partial('admin/courses/_course', - [ - 'semid' => $semid, - 'values' => $values, - 'view_filter' => $view_filter, - 'actions' => $actions, - 'selected_action' => $selected_action, - 'courses' => $courses, - 'parent' => $parent ?? null - ] - ) ?> - <? endforeach ?> - </tbody> -<? if (!empty($actions[$selected_action]['multimode'])) : ?> - <tfoot> - <tr> - <td colspan="<?= $colspan ?>" style="text-align: right"> - <? if (is_a($actions[$selected_action]['multimode'], "\\Studip\\Button")) : ?> - <?= $actions[$selected_action]['multimode'] ?> - <? else : ?> - <?= Studip\Button::createAccept( - is_string($actions[$selected_action]['multimode']) - ? $actions[$selected_action]['multimode'] - : $actions[$selected_action]['title'], - $actions[$selected_action]['name'], - $selected_action == 16 ? ['data-dialog' => 1] : null) ?> - <? endif ?> - </td> - </tr> - </tfoot> - <? endif ?> -</table> -<? if (!empty($actions[$selected_action]['multimode'])) : ?> -</form> -<? endif ?> diff --git a/app/views/admin/cronjobs/logs/index.php b/app/views/admin/cronjobs/logs/index.php index 1073d1b..d17a4a5 100644 --- a/app/views/admin/cronjobs/logs/index.php +++ b/app/views/admin/cronjobs/logs/index.php @@ -135,7 +135,7 @@ use Studip\Button, Studip\LinkButton; <tfoot> <tr> <td colspan="6"> - <select name="action" data-activates="button[name=bulk]"> + <select name="action" data-activates="button[name=bulk]" aria-label="<?= _('Aktion auswählen') ?>"> <option value="">- <?= _('Aktion auswählen') ?></option> <option value="delete"><?= _('Löschen') ?></option> </select> diff --git a/app/views/admin/cronjobs/schedules/display.php b/app/views/admin/cronjobs/schedules/display.php index 8eb9075..ddf1d21 100644 --- a/app/views/admin/cronjobs/schedules/display.php +++ b/app/views/admin/cronjobs/schedules/display.php @@ -16,9 +16,6 @@ <dt><?= _('Aktiv') ?></dt> <dd><?= $schedule->active ? _('Ja') : _('Nein') ?></dd> - <dt><?= _('Priorität') ?></dt> - <dd><?= CronjobSchedule::describePriority($schedule->priority) ?></dd> - <? if (count($schedule->parameters) > 0): ?> <dt><?= _('Parameter') ?></dt> <dd> @@ -33,23 +30,8 @@ <dt><?= _('Aufgabe') ?></dt> <dd><?= htmlReady($schedule->task->name) ?></dd> - <dt><?= _('Typ') ?></dt> -<? if ($schedule->type === 'once'): ?> - <dd> - <?= sprintf(_('Einmalig am %s um %s'), date('d.m.Y', $schedule->next_execution), date('H:i', $schedule->next_execution)) ?> - </dd> - - <dt><?= _('Ausgeführt') ?>?</dt> - <dd> - <? if ($schedule->execution_count > 0): ?> - <?= _('Ja') ?>, <?= sprintf(_('am %s um %s'), date('d.m.Y', $schedule->last_execution), date('H:i:s', $schedule->last_execution)) ?> - <? else: ?> - <?= _('Nein') ?> - <? endif; ?> - </dd> -<? else: ?> + <dt><?= _('Ausführungsrhytmus') ?></dt> <dd> - <?= _('Regelmässig') ?> <?= $this->render_partial('admin/cronjobs/schedules/periodic-schedule', $schedule->toArray()) ?> </dd> @@ -68,8 +50,6 @@ <dt><?= _('Letztes Ergebnis') ?></dt> <dd><code><?= htmlReady($schedule->last_result) ?></code></dd> <? endif; ?> - -<? endif; ?> </dl> <div data-dialog-button> diff --git a/app/views/admin/cronjobs/schedules/edit.php b/app/views/admin/cronjobs/schedules/edit.php index 96be249..8754510 100644 --- a/app/views/admin/cronjobs/schedules/edit.php +++ b/app/views/admin/cronjobs/schedules/edit.php @@ -42,17 +42,6 @@ $days_of_week = [ </label> <label> - <?= _('Priorität') ?> - <select name="priority" id="priority"> - <? foreach (CronjobSchedule::getPriorities() as $priority => $label): ?> - <option value="<?= $priority ?>" <? if ((!$schedule->priority && $priority === CronjobSchedule::PRIORITY_NORMAL) || $schedule->priority === $priority) echo 'selected'; ?>> - <?= htmlReady($label) ?> - </option> - <? endforeach; ?> - </select> - </label> - - <label> <?= _('Titel') ?> <input type="text" name="title" id="title" value="<?= htmlReady($schedule->title ?: '') ?>"> </label> @@ -118,14 +107,6 @@ $days_of_week = [ <fieldset> <legend><?= _('Zeitplan') ?></legend> - <label> - <input type="radio" name="type" value="periodic" - data-activates="[name^='periodic']" - data-deactivates="[name^='once']" - <? if ($schedule->type === 'periodic') echo 'checked'; ?>> - <?= _('Wiederholt') ?> - </label> - <section> <table class="default"> <colgroup> @@ -218,26 +199,6 @@ $days_of_week = [ </tbody> </table> </section> - - <label> - <input type="radio" name="type" value="once" - data-activates="input[name^='once']" - data-deactivates="[name^='periodic']" - <? if ($schedule->type === 'once') echo 'checked'; ?>> - <?= _('Einmalig') ?> - </label> - - <label class="col-1"> - <?= _('Datum') ?> - <input type="text" name="once[date]" data-date-picker class="size-s" - value="<? if ($schedule->type === 'once' && $schedule->next_execution) echo date('d.m.Y', $schedule->next_execution); ?>"> - </label> - - <label class="col-1"> - <?= _('Uhrzeit') ?> - <input type="text" name="once[time]" data-time-picker class="size-s" - value="<? if ($schedule->type === 'once' && $schedule->next_execution) echo date('H:i', $schedule->next_execution) ?>"> - </label> </fieldset> <footer class="buttons"> diff --git a/app/views/admin/cronjobs/schedules/index.php b/app/views/admin/cronjobs/schedules/index.php index 6160875..79a65be 100644 --- a/app/views/admin/cronjobs/schedules/index.php +++ b/app/views/admin/cronjobs/schedules/index.php @@ -18,30 +18,18 @@ use Studip\Button, Studip\LinkButton; <?= sprintf(_('Passend: %u von %u Cronjobs'), count($schedules), $total) ?> <? endif; ?> </legend> - <label class="col-2"> - <?= _('Typ') ?> - <select name="filter[type]" id="type" class="submit-upon-select"> - <option value=""><?= _('Alle Cronjobs anzeigen') ?></option> - <option value="once" <? if ($filter['type'] === 'once') echo 'selected'; ?>> - <?= _('Nur einmalige Cronjobs anzeigen') ?> - </option> - <option value="periodic" <? if ($filter['type'] === 'periodic') echo 'selected'; ?>> - <?= _('Nur regelmässige Cronjobs anzeigen') ?> - </option> - </select> - </label> - <label class="col-2"> + <label class="col-3"> <?= _('Aufgabe') ?> <select name="filter[task_id]" id="task_id" class="submit-upon-select"> <option value=""><?= _('Alle Cronjobs anzeigen') ?></option> <? foreach ($tasks as $task): ?> - <option value="<?= $task->task_id ?>" <? if ($filter['task_id'] === $task->task_id) echo 'selected'; ?>> + <option value="<?= $task->task_id ?>" <? if (isset($filter['task_id']) && $filter['task_id'] === $task->task_id) echo 'selected'; ?>> <?= htmlReady($task->name) ?> </option> <? endforeach; ?> </select> </label> - <label class="col-2"> + <label class="col-3"> <?= _('Status') ?> <select name="filter[status]" id="status" class="submit-upon-select"> <option value=""><?= _('Alle Cronjobs anzeigen') ?></option> @@ -74,7 +62,6 @@ use Studip\Button, Studip\LinkButton; <col style="width: 20px"> <col> <col style="width: 40px"> - <col style="width: 100px"> <col style="width: 30px"> <col style="width: 30px"> <col style="width: 30px"> @@ -91,7 +78,6 @@ use Studip\Button, Studip\LinkButton; </th> <th data-sort="text"><?= _('Cronjob') ?></th> <th data-sort="htmldata"><?= _('Aktiv') ?></th> - <th data-sort="text"><?= _('Typ') ?></th> <th colspan="5" data-sort="false"><?= _('Ausführung') ?></th> <th data-sort="false"><?= _('Optionen') ?></th> </tr> @@ -124,14 +110,7 @@ use Studip\Button, Studip\LinkButton; </a> <? endif; ?> </td> - <td><?= $schedule->type === 'once' ? _('Einmalig') : _('Regelmässig') ?></td> - <? if ($schedule->type === 'once'): ?> - <td colspan="5"> - <?= strftime('%x %R', $schedule->next_execution) ?> - </td> - <? else: ?> - <?= $this->render_partial('admin/cronjobs/schedules/periodic-schedule', $schedule->toArray() + ['display' => 'table-cells']) ?> - <? endif; ?> + <?= $this->render_partial('admin/cronjobs/schedules/periodic-schedule', $schedule->toArray() + ['display' => 'table-cells']) ?> <td style="text-align: right"> <a data-dialog href="<?= $controller->display($schedule) ?>"> <?= Icon::create('admin')->asImg(['title' => _('Cronjob anzeigen')]) ?> @@ -152,7 +131,7 @@ use Studip\Button, Studip\LinkButton; </tbody> <tfoot> <tr> - <td colspan="10"> + <td colspan="9"> <select name="action" data-activates=".cronjobs button[name=bulk]" aria-label="<?= _('Aktion auswählen')?>"> <option value="">- <?= _('Aktion auswählen') ?> -</option> <option value="activate"><?= _('Aktivieren') ?></option> diff --git a/app/views/admin/cronjobs/tasks/index.php b/app/views/admin/cronjobs/tasks/index.php index c39df93..0edd191 100644 --- a/app/views/admin/cronjobs/tasks/index.php +++ b/app/views/admin/cronjobs/tasks/index.php @@ -78,7 +78,7 @@ use Studip\Button; <tfoot> <tr> <td colspan="6"> - <select name="action" data-activates=".cronjobs button[name=bulk]"> + <select name="action" data-activates=".cronjobs button[name=bulk]" aria-label="<?= _('Aktion auswählen') ?>"> <option value="">- <?= _('Aktion auswählen') ?></option> <option value="activate"><?= _('Aktivieren') ?></option> <option value="deactivate"><?= _('Deaktivieren') ?></option> diff --git a/app/views/admin/datafields/new.php b/app/views/admin/datafields/new.php index 0c6f696..e64293f 100644 --- a/app/views/admin/datafields/new.php +++ b/app/views/admin/datafields/new.php @@ -45,7 +45,7 @@ use Studip\Button, Studip\LinkButton; <?= _('Veranstaltungskategorie') ?> <? elseif ($object_typ === 'inst'): ?> <?= _('Einrichtungstyp') ?> - <? elseif ($object_typ === 'moduldeskriptor' || $object_type === 'modulteildeskriptor') : ?> + <? elseif ($object_typ === 'moduldeskriptor' || $object_typ === 'modulteildeskriptor') : ?> <?= _('Sprache') ?> <? elseif ($object_typ === 'studycourse'): ?> <?= _('Typ/Abschnitt') ?> diff --git a/app/views/admin/lockrules/_form.php b/app/views/admin/lockrules/_form.php index c4ef111..b96c7b6 100644 --- a/app/views/admin/lockrules/_form.php +++ b/app/views/admin/lockrules/_form.php @@ -85,12 +85,14 @@ use Studip\Button; </td> <td> <input type="radio" - name="lockdata_attributes[<?= $attr ?>]" <?= ($lock_rule['attributes'][$attr] ? 'checked' : '') ?> - value="1"/> + name="lockdata_attributes[<?= $attr ?>]" + <?= !empty($lock_rule['attributes'][$attr]) ? 'checked' : '' ?> + value="1"> </td> <td> <input type="radio" - name="lockdata_attributes[<?= $attr ?>]" <?= (!$lock_rule['attributes'][$attr] ? 'checked' : '') ?> + name="lockdata_attributes[<?= $attr ?>]" + <?= empty($lock_rule['attributes'][$attr]) ? 'checked' : '' ?> value="0"/> </td> </tr> diff --git a/app/views/admin/plugin/edit_automaticupdate.php b/app/views/admin/plugin/edit_automaticupdate.php index 7e87c31..2feb1bc 100644 --- a/app/views/admin/plugin/edit_automaticupdate.php +++ b/app/views/admin/plugin/edit_automaticupdate.php @@ -46,7 +46,7 @@ if ($_SERVER['HTTPS'] == 'on' && $_SERVER['SERVER_PORT'] != 443 || <fieldset> <legend><?= _("Daten für das bereitstellende System") ?></legend> <p class="info"> - <?= _("Tragen Sie bei gitlab, github.com oder dem Pluginmarktplatz untenstehende URL ein, die der Webhook aufrufen soll.") ?> + <?= _("Tragen Sie bei gitlab, github.com oder dem Pluginmarktplatz die folgende URL ein, die der Webhook aufrufen soll.") ?> <? if ($plugin['automatic_update_secret']) : ?> <?= _("Dieser Aufruf muss noch mit dem Sicherheitstoken abgesichert werden.") ?> <? endif ?> diff --git a/app/views/admin/tree/create.php b/app/views/admin/tree/create.php index 027507a..55d26a5 100644 --- a/app/views/admin/tree/create.php +++ b/app/views/admin/tree/create.php @@ -20,8 +20,8 @@ <? foreach ($GLOBALS['SEM_TREE_TYPES'] as $index => $type) : ?> <option value="<?= htmlReady($index) ?>"> <?= $type['name'] ?: _('Standard') ?> - <?= !$type['editable'] ? _('(nicht mehr nachträglich änderbar)') : '' ?> - <?= $type['hidden'] ? _('(dieser Knoten ist versteckt)') : '' ?> + <?= empty($type['editable']) ? _('(nicht mehr nachträglich änderbar)') : '' ?> + <?= !empty($type['hidden']) ? _('(dieser Knoten ist versteckt)') : '' ?> </option> <? endforeach ?> </select> diff --git a/app/views/admin/user/edit.php b/app/views/admin/user/edit.php index 75ca932..47596a9 100644 --- a/app/views/admin/user/edit.php +++ b/app/views/admin/user/edit.php @@ -29,7 +29,10 @@ use Studip\Button, Studip\LinkButton; <? if ($user->locked): ?> <br> <span style="color: red"> - (<?= sprintf(_('gesperrt von %s'), htmlReady(get_fullname($user->locked_by))) ?> + (<?= htmlReady(sprintf( + _('gesperrt von %s'), + $user->locked_by ? get_fullname($user->locked_by) : _('unbekannt') + )) ?> <? if ($user->lock_comment): ?> , <?= _('Kommentar') ?>: <?= htmlReady($user->lock_comment) ?> <? endif; ?> @@ -341,7 +344,7 @@ use Studip\Button, Studip\LinkButton; <br> - <? if ($user->online->last_lifesign): ?> + <? if (!empty($user->online->last_lifesign)): ?> <abbr title="<?= strftime('%x %X', $user->online->last_lifesign) ?>"> <?= reltime($user->online->last_lifesign, true, 2) ?> </abbr> @@ -431,7 +434,7 @@ use Studip\Button, Studip\LinkButton; <?= sprintf( '%s, %s, %s. %s', htmlReady($usc->studycourse->name), - htmlReady($usc->degree->name), + htmlReady($usc->degree->name ?? _('Unbekannt')), htmlReady($usc->semester), _('Fachsemester') ) ?> diff --git a/app/views/admin/webservice_access/index.php b/app/views/admin/webservice_access/index.php index 07edb4c..223e5c3 100644 --- a/app/views/admin/webservice_access/index.php +++ b/app/views/admin/webservice_access/index.php @@ -28,7 +28,7 @@ </th> </tr> <? foreach ($ws_rules as $rule): ?> - <tr class="<?= TextHelper::cycle('table_row_even', 'table_row_odd') ?>"> + <tr> <? if (isset($edit) && $edit == $rule->id) :?> <td> <a name="edit"></a> |
