tweaked filters in send-maintenance-notifications.php

This commit is contained in:
Frank Schubert
2024-11-14 21:21:48 +01:00
parent 09507fc19a
commit bbde6d3bd1
3 changed files with 22 additions and 12 deletions

View File

@@ -138,18 +138,21 @@ class MaintenanceNotificationController extends mfBaseController {
$data["to"] = $to->getTimestamp();
try {
$send_ts = new DateTime($r->sendts_day." ".$r->sendts_hour.":00");
//var_dump($send_ts);exit;
} catch(Exception $e) {
$this->layout()->setFlash("Ungültige Versandzeitpunkt", "error");
if($mode = "edit") {
return $this->editAction();
if($r->sendts_day && $r->sendts_hour) {
try {
$send_ts = new DateTime($r->sendts_day . " " . $r->sendts_hour . ":00");
//var_dump($send_ts);exit;
} catch(Exception $e) {
$this->layout()->setFlash("Ungültige Versandzeitpunkt", "error");
if($mode = "edit") {
return $this->editAction();
}
return $this->addAction();
}
return $this->addAction();
$data["send_ts"] = $send_ts->getTimestamp();
} else {
$data["send_ts"] = null;
}
$data["send_ts"] = $send_ts->getTimestamp();
if($mode == "add") {
$notification = MaintenanceNotification::create($data);