public function show() { $form = new PHPWS_Form('room_change_request'); /* Cell phone */ $form->addText('cell_num'); $form->setLabel('cell_num', 'Cell phone Number'); $form->addCssClass('cell_num', 'form-control'); $form->addCheck('cell_opt_out'); /* Preferences */ $halls = array(0 => 'Choose from below...'); $halls = $halls + HMS_Residence_Hall::get_halls_array(Term::getSelectedTerm()); $form->addRadioAssoc('type', array('switch' => 'I want to change to an open bed.', 'swap' => 'I want to swap beds with someone I know.')); /* Swap */ $form->addText('swap_with'); $form->setLabel('swap_with', 'ASU Email Address'); $form->addCssClass('swap_with', 'form-control'); /* Switch */ $form->addDropBox('first_choice', $halls); $form->setLabel('first_choice', 'First Choice'); $form->addCssClass('first_choice', 'form-control'); $form->addDropBox('second_choice', $halls); $form->setLabel('second_choice', 'Second Choice'); $form->addCssClass('second_choice', 'form-control'); /* Reason */ $form->addTextArea('reason'); $form->setLabel('reason', 'Reason'); $form->addCssClass('reason', 'form-control'); $form->setRows('reason', 5); /* POST location */ $cmd = CommandFactory::getCommand('SubmitRoomChangeRequest'); $cmd->initForm($form); $tpl = $form->getTemplate(); return PHPWS_Template::process($tpl, 'hms', 'student/roomChangeRequestForm.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() { $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() { 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'); }
/** * Main method for creating the view */ public function show() { javascript('jquery'); javascript('jquery_ui'); javascriptMod('hms', 'jqueryCookie'); //javascriptMod('packageDesk'); Layout::addPageTitle('Package Desk'); $form = new PHPWS_Form('pd'); // Package desk drop down $form->addDropBox('desk', array('Select a Package Desk...') + $this->packageDesks); $form->setLabel('desk', 'Package Desk'); $form->addHidden('desk_hidden'); $tpl = $form->getTemplate(); return PHPWS_Template::process($tpl, 'hms', 'admin/packageDesk.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; }
public function display() { // Set up search fields $form = new \PHPWS_Form(); $form->setMethod('get'); $form->addHidden('module', 'intern'); $form->addHidden('action', 'results'); $form->useRowRepeat(); // Student name or Banner ID $form->addText('name'); $form->setLabel('name', "Name or Banner ID"); /*************** * Course Info * ***************/ $terms = Term::getTermsAssoc(); $form->addSelect('term_select', $terms); $form->setLabel('term_select', 'Term'); $form->setClass('term_select', 'form-control'); $subjects = array('-1' => 'Select subject ') + Subject::getSubjects(); $form->addSelect('course_subj', $subjects); $form->setLabel('course_subj', 'Subject'); $form->setClass('course_subj', 'form-control'); $form->addText('course_no'); $form->setLabel('course_no', 'Course Number'); $form->setSize('course_no', 6); $form->setMaxSize('course_no', 4); $form->setClass('course_no', 'form-control'); $form->addText('course_sect'); $form->setLabel('course_sect', 'Section'); $form->setSize('course_sect', 6); $form->setMaxSize('course_sect', 4); $form->setClass('course_sect', 'form-control'); /**************** * Faculty Info * ****************/ // Deity can search for any department. Other users are restricted. if (\Current_User::isDeity()) { $depts = Department::getDepartmentsAssoc(); } else { $depts = Department::getDepartmentsAssocForUsername(\Current_User::getUsername()); } $depts = array('-1' => 'Select Department') + $depts; $form->addSelect('dept', $depts); $form->setLabel('dept', 'Department'); //$form->setClass('', 'form-control'); $form->setClass('dept', 'form-control'); // If the user only has one department, select it for them // sizeof($depts) == 2 because of the 'Select Deparmtnet' option if (sizeof($depts) == 2) { $keys = array_keys($depts); $form->setMatch('dept', $keys[1]); } // Student level radio button javascript('jquery'); javascriptMod('intern', 'majorSelector', array('form_id' => $form->id)); // Student Major dummy box (gets replaced by dropdowns below using JS when student_level is selected) $levels = array('-1' => 'Choose student level first'); $form->addDropBox('student_major', $levels); $form->setLabel('student_major', 'Major / Program'); $form->addCssClass('student_major', 'form-control'); // Get the majors list $majorsList = MajorsProviderFactory::getProvider()->getMajors(Term::timeToTerm(time())); // Undergrad major drop down $undergradMajors = array('-1' => 'Select Undergraduate Major') + $majorsList->getUndergradMajorsAssoc(); $form->addSelect('undergrad_major', $undergradMajors); $form->setMatch('undergrad_major', '-1'); $form->setClass('undergrad_major', 'form-control'); // Graduate major drop down $graduateMajors = array('-1' => 'Select Graduate Major') + $majorsList->getGraduateMajorsAssoc(); $form->addSelect('graduate_major', $graduateMajors); $form->setMatch('graduate_major', '-1'); $form->setClass('graduate_major', 'form-control'); /******************* * Internship Type * *******************/ // Handeled directly in the html template /************ * Location * ************/ // Campus Handeled directly in the html template // International vs Domestic - Handeled directly in the html template // State search /******************* * Workflow States * *******************/ $workflowStates = WorkflowStateFactory::getStatesAssoc(); unset($workflowStates['Intern\\WorkflowState\\CreationState']); // Remove this state, since it's not valid (internal only state for initial creation) $form->addCheckAssoc('workflow_state', $workflowStates); $form->addSubmit('submit', 'Search'); // Javascript... javascriptMod('intern', 'resetSearch'); return \PHPWS_Template::process($form->getTemplate(), 'intern', 'search.tpl'); }
public static function display() { PHPWS_Core::initModClass('intern', 'Term.php'); PHPWS_Core::initModClass('intern', 'Department.php'); PHPWS_Core::initModClass('intern', 'Major.php'); PHPWS_Core::initModClass('intern', 'GradProgram.php'); PHPWS_Core::initModClass('intern', 'Internship.php'); PHPWS_Core::initModClass('intern', 'Agency.php'); PHPWS_Core::initModClass('intern', 'Subject.php'); PHPWS_Core::initModClass('intern', 'WorkflowStateFactory.php'); // Set up search fields $form = new PHPWS_Form(); $form->setMethod('get'); $form->addHidden('module', 'intern'); $form->addHidden('action', 'results'); $form->useRowRepeat(); $form->addText('name'); $form->setLabel('name', "Name or Banner ID"); $terms = Term::getTermsAssoc(); //$thisTerm = Term::timeToTerm(time()); $form->addSelect('term_select', $terms); $form->setLabel('term_select', 'Term'); $form->setClass('term_select', 'form-control'); //$form->setMatch('term_select', $thisTerm); // Deity can search for any department. Other users are restricted. if (Current_User::isDeity()) { $depts = Department::getDepartmentsAssoc(); } else { $depts = Department::getDepartmentsAssocForUsername(Current_User::getUsername()); } $form->addSelect('dept', $depts); $form->setLabel('dept', 'Department'); //$form->setClass('', 'form-control'); $form->setClass('dept', 'form-control'); // If the user only has one department, select it for them // sizeof($depts) == 2 because of the 'Select Deparmtnet' option if (sizeof($depts) == 2) { $keys = array_keys($depts); $form->setMatch('dept', $keys[1]); } // Student level radio button javascript('jquery'); javascriptMod('intern', 'majorSelector', array('form_id' => $form->id)); $levels = array('-1' => 'Any Level', 'ugrad' => 'Undergraduate', 'grad' => 'Graduate'); $form->addSelect('student_level', $levels); $form->setLabel('student_level', 'Level'); $form->setClass('student_level', 'form-control'); // Student Major dummy box (gets replaced by dropdowns below using JS when student_level is selected) $levels = array('-1' => 'Choose student level first'); $form->addDropBox('student_major', $levels); $form->setLabel('student_major', 'Major / Program'); $form->addCssClass('student_major', 'form-control'); // Undergrad major drop down if (isset($s)) { $majors = Major::getMajorsAssoc($s->ugrad_major); } else { $majors = Major::getMajorsAssoc(); } $form->addSelect('ugrad_major', $majors); $form->setLabel('ugrad_major', 'Undergraduate Majors & Certificate Programs'); $form->setClass('ugrad_major', 'form-control'); // Graduate major drop down if (isset($s)) { $progs = GradProgram::getGradProgsAssoc($s->grad_prog); } else { $progs = GradProgram::getGradProgsAssoc(); } $form->addSelect('grad_prog', $progs); $form->setLabel('grad_prog', 'Graduate Majors & Certificate Programs'); $form->setClass('grad_prog', 'form-control'); // Campus $campuses = array('main_campus' => 'Main Campus', 'distance_ed' => 'Distance Ed'); $form->addRadioAssoc('campus', $campuses); /*************** * Course Info * ***************/ $subjects = Subject::getSubjects(); $form->addSelect('course_subj', $subjects); $form->setLabel('course_subj', 'Subject'); $form->setClass('course_subj', 'form-control'); $form->addText('course_no'); $form->setLabel('course_no', 'Course Number'); $form->setSize('course_no', 6); $form->setMaxSize('course_no', 4); $form->setClass('course_no', 'form-control'); $form->addText('course_sect'); $form->setLabel('course_sect', 'Section'); $form->setSize('course_sect', 6); $form->setMaxSize('course_sect', 4); $form->setClass('course_sect', 'form-control'); // Internship types. $types = Internship::getTypesAssoc(); $form->addRadioAssoc('type', $types); // Location $loc = array('domestic' => 'Domestic', 'internat' => 'International'); $form->addRadioAssoc('loc', $loc); /* State search */ $db = new PHPWS_DB('intern_state'); $db->addWhere('active', 1); $db->addColumn('abbr'); $db->addColumn('full_name'); $db->setIndexBy('abbr'); // get backwards because we flip it $db->addOrder('full_name desc'); $states = $db->select('col'); if (empty($states)) { NQ::simple('intern', INTERN_ERROR, 'The list of allowed US states for internship locations has not been configured. Please use the administrative options to <a href="index.php?module=intern&action=edit_states">add allowed states.</a>'); NQ::close(); PHPWS_Core::goBack(); } $states[-1] = 'Select state'; $states = array_reverse($states, true); $form->addSelect('state', $states); $form->setLabel('state', 'State'); $form->setClass('state', 'form-control'); /* Province search */ $form->addText('prov'); $form->setLabel('prov', 'Province/Territory'); $form->setClass('prov', 'form-control'); // Workflow states $workflowStates = WorkflowStateFactory::getStatesAssoc(); unset($workflowStates['CreationState']); // Remove this state, since it's not valid (internal only state for initial creation) $form->addCheckAssoc('workflow_state', $workflowStates); unset($_REQUEST['module']); unset($_REQUEST['action']); unset($_REQUEST['submit']); //test($_REQUEST,1); $form->plugIn($_REQUEST); $form->addSubmit('submit', 'Search'); // Javascript... javascript('jquery'); javascriptMod('intern', 'resetSearch'); return PHPWS_Template::process($form->getTemplate(), 'intern', 'search.tpl'); }