ILIAS  release_8 Revision v8.19
All Data Structures Namespaces Files Functions Variables Modules Pages
ilObjGroup Class Reference

Class ilObjGroup. More...

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

Public Member Functions

 __construct (int $a_id=0, bool $a_call_by_reference=true)
 
 setInformation (string $a_information)
 
 getInformation ()
 
 setGroupType (int $a_type)
 
 getGroupType ()
 
 setRegistrationType (int $a_type)
 
 getRegistrationType ()
 
 isRegistrationEnabled ()
 
 enableUnlimitedRegistration (bool $a_status)
 
 isRegistrationUnlimited ()
 
 setRegistrationStart (?ilDateTime $a_start)
 
 getRegistrationStart ()
 
 setRegistrationEnd (?ilDateTime $a_end)
 
 getRegistrationEnd ()
 
 setPassword (string $a_pass)
 
 getPassword ()
 
 enableMembershipLimitation (bool $a_status)
 
 isMembershipLimited ()
 
 setMinMembers (int $a_max)
 
 getMinMembers ()
 
 setMaxMembers (int $a_max)
 
 getMaxMembers ()
 
 enableWaitingList (bool $a_status)
 
 isWaitingListEnabled ()
 
 setWaitingListAutoFill (bool $a_value)
 
 hasWaitingListAutoFill ()
 
 setLatitude (string $a_latitude)
 
 getLatitude ()
 
 setLongitude (string $a_longitude)
 
 getLongitude ()
 
 setLocationZoom (int $a_locationzoom)
 
 getLocationZoom ()
 
 setEnableGroupMap (bool $a_enablemap)
 
 getEnableMap ()
 
 getEnableGroupMap ()
 
 getRegistrationAccessCode ()
 
 setRegistrationAccessCode (string $a_code)
 
 isRegistrationAccessCodeEnabled ()
 
 enableRegistrationAccessCode (bool $a_status)
 
 setMailToMembersType (int $a_type)
 
 getMailToMembersType ()
 
 setCancellationEnd (?ilDate $a_value)
 
 getCancellationEnd ()
 
 setShowMembers (bool $a_status)
 
 getShowMembers ()
 
 setAutoNotification (bool $a_status)
 
 getAutoNotification ()
 
 setPeriod (?\ilDateTime $start=null, ?\ilDateTime $end=null)
 
 getStartTimeIndication ()
 
 getStart ()
 
 getEnd ()
 
 enableSessionLimit (bool $a_status)
 
 isSessionLimitEnabled ()
 
 setNumberOfPreviousSessions (int $a_num)
 
 getNumberOfPreviousSessions ()
 
 setNumberOfNextSessions (int $a_num)
 
 getNumberOfNextSessions ()
 
 validate ()
 validate group settings More...
 
 create ()
 
 update ()
 
 delete ()
 
 read ()
 
 cloneDependencies (int $a_target_id, int $a_copy_id)
 
 cloneAutoGeneratedRoles (ilObjGroup $new_obj)
 Clone group admin and member role permissions. More...
 
 getDefaultMemberRole ()
 returns object id of created default member role More...
 
 getDefaultAdminRole ()
 returns object id of created default adminstrator role More...
 
 leaveGroup ()
 
 leave (int $a_user_id)
 deassign member from group role More...
 
 getGroupMemberIds ()
 get all group Member ids regardless of role More...
 
 getGroupMemberData (array $a_mem_ids, int $active=1)
 get all group Members regardless of group role. More...
 
 getCountMembers ()
 
 getGroupAdminIds (int $a_grpId=0)
 
 getLocalGroupRoles (bool $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 More...
 
 getGrpStatusOpenTemplateId ()
 get group status open template More...
 
 updateGroupType (int $a_group_type=ilGroupConstants::GRP_TYPE_OPEN)
 Change group type Revokes permissions of all parent non-protected roles and initiates these roles with the according il_grp_(open|closed) template. More...
 
 setGroupStatus (int $a_status)
 
 getGroupStatus ()
 get group status More...
 
 readGroupStatus ()
 Read group type. More...
 
 getMemberRoles (int $a_user_id)
 
 isAdmin (int $a_userId)
 
 initDefaultRoles ()
 
 setParentRolePermissions (int $a_parent_ref)
 This method is called before "initDefaultRoles". More...
 
 applyDidacticTemplate (int $a_tpl_id)
 
 _isMember (int $a_user_id, int $a_ref_id, string $a_field='')
 
 _getMembers (int $a_obj_id)
 
 getViewMode ()
 Get effective container view mode. More...
 
 setViewMode (int $a_view_mode)
 
 addAdditionalSubItemInformation (array &$object)
 Add additional information to sub item, e.g. More...
 
 getMessage ()
 
 setMessage (string $a_message)
 
 appendMessage (string $a_message)
 
 getMembersObject ()
 
 register (int $a_user_id, int $a_role=ilParticipants::IL_GRP_MEMBER, bool $a_force_registration=false)
 
 handleAutoFill ()
 
 getSubItems (bool $a_admin_panel_enabled=false, bool $a_include_side_block=false, int $a_get_single=0, \ilContainerUserFilter $container_user_filter=null)
 
- Public Member Functions inherited from ilObject
 __construct (int $id=0, bool $reference=true)
 
 withReferences ()
 determines whether objects are referenced or not (got ref ids or not) More...
 
 processAutoRating ()
 
 read ()
 
 getId ()
 
 setId (int $id)
 
 setRefId (int $ref_id)
 
 getRefId ()
 
 getType ()
 
 setType (string $type)
 
 getPresentationTitle ()
 get presentation title Normally same as title Overwritten for sessions More...
 
 getTitle ()
 
 getUntranslatedTitle ()
 Get untranslated object title WebDAV needs to access the untranslated title of an object. More...
 
 setTitle (string $title)
 
 getDescription ()
 
 setDescription (string $desc)
 
 getLongDescription ()
 get object long description (stored in object_description) More...
 
 getImportId ()
 
 setImportId (string $import_id)
 
 setOfflineStatus (bool $status)
 
 getOfflineStatus ()
 
 supportsOfflineHandling ()
 
 getOwner ()
 
 getOwnerName ()
 get full name of object owner More...
 
 setOwner (int $usr_id)
 
 getCreateDate ()
 Get create date in YYYY-MM-DD HH-MM-SS format. More...
 
 getLastUpdateDate ()
 Get last update date in YYYY-MM-DD HH-MM-SS format. More...
 
 create ()
 note: title, description and type should be set when this function is called More...
 
 update ()
 
 MDUpdateListener (string $element)
 Metadata update listener. More...
 
 createMetaData ()
 
 updateMetaData ()
 
 deleteMetaData ()
 
 updateOwner ()
 update owner of object in db More...
 
 putInTree (int $parent_ref_id)
 maybe this method should be in tree object!? More...
 
 setPermissions (int $parent_ref_id)
 
 setParentRolePermissions (int $parent_ref_id)
 Initialize the permissions of parent roles (local roles of categories, global roles...) This method is overwritten in e.g. More...
 
 createReference ()
 creates reference for object More...
 
 countReferences ()
 
 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. More...
 
 applyDidacticTemplate (int $tpl_id)
 
 getXMLZip ()
 
 getHTMLDirectory ()
 
 appendCopyInfo (int $target_id, int $copy_id)
 Prepend Copy info if object with same name exists in that container. More...
 
 cloneDependencies (int $target_id, int $copy_id)
 Clone object dependencies. More...
 
 cloneMetaData (ilObject $target_obj)
 Copy meta data. More...
 
 selfOrParentWithRatingEnabled ()
 
 getPossibleSubObjects (bool $filter=true)
 get all possible sub objects of this type the object can decide which types of sub objects are possible jut in time overwrite if the decision distinguish from standard model More...
 
- Public Member Functions inherited from ilContainer
 getTileSizes ()
 
 getObjectTranslation ()
 
 setObjectTranslation (?ilObjectTranslation $obj_trans)
 
 createContainerDirectory ()
 
 getContainerDirectory ()
 
 setHiddenFilesFound (bool $a_hiddenfilesfound)
 
 getHiddenFilesFound ()
 
 getStyleSheetId ()
 
 setStyleSheetId (int $a_style_id)
 
 setNewsTimeline (bool $a_val)
 
 getNewsTimeline ()
 
 setNewsTimelineAutoEntries (bool $a_val)
 
 getNewsTimelineAutoEntries ()
 
 setNewsTimelineLandingPage (bool $a_val)
 
 getNewsTimelineLandingPage ()
 
 isNewsTimelineEffective ()
 
 isNewsTimelineLandingPageEffective ()
 
 setNewsBlockActivated (bool $a_val)
 
 getNewsBlockActivated ()
 
 setUseNews (bool $a_val)
 
 getUseNews ()
 
 cloneDependencies (int $target_id, int $copy_id)
 Clone object dependencies (container sorting) More...
 
 cloneAllObject (string $session_id, string $client_id, string $new_type, int $ref_id, int $clone_source, array $options, bool $soap_call=false, int $a_submode=1)
 
 delete ()
 delete category and all related data More...
 
 getViewMode ()
 
 getOrderType ()
 
 setOrderType (int $a_value)
 
 isClassificationFilterActive ()
 
 filteredSubtree ()
 Note grp/crs currently allow to filter in their whole subtrees Catetories only their direct childs. More...
 
 getSubItems (bool $a_admin_panel_enabled=false, bool $a_include_side_block=false, int $a_get_single=0, ilContainerUserFilter $container_user_filter=null)
 
 gotItems ()
 
 addAdditionalSubItemInformation (array &$object)
 Add additional information to sub item, e.g. More...
 
 getGroupedObjTypes ()
 
 enablePageEditing ()
 
 create ()
 
 putInTree (int $parent_ref_id)
 
 update ()
 
 read ()
 
 readContainerSettings ()
 
 removeTranslations ()
 
 deleteTranslation (string $a_lang)
 
 addTranslation (string $a_title, string $a_desc, string $a_lang, string $a_lang_default)
 
- Public Member Functions inherited from ilMembershipRegistrationCodes
 register (int $a_user_id)
 Register an user. More...
 

Static Public Member Functions

static lookupGroupTye (int $a_id)
 
static lookupGroupStatusTemplateId (int $a_obj_id)
 
static _lookupIdByTitle (string $a_title)
 
static lookupViewMode ($a_obj_id)
 
static translateViewMode (int $a_obj_id, int $a_view_mode, ?int $a_ref_id=null)
 
static lookupObjectsByCode (string $a_code)
 
static mayLeave (int $a_group_id, int $a_user_id=null, ?ilDate &$a_date=null)
 
static findGroupsWithNotEnoughMembers ()
 
static lookupShowMembersEnabled (int $a_obj_id)
 
- Static Public Member Functions inherited from ilObject
static _lookupObjIdByImportId (string $import_id)
 Get (latest) object id for an import id. More...
 
static _lookupImportId (int $obj_id)
 
static _lookupOwnerName (int $owner_id)
 Lookup owner name for owner id. More...
 
static _getIdForImportId (string $import_id)
 
static _getAllReferences (int $id)
 get all reference ids for object ID More...
 
static _lookupTitle (int $obj_id)
 
static lookupOfflineStatus (int $obj_id)
 Lookup offline status using objectDataCache. More...
 
static _lookupOwner (int $obj_id)
 Lookup owner user ID for object ID. More...
 
static _getIdsForTitle (string $title, string $type='', bool $partial_match=false)
 
static _lookupDescription (int $obj_id)
 
static _lookupLastUpdate (int $obj_id, bool $formatted=false)
 
static _getLastUpdateOfObjects (array $obj_ids)
 
static _lookupObjId (int $ref_id)
 
static _setDeletedDate (int $ref_id, int $deleted_by)
 
static setDeletedDates (array $ref_ids, int $user_id)
 
static _resetDeletedDate (int $ref_id)
 
static _lookupDeletedDate (int $ref_id)
 
static _writeTitle (int $obj_id, string $title)
 write title to db (static) More...
 
static _writeDescription (int $obj_id, string $desc)
 write description to db (static) More...
 
static _writeImportId (int $obj_id, string $import_id)
 write import id to db (static) More...
 
static _lookupType (int $id, bool $reference=false)
 
static _isInTrash (int $ref_id)
 
static _hasUntrashedReference (int $obj_id)
 checks whether an object has at least one reference that is not in trash More...
 
static _lookupObjectId (int $ref_id)
 
static _getObjectsDataForType (string $type, bool $omit_trash=false)
 get all objects of a certain type More...
 
static _exists (int $id, bool $reference=false, ?string $type=null)
 checks if an object exists in object_data More...
 
static _getObjectsByType (string $obj_type="", int $owner=null)
 
static _prepareCloneSelection (array $ref_ids, string $new_type, bool $show_path=true)
 Prepare copy wizard object selection. More...
 
static _getIcon (int $obj_id=0, string $size="big", string $type="", bool $offline=false)
 Get icon for repository item. More...
 
static collectDeletionDependencies (array &$deps, int $ref_id, int $obj_id, string $type, int $depth=0)
 Collect deletion dependencies. More...
 
static getDeletionDependencies (int $obj_id)
 Get deletion dependencies. More...
 
static getLongDescriptions (array $obj_ids)
 
static getAllOwnedRepositoryObjects (int $user_id)
 
static fixMissingTitles ($type, array &$obj_title_map)
 Try to fix missing object titles. More...
 
static _lookupCreationDate (int $obj_id)
 
static _getObjectTypeIdByTitle (string $type, \ilDBInterface $ilDB=null)
 
- Static Public Member Functions inherited from ilContainer
static _getContainerDirectory (int $a_id)
 
static _lookupContainerSetting (int $a_id, string $a_keyword, string $a_default_value=null)
 
static _hasContainerSetting (int $a_id, string $a_keyword)
 
static _writeContainerSetting (int $a_id, string $a_keyword, string $a_value)
 
static _getContainerSettings (int $a_id)
 
static _deleteContainerSettings (int $a_id, string $a_keyword="", bool $a_keyword_like=false)
 
static _exportContainerSettings (ilXmlWriter $a_xml, int $a_obj_id)
 
static getCompleteDescriptions (array $objects)
 overwrites description fields to long or short description in an assoc array keys needed (obj_id and description) More...
 

Data Fields

const CAL_REG_START = 1
 
const CAL_REG_END = 2
 
const CAL_START = 3
 
const CAL_END = 4
 
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
 
ilGroupParticipants $members_obj
 
 $m_roleMemberId
 
 $m_roleAdminId
 
- Data Fields inherited from ilObject
const TITLE_LENGTH = 255
 
const DESC_LENGTH = 128
 
const LONG_DESC_LENGTH = 4000
 
const TABLE_OBJECT_DATA = "object_data"
 
array $objectList
 
string $untranslatedTitle
 
- 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
 
const TILE_NORMAL = 0
 
const TILE_SMALL = 1
 
const TILE_LARGE = 2
 
const TILE_EXTRA_LARGE = 3
 
const TILE_FULL = 4
 
array $items = []
 

Protected Member Functions

 toggleStartTimeIndication (bool $time_indication)
 
 setStart (ilDateTime $a_value=null)
 
 setEnd (ilDateTime $a_value=null)
 
 getDefaultGroupRoles ()
 get default group roles, returns the defaultlike create roles il_grp_member, il_grp_admin More...
 
 prepareAppointments ($a_mode='create')
 Prepare calendar appointments. More...
 
 initParticipants ()
 
- Protected Member Functions inherited from ilObject
 doMDUpdateListener (string $a_element)
 
 beforeMDUpdateListener (string $a_element)
 
 doCreateMetaData ()
 
 beforeCreateMetaData ()
 
 doUpdateMetaData ()
 
 beforeUpdateMetaData ()
 
 doDeleteMetaData ()
 
 beforeDeleteMetaData ()
 
 handleAutoRating ()
 
 hasAutoRating ()
 
- Protected Member Functions inherited from ilContainer
 getInitialSubitems ()
 
 applyContainerUserFilter (array $objects, ilContainerUserFilter $container_user_filter=null)
 Apply container user filter on objects. More...
 
 filterObjIdsByCopyright (array $obj_ids, string $copyright_id)
 
 filterObjIdsByDefaultCopyright (array $obj_ids, string $default_identifier)
 
 legacyOnlineFilter (array $obj_ids, array $objects, int $val)
 Legacy online filter. More...
 

Private Attributes

string $information = ''
 
int $group_status = 0
 
int $group_type = ilGroupConstants::GRP_TYPE_UNKNOWN
 
int $reg_type = ilGroupConstants::GRP_REGISTRATION_DIRECT
 
bool $reg_unlimited = true
 
ilDateTime $reg_start = null
 
ilDateTime $reg_end = null
 
string $reg_password = ''
 
bool $reg_membership_limitation = false
 
int $reg_min_members = 0
 
int $reg_max_members = 0
 
bool $waiting_list = false
 
bool $auto_fill_from_waiting = false
 
ilDate $leave_end = null
 
bool $show_members = true
 
bool $session_limit = false
 
int $session_prev = -1
 
int $session_next = -1
 
bool $start_time_indication = false
 
ilDateTime $grp_start = null
 
ilDateTime $grp_end = null
 
bool $auto_notification = true
 
string $latitude = ''
 
string $longitude = ''
 
int $locationzoom = 0
 
bool $enablemap = false
 
string $reg_access_code = ''
 
bool $reg_access_code_enabled = false
 
int $view_mode = ilContainer::VIEW_DEFAULT
 
int $mail_members = self::MAIL_ALLOWED_ALL
 
ilLogger $logger
 
string $message = ''
 

Additional Inherited Members

- Static Public Attributes inherited from ilContainer
static bool $data_preloaded = false
 
- Protected Attributes inherited from ilObject
ilLogger $obj_log
 
ILIAS $ilias
 
ilObjectDefinition $obj_definition
 
ilDBInterface $db
 
ilLogger $log
 
ilErrorHandling $error
 
ilTree $tree
 
ilAppEventHandler $app_event_handler
 
ilRbacAdmin $rbac_admin
 
ilRbacReview $rbac_review
 
ilObjUser $user
 
ilLanguage $lng
 
int $id
 
bool $referenced
 
bool $call_by_reference
 
int $max_title = self::TITLE_LENGTH
 
int $max_desc = self::DESC_LENGTH
 
bool $add_dots = true
 
int $ref_id = null
 
string $type = ""
 
string $title = ""
 
bool $offline = false
 
string $desc = ""
 
string $long_desc = ""
 
int $owner = 0
 
string $create_date = ""
 
string $last_update = ""
 
string $import_id = ""
 
bool $register = false
 
- Protected Attributes inherited from ilContainer
ILIAS Style Content DomainService $content_style_domain
 
ilNewsService $news
 
ilAccessHandler $access
 
ilRbacSystem $rbacsystem
 
ilObjUser $user
 
ilObjectDefinition $obj_definition
 
int $order_type = 0
 
bool $hiddenfilesfound = false
 
bool $news_timeline = false
 
bool $news_timeline_auto_entries = false
 
ilSetting $setting
 
ilObjectTranslation $obj_trans = null
 
int $style_id = 0
 
bool $news_timeline_landing_page = false
 
bool $news_block_activated = false
 
bool $use_news = false
 
ilRecommendedContentManager $recommended_content_manager
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

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

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

References $DIC, ilObject\$tree, ILIAS\GlobalScreen\Provider\__construct(), and ILIAS\Repository\logger().

103  {
104  global $DIC;
105 
106  $tree = $DIC['tree'];
107 
108  $this->tree = &$tree;
109 
110  $this->type = "grp";
111  parent::__construct($a_id, $a_call_by_reference);
112 
113  $this->logger = $DIC->logger()->grp();
114  }
ilTree $tree
global $DIC
Definition: feed.php:28
__construct(Container $dic, ilPlugin $plugin)
+ Here is the call graph for this function:

Member Function Documentation

◆ _getMembers()

ilObjGroup::_getMembers ( int  $a_obj_id)

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

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

Referenced by _isMember().

1194  : array
1195  {
1196  // get reference
1197  $ref_ids = ilObject::_getAllReferences($a_obj_id);
1198  $ref_id = current($ref_ids);
1199 
1200  $local_roles = $this->rbac_review->getRolesOfRoleFolder($ref_id, false);
1201 
1202  $users = array();
1203  foreach ($local_roles as $role_id) {
1204  $users = array_merge($users, $this->rbac_review->assignedUsers($role_id));
1205  }
1206  return array_unique($users);
1207  }
static _getAllReferences(int $id)
get all reference ids for object ID
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ _isMember()

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

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

References $query, $res, _getMembers(), ilObject\_lookupObjId(), ilObjectFactory\getInstanceByObjId(), and ilArrayUtil\quoteArray().

Referenced by ilObjCourseGrouping\_checkGroupingDependencies().

1151  : bool
1152  {
1153  $local_roles = $this->rbac_review->getRolesOfRoleFolder($a_ref_id, false);
1154  $user_roles = $this->rbac_review->assignedRoles($a_user_id);
1155 
1156  // Used for membership limitations -> check membership by given field
1157  if ($a_field) {
1158  $tmp_user = ilObjectFactory::getInstanceByObjId($a_user_id);
1159  if (!$tmp_user instanceof ilObjUser) {
1160  throw new DomainException('Invalid user id given: ' . $a_user_id);
1161  }
1162  switch ($a_field) {
1163  case 'login':
1164  $and = "AND login = '" . $tmp_user->getLogin() . "' ";
1165  break;
1166  case 'email':
1167  $and = "AND email = '" . $tmp_user->getEmail() . "' ";
1168  break;
1169  case 'matriculation':
1170  $and = "AND matriculation = '" . $tmp_user->getMatriculation() . "' ";
1171  break;
1172 
1173  default:
1174  $and = "AND usr_id = '" . $a_user_id . "'";
1175  break;
1176  }
1177  if (!$members = ilObjGroup::_getMembers(ilObject::_lookupObjId($a_ref_id))) {
1178  return false;
1179  }
1180  $query = "SELECT * FROM usr_data as ud " .
1181  "WHERE usr_id IN (" . implode(",", ilArrayUtil::quoteArray($members)) . ") " .
1182  $and;
1183  $res = $this->db->query($query);
1184  return (bool) $res->numRows();
1185  }
1186 
1187  if (!array_intersect($local_roles, $user_roles)) {
1188  return false;
1189  }
1190 
1191  return true;
1192  }
$res
Definition: ltiservices.php:69
static quoteArray(array $a_array)
Quotes all members of an array for usage in DB query statement.
static _lookupObjId(int $ref_id)
_getMembers(int $a_obj_id)
$query
static getInstanceByObjId(?int $obj_id, bool $stop_on_error=true)
get an instance of an Ilias object by object id
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ _lookupIdByTitle()

static ilObjGroup::_lookupIdByTitle ( string  $a_title)
static

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

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

Referenced by ilMailAddressTypeHelperImpl\getGroupObjIdByTitle().

1136  : int
1137  {
1138  global $DIC;
1139 
1140  $ilDB = $DIC['ilDB'];
1141  $query = "SELECT * FROM object_data WHERE title = " .
1142  $ilDB->quote($a_title, 'text') . " AND type = 'grp'";
1143  $res = $ilDB->query($query);
1144  while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
1145  return $row->obj_id;
1146  }
1147  return 0;
1148  }
$res
Definition: ltiservices.php:69
global $DIC
Definition: feed.php:28
$query
+ Here is the caller graph for this function:

