Пример #1
0
function addTimeLogWrapper($project = false)
{
    $id = Utils::getArrayValue($_POST, 'id');
    $hours = Utils::getArrayValue($_POST, 'hours');
    $comment = Utils::getArrayValue($_POST, 'comment');
    $spent_on = Utils::getArrayValue($_POST, 'spent_on');
    $activity_id = Utils::getArrayValue($_POST, 'activity_id');
    if (!is_numeric($hours)) {
        $hours = 0.0;
    }
    $client = App::getClient();
    if ($project) {
        return TimeLog::addToProject($client, $id, $comment, $hours);
    } else {
        return TimeLog::addToIssue($client, $id, $comment, $hours);
    }
}