- Модуль: timeman
- Путь к файлу: ~/bitrix/modules/timeman/lib/controller/worktime.php
- Класс: BitrixTimemanControllerWorktime
- Вызов: Worktime::stopAction
public function stopAction($userId, $stopSeconds = null, $stopDate = null, $reason = null, $latitudeClose = null, $longitudeClose = null, $ipClose = null, $device = null)
{
$recordForm = WorktimeRecordForm::createWithEventForm();
$recordForm->userId = $userId;
$recordForm->recordedStopSeconds = $stopSeconds;
$recordForm->getFirstEventForm()->reason = $reason;
$recordForm->latitudeClose = $latitudeClose;
$recordForm->longitudeClose = $longitudeClose;
$recordForm->ipClose = $ipClose;
$recordForm->device = $device;
$recordForm->recordedStopDateFormatted = $stopDate;
if (!$recordForm->validate())
{
return $recordForm->getErrors();
}
$result = (new ManageStopHandler())->handle($recordForm);
return $this->decorateServiceResult($result);
}