Exemple #1
0
 public function careerPortalQuestionnaireUpdate()
 {
     if ($this->_realAccessLevel < ACCESS_LEVEL_DEMO) {
         CommonErrors::fatal(COMMONERROR_PERMISSION, $this);
         return;
     }
     $questionnaire = new Questionnaire($this->_siteID);
     $data = $questionnaire->getAll(true);
     for ($i = 0; $i < count($data); $i++) {
         if (isset($_POST[$id = 'removeQuestionnaire' . $i]) && !strcasecmp($_POST[$id], 'yes')) {
             $questionnaire->delete($data[$i]['questionnaireID']);
         }
     }
     CATSUtility::transferRelativeURI('m=settings&a=careerPortalSettings');
 }
 private function addCandidateModal($contents = '', $fields = array())
 {
     /* Bail out if we don't have a valid job order ID. */
     if (!$this->isRequiredIDValid('jobOrderID', $_GET)) {
         CommonErrors::fatalModal(COMMONERROR_BADINDEX, $this, 'Invalid job order ID.');
     }
     $jobOrderID = $_GET['jobOrderID'];
     $candidates = new Candidates($this->_siteID);
     /* Get possible sources. */
     $sourcesRS = $candidates->getPossibleSources();
     $sourcesString = ListEditor::getStringFromList($sourcesRS, 'name');
     /* Get extra fields. */
     $extraFieldRS = $candidates->extraFields->getValuesForAdd();
     $associatedAttachment = 0;
     $associatedAttachmentRS = array();
     $EEOSettings = new EEOSettings($this->_siteID);
     $EEOSettingsRS = $EEOSettings->getAll();
     if (is_array($parsingStatus = LicenseUtility::getParsingStatus()) && isset($parsingStatus['parseLimit'])) {
         $parsingStatus['parseLimit'] = $parsingStatus['parseLimit'] - 1;
     }
     $careerPortalSettings = new CareerPortalSettings($this->_siteID);
     $careerPortalSettingsRS = $careerPortalSettings->getAll();
     $careerPortalEnabled = intval($careerPortalSettingsRS['enabled']) ? true : false;
     /* Get questionnaires to attach (if public) */
     $questionnaire = new Questionnaire($this->_siteID);
     $questionnaires = $questionnaire->getAll(false);
     $this->_template->assign('careerPortalEnabled', $careerPortalEnabled);
     $this->_template->assign('questionnaires', $questionnaires);
     $this->_template->assign('contents', $contents);
     $this->_template->assign('isParsingEnabled', $tmp = LicenseUtility::isParsingEnabled());
     $this->_template->assign('parsingStatus', $parsingStatus);
     $this->_template->assign('extraFieldRS', $extraFieldRS);
     $this->_template->assign('sourcesRS', $sourcesRS);
     $this->_template->assign('isModal', true);
     $this->_template->assign('jobOrderID', $jobOrderID);
     $this->_template->assign('sourcesString', $sourcesString);
     $this->_template->assign('preassignedFields', $fields);
     $this->_template->assign('associatedAttachment', $associatedAttachment);
     $this->_template->assign('associatedAttachmentRS', $associatedAttachmentRS);
     $this->_template->assign('associatedTextResume', false);
     $this->_template->assign('associatedFileResume', false);
     $this->_template->assign('EEOSettingsRS', $EEOSettingsRS);
     if (!eval(Hooks::get('JO_ADD_CANDIDATE_MODAL'))) {
         return;
     }
     /* REMEMBER TO ALSO UPDATE CandidatesUI::add() IF APPLICABLE. */
     $this->_template->display('./modules/candidates/Add.tpl');
 }