本文整理汇总了PHP中Term::getNextTerm方法的典型用法代码示例。如果您正苦于以下问题:PHP Term::getNextTerm方法的具体用法?PHP Term::getNextTerm怎么用?PHP Term::getNextTerm使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Term
的用法示例。
在下文中一共展示了Term::getNextTerm方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
public function __construct($sendMagicWinners, $sendReminders, array $inviteCounts)
{
// Gender and classes
$this->genders = array(MALE, FEMALE);
$this->classes = array(CLASS_SENIOR, CLASS_JUNIOR, CLASS_SOPHOMORE);
// Send magic winners?
$this->sendMagicWinners = $sendMagicWinners;
// Send reminders?
$this->sendReminders = $sendReminders;
// Invite counts to be sent
$this->inviteCounts = $inviteCounts;
// One-time date/time calculations, setup for later on
$this->term = PHPWS_Settings::get('hms', 'lottery_term');
$this->year = Term::getTermYear($this->term);
$this->academicYear = Term::toString($this->term) . ' - ' . Term::toString(Term::getNextTerm($this->term));
$this->now = time();
$this->expireTime = $this->now + INVITE_TTL_HRS * 3600;
// Hard Cap
$this->hardCap = LotteryProcess::getHardCap();
// Soft caps
$this->jrSoftCap = LotteryProcess::getJrSoftCap();
$this->srSoftCap = LotteryProcess::getSrSoftCap();
// Invites Sent by this process so far this run
$this->numInvitesSent['TOTAL'] = 0;
foreach ($this->classes as $c) {
foreach ($this->genders as $g) {
$this->numInvitesSent[$c][$g] = 0;
}
}
$this->output = array();
}
示例2: show
public function show()
{
$tpl = array();
$tpl['TERM'] = Term::toString($this->term);
$tpl['NEXT_TERM'] = Term::toString(Term::getNextTerm($this->term));
$form = new PHPWS_Form('waitinglist-signup');
$submitCmd = CommandFactory::getCommand('WaitingListSignup');
$submitCmd->initForm($form);
$form->addSubmit('Sign up');
$form->addHidden('term', $this->term);
$form->mergeTemplate($tpl);
$tpl = $form->getTemplate();
return PHPWS_Template::process($tpl, 'hms', 'student/waitinglistSignup.tpl');
}
示例3: show
public function show()
{
$tpl = array();
if (Term::getTermSem($this->term) == TERM_FALL) {
// If it's fall, then it's really the fall & spring terms
$tpl['TERM'] = Term::toString($this->term) . ' - ' . Term::toString(Term::getNextTerm($this->term));
} else {
$tpl['TERM'] = Term::toString($this->term);
}
$contactFormLink = CommandFactory::getCommand('ShowContactForm')->getLink('contact University Housing');
// In case there are no features enabled for this term
$tpl['BLOCKS'][] = array('BLOCK' => 'Your application has been cancelled for this term. If this is an error please ' . $contactFormLink . '.');
return PHPWS_Template::process($tpl, 'hms', 'student/studentMenuTermBlock.tpl');
}
示例4: show
public function show()
{
$tpl = array();
$tpl['ENTRY_TERM'] = Term::toString($this->student->getApplicationTerm());
$tpl['REQUIRED_TERMS'] = array();
$appsOnFile = HousingApplication::getAllApplicationsForStudent($this->student);
# Make a list of the terms the student has completed
$termsOnFile = array();
if (isset($appsOnFile) && !is_null($appsOnFile)) {
foreach ($appsOnFile as $term => $app) {
$termsOnFile[] = $term;
}
}
foreach ($this->requiredTerms as $t) {
if ($t['required'] == 0) {
continue;
}
$completed = '';
if (in_array($t['term'], $termsOnFile)) {
$completed = ' <span style="color: #0000AA">(Completed)</span>';
}
// If the application is cancelled, overwrite the "complete" text with "cancelled"
if (isset($appsOnFile[$t['term']]) && $appsOnFile[$t['term']]->isCancelled()) {
$completed = ' <span style="color: #F00">(Cancelled)</span>';
}
if (Term::getTermSem($t['term']) == TERM_FALL) {
$tpl['REQUIRED_TERMS'][] = array('REQ_TERM' => Term::toString($t['term']) . ' - ' . Term::toString(Term::getNextTerm($t['term'])), 'COMPLETED' => $completed);
} else {
$tpl['REQUIRED_TERMS'][] = array('REQ_TERM' => Term::toString($t['term']), 'COMPLETED' => $completed);
}
}
$contactCmd = CommandFactory::getCommand('ShowContactForm');
$tpl['CONTACT_LINK'] = $contactCmd->getLink('contact us');
# Setup the form for the 'continue' button.
$form = new PHPWS_Form();
$this->submitCmd->initForm($form);
$form->mergeTemplate($tpl);
$tpl = $form->getTemplate();
$studentType = $this->student->getType();
Layout::addPageTitle("Welcome");
if (count($appsOnFile) > 0) {
// User is now past step one. No longer just welcoming, we are now welcoming back.
return PHPWS_Template::process($tpl, 'hms', 'student/welcome_back_screen.tpl');
}
if ($studentType == TYPE_FRESHMEN || $studentType == TYPE_NONDEGREE || $this->student->isInternational()) {
return PHPWS_Template::process($tpl, 'hms', 'student/welcome_screen_freshmen.tpl');
} else {
return PHPWS_Template::process($tpl, 'hms', 'student/welcome_screen_transfer.tpl');
}
}
示例5: show
public function show()
{
// Get the enabled features
$features = ApplicationFeature::getEnabledFeaturesForStudent($this->student, $this->term);
$tpl = array();
if (Term::getTermSem($this->term) == TERM_FALL) {
// If it's fall, then it's really the fall & spring terms
$tpl['TERM'] = Term::toString($this->term) . ' - ' . Term::toString(Term::getNextTerm($this->term));
} else {
$tpl['TERM'] = Term::toString($this->term);
}
// In case there are no features enabled for this term
if (empty($features)) {
$tpl['BLOCKS'][] = array('BLOCK' => 'There are no options currently available to you for this term.');
}
foreach ($features as $feat) {
$tpl['BLOCKS'][] = array('BLOCK' => $feat->getMenuBlockView($this->student)->show());
}
return PHPWS_Template::process($tpl, 'hms', 'student/studentMenuTermBlock.tpl');
}
示例6: show
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');
}
示例7: show
public function show()
{
$tpl = array();
$tpl['TERM'] = Term::toString($this->term) . ' - ' . Term::toString(Term::getNextTerm($this->term));
$halls = ResidenceHallFactory::getHallsForTerm($this->term);
// Check for an RLC Assignment, and that it's in the correct state
if ($this->rlcAssignment != null && $this->rlcAssignment->getStateName() == 'selfselect-invite') {
$rlcId = $this->rlcAssignment->getRlc()->getId();
} else {
$rlcId = null;
}
// A watch variable, set to true when we find at least one hall that
// still has an available bed
$somethingsAvailable = false;
foreach ($halls as $hall) {
$row = array();
$row['HALL_NAME'] = $hall->hall_name;
$row['ROW_TEXT_COLOR'] = 'black';
# Make sure we have a room of the specified gender available in the hall (or a co-ed room)
if ($hall->count_avail_lottery_rooms($this->student->getGender(), $rlcId) <= 0) {
$row['ROW_TEXT_COLOR'] = ' class="text-muted"';
$tpl['hall_list'][] = $row;
continue;
} else {
$somethingsAvailable = true;
}
$chooseCmd = CommandFactory::getCommand('LotteryChooseHall');
$chooseCmd->setHallId($hall->id);
$row['HALL_NAME'] = $chooseCmd->getLink($hall->hall_name);
$tpl['hall_list'][] = $row;
}
if (!$somethingsAvailable) {
unset($tpl['hall_list']);
$tpl['NOTHING_LEFT'] = '';
}
Layout::addPageTitle("Choose Hall");
return PHPWS_Template::process($tpl, 'hms', 'student/lottery_choose_hall.tpl');
}
示例8: show
public function show()
{
$tpl = array();
$tpl['DATES'] = HMS_Util::getPrettyDateRange($this->startDate, $this->endDate);
$tpl['STATUS'] = "";
$hardCapReached = LotteryProcess::hardCapReached($this->term);
if (!is_null($this->assignment)) {
// Student has already been assigned.
$tpl['ICON'] = FEATURE_COMPLETED_ICON;
//$tpl['ASSIGNED'] = $this->assignment->where_am_i();
$tpl['ASSIGNED'] = '';
} else {
if ($hardCapReached) {
// Hard cap has been reached
$tpl['ICON'] = FEATURE_LOCKED_ICON;
$tpl['HARD_CAP'] = "";
// dummy tag
} else {
if (!is_null($this->application) && $this->application->isWinner()) {
// Student has won, let them choose their room
$tpl['ICON'] = FEATURE_OPEN_ICON;
$chooseRoomCmd = CommandFactory::getCommand('LotteryShowChooseHall');
$tpl['SELECT_LINK'] = $chooseRoomCmd->getLink('Click here to select your room');
} else {
if (!is_null($this->application)) {
// Student has already re-applied
$tpl['ICON'] = FEATURE_COMPLETED_ICON;
$tpl['ALREADY_APPLIED'] = "";
// dummy tag, text is in template
} else {
if (time() < $this->startDate) {
// Too early
$tpl['ICON'] = FEATURE_NOTYET_ICON;
$tpl['BEGIN_DEADLINE'] = HMS_Util::getFriendlyDate($this->startDate);
} else {
if (time() > $this->endDate) {
// Too late
$tpl['ICON'] = FEATURE_LOCKED_ICON;
// fade out header
$tpl['STATUS'] = "locked";
$tpl['END_DEADLINE'] = HMS_Util::getFriendlyDate($this->endDate);
} else {
if (HMS_Lottery::determineEligibility(UserStatus::getUsername())) {
$tpl['ICON'] = FEATURE_OPEN_ICON;
$reAppCommand = CommandFactory::getCommand('ShowReApplication');
$reAppCommand->setTerm($this->term);
$tpl['ELIGIBLE'] = "";
//dummy tag, text is in template
$tpl['LOTTERY_TERM_1'] = Term::toString($this->term);
$tpl['NEXT_TERM_1'] = Term::toString(Term::getNextTerm($this->term));
$tpl['ENTRY_LINK'] = $reAppCommand->getLink('Click here to re-apply.');
} else {
$tpl['ICON'] = FEATURE_LOCKED_ICON;
$tpl['NOT_ELIGIBLE'] = "";
//dummy tag, text is in template
$tpl['LOTTERY_TERM_2'] = Term::toString($this->term);
$tpl['NEXT_TERM_2'] = Term::toString(Term::getNextTerm($this->term));
}
}
}
}
}
}
}
if (!$hardCapReached && time() > $this->startDate) {
if ($this->roommateRequests != FALSE && !is_null($this->roommateRequests) && $this->assignment != TRUE && !PEAR::isError($this->assignment)) {
$tpl['roommates'] = array();
$tpl['ROOMMATE_REQUEST'] = '';
// dummy tag
foreach ($this->roommateRequests as $invite) {
$cmd = CommandFactory::getCommand('LotteryShowRoommateRequest');
$cmd->setRequestId($invite['id']);
$roommie = StudentFactory::getStudentByUsername($invite['requestor'], $this->term);
$tpl['roommates'][]['ROOMMATE_LINK'] = $cmd->getLink($roommie->getName());
//$tpl['roommates'][]['ROOMMATE_LINK'] = PHPWS_Text::secureLink(HMS_SOAP::get_name($invite['requestor']), 'hms', array('type'=>'student', 'op'=>'lottery_show_roommate_request', 'id'=>$invite['id']));
}
}
}
return PHPWS_Template::process($tpl, 'hms', 'student/menuBlocks/reApplicationMenuBlock.tpl');
}
示例9: sendRlcInviteEmail
public static function sendRlcInviteEmail(Student $student, HMS_Learning_Community $community, $term, $respondByTimestamp)
{
$to = $student->getUsername() . TO_DOMAIN;
$subject = 'Response Needed: Residential Learning Community Invitation';
$tags = array();
$tags['NAME'] = $student->getName();
$tags['COMMUNITY_NAME'] = $community->get_community_name();
$tags['TERM'] = Term::toString($term) . ' - ' . Term::toString(Term::getNextTerm($term));
$tags['COMMUNITY_TERMS_CONDITIONS'] = $community->getTermsConditions();
$tags['RESPOND_BY'] = date("l, F jS, Y", $respondByTimestamp) . ' at ' . date("ga", $respondByTimestamp);
HMS_Email::send_template_message($to, $subject, 'email/RlcInvite.tpl', $tags);
}
示例10: show
public function show()
{
PHPWS_Core::initModClass('hms', 'HMS_Lottery.php');
javascript('jquery');
javascript('jquery_ui');
$tpl = array();
$tpl['TERM'] = Term::toString($this->term) . ' - ' . Term::toString(Term::getNextTerm($this->term));
$tpl['FALL_TERM'] = Term::toString($this->term);
/*
* onSubmit command
*/
$form = new PHPWS_Form();
$submitCmd = CommandFactory::getCommand('ReApplicationFormSubmit');
$submitCmd->setTerm($this->term);
$submitCmd->initForm($form);
/*
* Contact info
*/
if (isset($_REQUEST['number'])) {
$form->addText('number', $_REQUEST['number']);
} else {
$form->addText('number');
}
$form->setSize('number', 10);
$form->setMaxSize('number', 10);
$form->addCssClass('number', 'form-control');
$form->addCheck('do_not_call', 1);
/*********************
* Emergency Contact *
*********************/
$form->addText('emergency_contact_name');
$form->addCssClass('emergency_contact_name', 'form-control');
$form->addText('emergency_contact_relationship');
$form->addCssClass('emergency_contact_relationship', 'form-control');
$form->addText('emergency_contact_phone');
$form->addCssClass('emergency_contact_phone', 'form-control');
$form->addText('emergency_contact_email');
$form->addCssClass('emergency_contact_email', 'form-control');
$form->addTextArea('emergency_medical_condition');
$form->addCssClass('emergency_medical_condition', 'form-control');
/*
if(!is_null($this->existingApplication)){
$form->setValue('emergency_contact_name', $this->existingApplication->getEmergencyContactName());
$form->setValue('emergency_contact_relationship', $this->existingApplication->getEmergencyContactRelationship());
$form->setValue('emergency_contact_phone', $this->existingApplication->getEmergencyContactPhone());
$form->setValue('emergency_contact_email', $this->existingApplication->getEmergencyContactEmail());
$form->setValue('emergency_medical_condition', $this->existingApplication->getEmergencyMedicalCondition());
}
*/
/******************
* Missing Person *
******************/
$form->addText('missing_person_name');
$form->addCssClass('missing_person_name', 'form-control');
$form->addText('missing_person_relationship');
$form->addCssClass('missing_person_relationship', 'form-control');
$form->addText('missing_person_phone');
$form->addCssClass('missing_person_phone', 'form-control');
$form->addText('missing_person_email');
$form->addCssClass('missing_person_email', 'form-control');
/*
if(!is_null($this->existingApplication)){
$form->setValue('missing_person_name', $this->existingApplication->getMissingPersonName());
$form->setValue('missing_person_relationship', $this->existingApplication->getMissingPersonRelationship());
$form->setValue('missing_person_phone', $this->existingApplication->getMissingPersonPhone());
$form->setValue('missing_person_email', $this->existingApplication->getMissingPersonEmail());
}
*/
/*
* Meal Plan
*/
$mealPlans = array(BANNER_MEAL_LOW => _('Low'), BANNER_MEAL_STD => _('Standard'), BANNER_MEAL_HIGH => _('High'), BANNER_MEAL_SUPER => _('Super'));
$form->addDropBox('meal_plan', $mealPlans);
$form->setLabel('meal_plan', 'Meal plan: ');
$form->setMatch('meal_plan', BANNER_MEAL_STD);
$form->addCssClass('meal_plan', 'form-control');
/*
* Special interest stuff
*/
// RLC
$form->addCheck('rlc_interest', array('rlc_interest'));
$form->setLabel('rlc_interest', "I'm interested in applying for (or continuing in) a Residential Learning Community.");
/*
* Special needs
*/
$form->addCheck('special_need', array('special_need'));
$form->setLabel('special_need', array('Yes, I require special needs housing.'));
if (isset($_REQUEST['special_need'])) {
$form->setMatch('special_need', $_REQUEST['special_need']);
}
/*
* Early Release
*/
$nextTerm = Term::toString(Term::getNextTerm($this->term));
$reasons = array();
$reasons['no'] = "No, I'll be staying through {$nextTerm}.";
$reasons['grad'] = "Graduating in December";
$reasons['student_teaching'] = "Student Teaching in Spring";
$reasons['internship'] = "ASU-sponsored Internship";
$reasons['transfer'] = "Transferring to other University";
//.........这里部分代码省略.........
示例11: send_roommate_reminder_emails
public static function send_roommate_reminder_emails($term)
{
PHPWS_Core::initModClass('hms', 'HMS_Bed.php');
PHPWS_Core::initModclass('hms', 'StudentFactory.php');
// Get a list of outstanding roommate requests, send them reminder emails
$query = "select hms_lottery_reservation.* FROM hms_lottery_reservation\n LEFT OUTER JOIN (SELECT asu_username FROM hms_assignment WHERE term={$term} AND lottery = 1) as foo ON hms_lottery_reservation.asu_username = foo.asu_username\n WHERE foo.asu_username IS NULL\n AND hms_lottery_reservation.expires_on > " . time();
$result = PHPWS_DB::getAll($query);
if (PEAR::isError($result)) {
PHPWS_Error::log($result);
test($result, 1);
}
$year = Term::toString($term) . ' - ' . Term::toString(Term::getNextTerm($term));
foreach ($result as $row) {
$student = StudentFactory::getStudentByUsername($row['asu_username'], $term);
$requestor = StudentFactory::getStudentByUsername($row['requestor'], $term);
$bed = new HMS_Bed($row['bed_id']);
$hall_room = $bed->where_am_i();
HMS_Email::send_lottery_roommate_reminder($row['asu_username'], $student->getName(), $row['expires_on'], $requestor->getName(), $hall_room, $year);
HMS_Activity_Log::log_activity($row['asu_username'], ACTIVITY_LOTTERY_ROOMMATE_REMINDED, 'hms');
}
}
示例12: execute
public function execute(CommandContext $context)
{
PHPWS_Core::initModClass('hms', 'StudentFactory.php');
PHPWS_Core::initModClass('hms', 'WaitingListApplication.php');
PHPWS_Core::initModClass('hms', 'HMS_Lottery.php');
PHPWS_Core::initModClass('hms', 'HMS_Activity_Log.php');
PHPWS_Core::initModClass('hms', 'HMS_Email.php');
$term = $context->get('term');
$errorCmd = CommandFactory::getCommand('ShowOffCampusWaitListApplication');
$errorCmd->setTerm($term);
$student = StudentFactory::getStudentByUsername(UserStatus::getUsername(), $term);
// Data sanity checking
$doNotCall = $context->get('do_not_call');
$areaCode = $context->get('area_code');
$exchange = $context->get('exchange');
$number = $context->get('number');
if (is_null($doNotCall)) {
// do not call checkbox was not selected, so check the number
if (is_null($areaCode) || is_null($exchange) || is_null($number)) {
NQ::simple('hms', hms\NotificationView::ERROR, 'Please provide a cell-phone number or click the checkbox stating that you do not wish to share your number with us.');
$errorCmd->redirect();
}
}
if (!is_null($doNotCall)) {
$cellPhone = null;
} else {
$cellPhone = $areaCode . $exchange . $number;
}
$mealPlan = $context->get('meal_plan');
$specialNeeds = $context->get('special_needs');
$physicalDisability = isset($specialNeeds['physical_disability']) ? 1 : 0;
$psychDisability = isset($specialNeeds['psych_disability']) ? 1 : 0;
$genderNeed = isset($specialNeeds['gender_need']) ? 1 : 0;
$medicalNeed = isset($specialNeeds['medical_need']) ? 1 : 0;
$international = $student->isInternational();
$application = new WaitingListApplication(0, $term, $student->getBannerId(), $student->getUsername(), $student->getGender(), $student->getType(), $student->getApplicationTerm(), $cellPhone, $mealPlan, $physicalDisability, $psychDisability, $genderNeed, $medicalNeed, $international);
$application->setEmergencyContactName($context->get('emergency_contact_name'));
$application->setEmergencyContactRelationship($context->get('emergency_contact_relationship'));
$application->setEmergencyContactPhone($context->get('emergency_contact_phone'));
$application->setEmergencyContactEmail($context->get('emergency_contact_email'));
$application->setEmergencyMedicalCondition($context->get('emergency_medical_condition'));
$application->setMissingPersonName($context->get('missing_person_name'));
$application->setMissingPersonRelationship($context->get('missing_person_relationship'));
$application->setMissingPersonPhone($context->get('missing_person_phone'));
$application->setMissingPersonEmail($context->get('missing_person_email'));
try {
$application->save();
} catch (Exception $e) {
NQ::simple('hms', hms\NotificationView::ERROR, 'There was an error saving your application. Please try again or contact the Department of University Housing.');
$errorCmd->redirect();
}
// Log the fact that the entry was saved
HMS_Activity_Log::log_activity(UserStatus::getUsername(), ACTIVITY_LOTTERY_ENTRY, UserStatus::getUsername());
// Send a confirmation email
$year = Term::toString($term) . ' - ' . Term::toString(Term::getNextTerm($term));
HMS_Email::sendWaitListApplicationConfirmation($student, $year);
// Show a sucess message and redirect to the main menu
NQ::simple('hms', hms\NotificationView::SUCCESS, 'Your application to the Open Waiting List was submitted successfully.');
$cmd = CommandFactory::getCommand('ShowStudentMenu');
$cmd->redirect();
}
示例13: execute
public function execute(CommandContext $context)
{
$currentTerm = Term::getCurrentTerm();
$username = UserStatus::getUsername();
# Create a contact form command, redirect to it in case of error.
$contactCmd = CommandFactory::getCommand('ShowContactForm');
//TODO add try catch blocks here for StudentNotFound exception
$student = StudentFactory::getStudentByUsername($username, $currentTerm);
$applicationTerm = $student->getApplicationTerm();
// In case this is a new freshmen, they'll likely have no student type in the "current" term.
// So, instead, we need to lookup the student in their application term.
if ($applicationTerm > $currentTerm) {
$student = StudentFactory::getStudentByUsername($username, $applicationTerm);
}
$studentType = $student->getType();
$studentClass = $student->getClass();
$dob = $student->getDob();
# Check for banner errors in any of these calls
if (empty($applicationTerm) || empty($studentType) || empty($studentClass) || empty($dob) || is_null($dob)) {
# TODO: HMS_Mail here
PHPWS_Error::log('Initial banner lookup failed', 'hms', 'show_welcome_screen', "username: " . UserStatus::getUsername());
$badDataCmd = CommandFactory::getCommand('ShowBadBannerData');
$badDataCmd->redirect();
}
# Recreate the student object using the student's application term
$student = StudentFactory::getStudentByUsername($username, $applicationTerm);
# Check for an assignment in the current term. So far, this only matters for type 'Z' (readmit) students
$assignment = HMS_Assignment::checkForAssignment($username, $currentTerm);
/******************************************
* Sort returning students (lottery) from *
* freshmen (first-time application) *
******************************************/
# Check application term for past or future
if ($applicationTerm <= $currentTerm || $studentType == TYPE_READMIT && $assignment === TRUE) {
/**************
* Continuing *
**************/
# Application term is in the past
/*
* There's an exception above for type 'Z' (readmit) students.
* Their application terms will be in the past. They're considered continuing if they're
* already assigned. Otherwise, (not assigned) they're considered freshmen
*/
# Redirect to the returning student menu
$cmd = CommandFactory::getCommand('ShowReturningStudentMenu');
$cmd->redirect();
} else {
if ($applicationTerm > $currentTerm || $studentType == TYPE_READMIT) {
/**
* Exception for type 'Z' (readmit) students.
* Their application term is in the past, but they should be treated as freshmen/transfer
*/
/**
* This is somehwat of a hack for type 'Z' (readmit) students.
* This code sets the student's application term to the term after the current term, since type Z students.
* This makes *everything* else work right.
*/
if ($studentType == TYPE_READMIT) {
$applicationTerm = Term::getNextTerm(Term::getCurrentTerm());
//TODO find a way around this, because this doesn't work
$_SESSION['application_term'] = $application_term;
}
/*********************
* Incoming Freshmen *
*********************/
# Application term is in the future
# Check the student type, must be freshmen, transfer, readmit, or non-degree
/** Commenting this out since we have freshmen students with future application terms with student types of 'C'
if(!$student->isInternational() && $studentType != TYPE_FRESHMEN && $studentType != TYPE_TRANSFER && $studentType != TYPE_RETURNING && $studentType != TYPE_READMIT && $studentType != TYPE_NONDEGREE){
# No idea what's going on here, send to a contact page
$contactCmd->redirect();
}
*/
# Make sure the user's application term exists in hms_term,
# otherwise give a "too early" message
if (!Term::isValidTerm($applicationTerm)) {
PHPWS_Core::initModClass('hms', 'WelcomeScreenViewInvalidTerm.php');
$view = new WelcomeScreenViewInvalidTerm($applicationTerm, $contactCmd);
$context->setContent($view->show());
return;
}
# Make sure the student doesn't already have an assignment on file for the current term
if (HMS_Assignment::checkForAssignment($username, $currentTerm)) {
# No idea what's going on here, send to a contact page
$contactCmd->redirect();
}
# Check to see if the user has an application on file already for every required term
# If so, forward to main menu
$requiredTerms = HousingApplication::checkAppliedForAllRequiredTerms($student);
if (count($requiredTerms) > 0) {
# Student is missing a required application, so redirect to the application form for that term
$appCmd = CommandFactory::getCommand('ShowHousingApplicationWelcome');
$appCmd->setTerm($requiredTerms[0]);
$appCmd->redirect();
} else {
$menuCmd = CommandFactory::getCommand('ShowFreshmenMainMenu');
$menuCmd->redirect();
}
}
}
//.........这里部分代码省略.........
示例14: show
public function show()
{
$tpl = array();
$tpl['NAME'] = $this->student->getFullName();
$tpl['TERM'] = Term::toString($this->term) . ' - ' . Term::toString(Term::getNextTerm($this->term));
$form = new PHPWS_Form();
$submitCmd = CommandFactory::getCommand('ReApplicationWaitingListFormSubmit');
$submitCmd->setTerm($this->term);
$submitCmd->initForm($form);
if (isset($_REQUEST['area_code'])) {
$form->addText('area_code', $_REQUEST['area_code']);
} else {
$form->addText('area_code');
}
$form->setSize('area_code', 3);
$form->setMaxSize('area_code', 3);
if (isset($_REQUEST['exchange'])) {
$form->addText('exchange', $_REQUEST['exchange']);
} else {
$form->addText('exchange');
}
$form->setSize('exchange', 3);
$form->setMaxSize('exchange', 3);
if (isset($_REQUEST['number'])) {
$form->addText('number', $_REQUEST['number']);
} else {
$form->addText('number');
}
$form->setSize('number', 4);
$form->setMaxSize('number', 4);
$form->addCheck('do_not_call', 1);
/*********************
* Emergency Contact *
*********************/
$form->addText('emergency_contact_name');
$form->addText('emergency_contact_relationship');
$form->addText('emergency_contact_phone');
$form->addText('emergency_contact_email');
$form->addTextArea('emergency_medical_condition');
/*
if(!is_null($this->existingApplication)){
$form->setValue('emergency_contact_name', $this->existingApplication->getEmergencyContactName());
$form->setValue('emergency_contact_relationship', $this->existingApplication->getEmergencyContactRelationship());
$form->setValue('emergency_contact_phone', $this->existingApplication->getEmergencyContactPhone());
$form->setValue('emergency_contact_email', $this->existingApplication->getEmergencyContactEmail());
$form->setValue('emergency_medical_condition', $this->existingApplication->getEmergencyMedicalCondition());
}
*/
/******************
* Missing Person *
******************/
$form->addText('missing_person_name');
$form->addText('missing_person_relationship');
$form->addText('missing_person_phone');
$form->addText('missing_person_email');
/*
if(!is_null($this->existingApplication)){
$form->setValue('missing_person_name', $this->existingApplication->getMissingPersonName());
$form->setValue('missing_person_relationship', $this->existingApplication->getMissingPersonRelationship());
$form->setValue('missing_person_phone', $this->existingApplication->getMissingPersonPhone());
$form->setValue('missing_person_email', $this->existingApplication->getMissingPersonEmail());
}
*/
$mealPlans = array(BANNER_MEAL_LOW => _('Low'), BANNER_MEAL_STD => _('Standard'), BANNER_MEAL_HIGH => _('High'), BANNER_MEAL_SUPER => _('Super'));
$form->addDropBox('meal_plan', $mealPlans);
$form->setLabel('meal_plan', 'Meal plan: ');
$form->setMatch('meal_plan', BANNER_MEAL_STD);
$form->addCheck('special_need', array('special_need'));
$form->setLabel('special_need', array('Yes, I require special needs housing.'));
if (isset($_REQUEST['special_need'])) {
$form->setMatch('special_need', $_REQUEST['special_need']);
}
$form->addCheck('deposit_check', array('deposit_check'));
$form->setLabel('deposit_check', 'I understand & acknowledge that if I cancel my License Contract after I am assigned a space in a residence hall my student account will be charged $250. If I cancel my License Contract after July 1, I will be liable for the entire amount of the on-campus housing fees for the Fall semester.');
$form->addSubmit('submit', 'Submit waiting list application');
$form->mergeTemplate($tpl);
return PHPWS_Template::process($form->getTemplate(), 'hms', 'student/reapplicationOffcampus.tpl');
}
示例15: show
public function show()
{
$tpl = array();
$tpl['DATES'] = HMS_Util::getPrettyDateRange($this->startDate, $this->endDate);
$tpl['STATUS'] = "";
if (isset($this->assignment) && $this->assignment->getStateName() == 'declined') {
// Student declined the invite
$tpl['ICON'] = FEATURE_LOCKED_ICON;
$tpl['DECLINED'] = "";
//dummy tag
} else {
if (isset($this->application) && !is_null($this->application->id) && isset($this->assignment) && $this->assignment->getStateName() == 'confirmed') {
// Student has applied, been accepted, been invited, and confirmed that invitation to a particular community. The student can no longer view/edit the application.
$tpl['ICON'] = FEATURE_COMPLETED_ICON;
$tpl['CONFIRMED_RLC_NAME'] = $this->assignment->getRlcName();
} else {
if (isset($this->assignment) && $this->assignment->getStateName() == 'invited') {
// Studnet has applied, been assigned, and been sent an invite email
$tpl['ICON'] = FEATURE_COMPLETED_ICON;
$tpl['INVITED_COMMUNITY_NAME'] = $this->assignment->getRlcName();
$acceptCmd = CommandFactory::getCommand('ShowAcceptRlcInvite');
$acceptCmd->setTerm($this->term);
$tpl['INVITED_CONFIRM_LINK'] = $acceptCmd->getLink('accept or decline your invitation');
} else {
if (!is_null($this->rlcApp)) {
// Student has already re-applied
$tpl['ICON'] = FEATURE_COMPLETED_ICON;
$tpl['ALREADY_APPLIED'] = "";
// dummy tag, text is in template
} else {
if (time() < $this->startDate) {
// Too early
$tpl['ICON'] = FEATURE_NOTYET_ICON;
$tpl['BEGIN_DEADLINE'] = HMS_Util::getFriendlyDate($this->startDate);
} else {
if (time() > $this->endDate) {
// Too late
$tpl['ICON'] = FEATURE_LOCKED_ICON;
// fade out header
$tpl['STATUS'] = "locked";
$tpl['END_DEADLINE'] = HMS_Util::getFriendlyDate($this->endDate);
} else {
// Student has not re-applied yet
if (is_null($this->application)) {
# No housing application, therefore not eligible
$tpl['ICON'] = FEATURE_LOCKED_ICON;
$tpl['NOT_ELIGIBLE'] = "";
//dummy tag, text is in template
$tpl['LOTTERY_TERM_2'] = Term::toString($this->term);
$tpl['NEXT_TERM_2'] = Term::toString(Term::getNextTerm($this->term));
} else {
# Eligible
$tpl['ICON'] = FEATURE_OPEN_ICON;
$reAppCommand = CommandFactory::getCommand('ShowRlcReapplication');
$reAppCommand->setTerm($this->term);
$tpl['ELIGIBLE'] = "";
//dummy tag, text is in template
$tpl['LOTTERY_TERM_1'] = Term::toString($this->term);
$tpl['NEXT_TERM_1'] = Term::toString(Term::getNextTerm($this->term));
$tpl['ENTRY_LINK'] = $reAppCommand->getLink('Click here to re-apply.');
}
}
}
}
}
}
}
return PHPWS_Template::process($tpl, 'hms', 'student/menuBlocks/rlcReapplicationMenuBlock.tpl');
}