예제 #1
0
    $log->debug("Candidate submitted with name " . $candidate->getName());
    $controller = new Stratum\Controller\BullhornController();
    $controller->setLogger($log);
    $controller->submit($candidate);
});
$app->get('/launch', function () use($app) {
    $app->redirect('http://northcreek.ca/stratum/launch.html');
});
$app->get('/launchForm', function (Request $request, Response $response) use($log) {
    // this is all the happy path assuming everything is set up properly from the Bullhorn side
    //load the id from the request
    $id = $request->getAttribute('entityid');
    //set up the controllers and their loggers
    $wcontroller = new \Stratum\Controller\WorldappController();
    $bcontroller = new \Stratum\Controller\BullhornController();
    $bcontroller->setLogger($log);
    $wcontroller->setLogger($log);
    //find the correct form
    $form = $wcontroller->find_form_by_name('Registration Form - Stratum International');
    //load the candidate data from Bullhorn
    $candidate = new Stratum\Model\Candidate();
    $candidate->set("id", $id);
    $bcontroller->load($candidate);
    //find the corporateUser Owner of this candidate (for From and ReplyTo email address)
    $ownerId = $candidate->get("owner")["id"];
    $owner = new \Stratum\Model\CorporateUser();
    $owner->set("id", $ownerId);
    $bcontroller->loadCorporateUser($owner);
    //load the custom Object that contains the template information
    $obj = $this->candidate->loadCustomObject(3);
    //download and store the original template (so we can convert back)