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

prevent more php8 warnings, fixes #1717

Closes #1717

Merge request studip/studip!1119
parent e1af76a7
No related branches found
No related tags found
No related merge requests found
<form class="default"
action="<?= $controller->link_for('calendar/schedule/addentry' . ($show_entry['id'] ? '/' . $show_entry['id'] : '')) ?>"
action="<?= $controller->link_for('calendar/schedule/addentry', $show_entry['id'] ?? null) ?>"
method="post" name="edit_entry" onSubmit="return STUDIP.Schedule.checkFormFields()">
<?= CSRFProtection::tokenTag() ?>
<fieldset>
......@@ -22,38 +22,38 @@
<label class="col-2">
<?= _('von') ?>
<input class="size-s studip-timepicker" placeholder="HH:mm" type="text" size="2" name="entry_start"
value="<?= $show_entry['start'] ? $show_entry['start_formatted'] : '' ?>"
value="<?= !empty($show_entry['start']) ? $show_entry['start_formatted'] : '' ?>"
id="entry-start" data-time-picker>
</label>
<label class="col-2">
<?= _('bis') ?>
<input class="size-s studip-timepicker" placeholder="HH:mm" type="text" size="2" name="entry_end"
value="<?= $show_entry['end'] ? $show_entry['end_formatted'] : '' ?>"
value="<?= !empty($show_entry['end']) ? $show_entry['end_formatted'] : '' ?>"
id="entry-end" data-time-picker>
</label>
<span class="invalid_message"><?= _('Die Endzeit liegt vor der Startzeit!') ?></span>
<?= $this->render_partial('calendar/schedule/_colorpicker.php', [
'selected' => $show_entry['color'],
'selected' => $show_entry['color'] ?? null,
]) ?>
<label>
<?= _('Titel') ?>
<input type="text" name="entry_title" value="<?= htmlReady($show_entry['title']) ?>">
<input type="text" name="entry_title" value="<?= htmlReady($show_entry['title'] ?? '') ?>">
</label>
<label>
<?= _('Beschreibung') ?>
<textarea name="entry_content"
rows="7"><?= htmlReady($show_entry['content']) ?></textarea>
rows="7"><?= htmlReady($show_entry['content'] ?? '') ?></textarea>
</label>
</fieldset>
<footer data-dialog-button>
<?= Studip\Button::createAccept(_('Speichern'), ['style' => 'margin-right: 20px']) ?>
<? if ($show_entry['id']) : ?>
<? if (isset($show_entry['id'])) : ?>
<?= Studip\LinkButton::create(
_('Löschen'),
$controller->url_for('calendar/schedule/delete/'. $show_entry['id']),
......@@ -61,7 +61,7 @@
) ?>
<? endif ?>
<? if ($show_entry) : ?>
<? if (!empty($show_entry)) : ?>
<?= Studip\LinkButton::createCancel(
_('Abbrechen'),
$controller->url_for('calendar/schedule'),
......
<? if ($show_entry && in_array($show_entry['type'], ['sem', 'virtual']) !== false) : ?>
<? if (!empty($show_entry) && in_array($show_entry['type'], ['sem', 'virtual']) !== false) : ?>
<?= $this->render_partial('calendar/schedule/_entry_course.php') ?>
<? unset($this->show_entry) ?>
<? elseif ($show_entry && $show_entry['type'] == 'inst') : ?>
......
......@@ -333,7 +333,10 @@ class CalendarColumn
for ($i = floor($data['start'] / 100); $i <= floor($data['end'] / 100); $i++) {
for ($j = 0; $j < 60; $j++) {
if (($i * 100) + $j >= $data['start'] && ($i * 100) + $j < $data['end']) {
$group_matrix[($i * 100) + $j]++;
if (!isset($group_matrix[$i * 100 + $j])) {
$group_matrix[$i * 100 + $j] = 0;
}
$group_matrix[$i * 100 + $j]++;
}
}
}
......
......@@ -159,6 +159,8 @@ class SearchWidget extends SidebarWidget
$reset_link = URLHelper::getLink($this->url, array_merge($reset_params, ['reset-search' => 1]));
$this->template_variables['reset_link'] = $reset_link;
} else {
$this->template_variables['reset_link'] = false;
}
$this->template_variables['needles'] = $this->needles;
......
......@@ -285,8 +285,9 @@ function kill_format ($text) {
$text = explode("[nop] [/nop]", $text);
$i = 0;
$all = '';
foreach ($text as $w)
$all .= $w . $matches[1][$i++];
foreach ($text as $w) {
$all .= $w . ($matches[1][$i++] ?? '');
}
return $all;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment