本文整理汇总了PHP中type::isValid方法的典型用法代码示例。如果您正苦于以下问题:PHP type::isValid方法的具体用法?PHP type::isValid怎么用?PHP type::isValid使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类type
的用法示例。
在下文中一共展示了type::isValid方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: isValid
/**
* Validiere TitleMain eingaben im Formular.
*
* Zusätzlich zu den normalen Validierungen für Formularelemente wird geprüft, ob eine Sprache zweimal ausgewählt
* wurde.
*
* @param array $data
* @return boolean
*/
public function isValid($data, $context = null)
{
// wird immer aufgerufen um gegebenenfalls weitere Nachrichten anzuzeigen
$result = true;
if (!is_null($this->_subformValidator)) {
if (array_key_exists($this->getName(), $data)) {
$this->_subformValidator->prepareValidation($this, $data[$this->getName()], $context);
$result = $this->_subformValidator->isValid($data[$this->getName()], $context);
}
}
return $result && parent::isValid($data);
}
示例2: saveData
/**
* Saves form data, including document saving
* @param type $form
* @return JsonResponse
*/
public function saveData($form)
{
if ($form->isValid()) {
$data = $form->getData();
try {
$em = $this->getDoctrine()->getManager();
// Subo el fichero y luego lo guardo
$data->upload();
$em->persist($data);
$em->flush();
$response['success'] = true;
} catch (\Exception $e) {
$response['success'] = false;
$response['cause'] = $e->getMessage();
}
} else {
$response['success'] = false;
$response['cause'] = $form->getErrorsAsString();
}
return new JsonResponse($response);
}
示例3: save
/**
*
* @param type $form
* @return type
*/
public function save($form)
{
$auth = Zend_Auth::getInstance();
if ($auth->hasIdentity()) {
$loginUserId = $auth->getStorage()->read()->id;
$loginuserRole = $auth->getStorage()->read()->emprole;
}
$candDetails = "";
$canProcess = true;
$flag = 'true';
$profile_model = new Default_Model_Profiles();
$req_model = new Default_Model_Requisition();
$cand_model = new Default_Model_Candidatedetails();
if ($form->isValid($this->_request->getPost())) {
$id = $this->getRequest()->getParam('id');
$technology = $this->_getParam('technology', null);
$firstname = $this->_getParam('firstname', null);
$lastname = $this->_getParam('lastname', null);
$fullname = $firstname . ' ' . $lastname;
$email = $this->_getParam('emailaddress', null);
$contact = $this->_getParam('contact', null);
$totalexprience = $this->_getParam('totalexprience', null);
$releventexprience = $this->_getParam('releventexprience', null);
$currentCTC = $this->_getParam('currentCTC', null);
$expectedCTC = $this->_getParam('expectedCTC', null);
$currentcompany = $this->_getParam('currentcompany', null);
$currentlocation = $this->_getParam('currentlocation', null);
$noticeperiod = $this->_getParam('noticeperiod', null);
$requisition_id = $this->_getParam('requisition_id', null);
$cvcommentdescription = $this->_getParam('cvcommentdescription', null);
$candresume = $this->_getParam('cand_resume', null);
$data = array('requisition_id' => $requisition_id, 'technology' => $technology, 'firstname' => trim($firstname), 'lastname' => trim($lastname), 'fullname' => trim($fullname), 'emailaddress' => trim($email), 'contact' => trim($contact), 'totalexprience' => $totalexprience, 'releventexprience' => $releventexprience, 'currentCTC' => $currentCTC, 'expectedCTC' => $expectedCTC, 'currentcompany' => $currentcompany, 'currentlocation' => $currentlocation, 'noticeperiod' => $noticeperiod, 'isactive' => 1, 'createdby' => trim($loginUserId), 'modifiedby' => trim($loginUserId), 'createdon' => gmdate("Y-m-d H:i:s"), 'modifiedon' => gmdate("Y-m-d H:i:s"), 'profilelastmodifiedon' => gmdate("Y-m-d H:i:s"), 'cvcommentdescription' => $cvcommentdescription, 'cand_resume' => $candresume);
$data1 = array('requisition_id' => $requisition_id, 'candidate_firstname' => trim($firstname), 'candidate_lastname' => trim($lastname), 'candidate_name' => trim($fullname), 'emailid' => trim($email), 'contact_number' => trim($contact) == '' ? NULL : trim($contact), 'cand_resume' => $candresume, 'cand_status' => "Not Scheduled", 'isactive' => 1, 'createdby' => trim($loginUserId), 'modifiedby' => trim($loginUserId), 'createddate' => gmdate("Y-m-d H:i:s"), 'modifieddate' => gmdate("Y-m-d H:i:s"), 'cand_technology' => trim($technology), 'totalexprience' => trim($totalexprience), 'releventexprience' => trim($releventexprience), 'currentCTC' => trim($currentCTC), 'expectedCTC' => trim($expectedCTC), 'currentcompany' => trim($currentcompany), 'currentlocation' => trim($currentlocation), 'noticeperiod' => trim($noticeperiod));
$where = "";
$actionflag = 1;
if ($id != '') {
unset($data['createdby']);
unset($data['createddate']);
unset($data['isactive']);
$where = "id = " . $id;
$tableid = $id;
$actionflag = 2;
if ($canProcess) {
$result1 = $cand_model->SaveorUpdateCandidateData($data1, "");
}
//perform this action only if login user role is not HRRECRUITER role
if ($loginuserRole != HRRECRUITER) {
$cvshortlistedstatus = "";
try {
//CV Shortlisted status and comments
$cvshortlistedstatus = 1;
$cvcommentdescription = $this->_getParam('cvcommentdescription', null);
$insertCVShortlistDetailsResult = $req_model->insertCVShortlistDetails($id, $requisition_id, $cvshortlistedstatus, $cvcommentdescription, trim($loginUserId), gmdate("Y-m-d H:i:s"));
} catch (Exception $xyz) {
}
}
}
if ($where == '') {
$canProcess = true;
//$canProcess = $cand_model->IsCandidateExists($candidate_firstname, $candidate_lastname, $contact_number, $emailid, $cand_technology);
}
if ($canProcess) {
$result = $profile_model->SaveorUpdateCandidateData($data, $where);
} else {
echo "<script> alert('Profile already exists....!'); </script>";
}
$candData = $cand_model->getCandidateForView($result1);
if (isset($cvshortlistedstatus) || strlen(trim($cvshortlistedstatus)) > 0) {
//updating existing CV
$this->requisition_cvupload_emails($requisition_id, "Update", $candData);
} else {
if ($requisition_id !== NULL) {
//new CV
$this->requisition_cvupload_emails($requisition_id, "New", $candData);
}
}
//send email end -------------------------------------------------
if ($id == '') {
$tableid = $result;
}
if ($result != '') {
$menumodel = new Default_Model_Menu();
$objidArr = $menumodel->getMenuObjID('/profiles');
$objID = $objidArr[0]['id'];
$result = sapp_Global::logManager($objID, $actionflag, $loginUserId, $tableid);
if ($id == '') {
$this->_helper->getHelper("FlashMessenger")->addMessage(array("success" => "Profile details added successfully."));
} elseif ($id !== '' && $requisition_id !== '') {
$this->_helper->getHelper("FlashMessenger")->addMessage(array("success" => "Profile details Added successfully to Resource Pooling."));
} else {
$this->_helper->getHelper("FlashMessenger")->addMessage(array("success" => "Profile details updated successfully."));
}
$this->_redirect('/profiles');
}
} else {
//.........这里部分代码省略.........
示例4: save
/**
*
* @param type $emppersonaldetailsform
* @param type $userid
* @return type
*/
public function save($emppersonaldetailsform, $userid)
{
$auth = Zend_Auth::getInstance();
if ($auth->hasIdentity()) {
$loginUserId = $auth->getStorage()->read()->id;
}
if ($emppersonaldetailsform->isValid($this->_request->getPost())) {
$post_values = $this->_request->getPost();
$new_post_values = array_filter($post_values);
$empperdetailsModal = new Default_Model_Empprobationreview();
$id = $this->_request->getParam('id');
$user_id = $userid;
$feedback = $this->_request->getParam('feedback');
$probationstatus = $this->_request->getParam('probationstatus');
$reviewdate = $this->_request->getParam('reviewdate');
$nextreviewdate = $this->_request->getParam('next_reviewdate');
$reviewdate = sapp_Global::change_date($reviewdate, 'database');
$nextreviewdate = sapp_Global::change_date($nextreviewdate, 'database');
$data = array('user_id' => $user_id, 'probationdate' => $reviewdate, 'next_reviewdate' => $nextreviewdate, 'comments' => $feedback, 'status' => $probationstatus, 'createdby' => $loginUserId, 'isactive' => 1, 'createddate' => gmdate("Y-m-d H:i:s"));
$where = '';
$actionflag = 1;
$menumodel = new Default_Model_Menu();
$empperdetailsModal->makeInactiveExistingRecords($user_id);
$Id = $empperdetailsModal->SaveorUpdateEmpPersonalData($data, $where);
$tableid = $Id;
$this->_helper->getHelper("FlashMessenger")->addMessage(array("success" => "Employee probation review details added successfully."));
$menuidArr = $menumodel->getMenuObjID('/employee');
$menuID = $menuidArr[0]['id'];
$result = sapp_Global::logManager($menuID, $actionflag, $loginUserId, $user_id);
$this->_redirect('empprobationreview/edit/userid/' . $userid);
} else {
$messages = $emppersonaldetailsform->getMessages();
foreach ($messages as $key => $val) {
foreach ($val as $key2 => $val2) {
$msgarray[$key] = $val2;
break;
}
}
//echo '<pre>';print_r($msgarray);exit;
return $msgarray;
}
}
示例5: save
/**
*
* @param type $form
* @param type $data
* @return type
*/
public function save($form, $data)
{
$auth = Zend_Auth::getInstance();
if ($auth->hasIdentity()) {
$loginUserId = $auth->getStorage()->read()->id;
}
$cand_model = new Default_Model_Candidatedetails();
$requi_model = new Default_Model_Requisition();
$interview_model = new Default_Model_Interviewdetails();
$user_model = new Default_Model_Usermanagement();
$interview_round_model = new Default_Model_Interviewrounddetails();
$form->round_status->setRequired(false);
$form->interview_feedback->setRequired(false);
$cand_status = $this->_getParam('cand_status', null);
$interview_status = $this->_getParam('interview_status', null);
$flag = 'true';
if ($interview_status == 'On hold' && $cand_status != 'On hold') {
$msgarray['statusErr'] = 'Since the interview status is onhold, the candidate status should be onhold.';
$flag = 'false';
}
if ($interview_status == 'Completed' && ($cand_status != 'Disqualified' && $cand_status != 'Shortlisted')) {
$msgarray['statusErr'] = 'Since interview status is completed, the candidate status can be either disqualified or shortlisted.';
$flag = 'false';
}
if ($interview_status == 'In process' && ($cand_status == 'Disqualified' || $cand_status == 'Shortlisted')) {
$msgarray['statusErr'] = 'Since the interview status is in process, the candidate cannot be shortlisted or disqualified.';
$flag = 'false';
}
if ($form->isValid($this->_request->getPost()) && $flag != 'false') {
$id = $this->_getParam('id', null);
$requisition_id = $this->_getParam('req_id', null);
$candidate_id = $this->_getParam('candidate_name', null);
$interviewer_ids = $this->_getParam('interviewer_id', null);
$interview_panel = implode(",", $interviewer_ids);
$interviewer_id = 0;
foreach ($interviewer_ids as $interview) {
$interviewer_id = $interview;
break;
}
$int_location = $this->_getParam('int_location', null);
$country = $this->_getParam('country', null);
$state = $this->_getParam('state', null);
$city = $this->_getParam('city', null);
$interview_mode = $this->_getParam('interview_mode', null);
$interview_type_details = $this->_getParam('interview_Type_Details', null);
$interview_time = $this->_getParam('interview_time', null);
$interview_date = $this->_getParam('interview_date', null);
$interview_round = $this->_getParam('interview_round', null);
if (!isset($candidate_id)) {
$candidate_id = $data['id'];
}
if (empty($data)) {
$getExistingCandidateRecord = $interview_model->getCandidateInInterviewProcess(trim($candidate_id));
if ($getExistingCandidateRecord > 0) {
$this->_helper->FlashMessenger()->setNamespace('success')->addMessage('Interview already scheduled for this candidate.');
$this->_redirect('/scheduleinterviews');
}
}
if (empty($data)) {
$idata = array('req_id' => $requisition_id, 'candidate_id' => trim($candidate_id), 'interview_status' => trim($interview_status), 'isactive' => 1, 'createdby' => trim($loginUserId), 'modifiedby' => trim($loginUserId), 'createddate' => gmdate("Y-m-d H:i:s"), 'modifieddate' => gmdate("Y-m-d H:i:s"));
$idata['interview_status'] = 'In process';
$iwhere = "";
$actionflag = 1;
$iresult = $interview_model->SaveorUpdateInterviewData($idata, $iwhere);
if ($id == '') {
$tableid = $iresult;
}
if ($iresult != '') {
$irdata = array('interview_id' => $iresult, 'req_id' => $requisition_id, 'candidate_id' => $candidate_id, 'interviewer_id' => $interviewer_id, 'interview_time' => sapp_Global::change_time(trim($interview_time), 'database'), 'interview_date' => sapp_Global::change_date($interview_date, 'database'), 'interview_mode' => $interview_mode, 'interview_mode_details' => $interview_type_details, 'interview_round_number' => 1, 'interview_round' => trim($interview_round), 'int_location' => trim($int_location), 'int_country' => trim(intval($country)), 'int_state' => trim(intval($state)), 'int_city' => trim(intval($city)), 'isactive' => 1, 'createdby' => trim($loginUserId), 'modifiedby' => trim($loginUserId), 'createddate' => gmdate("Y-m-d H:i:s"), 'modifieddate' => gmdate("Y-m-d H:i:s"), 'interview_panel' => $interview_panel);
$ir_result = $interview_round_model->SaveorUpdateInterviewroundData($irdata, '');
$requisition_data = $requi_model->getRequisitionDataById($requisition_id);
$cand_data = $cand_model->getCandidateById($candidate_id);
$hrgroupemail = $requi_model->getgroupemailid("REQ_HR", $requisition_data["department_id"]);
$requisition_data = $requi_model->getrequisitiondetails($requisition_id);
$requesteremailaddress = $requi_model->getemployeeemailaddress($requisition_data["createdby"]);
$reportingmanageremailaddress = $requi_model->getemployeeemailaddress($requisition_data["reporting_id"]);
$mail_arr = array('HR' => $hrgroupemail["groupEmail"], $requesteremailaddress['userfullname'] => $requesteremailaddress['emailaddress'], $reportingmanageremailaddress['userfullname'] => $reportingmanageremailaddress['emailaddress']);
$loginuser_person_data = $user_model->getUserDataById($loginUserId);
$interview_panel = $interview_panel . "," . $loginUserId;
$interviewpanelnamesemailaddresss = $requi_model->GetInterviewPanelMamesEmailaddress($interview_panel);
/* $emailtemp = array();
$nametemp = array();
foreach ($interviewpanelnamesemailaddress as $row) {
array_push($emailtemp, $row['emailaddress']);
array_push($nametemp, $row['userfullname']);
}
$email = implode(";", $emailtemp);
$ename = implode(";", $nametemp); */
$cal_unique_id = $this->getCalendarUniqueID();
foreach ($interviewpanelnamesemailaddresss as $interviewpanelnamesemailaddress) {
$description = "Meeting From : " . $from_name . "\r\n" . "Candidate Name : " . $cand_data['candidate_name'] . "\r\n" . "Interview Type : " . $interview_mode . "\r\n" . "Interview Location : " . $int_location . "\r\n" . "Interview Date : " . $interview_date . "\r\n" . "Interview Time : " . sapp_Global::change_time($interview_time, 'view') . "\r\n" . " " . " " . "\r\n";
/* $base_url = 'http://' . $this->getRequest()->getHttpHost() . $this->getRequest()->getBaseUrl();
$options['subject'] = APPLICATION_NAME . ': Interview schedule';
$options['header'] = 'Interview schedule';
//.........这里部分代码省略.........
示例6: save
/**
*
* @param type $requisitionform
* @param type $data
* @return type
*/
public function save($requisitionform, $data)
{
$ipreporting_id = "";
$technicalskill_id = "";
$nontechnicalskill_id = "";
$auth = Zend_Auth::getInstance();
if ($auth->hasIdentity()) {
$loginUserId = $auth->getStorage()->read()->id;
$loginuserGroup = $auth->getStorage()->read()->group_id;
}
$requi_model = new Default_Model_Requisition();
$user_model = new Default_Model_Usermanagement();
$jobtitleModel = new Default_Model_Jobtitles();
$appr_mail = '';
$appr_per = '';
if ($requisitionform->isValid($this->_request->getPost())) {
$trDb = Zend_Db_Table::getDefaultAdapter();
// starting transaction
$trDb->beginTransaction();
try {
$id = (int) $this->_getParam('id', null);
$requisition_code = $this->_getParam('requisition_code', null);
$onboard_date = $this->_getParam('onboard_date', null);
$business_unit = $this->_getParam('business_unit', null);
$department = $this->_getParam('department', null);
$jobtitle = $this->_getParam('jobtitle', null);
$position_id = $this->_getParam('position_id', null);
$reporting_id = $this->_getParam('reporting_id', null);
$req_no_positions = $this->_getParam('req_no_positions', null);
$jobdescription = $this->_getParam('jobdescription', null);
$req_skills = $this->_getParam('req_skills', null);
$req_qualification = $this->_getParam('req_qualification', null);
$req_exp_years = $this->_getParam('req_exp_years', null);
$emp_type = $this->_getParam('emp_type', null);
$req_priority = $this->_getParam('req_priority', null);
$additional_info = $this->_getParam('additional_info', null);
$req_status = $this->_getParam('req_status', null);
$approver1 = $this->_getParam('approver1', null);
$approver2 = $this->_getParam('approver2', null);
$approver3 = $this->_getParam('approver3', null);
$aflag = $this->_getParam('aflag', null);
$edit_flag = $this->_getParam('edit_flag', null);
$edit_order = $this->_getParam('edit_order', null);
$requ_jd = $this->_getParam('requ_jd', null);
$billable = $this->_getParam('billable', null);
$billablefor = $this->_getParam('billablefor', null);
$billable_empname = $this->_getParam('billable_empname', null);
$interviewroundscount = $this->_getParam('interviewroundscount', null);
$technology = $this->_getParam('technology', null);
try {
$ipbusiness_unit = 1;
$ipdepartment = 1;
$ipreporting_id = $this->_getParam('ipreporting_id', null);
$technicalskill_id = $this->_getParam('technicalskill_id', null);
$nontechnicalskill_id = $this->_getParam('nontechnicalskill_id', null);
} catch (Exception $abc) {
}
$aorder = $this->_getParam('aorder', null);
//1= approver1,2=approver2,3=approver3
if ($aflag != '' && $aflag == 'approver') {
if ($req_status == 3) {
//for rejected
$data = array('modifiedby' => trim($loginUserId), 'modifiedon' => gmdate("Y-m-d H:i:s"), 'appstatus' . $aorder => $req_status, 'req_status' => $req_status);
} else {
//for approved
if ($aorder == 1) {
if ($approver2 != '') {
$data = array('appstatus1' => $req_status, 'req_status' => $req_status);
$appr_mail = $approver1;
$appr_per = $approver1;
} else {
$data = array('appstatus1' => $req_status, 'req_status' => $req_status);
$appr_mail = 'approved';
}
} else {
if ($aorder == 2) {
if ($approver3 != '') {
$data = array('appstatus2' => $req_status, 'req_status' => $req_status);
$appr_mail = $approver2;
$appr_per = $approver2;
} else {
$data = array('appstatus2' => $req_status, 'req_status' => $req_status);
$appr_mail = 'approved';
}
}
}
$data['modifiedby'] = trim($loginUserId);
$data['modifiedon'] = gmdate("Y-m-d H:i:s");
}
} else {
$data = array('requisition_code' => trim($requisition_code), 'onboard_date' => sapp_Global::change_date(trim($onboard_date), 'database'), 'position_id' => trim($position_id), 'reporting_id' => trim($reporting_id), 'businessunit_id' => trim($business_unit), 'department_id' => trim($department), 'req_no_positions' => trim($req_no_positions), 'jobdescription' => trim($jobdescription), 'jobtitle' => trim($jobtitle), 'req_skills' => trim($req_skills), 'req_qualification' => trim($req_qualification), 'req_exp_years' => trim($req_exp_years), 'emp_type' => trim($emp_type), 'req_priority' => trim($req_priority), 'additional_info' => trim($additional_info), 'billable' => trim($billable), 'interviewroundscount' => trim($interviewroundscount), 'technology' => trim($technology), 'approver1' => $approver1, 'approver2' => $approver2 == '' ? null : $approver2, 'approver3' => $approver3 == '' ? null : $approver3, 'req_status' => 'Initiated', 'appstatus1' => 'Initiated', 'appstatus2' => null, 'appstatus3' => null, 'isactive' => 1, 'createdby' => trim($loginUserId), 'modifiedby' => trim($loginUserId), 'createdon' => gmdate("Y-m-d H:i:s"), 'modifiedon' => gmdate("Y-m-d H:i:s"), 'upload_jd' => trim($requ_jd), 'billable_for' => trim($billablefor), 'billable_empname' => trim($billable_empname));
if ($loginuserGroup == MANAGER_GROUP) {
$data['reporting_id'] = $loginUserId;
}
//.........这里部分代码省略.........
示例7: save
/**
*
* @param type $requisitionform
* @param type $data
* @return type
*/
public function save($requisitionform, $data)
{
$auth = Zend_Auth::getInstance();
if ($auth->hasIdentity()) {
$loginUserId = $auth->getStorage()->read()->id;
$loginuserGroup = $auth->getStorage()->read()->group_id;
}
$requi_model = new Default_Model_Requisition();
$user_model = new Default_Model_Usermanagement();
$req_status = $this->_getParam('req_status', null);
try {
//update HR Executive for Requisition
$hrExecutiveID = $this->_getParam('hrexecutive_id', null);
$requisition_code = $this->_getParam('requisition_code', null);
$requisition_id = $this->_getParam('id', null);
$result1 = $requi_model->update_requisition_hrexecutive($requisition_id, $requisition_code, $hrExecutiveID, $loginUserId, gmdate("Y-m-d H:i:s"));
//send emails
$this->hrexecutive_to_requisition_emails($data, $requisition_code, $hrExecutiveID);
} catch (Exception $xyz) {
}
$flag = 'true';
if ($requisitionform->isValid($this->_request->getPost()) && $flag != 'false') {
$id = $this->_getParam('id', null);
$req_status = $this->_getParam('req_status', null);
$onboard_date = $this->_getParam('onboard_date', null);
$data = array('req_status' => $req_status, 'modifiedby' => trim($loginUserId), 'modifiedon' => gmdate("Y-m-d H:i:s"));
if ($onboard_date != '') {
$data = $data + array('onboard_date' => sapp_Global::change_date($onboard_date, 'database'));
}
$where = "id = " . $id;
$result = $requi_model->SaveorUpdateRequisitionData($data, $where);
$requisition_data = $requi_model->getReqDataForView($id);
$requisition_data = $requisition_data[0];
if ($loginUserId == $requisition_data['approver1']) {
$result1 = $requi_model->insert_requisition_approvalLog($id, $requisition_data['requisition_code'], $data['req_status'], $loginUserId, gmdate("Y-m-d H:i:s"));
}
$tableid = $id;
$actionflag = 2;
if ($result != '') {
if ($req_status == 'Complete' || $req_status == 'Closed') {
$requi_model->change_to_requisition_closed($id);
$report_person_data = $user_model->getUserDataById($requisition_data['createdby']);
$closed_person_data = $user_model->getUserDataById($loginUserId);
//HR
$mail_arr[0]['name'] = 'HR';
$mail_arr[0]['email'] = constant('REQ_HR_0');
$mail_arr[0]['type'] = 'HR';
//Management
$mail_arr[1]['name'] = 'Management';
$mail_arr[1]['email'] = constant('REQ_MGMT_0');
$mail_arr[1]['type'] = 'Management';
//Requester
$mail_arr[2]['name'] = $report_person_data['userfullname'];
$mail_arr[2]['email'] = $report_person_data['emailaddress'];
$mail_arr[2]['type'] = 'Raise';
for ($ii = 0; $ii < count($mail_arr); $ii++) {
$base_url = 'http://' . $this->getRequest()->getHttpHost() . $this->getRequest()->getBaseUrl();
$view = $this->getHelper('ViewRenderer')->view;
$this->view->emp_name = $mail_arr[$ii]['name'];
$this->view->base_url = $base_url;
$this->view->type = $mail_arr[$ii]['type'];
$this->view->requisition_code = $requisition_data['requisition_code'];
$this->view->req_status = $status = strtolower($req_status == 'Closed' ? "Closed" : $req_status);
$this->view->raised_name = $report_person_data['userfullname'];
$this->view->approver_str = $closed_person_data['userfullname'];
$text = $view->render('mailtemplates/changedrequisition.phtml');
$options['subject'] = APPLICATION_NAME . ':' . $requisition_data['requisition_code'] . '-Requisition is ' . $status;
$options['header'] = 'Requisition is ' . $status;
$options['toEmail'] = $mail_arr[$ii]['email'];
$options['toName'] = $mail_arr[$ii]['name'];
$options['message'] = $text;
//$options['cron'] = 'yes';
sapp_Global::_sendEmail($options, "changedrequisition", REQUISITIONMODULESENDEMAIL);
}
}
$menumodel = new Default_Model_Menu();
$objidArr = $menumodel->getMenuObjID('/approvedrequisitions');
$objID = $objidArr[0]['id'];
$result = sapp_Global::logManager($objID, $actionflag, $loginUserId, $tableid);
if ($id != '') {
$this->_helper->getHelper("FlashMessenger")->addMessage(array("success" => "Requisition updated successfully."));
} else {
$this->_helper->getHelper("FlashMessenger")->addMessage(array("success" => "Requisition added successfully."));
}
$this->_redirect('/approvedrequisitions');
}
} else {
$messages = $requisitionform->getMessages();
$msgarray = array();
foreach ($messages as $key => $val) {
foreach ($val as $key2 => $val2) {
$msgarray[$key] = $val2;
break;
}
//.........这里部分代码省略.........
示例8: validateExpression
/**
*
* @param type $bean
* @param type $flowData
* @param type $request
* @param type $paramsRelated
* @return type
*/
public function validateExpression($bean, $flowData, $request, $paramsRelated = array())
{
$conditionResult = $this->evaluator->evaluateExpression(trim($flowData['evn_criteria']), $bean, $paramsRelated);
if ($flowData['evn_criteria'] == '' || $flowData['evn_criteria'] == '[]' || $conditionResult) {
$request->validate();
} else {
$request->invalidate();
}
$condition = $this->evaluator->condition();
$this->logger->debug("Eval: {$condition} returned " . $request->isValid());
return $request;
}
示例9: updateempdetails
/**
*
* @param type $employeeform
* @return string
*/
public function updateempdetails($employeeform)
{
$emproleStr = '';
$roleArr = array();
$auth = Zend_Auth::getInstance();
if ($auth->hasIdentity()) {
$loginUserId = $auth->getStorage()->read()->id;
}
$usersModel = new Default_Model_Usermanagement();
$employeeModal = new Default_Model_Employee();
$businessunit_id = $this->_request->getParam('businessunit_id', null);
$department_id = $this->_request->getParam('department_id', null);
$reporting_manager = $this->_request->getParam('reporting_manager', null);
$jobtitle_id = $this->_request->getParam('jobtitle_id', null);
$position_id = $this->_request->getParam('position_id', null);
$user_id = $this->_getParam('user_id', null);
$prefix_id = $this->_getParam('prefix_id', null);
$extension_number = $this->_getParam('extension_number', null);
if ($employeeform->isValid($this->_request->getPost())) {
$id = $this->_request->getParam('id');
$emp_status_id = $this->_request->getParam('emp_status_id', null);
$date_of_joining = $this->_request->getParam('date_of_joining', null);
$date_of_joining = sapp_Global::change_date($date_of_joining, 'database');
$date_of_leaving = $this->_request->getParam('date_of_leaving', null);
$date_of_leaving = sapp_Global::change_date($date_of_leaving, 'database');
$years_exp = $this->_request->getParam('years_exp');
//FOR USER table
$employeeId = $this->_getParam('employeeId', null);
$modeofentry = $this->_getParam('modeofentry', null);
$hid_modeofentry = $this->_getParam('hid_modeofentry', null);
$other_modeofentry = $this->_getParam('other_modeofentry', null);
$userfullname = $this->_getParam('userfullname', null);
$candidatereferredby = $this->_getParam('candidatereferredby', null);
$rccandidatename = $this->_getParam('rccandidatename', null);
$emprole = $this->_getParam('emprole', null);
//roleid_group_id
if ($emprole != "") {
$roleArr = explode('_', $emprole);
if (!empty($roleArr)) {
$emproleStr = $roleArr[0];
}
}
$emailaddress = $this->_getParam('emailaddress', null);
$tmp_name = $this->_request->getParam('tmp_emp_name', null);
$act_inact = $this->_request->getParam("act_inact", null);
//end of user table
$date = new Zend_Date();
$menumodel = new Default_Model_Menu();
$empstatusarray = array(8, 9, 10);
$actionflag = '';
$tableid = '';
if ($modeofentry == 'Direct' || $hid_modeofentry == 'Direct') {
$candidate_key = 'userfullname';
$candidate_value = $userfullname;
$emp_name = $userfullname;
$candidate_flag = 'no';
} else {
$candidate_key = 'rccandidatename';
$candidate_value = $rccandidatename;
$emp_name = $tmp_name;
$candidate_flag = 'yes';
}
$trDb = Zend_Db_Table::getDefaultAdapter();
// starting transaction
$trDb->beginTransaction();
try {
$emppassword = sapp_Global::generatePassword();
$user_data = array('emprole' => $emproleStr, $candidate_key => $candidate_value, 'emailaddress' => $emailaddress, 'modifiedby' => $loginUserId, 'modifieddate' => Zend_Registry::get('currentdate'), 'emppassword' => md5($emppassword), 'employeeId' => $employeeId, 'modeofentry' => $id == '' ? $modeofentry : "", 'selecteddate' => $date_of_joining, 'candidatereferredby' => $candidatereferredby, 'userstatus' => 'old', 'other_modeofentry' => $other_modeofentry);
if ($id != '') {
$where = array('user_id=?' => $user_id);
$actionflag = 2;
$user_where = "id = " . $user_id;
unset($user_data['candidatereferredby']);
unset($user_data['userstatus']);
unset($user_data['emppassword']);
unset($user_data['employeeId']);
unset($user_data['modeofentry']);
unset($user_data['other_modeofentry']);
} else {
$data['createdby'] = $loginUserId;
$data['createddate'] = gmdate("Y-m-d H:i:s");
$data['isactive'] = 1;
$user_data['createdby'] = $loginUserId;
$user_data['createddate'] = gmdate("Y-m-d H:i:s");
$user_data['isactive'] = 1;
if ($modeofentry != 'Direct') {
$user_data['userfullname'] = $emp_name;
}
$where = '';
$actionflag = 1;
$user_where = '';
}
$user_status = $usersModel->SaveorUpdateUserData($user_data, $user_where);
if ($id == '') {
$user_id = $user_status;
//.........这里部分代码省略.........
示例10: validateExpression
/**
*
* @param type $bean
* @param type $flowData
* @param type $request
* @param type $paramsRelated
* @return type
*/
public function validateExpression($bean, $flowData, $request, $paramsRelated = array())
{
$terminate = $this->evaluator->evaluateExpression(trim($flowData['evn_criteria']), $bean, $paramsRelated);
if ($flowData['evn_criteria'] != '' && $flowData['evn_criteria'] != '[]' && $terminate) {
$request->setResult('TERMINATE_CASE');
}
$condition = $this->evaluator->condition();
$this->logger->debug("Eval: {$condition} returned " . $request->isValid());
return $request;
}
示例11: save
/**
*
* @param type $form
* @return type
*/
public function save($form)
{
$auth = Zend_Auth::getInstance();
if ($auth->hasIdentity()) {
$loginUserId = $auth->getStorage()->read()->id;
$loginuserRole = $auth->getStorage()->read()->emprole;
}
$canProcess = true;
$cand_model = new Default_Model_Candidatedetails();
$candwork_model = new Default_Model_Candidateworkdetails();
$req_model = new Default_Model_Requisition();
$requisition_id = $this->_getParam('requisition_id', null);
$cand_status = $this->_getParam('cand_status', null);
$ststidflag1 = $this->_getParam('ststidflag1', null);
$flag = 'true';
if ($form->isValid($this->_request->getPost())) {
$id = $this->getRequest()->getParam('id');
}
if ($ststidflag1 == 'true') {
if ($requisition_id == '') {
$msgarray['requisition_id'] = 'Please select requisition id.';
$flag = 'false';
}
//perform this action only if login user role is not HRRECRUITER role
if ($loginuserRole != HRRECRUITER) {
if ($cand_status == '') {
$msgarray['cand_status'] = 'Please select status.';
$flag = 'false';
}
}
}
$contact_number = $this->_getParam('contact_number', null);
if ($contact_number == null) {
$contact_number = $this->_getParam('candidate_phonenumber', null);
if ($id == '') {
if ($contact_number != null) {
if (!$cand_model->isPhoneNumberEmailAlreadyExists($contact_number)) {
echo "<script> alert('Candidate phone number already exists.'); </script>";
#$msgarray['errors-candidate_phonenumber'] = 'Candidate phone number already exists.';
$canProcess = 'false';
}
}
}
}
$emailid = $this->_getParam('emailid', null);
if ($emailid == null) {
$emailid = $this->_getParam('candidate_emailaddress', null);
if ($id == '') {
if ($emailid != null) {
if (!$cand_model->isPhoneNumberEmailAlreadyExists($emailid)) {
echo "<script> alert('Candidate email address already exists.'); </script>";
#$msgarray['errors-candidate_emailaddress'] = 'Candidate email address already exists.';
$canProcess = 'false';
}
}
}
}
$this->view->ststidflag1 = $ststidflag1;
if ($form->isValid($this->_request->getPost()) && $flag == 'true' && $canProcess == 'true') {
$id = $this->getRequest()->getParam('id');
$requisition_id = $this->_getParam('requisition_id', null);
$candidate_firstname = $this->_getParam('candidate_firstname', null);
$candidate_lastname = $this->_getParam('candidate_lastname', null);
$candidate_name = $candidate_firstname . ' ' . $candidate_lastname;
$cand_resume = $this->_getParam('cand_resume', null);
$req_status = $this->_getParam('req_status', null);
$cand_technology = $this->_getParam('candidate_technology', null);
$totalexprience = $this->_getParam('totalexprience', null);
$releventexprience = $this->_getParam('releventexprience', null);
$currentCTC = $this->_getParam('currentCTC', null);
$expectedCTC = $this->_getParam('expectedCTC', null);
$currentcompany = $this->_getParam('currentcompany', null);
$currentlocation = $this->_getParam('currentlocation', null);
$noticeperiod = $this->_getParam('noticeperiod', null);
$req_records = $cand_model->getcountofrecords($requisition_id);
if (empty($req_records) || !empty($req_records)) {
$rdata = array('req_status' => 'In process', 'modifiedby' => trim($loginUserId), 'modifiedon' => gmdate("Y-m-d H:i:s"));
$rwhere = ' id = ' . $requisition_id;
$req_model->SaveorUpdateRequisitionData($rdata, $rwhere);
}
$data = array('requisition_id' => $requisition_id, 'candidate_firstname' => trim($candidate_firstname), 'candidate_lastname' => trim($candidate_lastname), 'candidate_name' => trim($candidate_name), 'emailid' => trim($emailid), 'contact_number' => trim($contact_number) == '' ? NULL : trim($contact_number), 'cand_resume' => $cand_resume, 'cand_status' => $cand_status, 'isactive' => 1, 'createdby' => trim($loginUserId), 'modifiedby' => trim($loginUserId), 'createddate' => gmdate("Y-m-d H:i:s"), 'modifieddate' => gmdate("Y-m-d H:i:s"), 'cand_technology' => trim($cand_technology), 'totalexprience' => trim($totalexprience), 'releventexprience' => trim($releventexprience), 'currentCTC' => trim($currentCTC), 'expectedCTC' => trim($expectedCTC), 'currentcompany' => trim($currentcompany), 'currentlocation' => trim($currentlocation), 'noticeperiod' => trim($noticeperiod));
if (trim($contact_number) == '') {
unset($data['contact_number']);
}
if (trim($emailid) == '') {
unset($data['emailid']);
}
$where = "";
$actionflag = 1;
if ($id != '') {
unset($data['createdby']);
unset($data['createddate']);
unset($data['isactive']);
$where = "id = " . $id;
$tableid = $id;
//.........这里部分代码省略.........
示例12: save
/**
*
* @param type $form
* @return type
*/
public function save($form)
{
$auth = Zend_Auth::getInstance();
if ($auth->hasIdentity()) {
$loginUserId = $auth->getStorage()->read()->id;
$loginuserGroup = $auth->getStorage()->read()->group_id;
}
$requi_model = new Default_Model_Requisition();
$round_model = new Default_Model_Interviewrounddetails();
$round_reschedule_model = new Default_Model_Interviewroundrescheduledetails();
$intrvwModel = new Default_Model_Interviewdetails();
$user_model = new Default_Model_Usermanagement();
$cand_model = new Default_Model_Candidatedetails();
$roundId = $this->getRequest()->getParam('id');
$intrvwId = $this->getRequest()->getParam('unitId');
if ($form->isValid($this->_request->getPost())) {
$reqData = $intrvwModel->getReqByintrvwID($intrvwId);
if (!empty($reqData)) {
$reqId = $reqData['req_id'];
$candid = $reqData['candidate_id'];
$id = $this->getRequest()->getParam('id');
$interviewrnd_id = $intrvwId;
$interviewer_id1 = $this->getRequest()->getParam('interviewer_id');
if (is_array($interviewer_id1)) {
$interview_id = $interviewer_id1[0];
} else {
$interview_id = $interviewer_id1;
}
$interview_round = $this->getRequest()->getParam('interview_round');
$interview_mode = $this->getRequest()->getParam('interview_mode');
$interview_Type_Details = $this->getRequest()->getParam('interview_Type_Details');
$int_location = $this->getRequest()->getParam('int_location');
$interview_time = $this->getRequest()->getParam('interview_time');
$interview_date = $this->getRequest()->getParam('interview_date');
$interview_feedback = $this->getRequest()->getParam('interview_feedback');
$interview_comments = $this->getRequest()->getParam('interview_comments');
$round_status = $this->getRequest()->getParam('round_status', null);
$hid_round_status = $this->getRequest()->getParam('hid_round_status', null);
if (is_array($interviewer_id1)) {
$interview_panel = implode(",", $this->getRequest()->getParam('interviewer_id', null));
} else {
$interview_id = $interviewer_id1;
}
if ($id != null) {
//get Feedback Matrix values from Request
$requisitionSkillMatrix = $round_model->getRequisitionSkillMatrix($id);
$currRowCount = 0;
foreach ($requisitionSkillMatrix as $skill) {
$unqCode = $skill['uniquecode'];
$skillSelValue = $this->getRequest()->getParam($unqCode, null);
if ($skillSelValue != null) {
$requisitionSkillMatrix[$currRowCount]['Rating'] = $skillSelValue;
}
$currRowCount++;
}
}
//check if Skill matrix is filled as per business logic
$skillsmatrixvalidate = true;
if ($round_status == "Schedule for next round" || $round_status == "Qualified" || $round_status == "Selected" || $round_status == "Disqualified") {
if ($interview_round == "Technical") {
foreach ($requisitionSkillMatrix as $skill) {
if ($skill['Category'] == "Technical" && ($skill['Rating'] <= 0 || $skill['Rating'] == null)) {
$skillsmatrixvalidate = false;
break;
}
}
}
/* else if ($interview_round == "Managerial") {
foreach ($requisitionSkillMatrix as $skill) {
if ($skill['Category'] == "Non-Technical" && ($skill['Rating'] <= 0 || $skill['Rating'] == null)) {
$skillsmatrixvalidate = false;
break;
}
}
} */
}
if ($skillsmatrixvalidate != true) {
$alertMsg = ($interview_round == "Managerial" ? 'Non-Technical' : 'Technical') . " Skill Rating is Mandatory...!";
echo '<script language="javascript">';
echo 'alert("' . $alertMsg . '")';
echo '</script>';
} else {
// for Interview Reschedule & Cancellations
if ($round_status == "Re-Scheduled-Interviewer Request" || $round_status == "Re-Scheduled-Candidate Request" || $round_status == "Cancelled") {
$round_data = $round_model->getSingleRoundData($id);
$cand_data = $cand_model->getCandidateById($candid);
$requisition_data = $requi_model->getRequisitionDataById($reqId);
$interviewpanelnamesemailaddress = $requi_model->GetInterviewPanelMamesEmailaddress($round_data['interview_panel']);
$loginuser_person_data = $user_model->getUserDataById($loginUserId);
$data = array('interviewround_id' => $id, 'interview_id' => trim($intrvwId), 'req_id' => $reqId, 'candidate_id' => $candid, 'interview_location_old' => $round_data['int_location'], 'interview_round_old' => $round_data['interview_round'], 'interview_date_old' => $round_data['interview_date'], 'interview_time_old' => $round_data['interview_time'], 'interview_mode_old' => $round_data['interview_mode'], 'interview_mode_details_old' => $round_data['interview_mode_details'], 'interview_location' => $int_location, 'interview_round' => $interview_round, 'interview_time' => sapp_Global::change_time(trim($interview_time), 'database'), 'interview_date' => sapp_Global::change_date(trim($interview_date), 'database'), 'interview_mode' => $interview_mode, 'interview_mode_details' => $interview_Type_Details, 'interview_feedback' => trim($interview_feedback), 'round_status' => trim($round_status), 'createdby' => trim($loginUserId), 'createddate' => gmdate("Y-m-d H:i:s"));
$result1 = $round_reschedule_model->SaveorUpdateInterviewroundData($data, "");
$intRound_where = array("id = " . $id);
if ($round_status == "Cancelled") {
$data_intRound = array('int_location' => $int_location, 'interview_round' => $interview_round, 'interview_time' => sapp_Global::change_time(trim($interview_time), 'database'), 'interview_date' => sapp_Global::change_date(trim($interview_date), 'database'), 'interview_mode' => $interview_mode, 'interview_mode_details' => $interview_Type_Details, 'modifiedby' => trim($loginUserId), 'modifieddate' => gmdate("Y-m-d H:i:s"), 'isactive' => 0);
} else {
//.........这里部分代码省略.........
示例13: updateModelWithFormValidation
/**
* @param type $form
* @param type $model
* @param type $successMsg
* @return boolean
* @throws InvalidArgumentException
*/
protected function updateModelWithFormValidation($form, $model, $successMsg)
{
if ($form->isValid() && $model->update()) {
if (!empty($successMsg)) {
$this->flashSession->notice($successMsg);
}
return true;
}
$m = "";
foreach ($form->getMessages() as $msg) {
$m .= $msg . "<br>";
}
foreach ($model->getMessages() as $msg) {
$m .= $msg . "<br>";
}
throw new InvalidArgumentException($m);
}