public function show_verify_assignment() { PHPWS_Core::initModClass('hms', 'HMS_Term.php'); PHPWS_Core::initModClass('hms', 'HMS_SOAP.php'); 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'); $tpl = array(); $assignment = HMS_Assignment::get_assignment($_SESSION['asu_username'], $_SESSION['application_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 = HMS_SOAP::get_student_type($_SESSION['asu_username'], $_SESSION['application_term']); if ($type == TYPE_CONTINUING) { $movein_time_id = $assignment->get_rt_movein_time_id(); } elseif ($type == TYPE_TRANFER) { $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($_SESSION['application_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; $roommates = array(); if (!is_null($assignees)) { foreach ($assignees as $roommate) { if ($roommate->asu_username != $_SESSION['asu_username']) { $roommates[] = $roommate->asu_username; } } } if (empty($roommates)) { $tpl['roommate'][]['ROOMMATE'] = 'You do not have a roommate.'; } else { foreach ($roommates as $roommate) { $tpl['roommate'][]['ROOMMATE'] = '' . HMS_SOAP::get_name($roommate) . ' (<a href="mailto:' . $roommate . '@appstate.edu">' . $roommate . '@appstate.edu</a>)'; } } $rlc_assignment = HMS_RLC_Assignment::check_for_assignment($_SESSION['asu_username'], $_SESSION['application_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')); return PHPWS_Template::process($tpl, 'hms', 'student/verify_assignment.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::initCoreClass('Form.php'); $form = new PHPWS_Form(); $form->addDropBox('rlc', HMS_Learning_Community::getRlcList()); $form->setClass('rlc', 'form-control'); $form->addHidden('module', 'hms'); $form->addHidden('action', 'ShowSearchByRlc'); $form->addSubmit('submit', _('Search')); $form->setClass('submit', 'btn btn-primary pull-right'); $tags = $form->getTemplate(); $tags['TITLE'] = "RLC Search"; Layout::addPageTitle("RLC Search"); $final = PHPWS_Template::processTemplate($tags, 'hms', 'admin/search_by_rlc.tpl'); return $final; }
/** * @see View::show() */ public function show() { $tags = array(); $tags['TERM'] = Term::toString(Term::getSelectedTerm()); $tags['FILTERS'] = $this->getFilters(); $tags['ASSIGNMENTS_PAGER'] = $this->rlcApplicationPager(); $exportForm = new PHPWS_Form('export_form'); $exportCmd = CommandFactory::getCommand('ExportRlcApps'); $exportCmd->initForm($exportForm); $exportForm->addDropBox('rlc_list', HMS_Learning_Community::getRlcList()); $exportForm->setClass('rlc_list', 'form-control'); $exportForm->addSubmit('submit', 'Export'); $exportForm->setClass('submit', 'btn btn-primary'); $exportForm->mergeTemplate($tags); $tags = $exportForm->getTemplate(); return PHPWS_Template::process($tags, 'hms', 'admin/make_new_rlc_assignments.tpl'); }
public function getDeniedPagerTags() { PHPWS_Core::initModClass('hms', 'HMS_Learning_Community.php'); $student = StudentFactory::getStudentByUsername($this->username, $this->term); $tags = array(); $rlc_list = HMS_Learning_Community::getRlcList(); $tags['NAME'] = $student->getProfileLink(); $rlcCmd = CommandFactory::getCommand('ShowRlcApplicationReView'); $rlcCmd->setAppId($this->getId()); $tags['1ST_CHOICE'] = $rlcCmd->getLink($rlc_list[$this->getFirstChoice()], '_blank'); if (isset($rlc_list[$this->getSecondChoice()])) { $tags['2ND_CHOICE'] = $rlc_list[$this->getSecondChoice()]; } if (isset($rlc_list[$this->getThirdChoice()])) { $tags['3RD_CHOICE'] = $rlc_list[$this->getThirdChoice()]; } $tags['CLASS'] = $student->getClass(); $tags['GENDER'] = $student->getGender(); $tags['DATE_SUBMITTED'] = date('d-M-y', $this->getDateSubmitted()); $unDenyCmd = CommandFactory::getCommand('UnDenyRlcApplication'); $unDenyCmd->setApplicationId($this->id); $tags['ACTION'] = $unDenyCmd->getLink('Un-Deny'); return $tags; }
/** * Get form for approving application for specific community. */ private function getApprovalForm() { $approveForm = new PHPWS_Form('approve_form'); $approveForm->addSubmit('approve', 'Approve'); $approveForm->addCssClass('approve', 'btn btn-md btn-success'); $approveCmd = CommandFactory::getCommand('AssignRlcApplicants'); $tpl = array(); $tpl['RLC_LIST'] = HMS_RLC_Application::generateRLCDropDown(HMS_Learning_Community::getRlcList(), $this->application->id); $approveForm->mergeTemplate($tpl); $approveCmd->initForm($approveForm); return $approveForm; }
public function show() { $tpl = new PHPWS_Template('hms'); if (!$tpl->setFile('admin/reports/hall_overview.tpl')) { return 'Template error.'; } $rlcs = HMS_Learning_Community::getRlcList(); $rlcs_abbr = HMS_Learning_Community::getRLCListAbbr(); $tpl->setData(array('HALL' => $this->hall->hall_name, 'TERM' => Term::getPrintableSelectedTerm())); if ($this->nakedDisplay) { $menuCmd = CommandFactory::getCommand('ShowAdminMaintenanceMenu'); $tpl->setData(array('MAINTENANCE' => $menuCmd->getLink('Main Menu'))); } $class = 'toggle1'; $this->hall->loadFloors(); foreach ($this->hall->_floors as $floor) { $floor->loadRooms(); if (!isset($floor->_rooms)) { continue; } if ($floor->rlc_id != NULL) { $floor_rlc = $rlcs[$floor->rlc_id]; } else { $floor_rlc = ''; } foreach ($floor->_rooms as $room) { $extra_attribs = ''; if ($room->isOffline()) { $extra_attribs .= 'Offline '; } if ($room->isReserved()) { $extra_attribs .= 'Reserved '; } if ($room->isRa()) { $extra_attribs .= 'RA '; } if ($room->isPrivate()) { $extra_attribs .= 'Private '; } if ($room->isOverflow()) { $extra_attribs .= 'Overflow '; } if ($room->isParlor()) { $extra_attribs .= 'Parlor '; } if ($room->isADA()) { $extra_attribs .= 'ADA'; } if ($room->isHearingImpaired()) { $extra_attribs .= 'Hearing Impaired'; } if ($room->bathEnSuite()) { $extra_attribs .= 'Bath en Suite'; } $room->loadBeds(); if (empty($room->_beds)) { $tpl->setCurrentBlock('room_repeat'); $tpl->setData(array('EXTRA_ATTRIBS' => $extra_attribs, 'ROOM_NUMBER' => $room->getLink('Room'))); $tpl->parseCurrentBlock(); continue; } foreach ($room->_beds as $bed) { $bed->loadAssignment(); $tpl->setCurrentBlock('bed_repeat'); $bed_link = $bed->getLink(); if (isset($bed->_curr_assignment)) { $username = $bed->_curr_assignment->asu_username; try { $student = StudentFactory::getStudentByUsername($username, $this->hall->term); } catch (StudentNotFoundException $e) { $student = null; NQ::simple('hms', hms\NotificationView::WARNING, "Could not find data for: {$username}"); } $assign_rlc = HMS_RLC_Assignment::checkForAssignment($username, $this->hall->term); //false or index if ($assign_rlc != FALSE) { $rlc_abbr = $rlcs_abbr[$assign_rlc['rlc_id']]; //get the abbr for the rlc } else { $rlc_abbr = ''; } // Alternating background colors if ($class == 'toggle1') { $class = 'toggle2'; } else { $class = 'toggle1'; } if (is_null($student)) { $tpl->setData(array('BED_LABEL' => $bed->bedroom_label, 'BED' => $bed_link, 'NAME' => 'UNKNOWN', 'USERNAME' => $username, 'BANNER_ID' => '', 'TOGGLE' => $class, 'RLC_ABBR' => $rlc_abbr)); } else { $tpl->setData(array('BED_LABEL' => $bed->bedroom_label, 'BED' => $bed_link, 'NAME' => $student->getProfileLink(), 'USERNAME' => $student->getUsername(), 'BANNER_ID' => $student->getBannerId(), 'TOGGLE' => $class, 'RLC_ABBR' => $rlc_abbr)); } } else { $tpl->setData(array('BED_LABEL' => $bed->bedroom_label, 'BED' => $bed_link, 'NAME' => $bed->get_assigned_to_link(), 'VACANT' => '')); } $tpl->parseCurrentBlock(); } $tpl->setCurrentBlock('room_repeat'); $tpl->setData(array('EXTRA_ATTRIBS' => $extra_attribs, 'ROOM_NUMBER' => $room->getLink('Room'))); $tpl->parseCurrentBlock(); } $tpl->setCurrentBlock('floor_repeat'); $tpl->setData(array('FLOOR_NUMBER' => $floor->getLink('Floor'), 'FLOOR_RLC' => $floor_rlc)); $tpl->parseCurrentBlock(); } if ($this->nakedDisplay) { Layout::nakedDisplay($tpl->get(), 'Building overview for ' . $this->hall->hall_name, TRUE); } Layout::addPageTitle("Hall Overview"); return $tpl->get(); }
public function show() { Layout::addPageTitle("RLC Application"); javascript('jquery'); $jsVars = array('ELEMENTS_TO_BIND' => '"#phpws_form_rlc_first_choice","#phpws_form_rlc_second_choice","#phpws_form_rlc_third_choice"', 'ACTION' => 'AjaxGetRLCExtraInfo'); javascript('modules/hms/formDialog', $jsVars); $context = $this->context; $template = array(); $rlc_form = new PHPWS_Form(); $page2Cmd = CommandFactory::getCommand('ShowRlcApplicationPage2View'); $page2Cmd->setTerm($context->get('term')); $page2Cmd->initForm($rlc_form); // 1. Rank Your RLC Choices // Get the list of RLCs from the database that this student is allowed to apply for and which are not hidden $rlcList = HMS_Learning_Community::getRlcList(false, $this->student->getType()); // Add an inital element to the list. $rlc_choices = array("-1" => "Select") + $rlcList; // Make a copy of the RLC choices list, replacing "Select" with "None". // To be used with the second and third RLC choices $rlc_choices_none = array('-1' => "None") + $rlcList; $rlc_form->addDropBox('rlc_first_choice', $rlc_choices); $rlc_form->addCssClass('rlc_first_choice', 'form-control'); $rlc_form->setLabel('rlc_first_choice', 'First Choice: '); if (!is_null($context->get('rlc_first_choice'))) { $rlc_form->setMatch('rlc_first_choice', $context->get('rlc_first_choice')); // Select previous choice } else { $rlc_form->setMatch('rlc_first_choice', -1); // Select the default } $rlc_form->addDropBox('rlc_second_choice', $rlc_choices_none); $rlc_form->addCssClass('rlc_second_choice', 'form-control'); $rlc_form->setLabel('rlc_second_choice', 'Second Choice: '); if (!is_null($context->get('rlc_second_choice'))) { $rlc_form->setMatch('rlc_second_choice', $context->get('rlc_second_choice')); // Select previous choice } else { $rlc_form->setMatch('rlc_second_choice', -1); // Select the default } $rlc_form->addDropBox('rlc_third_choice', $rlc_choices_none); $rlc_form->addCssClass('rlc_third_choice', 'form-control'); $rlc_form->setLabel('rlc_third_choice', 'Third Choice: '); if (!is_null($context->get('rlc_third_choice'))) { $rlc_form->setMatch('rlc_third_choice', $context->get('rlc_third_choice')); } else { $rlc_form->setMatch('rlc_third_choice', -1); // Select the default } // 2. About Your Choices if (!is_null($context->get('why_specific_communities'))) { $rlc_form->addTextarea('why_specific_communities', $context->get('why_specific_communities')); } else { $rlc_form->addTextarea('why_specific_communities'); } $rlc_form->setLabel('why_specific_communities', 'Why are you interested in the specific communities you have chosen?'); if (!is_null($context->get('strengths_weaknesses'))) { $rlc_form->addTextarea('strengths_weaknesses', $context->get('strengths_weaknesses')); } else { $rlc_form->addTextarea('strengths_weaknesses'); } $rlc_form->setLabel('strengths_weaknesses', 'What are your strengths and in what areas would you like to improve?'); $rlc_form->mergeTemplate($template); $template = $rlc_form->getTemplate(); return PHPWS_Template::process($template, 'hms', 'student/rlc_signup_form_page1.tpl'); }