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


PHP PHPWS_Core::initModClasS方法代码示例

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


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

示例1: execute

 public function execute(CommandContext $context)
 {
     if (!Current_User::allow('hms', 'admin_approve_room_change')) {
         PHPWS_Core::initModClasS('hms', 'exception/PermissionException.php');
         throw new PermissionException('You do not have permission to approve room changes.');
     }
     PHPWS_Core::initModClass('hms', 'RoomChangeRequestFactory.php');
     PHPWS_Core::initModClass('hms', 'RoomChangeApprovalView.php');
     $term = Term::getSelectedTerm();
     // Get all requests in the FutureRDApproved state (i.e. waiting on housing assignments office)
     $needsApprovalChanges = RoomChangeRequestFactory::getAllRoomChangesNeedsAdminApproval($term);
     // Get all requests that are Approved (in-progress)
     $allApproved = RoomChangeRequestFactory::getAllRoomChangesByState($term, array('Approved'));
     // Get all requests that are pending/in-progress, but not waiting on Housing
     $allPending = RoomChangeRequestFactory::getAllRoomChangesByState($term, array('Pending', 'Hold'));
     // Get all complete requests
     $allComplete = RoomChangeRequestFactory::getAllRoomChangesByState($term, array('Complete'));
     // Get all requests that are inactive (cancelled, denied, complete)
     $allInactive = RoomChangeRequestFactory::getAllRoomChangesByState($term, array('Cancelled', 'Denied'));
     $view = new RoomChangeApprovalView($needsApprovalChanges, $allApproved, $allPending, $allComplete, $allInactive, array('All Halls'), $term);
     $context->setContent($view->show());
 }
开发者ID:jlbooker,项目名称:homestead,代码行数:22,代码来源:ShowAdminRoomChangeListCommand.php

示例2: sendRoomChangeCurrRDNotice

 /**
  * Sends a notification to the Current RD involved in a room change request
  * letting them know they need to log in and approve
  *
  * Template Tags:
  * {STUDENT_NAME}
  * {BANNER_ID}
  * {CURRENT_ASSIGNMENT}
  * {CELL_PHONE}
  *
  * @param $rd string The username of the RD
  * @param $participant RoomChangeParticipant The Participant object involved
  */
 public static function sendRoomChangeCurrRDNotice(RoomChangeRequest $request)
 {
     PHPWS_Core::initModClass('hms', 'StudentFactory.php');
     PHPWS_Core::initModClass('hms', 'HMS_Assignment.php');
     PHPWS_Core::initModClasS('hms', 'HMS_Bed.php');
     $subject = 'Room Change Approval Required';
     $template = 'email/roomChangeCurrRDNotice.tpl';
     $tags = array('PARTICIPANTS' => array());
     $rds = array();
     $term = Term::getCurrentTerm();
     foreach ($request->getParticipants() as $p) {
         // Add participant's RD(s) to recipients
         $rds = array_merge($rds, $p->getCurrentRdList());
         $bid = $p->getBannerId();
         $student = StudentFactory::getStudentByBannerID($bid, $term);
         $assign = HMS_Assignment::getAssignmentByBannerID($bid, $term);
         $participantTags = array('BANNER_ID' => $student->getBannerId(), 'NAME' => $student->getName(), 'CURRENT' => $assign->where_am_i());
         // If they have a future assignment, show it
         $futureBedId = $p->getToBed();
         if ($futureBedId) {
             $bed = new HMS_Bed($futureBedId);
             $participantTags['DESTINATION'] = $bed->where_am_i();
         }
         $tags['PARTICIPANTS'][] = $participantTags;
     }
     // In case an RD ends up in here several times, no need for dup emails
     $recips = array_unique($rds);
     $message = self::makeSwiftmailMessage(null, $subject, $tags, $template);
     foreach ($recips as $recip) {
         $message->setTo($recip . TO_DOMAIN);
         self::sendSwiftmailMessage($message);
     }
 }
开发者ID:jlbooker,项目名称:homestead,代码行数:46,代码来源:HMS_Email.php


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