public function show() { $terms = HousingApplication::getAvailableApplicationTermsForStudent($this->student); $applications = HousingApplication::getAllApplicationsForStudent($this->student); $tpl = array(); foreach ($terms as $t) { # If the student has a withdrawn application, # then show a message instead of the normal menu block. if (isset($applications[$t['term']]) && $applications[$t['term']]->isCancelled()) { $termBlock = new StudentMenuWithdrawnTermBlock($this->student, $t['term']); } else { // Look up the student again in each term, because student type can change depending on which term we ask about $student = StudentFactory::getStudentByBannerId($this->student->getBannerId(), $t['term']); $termBlock = new StudentMenuTermBlock($student, $t['term']); } $tpl['TERMBLOCK'][] = array('TERMBLOCK_CONTENT' => $termBlock->show()); } Layout::addPageTitle("Main Menu"); return PHPWS_Template::process($tpl, 'hms', 'student/freshmenMenu.tpl'); }
public function show() { $tpl = array(); $termList = array(); // Current term $currTerm = Term::getCurrentTerm(); $termList[] = $currTerm; // Always add the current term // Find the next two summer terms (could be next year if Fall // is the current term, could be this year if Spring is current term) $summerTerm1 = $currTerm; while (Term::getTermSem($summerTerm1) != TERM_SUMMER1) { $summerTerm1 = Term::getNextTerm($summerTerm1); } $summerTerm2 = Term::getNextTerm($summerTerm1); $currSem = Term::getTermSem($currTerm); if ($currSem == TERM_SUMMER1) { // If the current term is Summer 1, then we've already added it above, // so just add summer 2 $termList[] = Term::getNextTerm($currTerm); } else { if ($currSem != TERM_SUMMER2) { // Add both of the next summer terms then $termList[] = $summerTerm1; $termList[] = $summerTerm2; } } // Re-application term if ($this->lotteryTerm > $currTerm) { // If the lottery term is in the future $termList[] = $this->lotteryTerm; } foreach ($termList as $t) { $termBlock = new StudentMenuTermBlock($this->student, $t); $tpl['TERMBLOCK'][] = array('TERMBLOCK_CONTENT' => $termBlock->show()); } Layout::addPageTitle("Main Menu"); return PHPWS_Template::process($tpl, 'hms', 'student/returningMenu.tpl'); }