当前位置: 首页>>代码示例>>PHP>>正文


PHP Term::getPrintableCurrentTerm方法代码示例

本文整理汇总了PHP中Term::getPrintableCurrentTerm方法的典型用法代码示例。如果您正苦于以下问题:PHP Term::getPrintableCurrentTerm方法的具体用法?PHP Term::getPrintableCurrentTerm怎么用?PHP Term::getPrintableCurrentTerm使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Term的用法示例。


在下文中一共展示了Term::getPrintableCurrentTerm方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: execute

 public function execute(CommandContext $context)
 {
     if (!UserStatus::isAdmin() || !Current_User::allow('hms', 'activate_term')) {
         PHPWS_Core::initModClass('hms', 'exception/PermissionException.php');
         throw new PermissionException('You do not have permission to set the Current Term.');
     }
     PHPWS_Core::initModClass('hms', 'TermEditView.php');
     $this->term = $context->get('term');
     Term::setCurrentTerm($this->term);
     NQ::simple('hms', hms\NotificationView::SUCCESS, 'The Current Term has been set to ' . Term::getPrintableCurrentTerm());
     $cmd = CommandFactory::getCommand('ShowEditTerm');
     $cmd->redirect();
 }
开发者ID:jlbooker,项目名称:homestead,代码行数:13,代码来源:SetCurrentTermCommand.php

示例2: copy

 public function copy($to_term, $room_id, $assignments)
 {
     if (!$this->id) {
         return false;
     }
     // echo "in hms_beds, making a copy of this bed<br>";
     $new_bed = clone $this;
     $new_bed->reset();
     $new_bed->term = $to_term;
     $new_bed->room_id = $room_id;
     $new_bed->clearRoomChangeReserved();
     try {
         $new_bed->save();
     } catch (Exception $e) {
         throw $e;
     }
     // Copy assignment
     if ($assignments) {
         // echo "loading assignments for this bed<br>";
         PHPWS_Core::initModClass('hms', 'HousingApplication.php');
         PHPWS_Core::initModClass('hms', 'Term.php');
         PHPWS_Core::initModClass('hms', 'HMS_Assignment.php');
         PHPWS_Core::initModClass('hms', 'StudentFactory.php');
         try {
             $this->loadAssignment();
         } catch (Exception $e) {
             throw $e;
         }
         if (isset($this->_curr_assignment)) {
             try {
                 try {
                     $student = StudentFactory::getStudentByUsername($this->_curr_assignment->asu_username, Term::getCurrentTerm());
                     $app = HousingApplication::getApplicationByUser($this->_curr_assignment->asu_username, Term::getCurrentTerm());
                 } catch (StudentNotFoundException $e) {
                     NQ::simple('hms', hms\NotificationView::ERROR, 'Could not copy assignment for ' . $this->_curr_assignment->asu_username);
                     return;
                 }
                 // meal option defaults to standard
                 $meal_option = BANNER_MEAL_STD;
                 if (!is_null($app)) {
                     $meal_option = $app->getMealPlan();
                 }
                 $note = "Assignment copied from " . Term::getPrintableCurrentTerm() . " to " . Term::toString($to_term);
                 HMS_Assignment::assignStudent($student, $to_term, null, $new_bed->id, $meal_option, $note, false, $this->_curr_assignment->getReason());
             } catch (Exception $e) {
                 throw $e;
             }
         }
     }
 }
开发者ID:jlbooker,项目名称:homestead,代码行数:50,代码来源:HMS_Bed.php


注:本文中的Term::getPrintableCurrentTerm方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。