ILIAS  trunk Revision v11.0_alpha-1811-gd2d5443e411
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator 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 ()
 
- Public Member Functions inherited from ilObject
 getObjectProperties ()
 
 flushObjectProperties ()
 
 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 $description)
 
 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 getIconForType (string $type)
 
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)
 

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 = ''
 
array $local_roles = []
 

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
 
LOMServices $lom_services
 
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 = ""
 
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
News $news
 
ILIAS Style Content DomainService $content_style_domain
 
ILIAS Container InternalDomainService $domain
 
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
 
array $type_grps = null
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

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

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

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

105  {
106  global $DIC;
107 
108  $tree = $DIC['tree'];
109 
110  $this->tree = &$tree;
111 
112  $this->type = "grp";
113  parent::__construct($a_id, $a_call_by_reference);
114 
115  $this->logger = $DIC->logger()->grp();
116  }
ilTree $tree
global $DIC
Definition: shib_login.php:22
__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 1196 of file class.ilObjGroup.php.

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

Referenced by _isMember().

1196  : array
1197  {
1198  // get reference
1199  $ref_ids = ilObject::_getAllReferences($a_obj_id);
1200  $ref_id = current($ref_ids);
1201 
1202  $local_roles = $this->rbac_review->getRolesOfRoleFolder($ref_id, false);
1203 
1204  $users = array();
1205  foreach ($local_roles as $role_id) {
1206  $users = array_merge($users, $this->rbac_review->assignedUsers($role_id));
1207  }
1208  return array_unique($users);
1209  }
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 1153 of file class.ilObjGroup.php.

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

Referenced by ilObjCourseGrouping\_checkGroupingDependencies().

1153  : bool
1154  {
1155  $local_roles = $this->rbac_review->getRolesOfRoleFolder($a_ref_id, false);
1156  $user_roles = $this->rbac_review->assignedRoles($a_user_id);
1157 
1158  // Used for membership limitations -> check membership by given field
1159  if ($a_field) {
1160  $tmp_user = ilObjectFactory::getInstanceByObjId($a_user_id);
1161  if (!$tmp_user instanceof ilObjUser) {
1162  throw new DomainException('Invalid user id given: ' . $a_user_id);
1163  }
1164  switch ($a_field) {
1165  case 'login':
1166  $and = "AND login = '" . $tmp_user->getLogin() . "' ";
1167  break;
1168  case 'email':
1169  $and = "AND email = '" . $tmp_user->getEmail() . "' ";
1170  break;
1171  case 'matriculation':
1172  $and = "AND matriculation = '" . $tmp_user->getMatriculation() . "' ";
1173  break;
1174 
1175  default:
1176  $and = "AND usr_id = '" . $a_user_id . "'";
1177  break;
1178  }
1179  if (!$members = ilObjGroup::_getMembers(ilObject::_lookupObjId($a_ref_id))) {
1180  return false;
1181  }
1182  $query = "SELECT * FROM usr_data as ud " .
1183  "WHERE usr_id IN (" . implode(",", ilArrayUtil::quoteArray($members)) . ") " .
1184  $and;
1185  $res = $this->db->query($query);
1186  return (bool) $res->numRows();
1187  }
1188 
1189  if (!array_intersect($local_roles, $user_roles)) {
1190  return false;
1191  }
1192 
1193  return true;
1194  }
$res
Definition: ltiservices.php:66
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)
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 1138 of file class.ilObjGroup.php.

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

Referenced by ilMailAddressTypeHelperImpl\getGroupObjIdByTitle().

1138  : int
1139  {
1140  global $DIC;
1141 
1142  $ilDB = $DIC['ilDB'];
1143  $query = "SELECT * FROM object_data WHERE title = " .
1144  $ilDB->quote($a_title, 'text') . " AND type = 'grp'";
1145  $res = $ilDB->query($query);
1146  while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
1147  return $row->obj_id;
1148  }
1149  return 0;
1150  }
$res
Definition: ltiservices.php:66
global $DIC
Definition: shib_login.php:22
+ 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 1303 of file class.ilObjGroup.php.

References ilObjectActivation\addAdditionalSubItemInformation().

1303  : void
1304  {
1306  }
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 1317 of file class.ilObjGroup.php.

References getMessage().

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

◆ applyDidacticTemplate()

ilObjGroup::applyDidacticTemplate ( int  $a_tpl_id)

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

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

Referenced by updateGroupType().

1127  : void
1128  {
1129  parent::applyDidacticTemplate($a_tpl_id);
1130 
1131  if (!$a_tpl_id) {
1132  // init default type
1133  $this->setParentRolePermissions($this->getRefId());
1134  }
1135  }
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 763 of file class.ilObjGroup.php.

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

Referenced by read().

763  : void
764  {
765  $admin = $this->getDefaultAdminRole();
766  $new_admin = $new_obj->getDefaultAdminRole();
767  if (!$admin || !$new_admin || !$this->getRefId() || !$new_obj->getRefId()) {
768  $this->logger->warning('Error cloning auto generated rol: il_grp_admin');
769  }
770  $this->rbac_admin->copyRolePermissions($admin, $this->getRefId(), $new_obj->getRefId(), $new_admin, true);
771  $this->logger->info('Finished copying of role il_grp_admin.');
772 
773  $member = $this->getDefaultMemberRole();
774  $new_member = $new_obj->getDefaultMemberRole();
775  if (!$member || !$new_member) {
776  $this->logger->warning('Error cloning auto generated rol: il_grp_member');
777  }
778  $this->rbac_admin->copyRolePermissions($member, $this->getRefId(), $new_obj->getRefId(), $new_member, true);
779  $this->logger->info('Finished copying of role il_grp_member.');
780  }
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 745 of file class.ilObjGroup.php.

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

