4require_once 
'Services/Mail/classes/class.ilFormatMail.php';
 
    5require_once 
'Services/Contact/BuddySystem/classes/class.ilBuddySystem.php';
 
   82                $this->tpl        = 
$DIC[
'tpl'];
 
   83                $this->ctrl       = 
$DIC[
'ilCtrl'];
 
   84                $this->lng        = 
$DIC[
'lng'];
 
   85                $this->tabs_gui   = 
$DIC[
'ilTabs'];
 
   86                $this->help       = 
$DIC[
'ilHelp'];
 
   87                $this->toolbar    = 
$DIC[
'ilToolbar'];
 
   88                $this->
user       = $DIC[
'ilUser'];
 
   89                $this->
error      = $DIC[
'ilErr'];
 
   90                $this->rbacsystem = 
$DIC[
'rbacsystem'];
 
   92                $this->ctrl->saveParameter($this, 
"mobj_id");
 
   95                $this->lng->loadLanguageModule(
'buddysystem');
 
  102                $forward_class = $this->ctrl->getNextClass($this);
 
  105                $this->umail->savePostData($this->
user->getId(), array(), 
'', 
'', 
'', 
'', 
'', 
'', 
'', 
'');
 
  107                switch($forward_class)
 
  109                        case 'ilmailformgui':
 
  110                                include_once 
'Services/Mail/classes/class.ilMailFormGUI.php';
 
  114                        case 'ilmailsearchcoursesgui':
 
  115                                include_once 
'Services/Contact/classes/class.ilMailSearchCoursesGUI.php';
 
  119                                $this->ctrl->setReturn($this, 
"showContacts");
 
  123                        case 'ilmailsearchgroupsgui':
 
  124                                include_once 
'Services/Contact/classes/class.ilMailSearchGroupsGUI.php';
 
  128                                $this->ctrl->setReturn($this, 
"showContacts");
 
  132                        case 'ilmailinglistsgui':
 
  135                                        $this->
error->raiseError($this->lng->txt(
'msg_no_perm_read'), $this->error->MESSAGE);
 
  138                                include_once 
'Services/Contact/classes/class.ilMailingListsGUI.php';
 
  142                                $this->ctrl->setReturn($this, 
"showContacts");
 
  146                        case 'ilusersgallerygui':
 
  149                                        $this->
error->raiseError($this->lng->txt(
'msg_no_perm_read'), $this->error->MESSAGE);
 
  152                                $this->tabs_gui->activateSubTab(
'buddy_view_gallery');
 
  154                                require_once 
'Services/User/classes/class.ilUsersGalleryUsers.php';
 
  155                                require_once 
'Services/User/classes/class.ilUsersGalleryGUI.php';
 
  160                        case 'ilpublicuserprofilegui':
 
  161                                require_once 
'Services/User/classes/class.ilPublicUserProfileGUI.php';
 
  163                                $profile_gui->setBackUrl($this->ctrl->getLinkTarget($this, 
'showContacts'));
 
  164                                $this->ctrl->forwardCommand($profile_gui);
 
  171                                if (!(
$cmd = $this->ctrl->getCmd()))
 
  175                                                $cmd = 
'showContacts';
 
  179                                                $this->ctrl->redirectByClass(
'ilmailsearchcoursesgui');
 
  194                if($this->tabs_gui->hasTabs())
 
  198                                $this->tabs_gui->addSubTab(
'my_contacts', $this->lng->txt(
'my_contacts'), $this->ctrl->getLinkTarget($this));
 
  200                                if(in_array(strtolower($this->ctrl->getCmdClass()), array_map(
'strtolower', array(
'ilUsersGalleryGUI', get_class($this)))))
 
  202                                        require_once 
'Services/Form/classes/class.ilSelectInputGUI.php';
 
  204                                        $view_selection->setOptions(array(
 
  205                                                self::CONTACTS_VIEW_TABLE   => $this->lng->txt(
'buddy_view_table'),
 
  206                                                self::CONTACTS_VIEW_GALLERY => $this->lng->txt(
'buddy_view_gallery')
 
  208                                        $view_selection->setValue(
 
  209                                                strtolower($this->ctrl->getCmdClass()) == 
'ilusersgallerygui' ? self::CONTACTS_VIEW_GALLERY : self::CONTACTS_VIEW_TABLE
 
  211                                        $this->toolbar->addInputItem($view_selection);
 
  213                                        require_once 
'Services/UIComponent/Button/classes/class.ilSubmitButton.php';
 
  215                                        $contact_view_btn->setCaption(
'submit');
 
  216                                        $contact_view_btn->setCommand(
'changeContactsView');
 
  217                                        $this->toolbar->addButtonInstance($contact_view_btn);
 
  218                                        $this->toolbar->setFormAction($this->ctrl->getFormAction($this, 
'changeContactsView'));
 
  221                                $this->tabs_gui->addSubTab(
'mail_my_mailing_lists', $this->lng->txt(
'mail_my_mailing_lists'), $this->ctrl->getLinkTargetByClass(
'ilmailinglistsgui'));
 
  224                        $this->tabs_gui->addSubTab(
'mail_my_courses', $this->lng->txt(
'mail_my_courses'), $this->ctrl->getLinkTargetByClass(
'ilmailsearchcoursesgui'));
 
  225                        $this->tabs_gui->addSubTab(
'mail_my_groups', $this->lng->txt(
'mail_my_groups'), $this->ctrl->getLinkTargetByClass(
'ilmailsearchgroupsgui'));
 
  226                        $this->has_sub_tabs = 
true;
 
  230                        $this->help->setScreenIdComponent(
'contacts');
 
  234                                $this->tabs_gui->addTab(
'my_contacts', $this->lng->txt(
'my_contacts'), $this->ctrl->getLinkTarget($this));
 
  236                                if(in_array(strtolower($this->ctrl->getCmdClass()), array_map(
'strtolower', array(
'ilUsersGalleryGUI', get_class($this)))))
 
  238                                        $this->tabs_gui->addSubTab(
'buddy_view_table', $this->lng->txt(
'buddy_view_table'), $this->ctrl->getLinkTarget($this));
 
  239                                        $this->tabs_gui->addSubTab(
'buddy_view_gallery', $this->lng->txt(
'buddy_view_gallery'), $this->ctrl->getLinkTargetByClass(
'ilUsersGalleryGUI'));
 
  242                                $this->tabs_gui->addTab(
'mail_my_mailing_lists', $this->lng->txt(
'mail_my_mailing_lists'), $this->ctrl->getLinkTargetByClass(
'ilmailinglistsgui'));
 
  245                        $this->tabs_gui->addTab(
'mail_my_courses', $this->lng->txt(
'mail_my_courses'), $this->ctrl->getLinkTargetByClass(
'ilmailsearchcoursesgui'));
 
  246                        $this->tabs_gui->addTab(
'mail_my_groups', $this->lng->txt(
'mail_my_groups'), $this->ctrl->getLinkTargetByClass(
'ilmailsearchgroupsgui'));
 
  255                if($this->has_sub_tabs)
 
  257                        $this->tabs_gui->activateSubTab($a_id);
 
  261                        $this->tabs_gui->activateTab($a_id);
 
  272                        $this->
error->raiseError($this->lng->txt(
'msg_no_perm_read'), $this->error->MESSAGE);
 
  275                if(isset(
$_POST[
'contacts_view']))
 
  277                        switch(
$_POST[
'contacts_view'])
 
  280                                        $this->ctrl->redirectByClass(
'ilUsersGalleryGUI');
 
  284                                        $this->ctrl->redirect($this);
 
  289                $this->ctrl->redirect($this);
 
  299                        $this->
error->raiseError($this->lng->txt(
'msg_no_perm_read'), $this->error->MESSAGE);
 
  302                require_once 
'Services/Contact/BuddySystem/classes/tables/class.ilBuddySystemRelationsTableGUI.php';
 
  305                $table->resetOffset();
 
  306                $table->writeFilterToSession();
 
  318                        $this->
error->raiseError($this->lng->txt(
'msg_no_perm_read'), $this->error->MESSAGE);
 
  321                require_once 
'Services/Contact/BuddySystem/classes/tables/class.ilBuddySystemRelationsTableGUI.php';
 
  324                $table->resetOffset();
 
  325                $table->resetFilter();
 
  337                        $this->
error->raiseError($this->lng->txt(
'msg_no_perm_read'), $this->error->MESSAGE);
 
  340                $this->tabs_gui->activateSubTab(
'buddy_view_table');
 
  343                require_once 
'Services/Contact/BuddySystem/classes/tables/class.ilBuddySystemRelationsTableGUI.php';
 
  346                $this->tpl->setContent($table->getHTML());
 
  357                        $this->
error->raiseError($this->lng->txt(
'msg_no_perm_read'), $this->error->MESSAGE);
 
  360                if(!isset(
$_POST[
'usr_id']) || !is_array(
$_POST[
'usr_id']) || 0 == count(
$_POST[
'usr_id']))
 
  367                $usr_ids = (array)
$_POST[
'usr_id'];
 
  369                $mail_data = $this->umail->getSavedData();
 
  370                if(!is_array($mail_data))
 
  372                        $this->umail->savePostData($this->
user->getId(), array(), 
'', 
'', 
'', 
'', 
'', 
'', 
'', 
'');
 
  376                foreach($usr_ids as $usr_id)
 
  380                $logins = array_filter($logins);
 
  382                if(count($logins) > 0)
 
  384                        $mail_data = $this->umail->appendSearchResult($logins, 
'to');
 
  385                        $this->umail->savePostData(
 
  386                                $mail_data[
'user_id'],
 
  387                                $mail_data[
'attachments'],
 
  388                                $mail_data[
'rcp_to'],
 
  389                                $mail_data[
'rcp_cc'],
 
  390                                $mail_data[
'rcp_bcc'],
 
  391                                $mail_data[
'm_type'],
 
  392                                $mail_data[
'm_email'],
 
  393                                $mail_data[
'm_subject'],
 
  394                                $mail_data[
'm_message'],
 
  395                                $mail_data[
'use_placeholders'],
 
  396                                $mail_data[
'tpl_ctx_id'],
 
  397                                $mail_data[
'tpl_ctx_params']
 
  410                if(!isset(
$_POST[
'usr_id']) || !strlen(
$_POST[
'usr_id']))
 
  413                        $this->ctrl->redirect($this);
 
  425                $usr_ids = explode(
',', 
$_POST[
'usr_id']);
 
  428                $room_ids = explode(
',', 
$_POST[
'room_id']);
 
  429                $room_id  = (int)$room_ids[0];
 
  432                if(count($room_ids) > 0)
 
  434                        $scope = (int)$room_ids[1];
 
  437                include_once 
'Modules/Chatroom/classes/class.ilChatroom.php';
 
  440                $no_access               = array();
 
  442                $valid_users             = array();
 
  443                $valid_user_to_login_map = array();
 
  445                foreach($usr_ids as $usr_id)
 
  450                                $no_login[$usr_id] = $usr_id;
 
  454                        $ref_id  = $room->getRefIdByRoomId($room_id);
 
  458                                $room->isUserBanned($usr_id)
 
  461                                $no_access[$usr_id] = $login;
 
  465                                $valid_users[$usr_id]             = $usr_id;
 
  466                                $valid_user_to_login_map[$usr_id] = $login;
 
  470                if(count($no_access) || count($no_login))
 
  474                        if(count($no_access) > 0)
 
  476                                $message .= $this->lng->txt(
'chat_users_without_permission') . 
':<br>';
 
  479                                foreach($no_access as $usr_id => $login)
 
  481                                        $list .= 
'<li>' . $login . 
'</li>';
 
  491                                $message .= $this->lng->txt(
'chat_users_without_login') . 
':<br>';
 
  494                                foreach($no_login as $usr_id)
 
  496                                        $list .= 
'<li>' . $usr_id . 
'</li>';
 
  505                        $_POST[
'usr_id'] = $usr_ids;
 
  510                $ref_id = $room->getRefIdByRoomId($room_id);
 
  512                require_once 
'Services/Link/classes/class.ilLink.php';
 
  521                $link = 
'<p><a target="chatframe" href="' . 
$url . 
'" title="' . $this->lng->txt(
'goto_invitation_chat') . 
'">' .$this->lng->txt(
'goto_invitation_chat') . 
'</a></p>';
 
  524                foreach($valid_users as $id)
 
  526                        $room->inviteUserToPrivateRoom($id, $scope);
 
  527                        $room->sendInvitationNotification(
 
  528                                null, $this->
user->getId(), $id, (
int)$scope, 
$url 
  530                        $userlist[] = 
'<li>'.$valid_user_to_login_map[$id].
'</li>';
 
  535                        ilUtil::sendSuccess($this->lng->txt(
'chat_users_have_been_invited') . 
'<ul>'.implode(
'', $userlist).
'</ul>' . $link, 
true);
 
  538                $this->ctrl->redirect($this);
 
  546                $this->tabs_gui->activateSubTab(
'buddy_view_table');
 
  549                $this->lng->loadLanguageModule(
'chatroom');
 
  551                if(!isset(
$_POST[
'usr_id']) || !is_array(
$_POST[
'usr_id']) || 0 == count(
$_POST[
'usr_id']))
 
  554                        $this->ctrl->redirect($this);
 
  556                $usr_ids = 
$_POST[
'usr_id'];
 
  558                require_once 
'Modules/Chatroom/classes/class.ilChatroom.php';
 
  561                $chat_rooms = $ilChatroom->getAllRooms($this->
user->getId());
 
  564                foreach($chat_rooms as $room_id => 
$title)
 
  566                        $subrooms[] = $ilChatroom->getPrivateSubRooms($room_id, $this->
user->getId());
 
  569                include_once 
'Services/Form/classes/class.ilPropertyFormGUI.php';
 
  572                $form->setTitle($this->lng->txt(
'mail_invite_users_to_chat'));
 
  574                $psel    = 
new ilSelectInputGUI($this->lng->txt(
'chat_select_room'), 
'room_id');
 
  577                foreach($chat_rooms as $room_id => $room)
 
  581                        if($ilChatroom->isUserBanned($this->user->getId()))
 
  588                        foreach($subrooms as $subroom)
 
  590                                foreach($subroom as $sub_id => $parent_id)
 
  602                $form->addItem($psel);
 
  604                $phidden->setValue(implode(
',', $usr_ids));
 
  605                $form->addItem($phidden);
 
  606                $form->addCommandButton(
'submitInvitation', $this->lng->txt(
'submit'));
 
  607                $form->addCommandButton(
'showContacts', $this->lng->txt(
'cancel'));
 
  608                $form->setFormAction($this->ctrl->getFormAction($this, 
'showContacts'));
 
  610                $this->tpl->setTitle($this->lng->txt(
'mail_invite_users_to_chat'));
 
  611                $this->tpl->setContent($form->getHTML());
 
An exception for terminatinating execution or to throw for unit testing.
error($a_errmsg)
set error message @access public
static lookupPrivateRoomTitle($proom_id)
static checkPermissionsOfUser($usr_id, $permissions, $ref_id)
Checks user permissions in question for a given user id in relation to a given ref_id.
static byRoomId($room_id, $initObject=false)
Returns ilChatroom by given $room_id @global ilDBInterface $ilDB.
static _getStaticLink($a_ref_id, $a_type='', $a_fallback_goto=true, $append="")
Get static link.
static getMailObjectRefId()
Determines the reference id of the mail object and stores this information in a local cache variable.
static _lookupLogin($a_user_id)
lookup login
GUI class for public user profile presentation.
@ilCtrl_Calls ilUsersGalleryGUI: ilPublicUserProfileGUI @ilCtrl_isCalledBy ilUsersGalleryGUI: ilCours...
Class ilUsersGalleryUsers.
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
static redirect($a_script)
http redirect to other script
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
if(!is_array($argv)) $options