Fixed formatting
This commit is contained in:
parent
34b01fd37d
commit
edcc1f481d
|
@ -238,18 +238,20 @@ function UserAngelType_by_User_and_AngelType($userId, $angeltype)
|
||||||
* Get an UserAngelTypes by user
|
* Get an UserAngelTypes by user
|
||||||
*
|
*
|
||||||
* @param int $userId
|
* @param int $userId
|
||||||
|
* @param bool $onlyConfirmed
|
||||||
* @return array[]|null
|
* @return array[]|null
|
||||||
*/
|
*/
|
||||||
function UserAngelTypes_by_User($userId, $onlyConfirmed=false)
|
function UserAngelTypes_by_User($userId, $onlyConfirmed=false)
|
||||||
{
|
{
|
||||||
return DB::select('
|
return DB::select(
|
||||||
|
'
|
||||||
SELECT *
|
SELECT *
|
||||||
FROM `UserAngelTypes`
|
FROM `UserAngelTypes`
|
||||||
'.($onlyConfirmed ? 'LEFT JOIN AngelTypes AS a ON a.id=UserAngelTypes.angeltype_id' : '').'
|
' . ($onlyConfirmed ? 'LEFT JOIN AngelTypes AS a ON a.id=UserAngelTypes.angeltype_id' : '') . '
|
||||||
WHERE `user_id`=?
|
WHERE `user_id`=?
|
||||||
'
|
'
|
||||||
. (
|
. (
|
||||||
$onlyConfirmed ? 'AND (
|
$onlyConfirmed ? 'AND (
|
||||||
a.`restricted`=0
|
a.`restricted`=0
|
||||||
OR (
|
OR (
|
||||||
NOT `UserAngelTypes`.`confirm_user_id` IS NULL
|
NOT `UserAngelTypes`.`confirm_user_id` IS NULL
|
||||||
|
|
|
@ -195,7 +195,7 @@ function view_user_shifts()
|
||||||
$rooms = load_rooms();
|
$rooms = load_rooms();
|
||||||
$types = load_types();
|
$types = load_types();
|
||||||
$ownTypes = [];
|
$ownTypes = [];
|
||||||
foreach (UserAngelTypes_by_User($user->id, FALSE) as $type) {
|
foreach (UserAngelTypes_by_User($user->id, true) as $type) {
|
||||||
$ownTypes[] = (int)$type['angeltype_id'];
|
$ownTypes[] = (int)$type['angeltype_id'];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue