From 4414358cf5abf410368341d80ec72340011d5b29 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philip=20H=C3=A4usler?= Date: Sat, 6 Sep 2014 15:02:54 +0200 Subject: [PATCH] fix wrong nick and api sql query --- includes/controller/user_angeltypes_controller.php | 2 +- includes/model/NeededAngelTypes_model.php | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/includes/controller/user_angeltypes_controller.php b/includes/controller/user_angeltypes_controller.php index 0e786812..e4c7676f 100644 --- a/includes/controller/user_angeltypes_controller.php +++ b/includes/controller/user_angeltypes_controller.php @@ -213,7 +213,7 @@ function user_angeltype_delete_controller() { return array( _("Remove angeltype"), - UserAngelType_delete_view($user_angeltype, $user, $angeltype) + UserAngelType_delete_view($user_angeltype, $user_source, $angeltype) ); } diff --git a/includes/model/NeededAngelTypes_model.php b/includes/model/NeededAngelTypes_model.php index 81ce2d5f..e9176d34 100644 --- a/includes/model/NeededAngelTypes_model.php +++ b/includes/model/NeededAngelTypes_model.php @@ -23,7 +23,8 @@ function NeededAngelTypes_by_shift($shiftId) { SELECT `NeededAngelTypes`.*, `AngelTypes`.`name`, `AngelTypes`.`restricted` FROM `NeededAngelTypes` JOIN `AngelTypes` ON `AngelTypes`.`id` = `NeededAngelTypes`.`angel_type_id` - WHERE `room_id`=" . sql_escape($shiftId) . " + JOIN `Shifts` ON `Shifts`.`RID` = `NeededAngelTypes`.`room_id` + WHERE `Shifts`.`SID`=" . sql_escape($shiftId) . " AND `count` > 0 ORDER BY `room_id` DESC ");