示例#1
0
 public function executeDelete()
 {
     $employee_job_history = EmployeeJobHistoryPeer::retrieveByPk($this->getRequestParameter('id'));
     $this->forward404Unless($employee_job_history);
     $employee_id = $employee_job_history->getEmployeeId();
     $ref_error = 0;
     foreach ($employee_job_history->getRefCountMethods() as $ref) {
         $method = "count" . $ref['affix'];
         $count = $employee_job_history->{$method}();
         if ($count > 0) {
             ++$ref_error;
             $this->getRequest()->setError('employee_job_history_o/delete/' . sfInflector::camelize($ref['table']), $count);
         }
     }
     if ($ref_error > 0) {
         $this->getRequest()->setError('employee_job_history_o/delete', '_ERR_DELETE_ (' . $employee_job_history->toString() . ' - id:' . $employee_job_history->getId() . ')');
     } else {
         $employee_job_history->delete();
     }
     return $this->redirect('employee_job_history_o/list');
 }
示例#2
0
 public function executeShowJob()
 {
     $employee_job_history = EmployeeJobHistoryPeer::retrieveByPk($this->getRequestParameter('id'));
     $this->forward404Unless($employee_job_history);
     $this->subtitle = $employee_job_history->toString() . ' - id:' . $employee_job_history->getId();
     $academic_calendar_id = $this->getRequestParameter('academic_calendar_id');
     $academic_calendar = AcademicCalendarPeer::retrieveByPK($academic_calendar_id);
     $this->forward404Unless($academic_calendar);
     $department_id = $this->getRequestParameter('department_id');
     $department = DepartmentPeer::retrieveByPK($department_id);
     $this->forward404Unless($department);
     $actions = array(array('name' => 'Kembali', 'url' => 'employee_report/listJob?academic_calendar_id=' . $academic_calendar->getId() . '&department_id=' . $department->getId(), 'color' => 'black'));
     $this->actions = $actions;
     $this->employee_job_history = $employee_job_history;
     $actions2 = array(array('name' => '<span>Rekap Kepegawaian</span>', 'url' => 'employee_report/list', 'color' => 'sky'));
     array_push($actions2, array('name' => '<span>Mutasi Jabatan</span>', 'url' => 'employee_report/listJob?academic_calendar_id=' . $academic_calendar->getId() . '&department_id=' . $department->getId(), 'color' => 'sun', 'type' => 'direct'));
     array_push($actions2, array('name' => '<span>Absensi Pegawai</span>', 'url' => 'employee_report/listAbsence?academic_calendar_id=' . $academic_calendar->getId() . '&department_id=' . $department->getId(), 'color' => 'sky'));
     array_push($actions2, array('name' => '<span>Absen Per Pegawai</span>', 'url' => 'employee_report/listAbsenceEmployee?academic_calendar_id=' . $academic_calendar->getId() . '&department_id=' . $department->getId(), 'color' => 'sky'));
     array_push($actions2, array('name' => '<span>Cuti Pegawai</span>', 'url' => 'employee_report/listLeave?academic_calendar_id=' . $academic_calendar->getId() . '&department_id=' . $department->getId(), 'color' => 'sky'));
     array_push($actions2, array('name' => '<span>Izin Pegawai</span>', 'url' => 'employee_report/listPermit?academic_calendar_id=' . $academic_calendar->getId() . '&department_id=' . $department->getId(), 'color' => 'sky'));
     array_push($actions2, array('name' => '<span>Pengobatan</span>', 'url' => 'employee_report/listMedical?academic_calendar_id=' . $academic_calendar->getId() . '&department_id=' . $department->getId(), 'color' => 'sky'));
     array_push($actions2, array('name' => '<span>Gaji Pegawai</span>', 'url' => 'employee_report/listSalary?academic_calendar_id=' . $academic_calendar->getId() . '&department_id=' . $department->getId(), 'color' => 'sky'));
     $this->actions2 = $actions2;
     $cd = new Criteria();
     $cd->add(EmployeeDetailPeer::EMPLOYEE_ID, $employee_job_history->getEmployeeId());
     $this->employee_detail = EmployeeDetailPeer::doSelectOne($cd);
     $this->academic_calendar = $academic_calendar;
     $this->department = $department;
 }