Source of file JobListingPageController.php
Size: 2,641 Bytes - Last Modified: 2021-12-24T05:19:15+00:00
/var/www/docs.ssmods.com/process/src/src/JobListingPage/JobListingPageController.php
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133 | <?php namespace IQnection\JobListingPage; use IQnection\FormPage\FormPageController; class JobListingPageController extends FormPageController { private static $allowed_actions = [ 'details', 'apply' ]; public function PageJS() { return array_merge( parent::PageJS(), ["javascript/jquery.tablesorter.min.js"] ); } public function FormConfig() { $config = [ "useNospam" => true ]; $this->extend('updateFormConfig', $config); return $config; } public function FormFields() { $fields = array( "JobTitle" => array( "FieldType" => "HiddenField", "Label" => "Job Title", "Value" => $this->CurrentJob()->Title, ), "JobLocation" => array( "FieldType" => "HiddenField", "Label" => "Job Location", "Value" => $this->CurrentJob()->Location, ), "FirstName" => array( "FieldType" => "TextField", "Label" => "First Name", "Required" => true, ), "LastName" => array( "FieldType" => "TextField", "Label" => "Last Name", "Required" => true, ), "Address" => array( "FieldType" => "TextField", "Label" => "Address", ), "Address2" => array( "FieldType" => "TextField", "Label" => "", ), "City" => array( "FieldType" => "TextField", "Label" => "City", ), "State" => array( "FieldType" => "DropdownField", "Label" => "State", "Value" => "GetStates", "Default" => "PA" ), "ZipCode" => array( "FieldType" => "TextField", "Label" => "Zip Code", ), "Phone" => array( "FieldType" => "TextField", "Label" => "Phone Number", ), "Email" => array( "FieldType" => "EmailField", "Label" => "Email Address", "Required" => true, ), "CoverLetter" => array( "FieldType" => "FileField", "Label" => "Cover Letter", "Required" => false ), "Resume" => array( "FieldType" => "FileField", "Label" => "Resume", "Required" => true, "message" => "Please upload your resume." ), "Comments" => array( "FieldType" => "TextareaField", "Label" => "Comments", ), "Recipient" => $this->RecipientFieldConfig() ); $this->extend('updateFormFields',$fields); return $fields; } public function CurrentJob() { $currentJob = $this->JobPositions()->byID($this->request->param('ID')); $this->extend('updateCurrentJob',$currentJob); return $currentJob; } public function details() { if (!$this->CurrentJob()) { return $this->redirectBack(); } return $this; } public function apply() { if (!$this->CurrentJob()) { return $this->redirectBack(); } return $this; } } |