コード例 #1
0
 public function getCurrencyList()
 {
     $service = new PayGradeService();
     $currencyList = $service->getCurrencyListByPayGradeId($this->getId());
     $temp = array();
     foreach ($currencyList as $currency) {
         $temp[] = __($currency->getCurrencyType()->getCurrencyName());
     }
     return implode(',', $temp);
 }
コード例 #2
0
 /**
  * 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;
 }
コード例 #3
0
 /**
  *
  * @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()));
 }
コード例 #4
0
 /**
  * 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));
 }