本文整理汇总了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());
}
示例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);
}
}