Skip to content
Snippets Groups Projects
Commit 844f18c6 authored by Jan-Hendrik Willms's avatar Jan-Hendrik Willms
Browse files

prevent php warning in message display, fixes #4662

Closes #4662

Merge request studip/studip!3472
parent 1e01c093
No related branches found
No related tags found
No related merge requests found
<?php
/**
* @var Message $message
*/
?>
<tr id="message_<?= $message->getId() ?>" class="<?= $message->isRead() || $message['autor_id'] === $GLOBALS['user']->id ? "" : "unread" ?>"> <tr id="message_<?= $message->getId() ?>" class="<?= $message->isRead() || $message['autor_id'] === $GLOBALS['user']->id ? "" : "unread" ?>">
<td class="hidden-small-down"><input type="checkbox" name="bulk[]" value="<?= htmlReady($message->getId()) ?>"></td> <td class="hidden-small-down"><input type="checkbox" name="bulk[]" value="<?= htmlReady($message->getId()) ?>"></td>
<td class="title"> <td class="title">
...@@ -15,8 +20,10 @@ ...@@ -15,8 +20,10 @@
<? $num_recipients = $message->getNumRecipients() ?> <? $num_recipients = $message->getNumRecipients() ?>
<? if ($num_recipients > 1) : ?> <? if ($num_recipients > 1) : ?>
<?= sprintf(_("%s Personen"), $num_recipients) ?> <?= sprintf(_("%s Personen"), $num_recipients) ?>
<? else : ?> <? elseif (isset($message->receivers->first()->user)): ?>
<?= htmlReady(get_fullname($message->receivers[0]['user_id'])) ?> <?= htmlReady($message->receivers->first()->user->getFullName()) ?>
<? else: ?>
<?= _('unbekannt') ?>
<? endif ?> <? endif ?>
<? else: ?> <? else: ?>
<?= htmlReady(get_fullname($message['autor_id'])) ?> <?= htmlReady(get_fullname($message['autor_id'])) ?>
...@@ -24,20 +31,22 @@ ...@@ -24,20 +31,22 @@
</p> </p>
</td> </td>
<td class="hidden-small-down"> <td class="hidden-small-down">
<? if ($message['autor_id'] == "____%system%____") : ?> <? if ($message['autor_id'] === "____%system%____") : ?>
<?= _("Systemnachricht") ?> <?= _("Systemnachricht") ?>
<? elseif (isset($received) && !$received): ?> <? elseif (isset($received) && !$received): ?>
<? $num_recipients = $message->getNumRecipients() ?> <? $num_recipients = $message->getNumRecipients() ?>
<? if ($num_recipients > 1) : ?> <? if ($num_recipients > 1) : ?>
<?= sprintf(_("%s Personen"), $num_recipients) ?> <?= sprintf(_("%s Personen"), $num_recipients) ?>
<? else : ?> <? elseif (isset($message->receivers->first()->user)): ?>
<a href="<?= URLHelper::getLink('dispatch.php/profile', ['username' => get_username($message->receivers[0]['user_id'])]) ?>"> <a href="<?= URLHelper::getLink('dispatch.php/profile', ['username' => $message->receivers->first()->user->username]) ?>">
<?= htmlReady(get_fullname($message->receivers[0]['user_id'])) ?> <?= htmlReady($message->receivers->first()->user->getFullName()) ?>
</a> </a>
<? else: ?>
<?= _('unbekannt') ?>
<? endif ?> <? endif ?>
<? else: ?> <? else: ?>
<a href="<?= URLHelper::getLink('dispatch.php/profile', ['username' => get_username($message['autor_id'])]) ?>"> <a href="<?= URLHelper::getLink('dispatch.php/profile', ['username' => $message->author->username]) ?>">
<?= htmlReady(get_fullname($message['autor_id'])) ?> <?= htmlReady($message->author->getFullName()) ?>
</a> </a>
<? endif; ?> <? endif; ?>
</td> </td>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment