本文整理汇总了PHP中ilObjUser::_lookupFullname方法的典型用法代码示例。如果您正苦于以下问题:PHP ilObjUser::_lookupFullname方法的具体用法?PHP ilObjUser::_lookupFullname怎么用?PHP ilObjUser::_lookupFullname使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ilObjUser
的用法示例。
在下文中一共展示了ilObjUser::_lookupFullname方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getItems
/**
* Get all completed tests
*/
protected function getItems()
{
$data = array();
foreach (ilExAssignment::getTeamLog($this->team_id) as $item) {
switch ($item["action"]) {
case ilExAssignment::TEAM_LOG_CREATE_TEAM:
$mess = "create_team";
break;
case ilExAssignment::TEAM_LOG_ADD_MEMBER:
$mess = "add_member";
break;
case ilExAssignment::TEAM_LOG_REMOVE_MEMBER:
$mess = "remove_member";
break;
case ilExAssignment::TEAM_LOG_ADD_FILE:
$mess = "add_file";
break;
case ilExAssignment::TEAM_LOG_REMOVE_FILE:
$mess = "remove_file";
break;
}
$details = $this->lng->txt("exc_team_log_" . $mess);
if ($item["details"]) {
$details = sprintf($details, $item["details"]);
}
$data[] = array("tstamp" => $item["tstamp"], "user" => ilObjUser::_lookupFullname($item["user_id"]), "details" => $details);
}
$this->setData($data);
}
示例2: fillRow
protected function fillRow($a_set)
{
$this->tpl->setVariable("DATE", ilDatePresentation::formatDate(new ilDateTime($a_set["created"], IL_CAL_UNIX)));
$name = ilObjUser::_lookupName($a_set["user_id"]);
$this->tpl->setVariable("LASTNAME", $name["lastname"]);
$this->tpl->setVariable("FIRSTNAME", $name["firstname"]);
$this->tpl->setVariable("LOGIN", $name["login"]);
$this->tpl->setVariable("ACTION", $this->action_map[$a_set["action"]]);
if ($a_set["action"] == ilRbacLog::CHANGE_OWNER) {
$user = ilObjUser::_lookupFullname($a_set["data"][0]);
$changes = array(array("action" => $this->lng->txt("rbac_log_changed_owner"), "operation" => $user));
} else {
if ($a_set["action"] == ilRbacLog::EDIT_TEMPLATE) {
$changes = $this->parseChangesTemplate($a_set["data"]);
} else {
$changes = $this->parseChangesFaPa($a_set["data"]);
}
}
$this->tpl->setCurrentBlock("changes");
foreach ($changes as $change) {
$this->tpl->setVariable("CHANGE_ACTION", $change["action"]);
$this->tpl->setVariable("CHANGE_OPERATION", $change["operation"]);
$this->tpl->parseCurrentBlock();
}
}
示例3: initTable
/**
* Init table
*/
protected function initTable()
{
global $ilCtrl;
$this->setFormAction($ilCtrl->getFormAction($this->getParentObject()));
$this->setRowTemplate('tpl.scorm_track_item.html', 'Modules/ScormAicc');
$this->setTitle(ilObjUser::_lookupFullname($this->getUserId()));
$this->addColumn($this->lng->txt('title'), 'title', '35%');
$this->addColumn($this->lng->txt('cont_status'), 'status', '25%');
$this->addColumn($this->lng->txt('cont_time'), 'time', '20%');
$this->addColumn($this->lng->txt('cont_score'), 'score', '20%');
}
示例4: parse
/**
* Parse table content
*/
public function parse()
{
$this->initTable();
$sco_data = $this->getParentObject()->object->getTrackingDataAggSco($this->getSco()->getId());
$data = array();
foreach ($sco_data as $row) {
$tmp = array();
$tmp['user_id'] = $row['user_id'];
$tmp['score'] = $row['score'];
$tmp['time'] = $row['time'];
$tmp['status'] = $row['status'];
$tmp['name'] = ilObjUser::_lookupFullname($row['user_id']);
$data[] = $tmp;
}
$this->setData($data);
}
示例5: sendNotification
static function sendNotification($a_action, $a_in_wsp, $a_blog_node_id, $a_posting_id, $a_comment = null)
{
global $ilUser, $ilAccess;
// get blog object id (repository or workspace)
if ($a_in_wsp) {
include_once "Services/PersonalWorkspace/classes/class.ilWorkspaceTree.php";
include_once "Services/PersonalWorkspace/classes/class.ilWorkspaceAccessHandler.php";
$tree = new ilWorkspaceTree($ilUser->getId());
// owner of tree is irrelevant
$blog_obj_id = $tree->lookupObjectId($a_blog_node_id);
$access_handler = new ilWorkspaceAccessHandler($tree);
$link = ilWorkspaceAccessHandler::getGotoLink($a_blog_node_id, $blog_obj_id, "_" . $a_posting_id);
} else {
$blog_obj_id = ilObject::_lookupObjId($a_blog_node_id);
$access_handler = null;
include_once "Services/Link/classes/class.ilLink.php";
$link = ilLink::_getStaticLink($a_blog_node_id, "blog", true, "_" . $a_posting_id);
}
if (!$blog_obj_id) {
return;
}
include_once "./Modules/Blog/classes/class.ilBlogPosting.php";
$posting = new ilBlogPosting($a_posting_id);
// #11138
$ignore_threshold = $a_action == "comment";
// approval handling
$admin_only = false;
if (!$posting->isApproved()) {
$blog = new self($blog_obj_id, false);
if ($blog->hasApproval()) {
switch ($a_action) {
case "update":
// un-approved posting was updated - no notifications
return;
case "new":
// un-approved posting was activated - admin-only notification
$admin_only = true;
$ignore_threshold = true;
break;
}
}
}
// recipients
include_once "./Services/Notification/classes/class.ilNotification.php";
$users = ilNotification::getNotificationsForObject(ilNotification::TYPE_BLOG, $blog_obj_id, $a_posting_id, $ignore_threshold);
if (!sizeof($users)) {
return;
}
// send mails
include_once "./Services/Mail/classes/class.ilMail.php";
include_once "./Services/User/classes/class.ilObjUser.php";
include_once "./Services/Language/classes/class.ilLanguageFactory.php";
include_once "./Services/User/classes/class.ilUserUtil.php";
$posting_title = $posting->getTitle();
$blog_title = ilObject::_lookupTitle($blog_obj_id);
$author = $posting->getAuthor();
$notified = array();
foreach (array_unique($users) as $idx => $user_id) {
// the user responsible for the action should not be notified
if ($user_id == $ilUser->getId()) {
continue;
}
// workspace
if ($access_handler) {
if ($admin_only && !$access_handler->checkAccessOfUser($tree, $user_id, 'write', '', $a_blog_node_id)) {
continue;
}
if (!$access_handler->checkAccessOfUser($tree, $user_id, 'read', '', $a_blog_node_id)) {
continue;
}
} else {
if ($admin_only && !$ilAccess->checkAccessOfUser($user_id, 'write', '', $a_blog_node_id)) {
continue;
}
if (!$ilAccess->checkAccessOfUser($user_id, 'read', '', $a_blog_node_id)) {
continue;
}
}
// use language of recipient to compose message
$ulng = ilLanguageFactory::_getLanguageOfUser($user_id);
$ulng->loadLanguageModule('blog');
$subject = sprintf($ulng->txt('blog_change_notification_subject'), $blog_title);
$message = sprintf($ulng->txt('blog_change_notification_salutation'), ilObjUser::_lookupFullname($user_id)) . "\n\n";
$message .= $ulng->txt('blog_change_notification_body_' . $a_action) . ":\n\n";
$message .= $ulng->txt('obj_blog') . ": " . $blog_title . "\n";
$message .= $ulng->txt('blog_posting') . ": " . $posting_title . "\n";
$message .= $ulng->txt('blog_changed_by') . ": " . ilUserUtil::getNamePresentation($ilUser->getId()) . "\n";
if ($a_comment) {
$message .= "\n" . $ulng->txt('comment') . ":\n\"" . trim($a_comment) . "\"\n";
}
$message .= "\n" . $ulng->txt('blog_change_notification_link') . ": " . $link;
$mail_obj = new ilMail(ANONYMOUS_USER_ID);
$mail_obj->appendInstallationSignature(true);
$mail_obj->sendMail(ilObjUser::_lookupLogin($user_id), "", "", $subject, $message, array(), array("system"));
$notified[] = $user_id;
}
if (sizeof($notified)) {
ilNotification::updateNotificationTime(ilNotification::TYPE_BLOG, $blog_obj_id, $notified);
}
}
示例6: sendNotification
/**
* Send notification about team status
*
* @param int $a_exc_ref_id
* @param int $a_user_id
* @param string $a_action
*/
public function sendNotification($a_exc_ref_id, $a_user_id, $a_action)
{
global $ilUser;
// no need to notify current user
if ($ilUser->getId() == $a_user_id) {
return;
}
include_once "./Services/Mail/classes/class.ilMail.php";
include_once "./Services/User/classes/class.ilObjUser.php";
include_once "./Services/Language/classes/class.ilLanguageFactory.php";
include_once "./Services/User/classes/class.ilUserUtil.php";
include_once "./Services/Link/classes/class.ilLink.php";
$link = ilLink::_getStaticLink($a_exc_ref_id);
// use language of recipient to compose message
$ulng = ilLanguageFactory::_getLanguageOfUser($a_user_id);
$ulng->loadLanguageModule('exc');
$subject = sprintf($ulng->txt('exc_team_notification_subject_' . $a_action), $this->getTitle());
$message = sprintf($ulng->txt('exc_team_notification_salutation'), ilObjUser::_lookupFullname($a_user_id)) . "\n\n";
$message .= $ulng->txt('exc_team_notification_body_' . $a_action) . "\n\n";
$message .= $ulng->txt('obj_exc') . ": " . ilObject::_lookupTitle($this->getExerciseId()) . "\n";
$message .= $ulng->txt('exc_assignment') . ": " . $this->getTitle() . "\n";
$message .= $ulng->txt('exc_team_notification_changed_by') . ": " . ilUserUtil::getNamePresentation($ilUser->getId()) . "\n\n";
$message .= $ulng->txt('exc_team_notification_link') . ": " . $link;
$mail_obj = new ilMail(ANONYMOUS_USER_ID);
$mail_obj->appendInstallationSignature(true);
$ret = $mail_obj->sendMail(ilObjUser::_lookupLogin($a_user_id), "", "", $subject, $message, array(), array("system"));
// var_dump($ret);
}
示例7: cancelBooking
/**
* Confirmation screen to cancel consultation appointment or ressource booking
* depends on calendar category
*/
public function cancelBooking()
{
global $ilUser, $tpl;
$entry = (int) $_GET['app_id'];
include_once 'Services/Calendar/classes/class.ilCalendarEntry.php';
$entry = new ilCalendarEntry($entry);
$category = $this->calendarEntryToCategory($entry);
if ($category->getType() == ilCalendarCategory::TYPE_CH) {
include_once 'Services/Booking/classes/class.ilBookingEntry.php';
$booking = new ilBookingEntry($entry->getContextId());
if (!$booking->hasBooked($entry->getEntryId())) {
$this->ctrl->returnToParent($this);
return false;
}
$entry_title = ' ' . $entry->getTitle() . " (" . ilObjUser::_lookupFullname($booking->getObjId()) . ')';
} else {
if ($category->getType() == ilCalendarCategory::TYPE_BOOK) {
$entry_title = ' ' . $entry->getTitle();
} else {
$this->ctrl->returnToParent($this);
return false;
}
}
$title = ilDatePresentation::formatPeriod($entry->getStart(), $entry->getEnd());
include_once 'Services/Utilities/classes/class.ilConfirmationGUI.php';
$conf = new ilConfirmationGUI();
$conf->setFormAction($this->ctrl->getFormAction($this));
$conf->setHeaderText($this->lng->txt('cal_cancel_booking_info'));
$conf->setConfirm($this->lng->txt('cal_cancel_booking'), 'cancelconfirmed');
$conf->setCancel($this->lng->txt('cancel'), 'cancel');
$conf->addItem('app_id', $entry->getEntryId(), $title . ' - ' . $entry_title);
$tpl->setContent($conf->getHTML());
}
示例8: send
//.........这里部分代码省略.........
$this->appendBody("\n\n");
$this->appendBody($this->getLanguageText('grp_mail_permanent_link'));
$this->appendBody("\n\n");
$this->appendBody($this->createPermanentLink());
$this->getMail()->appendInstallationSignature(true);
$this->addAttachment();
$this->sendMail(array('#il_grp_admin_' . $this->getRefId(), '#il_grp_member_' . $this->getRefId()), array('system'), false);
break;
case self::TYPE_CRS_NEW_NOTIFICATION:
$this->setLanguage(ilLanguageFactory::_getLanguage($lng->getDefaultLanguage()));
$this->getLanguage()->loadLanguageModule('crs');
$this->getLanguage()->loadLanguageModule('dateplaner');
$this->initMail();
$this->setSubject(sprintf($this->getLanguageText('cal_crs_new_notification_sub'), $this->getObjectTitle(true)));
$this->setBody($this->getLanguageText('crs_notification_salutation'));
$this->appendBody("\n\n");
$this->appendBody(sprintf($this->getLanguageText('cal_crs_new_notification_body'), $this->getObjectTitle(true)));
$this->appendBody("\n\n");
$this->appendBody($this->getLanguageText('crs_mail_permanent_link'));
$this->appendBody("\n\n");
$this->appendAppointmentDetails();
$this->appendBody("\n\n");
$this->appendBody($this->createPermanentLink());
$this->getMail()->appendInstallationSignature(true);
$this->addAttachment();
$this->sendMail(array('#il_crs_admin_' . $this->getRefId(), '#il_crs_tutor_' . $this->getRefId(), '#il_crs_member_' . $this->getRefId()), array('system'), false);
break;
case self::TYPE_CRS_NOTIFICATION:
$this->setLanguage(ilLanguageFactory::_getLanguage($lng->getDefaultLanguage()));
$this->getLanguage()->loadLanguageModule('crs');
$this->getLanguage()->loadLanguageModule('dateplaner');
$this->initMail();
$this->setSubject(sprintf($this->getLanguageText('cal_crs_notification_sub'), $this->getObjectTitle(true)));
$this->setBody($this->getLanguageText('crs_notification_salutation'));
$this->appendBody("\n\n");
$this->appendBody(sprintf($this->getLanguageText('cal_crs_notification_body'), $this->getObjectTitle(true)));
$this->appendBody("\n\n");
$this->appendAppointmentDetails();
$this->appendBody("\n\n");
$this->appendBody($this->getLanguageText('crs_mail_permanent_link'));
$this->appendBody("\n\n");
$this->appendBody($this->createPermanentLink());
$this->getMail()->appendInstallationSignature(true);
$this->addAttachment();
$this->sendMail(array('#il_crs_admin_' . $this->getRefId(), '#il_crs_tutor_' . $this->getRefId(), '#il_crs_member_' . $this->getRefId()), array('system'), false);
break;
case self::TYPE_BOOKING_CONFIRMATION:
$user_id = array_pop($this->getRecipients());
include_once 'Services/Calendar/classes/class.ilCalendarEntry.php';
include_once 'Services/Booking/classes/class.ilBookingEntry.php';
$entry = new ilCalendarEntry($this->getAppointmentId());
$booking = new ilBookingEntry($entry->getContextId());
$this->initLanguage($user_id);
$this->getLanguage()->loadLanguageModule('dateplaner');
$this->initMail();
$this->setSubject(sprintf($this->getLanguageText('cal_booking_confirmation_subject'), $entry->getTitle()));
$this->setBody(ilMail::getSalutation($user_id, $this->getLanguage()));
$this->appendBody("\n\n");
$this->appendBody(sprintf($this->getLanguageText('cal_booking_confirmation_body'), ilObjUser::_lookupFullname($booking->getObjId())));
$this->appendBody("\n\n");
$this->appendAppointmentDetails($booking);
/*
$this->appendBody("\n\n");
$this->appendBody($this->getLanguageText('cal_booking_confirmation_link'));
$this->appendBody("\n\n");
$this->appendBody($this->createPermanentLink());
*/
$this->getMail()->appendInstallationSignature(true);
$this->sendMail(array($user_id), array('system'), true);
$this->appendBody("\n\n");
$this->appendBody($this->getLanguageText('cal_booking_confirmation_user') . "\n");
$this->appendBody(ilObjUser::_lookupFullname($user_id));
$this->sendMail(array($booking->getObjId()), array('system'), true);
break;
case self::TYPE_BOOKING_CANCELLATION:
$user_id = array_pop($this->getRecipients());
include_once 'Services/Calendar/classes/class.ilCalendarEntry.php';
include_once 'Services/Booking/classes/class.ilBookingEntry.php';
$entry = new ilCalendarEntry($this->getAppointmentId());
$booking = new ilBookingEntry($entry->getContextId());
$user_id = array_pop($this->getRecipients());
$this->initLanguage($user_id);
$this->getLanguage()->loadLanguageModule('dateplaner');
$this->initMail();
$this->setSubject(sprintf($this->getLanguageText('cal_booking_cancellation_subject'), $entry->getTitle()));
$this->setBody(ilMail::getSalutation($user_id, $this->getLanguage()));
$this->appendBody("\n\n");
$this->appendBody(sprintf($this->getLanguageText('cal_booking_cancellation_body'), ilObjUser::_lookupFullname($booking->getObjId())));
$this->appendBody("\n\n");
$this->appendAppointmentDetails($booking);
$this->getMail()->appendInstallationSignature(true);
$this->sendMail(array($user_id), array('system'), true);
$this->appendBody("\n\n");
$this->appendBody($this->getLanguageText('cal_booking_cancellation_user') . "\n");
$this->appendBody(ilObjUser::_lookupFullname($user_id));
$this->sendMail(array($booking->getObjId()), array('system'), true);
break;
}
$this->deleteAttachments();
}
示例9: getHTML
/**
* get HTML
*
* @access public
* @param
* @return
*/
public function getHTML($a_app)
{
global $tree, $lng, $ilUser;
self::$counter++;
$this->tpl = new ilTemplate('tpl.appointment_panel.html', true, true, 'Services/Calendar');
// Panel variables
$this->tpl->setVariable('PANEL_NUM', self::$counter);
$this->tpl->setVariable('PANEL_TITLE', str_replace(' ()', '', $a_app['event']->getPresentationTitle(false)));
if ($a_app["event"]->isMilestone()) {
$this->tpl->setVariable('PANEL_DETAILS', $this->lng->txt('cal_ms_details'));
} else {
$this->tpl->setVariable('PANEL_DETAILS', $this->lng->txt('cal_details'));
}
$this->tpl->setVariable('PANEL_TXT_DATE', $this->lng->txt('date'));
if ($a_app['fullday']) {
$this->tpl->setVariable('PANEL_DATE', ilDatePresentation::formatPeriod(new ilDate($a_app['dstart'], IL_CAL_UNIX), new ilDate($a_app['dend'], IL_CAL_UNIX)));
} else {
$this->tpl->setVariable('PANEL_DATE', ilDatePresentation::formatPeriod(new ilDateTime($a_app['dstart'], IL_CAL_UNIX), new ilDateTime($a_app['dend'], IL_CAL_UNIX)));
}
if ($a_app['event']->getLocation()) {
$this->tpl->setVariable('PANEL_TXT_WHERE', $this->lng->txt('cal_where'));
$this->tpl->setVariable('PANEL_WHERE', ilUtil::makeClickable($a_app['event']->getLocation()), true);
}
if ($a_app['event']->getDescription()) {
$this->tpl->setVariable('PANEL_TXT_DESC', $this->lng->txt('description'));
$this->tpl->setVariable('PANEL_DESC', ilUtil::makeClickable(nl2br($a_app['event']->getDescription())));
}
if ($a_app['event']->isMilestone() && $a_app['event']->getCompletion() > 0) {
$this->tpl->setVariable('PANEL_TXT_COMPL', $this->lng->txt('cal_task_completion'));
$this->tpl->setVariable('PANEL_COMPL', $a_app['event']->getCompletion() . " %");
}
if ($a_app['event']->isMilestone()) {
// users responsible
$users = $a_app['event']->readResponsibleUsers();
$delim = "";
foreach ($users as $r) {
$value .= $delim . $r["lastname"] . ", " . $r["firstname"] . " [" . $r["login"] . "]";
$delim = "<br />";
}
if (count($users) > 0) {
$this->tpl->setVariable('PANEL_TXT_RESP', $this->lng->txt('cal_responsible'));
$this->tpl->setVariable('PANEL_RESP', $value);
}
}
include_once './Services/Calendar/classes/class.ilCalendarCategoryAssignments.php';
$cat_id = ilCalendarCategoryAssignments::_lookupCategory($a_app['event']->getEntryId());
$cat_info = ilCalendarCategories::_getInstance()->getCategoryInfo($cat_id);
$entry_obj_id = isset($cat_info['subitem_obj_ids'][$cat_id]) ? $cat_info['subitem_obj_ids'][$cat_id] : $cat_info['obj_id'];
$this->tpl->setVariable('PANEL_TXT_CAL_TYPE', $this->lng->txt('cal_cal_type'));
switch ($cat_info['type']) {
case ilCalendarCategory::TYPE_GLOBAL:
$this->tpl->setVariable('PANEL_CAL_TYPE', $this->lng->txt('cal_type_system'));
break;
case ilCalendarCategory::TYPE_USR:
$this->tpl->setVariable('PANEL_CAL_TYPE', $this->lng->txt('cal_type_personal'));
break;
case ilCalendarCategory::TYPE_OBJ:
$type = ilObject::_lookupType($cat_info['obj_id']);
$this->tpl->setVariable('PANEL_CAL_TYPE', $this->lng->txt('cal_type_' . $type));
// Course group appointment registration
if ($this->settings->isCGRegistrationEnabled() and $type == 'crs' or type == 'grp') {
if (!$a_app['event']->isAutoGenerated()) {
include_once './Services/Calendar/classes/class.ilCalendarRegistration.php';
$reg = new ilCalendarRegistration($a_app['event']->getEntryId());
if ($reg->isRegistered($ilUser->getId(), new ilDateTime($a_app['dstart'], IL_CAL_UNIX), new ilDateTime($a_app['dend'], IL_CAL_UNIX))) {
$this->tpl->setCurrentBlock('panel_cancel_book_link');
$this->ctrl->setParameterByClass('ilcalendarappointmentgui', 'seed', $this->getSeed()->get(IL_CAL_DATE));
$this->ctrl->setParameterByClass('ilcalendarappointmentgui', 'app_id', $a_app['event']->getEntryId());
$this->ctrl->setParameterByClass('ilcalendarappointmentgui', 'dstart', $a_app['dstart']);
$this->ctrl->setParameterByClass('ilcalendarappointmentgui', 'dend', $a_app['dend']);
$this->tpl->setVariable('TXT_PANEL_CANCELBOOK', $this->lng->txt('cal_reg_unregister'));
$this->tpl->setVariable('PANEL_CANCELBOOK_HREF', $this->ctrl->getLinkTargetByClass('ilcalendarappointmentgui', 'confirmUnregister'));
$this->tpl->parseCurrentBlock();
} else {
$this->tpl->setCurrentBlock('panel_book_link');
$this->ctrl->setParameterByClass('ilcalendarappointmentgui', 'seed', $this->getSeed()->get(IL_CAL_DATE));
$this->ctrl->setParameterByClass('ilcalendarappointmentgui', 'app_id', $a_app['event']->getEntryId());
$this->ctrl->setParameterByClass('ilcalendarappointmentgui', 'dstart', $a_app['dstart']);
$this->ctrl->setParameterByClass('ilcalendarappointmentgui', 'dend', $a_app['dend']);
$this->tpl->setVariable('TXT_PANEL_BOOK', $this->lng->txt('cal_reg_register'));
$this->tpl->setVariable('PANEL_BOOK_HREF', $this->ctrl->getLinkTargetByClass('ilcalendarappointmentgui', 'confirmRegister'));
$this->tpl->parseCurrentBlock();
}
include_once './Services/Link/classes/class.ilLink.php';
$registrations = array();
foreach ($reg->getRegisteredUsers(new ilDateTime($a_app['dstart'], IL_CAL_UNIX), new ilDateTime($a_app['dend'], IL_CAL_UNIX)) as $usr_data) {
$usr_id = $usr_data['usr_id'];
$this->ctrl->setParameterByClass('ilconsultationhoursgui', 'user', $usr_id);
$registrations[] = '<a href="' . $this->ctrl->getLinkTargetByClass('ilconsultationhoursgui', 'showprofile') . '">' . ilObjUser::_lookupFullname($usr_id);
$this->ctrl->setParameterByClass('ilconsultationhoursgui', 'user', '');
}
if (count($registrations)) {
$this->tpl->setCurrentBlock('panel_current_booking');
//.........这里部分代码省略.........
示例10: initTable
/**
* Init table
*/
protected function initTable()
{
global $ilCtrl;
$this->setFormAction($ilCtrl->getFormAction($this->getParentObject()));
$this->setRowTemplate('tpl.scorm_track_item_per_user.html', 'Modules/ScormAicc');
$this->setTitle($this->getSco()->getTitle() . ' - ' . ilObjUser::_lookupFullname($this->getUserId()));
$this->addColumn($this->lng->txt('cont_lvalue'), 'lvalue', '50%');
$this->addColumn($this->lng->txt('cont_rvalue'), 'rvalue', '50%');
}
示例11: parse
/**
* Parse appointments
* @return
*/
public function parse()
{
global $ilDB, $ilObjDataCache;
include_once 'Services/Booking/classes/class.ilBookingEntry.php';
$data = array();
$counter = 0;
foreach (ilConsultationHourAppointments::getAppointments($this->getUserId()) as $app) {
$data[$counter]['id'] = $app->getEntryId();
$data[$counter]['title'] = $app->getTitle();
$data[$counter]['description'] = $app->getDescription();
$data[$counter]['start'] = $app->getStart()->get(IL_CAL_UNIX);
$data[$counter]['start_p'] = ilDatePresentation::formatDate($app->getStart());
$booking = new ilBookingEntry($app->getContextId());
$users = array();
foreach ($booking->getCurrentBookings($app->getEntryId()) as $user_id) {
$users[$user_id] = ilObjUser::_lookupFullname($user_id);
}
$data[$counter]['num_bookings'] = sizeof($users);
$data[$counter]['bookings'] = $users;
$target = $booking->getTargetObjId();
if ($target) {
$data[$counter]['target'] = $ilObjDataCache->lookupTitle($target);
}
$counter++;
}
$this->setData($data);
}
示例12: getHTML
/**
* Get bloch HTML code.
*/
function getHTML()
{
global $ilCtrl, $lng, $ilUser, $ilAccess;
if ($this->getCurrentDetailLevel() == 0) {
return "";
}
// add edit commands
#if ($this->getEnableEdit())
if ($this->mode == ilCalendarCategories::MODE_PERSONAL_DESKTOP_ITEMS or $this->mode == ilCalendarCategories::MODE_PERSONAL_DESKTOP_MEMBERSHIP) {
include_once "./Services/News/classes/class.ilRSSButtonGUI.php";
$this->addBlockCommand($this->ctrl->getLinkTarget($this, 'showCalendarSubscription'), $lng->txt('ical_export'), "", "", true, false, ilRSSButtonGUI::get(ilRSSButtonGUI::ICON_ICAL));
}
if ($this->mode == ilCalendarCategories::MODE_REPOSITORY) {
if (!isset($_GET["bkid"])) {
if ($ilAccess->checkAccess('edit_event', '', (int) $_GET['ref_id'])) {
$ilCtrl->setParameter($this, "add_mode", "block");
$this->addBlockCommand($ilCtrl->getLinkTargetByClass("ilCalendarAppointmentGUI", "add"), $lng->txt("add_appointment"));
$ilCtrl->setParameter($this, "add_mode", "");
}
global $ilObjDataCache;
include_once "Modules/Course/classes/class.ilCourseParticipants.php";
$obj_id = $ilObjDataCache->lookupObjId((int) $_GET['ref_id']);
$participants = ilCourseParticipants::_getInstanceByObjId($obj_id);
$users = array_unique(array_merge($participants->getTutors(), $participants->getAdmins()));
//$users = $participants->getParticipants();
include_once 'Services/Booking/classes/class.ilBookingEntry.php';
//$users = ilBookingEntry::isBookable($users, $obj_id);
$users = ilBookingEntry::lookupBookableUsersForObject($obj_id, $users);
if ($users) {
foreach ($users as $user_id) {
if (!isset($_GET["bkid"])) {
$ilCtrl->setParameter($this, "bkid", $user_id);
$this->addBlockCommand($ilCtrl->getLinkTargetByClass("ilCalendarMonthGUI", ""), $lng->txt("cal_consultation_hours_for") . ' ' . ilObjUser::_lookupFullname($user_id));
$this->cal_footer[] = array('link' => $ilCtrl->getLinkTargetByClass('ilCalendarMonthGUI', ''), 'txt' => $lng->txt("cal_consultation_hours_for") . ' ' . ilObjUser::_lookupFullname($user_id));
}
}
$ilCtrl->setParameter($this, "bkid", "");
}
} else {
$ilCtrl->setParameter($this, "bkid", "");
$this->addBlockCommand($ilCtrl->getLinkTarget($this), $lng->txt("back"));
$ilCtrl->setParameter($this, "bkid", (int) $_GET["bkid"]);
}
}
if ($this->getProperty("settings") == true) {
$this->addBlockCommand($ilCtrl->getLinkTarget($this, "editSettings"), $lng->txt("settings"));
}
$ilCtrl->setParameterByClass("ilcolumngui", "seed", isset($_GET["seed"]) ? $_GET["seed"] : "");
$ret = parent::getHTML();
$ilCtrl->setParameterByClass("ilcolumngui", "seed", "");
return $ret;
}
示例13: sendNotification
/**
* @param $a_action
* @param $a_table_id
* @param null $a_record_id
*/
public static function sendNotification($a_action, $a_table_id, $a_record_id = NULL)
{
global $ilUser, $ilAccess;
// If coming from trash, never send notifications and don't load dcl Object
if ($_GET['ref_id'] == SYSTEM_FOLDER_ID) {
return;
}
$dclObj = new ilObjDataCollection($_GET['ref_id']);
if ($dclObj->getNotification() != 1) {
return;
}
$obj_table = ilDataCollectionCache::getTableCache($a_table_id);
$obj_dcl = $obj_table->getCollectionObject();
// recipients
require_once './Services/Notification/classes/class.ilNotification.php';
$users = ilNotification::getNotificationsForObject(ilNotification::TYPE_DATA_COLLECTION, $obj_dcl->getId(), true);
if (!sizeof($users)) {
return;
}
ilNotification::updateNotificationTime(ilNotification::TYPE_DATA_COLLECTION, $obj_dcl->getId(), $users);
//FIXME $_GET['ref_id]
require_once './Services/Link/classes/class.ilLink.php';
$link = ilLink::_getLink($_GET['ref_id']);
// prepare mail content
// use language of recipient to compose message
require_once './Services/Language/classes/class.ilLanguageFactory.php';
// send mails
require_once './Services/Mail/classes/class.ilMail.php';
require_once './Services/User/classes/class.ilObjUser.php';
require_once './Services/Language/classes/class.ilLanguageFactory.php';
require_once './Services/User/classes/class.ilUserUtil.php';
require_once './Services/User/classes/class.ilUserUtil.php';
require_once './Modules/DataCollection/classes/class.ilDataCollectionTable.php';
foreach (array_unique($users) as $idx => $user_id) {
// the user responsible for the action should not be notified
// FIXME $_GET['ref_id]
if ($user_id != $ilUser->getId() && $ilAccess->checkAccessOfUser($user_id, 'read', '', $_GET['ref_id'])) {
// use language of recipient to compose message
$ulng = ilLanguageFactory::_getLanguageOfUser($user_id);
$ulng->loadLanguageModule('dcl');
$subject = sprintf($ulng->txt('dcl_change_notification_subject'), $obj_dcl->getTitle());
// update/delete
$message = $ulng->txt("dcl_hello") . " " . ilObjUser::_lookupFullname($user_id) . ",\n\n";
$message .= $ulng->txt('dcl_change_notification_dcl_' . $a_action) . ":\n\n";
$message .= $ulng->txt('obj_dcl') . ": " . $obj_dcl->getTitle() . "\n\n";
$message .= $ulng->txt('dcl_table') . ": " . $obj_table->getTitle() . "\n\n";
$message .= $ulng->txt('dcl_record') . ":\n";
$message .= "------------------------------------\n";
if ($a_record_id) {
$record = ilDataCollectionCache::getRecordCache($a_record_id);
if (!$record->getTableId()) {
$record->setTableId($a_table_id);
}
// $message .= $ulng->txt('dcl_record_id').": ".$a_record_id.":\n";
$t = "";
foreach ($record->getTable()->getVisibleFields() as $field) {
if ($record->getRecordField($field->getId())) {
$t .= $field->getTitle() . ": " . $record->getRecordField($field->getId())->getPlainText() . "\n";
}
}
$message .= $t . "\n";
}
$message .= "------------------------------------\n";
$message .= $ulng->txt('dcl_changed_by') . ": " . $ilUser->getFullname() . " " . ilUserUtil::getNamePresentation($ilUser->getId()) . "\n\n";
$message .= $ulng->txt('dcl_change_notification_link') . ": " . $link . "\n\n";
$message .= $ulng->txt('dcl_change_why_you_receive_this_email');
$mail_obj = new ilMail(ANONYMOUS_USER_ID);
$mail_obj->appendInstallationSignature(true);
$mail_obj->sendMail(ilObjUser::_lookupLogin($user_id), "", "", $subject, $message, array(), array("system"));
} else {
unset($users[$idx]);
}
}
}
示例14: removeTeamMember
/**
* Remove member from team
*
* @param int $a_team_id
* @param int $a_user_id
* @param int $a_exc_ref_id
*/
function removeTeamMember($a_team_id, $a_user_id, $a_exc_ref_id)
{
global $ilDB;
$sql = "DELETE FROM il_exc_team" . " WHERE ass_id = " . $ilDB->quote($this->getId(), "integer") . " AND id = " . $ilDB->quote($a_team_id, "integer") . " AND user_id = " . $ilDB->quote($a_user_id, "integer");
$ilDB->manipulate($sql);
$this->sendNotification($a_exc_ref_id, $a_user_id, "rmv");
self::writeTeamLog($a_team_id, self::TEAM_LOG_REMOVE_MEMBER, ilObjUser::_lookupFullname($a_user_id));
}
示例15: fillRow
/**
* Fill table row
*/
protected function fillRow($d)
{
global $lng, $ilCtrl;
$this->tpl->setVariable("TXT_ASS_TITLE", $d["title"]);
$file_info = ilExAssignment::getDownloadedFilesInfoForTableGUIS($this->parent_obj, $this->exc_id, $d["type"], $d["id"], $this->part_id, $this->parent_cmd);
$has_no_team_yet = false;
if ($d["type"] == ilExAssignment::TYPE_UPLOAD_TEAM) {
$members = ilExAssignment::getTeamMembersByAssignmentId($d["id"], $this->part_id);
// #11957
if (sizeof($members)) {
$this->tpl->setCurrentBlock("ass_members");
foreach ($members as $member_id) {
$this->tpl->setVariable("TXT_MEMBER_NAME", ilObjUser::_lookupFullname($member_id));
$this->tpl->parseCurrentBlock();
}
$ilCtrl->setParameter($this->parent_obj, "lpart", $this->part_id);
$this->tpl->setVariable("HREF_LOG", $ilCtrl->getLinkTarget($this->parent_obj, "showTeamLog"));
$this->tpl->setVariable("TXT_LOG", $lng->txt("exc_team_log"));
$ilCtrl->setParameter($this->parent_obj, "lpart", "");
} else {
// #11957
$has_no_team_yet = true;
$this->tpl->setCurrentBlock("team_info");
$this->tpl->setVariable("TXT_TEAM_INFO", $lng->txt("exc_no_team_yet"));
$this->tpl->setVariable("TXT_CREATE_TEAM", $lng->txt("exc_create_team"));
$ilCtrl->setParameter($this->parent_obj, "ass_id", $d["id"]);
$ilCtrl->setParameter($this->parent_obj, "lpart", $this->part_id);
$this->tpl->setVariable("URL_CREATE_TEAM", $ilCtrl->getLinkTarget($this->getParentObject(), "createSingleMemberTeam"));
$ilCtrl->setParameter($this->parent_obj, "lpart", "");
$ilCtrl->setParameter($this->parent_obj, "ass_id", "");
if ($file_info["files"]["count"]) {
$this->tpl->setVariable("TEAM_FILES_INFO", "<br />" . $file_info["files"]["txt"] . ": " . $file_info["files"]["count"]);
}
$this->tpl->parseCurrentBlock();
}
}
if (!$has_no_team_yet) {
$this->tpl->setVariable("VAL_CHKBOX", ilUtil::formCheckbox(0, "assid[" . $d["id"] . "]", 1));
$this->tpl->setVariable("VAL_ID", $d["id"]);
$this->tpl->setVariable("VAL_LAST_SUBMISSION", $file_info["last_submission"]["value"]);
$this->tpl->setVariable("TXT_LAST_SUBMISSION", $file_info["last_submission"]["txt"]);
$this->tpl->setVariable("TXT_SUBMITTED_FILES", $file_info["files"]["txt"]);
$this->tpl->setVariable("VAL_SUBMITTED_FILES", $file_info["files"]["count"]);
if ($file_info["files"]["download_url"]) {
$this->tpl->setCurrentBlock("download_link");
$this->tpl->setVariable("LINK_DOWNLOAD", $file_info["files"]["download_url"]);
$this->tpl->setVariable("TXT_DOWNLOAD", $file_info["files"]["download_txt"]);
$this->tpl->parseCurrentBlock();
}
if ($file_info["files"]["download_new_url"]) {
$this->tpl->setCurrentBlock("download_link");
$this->tpl->setVariable("LINK_NEW_DOWNLOAD", $file_info["files"]["download_new_url"]);
$this->tpl->setVariable("TXT_NEW_DOWNLOAD", $file_info["files"]["download_new_txt"]);
$this->tpl->parseCurrentBlock();
}
// note
$this->tpl->setVariable("TXT_NOTE", $lng->txt("exc_note_for_tutor"));
$this->tpl->setVariable("NAME_NOTE", "notice[" . $d["id"] . "]");
$this->tpl->setVariable("VAL_NOTE", ilUtil::prepareFormOutput(ilExAssignment::lookupNoticeOfUser($d["id"], $this->part_id)));
// comment for learner
$lcomment_value = ilExAssignment::lookupCommentForUser($d["id"], $this->part_id);
$overlay_id = "excasscomm_" . $d["id"] . "_" . $this->part_id;
$overlay_trigger_id = $overlay_id . "_tr";
$overlay = new ilOverlayGUI($overlay_id);
$overlay->setAnchor($overlay_trigger_id);
$overlay->setTrigger($overlay_trigger_id, "click", $overlay_trigger_id);
$overlay->add();
$this->tpl->setVariable("LCOMMENT_ID", $overlay_id . "_snip");
$this->tpl->setVariable("LCOMMENT_SNIPPET", ilUtil::shortenText($lcomment_value, 25, true));
$this->tpl->setVariable("COMMENT_OVERLAY_TRIGGER_ID", $overlay_trigger_id);
$this->tpl->setVariable("COMMENT_OVERLAY_TRIGGER_TEXT", $lng->txt("exc_comment_for_learner_edit"));
$lcomment_form = new ilPropertyFormGUI();
$lcomment_form->setId($overlay_id);
$lcomment_form->setPreventDoubleSubmission(false);
$lcomment = new ilTextAreaInputGUI($lng->txt("exc_comment_for_learner"), "lcomment_" . $d["id"] . "_" . $this->part_id);
$lcomment->setInfo($lng->txt("exc_comment_for_learner_info"));
$lcomment->setValue($lcomment_value);
$lcomment->setCols(45);
$lcomment->setRows(5);
$lcomment_form->addItem($lcomment);
//$lcomment_form->addCommandButton("save", $lng->txt("save"));
// $lcomment_form->addCommandButton("cancel", $lng->txt("cancel"));
$this->overlay_tpl->setCurrentBlock("overlay_bl");
$this->overlay_tpl->setVariable("COMMENT_OVERLAY_ID", $overlay_id);
$this->overlay_tpl->setVariable("COMMENT_OVERLAY_FORM", $lcomment_form->getHTML());
$this->overlay_tpl->parseCurrentBlock();
/*
$this->tpl->setVariable("TXT_LCOMMENT", $lng->txt("exc_comment_for_learner"));
$this->tpl->setVariable("NAME_LCOMMENT",
"lcomment[".$d["id"]."]");
$lpcomment = ilExAssignment::lookupCommentForUser($d["id"], $this->part_id);
$this->tpl->setVariable("VAL_LCOMMENT",
ilUtil::prepareFormOutput($lpcomment));
*/
// solved
//$this->tpl->setVariable("CHKBOX_SOLVED",
// ilUtil::formCheckbox($this->exc->members_obj->getStatusByMember($member_id),"solved[$member_id]",1));
//.........这里部分代码省略.........