◆ addAdditionalSubItemInformation()

ilObjGroup::addAdditionalSubItemInformation ( array &  $object)

Add additional information to sub item, e.g.

used in courses for timings information etc.

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

References ilObjectActivation\addAdditionalSubItemInformation().

1301  : void
1302  {
1304  }
static addAdditionalSubItemInformation(array &$item)
Parse item data for list entries.
+ Here is the call graph for this function:

◆ appendMessage()

ilObjGroup::appendMessage ( string  $a_message)

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

References getMessage().

1315  : void
1316  {
1317  if ($this->getMessage()) {
1318  $this->message .= "<br /> ";
1319  }
1320  $this->message .= $a_message;
1321  }
+ Here is the call graph for this function:

◆ applyDidacticTemplate()

ilObjGroup::applyDidacticTemplate ( int  $a_tpl_id)

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

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

Referenced by updateGroupType().

1125  : void
1126  {
1127  parent::applyDidacticTemplate($a_tpl_id);
1128 
1129  if (!$a_tpl_id) {
1130  // init default type
1131  $this->setParentRolePermissions($this->getRefId());
1132  }
1133  }
setParentRolePermissions(int $a_parent_ref)
This method is called before "initDefaultRoles".
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ cloneAutoGeneratedRoles()

ilObjGroup::cloneAutoGeneratedRoles ( ilObjGroup  $new_obj)

Clone group admin and member role permissions.

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

References getDefaultAdminRole(), getDefaultMemberRole(), ilObject\getRefId(), and ILIAS\Repository\logger().

Referenced by read().

761  : void
762  {
763  $admin = $this->getDefaultAdminRole();
764  $new_admin = $new_obj->getDefaultAdminRole();
765  if (!$admin || !$new_admin || !$this->getRefId() || !$new_obj->getRefId()) {
766  $this->logger->warning('Error cloning auto generated rol: il_grp_admin');
767  }
768  $this->rbac_admin->copyRolePermissions($admin, $this->getRefId(), $new_obj->getRefId(), $new_admin, true);
769  $this->logger->info('Finished copying of role il_grp_admin.');
770 
771  $member = $this->getDefaultMemberRole();
772  $new_member = $new_obj->getDefaultMemberRole();
773  if (!$member || !$new_member) {
774  $this->logger->warning('Error cloning auto generated rol: il_grp_member');
775  }
776  $this->rbac_admin->copyRolePermissions($member, $this->getRefId(), $new_obj->getRefId(), $new_member, true);
777  $this->logger->info('Finished copying of role il_grp_member.');
778  }
getDefaultAdminRole()
returns object id of created default adminstrator role
getDefaultMemberRole()
returns object id of created default member role
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ cloneDependencies()

