public function getCurrencyList() { $service = new PayGradeService(); $currencyList = $service->getCurrencyListByPayGradeId($this->getId()); $temp = array(); foreach ($currencyList as $currency) { $temp[] = __($currency->getCurrencyType()->getCurrencyName()); } return implode(',', $temp); }
/** * Gets all pay grades. * @return string[] $payGrades */ private function _getPayGrades() { $choices = array(); $service = new PayGradeService(); $payGrades = $service->getPayGradeList(); $choices = array('' => '-- ' . __('Select') . ' --'); foreach ($payGrades as $payGrade) { $choices[$payGrade->getId()] = $payGrade->getName(); } return $choices; }
/** * * @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())); }
/** * Get Min and Max salary for given salary grade and currency * * @param sfWebRequest $request * @return JSON formatted JobSpec object */ public function execute($request) { $this->setLayout(false); sfConfig::set('sf_web_debug', false); sfConfig::set('sf_debug', false); $salaryGrade = $request->getParameter('salaryGrade'); $currency = $request->getParameter('currency'); $minMax = array(); if ($this->getRequest()->isXmlHttpRequest()) { $this->getResponse()->setHttpHeader('Content-Type', 'application/json; charset=utf-8'); } if (!empty($salaryGrade) && !empty($currency)) { $service = new PayGradeService(); $salaryCurrency = $service->getCurrencyByCurrencyIdAndPayGradeId($currency, $salaryGrade); if ($salaryCurrency) { $minMax = array('min' => $salaryCurrency->minSalary, 'max' => $salaryCurrency->maxSalary); } } return $this->renderText(json_encode($minMax)); }