Exemplo n.º 1
0
$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)
    $emailTemplate = $wcontroller->getEmailTemplate($form->id);
    //set up the correct template
    $newTemplate = [];
    $newTemplate['formId'] = $form->id;
    $newTemplate['from'] = $owner->get("email");
Exemplo n.º 2
0
 public function load(\Stratum\Model\Candidate $candidate)
 {
     $bullhornClient = $this->getClient();
     $candidateController = new \Stratum\Controller\CandidateController();
     $candidateController->setLogger($this->_logger);
     //load $candidate based on ID currently in $candidate
     $candidate = $bullhornClient->find($candidate);
     if ($candidate == null) {
         //error condition according to Stratum
         //re-initialize
         $candidate = new \Stratum\Model\Candidate();
         $candidate->setLogger($this->_logger);
     }
     /**
              *  debug only 
              * 
     		if ($bullhornClient->confirm($candidate)) {
     			$this->log_debug("<p>Success!</p>");
     		} else {
     			$this->log_debug("Failure: please examine log files");
     		}
             **/
     return $candidate;
 }
Exemplo n.º 3
0
 public function load(\Stratum\Model\Candidate $candidate)
 {
     $bullhornClient = $this->getClient();
     $candidateController = new \Stratum\Controller\CandidateController();
     $candidateController->setLogger($this->_logger);
     //load $candidate based on ID currently in $candidate
     $candidate = $bullhornClient->find($candidate);
     if ($candidate == null) {
         //error condition according to Stratum
         //re-initialize
         $candidate = new \Stratum\Model\Candidate();
         $candidate->setLogger($this->_logger);
     }
     return $candidate;
 }