745  : bool
746  {
747  parent::cloneDependencies($a_target_id, $a_copy_id);
748 
749  ilObjectActivation::cloneDependencies($this->getRefId(), $a_target_id, $a_copy_id);
750 
751  // clone membership limitation
752  foreach (\ilObjCourseGrouping::_getGroupings($this->getId()) as $grouping_id) {
753  $this->logger->info('Handling grouping id: ' . $grouping_id);
754  $grouping = new \ilObjCourseGrouping($grouping_id);
755  $grouping->cloneGrouping($a_target_id, $a_copy_id);
756  }
757  return true;
758  }
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 482 of file class.ilObjGroup.php.

References $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(), null, prepareAppointments(), and ilDBConstants\T_INTEGER.

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

◆ delete()

ilObjGroup::delete ( )

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

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

595  : bool
596  {
597  // always call parent delete function first!!
598  if (!parent::delete()) {
599  return false;
600  }
601 
602  $this->deleteMetaData();
603 
604  $query = "DELETE FROM grp_settings " .
605  "WHERE obj_id = " . $this->db->quote($this->getId(), 'integer');
606  $res = $this->db->manipulate($query);
607 
609 
610  $this->app_event_handler->raise(
611  'components/ILIAS/Group',
612  'delete',
613  array('object' => $this,
614  'obj_id' => $this->getId(),
615  'appointments' => $this->prepareAppointments('delete'))
616  );
617  return true;
618  }
$res
Definition: ltiservices.php:66
prepareAppointments($a_mode='create')
Prepare calendar appointments.
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 209 of file class.ilObjGroup.php.

Referenced by read().

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

◆ enableRegistrationAccessCode()

ilObjGroup::enableRegistrationAccessCode ( bool  $a_status)

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

Referenced by read().

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

◆ enableSessionLimit()

ilObjGroup::enableSessionLimit ( bool  $a_status)

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

Referenced by read().

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

◆ enableUnlimitedRegistration()

ilObjGroup::enableUnlimitedRegistration ( bool  $a_status)

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

Referenced by read().

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

◆ enableWaitingList()

ilObjGroup::enableWaitingList ( bool  $a_status)

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

Referenced by read().

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

◆ findGroupsWithNotEnoughMembers()

static ilObjGroup::findGroupsWithNotEnoughMembers ( )
static

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

References $DIC, $ilDB, $q, $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().

1546  : array
1547  {
1548  global $DIC;
1549  $ilDB = $DIC->database();
1550  $tree = $DIC->repositoryTree();
1551 
1552  $res = array();
1553  $before = new ilDateTime(time(), IL_CAL_UNIX);
1554  $now_date = $before->get(IL_CAL_DATETIME, '', ilTimeZone::UTC);
1555  /*
1556  * For groups, registration_start and registration_end are currently not
1557  * persisted in UTC but the local timezone, so when fetching the current time
1558  * here we need to do the same.
1559  */
1560  $now_date_local = $before->get(IL_CAL_DATETIME);
1561  $now = $before->get(IL_CAL_UNIX);
1562 
1563  $set = $ilDB->query($q = "SELECT obj_id, registration_min_members" .
1564  " FROM grp_settings" .
1565  " WHERE registration_min_members > " . $ilDB->quote(0, "integer") .
1566  " AND registration_mem_limit = " . $ilDB->quote(1, "integer") . // #17206
1567  " AND ((leave_end IS NOT NULL" .
1568  " AND leave_end < " . $ilDB->quote($now, "integer") . ")" .
1569  " OR (leave_end IS NULL" .
1570  " AND registration_end IS NOT NULL" .
1571  " AND registration_end < " . $ilDB->quote($now_date_local, "text") . "))" .
1572  " AND (period_start IS NULL OR period_start > " . $ilDB->quote($now_date, ilDBConstants::T_TEXT) . ")");
1573  while ($row = $ilDB->fetchAssoc($set)) {
1574  $refs = ilObject::_getAllReferences((int) $row['obj_id']);
1575  $ref = end($refs);
1576 
1577  if ($tree->isDeleted($ref)) {
1578  continue;
1579  }
1580 
1581  $part = new ilGroupParticipants((int) $row["obj_id"]);
1582  $reci = $part->getNotificationRecipients();
1583  if (sizeof($reci)) {
1584  $missing = (int) $row["registration_min_members"] - $part->getCountMembers();
1585  if ($missing > 0) {
1586  $res[(int) $row["obj_id"]] = array($missing, $reci);
1587  }
1588  }
1589  }
1590  return $res;
1591  }
$res
Definition: ltiservices.php:66
const IL_CAL_DATETIME
static _getAllReferences(int $id)
get all reference ids for object ID
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: shib_login.php:22
$q
Definition: shib_logout.php:21
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getAutoNotification()

ilObjGroup::getAutoNotification ( )

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

References $auto_notification.

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

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

◆ getCancellationEnd()

ilObjGroup::getCancellationEnd ( )

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

References $leave_end.

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

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

◆ getCountMembers()

ilObjGroup::getCountMembers ( )

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

References getGroupMemberIds().

877  : int
878  {
879  return count($this->getGroupMemberIds());
880  }
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 795 of file class.ilObjGroup.php.

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

Referenced by cloneAutoGeneratedRoles().

795  : int
796  {
797  $local_group_Roles = $this->getLocalGroupRoles();
798  return $local_group_Roles["il_grp_admin_" . $this->getRefId()];
799  }
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 903 of file class.ilObjGroup.php.

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

Referenced by getGroupAdminIds(), and isAdmin().

903  : array
904  {
905  $grp_id = $this->getRefId();
906  $role_arr = $this->rbac_review->getRolesOfRoleFolder($grp_id);
907  $arr_grpDefaultRoles = [];
908  foreach ($role_arr as $role_id) {
909  $role = ilObjectFactory::getInstanceByObjId($role_id, false);
910  $grp_Member = "il_grp_member_" . $grp_id;
911  $grp_Admin = "il_grp_admin_" . $grp_id;
912 
913  if (strcmp($role->getTitle(), $grp_Member) == 0) {
914  $arr_grpDefaultRoles["grp_member_role"] = $role->getId();
915  }
916 
917  if (strcmp($role->getTitle(), $grp_Admin) == 0) {
918  $arr_grpDefaultRoles["grp_admin_role"] = $role->getId();
919  }
920  }
921  return $arr_grpDefaultRoles;
922  }
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 786 of file class.ilObjGroup.php.

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

Referenced by cloneAutoGeneratedRoles().

786  : int
787  {
788  $local_group_Roles = $this->getLocalGroupRoles();
789  return $local_group_Roles["il_grp_member_" . $this->getRefId()];
790  }
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 299 of file class.ilObjGroup.php.

References $enablemap.

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

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

◆ getEnableMap()

ilObjGroup::getEnableMap ( )

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

References getEnableGroupMap().

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

◆ getEnd()

ilObjGroup::getEnd ( )

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

References $grp_end.

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

407  : ?\ilDateTime
408  {
409  return $this->grp_end;
410  }
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 882 of file class.ilObjGroup.php.

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

Referenced by leaveGroup().

882  : array
883  {
884  if (!empty($a_grpId)) {
885  $grp_id = $a_grpId;
886  } else {
887  $grp_id = $this->getRefId();
888  }
889 
890  $usr_arr = array();
891  $roles = $this->getDefaultGroupRoles();
892 
893  foreach ($this->rbac_review->assignedUsers($this->getDefaultAdminRole()) as $member_id) {
894  array_push($usr_arr, $member_id);
895  }
896  return $usr_arr;
897  }
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 850 of file class.ilObjGroup.php.

References $q, $r, ilDBConstants\FETCHMODE_OBJECT, and ilArrayUtil\quoteArray().

850  : array
851  {
852  $usr_arr = array();
853  $q = "SELECT login,firstname,lastname,title,usr_id,last_login " .
854  "FROM usr_data " .
855  "WHERE usr_id IN (" . implode(',', ilArrayUtil::quoteArray($a_mem_ids)) . ") ";
856 
857  if (is_numeric($active) && $active > -1) {
858  $q .= "AND active = '$active'";
859  }
860 
861  $q .= 'ORDER BY lastname,firstname';
862 
863  $r = $this->db->query($q);
864  $mem_arr = [];
865  while ($row = $r->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
866  $mem_arr[] = array("id" => (int) $row->usr_id,
867  "login" => $row->login,
868  "firstname" => $row->firstname,
869  "lastname" => $row->lastname,
870  "last_login" => $row->last_login
871  );
872  }
873 
874  return $mem_arr;
875  }
static quoteArray(array $a_array)
Quotes all members of an array for usage in DB query statement.
$q
Definition: shib_logout.php:21
$r
+ 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 833 of file class.ilObjGroup.php.

References getLocalGroupRoles().

Referenced by getCountMembers(), and leaveGroup().

833  : array
834  {
835  $usr_arr = array();
836  $rol = $this->getLocalGroupRoles();
837  $mem_arr = [];
838  foreach ($rol as $value) {
839  foreach ($this->rbac_review->assignedUsers($value) as $member_id) {
840  array_push($usr_arr, $member_id);
841  }
842  }
843  return array_unique($usr_arr);
844  }
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 1026 of file class.ilObjGroup.php.

References $group_status.

1026  : int
1027  {
1028  return $this->group_status;
1029  }

◆ getGroupType()

ilObjGroup::getGroupType ( )

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

References $group_type.

Referenced by create(), and update().

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

◆ getGrpStatusClosedTemplateId()

ilObjGroup::getGrpStatusClosedTemplateId ( )

get group status closed template

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

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

953  : int
954  {
955  $q = "SELECT obj_id FROM object_data WHERE type='rolt' AND title='il_grp_status_closed'";
956  $res = $this->ilias->db->query($q);
957  $row = $res->fetchRow(ilDBConstants::FETCHMODE_ASSOC);
958 
959  return (int) $row["obj_id"];
960  }
$res
Definition: ltiservices.php:66
Class ilObjForumAdministration.
$q
Definition: shib_logout.php:21

◆ getGrpStatusOpenTemplateId()

ilObjGroup::getGrpStatusOpenTemplateId ( )

get group status open template

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

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

Referenced by setParentRolePermissions().

965  : int
966  {
967  $q = "SELECT obj_id FROM object_data WHERE type='rolt' AND title='il_grp_status_open'";
968  $res = $this->ilias->db->query($q);
969  $row = $res->fetchRow(ilDBConstants::FETCHMODE_ASSOC);
970 
971  return (int) $row["obj_id"];
972  }
$res
Definition: ltiservices.php:66
Class ilObjForumAdministration.
$q
Definition: shib_logout.php:21
+ Here is the caller graph for this function:

◆ getInformation()

ilObjGroup::getInformation ( )

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

References $information.

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

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

◆ getLatitude()

ilObjGroup::getLatitude ( )

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

References $latitude.

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

264  : string
265  {
266  return $this->latitude;
267  }
+ 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 929 of file class.ilObjGroup.php.

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

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

