From 3ecb4c7fb8612251818d4700e500b5d8eecf9c45 Mon Sep 17 00:00:00 2001 From: Keir Date: Wed, 16 Dec 2015 16:01:19 +0000 Subject: [PATCH] Report handlers are now parsed and displayed correctly. --- .../Mineplex.ChatSnapManager/web/report.php | 15 ++++++++++- Plugins/Mineplex.ChatSnapManager/web/view.php | 26 ++++++++++++------- 2 files changed, 30 insertions(+), 11 deletions(-) diff --git a/Plugins/Mineplex.ChatSnapManager/web/report.php b/Plugins/Mineplex.ChatSnapManager/web/report.php index f556d461d..dd565c14c 100644 --- a/Plugins/Mineplex.ChatSnapManager/web/report.php +++ b/Plugins/Mineplex.ChatSnapManager/web/report.php @@ -6,6 +6,9 @@ /** @var String */ private $serverName; + /** @var Player|Null */ + private $handler; + /** @var Player */ private $suspect; @@ -16,13 +19,15 @@ * Report constructor. * @param Int $id * @param String $serverName + * @param Player|Null $handler * @param Player $suspect * @param SplObjectStorage $reporters */ - function Report($id, $serverName, $suspect, $reporters) + function Report($id, $serverName, $handler, $suspect, $reporters) { $this->id = $id; $this->serverName = $serverName; + $this->handler = $handler; $this->suspect = $suspect; $this->reporters = $reporters; } @@ -43,6 +48,14 @@ return $this->serverName; } + /** + * @return Player|Null + */ + public function getHandler() + { + return $this->handler; + } + /** * @return Player */ diff --git a/Plugins/Mineplex.ChatSnapManager/web/view.php b/Plugins/Mineplex.ChatSnapManager/web/view.php index 5241d5d72..4dbefaa31 100644 --- a/Plugins/Mineplex.ChatSnapManager/web/view.php +++ b/Plugins/Mineplex.ChatSnapManager/web/view.php @@ -60,9 +60,10 @@ function toReport($reportData, $players) { $id = $reportData["id"]; $serverName = $reportData["serverName"]; + $handler = array_key_exists("handler", $reportData) ? getPlayer($players, $reportData["handler"]) : null; $suspect = getPlayer($players, $reportData["suspect"]); $reporters = toReporters($players, $reportData["reporters"]); - return new Report($id, $serverName, $suspect, $reporters); + return new Report($id, $serverName, $handler, $suspect, $reporters); } /** @@ -239,20 +240,20 @@ function removeBadCharacters($input) $messages = $snapshot->getMessages(); foreach($messages as $message): - $typeId = $message->getType(); - $typeDisplayName = Message::$TYPE_DISPLAY_NAMES[$typeId]; - $isPM = $typeId == Message::TYPE_PM; + $typeId = $message->getType(); + $typeDisplayName = Message::$TYPE_DISPLAY_NAMES[$typeId]; + $isPM = $typeId == Message::TYPE_PM; - // If this is a PM, then the "-> " suffix will be applied. - $involved = $message->getSender()->getUsername() . ($isPM ? " -> " . $message->getRecipients()[0]->getUsername() : ""); + // If this is a PM, then the "-> " suffix will be applied. + $involved = $message->getSender()->getUsername() . ($isPM ? " -> " . $message->getRecipients()[0]->getUsername() : ""); ?> " style="font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;"> : getMessage(); ?> -
- +
+ @@ -287,7 +288,12 @@ function removeBadCharacters($input)
Reported by
Suspect is getSuspect()->getUsername() ?>
- Staff Member assigned is TODO
+ + getHandler(); + echo $handler != null ? "Staff Member assigned is " . $handler->getUsername() : "No Staff Member assigned"; + ?> +

@@ -297,7 +303,7 @@ function removeBadCharacters($input) getPlayers() as $player): ?>   getUsername() ?> TODO
-  getUUID() ?> +  getUUID() ?>