本文整理汇总了PHP中Term::getPrintableSelectedTerm方法的典型用法代码示例。如果您正苦于以下问题:PHP Term::getPrintableSelectedTerm方法的具体用法?PHP Term::getPrintableSelectedTerm怎么用?PHP Term::getPrintableSelectedTerm使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Term
的用法示例。
在下文中一共展示了Term::getPrintableSelectedTerm方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: show
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');
}
示例2: show
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');
}
示例3: show
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');
}
示例4: show
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');
}
示例5: show
public function show()
{
$tpl = array();
$tpl['PAGER'] = $this->roommatePager->show();
$tpl['TERM'] = Term::getPrintableSelectedTerm();
$createCmd = CommandFactory::getCommand('CreateRoommateGroupView');
$tpl['CREATE_REQUEST_URI'] = $createCmd->getURI();
Layout::addPageTitle("Edit Roommate Group");
return PHPWS_Template::process($tpl, 'hms', 'admin/show_confirmed_roommates.tpl');
}
示例6: show
public function show()
{
if (!UserStatus::isAdmin() || !Current_User::allow('hms', 'edit_terms')) {
PHPWS_Core::initModClass('hms', 'exception/PermissionException.php');
throw new PermissionException('You do not have permission to edit terms.');
}
$printable = Term::getPrintableSelectedTerm();
$tpl = array();
$tpl['TITLE'] = dgettext('hms', 'Term settings for ') . $printable;
$newTermCmd = CommandFactory::getCommand('ShowCreateTerm');
$tpl['NEW_TERM_URI'] = $newTermCmd->getURI();
// Is this the Current Term?
if (Term::isCurrentTermSelected()) {
$tpl['CURRENT_TERM_TEXT'] = dgettext('hms', 'This term is the <strong>active term</strong>. To make another term active, please select it from the list at the top-left.');
} else {
$tpl['CURRENT_TERM_TEXT'] = dgettext('hms', 'This term is <strong>not</strong> the active term.');
if (Current_User::allow('hms', 'activate_term')) {
$cmd = CommandFactory::getCommand('SetCurrentTerm');
$cmd->setTerm(Term::getSelectedTerm());
$tpl['SET_TERM_URI'] = $cmd->getURI();
$tpl['SET_TERM_TEXT'] = "Make <strong>{$printable}</strong> the Current Term";
}
}
// What's with the Banner Queue?
$term = new Term(Term::getSelectedTerm());
if ($term->getBannerQueue()) {
$tpl['QUEUE_ENABLED'] = '';
$count = $term->getQueueCount();
$tpl['BANNER_QUEUE_COUNT'] = $count;
if ($count > 0) {
$cmd = CommandFactory::getCommand('ProcessBannerQueue');
$cmd->setTerm(Term::getSelectedTerm());
$tpl['BANNER_QUEUE_PROCESS_URI'] = $cmd->getURI();
} else {
$cmd = CommandFactory::getCommand('DisableBannerQueue');
$cmd->setTerm(Term::getSelectedTerm());
$tpl['BANNER_QUEUE_LINK'] = $cmd->getLink('Disable');
}
} else {
$tpl['QUEUE_DISABLED'] = '';
$cmd = CommandFactory::getCommand('EnableBannerQueue');
$cmd->setTerm(Term::getSelectedTerm());
$tpl['BANNER_QUEUE_LINK'] = $cmd->getLink('Enable');
}
// Terms and Conditions
PHPWS_Core::initModClass('hms', 'TermsConditionsAdminView.php');
$tcav = new TermsConditionsAdminView($this->term);
$tpl['TERMS_CONDITIONS_CONTENT'] = $tcav->show();
// Features and Deadlines
PHPWS_Core::initModClass('hms', 'ApplicationFeatureListView.php');
$aflv = new ApplicationFeatureListView(Term::getSelectedTerm());
$tpl['FEATURES_DEADLINES_CONTENT'] = $aflv->show();
Layout::addPageTitle("Term Settings");
return PHPWS_Template::process($tpl, 'hms', 'admin/TermEditView.tpl');
}
示例7: show
public function show()
{
$tpl = array();
$tpl['TITLE'] = $this->title;
$tpl['TERM'] = Term::getPrintableSelectedTerm();
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();
}
PHPWS_Core::initCoreClass('Form.php');
$form = new PHPWS_Form();
$this->onSelectCmd->initForm($form);
$form->setMethod('get');
$form->addDropBox('hallId', $this->halls);
$form->addCssClass('hallId', 'form-control');
$form->addSubmit('submit', _('Select Hall'));
$form->mergeTemplate($tpl);
$tpl = $form->getTemplate();
Layout::addPageTitle("Select Hall");
return PHPWS_Template::process($tpl, 'hms', 'admin/select_residence_hall.tpl');
}
示例8: show
public function show()
{
$tpl = array();
$tpl['TERM'] = Term::getPrintableSelectedTerm();
$tpl['HALL_NAMES'] = implode(', ', $this->hallNames);
$needsActionList = new RoomChangeListView($this->needsApproval, $this->term);
$tpl['NEEDS_ACTION'] = $needsActionList->show();
$tpl['NEEDS_ACTION_COUNT'] = count($this->needsApproval);
$approvedList = new RoomChangeListView($this->approved, $this->term);
$tpl['APPROVED'] = $approvedList->show();
$tpl['APPROVED_COUNT'] = count($this->approved);
$pendingList = new RoomChangeListView($this->allPending, $this->term);
$tpl['PENDING'] = $pendingList->show();
$tpl['PENDING_COUNT'] = count($this->allPending);
$completedList = new RoomChangeListView($this->completed, $this->term);
$tpl['COMPLETED'] = $completedList->show();
$tpl['COMPLETED_COUNT'] = count($this->completed);
$inactiveList = new RoomChangeListView($this->inactive, $this->term);
$tpl['INACTIVE'] = $inactiveList->show();
$tpl['INACTIVE_COUNT'] = count($this->inactive);
return PHPWS_Template::process($tpl, 'hms', 'admin/RoomChangeApprovalView.tpl');
}
示例9: show
public function show()
{
$tpl = new PHPWS_Template('hms');
$tpl->setFile('admin/floor_assignment.tpl');
$this->floor->loadRooms();
javascript('jquery_ui');
javascript('modules/hms/floor_assignment');
$this->floor->loadHall();
$hall = $this->floor->_hall;
$tpl->setCurrentBlocK('title');
$tpl->setData(array('TITLE' => HMS_Util::ordinal($this->floor->getFloorNumber()) . ' Floor - ' . $hall->getHallName() . ' - ' . Term::getPrintableSelectedTerm()));
foreach ($this->floor->_rooms as $room) {
$room->loadBeds();
foreach ($room->_beds as $bed) {
$tpl->setCurrentBlock('bed-list');
$tpl->setData(array('BED_ID' => $bed->id));
$tpl->parseCurrentBlock();
}
$tpl->setCurrentBlock('room-list');
$tpl->setData(array('ROOM' => $room->room_number));
$tpl->parseCurrentBlock();
}
return $tpl->get();
}
示例10: show
public function show()
{
if (!UserStatus::isAdmin()) {
PHPWS_Core::initModClass('hms', 'exception/PermissionException.php');
throw new PermissionException('You are not allowed to view residence halls');
}
javascript('jquery_ui');
$tpl = array();
# Setup the title and color of the title bar
$tpl['TITLE'] = $this->hall->getHallName();
$tpl['TERM'] = Term::getPrintableSelectedTerm();
if (!$this->hall->isOnline()) {
$tpl['OFFLINE'] = '';
}
$submitCmd = CommandFactory::getCommand('EditResidenceHall');
$submitCmd->setHallId($this->hall->getId());
$form = new PHPWS_Form();
$submitCmd->initForm($form);
// This is unused, as far as I can tell, so comment it out for now.
//$form->addHidden('beds_per_room', $this->hall->count_beds_per_room()); // add a hidden field for beds per room
$form->addText('hall_name', $this->hall->hall_name);
$form->addCssClass('hall_name', 'form-control');
$tpl['NUMBER_OF_FLOORS'] = $this->hall->get_number_of_floors();
$tpl['NUMBER_OF_ROOMS'] = $this->hall->get_number_of_rooms();
$tpl['NUMBER_OF_BEDS'] = $this->hall->get_number_of_beds();
$tpl['NUMBER_OF_BEDS_ONLINE'] = $this->hall->get_number_of_online_nonoverflow_beds();
$tpl['NUMBER_OF_ASSIGNEES'] = $this->hall->get_number_of_assignees();
$form->addDropBox('gender_type', array(FEMALE => FEMALE_DESC, MALE => MALE_DESC, COED => COED_DESC));
$form->setMatch('gender_type', $this->hall->gender_type);
$form->addCssClass('gender_type', 'form-control');
$form->addCheckBox('air_conditioned', 1);
$form->setMatch('air_conditioned', $this->hall->air_conditioned);
$form->addCheckBox('is_online', 1);
$form->setMatch('is_online', $this->hall->is_online);
$form->addCheckBox('meal_plan_required', 1);
$form->setMatch('meal_plan_required', $this->hall->meal_plan_required);
$form->addCheckBox('assignment_notifications', 1);
$form->setMatch('assignment_notifications', $this->hall->assignment_notifications);
// Package Desks
//PHPWS_Core::initModClass('hms', 'PackageDeskFactory.php');
//$packageDesks = PackageDeskFactory::getPackageDesksAssoc();
//$form->addDropBox('package_desk', $packageDesks);
//$form->setMatch('package_desk', $this->hall->getPackageDeskId());
// Images
PHPWS_Core::initModClass('filecabinet', 'Cabinet.php');
if (isset($this->hall->exterior_image_id)) {
$manager = Cabinet::fileManager('exterior_image_id', $this->hall->exterior_image_id);
} else {
$manager = Cabinet::fileManager('exterior_image_id');
}
$manager->maxImageWidth(300);
$manager->MaxImageHeight(300);
$manager->imageOnly(false, false);
$form->addTplTag('EXTERIOR_IMG', $manager->get());
if (isset($this->hall->other_image_id)) {
$manager = Cabinet::fileManager('other_image_id', $this->hall->other_image_id);
} else {
$manager = Cabinet::fileManager('other_image_id');
}
$manager->maxImageWidth(300);
$manager->MaxImageHeight(300);
$manager->imageOnly(false, false);
$form->addTplTag('OTHER_IMG', $manager->get());
if (isset($this->hall->map_image_id)) {
$manager = Cabinet::fileManager('map_image_id', $this->hall->map_image_id);
} else {
$manager = Cabinet::fileManager('map_image_id');
}
$manager->maxImageWidth(300);
$manager->MaxImageHeight(300);
$manager->imageOnly(false, false);
$form->addTplTag('MAP_IMG', $manager->get());
if (isset($this->hall->room_plan_image_id)) {
$manager = Cabinet::fileManager('room_plan_image_id', $this->hall->room_plan_image_id);
} else {
$manager = Cabinet::fileManager('room_plan_image_id');
}
$manager->maxImageWidth(300);
$manager->MaxImageHeight(300);
$manager->imageOnly(false, false);
$form->addTplTag('ROOM_PLAN_IMG', $manager->get());
# if the user has permission to view the form but not edit it then
# disable it
if (Current_User::allow('hms', 'hall_view') && !Current_User::allow('hms', 'hall_attributes') && !Current_User::allow('hms', 'hall_structure')) {
$form_vars = (array) $form;
$elements = $form_vars["PHPWS_Form_elements"];
//NB: this is a weird results of casting the object to an array
foreach ($elements as $element => $value) {
$form->setDisabled($element);
}
}
$form->mergeTemplate($tpl);
$tpl = $form->getTemplate();
$tpl['FLOOR_PAGER'] = HMS_Floor::get_pager_by_hall($this->hall->getId());
javascript('modules/hms/role_editor');
$tpl['ROLE_EDITOR'] = PHPWS_Template::process(array('CLASS_NAME' => "'HMS_Residence_Hall'", 'ID' => $this->hall->id), 'hms', 'admin/role_editor.tpl');
Layout::addPageTitle("Edit Residence Hall");
return PHPWS_Template::process($tpl, 'hms', 'admin/edit_residence_hall.tpl');
}
示例11: show
public function show()
{
$tpl = array();
$tpl['HALL_NAME'] = $this->hall->getLink();
$tpl['FLOOR_NUMBER_LINK'] = $this->floor->getLink('Floor');
$tpl['FLOOR_NUMBER'] = $this->floor->where_am_i();
$tpl['TERM'] = Term::getPrintableSelectedTerm();
$cmd = CommandFactory::getCommand('AddRoom');
$cmd->floor = $this->floor->id;
$form = new PHPWS_Form();
$cmd->initForm($form);
$form->addText('room_number');
$form->addCssClass('room_number', 'form-control');
$form->addHidden('hall_id', $this->hall->id);
$form->addHidden('floor_id', $this->floor->id);
if ($this->floor->gender_type == COED) {
$form->addDropBox('gender_type', array(FEMALE => FEMALE_DESC, MALE => MALE_DESC));
$form->addCssClass('gender_type', 'form-control');
$form->setMatch('gender_type', HMS_Util::formatGender($this->floor->gender_type));
} else {
$form->addDropBox('gender_type', array($this->floor->gender_type => HMS_Util::formatGender($this->floor->gender_type)));
$form->setReadOnly('gender_type', true);
}
// Always show the option to set the default gender
$defGenders = array(FEMALE => FEMALE_DESC, MALE => MALE_DESC);
if ($this->floor->gender_type == MALE) {
unset($defGenders[FEMALE]);
}
if ($this->floor->gender_type == FEMALE) {
unset($defGenders[MALE]);
}
$form->addDropBox('default_gender', $defGenders);
$form->addCssClass('default_gender', 'form-control');
if ($this->floor->gender_type != COED) {
$form->setMatch('default_gender', $this->floor->gender_type);
}
// Add a dropbox to for rlc
$form->addDropBox('rlc_reserved', array("0" => "None") + RlcFactory::getRlcList(Term::getSelectedTerm()));
$form->setLabel('rlc_reserved', 'Reserved for RLC');
$form->addCssClass('rlc_reserved', 'form-control');
$form->addCheck('offline', 1);
$form->setLabel('offline', 'Offline');
$form->addCheck('reserved', 1);
$form->setLabel('reserved', 'Reserved');
$form->addCheck('ra', 1);
$form->setLabel('ra', 'Reserved for RA');
$form->addCheck('private', 1);
$form->setLabel('private', 'Private');
$form->addCheck('overflow', 1);
$form->setLabel('overflow', 'Overflow');
$form->addCheck('parlor', 1);
$form->setLabel('parlor', 'Parlor');
$form->addCheck('ada', 1);
$form->setLabel('ada', 'ADA');
$form->addCheck('hearing_impaired', 1);
$form->setLabel('hearing_impaired', 'Hearing Impaired');
$form->addCheck('bath_en_suite', 1);
$form->setLabel('bath_en_suite', 'Bath en Suite');
$form->addSubmit('submit', 'Submit');
$form->mergeTemplate($tpl);
$tpl = $form->getTemplate();
return PHPWS_Template::process($tpl, 'hms', 'admin/addRoom.tpl');
}
示例12: execute
public function execute(CommandContext $context)
{
if (!Current_User::allow('hms', 'assignment_notify')) {
PHPWS_Core::initModClass('hms', 'exception/PermissionException.php');
throw new PermissionException('You do not have permission to send assignment notifications.');
}
PHPWS_Core::initModClass('hms', 'Term.php');
PHPWS_Core::initModClass('hms', 'HMS_Email.php');
PHPWS_Core::initModClass('hms', 'HMS_Assignment.php');
PHPWS_Core::initModClass('hms', 'HMS_Movein_Time.php');
PHPWS_Core::initModClass('hms', 'StudentFactory.php');
PHPWS_Core::initModClass('hms', 'HMS_RLC_Assignment.php');
// Check if any move-in times are set for the selected term
$moveinTimes = HMS_Movein_Time::get_movein_times_array(Term::getSelectedTerm());
// If the array of move-in times ONLY has the zero-th element ['None'] then it's no good
// Or, of course, if the array is null or emtpy it is no good
if (count($moveinTimes) <= 1 || is_null($moveinTimes) || empty($moveinTimes)) {
NQ::simple('hms', hms\NotificationView::ERROR, 'There are no move-in times set for ' . Term::getPrintableSelectedTerm());
$context->goBack();
}
// Keep track of floors missing move-in times
$missingMovein = array();
$term = Term::getSelectedTerm();
$db = new PHPWS_DB('hms_assignment');
$db->addWhere('email_sent', 0);
$db->addWhere('term', $term);
$result = $db->getObjects("HMS_Assignment");
if (PHPWS_Error::logIfError($result)) {
throw new DatabaseException($result->toString());
}
foreach ($result as $assignment) {
//get the students real name from their asu_username
$student = StudentFactory::getStudentByUsername($assignment->getUsername(), $term);
//get the location of their assignment
PHPWS_Core::initModClass('hms', 'HMS_Bed.php');
$bed = new HMS_Bed($assignment->getBedId());
$room = $bed->get_parent();
$location = $bed->where_am_i() . ' - Bedroom ' . $bed->bedroom_label;
// Lookup the floor and hall to make sure the
// assignment notifications flag is true for this hall
$floor = $room->get_parent();
$hall = $floor->get_parent();
if ($hall->assignment_notifications == 0) {
continue;
}
// Get the student type for determining move-in time
$type = $student->getType();
// Check for an accepted and confirmed RLC assignment
$rlcAssignment = HMS_RLC_Assignment::getAssignmentByUsername($student->getUsername(), $term);
// If there is an assignment, make sure the student "confirmed" the rlc invite
if (!is_null($rlcAssignment)) {
if ($rlcAssignment->getStateName() != 'confirmed' && $rlcAssignment->getStateName() != 'selfselect-assigned') {
$rlcAssignment = null;
}
}
// Make sure this is re-initialized
$moveinTimeId = null;
$rlcSetMoveinTime = false;
// Determine the move-in time
if (!is_null($rlcAssignment)) {
// If there is a 'confirmed' RLC assignment, use the RLC's move-in times
$rlc = $rlcAssignment->getRlc();
if ($type == TYPE_CONTINUING) {
$moveinTimeId = $rlc->getContinuingMoveinTime();
} else {
if ($type == TYPE_TRANSFER) {
$moveinTimeId = $rlc->getTransferMoveinTime();
} else {
if ($type == TYPE_FRESHMEN) {
$moveinTimeId = $rlc->getFreshmenMoveinTime();
}
}
}
}
// If there's a non-null move-in time ID at this point, then we know the RLC must have set it
if (!is_null($moveinTimeId)) {
$rlcSetMoveinTime = true;
}
// If the RLC didn't set a movein time, set it according to the floor
// TODO: Find continuing students by checking the student's application term
// against the term we're wending assignment notices for
if (is_null($moveinTimeId)) {
if ($type == TYPE_CONTINUING) {
$moveinTimeId = $assignment->get_rt_movein_time_id();
} else {
if ($type == TYPE_TRANSFER) {
$moveinTimeId = $assignment->get_t_movein_time_id();
} else {
$moveinTimeId = $assignment->get_f_movein_time_id();
}
}
}
// Check for missing move-in times
if ($moveinTimeId == NULL) {
//test($assignment, 1); // Will only happen if there's no move-in time set for the floor,student type
// Lets only keep a set of the floors
if (!in_array($floor, $missingMovein)) {
$missingMovein[] = $floor;
}
// Missing move-in time, so skip to the next assignment
//.........这里部分代码省略.........
示例13: show
public function show()
{
if (!UserStatus::isAdmin() || !Current_User::allow('hms', 'floor_view')) {
PHPWS_Core::initModClass('hms', 'exception/PermissionException.php');
throw new PermissionException('You are not allowed to edit or view floors.');
}
javascript('jquery_ui');
$floor_num = $this->floor->getFloorNumber();
// Setup the title and color of the title bar
$tpl = array();
$tpl['FLOOR_NUMBER'] = HMS_Util::ordinal($floor_num);
$tpl['TERM'] = Term::getPrintableSelectedTerm();
$submitCmd = CommandFactory::getCommand('EditFloor');
$submitCmd->setFloorId($this->floor->getId());
$form = new PHPWS_Form();
$submitCmd->initForm($form);
$tpl['HALL_NAME'] = $this->hall->getLink();
$tpl['NUMBER_OF_ROOMS'] = $this->floor->get_number_of_rooms();
$tpl['NUMBER_OF_BEDS'] = $this->floor->get_number_of_beds();
$tpl['NOMINAL_BEDS'] = $this->floor->countNominalBeds();
$tpl['NUMBER_OF_ASSIGNEES'] = $this->floor->get_number_of_assignees();
if (!$this->floor->isOnline()) {
$tpl['OFFLINE_ATTRIB'] = 'Offline';
}
$form->addDropBox('gender_type', array(FEMALE => FEMALE_DESC, MALE => MALE_DESC, COED => COED_DESC));
$form->setMatch('gender_type', $this->floor->gender_type);
$form->addCssClass('gender_type', 'form-control');
$form->addCheck('is_online', 1);
$form->setMatch('is_online', $this->floor->is_online);
$movein_times = HMS_Movein_Time::get_movein_times_array();
$form->addDropBox('f_movein_time', $movein_times);
$form->addCssClass('f_movein_time', 'form-control');
if (!isset($this->floor->f_movein_time_id)) {
$form->setMatch('f_movein_time', 0);
} else {
$form->setMatch('f_movein_time', $this->floor->f_movein_time_id);
}
$form->addDropBox('t_movein_time', $movein_times);
$form->addCssClass('t_movein_time', 'form-control');
if (!isset($this->floor->t_movein_time_id)) {
$form->setMatch('t_movein_time', 0);
} else {
$form->setMatch('t_movein_time', $this->floor->t_movein_time_id);
}
$form->addDropBox('rt_movein_time', $movein_times);
$form->addCssClass('rt_movein_time', 'form-control');
if (!isset($this->floor->rt_movein_time_id)) {
$form->setMatch('rt_movein_time', 0);
} else {
$form->setMatch('rt_movein_time', $this->floor->rt_movein_time_id);
}
// Get a list of the RLCs indexed by id
PHPWS_Core::initModClass('hms', 'HMS_Learning_Community.php');
$learning_communities = RlcFactory::getRlcList($this->floor->getTerm());
$learning_communities[0] = 'None';
$form->addDropBox('floor_rlc_id', $learning_communities);
$form->addCssClass('floor_rlc_id', 'form-control');
if (isset($this->floor->rlc_id)) {
$tpl['RLC_NAME'] = $learning_communities[$this->floor->rlc_id];
$form->setMatch('floor_rlc_id', $this->floor->rlc_id);
} else {
$form->setMatch('floor_rlc_id', 0);
}
PHPWS_Core::initModClass('filecabinet', 'Cabinet.php');
if (isset($this->floor->floor_plan_image_id)) {
$manager = Cabinet::fileManager('floor_plan_image_id', $this->floor->floor_plan_image_id);
} else {
$manager = Cabinet::fileManager('floor_plan_image_id');
}
$manager->maxImageWidth(300);
$manager->maxImageHeight(300);
$manager->imageOnly(false, false);
$form->addTplTag('FILE_MANAGER', $manager->get());
$form->addHidden('type', 'floor');
$form->addHidden('op', 'edit_floor');
$tpl['STATIC_ROOM_PAGER'] = HMS_Room::room_pager_by_floor($this->floor->id);
$tpl['DYNAMIC_ROOM_PAGER'] = HMS_Room::room_pager_by_floor($this->floor->id, true);
// if the user has permission to view the form but not edit it then
// disable it
if (Current_User::allow('hms', 'floor_view') && !Current_User::allow('hms', 'floor_attributes') && !Current_User::allow('hms', 'floor_structure')) {
$form_vars = get_object_vars($form);
$elements = $form_vars['_elements'];
foreach ($elements as $element => $value) {
$form->setDisabled($element);
}
}
$form->mergeTemplate($tpl);
$tpl = $form->getTemplate();
if (Current_User::allow('hms', 'edit_role_members')) {
javascript('modules/hms/role_editor');
$tpl['ROLE_EDITOR'] = PHPWS_Template::process(array('CLASS_NAME' => "'HMS_Floor'", 'ID' => $this->floor->id), 'hms', 'admin/role_editor.tpl');
}
Layout::addPageTitle("Edit Floor");
return PHPWS_Template::process($tpl, 'hms', 'admin/edit_floor.tpl');
}
示例14: show
public function show()
{
$tpl = new PHPWS_Template('hms');
if (!$tpl->setFile('admin/reports/hall_overview.tpl')) {
return 'Template error.';
}
$rlcs = HMS_Learning_Community::getRlcList();
$rlcs_abbr = HMS_Learning_Community::getRLCListAbbr();
$tpl->setData(array('HALL' => $this->hall->hall_name, 'TERM' => Term::getPrintableSelectedTerm()));
if ($this->nakedDisplay) {
$menuCmd = CommandFactory::getCommand('ShowAdminMaintenanceMenu');
$tpl->setData(array('MAINTENANCE' => $menuCmd->getLink('Main Menu')));
}
$class = 'toggle1';
$this->hall->loadFloors();
foreach ($this->hall->_floors as $floor) {
$floor->loadRooms();
if (!isset($floor->_rooms)) {
continue;
}
if ($floor->rlc_id != NULL) {
$floor_rlc = $rlcs[$floor->rlc_id];
} else {
$floor_rlc = '';
}
foreach ($floor->_rooms as $room) {
$extra_attribs = '';
if ($room->isOffline()) {
$extra_attribs .= 'Offline ';
}
if ($room->isReserved()) {
$extra_attribs .= 'Reserved ';
}
if ($room->isRa()) {
$extra_attribs .= 'RA ';
}
if ($room->isPrivate()) {
$extra_attribs .= 'Private ';
}
if ($room->isOverflow()) {
$extra_attribs .= 'Overflow ';
}
if ($room->isParlor()) {
$extra_attribs .= 'Parlor ';
}
if ($room->isADA()) {
$extra_attribs .= 'ADA';
}
if ($room->isHearingImpaired()) {
$extra_attribs .= 'Hearing Impaired';
}
if ($room->bathEnSuite()) {
$extra_attribs .= 'Bath en Suite';
}
$room->loadBeds();
if (empty($room->_beds)) {
$tpl->setCurrentBlock('room_repeat');
$tpl->setData(array('EXTRA_ATTRIBS' => $extra_attribs, 'ROOM_NUMBER' => $room->getLink('Room')));
$tpl->parseCurrentBlock();
continue;
}
foreach ($room->_beds as $bed) {
$bed->loadAssignment();
$tpl->setCurrentBlock('bed_repeat');
$bed_link = $bed->getLink();
if (isset($bed->_curr_assignment)) {
$username = $bed->_curr_assignment->asu_username;
try {
$student = StudentFactory::getStudentByUsername($username, $this->hall->term);
} catch (StudentNotFoundException $e) {
$student = null;
NQ::simple('hms', hms\NotificationView::WARNING, "Could not find data for: {$username}");
}
$assign_rlc = HMS_RLC_Assignment::checkForAssignment($username, $this->hall->term);
//false or index
if ($assign_rlc != FALSE) {
$rlc_abbr = $rlcs_abbr[$assign_rlc['rlc_id']];
//get the abbr for the rlc
} else {
$rlc_abbr = '';
}
// Alternating background colors
if ($class == 'toggle1') {
$class = 'toggle2';
} else {
$class = 'toggle1';
}
if (is_null($student)) {
$tpl->setData(array('BED_LABEL' => $bed->bedroom_label, 'BED' => $bed_link, 'NAME' => 'UNKNOWN', 'USERNAME' => $username, 'BANNER_ID' => '', 'TOGGLE' => $class, 'RLC_ABBR' => $rlc_abbr));
} else {
$tpl->setData(array('BED_LABEL' => $bed->bedroom_label, 'BED' => $bed_link, 'NAME' => $student->getProfileLink(), 'USERNAME' => $student->getUsername(), 'BANNER_ID' => $student->getBannerId(), 'TOGGLE' => $class, 'RLC_ABBR' => $rlc_abbr));
}
} else {
$tpl->setData(array('BED_LABEL' => $bed->bedroom_label, 'BED' => $bed_link, 'NAME' => $bed->get_assigned_to_link(), 'VACANT' => ''));
}
$tpl->parseCurrentBlock();
}
$tpl->setCurrentBlock('room_repeat');
$tpl->setData(array('EXTRA_ATTRIBS' => $extra_attribs, 'ROOM_NUMBER' => $room->getLink('Room')));
$tpl->parseCurrentBlock();
//.........这里部分代码省略.........
示例15: show
/**
* @see View::show()
*/
public function show()
{
$jsParams = array('LINK_SELECT' => '#addDamageLink');
javascript('addRoomDamage', $jsParams, 'mod/hms/');
// Drop down enhancements for room damage dialog
javascript('chosen', null, 'mod/hms/');
/*** Header Info ***/
$tpl = array();
$tpl['TERM'] = Term::getPrintableSelectedTerm();
$tpl['HALL_NAME'] = $this->hall->getLink();
$tpl['FLOOR_NUMBER'] = $this->floor->getLink('Floor');
/*** Page Title ***/
$tpl['ROOM'] = $this->room->getRoomNumber();
/*** Room Attributes Labels ***/
if ($this->room->isOffline()) {
$tpl['OFFLINE_ATTRIB'] = 'Offline';
}
if ($this->room->isReserved()) {
$tpl['RESERVED_ATTRIB'] = 'Reserved';
}
if ($this->room->isRa()) {
$tpl['RA_ATTRIB'] = 'RA';
}
if ($this->room->isPrivate()) {
$tpl['PRIVATE_ATTRIB'] = 'Private';
}
if ($this->room->isOverflow()) {
$tpl['OVERFLOW_ATTRIB'] = 'Overflow';
}
if ($this->room->isParlor()) {
$tpl['PARLOR_ATTRIB'] = 'Parlor';
}
if ($this->room->isADA()) {
$tpl['ADA_ATTRIB'] = 'ADA';
}
if ($this->room->isHearingImpaired()) {
$tpl['HEARING_ATTRIB'] = 'Hearing Impaired';
}
if ($this->room->bathEnSuite()) {
$tpl['BATHENSUITE_ATTRIB'] = 'Bath en Suite';
}
$number_of_assignees = $this->room->get_number_of_assignees();
$tpl['NUMBER_OF_BEDS'] = $this->room->get_number_of_beds();
$tpl['NUMBER_OF_ASSIGNEES'] = $number_of_assignees;
$form = new PHPWS_Form();
$submitCmd = CommandFactory::getCommand('EditRoom');
$submitCmd->setRoomId($this->room->id);
$submitCmd->initForm($form);
$form->addText('room_number', $this->room->getRoomNumber());
$form->setLabel('room_number', 'Room Number');
$form->addCssClass('room_number', 'form-control');
/*** Room Gender ***/
if ($number_of_assignees == 0) {
// Room is empty, show the drop down so the user can change the gender
$roomGenders = array(FEMALE => FEMALE_DESC, MALE => MALE_DESC, AUTO => AUTO_DESC);
// Check if the user is allowed to set rooms to co-ed, if so add Co-ed to the drop down
if (Current_User::allow('hms', 'coed_rooms')) {
$roomGenders[COED] = COED_DESC;
}
$form->addDropBox('gender_type', $roomGenders);
$form->setMatch('gender_type', $this->room->gender_type);
$form->addCssClass('gender_type', 'form-control');
} else {
// Room is not empty so just show the gender (no drop down)
$tpl['GENDER_MESSAGE'] = HMS_Util::formatGender($this->room->getGender());
// Add a hidden variable for 'gender_type' so it will be defined upon submission
$form->addHidden('gender_type', $this->room->gender_type);
// Show the reason the gender could not be changed.
if ($number_of_assignees != 0) {
$tpl['GENDER_REASON'] = 'Remove occupants to change room gender.';
}
}
//Always show the option to set the default gender
$form->addDropBox('default_gender', array(FEMALE => FEMALE_DESC, MALE => MALE_DESC, AUTO => AUTO_DESC));
$form->setLabel('default_gender', 'Default Gender');
$form->setMatch('default_gender', $this->room->default_gender);
$form->addCssClass('default_gender', 'form-control');
$form->addDropBox('rlc_reserved', array("0" => "Choose RLC") + RlcFactory::getRlcList($this->room->getTerm()));
$form->setLabel('rlc_reserved', 'Reserved for RLC');
$form->setMatch('rlc_reserved', $this->room->getReservedRlcId());
$form->addCssClass('rlc_reserved', 'form-control');
$form->addCheck('offline', 1);
$form->setLabel('offline', 'Offline');
$form->setMatch('offline', $this->room->isOffline());
$form->addCheck('reserved', 1);
$form->setLabel('reserved', 'Reserved');
$form->setMatch('reserved', $this->room->isReserved());
$form->addCheck('ra', 1);
$form->setLabel('ra', 'Reserved for RA');
$form->setMatch('ra', $this->room->isRa());
$form->addCheck('private', 1);
$form->setLabel('private', 'Private');
$form->setMatch('private', $this->room->isPrivate());
$form->addCheck('overflow', 1);
$form->setLabel('overflow', 'Overflow');
$form->setMatch('overflow', $this->room->isOverflow());
$form->addCheck('parlor', 1);
//.........这里部分代码省略.........