Skip to content
Snippets Groups Projects
Commit 850fe60f authored by Jan-Hendrik Willms's avatar Jan-Hendrik Willms Committed by David Siegfried
Browse files

prevent php8 warnings, fixes #2250

Closes #2250

Merge request studip/studip!1484
parent aad7efd8
No related branches found
No related tags found
1 merge request!4Draft: Icon creation
...@@ -84,8 +84,9 @@ use Studip\Button; ...@@ -84,8 +84,9 @@ use Studip\Button;
<?=_('Einrichtung')?> <?=_('Einrichtung')?>
<select name="institute"> <select name="institute">
<option value=""><?= _('Alle')?></option> <option value=""><?= _('Alle')?></option>
<? foreach($institutes as $institute) : ?> <? foreach ($institutes as $institute) : ?>
<option value="<?= $institute['Institut_id']?>" <?= $request['institute'] == $institute['Institut_id'] ? 'selected' : ''?>> <option value="<?= htmlReady($institute['Institut_id']) ?>"
<?= isset($request['institute']) && $request['institute'] === $institute['Institut_id'] ? 'selected' : ''?>>
<?= htmlReady($institute['Name'])?> <?= htmlReady($institute['Name'])?>
</option> </option>
<? endforeach ?> <? endforeach ?>
...@@ -97,11 +98,12 @@ use Studip\Button; ...@@ -97,11 +98,12 @@ use Studip\Button;
<select name="userdomains"> <select name="userdomains">
<option value=""><?= _('Alle') ?></option> <option value=""><?= _('Alle') ?></option>
<option value="null-domain" <?= $request['userdomains'] === 'null-domain' ? 'selected' : '' ?>> <option value="null-domain" <?= isset($request['userdomains']) && $request['userdomains'] === 'null-domain' ? 'selected' : '' ?>>
<?= _('Ohne Domäne') ?> <?= _('Ohne Domäne') ?>
</option> </option>
<? foreach ($userdomains as $one): ?> <? foreach ($userdomains as $one): ?>
<option value="<?= htmlReady($one->id) ?>" <?= $request['userdomains'] === $one->id ? 'selected' : ''?>> <option value="<?= htmlReady($one->id) ?>"
<?= isset($request['userdomains']) && $request['userdomains'] === $one->id ? 'selected' : ''?>>
<?= htmlReady($one->name ?: $one->id) ?> <?= htmlReady($one->name ?: $one->id) ?>
</option> </option>
<? endforeach; ?> <? endforeach; ?>
...@@ -114,7 +116,7 @@ use Studip\Button; ...@@ -114,7 +116,7 @@ use Studip\Button;
<option value=""><?=_('Alle')?></option> <option value=""><?=_('Alle')?></option>
<? foreach($degrees as $degree) : ?> <? foreach($degrees as $degree) : ?>
<option value="<?= $degree->id ?>" <option value="<?= $degree->id ?>"
<?= !empty($request['degree']) && in_array($degree->id, $request['degree']) ? 'selected' : ''?>> <?= isset($request['degree']) && in_array($degree->id, $request['degree']) ? 'selected' : '' ?>>
<?=htmlReady($degree->name)?> <?=htmlReady($degree->name)?>
</option> </option>
<? endforeach ?> <? endforeach ?>
...@@ -127,7 +129,7 @@ use Studip\Button; ...@@ -127,7 +129,7 @@ use Studip\Button;
<option value=""><?=_('Alle')?></option> <option value=""><?=_('Alle')?></option>
<? foreach($studycourses as $studycourse) : ?> <? foreach($studycourses as $studycourse) : ?>
<option value="<?= $studycourse->id ?>" <option value="<?= $studycourse->id ?>"
<?= !empty($request['studycourse']) && in_array($studycourse->id, $request['studycourse']) ? 'selected' : ''?>> <?= isset($request['studycourse']) && in_array($studycourse->id, $request['studycourse']) ? 'selected' : ''?>>
<?=htmlReady($studycourse->name)?> <?=htmlReady($studycourse->name)?>
</option> </option>
<? endforeach ?> <? endforeach ?>
...@@ -139,7 +141,7 @@ use Studip\Button; ...@@ -139,7 +141,7 @@ use Studip\Button;
<select name="fachsem"> <select name="fachsem">
<option value=""><?= _('Alle') ?></option> <option value=""><?= _('Alle') ?></option>
<? for ($i = 1; $i <= 50; $i += 1): ?> <? for ($i = 1; $i <= 50; $i += 1): ?>
<option <?= $request['fachsem'] && (int)$request['fachsem'] === $i ? 'selected' : ''?>> <option <?= isset($request['fachsem']) && (int) $request['fachsem'] === $i ? 'selected' : ''?>>
<?= $i ?> <?= $i ?>
</option> </option>
<? endfor; ?> <? endfor; ?>
...@@ -151,7 +153,8 @@ use Studip\Button; ...@@ -151,7 +153,8 @@ use Studip\Button;
<select name="auth_plugins"> <select name="auth_plugins">
<option value=""><?= _('Alle') ?></option> <option value=""><?= _('Alle') ?></option>
<? foreach (array_merge(['preliminary' => _('vorläufig')], $available_auth_plugins) as $key => $val): ?> <? foreach (array_merge(['preliminary' => _('vorläufig')], $available_auth_plugins) as $key => $val): ?>
<option value="<?= $key ?>" <?= $request['auth_plugins'] === $key ? 'selected' : '' ?>> <option value="<?= $key ?>"
<?= isset($request['auth_plugins']) && $request['auth_plugins'] === $key ? 'selected' : '' ?>>
<?= htmlReady($val) ?> <?= htmlReady($val) ?>
</option> </option>
<? endforeach; ?> <? endforeach; ?>
...@@ -165,15 +168,15 @@ use Studip\Button; ...@@ -165,15 +168,15 @@ use Studip\Button;
<? if ($datafield->type === 'bool'): ?> <? if ($datafield->type === 'bool'): ?>
<section class="hgroup"> <section class="hgroup">
<span class="col-2"> <span class="col-2">
<input type="radio" name="<?= $datafield->id ?>" value="" <?= isset($request[$datafield->id]) && mb_strlen($request[$datafield->id]) === 0 ? 'checked' : '' ?>> <input type="radio" name="<?= htmlReady($datafield->id) ?>" value="" <?= isset($request[$datafield->id]) && mb_strlen($request[$datafield->id]) === 0 ? 'checked' : '' ?>>
<?= _('egal') ?> <?= _('egal') ?>
</span> </span>
<span class="col-2"> <span class="col-2">
<input type="radio" name="<?= $datafield->id ?>" value="1" <?= (!empty($request[$datafield->id]) && $request[$datafield->id] === '1') ? 'checked' : '' ?>> <input type="radio" name="<?= htmlReady($datafield->id) ?>" value="1" <?= (!empty($request[$datafield->id]) && $request[$datafield->id] === '1') ? 'checked' : '' ?>>
<?= _('ja') ?> <?= _('ja') ?>
</span> </span>
<span class="col-2"> <span class="col-2">
<input type="radio" name="<?= $datafield->id ?>" value="0" <?= isset($request[$datafield->id]) && $request[$datafield->id] === '0' ? 'checked' : '' ?>> <input type="radio" name="<?= htmlReady($datafield->id) ?>" value="0" <?= isset($request[$datafield->id]) && $request[$datafield->id] === '0' ? 'checked' : '' ?>>
<?= _('nein') ?> <?= _('nein') ?>
</span> </span>
</section> </section>
......
<?php
/**
* @var Course_TimesroomsController $controller
* @var Semester[] $semester
* @var Course $course
*/
?>
<form action="<?= $controller->link_for('course/timesrooms/editSemester') ?>" method="post" <form action="<?= $controller->link_for('course/timesrooms/editSemester') ?>" method="post"
class="default" data-dialog> class="default" data-dialog>
<?=CSRFProtection::tokenTag()?> <?=CSRFProtection::tokenTag()?>
...@@ -20,7 +27,7 @@ ...@@ -20,7 +27,7 @@
<?= _('Dauer') ?> <?= _('Dauer') ?>
<select name="endSemester" id="endSemester"> <select name="endSemester" id="endSemester">
<option value="0" <option value="0"
<?= $course->end_semester->id === $course->start_semester->id ? 'selected' : '' ?>> <?= count($course->semesters) === 1 ? 'selected' : '' ?>>
<?= _('Ein Semester') ?></option> <?= _('Ein Semester') ?></option>
<? foreach ($semester as $sem) : ?> <? foreach ($semester as $sem) : ?>
<? if ($sem->beginn >= $course->start_semester->beginn) : ?> <? if ($sem->beginn >= $course->start_semester->beginn) : ?>
......
...@@ -597,7 +597,6 @@ class ForumEntry implements PrivacyObject ...@@ -597,7 +597,6 @@ class ForumEntry implements PrivacyObject
public static function getList($type, $parent_id) public static function getList($type, $parent_id)
{ {
$start = (ForumHelpers::getPage() - 1) * ForumEntry::POSTINGS_PER_PAGE; $start = (ForumHelpers::getPage() - 1) * ForumEntry::POSTINGS_PER_PAGE;
$last_visit_date = ForumVisit::getLastVisit($constraint['seminar_id']);
switch ($type) { switch ($type) {
case 'area': case 'area':
$list = ForumEntry::getEntries($parent_id, ForumEntry::WITHOUT_CHILDS, '', 'DESC', 0, 1000); $list = ForumEntry::getEntries($parent_id, ForumEntry::WITHOUT_CHILDS, '', 'DESC', 0, 1000);
...@@ -637,6 +636,7 @@ class ForumEntry implements PrivacyObject ...@@ -637,6 +636,7 @@ class ForumEntry implements PrivacyObject
case 'newest': case 'newest':
$constraint = ForumEntry::getConstraints($parent_id); $constraint = ForumEntry::getConstraints($parent_id);
$last_visit_date = ForumVisit::getLastVisit($constraint['seminar_id']);
// get postings // get postings
$stmt = DBManager::get()->prepare("SELECT forum_entries.*, IF(ou.topic_id IS NOT NULL, 'fav', NULL) as fav $stmt = DBManager::get()->prepare("SELECT forum_entries.*, IF(ou.topic_id IS NOT NULL, 'fav', NULL) as fav
...@@ -657,7 +657,6 @@ class ForumEntry implements PrivacyObject ...@@ -657,7 +657,6 @@ class ForumEntry implements PrivacyObject
$postings = $stmt->fetchAll(PDO::FETCH_ASSOC); $postings = $stmt->fetchAll(PDO::FETCH_ASSOC);
$postings = ForumEntry::parseEntries($postings); $postings = ForumEntry::parseEntries($postings);
// var_dump($postings);
// count found postings // count found postings
$stmt_count = DBManager::get()->prepare("SELECT COUNT(*) $stmt_count = DBManager::get()->prepare("SELECT COUNT(*)
......
...@@ -26,8 +26,6 @@ class PluginAdministration ...@@ -26,8 +26,6 @@ class PluginAdministration
*/ */
public function installPlugin($filename) public function installPlugin($filename)
{ {
global $SOFTWARE_VERSION;
$packagedir = Config::get()->PLUGINS_PATH . '/tmp_' . md5($filename); $packagedir = Config::get()->PLUGINS_PATH . '/tmp_' . md5($filename);
// extract plugin files // extract plugin files
...@@ -69,8 +67,8 @@ class PluginAdministration ...@@ -69,8 +67,8 @@ class PluginAdministration
// get plugin meta data // get plugin meta data
$pluginclass = $manifest['pluginclassname']; $pluginclass = $manifest['pluginclassname'];
$origin = $manifest['origin']; $origin = $manifest['origin'];
$min_version = $manifest['studipMinVersion']; $min_version = $manifest['studipMinVersion'] ?? null;
$max_version = $manifest['studipMaxVersion']; $max_version = $manifest['studipMaxVersion'] ?? null;
// check for compatible version // check for compatible version
if ((isset($min_version) && StudipVersion::olderThan($min_version)) || if ((isset($min_version) && StudipVersion::olderThan($min_version)) ||
...@@ -134,7 +132,7 @@ class PluginAdministration ...@@ -134,7 +132,7 @@ class PluginAdministration
} }
// register additional plugin classes in this package // register additional plugin classes in this package
$additionalclasses = $manifest['additionalclasses']; $additionalclasses = $manifest['additionalclasses'] ?? null;
if (is_array($additionalclasses)) { if (is_array($additionalclasses)) {
foreach ($additionalclasses as $class) { foreach ($additionalclasses as $class) {
......
...@@ -60,6 +60,7 @@ ...@@ -60,6 +60,7 @@
* @property SimpleORMapCollection admission_applicants has_many AdmissionApplication * @property SimpleORMapCollection admission_applicants has_many AdmissionApplication
* @property SimpleORMapCollection datafields has_many DatafieldEntryModel * @property SimpleORMapCollection datafields has_many DatafieldEntryModel
* @property SimpleORMapCollection cycles has_many SeminarCycleDate * @property SimpleORMapCollection cycles has_many SeminarCycleDate
* @property Semester[]|SimpleORMapCollection $semesters belongs_to Semester
* @property Semester start_semester belongs_to Semester * @property Semester start_semester belongs_to Semester
* @property Semester end_semester belongs_to Semester * @property Semester end_semester belongs_to Semester
* @property Institute home_institut belongs_to Institute * @property Institute home_institut belongs_to Institute
......
...@@ -59,7 +59,7 @@ if ($auth->auth["uid"]!="nobody") { ...@@ -59,7 +59,7 @@ if ($auth->auth["uid"]!="nobody") {
$user->set_last_action($timeout); $user->set_last_action($timeout);
//der logout() Aufruf fuer CAS (dadurch wird das Cookie (Ticket) im Browser zerstoert) //der logout() Aufruf fuer CAS (dadurch wird das Cookie (Ticket) im Browser zerstoert)
if ($docaslogout){ if (!empty($docaslogout)) {
$casauth->logout(); $casauth->logout();
} }
} else { } else {
...@@ -68,5 +68,3 @@ if ($auth->auth["uid"]!="nobody") { ...@@ -68,5 +68,3 @@ if ($auth->auth["uid"]!="nobody") {
} }
header("Location:" . URLHelper::getURL("index.php?logout=true&set_language=$_language&set_contrast=$contrast")); header("Location:" . URLHelper::getURL("index.php?logout=true&set_language=$_language&set_contrast=$contrast"));
?>
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment