public function execute(CommandContext $context)
 {
     if (!Current_User::allow('hms', 'room_structure')) {
         PHPWS_Core::initModClass('hms', 'exception/PermissionException.php');
         throw new PermissionException('You do not have permission to add a room.');
     }
     PHPWS_Core::initModClass('hms', 'HMS_Residence_Hall.php');
     PHPWS_Core::initModClass('hms', 'HMS_Floor.php');
     PHPWS_Core::initModClass('hms', 'HMS_Bed.php');
     PHPWS_Core::initModClass('hms', 'HMS_Assignment.php');
     PHPWS_Core::initModClass('hms', 'HMS_Util.php');
     PHPWS_Core::initModClass('hms', 'AddRoomView.php');
     $floor_id = $context->get('floor');
     $tpl = array();
     # Setup the title and color of the title bar
     $tpl['TITLE'] = 'Add Room';
     # Check to make sure we have a floor and hall.
     $floor = new HMS_Floor($floor_id);
     if (!$floor) {
         $tpl['ERROR_MSG'] = 'There was an error getting the floor object. Please contact ESS.';
         return PHPWS_Template::process($tpl, 'hms', 'admin/add_room.tpl');
     }
     $hall = $floor->get_parent();
     if (!$hall) {
         $tpl['ERROR_MSG'] = 'There was an error getting the hall object. Please contact ESS.';
         return PHPWS_Template::process($tpl, 'hms', 'admin/add_room.tpl');
     }
     # Check Permissions
     if (!Current_User::allow('hms', 'room_structure')) {
         HMS_Floor::show_edit_floor($floor_id, NULL, 'You do not have permission to add rooms.');
     }
     $view = new AddRoomView($floor);
     $context->setContent($view->show());
 }
 public function display()
 {
     $tpl = array();
     $tpl['TITLE'] = 'Edit Internship';
     // Setup the form
     $internshipForm = new EditInternshipFormView($this->intern, $this->student, $this->agency, $this->docs);
     // Get the Form object
     $form = $internshipForm->getForm();
     /*
      * If 'missing' is set then we have been redirected
      * back to the form because the user didn't type in something and
      * somehow got past the javascript.
      */
     if (isset($_REQUEST['missing'])) {
         $missing = explode(' ', $_REQUEST['missing']);
         /*
          * Set classes on field we are missing.
          */
         foreach ($missing as $m) {
             //$form->addCssClass($m, 'has-error');
             $form->addExtraTag($m, 'data-has-error="true"');
         }
         /* Plug old values back into form fields. */
         $form->plugIn($_GET);
         /* Re-add hidden fields with object ID's */
         $form->addHidden('id', $this->intern->id);
     }
     $form->mergeTemplate($tpl);
     $this->showWarnings();
     $this->showStudentWarnings();
     return \PHPWS_Template::process($form->getTemplate(), 'intern', 'internshipView.tpl');
 }
 public function execute(CommandContext $context)
 {
     $id = $context->get('roommateId');
     if (is_null($id)) {
         throw new InvalidArgumentException('Must set roommateId');
     }
     PHPWS_Core::initModClass('hms', 'HMS_Roommate.php');
     $roommate = new HMS_Roommate($id);
     if ($roommate->id = 0) {
         throw new InvalidArgumentException('Invalid roommateId ' . $id);
     }
     $username = UserStatus::getUsername();
     if ($username != $roommate->requestor && $username != $roommate->requestee) {
         PHPWS_Core::initModClass('hms', 'exception/PermissionException.php');
         throw new PermissionException("{$username} tried to break roommate pairing {$roommate->id}");
     }
     PHPWS_Core::initCoreClass('Captcha.php');
     // get other roommate
     $other = StudentFactory::getStudentByUsername($roommate->get_other_guy($username), $roommate->term);
     $form = new PHPWS_Form();
     $cmd = CommandFactory::getCommand('RoommateBreak');
     $cmd->setRoommateId($id);
     $cmd->initForm($form);
     $form->addTplTag('CAPTCHA_IMAGE', Captcha::get());
     $form->addTplTag('NAME', $other->getFullName());
     $form->addSubmit('Confirm');
     $form->addCssClass('submit', 'btn btn-danger');
     $context->setContent(PHPWS_Template::process($form->getTemplate(), 'hms', 'student/roommate_break_confirm.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');
 }
 public function show()
 {
     PHPWS_Core::initModClass('hms', 'HMS_Util.php');
     $tpl = array();
     $tpl['DATES'] = HMS_Util::getPrettyDateRange($this->startDate, $this->endDate);
     $tpl['STATUS'] = "";
     if (!is_null($this->application) && $this->application->getApplicationType() == 'offcampus_waiting_list') {
         $tpl['ICON'] = FEATURE_COMPLETED_ICON;
         $tpl['ALREADY_APPLIED'] = "";
     } else {
         if (time() < $this->startDate) {
             $tpl['ICON'] = FEATURE_NOTYET_ICON;
             $tpl['BEGIN_DEADLINE'] = HMS_Util::getFriendlyDate($this->startDate);
         } else {
             if (time() > $this->endDate) {
                 $tpl['ICON'] = FEATURE_LOCKED_ICON;
                 // fade out header
                 $tpl['STATUS'] = "locked";
                 $tpl['END_DEADLINE'] = HMS_Util::getFriendlyDate($this->endDate);
             } else {
                 //TODO
                 $tpl['ICON'] = FEATURE_OPEN_ICON;
                 $waitListCommand = CommandFactory::getCommand('ShowOffCampusWaitListApplication');
                 $waitListCommand->setTerm($this->term);
                 $tpl['WAIT_LIST_LINK'] = $waitListCommand->getLink('Apply to the waiting list');
             }
         }
     }
     return PHPWS_Template::process($tpl, 'hms', 'student/menuBlocks/OffCampusWaitingListMenuBlock.tpl');
 }
Exemple #6
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'] = '&lt;unassigned&gt;';
     $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 execute(CommandContext $context)
 {
     $id = $context->get('roommateId');
     if (is_null($id)) {
         throw new InvalidArgumentException('Must set roommateId');
     }
     PHPWS_Core::initModClass('hms', 'HMS_Roommate.php');
     $roommate = new HMS_Roommate($id);
     if ($roommate->id == 0) {
         throw new InvalidArgumentException('Invalid roommateId ' . $id);
     }
     $username = UserStatus::getUsername();
     if ($username != $roommate->requestee) {
         PHPWS_Core::initModClass('hms', 'exception/PermissionException.php');
         throw new PermissionException("{$username} tried to display confirmation screen for pairing {$roommate->id}");
     }
     $tpl = array();
     $acceptCmd = CommandFactory::getCommand('ShowRoommateConfirmAccept');
     $acceptCmd->setRoommateId($roommate->id);
     $tpl['ACCEPT'] = $acceptCmd->getURI();
     $rejectCmd = CommandFactory::getCommand('RoommateReject');
     $rejectCmd->setRoommateId($roommate->id);
     $tpl['DECLINE'] = $rejectCmd->getURI();
     $cancelCmd = CommandFactory::getCommand('ShowStudentMenu');
     $tpl['CANCEL'] = $cancelCmd->getURI();
     $requestor = StudentFactory::getStudentByUsername($roommate->requestor, $roommate->term);
     $tpl['REQUESTOR_NAME'] = $requestor->getFullName();
     $context->setContent(PHPWS_Template::process($tpl, 'hms', 'student/roommate_accept_reject_screen.tpl'));
 }
 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()
 {
     $tpl = array();
     PHPWS_Core::initModClass('hms', 'HMS_Util.php');
     $tpl['DATES'] = HMS_Util::getPrettyDateRange($this->startDate, $this->endDate);
     if (is_null($this->application)) {
         // No application
         $tpl['ICON'] = FEATURE_NOTYET_ICON;
         $tpl['NOT_APP'] = "";
         // this needs to be here to trigger the line in the template
     } else {
         if (time() < $this->startDate) {
             // too early
             $tpl['BEGIN_DEADLINE'] = HMS_Util::getFriendlyDate($this->startDate);
             $tpl['ICON'] = FEATURE_NOTYET_ICON;
         } else {
             if (time() > $this->endDate) {
                 // too late
                 $tpl['ICON'] = FEATURE_LOCKED_ICON;
                 $tpl['END_DEADLINE'] = HMS_Util::getFriendlyDate($this->endDate);
             } else {
                 $tpl['ICON'] = FEATURE_OPEN_ICON;
                 $cmd = CommandFactory::getCommand('ShowEmergencyContactForm');
                 $cmd->setTerm($this->application->getTerm());
                 $tpl['UPDATE_CONTACT'] = $cmd->getLink('update your emergency contact info');
             }
         }
     }
     return PHPWS_Template::process($tpl, 'hms', 'student/menuBlocks/updateEmergencyContactMenuBlock.tpl');
 }
Exemple #10
0
 public function show()
 {
     if (\UserStatus::isGuest()) {
         return '';
     }
     $terms = \Term::getTermsAssoc();
     $current = \Term::getCurrentTerm();
     if (isset($terms[$current])) {
         $terms[$current] .= ' (Current)';
     }
     $form = new \PHPWS_Form('term_selector');
     $cmd = \CommandFactory::getCommand('SelectTerm');
     $cmd->initForm($form);
     $form->addDropBox('term', $terms);
     $tags = $form->getTemplate();
     $currentTerm = \Term::getSelectedTerm();
     $tags['TERM_OPTIONS'] = array();
     foreach ($tags['TERM_VALUE'] as $key => $value) {
         $selected = '';
         if ($key == $currentTerm) {
             $selected = 'selected="selected"';
         }
         $tags['TERM_OPTIONS'][] = array('id' => $key, 'term' => $value, 'selected' => $selected);
     }
     javascript('jquery');
     javascriptMod('hms', 'jqueryCookie');
     javascript('modules/hms/SelectTerm');
     return \PHPWS_Template::process($tags, 'hms', 'admin/SelectTerm.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');
 }
Exemple #12
0
 public function show()
 {
     $tpl = array();
     $tpl['LOGIN_LINK'] = '';
     // a dummy tag to make the actual login content show
     return PHPWS_Template::process($tpl, 'hms', 'misc/login.tpl');
 }
Exemple #13
0
 /**
  * Returns the proccessed template that will be displayed
  * @return template
  */
 public function display()
 {
     $tpl = array();
     javascript('jquery');
     javascriptMod('appsync', 'organization');
     return \PHPWS_Template::process($tpl, 'appsync', 'top.tpl');
 }
 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');
 }
 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()
 {
     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()
 {
     $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');
 }
 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();
     // Check for an empty array of requests
     if (sizeof($this->requests) == 0) {
         $tpl['NO_REQUESTS'] = 'No pending requests found.';
         return PHPWS_Template::process($tpl, 'hms', 'admin/roomChangeListView.tpl');
     }
     javascriptMod('hms', 'livestamp');
     $tpl['REQUESTS'] = array();
     foreach ($this->requests as $request) {
         $row = array();
         $participants = $request->getParticipants();
         $participantNames = array();
         foreach ($participants as $p) {
             $student = StudentFactory::getStudentByBannerId($p->getBannerId(), $this->term);
             $participantNames[] = $student->getName();
         }
         $row['participants'] = implode(', ', $participantNames);
         $mgmtCmd = CommandFactory::getCommand('ShowManageRoomChange');
         $mgmtCmd->setRequestId($request->getId());
         $row['manage'] = $mgmtCmd->getURI();
         $row['last_updated_timestamp'] = $request->getLastUpdatedTimestamp();
         $row['last_updated_date'] = date("M j @ g:ia", $request->getLastUpdatedTimestamp());
         $tpl['REQUESTS'][] = $row;
     }
     return PHPWS_Template::process($tpl, 'hms', 'admin/roomChangeListView.tpl');
 }
 public function show()
 {
     $tpl = array();
     $tpl['DATES'] = HMS_Util::getPrettyDateRange($this->startDate, $this->endDate);
     $tpl['STATUS'] = "";
     if (isset($this->profile) && !is_null($this->profile)) {
         $tpl['ICON'] = FEATURE_COMPLETED_ICON;
         $editCmd = CommandFactory::getCommand('ShowRoommateProfileForm');
         $editCmd->setTerm($this->term);
         $tpl['EDIT_PROFILE'] = $editCmd->getLink('view and edit your profile');
     } else {
         if (time() < $this->startDate) {
             $tpl['ICON'] = FEATURE_LOCKED_ICON;
             $tpl['BEGIN_DEADLINE'] = HMS_Util::getFriendlyDate($this->startDate);
         } else {
             if (time() > $this->endDate) {
                 $tpl['END_DEADLINE'] = HMS_Util::getFriendlyDate($this->endDate);
                 // fade out header
                 $tpl['STATUS'] = "locked";
                 $tpl['ICON'] = FEATURE_LOCKED_ICON;
             } else {
                 $tpl['ICON'] = FEATURE_OPEN_ICON;
                 $createCmd = CommandFactory::getCommand('ShowRoommateProfileForm');
                 $createCmd->setTerm($this->term);
                 $tpl['CREATE_PROFILE'] = $createCmd->getLink('Create your profile');
             }
         }
     }
     return PHPWS_Template::process($tpl, 'hms', 'student/menuBlocks/StudentProfileMenuBlock.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()
 {
     $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');
 }
 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');
 }
 public function show()
 {
     PHPWS_Core::initModClass('hms', 'HMS_Lottery.php');
     PHPWS_Core::initModClass('hms', 'LotteryApplication.php');
     $this->setTitle('Special Interest Group');
     javascript('jquery');
     $tpl = array();
     $groups = HMS_Lottery::getSpecialInterestGroupsMap();
     // If a group was selected
     if (!is_null($this->group) && $this->group != 'none') {
         $tpl['GROUP_PAGER'] = LotteryApplication::specialInterestPager($this->group, PHPWS_Settings::get('hms', 'lottery_term'));
         $tpl['GROUP'] = $groups[$this->group];
     }
     // Show the drop down box of groups
     $form = new PHPWS_Form('special_interest');
     $form->setMethod('get');
     $form->addDropBox('group', $groups);
     $form->setClass('group', 'form-control');
     $form->setMatch('group', $this->group);
     $cmd = CommandFactory::getCommand('ShowSpecialInterestGroupApproval');
     $cmd->initForm($form);
     $form->mergeTemplate($tpl);
     $tpl = $form->getTemplate();
     return PHPWS_Template::process($tpl, 'hms', 'admin/special_interest_approval.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');
 }
 public function show()
 {
     $username = UserStatus::getUsername();
     $currentTerm = Term::getCurrentTerm();
     $student = StudentFactory::getStudentByUsername($username, $currentTerm);
     $applicationTerm = $student->getApplicationTerm();
     $tpl = array();
     $tpl['TITLE'] = 'Contact Form';
     $form = new PHPWS_Form();
     $form->addText('name');
     $form->setLabel('name', 'Name');
     $form->addText('email');
     $form->setLabel('email', 'Email Address');
     $form->addText('phone');
     $form->setLabel('phone', 'Phone number');
     $form->addDropBox('stype', array('F' => 'New Freshmen', 'T' => 'Transfer', 'C' => 'Returning'));
     $form->setLabel('stype', 'Classification');
     $form->addTextArea('comments');
     $form->setLabel('comments', 'Question, Comments, or Description of the Problem');
     $form->addSubmit('Submit');
     $form->mergeTemplate($tpl);
     $cmd = CommandFactory::getCommand('SubmitContactForm');
     $cmd->setUsername($username);
     $cmd->setApplicationTerm($applicationTerm);
     $cmd->setStudentType($student->getType());
     $cmd->initForm($form);
     $tpl = $form->getTemplate();
     //var_dump($tpl);exit;
     return PHPWS_Template::process($tpl, 'hms', 'student/contact_page.tpl');
 }
 public function show()
 {
     $tpl = array();
     $submitCmd = CommandFactory::getCommand('SendLotteryInvites');
     $form = new PHPWS_Form();
     $submitCmd->initForm($form);
     $form->addCheckAssoc('send_reminders', array('send_reminders' => "Send Invite Reminders"));
     $form->setMatch('send_reminders', 'send_reminders');
     $form->addCheckAssoc('magic_flag', array('magic_flag' => "Send 'Magic Winner' Invites"));
     $form->setMatch('magic_flag', 'magic_flag');
     $form->addText('sr_male', 0);
     $form->setLabel('sr_male', 'Male:');
     $form->setClass('sr_male', 'form-control');
     $form->addText('sr_female', 0);
     $form->setLabel('sr_female', 'Female:');
     $form->setClass('sr_female', 'form-control');
     $form->addText('jr_male', 0);
     $form->setLabel('jr_male', 'Male:');
     $form->setClass('jr_male', 'form-control');
     $form->addText('jr_female', 0);
     $form->setLabel('jr_female', 'Female:');
     $form->setClass('jr_female', 'form-control');
     $form->addText('soph_male', 0);
     $form->setLabel('soph_male', 'Male:');
     $form->setClass('soph_male', 'form-control');
     $form->addText('soph_female', 0);
     $form->setLabel('soph_female', 'Female:');
     $form->setClass('soph_female', 'form-control');
     $form->addSubmit('submit', 'Send Invites');
     $form->mergeTemplate($tpl);
     $tpl = $form->getTemplate();
     return PHPWS_Template::process($tpl, 'hms', 'admin/SendLotteryInvitesView.tpl');
 }
 public function show()
 {
     $tpl = array();
     $tpl['CHANGELOG_REPEAT'] = array();
     PHPWS_Core::initModClass('intern', 'ChangeHistoryFactory.php');
     $changes = ChangeHistoryFactory::getChangesForInternship($this->internship);
     if (is_null($changes)) {
         return "";
     }
     foreach ($changes as $change) {
         $changeFields = array();
         $changeFields['RELATIVE_DATE'] = $change->getRelativeDate();
         $changeFields['EXACT_DATE'] = $change->getFormattedDate();
         $changeFields['USERNAME'] = $change->getUsername();
         if ($change->getFromStateFriendlyname() != $change->getToStateFriendlyName()) {
             $changeFields['FROM_STATE'] = $change->getFromStateFriendlyName();
             $changeFields['TO_STATE'] = $change->getToStateFriendlyName();
         }
         $note = $change->getNote();
         if (!is_null($note)) {
             $changeFields['NOTE'] = $note;
         }
         $tpl['changelog_repeat'][] = $changeFields;
     }
     return PHPWS_Template::process($tpl, 'intern', 'changeHistory.tpl');
 }
Exemple #30
0
 public function show()
 {
     $tpl = array();
     $tpl['NOTIFICATIONS'] = $this->notifications;
     $tpl['MAIN'] = $this->getMain();
     $this->showHMS(\PHPWS_Template::process($tpl, 'hms', 'user.tpl'));
 }