Example #1
0
 /**
  * Function to build the form
  *
  * @return void
  * @access public
  */
 public function buildQuickForm()
 {
     $this->addButtons(array(array('type' => 'next', 'name' => ts('Save'), 'isDefault' => TRUE), array('type' => 'cancel', 'name' => ts('Cancel'))));
     if ($this->_action & CRM_Core_Action::DELETE) {
         $this->addButtons(array(array('type' => 'next', 'name' => ts('Delete'), 'isDefault' => TRUE), array('type' => 'cancel', 'name' => ts('Cancel'))));
     }
     $this->_id = CRM_Utils_Request::retrieve('id', 'Positive', $this);
     if ($this->_action & CRM_Core_Action::DELETE) {
         return;
     }
     $this->add('text', 'location', ts('Location'), CRM_Core_DAO::getAttribute('CRM_Hrjobcontract_DAO_HoursLocation', 'location'), TRUE);
     $this->add('text', 'standard_hours', ts('Standard Hours'), CRM_Core_DAO::getAttribute('CRM_Hrjobcontract_DAO_HoursLocation', 'standard_hours'), TRUE);
     $this->add('select', 'periodicity', ts('Periodicity'), array('' => ts('- select -')) + CRM_Hrjobcontract_SelectValues::commonUnit(), TRUE);
     $this->add('checkbox', 'is_active', ts('Enabled?'), CRM_Core_DAO::getAttribute('CRM_Hrjobcontract_DAO_HoursLocation', 'is_active'));
     $this->addFormRule(array('CRM_Hrjobcontract_Form_HoursLocation', 'formRule'), $this);
 }
Example #2
0
 function alterDisplay(&$rows)
 {
     $entryFound = FALSE;
     $gender = CRM_Core_PseudoConstant::get('CRM_Contact_DAO_Contact', 'gender_id');
     $job_location = CRM_Core_OptionGroup::values('hrjc_location');
     $contract_type = CRM_Core_OptionGroup::values('hrjc_contract_type');
     $department = CRM_Core_OptionGroup::values('hrjc_department');
     $hours_type = CRM_Core_OptionGroup::values('hrjc_hours_type');
     $level_typel = CRM_Core_OptionGroup::values('hrjc_level_type');
     $plan_type = CRM_Hrjobcontract_SelectValues::planType();
     $life_plan_type = CRM_Hrjobcontract_SelectValues::planTypeLifeInsurance();
     $payUnit = CRM_Hrjobcontract_SelectValues::payUnit();
     $periodType = CRM_Hrjobcontract_SelectValues::periodType();
     $commonUnit = CRM_Hrjobcontract_SelectValues::commonUnit();
     foreach ($rows as $rowNum => $row) {
         if (array_key_exists('civicrm_contact_sort_name', $row) && !empty($rows[$rowNum]['civicrm_contact_sort_name']) && array_key_exists('civicrm_contact_id', $row)) {
             $url = CRM_Utils_System::url("civicrm/contact/view", 'reset=1&cid=' . $row['civicrm_contact_id'], $this->_absoluteUrl);
             $rows[$rowNum]['civicrm_contact_sort_name_link'] = $url;
             $rows[$rowNum]['civicrm_contact_sort_name_hover'] = ts("View Contact Summary for this Contact.");
             $entryFound = TRUE;
         }
         if (array_key_exists('civicrm_hrjobcontract_is_primary', $row)) {
             if (isset($row['civicrm_hrjobcontract_is_primary'])) {
                 $rows[$rowNum]['civicrm_hrjobcontract_is_primary'] = $row['civicrm_hrjobcontract_is_primary'] == 1 ? ts('Yes') : ts('No');
             }
             $entryFound = TRUE;
         }
         if (array_key_exists('civicrm_hrjobcontract_health_hrjobcontract_health_health_plan_type', $row)) {
             if (isset($row['civicrm_hrjobcontract_health_hrjobcontract_health_health_plan_type'])) {
                 $rows[$rowNum]['civicrm_hrjobcontract_health_hrjobcontract_health_health_plan_type'] = $plan_type[$row['civicrm_hrjobcontract_health_hrjobcontract_health_health_plan_type']];
             }
             $entryFound = TRUE;
         }
         if (array_key_exists('civicrm_hrjobcontract_hour_hrjobcontract_hour_hours_unit', $row)) {
             if (isset($row['civicrm_hrjobcontract_hour_hrjobcontract_hour_hours_unit'])) {
                 $rows[$rowNum]['civicrm_hrjobcontract_hour_hrjobcontract_hour_hours_unit'] = $commonUnit[$row['civicrm_hrjobcontract_hour_hrjobcontract_hour_hours_unit']];
             }
             $entryFound = TRUE;
         }
         if (array_key_exists('civicrm_hrjobcontract_pay_hrjobcontract_pay_pay_unit', $row)) {
             if (isset($row['civicrm_hrjobcontract_pay_hrjobcontract_pay_pay_unit'])) {
                 $rows[$rowNum]['civicrm_hrjobcontract_pay_hrjobcontract_pay_pay_unit'] = $payUnit[$row['civicrm_hrjobcontract_pay_hrjobcontract_pay_pay_unit']];
             }
             $entryFound = TRUE;
         }
         if (array_key_exists('civicrm_hrjobcontract_health_hrjobcontract_health_life_insurance_plan_type', $row)) {
             if (isset($row['civicrm_hrjobcontract_health_hrjobcontract_health_life_insurance_plan_type'])) {
                 $rows[$rowNum]['civicrm_hrjobcontract_health_hrjobcontract_health_life_insurance_plan_type'] = $life_plan_type[$row['civicrm_hrjobcontract_health_hrjobcontract_health_life_insurance_plan_type']];
             }
             $entryFound = TRUE;
         }
         if (array_key_exists('civicrm_hrjobcontract_pay_hrjobcontract_pay_is_paid', $row)) {
             if (isset($row['civicrm_hrjobcontract_pay_hrjobcontract_pay_is_paid'])) {
                 $rows[$rowNum]['civicrm_hrjobcontract_pay_hrjobcontract_pay_is_paid'] = $row['civicrm_hrjobcontract_pay_hrjobcontract_pay_is_paid'] == 1 ? ts('Paid') : ts('Unpaid');
             }
             $entryFound = TRUE;
         }
         if (array_key_exists('civicrm_hrjobcontract_health_hrjobcontract_health_health_provider_life_insurance', $row) && array_key_exists('civicrm_hrjobcontract_health_life_provider_id', $row) && array_key_exists('civicrm_hrjobcontract_health_life_provider_display_name', $row)) {
             $url = CRM_Utils_System::url("civicrm/contact/view", 'reset=1&cid=' . $row['civicrm_hrjobcontract_health_life_provider_id'], $this->_absoluteUrl);
             $rows[$rowNum]['civicrm_hrjobcontract_health_hrjobcontract_health_health_provider_life_insurance'] = $rows[$rowNum]['civicrm_hrjobcontract_health_life_provider_display_name'];
             $rows[$rowNum]['civicrm_hrjobcontract_health_hrjobcontract_health_health_provider_life_insurance_link'] = $url;
             $entryFound = TRUE;
         }
         if (array_key_exists('civicrm_hrjobcontract_health_hrjobcontract_health_health_provider', $row) && array_key_exists('civicrm_hrjobcontract_health_provider_id', $row) && array_key_exists('civicrm_hrjobcontract_health_provider_organization_name', $row)) {
             $url = CRM_Utils_System::url("civicrm/contact/view", 'reset=1&cid=' . $row['civicrm_hrjobcontract_health_provider_id'], $this->_absoluteUrl);
             $rows[$rowNum]['civicrm_hrjobcontract_health_hrjobcontract_health_health_provider'] = $rows[$rowNum]['civicrm_hrjobcontract_health_provider_organization_name'];
             $rows[$rowNum]['civicrm_hrjobcontract_health_hrjobcontract_health_health_provider_link'] = $url;
             $entryFound = TRUE;
         }
         if (array_key_exists('civicrm_contact_gender', $row)) {
             if (!empty($row['civicrm_contact_gender'])) {
                 $rows[$rowNum]['civicrm_contact_gender'] = CRM_Utils_Array::value($row['civicrm_contact_gender'], $gender);
             }
             $entryFound = TRUE;
         }
         if (array_key_exists('civicrm_hrjobcontract_details_hrjobcontract_details_location', $row) && isset($rows[$rowNum]['civicrm_hrjobcontract_details_hrjobcontract_details_location'])) {
             $rows[$rowNum]['civicrm_hrjobcontract_details_hrjobcontract_details_location'] = $job_location[$rows[$rowNum]['civicrm_hrjobcontract_details_hrjobcontract_details_location']];
             $entryFound = TRUE;
         }
         if (array_key_exists('civicrm_hrjobcontract_details_hrjobcontract_details_contract_type', $row) && isset($rows[$rowNum]['civicrm_hrjobcontract_details_hrjobcontract_details_contract_type']) && isset($contract_type[$rows[$rowNum]['civicrm_hrjobcontract_details_hrjobcontract_details_contract_type']])) {
             $rows[$rowNum]['civicrm_hrjobcontract_details_hrjobcontract_details_contract_type'] = $contract_type[$rows[$rowNum]['civicrm_hrjobcontract_details_hrjobcontract_details_contract_type']];
             $entryFound = TRUE;
         }
         if (array_key_exists('civicrm_hrjobcontract_role_hrjobcontract_role_role_department', $row) && isset($rows[$rowNum]['civicrm_hrjobcontract_role_hrjobcontract_role_role_department'])) {
             $rows[$rowNum]['civicrm_hrjobcontract_role_hrjobcontract_role_role_department'] = $department[$rows[$rowNum]['civicrm_hrjobcontract_role_hrjobcontract_role_role_department']];
             $entryFound = TRUE;
         }
         if (array_key_exists('civicrm_hrjobcontract_hour_hrjobcontract_hour_hours_type', $row) && isset($rows[$rowNum]['civicrm_hrjobcontract_hour_hrjobcontract_hour_hours_type'])) {
             $rows[$rowNum]['civicrm_hrjobcontract_hour_hrjobcontract_hour_hours_type'] = $hours_type[$rows[$rowNum]['civicrm_hrjobcontract_hour_hrjobcontract_hour_hours_type']];
             $entryFound = TRUE;
         }
         if (array_key_exists('civicrm_hrjobcontract_role_hrjobcontract_role_role_level_type', $row) && isset($rows[$rowNum]['civicrm_hrjobcontract_role_hrjobcontract_role_role_level_type'])) {
             $rows[$rowNum]['civicrm_hrjobcontract_role_hrjobcontract_role_role_level_type'] = $level_typel[$rows[$rowNum]['civicrm_hrjobcontract_role_hrjobcontract_role_role_level_type']];
             $entryFound = TRUE;
         }
         $entryFound = $this->alterDisplayAddressFields($row, $rows, $rowNum, 'civihr/summary', 'List all contact(s) for this ') ? TRUE : $entryFound;
         // skip looking further in rows, if first row itself doesn't
         // have the column we need
         if (!$entryFound) {
             break;
         }
     }
 }
Example #3
0
 public function buildAdvancedSearchPaneForm(&$form, $type)
 {
     //if (!CRM_Core_Permission::check('access HRJobs')) { echo 'not accessible'; return; }
     if ($type == 'hrjobcontract') {
         $form->add('hidden', 'hidden_hrjobcontract', 1);
         $form->addElement('text', 'hrjobcontract_details_position', ts('Position'), CRM_Core_DAO::getAttribute('CRM_Hrjobcontract_DAO_HRJobDetails', 'position'));
         $form->addElement('text', 'hrjobcontract_details_title', ts('Title'), CRM_Core_DAO::getAttribute('CRM_Hrjobcontract_DAO_HRJobDetails', 'title'));
         $form->addElement('text', 'hrjobcontract_details_funding_notes', ts('Funding Notes'), CRM_Core_DAO::getAttribute('CRM_Hrjobcontract_DAO_HRJobDetails', 'funding_notes'));
         $form->addElement('text', 'hrjobcontract_details_notice_amount', ts('Notice Period from Employer (Amount)'), CRM_Core_DAO::getAttribute('CRM_Hrjobcontract_DAO_HRJobDetails', 'notice_amount'));
         $form->add('select', 'hrjobcontract_details_notice_unit', ts('Notice Period from Employer (Amount)'), CRM_Hrjobcontract_SelectValues::commonUnit(), FALSE, array('id' => 'hrjobcontract_details_notice_unit', 'multiple' => true));
         $form->addElement('text', 'hrjobcontract_details_notice_amount_employee', ts('Notice Period from Employee (Amount)'), CRM_Core_DAO::getAttribute('CRM_Hrjobcontract_DAO_HRJobDetails', 'notice_amount_employee'));
         $form->add('select', 'hrjobcontract_details_notice_unit_employee', ts('Notice Period from Employer (Amount)'), CRM_Hrjobcontract_SelectValues::commonUnit(), FALSE, array('id' => 'hrjobcontract_details_notice_unit_employee', 'multiple' => true));
         $hrjcLocation = CRM_Core_PseudoConstant::get('CRM_Hrjobcontract_DAO_HRJobDetails', 'hrjobcontract_details_location');
         $form->add('select', 'hrjobcontract_details_location', ts('Normal Place of Work'), $hrjcLocation, FALSE, array('id' => 'hrjobcontract_details_location', 'multiple' => true));
         $form->add('select', 'hrjobcontract_role_role_level_type', ts('Level'), CRM_Core_PseudoConstant::get('CRM_Hrjobcontract_DAO_HRJobRole', 'hrjobcontract_role_role_level_type'), FALSE, array('id' => 'hrjobcontract_role_role_level_type', 'multiple' => true));
         $form->add('select', 'hrjobcontract_details_contract_type', ts('Contract Type'), CRM_Core_PseudoConstant::get('CRM_Hrjobcontract_DAO_HRJobDetails', 'hrjobcontract_details_contract_type'), FALSE, array('id' => 'hrjobcontract_details_contract_type', 'multiple' => true));
         CRM_Core_Form_Date::buildDateRange($form, 'hrjobcontract_details_period_start_date', 1, '_low', '_high', ts('From:'), FALSE, FALSE);
         CRM_Core_Form_Date::buildDateRange($form, 'hrjobcontract_details_period_end_date', 1, '_low', '_high', ts('From:'), FALSE, FALSE);
         //$form->addYesNo( 'hrjobcontract_details_is_primary', ts('Is Primary?'));
         $form->add('select', 'hrjobcontract_details_is_primary', ts('Is Primary'), array('' => '- select -', 0 => 'No', 1 => 'Yes'), FALSE, array('id' => 'hrjobcontract_details_is_primary', 'multiple' => false));
     }
     if ($type == 'hrjobcontract_health') {
         $form->add('hidden', 'hidden_hrjobcontract_health', 1);
         //$form->add('checkbox', 'hrjobcontract_health_is_healthcare', ts('Is healthcare provided?'));
         $form->addElement('text', 'hrjobcontract_health_health_provider', ts('Healthcare Provider (Complete OR Partial Name)'), CRM_Core_DAO::getAttribute('CRM_Hrjobcontract_DAO_HRJobHealth', 'provider'));
         $form->add('select', 'hrjobcontract_health_health_plan_type', ts('Healthcare Plan Type'), CRM_Hrjobcontract_SelectValues::planType(), FALSE, array('id' => 'hrjobcontract_health_health_plan_type', 'multiple' => true));
         $form->addElement('text', 'hrjobcontract_health_description', ts('Description Health Insurance'), CRM_Core_DAO::getAttribute('CRM_Hrjobcontract_DAO_HRJobHealth', 'description'));
         $form->addElement('text', 'hrjobcontract_health_dependents', ts('Healthcare Dependents'), CRM_Core_DAO::getAttribute('CRM_Hrjobcontract_DAO_HRJobHealth', 'dependents'));
         $form->addElement('text', 'hrjobcontract_health_health_provider_life_insurance', ts('Life insurance Provider (Complete OR Partial Name)'), CRM_Core_DAO::getAttribute('CRM_Hrjobcontract_DAO_HRJobHealth', 'provider_life_insurance'));
         $form->add('select', 'hrjobcontract_health_life_insurance_plan_type', ts('Life insurance Plan Type'), CRM_Hrjobcontract_SelectValues::planTypeLifeInsurance(), FALSE, array('id' => 'hrjobcontract_health_life_insurance_plan_type', 'multiple' => true));
         $form->addElement('text', 'hrjobcontract_health_description_life_insurance', ts('Description Life Insurance'), CRM_Core_DAO::getAttribute('CRM_Hrjobcontract_DAO_HRJobHealth', 'description_life_insurance'));
         $form->addElement('text', 'hrjobcontract_health_dependents_life_insurance', ts('Life Insurance Dependents'), CRM_Core_DAO::getAttribute('CRM_Hrjobcontract_DAO_HRJobHealth', 'dependents_life_insurance'));
     }
     if ($type == 'hrjobcontract_hour') {
         $form->add('hidden', 'hidden_hrjobcontract_hour', 1);
         $hoursLocation = new CRM_Hrjobcontract_BAO_HoursLocation();
         $hoursLocation->find();
         $hoursLocationOptions = array();
         while ($hoursLocation->fetch()) {
             $hoursLocationOptions[$hoursLocation->id] = $hoursLocation->location;
         }
         $form->add('select', 'hrjobcontract_hour_location_standard_hours', ts('Location/Standard hours'), $hoursLocationOptions, FALSE, array('id' => 'hrjobcontract_hour_location_standard_hours', 'multiple' => true));
         $hoursType = CRM_Core_PseudoConstant::get('CRM_Hrjobcontract_DAO_HRJobHour', 'hrjobcontract_hour_hours_type');
         $form->add('select', 'hrjobcontract_hour_hours_type', ts('Hours Types'), $hoursType, FALSE, array('id' => 'hrjobcontract_hour_hours_type', 'multiple' => true));
         $form->add('text', 'hrjobcontract_hour_hours_amount', ts('Actual Hours (Amount)'), array('size' => 8, 'maxlength' => 8));
         $form->add('select', 'hrjobcontract_hour_hours_unit', ts('Actual Hours (Unit)'), CRM_Hrjobcontract_SelectValues::commonUnit(), FALSE, array('id' => 'hrjobcontract_hour_hours_unit', 'multiple' => true));
         $form->add('text', 'hrjobcontract_hour_hours_fte', ts('Full-Time Equivalence'), array('size' => 8, 'maxlength' => 8));
         $form->add('text', 'hrjobcontract_hour_hours_fte_num', ts('Full-Time Numerator Equivalence'), array('size' => 8, 'maxlength' => 8));
         $form->add('text', 'hrjobcontract_hour_fte_denom', ts('Full-Time Denominator Equivalence'), array('size' => 8, 'maxlength' => 8));
         $form->add('text', 'hrjobcontract_hour_hours_amount_low', ts('From'), array('size' => 8, 'maxlength' => 8));
         $form->addRule('hrjobcontract_hour_hours_amount_low', ts('Please enter a valid money value (e.g. %1).', array(1 => CRM_Utils_Money::format('9.99', ' '))), 'money');
         $form->add('text', 'hrjobcontract_hour_hours_amount_high', ts('To'), array('size' => 8, 'maxlength' => 8));
         $form->addRule('hrjobcontract_hour_hours_amount_high', ts('Please enter a valid money value (e.g. %1).', array(1 => CRM_Utils_Money::format('99.99', ' '))), 'money');
         $form->add('text', 'hrjobcontract_hour_hours_fte_low', ts('From'), array('size' => 8, 'maxlength' => 8));
         $form->addRule('hrjobcontract_hour_hours_fte_low', ts('Please enter a valid decimal value (e.g. %1).', array(1 => CRM_Utils_Money::format('9.99', ' '))), 'money');
         $form->add('text', 'hrjobcontract_hour_hours_fte_high', ts('To'), array('size' => 8, 'maxlength' => 8));
         $form->addRule('hrjobcontract_hour_hours_fte_high', ts('Please enter a valid decimal value (e.g. %1).', array(1 => CRM_Utils_Money::format('99.99', ' '))), 'money');
     }
     if ($type == 'hrjobcontract_leave') {
         $form->add('hidden', 'hidden_hrjobcontract_leave', 1);
         $leaveTypeOptions = array();
         $absenceType = new CRM_HRAbsence_BAO_HRAbsenceType();
         $absenceType->find();
         while ($absenceType->fetch()) {
             $leaveTypeOptions[$absenceType->id] = $absenceType->title;
         }
         $form->add('select', 'hrjobcontract_leave_leave_type', ts('Leave Type'), $leaveTypeOptions, FALSE, array('id' => 'hrjobcontract_leave_leave_type', 'multiple' => true));
     }
     if ($type == 'hrjobcontract_pay') {
         $form->add('hidden', 'hidden_hrjobcontract_pay', 1);
         $payScaleOptions = array();
         $payScale = new CRM_Hrjobcontract_BAO_PayScale();
         $payScale->find();
         while ($payScale->fetch()) {
             $payScaleOptions[$payScale->id] = $payScale->pay_scale;
             if (!empty($payScale->pay_grade)) {
                 $payScaleOptions[$payScale->id] .= ' - ' . $payScale->pay_grade . ' - ' . $payScale->currency . ' ' . $payScale->amount . ' per ' . $payScale->periodicity;
             }
         }
         $form->add('select', 'hrjobcontract_pay_pay_scale', ts('Pay Scale'), $payScaleOptions, FALSE, array('id' => 'hrjobcontract_pay_pay_scale', 'multiple' => true));
         $form->add('select', 'hrjobcontract_pay_is_paid', ts('Paid / Unpaid'), CRM_Core_PseudoConstant::get('CRM_Hrjobcontract_DAO_HRJobPay', 'is_paid'), FALSE, array('id' => 'hrjobcontract_pay_is_paid', 'multiple' => 'multiple', 'title' => ts('- select -')));
         $form->add('text', 'hrjobcontract_pay_pay_amount', ts('Pay Amount'), array('size' => 8, 'maxlength' => 8));
         $form->addRule('hrjobcontract_pay_pay_amount', ts('Please enter a valid money value (e.g. %1).', array(1 => CRM_Utils_Money::format('9.99', ' '))), 'money');
         $form->add('text', 'hrjobcontract_pay_pay_amount_low', ts('From'), array('size' => 8, 'maxlength' => 8));
         $form->addRule('hrjobcontract_pay_pay_amount_low', ts('Please enter a valid money value (e.g. %1).', array(1 => CRM_Utils_Money::format('9.99', ' '))), 'money');
         $form->add('text', 'hrjobcontract_pay_pay_amount_high', ts('To'), array('size' => 8, 'maxlength' => 8));
         $form->addRule('hrjobcontract_pay_pay_amount_high', ts('Please enter a valid money value (e.g. %1).', array(1 => CRM_Utils_Money::format('99.99', ' '))), 'money');
         $form->add('select', 'hrjobcontract_pay_pay_unit', ts('Pay Unit'), CRM_Hrjobcontract_SelectValues::payUnit(), FALSE, array('id' => 'hrjobcontract_pay_pay_unit', 'multiple' => true));
         $form->add('select', 'hrjobcontract_pay_pay_currency', ts('Pay Currency'), array_keys(CRM_Hrjobcontract_Page_JobContractTab::getCurrencyFormats()), FALSE, array('id' => 'hrjobcontract_pay_pay_currency', 'multiple' => true));
         $form->add('text', 'hrjobcontract_pay_pay_annualized_est', ts('Estimated Annual Pay'), array('size' => 8, 'maxlength' => 8));
         $form->addRule('hrjobcontract_pay_pay_annualized_est', ts('Please enter a valid money value (e.g. %1).', array(1 => CRM_Utils_Money::format('9.99', ' '))), 'money');
         $form->add('text', 'hrjobcontract_pay_pay_annualized_est_low', ts('From'), array('size' => 8, 'maxlength' => 8));
         $form->addRule('hrjobcontract_pay_pay_annualized_est_low', ts('Please enter a valid money value (e.g. %1).', array(1 => CRM_Utils_Money::format('9.99', ' '))), 'money');
         $form->add('text', 'hrjobcontract_pay_pay_annualized_est_high', ts('To'), array('size' => 8, 'maxlength' => 8));
         $form->addRule('hrjobcontract_pay_pay_annualized_est_high', ts('Please enter a valid money value (e.g. %1).', array(1 => CRM_Utils_Money::format('99.99', ' '))), 'money');
         $form->add('select', 'hrjobcontract_pay_pay_is_auto_est', ts('Estimated Auto Pay'), array('' => '- select -', 0 => 'No', 1 => 'Yes'), FALSE, array('id' => 'hrjobcontract_pay_pay_is_auto_est', 'multiple' => false));
         // TODO: Annual Benefits + Annual Deductions
         $payCycleOptions = array();
         $payCycles = array();
         CRM_Core_OptionGroup::getAssoc('hrjc_pay_cycle', $payCycles, true);
         foreach ($payCycles as $payCycle) {
             $payCycleOptions[$payCycle['value']] = $payCycle['label'];
         }
         $form->add('select', 'hrjobcontract_pay_pay_cycle', ts('Pay Cycle'), $payCycleOptions, FALSE, array('id' => 'hrjobcontract_pay_pay_cycle', 'multiple' => true));
         $form->add('text', 'hrjobcontract_pay_pay_per_cycle_gross', ts('Pay Per Cycle Gross'), array('size' => 8, 'maxlength' => 8));
         $form->addRule('hrjobcontract_pay_pay_per_cycle_gross', ts('Please enter a valid money value (e.g. %1).', array(1 => CRM_Utils_Money::format('9.99', ' '))), 'money');
         $form->add('text', 'hrjobcontract_pay_pay_per_cycle_gross_low', ts('From'), array('size' => 8, 'maxlength' => 8));
         $form->addRule('hrjobcontract_pay_pay_per_cycle_gross_low', ts('Please enter a valid money value (e.g. %1).', array(1 => CRM_Utils_Money::format('9.99', ' '))), 'money');
         $form->add('text', 'hrjobcontract_pay_pay_per_cycle_gross_high', ts('To'), array('size' => 8, 'maxlength' => 8));
         $form->addRule('hrjobcontract_pay_pay_per_cycle_gross_high', ts('Please enter a valid money value (e.g. %1).', array(1 => CRM_Utils_Money::format('99.99', ' '))), 'money');
         $form->add('text', 'hrjobcontract_pay_pay_per_cycle_net', ts('Pay Per Cycle Net'), array('size' => 8, 'maxlength' => 8));
         $form->addRule('hrjobcontract_pay_pay_per_cycle_net', ts('Please enter a valid money value (e.g. %1).', array(1 => CRM_Utils_Money::format('9.99', ' '))), 'money');
         $form->add('text', 'hrjobcontract_pay_pay_per_cycle_net_low', ts('From'), array('size' => 8, 'maxlength' => 8));
         $form->addRule('hrjobcontract_pay_pay_per_cycle_net_low', ts('Please enter a valid money value (e.g. %1).', array(1 => CRM_Utils_Money::format('9.99', ' '))), 'money');
         $form->add('text', 'hrjobcontract_pay_pay_per_cycle_net_high', ts('To'), array('size' => 8, 'maxlength' => 8));
         $form->addRule('hrjobcontract_pay_pay_per_cycle_net_high', ts('Please enter a valid money value (e.g. %1).', array(1 => CRM_Utils_Money::format('99.99', ' '))), 'money');
     }
     if ($type == 'hrjobcontract_pension') {
         $form->add('hidden', 'hidden_hrjobcontract_pension', 1);
         $form->add('select', 'hrjobcontract_pension_is_enrolled', ts('Is Enrolled'), array(0 => 'No', 1 => 'Yes', 2 => 'Opted out'), FALSE, array('id' => 'hrjobcontract_pension_is_enrolled', 'multiple' => true));
         $form->add('text', 'hrjobcontract_pension_ee_contrib_pct_low', ts('From'), array('size' => 8, 'maxlength' => 8));
         $form->addRule('hrjobcontract_pension_ee_contrib_pct_low', ts('Please enter a valid money value (e.g. %1).', array(1 => CRM_Utils_Money::format('9.99', ' '))), 'money');
         $form->add('text', 'hrjobcontract_pension_ee_contrib_pct_high', ts('To'), array('size' => 8, 'maxlength' => 8));
         $form->addRule('hrjobcontract_pension_ee_contrib_pct_high', ts('Please enter a valid money value (e.g. %1).', array(1 => CRM_Utils_Money::format('99.99', ' '))), 'money');
         $form->add('text', 'hrjobcontract_pension_er_contrib_pct_low', ts('From'), array('size' => 8, 'maxlength' => 8));
         $form->addRule('hrjobcontract_pension_er_contrib_pct_low', ts('Please enter a valid money value (e.g. %1).', array(1 => CRM_Utils_Money::format('9.99', ' '))), 'money');
         $form->add('text', 'hrjobcontract_pension_er_contrib_pct_high', ts('To'), array('size' => 8, 'maxlength' => 8));
         $form->addRule('hrjobcontract_pension_er_contrib_pct_high', ts('Please enter a valid money value (e.g. %1).', array(1 => CRM_Utils_Money::format('99.99', ' '))), 'money');
         $pensionTypes = array();
         $pensionTypeOptions = array();
         CRM_Core_OptionGroup::getAssoc('hrjc_pension_type', $pensionTypes, true);
         foreach ($pensionTypes as $pensionType) {
             $pensionTypeOptions[$pensionType['value']] = $pensionType['label'];
         }
         $form->add('select', 'hrjobcontract_pension_pension_type', ts('Pension Provider'), $pensionTypeOptions, FALSE, array('id' => 'hrjobcontract_pension_pension_type', 'multiple' => true));
         $form->add('text', 'hrjobcontract_pension_ee_contrib_abs_low', ts('From'), array('size' => 8, 'maxlength' => 8));
         $form->addRule('hrjobcontract_pension_ee_contrib_abs_low', ts('Please enter a valid money value (e.g. %1).', array(1 => CRM_Utils_Money::format('9.99', ' '))), 'money');
         $form->add('text', 'hrjobcontract_pension_ee_contrib_abs_high', ts('To'), array('size' => 8, 'maxlength' => 8));
         $form->addRule('hrjobcontract_pension_ee_contrib_abs_high', ts('Please enter a valid money value (e.g. %1).', array(1 => CRM_Utils_Money::format('99.99', ' '))), 'money');
         $form->addElement('text', 'hrjobcontract_pension_ee_evidence_note', ts('Pension Evidence Note'), CRM_Core_DAO::getAttribute('CRM_Hrjobcontract_DAO_HRJobPension', 'ee_evidence_note'));
     }
 }