929  : array
930  {
931  if (empty($this->local_roles)) {
932  $this->local_roles = array();
933  $role_arr = $this->rbac_review->getRolesOfRoleFolder($this->getRefId());
934 
935  foreach ($role_arr as $role_id) {
936  if ($this->rbac_review->isAssignable($role_id, $this->getRefId()) == true) {
937  $role = ilObjectFactory::getInstanceByObjId($role_id, false);
938  if ($a_translate) {
939  $role_name = ilObjRole::_getTranslation($role->getTitle());
940  } else {
941  $role_name = $role->getTitle();
942  }
943  $this->local_roles[$role_name] = $role->getId();
944  }
945  }
946  }
947  return $this->local_roles;
948  }
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 284 of file class.ilObjGroup.php.

References $locationzoom.

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

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

◆ getLongitude()

ilObjGroup::getLongitude ( )

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

References $longitude.

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

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

◆ getMailToMembersType()

ilObjGroup::getMailToMembersType ( )

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

References $mail_members.

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

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

◆ getMaxMembers()

ilObjGroup::getMaxMembers ( )

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

References $reg_max_members.

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

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

◆ getMemberRoles()

ilObjGroup::getMemberRoles ( int  $a_user_id)

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

References getLocalGroupRoles().

Referenced by leave().

1044  : array
1045  {
1046  return array_intersect(
1047  $this->rbac_review->assignedRoles($a_user_id),
1048  $this->getLocalGroupRoles()
1049  );
1050  }
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 1391 of file class.ilObjGroup.php.

References $members_obj, and initParticipants().

Referenced by handleAutoFill().

1392  {
1393  // #17886
1394  if (!$this->members_obj instanceof ilGroupParticipants) {
1395  $this->initParticipants();
1396  }
1397  return $this->members_obj;
1398  }
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 1308 of file class.ilObjGroup.php.

References $message.

Referenced by appendMessage().

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

◆ getMinMembers()

ilObjGroup::getMinMembers ( )

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

References $reg_min_members.

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

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

◆ getNumberOfNextSessions()

ilObjGroup::getNumberOfNextSessions ( )

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

References $session_next.

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

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

◆ getNumberOfPreviousSessions()

ilObjGroup::getNumberOfPreviousSessions ( )

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

References $session_prev.

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

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

◆ getPassword()

ilObjGroup::getPassword ( )

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

References $reg_password.

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

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

◆ getRegistrationAccessCode()

ilObjGroup::getRegistrationAccessCode ( )

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

References $reg_access_code.

Referenced by create(), and update().

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

◆ getRegistrationEnd()

ilObjGroup::getRegistrationEnd ( )

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

References $reg_end.

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

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

◆ getRegistrationStart()

ilObjGroup::getRegistrationStart ( )

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

References $reg_start.

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

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

◆ getRegistrationType()

ilObjGroup::getRegistrationType ( )

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

References $reg_type.

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

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

◆ getShowMembers()

ilObjGroup::getShowMembers ( )

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

References $show_members.

Referenced by read(), and update().

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

◆ getStart()

ilObjGroup::getStart ( )

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

References $grp_start.

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

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

◆ getStartTimeIndication()

ilObjGroup::getStartTimeIndication ( )

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

References $start_time_indication.

Referenced by prepareAppointments(), and update().

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

◆ getViewMode()

ilObjGroup::getViewMode ( )

Get effective container view mode.

Returns
int

Definition at line 1215 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.

1215  : int
1216  {
1217  $tree = $this->tree;
1218 
1219  // default: by type
1220  $view = self::lookupViewMode($this->getId());
1221 
1222  if ($view != ilContainer::VIEW_INHERIT) {
1223  return $view;
1224  }
1225 
1226  $container_ref_id = $tree->checkForParentType($this->ref_id, 'crs');
1227  if ($container_ref_id) {
1229  // these three are available...
1230  if (
1234  return $view_mode;
1235  }
1236  }
1238  }
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 1490 of file class.ilObjGroup.php.

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

1490  : void
1491  {
1492  if ($this->isWaitingListEnabled() &&
1493  $this->hasWaitingListAutoFill()) {
1494  $max = $this->getMaxMembers();
1496  if ($max > $now) {
1497  // see assignFromWaitingListObject()
1498  $waiting_list = new ilGroupWaitingList($this->getId());
1499 
1500  foreach ($waiting_list->getUserIds() as $user_id) {
1501  if (!$tmp_obj = ilObjectFactory::getInstanceByObjId($user_id, false)) {
1502  continue;
1503  }
1504  if ($this->getMembersObject()->isAssigned($user_id)) {
1505  continue;
1506  }
1507  $this->getMembersObject()->add($user_id, ilParticipants::IL_GRP_MEMBER); // #18213
1509  $waiting_list->removeFromList($user_id);
1510 
1511  $now++;
1512  if ($now >= $max) {
1513  break;
1514  }
1515  }
1516  }
1517  }
1518  }
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 254 of file class.ilObjGroup.php.

References $auto_fill_from_waiting.

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

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

◆ initDefaultRoles()

ilObjGroup::initDefaultRoles ( )

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

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

1064  : void
1065  {
1067  'il_grp_admin_' . $this->getRefId(),
1068  "Groupadmin group obj_no." . $this->getId(),
1069  'il_grp_admin',
1070  $this->getRefId()
1071  );
1072  $this->m_roleAdminId = $role->getId();
1073 
1075  'il_grp_member_' . $this->getRefId(),
1076  "Groupmember of group obj_no." . $this->getId(),
1077  'il_grp_member',
1078  $this->getRefId()
1079  );
1080  $this->m_roleMemberId = $role->getId();
1081  }
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 1386 of file class.ilObjGroup.php.

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

