Ejemplo n.º 1
0
 protected function render()
 {
     require_once PHPWS_SOURCE_DIR . 'mod/hms/class/Term.php';
     parent::render();
     $this->tpl['TERM'] = Term::toString($this->report->getTerm());
     $this->tpl['TOTAL_BEDS'] = $this->report->getTotalBeds();
     $this->tpl['TOTAL_ROOMS'] = $this->report->getTotalRooms();
     $this->tpl['MALE'] = $this->report->getMale();
     $this->tpl['FEMALE'] = $this->report->getFemale();
     $this->tpl['COED'] = $this->report->getCoed();
     // Copy results into the template
     foreach ($this->report->getData() as $row) {
         if (empty($row['maleRooms'])) {
             $row['maleRooms'] = "None";
         }
         if (empty($row['femaleRooms'])) {
             $row['femaleRooms'] = "None";
         }
         if (empty($row['coedRooms'])) {
             $row['coedRooms'] = "None";
         }
         $this->tpl['rows'][] = $row;
     }
     return PHPWS_Template::process($this->tpl, 'hms', 'admin/reports/UnassignedBeds.tpl');
 }
 protected function render()
 {
     $this->tpl = $this->report->getSortedRows();
     parent::render();
     $this->tpl['TERM'] = Term::toString($this->report->getTerm());
     return PHPWS_Template::process($this->tpl, 'hms', 'admin/reports/SpecialNeedsRequest.tpl');
 }
 protected function render()
 {
     parent::render();
     $this->tpl['TERM'] = Term::toString($this->report->getTerm());
     $rows = array();
     $totalAssignments = 0;
     foreach ($this->report->getTypeCounts() as $result) {
         $row = array();
         // Translate the reason string into a human readable label, if it exists
         // Otherwsie, use the raw reason code
         $name = constant($result['reason']);
         if (isset($name)) {
             $row['REASON'] = $name;
         } else {
             $row['REASON'] = $result['reason'];
         }
         $row['COUNT'] = $result['count'];
         $rows[] = $row;
         // Add the count for this reason to the running total
         $totalAssignments += $result['count'];
     }
     $this->tpl['TABLE_ROWS'] = $rows;
     $this->tpl['TOTAL_ASSIGNMENTS'] = $totalAssignments;
     return PHPWS_Template::process($this->tpl, 'hms', 'admin/reports/AssignmentsByType.tpl');
 }
Ejemplo n.º 4
0
 public function show()
 {
     $tpl = array();
     $tpl['REVIEW_MSG'] = '';
     // set this to show the review message
     $tpl['STUDENT_NAME'] = $this->student->getFullName();
     $tpl['TERM'] = Term::toString($this->term);
     /* Emergency Contact */
     $tpl['EMERGENCY_CONTACT_NAME'] = $this->app->getEmergencyContactName();
     $tpl['EMERGENCY_CONTACT_RELATIONSHIP'] = $this->app->getEmergencyContactRelationship();
     $tpl['EMERGENCY_CONTACT_PHONE'] = $this->app->getEmergencyContactPhone();
     $tpl['EMERGENCY_CONTACT_EMAIL'] = $this->app->getEmergencyContactEmail();
     $tpl['EMERGENCY_MEDICAL_CONDITION'] = $this->app->getEmergencyMedicalCondition();
     /* Missing Person */
     $tpl['MISSING_PERSON_NAME'] = $this->app->getMissingPersonName();
     $tpl['MISSING_PERSON_RELATIONSHIP'] = $this->app->getMissingPersonRelationship();
     $tpl['MISSING_PERSON_PHONE'] = $this->app->getMissingPersonPhone();
     $tpl['MISSING_PERSON_EMAIL'] = $this->app->getMissingPersonEmail();
     $form = new PHPWS_Form('hidden_form');
     $submitCmd = CommandFactory::getCommand('EmergencyContactConfirm');
     $submitCmd->setVars($_REQUEST);
     $submitCmd->initForm($form);
     $form->addSubmit('submit', 'Confirm & Continue');
     $redoCmd = CommandFactory::getCommand('ShowEmergencyContactForm');
     $redoCmd->setTerm($this->term);
     $redoCmd->setVars($_REQUEST);
     $tpl['REDO_BUTTON'] = $redoCmd->getLink('modify your information');
     $form->mergeTemplate($tpl);
     $tpl = $form->getTemplate();
     return PHPWS_Template::process($tpl, 'hms', 'student/emergency_contact_form.tpl');
 }
Ejemplo n.º 5
0
 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()
 {
     $tpl = array();
     $tpl['TERM'] = Term::toString($this->term);
     $form = new PHPWS_Form('rlc_reapp');
     $submitCmd = CommandFactory::getCommand('SubmitRLCReapplicationPage2');
     $submitCmd->setTerm($this->term);
     $submitCmd->initForm($form);
     foreach ($this->rlcs as $i => $rlc) {
         $question = $this->rlcs[$i]->getReturningQuestion();
         if (!isset($question)) {
             throw new Exception("Missing returning question for {$this->rlcs[$i]->get_community_name()}");
         }
         if (isset($this->reApp) && isset($this->reApp->{"rlc_question_{$i}"})) {
             $form->addTextArea("rlc_question_{$i}", $this->reApp->{"rlc_question_{$i}"});
         } else {
             $form->addTextArea("rlc_question_{$i}");
         }
         $form->setLabel("rlc_question_{$i}", $this->rlcs[$i]->getReturningQuestion());
         $form->addCssClass("rlc_question_{$i}", 'form-control');
     }
     $form->addSubmit('submit', 'Submit Application');
     $form->mergeTemplate($tpl);
     $tpl = $form->getTemplate();
     return PHPWS_Template::process($tpl, 'hms', 'student/RlcReapplicationPage2.tpl');
 }
 /**
  * Executes this pulse. Does the withdrawn search and emails the results.
  */
 public function execute()
 {
     // Reschedule the next run of this process
     $sp = $this->makeClone();
     $sp->execute_at = strtotime("tomorrow");
     $sp->save();
     // Load some classes
     PHPWS_Core::initModClass('hms', 'HMS.php');
     PHPWS_Core::initModClass('hms', 'WithdrawnSearch.php');
     PHPWS_Core::initModClass('hms', 'HMS_Email.php');
     PHPWS_Core::initModClass('hms', 'UserStatus.php');
     UserStatus::wearMask('HMS System');
     // The search is run over all future terms
     $terms = Term::getFutureTerms();
     $text = "";
     foreach ($terms as $term) {
         $search = new WithdrawnSearch($term);
         $search->doSearch();
         $text .= "\n\n=========== " . Term::toString($term) . " ===========\n\n";
         $text .= $search->getTextView();
     }
     $text = $search->getTextView();
     HMS_Email::sendWithdrawnSearchOutput($text);
     UserStatus::removeMask();
     HMS::quit();
 }
 protected function render()
 {
     parent::render();
     $this->tpl['TERM'] = Term::toString($this->report->getTerm());
     // Males
     foreach ($this->report->getMaleTotals() as $total) {
         $this->tpl['male_totals'][] = array('COUNT' => $total);
     }
     $this->tpl['MALE_SUB'] = $this->report->getMaleSubTotal();
     // Females
     foreach ($this->report->getFemaleTotals() as $total) {
         $this->tpl['female_totals'][] = array('COUNT' => $total);
     }
     $this->tpl['FEMALE_SUB'] = $this->report->getFemaleSubTotal();
     // Type totals
     foreach ($this->report->getTypeTotals() as $total) {
         $this->tpl['type_totals'][] = array('COUNT' => $total);
     }
     $this->tpl['SUB_TOTAL'] = $this->report->getSubTotal();
     // Cancelled totals
     $cancelledTotals = $this->report->getCancelledTotals();
     $this->tpl['FEMALE_CANCELLED'] = $cancelledTotals[FEMALE];
     $this->tpl['MALE_CANCELLED'] = $cancelledTotals[MALE];
     $this->tpl['CANCELLED_SUB'] = $this->report->getCancelledSubTotal();
     $this->tpl['FEMALE_TOTAL'] = $this->report->getFemaleGrandTotal();
     $this->tpl['MALE_TOTAL'] = $this->report->getMaleGrandTotal();
     $this->tpl['ALL_TOTAL'] = $this->report->getTotal();
     return PHPWS_Template::process($this->tpl, 'hms', 'admin/reports/ApplicantDemographics.tpl');
 }