ilObjGroup::cloneDependencies ( int  $a_target_id,
int  $a_copy_id 
)

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

References ilObjCourseGrouping\_getGroupings(), ilObjectActivation\cloneDependencies(), ilObject\getId(), ilObject\getRefId(), and ILIAS\Repository\logger().

743  : bool
744  {
745  parent::cloneDependencies($a_target_id, $a_copy_id);
746 
747  ilObjectActivation::cloneDependencies($this->getRefId(), $a_target_id, $a_copy_id);
748 
749  // clone membership limitation
750  foreach (\ilObjCourseGrouping::_getGroupings($this->getId()) as $grouping_id) {
751  $this->logger->info('Handling grouping id: ' . $grouping_id);
752  $grouping = new \ilObjCourseGrouping($grouping_id);
753  $grouping->cloneGrouping($a_target_id, $a_copy_id);
754  }
755  return true;
756  }
static cloneDependencies(int $ref_id, int $target_id, int $copy_id)
static _getGroupings(int $a_course_id)
+ Here is the call graph for this function:

◆ create()

ilObjGroup::create ( )

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

References $query, $res, ilObject\createMetaData(), getAutoNotification(), getCancellationEnd(), getEnableGroupMap(), getEnd(), getGroupType(), ilObject\getId(), getInformation(), getLatitude(), getLocationZoom(), getLongitude(), getMailToMembersType(), getMaxMembers(), getMinMembers(), getNumberOfNextSessions(), getNumberOfPreviousSessions(), getPassword(), getRegistrationAccessCode(), getRegistrationEnd(), getRegistrationStart(), getRegistrationType(), getStart(), hasWaitingListAutoFill(), IL_CAL_DATETIME, IL_CAL_UNIX, isMembershipLimited(), isRegistrationAccessCodeEnabled(), isRegistrationEnabled(), isRegistrationUnlimited(), isSessionLimitEnabled(), isWaitingListEnabled(), prepareAppointments(), and ilDBConstants\T_INTEGER.

480  : int
481  {
482  if (!parent::create()) {
483  return 0;
484  }
485  $this->createMetaData();
486 
487  $query = "INSERT INTO grp_settings (obj_id,information,grp_type,registration_type,registration_enabled," .
488  "registration_unlimited,registration_start,registration_end,registration_password,registration_mem_limit," .
489  "registration_max_members,waiting_list,latitude,longitude,location_zoom,enablemap,reg_ac_enabled,reg_ac,view_mode,mail_members_type," .
490  "leave_end,registration_min_members,auto_wait, grp_start, grp_end, auto_notification, session_limit, session_prev, session_next) " .
491  "VALUES(" .
492  $this->db->quote($this->getId(), 'integer') . ", " .
493  $this->db->quote($this->getInformation(), 'text') . ", " .
494  $this->db->quote($this->getGroupType(), 'integer') . ", " .
495  $this->db->quote($this->getRegistrationType(), 'integer') . ", " .
496  $this->db->quote(($this->isRegistrationEnabled() ? 1 : 0), 'integer') . ", " .
497  $this->db->quote(($this->isRegistrationUnlimited() ? 1 : 0), 'integer') . ", " .
498  $this->db->quote(($this->getRegistrationStart() && !$this->getRegistrationStart()->isNull()) ? $this->getRegistrationStart()->get(IL_CAL_DATETIME, '') : null, 'timestamp') . ", " .
499  $this->db->quote(($this->getRegistrationEnd() && !$this->getRegistrationEnd()->isNull()) ? $this->getRegistrationEnd()->get(IL_CAL_DATETIME, '') : null, 'timestamp') . ", " .
500  $this->db->quote($this->getPassword(), 'text') . ", " .
501  $this->db->quote((int) $this->isMembershipLimited(), 'integer') . ", " .
502  $this->db->quote($this->getMaxMembers(), 'integer') . ", " .
503  $this->db->quote($this->isWaitingListEnabled() ? 1 : 0, 'integer') . ", " .
504  $this->db->quote($this->getLatitude(), 'text') . ", " .
505  $this->db->quote($this->getLongitude(), 'text') . ", " .
506  $this->db->quote($this->getLocationZoom(), 'integer') . ", " .
507  $this->db->quote((int) $this->getEnableGroupMap(), 'integer') . ", " .
508  $this->db->quote($this->isRegistrationAccessCodeEnabled(), 'integer') . ', ' .
509  $this->db->quote($this->getRegistrationAccessCode(), 'text') . ', ' .
510  $this->db->quote($this->view_mode, 'integer') . ', ' .
511  $this->db->quote($this->getMailToMembersType(), 'integer') . ', ' .
512  $this->db->quote(($this->getCancellationEnd() && !$this->getCancellationEnd()->isNull()) ? $this->getCancellationEnd()->get(IL_CAL_UNIX) : null, 'integer') . ', ' .
513  $this->db->quote($this->getMinMembers(), 'integer') . ', ' .
514  $this->db->quote($this->hasWaitingListAutoFill(), 'integer') . ', ' .
515  $this->db->quote($this->getStart() instanceof ilDate ? $this->getStart()->get(IL_CAL_UNIX) : null, 'integer') . ', ' .
516  $this->db->quote($this->getEnd() instanceof ilDate ? $this->getEnd()->get(IL_CAL_UNIX) : null, 'integer') . ', ' .
517  $this->db->quote($this->getAutoNotification(), \ilDBConstants::T_INTEGER) . ', ' .
518  $this->db->quote($this->isSessionLimitEnabled(), ilDBConstants::T_INTEGER) . ', ' .
519  $this->db->quote($this->getNumberOfPreviousSessions(), ilDBConstants::T_INTEGER) . ', ' .
520  $this->db->quote($this->getNumberOfNextSessions(), ilDBConstants::T_INTEGER) .
521  ')';
522  $res = $this->db->manipulate($query);
523 
524  $this->app_event_handler->raise(
525  'Modules/Group',
526  'create',
527  array('object' => $this,
528  'obj_id' => $this->getId(),
529  'appointments' => $this->prepareAppointments('create'))
530  );
531  return $this->getId();
532  }
$res
Definition: ltiservices.php:69
const IL_CAL_DATETIME
const IL_CAL_UNIX
prepareAppointments($a_mode='create')
Prepare calendar appointments.
$query
isRegistrationAccessCodeEnabled()
+ Here is the call graph for this function:

◆ delete()

ilObjGroup::delete ( )

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

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

593  : bool
594  {
595  // always call parent delete function first!!
596  if (!parent::delete()) {
597  return false;
598  }
599 
600  $this->deleteMetaData();
601 
602  $query = "DELETE FROM grp_settings " .
603  "WHERE obj_id = " . $this->db->quote($this->getId(), 'integer');
604  $res = $this->db->manipulate($query);
605 
607 
608  $this->app_event_handler->raise(
609  'Modules/Group',
610  'delete',
611  array('object' => $this,
612  'obj_id' => $this->getId(),
613  'appointments' => $this->prepareAppointments('delete'))
614  );
615  return true;
616  }
$res
Definition: ltiservices.php:69
prepareAppointments($a_mode='create')
Prepare calendar appointments.
$query
static _deleteAllEntries(int $a_obj_id)
Delete all entries Normally called in case of object deletion.
+ Here is the call graph for this function:

◆ enableMembershipLimitation()

ilObjGroup::enableMembershipLimitation ( bool  $a_status)

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

Referenced by read().

207  : void
208  {
209  $this->reg_membership_limitation = $a_status;
210  }
+ Here is the caller graph for this function:

◆ enableRegistrationAccessCode()

ilObjGroup::enableRegistrationAccessCode ( bool  $a_status)

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

Referenced by read().

317  : void
318  {
319  $this->reg_access_code_enabled = $a_status;
320  }
+ Here is the caller graph for this function:

◆ enableSessionLimit()

ilObjGroup::enableSessionLimit ( bool  $a_status)

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

Referenced by read().

410  : void
411  {
412  $this->session_limit = $a_status;
413  }
+ Here is the caller graph for this function:

◆ enableUnlimitedRegistration()

ilObjGroup::enableUnlimitedRegistration ( bool  $a_status)

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

Referenced by read().

166  : void
167  {
168  $this->reg_unlimited = $a_status;
169  }
+ Here is the caller graph for this function:

◆ enableWaitingList()

ilObjGroup::enableWaitingList ( bool  $a_status)

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

Referenced by read().

237  : void
238  {
239  $this->waiting_list = $a_status;
240  }
+ Here is the caller graph for this function:

◆ findGroupsWithNotEnoughMembers()

static ilObjGroup::findGroupsWithNotEnoughMembers ( )
static

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

References $DIC, $ilDB, $res, ilObject\$tree, ilObject\_getAllReferences(), IL_CAL_DATETIME, IL_CAL_UNIX, ILIAS\Repository\int(), ilTree\isDeleted(), ilDBConstants\T_TEXT, and ilTimeZone\UTC.

Referenced by ilMembershipCronMinMembers\getGroups().

1544  : array
1545  {
1546  global $DIC;
1547  $ilDB = $DIC->database();
1548  $tree = $DIC->repositoryTree();
1549 
1550  $res = array();
1551  $before = new ilDateTime(time(), IL_CAL_UNIX);
1552  $now_date = $before->get(IL_CAL_DATETIME, '', ilTimeZone::UTC);
1553  $now = $before->get(IL_CAL_UNIX);
1554 
1555  $set = $ilDB->query($q = "SELECT obj_id, registration_min_members" .
1556  " FROM grp_settings" .
1557  " WHERE registration_min_members > " . $ilDB->quote(0, "integer") .
1558  " AND registration_mem_limit = " . $ilDB->quote(1, "integer") . // #17206
1559  " AND ((leave_end IS NOT NULL" .
1560  " AND leave_end < " . $ilDB->quote($now, "integer") . ")" .
1561  " OR (leave_end IS NULL" .
1562  " AND registration_end IS NOT NULL" .
1563  " AND registration_end < " . $ilDB->quote($now_date, "text") . "))" .
1564  " AND (period_start IS NULL OR period_start > " . $ilDB->quote($now_date, ilDBConstants::T_TEXT) . ")");
1565  while ($row = $ilDB->fetchAssoc($set)) {
1566  $refs = ilObject::_getAllReferences((int) $row['obj_id']);
1567  $ref = end($refs);
1568 
1569  if ($tree->isDeleted($ref)) {
1570  continue;
1571  }
1572 
1573  $part = new ilGroupParticipants((int) $row["obj_id"]);
1574  $reci = $part->getNotificationRecipients();
1575  if (sizeof($reci)) {
1576  $missing = (int) $row["registration_min_members"] - $part->getCountMembers();
1577  if ($missing > 0) {
1578  $res[(int) $row["obj_id"]] = array($missing, $reci);
1579  }
1580  }
1581  }
1582  return $res;
1583  }
$res
Definition: ltiservices.php:69
const IL_CAL_DATETIME
static _getAllReferences(int $id)
get all reference ids for object ID
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
ilTree $tree
isDeleted(int $a_node_id)
This is a wrapper for isSaved() with a more useful name.
const IL_CAL_UNIX
global $DIC
Definition: feed.php:28
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getAutoNotification()

ilObjGroup::getAutoNotification ( )

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

References $auto_notification.

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

356  : bool
357  {
359  }
bool $auto_notification
+ Here is the caller graph for this function:

◆ getCancellationEnd()

ilObjGroup::getCancellationEnd ( )

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

References $leave_end.

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

337  : ?ilDate
338  {
339  return $this->leave_end;
340  }
+ Here is the caller graph for this function:

◆ getCountMembers()

ilObjGroup::getCountMembers ( )

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

References getGroupMemberIds().

875  : int
876  {
877  return count($this->getGroupMemberIds());
878  }
getGroupMemberIds()
get all group Member ids regardless of role
+ Here is the call graph for this function:

◆ getDefaultAdminRole()

ilObjGroup::getDefaultAdminRole ( )

returns object id of created default adminstrator role

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

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

Referenced by cloneAutoGeneratedRoles().

793  : int
794  {
795  $local_group_Roles = $this->getLocalGroupRoles();
796  return $local_group_Roles["il_grp_admin_" . $this->getRefId()];
797  }
getLocalGroupRoles(bool $a_translate=false)
get ALL local roles of group, also those created and defined afterwards only fetch data once from dat...
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getDefaultGroupRoles()

ilObjGroup::getDefaultGroupRoles ( )
protected

get default group roles, returns the defaultlike create roles il_grp_member, il_grp_admin

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

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