Referenced by getMembersObject(), and read().

1386  : void
1387  {
1388  $this->members_obj = ilGroupParticipants::_getInstanceByObjId($this->getId());
1389  }
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 1052 of file class.ilObjGroup.php.

References getDefaultGroupRoles().

Referenced by leaveGroup().

1052  : bool
1053  {
1054  $grp_Roles = $this->getDefaultGroupRoles();
1055  if (in_array($a_userId, $this->rbac_review->assignedUsers($grp_Roles["grp_admin_role"]))) {
1056  return true;
1057  } else {
1058  return false;
1059  }
1060  }
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 214 of file class.ilObjGroup.php.

References $reg_membership_limitation.

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

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

◆ isRegistrationAccessCodeEnabled()

ilObjGroup::isRegistrationAccessCodeEnabled ( )

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

References $reg_access_code_enabled.

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

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

◆ isRegistrationEnabled()

ilObjGroup::isRegistrationEnabled ( )

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

References getRegistrationType(), and ilGroupConstants\GRP_REGISTRATION_DEACTIVATED.

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

163  : bool
164  {
166  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ isRegistrationUnlimited()

ilObjGroup::isRegistrationUnlimited ( )

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

References $reg_unlimited.

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

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

◆ isSessionLimitEnabled()

ilObjGroup::isSessionLimitEnabled ( )

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

References $session_limit.

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

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

◆ isWaitingListEnabled()

ilObjGroup::isWaitingListEnabled ( )

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

References $waiting_list.

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

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

◆ leave()

ilObjGroup::leave ( int  $a_user_id)

deassign member from group role

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

References getMemberRoles().

Referenced by leaveGroup().

819  : bool
820  {
821  $arr_groupRoles = $this->getMemberRoles($a_user_id);
822  foreach ($arr_groupRoles as $groupRole) {
823  $this->rbac_admin->deassignUser($groupRole, $a_user_id);
824  }
825  return true;
826  }
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 801 of file class.ilObjGroup.php.

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

801  : int
802  {
803  $member_ids = $this->getGroupMemberIds();
804  if (count($member_ids) <= 1 || !in_array($this->user->getId(), $member_ids)) {
805  return 2;
806  } elseif (!$this->isAdmin($this->user->getId())) {
807  $this->leave($this->user->getId());
808  $this->recommended_content_manager->removeObjectRecommendation($this->user->getId(), $this->getRefId());
809  return 0;
810  } elseif (count($this->getGroupAdminIds()) == 1) {
811  return 1;
812  }
813  return 1;
814  }
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 974 of file class.ilObjGroup.php.

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

Referenced by ilRbacAdmin\adjustMovedObjectPermissions().

974  : int
975  {
976  global $DIC;
977 
978  $ilDB = $DIC['ilDB'];
979 
980  $type = self::lookupGroupTye($a_obj_id);
982  $query = 'SELECT obj_id FROM object_data WHERE type = ' . $ilDB->quote('rolt', 'text') . ' AND title = ' . $ilDB->quote('il_grp_status_closed', 'text');
983  } else {
984  $query = 'SELECT obj_id FROM object_data WHERE type = ' . $ilDB->quote('rolt', 'text') . ' AND title = ' . $ilDB->quote('il_grp_status_open', 'text');
985  }
986  $res = $ilDB->query($query);
987  $row = $res->fetchRow(ilDBConstants::FETCHMODE_ASSOC);
988  return $row['obj_id'] ? (int) $row['obj_id'] : 0;
989  }
$res
Definition: ltiservices.php:66
string $type
global $DIC
Definition: shib_login.php:22
+ 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 118 of file class.ilObjGroup.php.

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

Referenced by ilObjRole\createPermissionIntersection().

118  : int
119  {
120  global $DIC;
121 
122  $ilDB = $DIC->database();
123 
124  $query = "SELECT grp_type FROM grp_settings " .
125  "WHERE obj_id = " . $ilDB->quote($a_id, 'integer');
126  $res = $ilDB->query($query);
127  while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
128  return (int) $row->grp_type;
129  }
131  }
$res
Definition: ltiservices.php:66
global $DIC
Definition: shib_login.php:22
+ 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 1404 of file class.ilObjGroup.php.

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

Referenced by ilMembershipRegistrationCodeUtils\lookupObjectsByCode().

1404  : array
1405  {
1406  global $DIC;
1407 
1408  $ilDB = $DIC->database();
1409 
1410  $query = "SELECT obj_id FROM grp_settings " .
1411  "WHERE reg_ac_enabled = " . $ilDB->quote(1, 'integer') . " " .
1412  "AND reg_ac = " . $ilDB->quote($a_code, 'text');
1413  $res = $ilDB->query($query);
1414 
1415  $obj_ids = array();
1416  while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
1417  $obj_ids[] = (int) $row->obj_id;
1418  }
1419  return $obj_ids;
1420  }
$res
Definition: ltiservices.php:66
global $DIC
Definition: shib_login.php:22
+ 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 1593 of file class.ilObjGroup.php.

References $DIC, $ilDB, and $res.

Referenced by ilParticipants\hasParticipantListAccess().

1593  : bool
1594  {
1595  global $DIC;
1596  $ilDB = $DIC->database();
1597 
1598  $query = 'SELECT show_members FROM grp_settings'
1599  . ' WHERE obj_id = ' . $ilDB->quote($a_obj_id, 'integer');
1600  $res = $ilDB->query($query);
1601  if ($ilDB->numRows($res) == 0) {
1602  return false;
1603  }
1604  $row = $ilDB->fetchAssoc($res);
1605  return (bool) $row['show_members'];
1606  }
$res
Definition: ltiservices.php:66
global $DIC
Definition: shib_login.php:22
+ Here is the caller graph for this function:

◆ lookupViewMode()

static ilObjGroup::lookupViewMode (   $a_obj_id)
static

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

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

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

1246  : int
1247  {
1248  global $DIC;
1249 
1250  $ilDB = $DIC->database();
1251 
1252  $query = 'SELECT view_mode FROM grp_settings ' .
1253  'WHERE obj_id = ' . $ilDB->quote($a_obj_id, 'integer');
1254  $res = $ilDB->query($query);
1255 
1256  $view_mode = null;
1257  while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
1258  $view_mode = (int) $row->view_mode;
1259  }
1260  return $view_mode;
1261  }
$res
Definition: ltiservices.php:66
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
global $DIC
Definition: shib_login.php:22
+ 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 1520 of file class.ilObjGroup.php.

References $DIC, $ilDB, and IL_CAL_DATE.

Referenced by ilObjGroupAccess\_checkAccess().

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

◆ prepareAppointments()

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

Prepare calendar appointments.

Returns
ilCalendarAppointmentTemplate[]

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

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

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

1329  : array
1330  {
1331  switch ($a_mode) {
1332  case 'create':
1333  case 'update':
1334 
1335  $apps = array();
1336  if ($this->getStart() && $this->getEnd()) {
1337  $app = new ilCalendarAppointmentTemplate(self::CAL_START);
1338  $app->setTitle($this->getTitle());
1339  $app->setSubtitle('grp_cal_start');
1340  $app->setTranslationType(ilCalendarEntry::TRANSLATION_SYSTEM);
1341  $app->setDescription($this->getLongDescription());
1342  $app->setStart($this->getStart());
1343  $app->setFullday(!$this->getStartTimeIndication());
1344  $apps[] = $app;
1345 
1346  $app = new ilCalendarAppointmentTemplate(self::CAL_END);
1347  $app->setTitle($this->getTitle());
1348  $app->setSubtitle('grp_cal_end');
1349  $app->setTranslationType(ilCalendarEntry::TRANSLATION_SYSTEM);
1350  $app->setDescription($this->getLongDescription());
1351  $app->setStart($this->getEnd());
1352  $app->setFullday(!$this->getStartTimeIndication());
1353  $apps[] = $app;
1354  }
1355  if ($this->isRegistrationUnlimited()) {
1356  return $apps;
1357  }
1358 
1359  $app = new ilCalendarAppointmentTemplate(self::CAL_REG_START);
1360  $app->setTitle($this->getTitle());
1361  $app->setSubtitle('grp_cal_reg_start');
1362  $app->setTranslationType(ilCalendarEntry::TRANSLATION_SYSTEM);
1363  $app->setDescription($this->getLongDescription());
1364  $app->setStart($this->getRegistrationStart());
1365  $apps[] = $app;
1366 
1367  $app = new ilCalendarAppointmentTemplate(self::CAL_REG_END);
1368  $app->setTitle($this->getTitle());
1369  $app->setSubtitle('grp_cal_reg_end');
1370  $app->setTranslationType(ilCalendarEntry::TRANSLATION_SYSTEM);
1371  $app->setDescription($this->getLongDescription());
1372  $app->setStart($this->getRegistrationEnd());
1373  $apps[] = $app;
1374 
1375 
1376  return $apps;
1377 
1378  case 'delete':
1379  // Nothing to do: The category and all assigned appointments will be deleted.
1380  return array();
1381  }
1382  return [];
1383  }
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 624 of file class.ilObjGroup.php.

References $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(), null, 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.

624  : void
625  {
626  parent::read();
627 
628  $query = "SELECT * FROM grp_settings " .
629  "WHERE obj_id = " . $this->db->quote($this->getId(), 'integer');
630 
631  $res = $this->db->query($query);
632  while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
633  $this->setInformation((string) $row->information);
634  $this->setGroupType((int) $row->grp_type);
635  $this->setRegistrationType((int) $row->registration_type);
636  $this->enableUnlimitedRegistration((bool) $row->registration_unlimited);
637  $this->setRegistrationStart(new ilDateTime($row->registration_start, IL_CAL_DATETIME));
638  $this->setRegistrationEnd(new ilDateTime($row->registration_end, IL_CAL_DATETIME));
639  $this->setPassword((string) $row->registration_password);
640  $this->enableMembershipLimitation((bool) $row->registration_mem_limit);
641  $this->setMaxMembers((int) $row->registration_max_members);
642  $this->enableWaitingList((bool) $row->waiting_list);
643  $this->setLatitude((string) $row->latitude);
644  $this->setLongitude((string) $row->longitude);
645  $this->setLocationZoom((int) $row->location_zoom);
646  $this->setEnableGroupMap((bool) $row->enablemap);
647  $this->enableRegistrationAccessCode((bool) $row->reg_ac_enabled);
648  $this->setRegistrationAccessCode((string) $row->reg_ac);
649  $this->setViewMode((int) $row->view_mode);
650  $this->setMailToMembersType((int) $row->mail_members_type);
651  $this->setCancellationEnd($row->leave_end ? new ilDate((int) $row->leave_end, IL_CAL_UNIX) : null);
652  $this->setMinMembers((int) $row->registration_min_members);
653  $this->setWaitingListAutoFill((bool) $row->auto_wait);
654  $this->setShowMembers((bool) $row->show_members);
655  $this->setAutoNotification((bool) $row->auto_notification);
656  if ($row->period_time_indication) {
657  $this->setPeriod(
658  new \ilDateTime($row->period_start, IL_CAL_DATETIME, \ilTimeZone::UTC),
659  new \ilDateTime($row->period_end, IL_CAL_DATETIME, \ilTimeZone::UTC)
660  );
661  } elseif (!is_null($row->period_start) && !is_null($row->period_end)) {
662  $this->setPeriod(
663  new \ilDate($row->period_start, IL_CAL_DATE),
664  new \ilDate($row->period_end, IL_CAL_DATE)
665  );
666  }
667  $this->toggleStartTimeIndication((bool) $row->period_time_indication);
668  $this->enableSessionLimit((bool) $row->session_limit);
669  $this->setNumberOfPreviousSessions((int) $row->session_prev);
670  $this->setNumberOfNextSessions((int) $row->session_next);
671  }
672  $this->initParticipants();
673 
674  // Inherit order type from parent course (if exists)
676  }
enableUnlimitedRegistration(bool $a_status)
enableWaitingList(bool $a_status)
$res
Definition: ltiservices.php:66
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)
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
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)
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 1035 of file class.ilObjGroup.php.

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

