Exemplo n.º 1
0
/**
 * Populates the states list based on selected country
 *
 * @param String $country Country code of currently selected country.
 */
function populateStates($country)
{
    $objResponse = new xajaxResponse();
    $provinceList = RecruitmentController::getProvinceList($country);
    if ($provinceList) {
        $xajaxFiller = new xajaxElementFiller();
        $xajaxFiller->setDefaultOptionName($GLOBALS['lang_Common_Select']);
        $objResponse->addAssign('state', 'innerHTML', '<select name="txtProvince" id="txtProvince" name="txtProvince" tabindex="8"><option value="0">--- ' . $GLOBALS['lang_Common_Select'] . ' ---</option></select>');
        $objResponse = $xajaxFiller->cmbFillerById($objResponse, $provinceList, 1, 'fromJobApplication.state', 'txtProvince');
    } else {
        $objResponse->addAssign('state', 'innerHTML', '<input type="text" id="txtProvince" name="txtProvince" tabindex="8" >');
    }
    $objResponse->addScript('hideLoading();formJobApplication.txtProvince.focus();');
    return $objResponse->getXML();
}
                            $obj = $timesheetExtractor->parseViewData($_POST);
                            $timeController->setObjTime($obj);
                            $timeController->viewTimesheetPrintPreview($filterValues);
                            break;
                        case 'Print_Timesheet_Get_Page':
                            $filterValues = array($_POST['txtEmpID'], $_POST['txtLocation'], $_POST['txtRepEmpID'], $_POST['txtEmploymentStatus']);
                            $obj = $timesheetExtractor->parseViewData($_POST);
                            $timeController->setObjTime($obj);
                            $timeController->viewTimesheelBulk($filterValues, $_GET['page']);
                            break;
                        case 'Print':
                            $timeController->showPrint();
                            break;
                    }
                } else {
                    trigger_error("Invalid Action " . $_GET['action'], E_USER_NOTICE);
                }
                break;
            case 'benefits':
                include ROOT_PATH . '/lib/controllers/Benefits.inc.php';
                break;
            default:
                trigger_error("Invalid Action " . $_GET['action'], E_USER_NOTICE);
        }
        break;
    case 'recruitMod':
        $recruitController = new RecruitmentController();
        $recruitController->handleRequest($_GET['recruitcode']);
        break;
}
@ob_end_flush();
Exemplo n.º 3
0
} elseif (isset($_GET['recruitcode'])) {
    $moduletype = 'recruitMod';
}
switch ($moduletype) {
    case 'admin':
        break;
    case 'hr':
        break;
    case 'mt':
        break;
    case 'rep':
        break;
    case 'leave':
        break;
    case 'timeMod':
        break;
    case 'recruitMod':
        $recruitController = new RecruitmentController();
        switch ($_GET['recruitcode']) {
            case 'ApplicantViewJobs':
                $recruitController->showVacanciesToApplicant();
                break;
            case 'ApplicantViewApplication':
                $recruitController->showJobApplication($_GET['id']);
                break;
            case 'ApplicantApply':
                $recruitController->applyForJob();
                break;
        }
}
ob_end_flush();
Exemplo n.º 4
0
 /**
  * Test case for createEmployeeFromApplication
  */
 public function testCreateEmployeeFromApplication()
 {
     $jobApplication = JobApplication::getJobApplication(1);
     $empInfo = new EmpInfo();
     $before = $empInfo->countEmployee();
     $recController = new RecruitmentController();
     $empNum = $recController->createEmployeeFromApplication($jobApplication);
     $this->assertNotNull($empNum);
     // check employee count increased by 1
     $after = $empInfo->countEmployee();
     $this->assertEquals($before + 1, $after);
     // verify employee main details
     $empMain = $empInfo->filterEmpMain($empNum);
     $this->assertTrue(isset($empMain[0]));
     $this->assertEquals($empNum, $empMain[0][0]);
     $this->assertEquals($jobApplication->getLastName(), $empMain[0][1]);
     $this->assertEquals($jobApplication->getFirstName(), $empMain[0][2]);
     $this->assertEquals($jobApplication->getMiddleName(), $empMain[0][3]);
     // check that empId saved as well.
     $employeeId = str_pad($empNum, $empInfo->getEmployeeIdLength(), "0", STR_PAD_LEFT);
     $this->assertEquals($employeeId, $empMain[0][5]);
     // verify employee contact details
     $empContact = $empInfo->filterEmpContact($empNum);
     $this->assertTrue(isset($empContact[0]));
     $this->assertEquals($empNum, $empMain[0][0]);
     $this->assertEquals($jobApplication->getStreet1(), $empContact[0][1]);
     $this->assertEquals($jobApplication->getStreet2(), $empContact[0][2]);
     $this->assertEquals($jobApplication->getCity(), $empContact[0][3]);
     $this->assertEquals($jobApplication->getCountry(), $empContact[0][4]);
     $this->assertEquals($jobApplication->getProvince(), $empContact[0][5]);
     $this->assertEquals($jobApplication->getZip(), $empContact[0][6]);
     // Phone saved as home telephone
     $this->assertEquals($jobApplication->getPhone(), $empContact[0][7]);
     $this->assertEquals($jobApplication->getMobile(), $empContact[0][8]);
     // Email stored as other email.
     $this->assertEquals($jobApplication->getEmail(), $empContact[0][11]);
     // Job title
     $empJobInfo = $empInfo->filterEmpJobInfo($empNum);
     $this->assertTrue(isset($empJobInfo[0]));
     $this->assertEquals($empNum, $empJobInfo[0][0]);
     $vacancy = JobVacancy::getJobVacancy($jobApplication->getVacancyId());
     $this->assertEquals($vacancy->getJobTitleCode(), $empJobInfo[0][2]);
 }