References ilObjectFactory\getInstanceByObjId(), and ilObject\getRefId().

Referenced by getGroupAdminIds(), and isAdmin().

901  : array
902  {
903  $grp_id = $this->getRefId();
904  $role_arr = $this->rbac_review->getRolesOfRoleFolder($grp_id);
905  $arr_grpDefaultRoles = [];
906  foreach ($role_arr as $role_id) {
907  $role = ilObjectFactory::getInstanceByObjId($role_id, false);
908  $grp_Member = "il_grp_member_" . $grp_id;
909  $grp_Admin = "il_grp_admin_" . $grp_id;
910 
911  if (strcmp($role->getTitle(), $grp_Member) == 0) {
912  $arr_grpDefaultRoles["grp_member_role"] = $role->getId();
913  }
914 
915  if (strcmp($role->getTitle(), $grp_Admin) == 0) {
916  $arr_grpDefaultRoles["grp_admin_role"] = $role->getId();
917  }
918  }
919  return $arr_grpDefaultRoles;
920  }
static getInstanceByObjId(?int $obj_id, bool $stop_on_error=true)
get an instance of an Ilias object by object id
+ 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

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

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

Referenced by cloneAutoGeneratedRoles().

784  : int
785  {
786  $local_group_Roles = $this->getLocalGroupRoles();
787  return $local_group_Roles["il_grp_member_" . $this->getRefId()];
788  }
getLocalGroupRoles(bool $a_translate=false)
get ALL local roles of group, also those created and defined afterwards only fetch data once from dat...
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getEnableGroupMap()

ilObjGroup::getEnableGroupMap ( )

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

References $enablemap.

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

297  : bool
298  {
299  return $this->enablemap;
300  }
+ Here is the caller graph for this function:

◆ getEnableMap()

ilObjGroup::getEnableMap ( )

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

References getEnableGroupMap().

292  : bool
293  {
294  return $this->getEnableGroupMap();
295  }
+ Here is the call graph for this function:

◆ getEnd()

ilObjGroup::getEnd ( )

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

References $grp_end.

Referenced by create(), prepareAppointments(), read(), and update().

405  : ?\ilDateTime
406  {
407  return $this->grp_end;
408  }
Date and time handling
ilDateTime $grp_end
+ Here is the caller graph for this function:

◆ getGroupAdminIds()

ilObjGroup::getGroupAdminIds ( int  $a_grpId = 0)

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

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

Referenced by leaveGroup().

880  : array
881  {
882  if (!empty($a_grpId)) {
883  $grp_id = $a_grpId;
884  } else {
885  $grp_id = $this->getRefId();
886  }
887 
888  $usr_arr = array();
889  $roles = $this->getDefaultGroupRoles();
890 
891  foreach ($this->rbac_review->assignedUsers($this->getDefaultAdminRole()) as $member_id) {
892  array_push($usr_arr, $member_id);
893  }
894  return $usr_arr;
895  }
getDefaultGroupRoles()
get default group roles, returns the defaultlike create roles il_grp_member, il_grp_admin ...
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getGroupMemberData()

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

get all group Members regardless of group role.

fetch all users data in one shot to improve performance

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

References ilDBConstants\FETCHMODE_OBJECT, and ilArrayUtil\quoteArray().

848  : array
849  {
850  $usr_arr = array();
851  $q = "SELECT login,firstname,lastname,title,usr_id,last_login " .
852  "FROM usr_data " .
853  "WHERE usr_id IN (" . implode(',', ilArrayUtil::quoteArray($a_mem_ids)) . ") ";
854 
855  if (is_numeric($active) && $active > -1) {
856  $q .= "AND active = '$active'";
857  }
858 
859  $q .= 'ORDER BY lastname,firstname';
860 
861  $r = $this->db->query($q);
862  $mem_arr = [];
863  while ($row = $r->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
864  $mem_arr[] = array("id" => (int) $row->usr_id,
865  "login" => $row->login,
866  "firstname" => $row->firstname,
867  "lastname" => $row->lastname,
868  "last_login" => $row->last_login
869  );
870  }
871 
872  return $mem_arr;
873  }
static quoteArray(array $a_array)
Quotes all members of an array for usage in DB query statement.
+ Here is the call graph for this function:

◆ getGroupMemberIds()

ilObjGroup::getGroupMemberIds ( )

get all group Member ids regardless of role

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

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

References getLocalGroupRoles().

Referenced by getCountMembers(), and leaveGroup().

831  : array
832  {
833  $usr_arr = array();
834  $rol = $this->getLocalGroupRoles();
835  $mem_arr = [];
836  foreach ($rol as $value) {
837  foreach ($this->rbac_review->assignedUsers($value) as $member_id) {
838  array_push($usr_arr, $member_id);
839  }
840  }
841  return array_unique($usr_arr);
842  }
getLocalGroupRoles(bool $a_translate=false)
get ALL local roles of group, also those created and defined afterwards only fetch data once from dat...
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getGroupStatus()

ilObjGroup::getGroupStatus ( )

get group status

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

References $group_status.

1024  : int
1025  {
1026  return $this->group_status;
1027  }

◆ getGroupType()

ilObjGroup::getGroupType ( )

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

References $group_type.

Referenced by create(), and update().

146  : int
147  {
148  return $this->group_type;
149  }
+ Here is the caller graph for this function:

◆ getGrpStatusClosedTemplateId()

ilObjGroup::getGrpStatusClosedTemplateId ( )

get group status closed template

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

References $res, and ilDBConstants\FETCHMODE_ASSOC.

951  : int
952  {
953  $q = "SELECT obj_id FROM object_data WHERE type='rolt' AND title='il_grp_status_closed'";
954  $res = $this->ilias->db->query($q);
955  $row = $res->fetchRow(ilDBConstants::FETCHMODE_ASSOC);
956 
957  return (int) $row["obj_id"];
958  }
$res
Definition: ltiservices.php:69
header include for all ilias files.

◆ getGrpStatusOpenTemplateId()

ilObjGroup::getGrpStatusOpenTemplateId ( )

get group status open template

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

References $res, and ilDBConstants\FETCHMODE_ASSOC.

Referenced by setParentRolePermissions().

963  : int
964  {
965  $q = "SELECT obj_id FROM object_data WHERE type='rolt' AND title='il_grp_status_open'";
966  $res = $this->ilias->db->query($q);
967  $row = $res->fetchRow(ilDBConstants::FETCHMODE_ASSOC);
968 
969  return (int) $row["obj_id"];
970  }
$res
Definition: ltiservices.php:69
header include for all ilias files.
+ Here is the caller graph for this function:

◆ getInformation()

ilObjGroup::getInformation ( )

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

References $information.

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

136  : string
137  {
138  return $this->information;
139  }
string $information
+ Here is the caller graph for this function:

◆ getLatitude()

ilObjGroup::getLatitude ( )

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

References $latitude.

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

262  : string
263  {
264  return $this->latitude;
265  }
+ Here is the caller graph for this function:

◆ getLocalGroupRoles()

ilObjGroup::getLocalGroupRoles ( bool  $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

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

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

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

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

927  : array
928  {
929  if (empty($this->local_roles)) {
930  $this->local_roles = array();
931  $role_arr = $this->rbac_review->getRolesOfRoleFolder($this->getRefId());
932 
933  foreach ($role_arr as $role_id) {
934  if ($this->rbac_review->isAssignable($role_id, $this->getRefId()) == true) {
935  $role = ilObjectFactory::getInstanceByObjId($role_id, false);
936  if ($a_translate) {
937  $role_name = ilObjRole::_getTranslation($role->getTitle());
938  } else {
939  $role_name = $role->getTitle();
940  }
941  $this->local_roles[$role_name] = $role->getId();
942  }
943  }
944  }
945  return $this->local_roles;
946  }
static _getTranslation(string $a_role_title)
static getInstanceByObjId(?int $obj_id, bool $stop_on_error=true)
get an instance of an Ilias object by object id
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getLocationZoom()

ilObjGroup::getLocationZoom ( )

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

References $locationzoom.

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

282  : int
283  {
284  return $this->locationzoom;
285  }
+ Here is the caller graph for this function:

◆ getLongitude()

ilObjGroup::getLongitude ( )

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

References $longitude.

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

272  : string
273  {
274  return $this->longitude;
275  }
+ Here is the caller graph for this function:

◆ getMailToMembersType()

ilObjGroup::getMailToMembersType ( )

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

References $mail_members.

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

327  : int
328  {
329  return $this->mail_members;
330  }
+ Here is the caller graph for this function:

◆ getMaxMembers()

ilObjGroup::getMaxMembers ( )

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

References $reg_max_members.

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

232  : int
233  {
234  return $this->reg_max_members;
235  }
+ Here is the caller graph for this function:

◆ getMemberRoles()

ilObjGroup::getMemberRoles ( int  $a_user_id)

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

References getLocalGroupRoles().

Referenced by leave().

1042  : array
1043  {
1044  return array_intersect(
1045  $this->rbac_review->assignedRoles($a_user_id),
1046  $this->getLocalGroupRoles()
1047  );
1048  }
getLocalGroupRoles(bool $a_translate=false)
get ALL local roles of group, also those created and defined afterwards only fetch data once from dat...
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getMembersObject()

ilObjGroup::getMembersObject ( )

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

References $members_obj, and initParticipants().

Referenced by handleAutoFill().

1390  {
1391  // #17886
1392  if (!$this->members_obj instanceof ilGroupParticipants) {
1393  $this->initParticipants();
1394  }
1395  return $this->members_obj;
1396  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
ilGroupParticipants $members_obj
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getMessage()

ilObjGroup::getMessage ( )

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

References $message.

Referenced by appendMessage().

1306  : string
1307  {
1308  return $this->message;
1309  }
+ Here is the caller graph for this function:

◆ getMinMembers()

ilObjGroup::getMinMembers ( )

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

References $reg_min_members.

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

222  : int
223  {
224  return $this->reg_min_members;
225  }
+ Here is the caller graph for this function:

◆ getNumberOfNextSessions()

ilObjGroup::getNumberOfNextSessions ( )

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

References $session_next.

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

435  : int
436  {
437  return $this->session_next;
438  }
+ Here is the caller graph for this function:

◆ getNumberOfPreviousSessions()

ilObjGroup::getNumberOfPreviousSessions ( )

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

References $session_prev.

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

425  : int
426  {
427  return $this->session_prev;
428  }
+ Here is the caller graph for this function:

◆ getPassword()

ilObjGroup::getPassword ( )

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

References $reg_password.

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

202  : string
203  {
204  return $this->reg_password;
205  }
string $reg_password
+ Here is the caller graph for this function:

◆ getRegistrationAccessCode()

ilObjGroup::getRegistrationAccessCode ( )

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

References $reg_access_code.

Referenced by create(), and update().

302  : string
303  {
304  return $this->reg_access_code;
305  }
string $reg_access_code
+ Here is the caller graph for this function:

◆ getRegistrationEnd()

ilObjGroup::getRegistrationEnd ( )

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

References $reg_end.

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

192  : ?ilDateTime
193  {
194  return $this->reg_end;
195  }
ilDateTime $reg_end
+ Here is the caller graph for this function:

◆ getRegistrationStart()

ilObjGroup::getRegistrationStart ( )

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

References $reg_start.

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

181  : ?ilDateTime
182  {
183  return $this->reg_start;
184  }
ilDateTime $reg_start
+ Here is the caller graph for this function:

◆ getRegistrationType()

ilObjGroup::getRegistrationType ( )

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

References $reg_type.

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

156  : int
157  {
158  return $this->reg_type;
159  }
+ Here is the caller graph for this function:

◆ getShowMembers()

ilObjGroup::getShowMembers ( )

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

References $show_members.

Referenced by read(), and update().

346  : bool
347  {
348  return $this->show_members;
349  }
+ Here is the caller graph for this function:

◆ getStart()

ilObjGroup::getStart ( )

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

References $grp_start.

Referenced by create(), prepareAppointments(), read(), and update().

395  : ?\ilDateTime
396  {
397  return $this->grp_start;
398  }
ilDateTime $grp_start
Date and time handling
+ Here is the caller graph for this function:

◆ getStartTimeIndication()

ilObjGroup::getStartTimeIndication ( )

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

References $start_time_indication.

Referenced by prepareAppointments(), and update().

384  : bool
385  {
387  }
bool $start_time_indication
+ Here is the caller graph for this function:

◆ getSubItems()

ilObjGroup::getSubItems ( bool  $a_admin_panel_enabled = false,
bool  $a_include_side_block = false,
int  $a_get_single = 0,
\ilContainerUserFilter  $container_user_filter = null 
)

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

References ILIAS\Repository\int().

1609  : array {
1610  // Caching
1611  if (
1612  isset($this->items[(int) $a_admin_panel_enabled][(int) $a_include_side_block]) &&
1613  is_array($this->items[(int) $a_admin_panel_enabled][(int) $a_include_side_block])
1614  ) {
1615  return $this->items[(int) $a_admin_panel_enabled][(int) $a_include_side_block];
1616  }
1617  // Results are stored in $this->items
1618  parent::getSubItems($a_admin_panel_enabled, $a_include_side_block, $a_get_single);
1619  $this->items = ilContainerSessionsContentGUI::prepareSessionPresentationLimitation(
1620  $this->items,
1621  $this,
1622  $a_admin_panel_enabled,
1623  $a_include_side_block
1624  );
1625  return $this->items[(int) $a_admin_panel_enabled][(int) $a_include_side_block];
1626  }
+ Here is the call graph for this function:

◆ getViewMode()

ilObjGroup::getViewMode ( )

Get effective container view mode.

Returns
int

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

References ilObject\$tree, $view_mode, ilObject\_lookupObjId(), ilObjCourseAccess\_lookupViewMode(), ilTree\checkForParentType(), ilObject\getId(), ilContainer\VIEW_BY_TYPE, ilContainer\VIEW_DEFAULT, ilContainer\VIEW_INHERIT, ilContainer\VIEW_SESSIONS, and ilContainer\VIEW_SIMPLE.

1213  : int
1214  {
1215  $tree = $this->tree;
1216 
1217  // default: by type
1218  $view = self::lookupViewMode($this->getId());
1219 
1220  if ($view != ilContainer::VIEW_INHERIT) {
1221  return $view;
1222  }
1223 
1224  $container_ref_id = $tree->checkForParentType($this->ref_id, 'crs');
1225  if ($container_ref_id) {
1227  // these three are available...
1228  if (
1232  return $view_mode;
1233  }
1234  }
1236  }
ilTree $tree
static _lookupObjId(int $ref_id)
checkForParentType(int $a_ref_id, string $a_type, bool $a_exclude_source_check=false)
Check for parent type e.g check if a folder (ref_id 3) is in a parent course obj => checkForParentTyp...
static _lookupViewMode(int $a_id)
+ Here is the call graph for this function:

◆ handleAutoFill()

ilObjGroup::handleAutoFill ( )

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

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

1488  : void
1489  {
1490  if ($this->isWaitingListEnabled() &&
1491  $this->hasWaitingListAutoFill()) {
1492  $max = $this->getMaxMembers();
1494  if ($max > $now) {
1495  // see assignFromWaitingListObject()
1496  $waiting_list = new ilGroupWaitingList($this->getId());
1497 
1498  foreach ($waiting_list->getUserIds() as $user_id) {
1499  if (!$tmp_obj = ilObjectFactory::getInstanceByObjId($user_id, false)) {
1500  continue;
1501  }
1502  if ($this->getMembersObject()->isAssigned($user_id)) {
1503  continue;
1504  }
1505  $this->getMembersObject()->add($user_id, ilParticipants::IL_GRP_MEMBER); // #18213
1507  $waiting_list->removeFromList($user_id);
1508 
1509  $now++;
1510  if ($now >= $max) {
1511  break;
1512  }
1513  }
1514  }
1515  }
1516  }
Waiting list for groups.
static getInstanceByObjId(?int $obj_id, bool $stop_on_error=true)
get an instance of an Ilias object by object id
static lookupNumberOfMembers(int $a_ref_id)
Lookup number of members.
+ Here is the call graph for this function:

◆ hasWaitingListAutoFill()

ilObjGroup::hasWaitingListAutoFill ( )

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

References $auto_fill_from_waiting.

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

252  : bool
253  {
255  }
bool $auto_fill_from_waiting
+ Here is the caller graph for this function:

◆ initDefaultRoles()

ilObjGroup::initDefaultRoles ( )

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

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

1062  : void
1063  {
1065  'il_grp_admin_' . $this->getRefId(),
1066  "Groupadmin group obj_no." . $this->getId(),
1067  'il_grp_admin',
1068  $this->getRefId()
1069  );
1070  $this->m_roleAdminId = $role->getId();
1071 
1073  'il_grp_member_' . $this->getRefId(),
1074  "Groupmember of group obj_no." . $this->getId(),
1075  'il_grp_member',
1076  $this->getRefId()
1077  );
1078  $this->m_roleMemberId = $role->getId();
1079  }
static createDefaultRole(string $a_title, string $a_description, string $a_tpl_name, int $a_ref_id)
+ Here is the call graph for this function:

◆ initParticipants()

ilObjGroup::initParticipants ( )
protected

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

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

Referenced by getMembersObject(), and read().

1384  : void
1385  {
1386  $this->members_obj = ilGroupParticipants::_getInstanceByObjId($this->getId());
1387  }
static _getInstanceByObjId(int $a_obj_id)
Get singleton instance.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ isAdmin()

ilObjGroup::isAdmin ( int  $a_userId)

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

References getDefaultGroupRoles().

Referenced by leaveGroup().

1050  : bool
1051  {
1052  $grp_Roles = $this->getDefaultGroupRoles();
1053  if (in_array($a_userId, $this->rbac_review->assignedUsers($grp_Roles["grp_admin_role"]))) {
1054  return true;
1055  } else {
1056  return false;
1057  }
1058  }
getDefaultGroupRoles()
get default group roles, returns the defaultlike create roles il_grp_member, il_grp_admin ...
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ isMembershipLimited()

ilObjGroup::isMembershipLimited ( )

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

References $reg_membership_limitation.

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

212  : bool
213  {
215  }
bool $reg_membership_limitation
+ Here is the caller graph for this function:

◆ isRegistrationAccessCodeEnabled()

ilObjGroup::isRegistrationAccessCodeEnabled ( )

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

References $reg_access_code_enabled.

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

312  : bool
313  {
315  }
bool $reg_access_code_enabled
+ Here is the caller graph for this function:

◆ isRegistrationEnabled()

ilObjGroup::isRegistrationEnabled ( )

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

References getRegistrationType(), and ilGroupConstants\GRP_REGISTRATION_DEACTIVATED.

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

161  : bool
162  {
164  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ isRegistrationUnlimited()

ilObjGroup::isRegistrationUnlimited ( )

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

References $reg_unlimited.

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

171  : bool
172  {
173  return $this->reg_unlimited;
174  }
+ Here is the caller graph for this function:

◆ isSessionLimitEnabled()

ilObjGroup::isSessionLimitEnabled ( )

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

References $session_limit.

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

415  : bool
416  {
417  return $this->session_limit;
418  }
+ Here is the caller graph for this function:

◆ isWaitingListEnabled()

ilObjGroup::isWaitingListEnabled ( )

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

References $waiting_list.

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

242  : bool
243  {
244  return $this->waiting_list;
245  }
+ Here is the caller graph for this function:

◆ leave()

ilObjGroup::leave ( int  $a_user_id)

deassign member from group role

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

References getMemberRoles().

Referenced by leaveGroup().

817  : bool
818  {
819  $arr_groupRoles = $this->getMemberRoles($a_user_id);
820  foreach ($arr_groupRoles as $groupRole) {
821  $this->rbac_admin->deassignUser($groupRole, $a_user_id);
822  }
823  return true;
824  }
getMemberRoles(int $a_user_id)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ leaveGroup()

ilObjGroup::leaveGroup ( )

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

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

799  : int
800  {
801  $member_ids = $this->getGroupMemberIds();
802  if (count($member_ids) <= 1 || !in_array($this->user->getId(), $member_ids)) {
803  return 2;
804  } elseif (!$this->isAdmin($this->user->getId())) {
805  $this->leave($this->user->getId());
806  $this->recommended_content_manager->removeObjectRecommendation($this->user->getId(), $this->getRefId());
807  return 0;
808  } elseif (count($this->getGroupAdminIds()) == 1) {
809  return 1;
810  }
811  return 1;
812  }
getGroupAdminIds(int $a_grpId=0)
isAdmin(int $a_userId)
leave(int $a_user_id)
deassign member from group role
getGroupMemberIds()
get all group Member ids regardless of role
+ Here is the call graph for this function:

◆ lookupGroupStatusTemplateId()

static ilObjGroup::lookupGroupStatusTemplateId ( int  $a_obj_id)
static

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

References $DIC, $ilDB, $query, $res, ilObject\$type, ilDBConstants\FETCHMODE_ASSOC, ilGroupConstants\GRP_TYPE_CLOSED, and ILIAS\Repository\int().

Referenced by ilRbacAdmin\adjustMovedObjectPermissions().

972  : int
973  {
974  global $DIC;
975 
976  $ilDB = $DIC['ilDB'];
977 
978  $type = self::lookupGroupTye($a_obj_id);
980  $query = 'SELECT obj_id FROM object_data WHERE type = ' . $ilDB->quote('rolt', 'text') . ' AND title = ' . $ilDB->quote('il_grp_status_closed', 'text');
981  } else {
982  $query = 'SELECT obj_id FROM object_data WHERE type = ' . $ilDB->quote('rolt', 'text') . ' AND title = ' . $ilDB->quote('il_grp_status_open', 'text');
983  }
984  $res = $ilDB->query($query);
985  $row = $res->fetchRow(ilDBConstants::FETCHMODE_ASSOC);
986  return $row['obj_id'] ? (int) $row['obj_id'] : 0;
987  }
$res
Definition: ltiservices.php:69
string $type
global $DIC
Definition: feed.php:28
$query
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ lookupGroupTye()

static ilObjGroup::lookupGroupTye ( int  $a_id)
static

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

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

Referenced by ilObjRole\createPermissionIntersection().

116  : int
117  {
118  global $DIC;
119 
120  $ilDB = $DIC->database();
121 
122  $query = "SELECT grp_type FROM grp_settings " .
123  "WHERE obj_id = " . $ilDB->quote($a_id, 'integer');
124  $res = $ilDB->query($query);
125  while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
126  return (int) $row->grp_type;
127  }
129  }
$res
Definition: ltiservices.php:69
global $DIC
Definition: feed.php:28
$query
+ Here is the caller graph for this function:

◆ lookupObjectsByCode()

static ilObjGroup::lookupObjectsByCode ( string  $a_code)
static
Returns
int[]
See also
interface.ilMembershipRegistrationCodes

Implements ilMembershipRegistrationCodes.

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

References $DIC, $ilDB, $query, $res, ilDBConstants\FETCHMODE_OBJECT, and ILIAS\Repository\int().

Referenced by ilMembershipRegistrationCodeUtils\lookupObjectsByCode().

1402  : array
1403  {
1404  global $DIC;
1405 
1406  $ilDB = $DIC->database();
1407 
1408  $query = "SELECT obj_id FROM grp_settings " .
1409  "WHERE reg_ac_enabled = " . $ilDB->quote(1, 'integer') . " " .
1410  "AND reg_ac = " . $ilDB->quote($a_code, 'text');
1411  $res = $ilDB->query($query);
1412 
1413  $obj_ids = array();
1414  while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
1415  $obj_ids[] = (int) $row->obj_id;
1416  }
1417  return $obj_ids;
1418  }
$res
Definition: ltiservices.php:69
global $DIC
Definition: feed.php:28
$query
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ lookupShowMembersEnabled()

static ilObjGroup::lookupShowMembersEnabled ( int  $a_obj_id)
static

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

References $DIC, $ilDB, $query, and $res.

Referenced by ilParticipants\hasParticipantListAccess().

1585  : bool
1586  {
1587  global $DIC;
1588  $ilDB = $DIC->database();
1589 
1590  $query = 'SELECT show_members FROM grp_settings'
1591  . ' WHERE obj_id = ' . $ilDB->quote($a_obj_id, 'integer');
1592  $res = $ilDB->query($query);
1593  if ($ilDB->numRows($res) == 0) {
1594  return false;
1595  }
1596  $row = $ilDB->fetchAssoc($res);
1597  return (bool) $row['show_members'];
1598  }
$res
Definition: ltiservices.php:69
global $DIC
Definition: feed.php:28
$query
+ Here is the caller graph for this function:

◆ lookupViewMode()

static ilObjGroup::lookupViewMode (   $a_obj_id)
static

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

References $DIC, $ilDB, $query, $res, $view_mode, ilDBConstants\FETCHMODE_OBJECT, and ILIAS\Repository\int().

Referenced by ilGroupXMLWriter\__buildExtraSettings(), ilObjFolder\getViewMode(), and ilObjGroupGUI\initForm().

1244  : int
1245  {
1246  global $DIC;
1247 
1248  $ilDB = $DIC->database();
1249 
1250  $query = 'SELECT view_mode FROM grp_settings ' .
1251  'WHERE obj_id = ' . $ilDB->quote($a_obj_id, 'integer');
1252  $res = $ilDB->query($query);
1253 
1254  $view_mode = null;
1255  while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
1256  $view_mode = (int) $row->view_mode;
1257  }
1258  return $view_mode;
1259  }
$res
Definition: ltiservices.php:69
global $DIC
Definition: feed.php:28
$query
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ mayLeave()

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

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

References $DIC, $ilDB, $ilUser, and IL_CAL_DATE.

Referenced by ilObjGroupAccess\_checkAccess().

1518  : bool
1519  {
1520  global $DIC;
1521 
1522  $ilUser = $DIC->user();
1523  $ilDB = $DIC->database();
1524 
1525  if (!$a_user_id) {
1526  $a_user_id = $ilUser->getId();
1527  }
1528 
1529  $set = $ilDB->query("SELECT leave_end" .
1530  " FROM grp_settings" .
1531  " WHERE obj_id = " . $ilDB->quote($a_group_id, "integer"));
1532  $row = $ilDB->fetchAssoc($set);
1533  if ($row && isset($row["leave_end"]) && is_numeric($row["leave_end"])) {
1534  // timestamp to date
1535  $limit = date("Ymd", (int) $row["leave_end"]);
1536  if ($limit < date("Ymd")) {
1537  $a_date = new ilDate(date("Y-m-d", (int) $row["leave_end"]), IL_CAL_DATE);
1538  return false;
1539  }
1540  }
1541  return true;
1542  }
global $DIC
Definition: feed.php:28
const IL_CAL_DATE
$ilUser
Definition: imgupload.php:34
+ Here is the caller graph for this function:

◆ prepareAppointments()

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

Prepare calendar appointments.

Returns
ilCalendarAppointmentTemplate[]

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

References $app, getEnd(), ilObject\getLongDescription(), getRegistrationEnd(), getRegistrationStart(), getStart(), getStartTimeIndication(), ilObject\getTitle(), isRegistrationUnlimited(), and ilCalendarEntry\TRANSLATION_SYSTEM.

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

1327  : array
1328  {
1329  switch ($a_mode) {
1330  case 'create':
1331  case 'update':
1332 
1333  $apps = array();
1334  if ($this->getStart() && $this->getEnd()) {
1335  $app = new ilCalendarAppointmentTemplate(self::CAL_START);
1336  $app->setTitle($this->getTitle());
1337  $app->setSubtitle('grp_cal_start');
1338  $app->setTranslationType(ilCalendarEntry::TRANSLATION_SYSTEM);
1339  $app->setDescription($this->getLongDescription());
1340  $app->setStart($this->getStart());
1341  $app->setFullday(!$this->getStartTimeIndication());
1342  $apps[] = $app;
1343 
1344  $app = new ilCalendarAppointmentTemplate(self::CAL_END);
1345  $app->setTitle($this->getTitle());
1346  $app->setSubtitle('grp_cal_end');
1347  $app->setTranslationType(ilCalendarEntry::TRANSLATION_SYSTEM);
1348  $app->setDescription($this->getLongDescription());
1349  $app->setStart($this->getEnd());
1350  $app->setFullday(!$this->getStartTimeIndication());
1351  $apps[] = $app;
1352  }
1353  if ($this->isRegistrationUnlimited()) {
1354  return $apps;
1355  }
1356 
1357  $app = new ilCalendarAppointmentTemplate(self::CAL_REG_START);
1358  $app->setTitle($this->getTitle());
1359  $app->setSubtitle('grp_cal_reg_start');
1360  $app->setTranslationType(ilCalendarEntry::TRANSLATION_SYSTEM);
1361  $app->setDescription($this->getLongDescription());
1362  $app->setStart($this->getRegistrationStart());
1363  $apps[] = $app;
1364 
1365  $app = new ilCalendarAppointmentTemplate(self::CAL_REG_END);
1366  $app->setTitle($this->getTitle());
1367  $app->setSubtitle('grp_cal_reg_end');
1368  $app->setTranslationType(ilCalendarEntry::TRANSLATION_SYSTEM);
1369  $app->setDescription($this->getLongDescription());
1370  $app->setStart($this->getRegistrationEnd());
1371  $apps[] = $app;
1372 
1373 
1374  return $apps;
1375 
1376  case 'delete':
1377  // Nothing to do: The category and all assigned appointments will be deleted.
1378  return array();
1379  }
1380  return [];
1381  }
$app
Definition: cli.php:39
Apointment templates are used for automatic generated apointments.
getLongDescription()
get object long description (stored in object_description)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ read()

ilObjGroup::read ( )

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

References $query, $res, ilCourseDefinedFieldDefinition\_clone(), ilGroupParticipants\_getInstanceByObjId(), ilContainerSortingSettings\_lookupSortMode(), cloneAutoGeneratedRoles(), ilObject\cloneMetaData(), enableMembershipLimitation(), enableRegistrationAccessCode(), enableSessionLimit(), enableUnlimitedRegistration(), enableWaitingList(), ilDBConstants\FETCHMODE_OBJECT, ilMembershipRegistrationCodeUtils\generateCode(), getAutoNotification(), getCancellationEnd(), getEnableGroupMap(), getEnd(), ilObject\getId(), getInformation(), getLatitude(), getLocationZoom(), getLongitude(), getMailToMembersType(), getMaxMembers(), getMinMembers(), getNumberOfNextSessions(), getNumberOfPreviousSessions(), getPassword(), ilObject\getRefId(), getRegistrationEnd(), getRegistrationStart(), getRegistrationType(), getShowMembers(), getStart(), hasWaitingListAutoFill(), IL_CAL_DATE, IL_CAL_DATETIME, IL_CAL_UNIX, ilParticipants\IL_GRP_ADMIN, initParticipants(), isMembershipLimited(), isRegistrationAccessCodeEnabled(), isRegistrationUnlimited(), isSessionLimitEnabled(), isWaitingListEnabled(), ilDidacticTemplateObjSettings\lookupTemplateId(), setAutoNotification(), setCancellationEnd(), setEnableGroupMap(), setGroupType(), setInformation(), setLatitude(), setLocationZoom(), setLongitude(), setMailToMembersType(), setMaxMembers(), setMinMembers(), setNumberOfNextSessions(), setNumberOfPreviousSessions(), ilContainer\setOrderType(), setPassword(), setPeriod(), setRegistrationAccessCode(), setRegistrationEnd(), setRegistrationStart(), setRegistrationType(), setShowMembers(), setViewMode(), setWaitingListAutoFill(), toggleStartTimeIndication(), ILIAS\Repository\user(), and ilTimeZone\UTC.

622  : void
623  {
624  parent::read();
625 
626  $query = "SELECT * FROM grp_settings " .
627  "WHERE obj_id = " . $this->db->quote($this->getId(), 'integer');
628 
629  $res = $this->db->query($query);
630  while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
631  $this->setInformation((string) $row->information);
632  $this->setGroupType((int) $row->grp_type);
633  $this->setRegistrationType((int) $row->registration_type);
634  $this->enableUnlimitedRegistration((bool) $row->registration_unlimited);
635  $this->setRegistrationStart(new ilDateTime($row->registration_start, IL_CAL_DATETIME));
636  $this->setRegistrationEnd(new ilDateTime($row->registration_end, IL_CAL_DATETIME));
637  $this->setPassword((string) $row->registration_password);
638  $this->enableMembershipLimitation((bool) $row->registration_mem_limit);
639  $this->setMaxMembers((int) $row->registration_max_members);
640  $this->enableWaitingList((bool) $row->waiting_list);
641  $this->setLatitude((string) $row->latitude);
642  $this->setLongitude((string) $row->longitude);
643  $this->setLocationZoom((int) $row->location_zoom);
644  $this->setEnableGroupMap((bool) $row->enablemap);
645  $this->enableRegistrationAccessCode((bool) $row->reg_ac_enabled);
646  $this->setRegistrationAccessCode((string) $row->reg_ac);
647  $this->setViewMode((int) $row->view_mode);
648  $this->setMailToMembersType((int) $row->mail_members_type);
649  $this->setCancellationEnd($row->leave_end ? new ilDate((int) $row->leave_end, IL_CAL_UNIX) : null);
650  $this->setMinMembers((int) $row->registration_min_members);
651  $this->setWaitingListAutoFill((bool) $row->auto_wait);
652  $this->setShowMembers((bool) $row->show_members);
653  $this->setAutoNotification((bool) $row->auto_notification);
654  if ($row->period_time_indication) {
655  $this->setPeriod(
656  new \ilDateTime($row->period_start, IL_CAL_DATETIME, \ilTimeZone::UTC),
657  new \ilDateTime($row->period_end, IL_CAL_DATETIME, \ilTimeZone::UTC)
658  );
659  } elseif (!is_null($row->period_start) && !is_null($row->period_end)) {
660  $this->setPeriod(
661  new \ilDate($row->period_start, IL_CAL_DATE),
662  new \ilDate($row->period_end, IL_CAL_DATE)
663  );
664  }
665  $this->toggleStartTimeIndication((bool) $row->period_time_indication);
666  $this->enableSessionLimit((bool) $row->session_limit);
667  $this->setNumberOfPreviousSessions((int) $row->session_prev);
668  $this->setNumberOfNextSessions((int) $row->session_next);
669  }
670  $this->initParticipants();
671 
672  // Inherit order type from parent course (if exists)
674  }
enableUnlimitedRegistration(bool $a_status)
enableWaitingList(bool $a_status)
$res
Definition: ltiservices.php:69
const IL_CAL_DATETIME
setInformation(string $a_information)
setRegistrationStart(?ilDateTime $a_start)
setRegistrationAccessCode(string $a_code)
setMaxMembers(int $a_max)
setLatitude(string $a_latitude)
setNumberOfPreviousSessions(int $a_num)
setShowMembers(bool $a_status)
toggleStartTimeIndication(bool $time_indication)
setNumberOfNextSessions(int $a_num)
const IL_CAL_UNIX
setOrderType(int $a_value)
setPassword(string $a_pass)
setGroupType(int $a_type)
setLocationZoom(int $a_locationzoom)
setRegistrationType(int $a_type)
setRegistrationEnd(?ilDateTime $a_end)
setLongitude(string $a_longitude)
setMinMembers(int $a_max)
setViewMode(int $a_view_mode)
setPeriod(?\ilDateTime $start=null, ?\ilDateTime $end=null)
$query
setWaitingListAutoFill(bool $a_value)
enableMembershipLimitation(bool $a_status)
const IL_CAL_DATE
setCancellationEnd(?ilDate $a_value)
setEnableGroupMap(bool $a_enablemap)
setAutoNotification(bool $a_status)
enableRegistrationAccessCode(bool $a_status)
setMailToMembersType(int $a_type)
enableSessionLimit(bool $a_status)
+ Here is the call graph for this function:

◆ readGroupStatus()

ilObjGroup::readGroupStatus ( )

Read group type.

Returns
int

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

References ilObject\getRefId(), ilGroupConstants\GRP_TYPE_CLOSED, ilGroupConstants\GRP_TYPE_OPEN, and ilDidacticTemplateObjSettings\lookupTemplateId().

1033  : int
1034  {
1036  if (!$tpl_id) {
1038  }
1040  }
+ Here is the call graph for this function:

◆ register()

ilObjGroup::register ( int  $a_user_id,
int  $a_role = ilParticipants::IL_GRP_MEMBER,
bool  $a_force_registration = false 
)
See also
ilMembershipRegistrationCodes::register()

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

References ilDateTime\_after(), ilDateTime\_before(), ilGroupParticipants\_getInstanceByObjId(), ilObjGroupAccess\_usingRegistrationCode(), ilMembershipRegistrationException\ADDED_TO_WAITINGLIST, ilObject\getId(), getMaxMembers(), getRegistrationEnd(), getRegistrationStart(), ilObject\getTitle(), IL_CAL_UNIX, isMembershipLimited(), isRegistrationEnabled(), isRegistrationUnlimited(), isWaitingListEnabled(), ILIAS\Repository\lng(), ilMembershipRegistrationException\OBJECT_IS_FULL, ilMembershipRegistrationException\OUT_OF_REGISTRATION_PERIOD, ilMembershipRegistrationException\REGISTRATION_CODE_DISABLED, ilGroupMembershipMailNotification\TYPE_ADMISSION_MEMBER, ilGroupMembershipMailNotification\TYPE_NOTIFICATION_REGISTRATION, and ilGroupMembershipMailNotification\TYPE_WAITING_LIST_MEMBER.

