/** * * @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 { $messages = $form->getMessages(); foreach ($messages as $key => $val) { foreach ($val as $key2 => $val2) { $msgarray[$key] = $val2; break; } } return $msgarray; } }
public function viewAction() { $cand_model = new Default_Model_Candidatedetails(); $candwork_model = new Default_Model_Candidateworkdetails(); $auth = Zend_Auth::getInstance(); if ($auth->hasIdentity()) { $loginUserId = $auth->getStorage()->read()->id; $login_group_id = $auth->getStorage()->read()->group_id; $login_role_id = $auth->getStorage()->read()->emprole; } $id = $this->getRequest()->getParam('id'); try { $candidateData = $cand_model->getCandidateForView($id); if (!empty($candidateData)) { try { $candidateworkData = $candwork_model->getcandidateworkData($id); $previ_data = sapp_Global::_checkprivileges(CANDIDATEDETAILS, $login_group_id, $login_role_id, 'edit'); $this->view->previ_data = $previ_data; $this->view->workdata = $candidateworkData; $this->view->ermsg = ''; $this->view->cdata = $candidateData; $objName = 'candidatedetails'; $this->view->id = $id; $this->view->controllername = $objName; } catch (Exception $e) { $this->view->nodata = 'nodata'; } } else { $this->view->nodata = 'nodata'; } } catch (Exception $e) { $this->view->nodata = 'nodata'; } }
/** * */ public function followupAction() { /* $cand_details_model = new Default_Model_Candidatedetails(); $result = $cand_details_model->getcandidateData($this->_getParam('id')); if (!empty($result['cand_resume'])) { $status = array(); $file = BASE_PATH . '/uploads/resumes/' . $result['cand_resume']; $status = sapp_Global::downloadFile($file); if (!empty($status['message'])) { $this->_helper->FlashMessenger()->setNamespace('success')->addMessage($status['message']); } } */ $candidateid = $this->_getParam('id'); $requi_model = new Default_Model_Requisition(); $requisition_id = $requi_model->getcandidaterequisitionid($candidateid); $requ_id = $requisition_id[requisition_id]; $cand_model = new Default_Model_Candidatedetails(); $candData = $cand_model->getCandidateForView($candidateid); $this->requisition_cvupload_emails($requ_id, "Update", $candData); $this->_helper->getHelper("FlashMessenger")->addMessage(array("success" => "Follow-up emails successfully send.")); $this->_redirect('candidatedetails/index'); }