Merge branch 'fronkdev' into 'master'

Added Maintenanceinfo Api Controller

See merge request fronk/thetool!742
This commit is contained in:
Frank Schubert
2024-11-14 18:56:40 +00:00

View File

@@ -92,7 +92,7 @@ class MaintenanceNotification extends mfBaseModel {
return true;
}
private function getReplacedBody() {
public function getReplacedBody() {
$body = $this->text;
$from = new DateTime("@".$this->from);
@@ -345,6 +345,12 @@ class MaintenanceNotification extends mfBaseModel {
return 0;
}
public static function searchActive($filter, $limit = false, $order = false) {
$filter["to>"] = date("U");
return self::search($filter, $limit, $order);
}
public static function search($filter, $limit = false, $order = false) {
//var_dump($filter);exit;
$items = [];
@@ -390,13 +396,20 @@ class MaintenanceNotification extends mfBaseModel {
}
}
if(array_key_exists("object_type", $filter)) {
/*if(array_key_exists("object_type", $filter)) {
$object_type = FronkDB::singleton()->escape($filter["object_type"]);
if($object_type) {
$where .= " AND object_type='$object_type'";
}
}
}*/
if(array_key_exists("to>", $filter)) {
$to = $filter['to>'];
if(is_numeric($to)) {
$where .= " AND MaintenanceNotification.to >= $to";
}
}