mirror of
https://github.com/RaspbianFrance/raspisms.git
synced 2025-05-04 23:36:26 +02:00
style validation fix
This commit is contained in:
parent
f1d47a25ed
commit
017c7fee53
42 changed files with 526 additions and 497 deletions
controllers/internals
|
@ -18,11 +18,11 @@ namespace controllers\internals;
|
|||
/**
|
||||
* Create a call.
|
||||
*
|
||||
* @param int $id_user : Id of the user
|
||||
* @param int $id_phone : Id of the phone that emitted (outbound) or received (inbound) the call
|
||||
* @param string $uid : Uid of the phone call
|
||||
* @param string $direction : Direction of the call, \models\Call::DIRECTION_INBOUND | \models\Call::DIRECTION_OUTBOUND
|
||||
* @param string $start : Date of the call beginning
|
||||
* @param int $id_user : Id of the user
|
||||
* @param int $id_phone : Id of the phone that emitted (outbound) or received (inbound) the call
|
||||
* @param string $uid : Uid of the phone call
|
||||
* @param string $direction : Direction of the call, \models\Call::DIRECTION_INBOUND | \models\Call::DIRECTION_OUTBOUND
|
||||
* @param string $start : Date of the call beginning
|
||||
* @param ?string $end : Date of the call end
|
||||
* @param ?string $origin : Origin of the call or null if outbound
|
||||
* @param ?string $destination : Destination of the call or null if inbound
|
||||
|
@ -49,15 +49,23 @@ namespace controllers\internals;
|
|||
|
||||
switch ($direction)
|
||||
{
|
||||
case \models\Call::DIRECTION_OUTBOUND :
|
||||
if (null === $destination) { return false; }
|
||||
break;
|
||||
|
||||
case \models\Call::DIRECTION_INBOUND :
|
||||
if (null === $origin) { return false; }
|
||||
case \models\Call::DIRECTION_OUTBOUND:
|
||||
if (null === $destination)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
default :
|
||||
case \models\Call::DIRECTION_INBOUND:
|
||||
if (null === $origin)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -75,7 +83,7 @@ namespace controllers\internals;
|
|||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
$new_call_id = $this->get_model()->insert($call);
|
||||
if (!$new_call_id)
|
||||
{
|
||||
|
@ -83,21 +91,20 @@ namespace controllers\internals;
|
|||
}
|
||||
|
||||
$call['id'] = $new_call_id;
|
||||
|
||||
|
||||
$internal_webhook = new Webhook($this->bdd);
|
||||
$internal_webhook->trigger($id_user, \models\Webhook::TYPE_INBOUND_CALL, $call);
|
||||
|
||||
return $new_call_id;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* End a call
|
||||
* End a call.
|
||||
*
|
||||
* @param int $id_user : Id of the user to end call for
|
||||
* @param int $id_phone : If of the phone to end call for
|
||||
* @param string $uid : Uid of the call to end
|
||||
* @param string $end : End date of the call, format Y-m-d H:i:s
|
||||
* @param int $id_user : Id of the user to end call for
|
||||
* @param int $id_phone : If of the phone to end call for
|
||||
* @param string $uid : Uid of the call to end
|
||||
* @param string $end : End date of the call, format Y-m-d H:i:s
|
||||
*
|
||||
* @return bool : False if cannot end phone call, true else
|
||||
*/
|
||||
|
@ -125,7 +132,7 @@ namespace controllers\internals;
|
|||
|
||||
return (bool) $this->get_model()->update_for_user($id_user, $call['id'], $datas);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Get the model for the Controller.
|
||||
*/
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue