Removed $angeltype from function Shift_signup_allowed_*
This commit is contained in:
parent
55141154c0
commit
1c27bf1375
|
@ -292,14 +292,11 @@ function Shift_signup_allowed_angel(
|
||||||
/**
|
/**
|
||||||
* Check if an angeltype supporter can sign up a user to a shift.
|
* Check if an angeltype supporter can sign up a user to a shift.
|
||||||
*
|
*
|
||||||
* @TODO: remove $angeltype
|
|
||||||
*
|
|
||||||
* @param array|null $angeltype
|
|
||||||
* @param array $needed_angeltype
|
* @param array $needed_angeltype
|
||||||
* @param array[] $shift_entries
|
* @param array[] $shift_entries
|
||||||
* @return ShiftSignupState
|
* @return ShiftSignupState
|
||||||
*/
|
*/
|
||||||
function Shift_signup_allowed_angeltype_supporter($angeltype, $needed_angeltype, $shift_entries)
|
function Shift_signup_allowed_angeltype_supporter($needed_angeltype, $shift_entries)
|
||||||
{
|
{
|
||||||
$free_entries = Shift_free_entries($needed_angeltype, $shift_entries);
|
$free_entries = Shift_free_entries($needed_angeltype, $shift_entries);
|
||||||
if ($free_entries == 0) {
|
if ($free_entries == 0) {
|
||||||
|
@ -312,14 +309,11 @@ function Shift_signup_allowed_angeltype_supporter($angeltype, $needed_angeltype,
|
||||||
/**
|
/**
|
||||||
* Check if an admin can sign up a user to a shift.
|
* Check if an admin can sign up a user to a shift.
|
||||||
*
|
*
|
||||||
* @TODO: remove $angeltype
|
|
||||||
*
|
|
||||||
* @param array|null $angeltype The angeltype to which the user wants to sign up
|
|
||||||
* @param array $needed_angeltype
|
* @param array $needed_angeltype
|
||||||
* @param array[] $shift_entries
|
* @param array[] $shift_entries
|
||||||
* @return ShiftSignupState
|
* @return ShiftSignupState
|
||||||
*/
|
*/
|
||||||
function Shift_signup_allowed_admin($angeltype, $needed_angeltype, $shift_entries)
|
function Shift_signup_allowed_admin($needed_angeltype, $shift_entries)
|
||||||
{
|
{
|
||||||
$free_entries = Shift_free_entries($needed_angeltype, $shift_entries);
|
$free_entries = Shift_free_entries($needed_angeltype, $shift_entries);
|
||||||
|
|
||||||
|
@ -355,14 +349,14 @@ function Shift_signup_allowed(
|
||||||
global $user, $privileges;
|
global $user, $privileges;
|
||||||
|
|
||||||
if (in_array('user_shifts_admin', $privileges)) {
|
if (in_array('user_shifts_admin', $privileges)) {
|
||||||
return Shift_signup_allowed_admin($angeltype, $needed_angeltype, $shift_entries);
|
return Shift_signup_allowed_admin($needed_angeltype, $shift_entries);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (
|
if (
|
||||||
in_array('shiftentry_edit_angeltype_supporter', $privileges)
|
in_array('shiftentry_edit_angeltype_supporter', $privileges)
|
||||||
&& User_is_AngelType_supporter($user, $angeltype)
|
&& User_is_AngelType_supporter($user, $angeltype)
|
||||||
) {
|
) {
|
||||||
return Shift_signup_allowed_angeltype_supporter($angeltype, $needed_angeltype, $shift_entries);
|
return Shift_signup_allowed_angeltype_supporter($needed_angeltype, $shift_entries);
|
||||||
}
|
}
|
||||||
|
|
||||||
return Shift_signup_allowed_angel(
|
return Shift_signup_allowed_angel(
|
||||||
|
|
Loading…
Reference in New Issue