예제 #1
0
 function JobDetailsPage()
 {
     $job_id = intval($this->request->param('JOB_ID'));
     $job = Job::get()->byID($job_id);
     if ($job) {
         if (!empty($job->MoreInfoLink)) {
             $job->FormattedMoreInfoLink = JobHolder_Controller::getViewInfoLink($job->MoreInfoLink);
         }
         return $this->renderWith(array('JobDetail', 'Page'), ['Job' => $job]);
     }
     return $this->httpError(404, 'Sorry that Job could not be found!.');
 }
예제 #2
0
 /**
  * @param SS_HTTPRequest $request
  * @return mixed|null|SS_HTTPResponse|string
  */
 public function getJobList(SS_HTTPRequest $request)
 {
     try {
         $output = $this->loadRAWResponseFromCache($request);
         if (!is_null($output)) {
             return $output;
         }
         $output = '';
         $kw = $request->getVar('kw');
         $type_id = $request->getVar('type_id');
         $sort_by = !empty($request->getVar('sort_by')) ? $request->getVar('sort_by') : 'posted';
         $jobs = $this->repository->getJobsByKeywordTypeAndSortedBy($kw, $type_id, $sort_by);
         foreach ($jobs as $job) {
             $output .= $job->renderWith('JobHolder_job', ['FormattedMoreInfoLink' => JobHolder_Controller::getViewInfoLink($job->MoreInfoLink)]);
         }
         $this->saveRAWResponseToCache($request, $output);
         return $output;
     } catch (NotFoundEntityException $ex1) {
         SS_Log::log($ex1, SS_Log::ERR);
         return $this->notFound($ex1->getMessage());
     } catch (Exception $ex) {
         SS_Log::log($ex, SS_Log::ERR);
         return $this->serverError();
     }
 }