public function executePrintFormSpp() { $group_id = $this->getContext()->getUser()->getAttribute('group_id', null, 'bo'); $c = new Criteria(); $c->add(JobPeer::CODE, 'student_type'); $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; $paid_at = $this->getRequestParameter('paid_at'); $year = $this->getRequestParameter('year'); $student = StudentPeer::retrieveByPK($this->getRequestParameter('student_id')); $this->forward404Unless($student); $cr = new Criteria(); $cr->add(StudentTypePeer::STUDENT_ID, $student->getId()); $stu_type = StudentTypePeer::doSelectOne($cr); $c = new Criteria(); $cton1 = $c->getNewCriterion(VAcaCostPeer::ACADEMIC_CALENDAR_ID, $student->getAcademicCalendar()->getChildRecurs(), Criteria::IN); $cton2 = $c->getNewCriterion(VAcaCostPeer::CLASS_GROUP_ID, $student->getClassGroup()->getParentRecurs(), Criteria::IN); $cton3 = $c->getNewCriterion(VAcaCostPeer::PAYER_CODE, $stu_type->getPayerType()->getCode(), Criteria::IN); $cton4 = $c->getNewCriterion(VAcaCostPeer::ACADEMIC_COST_COMPONENT_ID, 13, Criteria::IN); $cton3->addAnd($cton4); $cton2->addAnd($cton3); $cton1->addAnd($cton2); $c->add($cton1); $ac_cost = VAcaCostPeer::doSelectOne($c); $this->forward404Unless($ac_cost); $this->ac_cost = $ac_cost; $this->subtitle = $student->toString(); $this->student = $student; $this->paid_at = $paid_at; $this->year = $year; $rpp = $this->getRequestParameter('max_per_page', 999); $pager = new sfPropelPager('VAcaCost', $rpp); $pager->setCriteria($c); $pager->setPage($this->getRequestParameter('page', 1)); $pager->init(); $this->pager = $pager; $this->papersize = 'gdscform'; $this->orientation = 'landscape'; $this->setViewClass('sfDomPDF'); }