public function executeList() { $group_id = $this->getContext()->getUser()->getAttribute('group_id', null, 'bo'); $c = new Criteria(); $c->add(JobPeer::CODE, $this->getModuleName()); $job = JobPeer::doSelectOne($c); $acl = AclPeer::retrieveByPK($group_id, $job->getId()); if (!$acl) { $this->forward('default', 'error404'); } $this->can_add = $acl->getAddPriv() == 1; $this->can_edit = $acl->getEditPriv() == 1; $this->can_remove = $acl->getRemovePriv() == 1; $c = new Criteria(); $dept = $this->getContext()->getUser()->getAttribute('department', null, 'bo'); $c->add(AcademicCalendarPeer::DEPARTMENT_ID, $dept->getChildRecurs(), Criteria::IN); $filters = null; if ($this->getRequest()->hasParameter('filters')) { $filters = $this->getRequestParameter('filters'); if ($filters == 'clear') { $this->filters = null; } else { $defined_filter = false; foreach ($filters as $f) { if (is_array($f)) { if (strlen($f['from']) > 0 || strlen($f['to']) > 0) { $defined_filter = true; break; } } else { if ($f != null && $f != '') { $defined_filter = true; break; } } } if ($defined_filter) { $this->filters = $filters; $this->filter($c, $this->getRequestParameter('filters')); } } } $rpp = $this->getRequestParameter('max_per_page', 999); $pager = new sfPropelPager('AcademicCalendar', $rpp); $pager->setPeerMethod('doSelectOrdered'); $pager->setCriteria($c); $pager->setPage($this->getRequestParameter('page', 1)); $pager->init(); $this->pager = $pager; $actions = array(array('name' => 'filter', 'color' => 'white')); $filter_string = ""; if ($filters) { foreach ($filters as $key => $val) { $filter_string .= "&filters[{$key}]={$val}"; } $filter_string = preg_replace('/^&/', '', $filter_string); } $this->actions = $actions; }
public function executeList() { $group_id = $this->getContext()->getUser()->getAttribute('group_id', null, 'bo'); $c = new Criteria(); $c->add(JobPeer::CODE, $this->getModuleName()); $job = JobPeer::doSelectOne($c); $acl = AclPeer::retrieveByPK($group_id, $job->getId()); if (!$acl) { $this->forward('default', 'error404'); } $this->can_add = $acl->getAddPriv() == 1; $this->can_edit = $acl->getEditPriv() == 1; $this->can_remove = $acl->getRemovePriv() == 1; $dept = $this->getContext()->getUser()->getAttribute('department', null, 'bo'); $c = new Criteria(); $c->addAscendingOrderByColumn(CourseSchedulePeer::CLASS_GROUP_ID); $this->sort($c); if ($this->getRequest()->hasParameter('filters')) { $filters = $this->getRequestParameter('filters'); if ($filters == 'clear') { $this->filters = null; } else { $defined_filter = false; foreach ($filters as $f) { if (is_array($f)) { if (strlen($f['from']) > 0 || strlen($f['to']) > 0) { $defined_filter = true; break; } } else { if ($f != null && $f != '') { $defined_filter = true; break; } } } if ($defined_filter) { $this->filters = $filters; $this->filter($c, $this->getRequestParameter('filters')); } } } $rpp = $this->getRequestParameter('max_per_page', $this->getUser()->getAttribute('max_per_page', ParamsPeer::retrieveByCode('row_per_page')->getValue(), 'course')); $this->getUser()->setAttribute('max_per_page', $rpp, 'course'); $pager = new sfPropelPager('CourseSchedule', $rpp); $pager->setCriteria($c); $page = $this->getRequestParameter('page', $this->getUser()->getAttribute('page', 1, 'course')); $this->getUser()->setAttribute('page', $page, 'course'); $pager->setPage($page); $pager->init(); $this->pager = $pager; $actions = array(); $this->actions = $actions; $this->subtitle = $dept->getName(); $this->counseling = new Counseling(); $this->dept = $dept; }
public function executeList() { $group_id = $this->getContext()->getUser()->getAttribute('group_id', null, 'bo'); $c = new Criteria(); $c->add(JobPeer::CODE, $this->getModuleName()); $job = JobPeer::doSelectOne($c); $acl = AclPeer::retrieveByPK($group_id, $job->getId()); $this->can_add = $acl->getAddPriv() == 1; $this->can_edit = $acl->getEditPriv() == 1; $this->can_remove = $acl->getRemovePriv() == 1; $c = new Criteria(); $dept = $this->getContext()->getUser()->getAttribute('department', null, 'bo'); $c->add(ColLocationPeer::DEPARTMENT_ID, $dept->getChildRecurs(), Criteria::IN); $c->addJoin(ColItemPeer::COL_LOCATION_ID, ColLocationPeer::ID); $this->sort($c); if ($this->getRequest()->hasParameter('filters')) { $filters = $this->getRequestParameter('filters'); if ($filters == 'clear') { $this->filters = null; } else { $defined_filter = false; foreach ($filters as $f) { if ($f != null && $f != '') { $defined_filter = true; break; } } if ($defined_filter) { $this->filters = $filters; $this->filter($c, $this->getRequestParameter('filters')); } } } #$rpp = $this->getRequestParameter('max_per_page', $this->getUser()->getAttribute('max_per_page', ParamsPeer::retrieveByCode('row_per_page')->getValue(), 'col_item')); $this->getUser()->setAttribute('max_per_page', 12, 'col_item'); $pager = new sfPropelPager('ColItem', 12); $pager->setCriteria($c); $page = $this->getRequestParameter('page', $this->getUser()->getAttribute('page', 1, 'col_item')); $this->getUser()->setAttribute('page', $page, 'col_item'); $pager->setPage($page); $pager->init(); $this->pager = $pager; $filter_string = ""; if ($this->filters) { foreach ($this->filters as $key => $val) { $filter_string .= "&filters[{$key}]={$val}"; } $filter_string = preg_replace('/^&/', '', $filter_string); } $this->filter_string = $filter_string; $this->subtitle = ''; $actions = array(array('name' => 'cetak', 'type' => 'submit', 'options' => array('class' => 'save_button', 'onclick' => "action_type.value=this.value"))); $this->actions = $actions; $this->actions3 = array(); }
public function executeShowStudent() { $group_id = $this->getContext()->getUser()->getAttribute('group_id', null, 'bo'); $c = new Criteria(); $c->add(JobPeer::CODE, $this->getModuleName()); $job = JobPeer::doSelectOne($c); $acl = AclPeer::retrieveByPK($group_id, $job->getId()); if (!$acl) { $this->forward('default', 'error404'); } $subject = SubjectPeer::retrieveByPk($this->getRequestParameter('id')); $this->forward404Unless($subject); $this->subtitle = $subject->toString() . ' - id:' . $subject->getId(); $this->subject = $subject; }
public function executeList() { $group_id = $this->getContext()->getUser()->getAttribute('group_id', null, 'bo'); $c = new Criteria(); $c->add(JobPeer::CODE, $this->getModuleName()); $job = JobPeer::doSelectOne($c); $acl = AclPeer::retrieveByPK($group_id, $job->getId()); if (!$acl) { $this->forward('default', 'error404'); } $this->can_edit = $acl->getEditPriv() == 1; $this->can_remove = $acl->getRemovePriv() == 1; $actions = array(); $this->actions = $actions; $this->byEmployee = false; $this->subtitle = 'Riwayat Penilaian'; $this->counseling = new Counseling(); }
public function executeListByEmployee() { $group_id = $this->getContext()->getUser()->getAttribute('group_id', null, 'bo'); $c = new Criteria(); $c->add(JobPeer::CODE, 'counseling/listByEmployee'); $job = JobPeer::doSelectOne($c); $acl = AclPeer::retrieveByPK($group_id, $job->getId()); if (!$acl) { $this->forward('default', 'error404'); } $employee_id = sfContext::getInstance()->getUser()->getAttribute('user_id', null, 'bo'); $employee = EmployeePeer::retrieveByPK($employee_id); $this->forward404Unless($employee); $dept = $this->getContext()->getUser()->getAttribute('department_id', null, 'bo'); $actions = array(); $this->actions = $actions; $this->subtitle = $employee->toString(); $this->employee_id = $employee_id; $this->employee = $employee; $this->counseling = new Counseling(); }
public function executeEdit() { $group_id = $this->getContext()->getUser()->getAttribute('group_id', null, 'bo'); $c = new Criteria(); $c->add(JobPeer::CODE, $this->getModuleName()); $job = JobPeer::doSelectOne($c); $acl = AclPeer::retrieveByPK($group_id, $job->getId()); if (!$acl) { $this->forward('default', 'error404'); } $this->can_add = $acl->getAddPriv() == 1; $this->can_edit = $acl->getEditPriv() == 1; $this->can_remove = $acl->getRemovePriv() == 1; $payment_student = PaymentJournalPeer::retrieveByPk($this->getRequestParameter('id')); $this->forward404Unless($payment_student); $actions = array(array('name' => 'save', 'type' => 'submit', 'options' => array('class' => 'save_button', 'onclick' => "action_type.value=this.value"))); if ($acl->getRemovePriv()) { array_push($actions, array('name' => 'delete', 'url' => 'payment_student/delete?id=' . $payment_student->getId(), 'color' => 'red')); } array_push($actions, array('name' => 'cancel', 'url' => 'payment_student/list', 'color' => 'white')); $this->subtitle = $payment_student->toString() . ' - id:' . $payment_student->getId(); $this->type = 'edit'; $this->payment_student = $payment_student; $this->actions = $actions; $dept = sfContext::getInstance()->getUser()->getAttribute('department', null, 'bo'); $depts = $dept->getChildRecurs(array()); $this->academic_costs = array(); $c = new Criteria(); $c->add(AcademicCalendarPeer::DEPARTMENT_ID, $depts, Criteria::IN); $c->addJoin(AcademicCalendarPeer::ID, VAcademicCostPeer::ACADEMIC_CALENDAR_ID); $costs = VAcademicCostPeer::doSelect($c); foreach ($costs as $cost) { $academic_costs[$cost->getId()] = $cost->toStringCap(); } $this->academic_costs = $academic_costs; }
public function executeAchievement() { $group_id = $this->getContext()->getUser()->getAttribute('group_id', null, 'bo'); $c = new Criteria(); $c->add(JobPeer::CODE, $this->getModuleName()); $job = JobPeer::doSelectOne($c); $acl = AclPeer::retrieveByPK($group_id, $job->getId()); if (!$acl) { $this->forward('default', 'error404'); } $this->ng_test_applicant = NgTestApplicantPeer::retrieveByPk($this->getRequestParameter('id')); $this->forward404Unless($this->ng_test_applicant); $actions = array(array('name' => 'save', 'type' => 'submit', 'options' => array('class' => 'save_button', 'onclick' => "action_type.value=this.value"))); if ($acl->getRemovePriv()) { array_push($actions, array('name' => 'delete', 'url' => 'ng_test_applicant/delete?id=' . $this->ng_test_applicant->getId(), 'color' => 'red')); } array_push($actions, array('name' => 'cancel', 'url' => 'ng_test_applicant/list', 'color' => 'black')); $this->actions = $actions; $this->subtitle = $this->ng_test_applicant->getName() . ' - id:' . $this->ng_test_applicant->getId(); $this->type = 'edit'; $this->setTemplate('editPhase'); $this->tipe = 'achievement'; $this->title = 'Detail Prestasi'; $this->actions_url = 'ng_test_applicant/saveAchievement'; $this->tab_attr_tmpl = $this->getContext()->getModuleDirectory() . "/templates/tmplTabSuccess.php"; $actions2 = array(array('name' => 'TestApplicant', 'url' => 'ng_test_applicant/list', 'color' => 'sky')); array_push($actions2, array('name' => 'Identity Detail', 'url' => 'ng_test_applicant/edit?id=' . $this->ng_test_applicant->getId(), 'color' => 'sky')); array_push($actions2, array('name' => 'Education Detail', 'url' => 'ng_test_applicant/education?id=' . $this->ng_test_applicant->getId(), 'color' => 'sky')); array_push($actions2, array('name' => 'Parents Detail', 'url' => 'ng_test_applicant/parent?id=' . $this->ng_test_applicant->getId(), 'color' => 'sky')); array_push($actions2, array('name' => 'Home Detail', 'url' => 'ng_test_applicant/home?id=' . $this->ng_test_applicant->getId(), 'color' => 'sky')); array_push($actions2, array('name' => 'Medical Detail', 'url' => 'ng_test_applicant/medical?id=' . $this->ng_test_applicant->getId(), 'color' => 'sky')); array_push($actions2, array('name' => 'Talent Detail', 'url' => 'ng_test_applicant/talent?id=' . $this->ng_test_applicant->getId(), 'color' => 'sky')); array_push($actions2, array('name' => 'Achievement Detail', 'url' => 'ng_test_applicant/achievement?id=' . $this->ng_test_applicant->getId(), 'color' => 'sun', 'type' => 'direct')); $this->actions2 = $actions2; }
public function executeEdit() { $emp_id = $this->getRequestParameter('employee_id'); $emp = EmployeePeer::retrieveByPK($emp_id); $this->forward404Unless($emp); $this->employee = $emp; $group_id = $this->getContext()->getUser()->getAttribute('group_id', null, 'bo'); $c = new Criteria(); $c->add(JobPeer::CODE, $this->getModuleName()); $job = JobPeer::doSelectOne($c); $acl = AclPeer::retrieveByPK($group_id, $job->getId()); if (!$acl) { $this->forward('default', 'error404'); } $this->can_add = $acl->getAddPriv() == 1; $this->can_edit = $acl->getEditPriv() == 1; $this->can_remove = $acl->getRemovePriv() == 1; $teaching_competency = TeachingCompetencyPeer::retrieveByPk($this->getRequestParameter('id')); $this->forward404Unless($teaching_competency); $actions = array(array('name' => 'save', 'type' => 'submit', 'options' => array('class' => 'save_button', 'onclick' => "action_type.value=this.value"))); if ($acl->getRemovePriv()) { array_push($actions, array('name' => 'delete', 'url' => 'teaching_competency/delete?employee_id=' . $emp_id . '&id=' . $teaching_competency->getId(), 'color' => 'red')); } array_push($actions, array('name' => 'cancel', 'url' => 'teaching_competency/list?employee_id=' . $emp_id, 'color' => 'white')); $this->subtitle = $teaching_competency->toString() . ' - id:' . $teaching_competency->getId(); $this->type = 'edit'; $this->teaching_competency = $teaching_competency; $this->actions = $actions; }
public function executeEdit() { $group_id = $this->getContext()->getUser()->getAttribute('group_id', null, 'bo'); $c = new Criteria(); $c->add(JobPeer::CODE, $this->getModuleName()); $job = JobPeer::doSelectOne($c); $acl = AclPeer::retrieveByPK($group_id, $job->getId()); if (!$acl) { $this->forward('default', 'error404'); } $this->can_add = $acl->getAddPriv() == 1; $this->can_edit = $acl->getEditPriv() == 1; $this->can_remove = $acl->getRemovePriv() == 1; $cat_language = CatLanguagePeer::retrieveByPk($this->getRequestParameter('id')); $this->forward404Unless($cat_language); $actions = array(array('name' => 'save', 'type' => 'submit', 'options' => array('class' => 'save_button', 'onclick' => "action_type.value=this.value"))); // if ($acl->getAddPriv()) array_push($actions, array('name'=>'copy','type'=>'submit', 'options'=>array('class'=>'save_button', 'onclick'=>"action_type.value=this.value"))); if ($acl->getRemovePriv()) { array_push($actions, array('name' => 'delete', 'url' => 'cat_language/delete?id=' . $cat_language->getId(), 'color' => 'red')); } array_push($actions, array('name' => 'cancel', 'url' => 'cat_language/list', 'color' => 'black')); $this->subtitle = $cat_language->toString() . ' - id:' . $cat_language->getId(); $this->type = 'edit'; $this->cat_language = $cat_language; $this->actions = $actions; }
public function executeEdit() { $group_id = $this->getContext()->getUser()->getAttribute('group_id', null, 'bo'); $c = new Criteria(); $c->add(JobPeer::CODE, $this->getModuleName()); $job = JobPeer::doSelectOne($c); $acl = AclPeer::retrieveByPK($group_id, $job->getId()); if (!$acl) { $this->forward('default', 'error404'); } $this->can_add = $acl->getAddPriv() == 1; $this->can_edit = $acl->getEditPriv() == 1; $this->can_remove = $acl->getRemovePriv() == 1; $member_type = MemberTypePeer::retrieveByPk($this->getRequestParameter('id')); $this->forward404Unless($member_type); $actions = array(array('name' => 'save', 'type' => 'submit', 'options' => array('class' => 'save_button', 'onclick' => "action_type.value=this.value"))); // if ($acl->getAddPriv()) array_push($actions, array('name'=>'copy','type'=>'submit', 'options'=>array('class'=>'save_button', 'onclick'=>"action_type.value=this.value"))); if ($acl->getRemovePriv()) { array_push($actions, array('name' => 'delete', 'url' => 'member_type/delete?id=' . $member_type->getId(), 'color' => 'red')); } array_push($actions, array('name' => 'cancel', 'url' => 'member_type/list', 'color' => 'black')); $this->subtitle = $member_type->toString() . ' - id:' . $member_type->getId(); $this->type = 'edit'; $this->member_type = $member_type; $this->forward404Unless($this->member_type); $c = new Criteria(); $this->member_jobs = MemberJobPeer::doSelect($c); foreach ($this->member_jobs as $member_job) { $c = new Criteria(); $c->add(MemberJobPeer::PARENT, $member_job->getId()); $c->add(MemberJobPeer::DISPLAY_MENU, true); $member_job->child = MemberJobPeer::doCount($c); $c = new Criteria(); $c->add(MemberAclPeer::MEMBER_TYPE_ID, $this->member_type->getId(), Criteria::EQUAL); $c->add(MemberAclPeer::MEMBER_JOB_ID, $member_job->getId(), Criteria::EQUAL); $member_job->member_acl = MemberAclPeer::doSelectOne($c); $member_job->level = $member_job->getLevel(); $member_job->order = $member_job->getMenuOrderRecursive(); } function sortOrder($a, $b) { if ($a->order == $b->order) { return 0; } return $a->order < $b->order ? -1 : 1; } usort($this->member_jobs, 'sortOrder'); $this->actions = $actions; }
public function executeListAbsenceByEmployee() { $group_id = $this->getContext()->getUser()->getAttribute('group_id', null, 'bo'); $c = new Criteria(); $c->add(JobPeer::CODE, 'counseling/listByEmployee'); $job = JobPeer::doSelectOne($c); $acl = AclPeer::retrieveByPK($group_id, $job->getId()); if (!$acl) { $this->forward('default', 'error404'); } $employee_id = sfContext::getInstance()->getUser()->getAttribute('user_id', null, 'bo'); $employee = EmployeePeer::retrieveByPK($employee_id); $this->forward404Unless($employee); $counseling_id = $this->getRequestParameter('counseling_id'); $counseling = CounselingPeer::retrieveByPK($counseling_id); $this->forward404Unless($counseling); $accal_id = $this->getRequestParameter('accal_id'); $academic_calendar = AcademicCalendarPeer::retrieveByPK($accal_id); $this->forward404Unless($academic_calendar); $month_id = $this->getRequestParameter('month_id'); $title = MonthPeer::retrieveByPK($month_id); $this->forward404Unless($title); $c = new Criteria(); $c->add(StudentAccalPeer::ACADEMIC_CALENDAR_ID, $academic_calendar->getId()); $c->add(StudentAccalPeer::CLASS_GROUP_ID, $counseling->getClassGroupId()); $c->addJoin(StudentPeer::ID, StudentAccalPeer::STUDENT_ID); $c->add(StudentPeer::STATUS, 2, Criteria::NOT_EQUAL); $c->add(StudentPeer::STATUS, 3, Criteria::NOT_EQUAL); $c->addAscendingOrderByColumn(StudentPeer::CLASS_NAME); $this->sortStudent($c); if ($this->getRequest()->hasParameter('filters')) { $filters = $this->getRequestParameter('filters'); if ($filters == 'clear') { $this->filters = null; } else { $defined_filter = false; foreach ($filters as $f) { if (is_array($f)) { if (strlen($f['from']) > 0 || strlen($f['to']) > 0) { $defined_filter = true; break; } } else { if ($f != null && $f != '') { $defined_filter = true; break; } } } if ($defined_filter) { $this->filters = $filters; $this->filterStudent($c, $this->getRequestParameter('filters')); } } } $rpp = $this->getRequestParameter('max_per_page', $this->getUser()->getAttribute('max_per_page', ParamsPeer::retrieveByCode('row_per_page')->getValue(), 'student')); $this->getUser()->setAttribute('max_per_page', $rpp, 'student'); $pager = new sfPropelPager('Student', $rpp); $pager->setCriteria($c); $page = $this->getRequestParameter('page', $this->getUser()->getAttribute('page', 1, 'student')); $this->getUser()->setAttribute('page', $page, 'student'); $pager->setPage($page); $pager->init(); $this->pager = $pager; $actions = array(array('name' => 'filter', 'color' => 'white')); $filter_string = ""; if ($this->filters) { foreach ($this->filters as $key => $val) { $filter_string .= "&filters[{$key}]={$val}"; } $filter_string = preg_replace('/^&/', '', $filter_string); } array_unshift($actions, array('name' => '_AS_CSV_', 'url' => "counseling/listAbsenceByEmployeeAsCSV?accal_id=" . $academic_calendar->getId() . "&counseling_id=" . $counseling_id . "&{$filter_string}&month_id=" . $month_id, 'color' => 'black', 'type' => 'direct')); array_unshift($actions, array('name' => '_AS_PDF_', 'url' => "counseling/listAbsenceByEmployeeAsPDF?accal_id=" . $academic_calendar->getId() . "&counseling_id=" . $counseling_id . "&{$filter_string}&month_id=" . $month_id, 'color' => 'black', 'type' => 'direct')); $this->actions = $actions; $bln1 = substr($academic_calendar->getStart(), 5, 2); $bln2 = substr($academic_calendar->getEnd(), 5, 2); $cw = new Criteria(); $cton1 = $cw->getNewCriterion(MonthPeer::ID, $bln1, Criteria::GREATER_EQUAL); $cton2 = $cw->getNewCriterion(MonthPeer::ID, $bln2, Criteria::LESS_EQUAL); $cton1->addAnd($cton2); $cw->add($cton1); $months = MonthPeer::doSelect($cw); $actions2 = array(array('name' => '<span>' . $academic_calendar->toString() . '</span>', 'url' => 'counseling/listByEmployee', 'color' => 'volcadot')); foreach ($months as $month) { if ($month->getId() == $title->getId()) { array_push($actions2, array('name' => '<span>' . $month->getName() . '</span>', 'url' => 'counseling/listAbsenceByEmployee?accal_id=' . $academic_calendar->getId() . '&counseling_id=' . $counseling->getId() . '&month_id=' . $month->getId(), 'color' => 'sky', 'type' => 'direct')); } else { array_push($actions2, array('name' => '<span>' . $month->getName() . '</span>', 'url' => 'counseling/listAbsenceByEmployee?accal_id=' . $academic_calendar->getId() . '&counseling_id=' . $counseling->getId() . '&month_id=' . $month->getId(), 'color' => 'sun')); } } $this->actions2 = $actions2; $this->counseling = $counseling; $this->title = $title; $this->month = $title; $this->judul = $title->getName(); $this->tahun = $academic_calendar->getYear(); $this->subtitle = 'Absensi Bulan ' . $title->getName() . ' - ' . $academic_calendar->getYear() . ' # ' . $counseling->getClassGroup()->toString(); $this->employee_id = $employee_id; $this->academic_calendar = $academic_calendar; }
public function executeEdit() { $group_id = $this->getContext()->getUser()->getAttribute('group_id', null, 'bo'); $usertype = $this->getContext()->getUser()->getAttribute('usertype', null, 'bo'); $jobtemplate = $this->getContext()->getUser()->getAttribute('job_template_id', null, 'bo'); if ($jobtemplate == 1) { $c = new Criteria(); $c->add(JobPeer::CODE, $this->getModuleName()); $job = JobPeer::doSelectOne($c); $acl = AclPeer::retrieveByPK($group_id, $job->getId()); if (!$acl) { $this->forward('default', 'error404'); } $this->can_add = $acl->getAddPriv() == 1; $this->can_edit = $acl->getEditPriv() == 1; $this->can_remove = $acl->getRemovePriv() == 1; $byEmployee = false; } else { $c = new Criteria(); $c->add(JobPeer::CODE, 'employee_leave_l'); $job = JobPeer::doSelectOne($c); $acl = AclPeer::retrieveByPK($group_id, $job->getId()); if (!$acl) { $this->forward('default', 'error404'); } $this->can_add = $acl->getAddPriv() == 1; $this->can_edit = $acl->getEditPriv() == 1; $this->can_remove = $acl->getRemovePriv() == 1; $byEmployee = true; } $employee_leave = EmployeeLeavePeer::retrieveByPk($this->getRequestParameter('id')); $this->forward404Unless($employee_leave); $actions = array(array('name' => 'save', 'type' => 'submit', 'options' => array('class' => 'save_button', 'onclick' => "action_type.value=this.value"))); if ($acl->getRemovePriv()) { array_push($actions, array('name' => 'delete', 'url' => 'employee_leave/delete?id=' . $employee_leave->getId(), 'color' => 'red')); } array_push($actions, array('name' => 'cancel', 'url' => 'employee_leave/list?employee_id=' . $employee_leave->getEmployeeId(), 'color' => 'white')); $this->subtitle = $employee_leave->toString() . ' - id:' . $employee_leave->getId(); $this->type = 'edit'; $this->employee_leave = $employee_leave; $this->actions = $actions; $employee = $employee_leave->getEmployee(); if ($byEmployee == false) { $actions2 = array(array('name' => '<span>Catatan Kepegawaian</span>', 'url' => 'employee_list/list', 'color' => 'sky')); array_push($actions2, array('name' => '<span>Mutasi Jabatan</span>', 'url' => 'employee_job_history/list?employee_id=' . $employee->getId(), 'color' => 'sky')); array_push($actions2, array('name' => '<span>Absensi Pegawai</span>', 'url' => 'employee_absence/list?employee_id=' . $employee->getId(), 'color' => 'sky')); array_push($actions2, array('name' => '<span>Administrasi Cuti</span>', 'url' => 'employee_leave/list?employee_id=' . $employee->getId(), 'color' => 'sun', 'type' => 'direct')); array_push($actions2, array('name' => '<span>Administrasi Izin</span>', 'url' => 'employee_permit/list?employee_id=' . $employee->getId(), 'color' => 'sky')); array_push($actions2, array('name' => '<span>Administrasi Pengobatan</span>', 'url' => 'employee_medical/list?employee_id=' . $employee->getId(), 'color' => 'sky')); array_push($actions2, array('name' => '<span>Gaji Pegawai</span>', 'url' => 'employee_salary/list?employee_id=' . $employee->getId(), 'color' => 'sky')); $this->actions2 = $actions2; } $this->byEmployee = $byEmployee; }
public function executeEdit() { $group_id = $this->getContext()->getUser()->getAttribute('group_id', null, 'bo'); $c = new Criteria(); $c->add(JobPeer::CODE, $this->getModuleName()); $job = JobPeer::doSelectOne($c); $acl = AclPeer::retrieveByPK($group_id, $job->getId()); if (!$acl) { $this->forward('default', 'error404'); } $this->can_add = $acl->getAddPriv() == 1; $this->can_edit = $acl->getEditPriv() == 1; $this->can_remove = $acl->getRemovePriv() == 1; $user_group = UserGroupPeer::retrieveByPk($this->getRequestParameter('id')); $this->forward404Unless($user_group); if ($user_group->getJobTemplateId() == 11) { $c = new Criteria(); $cton1 = $c->getNewCriterion(JobPeer::ID, 132, Criteria::NOT_IN); $cton2 = $c->getNewCriterion(JobPeer::JOB_TEMPLATE_ID, 1, Criteria::IN); $cton3 = $c->getNewCriterion(JobPeer::JOB_TEMPLATE_ID, 3, Criteria::IN); $cton4 = $c->getNewCriterion(JobPeer::JOB_TEMPLATE_ID, 11, Criteria::IN); $cton3->addOr($cton4); $cton2->addOr($cton3); $cton1->addAnd($cton2); $c->add($cton1); $c->addAscendingOrderByColumn(JobPeer::MENU_ORDER); $jobs = JobPeer::doSelect($c); } else { $c = new Criteria(); $cton1 = $c->getNewCriterion(JobPeer::ID, 132, Criteria::NOT_IN); $cton2 = $c->getNewCriterion(JobPeer::JOB_TEMPLATE_ID, $user_group->getJobTemplateId(), Criteria::IN); $cton3 = $c->getNewCriterion(JobPeer::JOB_TEMPLATE_ID, $user_group->getJobTemplate()->getParent(), Criteria::IN); $cton4 = $c->getNewCriterion(JobPeer::JOB_TEMPLATE_ID, 11, Criteria::IN); $cton3->addOr($cton4); $cton2->addOr($cton3); $cton1->addAnd($cton2); $c->add($cton1); $c->addAscendingOrderByColumn(JobPeer::MENU_ORDER); $jobs = JobPeer::doSelect($c); } foreach ($jobs as $job) { $c = new Criteria(); $c->add(JobPeer::PARENT, $job->getId()); $c->add(JobPeer::DISPLAY_MENU, true); $job->child = JobPeer::doCount($c); $c = new Criteria(); $c->add(AclPeer::USER_GROUP_ID, $user_group->getId(), Criteria::EQUAL); $c->add(AclPeer::JOB_ID, $job->getId(), Criteria::EQUAL); $job->acl = AclPeer::doSelectOne($c); $job->level = $job->getLevel(); $job->order = $job->getMenuOrderRecursive(); } $actions = array(array('name' => 'save', 'type' => 'submit', 'options' => array('class' => 'save_button', 'onclick' => "action_type.value=this.value"))); if ($user_group->getCode() != 'admin' && $user_group->getCode() != 'student' && $user_group->getCode() != 'lector') { array_push($actions, array('name' => 'delete', 'url' => 'user_group/delete?id=' . $user_group->getId(), 'color' => 'red')); } array_push($actions, array('name' => 'cancel', 'url' => 'user_group/list', 'color' => 'white')); $this->subtitle = $user_group->toString() . ' - id:' . $user_group->getId(); $this->type = 'edit'; $this->user_group = $user_group; $this->icon = 'user_edit.png'; $this->actions = $actions; $this->jobs = $jobs; }
public function executeEdit() { $group_id = $this->getContext()->getUser()->getAttribute('group_id', null, 'bo'); $c = new Criteria(); $c->add(JobPeer::CODE, $this->getModuleName()); $job = JobPeer::doSelectOne($c); $acl = AclPeer::retrieveByPK($group_id, $job->getId()); if (!$acl) { $this->forward('default', 'error404'); } $this->can_edit = $acl->getEditPriv() == 1; $this->can_remove = $acl->getRemovePriv() == 1; $schedule = SchedulePeer::retrieveByPk($this->getRequestParameter('id')); $this->forward404Unless($schedule); $this->setTemplate('edit'); $actions = array(array('name' => 'save', 'type' => 'submit', 'options' => array('class' => 'save_button', 'onclick' => "action_type.value=this.value"))); if ($acl->getRemovePriv()) { array_push($actions, array('name' => 'delete', 'url' => 'extracurricular/delete?id=' . $schedule->getId(), 'color' => 'red')); } array_push($actions, array('name' => 'cancel', 'url' => 'extracurricular/list', 'color' => 'black')); $this->subtitle = $schedule->toStringCap() . ' - id:' . $schedule->getId(); $this->type = 'edit'; $this->schedule = $schedule; $this->actions = $actions; $c = new Criteria(); $c->add(ScheduleDetailPeer::SCHEDULE_ID, $schedule->getId()); $c->addDescendingOrderByColumn(ScheduleDetailPeer::ID); $rpp = $this->getRequestParameter('max_per_page', $this->getUser()->getAttribute('max_per_page', ParamsPeer::retrieveByCode('row_per_page')->getValue(), 'schedule_detail')); $this->getUser()->setAttribute('max_per_page', $rpp, 'schedule_detail'); $pager = new sfPropelPager('ScheduleDetail', $rpp); $pager->setCriteria($c); $page = $this->getRequestParameter('page', $this->getUser()->getAttribute('page', 1, 'schedule_detail')); $this->getUser()->setAttribute('page', $page, 'schedule_detail'); $pager->setPage($page); $pager->init(); $this->pager = $pager; $actions2 = array(array('name' => 'add', 'url' => 'extracurricular/createSchedule?schedule_id=' . $schedule->getId(), 'color' => 'black')); $this->actions2 = $actions2; }
public function executeEdit() { $group_id = $this->getContext()->getUser()->getAttribute('group_id', null, 'bo'); $c = new Criteria(); $c->add(JobPeer::CODE, $this->getModuleName()); $jobs = JobPeer::doSelectOne($c); $acl = AclPeer::retrieveByPK($group_id, $jobs->getId()); if (!$acl) { $this->forward('default', 'error404'); } $this->can_add = $acl->getAddPriv() == 1; $this->can_edit = $acl->getEditPriv() == 1; $this->can_remove = $acl->getRemovePriv() == 1; $job = JobPeer::retrieveByPk($this->getRequestParameter('id')); $this->forward404Unless($job); $c = new Criteria(); $c->add(JobInformationPeer::JOB_ID, $job->getId()); $job_information = JobInformationPeer::doSelectOne($c); if ($job_information) { $this->job_information = $job_information; } else { $this->job_information = new JobInformation(); } $actions = array(array('name' => 'save', 'type' => 'submit', 'options' => array('class' => 'save_button', 'onclick' => "action_type.value=this.value"))); if ($acl->getRemovePriv()) { array_push($actions, array('name' => 'delete', 'url' => 'job_information/delete?id=' . $job->getId(), 'color' => 'red')); } array_push($actions, array('name' => 'cancel', 'url' => 'job_information/list', 'color' => 'white')); $this->subtitle = $job->toString() . ' - id:' . $job->getId(); $this->type = 'edit'; $this->job = $job; $this->actions = $actions; $cw = new Criteria(); $cw->add(JobPeer::PARENT, 1078); $cw->addAscendingOrderByColumn('menu_order'); $parent = JobPeer::doSelectOne($cw); $cr = new Criteria(); $cton1 = $cr->getNewCriterion(JobPeer::PARENT, $parent->getParent(), Criteria::IN); $cton2 = $cr->getNewCriterion(JobPeer::ID, $jobs->getId(), Criteria::NOT_IN); $cton3 = $cr->getNewCriterion(JobPeer::CODE, 'public_information_category/list', Criteria::NOT_IN); $cton4 = $cr->getNewCriterion(JobPeer::CODE, 'public_information/listArticle', Criteria::NOT_IN); $cton5 = $cr->getNewCriterion(JobPeer::CODE, 'job_information/list', Criteria::NOT_IN); $cton6 = $cr->getNewCriterion(JobPeer::CODE, 'job_category', Criteria::NOT_IN); $cton5->addAnd($cton6); $cton4->addAnd($cton5); $cton3->addAnd($cton4); $cton2->addAnd($cton3); $cton1->addAnd($cton2); $cr->add($cton1); $modules = JobPeer::doSelect($cr); $this->modules = $modules; $actions2 = array(array('name' => '<span>Kategori Artikel</span>', 'url' => 'job_category/list', 'color' => 'sky')); array_push($actions2, array('name' => '<span>Artikel Web</span>', 'url' => 'public_information/listArticle', 'color' => 'sky')); array_push($actions2, array('name' => '<span>Kategori Menu</span>', 'url' => 'job_category/list', 'color' => 'sky')); array_push($actions2, array('name' => '<span>' . $jobs->getName() . '</span>', 'url' => $jobs->getCode(), 'color' => 'sun', 'type' => 'direct')); $this->actions2 = $actions2; }
public function fromArray($arr, $keyType = BasePeer::TYPE_PHPNAME) { $keys = AclPeer::getFieldNames($keyType); if (array_key_exists($keys[0], $arr)) { $this->setUserGroupId($arr[$keys[0]]); } if (array_key_exists($keys[1], $arr)) { $this->setJobId($arr[$keys[1]]); } if (array_key_exists($keys[2], $arr)) { $this->setAddPriv($arr[$keys[2]]); } if (array_key_exists($keys[3], $arr)) { $this->setEditPriv($arr[$keys[3]]); } if (array_key_exists($keys[4], $arr)) { $this->setRemovePriv($arr[$keys[4]]); } }
public function executeShow() { $group_id = $this->getContext()->getUser()->getAttribute('group_id', null, 'bo'); $c = new Criteria(); $c->add(JobPeer::CODE, $this->getModuleName()); $job = JobPeer::doSelectOne($c); $acl = AclPeer::retrieveByPK($group_id, $job->getId()); if (!$acl) { $this->forward('default', 'error404'); } $this->can_add = $acl->getAddPriv() == 1; $this->can_edit = $acl->getEditPriv() == 1; $this->can_remove = $acl->getRemovePriv() == 1; $employee_id = sfContext::getInstance()->getUser()->getAttribute('user_id', null, 'bo'); $employee = EmployeePeer::retrieveByPK($employee_id); $this->forward404Unless($employee); $outbox_emp = OutboxEmpPeer::retrieveByPk($this->getRequestParameter('id')); $this->forward404Unless($outbox_emp); $this->subtitle = $outbox_emp->toString() . ' - id:' . $outbox_emp->getId(); $actions = array(array('name' => 'back', 'url' => 'employee_outmail', 'color' => 'black')); array_push($actions, array('name' => 'delete', 'url' => 'employee_outmail/delete?id=' . $outbox_emp->getId(), 'color' => 'red')); $this->actions = $actions; $this->outbox_emp = $outbox_emp; }
public function executeListElse() { $group_id = $this->getContext()->getUser()->getAttribute('group_id', null, 'bo'); $group = $this->getContext()->getUser()->getAttribute('group', null, 'bo'); if ($group == 'lector') { $employee_id = sfContext::getInstance()->getUser()->getAttribute('user_id', null, 'bo'); $employee = EmployeePeer::retrieveByPK($employee_id); if ($employee->getStaffTypeId() == 13 || $employee->getStaffTypeId() == 14) { $this->can_add == 0; $this->can_edit == 0; $this->can_remove == 0; } $this->employee = $employee; } else { $c = new Criteria(); $c->add(JobPeer::CODE, $this->getModuleName()); $job = JobPeer::doSelectOne($c); $acl = AclPeer::retrieveByPK($group_id, $job->getId()); if (!$acl) { $this->forward('default', 'error404'); } $this->can_edit = $acl->getEditPriv() == 1; $this->can_remove = $acl->getRemovePriv() == 1; } $counseling_id = $this->getRequestParameter('counseling_id'); $counseling = CounselingPeer::retrieveByPK($counseling_id); $this->forward404Unless($counseling); $c = new Criteria(); $c->add(VStudentElsePeer::ACADEMIC_CALENDAR_ID, $counseling->getAcademicCalendarId(), Criteria::IN); $c->add(VStudentElsePeer::CLASS_GROUP_ID, $counseling->getClassGroupId(), Criteria::IN); $c->add(VStudentElsePeer::STATUS, Student::STATUS_GRADUATE, Criteria::NOT_EQUAL); $c->add(VStudentElsePeer::STATUS, Student::STATUS_OVERDUE, Criteria::NOT_EQUAL); $this->sortElse($c); if ($this->getRequest()->hasParameter('filters')) { $filters = $this->getRequestParameter('filters'); if ($filters == 'clear') { $this->filters = null; } else { $defined_filter = false; foreach ($filters as $f) { if (is_array($f)) { if (strlen($f['from']) > 0 || strlen($f['to']) > 0) { $defined_filter = true; break; } } else { if ($f != null && $f != '') { $defined_filter = true; break; } } } if ($defined_filter) { $this->filters = $filters; $this->filterElse($c, $this->getRequestParameter('filters')); } } } $rpp = $this->getRequestParameter('max_per_page', $this->getUser()->getAttribute('max_per_page', ParamsPeer::retrieveByCode('row_per_page')->getValue(), 'else')); $this->getUser()->setAttribute('max_per_page', $rpp, 'else'); $pager = new sfPropelPager('VStudentElse', $rpp); $pager->setCriteria($c); $page = $this->getRequestParameter('page', $this->getUser()->getAttribute('page', 1, 'else')); $this->getUser()->setAttribute('page', $page, 'else'); $pager->setPage($page); $pager->init(); $this->pager = $pager; $actions = array(array('name' => 'filter', 'color' => 'white')); $filter_string = ""; if ($this->filters) { foreach ($this->filters as $key => $val) { $filter_string .= "&filters[{$key}]={$val}"; } $filter_string = preg_replace('/^&/', '', $filter_string); } array_unshift($actions, array('name' => 'back', 'url' => "student_finance/list", 'color' => 'black')); array_unshift($actions, array('name' => '_AS_CSV_', 'url' => "student_finance/listElseAsCSV?counseling_id={$counseling_id}&{$filter_string}", 'color' => 'black', 'type' => 'direct')); array_unshift($actions, array('name' => '_AS_PDF_', 'url' => "student_finance/listElseAsPDF?counseling_id={$counseling_id}&{$filter_string}", 'color' => 'black', 'type' => 'direct')); $this->actions = $actions; $this->counseling = $counseling; $this->subtitle = $counseling->getAcademicCalendar()->toString() . ' # ' . $counseling->getClassGroup()->toString(); $actions2 = array(array('name' => '<span>Jurnal Pembayaran Wakaf</span>', 'url' => 'student_finance/listStudent?counseling_id=' . $counseling->getId(), 'color' => 'sky')); array_unshift($actions2, array('name' => '<span>Jurnal Keuangan Murid</span>', 'url' => 'student_finance/list', 'color' => 'sky')); array_push($actions2, array('name' => '<span>Jurnal Pembayaran Infaq</span>', 'url' => 'student_finance/listInfaq?counseling_id=' . $counseling->getId(), 'color' => 'sky')); array_push($actions2, array('name' => '<span>Jurnal Pembayaran SPP</span>', 'url' => 'student_finance/listSpp?counseling_id=' . $counseling->getId(), 'color' => 'sky')); array_push($actions2, array('name' => '<span>Jurnal Pembayaran Lain-lain</span>', 'url' => 'student_finance/listElse?counseling_id=' . $counseling->getId(), 'color' => 'sun', 'type' => 'direct')); $this->actions2 = $actions2; }
public function executeListDetail() { $group_id = $this->getContext()->getUser()->getAttribute('group_id', null, 'bo'); $c = new Criteria(); $c->add(JobPeer::CODE, $this->getModuleName()); $job = JobPeer::doSelectOne($c); $acl = AclPeer::retrieveByPK($group_id, $job->getId()); if (!$acl) { $this->forward('default', 'error404'); } $this->can_edit = $acl->getEditPriv() == 1; $this->can_remove = $acl->getRemovePriv() == 1; $counseling_id = $this->getRequestParameter('counseling_id'); $counseling = CounselingPeer::retrieveByPK($counseling_id); $this->forward404Unless($counseling); $accal_id = $this->getRequestParameter('accal_id'); $academic_calendar = AcademicCalendarPeer::retrieveByPK($accal_id); $this->forward404Unless($academic_calendar); $c = new Criteria(); $c->add(StudentAccalPeer::ACADEMIC_CALENDAR_ID, $academic_calendar->getId()); $c->add(StudentAccalPeer::CLASS_GROUP_ID, $counseling->getClassGroupId()); $c->addJoin(VStudentActivePeer::ID, StudentAccalPeer::STUDENT_ID); $c->addJoin(StudentPeer::ID, VStudentActivePeer::ID); $c->addAscendingOrderByColumn(StudentPeer::CLASS_NAME); $this->sortStudent($c); if ($this->getRequest()->hasParameter('filters')) { $filters = $this->getRequestParameter('filters'); if ($filters == 'clear') { $this->filters = null; } else { $defined_filter = false; foreach ($filters as $f) { if (is_array($f)) { if (strlen($f['from']) > 0 || strlen($f['to']) > 0) { $defined_filter = true; break; } } else { if ($f != null && $f != '') { $defined_filter = true; break; } } } if ($defined_filter) { $this->filters = $filters; $this->filterStudent($c, $this->getRequestParameter('filters')); } } } $rpp = $this->getRequestParameter('max_per_page', $this->getUser()->getAttribute('max_per_page', ParamsPeer::retrieveByCode('row_per_page')->getValue(), 'student')); $this->getUser()->setAttribute('max_per_page', $rpp, 'student'); $pager = new sfPropelPager('Student', $rpp); $pager->setCriteria($c); $page = $this->getRequestParameter('page', $this->getUser()->getAttribute('page', 1, 'student')); $this->getUser()->setAttribute('page', $page, 'student'); $pager->setPage($page); $pager->init(); $this->pager = $pager; $actions = array(array('name' => 'filter', 'color' => 'white')); $filter_string = ""; if ($this->filters) { foreach ($this->filters as $key => $val) { $filter_string .= "&filters[{$key}]={$val}"; } $filter_string = preg_replace('/^&/', '', $filter_string); } array_unshift($actions, array('name' => 'back', 'url' => "counseling_hist/list", 'color' => 'black')); $this->actions = $actions; $co = new Criteria(); $co->add(AcademicCalendarPeer::PARENT, $counseling->getAcademicCalendarId()); $co->addAscendingOrderByColumn(AcademicCalendarPeer::ID); $accal_counselings = AcademicCalendarPeer::doSelect($co); $actions2 = array(array('name' => '<span>Laporan Rekap Perwalian</span>', 'url' => 'counseling_hist/list', 'color' => 'sun')); if ($accal_counselings) { foreach ($accal_counselings as $accal_counsel) { if ($accal_counsel->getId() == $academic_calendar->getId()) { array_push($actions2, array('name' => '<span>' . $accal_counsel->toString() . '</span>', 'url' => 'counseling_hist/listDetail?accal_id=' . $accal_counsel->getId() . '&counseling_id=' . $counseling->getId(), 'color' => 'sun', 'type' => 'direct')); } else { array_push($actions2, array('name' => '<span>' . $accal_counsel->toString() . '</span>', 'url' => 'counseling_hist/listDetail?accal_id=' . $accal_counsel->getId() . '&counseling_id=' . $counseling->getId(), 'color' => 'sun')); } } } else { array_push($actions2, array('name' => '<span>' . $academic_calendar->toString() . '</span>', 'url' => 'counseling_hist/listDetail?accal_id=' . $academic_calendar->getId() . '&counseling_id=' . $counseling->getId(), 'color' => 'sun', 'type' => 'direct')); } $this->actions2 = $actions2; $this->counseling = $counseling; $this->subtitle = $academic_calendar->toString() . ' # ' . $counseling->getClassGroup()->toString(); $this->academic_calendar = $academic_calendar; }
public function executeEdit() { $group_id = $this->getContext()->getUser()->getAttribute('group_id', null, 'bo'); $c = new Criteria(); $c->add(JobPeer::CODE, $this->getModuleName()); $job = JobPeer::doSelectOne($c); $acl = AclPeer::retrieveByPK($group_id, $job->getId()); if (!$acl) { $this->forward('default', 'error404'); } $this->can_add = $acl->getAddPriv() == 1; $this->can_edit = $acl->getEditPriv() == 1; $this->can_remove = $acl->getRemovePriv() == 1; $class_agenda = ClassAgendaPeer::retrieveByPk($this->getRequestParameter('id')); $this->forward404Unless($class_agenda); $this->subtitle = ''; if (sfContext::getInstance()->getUser()->getAttribute('usertype', null, 'bo') == 'lector') { $employee_id = sfContext::getInstance()->getUser()->getAttribute('user_id', null, 'bo'); $employee = EmployeePeer::retrieveByPK($employee_id); $this->forward404Unless($employee); $this->subtitle = $employee->toString(); $this->employee_id = $employee_id; } $accal_options = array(); $c = new Criteria(); $dept = $this->getContext()->getUser()->getAttribute('department', null, 'bo'); $c->add(AcademicCalendarPeer::DEPARTMENT_ID, $dept->getChildRecurs(), Criteria::IN); $c->addDescendingOrderByColumn(AcademicCalendarPeer::CODE); $accals = AcademicCalendarPeer::doSelect($c); foreach ($accals as $accal) { if ($accal->getParent() != null) { $accal_options[$accal->getId()] = '· ' . $accal->toString(); } else { $accal_options[$accal->getId()] = $accal->toString(); } } $this->accal_options = $accal_options; $this->actions = array(array('name' => 'save', 'type' => 'submit', 'options' => array('class' => 'save_button', 'onclick' => "action_type.value=this.value")), array('name' => 'cancel', 'url' => 'agenda/list', 'color' => 'black')); $this->subtitle = ''; $this->type = 'add'; $this->class_agenda = $class_agenda; $c = new Criteria(); $c->add(SubjectGradingPeer::SUBJECT_CURR_ID, $class_agenda->getCourseSchedule()->getSubjectCurrId(), Criteria::IN); $c->addAscendingOrderByColumn(SubjectGradingPeer::ID); $objs = SubjectGradingPeer::doSelect($c); $grades = array(); foreach ($objs as $o) { $grades[$o->getId()] = $o->getGradeComponent()->toString(); } $this->grades = $grades; $this->selected_grade = $class_agenda->getSubjectGradingId(); $scheds_options = array(); $c = new Criteria(); $c->add(CourseScheduleTutorPeer::EMPLOYEE_ID, $employee_id, Criteria::IN); $c->add(CourseSchedulePeer::ACADEMIC_CALENDAR_ID, $class_agenda->getCourseSchedule()->getAcademicCalendarId(), Criteria::IN); $c->addJoin(CourseSchedulePeer::ID, CourseScheduleTutorPeer::COURSE_SCHEDULE_ID); $c->addJoin(CourseScheduleDetailPeer::COURSE_SCHEDULE_ID, CourseSchedulePeer::ID); $c->addAscendingOrderByColumn(CourseScheduleDetailPeer::CLASS_SESSION_ID); $csds = CourseScheduleDetailPeer::doSelect($c); foreach ($csds as $csd) { $scheds_options[$csd->getCourseScheduleId()] = $csd->getCourseSchedule()->getSubjectCurr()->getSubject()->getName() . ' # ' . $csd->getCourseSchedule()->getClassGroup()->getName(); } $this->scheds = $scheds_options; $this->selected_sched = $class_agenda->getCourseScheduleId(); $c = new Criteria(); $cton4 = $c->getNewCriterion(StudentAbsencePeer::END, $class_agenda->getDate(), Criteria::IN); $cton3 = $c->getNewCriterion(StudentAbsencePeer::START, $class_agenda->getDate(), Criteria::IN); $cton2 = $c->getNewCriterion(StudentAbsencePeer::ACADEMIC_CALENDAR_ID, $class_agenda->getCourseSchedule()->getAcademicCalendarId(), Criteria::IN); $cton1 = $c->getNewCriterion(StudentAbsencePeer::CLASS_GROUP_ID, $class_agenda->getClassGroupId(), Criteria::IN); $cton3->addOr($cton4); $cton2->addAnd($cton3); $cton1->addAnd($cton2); $c->add($cton1); $this->student_absences = StudentAbsencePeer::doSelect($c); $this->stu_count = StudentAbsencePeer::doCount($c); }
public function executeEditByEmployee() { $class_agenda = ClassAgendaPeer::retrieveByPK($this->getRequestParameter('agenda_id')); $this->forward404Unless($class_agenda); $employee_id = sfContext::getInstance()->getUser()->getAttribute('user_id', null, 'bo'); $employee = EmployeePeer::retrieveByPK($employee_id); $this->forward404Unless($employee); $this->employee = $employee; $group_id = $this->getContext()->getUser()->getAttribute('group_id', null, 'bo'); $c = new Criteria(); $c->add(JobPeer::CODE, 'leave/listByEmployee'); $job = JobPeer::doSelectOne($c); $acl = AclPeer::retrieveByPK($group_id, $job->getId()); if (!$acl) { $this->forward('default', 'error404'); } $this->can_add = $acl->getAddPriv() == 1; $this->can_edit = $acl->getEditPriv() == 1; $this->can_remove = $acl->getRemovePriv() == 1; $student_absence = StudentAbsencePeer::retrieveByPk($this->getRequestParameter('id')); $this->forward404Unless($student_absence); $stu_options = array(); $c = new Criteria(); $c->add(StudentPeer::CLASS_GROUP_ID, $class_agenda->getClassGroupId(), Criteria::IN); $c->addAscendingOrderByColumn(StudentPeer::NAME); $students = StudentPeer::doSelect($c); foreach ($students as $student) { $stu_options[$student->getId()] = $student->getName(); } $this->stu_options = $stu_options; $actions = array(array('name' => 'save', 'type' => 'submit', 'options' => array('class' => 'save_button', 'onclick' => "action_type.value=this.value"))); if ($acl->getRemovePriv()) { array_push($actions, array('name' => 'delete', 'url' => 'leave/deleteByEmployee?id=' . $student_absence->getId() . '&agenda_id=' . $class_agenda->getId(), 'color' => 'red')); } array_push($actions, array('name' => 'cancel', 'url' => 'leave/listByEmployee?agenda_id=' . $class_agenda->getId(), 'color' => 'white')); $this->subtitle = $class_agenda->toString() . ' - id:' . $student_absence->getId(); $this->type = 'edit'; $this->student_absence = $student_absence; $this->actions = $actions; $this->class_agenda = $class_agenda; }
public function executeList() { $group_id = $this->getContext()->getUser()->getAttribute('group_id', null, 'bo'); $cw = new Criteria(); $cw->add(JobPeer::CODE, $this->getModuleName()); $job = JobPeer::doSelectOne($cw); $acl = AclPeer::retrieveByPK($group_id, $job->getId()); if (!$acl) { $this->forward('default', 'error404'); } $this->can_edit = $acl->getEditPriv() == 1; $this->can_remove = $acl->getRemovePriv() == 1; $c = new Criteria(); $dept = $this->getContext()->getUser()->getAttribute('department', null, 'bo'); $c->add(EmployeePeer::DEPARTMENT_ID, $dept->getChildRecurs(), Criteria::IN); $c->addJoin(VEmployeePermitPeer::EMPLOYEE_ID, EmployeePeer::ID); $this->sort($c); if ($this->getRequest()->hasParameter('filters')) { $filters = $this->getRequestParameter('filters'); if ($filters == 'clear') { $this->filters = null; } else { $defined_filter = false; foreach ($filters as $f) { if (is_array($f)) { if (strlen($f['from']) > 0 || strlen($f['to']) > 0) { $defined_filter = true; break; } } else { if ($f != null && $f != '') { $defined_filter = true; break; } } } if ($defined_filter) { $this->filters = $filters; $this->filter($c, $this->getRequestParameter('filters')); } } } $rpp = $this->getRequestParameter('max_per_page', $this->getUser()->getAttribute('max_per_page', ParamsPeer::retrieveByCode('row_per_page')->getValue(), 'emp_permit')); $this->getUser()->setAttribute('max_per_page', $rpp, 'emp_permit'); $pager = new sfPropelPager('VEmployeePermit', $rpp); $pager->setCriteria($c); $page = $this->getRequestParameter('page', $this->getUser()->getAttribute('page', 1, 'emp_permit')); $this->getUser()->setAttribute('page', $page, 'emp_permit'); $pager->setPage($page); $pager->init(); $this->pager = $pager; $actions = array(); $filter_string = ""; if ($this->filters) { foreach ($this->filters as $key => $val) { $filter_string .= "&filters[{$key}]={$val}"; } $filter_string = preg_replace('/^&/', '', $filter_string); } array_unshift($actions, array('name' => 'Print Excel', 'url' => "employee_permit_recapt/listAsCSV?{$filter_string}", 'color' => 'black', 'type' => 'direct')); array_unshift($actions, array('name' => 'Print PDF', 'url' => "employee_permit_recapt/listAsPDF?{$filter_string}", 'color' => 'black', 'type' => 'direct')); $this->actions = $actions; $this->subtitle = ''; }
public function executeEdit() { $group_id = $this->getContext()->getUser()->getAttribute('group_id', null, 'bo'); $c = new Criteria(); $c->add(JobPeer::CODE, $this->getModuleName()); $job = JobPeer::doSelectOne($c); $acl = AclPeer::retrieveByPK($group_id, $job->getId()); if (!$acl) { $this->forward('default', 'error404'); } $this->can_add = $acl->getAddPriv() == 1; $this->can_edit = $acl->getEditPriv() == 1; $this->can_remove = $acl->getRemovePriv() == 1; $this->transaction_status = TransactionStatusPeer::retrieveByPk($this->getRequestParameter('id')); $this->forward404Unless($this->transaction_status); $actions = array(array('name' => 'save', 'type' => 'submit', 'options' => array('class' => 'save_button', 'onclick' => "action_type.value=this.value"))); $this->subtitle = $this->transaction_status->toString() . ' - id:' . $this->transaction_status->getId(); $this->type = 'edit'; $this->actions = $actions; $this->disabled = $this->transaction_status->getChildRecurs(); }
public function executeEdit() { $group_id = $this->getContext()->getUser()->getAttribute('group_id', null, 'bo'); $c = new Criteria(); $c->add(JobPeer::CODE, $this->getModuleName()); $job = JobPeer::doSelectOne($c); $acl = AclPeer::retrieveByPK($group_id, $job->getId()); if (!$acl) { $this->forward('default', 'error404'); } $this->can_add = $acl->getAddPriv() == 1; $this->can_edit = $acl->getEditPriv() == 1; $this->can_remove = $acl->getRemovePriv() == 1; $course_schedule = CourseSchedulePeer::retrieveByPK($this->getRequestParameter('course_id')); $this->forward404Unless($course_schedule); $course_schedule_id = $course_schedule->getId(); $grade_options = array(); $c = new Criteria(); $c->add(SubjectGradingPeer::SUBJECT_CURR_ID, $course_schedule->getSubjectCurrId(), Criteria::IN); $c->addAscendingOrderByColumn(SubjectGradingPeer::ID); $grades = SubjectGradingPeer::doSelect($c); foreach ($grades as $grade) { $grade_options[$grade->getId()] = $grade->getGradeComponent()->toString(); } $this->grade_options = $grade_options; $class_agenda = ClassAgendaPeer::retrieveByPk($this->getRequestParameter('id')); $this->forward404Unless($class_agenda); $actions = array(array('name' => 'save', 'type' => 'submit', 'options' => array('class' => 'save_button', 'onclick' => "action_type.value=this.value"))); if ($acl->getRemovePriv()) { array_push($actions, array('name' => 'delete', 'url' => 'class_agenda/delete?id=' . $class_agenda->getId() . '&sched_id=' . $course_schedule->getId(), 'color' => 'red')); } array_push($actions, array('name' => 'cancel', 'url' => 'class_agenda/list?id=' . $course_schedule->getId(), 'color' => 'black')); $this->subtitle = $class_agenda->toString() . ' - id:' . $class_agenda->getId(); $this->type = 'edit'; $this->class_agenda = $class_agenda; $this->actions = $actions; $this->course_schedule_id = $class_agenda->getCourseScheduleId(); $this->course_schedule = $course_schedule; $actions2 = array(array('name' => '<span>Jadwal Pelajaran</span>', 'url' => 'course_sched/list', 'color' => 'sky')); array_push($actions2, array('name' => '<span>Agenda Kelas</span>', 'url' => 'class_agenda/list?id=' . $course_schedule->getId(), 'color' => 'sun', 'type' => 'direct')); $this->actions2 = $actions2; }
public function executeEditDetail() { $group_id = $this->getContext()->getUser()->getAttribute('group_id', null, 'bo'); $c = new Criteria(); $c->add(JobPeer::CODE, 'ng_reg_period'); $job = JobPeer::doSelectOne($c); $acl = AclPeer::retrieveByPK($group_id, $job->getId()); if (!$acl) { $this->forward('default', 'error404'); } $this->ng_reg_period = NgRegPeriodPeer::retrieveByPK($this->getRequestParameter('ng_reg_period_id')); $this->forward404Unless($this->ng_reg_period); $this->ng_reg_test_detail = NgRegTestDetailPeer::retrieveByPk($this->getRequestParameter('id')); $this->forward404Unless($this->ng_reg_test_detail); $this->subtitle = $this->ng_reg_test_detail->getTitle() . ' - id:' . $this->ng_reg_test_detail->getId(); $actions = array(array('name' => 'save', 'type' => 'submit', 'options' => array('class' => 'save_button', 'onclick' => "action_type.value=this.value"))); if ($acl->getRemovePriv()) { array_push($actions, array('name' => 'delete', 'url' => 'ng_reg_detail/deleteDetail?id=' . $this->ng_reg_test_detail->getId() . '&ng_reg_period_id=' . $this->ng_reg_period->getId(), 'color' => 'red')); } array_push($actions, array('name' => 'cancel', 'url' => 'ng_reg_detail/listDetail?id=' . $this->ng_reg_period->getId(), 'color' => 'black')); $actions2 = array(array('name' => $this->ng_reg_period->toString(), 'url' => 'ng_reg_period/list', 'color' => 'sky')); array_push($actions2, array('name' => 'Reg Period Detail Schedule', 'url' => 'ng_reg_detail/listOther?id=' . $this->ng_reg_period->getId(), 'color' => 'sky')); array_push($actions2, array('name' => 'Reg Test Period', 'url' => 'ng_reg_detail/list?id=' . $this->ng_reg_period->getId(), 'color' => 'sky')); array_push($actions2, array('name' => 'Reg Test Period Detail Schedule', 'url' => 'ng_reg_detail/listDetail?id=' . $this->ng_reg_period->getId(), 'color' => 'sun', 'type' => 'direct')); array_push($actions2, array('name' => 'Assessment Test', 'url' => 'ng_reg_detail/listTest?id=' . $this->ng_reg_period->getId(), 'color' => 'sky')); $this->actions2 = $actions2; $this->type = 'edit'; $this->actions = $actions; }
public function executeEdit() { $group_id = $this->getContext()->getUser()->getAttribute('group_id', null, 'bo'); $c = new Criteria(); $c->add(JobPeer::CODE, $this->getModuleName()); $job = JobPeer::doSelectOne($c); $acl = AclPeer::retrieveByPK($group_id, $job->getId()); if (!$acl) { $this->forward('default', 'error404'); } $this->can_add = $acl->getAddPriv() == 1; $this->can_edit = $acl->getEditPriv() == 1; $this->can_remove = $acl->getRemovePriv() == 1; $budget_status = BudgetStatusPeer::retrieveByPk($this->getRequestParameter('id')); $this->forward404Unless($budget_status); $actions = array(array('name' => 'save', 'type' => 'submit', 'options' => array('class' => 'save_button', 'onclick' => "action_type.value=this.value"))); if ($acl->getRemovePriv()) { array_push($actions, array('name' => 'delete', 'url' => 'budget_status/delete?id=' . $budget_status->getId(), 'color' => 'red')); } array_push($actions, array('name' => 'cancel', 'url' => 'budget_status/list', 'color' => 'white')); $this->subtitle = $budget_status->toString() . ' - id:' . $budget_status->getId(); $this->type = 'edit'; $this->budget_status = $budget_status; $this->actions = $actions; $cw = new Criteria(); $cw->add(JobPeer::PARENT, 240); $parent = JobPeer::doSelectOne($cw); $cr = new Criteria(); $cton1 = $cr->getNewCriterion(JobPeer::PARENT, $parent->getParent(), Criteria::IN); $cton2 = $cr->getNewCriterion(JobPeer::ID, $job->getId(), Criteria::NOT_IN); $cton3 = $cr->getNewCriterion(JobPeer::CODE, 'academic_process', Criteria::NOT_IN); $cton4 = $cr->getNewCriterion(JobPeer::CODE, 'payer_type', Criteria::NOT_IN); $cton5 = $cr->getNewCriterion(JobPeer::CODE, 'payment_model', Criteria::NOT_IN); $cton6 = $cr->getNewCriterion(JobPeer::CODE, 'budget_category', Criteria::NOT_IN); $cton5->addAnd($cton6); $cton4->addAnd($cton5); $cton3->addAnd($cton4); $cton2->addAnd($cton3); $cton1->addAnd($cton2); $cr->add($cton1); $modules = JobPeer::doSelect($cr); $this->modules = $modules; $actions2 = array(array('name' => '<span>Komponen Biaya Sekolah</span>', 'url' => 'academic_cost_component/list', 'color' => 'sky')); array_push($actions2, array('name' => '<span>Proses Akademik</span>', 'url' => 'academic_process/list', 'color' => 'sky')); array_push($actions2, array('name' => '<span>Tipe Siswa</span>', 'url' => 'payer_type/list', 'color' => 'sky')); array_push($actions2, array('name' => '<span>Model Pembayaran</span>', 'url' => 'payment_model/list', 'color' => 'sky')); array_push($actions2, array('name' => '<span>Kategori Anggaran</span>', 'url' => 'budget_category/list', 'color' => 'sky')); array_push($actions2, array('name' => '<span>' . $job->getName() . '</span>', 'url' => $job->getCode(), 'color' => 'sun', 'type' => 'direct')); $this->actions2 = $actions2; }
public function executeEdit() { $student_id = $this->getRequestParameter('student_id'); $student = StudentPeer::retrieveByPK($student_id); $this->forward404Unless($student); $this->student = $student; $group_id = $this->getContext()->getUser()->getAttribute('group_id', null, 'bo'); $c = new Criteria(); $c->add(JobPeer::CODE, $this->getModuleName()); $job = JobPeer::doSelectOne($c); $acl = AclPeer::retrieveByPK($group_id, $job->getId()); if (!$acl) { $this->forward('default', 'error404'); } $this->can_add = $acl->getAddPriv() == 1; $this->can_edit = $acl->getEditPriv() == 1; $this->can_remove = $acl->getRemovePriv() == 1; $alumni_work_history = AlumniWorkHistoryPeer::retrieveByPk($this->getRequestParameter('id')); $this->forward404Unless($alumni_work_history); $actions = array(array('name' => 'save', 'type' => 'submit', 'options' => array('class' => 'save_button', 'onclick' => "action_type.value=this.value"))); if ($acl->getRemovePriv()) { array_push($actions, array('name' => 'delete', 'url' => 'alumni_work_history/delete?student_id=' . $student_id . '&id=' . $alumni_work_history->getId(), 'color' => 'red')); } array_push($actions, array('name' => 'cancel', 'url' => 'alumni_work_history/list?student_id=' . $student_id, 'color' => 'white')); $this->subtitle = $student->toString() . ' - id:' . $alumni_work_history->getId(); $this->type = 'edit'; $this->alumni_work_history = $alumni_work_history; $this->actions = $actions; }
public function executeGetCounseling() { $group_id = $this->getContext()->getUser()->getAttribute('group_id', null, 'bo'); $c = new Criteria(); $c->add(JobPeer::CODE, $this->getModuleName()); $job = JobPeer::doSelectOne($c); $acl = AclPeer::retrieveByPK($group_id, $job->getId()); if (!$acl) { $this->forward('default', 'error404'); } $this->can_edit = $acl->getEditPriv() == 1; $this->can_remove = $acl->getRemovePriv() == 1; $employee_id = sfContext::getInstance()->getUser()->getAttribute('user_id', null, 'bo'); $employee = EmployeePeer::retrieveByPK($employee_id); $this->forward404Unless($employee); $dept = $this->getContext()->getUser()->getAttribute('department_id', null, 'bo'); $dept_id = $this->getContext()->getUser()->getAttribute('department', null, 'bo'); $academic_calendar_id = $this->getRequestParameter('academic_calendar_id'); $academic_calendar = AcademicCalendarPeer::retrieveByPK($academic_calendar_id); $this->forward404Unless($academic_calendar); $c = new Criteria(); $c->add(AcademicCalendarPeer::DEPARTMENT_ID, $dept_id->getChildRecurs(), Criteria::IN); $c->add(AcademicCalendarPeer::ID, $academic_calendar->getParent(), Criteria::IN); $c->addJoin(CounselingPeer::ACADEMIC_CALENDAR_ID, AcademicCalendarPeer::ID); $this->sort($c); if ($this->getRequest()->hasParameter('filters')) { $filters = $this->getRequestParameter('filters'); if ($filters == 'clear') { $this->filters = null; } else { $defined_filter = false; foreach ($filters as $f) { if (is_array($f)) { if (strlen($f['from']) > 0 || strlen($f['to']) > 0) { $defined_filter = true; break; } } else { if ($f != null && $f != '') { $defined_filter = true; break; } } } if ($defined_filter) { $this->filters = $filters; $this->filter($c, $this->getRequestParameter('filters')); } } } $rpp = $this->getRequestParameter('max_per_page', $this->getUser()->getAttribute('max_per_page', ParamsPeer::retrieveByCode('row_per_page')->getValue(), 'counseling')); $this->getUser()->setAttribute('max_per_page', $rpp, 'counseling'); $pager = new sfPropelPager('Counseling', $rpp); $pager->setCriteria($c); $page = $this->getRequestParameter('page', $this->getUser()->getAttribute('page', 1, 'counseling')); $this->getUser()->setAttribute('page', $page, 'counseling'); $pager->setPage($page); $pager->init(); $this->pager = $pager; $filter_string = ""; if ($this->filters) { foreach ($this->filters as $key => $val) { $filter_string .= "&filters[{$key}]={$val}"; } $filter_string = preg_replace('/^&/', '', $filter_string); } $this->subtitle = $employee->getName() . ' - ' . $academic_calendar->getName(); $actions = array(); $this->actions = $actions; $this->academic_calendar = $academic_calendar; $this->employee_id = $employee_id; $this->employee = $employee; }
public function executeEdit() { $group_id = $this->getContext()->getUser()->getAttribute('group_id', null, 'bo'); $c = new Criteria(); $c->add(JobPeer::CODE, $this->getModuleName()); $job = JobPeer::doSelectOne($c); $acl = AclPeer::retrieveByPK($group_id, $job->getId()); if (!$acl) { $this->forward('default', 'error404'); } $this->can_add = $acl->getAddPriv() == 1; $this->can_edit = $acl->getEditPriv() == 1; $this->can_remove = $acl->getRemovePriv() == 1; $expenditure_journal = ExpenditureJournalPeer::retrieveByPk($this->getRequestParameter('id')); $this->forward404Unless($expenditure_journal); $actions = array(array('name' => 'save', 'type' => 'submit', 'options' => array('class' => 'save_button', 'onclick' => "action_type.value=this.value"))); if ($acl->getRemovePriv()) { array_push($actions, array('name' => 'delete', 'url' => 'expenditure_journal/delete?id=' . $expenditure_journal->getId(), 'color' => 'red')); } array_push($actions, array('name' => 'cancel', 'url' => 'expenditure_journal/list', 'color' => 'white')); $this->subtitle = $expenditure_journal->toString() . ' - id:' . $expenditure_journal->getId(); $this->type = 'edit'; $this->expenditure_journal = $expenditure_journal; $this->actions = $actions; $bank_account = BankAccountPeer::retrieveByPK($expenditure_journal->getBudget()); $this->forward404Unless($bank_account); $c = new Criteria(); $c->addJoin(AcademicCalenderPeer::ID, ExpenditureJournalPeer::ACADEMIC_CALENDAR_ID); $c->addJoin(AcademicCalendarPeer::CURRICULUM_ID, CurriculumPeer::ID); $c->addJoin(CurriculumPeer::DEPARTMENT_ID, BankAccountPeer::DEPARTMENT_ID); $c->add(BankAccountPeer::ID, $bank_account->getId()); if ($bank_account->getDepartmentId()) { $c->add(CurriculumPeer::DEPARTMENT_ID, $bank_account->getDepartment()->getParentRecurs(), Criteria::IN); } $ac_calendars = AcademicCalenderPeer::doSelect($c); $ac_calendar_list = array(); foreach ($ac_calendars as $ac_calendar) { $ac_calendar_list[$ac_calendar->getId()] = $ac_calendar->toString(); } $this->academic_calendars = $ac_calendar_list; }