From fbbea4eb5f8e72386a78c3b4639147b6e82a8535 Mon Sep 17 00:00:00 2001 From: msquare Date: Sat, 23 Dec 2017 11:59:13 +0100 Subject: add show on dashboard flag for angeltypes --- includes/model/AngelType_model.php | 19 +++++++++++++------ includes/model/Shifts_model.php | 2 +- 2 files changed, 14 insertions(+), 7 deletions(-) (limited to 'includes/model') diff --git a/includes/model/AngelType_model.php b/includes/model/AngelType_model.php index bdfb0e6e..f6e2a9cf 100644 --- a/includes/model/AngelType_model.php +++ b/includes/model/AngelType_model.php @@ -18,7 +18,8 @@ function AngelType_new() 'requires_driver_license' => false, 'contact_name' => null, 'contact_dect' => null, - 'contact_email' => null + 'contact_email' => null, + 'show_on_dashboard' => true ]; } @@ -65,7 +66,8 @@ function AngelType_update($angeltype) `no_self_signup` = ?, `contact_name` = ?, `contact_dect` = ?, - `contact_email` = ? + `contact_email` = ?, + `show_on_dashboard` = ? WHERE `id` = ?', [ $angeltype['name'], @@ -76,6 +78,7 @@ function AngelType_update($angeltype) $angeltype['contact_name'], $angeltype['contact_dect'], $angeltype['contact_email'], + (int)$angeltype['show_on_dashboard'], $angeltype['id'], ] ); @@ -86,7 +89,8 @@ function AngelType_update($angeltype) . ($angeltype['requires_driver_license'] ? ', requires driver license' : '') . ', ' . $angeltype['contact_name'] . ', ' . $angeltype['contact_dect'] . ', ' - . $angeltype['contact_email'] + . $angeltype['contact_email'] . ', ' + . $angeltype['show_on_dashboard'] ); } @@ -107,9 +111,10 @@ function AngelType_create($angeltype) `no_self_signup`, `contact_name`, `contact_dect`, - `contact_email` + `contact_email`, + `show_on_dashboard` ) - VALUES (?, ?, ?, ?, ?, ?, ?, ?) + VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?) ', [ $angeltype['name'], @@ -120,6 +125,7 @@ function AngelType_create($angeltype) $angeltype['contact_name'], $angeltype['contact_dect'], $angeltype['contact_email'], + $angeltype['show_on_dashboard'] ] ); @@ -130,7 +136,8 @@ function AngelType_create($angeltype) . ($angeltype['requires_driver_license'] ? ', requires driver license' : '') . ', ' . $angeltype['contact_name'] . ', ' . $angeltype['contact_dect'] . ', ' - . $angeltype['contact_email'] + . $angeltype['contact_email'] . ', ' + . $angeltype['show_on_dashboard'] ); return $angeltype; } diff --git a/includes/model/Shifts_model.php b/includes/model/Shifts_model.php index ad64e9b9..caca2a33 100644 --- a/includes/model/Shifts_model.php +++ b/includes/model/Shifts_model.php @@ -27,7 +27,7 @@ function Shifts_by_angeltype($angeltype) { } /** - * Returns every shift with needed angels in the given time range. + * Returns every shift with needed angels in the given time range. */ function Shifts_free($start, $end) { -- cgit v1.2.3-54-g00ecf