Ejemplo n.º 9
0
 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();
 }
Ejemplo n.º 10
0
 public function execute(CommandContext $context)
 {
     // Check permissions
     if (!Current_User::allow('hms', 'checkin')) {
         PHPWS_Core::initModClass('hms', 'exception/PermissionException.php');
         throw new PermissionException('You do not have permission to checkin students.');
     }
     $term = Term::getSelectedTerm();
     $bannerId = $context->get('bannerId');
     $hallId = $context->get('hallId');
     $errorCmd = CommandFactory::getCommand('ShowCheckinStart');
     if (!isset($bannerId) || is_null($bannerId) || $bannerId == '') {
         NQ::simple('hms', hms\NotificationView::ERROR, 'Missing Banner ID.');
         $errorCmd->redirect();
     }
     if (!isset($hallId)) {
         NQ::simple('hms', hms\NotificationView::ERROR, 'Missing residence hall ID.');
         $errorCmd->redirect();
     }
     // Check the Banner ID
     if (preg_match("/[\\d]{9}/", $bannerId) == false) {
         NQ::simple('hms', hms\NotificationView::ERROR, 'Imporperly formatted Banner ID.');
         $errorCmd->redirect();
     }
     // Try to lookup the student in Banner
     try {
         $student = StudentFactory::getStudentByBannerId($bannerId, $term);
     } catch (StudentNotFoundException $e) {
         NQ::simple('hms', hms\NotificationView::ERROR, 'Could not locate a student with that Banner ID.');
         $errorCmd->redirect();
     }
     // Make sure the student is assigned in the current term
     $assignment = HMS_Assignment::getAssignmentByBannerId($bannerId, $term);
     if (!isset($assignment) || is_null($assignment)) {
         NQ::simple('hms', hms\NotificationView::ERROR, $student->getName() . ' is not assigned for ' . Term::toString($term) . '. Please contact the University Housing Assignments Office at 828-262-6111.');
         $errorCmd->redirect();
     }
     // Make sure the student's assignment matches the hall the user selected
     $bed = $assignment->get_parent();
     $room = $bed->get_parent();
     $floor = $room->get_parent();
     $hall = $floor->get_parent();
     if ($hallId != $hall->getId()) {
         NQ::simple('hms', hms\NotificationView::ERROR, 'Wrong hall! ' . $student->getName() . ' is assigned to ' . $assignment->where_am_i());
         $errorCmd->redirect();
     }
     // Load any existing check-in
     $checkin = CheckinFactory::getLastCheckinByBannerId($bannerId, $term);
     // If there is a checkin for the same bed, and the difference between the current time and the checkin time is
     // greater than 48 hours, then show an error.
     if (!is_null($checkin)) {
         $checkoutDate = $checkin->getCheckoutDate();
         if ($checkin->getBedId() == $bed->getId() && !isset($checkoutDate) && time() - $checkin->getCheckinDate() > Checkin::CHECKIN_TIMEOUT) {
             NQ::simple('hms', hms\NotificationView::ERROR, $student->getName() . ' has already checked in to ' . $assignment->where_am_i());
             $errorCmd->redirect();
         }
     }
     $view = new CheckinFormView($student, $assignment, $hall, $floor, $room, $checkin);
     $context->setContent($view->show());
 }
Ejemplo n.º 11
0
 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');
 }
Ejemplo n.º 12
0
 protected function render()
 {
     parent::render();
     $this->tpl['rows'] = $this->report->getRows();
     $this->tpl['TERM'] = Term::toString($this->report->getTerm());
     $this->tpl['totalCoed'] = $this->report->getTotalCoed();
     return PHPWS_Template::process($this->tpl, 'hms', 'admin/reports/CoedRooms.tpl');
 }
Ejemplo n.º 13
0
 protected function render()
 {
     parent::render();
     $rows = $this->report->getRows();
     $this->tpl['rows'] = $rows;
     $this->tpl['TERM'] = Term::toString($this->report->getTerm());
     return PHPWS_Template::process($this->tpl, 'hms', 'admin/reports/TwentyFive.tpl');
 }
 public function show()
 {
     $excess_limit = 3;
     // Number of rows to show by default
     $count = 0;
     $tpl = array();
     $historyRows = array();
     $excessRows = array();
     $historyArray = $this->assignmentHistory->getHistory();
     foreach ($historyArray as $ah) {
         $row = array();
         if (defined($ah->assigned_reason)) {
             $assignedReason = constant($ah->assigned_reason);
             // for pretty text purposes
         } else {
             $assignedReason = $ah->assigned_reason;
         }
         if (defined($ah->removed_reason)) {
             $removedReason = constant($ah->removed_reason);
             // for pretty text purposes
         } else {
             $removedReason = $ah->removed_reason;
         }
         if (!is_null($ah->assigned_on)) {
             $assignedOn = date('M jS, Y \\a\\t g:ia', $ah->assigned_on);
         }
         if (!is_null($ah->removed_on)) {
             $removedOn = date('M jS, Y \\a\\t g:ia', $ah->removed_on);
         }
         $bed = new HMS_Bed($ah->getBedId());
         $row['room'] = $bed->where_am_i();
         $row['term'] = Term::toString($ah->term);
         // Combine for ease of view
         if (isset($ah->assigned_reason)) {
             $row['assignments'] = '<em>' . $assignedReason . '</em>' . ' by ' . $ah->assigned_by . '<br /><span style="font-size:11px;color:#7C7C7C;">on ' . $assignedOn . '</span>';
         } else {
             $row['assignments'] = '<em class="text-muted">None</em>';
         }
         if (isset($ah->removed_reason)) {
             $row['unassignments'] = '<em>' . $removedReason . '</em>' . ' by ' . $ah->removed_by . '<br /><span style="font-size:11px;color:#7C7C7C;">on ' . $removedOn . '</span>';
         } else {
             $row['unassignments'] = '<em class="text-muted">None</em>';
         }
         if ($count++ < $excess_limit) {
             $historyRows[] = $row;
         } else {
             $excessRows[] = $row;
         }
     }
     $tpl['HISTORY'] = $historyRows;
     $tpl['EXTRA_HISTORY'] = $excessRows;
     if (sizeof($historyArray) > $excess_limit) {
         $tpl['SHOW_MORE'] = "[ <a id='showMoreLink'>show more</a> ]";
     }
     return PHPWS_Template::process($tpl, 'hms', 'admin/StudentAssignmentHistoryView.tpl');
 }
 public function execute(CommandContext $context)
 {
     if (!Current_User::allow('hms', 'cancel_housing_application')) {
         PHPWS_Core::initModClass('hms', 'exception/PermissionException.php');
         throw new PermissionException('You do not have permission to cancel housing applications.');
     }
     // Check for a housing application id
     $applicationId = $context->get('applicationId');
     if (!isset($applicationId) || is_null($applicationId)) {
         throw new InvalidArgumentException('Missing housing application id.');
     }
     // Check for a cancellation reason
     $cancelReason = $context->get('cancel_reason');
     if (!isset($cancelReason) || is_null($cancelReason)) {
         throw new InvalidArgumentException('Missing cancellation reason.');
     }
     // Load the housing application
     PHPWS_Core::initModClass('hms', 'HousingApplicationFactory.php');
     $application = HousingApplicationFactory::getApplicationById($applicationId);
     // Load the student
     $student = $application->getStudent();
     $username = $student->getUsername();
     $term = $application->getTerm();
     // Load the cancellation reasons
     $reasons = HousingApplication::getCancellationReasons();
     // Check for an assignment and remove it
     // Decide which term to use - If this application is in a past fall term, then use the current term
     if ($term < Term::getCurrentTerm() && Term::getTermSem($term) == TERM_FALL) {
         $assignmentTerm = Term::getCurrentTerm();
     } else {
         $assignmentTerm = $term;
     }
     PHPWS_Core::initModClass('hms', 'HMS_Assignment.php');
     $assignment = HMS_Assignment::getAssignmentByBannerId($student->getBannerId(), $assignmentTerm);
     if (isset($assignment)) {
         // TODO: Don't hard code cancellation refund percentage
         HMS_Assignment::unassignStudent($student, $assignmentTerm, 'Application cancellation: ' . $reasons[$cancelReason], UNASSIGN_CANCEL, 100);
     }
     PHPWS_Core::initModClass('hms', 'HMS_RLC_Assignment.php');
     $rlcAssignment = HMS_RLC_Assignment::getAssignmentByUsername($username, $term);
     if (!is_null($rlcAssignment)) {
         $rlcAssignment->delete();
     }
     PHPWS_Core::initModClass('hms', 'HMS_RLC_Application.php');
     $rlcApplication = HMS_RLC_Application::getApplicationByUsername($username, $term);
     if (!is_null($rlcApplication)) {
         $rlcApplication->denied = 1;
         $rlcApplication->save();
         HMS_Activity_Log::log_activity($username, ACTIVITY_DENIED_RLC_APPLICATION, \Current_User::getUsername(), Term::toString($term) . ' Denied RLC Application due to Contract Cancellation');
     }
     // Cancel the application
     $application->cancel($cancelReason);
     $application->save();
     echo 'success';
     exit;
 }
 protected function render()
 {
     parent::render();
     $this->tpl['TERM'] = Term::toString($this->report->getTerm());
     // Copy keys and values from the report. Kinda a hack
     foreach ($this->report->getData() as $key => $value) {
         $this->tpl[$key] = $value;
     }
     return PHPWS_Template::process($this->tpl, 'hms', 'admin/reports/ReapplicationOverview.tpl');
 }
 protected function render()
 {
     parent::render();
     $this->tps['TERM'] = Term::toString($this->report->getTerm());
     // Copy results into the template
     foreach ($this->report->getData() as $row) {
         $this->tpl['halls'][] = $row;
     }
     return PHPWS_Template::process($this->tpl, 'hms', 'admin/reports/ReappAvailableBeds.tpl');
 }
 protected function render()
 {
     parent::render();
     $this->tpl['TERM'] = Term::toString($this->report->getTerm());
     $this->tpl['lastTerm'] = Term::toString($this->report->getLastTerm());
     $this->tpl['thisTerm'] = Term::toSTring($this->report->getTerm());
     $this->tpl['lastYearSeries'] = $this->report->getLastYearJson();
     $this->tpl['thisYearSeries'] = $this->report->getThisYearJson();
     return PHPWS_Template::process($this->tpl, 'hms', 'admin/reports/CancelledAppsContinuingGraph.tpl');
 }
 protected function render()
 {
     parent::render();
     $this->tpl['TERM'] = Term::toString($this->report->getTerm());
     $this->tpl['MALE_SINGLE_GENDER'] = $this->report->getMaleSingle();
     $this->tpl['MALE_COED'] = $this->report->getMaleCoed();
     $this->tpl['FEMALE_SINGLE_GENDER'] = $this->report->getFemaleSingle();
     $this->tpl['FEMALE_COED'] = $this->report->getFemaleCoed();
     return PHPWS_Template::process($this->tpl, 'hms', 'admin/reports/SingleGenderVsCoedPref.tpl');
 }
 protected function render()
 {
     parent::render();
     $this->tpl['TERM'] = Term::toString($this->report->getTerm());
     $this->tpl['MISMATCH_COUNT'] = $this->report->getMismatchCount();
     foreach ($this->report->getData() as $row) {
         $this->tpl['rows'][] = $row;
     }
     return PHPWS_Template::process($this->tpl, 'hms', 'admin/reports/MismatchedRoommates.tpl');
 }
Ejemplo n.º 21
0
 public function show()
 {
     $tpl = array();
     if (empty($this->housingApps)) {
         $tpl['APPLICATIONS_EMPTY'] = 'No applications found.';
         return PHPWS_Template::process($tpl, 'hms', 'admin/profileHousingAppList.tpl');
     }
     // Include javascript for cancel application jquery dialog
     $jsParams = array('LINK_SELECT' => '.cancelAppLink');
     javascript('profileCancelApplication', $jsParams, 'mod/hms/');
     $app_rows = "";
     // Get the list of cancellation reasons
     $reasons = HousingApplication::getCancellationReasons();
     // Show a row for each application
     foreach ($this->housingApps as $app) {
         $term = Term::toString($app->getTerm());
         $mealPlan = HMS_Util::formatMealOption($app->getMealPlan());
         $phone = HMS_Util::formatCellPhone($app->getCellPhone());
         $type = $app->getPrintableAppType();
         // Clean/dirty and early/late preferences are only fields on the FallApplication
         if ($app instanceof FallApplication && isset($app->room_condition)) {
             $clean = $app->room_condition == 1 ? 'Neat' : 'Cluttered';
         } else {
             $clean = '';
         }
         if ($app instanceof FallApplication && isset($app->preferred_bedtime)) {
             $bedtime = $app->preferred_bedtime == 1 ? 'Early' : 'Late';
         } else {
             $bedtime = '';
         }
         $viewCmd = CommandFactory::getCommand('ShowApplicationView');
         $viewCmd->setAppId($app->getId());
         $view = $viewCmd->getURI();
         $row = array('term' => $term, 'type' => $type, 'meal_plan' => $mealPlan, 'cell_phone' => $phone, 'clean' => $clean, 'bedtime' => $bedtime, 'view' => $view);
         if ($app->isCancelled()) {
             $reInstateCmd = CommandFactory::getCommand('ReinstateApplication');
             $reInstateCmd->setAppID($app->getId());
             $row['reinstate'] = $reInstateCmd->getURI();
             $cancelledReason = "({$reasons[$app->getCancelledReason()]})";
             $row['cancelledReason'] = $cancelledReason;
             $row['row_style'] = 'warning';
         } else {
             // Show Cancel Command, if user has permission to cancel apps
             if (Current_User::allow('hms', 'cancel_housing_application')) {
                 $cancelCmd = CommandFactory::getCommand('ShowCancelHousingApplication');
                 $cancelCmd->setHousingApp($app);
                 $cancel = $cancelCmd->getURI();
                 $row['cancel'] = $cancel;
             }
         }
         $app_rows[] = $row;
     }
     $tpl['APPLICATIONS'] = $app_rows;
     return PHPWS_Template::process($tpl, 'hms', 'admin/profileHousingAppList.tpl');
 }
Ejemplo n.º 22
0
 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');
 }
Ejemplo n.º 23
0
 protected function render()
 {
     parent::render();
     $this->tpl['TERM'] = Term::toString($this->report->getTerm());
     $this->tpl['TOTAL'] = $this->report->getTotal();
     // Copy results into the template
     foreach ($this->report->getData() as $row) {
         $this->tpl['rows'][] = $row;
     }
     return PHPWS_Template::process($this->tpl, 'hms', 'admin/reports/CheckinList.tpl');
 }
Ejemplo n.º 24
0
 public function item_tags()
 {
     $tpl = array();
     $tpl['ADDED_ON'] = strftime('%c', $this->added_on);
     $tpl['UPDATED_ON'] = strftime('%c', $this->updated_on);
     $adder = new PHPWS_User($this->added_by);
     $tpl['ADDED_BY'] = $adder->username;
     $updater = new PHPWS_User($this->updated_by);
     $tpl['UPDATED_BY'] = $updater->username;
     $tpl['TERM'] = Term::toString($this->term, true);
     return $tpl;
 }
Ejemplo n.º 25
0
 protected function render()
 {
     parent::render();
     $this->tpl['rows'] = $this->report->getRows();
     $this->tpl['TERM'] = Term::toString($this->report->getTerm());
     $this->tpl['totalCurrOccupancy'] = $this->report->getTotalCurrOccupancy();
     $this->tpl['totalMales'] = $this->report->getTotalMales();
     $this->tpl['totalFemales'] = $this->report->getTotalFemales();
     $this->tpl['totalMalePercent'] = $this->report->getTotalMalePercent();
     $this->tpl['totalFemalePercent'] = $this->report->getTotalFemalePercent();
     return PHPWS_Template::process($this->tpl, 'hms', 'admin/reports/TwentyOne.tpl');
 }
Ejemplo n.º 26
0
 protected function render()
 {
     parent::render();
     $this->tpl['TERM'] = Term::toString($this->report->getTerm());
     $this->tpl['MEMBER_COUNT'] = $this->report->getMemberCount();
     foreach ($this->report->getData() as $row) {
         if (empty($row['COMMUNITY'])) {
             $row['COMMUNITY'] = '<em class="text-muted">No Membership</em>';
         }
         $this->tpl['rows'][] = $row;
     }
     return PHPWS_Template::process($this->tpl, 'hms', 'admin/reports/RlcRoster.tpl');
 }
 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');
 }
Ejemplo n.º 28
0
 public function copy($to_term, $room_id, $assignments)
 {
     if (!$this->id) {
         return false;
     }
     // echo "in hms_beds, making a copy of this bed<br>";
     $new_bed = clone $this;
     $new_bed->reset();
     $new_bed->term = $to_term;
     $new_bed->room_id = $room_id;
     $new_bed->clearRoomChangeReserved();
     try {
         $new_bed->save();
     } catch (Exception $e) {
         throw $e;
     }
     // Copy assignment
     if ($assignments) {
         // echo "loading assignments for this bed<br>";
         PHPWS_Core::initModClass('hms', 'HousingApplication.php');
         PHPWS_Core::initModClass('hms', 'Term.php');
         PHPWS_Core::initModClass('hms', 'HMS_Assignment.php');
         PHPWS_Core::initModClass('hms', 'StudentFactory.php');
         try {
             $this->loadAssignment();
         } catch (Exception $e) {
             throw $e;
         }
         if (isset($this->_curr_assignment)) {
             try {
                 try {
                     $student = StudentFactory::getStudentByUsername($this->_curr_assignment->asu_username, Term::getCurrentTerm());
                     $app = HousingApplication::getApplicationByUser($this->_curr_assignment->asu_username, Term::getCurrentTerm());
                 } catch (StudentNotFoundException $e) {
                     NQ::simple('hms', hms\NotificationView::ERROR, 'Could not copy assignment for ' . $this->_curr_assignment->asu_username);
                     return;
                 }
                 // meal option defaults to standard
                 $meal_option = BANNER_MEAL_STD;
                 if (!is_null($app)) {
                     $meal_option = $app->getMealPlan();
                 }
                 $note = "Assignment copied from " . Term::getPrintableCurrentTerm() . " to " . Term::toString($to_term);
                 HMS_Assignment::assignStudent($student, $to_term, null, $new_bed->id, $meal_option, $note, false, $this->_curr_assignment->getReason());
             } catch (Exception $e) {
                 throw $e;
             }
         }
     }
 }
Ejemplo n.º 29
0
 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()
 {
     $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');
     }
 }