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

Class ilObjGroup. More...

+ Inheritance diagram for ilObjGroup:
+ Collaboration diagram for ilObjGroup:

Public Member Functions

 __construct ($a_id=0, $a_call_by_reference=true)
 Constructor @access public. More...
 
 setInformation ($a_information)
 set information More...
 
 getInformation ()
 get Information More...
 
 setGroupType ($a_type)
 set group type More...
 
 getGroupType ()
 get group type More...
 
 setRegistrationType ($a_type)
 set registration type More...
 
 getRegistrationType ()
 get registration type More...
 
 isRegistrationEnabled ()
 is registration enabled More...
 
 enableUnlimitedRegistration ($a_status)
 enable unlimited registration More...
 
 isRegistrationUnlimited ()
 is registration unlimited More...
 
 setRegistrationStart ($a_start)
 set registration start More...
 
 getRegistrationStart ()
 get registration start More...
 
 setRegistrationEnd ($a_end)
 set registration end More...
 
 getRegistrationEnd ()
 get registration end More...
 
 setPassword ($a_pass)
 set password More...
 
 getPassword ()
 get password More...
 
 enableMembershipLimitation ($a_status)
 enable max member limitation More...
 
 isMembershipLimited ()
 is max member limited More...
 
 setMinMembers ($a_max)
 set min members More...
 
 getMinMembers ()
 get min members More...
 
 setMaxMembers ($a_max)
 set max members More...
 
 getMaxMembers ()
 get max members More...
 
 enableWaitingList ($a_status)
 enable waiting list More...
 
 isWaitingListEnabled ()
 is waiting list enabled More...
 
 setWaitingListAutoFill ($a_value)
 
 hasWaitingListAutoFill ()
 
 setLatitude ($a_latitude)
 Set Latitude. More...
 
 getLatitude ()
 Get Latitude. More...
 
 setLongitude ($a_longitude)
 Set Longitude. More...
 
 getLongitude ()
 Get Longitude. More...
 
 setLocationZoom ($a_locationzoom)
 Set LocationZoom. More...
 
 getLocationZoom ()
 Get LocationZoom. More...
 
 setEnableGroupMap ($a_enablemap)
 Set Enable Group Map. More...
 
 getEnableMap ()
 Type independent wrapper. More...
 
 getEnableGroupMap ()
 Get Enable Group Map. More...
 
 getRegistrationAccessCode ()
 get access code More...
 
 setRegistrationAccessCode ($a_code)
 Set refistration access code. More...
 
 isRegistrationAccessCodeEnabled ()
 Check if access code is enabled. More...
 
 enableRegistrationAccessCode ($a_status)
 En/disable registration access code. More...
 
 setMailToMembersType ($a_type)
 Set mail to members type. More...
 
 getMailToMembersType ()
 Get mail to members type. More...
 
 setCancellationEnd (ilDate $a_value=null)
 
 getCancellationEnd ()
 
 setShowMembers ($a_status)
 
 getShowMembers ()
 
 validate ()
 validate group settings More...
 
 create ()
 Create group. More...
 
 update ()
 Update group. More...
 
 delete ()
 delete group and all related data More...
 
 read ()
 Read group. More...
 
 cloneObject ($a_target_id, $a_copy_id=0, $a_omit_tree=false)
 Clone group (no member data) More...
 
 cloneDependencies ($a_target_id, $a_copy_id)
 Clone object dependencies (crs items, preconditions) More...
 
 cloneAutoGeneratedRoles ($new_obj)
 Clone group admin and member role permissions. More...
 
 join ($a_user_id, $a_mem_role="")
 join Group, assigns user to role @access private More...
 
 getDefaultMemberRole ()
 returns object id of created default member role @access public More...
 
 getDefaultAdminRole ()
 returns object id of created default adminstrator role @access public More...
 
 addMember ($a_user_id, $a_mem_role)
 add Member to Group @access public More...
 
 leaveGroup ()
 is called when a member decides to leave group @access public More...
 
 leave ($a_user_id)
 deassign member from group role @access private More...
 
 getGroupMemberIds ()
 get all group Member ids regardless of role @access public More...
 
 getGroupMemberData ($a_mem_ids, $active=1)
 get all group Members regardless of group role. More...
 
 getCountMembers ()
 
 getGroupAdminIds ($a_grpId="")
 get Group Admin Id @access public More...
 
 getDefaultGroupRoles ($a_grp_id="")
 get default group roles, returns the defaultlike create roles il_grp_member, il_grp_admin @access public More...
 
 getLocalGroupRoles ($a_translate=false)
 get ALL local roles of group, also those created and defined afterwards only fetch data once from database. More...
 
 getGrpStatusClosedTemplateId ()
 get group status closed template @access public More...
 
 getGrpStatusOpenTemplateId ()
 get group status open template @access public More...
 
 updateGroupType ()
 Change group type. More...
 
 initGroupStatus ($a_grpStatus=GRP_TYPE_PUBLIC)
 set group status More...
 
 setGroupStatus ($a_status)
 Set group status. More...
 
 getGroupStatus ()
 get group status More...
 
 readGroupStatus ()
 get group status, redundant method because @access public More...
 
 getMemberRoles ($a_user_id)
 get group member status @access public More...
 
 isAdmin ($a_userId)
 is Admin @access public More...
 
 initDefaultRoles ()
 init default roles settings @access public More...
 
 setParentRolePermissions ($a_parent_ref)
 This method is called before "initDefaultRoles". More...
 
 applyDidacticTemplate ($a_tpl_id)
 Apply template. More...
 
 _isMember ($a_user_id, $a_ref_id, $a_field='')
 
 _getMembers ($a_obj_id)
 
 getViewMode ($a_translate_inherit=true)
 get view mode More...
 
 setViewMode ($a_view_mode)
 Set group view mode. More...
 
 addAdditionalSubItemInformation (&$a_item_data)
 Add additional information to sub item, e.g. More...
 
 getMessage ()
 
 setMessage ($a_message)
 
 appendMessage ($a_message)
 
 getMembersObject ()
 Get members objects. More...
 
 register ($a_user_id, $a_role=IL_GRP_MEMBER, $a_force_registration=false)
 
 handleAutoFill ()
 
- Public Member Functions inherited from ilObject
 __construct ($a_id=0, $a_reference=true)
 Constructor @access public. More...
 
 withReferences ()
 determines wehter objects are referenced or not (got ref ids or not) More...
 
 read ()
 read object data from db into object More...
 
 getId ()
 get object id @access public More...
 
 setId ($a_id)
 set object id @access public More...
 
 setRefId ($a_id)
 set reference id @access public More...
 
 getRefId ()
 get reference id @access public More...
 
 getType ()
 get object type @access public More...
 
 setType ($a_type)
 set object type @access public More...
 
 getPresentationTitle ()
 get presentation title Normally same as title Overwritten for sessions More...
 
 getTitle ()
 get object title @access public More...
 
 getUntranslatedTitle ()
 get untranslated object title @access public More...
 
 setTitle ($a_title)
 set object title More...
 
 getDescription ()
 get object description More...
 
 setDescription ($a_desc)
 set object description More...
 
 getLongDescription ()
 get object long description (stored in object_description) More...
 
 getImportId ()
 get import id More...
 
 setImportId ($a_import_id)
 set import id More...
 
 getOwner ()
 get object owner More...
 
 getOwnerName ()
 
 setOwner ($a_owner)
 set object owner More...
 
 getCreateDate ()
 get create date @access public More...
 
 getLastUpdateDate ()
 get last update date @access public More...
 
 getDiskUsage ()
 
 create ()
 create More...
 
 update ()
 update object in db More...
 
 MDUpdateListener ($a_element)
 Meta data update listener. More...
 
 createMetaData ()
 create meta data entry More...
 
 updateMetaData ()
 update meta data entry More...
 
 deleteMetaData ()
 delete meta data entry More...
 
 updateOwner ()
 update owner of object in db More...
 
 putInTree ($a_parent_ref)
 maybe this method should be in tree object!? More...
 
 setPermissions ($a_parent_ref)
 set permissions of object More...
 
 setParentRolePermissions ($a_parent_ref)
 Initialize the permissions of parent roles (local roles of categories, global roles...) This method is overwritten in e.g courses, groups for building permission intersections with non_member templates. More...
 
 createReference ()
 creates reference for object More...
 
 countReferences ()
 count references of object More...
 
 delete ()
 delete object or referenced object (in the case of a referenced object, object data is only deleted if last reference is deleted) This function removes an object entirely from system!! More...
 
 initDefaultRoles ()
 init default roles settings Purpose of this function is to create a local role folder and local roles, that are needed depending on the object type If you want to setup default local roles you MUST overwrite this method in derived object classes (see ilObjForum for an example) @access public More...
 
 applyDidacticTemplate ($a_tpl_id)
 Apply template. More...
 
 setRegisterMode ($a_bool)
 
 isUserRegistered ($a_user_id=0)
 
 requireRegistration ()
 
 getXMLZip ()
 
 getHTMLDirectory ()
 
 cloneObject ($a_target_id, $a_copy_id=0, $a_omit_tree=false)
 Clone object permissions, put in tree ... More...
 
 appendCopyInfo ($a_target_id, $a_copy_id)
 Prepend Copy info if object with same name exists in that container. More...
 
 cloneDependencies ($a_target_id, $a_copy_id)
 Clone object dependencies. More...
 
 cloneMetaData ($target_obj)
 Copy meta data. More...
 
 getPossibleSubObjects ($a_filter=true)
 get all possible subobjects of this type the object can decide which types of subobjects are possible jut in time overwrite if the decision distinguish from standard model More...
 
- Public Member Functions inherited from ilContainer
 __construct ($a_id=0, $a_reference=true)
 Constructor @access public. More...
 
 createContainerDirectory ()
 Create directory for the container. More...
 
 getContainerDirectory ()
 Get the container directory. More...
 
 getBigIconPath ()
 Get path for big icon. More...
 
 getSmallIconPath ()
 Get path for small icon. More...
 
 getTinyIconPath ()
 Get path for tiny icon. More...
 
 getCustomIconPath ()
 Get path for custom icon. More...
 
 setHiddenFilesFound ($a_hiddenfilesfound)
 Set Found hidden files (set by getSubItems). More...
 
 getHiddenFilesFound ()
 Get Found hidden files (set by getSubItems). More...
 
 getStyleSheetId ()
 get ID of assigned style sheet object More...
 
 setStyleSheetId ($a_style_id)
 set ID of assigned style sheet object More...
 
 setNewsTimeline ($a_val)
 Set news timeline. More...
 
 getNewsTimeline ()
 Get news timeline. More...
 
 setNewsTimelineAutoEntries ($a_val)
 Set news timeline auto entries. More...
 
 getNewsTimelineAutoEntries ()
 Get news timeline auto entries. More...
 
 setNewsTimelineLandingPage ($a_val)
 Set news timline is landing page. More...
 
 getNewsTimelineLandingPage ()
 Get news timline is landing page. More...
 
 isNewsTimelineEffective ()
 Is news timeline effective? More...
 
 isNewsTimelineLandingPageEffective ()
 Is news timeline landing page effective? More...
 
 setNewsBlockActivated ($a_val)
 Set news block activated. More...
 
 getNewsBlockActivated ()
 Get news block activated. More...
 
 setUseNews ($a_val)
 Set use news. More...
 
 getUseNews ()
 Get use news. More...
 
 saveIcons ($a_custom_icon)
 save container icons More...
 
 removeCustomIcon ()
 remove small icon More...
 
 cloneObject ($a_target_id, $a_copy_id=0, $a_omit_tree=false)
 Clone container settings. More...
 
 cloneDependencies ($a_target_id, $a_copy_id)
 Clone object dependencies (container sorting) More...
 
 cloneAllObject ($session_id, $client_id, $new_type, $ref_id, $clone_source, $options, $soap_call=false, $a_submode=1)
 clone all objects according to this container More...
 
 getViewMode ()
 Get container view mode. More...
 
 getOrderType ()
 Get order type default implementation. More...
 
 setOrderType ($a_value)
 
 getSubItems ($a_admin_panel_enabled=false, $a_include_side_block=false, $a_get_single=0)
 Get subitems of container. More...
 
 gotItems ()
 Check whether we got any items. More...
 
 addAdditionalSubItemInformation (&$object)
 Add additional information to sub item, e.g. More...
 
 getGroupedObjTypes ()
 Get grouped repository object types. More...
 
 enablePageEditing ()
 Check whether page editing is allowed for container. More...
 
 create ()
 Create. More...
 
 update ()
 Update. More...
 
 read ()
 read More...
 
 readContainerSettings ()
 Read container settings. More...
 
- Public Member Functions inherited from ilMembershipRegistrationCodes
 register ($a_user_id)
 Register an user. More...
 

Static Public Member Functions

static lookupGroupTye ($a_id)
 Lookup group type. More...
 
static lookupGroupStatusTemplateId ($a_obj_id)
 @global $ilDB $ilDB More...
 
static _lookupIdByTitle ($a_title)
 
static lookupViewMode ($a_obj_id)
 lookup view mode @global $ilDB More...
 
static translateViewMode ($a_obj_id, $a_view_mode, $a_ref_id=null)
 translate view mode More...
 
static lookupObjectsByCode ($a_code)
 
static mayLeave ($a_group_id, $a_user_id=null, &$a_date=null)
 
static findGroupsWithNotEnoughMembers ()
 Minimum members check @global $ilDB $ilDB. More...
 
- Static Public Member Functions inherited from ilObject
static _lookupObjIdByImportId ($a_import_id)
 
static _lookupImportId ($a_obj_id)
 
static _lookupOwnerName ($a_owner_id)
 lookup owner name for owner id More...
 
static _getIdForImportId ($a_import_id)
 get current object id for import id (static) More...
 
static _getAllReferences ($a_id)
 get all reference ids of object More...
 
static _lookupTitle ($a_id)
 lookup object title More...
 
static _lookupOwner ($a_id)
 lookup object owner More...
 
static _getIdsForTitle ($title, $type='', $partialmatch=false)
 
static _lookupDescription ($a_id)
 lookup object description More...
 
static _lookupLastUpdate ($a_id, $a_as_string=false)
 lookup last update More...
 
static _getLastUpdateOfObjects ($a_objs)
 Get last update for a set of media objects. More...
 
static _lookupObjId ($a_id)
 
static _setDeletedDate ($a_ref_id)
 only called in ilTree::saveSubTree More...
 
static setDeletedDates ($a_ref_ids)
 Set deleted date @global type $ilDB. More...
 
static _resetDeletedDate ($a_ref_id)
 only called in ilObjectGUI::insertSavedNodes More...
 
static _lookupDeletedDate ($a_ref_id)
 only called in ilObjectGUI::insertSavedNodes More...
 
static _writeTitle ($a_obj_id, $a_title)
 write title to db (static) More...
 
static _writeDescription ($a_obj_id, $a_desc)
 write description to db (static) More...
 
static _writeImportId ($a_obj_id, $a_import_id)
 write import id to db (static) More...
 
static _lookupType ($a_id, $a_reference=false)
 lookup object type More...
 
static _isInTrash ($a_ref_id)
 checks wether object is in trash More...
 
static _hasUntrashedReference ($a_obj_id)
 checks wether an object has at least one reference that is not in trash More...
 
static _lookupObjectId ($a_ref_id)
 lookup object id More...
 
static _getObjectsDataForType ($a_type, $a_omit_trash=false)
 get all objects of a certain type More...
 
static _exists ($a_id, $a_reference=false, $a_type=null)
 checks if an object exists in object_data@access public More...
 
static _getObjectsByType ($a_obj_type="", $a_owner="")
 Get objects by type. More...
 
static _prepareCloneSelection ($a_ref_ids, $new_type, $show_path=true)
 Prepare copy wizard object selection. More...
 
static _getIcon ($a_obj_id="", $a_size="big", $a_type="", $a_offline=false)
 Get icon for repository item. More...
 
static collectDeletionDependencies (&$deps, $a_ref_id, $a_obj_id, $a_type, $a_depth=0)
 Collect deletion dependencies. More...
 
static getDeletionDependencies ($a_obj_id)
 Get deletion dependencies. More...
 
static getLongDescriptions (array $a_obj_ids)
 Get long description data. More...
 
static getAllOwnedRepositoryObjects ($a_user_id)
 Get all ids of objects user owns. More...
 
static fixMissingTitles ($a_type, array &$a_obj_title_map)
 Try to fix missing object titles. More...
 
static _lookupCreationDate ($a_id)
 Lookup creation date. More...
 
static hasAutoRating ($a_type, $a_ref_id)
 Check if auto rating is active for parent group/course. More...
 
- Static Public Member Functions inherited from ilContainer
static _getContainerDirectory ($a_id)
 Get the container directory. More...
 
static _lookupContainerSetting ($a_id, $a_keyword, $a_default_value=NULL)
 Lookup a container setting. More...
 
static _writeContainerSetting ($a_id, $a_keyword, $a_value)
 
static _getContainerSettings ($a_id)
 
static _deleteContainerSettings ($a_id, $a_keyword=null, $a_keyword_like=false)
 
static _exportContainerSettings (ilXmlWriter $a_xml, $a_obj_id)
 
static _lookupIconPath ($a_id, $a_size="big")
 lookup icon path More...
 
static getCompleteDescriptions (array $objects)
 overwrites description fields to long or short description in an assoc array keys needed (obj_id and description) More...
 
static lookupObjectsByCode ($a_code)
 Lookup all objects with reg_access_code enabled and. More...
 

Data Fields

const CAL_REG_START = 1
 
const CAL_REG_END = 2
 
const GRP_MEMBER = 1
 
const GRP_ADMIN = 2
 
const ERR_MISSING_TITLE = 'msg_no_title'
 
const ERR_MISSING_GROUP_TYPE = 'grp_missing_grp_type'
 
const ERR_MISSING_PASSWORD = 'grp_missing_password'
 
const ERR_WRONG_MAX_MEMBERS = 'grp_wrong_max_members'
 
const ERR_WRONG_REG_TIME_LIMIT = 'grp_wrong_reg_time_limit'
 
const ERR_MISSING_MIN_MAX_MEMBERS = 'grp_wrong_min_max_members'
 
const ERR_WRONG_MIN_MAX_MEMBERS = 'grp_max_and_min_members_invalid'
 
const ERR_WRONG_REGISTRATION_LIMITED = 'grp_err_registration_limited'
 
const MAIL_ALLOWED_ALL = 1
 
const MAIL_ALLOWED_TUTORS = 2
 
 $SHOW_MEMBERS_ENABLED = 1
 
 $SHOW_MEMBERS_DISABLED = 0
 
 $members_obj
 
 $file_obj = null
 Group file object for handling of export files. More...
 
 $m_grpStatus
 
 $m_roleMemberId
 
 $m_roleAdminId
 
- Data Fields inherited from ilObject
const TITLE_LENGTH = 255
 max length of object title More...
 
const DESC_LENGTH = 128
 
 $ilias
 
 $lng
 
 $id
 
 $ref_id
 
 $type
 
 $title
 
 $untranslatedTitle
 
 $desc
 
 $long_desc
 
 $owner
 
 $create_date
 
 $last_update
 
 $import_id
 
 $register = false
 
 $referenced
 
 $objectList
 
 $max_title
 
 $max_desc
 
 $add_dots
 
- Data Fields inherited from ilContainer
const VIEW_SESSIONS = 0
 
const VIEW_OBJECTIVE = 1
 
const VIEW_TIMING = 2
 
const VIEW_ARCHIVE = 3
 
const VIEW_SIMPLE = 4
 
const VIEW_BY_TYPE = 5
 
const VIEW_INHERIT = 6
 
const VIEW_DEFAULT = self::VIEW_BY_TYPE
 
const SORT_TITLE = 0
 
const SORT_MANUAL = 1
 
const SORT_ACTIVATION = 2
 
const SORT_INHERIT = 3
 
const SORT_CREATION = 4
 
const SORT_DIRECTION_ASC = 0
 
const SORT_DIRECTION_DESC = 1
 
const SORT_NEW_ITEMS_POSITION_TOP = 0
 
const SORT_NEW_ITEMS_POSITION_BOTTOM = 1
 
const SORT_NEW_ITEMS_ORDER_TITLE = 0
 
const SORT_NEW_ITEMS_ORDER_CREATION = 1
 
const SORT_NEW_ITEMS_ORDER_ACTIVATION = 2
 

Protected Member Functions

 prepareAppointments ($a_mode='create')
 Prepare calendar appointments. More...
 
 initParticipants ()
 init participants object More...
 

Protected Attributes

 $information
 
 $group_type = null
 
 $reg_type = GRP_REGISTRATION_DIRECT
 
 $reg_enabled = true
 
 $reg_unlimited = true
 
 $reg_start = null
 
 $reg_end = null
 
 $reg_password = ''
 
 $reg_membership_limitation = false
 
 $reg_min_members = 0
 
 $reg_max_members = 0
 
 $waiting_list = false
 
 $auto_fill_from_waiting
 
 $leave_end
 
 $show_members = 1
 
- Protected Attributes inherited from ilContainer
 $order_type = 0
 
 $hiddenfilesfound = false
 
 $news_timeline = false
 
 $news_timeline_auto_entries = false
 
 $setting
 

Private Attributes

 $latitude = ''
 
 $longitude = ''
 
 $locationzoom = 0
 
 $enablemap = 0
 
 $reg_access_code = ''
 
 $reg_access_code_enabled = false
 
 $view_mode = NULL
 
 $mail_members = self::MAIL_ALLOWED_ALL
 

Additional Inherited Members

- Static Public Attributes inherited from ilContainer
static $data_preloaded = false
 
- Static Protected Member Functions inherited from ilContainer
static fixInternalLinksAfterCopy ($a_target_id, $a_copy_id, $a_source_ref_id)
 Fix internal links after copy process. More...
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

ilObjGroup::__construct (   $a_id = 0,
  $a_call_by_reference = true 
)

Constructor @access public.

Parameters
integerreference_id or object_id
booleantreat the id as reference_id (true) or object_id (false)

Reimplemented from ilContainer.

Definition at line 107 of file class.ilObjGroup.php.

108 {
109 global $tree;
110
111 $this->tree =& $tree;
112
113 $this->type = "grp";
114 parent::__construct($a_id,$a_call_by_reference);
115 $this->setRegisterMode(true); // ???
116 }
setRegisterMode($a_bool)

References ilObject\setRegisterMode().

+ Here is the call graph for this function:

Member Function Documentation

◆ _getMembers()

ilObjGroup::_getMembers (   $a_obj_id)

Definition at line 1723 of file class.ilObjGroup.php.

1724 {
1725 global $rbacreview;
1726
1727 // get reference
1728 $ref_ids = ilObject::_getAllReferences($a_obj_id);
1729 $ref_id = current($ref_ids);
1730
1731 $local_roles = $rbacreview->getRolesOfRoleFolder($ref_id,false);
1732
1733 $users = array();
1734 foreach($local_roles as $role_id)
1735 {
1736 $users = array_merge($users,$rbacreview->assignedUsers($role_id));
1737 }
1738
1739 return array_unique($users);
1740 }
static _getAllReferences($a_id)
get all reference ids of object

References ilObject\$ref_id, and ilObject\_getAllReferences().

Referenced by _isMember().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ _isMember()

ilObjGroup::_isMember (   $a_user_id,
  $a_ref_id,
  $a_field = '' 
)

Definition at line 1674 of file class.ilObjGroup.php.

1675 {
1676 global $rbacreview,$ilObjDataCache,$ilDB;
1677
1678 $local_roles = $rbacreview->getRolesOfRoleFolder($a_ref_id,false);
1679 $user_roles = $rbacreview->assignedRoles($a_user_id);
1680
1681 // Used for membership limitations -> check membership by given field
1682 if($a_field)
1683 {
1684 include_once './Services/User/classes/class.ilObjUser.php';
1685
1686 $tmp_user =& ilObjectFactory::getInstanceByObjId($a_user_id);
1687 switch($a_field)
1688 {
1689 case 'login':
1690 $and = "AND login = '".$tmp_user->getLogin()."' ";
1691 break;
1692 case 'email':
1693 $and = "AND email = '".$tmp_user->getEmail()."' ";
1694 break;
1695 case 'matriculation':
1696 $and = "AND matriculation = '".$tmp_user->getMatriculation()."' ";
1697 break;
1698
1699 default:
1700 $and = "AND usr_id = '".$a_user_id."'";
1701 break;
1702 }
1703 if(!$members = ilObjGroup::_getMembers($ilObjDataCache->lookupObjId($a_ref_id)))
1704 {
1705 return false;
1706 }
1707 $query = "SELECT * FROM usr_data as ud ".
1708 "WHERE usr_id IN (".implode(",",ilUtil::quoteArray($members)).") ".
1709 $and;
1710 $res = $ilDB->query($query);
1711
1712 return $res->numRows() ? true : false;
1713 }
1714
1715 if (!array_intersect($local_roles,$user_roles))
1716 {
1717 return false;
1718 }
1719
1720 return true;
1721 }
_getMembers($a_obj_id)
static getInstanceByObjId($a_obj_id, $stop_on_error=true)
get an instance of an Ilias object by object id
static quoteArray($a_array)
Quotes all members of an array for usage in DB query statement.
global $ilDB

References $ilDB, $query, $res, _getMembers(), ilObjectFactory\getInstanceByObjId(), and ilUtil\quoteArray().

Referenced by ilObjCourseGrouping\_checkGroupingDependencies().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ _lookupIdByTitle()

static ilObjGroup::_lookupIdByTitle (   $a_title)
static

Definition at line 1659 of file class.ilObjGroup.php.

1660 {
1661 global $ilDB;
1662
1663 $query = "SELECT * FROM object_data WHERE title = ".
1664 $ilDB->quote($a_title ,'text')." AND type = 'grp'";
1665 $res = $ilDB->query($query);
1666 while($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT))
1667 {
1668 return $row->obj_id;
1669 }
1670 return 0;
1671 }

References $ilDB, $query, $res, $row, and ilDBConstants\FETCHMODE_OBJECT.

Referenced by ilMailGroupAddressType\resolve().

+ Here is the caller graph for this function:

◆ addAdditionalSubItemInformation()

ilObjGroup::addAdditionalSubItemInformation ( $a_item_data)

Add additional information to sub item, e.g.

used in courses for timings information etc.

Reimplemented from ilContainer.

Definition at line 1839 of file class.ilObjGroup.php.

1840 {
1841 include_once './Services/Object/classes/class.ilObjectActivation.php';
1843 }
static addAdditionalSubItemInformation(array &$a_item)
Parse item data for list entries.

References ilObjectActivation\addAdditionalSubItemInformation().

+ Here is the call graph for this function:

◆ addMember()

ilObjGroup::addMember (   $a_user_id,
  $a_mem_role 
)

add Member to Group @access public

Parameters
integeruser_id
integermember role_id of local group_role

Definition at line 988 of file class.ilObjGroup.php.

989 {
990 global $rbacadmin;
991
992 if (isset($a_user_id) && isset($a_mem_role) )
993 {
994 $this->join($a_user_id,$a_mem_role);
995 return true;
996 }
997 else
998 {
999 $this->ilias->raiseError(get_class($this)."::addMember(): Missing parameters !",$this->ilias->error_obj->WARNING);
1000 return false;
1001 }
1002 }
join($a_user_id, $a_mem_role="")
join Group, assigns user to role @access private
redirection script todo: (a better solution should control the processing via a xml file)

References join().

+ Here is the call graph for this function:

◆ appendMessage()

ilObjGroup::appendMessage (   $a_message)

Definition at line 1853 of file class.ilObjGroup.php.

1854 {
1855 if($this->getMessage())
1856 {
1857 $this->message .= "<br /> ";
1858 }
1859 $this->message .= $a_message;
1860 }

References getMessage().

+ Here is the call graph for this function:

◆ applyDidacticTemplate()

ilObjGroup::applyDidacticTemplate (   $a_tpl_id)

Apply template.

Parameters
int$a_tpl_id

Reimplemented from ilObject.

Definition at line 1646 of file class.ilObjGroup.php.

1647 {
1648 parent::applyDidacticTemplate($a_tpl_id);
1649
1650 if(!$a_tpl_id)
1651 {
1652 // init default type
1653 $this->setParentRolePermissions($this->getRefId());
1654 }
1655
1656 }
setParentRolePermissions($a_parent_ref)
This method is called before "initDefaultRoles".
getRefId()
get reference id @access public

References ilObject\getRefId(), and setParentRolePermissions().

+ Here is the call graph for this function:

◆ cloneAutoGeneratedRoles()

ilObjGroup::cloneAutoGeneratedRoles (   $new_obj)

Clone group admin and member role permissions.

@access public

Parameters
objectnew group object

Definition at line 912 of file class.ilObjGroup.php.

913 {
914 global $rbacadmin,$rbacreview;
915
916 $admin = $this->getDefaultAdminRole();
917 $new_admin = $new_obj->getDefaultAdminRole();
918 if(!$admin || !$new_admin || !$this->getRefId() || !$new_obj->getRefId())
919 {
920 ilLoggerFactory::getLogger('grp')->warning('Error cloning auto generated rol: il_grp_admin');
921 }
922 $rbacadmin->copyRolePermissions($admin,$this->getRefId(),$new_obj->getRefId(),$new_admin,true);
923 ilLoggerFactory::getLogger('grp')->info('Finished copying of role il_grp_admin.');
924
925 $member = $this->getDefaultMemberRole();
926 $new_member = $new_obj->getDefaultMemberRole();
927 if(!$member || !$new_member)
928 {
929 ilLoggerFactory::getLogger('grp')->warning('Error cloning auto generated rol: il_grp_member');
930 }
931 $rbacadmin->copyRolePermissions($member,$this->getRefId(),$new_obj->getRefId(),$new_member,true);
932 ilLoggerFactory::getLogger('grp')->info('Finished copying of role il_grp_member.');
933 }
static getLogger($a_component_id)
Get component logger.
getDefaultAdminRole()
returns object id of created default adminstrator role @access public
getDefaultMemberRole()
returns object id of created default member role @access public

References getDefaultAdminRole(), getDefaultMemberRole(), ilLoggerFactory\getLogger(), and ilObject\getRefId().

Referenced by cloneObject().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ cloneDependencies()

ilObjGroup::cloneDependencies (   $a_target_id,
  $a_copy_id 
)

Clone object dependencies (crs items, preconditions)

@access public

Parameters
inttarget ref id of new course
intcopy id

Reimplemented from ilContainer.

Definition at line 893 of file class.ilObjGroup.php.

894 {
895 global $tree;
896
897 parent::cloneDependencies($a_target_id,$a_copy_id);
898
899 include_once('Services/Object/classes/class.ilObjectActivation.php');
900 ilObjectActivation::cloneDependencies($this->getRefId(), $a_target_id, $a_copy_id);
901
902 return true;
903 }
static cloneDependencies($a_ref_id, $a_target_id, $a_copy_id)
Clone dependencies.

References ilObjectActivation\cloneDependencies(), and ilObject\getRefId().

+ Here is the call graph for this function:

◆ cloneObject()

ilObjGroup::cloneObject (   $a_target_id,
  $a_copy_id = 0,
  $a_omit_tree = false 
)

Clone group (no member data)

@access public

Parameters
inttarget ref_id
intcopy id

Reimplemented from ilContainer.

Definition at line 820 of file class.ilObjGroup.php.

821 {
822 global $ilDB,$ilUser, $ilSetting;
823
824 $new_obj = parent::cloneObject($a_target_id,$a_copy_id, $a_omit_tree);
825 $new_obj->setGroupType($this->getGroupType());
826 $new_obj->initGroupStatus($this->getGroupType() ? $this->getGroupType() : $this->readGroupStatus());
827
828 $this->cloneAutoGeneratedRoles($new_obj);
829
830 $new_obj->setRegistrationType($this->getRegistrationType());
831 $new_obj->setInformation($this->getInformation());
832 $new_obj->setRegistrationStart($this->getRegistrationStart());
833 $new_obj->setRegistrationEnd($this->getRegistrationEnd());
834 $new_obj->enableUnlimitedRegistration($this->isRegistrationUnlimited());
835 $new_obj->setPassword($this->getPassword());
836 $new_obj->enableMembershipLimitation($this->isMembershipLimited());
837 $new_obj->setMaxMembers($this->getMaxMembers());
838 $new_obj->enableWaitingList($this->isWaitingListEnabled());
839 $new_obj->setShowMembers($this->getShowMembers());
840
841 // map
842 $new_obj->setLatitude($this->getLatitude());
843 $new_obj->setLongitude($this->getLongitude());
844 $new_obj->setLocationZoom($this->getLocationZoom());
845 $new_obj->setEnableGroupMap($this->getEnableGroupMap());
846 $new_obj->enableRegistrationAccessCode($this->isRegistrationAccessCodeEnabled());
847 include_once './Services/Membership/classes/class.ilMembershipRegistrationCodeUtils.php';
848 $new_obj->setRegistrationAccessCode(ilMembershipRegistrationCodeUtils::generateCode());
849
850 $new_obj->setViewMode($this->getViewMode());
851 $new_obj->setMailToMembersType($this->getMailToMembersType());
852
853 $new_obj->setCancellationEnd($this->getCancellationEnd());
854 $new_obj->setMinMembers($this->getMinMembers());
855 $new_obj->setWaitingListAutoFill($this->hasWaitingListAutoFill());
856
857 $new_obj->update();
858
859 // #13008 - Group Defined Fields
860 include_once('Modules/Course/classes/Export/class.ilCourseDefinedFieldDefinition.php');
861 ilCourseDefinedFieldDefinition::_clone($this->getId(),$new_obj->getId());
862
863 ilLoggerFactory::getLogger('grp')->debug('Starting add user');
864
865 // Assign user as admin
866 include_once('./Modules/Group/classes/class.ilGroupParticipants.php');
867 $part = ilGroupParticipants::_getInstanceByObjId($new_obj->getId());
868 $part->add($ilUser->getId(),IL_GRP_ADMIN);
869 $part->updateNotification($ilUser->getId(),$ilSetting->get('mail_grp_admin_notification', true));
870
871 // Copy learning progress settings
872 include_once('Services/Tracking/classes/class.ilLPObjSettings.php');
873 $obj_settings = new ilLPObjSettings($this->getId());
874 $obj_settings->cloneSettings($new_obj->getId());
875 unset($obj_settings);
876
877 // clone icons
878 $new_obj->saveIcons($this->getBigIconPath(),
879 $this->getSmallIconPath(),
880 $this->getTinyIconPath());
881
882 return $new_obj;
883 }
const IL_GRP_ADMIN
getBigIconPath()
Get path for big icon.
getSmallIconPath()
Get path for small icon.
getViewMode()
Get container view mode.
getTinyIconPath()
Get path for tiny icon.
static _clone($a_source_id, $a_target_id)
Clone fields.
static _getInstanceByObjId($a_obj_id)
Get singleton instance.
static generateCode()
Generate new registration key.
getInformation()
get Information
getGroupType()
get group type
getLocationZoom()
Get LocationZoom.
getLongitude()
Get Longitude.
getPassword()
get password
getMinMembers()
get min members
getRegistrationStart()
get registration start
readGroupStatus()
get group status, redundant method because @access public
getRegistrationType()
get registration type
getMaxMembers()
get max members
isMembershipLimited()
is max member limited
cloneAutoGeneratedRoles($new_obj)
Clone group admin and member role permissions.
getRegistrationEnd()
get registration end
isRegistrationUnlimited()
is registration unlimited
isRegistrationAccessCodeEnabled()
Check if access code is enabled.
getLatitude()
Get Latitude.
getMailToMembersType()
Get mail to members type.
getEnableGroupMap()
Get Enable Group Map.
isWaitingListEnabled()
is waiting list enabled
getId()
get object id @access public
global $ilSetting
Definition: privfeed.php:17
$ilUser
Definition: imgupload.php:18

References $ilDB, $ilSetting, $ilUser, ilCourseDefinedFieldDefinition\_clone(), ilGroupParticipants\_getInstanceByObjId(), cloneAutoGeneratedRoles(), ilMembershipRegistrationCodeUtils\generateCode(), ilContainer\getBigIconPath(), getCancellationEnd(), getEnableGroupMap(), getGroupType(), ilObject\getId(), getInformation(), getLatitude(), getLocationZoom(), ilLoggerFactory\getLogger(), getLongitude(), getMailToMembersType(), getMaxMembers(), getMinMembers(), getPassword(), getRegistrationEnd(), getRegistrationStart(), getRegistrationType(), getShowMembers(), ilContainer\getSmallIconPath(), ilContainer\getTinyIconPath(), ilContainer\getViewMode(), hasWaitingListAutoFill(), IL_GRP_ADMIN, isMembershipLimited(), isRegistrationAccessCodeEnabled(), isRegistrationUnlimited(), isWaitingListEnabled(), and readGroupStatus().

+ Here is the call graph for this function:

◆ create()

ilObjGroup::create ( )

Create group.

Reimplemented from ilContainer.

Definition at line 634 of file class.ilObjGroup.php.

635 {
636 global $ilDB,$ilAppEventHandler;
637
638 if(!parent::create())
639 {
640 return false;
641 }
642
643 $query = "INSERT INTO grp_settings (obj_id,information,grp_type,registration_type,registration_enabled,".
644 "registration_unlimited,registration_start,registration_end,registration_password,registration_mem_limit,".
645 "registration_max_members,waiting_list,latitude,longitude,location_zoom,enablemap,reg_ac_enabled,reg_ac,view_mode,mail_members_type,".
646 "leave_end,registration_min_members,auto_wait) ".
647 "VALUES(".
648 $ilDB->quote($this->getId() ,'integer').", ".
649 $ilDB->quote($this->getInformation() ,'text').", ".
650 $ilDB->quote((int) $this->getGroupType() ,'integer').", ".
651 $ilDB->quote($this->getRegistrationType() ,'integer').", ".
652 $ilDB->quote(($this->isRegistrationEnabled() ? 1 : 0) ,'integer').", ".
653 $ilDB->quote(($this->isRegistrationUnlimited() ? 1 : 0) ,'integer').", ".
654 $ilDB->quote(($this->getRegistrationStart() && !$this->getRegistrationStart()->isNull()) ? $this->getRegistrationStart()->get(IL_CAL_DATETIME,'') : null,'timestamp').", ".
655 $ilDB->quote(($this->getRegistrationEnd() && !$this->getRegistrationEnd()->isNull()) ? $this->getRegistrationEnd()->get(IL_CAL_DATETIME,'') : null,'timestamp').", ".
656 $ilDB->quote($this->getPassword() ,'text').", ".
657 $ilDB->quote((int) $this->isMembershipLimited() ,'integer').", ".
658 $ilDB->quote($this->getMaxMembers() ,'integer').", ".
659 $ilDB->quote($this->isWaitingListEnabled() ? 1 : 0 ,'integer').", ".
660 $ilDB->quote($this->getLatitude() ,'text').", ".
661 $ilDB->quote($this->getLongitude() ,'text').", ".
662 $ilDB->quote($this->getLocationZoom() ,'integer').", ".
663 $ilDB->quote((int) $this->getEnableGroupMap() ,'integer').", ".
664 $ilDB->quote($this->isRegistrationAccessCodeEnabled(),'integer').', '.
665 $ilDB->quote($this->getRegistrationAccessCode(),'text').', '.
666 $ilDB->quote($this->getViewMode(),'integer').', '.
667 $ilDB->quote($this->getMailToMembersType(),'integer').', '.
668 $ilDB->quote(($this->getCancellationEnd() && !$this->getCancellationEnd()->isNull()) ? $this->getCancellationEnd()->get(IL_CAL_UNIX) : null, 'integer').', '.
669 $ilDB->quote($this->getMinMembers(),'integer').', '.
670 $ilDB->quote($this->hasWaitingListAutoFill(),'integer').' '.
671 ")";
672 $res = $ilDB->manipulate($query);
673
674 $ilAppEventHandler->raise('Modules/Group',
675 'create',
676 array('object' => $this,
677 'obj_id' => $this->getId(),
678 'appointments' => $this->prepareAppointments('create')));
679
680 return $this->getId();
681 }
const IL_CAL_UNIX
const IL_CAL_DATETIME
getRegistrationAccessCode()
get access code
isRegistrationEnabled()
is registration enabled
prepareAppointments($a_mode='create')
Prepare calendar appointments.

References $ilDB, $query, $res, getCancellationEnd(), getEnableGroupMap(), getGroupType(), ilObject\getId(), getInformation(), getLatitude(), getLocationZoom(), getLongitude(), getMailToMembersType(), getMaxMembers(), getMinMembers(), getPassword(), getRegistrationAccessCode(), getRegistrationEnd(), getRegistrationStart(), getRegistrationType(), ilContainer\getViewMode(), hasWaitingListAutoFill(), IL_CAL_DATETIME, IL_CAL_UNIX, isMembershipLimited(), isRegistrationAccessCodeEnabled(), isRegistrationEnabled(), isRegistrationUnlimited(), isWaitingListEnabled(), and prepareAppointments().

+ Here is the call graph for this function:

◆ delete()

ilObjGroup::delete ( )

delete group and all related data

@access public

Returns
boolean true if all object data were removed; false if only a references were removed

Reimplemented from ilObject.

Definition at line 739 of file class.ilObjGroup.php.

740 {
741 global $ilDB,$ilAppEventHandler;
742
743 // always call parent delete function first!!
744 if (!parent::delete())
745 {
746 return false;
747 }
748
749 $query = "DELETE FROM grp_settings ".
750 "WHERE obj_id = ".$ilDB->quote($this->getId() ,'integer');
751 $res = $ilDB->manipulate($query);
752
753 include_once('./Modules/Group/classes/class.ilGroupParticipants.php');
755
756 $ilAppEventHandler->raise('Modules/Group',
757 'delete',
758 array('object' => $this,
759 'obj_id' => $this->getId(),
760 'appointments' => $this->prepareAppointments('delete')));
761
762
763 return true;
764 }
static _deleteAllEntries($a_obj_id)
Delete all entries Normally called for course deletion.

References $ilDB, $query, $res, ilParticipants\_deleteAllEntries(), ilObject\getId(), and prepareAppointments().

+ Here is the call graph for this function:

◆ enableMembershipLimitation()

ilObjGroup::enableMembershipLimitation (   $a_status)

enable max member limitation

@access public

Parameters
boolstatus
Returns

Definition at line 317 of file class.ilObjGroup.php.

318 {
319 $this->reg_membership_limitation = $a_status;
320 }

Referenced by read().

+ Here is the caller graph for this function:

◆ enableRegistrationAccessCode()

ilObjGroup::enableRegistrationAccessCode (   $a_status)

En/disable registration access code.

Parameters
object$a_status
Returns

Definition at line 533 of file class.ilObjGroup.php.

534 {
535 $this->reg_access_code_enabled = $a_status;
536 }

Referenced by read().

+ Here is the caller graph for this function:

◆ enableUnlimitedRegistration()

ilObjGroup::enableUnlimitedRegistration (   $a_status)

enable unlimited registration

@access public

Parameters
bool
Returns

Definition at line 225 of file class.ilObjGroup.php.

226 {
227 $this->reg_unlimited = $a_status;
228 }

Referenced by read().

+ Here is the caller graph for this function:

◆ enableWaitingList()

ilObjGroup::enableWaitingList (   $a_status)

enable waiting list

@access public

Parameters
bool
Returns

Definition at line 384 of file class.ilObjGroup.php.

385 {
386 $this->waiting_list = $a_status;
387 }

Referenced by read().

+ Here is the caller graph for this function:

◆ findGroupsWithNotEnoughMembers()

static ilObjGroup::findGroupsWithNotEnoughMembers ( )
static

Minimum members check @global $ilDB $ilDB.

Returns
array

Definition at line 2104 of file class.ilObjGroup.php.

2105 {
2106 $ilDB = $GLOBALS['DIC']->database();
2107 $tree = $GLOBALS['DIC']->repositoryTree();
2108
2109 $res = array();
2110
2111 $now = date("Y-m-d H:i:s");
2112
2113 include_once "Modules/Group/classes/class.ilGroupParticipants.php";
2114
2115 $set = $ilDB->query("SELECT obj_id, registration_min_members".
2116 " FROM grp_settings".
2117 " WHERE registration_min_members > ".$ilDB->quote(0, "integer").
2118 " AND registration_mem_limit = ".$ilDB->quote(1, "integer"). // #17206
2119 " AND ((leave_end IS NOT NULL".
2120 " AND leave_end < ".$ilDB->quote($now, "text").")".
2121 " OR (leave_end IS NULL".
2122 " AND registration_end IS NOT NULL".
2123 " AND registration_end < ".$ilDB->quote($now, "text")."))"
2124 // :TODO: there is no group start ?!
2125 /* " AND (grp_start IS NULL OR grp_start > ".$ilDB->quote($now, "integer").")" */);
2126 while($row = $ilDB->fetchAssoc($set))
2127 {
2128 $refs = ilObject::_getAllReferences($row['obj_id']);
2129 $ref = end($refs);
2130
2131 if($tree->isDeleted($ref))
2132 {
2133 continue;
2134 }
2135
2136 $part = new ilGroupParticipants($row["obj_id"]);
2137 $reci = $part->getNotificationRecipients();
2138 if(sizeof($reci))
2139 {
2140 $missing = (int)$row["registration_min_members"]-$part->getCountMembers();
2141 if($missing > 0)
2142 {
2143 $res[$row["obj_id"]] = array($missing, $reci);
2144 }
2145 }
2146 }
2147
2148 return $res;
2149 }
date( 'd-M-Y', $objPHPExcel->getProperties() ->getCreated())
$GLOBALS['loaded']
Global hash that tracks already loaded includes.

References $GLOBALS, $ilDB, $res, $row, ilObject\_getAllReferences(), and date.

Referenced by ilMembershipCronMinMembers\getGroups().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getCancellationEnd()

ilObjGroup::getCancellationEnd ( )

Definition at line 562 of file class.ilObjGroup.php.

563 {
564 return $this->leave_end;
565 }

References $leave_end.

Referenced by cloneObject(), create(), and update().

+ Here is the caller graph for this function:

◆ getCountMembers()

ilObjGroup::getCountMembers ( )

Definition at line 1127 of file class.ilObjGroup.php.

1128 {
1129 return count($this->getGroupMemberIds());
1130 }
getGroupMemberIds()
get all group Member ids regardless of role @access public

References getGroupMemberIds().

+ Here is the call graph for this function:

◆ getDefaultAdminRole()

ilObjGroup::getDefaultAdminRole ( )

returns object id of created default adminstrator role @access public

Definition at line 975 of file class.ilObjGroup.php.

976 {
977 $local_group_Roles = $this->getLocalGroupRoles();
978
979 return $local_group_Roles["il_grp_admin_".$this->getRefId()];
980 }
getLocalGroupRoles($a_translate=false)
get ALL local roles of group, also those created and defined afterwards only fetch data once from dat...

References getLocalGroupRoles().

Referenced by cloneAutoGeneratedRoles().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getDefaultGroupRoles()

ilObjGroup::getDefaultGroupRoles (   $a_grp_id = "")

get default group roles, returns the defaultlike create roles il_grp_member, il_grp_admin @access public

Parameters
returnsthe obj_ids of group specific roles(il_grp_member,il_grp_admin)

Definition at line 1167 of file class.ilObjGroup.php.

1168 {
1169 global $rbacadmin, $rbacreview;
1170
1171 if (strlen($a_grp_id) > 0)
1172 {
1173 $grp_id = $a_grp_id;
1174 }
1175 else
1176 {
1177 $grp_id = $this->getRefId();
1178 }
1179
1180 $role_arr = $rbacreview->getRolesOfRoleFolder($grp_id);
1181
1182 foreach ($role_arr as $role_id)
1183 {
1184 $role_Obj =& $this->ilias->obj_factory->getInstanceByObjId($role_id);
1185
1186 $grp_Member ="il_grp_member_".$grp_id;
1187 $grp_Admin ="il_grp_admin_".$grp_id;
1188
1189 if (strcmp($role_Obj->getTitle(), $grp_Member) == 0 )
1190 {
1191 $arr_grpDefaultRoles["grp_member_role"] = $role_Obj->getId();
1192 }
1193
1194 if (strcmp($role_Obj->getTitle(), $grp_Admin) == 0)
1195 {
1196 $arr_grpDefaultRoles["grp_admin_role"] = $role_Obj->getId();
1197 }
1198 }
1199
1200 return $arr_grpDefaultRoles;
1201 }

References ilObject\getRefId().

Referenced by getGroupAdminIds(), isAdmin(), readGroupStatus(), and updateGroupType().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getDefaultMemberRole()

ilObjGroup::getDefaultMemberRole ( )

returns object id of created default member role @access public

Definition at line 964 of file class.ilObjGroup.php.

965 {
966 $local_group_Roles = $this->getLocalGroupRoles();
967
968 return $local_group_Roles["il_grp_member_".$this->getRefId()];
969 }

References getLocalGroupRoles().

Referenced by cloneAutoGeneratedRoles().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getEnableGroupMap()

ilObjGroup::getEnableGroupMap ( )

Get Enable Group Map.

Returns
boolean Enable Group Map

Definition at line 495 of file class.ilObjGroup.php.

496 {
497 return (bool) $this->enablemap;
498 }

References $enablemap.

Referenced by cloneObject(), create(), getEnableMap(), and update().

+ Here is the caller graph for this function:

◆ getEnableMap()

ilObjGroup::getEnableMap ( )

Type independent wrapper.

Returns
type

Definition at line 485 of file class.ilObjGroup.php.

486 {
487 return $this->getEnableGroupMap();
488 }

References getEnableGroupMap().

+ Here is the call graph for this function:

◆ getGroupAdminIds()

ilObjGroup::getGroupAdminIds (   $a_grpId = "")

get Group Admin Id @access public

Parameters
integergroup id
returnsuserids that are assigned to a group administrator! role

Definition at line 1138 of file class.ilObjGroup.php.

1139 {
1140 global $rbacreview;
1141
1142 if (!empty($a_grpId))
1143 {
1144 $grp_id = $a_grpId;
1145 }
1146 else
1147 {
1148 $grp_id = $this->getRefId();
1149 }
1150
1151 $usr_arr = array();
1152 $roles = $this->getDefaultGroupRoles($this->getRefId());
1153
1154 foreach ($rbacreview->assignedUsers($this->getDefaultAdminRole()) as $member_id)
1155 {
1156 array_push($usr_arr,$member_id);
1157 }
1158
1159 return $usr_arr;
1160 }
getDefaultGroupRoles($a_grp_id="")
get default group roles, returns the defaultlike create roles il_grp_member, il_grp_admin @access pub...

References getDefaultGroupRoles(), and ilObject\getRefId().

Referenced by leaveGroup().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getGroupMemberData()

ilObjGroup::getGroupMemberData (   $a_mem_ids,
  $active = 1 
)

get all group Members regardless of group role.

fetch all users data in one shot to improve performance @access public

Parameters
arrayof user ids
Returns
return array of userdata

Definition at line 1097 of file class.ilObjGroup.php.

1098 {
1099 global $rbacadmin, $rbacreview, $ilBench, $ilDB;
1100
1101 $usr_arr= array();
1102
1103 $q = "SELECT login,firstname,lastname,title,usr_id,last_login ".
1104 "FROM usr_data ".
1105 "WHERE usr_id IN (".implode(',',ilUtil::quoteArray($a_mem_ids)).") ";
1106
1107 if (is_numeric($active) && $active > -1)
1108 $q .= "AND active = '$active'";
1109
1110 $q .= 'ORDER BY lastname,firstname';
1111
1112 $r = $ilDB->query($q);
1113
1114 while($row = $r->fetchRow(ilDBConstants::FETCHMODE_OBJECT))
1115 {
1116 $mem_arr[] = array("id" => $row->usr_id,
1117 "login" => $row->login,
1118 "firstname" => $row->firstname,
1119 "lastname" => $row->lastname,
1120 "last_login" => $row->last_login
1121 );
1122 }
1123
1124 return $mem_arr ? $mem_arr : array();
1125 }
$r
Definition: example_031.php:79
global $ilBench
Definition: ilias.php:18

References $ilBench, $ilDB, $r, $row, ilDBConstants\FETCHMODE_OBJECT, and ilUtil\quoteArray().

+ Here is the call graph for this function:

◆ getGroupMemberIds()

ilObjGroup::getGroupMemberIds ( )

get all group Member ids regardless of role @access public

Returns
return array of users (obj_ids) that are assigned to the groupspecific roles (grp_member,grp_admin)

Definition at line 1069 of file class.ilObjGroup.php.

1070 {
1071 global $rbacadmin, $rbacreview;
1072
1073 $usr_arr= array();
1074
1075 $rol = $this->getLocalGroupRoles();
1076
1077 foreach ($rol as $value)
1078 {
1079 foreach ($rbacreview->assignedUsers($value) as $member_id)
1080 {
1081 array_push($usr_arr,$member_id);
1082 }
1083 }
1084
1085 $mem_arr = array_unique($usr_arr);
1086
1087 return $mem_arr ? $mem_arr : array();
1088 }

References getLocalGroupRoles().

Referenced by getCountMembers(), and leaveGroup().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getGroupStatus()

ilObjGroup::getGroupStatus ( )

get group status

@access public

Parameters
intgroup status

Definition at line 1495 of file class.ilObjGroup.php.

1496 {
1497 return $this->group_status;
1498 }

◆ getGroupType()

ilObjGroup::getGroupType ( )

get group type

@access public

Returns
int group type

Definition at line 179 of file class.ilObjGroup.php.

180 {
181 return $this->group_type;
182 }

References $group_type.

Referenced by cloneObject(), create(), update(), and updateGroupType().

+ Here is the caller graph for this function:

◆ getGrpStatusClosedTemplateId()

ilObjGroup::getGrpStatusClosedTemplateId ( )

get group status closed template @access public

Parameters
returnobj_id of roletemplate containing permissionsettings for a closed group

Definition at line 1246 of file class.ilObjGroup.php.

1247 {
1248 $q = "SELECT obj_id FROM object_data WHERE type='rolt' AND title='il_grp_status_closed'";
1249 $res = $this->ilias->db->query($q);
1251
1252 return $row["obj_id"];
1253 }

References $res, $row, and ilDBConstants\FETCHMODE_ASSOC.

Referenced by initGroupStatus(), and updateGroupType().

+ Here is the caller graph for this function:

◆ getGrpStatusOpenTemplateId()

ilObjGroup::getGrpStatusOpenTemplateId ( )

get group status open template @access public

Parameters
returnobj_id of roletemplate containing permissionsettings for an open group

Definition at line 1260 of file class.ilObjGroup.php.

1261 {
1262 $q = "SELECT obj_id FROM object_data WHERE type='rolt' AND title='il_grp_status_open'";
1263 $res = $this->ilias->db->query($q);
1265
1266 return $row["obj_id"];
1267 }

References $res, $row, and ilDBConstants\FETCHMODE_ASSOC.

Referenced by initGroupStatus(), setParentRolePermissions(), and updateGroupType().

+ Here is the caller graph for this function:

◆ getInformation()

ilObjGroup::getInformation ( )

get Information

@access public

Parameters

return string information

Definition at line 157 of file class.ilObjGroup.php.

158 {
159 return $this->information;
160 }

References $information.

Referenced by cloneObject(), create(), and update().

+ Here is the caller graph for this function:

◆ getLatitude()

ilObjGroup::getLatitude ( )

Get Latitude.

Returns
string Latitude

Definition at line 426 of file class.ilObjGroup.php.

427 {
428 return $this->latitude;
429 }

References $latitude.

Referenced by cloneObject(), create(), and update().

+ Here is the caller graph for this function:

◆ getLocalGroupRoles()

ilObjGroup::getLocalGroupRoles (   $a_translate = false)

get ALL local roles of group, also those created and defined afterwards only fetch data once from database.

info is stored in object variable @access public

Returns
return array [title|id] of roles...

Definition at line 1209 of file class.ilObjGroup.php.

1210 {
1211 global $rbacadmin,$rbacreview;
1212
1213 if (empty($this->local_roles))
1214 {
1215 $this->local_roles = array();
1216 $role_arr = $rbacreview->getRolesOfRoleFolder($this->getRefId());
1217
1218 foreach ($role_arr as $role_id)
1219 {
1220 if ($rbacreview->isAssignable($role_id,$this->getRefId()) == true)
1221 {
1222 $role_Obj =& $this->ilias->obj_factory->getInstanceByObjId($role_id);
1223
1224 if ($a_translate)
1225 {
1226 $role_name = ilObjRole::_getTranslation($role_Obj->getTitle());
1227 }
1228 else
1229 {
1230 $role_name = $role_Obj->getTitle();
1231 }
1232
1233 $this->local_roles[$role_name] = $role_Obj->getId();
1234 }
1235 }
1236 }
1237
1238 return $this->local_roles;
1239 }
static _getTranslation($a_role_title)

References ilObjRole\_getTranslation(), and ilObject\getRefId().

Referenced by getDefaultAdminRole(), getDefaultMemberRole(), and getGroupMemberIds().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getLocationZoom()

ilObjGroup::getLocationZoom ( )

Get LocationZoom.

Returns
int LocationZoom

Definition at line 466 of file class.ilObjGroup.php.

467 {
468 return $this->locationzoom;
469 }

References $locationzoom.

Referenced by cloneObject(), create(), and update().

+ Here is the caller graph for this function:

◆ getLongitude()

ilObjGroup::getLongitude ( )

Get Longitude.

Returns
string Longitude

Definition at line 446 of file class.ilObjGroup.php.

447 {
448 return $this->longitude;
449 }

References $longitude.

Referenced by cloneObject(), create(), and update().

+ Here is the caller graph for this function:

◆ getMailToMembersType()

ilObjGroup::getMailToMembersType ( )

Get mail to members type.

Returns
int

Definition at line 552 of file class.ilObjGroup.php.

553 {
554 return $this->mail_members;
555 }

References $mail_members.

Referenced by cloneObject(), create(), and update().

+ Here is the caller graph for this function:

◆ getMaxMembers()

ilObjGroup::getMaxMembers ( )

get max members

@access public

Returns

Definition at line 372 of file class.ilObjGroup.php.

373 {
375 }

References $reg_max_members.

Referenced by cloneObject(), create(), handleAutoFill(), register(), update(), and validate().

+ Here is the caller graph for this function:

◆ getMemberRoles()

ilObjGroup::getMemberRoles (   $a_user_id)

get group member status @access public

Parameters
integeruser_id
Returns
returns array of obj_ids of assigned local roles

Definition at line 1532 of file class.ilObjGroup.php.

1533 {
1534 global $rbacadmin, $rbacreview,$ilBench;
1535
1536 $ilBench->start("Group", "getMemberRoles");
1537
1538 $arr_assignedRoles = array();
1539
1540 $arr_assignedRoles = array_intersect($rbacreview->assignedRoles($a_user_id),$this->getLocalGroupRoles());
1541
1542 $ilBench->stop("Group", "getMemberRoles");
1543
1544 return $arr_assignedRoles;
1545 }

References $ilBench.

Referenced by leave().

+ Here is the caller graph for this function:

◆ getMembersObject()

ilObjGroup::getMembersObject ( )

Get members objects.

Returns
ilGroupParticipants

Definition at line 1923 of file class.ilObjGroup.php.

1924 {
1925 // #17886
1926 if(!$this->members_obj instanceof ilGroupParticipants)
1927 {
1928 $this->initParticipants();
1929 }
1930 return $this->members_obj;
1931 }
initParticipants()
init participants object

References $members_obj, and initParticipants().

Referenced by handleAutoFill().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getMessage()

ilObjGroup::getMessage ( )

Definition at line 1845 of file class.ilObjGroup.php.

1846 {
1847 return $this->message;
1848 }

Referenced by appendMessage().

+ Here is the caller graph for this function:

◆ getMinMembers()

ilObjGroup::getMinMembers ( )

get min members

@access public

Returns

Definition at line 350 of file class.ilObjGroup.php.

351 {
353 }

References $reg_min_members.

Referenced by cloneObject(), create(), update(), and validate().

+ Here is the caller graph for this function:

◆ getPassword()

ilObjGroup::getPassword ( )

get password

@access public

Returns
string password

Definition at line 305 of file class.ilObjGroup.php.

306 {
307 return $this->reg_password;
308 }

References $reg_password.

Referenced by cloneObject(), create(), update(), and validate().

+ Here is the caller graph for this function:

◆ getRegistrationAccessCode()

ilObjGroup::getRegistrationAccessCode ( )

get access code

Returns

Definition at line 504 of file class.ilObjGroup.php.

505 {
507 }

References $reg_access_code.

Referenced by create(), and update().

+ Here is the caller graph for this function:

◆ getRegistrationEnd()

ilObjGroup::getRegistrationEnd ( )

get registration end

@access public

Returns
int registration end

Definition at line 283 of file class.ilObjGroup.php.

284 {
285 return $this->reg_end;
286 }

References $reg_end.

Referenced by cloneObject(), create(), prepareAppointments(), register(), update(), and validate().

+ Here is the caller graph for this function:

◆ getRegistrationStart()

ilObjGroup::getRegistrationStart ( )

get registration start

@access public

Returns
int registration start

Definition at line 259 of file class.ilObjGroup.php.

260 {
261 return $this->reg_start;
262 }

References $reg_start.

Referenced by cloneObject(), create(), prepareAppointments(), register(), update(), and validate().

+ Here is the caller graph for this function:

◆ getRegistrationType()

ilObjGroup::getRegistrationType ( )

get registration type

@access public

Returns
int registration type

Definition at line 202 of file class.ilObjGroup.php.

203 {
204 return $this->reg_type;
205 }

References $reg_type.

Referenced by cloneObject(), create(), isRegistrationEnabled(), update(), and validate().

+ Here is the caller graph for this function:

◆ getShowMembers()

ilObjGroup::getShowMembers ( )

Definition at line 571 of file class.ilObjGroup.php.

572 {
573 return $this->show_members;
574 }

References $show_members.

Referenced by cloneObject(), and update().

+ Here is the caller graph for this function:

◆ getViewMode()

ilObjGroup::getViewMode (   $a_translate_inherit = true)

get view mode

@access public

Returns
int view mode

Definition at line 1748 of file class.ilObjGroup.php.

1749 {
1750 $view = (int) $this->view_mode;
1751
1752 if(!$view)
1753 {
1755 }
1756 return $view;
1757 }

References ilContainer\VIEW_DEFAULT.

◆ handleAutoFill()

ilObjGroup::handleAutoFill ( )

Definition at line 2035 of file class.ilObjGroup.php.

2036 {
2037 if($this->isWaitingListEnabled() &&
2038 $this->hasWaitingListAutoFill())
2039 {
2040 $max = $this->getMaxMembers();
2042 if($max > $now)
2043 {
2044 // see assignFromWaitingListObject()
2045 include_once('./Modules/Group/classes/class.ilGroupWaitingList.php');
2046 $waiting_list = new ilGroupWaitingList($this->getId());
2047
2048 foreach($waiting_list->getUserIds() as $user_id)
2049 {
2050 if(!$tmp_obj = ilObjectFactory::getInstanceByObjId($user_id,false))
2051 {
2052 continue;
2053 }
2054 if($this->getMembersObject()->isAssigned($user_id))
2055 {
2056 continue;
2057 }
2058 $this->getMembersObject()->add($user_id,IL_GRP_MEMBER); // #18213
2059 include_once './Modules/Group/classes/class.ilGroupMembershipMailNotification.php';
2061 $waiting_list->removeFromList($user_id);
2062
2063 $now++;
2064 if($now >= $max)
2065 {
2066 break;
2067 }
2068 }
2069 }
2070 }
2071 }
const IL_GRP_MEMBER
Waiting list for groups.
getMembersObject()
Get members objects.
static lookupNumberOfMembers($a_ref_id)
Lookup number of members @global ilRbacReview $rbacreview @global <type> $ilObjDataCache.

References $waiting_list, ilObject\getId(), ilObjectFactory\getInstanceByObjId(), getMaxMembers(), getMembersObject(), ilObject\getRefId(), hasWaitingListAutoFill(), IL_GRP_MEMBER, isWaitingListEnabled(), ilParticipants\lookupNumberOfMembers(), and ilGroupMembershipMailNotification\TYPE_ACCEPTED_SUBSCRIPTION_MEMBER.

+ Here is the call graph for this function:

◆ hasWaitingListAutoFill()

ilObjGroup::hasWaitingListAutoFill ( )

Definition at line 406 of file class.ilObjGroup.php.

407 {
409 }

References $auto_fill_from_waiting.

Referenced by cloneObject(), create(), handleAutoFill(), and update().

+ Here is the caller graph for this function:

◆ initDefaultRoles()

ilObjGroup::initDefaultRoles ( )

init default roles settings @access public

Returns
array object IDs of created local roles.

Reimplemented from ilObject.

Definition at line 1573 of file class.ilObjGroup.php.

1574 {
1575 include_once './Services/AccessControl/classes/class.ilObjRole.php';
1577 'il_grp_admin_'.$this->getRefId(),
1578 "Groupadmin group obj_no.".$this->getId(),
1579 'il_grp_admin',
1580 $this->getRefId()
1581 );
1582 $this->m_roleAdminId = $role->getId();
1583
1585 'il_grp_member_'.$this->getRefId(),
1586 "Groupmember of group obj_no.".$this->getId(),
1587 'il_grp_member',
1588 $this->getRefId()
1589 );
1590 $this->m_roleMemberId = $role->getId();
1591
1592 return array();
1593 }
static createDefaultRole($a_title, $a_description, $a_tpl_name, $a_ref_id)

References ilObjRole\createDefaultRole(), ilObject\getId(), and ilObject\getRefId().

+ Here is the call graph for this function:

◆ initGroupStatus()

ilObjGroup::initGroupStatus (   $a_grpStatus = GRP_TYPE_PUBLIC)

set group status

Grants permissions on the group object for all parent roles. Each permission is granted by computing the intersection of the role template il_grp_status_open/_closed and the permission template of the parent role.

Creates linked roles in the local role folder object for all parent roles and initializes their permission templates. Each permission template is initialized by computing the intersection of the role template il_grp_status_open/_closed and the permission template of the parent role.

@access public

Parameters
integergroup status GRP_TYPE_PUBLIC or GRP_TYPE_CLOSED

Definition at line 1400 of file class.ilObjGroup.php.

1401 {
1402 global $rbacadmin, $rbacreview, $rbacsystem;
1403
1404 //define all relevant roles that rights are needed to be changed
1405 $arr_parentRoles = $rbacreview->getParentRoleIds($this->getRefId());
1406
1407 $real_local_roles = $rbacreview->getRolesOfRoleFolder($this->getRefId(),false);
1408 $arr_relevantParentRoleIds = array_diff(array_keys($arr_parentRoles),$real_local_roles);
1409
1410 //group status open (aka public) or group status closed
1411 if ($a_grpStatus == GRP_TYPE_PUBLIC || $a_grpStatus == GRP_TYPE_CLOSED)
1412 {
1413 if ($a_grpStatus == GRP_TYPE_PUBLIC)
1414 {
1416 }
1417 else
1418 {
1420 }
1421 //get defined operations from template
1422 $template_ops = $rbacreview->getOperationsOfRole($template_id, 'grp', ROLE_FOLDER_ID);
1423
1424 foreach ($arr_relevantParentRoleIds as $parentRole)
1425 {
1426 if ($rbacreview->isProtected($arr_parentRoles[$parentRole]['parent'],$parentRole))
1427 {
1428 continue;
1429 }
1430
1431 $granted_permissions = array();
1432
1433 // Delete the linked role for the parent role
1434 // (just in case if it already exists).
1435
1436 // Added additional check, since this operation is very dangerous.
1437 // If there is no role folder ALL parent roles are deleted.
1438
1439 // @todo refactor rolf
1440 $rbacadmin->deleteLocalRole($parentRole,$this->getRefId());
1441
1442 // Grant permissions on the group object for
1443 // the parent role. In the foreach loop we
1444 // compute the intersection of the role
1445 // template il_grp_status_open/_closed and the
1446 // permission template of the parent role.
1447 $current_ops = $rbacreview->getRoleOperationsOnObject($parentRole, $this->getRefId());
1448 $rbacadmin->revokePermission($this->getRefId(), $parentRole);
1449 foreach ($template_ops as $template_op)
1450 {
1451 if (in_array($template_op,$current_ops))
1452 {
1453 array_push($granted_permissions,$template_op);
1454 }
1455 }
1456 if (!empty($granted_permissions))
1457 {
1458 $rbacadmin->grantPermission($parentRole, $granted_permissions, $this->getRefId());
1459 }
1460
1461 // Create a linked role for the parent role and
1462 // initialize it with the intersection of
1463 // il_grp_status_open/_closed and the permission
1464 // template of the parent role
1465
1466 $rbacadmin->copyRolePermissionIntersection(
1467 $template_id, ROLE_FOLDER_ID,
1468 $parentRole, $arr_parentRoles[$parentRole]['parent'],
1469 $this->getRefId(), $parentRole
1470 );
1471 $rbacadmin->assignRoleToFolder($parentRole,$this->getRefId(),"false");
1472 }//END foreach
1473 }
1474 }
const GRP_TYPE_CLOSED
const GRP_TYPE_PUBLIC
getGrpStatusClosedTemplateId()
get group status closed template @access public
getGrpStatusOpenTemplateId()
get group status open template @access public
$template_id
Definition: example_062.php:89

References $template_id, getGrpStatusClosedTemplateId(), getGrpStatusOpenTemplateId(), ilObject\getRefId(), GRP_TYPE_CLOSED, and GRP_TYPE_PUBLIC.

+ Here is the call graph for this function:

◆ initParticipants()

ilObjGroup::initParticipants ( )
protected

init participants object

@access protected

Returns

Definition at line 1912 of file class.ilObjGroup.php.

1913 {
1914 include_once('./Modules/Group/classes/class.ilGroupParticipants.php');
1915 $this->members_obj = ilGroupParticipants::_getInstanceByObjId($this->getId());
1916 }

References ilGroupParticipants\_getInstanceByObjId(), and ilObject\getId().

Referenced by getMembersObject(), and read().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ isAdmin()

ilObjGroup::isAdmin (   $a_userId)

is Admin @access public

Parameters
integeruser_id
boolean,trueif user is group administrator

Definition at line 1553 of file class.ilObjGroup.php.

1554 {
1555 global $rbacreview;
1556
1557 $grp_Roles = $this->getDefaultGroupRoles();
1558
1559 if (in_array($a_userId,$rbacreview->assignedUsers($grp_Roles["grp_admin_role"])))
1560 {
1561 return true;
1562 }
1563 else
1564 {
1565 return false;
1566 }
1567 }

References getDefaultGroupRoles().

Referenced by leaveGroup().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ isMembershipLimited()

ilObjGroup::isMembershipLimited ( )

is max member limited

@access public

Returns

Definition at line 328 of file class.ilObjGroup.php.

329 {
331 }

References $reg_membership_limitation.

Referenced by cloneObject(), create(), register(), update(), and validate().

+ Here is the caller graph for this function:

◆ isRegistrationAccessCodeEnabled()

ilObjGroup::isRegistrationAccessCodeEnabled ( )

Check if access code is enabled.

Returns

Definition at line 523 of file class.ilObjGroup.php.

524 {
525 return (bool) $this->reg_access_code_enabled;
526 }

References $reg_access_code_enabled.

Referenced by cloneObject(), create(), and update().

+ Here is the caller graph for this function:

◆ isRegistrationEnabled()

ilObjGroup::isRegistrationEnabled ( )

is registration enabled

@access public

Returns
bool

Definition at line 213 of file class.ilObjGroup.php.

214 {
216 }
const GRP_REGISTRATION_DEACTIVATED

References getRegistrationType(), and GRP_REGISTRATION_DEACTIVATED.

Referenced by create(), register(), and update().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ isRegistrationUnlimited()

ilObjGroup::isRegistrationUnlimited ( )

is registration unlimited

@access public

Returns
bool

Definition at line 236 of file class.ilObjGroup.php.

237 {
239 }

References $reg_unlimited.

Referenced by cloneObject(), create(), prepareAppointments(), register(), and update().

+ Here is the caller graph for this function:

◆ isWaitingListEnabled()

ilObjGroup::isWaitingListEnabled ( )

is waiting list enabled

@access public

Parameters

return bool

Definition at line 396 of file class.ilObjGroup.php.

397 {
398 return $this->waiting_list;
399 }

References $waiting_list.

Referenced by cloneObject(), create(), handleAutoFill(), register(), update(), and validate().

+ Here is the caller graph for this function:

◆ join()

ilObjGroup::join (   $a_user_id,
  $a_mem_role = "" 
)

join Group, assigns user to role @access private

Parameters
integermember status = obj_id of local_group_role

Definition at line 941 of file class.ilObjGroup.php.

942 {
943 global $rbacadmin;
944
945 if (is_array($a_mem_role))
946 {
947 foreach ($a_mem_role as $role)
948 {
949 $rbacadmin->assignUser($role,$a_user_id, false);
950 }
951 }
952 else
953 {
954 $rbacadmin->assignUser($a_mem_role,$a_user_id, false);
955 }
956
957 return true;
958 }

Referenced by addMember().

+ Here is the caller graph for this function:

◆ leave()

ilObjGroup::leave (   $a_user_id)

deassign member from group role @access private

Definition at line 1042 of file class.ilObjGroup.php.

1043 {
1044 global $rbacadmin;
1045
1046 $arr_groupRoles = $this->getMemberRoles($a_user_id);
1047
1048 if (is_array($arr_groupRoles))
1049 {
1050 foreach ($arr_groupRoles as $groupRole)
1051 {
1052 $rbacadmin->deassignUser($groupRole, $a_user_id);
1053 }
1054 }
1055 else
1056 {
1057 $rbacadmin->deassignUser($arr_groupRoles, $a_user_id);
1058 }
1059
1060 return true;
1061 }
getMemberRoles($a_user_id)
get group member status @access public

References getMemberRoles().

Referenced by leaveGroup().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ leaveGroup()

ilObjGroup::leaveGroup ( )

is called when a member decides to leave group @access public

Parameters
integeruser-Id
integergroup-Id

Definition at line 1011 of file class.ilObjGroup.php.

1012 {
1013 global $rbacadmin, $rbacreview;
1014
1015 $member_ids = $this->getGroupMemberIds();
1016
1017 if (count($member_ids) <= 1 || !in_array($this->ilias->account->getId(), $member_ids))
1018 {
1019 return 2;
1020 }
1021 else
1022 {
1023 if (!$this->isAdmin($this->ilias->account->getId()))
1024 {
1025 $this->leave($this->ilias->account->getId());
1026 $member = new ilObjUser($this->ilias->account->getId());
1027 $member->dropDesktopItem($this->getRefId(), "grp");
1028
1029 return 0;
1030 }
1031 else if (count($this->getGroupAdminIds()) == 1)
1032 {
1033 return 1;
1034 }
1035 }
1036 }
leave($a_user_id)
deassign member from group role @access private
isAdmin($a_userId)
is Admin @access public
getGroupAdminIds($a_grpId="")
get Group Admin Id @access public

References getGroupAdminIds(), getGroupMemberIds(), ilObject\getRefId(), isAdmin(), and leave().

+ Here is the call graph for this function:

◆ lookupGroupStatusTemplateId()

static ilObjGroup::lookupGroupStatusTemplateId (   $a_obj_id)
static

@global $ilDB $ilDB

Parameters
int$a_obj_id
Returns
int

Definition at line 1275 of file class.ilObjGroup.php.

1276 {
1277 global $ilDB;
1278
1279 $type = self::lookupGroupTye($a_obj_id);
1280 if($type == GRP_TYPE_CLOSED)
1281 {
1282 $query = 'SELECT obj_id FROM object_data WHERE type = '.$ilDB->quote('rolt','text').' AND title = '.$ilDB->quote('il_grp_status_closed','text');
1283 }
1284 else
1285 {
1286 $query = 'SELECT obj_id FROM object_data WHERE type = '.$ilDB->quote('rolt','text').' AND title = '.$ilDB->quote('il_grp_status_open','text');
1287 }
1288 $res = $ilDB->query($query);
1290
1291 return isset($row['obj_id']) ? $row['obj_id'] : 0;
1292 }
static lookupGroupTye($a_id)
Lookup group type.

References $ilDB, $query, $res, $row, ilObject\$type, ilDBConstants\FETCHMODE_ASSOC, GRP_TYPE_CLOSED, and lookupGroupTye().

Referenced by ilRbacAdmin\adjustMovedObjectPermissions().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ lookupGroupTye()

static ilObjGroup::lookupGroupTye (   $a_id)
static

Lookup group type.

Parameters
object$a_id
Returns

Definition at line 123 of file class.ilObjGroup.php.

124 {
125 global $ilDB;
126
127 $query = "SELECT grp_type FROM grp_settings ".
128 "WHERE obj_id = ".$ilDB->quote($a_id,'integer');
129 $res = $ilDB->query($query);
130 while($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT))
131 {
132 return $row->grp_type;
133 }
134 return GRP_TYPE_UNKNOWN;
135 }
const GRP_TYPE_UNKNOWN

References $ilDB, $query, $res, $row, ilDBConstants\FETCHMODE_OBJECT, and GRP_TYPE_UNKNOWN.

Referenced by ilObjRole\createPermissionIntersection(), and lookupGroupStatusTemplateId().

+ Here is the caller graph for this function:

◆ lookupObjectsByCode()

static ilObjGroup::lookupObjectsByCode (   $a_code)
static
See also
interface.ilMembershipRegistrationCodes
Returns
array obj ids

Implements ilMembershipRegistrationCodes.

Definition at line 1937 of file class.ilObjGroup.php.

1938 {
1939 global $ilDB;
1940
1941 $query = "SELECT obj_id FROM grp_settings ".
1942 "WHERE reg_ac_enabled = ".$ilDB->quote(1,'integer')." ".
1943 "AND reg_ac = ".$ilDB->quote($a_code,'text');
1944 $res = $ilDB->query($query);
1945
1946 $obj_ids = array();
1947 while($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT))
1948 {
1949 $obj_ids[] = $row->obj_id;
1950 }
1951 return $obj_ids;
1952 }

References $ilDB, $query, $res, $row, and ilDBConstants\FETCHMODE_OBJECT.

Referenced by ilMembershipRegistrationCodeUtils\lookupObjectsByCode().

+ Here is the caller graph for this function:

◆ lookupViewMode()

static ilObjGroup::lookupViewMode (   $a_obj_id)
static

lookup view mode @global $ilDB

Definition at line 1772 of file class.ilObjGroup.php.

1773 {
1774 global $ilDB;
1775
1776 $query = 'SELECT view_mode FROM grp_settings '.
1777 'WHERE obj_id = '.$ilDB->quote($a_obj_id,'integer');
1778 $res = $ilDB->query($query);
1779
1780 $view_mode = NULL;
1781 while($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT))
1782 {
1783 $view_mode = $row->view_mode;
1784 }
1785 return self::translateViewMode($a_obj_id,$view_mode);
1786 }
static translateViewMode($a_obj_id, $a_view_mode, $a_ref_id=null)
translate view mode

References $ilDB, $query, $res, $row, $view_mode, ilDBConstants\FETCHMODE_OBJECT, and translateViewMode().

+ Here is the call graph for this function:

◆ mayLeave()

static ilObjGroup::mayLeave (   $a_group_id,
  $a_user_id = null,
$a_date = null 
)
static

Definition at line 2073 of file class.ilObjGroup.php.

2074 {
2075 global $ilUser, $ilDB;
2076
2077 if(!$a_user_id)
2078 {
2079 $a_user_id = $ilUser->getId();
2080 }
2081
2082 $set = $ilDB->query("SELECT leave_end".
2083 " FROM grp_settings".
2084 " WHERE obj_id = ".$ilDB->quote($a_group_id, "integer"));
2085 $row = $ilDB->fetchAssoc($set);
2086 if($row && $row["leave_end"])
2087 {
2088 // timestamp to date
2089 $limit = date("Ymd", $row["leave_end"]);
2090 if($limit < date("Ymd"))
2091 {
2092 $a_date = new ilDate(date("Y-m-d", $row["leave_end"]), IL_CAL_DATE);
2093 return false;
2094 }
2095 }
2096 return true;
2097 }
const IL_CAL_DATE
Class for single dates.

References $ilDB, $ilUser, $row, date, and IL_CAL_DATE.

Referenced by ilObjGroupAccess\_checkAccess().

+ Here is the caller graph for this function:

◆ prepareAppointments()

ilObjGroup::prepareAppointments (   $a_mode = 'create')
protected

Prepare calendar appointments.

@access protected

Parameters
stringmode UPDATE|CREATE|DELETE
Returns

Definition at line 1869 of file class.ilObjGroup.php.

1870 {
1871 include_once('./Services/Calendar/classes/class.ilCalendarAppointmentTemplate.php');
1872
1873 switch($a_mode)
1874 {
1875 case 'create':
1876 case 'update':
1877 if($this->isRegistrationUnlimited())
1878 {
1879 return array();
1880 }
1881 $app = new ilCalendarAppointmentTemplate(self::CAL_REG_START);
1882 $app->setTitle($this->getTitle());
1883 $app->setSubtitle('grp_cal_reg_start');
1884 $app->setTranslationType(IL_CAL_TRANSLATION_SYSTEM);
1885 $app->setDescription($this->getLongDescription());
1886 $app->setStart($this->getRegistrationStart());
1887 $apps[] = $app;
1888
1889 $app = new ilCalendarAppointmentTemplate(self::CAL_REG_END);
1890 $app->setTitle($this->getTitle());
1891 $app->setSubtitle('grp_cal_reg_end');
1892 $app->setTranslationType(IL_CAL_TRANSLATION_SYSTEM);
1893 $app->setDescription($this->getLongDescription());
1894 $app->setStart($this->getRegistrationEnd());
1895 $apps[] = $app;
1896
1897 return $apps;
1898
1899 case 'delete':
1900 // Nothing to do: The category and all assigned appointments will be deleted.
1901 return array();
1902 }
1903 }
const IL_CAL_TRANSLATION_SYSTEM
Apointment templates are used for automatic generated apointments.
getLongDescription()
get object long description (stored in object_description)
getTitle()
get object title @access public

References ilObject\getLongDescription(), getRegistrationEnd(), getRegistrationStart(), ilObject\getTitle(), IL_CAL_TRANSLATION_SYSTEM, and isRegistrationUnlimited().

Referenced by create(), delete(), and update().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ read()

ilObjGroup::read ( )

Read group.

Reimplemented from ilContainer.

Definition at line 770 of file class.ilObjGroup.php.

771 {
772 global $ilDB;
773
774 parent::read();
775
776 $query = "SELECT * FROM grp_settings ".
777 "WHERE obj_id = ".$ilDB->quote($this->getId() ,'integer');
778
779 $res = $ilDB->query($query);
780 while($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT))
781 {
782 $this->setInformation($row->information);
783 $this->setGroupType($row->grp_type);
784 $this->setRegistrationType($row->registration_type);
785 $this->enableUnlimitedRegistration($row->registration_unlimited);
786 $this->setRegistrationStart(new ilDateTime($row->registration_start,IL_CAL_DATETIME));
787 $this->setRegistrationEnd(new ilDateTime($row->registration_end,IL_CAL_DATETIME));
788 $this->setPassword($row->registration_password);
789 $this->enableMembershipLimitation((bool) $row->registration_mem_limit);
790 $this->setMaxMembers($row->registration_max_members);
791 $this->enableWaitingList($row->waiting_list);
792 $this->setLatitude($row->latitude);
793 $this->setLongitude($row->longitude);
794 $this->setLocationZoom($row->location_zoom);
795 $this->setEnableGroupMap($row->enablemap);
796 $this->enableRegistrationAccessCode($row->reg_ac_enabled);
797 $this->setRegistrationAccessCode($row->reg_ac);
798 $this->setViewMode($row->view_mode);
799 $this->setMailToMembersType($row->mail_members_type);
800 $this->setCancellationEnd($row->leave_end ? new ilDate($row->leave_end, IL_CAL_UNIX) : null);
801 $this->setMinMembers($row->registration_min_members);
802 $this->setWaitingListAutoFill($row->auto_wait);
803 $this->setShowMembers($row->show_members);
804 }
805 $this->initParticipants();
806
807 // Inherit order type from parent course (if exists)
808 include_once('./Services/Container/classes/class.ilContainerSortingSettings.php');
810 }
static _lookupSortMode($a_obj_id)
lookup sort mode
setOrderType($a_value)
@classDescription Date and time handling
enableRegistrationAccessCode($a_status)
En/disable registration access code.
setPassword($a_pass)
set password
enableWaitingList($a_status)
enable waiting list
setRegistrationAccessCode($a_code)
Set refistration access code.
setRegistrationStart($a_start)
set registration start
setInformation($a_information)
set information
setMaxMembers($a_max)
set max members
setEnableGroupMap($a_enablemap)
Set Enable Group Map.
setCancellationEnd(ilDate $a_value=null)
setWaitingListAutoFill($a_value)
setLongitude($a_longitude)
Set Longitude.
setRegistrationEnd($a_end)
set registration end
setGroupType($a_type)
set group type
setMinMembers($a_max)
set min members
setMailToMembersType($a_type)
Set mail to members type.
setLatitude($a_latitude)
Set Latitude.
setLocationZoom($a_locationzoom)
Set LocationZoom.
setViewMode($a_view_mode)
Set group view mode.
setRegistrationType($a_type)
set registration type
enableMembershipLimitation($a_status)
enable max member limitation
setShowMembers($a_status)
enableUnlimitedRegistration($a_status)
enable unlimited registration

References $ilDB, $query, $res, $row, ilContainerSortingSettings\_lookupSortMode(), enableMembershipLimitation(), enableRegistrationAccessCode(), enableUnlimitedRegistration(), enableWaitingList(), ilDBConstants\FETCHMODE_OBJECT, ilObject\getId(), IL_CAL_DATETIME, IL_CAL_UNIX, initParticipants(), setCancellationEnd(), setEnableGroupMap(), setGroupType(), setInformation(), setLatitude(), setLocationZoom(), setLongitude(), setMailToMembersType(), setMaxMembers(), setMinMembers(), ilContainer\setOrderType(), setPassword(), setRegistrationAccessCode(), setRegistrationEnd(), setRegistrationStart(), setRegistrationType(), setShowMembers(), setViewMode(), and setWaitingListAutoFill().

+ Here is the call graph for this function:

◆ readGroupStatus()

ilObjGroup::readGroupStatus ( )

get group status, redundant method because @access public

Parameters
returngroup status[0=public|2=closed]

Definition at line 1505 of file class.ilObjGroup.php.

1506 {
1507 global $rbacsystem,$rbacreview;
1508
1509 $local_roles = $rbacreview->getRolesOfRoleFolder($this->getRefId());
1510
1511 //get all relevant roles
1512 $arr_globalRoles = array_diff($local_roles, $this->getDefaultGroupRoles());
1513
1514 //if one global role has no permission to join the group is officially closed !
1515 foreach ($arr_globalRoles as $globalRole)
1516 {
1517 if ($rbacsystem->checkPermission($this->getRefId(), $globalRole ,"join"))
1518 {
1519 return $this->group_status = GRP_TYPE_PUBLIC;
1520 }
1521 }
1522
1523 return $this->group_status = GRP_TYPE_CLOSED;
1524 }

References getDefaultGroupRoles(), ilObject\getRefId(), GRP_TYPE_CLOSED, and GRP_TYPE_PUBLIC.

Referenced by cloneObject().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ register()

ilObjGroup::register (   $a_user_id,
  $a_role = IL_GRP_MEMBER,
  $a_force_registration = false 
)
See also
ilMembershipRegistrationCodes::register()
Parameters
intuser_id
introle
boolforce registration and do not check registration constraints.

Definition at line 1960 of file class.ilObjGroup.php.

