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" <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()"> method="post" name="edit_entry" onSubmit="return STUDIP.Schedule.checkFormFields()">
<?= CSRFProtection::tokenTag() ?> <?= CSRFProtection::tokenTag() ?>
<fieldset> <fieldset>
...@@ -22,38 +22,38 @@ ...@@ -22,38 +22,38 @@
<label class="col-2"> <label class="col-2">
<?= _('von') ?> <?= _('von') ?>
<input class="size-s studip-timepicker" placeholder="HH:mm" type="text" size="2" name="entry_start" <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> id="entry-start" data-time-picker>
</label> </label>
<label class="col-2"> <label class="col-2">
<?= _('bis') ?> <?= _('bis') ?>
<input class="size-s studip-timepicker" placeholder="HH:mm" type="text" size="2" name="entry_end" <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> id="entry-end" data-time-picker>
</label> </label>
<span class="invalid_message"><?= _('Die Endzeit liegt vor der Startzeit!') ?></span> <span class="invalid_message"><?= _('Die Endzeit liegt vor der Startzeit!') ?></span>
<?= $this->render_partial('calendar/schedule/_colorpicker.php', [ <?= $this->render_partial('calendar/schedule/_colorpicker.php', [
'selected' => $show_entry['color'], 'selected' => $show_entry['color'] ?? null,
]) ?> ]) ?>
<label> <label>
<?= _('Titel') ?> <?= _('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>
<label> <label>
<?= _('Beschreibung') ?> <?= _('Beschreibung') ?>
<textarea name="entry_content" <textarea name="entry_content"
rows="7"><?= htmlReady($show_entry['content']) ?></textarea> rows="7"><?= htmlReady($show_entry['content'] ?? '') ?></textarea>
</label> </label>
</fieldset> </fieldset>
<footer data-dialog-button> <footer data-dialog-button>
<?= Studip\Button::createAccept(_('Speichern'), ['style' => 'margin-right: 20px']) ?> <?= Studip\Button::createAccept(_('Speichern'), ['style' => 'margin-right: 20px']) ?>
<? if ($show_entry['id']) : ?> <? if (isset($show_entry['id'])) : ?>
<?= Studip\LinkButton::create( <?= Studip\LinkButton::create(
_('Löschen'), _('Löschen'),
$controller->url_for('calendar/schedule/delete/'. $show_entry['id']), $controller->url_for('calendar/schedule/delete/'. $show_entry['id']),
...@@ -61,7 +61,7 @@ ...@@ -61,7 +61,7 @@
) ?> ) ?>
<? endif ?> <? endif ?>
<? if ($show_entry) : ?> <? if (!empty($show_entry)) : ?>
<?= Studip\LinkButton::createCancel( <?= Studip\LinkButton::createCancel(
_('Abbrechen'), _('Abbrechen'),
$controller->url_for('calendar/schedule'), $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') ?> <?= $this->render_partial('calendar/schedule/_entry_course.php') ?>
<? unset($this->show_entry) ?> <? unset($this->show_entry) ?>
<? elseif ($show_entry && $show_entry['type'] == 'inst') : ?> <? elseif ($show_entry && $show_entry['type'] == 'inst') : ?>
......
...@@ -333,7 +333,10 @@ class CalendarColumn ...@@ -333,7 +333,10 @@ class CalendarColumn
for ($i = floor($data['start'] / 100); $i <= floor($data['end'] / 100); $i++) { for ($i = floor($data['start'] / 100); $i <= floor($data['end'] / 100); $i++) {
for ($j = 0; $j < 60; $j++) { for ($j = 0; $j < 60; $j++) {
if (($i * 100) + $j >= $data['start'] && ($i * 100) + $j < $data['end']) { 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 ...@@ -159,6 +159,8 @@ class SearchWidget extends SidebarWidget
$reset_link = URLHelper::getLink($this->url, array_merge($reset_params, ['reset-search' => 1])); $reset_link = URLHelper::getLink($this->url, array_merge($reset_params, ['reset-search' => 1]));
$this->template_variables['reset_link'] = $reset_link; $this->template_variables['reset_link'] = $reset_link;
} else {
$this->template_variables['reset_link'] = false;
} }
$this->template_variables['needles'] = $this->needles; $this->template_variables['needles'] = $this->needles;
......
...@@ -285,8 +285,9 @@ function kill_format ($text) { ...@@ -285,8 +285,9 @@ function kill_format ($text) {
$text = explode("[nop] [/nop]", $text); $text = explode("[nop] [/nop]", $text);
$i = 0; $i = 0;
$all = ''; $all = '';
foreach ($text as $w) foreach ($text as $w) {
$all .= $w . $matches[1][$i++]; $all .= $w . ($matches[1][$i++] ?? '');
}
return $all; return $all;
} }
......
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