Esempio n. 1
0
 private function generateWithLinkToRemote($page, $linkName)
 {
     sfProjectConfiguration::getActive()->loadHelpers('Javascript');
     return link_to_remote($linkName, array('url' => "{$this->baseUrl}&page={$page}", 'update' => $this->linkToRemoteElementId), array('class' => $page == $this->pager->getPage() ? 'active' : ''));
 }
 public function evaluateCareerSchoolYearStudent(CareerSchoolYear $career_school_year, Student $student, PropelPDO $con = null)
 {
     $con = is_null($con) ? Propel::getConnection() : $con;
     // obtenemos las materias de este año
     #$course_subject_students = CourseSubjectStudentPeer::retrieveByCareerSchoolYearAndStudent($career_school_year, $student, $con);
     $c = CourseSubjectStudentPeer::retrieveCriteriaByCareerSchoolYearAndStudent($career_school_year, $student, $con);
     $pager = new sfPropelPager('CourseSubjectStudent', 100);
     $pager->setCriteria($c);
     $pager->init();
     for ($i = 1; $i < $pager->getLastPage() + 1; $i++) {
         $course_subject_students = $pager->getResults();
         // para todas las materias cursadas este año
         foreach ($course_subject_students as $course_subject_student) {
             // obtenemos el resultado (aprobada o desaprobada) y la cerramos.
             // para el caso de las aprobadas, se crea la mesa de examen final (StudentApprovedCareerSubject)
             // de lo contrario, la inscripción a la mesa de examen (TODO)
             $result = $course_subject_student->getCourseResult($con);
             if (!is_null($result)) {
                 $result->close($con);
             }
         }
         ###Liberando memoria ###
         CourseSubjectStudentPeer::clearInstancePool();
         StudentApprovedCourseSubjectPeer::clearInstancePool();
         StudentDisapprovedCourseSubjectPeer::clearInstancePool();
         ################################
         $pager->setPage($pager->getPage() + 1);
         $pager->init();
     }
     unset($pager);
     unset($c);
 }