1961 {
1962 include_once './Services/Membership/exceptions/class.ilMembershipRegistrationException.php';
1963 include_once "./Modules/Group/classes/class.ilGroupParticipants.php";
1965
1966 if($part->isAssigned($a_user_id))
1967 {
1968 return true;
1969 }
1970
1971 if(!$a_force_registration)
1972 {
1973 // Availability
1974 if(!$this->isRegistrationEnabled())
1975 {
1976 include_once './Modules/Group/classes/class.ilObjGroupAccess.php';
1977
1979 {
1980 throw new ilMembershipRegistrationException('Cant registrate to group '.$this->getId().
1981 ', group subscription is deactivated.', ilMembershipRegistrationException::REGISTRATION_CODE_DISABLED);
1982 }
1983 }
1984
1985 // Time Limitation
1986 if(!$this->isRegistrationUnlimited())
1987 {
1988 $start = $this->getRegistrationStart();
1989 $end = $this->getRegistrationEnd();
1990 $time = new ilDateTime(time(),IL_CAL_UNIX);
1991
1992 if( !(ilDateTime::_after($time, $start) and ilDateTime::_before($time,$end)) )
1993 {
1994 throw new ilMembershipRegistrationException('Cant registrate to group '.$this->getId().
1995 ', group is out of registration time.', ilMembershipRegistrationException::OUT_OF_REGISTRATION_PERIOD);
1996 }
1997 }
1998
1999 // Max members
2000 if($this->isMembershipLimited())
2001 {
2002 $free = max(0,$this->getMaxMembers() - $part->getCountMembers());
2003 include_once('./Modules/Group/classes/class.ilGroupWaitingList.php');
2004 $waiting_list = new ilGroupWaitingList($this->getId());
2005 if($this->isWaitingListEnabled() and (!$free or $waiting_list->getCountUsers()))
2006 {
2007 $this->lng->loadLanguageModule("grp");
2008 $waiting_list->addToList($a_user_id);
2009
2010 $info = sprintf($this->lng->txt('grp_added_to_list'),
2011 $this->getTitle(),
2012 $waiting_list->getPosition($a_user_id));
2013
2014 include_once('./Modules/Group/classes/class.ilGroupParticipants.php');
2015 include_once('./Modules/Group/classes/class.ilGroupMembershipMailNotification.php');
2016 $participants = ilGroupParticipants::_getInstanceByObjId($this->getId());
2017 $participants->sendNotification(ilGroupMembershipMailNotification::TYPE_WAITING_LIST_MEMBER,$a_user_id);
2018
2020 }
2021
2022 if(!$free or $waiting_list->getCountUsers())
2023 {
2024 throw new ilMembershipRegistrationException('Cant registrate to group '.$this->getId().
2025 ', membership is limited.', ilMembershipRegistrationException::OBJECT_IS_FULL);
2026 }
2027 }
2028 }
2029
2030 $part->add($a_user_id,$a_role);
2031 $part->sendNotification($part->TYPE_NOTIFICATION_REGISTRATION, $a_user_id);
2032 return true;
2033 }
sprintf('%.4f', $callTime)
static _after(ilDateTime $start, ilDateTime $end, $a_compare_field='', $a_tz='')
compare two dates and check start is after end This method does not consider tz offsets.
static _before(ilDateTime $start, ilDateTime $end, $a_compare_field='', $a_tz='')
compare two dates and check start is before end This method does not consider tz offsets.
static _usingRegistrationCode()
Using Registration code.
$info
Definition: example_052.php:80

References $info, $start, $waiting_list, ilDateTime\_after(), ilDateTime\_before(), ilGroupParticipants\_getInstanceByObjId(), ilObjGroupAccess\_usingRegistrationCode(), ilMembershipRegistrationException\ADDED_TO_WAITINGLIST, ilObject\getId(), getMaxMembers(), getRegistrationEnd(), getRegistrationStart(), IL_CAL_UNIX, isMembershipLimited(), isRegistrationEnabled(), isRegistrationUnlimited(), isWaitingListEnabled(), ilMembershipRegistrationException\OBJECT_IS_FULL, ilMembershipRegistrationException\OUT_OF_REGISTRATION_PERIOD, ilMembershipRegistrationException\REGISTRATION_CODE_DISABLED, sprintf, and ilGroupMembershipMailNotification\TYPE_WAITING_LIST_MEMBER.

+ Here is the call graph for this function:

◆ setCancellationEnd()

ilObjGroup::setCancellationEnd ( ilDate  $a_value = null)

Definition at line 557 of file class.ilObjGroup.php.

558 {
559 $this->leave_end = $a_value;
560 }

Referenced by read().

+ Here is the caller graph for this function:

◆ setEnableGroupMap()

ilObjGroup::setEnableGroupMap (   $a_enablemap)

Set Enable Group Map.

Parameters
boolean$a_enablemapEnable Group Map

Definition at line 476 of file class.ilObjGroup.php.

477 {
478 $this->enablemap = $a_enablemap;
479 }

Referenced by read().

+ Here is the caller graph for this function:

◆ setGroupStatus()

ilObjGroup::setGroupStatus (   $a_status)

Set group status.

@access public

Parameters
intgroup status[0=public|2=closed]

Definition at line 1483 of file class.ilObjGroup.php.

1484 {
1485 $this->group_status = $a_status;
1486 }

◆ setGroupType()

ilObjGroup::setGroupType (   $a_type)

set group type

@access public

Parameters
inttype

Definition at line 168 of file class.ilObjGroup.php.

169 {
170 $this->group_type = $a_type;
171 }
$a_type
Definition: workflow.php:93

References $a_type.

Referenced by read().

+ Here is the caller graph for this function:

◆ setInformation()

ilObjGroup::setInformation (   $a_information)

set information

@access public

Parameters
stringinformation
Returns

Definition at line 145 of file class.ilObjGroup.php.

146 {
147 $this->information = $a_information;
148 }

Referenced by read().

+ Here is the caller graph for this function:

◆ setLatitude()

ilObjGroup::setLatitude (   $a_latitude)

Set Latitude.

Parameters
string$a_latitudeLatitude

Definition at line 416 of file class.ilObjGroup.php.

417 {
418 $this->latitude = $a_latitude;
419 }

Referenced by read().

+ Here is the caller graph for this function:

◆ setLocationZoom()

ilObjGroup::setLocationZoom (   $a_locationzoom)

Set LocationZoom.

Parameters
int$a_locationzoomLocationZoom

Definition at line 456 of file class.ilObjGroup.php.

457 {
458 $this->locationzoom = $a_locationzoom;
459 }

Referenced by read().

+ Here is the caller graph for this function:

◆ setLongitude()

ilObjGroup::setLongitude (   $a_longitude)

Set Longitude.

Parameters
string$a_longitudeLongitude

Definition at line 436 of file class.ilObjGroup.php.

437 {
438 $this->longitude = $a_longitude;
439 }

Referenced by read().

+ Here is the caller graph for this function:

◆ setMailToMembersType()

ilObjGroup::setMailToMembersType (   $a_type)

Set mail to members type.

See also
ilCourseConstants
Parameters
type$a_type

Definition at line 543 of file class.ilObjGroup.php.

544 {
545 $this->mail_members = $a_type;
546 }

References $a_type.

Referenced by read().

+ Here is the caller graph for this function:

◆ setMaxMembers()

ilObjGroup::setMaxMembers (   $a_max)

set max members

@access public

Parameters
intmax members

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

362 {
363 $this->reg_max_members = $a_max;
364 }

Referenced by read().

+ Here is the caller graph for this function:

◆ setMessage()

ilObjGroup::setMessage (   $a_message)

Definition at line 1849 of file class.ilObjGroup.php.

1850 {
1851 $this->message = $a_message;
1852 }

◆ setMinMembers()

ilObjGroup::setMinMembers (   $a_max)

set min members

@access public

Parameters
intmin members

Definition at line 339 of file class.ilObjGroup.php.

340 {
341 $this->reg_min_members = $a_max;
342 }

Referenced by read().

+ Here is the caller graph for this function:

◆ setParentRolePermissions()

ilObjGroup::setParentRolePermissions (   $a_parent_ref)

This method is called before "initDefaultRoles".

Therefore no local group roles are created.

Grants permissions on the group object for all parent roles. Each permission is granted by computing the intersection of the template il_grp_status and the permission template of the parent role.

Parameters
intparent ref id

Reimplemented from ilObject.

Definition at line 1604 of file class.ilObjGroup.php.

1605 {
1606 $rbacadmin = $GLOBALS['DIC']->rbac()->admin();
1607 $rbacreview = $GLOBALS['DIC']->rbac()->review();
1608
1609 $parent_roles = $rbacreview->getParentRoleIds($a_parent_ref);
1610 foreach((array) $parent_roles as $parent_role)
1611 {
1612 if($parent_role['parent'] == $this->getRefId())
1613 {
1614 continue;
1615 }
1616 if($rbacreview->isProtected($parent_role['parent'], $parent_role['rol_id']))
1617 {
1618 $operations = $rbacreview->getOperationsOfRole(
1619 $parent_role['obj_id'],
1620 $this->getType(),
1621 $parent_role['parent']
1622 );
1623 $rbacadmin->grantPermission(
1624 $parent_role['obj_id'],
1625 $operations,
1626 $this->getRefId()
1627 );
1628 continue;
1629 }
1630
1631 $rbacadmin->initIntersectionPermissions(
1632 $this->getRefId(),
1633 $parent_role['obj_id'],
1634 $parent_role['parent'],
1636 ROLE_FOLDER_ID
1637 );
1638 }
1639 }
getType()
get object type @access public

References $GLOBALS, getGrpStatusOpenTemplateId(), ilObject\getRefId(), and ilObject\getType().

Referenced by applyDidacticTemplate().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setPassword()

ilObjGroup::setPassword (   $a_pass)

set password

@access public

Parameters
stringpassword

Definition at line 294 of file class.ilObjGroup.php.

295 {
296 $this->reg_password = $a_pass;
297 }

Referenced by read().

+ Here is the caller graph for this function:

◆ setRegistrationAccessCode()

ilObjGroup::setRegistrationAccessCode (   $a_code)

Set refistration access code.

Parameters
string$a_code
Returns

Definition at line 514 of file class.ilObjGroup.php.

515 {
516 $this->reg_access_code = $a_code;
517 }

Referenced by read().

+ Here is the caller graph for this function:

◆ setRegistrationEnd()

ilObjGroup::setRegistrationEnd (   $a_end)

set registration end

@access public

Parameters
intunix time
Returns

Definition at line 272 of file class.ilObjGroup.php.

273 {
274 $this->reg_end = $a_end;
275 }

Referenced by read().

+ Here is the caller graph for this function:

◆ setRegistrationStart()

ilObjGroup::setRegistrationStart (   $a_start)

set registration start

@access public

Parameters
objectilDateTime
Returns

Definition at line 248 of file class.ilObjGroup.php.

249 {
250 $this->reg_start = $a_start;
251 }

Referenced by read().

+ Here is the caller graph for this function:

◆ setRegistrationType()

ilObjGroup::setRegistrationType (   $a_type)

set registration type

@access public

Parameters
intregistration type
Returns

Definition at line 191 of file class.ilObjGroup.php.

192 {
193 $this->reg_type = $a_type;
194 }

References $a_type.

Referenced by read().

+ Here is the caller graph for this function:

◆ setShowMembers()

ilObjGroup::setShowMembers (   $a_status)

Definition at line 567 of file class.ilObjGroup.php.

568 {
569 $this->show_members = $a_status;
570 }

Referenced by read().

+ Here is the caller graph for this function:

◆ setViewMode()

ilObjGroup::setViewMode (   $a_view_mode)

Set group view mode.

Parameters
int$a_view_mode

Definition at line 1763 of file class.ilObjGroup.php.

1764 {
1765 $this->view_mode = $a_view_mode;
1766 }

Referenced by read().

+ Here is the caller graph for this function:

◆ setWaitingListAutoFill()

ilObjGroup::setWaitingListAutoFill (   $a_value)

Definition at line 401 of file class.ilObjGroup.php.

402 {
403 $this->auto_fill_from_waiting = (bool)$a_value;
404 }

Referenced by read().

+ Here is the caller graph for this function:

◆ translateViewMode()

static ilObjGroup::translateViewMode (   $a_obj_id,
  $a_view_mode,
  $a_ref_id = null 
)
static

translate view mode

Parameters
int$a_obj_id
int$a_view_mode
int$a_ref_id
Returns
int

Definition at line 1795 of file class.ilObjGroup.php.

1796 {
1797 global $tree;
1798
1799 if(!$a_view_mode)
1800 {
1801 $a_view_mode = ilContainer::VIEW_DEFAULT;
1802 }
1803
1804 // view mode is inherit => check for parent course
1805 if($a_view_mode == ilContainer::VIEW_INHERIT)
1806 {
1807 if(!$a_ref_id)
1808 {
1809 $ref = ilObject::_getAllReferences($a_obj_id);
1810 $a_ref_id = end($ref);
1811 }
1812
1813 $crs_ref = $tree->checkForParentType($a_ref_id, 'crs');
1814 if(!$crs_ref)
1815 {
1817 }
1818
1819 include_once './Modules/Course/classes/class.ilObjCourse.php';
1821
1822 // validate course view mode
1823 if(!in_array($view_mode, array(ilContainer::VIEW_SESSIONS,
1825 {
1827 }
1828
1829 return $view_mode;
1830 }
1831
1832 return $a_view_mode;
1833 }
static _lookupViewMode($a_id)
lookup view mode of container
static _lookupObjId($a_id)

References $view_mode, ilObject\_getAllReferences(), ilObject\_lookupObjId(), ilObjCourse\_lookupViewMode(), ilContainer\VIEW_BY_TYPE, ilContainer\VIEW_DEFAULT, ilContainer\VIEW_INHERIT, ilContainer\VIEW_SESSIONS, and ilContainer\VIEW_SIMPLE.

Referenced by ilObjGroupGUI\initForm(), and lookupViewMode().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ update()

ilObjGroup::update ( )

Update group.

Reimplemented from ilContainer.

Definition at line 686 of file class.ilObjGroup.php.

687 {
688 global $ilDB,$ilAppEventHandler;
689
690 if (!parent::update())
691 {
692 return false;
693 }
694
695 $query = "UPDATE grp_settings ".
696 "SET information = ".$ilDB->quote($this->getInformation() ,'text').", ".
697 "grp_type = ".$ilDB->quote((int) $this->getGroupType() ,'integer').", ".
698 "registration_type = ".$ilDB->quote($this->getRegistrationType() ,'integer').", ".
699 "registration_enabled = ".$ilDB->quote($this->isRegistrationEnabled() ? 1 : 0 ,'integer').", ".
700 "registration_unlimited = ".$ilDB->quote($this->isRegistrationUnlimited() ? 1 : 0 ,'integer').", ".
701 "registration_start = ".$ilDB->quote(($this->getRegistrationStart() && !$this->getRegistrationStart()->isNull()) ? $this->getRegistrationStart()->get(IL_CAL_DATETIME,'') : null,'timestamp').", ".
702 "registration_end = ".$ilDB->quote(($this->getRegistrationEnd() && !$this->getRegistrationEnd()->isNull()) ? $this->getRegistrationEnd()->get(IL_CAL_DATETIME,'') : null,'timestamp').", ".
703 "registration_password = ".$ilDB->quote($this->getPassword() ,'text').", ".
704// "registration_membership_limited = ".$ilDB->quote((int) $this->isMembershipLimited() ,'integer').", ".
705 "registration_mem_limit = ".$ilDB->quote((int) $this->isMembershipLimited() ,'integer').", ".
706 "registration_max_members = ".$ilDB->quote($this->getMaxMembers() ,'integer').", ".
707 "waiting_list = ".$ilDB->quote($this->isWaitingListEnabled() ? 1 : 0 ,'integer').", ".
708 "latitude = ".$ilDB->quote($this->getLatitude() ,'text').", ".
709 "longitude = ".$ilDB->quote($this->getLongitude() ,'text').", ".
710 "location_zoom = ".$ilDB->quote($this->getLocationZoom() ,'integer').", ".
711 "enablemap = ".$ilDB->quote((int) $this->getEnableGroupMap() ,'integer').", ".
712 'reg_ac_enabled = '.$ilDB->quote($this->isRegistrationAccessCodeEnabled(),'integer').', '.
713 'reg_ac = '.$ilDB->quote($this->getRegistrationAccessCode(),'text').', '.
714 'view_mode = '.$ilDB->quote($this->getViewMode(),'integer').', '.
715 'mail_members_type = '.$ilDB->quote($this->getMailToMembersType(),'integer').', '.
716 'leave_end = '.$ilDB->quote(($this->getCancellationEnd() && !$this->getCancellationEnd()->isNull()) ? $this->getCancellationEnd()->get(IL_CAL_UNIX) : null, 'integer').', '.
717 "registration_min_members = ".$ilDB->quote($this->getMinMembers() ,'integer').", ".
718 "auto_wait = ".$ilDB->quote($this->hasWaitingListAutoFill() ,'integer').", ".
719 "show_members = ".$ilDB->quote((int) $this->getShowMembers() ,'integer')." ".
720 "WHERE obj_id = ".$ilDB->quote($this->getId() ,'integer');
721 $res = $ilDB->manipulate($query);
722
723 $ilAppEventHandler->raise('Modules/Group',
724 'update',
725 array('object' => $this,
726 'obj_id' => $this->getId(),
727 'appointments' => $this->prepareAppointments('update')));
728
729
730 return true;
731 }

References $ilDB, $query, $res, getCancellationEnd(), getEnableGroupMap(), getGroupType(), ilObject\getId(), getInformation(), getLatitude(), getLocationZoom(), getLongitude(), getMailToMembersType(), getMaxMembers(), getMinMembers(), getPassword(), getRegistrationAccessCode(), getRegistrationEnd(), getRegistrationStart(), getRegistrationType(), getShowMembers(), ilContainer\getViewMode(), hasWaitingListAutoFill(), IL_CAL_DATETIME, IL_CAL_UNIX, isMembershipLimited(), isRegistrationAccessCodeEnabled(), isRegistrationEnabled(), isRegistrationUnlimited(), isWaitingListEnabled(), and prepareAppointments().

+ Here is the call graph for this function:

◆ updateGroupType()

ilObjGroup::updateGroupType ( )

Change group type.

Revokes permissions of all parent non-protected roles and initiates these roles with the according il_grp_(open|closed) template.

@access public

Returns

Definition at line 1305 of file class.ilObjGroup.php.

1306 {
1307 global $tree,$rbacreview,$rbacadmin;
1308
1309 $parent_roles = $rbacreview->getParentRoleIds($this->getRefId());
1310 $real_parent_roles = array_diff(array_keys($parent_roles),$this->getDefaultGroupRoles());
1311
1312 // Delete parent roles with stopped inheritance
1313 foreach($real_parent_roles as $role_id)
1314 {
1315 // Delete local role
1316 $rbacadmin->deleteLocalRole($role_id,$this->getRefId());
1317 }
1318 $parent_roles = $rbacreview->getParentRoleIds($this->getRefId());
1319 $real_parent_roles = array_diff(array_keys($parent_roles),$this->getDefaultGroupRoles());
1320
1321 switch($this->getGroupType())
1322 {
1323 case GRP_TYPE_PUBLIC:
1325 break;
1326
1327 case GRP_TYPE_CLOSED:
1329 break;
1330 }
1331
1332 $first = true;
1333 foreach($tree->getFilteredSubTree($this->getRefId(),array('grp')) as $subnode)
1334 {
1335 // Read template operations
1336 $template_ops = $rbacreview->getOperationsOfRole($template_id,$subnode['type'], ROLE_FOLDER_ID);
1337
1338 // for all parent roles
1339 foreach($real_parent_roles as $role_id)
1340 {
1341 if($rbacreview->isProtected($parent_roles[$role_id]['parent'],$role_id))
1342 {
1343 continue;
1344 }
1345
1346 $rbacadmin->deleteLocalRole($role_id,$subnode['child']);
1347
1348 // Store current operations
1349 $current_ops = $rbacreview->getOperationsOfRole($role_id,$subnode['type'],$parent_roles[$role_id]['parent']);
1350
1351 // Revoke permissions
1352 $rbacadmin->revokePermission($subnode['child'],$role_id);
1353
1354 // Grant permissions
1355 $granted = array();
1356 foreach($template_ops as $operation)
1357 {
1358 if(in_array($operation,$current_ops))
1359 {
1360 $granted[] = $operation;
1361 }
1362 }
1363 if($granted)
1364 {
1365 $rbacadmin->grantPermission($role_id, $granted,$subnode['child']);
1366 }
1367
1368 if($first)
1369 {
1370 // This is the group itself
1371 $rbacadmin->copyRolePermissionIntersection(
1372 $template_id, ROLE_FOLDER_ID,
1373 $role_id, $parent_roles[$role_id]['parent'],
1374 $subnode["child"],$role_id);
1375 $rbacadmin->assignRoleToFolder($role_id,$subnode['child'],"n");
1376
1377 }
1378 }
1379 $first = false;
1380 }
1381 }

References $template_id, getDefaultGroupRoles(), getGroupType(), getGrpStatusClosedTemplateId(), getGrpStatusOpenTemplateId(), ilObject\getRefId(), GRP_TYPE_CLOSED, and GRP_TYPE_PUBLIC.

+ Here is the call graph for this function:

◆ validate()

ilObjGroup::validate ( )

validate group settings

@access public

Returns
bool

Definition at line 582 of file class.ilObjGroup.php.

583 {
584 global $ilErr;
585
586 if(!$this->getTitle())
587 {
588 $this->title = '';
589 $ilErr->appendMessage($this->lng->txt(self::ERR_MISSING_TITLE));
590 }
591 if($this->getRegistrationType() == GRP_REGISTRATION_PASSWORD and !strlen($this->getPassword()))
592 {
593 $ilErr->appendMessage($this->lng->txt(self::ERR_MISSING_PASSWORD));
594 }
595 /*
596 if(ilDateTime::_before($this->getRegistrationEnd(),$this->getRegistrationStart()))
597 {
598 $ilErr->appendMessage($this->lng->txt(self::ERR_WRONG_REG_TIME_LIMIT));
599 }
600 */
601 if($this->isMembershipLimited())
602 {
603 if($this->getMinMembers() <= 0 && $this->getMaxMembers() <= 0)
604 {
605 $ilErr->appendMessage($this->lng->txt(self::ERR_MISSING_MIN_MAX_MEMBERS));
606 }
607 if($this->getMaxMembers() <= 0 && $this->isWaitingListEnabled())
608 {
609 $ilErr->appendMessage($this->lng->txt(self::ERR_WRONG_MAX_MEMBERS));
610 }
611 if($this->getMaxMembers() > 0 && $this->getMinMembers() > $this->getMaxMembers())
612 {
613 $ilErr->appendMessage($this->lng->txt(self::ERR_WRONG_MIN_MAX_MEMBERS));
614 }
615 }
616 if(
617 ($this->getRegistrationStart() && !$this->getRegistrationEnd()) ||
618 (!$this->getRegistrationStart() && $this->getRegistrationEnd()) ||
619 $this->getRegistrationEnd() <= $this->getRegistrationStart()
620 )
621 {
622 $ilErr->appendMessage($this->lng->txt((self::ERR_WRONG_REGISTRATION_LIMITED)));
623 }
624
625 return strlen($ilErr->getMessage()) == 0;
626 }
const GRP_REGISTRATION_PASSWORD
global $ilErr
Definition: raiseError.php:16

References $ilErr, getMaxMembers(), getMinMembers(), getPassword(), getRegistrationEnd(), getRegistrationStart(), getRegistrationType(), ilObject\getTitle(), GRP_REGISTRATION_PASSWORD, isMembershipLimited(), and isWaitingListEnabled().

+ Here is the call graph for this function:

Field Documentation

◆ $auto_fill_from_waiting

ilObjGroup::$auto_fill_from_waiting
protected

Definition at line 68 of file class.ilObjGroup.php.

Referenced by hasWaitingListAutoFill().

◆ $enablemap

ilObjGroup::$enablemap = 0
private

Definition at line 77 of file class.ilObjGroup.php.

Referenced by getEnableGroupMap().

◆ $file_obj

ilObjGroup::$file_obj = null

Group file object for handling of export files.

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

◆ $group_type

ilObjGroup::$group_type = null
protected

Definition at line 57 of file class.ilObjGroup.php.

Referenced by getGroupType().

◆ $information

ilObjGroup::$information
protected

Definition at line 56 of file class.ilObjGroup.php.

Referenced by getInformation().

◆ $latitude

ilObjGroup::$latitude = ''
private

Definition at line 74 of file class.ilObjGroup.php.

Referenced by getLatitude().

◆ $leave_end

ilObjGroup::$leave_end
protected

Definition at line 69 of file class.ilObjGroup.php.

Referenced by getCancellationEnd().

◆ $locationzoom

ilObjGroup::$locationzoom = 0
private

Definition at line 76 of file class.ilObjGroup.php.

Referenced by getLocationZoom().

◆ $longitude

ilObjGroup::$longitude = ''
private

Definition at line 75 of file class.ilObjGroup.php.

Referenced by getLongitude().

◆ $m_grpStatus

ilObjGroup::$m_grpStatus

Definition at line 95 of file class.ilObjGroup.php.

◆ $m_roleAdminId

ilObjGroup::$m_roleAdminId

Definition at line 99 of file class.ilObjGroup.php.

◆ $m_roleMemberId

ilObjGroup::$m_roleMemberId

Definition at line 97 of file class.ilObjGroup.php.

◆ $mail_members

ilObjGroup::$mail_members = self::MAIL_ALLOWED_ALL
private

Definition at line 84 of file class.ilObjGroup.php.

Referenced by getMailToMembersType().

◆ $members_obj

ilObjGroup::$members_obj

Definition at line 87 of file class.ilObjGroup.php.

Referenced by getMembersObject().

◆ $reg_access_code

ilObjGroup::$reg_access_code = ''
private

Definition at line 79 of file class.ilObjGroup.php.

Referenced by getRegistrationAccessCode().

◆ $reg_access_code_enabled

ilObjGroup::$reg_access_code_enabled = false
private

Definition at line 80 of file class.ilObjGroup.php.

Referenced by isRegistrationAccessCodeEnabled().

◆ $reg_enabled

ilObjGroup::$reg_enabled = true
protected

Definition at line 59 of file class.ilObjGroup.php.

◆ $reg_end

ilObjGroup::$reg_end = null
protected

Definition at line 62 of file class.ilObjGroup.php.

Referenced by getRegistrationEnd().

◆ $reg_max_members

ilObjGroup::$reg_max_members = 0
protected

Definition at line 66 of file class.ilObjGroup.php.

Referenced by getMaxMembers().

◆ $reg_membership_limitation

ilObjGroup::$reg_membership_limitation = false
protected

Definition at line 64 of file class.ilObjGroup.php.

Referenced by isMembershipLimited().

◆ $reg_min_members

ilObjGroup::$reg_min_members = 0
protected

Definition at line 65 of file class.ilObjGroup.php.

Referenced by getMinMembers().

◆ $reg_password

ilObjGroup::$reg_password = ''
protected

Definition at line 63 of file class.ilObjGroup.php.

Referenced by getPassword().

◆ $reg_start

ilObjGroup::$reg_start = null
protected

Definition at line 61 of file class.ilObjGroup.php.

Referenced by getRegistrationStart().

◆ $reg_type

ilObjGroup::$reg_type = GRP_REGISTRATION_DIRECT
protected

Definition at line 58 of file class.ilObjGroup.php.

Referenced by getRegistrationType().

◆ $reg_unlimited

ilObjGroup::$reg_unlimited = true
protected

Definition at line 60 of file class.ilObjGroup.php.

Referenced by isRegistrationUnlimited().

◆ $show_members

ilObjGroup::$show_members = 1
protected

Definition at line 70 of file class.ilObjGroup.php.

Referenced by getShowMembers().

◆ $SHOW_MEMBERS_DISABLED

ilObjGroup::$SHOW_MEMBERS_DISABLED = 0

Definition at line 54 of file class.ilObjGroup.php.

◆ $SHOW_MEMBERS_ENABLED

ilObjGroup::$SHOW_MEMBERS_ENABLED = 1

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

◆ $view_mode

ilObjGroup::$view_mode = NULL
private

Definition at line 82 of file class.ilObjGroup.php.

Referenced by lookupViewMode(), and translateViewMode().

◆ $waiting_list

ilObjGroup::$waiting_list = false
protected

Definition at line 67 of file class.ilObjGroup.php.

Referenced by handleAutoFill(), isWaitingListEnabled(), and register().

◆ CAL_REG_END

const ilObjGroup::CAL_REG_END = 2

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

◆ CAL_REG_START

const ilObjGroup::CAL_REG_START = 1

Definition at line 35 of file class.ilObjGroup.php.

◆ ERR_MISSING_GROUP_TYPE

const ilObjGroup::ERR_MISSING_GROUP_TYPE = 'grp_missing_grp_type'

Definition at line 42 of file class.ilObjGroup.php.

◆ ERR_MISSING_MIN_MAX_MEMBERS

const ilObjGroup::ERR_MISSING_MIN_MAX_MEMBERS = 'grp_wrong_min_max_members'

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

◆ ERR_MISSING_PASSWORD

const ilObjGroup::ERR_MISSING_PASSWORD = 'grp_missing_password'

Definition at line 43 of file class.ilObjGroup.php.

◆ ERR_MISSING_TITLE

const ilObjGroup::ERR_MISSING_TITLE = 'msg_no_title'

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

◆ ERR_WRONG_MAX_MEMBERS

const ilObjGroup::ERR_WRONG_MAX_MEMBERS = 'grp_wrong_max_members'

Definition at line 44 of file class.ilObjGroup.php.

◆ ERR_WRONG_MIN_MAX_MEMBERS

const ilObjGroup::ERR_WRONG_MIN_MAX_MEMBERS = 'grp_max_and_min_members_invalid'

Definition at line 47 of file class.ilObjGroup.php.

◆ ERR_WRONG_REG_TIME_LIMIT

const ilObjGroup::ERR_WRONG_REG_TIME_LIMIT = 'grp_wrong_reg_time_limit'

Definition at line 45 of file class.ilObjGroup.php.

◆ ERR_WRONG_REGISTRATION_LIMITED

const ilObjGroup::ERR_WRONG_REGISTRATION_LIMITED = 'grp_err_registration_limited'

Definition at line 48 of file class.ilObjGroup.php.

◆ GRP_ADMIN

const ilObjGroup::GRP_ADMIN = 2

Definition at line 39 of file class.ilObjGroup.php.

◆ GRP_MEMBER

const ilObjGroup::GRP_MEMBER = 1

Definition at line 38 of file class.ilObjGroup.php.

◆ MAIL_ALLOWED_ALL

const ilObjGroup::MAIL_ALLOWED_ALL = 1

Definition at line 50 of file class.ilObjGroup.php.

Referenced by ilObjGroupGUI\executeCommand(), and ilObjGroupGUI\initForm().

◆ MAIL_ALLOWED_TUTORS

const ilObjGroup::MAIL_ALLOWED_TUTORS = 2

Definition at line 51 of file class.ilObjGroup.php.

Referenced by ilObjGroupGUI\initForm().


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