diff --git a/classes/constellation.php b/classes/constellation.php index 3dba616..a31f6e9 100644 --- a/classes/constellation.php +++ b/classes/constellation.php @@ -69,7 +69,7 @@ class Constellation * @param boolean $admin * @return array of services */ - public function render_status($admin = false, $heading = true){ + public function render_status($admin = false, $heading = true): array{ global $mysqli; //$query = $mysqli->query("SELECT id, name, description FROM services"); diff --git a/classes/incident.php b/classes/incident.php index 3a3cd0a..af7a695 100644 --- a/classes/incident.php +++ b/classes/incident.php @@ -223,7 +223,7 @@ class Incident implements JsonSerializable $this->id, "date" => $this->timestamp, diff --git a/classes/locale-negotiator.php b/classes/locale-negotiator.php index b13ee23..94060c4 100644 --- a/classes/locale-negotiator.php +++ b/classes/locale-negotiator.php @@ -150,7 +150,6 @@ class LocaleNegotiator 'nl_BE' => 'Nederlands', 'nl_NL' => 'Nederlands', 'nn_NO' => 'Nynorsk', - 'nb_NO' => 'Norsk Bokmål', 'nso_ZA' => 'Northern sotho', 'oc_FR' => 'Occitan', 'or_IN' => 'ଓଡ଼ିଆ', diff --git a/classes/notification.php b/classes/notification.php index d39dd88..cf11ce7 100644 --- a/classes/notification.php +++ b/classes/notification.php @@ -130,7 +130,7 @@ class Notification * @param string $msg Body of message * @return boolean true = Sent / False = failed */ - public function submit_queue_telegram($userID, $firstname, $msg) + public static function submit_queue_telegram($userID, $firstname, $msg) { // TODO Handle limitations (Max 30 different subscribers per second) // TODO Error handling @@ -155,7 +155,7 @@ class Notification * @param String $uthkey Users token for managing subscription * @return void */ - public function submit_queue_email($subscriber, $subject, $msg) + public static function submit_queue_email($subscriber, $subject, $msg): bool { // TODO Error handling $mailer = new Mailer(); diff --git a/classes/queue.php b/classes/queue.php index a1836b3..adb6653 100644 --- a/classes/queue.php +++ b/classes/queue.php @@ -49,7 +49,7 @@ class Queue * Remove task from the queue * @return void */ - public function delete_task($task_id){ + public static function delete_task($task_id){ global $mysqli; $stmt = $mysqli->prepare("DELETE FROM queue_task WHERE id = ?"); $stmt->bind_param("i", $task_id); @@ -98,14 +98,14 @@ class Queue $this->set_task_status($this->all_status['ready']); // Make task available for release } - public function update_notification_retries($task_id, $subscriber_id) { + public static function update_notification_retries($task_id, $subscriber_id) { global $mysqli; $stmt = $mysqli->prepare("UPDATE queue_notify SET retries = retries+1 WHERE task_id = ? AND subscriber_id = ?"); $stmt->bind_param("ii", $task_id, $subscriber_id); $stmt->execute(); } - public function delete_notification($task_id, $subscriber_id) { + public static function delete_notification($task_id, $subscriber_id) { global $mysqli; $stmt = $mysqli->prepare("DELETE FROM queue_notify WHERE task_id = ? AND subscriber_id = ?"); $stmt->bind_param("ii", $task_id, $subscriber_id); diff --git a/classes/service-group.php b/classes/service-group.php index f94fc72..fef8934 100644 --- a/classes/service-group.php +++ b/classes/service-group.php @@ -8,6 +8,7 @@ class ServiceGroup private $name; private $description; private $visibility_id; + private $status; /** * Constructs servicegroup from its data. @@ -16,7 +17,7 @@ class ServiceGroup * @param String $description tooltip text * @param int $visibility_id how to display group items */ - function __construct($id, $name, $description, $visibility_id) + function __construct($id, $name, $description, $visibility_id, $status) { //TODO: Maybe get data from ID? diff --git a/classes/service.php b/classes/service.php index 268715c..5ed577e 100644 --- a/classes/service.php +++ b/classes/service.php @@ -180,7 +180,7 @@ class Service implements JsonSerializable * @param Service[] $array array of services * @return void */ - public static function current_status($array){ + public static function current_status($array): void{ global $all, $some, $classes; $statuses = array(0,0,0,0); $worst = 5; @@ -258,7 +258,7 @@ class Service implements JsonSerializable } } - public function jsonSerialize() { + public function jsonSerialize(): mixed { global $statuses; return [ "id" => $this->id, diff --git a/index.php b/index.php index a815246..96bb3dd 100644 --- a/index.php +++ b/index.php @@ -100,7 +100,7 @@ Template::render_header("Status"); render_status();?> -query("SELECT count(*) FROM status")->num_rows) +query("SELECT count(*) FROM status")) { ?>