Fixed subject in MaintenanceNotification Index

This commit is contained in:
Frank Schubert
2024-11-12 18:41:52 +01:00
parent 667a985293
commit b80b480fba
2 changed files with 10 additions and 1 deletions

View File

@@ -85,7 +85,7 @@
</tr>
<?php foreach($notifications as $notification): ?>
<tr>
<td><?=$notification->subject?></td>
<td><?=$notification->subject->subject?></td>
<td><?=($notification->plz) ? implode(", ", $notification->plzs) : ""?></td>
<td><?=($notification->send_ts) ? date("d.m.Y H:i", $notification->send_ts) : ""?></td>
<td><?=($notification->sent) ? "Ja" : "nein"?></td>

View File

@@ -1,12 +1,21 @@
<?php
class MaintenanceNotification extends mfBaseModel {
private $subject;
private $plzs;
public function getProperty($name) {
if($this->$name == null) {
if($name == "subject") {
$subject = new MaintenanceNotificationTemplate($this->subject_id);
if($subject) {
$this->subject = $subject;
}
return $this->subject;
}
if($name == "plzs") {
if(!$this->plz) return [];
$plzs = json_decode($this->plz);