Show all involved users correctly
This commit is contained in:
parent
1c73d2a793
commit
c076a46078
@ -262,6 +262,24 @@ function getReporters($reportId)
|
|||||||
return $reportReasons;
|
return $reportReasons;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param Snapshot $snapshot
|
||||||
|
* @param Report $report
|
||||||
|
* @return User[]
|
||||||
|
*/
|
||||||
|
function getInvolvedUsers($snapshot, $report)
|
||||||
|
{
|
||||||
|
$involvedUsers = $snapshot->getPlayers();
|
||||||
|
$involvedUsers[$report->getSuspect()->getId()] = $report->getSuspect();
|
||||||
|
|
||||||
|
/** @var User $reporter */
|
||||||
|
foreach ($report->getReporters() as $reporter) {
|
||||||
|
$involvedUsers[$reporter->getId()] = $reporter;
|
||||||
|
}
|
||||||
|
|
||||||
|
return $involvedUsers;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param Message $messageA
|
* @param Message $messageA
|
||||||
* @param Message $messageB
|
* @param Message $messageB
|
||||||
@ -422,6 +440,8 @@ if ($validId)
|
|||||||
$reporterUsernames[count($reporterUsernames)] = $reporter->getUsername();
|
$reporterUsernames[count($reporterUsernames)] = $reporter->getUsername();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$involvedUsers = getInvolvedUsers($snapshot, $report);
|
||||||
|
|
||||||
// TODO Calculate time since last report
|
// TODO Calculate time since last report
|
||||||
// TODO actually calculate time
|
// TODO actually calculate time
|
||||||
$lastReportTime = new DateTime('1999-01-12');
|
$lastReportTime = new DateTime('1999-01-12');
|
||||||
@ -487,10 +507,10 @@ if ($validId)
|
|||||||
|
|
||||||
<h4><i class="fa fa-users"></i> Users</h4>
|
<h4><i class="fa fa-users"></i> Users</h4>
|
||||||
<hr>
|
<hr>
|
||||||
<?php foreach($snapshot->getPlayers() as $player): ?>
|
<?php foreach($involvedUsers as $user): ?>
|
||||||
<img src="http://cravatar.eu/avatar/<?= $player->getUUID() ?>/55.png" class="pull-left" />
|
<img src="http://cravatar.eu/avatar/<?= $user->getUUID() ?>/55.png" class="pull-left" />
|
||||||
<b class="name"><?= $player->getUsername() ?></b> <span class="label label-staff name"><?= $player->getRank() ?></span><br> <!-- TODO different styling for different ranks -->
|
<b class="name"><?= $user->getUsername() ?></b> <span class="label label-staff name"><?= $user->getRank() ?></span><br> <!-- TODO different styling for different ranks -->
|
||||||
<code style="font-size: 11px;"><?= $player->getUUID() ?></code>
|
<code style="font-size: 11px;"><?= $user->getUUID() ?></code>
|
||||||
<br><br>
|
<br><br>
|
||||||
<?php endforeach; ?>
|
<?php endforeach; ?>
|
||||||
</div>
|
</div>
|
||||||
|
Loading…
Reference in New Issue
Block a user