1035  : int
1036  {
1038  if (!$tpl_id) {
1040  }
1042  }
+ 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 1426 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.

1430  : void {
1432 
1433  if ($part->isAssigned($a_user_id)) {
1434  return;
1435  }
1436 
1437  if (!$a_force_registration) {
1438  // Availability
1439  if (!$this->isRegistrationEnabled()) {
1441  throw new ilMembershipRegistrationException('Cannot registrate to group ' . $this->getId() .
1442  ', group subscription is deactivated.', ilMembershipRegistrationException::REGISTRATION_CODE_DISABLED);
1443  }
1444  }
1445 
1446  // Time Limitation
1447  if (!$this->isRegistrationUnlimited()) {
1448  $start = $this->getRegistrationStart();
1449  $end = $this->getRegistrationEnd();
1450  $time = new ilDateTime(time(), IL_CAL_UNIX);
1451 
1452  if (!(ilDateTime::_after($time, $start) and ilDateTime::_before($time, $end))) {
1453  throw new ilMembershipRegistrationException('Cannot registrate to group ' . $this->getId() .
1454  ', group is out of registration time.', ilMembershipRegistrationException::OUT_OF_REGISTRATION_PERIOD);
1455  }
1456  }
1457 
1458  // Max members
1459  if ($this->isMembershipLimited()) {
1460  $free = max(0, $this->getMaxMembers() - $part->getCountMembers());
1461  $waiting_list = new ilGroupWaitingList($this->getId());
1462  if ($this->isWaitingListEnabled() and (!$free or $waiting_list->getCountUsers())) {
1463  $this->lng->loadLanguageModule("grp");
1464  $waiting_list->addToList($a_user_id);
1465 
1466  $info = sprintf(
1467  $this->lng->txt('grp_added_to_list'),
1468  $this->getTitle(),
1469  $waiting_list->getPosition($a_user_id)
1470  );
1471 
1472  $participants = ilGroupParticipants::_getInstanceByObjId($this->getId());
1473  $participants->sendNotification(ilGroupMembershipMailNotification::TYPE_WAITING_LIST_MEMBER, $a_user_id);
1474 
1476  }
1477 
1478  if (!$free or $waiting_list->getCountUsers()) {
1479  throw new ilMembershipRegistrationException('Cannot registrate to group ' . $this->getId() .
1480  ', membership is limited.', ilMembershipRegistrationException::OBJECT_IS_FULL);
1481  }
1482  }
1483  }
1484 
1485  $part->add($a_user_id, $a_role);
1486  $part->sendNotification(ilGroupMembershipMailNotification::TYPE_ADMISSION_MEMBER, $a_user_id);
1487  $part->sendNotification(ilGroupMembershipMailNotification::TYPE_NOTIFICATION_REGISTRATION, $a_user_id);
1488  }
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.
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 353 of file class.ilObjGroup.php.

Referenced by read().

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

◆ setCancellationEnd()

ilObjGroup::setCancellationEnd ( ?ilDate  $a_value)

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

Referenced by read().

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

◆ setEnableGroupMap()

ilObjGroup::setEnableGroupMap ( bool  $a_enablemap)

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

Referenced by read().

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

◆ setEnd()

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

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

Referenced by setPeriod().

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

◆ setGroupStatus()

ilObjGroup::setGroupStatus ( int  $a_status)

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

1018  : void
1019  {
1020  $this->group_status = $a_status;
1021  }

◆ setGroupType()

ilObjGroup::setGroupType ( int  $a_type)

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

Referenced by read().

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

◆ setInformation()

ilObjGroup::setInformation ( string  $a_information)

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

Referenced by read().

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

◆ setLatitude()

ilObjGroup::setLatitude ( string  $a_latitude)

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

Referenced by read().

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

◆ setLocationZoom()

ilObjGroup::setLocationZoom ( int  $a_locationzoom)

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

Referenced by read().

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

◆ setLongitude()

ilObjGroup::setLongitude ( string  $a_longitude)

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

Referenced by read().

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

◆ setMailToMembersType()

ilObjGroup::setMailToMembersType ( int  $a_type)

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

Referenced by read().

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

◆ setMaxMembers()

ilObjGroup::setMaxMembers ( int  $a_max)

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

Referenced by read().

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

◆ setMessage()

ilObjGroup::setMessage ( string  $a_message)

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

1313  : void
1314  {
1315  $this->message = $a_message;
1316  }

◆ setMinMembers()

ilObjGroup::setMinMembers ( int  $a_max)

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

Referenced by read().

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