1428  : void {
1430 
1431  if ($part->isAssigned($a_user_id)) {
1432  return;
1433  }
1434 
1435  if (!$a_force_registration) {
1436  // Availability
1437  if (!$this->isRegistrationEnabled()) {
1439  throw new ilMembershipRegistrationException('Cannot registrate to group ' . $this->getId() .
1440  ', group subscription is deactivated.', ilMembershipRegistrationException::REGISTRATION_CODE_DISABLED);
1441  }
1442  }
1443 
1444  // Time Limitation
1445  if (!$this->isRegistrationUnlimited()) {
1446  $start = $this->getRegistrationStart();
1447  $end = $this->getRegistrationEnd();
1448  $time = new ilDateTime(time(), IL_CAL_UNIX);
1449 
1450  if (!(ilDateTime::_after($time, $start) and ilDateTime::_before($time, $end))) {
1451  throw new ilMembershipRegistrationException('Cannot registrate to group ' . $this->getId() .
1452  ', group is out of registration time.', ilMembershipRegistrationException::OUT_OF_REGISTRATION_PERIOD);
1453  }
1454  }
1455 
1456  // Max members
1457  if ($this->isMembershipLimited()) {
1458  $free = max(0, $this->getMaxMembers() - $part->getCountMembers());
1459  $waiting_list = new ilGroupWaitingList($this->getId());
1460  if ($this->isWaitingListEnabled() and (!$free or $waiting_list->getCountUsers())) {
1461  $this->lng->loadLanguageModule("grp");
1462  $waiting_list->addToList($a_user_id);
1463 
1464  $info = sprintf(
1465  $this->lng->txt('grp_added_to_list'),
1466  $this->getTitle(),
1467  $waiting_list->getPosition($a_user_id)
1468  );
1469 
1470  $participants = ilGroupParticipants::_getInstanceByObjId($this->getId());
1471  $participants->sendNotification(ilGroupMembershipMailNotification::TYPE_WAITING_LIST_MEMBER, $a_user_id);
1472 
1474  }
1475 
1476  if (!$free or $waiting_list->getCountUsers()) {
1477  throw new ilMembershipRegistrationException('Cannot registrate to group ' . $this->getId() .
1478  ', membership is limited.', ilMembershipRegistrationException::OBJECT_IS_FULL);
1479  }
1480  }
1481  }
1482 
1483  $part->add($a_user_id, $a_role);
1484  $part->sendNotification(ilGroupMembershipMailNotification::TYPE_ADMISSION_MEMBER, $a_user_id);
1485  $part->sendNotification(ilGroupMembershipMailNotification::TYPE_NOTIFICATION_REGISTRATION, $a_user_id);
1486  }
static _before(ilDateTime $start, ilDateTime $end, string $a_compare_field='', string $a_tz='')
compare two dates and check start is before end This method does not consider tz offsets.
const IL_CAL_UNIX
static _after(ilDateTime $start, ilDateTime $end, string $a_compare_field='', string $a_tz='')
compare two dates and check start is after end This method does not consider tz offsets.
Waiting list for groups.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static _getInstanceByObjId(int $a_obj_id)
Get singleton instance.
+ Here is the call graph for this function:

◆ setAutoNotification()

ilObjGroup::setAutoNotification ( bool  $a_status)

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

Referenced by read().

351  : void
352  {
353  $this->auto_notification = $a_status;
354  }
+ Here is the caller graph for this function:

◆ setCancellationEnd()

ilObjGroup::setCancellationEnd ( ?ilDate  $a_value)

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

Referenced by read().

332  : void
333  {
334  $this->leave_end = $a_value;
335  }
+ Here is the caller graph for this function:

◆ setEnableGroupMap()

ilObjGroup::setEnableGroupMap ( bool  $a_enablemap)

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

Referenced by read().

287  : void
288  {
289  $this->enablemap = $a_enablemap;
290  }
+ Here is the caller graph for this function:

◆ setEnd()

ilObjGroup::setEnd ( ilDateTime  $a_value = null)
protected

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

Referenced by setPeriod().

400  : void
401  {
402  $this->grp_end = $a_value;
403  }
+ Here is the caller graph for this function:

◆ setGroupStatus()

ilObjGroup::setGroupStatus ( int  $a_status)

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

1016  : void
1017  {
1018  $this->group_status = $a_status;
1019  }

◆ setGroupType()

ilObjGroup::setGroupType ( int  $a_type)

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

Referenced by read().

141  : void
142  {
143  $this->group_type = $a_type;
144  }
+ Here is the caller graph for this function:

◆ setInformation()

ilObjGroup::setInformation ( string  $a_information)

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

Referenced by read().

131  : void
132  {
133  $this->information = $a_information;
134  }
+ Here is the caller graph for this function:

◆ setLatitude()

ilObjGroup::setLatitude ( string  $a_latitude)

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

Referenced by read().

257  : void
258  {
259  $this->latitude = $a_latitude;
260  }
+ Here is the caller graph for this function:

◆ setLocationZoom()

ilObjGroup::setLocationZoom ( int  $a_locationzoom)

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

Referenced by read().

277  : void
278  {
279  $this->locationzoom = $a_locationzoom;
280  }
+ Here is the caller graph for this function:

◆ setLongitude()

ilObjGroup::setLongitude ( string  $a_longitude)

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

Referenced by read().

267  : void
268  {
269  $this->longitude = $a_longitude;
270  }
+ Here is the caller graph for this function:

◆ setMailToMembersType()

ilObjGroup::setMailToMembersType ( int  $a_type)

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

Referenced by read().

322  : void
323  {
324  $this->mail_members = $a_type;
325  }
+ Here is the caller graph for this function:

◆ setMaxMembers()

ilObjGroup::setMaxMembers ( int  $a_max)

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

Referenced by read().

227  : void
228  {
229  $this->reg_max_members = $a_max;
230  }
+ Here is the caller graph for this function:

◆ setMessage()

ilObjGroup::setMessage ( string  $a_message)

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

1311  : void
1312  {
1313  $this->message = $a_message;
1314  }

◆ setMinMembers()

ilObjGroup::setMinMembers ( int  $a_max)

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

Referenced by read().

217  : void
218  {
219  $this->reg_min_members = $a_max;
220  }
+ Here is the caller graph for this function:

◆ setNumberOfNextSessions()

ilObjGroup::setNumberOfNextSessions ( int  $a_num)

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

Referenced by read().

430  : void
431  {
432  $this->session_next = $a_num;
433  }
+ Here is the caller graph for this function:

◆ setNumberOfPreviousSessions()

ilObjGroup::setNumberOfPreviousSessions ( int  $a_num)

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

Referenced by read().

420  : void
421  {
422  $this->session_prev = $a_num;
423  }
+ Here is the caller graph for this function:

◆ setParentRolePermissions()

