/** * * @param <type> $request * @return <type> */ public function execute($request) { $this->setLayout(false); sfConfig::set('sf_web_debug', false); sfConfig::set('sf_debug', false); if ($this->getRequest()->isXmlHttpRequest()) { $this->getResponse()->setHttpHeader('Content-Type', 'application/json; charset=utf-8'); } $userRoleManager = $this->getContext()->getUserRoleManager(); $mode = $request->getParameter('mode'); $dataGroupName = $mode == self::MODE_CANDIDATES ? 'recruitment_candidates' : 'recruitment_vacancies'; $requiredPermissions = array(BasicUserRoleManager::PERMISSION_TYPE_DATA_GROUP => array($dataGroupName => new ResourcePermission(true, false, false, false))); $allowedVacancyList = $userRoleManager->getAccessibleEntityIds('Vacancy', null, null, array(), array(), $requiredPermissions); $jobTitle = $request->getParameter('jobTitle'); $vacancyService = new VacancyService(); $vacancyList = $vacancyService->getVacancyListForJobTitle($jobTitle, $allowedVacancyList, true); $newVacancyList = array(); foreach ($vacancyList as $vacancy) { if ($vacancy['status'] == JobVacancy::CLOSED) { $vacancy['name'] = $vacancy['name'] . " (Closed)"; } $newVacancyList[] = $vacancy; } return $this->renderText(json_encode($newVacancyList)); }
/** * * @param <type> $request */ public function execute($request) { $toBeDeletedActivityIds = $request->getParameter('chkSelectRow'); $projectId = $request->getParameter('projectId'); $form = new DefaultListForm(); $form->bind($request->getParameter($form->getName())); if ($form->isValid()) { if (!empty($toBeDeletedActivityIds)) { $delete = true; foreach ($toBeDeletedActivityIds as $toBeDeletedActivityId) { $deletable = $this->getProjectService()->hasActivityGotTimesheetItems($toBeDeletedActivityId); if ($deletable) { $delete = false; break; } } if ($delete) { foreach ($toBeDeletedActivityIds as $toBeDeletedActivityId) { $customer = $this->getProjectService()->deleteProjectActivities($toBeDeletedActivityId); } $this->getUser()->setFlash('success', __(TopLevelMessages::DELETE_SUCCESS)); } else { $this->getUser()->setFlash('error', __('Not Allowed to Delete Project Activites Which Have Time Logged Against')); } } } $this->redirect('admin/saveProject?projectId=' . $projectId . '#ProjectActivities'); }
/** * * @param <type> $request */ public function execute($request) { /* For highlighting corresponding menu item */ $request->setParameter('initialActionName', 'viewJobVacancy'); $usrObj = $this->getUser()->getAttribute('user'); if (!$usrObj->isAdmin()) { $this->redirect('recruitment/viewCandidates'); } $this->vacancyId = $request->getParameter('Id'); $values = array('vacancyId' => $this->vacancyId); $this->setForm(new AddJobVacancyForm(array(), $values)); if ($this->getUser()->hasFlash('templateMessage')) { list($this->messageType, $this->message) = $this->getUser()->getFlash('templateMessage'); MessageRegistry::instance()->addMessage($this->message, 'recruitment', 'addJobVacancy', MessageRegistry::PREPEND); $this->message = MessageRegistry::instance()->getMessage('recruitment', 'addJobVacancy'); } if ($request->isMethod('post')) { $this->form->bind($request->getParameter($this->form->getName())); if ($this->form->isValid()) { $this->vacancyId = $this->form->save(); $this->getUser()->setFlash('success', __(TopLevelMessages::SAVE_SUCCESS)); $this->redirect('recruitment/addJobVacancy?Id=' . $this->vacancyId); } } }
/** * * @param <type> $request */ public function execute($request) { $this->setForm(new CopyActivityForm()); $projectId = $request->getParameter('projectId'); $this->form->bind($request->getParameter($this->form->getName())); $projectActivityList = $this->getProjectService()->getActivityListByProjectId($projectId); if ($this->form->isValid()) { $activityNameList = $request->getParameter('activityNames', array()); $activities = new Doctrine_Collection('ProjectActivity'); $isUnique = true; foreach ($activityNameList as $activityName) { foreach ($projectActivityList as $projectActivity) { if (strtolower($activityName) == strtolower($projectActivity->getName())) { $isUnique = false; break; } } } if ($isUnique) { foreach ($activityNameList as $activityName) { $activity = new ProjectActivity(); $activity->setProjectId($projectId); $activity->setName($activityName); $activity->setIsDeleted(ProjectActivity::ACTIVE_PROJECT); $activities->add($activity); } $activities->save(); $this->getUser()->setFlash('templateMessageAct', array('success', __('Successfully Copied'))); } else { $this->getUser()->setFlash('templateMessageAct', array('failure', __('Name Already Exists'))); } $this->redirect('admin/saveProject?projectId=' . $projectId); } }
/** * * @param <type> $request */ public function execute($request) { $usrObj = $this->getUser()->getAttribute('user'); if (!$usrObj->isAdmin()) { $this->redirect('pim/viewPersonalDetails'); } $customerId = $request->getParameter('customerId'); $isPaging = $request->getParameter('pageNo'); $sortField = $request->getParameter('sortField'); $sortOrder = $request->getParameter('sortOrder'); $pageNumber = $isPaging; if ($customerId > 0 && $this->getUser()->hasAttribute('pageNumber')) { $pageNumber = $this->getUser()->getAttribute('pageNumber'); } if ($this->getUser()->getAttribute('addScreen') && $this->getUser()->hasAttribute('pageNumber')) { $pageNumber = $this->getUser()->getAttribute('pageNumber'); } $noOfRecords = Customer::NO_OF_RECORDS_PER_PAGE; $offset = $pageNumber >= 1 ? ($pageNumber - 1) * $noOfRecords : ($request->getParameter('pageNo', 1) - 1) * $noOfRecords; $customerList = $this->getCustomerService()->getCustomerList($noOfRecords, $offset, $sortField, $sortOrder); $this->_setListComponent($customerList, $noOfRecords, $pageNumber); $this->getUser()->setAttribute('pageNumber', $pageNumber); $params = array(); $this->parmetersForListCompoment = $params; if ($this->getUser()->hasFlash('templateMessage')) { list($this->messageType, $this->message) = $this->getUser()->getFlash('templateMessage'); } }
/** * * @param <type> $request */ public function execute($request) { $form = new DefaultListForm(array(), array(), true); $form->bind($request->getParameter($form->getName())); $toBeDeletedUserIds = $request->getParameter('chkSelectRow'); if (!empty($toBeDeletedUserIds)) { if ($form->isValid()) { $accessibleIds = $this->getContext()->getUserRoleManager()->getAccessibleEntityIds('SystemUser'); $delete = true; foreach ($toBeDeletedUserIds as $id) { if (!in_array($id, $accessibleIds)) { $delete = false; break; } } if (!$delete) { $this->forward(sfConfig::get('sf_secure_module'), sfConfig::get('sf_secure_action')); } $this->getSystemUserService()->deleteSystemUsers($toBeDeletedUserIds); $this->getUser()->setFlash('success', __(TopLevelMessages::DELETE_SUCCESS)); } } else { $this->getUser()->setFlash('warning', __(TopLevelMessages::SELECT_RECORDS)); } $this->redirect('admin/viewSystemUsers'); }
/** * * @param <type> $request */ public function execute($request) { /* For highlighting corresponding menu item */ $request->setParameter('initialActionName', 'viewJobVacancy'); $this->vacancyPermissions = $this->getDataGroupPermissions('recruitment_vacancies'); $this->vacancyId = $request->getParameter('Id'); $values = array('vacancyId' => $this->vacancyId, 'vacancyPermissions' => $this->vacancyPermissions); $this->setForm(new AddJobVacancyForm(array(), $values)); if ($this->getUser()->hasFlash('templateMessage')) { list($this->messageType, $this->message) = $this->getUser()->getFlash('templateMessage'); MessageRegistry::instance()->addMessage($this->message, 'recruitment', 'addJobVacancy', MessageRegistry::PREPEND); $this->message = MessageRegistry::instance()->getMessage('recruitment', 'addJobVacancy'); } if ($request->isMethod('post')) { if ($this->vacancyPermissions->canCreate() || $this->vacancyPermissions->canUpdate()) { $this->form->bind($request->getParameter($this->form->getName())); if ($this->form->isValid()) { $this->vacancyId = $this->form->save(); $this->getUser()->setFlash('success', __(TopLevelMessages::SAVE_SUCCESS)); $this->redirect('recruitment/addJobVacancy?Id=' . $this->vacancyId); } else { Logger::getLogger('recruitment.addJobVacancy')->error($this->form); $this->getUser()->setFlash('warning', __(TopLevelMessages::SAVE_FAILURE), false); } } } }
/** * * @param <type> $request */ public function execute($request) { $toBeDeletedProjectIds = $request->getParameter('chkSelectRow'); $projectPermissions = $this->getDataGroupPermissions('time_projects'); if ($projectPermissions->canDelete()) { $form = new DefaultListForm(); $form->bind($request->getParameter($form->getName())); if ($form->isValid()) { if (!empty($toBeDeletedProjectIds)) { $delete = true; foreach ($toBeDeletedProjectIds as $toBeDeletedProjectId) { $deletable = $this->getProjectService()->hasProjectGotTimesheetItems($toBeDeletedProjectId); if ($deletable) { $delete = false; break; } } if ($delete) { foreach ($toBeDeletedProjectIds as $toBeDeletedProjectId) { $customer = $this->getProjectService()->deleteProject($toBeDeletedProjectId); } $this->getUser()->setFlash('success', __(TopLevelMessages::DELETE_SUCCESS)); } else { $this->getUser()->setFlash('error', __('Not Allowed to Delete Project(s) Which Have Time Logged Against Them')); } } } $this->redirect('admin/viewProjects'); } }
/** * * @param <type> $request */ public function execute($request) { $usrObj = $this->getUser()->getAttribute('user'); $this->customerPermissions = $this->getDataGroupPermissions('time_customers'); $customerId = $request->getParameter('customerId'); $isPaging = $request->getParameter('pageNo'); $sortField = $request->getParameter('sortField'); $sortOrder = $request->getParameter('sortOrder'); $pageNumber = $isPaging; if ($customerId > 0 && $this->getUser()->hasAttribute('pageNumber')) { $pageNumber = $this->getUser()->getAttribute('pageNumber'); } if ($this->getUser()->getAttribute('addScreen') && $this->getUser()->hasAttribute('pageNumber')) { $pageNumber = $this->getUser()->getAttribute('pageNumber'); } if ($this->customerPermissions->canRead()) { $noOfRecords = Customer::NO_OF_RECORDS_PER_PAGE; $offset = $pageNumber >= 1 ? ($pageNumber - 1) * $noOfRecords : ($request->getParameter('pageNo', 1) - 1) * $noOfRecords; $customerList = $this->getCustomerService()->getCustomerList($noOfRecords, $offset, $sortField, $sortOrder); $this->_setListComponent($customerList, $noOfRecords, $pageNumber, $this->customerPermissions); $this->getUser()->setAttribute('pageNumber', $pageNumber); $params = array(); $this->parmetersForListCompoment = $params; } }
/** * * @param <type> $request */ public function execute($request) { $usrObj = $this->getUser()->getAttribute('user'); if (!$usrObj->isAdmin()) { $this->redirect('recruitment/viewCandidates'); } $allowedVacancyList = $usrObj->getAllowedVacancyList(); $isPaging = $request->getParameter('pageNo'); $vacancyId = $request->getParameter('vacancyId'); $pageNumber = $isPaging; if (!is_null($this->getUser()->getAttribute('vacancyPageNumber')) && !($pageNumber >= 1)) { $pageNumber = $this->getUser()->getAttribute('vacancyPageNumber'); } $this->getUser()->setAttribute('vacancyPageNumber', $pageNumber); $sortField = $request->getParameter('sortField'); $sortOrder = $request->getParameter('sortOrder'); $noOfRecords = JobVacancy::NUMBER_OF_RECORDS_PER_PAGE; $offset = $pageNumber >= 1 ? ($pageNumber - 1) * $noOfRecords : ($request->getParameter('pageNo', 1) - 1) * $noOfRecords; $param = array('allowedVacancyList' => $allowedVacancyList); $this->setForm(new ViewJobVacancyForm(array(), $param, true)); $srchParams = array('jobTitle' => "", 'jobVacancy' => "", 'hiringManager' => "", 'status' => ""); $srchParams['noOfRecords'] = $noOfRecords; $srchParams['offset'] = $offset; if (!empty($sortField) && !empty($sortOrder) || $vacancyId > 0 || $isPaging > 0) { if ($this->getUser()->hasAttribute('searchParameters')) { $srchParams = $this->getUser()->getAttribute('searchParameters'); $this->form->setDefaultDataToWidgets($srchParams); } $srchParams['orderField'] = $sortField; $srchParams['orderBy'] = $sortOrder; } else { $this->getUser()->setAttribute('searchParameters', $srchParams); } list($this->messageType, $this->message) = $this->getUser()->getFlash('vacancyDeletionMessageItems'); $srchParams['offset'] = $offset; $vacancyList = $this->getVacancyService()->searchVacancies($srchParams); $this->_setListComponent($vacancyList, $noOfRecords, $srchParams, $pageNumber); $params = array(); $this->parmetersForListCompoment = $params; if (empty($isPaging)) { if ($request->isMethod('post')) { $pageNumber = 1; $this->getUser()->setAttribute('vacancyPageNumber', $pageNumber); $this->form->bind($request->getParameter($this->form->getName())); if ($this->form->isValid()) { $srchParams = $this->form->getSearchParamsBindwithFormData(); $srchParams['noOfRecords'] = $noOfRecords; $srchParams['offset'] = 0; $this->getUser()->setAttribute('searchParameters', $srchParams); $vacancyList = $this->getVacancyService()->searchVacancies($srchParams); $this->_setListComponent($vacancyList, $noOfRecords, $srchParams, $pageNumber); } } } }
/** * * @param <type> $request */ public function execute($request) { $param = null; $this->candidateId = null; $this->vacancyId = $request->getParameter('id'); //$this->candidateId = $request->getParameter('candidateId'); $this->getResponse()->setTitle(__("Vacancy Apply Form")); //$param = array('candidateId' => $this->candidateId); $this->setForm(new ApplyVacancyForm(array(), $param, true)); if ($this->getUser()->hasFlash('templateMessage')) { list($this->messageType, $this->message) = $this->getUser()->getFlash('templateMessage'); } if (!empty($this->vacancyId)) { $vacancy = $this->getVacancyService()->getVacancyById($this->vacancyId); if (empty($vacancy)) { $this->redirect('recruitmentApply/jobs.html'); } $this->description = $vacancy->getDescription(); $this->name = $vacancy->getName(); } else { $this->redirect('recruitmentApply/jobs.html'); } if ($request->isMethod('post')) { $this->form->bind($request->getParameter($this->form->getName()), $request->getFiles($this->form->getName())); $file = $request->getFiles($this->form->getName()); if ($_FILES['addCandidate']['size']['resume'] > 1024000) { $this->templateMessage = array('WARNING', __(TopLevelMessages::FILE_SIZE_SAVE_FAILURE)); } else { if ($_FILES == null) { $this->getUser()->setFlash('templateMessage', array('warning', __(TopLevelMessages::FILE_SIZE_SAVE_FAILURE))); $this->redirect('recruitmentApply/applyVacancy?id=' . $this->vacancyId); } else { if ($this->form->isValid()) { $result = $this->form->save(); if (isset($result['messageType'])) { $this->messageType = $result['messageType']; $this->message = $result['message']; } else { $this->candidateId = $result['candidateId']; if (!empty($this->candidateId)) { $this->messageType = 'success'; $this->message = __('Application Received'); } //$this->getUser()->setFlash('templateMessage', array('success', __('Your Application for the Position of ' . $this->name . ' Was Received'))); //$this->redirect('recruitmentApply/applyVacancy?id=' . $this->vacancyId . '&candidateId=' . $this->form->candidateId); } } } } } }
/** * * @param <type> $request */ public function execute($request) { $vacancyPermissions = $this->getDataGroupPermissions('recruitment_vacancies'); if ($vacancyPermissions->canDelete()) { $form = new DefaultListForm(array(), array(), true); $form->bind($request->getParameter($form->getName())); if ($form->isValid()) { $toBeDeletedVacancyIds = $request->getParameter('chkSelectRow'); $isDeletionSucceeded = $this->getVacancyService()->deleteVacancies($toBeDeletedVacancyIds); $this->getUser()->setFlash('success', __(TopLevelMessages::DELETE_SUCCESS)); } } $this->redirect('recruitment/viewJobVacancy'); }
/** * * @param <type> $request */ public function execute($request) { $param = null; $this->candidateId = null; $this->vacancyId = $request->getParameter('id'); //$this->candidateId = $request->getParameter('candidateId'); $this->getResponse()->setTitle(__("Vacancy Apply Form")); //$param = array('candidateId' => $this->candidateId); $this->setForm(new ApplyVacancyForm(array(), $param, true)); if (!empty($this->vacancyId)) { $vacancy = $this->getVacancyService()->getVacancyById($this->vacancyId); if (empty($vacancy)) { $this->redirect('recruitmentApply/jobs.html'); } $this->description = $vacancy->getDescription(); $this->name = $vacancy->getName(); } else { $this->redirect('recruitmentApply/jobs.html'); } if ($request->isMethod('post')) { $this->form->bind($request->getParameter($this->form->getName()), $request->getFiles($this->form->getName())); $file = $request->getFiles($this->form->getName()); if ($_FILES['addCandidate']['size']['resume'] > 1024000) { $this->getUser()->setFlash('applyVacancy.warning', __(TopLevelMessages::FILE_SIZE_SAVE_FAILURE)); } else { if ($_FILES == null) { $this->getUser()->setFlash('applyVacancy.warning', __(TopLevelMessages::FILE_SIZE_SAVE_FAILURE)); $this->redirect('recruitmentApply/applyVacancy?id=' . $this->vacancyId); } else { if ($this->form->isValid()) { $result = $this->form->save(); if (isset($result['messageType'])) { $this->getUser()->setFlash('applyVacancy.' . $result['messageType'], $result['message']); } else { $this->candidateId = $result['candidateId']; if (!empty($this->candidateId)) { $this->getUser()->setFlash('applyVacancy.success', __('Application Received')); $this->getUser()->setFlash('applyVacancy.warning', null); // Send a confirmation e-mail to the applicant and notification to the hiring manager. $logger = Logger::getLogger('recruitment.applyvacancy'); $logger->info('Application recieved'); $eventData = array('vacancy' => $vacancy, 'candidateId' => $this->candidateId); $this->getDispatcher()->notify(new sfEvent($this, RecruitmentEvents::RECRUITMENT_APPLY, $eventData)); } } } } } } }
/** * * @param <type> $request * @return <type> */ public function execute($request) { $this->setLayout(false); sfConfig::set('sf_web_debug', false); sfConfig::set('sf_debug', false); if ($this->getRequest()->isXmlHttpRequest()) { $this->getResponse()->setHttpHeader('Content-Type', 'application/json; charset=utf-8'); } $curId = $request->getParameter('curId'); $payGradeId = $request->getParameter('payGradeId'); $service = new PayGradeService(); $status = $service->getCurrencyByCurrencyIdAndPayGradeId($curId, $payGradeId); return $this->renderText(json_encode($status->toArray())); }
/** * * @param <type> $request * @return <type> */ public function execute($request) { $this->setLayout(false); sfConfig::set('sf_web_debug', false); sfConfig::set('sf_debug', false); if ($this->getRequest()->isXmlHttpRequest()) { $this->getResponse()->setHttpHeader('Content-Type', 'application/json; charset=utf-8'); } $systemUser = $request->getParameter('systemUser'); $userId = $request->getParameter('user_id'); $systemUserService = new SystemUserService(); $user = $systemUserService->isExistingSystemUser($systemUser['userName'], $userId); $isExisting = $user instanceof SystemUser ? false : true; return $this->renderText(json_encode($isExisting)); }
/** * * @param <type> $request */ public function execute($request) { /* For highlighting corresponding menu item */ $request->setParameter('initialActionName', 'viewCandidates'); $usrObj = $this->getUser()->getAttribute('user'); $allowedCandidateList = $usrObj->getAllowedCandidateList(); $allowedVacancyList = $usrObj->getAllowedVacancyList(); $empNumber = $usrObj->getEmployeeNumber(); if ($this->getUser()->hasFlash('templateMessage')) { list($this->messageType, $this->message) = $this->getUser()->getFlash('templateMessage'); } $this->historyId = $request->getParameter('historyId'); $this->interviewId = $request->getParameter('interviewId'); $candidateVacancyId = $request->getParameter('candidateVacancyId'); $selectedAction = $request->getParameter('selectedAction'); $this->editHiringManager = true; $param = array(); if ($candidateVacancyId > 0 && $selectedAction != "") { $interviewHistory = $this->getJobInterviewService()->getInterviewScheduledHistoryByInterviewId($this->interviewId); $param = array('interviewId' => $this->interviewId, 'candidateVacancyId' => $candidateVacancyId, 'selectedAction' => $selectedAction, 'historyId' => !empty($interviewHistory) ? $interviewHistory->getId() : null); } if (!empty($this->historyId) && !empty($this->interviewId)) { $history = $this->getCandidateService()->getCandidateHistoryById($this->historyId); $candidateVacancyId = $this->getCandidateService()->getCandidateVacancyByCandidateIdAndVacancyId($history->getCandidateId(), $history->getVacancyId()); $selectedAction = $history->getAction(); $param = array('id' => $this->interviewId, 'candidateVacancyId' => $candidateVacancyId, 'selectedAction' => $selectedAction); } if (!$this->getCandidateService()->isHiringManager($candidateVacancyId, $empNumber) && $this->getCandidateService()->isInterviewer($candidateVacancyId, $empNumber)) { $this->editHiringManager = false; } // $lastAction = $this->getCandidateService()->getLastPerformedActionByCandidateVAcancyId($candidateVacancyId); $this->setForm(new JobInterviewForm(array(), $param, true)); if (!in_array($this->form->candidateId, $allowedCandidateList) && !in_array($this->form->vacancyId, $allowedVacancyList)) { $this->redirect('recruitment/viewCandidates'); } if ($request->isMethod('post')) { $this->form->bind($request->getParameter($this->form->getName())); if ($this->form->isValid()) { $result = $this->form->save(); if (isset($result['messageType'])) { $this->getUser()->setFlash('templateMessage', array($result['messageType'], $result['message'])); } else { $this->getUser()->setFlash('templateMessage', array('success', __('Successfully Scheduled'))); } $this->redirect('recruitment/changeCandidateVacancyStatus?id=' . $this->form->historyId); } } }
/** * * @param <type> $request * @return <type> */ public function execute($request) { $allowedVacancyList = $this->getUser()->getAttribute('user')->getAllowedVacancyList(); $this->setLayout(false); sfConfig::set('sf_web_debug', false); sfConfig::set('sf_debug', false); $hiringManagerList = array(); if ($this->getRequest()->isXmlHttpRequest()) { $this->getResponse()->setHttpHeader('Content-Type', 'application/json; charset=utf-8'); } $jobTitle = $request->getParameter('jobTitle'); $vacancyId = $request->getParameter('vacancyId'); $vacancyService = new VacancyService(); $hiringManagerList = $vacancyService->getHiringManagersList($jobTitle, $vacancyId, $allowedVacancyList); return $this->renderText(json_encode($hiringManagerList)); }
/** * * @param <type> $request */ public function execute($request) { $toBeDeletedVacancyIds = $request->getParameter('chkSelectRow'); $isDeletionSucceeded = $this->getVacancyService()->deleteVacancies($toBeDeletedVacancyIds); $this->getUser()->setFlash('vacancyDeletionMessageItems', array('success', __(TopLevelMessages::DELETE_SUCCESS))); $this->redirect('recruitment/viewJobVacancy'); }
/** * * @param <type> $request */ public function execute($request) { $candidateId = $request->getParameter('candidateId'); //print($candidateId);die; //$timeList = $this->getJobInterviewService(); //$dao = new CandidateDao(); //print_r(count($dao->getCandidateById($candidateId)->getJobCandidateVacancy()));die; $service = new JobInterviewService(); // $service->getInterviewListByCandidateIdAndInterviewDateAndTime(1, '2011-08-10', '10:30:00'); // $allowedVacancyList = $this->getUser()->getAttribute('user')->getAllowedVacancyList(); // // $this->setLayout(false); // sfConfig::set('sf_web_debug', false); // sfConfig::set('sf_debug', false); // // $vacancyList = array(); // // if ($this->getRequest()->isXmlHttpRequest()) { // $this->getResponse()->setHttpHeader('Content-Type', 'application/json; charset=utf-8'); // } // // $jobTitle = $request->getParameter('jobTitle'); // // $vacancyService = new VacancyService(); // $vacancyList = $vacancyService->getVacancyListForJobTitle($jobTitle, $allowedVacancyList, true); // $newVacancyList = array(); // foreach ($vacancyList as $vacancy) { // if ($vacancy['status'] == JobVacancy::CLOSED) { // $vacancy['name'] = $vacancy['name'] . " (Closed)"; // } // $newVacancyList[] = $vacancy; // } // return $this->renderText(json_encode($newVacancyList)); }
/** * * @param <type> $request * @return <type> */ public function execute($request) { // this should probably be kept in session? $attachId = $request->getParameter('attachId'); $recruitmentAttachmentService = $this->getRecruitmentAttachmentService(); $attachment = $recruitmentAttachmentService->getCandidateAttachment($attachId); $response = $this->getResponse(); if (!empty($attachment)) { $contents = $attachment->getFileContent(); $contentType = $attachment->getAttachmentType(); $fileName = $attachment->getFileName(); $fileLength = $attachment->getFileSize(); $response->setHttpHeader('Pragma', 'public'); $response->setHttpHeader('Expires', '0'); $response->setHttpHeader("Cache-Control", "must-revalidate, post-check=0, pre-check=0, max-age=0"); $response->setHttpHeader("Cache-Control", "private", false); $response->setHttpHeader("Content-Type", $contentType); $response->setHttpHeader("Content-Disposition", 'attachment; filename="' . $fileName . '";'); $response->setHttpHeader("Content-Transfer-Encoding", "binary"); $response->setHttpHeader("Content-Length", $fileLength); $response->setContent($contents); $response->send(); } else { $response->setStatusCode(404, 'This attachment does not exist'); } return sfView::NONE; }
/** * execute function * @param <type> $request */ public function execute($request) { $this->setForm(new LocalizationForm()); $languages = $this->getRequest()->getLanguages(); $this->browserLanguage = $languages[0]; if ($request->isMethod('post')) { $this->form->bind($request->getParameter($this->form->getName())); if ($this->form->isValid()) { // For reloading main menu (index.php) $_SESSION['load.admin.localization'] = true; $formValues = $this->form->getFormValues(); $defaultLanguage = $formValues['defaultLanguage']; $setBrowserLanguage = !empty($formValues['setBrowserLanguage']) ? "Yes" : "No"; $supprotedLanguages = $this->form->getLanguages(); if ($setBrowserLanguage == "Yes" && in_array($languages[0], $supprotedLanguages)) { $defaultLanguage = $languages[0]; } $this->getUser()->setCulture($defaultLanguage); $this->getConfigService()->setAdminLocalizationDefaultLanguage($formValues['defaultLanguage']); $this->getConfigService()->setAdminLocalizationUseBrowserLanguage($setBrowserLanguage); $this->getUser()->setDateFormat($formValues['defaultDateFormat']); $this->getConfigService()->setAdminLocalizationDefaultDateFormat($formValues['defaultDateFormat']); $this->getUser()->setFlash('success', __(TopLevelMessages::SAVE_SUCCESS)); } $this->redirect("admin/localization"); } }
/** * * @param <type> $request */ public function execute($request) { $payGradeId = $request->getParameter('payGradeId'); $this->form = new DeletePayGradeCurrenciesForm(); $this->form->bind($request->getParameter($this->form->getName())); if ($this->form->isValid()) { $currenciesToDelete = $request->getParameter('delCurrencies', array()); if ($currenciesToDelete) { for ($i = 0; $i < sizeof($currenciesToDelete); $i++) { $currency = $this->getPayGradeService()->getCurrencyByCurrencyIdAndPayGradeId($currenciesToDelete[$i], $payGradeId); $currency->delete(); } } $this->getUser()->setFlash('success', __(TopLevelMessages::DELETE_SUCCESS)); } $this->redirect('admin/payGrade?payGradeId=' . $payGradeId . '#Currencies'); }
/** * * @param <type> $request * @return <type> */ public function execute($request) { $this->setLayout(false); sfConfig::set('sf_web_debug', false); sfConfig::set('sf_debug', false); if ($this->getRequest()->isXmlHttpRequest()) { $this->getResponse()->setHttpHeader('Content-Type', 'application/json; charset=utf-8'); } $customerName = $request->getParameter('customerName'); $description = $request->getParameter('description'); $customer = new Customer(); $customer->setName($customerName); $customer->setDescription($description); $customer->save(); $array = array('id' => $customer->getCustomerId()); return $this->renderText(json_encode($array)); }
/** * * @param <type> $request * @return <type> */ public function execute($request) { $this->setLayout(false); sfConfig::set('sf_web_debug', false); sfConfig::set('sf_debug', false); $userRoleManager = $this->getContext()->getUserRoleManager(); $mode = $request->getParameter('mode'); $dataGroupName = $mode == getVacancyListForJobTitleJsonAction::MODE_CANDIDATES ? 'recruitment_candidates' : 'recruitment_vacancies'; $requiredPermissions = array(BasicUserRoleManager::PERMISSION_TYPE_DATA_GROUP => array($dataGroupName => new ResourcePermission(true, false, false, false))); $allowedVacancyList = $userRoleManager->getAccessibleEntityIds('Vacancy', null, null, array(), array(), $requiredPermissions); if ($this->getRequest()->isXmlHttpRequest()) { $this->getResponse()->setHttpHeader('Content-Type', 'application/json; charset=utf-8'); } $jobTitle = $request->getParameter('jobTitle'); $vacancyId = $request->getParameter('vacancyId'); $vacancyService = new VacancyService(); $hiringManagerList = $vacancyService->getHiringManagersList($jobTitle, $vacancyId, $allowedVacancyList); return $this->renderText(json_encode($hiringManagerList)); }
/** * * @param <type> $request */ public function execute($request) { $screen = $request->getParameter('screen'); $param = array('screen' => $screen); $this->form = new RecruitmentAttachmentDeleteForm(array(), $param, true); $this->form->bind($request->getParameter($this->form->getName())); if ($this->form->isValid()) { $attachmentsToDelete = $request->getParameter('delAttachments', array()); if ($attachmentsToDelete) { for ($i = 0; $i < sizeof($attachmentsToDelete); $i++) { $service = new RecruitmentAttachmentService(); $attachment = $service->getAttachment($attachmentsToDelete[$i], $this->form->screen); $attachment->delete(); } $this->getUser()->setFlash('attachmentMessage', array('success', __(TopLevelMessages::DELETE_SUCCESS))); } } $this->redirect($this->getRequest()->getReferer() . '#attachments'); }
/** * * @param <type> $request */ public function execute($request) { $screen = $request->getParameter('screen'); $param = array('screen' => $screen); $this->form = new RecruitmentAttachmentForm(array(), $param, true); if ($this->getRequest()->isMethod('post')) { if ($_FILES['recruitmentAttachment']['size']['ufile'] > 1024000 || $_FILES == null) { $this->getUser()->setFlash('attachmentMessage', array('warning', __(TopLevelMessages::FILE_SIZE_SAVE_FAILURE))); $this->redirect($this->getRequest()->getReferer() . '#attachments'); } // Handle the form submission $this->form->bind($request->getParameter($this->form->getName()), $request->getFiles($this->form->getName())); if ($this->form->isValid()) { $this->form->save(); $this->getUser()->setFlash('attachmentMessage', array('success', __(TopLevelMessages::SAVE_SUCCESS))); } } $this->redirect($this->getRequest()->getReferer() . '#attachments'); }
/** * * @param <type> $request */ public function execute($request) { $toBeDeletedUserIds = $request->getParameter('chkSelectRow'); if (!empty($toBeDeletedUserIds)) { $delete = true; $this->getSystemUserService()->deleteSystemUsers($toBeDeletedUserIds); $this->getUser()->setFlash('templateMessage', array('success', __(TopLevelMessages::DELETE_SUCCESS))); } else { $this->getUser()->setFlash('templateMessage', array('warning', __(TopLevelMessages::SELECT_RECORDS))); } $this->redirect('admin/viewSystemUsers'); }
/** * * @param <type> $request * @return <type> */ public function execute($request) { $this->setLayout(false); sfConfig::set('sf_web_debug', false); sfConfig::set('sf_debug', false); if ($this->getRequest()->isXmlHttpRequest()) { $this->getResponse()->setHttpHeader('Content-Type', 'application/json; charset=utf-8'); } $jobCatId = $request->getParameter('id'); $service = new JobCategoryService(); $status = $service->getJobCategoryById($jobCatId); return $this->renderText(json_encode($status->toArray())); }
/** * * @param <type> $request * @return <type> */ public function execute($request) { $this->setLayout(false); sfConfig::set('sf_web_debug', false); sfConfig::set('sf_debug', false); $csrfToken = $request->getParameter('csrfToken'); $form = new TimesheetFormToImplementCsrfTokens(); if ($form->getCSRFToken() != $csrfToken) { return sfView::NONE; } if ($this->getRequest()->isXmlHttpRequest()) { $this->getResponse()->setHttpHeader('Content-Type', 'application/json; charset=utf-8'); } $customerName = $request->getParameter('customerName'); $description = $request->getParameter('description'); $customer = new Customer(); $customer->setName($customerName); $customer->setDescription($description); $customer->save(); $array = array('id' => $customer->getCustomerId()); return $this->renderText(json_encode($array)); }
/** * * @param <type> $request * @return <type> */ public function execute($request) { sfConfig::set('sf_web_debug', false); sfConfig::set('sf_debug', false); $isValidEntitlement = true; if ($this->getRequest()->isXmlHttpRequest()) { $this->getResponse()->setHttpHeader('Content-Type', 'application/json; charset=utf-8'); } $id = $request->getParameter('id'); if ($id > 0) { $entitlementValue = $request->getParameter('entitlements'); $entitlmentService = new LeaveEntitlementService(); $entitlment = $entitlmentService->getLeaveEntitlement($id); if ($entitlment->getDaysUsed() > $entitlementValue['entitlement']) { $isValidEntitlement = false; } } $response = $this->getResponse(); $response->setHttpHeader('Expires', '0'); $response->setHttpHeader("Cache-Control", "must-revalidate, post-check=0, pre-check=0, max-age=0"); $response->setHttpHeader("Cache-Control", "private", false); return $this->renderText(json_encode($isValidEntitlement)); }