◆ setNumberOfNextSessions()

ilObjGroup::setNumberOfNextSessions ( int  $a_num)

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

Referenced by read().

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

◆ setNumberOfPreviousSessions()

ilObjGroup::setNumberOfPreviousSessions ( int  $a_num)

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

Referenced by read().

422  : void
423  {
424  $this->session_prev = $a_num;
425  }
+ 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 1091 of file class.ilObjGroup.php.

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

Referenced by applyDidacticTemplate().

1091  : bool
1092  {
1093  $parent_roles = $this->rbac_review->getParentRoleIds($a_parent_ref);
1094  foreach ($parent_roles as $parent_role) {
1095  if ($parent_role['parent'] == $this->getRefId()) {
1096  continue;
1097  }
1098  if ($this->rbac_review->isProtected((int) $parent_role['parent'], (int) $parent_role['rol_id'])) {
1099  $operations = $this->rbac_review->getOperationsOfRole(
1100  (int) $parent_role['obj_id'],
1101  $this->getType(),
1102  (int) $parent_role['parent']
1103  );
1104  $this->rbac_admin->grantPermission(
1105  (int) $parent_role['obj_id'],
1106  $operations,
1107  $this->getRefId()
1108  );
1109  continue;
1110  }
1111 
1112  $this->rbac_admin->initIntersectionPermissions(
1113  $this->getRefId(),
1114  (int) $parent_role['obj_id'],
1115  (int) $parent_role['parent'],
1116  $this->getGrpStatusOpenTemplateId(),
1118  );
1119  }
1120  return true;
1121  }
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 199 of file class.ilObjGroup.php.

Referenced by read().

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

◆ setPeriod()

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

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

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

Referenced by read().

363  : void
364  {
365  if (
366  ($start instanceof \ilDate && !$end instanceof ilDate) ||
367  ($end instanceof \ilDate && !$start instanceof ilDate)
368  ) {
369  throw new InvalidArgumentException('Different date types not supported.');
370  }
371 
372  if ($start instanceof \ilDate) {
373  $this->toggleStartTimeIndication(false);
374  } else {
375  $this->toggleStartTimeIndication(true);
376  }
377  $this->setStart($start);
378  $this->setEnd($end);
379  }
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 309 of file class.ilObjGroup.php.

Referenced by read().

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

◆ setRegistrationEnd()

ilObjGroup::setRegistrationEnd ( ?ilDateTime  $a_end)

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

Referenced by read().

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

◆ setRegistrationStart()

ilObjGroup::setRegistrationStart ( ?ilDateTime  $a_start)

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

Referenced by read().

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

◆ setRegistrationType()

ilObjGroup::setRegistrationType ( int  $a_type)

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

Referenced by read().

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

◆ setShowMembers()

ilObjGroup::setShowMembers ( bool  $a_status)

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

Referenced by read().

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

◆ setStart()

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

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

Referenced by setPeriod().

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

◆ setViewMode()

ilObjGroup::setViewMode ( int  $a_view_mode)

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

Referenced by read().

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

◆ setWaitingListAutoFill()

ilObjGroup::setWaitingListAutoFill ( bool  $a_value)

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

Referenced by read().

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

◆ toggleStartTimeIndication()

ilObjGroup::toggleStartTimeIndication ( bool  $time_indication)
protected

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

Referenced by read(), and setPeriod().

381  : void
382  {
383  $this->start_time_indication = $time_indication;
384  }
+ 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 1263 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.

1263  : int
1264  {
1265  global $DIC;
1266 
1267  $tree = $DIC['tree'];
1268 
1269  if (!$a_view_mode) {
1270  $a_view_mode = ilContainer::VIEW_DEFAULT;
1271  }
1272 
1273  // view mode is inherit => check for parent course
1274  if ($a_view_mode == ilContainer::VIEW_INHERIT) {
1275  if (!$a_ref_id) {
1276  $ref = ilObject::_getAllReferences($a_obj_id);
1277  $a_ref_id = end($ref);
1278  }
1279 
1280  $crs_ref = $tree->checkForParentType($a_ref_id, 'crs');
1281  if (!$crs_ref) {
1283  }
1284 
1286 
1287  // validate course view mode
1288  if (!in_array($view_mode, array(ilContainer::VIEW_SESSIONS,
1291  }
1292 
1293  return $view_mode;
1294  }
1295 
1296  return $a_view_mode;
1297  }
static _getAllReferences(int $id)
get all reference ids for object ID
ilTree $tree
static _lookupViewMode(int $a_id)
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...
global $DIC
Definition: shib_login.php:22
+ Here is the call graph for this function:

◆ update()

ilObjGroup::update ( )

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

References $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(), null, prepareAppointments(), ilDBConstants\T_INTEGER, ilDBConstants\T_TIMESTAMP, and ilObject\updateMetaData().

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

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

1000  : void {
1001  if ($a_group_type == ilGroupConstants::GRP_TYPE_OPEN) {
1002  $this->applyDidacticTemplate(0);
1003  return;
1004  }
1005  $templates = ilDidacticTemplateSettings::getInstanceByObjectType($this->getType())->getTemplates();
1006  foreach ($templates as $template) {
1007  // the closed template
1008  if ($template->isAutoGenerated()) {
1009  $this->logger->info('Appying default closed template');
1010  $this->applyDidacticTemplate($template->getId());
1011  return;
1012  }
1013  }
1014  $this->logger->warning('No closed didactic template available.');
1015  }
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 446 of file class.ilObjGroup.php.

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

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

◆ $local_roles

array ilObjGroup::$local_roles = []
private

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

Referenced by getLocalGroupRoles().

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