Ejemplo n.º 1
0
        $this->createNew($this->CandID, $subprojectID, $this->VisitLabel);
        $this->header("HTTP/1.1 201 Created");
    }
    /**
     * Create a new timepoint
     *
     * This is a wrapper around the Timepoint::createNew function
     * that can be stubbed out for testing.
     *
     * @param integer $CandID       The candidate with the visit
     * @param integer $subprojectID The subproject for the new visit
     * @param string  $VL           The visit label of the visit to
     *                              be created
     *
     * @return none
     */
    function createNew($CandID, $subprojectID, $VL)
    {
        \TimePoint::createNew($CandID, $subprojectID, $VL);
    }
}
if (isset($_REQUEST['PrintVisit'])) {
    parse_str(urldecode(file_get_contents("php://input")), $InputDataArray);
    $InputData = json_encode($InputDataArray);
    if ($_SERVER['REQUEST_METHOD'] === 'PUT') {
        $obj = new Visit($_SERVER['REQUEST_METHOD'], $_REQUEST['CandID'], $_REQUEST['VisitLabel'], $InputData);
    } else {
        $obj = new Visit($_SERVER['REQUEST_METHOD'], $_REQUEST['CandID'], $_REQUEST['VisitLabel']);
    }
    print $obj->toJSONString();
}