public function show() { PHPWS_Core::initCoreClass('Form.php'); javascript('jquery'); javascript('modules/hms/assign_student'); $unassignCmd = CommandFactory::getCommand('UnassignStudent'); $form = new PHPWS_Form(); $unassignCmd->initForm($form); $form->addText('username'); if (!is_null($this->student)) { $form->setValue('username', $this->student->getUsername()); } $form->addCssClass('username', 'form-control'); $form->setExtra('username', 'autofocus'); // Addition of "Unassignment Type" $form->addDropBox('unassignment_type', array('-1' => 'Choose a reason...', UNASSIGN_ADMIN => 'Administrative', UNASSIGN_REASSIGN => 'Re-assign', UNASSIGN_CANCEL => 'Contract Cancellation', UNASSIGN_PRE_SPRING => 'Pre-spring room change', UNASSIGN_RELEASE => 'Contract Release')); //$form->setMatch('unassignment_type', UNASSIGN_ADMIN); $form->setLabel('unassignment_type', 'Unassignment Type: '); $form->addCssClass('unassignment_type', 'form-control'); $form->addText('refund'); $form->setLabel('refund', 'Refund Percentage'); $form->setSize('refund', 4); $form->setMaxSize('refund', 3); $form->addCssClass('refund', 'form-control'); $form->addTextarea('note'); $form->setLabel('note', 'Note: '); $form->addCssClass('note', 'form-control'); $tpl = $form->getTemplate(); $tpl['TERM'] = Term::getPrintableSelectedTerm(); Layout::addPageTitle("Unassign Student"); return PHPWS_Template::process($tpl, 'hms', 'admin/unassignStudent.tpl'); }
public function show() { PHPWS_Core::initModClass('hms', 'HMS_Util.php'); $tpl = array(); $tpl['TITLE'] = 'Edit Move-in Times'; $form = new PHPWS_Form(); $form->addDropBox('begin_day', HMS_Util::get_days()); $form->addCssClass('begin_day', 'form-control'); $form->addDropBox('begin_month', HMS_Util::get_months()); $form->addCssClass('begin_month', 'form-control'); $form->addDropBox('begin_year', HMS_Util::get_years_2yr()); $form->addCssClass('begin_year', 'form-control'); $form->addDropBox('begin_hour', HMS_Util::get_hours()); $form->addCssClass('begin_hour', 'form-control'); $form->addDropBox('end_day', HMS_Util::get_days()); $form->addCssClass('end_day', 'form-control'); $form->addDropBox('end_month', HMS_Util::get_months()); $form->addCssClass('end_month', 'form-control'); $form->addDropBox('end_year', HMS_Util::get_years_2yr()); $form->addCssClass('end_year', 'form-control'); $form->addDropBox('end_hour', HMS_Util::get_hours()); $form->addCssClass('end_hour', 'form-control'); $form->addSubmit('submit', 'Create'); $cmd = CommandFactory::getCommand('CreateMoveinTime'); $cmd->initForm($form); $tpl['MOVEIN_TIME_PAGER'] = HMS_Movein_Time::get_movein_times_pager(); $form->mergeTemplate($tpl); $tpl = $form->getTemplate(); Layout::addPageTitle("Move-in Times"); return PHPWS_Template::process($tpl, 'hms', 'admin/edit_movein_time.tpl'); }
public function show() { Layout::addPageTitle("View By RLC"); PHPWS_Core::initModClass('hms', 'RlcRosterPager.php'); $rosterPager = new RlcRosterPager($this->rlc); return $rosterPager->get(); }
public function show() { $tpl = array(); $tpl['TERM'] = Term::toString($this->room->getTerm()); $tpl['TITLE'] = 'Add New Bed'; $tpl['HALL_NAME'] = $this->hall->getLink(); $tpl['FLOOR_NUMBER'] = $this->floor->getLink(); $tpl['ROOM_NUMBER'] = $this->room->getLink(); $tpl['ASSIGNED_TO'] = '<unassigned>'; $submitCmd = CommandFactory::getCommand('AddBed'); $submitCmd->setRoomId($this->room->id); $tpl['HALL_ABBR'] = $this->hall->getBannerBuildingCode(); $form = new PHPWS_Form(); $submitCmd->initForm($form); if (isset($this->bedLetter)) { $form->addText('bed_letter', $this->bedLetter); } else { $form->addText('bed_letter', chr($this->room->get_number_of_beds() + 97)); } $form->addCssClass('bed_letter', 'form-control'); if (isset($this->bedroomLabel)) { $form->addText('bedroom_label', $this->bedroomLabel); } else { $form->addText('bedroom_label', 'a'); } $form->addCssClass('bedroom_label', 'form-control'); if (isset($this->phoneNumber)) { $form->addText('phone_number', $this->phoneNumber); } else { // Try to guess at the phone number $beds = $this->room->get_beds(); if (sizeof($beds) > 0) { $form->addText('phone_number', $beds[0]->phone_number); } else { $form->addText('phone_number'); } } $form->setMaxSize('phone_number', 4); $form->setSize('phone_number', 5); $form->addCssClass('phone_number', 'form-control'); if (isset($this->bannerId)) { $form->addText('banner_id', $this->bannerId); } else { // try to guess a the banner ID // Strip any text out of the room number, just get the numbers $match = null; preg_match("/[0-9]*/", $this->room->room_number, $match); $roomNumber = $match[0]; $form->addText('banner_id', '0' . $roomNumber . ($this->room->get_number_of_beds() + 1)); } $form->addCssClass('banner_id', 'form-control'); $form->addCheckBox('ra', 1); $form->addCheckBox('ra_roommate', 1); $form->addCheckBox('international_reserved', 1); $form->mergeTemplate($tpl); $tpl = $form->getTemplate(); Layout::addPageTitle("Add Bed"); // Reusing the edit bed template here return PHPWS_Template::process($tpl, 'hms', 'admin/addBed.tpl'); }
public function show() { $form = new PHPWS_Form(); $this->submitCmd->initForm($form); $form->dropElement('special_needs'); $form->addCheck('special_needs', array('physical_disability', 'psych_disability', 'medical_need', 'gender_need')); $form->setLabel('special_needs', array('Physical disability', 'Psychological disability', 'Medical need', 'Transgender housing')); $checked = array(); if (isset($this->specialNeeds['physical_disability'])) { $checked[] = 'physical_disability'; } if (isset($this->specialNeeds['psych_disability'])) { $checked[] = 'psych_disability'; } if (isset($this->specialNeeds['medical_need'])) { $checked[] = 'medical_need'; } if (isset($this->specialNeeds['gender_need'])) { $checked[] = 'gender_need'; } $form->setMatch('special_needs', $checked); $form->addSubmit('submit', 'Continue'); Layout::addPageTitle("Special Needs Form"); return PHPWS_Template::process($form->getTemplate(), 'hms', 'student/special_needs.tpl'); }
public function show() { $tpl = array(); $tpl['TERM'] = Term::getPrintableSelectedTerm(); $form = new PHPWS_Form('roommate_group'); $submitCmd = CommandFactory::getCommand('CreateRoommateGroup'); $submitCmd->initForm($form); if (isset($this->roommate1)) { $form->addText('roommate1', $this->roommate1); } else { $form->addText('roommate1'); } $form->addCssClass('roommate1', 'form-control'); $form->setExtra('roommate1', 'autofocus'); if (isset($this->roommate1)) { $form->addText('roommate2', $this->roommate2); } else { $form->addText('roommate2'); } $form->addCssClass('roommate2', 'form-control'); $form->mergeTemplate($tpl); $tpl = $form->getTemplate(); Layout::addPageTitle("Create Roommate Group"); return PHPWS_Template::process($tpl, 'hms', 'admin/createRoommateGroup.tpl'); }
public function show() { $tpl = array(); if ($this->halls == NULL) { NQ::simple('hms', hms\NotificationView::ERROR, 'There are no halls available for the selected term.'); $cmd = CommandFactory::getCommand('ShowAdminMaintenanceMenu'); $cmd->redirect(); } $tpl['TITLE'] = $this->title; $tpl['TERM'] = Term::getPrintableSelectedTerm(); javascript('jquery'); javascript('modules/hms/select_floor'); # Setup the form $form = new PHPWS_Form(); $this->onSelectCmd->initForm($form); $form->setMethod('get'); $form->addDropBox('residence_hall', $this->halls); $form->setLabel('residence_hall', 'Residence hall'); $form->setMatch('residence_hall', 0); $form->setClass('residence_hall', 'form-control'); $form->addDropBox('floor', array(0 => '')); $form->setLabel('floor', 'Floor'); $form->setClass('floor', 'form-control'); $form->addSubmit('submit_button', 'Select'); $form->mergeTemplate($tpl); $tpl = $form->getTemplate(); Layout::addPageTitle("Select Floor"); return PHPWS_Template::process($tpl, 'hms', 'admin/select_floor.tpl'); }
public function show() { $tpl = array(); $tpl['LOGOUT_LINK'] = PHPWS_Text::secureLink(_('Log Out'), 'users', array('action' => 'user', 'command' => 'logout')); Layout::addPageTitle("Contact"); return PHPWS_Template::process($tpl, 'hms', 'student/contact_form_thankyou.tpl'); }
public function show() { Layout::addPageTitle("Hall Notification Edit"); $tpl = array(); $submitCmd = CommandFactory::getCommand('ReviewHallNotificationMessage'); $form = new PHPWS_Form('email_content'); $submitCmd->initForm($form); if (Current_User::allow('hms', 'anonymous_notifications')) { $form->addCheck('anonymous'); $form->setMatch('anonymous', $this->anonymous); $form->setLabel('anonymous', 'Send Anonymously'); } $form->addText('subject', !is_null($this->subject) ? $this->subject : ''); $form->setLabel('subject', 'Subject'); $form->addCssClass('subject', 'form-control'); $form->setSize('subject', 35); $form->setExtra('subject', 'autofocus'); $form->addTextarea('body', !is_null($this->body) ? $this->body : ''); $form->addCssClass('body', 'form-control'); $form->setLabel('body', 'Message:'); if (!empty($this->halls)) { $form->addHidden('hall', $this->halls); } if (!empty($this->floors)) { $form->addHidden('floor', $this->floors); } return PHPWS_Template::process($form->getTemplate(), 'hms', 'admin/hall_notification_email_page.tpl'); }
/** * Shows the requested report's HTML output. * * @param CommandContext $context * @throws InvalidArgumentExection */ public function execute(CommandContext $context) { if (!Current_User::allow('hms', 'reports')) { PHPWS_Core::initModClass('hms', 'exception/PermissionException.php'); throw new PermissionException('You do no have permission to run reports.'); } $reportId = $context->get('reportId'); if (!isset($reportId) || is_null($reportId)) { throw new InvalidArgumentExection('Missing report id.'); } // Instantiate the report controller with the requested report id PHPWS_Core::initModClass('hms', 'ReportFactory.php'); $report = ReportFactory::getReportById($reportId); Layout::addPageTitle($report->getFriendlyName()); $detailCmd = CommandFactory::getCommand('ShowReportDetail'); $detailCmd->setReportClass($report->getClass()); $content = '<div> ' . $detailCmd->getLink('« back') . ' </div>'; $content .= file_get_contents($report->getHtmlOutputFilename()); if ($content === FALSE) { NQ::simple('hms', hms\NotificationView::ERROR, 'Could not open report file.'); PHPWS_Error::log('Could not open report file ' . $report->getCsvOutputFilename(), 'hms'); $reportCmd = CommandFactory::getCommand('ShowReportDetail'); $reportCmd->setReportClass($report->getClass()); $reportCmd->redirect(); } $context->setContent($content); }
public function show() { $tpl = array(); $tpl['TERM'] = Term::getPrintableSelectedTerm(); $tpl['NAME'] = $this->student->getFullName(); $tpl['LOCATION'] = $this->assignment->where_am_i(); $submitCmd = CommandFactory::getCommand('AssignStudent'); $submitCmd->setUsername($this->student->getUsername()); $submitCmd->setRoom($this->room); $submitCmd->setBed($this->bed); $submitCmd->setMealPlan($this->mealPlan); $submitCmd->setMoveConfirmed("true"); $submitCmd->setAssignmentType($this->assignmentType); $submitCmd->setNotes($this->notes); $form = new PHPWS_Form(); $submitCmd->initForm($form); $form->addSubmit('submit', 'Confirm Move'); $form->setClass('submit', 'btn btn-danger'); $form->mergeTemplate($tpl); $tpl = $form->getTemplate(); if (!empty($_SERVER['HTTP_REFERER'])) { $tpl['BACK'] = $_SERVER['HTTP_REFERER']; } else { $tpl['BACK'] = 'index.php?module=hms&action=ShowAssignStudent'; } Layout::addPageTitle("Assignment Move Confirmation"); return PHPWS_Template::process($tpl, 'hms', 'admin/assign_student_move_confirm.tpl'); }
public function show() { PHPWS_Core::initModClass('hms', 'HMS_Lottery.php'); $tpl = array(); $form = new PHPWS_Form(); $submitCmd = CommandFactory::getCommand('LotterySettingsSubmit'); $submitCmd->initForm($form); $form->addDropBox('lottery_term', Term::getTermsAssoc()); $form->setMatch('lottery_term', PHPWS_Settings::get('hms', 'lottery_term')); $form->setLabel('lottery_term', 'Lottery Term'); $form->setClass('lottery_term', 'form-control'); $form->addText('hard_cap'); $form->setLabel('hard_cap', 'Max # Returning Students (hard cap):'); $form->setValue('hard_cap', PHPWS_Settings::get('hms', 'lottery_hard_cap')); $form->setClass('hard_cap', 'form-control'); /* $form->addText('soph_goal'); $form->setLabel('soph_goal', 'Sophomores:'); $form->setValue('soph_goal', PHPWS_Settings::get('hms', 'lottery_soph_goal')); */ $form->addText('jr_goal'); $form->setLabel('jr_goal', 'Juniors:'); $form->setValue('jr_goal', PHPWS_Settings::get('hms', 'lottery_jr_goal')); $form->setClass('jr_goal', 'form-control'); $form->addText('sr_goal'); $form->setLabel('sr_goal', 'Senior:'); $form->setValue('sr_goal', PHPWS_Settings::get('hms', 'lottery_sr_goal')); $form->setClass('sr_goal', 'form-control'); $form->addSubmit('submit', 'Save'); $form->mergeTemplate($tpl); Layout::addPageTitle("Lottery Settings"); return PHPWS_Template::process($form->getTemplate(), 'hms', 'admin/lottery_settings.tpl'); }
public function show() { PHPWS_Core::initModClass('hms', 'HMS_Learning_Community.php'); PHPWS_Core::initModClass('hms', 'HMS_RLC_Application.php'); PHPWS_Core::initModClass('hms', 'HMS_RLC_Assignment.php'); Layout::addPageTitle("RLC Application Review"); $tags = array(); if (UserStatus::isAdmin()) { $menuCmd = CommandFactory::getCommand('ShowAssignRlcApplicants'); $tags['MENU_LINK'] = $menuCmd->getURI(); } else { $menuCmd = CommandFactory::getCommand('ShowStudentMenu'); $tags['MENU_LINK'] = $menuCmd->getURI(); } $tags['FULL_NAME'] = $this->student->getFullName(); $tags['STUDENT_TYPE'] = $this->student->getPrintableType(); $tags['TERM'] = Term::toString($this->application->getTerm()); $appType = $this->application->getApplicationType(); if ($appType == RLC_APP_FRESHMEN) { $tags['APPLICATION_TYPE'] = 'Freshmen'; } else { if ($appType == RLC_APP_RETURNING) { $tags['APPLICATION_TYPE'] = 'Re-application'; } } $rlcs = HMS_Learning_Community::getRlcList(); $tags['FIRST_CHOICE'] = $rlcs[$this->application->rlc_first_choice_id]; if (isset($this->application->rlc_second_choice_id)) { $tags['SECOND_CHOICE'] = $rlcs[$this->application->rlc_second_choice_id]; } if (isset($this->application->rlc_third_choice_id)) { $tags['THIRD_CHOICE'] = $rlcs[$this->application->rlc_third_choice_id]; } $tags['WHY_SPECIFIC'] = $this->application->why_specific_communities; $tags['STRENGTHS_AND_WEAKNESSES'] = $this->application->strengths_weaknesses; $tags['WHY_FIRST_CHOICE'] = $this->application->rlc_question_0; if (isset($this->application->rlc_second_choice_id)) { $tags['WHY_SECOND_CHOICE'] = $this->application->rlc_question_1; } if (isset($this->application->rlc_second_choice_id)) { $tags['WHY_THIRD_CHOICE'] = $this->application->rlc_question_2; } // If this application is denied and the person logged in is an admin, show a warning if ($this->application->isDenied() && UserStatus::isAdmin()) { NQ::simple('hms', hms\NotificationView::WARNING, 'This application has been denied.'); } // Show options depending of status of application. if (UserStatus::isAdmin() && Current_User::allow('hms', 'approve_rlc_applications')) { if (!$this->application->denied && !HMS_RLC_Assignment::checkForAssignment($this->student->getUsername(), Term::getSelectedTerm())) { // Approve application for the community selected from dropdown $approvalForm = $this->getApprovalForm(); $approvalForm->mergeTemplate($tags); $tags = $approvalForm->getTemplate(); // Deny application $tags['DENY_APP'] = $this->getDenialLink(); } } return PHPWS_Template::process($tags, 'hms', 'student/rlc_application.tpl'); }
public function show() { $tpl = array(); $contactCmd = CommandFactory::getCommand('ShowContactForm'); $tpl['CONTACT_LINK'] = $contactCmd->getLink('click here to contact us.'); Layout::addPageTitle("Contact"); return PHPWS_Template::process($tpl, 'hms', 'student/badBannerDataView.tpl'); }
public function show() { $tpl = array(); $tpl['MAIN'] = $this->getMain(); $tpl['MESSAGE'] = $this->getMessage(); $tpl['NOTIFICATIONS'] = $this->notifications; \Layout::addPageTitle("Login"); $this->showHMS(\PHPWS_Template::process($tpl, 'hms', 'guest.tpl')); }
public function show() { $tpl = array(); $tpl['PAGER'] = $this->roommatePager->show(); $tpl['TERM'] = Term::getPrintableSelectedTerm(); $createCmd = CommandFactory::getCommand('CreateRoommateGroupView'); $tpl['CREATE_REQUEST_URI'] = $createCmd->getURI(); Layout::addPageTitle("Edit Roommate Group"); return PHPWS_Template::process($tpl, 'hms', 'admin/show_confirmed_roommates.tpl'); }
public function show() { $tpl = array(); $tpl['SUCCESS'] = 'Your roommate request was successfully confirmed. You have been assigned to ' . $this->bed->where_am_i() . "."; $tpl['LOGOUT_LINK'] = UserStatus::getLogoutLink(); $mainMenuCmd = CommandFactory::getCommand('ShowStudentMenu'); $tpl['MAIN_MENU'] = $mainMenuCmd->getLink('Return to the main menu'); Layout::addPageTitle("Thank you"); return PHPWS_Template::process($tpl, 'hms', 'student/lottery_confirm_roommate_thanks.tpl'); }
public function show() { $submitCmd = CommandFactory::getCommand('LotteryAdminSetWinner'); $form = new PHPWS_Form('magic_form'); $submitCmd->initForm($form); $form->addTextArea('banner_ids'); $form->addSubmit('Submit'); Layout::addPageTitle("Automatic Lottery Winners"); return PHPWS_Template::process($form->getTemplate(), 'hms', 'admin/lotteryAutoWinnersView.tpl'); }
public function show() { $tags = array(); $tags['CONTENT'] = $this->pager->show(); $tags['FILTERS'] = ActivityLogView::showFilters($_REQUEST); Layout::addPageTitle("Activity Log"); javascript('jquery_ui'); javascript('modules/hms/note', array('LINK' => 'activity-log-note')); return PHPWS_Template::Process($tags, 'hms', 'admin/activity_log_box.tpl'); }
public function show() { $tpl = array(); $tpl['LOCATION'] = $this->room->where_am_i(); $mainMenuCmd = CommandFactory::getCommand('ShowStudentMenu'); $tpl['MAIN_MENU'] = $mainMenuCmd->getLink('Return to the main menu'); $tpl['LOGOUT'] = UserStatus::getLogoutLink(); Layout::addPageTitle("Thank you"); return PHPWS_Template::process($tpl, 'hms', 'student/lottery_choose_room_thanks.tpl'); }
public function show() { if (!UserStatus::isAdmin() || !Current_User::allow('hms', 'edit_terms')) { PHPWS_Core::initModClass('hms', 'exception/PermissionException.php'); throw new PermissionException('You do not have permission to edit terms.'); } $printable = Term::getPrintableSelectedTerm(); $tpl = array(); $tpl['TITLE'] = dgettext('hms', 'Term settings for ') . $printable; $newTermCmd = CommandFactory::getCommand('ShowCreateTerm'); $tpl['NEW_TERM_URI'] = $newTermCmd->getURI(); // Is this the Current Term? if (Term::isCurrentTermSelected()) { $tpl['CURRENT_TERM_TEXT'] = dgettext('hms', 'This term is the <strong>active term</strong>. To make another term active, please select it from the list at the top-left.'); } else { $tpl['CURRENT_TERM_TEXT'] = dgettext('hms', 'This term is <strong>not</strong> the active term.'); if (Current_User::allow('hms', 'activate_term')) { $cmd = CommandFactory::getCommand('SetCurrentTerm'); $cmd->setTerm(Term::getSelectedTerm()); $tpl['SET_TERM_URI'] = $cmd->getURI(); $tpl['SET_TERM_TEXT'] = "Make <strong>{$printable}</strong> the Current Term"; } } // What's with the Banner Queue? $term = new Term(Term::getSelectedTerm()); if ($term->getBannerQueue()) { $tpl['QUEUE_ENABLED'] = ''; $count = $term->getQueueCount(); $tpl['BANNER_QUEUE_COUNT'] = $count; if ($count > 0) { $cmd = CommandFactory::getCommand('ProcessBannerQueue'); $cmd->setTerm(Term::getSelectedTerm()); $tpl['BANNER_QUEUE_PROCESS_URI'] = $cmd->getURI(); } else { $cmd = CommandFactory::getCommand('DisableBannerQueue'); $cmd->setTerm(Term::getSelectedTerm()); $tpl['BANNER_QUEUE_LINK'] = $cmd->getLink('Disable'); } } else { $tpl['QUEUE_DISABLED'] = ''; $cmd = CommandFactory::getCommand('EnableBannerQueue'); $cmd->setTerm(Term::getSelectedTerm()); $tpl['BANNER_QUEUE_LINK'] = $cmd->getLink('Enable'); } // Terms and Conditions PHPWS_Core::initModClass('hms', 'TermsConditionsAdminView.php'); $tcav = new TermsConditionsAdminView($this->term); $tpl['TERMS_CONDITIONS_CONTENT'] = $tcav->show(); // Features and Deadlines PHPWS_Core::initModClass('hms', 'ApplicationFeatureListView.php'); $aflv = new ApplicationFeatureListView(Term::getSelectedTerm()); $tpl['FEATURES_DEADLINES_CONTENT'] = $aflv->show(); Layout::addPageTitle("Term Settings"); return PHPWS_Template::process($tpl, 'hms', 'admin/TermEditView.tpl'); }
public function show() { PHPWS_Core::initCoreClass('Form.php'); $form = new PHPWS_Form(); $submitCmd = CommandFactory::getCommand('EmergencyContactFormSubmit'); $submitCmd->setTerm($this->term); $submitCmd->initForm($form); $tpl = array(); /**************** * Display Info * ****************/ $tpl['TERM'] = Term::toString($this->term); $tpl['STUDENT_NAME'] = $this->student->getFullName(); /********************* * 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->application)) { $form->setValue('emergency_contact_name', $this->application->getEmergencyContactName()); $form->setValue('emergency_contact_relationship', $this->application->getEmergencyContactRelationship()); $form->setValue('emergency_contact_phone', $this->application->getEmergencyContactPhone()); $form->setValue('emergency_contact_email', $this->application->getEmergencyContactEmail()); $form->setValue('emergency_medical_condition', $this->application->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->application)) { $form->setValue('missing_person_name', $this->application->getMissingPersonName()); $form->setValue('missing_person_relationship', $this->application->getMissingPersonRelationship()); $form->setValue('missing_person_phone', $this->application->getMissingPersonPhone()); $form->setValue('missing_person_email', $this->application->getMissingPersonEmail()); } $form->mergeTemplate($tpl); $tpl = $form->getTemplate(); Layout::addPageTitle("Emergency Contact Form"); return PHPWS_Template::process($tpl, 'hms', 'student/emergency_contact_form.tpl'); }
public function show() { PHPWS_Core::initModClass('hms', 'HMS_Assignment.php'); PHPWS_Core::initModClass('hms', 'HMS_Learning_Community.php'); PHPWS_Core::initModClass('hms', 'HMS_RLC_Assignment.php'); PHPWS_Core::initModClass('hms', 'HMS_Movein_Time.php'); PHPWS_Core::initModClass('hms', 'HMS_Assignment.php'); $tpl = array(); $assignment = HMS_Assignment::getAssignment($this->student->getUsername(), $this->term); if ($assignment === NULL || $assignment == FALSE) { $tpl['NO_ASSIGNMENT'] = "You do not currently have a housing assignment."; } else { $tpl['ASSIGNMENT'] = $assignment->where_am_i() . '<br />'; # Determine the student's type and figure out their movein time $type = $this->student->getType(); if ($type == TYPE_CONTINUING) { $movein_time_id = $assignment->get_rt_movein_time_id(); } elseif ($type == TYPE_TRANSFER) { $movein_time_id = $assignment->get_t_movein_time_id(); } else { $movein_time_id = $assignment->get_f_movein_time_id(); } if ($movein_time_id == NULL) { $tpl['MOVE_IN_TIME'] = 'To be determined<br />'; } else { $movein_times = HMS_Movein_Time::get_movein_times_array($this->term); $tpl['MOVE_IN_TIME'] = $movein_times[$movein_time_id]; } } //get the assignees to the room that the bed that the assignment is in $assignees = !is_null($assignment) ? $assignment->get_parent()->get_parent()->get_assignees() : NULL; if (!is_null($assignees)) { foreach ($assignees as $roommate) { if ($roommate->getUsername() != $this->student->getUsername()) { $assignment = HMS_Assignment::getAssignment($roommate->getUsername(), $this->term); $assignment->loadBed(); $label = $assignment->_bed->bedroom_label; $tpl['roommate'][]['ROOMMATE'] = $roommate->getFullName() . ' - ' . $label . ' (' . $roommate->getEmailLink() . ')'; } } } else { $tpl['roommate'] = 'You do not have a roommate'; } $rlc_assignment = HMS_RLC_Assignment::checkForAssignment($this->student->getUsername(), $this->term); if ($rlc_assignment == NULL || $rlc_assignment === FALSE) { $tpl['RLC'] = "You have not been accepted to an RLC."; } else { $rlc_list = HMS_Learning_Community::getRlcList(); $tpl['RLC'] = 'You have been assigned to the ' . $rlc_list[$rlc_assignment['rlc_id']]; } $tpl['MENU_LINK'] = PHPWS_Text::secureLink('Back to Main Menu', 'hms', array('type' => 'student', 'op' => 'show_main_menu')); Layout::addPageTitle("Verify Assignment"); return PHPWS_Template::process($tpl, 'hms', 'student/verify_assignment.tpl'); }
public function show() { PHPWS_Core::initModClass('hms', 'HMS_Floor.php'); $floor = new HMS_Floor($this->floorId); $tpl = array(); $tpl['HALL_FLOOR'] = $floor->where_am_i(); if (isset($floor->floor_plan_image_id) && $floor->floor_plan_image_id != 0) { $file = Cabinet::getFile($floor->floor_plan_image_id); //if the image loaded properly if ($file->id == $floor->floor_plan_image_id) { $tpl['FLOOR_PLAN_IMAGE'] = $file->parentLinked(); } } if ($this->rlcAssignment != null && ($this->rlcAssignment->getStateName() == 'confirmed' || $this->rlcAssignment->getStateName() == 'selfselect-invite')) { $rlcId = $this->rlcAssignment->getRlc()->getId(); } else { $rlcId = null; } $rooms = $floor->get_rooms(); $tpl['room_list'] = array(); foreach ($rooms as $room) { $row = array(); $num_avail_beds = $room->count_avail_lottery_beds(); // We list the room dispite whether it's actually available to choose or not, // so decide whether to "gray out" this row in the room list or not if ($room->gender_type != $this->student->getGender() && $room->gender_type != AUTO || $num_avail_beds == 0 || $room->reserved == 1 || $room->offline == 1 || $room->private == 1 || $room->overflow == 1 || $room->parlor == 1 || $room->getReservedRlcId() != $rlcId) { // Show a grayed out row and no link $row['ROOM_NUM'] = $room->room_number; $row['ROW_TEXT_COLOR'] = 'text-muted'; $row['AVAIL_BEDS'] = 0; // show 0 available beds since this room is unavailable to the user } else { // Show the room number as a link $roomCmd = CommandFactory::getCommand('LotteryChooseRoom'); $roomCmd->setRoomId($room->id); $row['ROOM_NUM'] = $roomCmd->getLink($room->room_number); $row['ROW_TEXT_COLOR'] = 'black'; $row['AVAIL_BEDS'] = $num_avail_beds; } if ($room->isADA()) { $row['ADA'] = '<i class="fa fa-wheelchair" title="ADA Compliant"></i>'; } if ($room->isHearingImpaired()) { $row['HEARING_IMPAIRED'] = '<i class="fa fa-bell-slash" title="Equiped for Hearing Impaired"></i>'; } if ($room->bathEnSuite()) { $row['BATH_EN_SUITE'] = '<i class="fa fa-female" title="Bathroom en Suite">|</i><i class="fa fa-male" title="Bathroom en Suite"></i>'; } $row['NUM_BEDS'] = $room->get_number_of_beds(); $tpl['room_list'][] = $row; } Layout::addPageTitle("Lottery Choose Room"); return PHPWS_Template::process($tpl, 'hms', 'student/lottery_choose_room.tpl'); }
public function show() { PHPWS_Core::initModClass('hms', 'HMS_Lottery.php'); PHPWS_Core::initModClass('hms', 'HMS_Bed.php'); PHPWS_Core::initModClass('hms', 'StudentFactory.php'); PHPWS_Core::initModClass('hms', 'HMS_Util.php'); # Get the roommate request record from the database $bed = new HMS_Bed($this->request['bed_id']); $room = $bed->get_parent(); $tpl = array(); $requestor = StudentFactory::getStudentByUsername($this->request['requestor'], $this->term); $tpl['REQUESTOR'] = $requestor->getName(); $tpl['HALL_ROOM'] = $bed->where_am_i(); # List all the students which will be assigned and their beds $beds = $room->get_beds(); foreach ($beds as $bed) { $bed_row = array(); # Check for an assignment $bed->loadAssignment(); # Check for a reservation $reservation = $bed->get_lottery_reservation_info(); $bed_row['BEDROOM_LETTER'] = $bed->bedroom_label; if ($bed->_curr_assignment != NULL) { # Bed is assigned $roommate = StudentFactory::getStudentByUsername($bed->_curr_assignment->asu_username, $this->term); $bed_row['TEXT'] = $roommate->getName(); } else { if ($reservation != NULL) { # Bed is reserved $roommate = StudentFactory::getStudentByUsername($reservation['asu_username'], $this->term); $bed_row['TEXT'] = $roommate->getName() . ' (reserved)'; } else { $bed_row['TEXT'] = 'Empty'; } } $tpl['beds'][] = $bed_row; } $tpl['MEAL_PLAN'] = HMS_Util::formatMealOption($this->mealPlan); PHPWS_Core::initCoreClass('Captcha.php'); $tpl['CAPTCHA'] = Captcha::get(); $submitCmd = CommandFactory::getCommand('LotteryConfirmRoommateRequest'); $submitCmd->setRequestId($this->request['id']); $submitCmd->setMealPlan($this->mealPlan); $form = new PHPWS_Form(); $submitCmd->initForm($form); $form->addSubmit('confirm', 'Confirm Roommate'); $form->mergeTemplate($tpl); $tpl = $form->getTemplate(); Layout::addPageTitle("Lottery Confirm Roommate"); return PHPWS_Template::process($tpl, 'hms', 'student/lottery_confirm_roommate_request.tpl'); }
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'); } }
public function show() { $tpl = array(); $tpl['VIEW_APPLICATION'] = PHPWS_Text::secureLink(_('View My Application'), 'hms', array('type' => 'student', 'op' => 'view_application')); $tpl['MAIN_MENU_LINK'] = PHPWS_Text::secureLink(_('Back to Main Menu'), 'hms', array('type' => 'student', 'op' => 'main')); $tpl['LOGOUT_LINK'] = PHPWS_Text::moduleLink(_('Logout'), 'users', array('action' => 'user', 'command' => 'logout')); // TODO HMS_Entry_Term is deprecated, use something else PHPWS_Core::initModClass('hms', 'HMS_Entry_Term.php'); if (HMS_Entry_Term::get_entry_semester($_SESSION['asu_username']) == TERM_FALL) { $tpl['RLC_LINK'] = PHPWS_Text::secureLink(_('Residential Learning Communities Application'), 'hms', array('type' => 'student', 'op' => 'show_rlc_application_form')); } Layout::addPageTitle("Thank you"); return PHPWS_Template::process($tpl, 'hms', 'student/student_application_thankyou.tpl'); }
public function show() { $form = new PHPWS_Form(); $this->submitCommand->initForm($form); $tpl = $form->getTemplate(); $tpl['TERM'] = Term::toString($this->term); $tpl['DOCUSIGN_BEGIN_CMD'] = $this->submitCommand->getURI(); if ($this->student->isUnder18()) { $tpl['UNDER_18'] = ''; } javascript('jquery'); Layout::addPageTitle("License Agreement"); return PHPWS_Template::process($tpl, 'hms', 'student/contract.tpl'); }
public function show() { $form = new PHPWS_Form('waiver'); $form->addTextArea('usernames'); $form->setLabel('usernames', 'ASU User names (one per line):'); $form->setExtra('usernames', 'autofocus'); $form->addSubmit('submit_btn', 'Create'); $cmd = CommandFactory::getCommand('CreateWaiver'); $cmd->initForm($form); $tpl = array(); $form->mergeTemplate($tpl); Layout::addPageTitle("Lottery Eligibility Waiver"); return PHPWS_Template::process($form->getTemplate(), 'hms', 'admin/eligibility_waiver.tpl'); }
public function show() { PHPWS_Core::initModClass('hms', 'HMS_RLC_Application.php'); $tpl = array(); $tpl['TITLE'] = "Denied RLC Applications - " . Term::toString(Term::getSelectedTerm()); $tpl['DENIED_PAGER'] = HMS_RLC_Application::denied_pager(); if (isset($success_msg)) { $tpl['SUCCESS_MSG'] = $success_msg; } if (isset($error_msg)) { $tpl['ERROR_MSG'] = $error_msg; } Layout::addPageTitle("Denied RLC Applications"); return PHPWS_Template::process($tpl, 'hms', 'admin/view_denied_rlc_applications.tpl'); }