本文整理汇总了PHP中Subject::getSubjects方法的典型用法代码示例。如果您正苦于以下问题:PHP Subject::getSubjects方法的具体用法?PHP Subject::getSubjects怎么用?PHP Subject::getSubjects使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Subject
的用法示例。
在下文中一共展示了Subject::getSubjects方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: buildInternshipForm
//.........这里部分代码省略.........
$loc = array('domestic' => 'Domestic', 'internat' => 'International');
$this->form->addRadioAssoc('location', $loc);
//$this->form->setMatch('location', 'domestic'); // Default to domestic
//$this->form->setRequired('location');
// Domestic fields
$this->form->addText('loc_address');
$this->form->setLabel('loc_address', 'Address');
$this->form->addCssClass('loc_address', 'form-control');
$this->form->addText('loc_city');
$this->form->setLabel('loc_city', 'City');
$this->form->addCssClass('loc_city', 'form-control');
$this->form->addSelect('loc_state', State::getAllowedStates());
$this->form->setLabel('loc_state', 'State');
$this->form->addCssClass('loc_state', 'form-control');
$this->form->addText('loc_zip');
$this->form->setLabel('loc_zip', 'Zip');
$this->form->addCssClass('loc_zip', 'form-control');
// Itn'l location fields
$this->form->addText('loc_province');
$this->form->setLabel('loc_province', 'Province/Territory');
$this->form->addCssClass('loc_province', 'form-control');
$this->form->addText('loc_country');
$this->form->setLabel('loc_country', 'Country');
$this->form->addCssClass('loc_country', 'form-control');
/*************
* Term Info *
*/
$terms = Term::getFutureTermsAssoc();
$terms[-1] = 'Select Term';
$this->form->addSelect('term', $terms);
$this->form->setLabel('term', 'Select Term');
$this->form->addCssClass('term', 'form-control');
$this->form->addText('start_date');
$this->form->setLabel('start_date', 'Start Date');
$this->form->addCssClass('start_date', 'form-control');
$this->form->addText('end_date');
$this->form->setLabel('end_date', 'End Date');
$this->form->addCssClass('end_date', 'form-control');
$this->form->addText('credits');
$this->form->setLabel('credits', 'Credit Hours');
$this->form->addCssClass('credits', 'form-control');
$this->form->addText('avg_hours_week');
$this->form->setLabel('avg_hours_week', 'Average Hours per Week');
$this->form->addCssClass('avg_hours_week', 'form-control');
$this->form->addCheck('multipart');
$this->form->setLabel('multipart', 'This internship is part of a multi-part experience.');
$this->form->addCheck('secondary_part');
$this->form->setLabel('secondary_part', 'This is a secondary part (enrollment complete through primary part).');
/***************
* Course Info *
*/
$subjects = Subject::getSubjects();
$this->form->addSelect('course_subj', $subjects);
$this->form->setLabel('course_subj', 'Subject');
$this->form->addCssClass('course_subj', 'form-control');
$this->form->addText('course_no');
$this->form->setLabel('course_no', 'Number');
$this->form->addCssClass('course_no', 'form-control');
$this->form->addText('course_sect');
$this->form->setLabel('course_sect', 'Section');
$this->form->addCssClass('course_sect', 'form-control');
$this->form->addText('course_title');
$this->form->setLabel('course_title', 'Title');
$this->form->setMaxSize('course_title', 28);
// Limit to 28 chars, per Banner
$this->form->addCssClass('course_title', 'form-control');
// Corequisite
if (!is_null($this->intern)) {
$dept = $this->intern->getDepartment();
if ($dept->hasCorequisite()) {
$this->form->addText('corequisite_course_num');
$this->form->addCssClass('corequisite_course_num', 'form-control');
$this->form->addText('corequisite_course_sect');
$this->form->addCssClass('corequisite_course_sect', 'form-control');
}
}
/************
* Pay Info *
*/
$pay = array('unpaid' => 'Unpaid', 'paid' => 'Paid');
$this->form->addRadioAssoc('payment', $pay);
$this->form->setMatch('payment', 'unpaid');
// Default to unpaid
$this->form->addCheck('stipend');
$this->form->setLabel('stipend', 'Stipend');
$this->form->addText('pay_rate');
$this->form->setLabel('pay_rate', 'Pay Rate');
$this->form->addCssClass('pay_rate', 'form-control');
/*******************
* Internship Type *
*/
$this->form->addRadioAssoc('experience_type', Internship::getTypesAssoc());
$this->form->setMatch('experience_type', 'internship');
/*********
* Notes *
*/
$this->form->addTextArea('notes');
$this->form->setLabel('notes', 'Notes');
$this->form->addCssClass('notes', 'form-control');
}
示例2: sendRegistrationIssueEmail
/**
* Sends the 'Registration Issue' notification email.
*
* @param Internship $i
* @param Agency $agency
* @param string $note
*/
public static function sendRegistrationIssueEmail(Internship $i, Agency $agency, $note)
{
$tpl = array();
$subjects = Subject::getSubjects();
$settings = InternSettings::getInstance();
$faculty = $i->getFaculty();
$tpl = array();
$tpl['NAME'] = $i->getFullName();
$tpl['BANNER'] = $i->banner;
$tpl['USER'] = $i->email;
$tpl['PHONE'] = $i->phone;
$tpl['TERM'] = Term::rawToRead($i->term, false);
if (isset($i->course_subj)) {
$tpl['SUBJECT'] = $subjects[$i->course_subj];
} else {
$tpl['SUBJECT'] = '(No course subject provided)';
}
$tpl['COURSE_NUM'] = $i->course_no;
if (isset($i->course_sect)) {
$tpl['SECTION'] = $i->course_sect;
} else {
$tpl['SECTION'] = '(not provided)';
}
if (isset($i->course_title)) {
$tpl['COURSE_TITLE'] = $i->course_title;
}
if (isset($i->credits)) {
$tpl['CREDITS'] = $i->credits;
} else {
$tpl['CREDITS'] = '(not provided)';
}
$startDate = $i->getStartDate(true);
if (isset($startDate)) {
$tpl['START_DATE'] = $startDate;
} else {
$tpl['START_DATE'] = '(not provided)';
}
$endDate = $i->getEndDate(true);
if (isset($endDate)) {
$tpl['END_DATE'] = $endDate;
} else {
$tpl['END_DATE'] = '(not provided)';
}
if ($faculty instanceof Faculty) {
$tpl['FACULTY'] = $faculty->getFullName();
} else {
$tpl['FACULTY'] = '(not provided)';
}
$department = $i->getDepartment();
$tpl['DEPT'] = $department->getName();
if ($i->international) {
$tpl['COUNTRY'] = $i->loc_country;
$tpl['INTERNATIONAL'] = 'Yes';
$intlSubject = '[int\'l] ';
} else {
$tpl['STATE'] = $i->loc_state;
$tpl['INTERNATIONAL'] = 'No';
$intlSubject = '';
}
$tpl['NOTE'] = $note;
$to = $i->email . $settings->getEmailDomain();
if ($faculty instanceof Faculty) {
$cc = array($faculty->getUsername() . $settings->getEmailDomain());
} else {
$cc = array();
}
$subject = 'Internship Enrollment Issue';
email::sendTemplateMessage($to, $subject, 'email/RegistrationIssue.tpl', $tpl, $cc);
}
示例3: plugCourseInfo
private function plugCourseInfo()
{
// Course Info
// Remove the subject field and re-add it
$this->form->dropElement('course_subj');
$this->form->addSelect('course_subj', Subject::getSubjects($this->intern->course_subj));
$this->form->setMatch('course_subj', $this->intern->course_subj);
$this->formVals['course_no'] = $this->intern->course_no;
$this->formVals['course_sect'] = $this->intern->course_sect;
$this->formVals['course_title'] = $this->intern->course_title;
if ($this->intern->isMultipart()) {
$this->form->setMatch('multipart', '1');
}
if ($this->intern->isSecondaryPart()) {
$this->form->setMatch('secondary_part', '1');
}
$this->formVals['corequisite_course_num'] = $this->intern->getCorequisiteNum();
$this->formVals['corequisite_course_sect'] = $this->intern->getCorequisiteSection();
}
示例4: display
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');
//.........这里部分代码省略.........