/**
  *
  * @param CandidateSearchParameters $searchParam
  */
 public function setDefaultDataToWidgets(CandidateSearchParameters $searchParam)
 {
     $newSearchParam = new CandidateSearchParameters();
     $this->setDefault('jobTitle', $searchParam->getJobTitleCode());
     $this->setDefault('jobVacancy', $searchParam->getVacancyId());
     $this->setDefault('hiringManager', $searchParam->getHiringManagerId());
     $this->setDefault('status', $searchParam->getStatus());
     $this->setDefault('selectedCandidate', $searchParam->getCandidateId());
     $this->setDefault('modeOfApplication', $searchParam->getModeOfApplication());
     $displayFromDate = $searchParam->getFromDate() == $newSearchParam->getFromDate() ? "" : $searchParam->getFromDate();
     $displayToDate = $searchParam->getToDate() == $newSearchParam->getToDate() ? "" : $searchParam->getToDate();
     $this->setDefault('from_date', $displayFromDate);
     $this->setDefault('to_date', $displayToDate);
     $this->setDefault('keywords', $searchParam->getKeywords());
     $this->setDefault('candidateName', $searchParam->getCandidateName());
 }
Esempio n. 2
0
 /**
  * @param CandidateSearchParameters $paramObject
  * @return string
  */
 private function _buildAdditionalWhereClauses(CandidateSearchParameters $paramObject)
 {
     $allowedCandidateList = $paramObject->getAllowedCandidateList();
     $jobTitleCode = $paramObject->getJobTitleCode();
     $jobVacancyId = $paramObject->getVacancyId();
     $hiringManagerId = $paramObject->getHiringManagerId();
     $status = $paramObject->getStatus();
     $allowedVacancyList = $paramObject->getAllowedVacancyList();
     $isAdmin = $paramObject->getIsAdmin();
     $empNumber = $paramObject->getEmpNumber();
     $whereClause = '';
     $whereFilters = array();
     if ($allowedVacancyList != null && !$isAdmin) {
         $this->_addAdditionalWhereClause($whereFilters, 'jv.id', '(' . implode(',', $allowedVacancyList) . ')', 'IN');
     }
     if ($allowedCandidateList != null && !$isAdmin) {
         $this->_addAdditionalWhereClause($whereFilters, 'jc.id', '(' . implode(',', $allowedCandidateList) . ')', 'IN');
     }
     if (!empty($jobTitleCode) || !empty($jobVacancyId) || !empty($hiringManagerId) || !empty($status)) {
         $this->_addAdditionalWhereClause($whereFilters, 'jv.status', $paramObject->getVacancyStatus());
     }
     $this->_addAdditionalWhereClause($whereFilters, 'jv.job_title_code', $paramObject->getJobTitleCode());
     $this->_addAdditionalWhereClause($whereFilters, 'jv.id', $paramObject->getVacancyId());
     $this->_addAdditionalWhereClause($whereFilters, 'jv.hiring_manager_id', $paramObject->getHiringManagerId());
     $this->_addAdditionalWhereClause($whereFilters, 'jcv.status', $paramObject->getStatus());
     $this->_addCandidateNameClause($whereFilters, $paramObject);
     $this->_addAdditionalWhereClause($whereFilters, 'jc.mode_of_application', $paramObject->getModeOfApplication());
     $this->_addAdditionalWhereClause($whereFilters, 'jc.added_person', $paramObject->getEmpNumber());
     $whereClause .= count($whereFilters) > 0 ? ' AND ' . implode('AND ', $whereFilters) : '';
     //        if($paramObject->getHiringManagerId() != null){
     //        	 $whereClause .= " AND jv.hiring_manager_id = ".$paramObject->getHiringManagerId()." OR jv.hiring_manager1_id = ".$paramObject->getHiringManagerId();
     //        }
     if ($empNumber != null) {
         $whereClause .= " OR jc.id NOT IN (SELECT ojcv.candidate_id FROM ohrm_job_candidate_vacancy ojcv) ";
     }
     if (!empty($status)) {
         $whereClause .= " AND NOT ISNULL(jcv.status)";
     }
     return $whereClause;
 }