ilObjGroup::setParentRolePermissions ( int  $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.

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

References getGrpStatusOpenTemplateId(), ilObject\getRefId(), ilObject\getType(), and ROLE_FOLDER_ID.

Referenced by applyDidacticTemplate().

1089  : bool
1090  {
1091  $parent_roles = $this->rbac_review->getParentRoleIds($a_parent_ref);
1092  foreach ($parent_roles as $parent_role) {
1093  if ($parent_role['parent'] == $this->getRefId()) {
1094  continue;
1095  }
1096  if ($this->rbac_review->isProtected((int) $parent_role['parent'], (int) $parent_role['rol_id'])) {
1097  $operations = $this->rbac_review->getOperationsOfRole(
1098  (int) $parent_role['obj_id'],
1099  $this->getType(),
1100  (int) $parent_role['parent']
1101  );
1102  $this->rbac_admin->grantPermission(
1103  (int) $parent_role['obj_id'],
1104  $operations,
1105  $this->getRefId()
1106  );
1107  continue;
1108  }
1109 
1110  $this->rbac_admin->initIntersectionPermissions(
1111  $this->getRefId(),
1112  (int) $parent_role['obj_id'],
1113  (int) $parent_role['parent'],
1114  $this->getGrpStatusOpenTemplateId(),
1116  );
1117  }
1118  return true;
1119  }
getGrpStatusOpenTemplateId()
get group status open template
const ROLE_FOLDER_ID
Definition: constants.php:34
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setPassword()

ilObjGroup::setPassword ( string  $a_pass)

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

Referenced by read().

197  : void
198  {
199  $this->reg_password = $a_pass;
200  }
+ Here is the caller graph for this function:

◆ setPeriod()

ilObjGroup::setPeriod ( ?\ilDateTime  $start = null,
?\ilDateTime  $end = null 
)

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

References setEnd(), setStart(), and toggleStartTimeIndication().

Referenced by read().

361  : void
362  {
363  if (
364  ($start instanceof \ilDate && !$end instanceof ilDate) ||
365  ($end instanceof \ilDate && !$start instanceof ilDate)
366  ) {
367  throw new InvalidArgumentException('Different date types not supported.');
368  }
369 
370  if ($start instanceof \ilDate) {
371  $this->toggleStartTimeIndication(false);
372  } else {
373  $this->toggleStartTimeIndication(true);
374  }
375  $this->setStart($start);
376  $this->setEnd($end);
377  }
setEnd(ilDateTime $a_value=null)
toggleStartTimeIndication(bool $time_indication)
setStart(ilDateTime $a_value=null)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setRegistrationAccessCode()

ilObjGroup::setRegistrationAccessCode ( string  $a_code)

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

Referenced by read().

307  : void
308  {
309  $this->reg_access_code = $a_code;
310  }
+ Here is the caller graph for this function:

◆ setRegistrationEnd()

ilObjGroup::setRegistrationEnd ( ?ilDateTime  $a_end)

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

Referenced by read().

187  : void
188  {
189  $this->reg_end = $a_end;
190  }
+ Here is the caller graph for this function:

◆ setRegistrationStart()

ilObjGroup::setRegistrationStart ( ?ilDateTime  $a_start)

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

Referenced by read().

176  : void
177  {
178  $this->reg_start = $a_start;
179  }
+ Here is the caller graph for this function:

◆ setRegistrationType()

ilObjGroup::setRegistrationType ( int  $a_type)

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

Referenced by read().

151  : void
152  {
153  $this->reg_type = $a_type;
154  }
+ Here is the caller graph for this function:

◆ setShowMembers()

ilObjGroup::setShowMembers ( bool  $a_status)

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

Referenced by read().

342  : void
343  {
344  $this->show_members = $a_status;
345  }
+ Here is the caller graph for this function:

◆ setStart()

ilObjGroup::setStart ( ilDateTime  $a_value = null)
protected

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

Referenced by setPeriod().

390  : void
391  {
392  $this->grp_start = $a_value;
393  }
+ Here is the caller graph for this function:

◆ setViewMode()

ilObjGroup::setViewMode ( int  $a_view_mode)

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

Referenced by read().

1239  : void
1240  {
1241  $this->view_mode = $a_view_mode;
1242  }
+ Here is the caller graph for this function:

◆ setWaitingListAutoFill()

ilObjGroup::setWaitingListAutoFill ( bool  $a_value)

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

Referenced by read().

247  : void
248  {
249  $this->auto_fill_from_waiting = $a_value;
250  }
+ Here is the caller graph for this function:

◆ toggleStartTimeIndication()

ilObjGroup::toggleStartTimeIndication ( bool  $time_indication)
protected

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

Referenced by read(), and setPeriod().

379  : void
380  {
381  $this->start_time_indication = $time_indication;
382  }
+ Here is the caller graph for this function:

◆ translateViewMode()

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

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

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

1261  : int
1262  {
1263  global $DIC;
1264 
1265  $tree = $DIC['tree'];
1266 
1267  if (!$a_view_mode) {
1268  $a_view_mode = ilContainer::VIEW_DEFAULT;
1269  }
1270 
1271  // view mode is inherit => check for parent course
1272  if ($a_view_mode == ilContainer::VIEW_INHERIT) {
1273  if (!$a_ref_id) {
1274  $ref = ilObject::_getAllReferences($a_obj_id);
1275  $a_ref_id = end($ref);
1276  }
1277 
1278  $crs_ref = $tree->checkForParentType($a_ref_id, 'crs');
1279  if (!$crs_ref) {
1281  }
1282 
1284 
1285  // validate course view mode
1286  if (!in_array($view_mode, array(ilContainer::VIEW_SESSIONS,
1289  }
1290 
1291  return $view_mode;
1292  }
1293 
1294  return $a_view_mode;
1295  }
static _getAllReferences(int $id)
get all reference ids for object ID
ilTree $tree
static _lookupViewMode(int $a_id)
static _lookupObjId(int $ref_id)
global $DIC
Definition: feed.php:28
checkForParentType(int $a_ref_id, string $a_type, bool $a_exclude_source_check=false)
Check for parent type e.g check if a folder (ref_id 3) is in a parent course obj => checkForParentTyp...
+ Here is the call graph for this function:

◆ update()

ilObjGroup::update ( )

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

References $query, $res, ilCalendarUtil\convertDateToUtcDBTimestamp(), getAutoNotification(), getCancellationEnd(), getEnableGroupMap(), getEnd(), getGroupType(), ilObject\getId(), getInformation(), getLatitude(), getLocationZoom(), getLongitude(), getMailToMembersType(), getMaxMembers(), getMinMembers(), getNumberOfNextSessions(), getNumberOfPreviousSessions(), getPassword(), getRegistrationAccessCode(), getRegistrationEnd(), getRegistrationStart(), getRegistrationType(), getShowMembers(), getStart(), getStartTimeIndication(), hasWaitingListAutoFill(), IL_CAL_DATETIME, IL_CAL_UNIX, isMembershipLimited(), isRegistrationAccessCodeEnabled(), isRegistrationEnabled(), isRegistrationUnlimited(), isSessionLimitEnabled(), isWaitingListEnabled(), prepareAppointments(), ilDBConstants\T_INTEGER, ilDBConstants\T_TIMESTAMP, and ilObject\updateMetaData().

537  : bool
538  {
539  if (!parent::update()) {
540  return false;
541  }
542 
543  $this->updateMetaData();
544 
545  $query = "UPDATE grp_settings " .
546  "SET information = " . $this->db->quote($this->getInformation(), 'text') . ", " .
547  "grp_type = " . $this->db->quote($this->getGroupType(), 'integer') . ", " .
548  "registration_type = " . $this->db->quote($this->getRegistrationType(), 'integer') . ", " .
549  "registration_enabled = " . $this->db->quote($this->isRegistrationEnabled() ? 1 : 0, 'integer') . ", " .
550  "registration_unlimited = " . $this->db->quote($this->isRegistrationUnlimited() ? 1 : 0, 'integer') . ", " .
551  "registration_start = " . $this->db->quote(($this->getRegistrationStart() && !$this->getRegistrationStart()->isNull()) ? $this->getRegistrationStart()->get(IL_CAL_DATETIME, '') : null, 'timestamp') . ", " .
552  "registration_end = " . $this->db->quote(($this->getRegistrationEnd() && !$this->getRegistrationEnd()->isNull()) ? $this->getRegistrationEnd()->get(IL_CAL_DATETIME, '') : null, 'timestamp') . ", " .
553  "registration_password = " . $this->db->quote($this->getPassword(), 'text') . ", " .
554 // "registration_membership_limited = ".$this->db->quote((int) $this->isMembershipLimited() ,'integer').", ".
555  "registration_mem_limit = " . $this->db->quote((int) $this->isMembershipLimited(), 'integer') . ", " .
556  "registration_max_members = " . $this->db->quote($this->getMaxMembers(), 'integer') . ", " .
557  "waiting_list = " . $this->db->quote($this->isWaitingListEnabled() ? 1 : 0, 'integer') . ", " .
558  "latitude = " . $this->db->quote($this->getLatitude(), 'text') . ", " .
559  "longitude = " . $this->db->quote($this->getLongitude(), 'text') . ", " .
560  "location_zoom = " . $this->db->quote($this->getLocationZoom(), 'integer') . ", " .
561  "enablemap = " . $this->db->quote((int) $this->getEnableGroupMap(), 'integer') . ", " .
562  'reg_ac_enabled = ' . $this->db->quote($this->isRegistrationAccessCodeEnabled(), 'integer') . ', ' .
563  'reg_ac = ' . $this->db->quote($this->getRegistrationAccessCode(), 'text') . ', ' .
564  'view_mode = ' . $this->db->quote($this->view_mode, 'integer') . ', ' .
565  'mail_members_type = ' . $this->db->quote($this->getMailToMembersType(), 'integer') . ', ' .
566  'leave_end = ' . $this->db->quote(($this->getCancellationEnd() && !$this->getCancellationEnd()->isNull()) ? $this->getCancellationEnd()->get(IL_CAL_UNIX) : null, 'integer') . ', ' .
567  "registration_min_members = " . $this->db->quote($this->getMinMembers(), 'integer') . ", " .
568  "auto_wait = " . $this->db->quote($this->hasWaitingListAutoFill(), 'integer') . ", " .
569  "show_members = " . $this->db->quote((int) $this->getShowMembers(), 'integer') . ", " .
570  'period_start = ' . $this->db->quote(\ilCalendarUtil::convertDateToUtcDBTimestamp($this->getStart()), \ilDBConstants::T_TIMESTAMP) . ', ' .
571  'period_end = ' . $this->db->quote(\ilCalendarUtil::convertDateToUtcDBTimestamp($this->getEnd()), \ilDBConstants::T_TIMESTAMP) . ', ' .
572  'period_time_indication = ' . $this->db->quote($this->getStartTimeIndication() ? 1 : 0, \ilDBConstants::T_INTEGER) . ', ' .
573  'auto_notification = ' . $this->db->quote($this->getAutoNotification(), \ilDBConstants::T_INTEGER) . ', ' .
574  'session_limit = ' . $this->db->quote($this->isSessionLimitEnabled(), ilDBConstants::T_INTEGER) . ', ' .
575  'session_prev = ' . $this->db->quote($this->getNumberOfPreviousSessions(), ilDBConstants::T_INTEGER) . ', ' .
576  'session_next = ' . $this->db->quote($this->getNumberOfNextSessions(), ilDBConstants::T_INTEGER) . ' ' .
577  "WHERE obj_id = " . $this->db->quote($this->getId(), 'integer');
578  $res = $this->db->manipulate($query);
579 
580  $this->app_event_handler->raise(
581  'Modules/Group',
582  'update',
583  array('object' => $this,
584  'obj_id' => $this->getId(),
585  'appointments' => $this->prepareAppointments('update'))
586  );
587  return true;
588  }
$res
Definition: ltiservices.php:69
const IL_CAL_DATETIME
static convertDateToUtcDBTimestamp(\ilDateTime $date=null)
const IL_CAL_UNIX
prepareAppointments($a_mode='create')
Prepare calendar appointments.
$query
isRegistrationAccessCodeEnabled()
+ Here is the call graph for this function:

◆ updateGroupType()

ilObjGroup::updateGroupType ( int  $a_group_type = ilGroupConstants::GRP_TYPE_OPEN)

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

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

References applyDidacticTemplate(), ilDidacticTemplateSettings\getInstanceByObjectType(), ilObject\getType(), ilGroupConstants\GRP_TYPE_OPEN, and ILIAS\Repository\logger().

998  : void {
999  if ($a_group_type == ilGroupConstants::GRP_TYPE_OPEN) {
1000  $this->applyDidacticTemplate(0);
1001  return;
1002  }
1003  $templates = ilDidacticTemplateSettings::getInstanceByObjectType($this->getType())->getTemplates();
1004  foreach ($templates as $template) {
1005  // the closed template
1006  if ($template->isAutoGenerated()) {
1007  $this->logger->info('Appying default closed template');
1008  $this->applyDidacticTemplate($template->getId());
1009  return;
1010  }
1011  }
1012  $this->logger->warning('No closed didactic template available.');
1013  }
applyDidacticTemplate(int $a_tpl_id)
static getInstanceByObjectType(string $a_obj_type)
+ Here is the call graph for this function:

◆ validate()

ilObjGroup::validate ( )

validate group settings

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

References getMaxMembers(), getMinMembers(), getPassword(), getRegistrationEnd(), getRegistrationStart(), getRegistrationType(), ilObject\getTitle(), ilGroupConstants\GRP_REGISTRATION_PASSWORD, isMembershipLimited(), isWaitingListEnabled(), and ILIAS\Repository\lng().

444  : bool
445  {
446  if (!$this->getTitle()) {
447  $this->title = '';
448  $this->error->appendMessage($this->lng->txt(self::ERR_MISSING_TITLE));
449  }
450  if ($this->getRegistrationType() == ilGroupConstants::GRP_REGISTRATION_PASSWORD and !strlen($this->getPassword())) {
451  $this->error->appendMessage($this->lng->txt(self::ERR_MISSING_PASSWORD));
452  }
453  if ($this->isMembershipLimited()) {
454  if ($this->getMinMembers() <= 0 && $this->getMaxMembers() <= 0) {
455  $this->error->appendMessage($this->lng->txt(self::ERR_MISSING_MIN_MAX_MEMBERS));
456  }
457  if ($this->getMaxMembers() <= 0 && $this->isWaitingListEnabled()) {
458  $this->error->appendMessage($this->lng->txt(self::ERR_WRONG_MAX_MEMBERS));
459  }
460  if ($this->getMaxMembers() > 0 && $this->getMinMembers() > $this->getMaxMembers()) {
461  $this->error->appendMessage($this->lng->txt(self::ERR_WRONG_MIN_MAX_MEMBERS));
462  }
463  }
464  if (
465  ($this->getRegistrationStart() && !$this->getRegistrationEnd()) ||
466  (!$this->getRegistrationStart() && $this->getRegistrationEnd()) ||
467  $this->getRegistrationEnd() <= $this->getRegistrationStart()
468  ) {
469  $this->error->appendMessage($this->lng->txt((self::ERR_WRONG_REGISTRATION_LIMITED)));
470  }
471  return strlen($this->error->getMessage()) == 0;
472  }
+ Here is the call graph for this function:

Field Documentation

◆ $auto_fill_from_waiting

bool ilObjGroup::$auto_fill_from_waiting = false
private

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

Referenced by hasWaitingListAutoFill().

◆ $auto_notification

bool ilObjGroup::$auto_notification = true
private

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

Referenced by getAutoNotification().

◆ $enablemap

bool ilObjGroup::$enablemap = false
private

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

Referenced by getEnableGroupMap().

◆ $group_status

int ilObjGroup::$group_status = 0
private

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

Referenced by getGroupStatus().

◆ $group_type

int ilObjGroup::$group_type = ilGroupConstants::GRP_TYPE_UNKNOWN
private

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

Referenced by getGroupType().

◆ $grp_end

ilDateTime ilObjGroup::$grp_end = null
private

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

Referenced by getEnd().

◆ $grp_start

ilDateTime ilObjGroup::$grp_start = null
private

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

Referenced by getStart().

◆ $information

string ilObjGroup::$information = ''
private

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

Referenced by getInformation().

◆ $latitude

string ilObjGroup::$latitude = ''
private

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

Referenced by getLatitude().

◆ $leave_end

ilDate ilObjGroup::$leave_end = null
private

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

Referenced by getCancellationEnd().

◆ $locationzoom

int ilObjGroup::$locationzoom = 0
private

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

Referenced by getLocationZoom().

◆ $logger

ilLogger ilObjGroup::$logger
private

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

◆ $longitude

string ilObjGroup::$longitude = ''
private

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

Referenced by getLongitude().

◆ $m_roleAdminId

ilObjGroup::$m_roleAdminId

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

◆ $m_roleMemberId

ilObjGroup::$m_roleMemberId

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

◆ $mail_members

int ilObjGroup::$mail_members = self::MAIL_ALLOWED_ALL
private

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

Referenced by getMailToMembersType().

◆ $members_obj

ilGroupParticipants ilObjGroup::$members_obj

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

Referenced by getMembersObject().

◆ $message

string ilObjGroup::$message = ''
private

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

Referenced by getMessage().

◆ $reg_access_code

string ilObjGroup::$reg_access_code = ''
private

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

Referenced by getRegistrationAccessCode().

◆ $reg_access_code_enabled

bool ilObjGroup::$reg_access_code_enabled = false
private

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

Referenced by isRegistrationAccessCodeEnabled().

◆ $reg_end

ilDateTime ilObjGroup::$reg_end = null
private

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

Referenced by getRegistrationEnd().

◆ $reg_max_members

int ilObjGroup::$reg_max_members = 0
private

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

Referenced by getMaxMembers().

◆ $reg_membership_limitation

bool ilObjGroup::$reg_membership_limitation = false
private

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

Referenced by isMembershipLimited().

◆ $reg_min_members

int ilObjGroup::$reg_min_members = 0
private

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

Referenced by getMinMembers().

◆ $reg_password

string ilObjGroup::$reg_password = ''
private

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

Referenced by getPassword().

◆ $reg_start

ilDateTime ilObjGroup::$reg_start = null
private

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

Referenced by getRegistrationStart().

◆ $reg_type

int ilObjGroup::$reg_type = ilGroupConstants::GRP_REGISTRATION_DIRECT
private

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

Referenced by getRegistrationType().

◆ $reg_unlimited

bool ilObjGroup::$reg_unlimited = true
private

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

Referenced by isRegistrationUnlimited().

◆ $session_limit

bool ilObjGroup::$session_limit = false
private

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

Referenced by isSessionLimitEnabled().

◆ $session_next

int ilObjGroup::$session_next = -1
private

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

Referenced by getNumberOfNextSessions().

◆ $session_prev

int ilObjGroup::$session_prev = -1
private

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

Referenced by getNumberOfPreviousSessions().

◆ $show_members

bool ilObjGroup::$show_members = true
private

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.

◆ $start_time_indication

bool ilObjGroup::$start_time_indication = false
private

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

Referenced by getStartTimeIndication().

◆ $view_mode

int ilObjGroup::$view_mode = ilContainer::VIEW_DEFAULT
private

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

Referenced by getViewMode(), lookupViewMode(), and translateViewMode().

◆ $waiting_list

bool ilObjGroup::$waiting_list = false
private

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

Referenced by isWaitingListEnabled().

◆ CAL_END

const ilObjGroup::CAL_END = 4

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

◆ CAL_REG_END

const ilObjGroup::CAL_REG_END = 2

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

◆ CAL_REG_START

const ilObjGroup::CAL_REG_START = 1

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

◆ CAL_START

const ilObjGroup::CAL_START = 3

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

◆ 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: