ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
ilMembershipGUI Class Reference

Base class for member tab content. More...

+ Inheritance diagram for ilMembershipGUI:
+ Collaboration diagram for ilMembershipGUI:

Public Member Functions

 __construct (ilObjectGUI $repository_gui, ilObject $repository_obj)
 Constructor. More...
 
 getParentGUI ()
 Get parent gui. More...
 
 getParentObject ()
 Get parent object. More...
 
 getMembersObject ()
 Get member object. More...
 
 updateParticipants ()
 update members More...
 
 createMailSignature ()
 
 addMemberTab (ilTabsGUI $tabs, $a_is_participant=false)
 add member tab More...
 
 readMemberData (array $usr_ids, array $columns)
 Required for member table guis. More...
 
 getLocalRoles ()
 Get parent roles. More...
 
 confirmAssignSubscribers ()
 Show subscription confirmation. More...
 
 confirmRefuseSubscribers ()
 Refuse subscriber confirmation. More...
 
 assignSubscribers ()
 Do assignment of subscription request type $rbacsystem type $ilErr. More...
 
 confirmAssignFromWaitingList ()
 Assign from waiting list (confirmatoin) More...
 
 assignFromWaitingList ()
 Assign from waiting list type $rbacsystem. More...
 
 confirmRefuseFromList ()
 Refuse from waiting list (confirmation) More...
 

Protected Member Functions

 checkPermissionBool ($a_permission, $a_cmd='', $a_type='', $a_ref_id=0)
 Check permission. More...
 
 participants ()
 Show participant table, subscriber table, wating list table;. More...
 
 participantsApplyFilter ()
 Apply filter for participant table. More...
 
 participantsResetFilter ()
 reset participants filter More...
 
 editMember ()
 Edit one participant. More...
 
 editParticipants ($post_participants=array())
 Edit participants. More...
 
 confirmDeleteParticipants ()
 Show confirmation screen for participants deletion. More...
 
 deleteParticipants ()
 
 sendMailToSelectedUsers ()
 Send mail to selected users. More...
 
 membersMap ()
 Members map. More...
 
 mailMembersBtn ()
 Mail to members view type $ilToolbar. More...
 
 showParticipantsToolbar ()
 Show participants toolbar. More...
 
 showMailToMemberToolbarButton (ilToolbarGUI $toolbar, $a_back_cmd=null, $a_separator=false)
 Show mail to member toolbar button. More...
 
 setSubTabs (ilTabsGUI $tabs)
 Set sub tabs. More...
 
 parseSubscriberTable ()
 Parse table of subscription request. More...
 
 refuseSubscribers ()
 Refuse subscribers type $rbacsystem. More...
 
 parseWaitingListTable ()
 Parse table of subscription request. More...
 
 refuseFromList ()
 refuse from waiting list More...
 
 addToClipboard ()
 Add selected users to user clipboard. More...
 
 getDefaultRole ()
 
 printMembers ()
 Print members. More...
 
 printMembersOutput ()
 print members output More...
 

Protected Attributes

 $lng = null
 
 $ctrl = null
 
 $logger = null
 
 $tpl
 
 $access
 

Private Attributes

 $repository_object = null
 
 $repository_gui = null
 

Detailed Description

Base class for member tab content.

Author
Stefan Meyer smeye.nosp@m.r.il.nosp@m.ias@g.nosp@m.mx.d.nosp@m.e

Definition at line 11 of file class.ilMembershipGUI.php.

Constructor & Destructor Documentation

◆ __construct()

ilMembershipGUI::__construct ( ilObjectGUI  $repository_gui,
ilObject  $repository_obj 
)

Constructor.

Parameters
ilObject$repository_obj

Definition at line 53 of file class.ilMembershipGUI.php.

References $GLOBALS, $repository_gui, ilLoggerFactory\getLogger(), and getParentObject().

54  {
55  $this->repository_gui = $repository_gui;
56  $this->repository_object = $repository_obj;
57 
58  $this->lng = $GLOBALS['DIC']['lng'];
59  $this->lng->loadLanguageModule('crs');
60  $this->lng->loadLanguageModule($this->getParentObject()->getType());
61 
62  $this->tpl = $GLOBALS['DIC']['tpl'];
63 
64  $this->ctrl = $GLOBALS['DIC']['ilCtrl'];
65 
66  $this->logger = ilLoggerFactory::getLogger($this->getParentObject()->getType());
67 
68  $this->access = $GLOBALS['DIC']->access();
69  }
$GLOBALS['loaded']
Global hash that tracks already loaded includes.
static getLogger($a_component_id)
Get component logger.
getParentObject()
Get parent object.
+ Here is the call graph for this function:

Member Function Documentation

◆ addMemberTab()

ilMembershipGUI::addMemberTab ( ilTabsGUI  $tabs,
  $a_is_participant = false 
)

add member tab

Parameters
ilTabsGUI$tabs

Definition at line 844 of file class.ilMembershipGUI.php.

References $GLOBALS, ilTabsGUI\addTab(), array, and getParentObject().

845  {
846  global $ilAccess;
847 
848  include_once './Services/Mail/classes/class.ilMail.php';
849  $mail = new ilMail($GLOBALS['ilUser']->getId());
850 
851  if($ilAccess->checkAccess('manage_members', '' , $this->getParentObject()->getRefId()))
852  {
853  $tabs->addTab(
854  'members',
855  $this->lng->txt('members'),
856  $this->ctrl->getLinkTarget($this,'')
857  );
858  }
859  elseif(
860  (bool) $this->getParentObject()->getShowMembers() && $a_is_participant
861  )
862  {
863  $tabs->addTab(
864  'members',
865  $this->lng->txt('members'),
866  $this->ctrl->getLinkTargetByClass(array(get_class($this),'ilusersgallerygui'), 'view')
867  );
868  }
869  elseif(
870  $this->getParentObject()->getMailToMembersType() == 1 &&
871  $GLOBALS['rbacsystem']->checkAccess('internal_mail',$mail->getMailObjectReferenceId ()) &&
872  $a_is_participant
873  )
874  {
875  $tabs->addTab(
876  'members',
877  $this->lng->txt('members'),
878  $this->ctrl->getLinkTarget($this, "mailMembersBtn")
879  );
880  }
881  }
$GLOBALS['loaded']
Global hash that tracks already loaded includes.
This class handles base functions for mail handling.
Create styles array
The data for the language used.
addTab($a_id, $a_text, $a_link, $a_frame="")
Add a Tab.
getParentObject()
Get parent object.
+ Here is the call graph for this function:

◆ addToClipboard()

ilMembershipGUI::addToClipboard ( )
protected

Add selected users to user clipboard.

Definition at line 1359 of file class.ilMembershipGUI.php.

References $_POST, $GLOBALS, array, ilUserClipboard\getInstance(), ilUtil\sendFailure(), and ilUtil\sendSuccess().

1360  {
1361  $users = (array) $_POST['participants'];
1362  if(!count($users))
1363  {
1364  ilUtil::sendFailure($this->lng->txt('select_one'),true);
1365  $this->ctrl->redirect($this, 'participants');
1366  }
1367  include_once './Services/User/classes/class.ilUserClipboard.php';
1368  $clip = ilUserClipboard::getInstance($GLOBALS['ilUser']->getId());
1369  $clip->add($users);
1370  $clip->save();
1371 
1372  $this->lng->loadLanguageModule('user');
1373  ilUtil::sendSuccess($this->lng->txt('clipboard_user_added'),true);
1374  $this->ctrl->redirect($this, 'participants');
1375 
1376  }
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
static getInstance($a_usr_id)
Get singelton instance.
$GLOBALS['loaded']
Global hash that tracks already loaded includes.
Create styles array
The data for the language used.
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
$_POST["username"]
+ Here is the call graph for this function:

◆ assignFromWaitingList()

ilMembershipGUI::assignFromWaitingList ( )

Assign from waiting list type $rbacsystem.

Returns
boolean

Definition at line 1224 of file class.ilMembershipGUI.php.

References $_POST, ilObjectFactory\getInstanceByObjId(), getMembersObject(), getParentObject(), IL_CRS_MEMBER, IL_GRP_MEMBER, ilUtil\sendFailure(), ilUtil\sendSuccess(), and ilGroupMembershipMailNotification\TYPE_ACCEPTED_SUBSCRIPTION_MEMBER.

1225  {
1226  if(!count($_POST["waiting"]))
1227  {
1228  ilUtil::sendFailure($this->lng->txt("crs_no_users_selected"),true);
1229  $this->ctrl->redirect($this,'participants');
1230  }
1231 
1232  $waiting_list = $this->initWaitingList();
1233 
1234  $added_users = 0;
1235  foreach($_POST["waiting"] as $user_id)
1236  {
1237  if(!$tmp_obj = ilObjectFactory::getInstanceByObjId($user_id,false))
1238  {
1239  continue;
1240  }
1241  if($this->getMembersObject()->isAssigned($user_id))
1242  {
1243  continue;
1244  }
1245 
1246  if($this instanceof ilCourseMembershipGUI)
1247  {
1248  $this->getMembersObject()->add($user_id,IL_CRS_MEMBER);
1249  $this->getMembersObject()->sendNotification($this->getMembersObject()->NOTIFY_ACCEPT_USER,$user_id,true);
1250  $this->getParentObject()->checkLPStatusSync($user_id);
1251  }
1252  else
1253  {
1254  include_once './Modules/Group/classes/class.ilGroupMembershipMailNotification.php';
1255  $this->getMembersObject()->add($user_id,IL_GRP_MEMBER);
1256  $this->getMembersObject()->sendNotification(
1258  $user_id,
1259  true
1260  );
1261  }
1262  $waiting_list->removeFromList($user_id);
1263  ++$added_users;
1264  }
1265 
1266  if($added_users)
1267  {
1268  ilUtil::sendSuccess($this->lng->txt("crs_users_added"),true);
1269  $this->ctrl->redirect($this, 'participants');
1270  }
1271  else
1272  {
1273  ilUtil::sendFailure($this->lng->txt("crs_users_already_assigned"),true);
1274  $this->ctrl->redirect($this, 'participants');
1275  }
1276  }
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
getMembersObject()
Get member object.
const IL_GRP_MEMBER
const IL_CRS_MEMBER
static getInstanceByObjId($a_obj_id, $stop_on_error=true)
get an instance of an Ilias object by object id
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
getParentObject()
Get parent object.
$_POST["username"]
+ Here is the call graph for this function:

◆ assignSubscribers()

ilMembershipGUI::assignSubscribers ( )

Do assignment of subscription request type $rbacsystem type $ilErr.

Returns
boolean

Definition at line 1119 of file class.ilMembershipGUI.php.

References $_POST, $ilErr, getMembersObject(), getParentObject(), IL_GRP_MEMBER, ilUtil\sendFailure(), ilUtil\sendSuccess(), and ilGroupMembershipMailNotification\TYPE_ACCEPTED_SUBSCRIPTION_MEMBER.

1120  {
1121  global $ilErr;
1122 
1123  if(!is_array($_POST["subscribers"]))
1124  {
1125  ilUtil::sendFailure($this->lng->txt("crs_no_subscribers_selected"),true);
1126  $this->ctrl->redirect($this, 'participants');
1127  }
1128 
1129  if(!$this->getMembersObject()->assignSubscribers($_POST["subscribers"]))
1130  {
1131  $this->object->members_obj->add($usr_id,IL_GRP_MEMBER);
1132  $this->object->members_obj->deleteSubscriber($usr_id);
1133 
1134 
1135 
1136  ilUtil::sendFailure($ilErr->getMessage(),true);
1137  $this->ctrl->redirect($this, 'participants');
1138  }
1139  else
1140  {
1141  foreach($_POST["subscribers"] as $usr_id)
1142  {
1143  if($this instanceof ilCourseMembershipGUI)
1144  {
1145  $this->getMembersObject()->sendNotification($this->getMembersObject()->NOTIFY_ACCEPT_SUBSCRIBER, $usr_id);
1146  $this->getParentObject()->checkLPStatusSync($usr_id);
1147  }
1148  else
1149  {
1150  include_once './Modules/Group/classes/class.ilGroupMembershipMailNotification.php';
1151  $this->getMembersObject()->sendNotification(
1153  $usr_id
1154  );
1155  }
1156  }
1157  }
1158  ilUtil::sendSuccess($this->lng->txt("crs_subscribers_assigned"),true);
1159  $this->ctrl->redirect($this, 'participants');
1160  }
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
global $ilErr
Definition: raiseError.php:16
getMembersObject()
Get member object.
const IL_GRP_MEMBER
assignSubscribers()
Do assignment of subscription request type $rbacsystem type $ilErr.
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
getParentObject()
Get parent object.
$_POST["username"]
+ Here is the call graph for this function:

◆ checkPermissionBool()

ilMembershipGUI::checkPermissionBool (   $a_permission,
  $a_cmd = '',
  $a_type = '',
  $a_ref_id = 0 
)
protected

Check permission.

Parameters
type$a_permission
type$a_cmd
type$a_type
type$a_ref_id

Definition at line 110 of file class.ilMembershipGUI.php.

References $cmd, $GLOBALS, $ilErr, $ilUser, League\OAuth2\Client\Provider\$provider, $ret, ilParticipants\_isParticipant(), array, ilParticipants\getInstanceByObjId(), getLocalRoles(), getMembersObject(), getParentGUI(), getParentObject(), ilCourseConstants\MAIL_ALLOWED_ALL, object, setSubTabs(), and showMailToMemberToolbarButton().

111  {
112  if(!$a_ref_id)
113  {
114  $a_ref_id = $this->getParentObject()->getRefId();
115  }
116  return $this->access->checkAccess($a_permission, $a_cmd, $a_ref_id);
117  }
getParentObject()
Get parent object.
+ Here is the call graph for this function:

◆ confirmAssignFromWaitingList()

ilMembershipGUI::confirmAssignFromWaitingList ( )

Assign from waiting list (confirmatoin)

Returns
boolean

Definition at line 1187 of file class.ilMembershipGUI.php.

References $_POST, ilObjUser\_lookupName(), ilUtil\getImagePath(), and ilUtil\sendFailure().

1188  {
1189  if(!is_array($_POST["waiting"]))
1190  {
1191  ilUtil::sendFailure($this->lng->txt("crs_no_users_selected"),true);
1192  $this->ctrl->redirect($this,'participants');
1193  }
1194 
1195 
1196  include_once("Services/Utilities/classes/class.ilConfirmationGUI.php");
1197  $c_gui = new ilConfirmationGUI();
1198 
1199  // set confirm/cancel commands
1200  $c_gui->setFormAction($this->ctrl->getFormAction($this, "assignFromWaitingList"));
1201  $c_gui->setHeaderText($this->lng->txt("info_assign_sure"));
1202  $c_gui->setCancel($this->lng->txt("cancel"), "participants");
1203  $c_gui->setConfirm($this->lng->txt("confirm"), "assignFromWaitingList");
1204 
1205  foreach($_POST["waiting"] as $waiting)
1206  {
1207  $name = ilObjUser::_lookupName($waiting);
1208 
1209  $c_gui->addItem('waiting[]',
1210  $name['user_id'],
1211  $name['lastname'].', '.$name['firstname'].' ['.$name['login'].']',
1212  ilUtil::getImagePath('icon_usr.svg'));
1213  }
1214 
1215  $this->tpl->setContent($c_gui->getHTML());
1216  return true;
1217  }
static _lookupName($a_user_id)
lookup user name
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
$_POST["username"]
Confirmation screen class.
+ Here is the call graph for this function:

◆ confirmAssignSubscribers()

ilMembershipGUI::confirmAssignSubscribers ( )

Show subscription confirmation.

Returns
boolean

Definition at line 1002 of file class.ilMembershipGUI.php.

References $_POST, ilObjUser\_lookupName(), ilUtil\getImagePath(), and ilUtil\sendFailure().

1003  {
1004  if(!is_array($_POST["subscribers"]))
1005  {
1006  ilUtil::sendFailure($this->lng->txt("crs_no_subscribers_selected"),true);
1007  $this->ctrl->redirect($this, 'participants');
1008  }
1009 
1010  include_once("Services/Utilities/classes/class.ilConfirmationGUI.php");
1011  $c_gui = new ilConfirmationGUI();
1012 
1013  // set confirm/cancel commands
1014  $c_gui->setFormAction($this->ctrl->getFormAction($this, "assignSubscribers"));
1015  $c_gui->setHeaderText($this->lng->txt("info_assign_sure"));
1016  $c_gui->setCancel($this->lng->txt("cancel"), "participants");
1017  $c_gui->setConfirm($this->lng->txt("confirm"), "assignSubscribers");
1018 
1019  foreach($_POST["subscribers"] as $subscribers)
1020  {
1021  $name = ilObjUser::_lookupName($subscribers);
1022 
1023  $c_gui->addItem('subscribers[]',
1024  $name['user_id'],
1025  $name['lastname'].', '.$name['firstname'].' ['.$name['login'].']',
1026  ilUtil::getImagePath('icon_usr.svg'));
1027  }
1028 
1029  $this->tpl->setContent($c_gui->getHTML());
1030  return true;
1031  }
static _lookupName($a_user_id)
lookup user name
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
$_POST["username"]
Confirmation screen class.
+ Here is the call graph for this function:

◆ confirmDeleteParticipants()

ilMembershipGUI::confirmDeleteParticipants ( )
protected

Show confirmation screen for participants deletion.

Definition at line 530 of file class.ilMembershipGUI.php.

References $_POST, $GLOBALS, $ilUser, ilObjUser\_lookupName(), array, ilUtil\getImagePath(), getMembersObject(), and ilUtil\sendFailure().

531  {
532  global $ilAccess, $ilUser;
533 
534  $participants = (array) $_POST['participants'];
535 
536  if(!count($participants))
537  {
538  ilUtil::sendFailure($this->lng->txt('no_checkbox'),true);
539  $this->ctrl->redirect($this, 'participants');
540  }
541 
542  // Check last admin
543  if(!$this->getMembersObject()->checkLastAdmin($participants))
544  {
545  ilUtil::sendFailure($this->lng->txt($this->getParentObject()->getType().'_at_least_one_admin'),true);
546  $this->ctrl->redirect($this, 'participants');
547  }
548 
549  // Access check for admin deletion
550  if(
551  !$ilAccess->checkAccess(
552  'edit_permission',
553  '',
554  $this->getParentObject()->getRefId()) &&
555  !$this->getMembersObject()->isAdmin($GLOBALS['ilUser']->getId())
556  )
557  {
558  foreach ($participants as $usr_id)
559  {
560  if($this->getMembersObject()->isAdmin($usr_id))
561  {
562  ilUtil::sendFailure($this->lng->txt("msg_no_perm_perm"),true);
563  $this->ctrl->redirect($this, 'participants');
564  }
565  }
566  }
567 
568 
569  include_once('./Services/Utilities/classes/class.ilConfirmationGUI.php');
570  $confirm = new ilConfirmationGUI();
571  $confirm->setFormAction($this->ctrl->getFormAction($this,'confirmDeleteParticipants'));
572  $confirm->setHeaderText($this->lng->txt($this->getParentObject()->getType().'_header_delete_members'));
573  $confirm->setConfirm($this->lng->txt('confirm'),'deleteParticipants');
574  $confirm->setCancel($this->lng->txt('cancel'),'participants');
575 
576  foreach($participants as $usr_id)
577  {
578  $name = ilObjUser::_lookupName($usr_id);
579 
580  $confirm->addItem('participants[]',
581  $name['user_id'],
582  $name['lastname'].', '.$name['firstname'].' ['.$name['login'].']',
583  ilUtil::getImagePath('icon_usr.svg'));
584  }
585 
586  $this->tpl->setContent($confirm->getHTML());
587  }
static _lookupName($a_user_id)
lookup user name
getMembersObject()
Get member object.
$GLOBALS['loaded']
Global hash that tracks already loaded includes.
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
$ilUser
Definition: imgupload.php:18
Create styles array
The data for the language used.
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
$_POST["username"]
Confirmation screen class.
+ Here is the call graph for this function:

◆ confirmRefuseFromList()

ilMembershipGUI::confirmRefuseFromList ( )

Refuse from waiting list (confirmation)

Returns
boolean

Definition at line 1282 of file class.ilMembershipGUI.php.

References $_POST, ilObjUser\_lookupName(), ilUtil\getImagePath(), and ilUtil\sendFailure().

1283  {
1284  if(!is_array($_POST["waiting"]))
1285  {
1286  ilUtil::sendFailure($this->lng->txt("no_checkbox"),true);
1287  $this->ctrl->redirect($this, 'participants');
1288  }
1289 
1290  $this->lng->loadLanguageModule('mmbr');
1291 
1292  include_once("Services/Utilities/classes/class.ilConfirmationGUI.php");
1293  $c_gui = new ilConfirmationGUI();
1294 
1295  // set confirm/cancel commands
1296  $c_gui->setFormAction($this->ctrl->getFormAction($this, "refuseFromList"));
1297  $c_gui->setHeaderText($this->lng->txt("info_refuse_sure"));
1298  $c_gui->setCancel($this->lng->txt("cancel"), "participants");
1299  $c_gui->setConfirm($this->lng->txt("confirm"), "refuseFromList");
1300 
1301  foreach($_POST["waiting"] as $waiting)
1302  {
1303  $name = ilObjUser::_lookupName($waiting);
1304 
1305  $c_gui->addItem('waiting[]',
1306  $name['user_id'],
1307  $name['lastname'].', '.$name['firstname'].' ['.$name['login'].']',
1308  ilUtil::getImagePath('icon_usr.svg'));
1309  }
1310 
1311  $this->tpl->setContent($c_gui->getHTML());
1312  return true;
1313  }
static _lookupName($a_user_id)
lookup user name
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
$_POST["username"]
Confirmation screen class.
+ Here is the call graph for this function:

◆ confirmRefuseSubscribers()

ilMembershipGUI::confirmRefuseSubscribers ( )

Refuse subscriber confirmation.

Returns
boolean

Definition at line 1037 of file class.ilMembershipGUI.php.

References $_POST, ilObjUser\_lookupName(), ilUtil\getImagePath(), and ilUtil\sendFailure().

1038  {
1039  if(!is_array($_POST["subscribers"]))
1040  {
1041  ilUtil::sendFailure($this->lng->txt("crs_no_subscribers_selected"),true);
1042  $this->ctrl->redirect($this, 'participants');
1043  }
1044 
1045  $this->lng->loadLanguageModule('mmbr');
1046 
1047  include_once("Services/Utilities/classes/class.ilConfirmationGUI.php");
1048  $c_gui = new ilConfirmationGUI();
1049 
1050  // set confirm/cancel commands
1051  $c_gui->setFormAction($this->ctrl->getFormAction($this, "refuseSubscribers"));
1052  $c_gui->setHeaderText($this->lng->txt("info_refuse_sure"));
1053  $c_gui->setCancel($this->lng->txt("cancel"), "participants");
1054  $c_gui->setConfirm($this->lng->txt("confirm"), "refuseSubscribers");
1055 
1056  foreach($_POST["subscribers"] as $subscribers)
1057  {
1058  $name = ilObjUser::_lookupName($subscribers);
1059 
1060  $c_gui->addItem('subscribers[]',
1061  $name['user_id'],
1062  $name['lastname'].', '.$name['firstname'].' ['.$name['login'].']',
1063  ilUtil::getImagePath('icon_usr.svg'));
1064  }
1065 
1066  $this->tpl->setContent($c_gui->getHTML());
1067  return true;
1068  }
static _lookupName($a_user_id)
lookup user name
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
$_POST["username"]
Confirmation screen class.
+ Here is the call graph for this function:

◆ createMailSignature()

ilMembershipGUI::createMailSignature ( )
Todo:
better implementation Create Mail signature

Definition at line 835 of file class.ilMembershipGUI.php.

References getParentGUI().

Referenced by sendMailToSelectedUsers().

836  {
837  return $this->getParentGUI()->createMailSignature();
838  }
getParentGUI()
Get parent gui.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ deleteParticipants()

ilMembershipGUI::deleteParticipants ( )
protected

Definition at line 589 of file class.ilMembershipGUI.php.

References $_POST, $GLOBALS, $ilUser, array, getMembersObject(), getParentObject(), ilUtil\sendFailure(), ilUtil\sendSuccess(), and ilGroupMembershipMailNotification\TYPE_DISMISS_MEMBER.

590  {
591  global $rbacreview, $rbacsystem, $ilAccess, $ilUser;
592 
593  $participants = (array) $_POST['participants'];
594 
595  if(!is_array($participants) or !count($participants))
596  {
597  ilUtil::sendFailure($this->lng->txt("no_checkbox"),true);
598  $this->ctrl->redirect($this, 'participants');
599  }
600 
601  // If the user doesn't have the edit_permission and is not administrator, he may not remove
602  // members who have the course administrator role
603  if (
604  !$ilAccess->checkAccess('edit_permission', '', $this->getParentObject()->getRefId()) &&
605  !$this->getMembersObject()->isAdmin($GLOBALS['ilUser']->getId())
606  )
607  {
608  foreach($participants as $part)
609  {
610  if($this->getMembersObject()->isAdmin($part))
611  {
612  ilUtil::sendFailure($this->lng->txt('msg_no_perm_perm'),true);
613  $this->ctrl->redirect($this, 'participants');
614  }
615  }
616  }
617 
618  if(!$this->getMembersObject()->deleteParticipants($participants))
619  {
620  ilUtil::sendFailure('Error deleting participants.', true);
621  $this->ctrl->redirect($this, 'participants');
622  }
623  else
624  {
625  foreach((array) $_POST["participants"] as $usr_id)
626  {
627  $mail_type = 0;
628  // @todo more generic
629  switch($this->getParentObject()->getType())
630  {
631  case 'crs':
632  $mail_type = $this->getMembersObject()->NOTIFY_DISMISS_MEMBER;
633  break;
634  case 'grp':
635  include_once './Modules/Group/classes/class.ilGroupMembershipMailNotification.php';
637  break;
638  }
639  $this->getMembersObject()->sendNotification($mail_type, $usr_id);
640  }
641  }
642  ilUtil::sendSuccess($this->lng->txt($this->getParentObject()->getType()."_members_deleted"), true);
643  $this->ctrl->redirect($this, "participants");
644 
645  return true;
646 
647  }
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
getMembersObject()
Get member object.
$GLOBALS['loaded']
Global hash that tracks already loaded includes.
$ilUser
Definition: imgupload.php:18
Create styles array
The data for the language used.
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
getParentObject()
Get parent object.
$_POST["username"]
+ Here is the call graph for this function:

◆ editMember()

ilMembershipGUI::editMember ( )
protected

Edit one participant.

Definition at line 361 of file class.ilMembershipGUI.php.

References array, editParticipants(), and getParentObject().

362  {
363  $this->activateSubTab($this->getParentObject()->getType()."_member_administration");
364  return $this->editParticipants(array($_REQUEST['member_id']));
365  }
Create styles array
The data for the language used.
getParentObject()
Get parent object.
editParticipants($post_participants=array())
Edit participants.
+ Here is the call graph for this function:

◆ editParticipants()

ilMembershipGUI::editParticipants (   $post_participants = array())
protected

Edit participants.

Parameters
array$post_participants

Definition at line 371 of file class.ilMembershipGUI.php.

References $_POST, array, getMembersObject(), and ilUtil\sendFailure().

Referenced by editMember().

372  {
373  if(!$post_participants)
374  {
375  $post_participants = (array) $_POST['participants'];
376  }
377 
378  $real_participants = $this->getMembersObject()->getParticipants();
379  $participants = array_intersect((array) $post_participants, (array) $real_participants);
380 
381  if(!count($participants))
382  {
383  ilUtil::sendFailure($this->lng->txt('no_checkbox'),true);
384  $this->ctrl->redirect($this,'participants');
385  }
386  $table = $this->initEditParticipantTableGUI($participants);
387  $this->tpl->setContent($table->getHTML());
388  return true;
389  }
getMembersObject()
Get member object.
Create styles array
The data for the language used.
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
$_POST["username"]
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getDefaultRole()

ilMembershipGUI::getDefaultRole ( )
protected
Returns
null

Definition at line 1381 of file class.ilMembershipGUI.php.

References $GLOBALS, getParentGUI(), and ilUtil\sendFailure().

Referenced by showParticipantsToolbar().

1382  {
1383  return null;
1384  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getLocalRoles()

ilMembershipGUI::getLocalRoles ( )

Get parent roles.

Returns
type

Definition at line 976 of file class.ilMembershipGUI.php.

References getParentGUI().

Referenced by checkPermissionBool().

977  {
978  return $this->getParentGUI()->getLocalRoles();
979  }
getParentGUI()
Get parent gui.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getMembersObject()

ilMembershipGUI::getMembersObject ( )

Get member object.

Returns
ilParticipants

Definition at line 93 of file class.ilMembershipGUI.php.

References ilParticipants\getInstanceByObjId(), getParentObject(), and participants().

Referenced by assignFromWaitingList(), ilGroupMembershipGUI\assignMembers(), ilCourseMembershipGUI\assignMembers(), assignSubscribers(), checkPermissionBool(), confirmDeleteParticipants(), deleteParticipants(), editParticipants(), ilCourseMembershipGUI\getPrintMemberData(), parseSubscriberTable(), printMembersOutput(), refuseFromList(), refuseSubscribers(), updateParticipants(), ilGroupMembershipGUI\updateParticipantsStatus(), and ilCourseMembershipGUI\updateParticipantsStatus().

94  {
95  if($this->participants instanceof ilParticipants)
96  {
97  return $this->participants;
98  }
99  include_once './Services/Membership/classes/class.ilParticipants.php';
100  return $this->participants = ilParticipants::getInstanceByObjId($this->getParentObject()->getId());
101  }
participants()
Show participant table, subscriber table, wating list table;.
getParentObject()
Get parent object.
static getInstanceByObjId($a_obj_id)
Get instance by obj type.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getParentGUI()

◆ getParentObject()

◆ mailMembersBtn()

ilMembershipGUI::mailMembersBtn ( )
protected

Mail to members view type $ilToolbar.

Definition at line 743 of file class.ilMembershipGUI.php.

References $GLOBALS, and showMailToMemberToolbarButton().

744  {
745  global $ilToolbar;
746 
747  $this->showMailToMemberToolbarButton($GLOBALS['ilToolbar'], 'mailMembersBtn');
748  }
$GLOBALS['loaded']
Global hash that tracks already loaded includes.
showMailToMemberToolbarButton(ilToolbarGUI $toolbar, $a_back_cmd=null, $a_separator=false)
Show mail to member toolbar button.
+ Here is the call graph for this function:

◆ membersMap()

ilMembershipGUI::membersMap ( )
protected

Members map.

Definition at line 707 of file class.ilMembershipGUI.php.

References $tpl, array, ilParticipants\getInstanceByObjId(), ilMapUtil\getMapGUI(), getParentObject(), and ilMapUtil\isActivated().

708  {
709  global $tpl;
710  $this->activateSubTab($this->getParentObject()->getType()."_members_map");
711  include_once("./Services/Maps/classes/class.ilMapUtil.php");
712  if (!ilMapUtil::isActivated() || !$this->getParentObject()->getEnableMap())
713  {
714  return;
715  }
716 
717  $map = ilMapUtil::getMapGUI();
718  $map->setMapId("course_map")
719  ->setWidth("700px")
720  ->setHeight("500px")
721  ->setLatitude($this->getParentObject()->getLatitude())
722  ->setLongitude($this->getParentObject()->getLongitude())
723  ->setZoom($this->getParentObject()->getLocationZoom())
724  ->setEnableTypeControl(true)
725  ->setEnableNavigationControl(true)
726  ->setEnableCentralMarker(true);
727 
728  include_once './Services/Membership/classes/class.ilParticipants.php';
729  $members = ilParticipants::getInstanceByObjId($this->getParentObject()->getId())->getParticipants();
730  foreach((array) $members as $user_id)
731  {
732  $map->addUserMarker($user_id);
733  }
734 
735  $tpl->setContent($map->getHTML());
736  $tpl->setLeftContent($map->getUserListHTML());
737  }
static getMapGUI()
Get an instance of the GUI class.
Create styles array
The data for the language used.
static isActivated()
Checks whether Map feature is activated.
getParentObject()
Get parent object.
static getInstanceByObjId($a_obj_id)
Get instance by obj type.
+ Here is the call graph for this function:

◆ parseSubscriberTable()

ilMembershipGUI::parseSubscriberTable ( )
protected

Parse table of subscription request.

Definition at line 984 of file class.ilMembershipGUI.php.

References ilLoggerFactory\getLogger(), getMembersObject(), and getParentObject().

Referenced by participants().

985  {
986  if(!$this->getMembersObject()->getSubscribers())
987  {
988  ilLoggerFactory::getLogger('mmbr')->debug('No subscriber found');
989  return null;
990  }
991  include_once './Services/Membership/classes/class.ilSubscriberTableGUI.php';
992  $subscriber = new ilSubscriberTableGUI($this, $this->getParentObject(),true);
993  $subscriber->setTitle($this->lng->txt('group_new_registrations'));
994  $subscriber->readSubscriberData();
995  return $subscriber;
996  }
getMembersObject()
Get member object.
GUI class for course/group subscriptions.
static getLogger($a_component_id)
Get component logger.
getParentObject()
Get parent object.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ parseWaitingListTable()

ilMembershipGUI::parseWaitingListTable ( )
protected

Parse table of subscription request.

Returns
ilWaitingListTableGUI

Definition at line 1166 of file class.ilMembershipGUI.php.

References getParentObject().

Referenced by participants().

1167  {
1168  $wait = $this->initWaitingList();
1169 
1170  if(!$wait->getCountUsers())
1171  {
1172  return null;
1173  }
1174 
1175  include_once './Services/Membership/classes/class.ilWaitingListTableGUI.php';
1176  $waiting_table = new ilWaitingListTableGUI($this, $this->getParentObject(), $wait);
1177  $waiting_table->setUsers($wait->getAllUsers());
1178  $waiting_table->setTitle($this->lng->txt('crs_waiting_list'));
1179 
1180  return $waiting_table;
1181  }
GUI class for course/group waiting list.
getParentObject()
Get parent object.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ participants()

ilMembershipGUI::participants ( )
protected

Show participant table, subscriber table, wating list table;.

Definition at line 300 of file class.ilMembershipGUI.php.

References getParentObject(), parseSubscriberTable(), parseWaitingListTable(), and showParticipantsToolbar().

Referenced by getMembersObject(), participantsApplyFilter(), and participantsResetFilter().

301  {
302  $this->initParticipantTemplate();
303  $this->showParticipantsToolbar();
304  $this->activateSubTab($this->getParentObject()->getType()."_member_administration");
305 
306  // show waiting list table
307  $waiting = $this->parseWaitingListTable();
308  if($waiting instanceof ilWaitingListTableGUI)
309  {
310  $this->tpl->setVariable('TABLE_WAIT', $waiting->getHTML());
311  }
312 
313  // show subscriber table
314  $subscriber = $this->parseSubscriberTable();
315  if($subscriber instanceof ilSubscriberTableGUI)
316  {
317  $this->tpl->setVariable('TABLE_SUB', $subscriber->getHTML());
318  }
319 
320  // show member table
321  $table = $this->initParticipantTableGUI();
322  $table->setTitle($this->lng->txt($this->getParentObject()->getType().'_mem_tbl_header'));
323  $table->setFormAction($this->ctrl->getFormAction($this));
324  $table->parse();
325 
326  // filter commands
327  $table->setFilterCommand('participantsApplyFilter');
328  $table->setResetCommand('participantsResetFilter');
329 
330  $this->tpl->setVariable('MEMBERS', $table->getHTML());
331  }
parseWaitingListTable()
Parse table of subscription request.
GUI class for course/group subscriptions.
showParticipantsToolbar()
Show participants toolbar.
parseSubscriberTable()
Parse table of subscription request.
GUI class for course/group waiting list.
getParentObject()
Get parent object.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ participantsApplyFilter()

ilMembershipGUI::participantsApplyFilter ( )
protected

Apply filter for participant table.

Definition at line 336 of file class.ilMembershipGUI.php.

References participants().

337  {
338  $table = $this->initParticipantTableGUI();
339  $table->resetOffset();
340  $table->writeFilterToSession();
341 
342  $this->participants();
343  }
participants()
Show participant table, subscriber table, wating list table;.
+ Here is the call graph for this function:

◆ participantsResetFilter()

ilMembershipGUI::participantsResetFilter ( )
protected

reset participants filter

Definition at line 348 of file class.ilMembershipGUI.php.

References participants().

349  {
350  $table = $this->initParticipantTableGUI();
351  $table->resetOffset();
352  $table->resetFilter();
353 
354  $this->participants();
355  }
participants()
Show participant table, subscriber table, wating list table;.
+ Here is the call graph for this function:

◆ printMembers()

ilMembershipGUI::printMembers ( )
protected

Print members.

Todo:
: refactor to own class

Definition at line 1423 of file class.ilMembershipGUI.php.

1424  {
1425  global $ilTabs;
1426 
1427  $this->checkPermission('manage_members');
1428 
1429  $ilTabs->clearTargets();
1430  $ilTabs->setBackTarget(
1431  $this->lng->txt('back'),
1432  $this->ctrl->getLinkTarget($this, 'participants'));
1433 
1434  $list = $this->initAttendanceList();
1435  $form = $list->initForm('printMembersOutput');
1436  $this->tpl->setContent($form->getHTML());
1437 
1438  }

◆ printMembersOutput()

ilMembershipGUI::printMembersOutput ( )
protected

print members output

Definition at line 1443 of file class.ilMembershipGUI.php.

References ilObjUserTracking\_enabledLearningProgress(), ilObjUserTracking\_enabledUserRelatedData(), ilPrivacySettings\_getInstance(), array, exit, ilObjectLP\getInstance(), getMembersObject(), and getParentObject().

1444  {
1445  $list = $this->initAttendanceList();
1446  $list->initFromForm();
1447  $list->setCallback(array($this, 'getAttendanceListUserData'));
1448  $this->member_data = $this->getPrintMemberData($this->getMembersObject()->getParticipants());
1449  $list->getNonMemberUserData($this->member_data);
1450 
1451  $list->getFullscreenHTML();
1452  exit();
1453  }
getMembersObject()
Get member object.
Create styles array
The data for the language used.
+ Here is the call graph for this function:

◆ readMemberData()

ilMembershipGUI::readMemberData ( array  $usr_ids,
array  $columns 
)

Required for member table guis.

Has to be refactored and should be locate in ilObjCourse, ilObjGroup instead of GUI

Returns
array

Definition at line 967 of file class.ilMembershipGUI.php.

References getParentGUI().

Referenced by ilGroupMembershipGUI\getPrintMemberData(), ilGroupMembershipGUI\initEditParticipantTableGUI(), and ilCourseMembershipGUI\initEditParticipantTableGUI().

968  {
969  return $this->getParentGUI()->readMemberData($usr_ids, $columns);
970  }
getParentGUI()
Get parent gui.
if(! $in) $columns
Definition: Utf8Test.php:45
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ refuseFromList()

ilMembershipGUI::refuseFromList ( )
protected

refuse from waiting list

public

Returns

Definition at line 1321 of file class.ilMembershipGUI.php.

References $_POST, $ilUser, getMembersObject(), ilUtil\sendFailure(), ilUtil\sendSuccess(), and ilGroupMembershipMailNotification\TYPE_REFUSED_SUBSCRIPTION_MEMBER.

1322  {
1323  global $ilUser;
1324 
1325  if(!count($_POST['waiting']))
1326  {
1327  ilUtil::sendFailure($this->lng->txt('no_checkbox'),true);
1328  $this->ctrl->redirect($this, 'participants');
1329  }
1330 
1331  $waiting_list = $this->initWaitingList();
1332 
1333  foreach($_POST["waiting"] as $user_id)
1334  {
1335  $waiting_list->removeFromList($user_id);
1336 
1337  if($this instanceof ilCourseWaitingList)
1338  {
1339  $this->getMembersObject()->sendNotification($this->getMembersObject()->NOTIFY_DISMISS_SUBSCRIBER,$user_id,true);
1340  }
1341  else
1342  {
1343  include_once './Modules/Group/classes/class.ilGroupMembershipMailNotification.php';
1344  $this->getMembersObject()->sendNotification(
1346  $user_id,
1347  true
1348  );
1349  }
1350 
1351  }
1352  ilUtil::sendSuccess($this->lng->txt('crs_users_removed_from_list'),true);
1353  $this->ctrl->redirect($this, 'participants');
1354  }
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
getMembersObject()
Get member object.
$ilUser
Definition: imgupload.php:18
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
$_POST["username"]
+ Here is the call graph for this function:

◆ refuseSubscribers()

ilMembershipGUI::refuseSubscribers ( )
protected

Refuse subscribers type $rbacsystem.

Returns
boolean

Definition at line 1075 of file class.ilMembershipGUI.php.

References $_POST, $GLOBALS, getMembersObject(), ilUtil\sendFailure(), ilUtil\sendSuccess(), and ilGroupMembershipMailNotification\TYPE_REFUSED_SUBSCRIPTION_MEMBER.

1076  {
1077  global $rbacsystem;
1078 
1079  if(!$_POST['subscribers'])
1080  {
1081  ilUtil::sendFailure($this->lng->txt("crs_no_subscribers_selected"),true);
1082  $this->ctrl->redirect($this, 'participants');
1083  }
1084 
1085  if(!$this->getMembersObject()->deleteSubscribers($_POST["subscribers"]))
1086  {
1087  ilUtil::sendFailure($GLOBALS['ilErr']->getMessage(),true);
1088  $this->ctrl->redirect($this, 'participants');
1089  }
1090  else
1091  {
1092  foreach($_POST['subscribers'] as $usr_id)
1093  {
1094  if($this instanceof ilCourseMembershipGUI)
1095  {
1096  $this->getMembersObject()->sendNotification($this->getMembersObject()->NOTIFY_DISMISS_SUBSCRIBER, $usr_id);
1097  }
1098  else
1099  {
1100  include_once './Modules/Group/classes/class.ilGroupMembershipMailNotification.php';
1101  $this->getMembersObject()->sendNotification(
1103  $usr_id
1104  );
1105  }
1106  }
1107  }
1108 
1109  ilUtil::sendSuccess($this->lng->txt("crs_subscribers_deleted"),true);
1110  $this->ctrl->redirect($this, 'participants');
1111  }
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
getMembersObject()
Get member object.
$GLOBALS['loaded']
Global hash that tracks already loaded includes.
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
$_POST["username"]
+ Here is the call graph for this function:

◆ sendMailToSelectedUsers()

ilMembershipGUI::sendMailToSelectedUsers ( )
protected

Send mail to selected users.

Definition at line 652 of file class.ilMembershipGUI.php.

References $_GET, $_POST, ilObjUser\_lookupLogin(), array, ilMailFormCall\CONTEXT_KEY, createMailSignature(), getParentObject(), ilMailFormCall\getRedirectTarget(), ilCourseMailTemplateTutorContext\ID, ilUtil\redirect(), ilUtil\sendFailure(), ilMailFormCall\setRecipients(), and time.

653  {
654  if($_POST['participants'])
655  {
656  $participants = (array) $_POST['participants'];
657  }
658  elseif($_GET['member_id'])
659  {
660  $participants = array($_GET['member_id']);
661  }
662  elseif($_POST['subscribers'])
663  {
664  $participants = (array) $_POST['subscribers'];
665  }
666  elseif($_POST['waiting'])
667  {
668  $participants = (array) $_POST['waiting'];
669  }
670 
671  if (!count($participants))
672  {
673  ilUtil::sendFailure($this->lng->txt("no_checkbox"), true);
674  $this->ctrl->redirect($this, 'participants');
675  }
676 
677  foreach($participants as $usr_id)
678  {
679  $rcps[] = ilObjUser::_lookupLogin($usr_id);
680  }
681 
682  require_once 'Services/Mail/classes/class.ilMailFormCall.php';
683  require_once 'Modules/Course/classes/class.ilCourseMailTemplateTutorContext.php';
684 
688  $this,
689  'participants',
690  array(),
691  array(
692  'type' => 'new',
693  'sig' => $this->createMailSignature()
694  ),
695  array(
697  'ref_id' => $this->getParentObject()->getRefId(),
698  'ts' => time()
699  )
700  )
701  );
702  }
static _lookupLogin($a_user_id)
lookup login
$_GET["client_id"]
Create styles array
The data for the language used.
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
const CONTEXT_KEY
Session parameter for the context.
static getRedirectTarget($gui, $cmd, array $gui_params=array(), array $mail_params=array(), array $context_params=array())
static setRecipients(array $recipients)
Add data(end) time
Method that wraps PHPs time in order to allow simulations with the workflow.
getParentObject()
Get parent object.
static redirect($a_script)
http redirect to other script
$_POST["username"]
+ Here is the call graph for this function:

◆ setSubTabs()

ilMembershipGUI::setSubTabs ( ilTabsGUI  $tabs)
protected

Set sub tabs.

Definition at line 886 of file class.ilMembershipGUI.php.

References $GLOBALS, ilPrivacySettings\_getInstance(), ilTabsGUI\addSubTabTarget(), array, getParentObject(), and ilMapUtil\isActivated().

Referenced by checkPermissionBool().

887  {
888  global $ilAccess;
889 
890  if($ilAccess->checkAccess('manage_members','',$this->getParentObject()->getRefId()))
891  {
892  $tabs->addSubTabTarget(
893  $this->getParentObject()->getType()."_member_administration",
894  $this->ctrl->getLinkTarget($this,'participants'),
895  "members",
896  get_class($this)
897  );
898 
899  // show group overview
900  if($this instanceof ilCourseMembershipGUI)
901  {
902  $tabs->addSubTabTarget(
903  "crs_members_groups",
904  $this->ctrl->getLinkTargetByClass("ilCourseParticipantsGroupsGUI", "show"),
905  "",
906  "ilCourseParticipantsGroupsGUI"
907  );
908  }
909 
910  $childs = (array) $GLOBALS['tree']->getChildsByType($this->getParentObject()->getRefId(),'sess');
911  if(count($childs))
912  {
913  $tabs->addSubTabTarget(
914  'events',
915  $this->ctrl->getLinkTargetByClass(array(get_class($this),'ilsessionoverviewgui'),'listSessions'),
916  '',
917  'ilsessionoverviewgui'
918  );
919  }
920 
921  $tabs->addSubTabTarget(
922  $this->getParentObject()->getType().'_members_gallery',
923  $this->ctrl->getLinkTargetByClass(array(get_class($this),'ilUsersGalleryGUI')),
924  'view',
925  'ilUsersGalleryGUI'
926  );
927  }
928  else if($this->getParentObject()->getShowMembers())
929  {
930  // gallery
931  $tabs->addSubTabTarget(
932  $this->getParentObject()->getType().'_members_gallery',
933  $this->ctrl->getLinkTargetByClass(array(get_class($this),'ilUsersGalleryGUI')),
934  'view',
935  'ilUsersGalleryGUI'
936  );
937  }
938 
939  include_once './Services/Maps/classes/class.ilMapUtil.php';
940  if(ilMapUtil::isActivated() && $this->getParentObject()->getEnableMap())
941  {
942  $tabs->addSubTabTarget(
943  $this->getParentObject()->getType().'_members_map',
944  $this->ctrl->getLinkTarget($this,'membersMap'),
945  "membersMap",
946  get_class($this)
947  );
948  }
949 
950  include_once 'Services/PrivacySecurity/classes/class.ilPrivacySettings.php';
951  if(ilPrivacySettings::_getInstance()->checkExportAccess($this->getParentObject()->getRefId()))
952  {
953  $tabs->addSubTabTarget(
954  'export_members',
955  $this->ctrl->getLinkTargetByClass(array(get_class($this),'ilmemberexportgui'),'show'),
956  '',
957  'ilmemberexportgui'
958  );
959  }
960  }
$GLOBALS['loaded']
Global hash that tracks already loaded includes.
addSubTabTarget($a_text, $a_link, $a_cmd="", $a_cmdClass="", $a_frame="", $a_activate=false, $a_dir_text=false)
DEPRECATED.
Create styles array
The data for the language used.
static isActivated()
Checks whether Map feature is activated.
static _getInstance()
Get instance of ilPrivacySettings.
getParentObject()
Get parent object.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ showMailToMemberToolbarButton()

ilMembershipGUI::showMailToMemberToolbarButton ( ilToolbarGUI  $toolbar,
  $a_back_cmd = null,
  $a_separator = false 
)
protected

Show mail to member toolbar button.

Definition at line 799 of file class.ilMembershipGUI.php.

References $ilUser, ilToolbarGUI\addButton(), ilToolbarGUI\addSeparator(), and getParentObject().

Referenced by checkPermissionBool(), mailMembersBtn(), and showParticipantsToolbar().

800  {
801  global $ilUser, $rbacsystem, $ilAccess;
802  include_once 'Services/Mail/classes/class.ilMail.php';
803  $mail = new ilMail($ilUser->getId());
804 
805  if(
806  ($this->getParentObject()->getMailToMembersType() == 1) ||
807  (
808  $ilAccess->checkAccess('manage_members',"",$this->getParentObject()->getRefId()) &&
809  $rbacsystem->checkAccess('internal_mail',$mail->getMailObjectReferenceId())
810  )
811  )
812  {
813 
814  if($a_separator)
815  {
816  $toolbar->addSeparator();
817  }
818 
819  if($a_back_cmd)
820  {
821  $this->ctrl->setParameter($this, "back_cmd", $a_back_cmd);
822  }
823 
824  $toolbar->addButton(
825  $this->lng->txt("mail_members"),
826  $this->ctrl->getLinkTargetByClass('ilMailMemberSearchGUI','')
827  );
828  }
829  }
addButton($a_txt, $a_cmd, $a_target="", $a_acc_key="", $a_additional_attrs='', $a_id="", $a_class='submit')
Add button to toolbar.
This class handles base functions for mail handling.
$ilUser
Definition: imgupload.php:18
addSeparator()
Add separator.
getParentObject()
Get parent object.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ showParticipantsToolbar()

ilMembershipGUI::showParticipantsToolbar ( )
protected

Show participants toolbar.

Definition at line 756 of file class.ilMembershipGUI.php.

References array, ilRepositorySearchGUI\fillAutoCompleteToolbar(), getDefaultRole(), getParentGUI(), and showMailToMemberToolbarButton().

Referenced by participants().

757  {
758  global $ilToolbar;
759 
760  include_once './Services/Search/classes/class.ilRepositorySearchGUI.php';
762  $this,
763  $ilToolbar,
764  array(
765  'auto_complete_name' => $this->lng->txt('user'),
766  'user_type' => $this->getParentGUI()->getLocalRoles(),
767  'user_type_default' => $this->getDefaultRole(),
768  'submit_name' => $this->lng->txt('add')
769  )
770  );
771 
772  // spacer
773  $ilToolbar->addSeparator();
774 
775  // search button
776  $ilToolbar->addButton(
777  $this->lng->txt($this->getParentObject()->getType()."_search_users"),
778  $this->ctrl->getLinkTargetByClass(
779  'ilRepositorySearchGUI',
780  'start')
781  );
782 
783  // separator
784  $ilToolbar->addSeparator();
785 
786  // print button
787  $ilToolbar->addButton(
788  $this->lng->txt($this->getParentObject()->getType(). "_print_list"),
789  $this->ctrl->getLinkTarget($this, 'printMembers'));
790 
791  $this->showMailToMemberToolbarButton($ilToolbar, 'participants', false);
792  }
showMailToMemberToolbarButton(ilToolbarGUI $toolbar, $a_back_cmd=null, $a_separator=false)
Show mail to member toolbar button.
getParentGUI()
Get parent gui.
Create styles array
The data for the language used.
static fillAutoCompleteToolbar($parent_object, ilToolbarGUI $toolbar=null, $a_options=array(), $a_sticky=false)
fill toolbar with
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ updateParticipants()

ilMembershipGUI::updateParticipants ( )

update members

public

Parameters

Definition at line 398 of file class.ilMembershipGUI.php.

References $_POST, $ilUser, $title, array, getMembersObject(), getParentObject(), ilUtil\sendFailure(), and ilUtil\sendSuccess().

399  {
400  global $rbacsystem, $rbacreview, $ilUser, $ilAccess;
401 
402  if(!count($_POST['participants']))
403  {
404  ilUtil::sendFailure($this->lng->txt('no_checkbox'),true);
405  $this->ctrl->redirect($this,'participants');
406  }
407 
408  $notifications = $_POST['notification'] ? $_POST['notification'] : array();
409  $passed = $_POST['passed'] ? $_POST['passed'] : array();
410  $blocked = $_POST['blocked'] ? $_POST['blocked'] : array();
411  $contact = $_POST['contact'] ? $_POST['contact'] : array();
412 
413  // Determine whether the user has the 'edit_permission' permission
414  $hasEditPermissionAccess =
415  (
416  $ilAccess->checkAccess('edit_permission','',$this->getParentObject()->getRefId()) or
417  $this->getMembersObject()->isAdmin($ilUser->getId())
418  );
419 
420  // Get all assignable local roles of the object, and
421  // determine the role id of the course administrator role.
422  $assignableLocalRoles = array();
423  $adminRoleId = $this->getParentObject()->getDefaultAdminRole();
424  foreach ($this->getLocalTypeRole(false) as $title => $role_id)
425  {
426  $assignableLocalRoles[$role_id] = $title;
427  }
428 
429  // Validate the user ids and role ids in the post data
430  foreach($_POST['participants'] as $usr_id)
431  {
432  $memberIsAdmin = $rbacreview->isAssigned($usr_id, $adminRoleId);
433 
434  // If the current user doesn't have the 'edit_permission'
435  // permission, make sure he doesn't remove the course
436  // administrator role of members who are course administrator.
437  if (! $hasEditPermissionAccess && $memberIsAdmin &&
438  ! in_array($adminRoleId, $_POST['roles'][$usr_id])
439  )
440  {
441  $_POST['roles'][$usr_id][] = $adminRoleId;
442  }
443 
444  // Validate the role ids in the post data
445  foreach ((array) $_POST['roles'][$usr_id] as $role_id)
446  {
447  if(!array_key_exists($role_id, $assignableLocalRoles))
448  {
449  ilUtil::sendFailure($this->lng->txt('msg_no_perm_perm'),true);
450  $this->ctrl->redirect($this, 'participants');
451  }
452  if(!$hasEditPermissionAccess &&
453  $role_id == $adminRoleId &&
454  !$memberIsAdmin)
455  {
456  ilUtil::sendFailure($this->lng->txt('msg_no_perm_perm'));
457  $this->ctrl->redirect($this, 'participants');
458  }
459  }
460  }
461 
462  $has_admin = false;
463  foreach($this->getMembersObject()->getAdmins() as $admin_id)
464  {
465  if(!isset($_POST['roles'][$admin_id]))
466  {
467  $has_admin = true;
468  break;
469  }
470  if(in_array($adminRoleId,$_POST['roles'][$admin_id]))
471  {
472  $has_admin = true;
473  break;
474  }
475  }
476 
477  if(!$has_admin)
478  {
479  ilUtil::sendFailure($this->lng->txt($this->getParentObject()->getType().'_min_one_admin'),true);
480  $this->ctrl->redirect($this, 'participants');
481  }
482 
483  foreach($_POST['participants'] as $usr_id)
484  {
485  $this->getMembersObject()->updateRoleAssignments($usr_id,(array) $_POST['roles'][$usr_id]);
486 
487  // Disable notification for all of them
488  $this->getMembersObject()->updateNotification($usr_id,0);
489  if(($this->getMembersObject()->isTutor($usr_id) or $this->getMembersObject()->isAdmin($usr_id)) and in_array($usr_id,$notifications))
490  {
491  $this->getMembersObject()->updateNotification($usr_id,1);
492  }
493 
494  $this->getMembersObject()->updateBlocked($usr_id,0);
495  if((!$this->getMembersObject()->isAdmin($usr_id) and !$this->getMembersObject()->isTutor($usr_id)) and in_array($usr_id,$blocked))
496  {
497  $this->getMembersObject()->updateBlocked($usr_id,1);
498  }
499 
500  if($this instanceof ilCourseMembershipGUI)
501  {
502  $this->getMembersObject()->updatePassed($usr_id,in_array($usr_id,$passed),true);
503  $this->getMembersObject()->sendNotification(
504  $this->getMembersObject()->NOTIFY_STATUS_CHANGED,
505  $usr_id);
506  }
507 
508  if(
509  ($this->getMembersObject()->isAdmin($usr_id) ||
510  $this->getMembersObject()->isTutor($usr_id)) &&
511  in_array($usr_id, $contact)
512  )
513  {
514  $this->getMembersObject()->updateContact($usr_id,TRUE);
515  }
516  else
517  {
518  $this->getMembersObject()->updateContact($usr_id,FALSE);
519  }
520 
521  $this->updateLPFromStatus($usr_id,in_array($usr_id,$passed));
522  }
523  ilUtil::sendSuccess($this->lng->txt("msg_obj_modified"),true);
524  $this->ctrl->redirect($this, "participants");
525  }
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
getMembersObject()
Get member object.
$ilUser
Definition: imgupload.php:18
Create styles array
The data for the language used.
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
getParentObject()
Get parent object.
$_POST["username"]
+ Here is the call graph for this function:

Field Documentation

◆ $access

ilMembershipGUI::$access
protected

Definition at line 46 of file class.ilMembershipGUI.php.

◆ $ctrl

ilMembershipGUI::$ctrl = null
protected

Definition at line 31 of file class.ilMembershipGUI.php.

◆ $lng

ilMembershipGUI::$lng = null
protected

Definition at line 26 of file class.ilMembershipGUI.php.

Referenced by ilCourseMembershipGUI\getPrintMemberData().

◆ $logger

ilMembershipGUI::$logger = null
protected

Definition at line 36 of file class.ilMembershipGUI.php.

◆ $repository_gui

ilMembershipGUI::$repository_gui = null
private

Definition at line 21 of file class.ilMembershipGUI.php.

Referenced by __construct(), and getParentGUI().

◆ $repository_object

ilMembershipGUI::$repository_object = null
private

Definition at line 16 of file class.ilMembershipGUI.php.

Referenced by getParentObject().

◆ $tpl

ilMembershipGUI::$tpl
protected

Definition at line 41 of file class.ilMembershipGUI.php.

Referenced by membersMap().


The documentation for this class was generated from the following file: