ILIAS  release_5-0 Revision 5.0.0-1144-gc4397b1f870
All Data Structures Namespaces Files Functions Variables Modules Pages
ilObjGroup Class Reference

Class ilObjGroup. More...

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

Public Member Functions

 __construct ($a_id=0, $a_call_by_reference=true)
 Constructor public. More...
 
 setInformation ($a_information)
 set information More...
 
 getInformation ()
 get Information More...
 
 setGroupType ($a_type)
 set group type More...
 
 getGroupType ()
 get group type More...
 
 isGroupTypeModified ($a_old_type)
 check if group type is modified More...
 
 setRegistrationType ($a_type)
 set registration type More...
 
 getRegistrationType ()
 get registration type More...
 
 isRegistrationEnabled ()
 is registration enabled More...
 
 enableUnlimitedRegistration ($a_status)
 enable unlimited registration More...
 
 isRegistrationUnlimited ()
 is registration unlimited More...
 
 setRegistrationStart ($a_start)
 set registration start More...
 
 getRegistrationStart ()
 get registration start More...
 
 setRegistrationEnd ($a_end)
 set registration end More...
 
 getRegistrationEnd ()
 get registration end More...
 
 setPassword ($a_pass)
 set password More...
 
 getPassword ()
 get password More...
 
 enableMembershipLimitation ($a_status)
 enable max member limitation More...
 
 isMembershipLimited ()
 is max member limited More...
 
 setMaxMembers ($a_max)
 set max members More...
 
 getMaxMembers ()
 get max members More...
 
 enableWaitingList ($a_status)
 enable waiting list More...
 
 isWaitingListEnabled ()
 is waiting list enabled More...
 
 setLatitude ($a_latitude)
 Set Latitude. More...
 
 getLatitude ()
 Get Latitude. More...
 
 setLongitude ($a_longitude)
 Set Longitude. More...
 
 getLongitude ()
 Get Longitude. More...
 
 setLocationZoom ($a_locationzoom)
 Set LocationZoom. More...
 
 getLocationZoom ()
 Get LocationZoom. More...
 
 setEnableGroupMap ($a_enablemap)
 Set Enable Group Map. More...
 
 getEnableGroupMap ()
 Get Enable Group Map. More...
 
 getRegistrationAccessCode ()
 get access code More...
 
 setRegistrationAccessCode ($a_code)
 Set refistration access code. More...
 
 isRegistrationAccessCodeEnabled ()
 Check if access code is enabled. More...
 
 enableRegistrationAccessCode ($a_status)
 En/disable registration access code. More...
 
 setMailToMembersType ($a_type)
 Set mail to members type. More...
 
 getMailToMembersType ()
 Get mail to members type. More...
 
 validate ()
 validate group settings More...
 
 create ()
 Create group. More...
 
 update ()
 Update group. More...
 
 delete ()
 delete group and all related data More...
 
 read ()
 Read group. More...
 
 cloneObject ($a_target_id, $a_copy_id=0)
 Clone group (no member data) More...
 
 cloneDependencies ($a_target_id, $a_copy_id)
 Clone object dependencies (crs items, preconditions) More...
 
 cloneAutoGeneratedRoles ($new_obj)
 Clone group admin and member role permissions. More...
 
 join ($a_user_id, $a_mem_role="")
 join Group, assigns user to role private More...
 
 getDefaultMemberRole ()
 returns object id of created default member role public More...
 
 getDefaultAdminRole ()
 returns object id of created default adminstrator role public More...
 
 addMember ($a_user_id, $a_mem_role)
 add Member to Group public More...
 
 leaveGroup ()
 is called when a member decides to leave group public More...
 
 leave ($a_user_id)
 deassign member from group role private More...
 
 getGroupMemberIds ()
 get all group Member ids regardless of role public More...
 
 getGroupMemberData ($a_mem_ids, $active=1)
 get all group Members regardless of group role. More...
 
 getCountMembers ()
 
 getGroupAdminIds ($a_grpId="")
 get Group Admin Id public More...
 
 getDefaultGroupRoles ($a_grp_id="")
 get default group roles, returns the defaultlike create roles il_grp_member, il_grp_admin public More...
 
 getLocalGroupRoles ($a_translate=false)
 get ALL local roles of group, also those created and defined afterwards only fetch data once from database. More...
 
 getGrpStatusClosedTemplateId ()
 get group status closed template public More...
 
 getGrpStatusOpenTemplateId ()
 get group status open template public More...
 
 updateGroupType ()
 Change group type. More...
 
 initGroupStatus ($a_grpStatus=GRP_TYPE_PUBLIC)
 set group status More...
 
 setGroupStatus ($a_status)
 Set group status. More...
 
 getGroupStatus ()
 get group status More...
 
 readGroupStatus ()
 get group status, redundant method because public More...
 
 getMemberRoles ($a_user_id)
 get group member status public More...
 
 isAdmin ($a_userId)
 is Admin public More...
 
 initDefaultRoles ()
 init default roles settings public More...
 
 notify ($a_event, $a_ref_id, $a_parent_non_rbac_id, $a_node_id, $a_params=0)
 notifys an object about an event occured Based on the event happend, each object may decide how it reacts. More...
 
 exportXML ()
 
 deleteExportFiles ($a_files)
 
 downloadExportFile ($file)
 
 _lookupIdByTitle ($a_title)
 
 _isMember ($a_user_id, $a_ref_id, $a_field='')
 
 _getMembers ($a_obj_id)
 
 getViewMode ($a_translate_inherit=true)
 get view mode More...
 
 setViewMode ($a_view_mode)
 Set group view mode. More...
 
 addAdditionalSubItemInformation (&$a_item_data)
 Add additional information to sub item, e.g. More...
 
 __initFileObject ()
 
 getMessage ()
 
 setMessage ($a_message)
 
 appendMessage ($a_message)
 
 register ($a_user_id, $a_role=IL_GRP_MEMBER, $a_force_registration=false)
 
- Public Member Functions inherited from ilObject
 ilObject ($a_id=0, $a_reference=true)
 Constructor public. More...
 
 withReferences ()
 determines wehter objects are referenced or not (got ref ids or not) More...
 
 read ($a_force_db=false)
 read object data from db into object More...
 
 getId ()
 get object id public More...
 
 setId ($a_id)
 set object id public More...
 
 setRefId ($a_id)
 set reference id public More...
 
 getRefId ()
 get reference id public More...
 
 getType ()
 get object type public More...
 
 setType ($a_type)
 set object type public More...
 
 getPresentationTitle ()
 get presentation title Normally same as title Overwritten for sessions More...
 
 getTitle ()
 get object title public More...
 
 getUntranslatedTitle ()
 get untranslated object title public More...
 
 setTitle ($a_title)
 set object title More...
 
 getDescription ()
 get object description More...
 
 setDescription ($a_desc)
 set object description More...
 
 getLongDescription ()
 get object long description (stored in object_description) More...
 
 getImportId ()
 get import id More...
 
 setImportId ($a_import_id)
 set import id More...
 
 getOwner ()
 get object owner More...
 
 getOwnerName ()
 
 _lookupOwnerName ($a_owner_id)
 lookup owner name for owner id More...
 
 setOwner ($a_owner)
 set object owner More...
 
 getCreateDate ()
 get create date public More...
 
 getLastUpdateDate ()
 get last update date public More...
 
 getDiskUsage ()
 Gets the disk usage of the object in bytes. More...
 
 setObjDataRecord ($a_record)
 set object_data record (note: this method should only be called from the ilObjectFactory class) More...
 
 create ()
 create More...
 
 update ()
 update object in db More...
 
 MDUpdateListener ($a_element)
 Meta data update listener. More...
 
 createMetaData ()
 create meta data entry More...
 
 updateMetaData ()
 update meta data entry More...
 
 deleteMetaData ()
 delete meta data entry More...
 
 updateOwner ()
 update owner of object in db More...
 
 _getIdForImportId ($a_import_id)
 get current object id for import id (static) More...
 
 _lookupOwner ($a_id)
 lookup object owner More...
 
 _lookupLastUpdate ($a_id, $a_as_string=false)
 lookup last update More...
 
 _getLastUpdateOfObjects ($a_objs)
 Get last update for a set of media objects. More...
 
 _setDeletedDate ($a_ref_id)
 only called in ilTree::saveSubTree More...
 
 _resetDeletedDate ($a_ref_id)
 only called in ilObjectGUI::insertSavedNodes More...
 
 _lookupDeletedDate ($a_ref_id)
 only called in ilObjectGUI::insertSavedNodes More...
 
 _writeTitle ($a_obj_id, $a_title)
 write title to db (static) More...
 
 _writeDescription ($a_obj_id, $a_desc)
 write description to db (static) More...
 
 _writeImportId ($a_obj_id, $a_import_id)
 write import id to db (static) More...
 
 _isInTrash ($a_ref_id)
 checks wether object is in trash More...
 
 _hasUntrashedReference ($a_obj_id)
 checks wether an object has at least one reference that is not in trash More...
 
 _getObjectsDataForType ($a_type, $a_omit_trash=false)
 get all objects of a certain type More...
 
 putInTree ($a_parent_ref)
 maybe this method should be in tree object!? More...
 
 setPermissions ($a_parent_ref)
 set permissions of object More...
 
 setParentRolePermissions ($a_parent_ref)
 Initialize the permissions of parent roles (local roles of categories, global roles...) This method is overwritten in e.g courses, groups for building permission intersections with non_member templates. More...
 
 createReference ()
 creates reference for object More...
 
 countReferences ()
 count references of object More...
 
 delete ()
 delete object or referenced object (in the case of a referenced object, object data is only deleted if last reference is deleted) This function removes an object entirely from system!! More...
 
 initDefaultRoles ()
 init default roles settings Purpose of this function is to create a local role folder and local roles, that are needed depending on the object type If you want to setup default local roles you MUST overwrite this method in derived object classes (see ilObjForum for an example) public More...
 
 applyDidacticTemplate ($a_tpl_id)
 Apply template. More...
 
 notify ($a_event, $a_ref_id, $a_parent_non_rbac_id, $a_node_id, $a_params=0)
 notifys an object about an event occured Based on the event passed, each object may decide how it reacts. More...
 
 setRegisterMode ($a_bool)
 
 isUserRegistered ($a_user_id=0)
 
 requireRegistration ()
 
 getXMLZip ()
 
 getHTMLDirectory ()
 
 cloneObject ($a_target_id, $a_copy_id=0, $a_omit_tree=false)
 Clone object permissions, put in tree ... More...
 
 appendCopyInfo ($a_target_id, $a_copy_id)
 Prepend Copy info if object with same name exists in that container. More...
 
 cloneDependencies ($a_target_id, $a_copy_id)
 Clone object dependencies. More...
 
 cloneMetaData ($target_obj)
 Copy meta data. More...
 
 _lookupCreationDate ($a_id)
 Lookup creation date. More...
 
- Public Member Functions inherited from ilContainer
 ilContainer ($a_id=0, $a_call_by_reference=true)
 Constructor public. More...
 
 createContainerDirectory ()
 Create directory for the container. More...
 
 getContainerDirectory ()
 Get the container directory. More...
 
 _getContainerDirectory ($a_id)
 Get the container directory. More...
 
 getBigIconPath ()
 Get path for big icon. More...
 
 getSmallIconPath ()
 Get path for small icon. More...
 
 getTinyIconPath ()
 Get path for tiny icon. More...
 
 getCustomIconPath ()
 Get path for custom icon. More...
 
 setHiddenFilesFound ($a_hiddenfilesfound)
 Set Found hidden files (set by getSubItems). More...
 
 getHiddenFilesFound ()
 Get Found hidden files (set by getSubItems). More...
 
 getStyleSheetId ()
 get ID of assigned style sheet object More...
 
 setStyleSheetId ($a_style_id)
 set ID of assigned style sheet object More...
 
 _lookupContainerSetting ($a_id, $a_keyword, $a_default_value=NULL)
 Lookup a container setting. More...
 
 _writeContainerSetting ($a_id, $a_keyword, $a_value)
 
 _lookupIconPath ($a_id, $a_size="big")
 lookup icon path More...
 
 saveIcons ($a_custom_icon)
 save container icons More...
 
 removeCustomIcon ()
 remove small icon More...
 
 cloneObject ($a_target_id, $a_copy_id=0)
 Clone container settings. More...
 
 cloneDependencies ($a_target_id, $a_copy_id)
 Clone object dependencies (container sorting) More...
 
 cloneAllObject ($session_id, $client_id, $new_type, $ref_id, $clone_source, $options, $soap_call=false)
 clone all objects according to this container More...
 
 getViewMode ()
 Get container view mode. More...
 
 getOrderType ()
 Get order type default implementation. More...
 
 setOrderType ($a_value)
 
 getSubItems ($a_admin_panel_enabled=false, $a_include_side_block=false, $a_get_single=0)
 Get subitems of container. More...
 
 gotItems ()
 Check whether we got any items. More...
 
 addAdditionalSubItemInformation (&$object)
 Add additional information to sub item, e.g. More...
 
 getGroupedObjTypes ()
 Get grouped repository object types. More...
 
 enablePageEditing ()
 Check whether page editing is allowed for container. More...
 
 create ()
 Create. More...
 
 update ()
 Update. More...
 
 read ()
 read More...
 
- Public Member Functions inherited from ilMembershipRegistrationCodes
 register ($a_user_id)
 Register an user. More...
 

Static Public Member Functions

static lookupGroupTye ($a_id)
 Lookup group type. More...
 
static lookupGroupStatusTemplateId ($a_obj_id)
 $ilDB $ilDB More...
 
 _importFromXMLString ($xml, $parent_id)
 Static used for importing a group from xml string. More...
 
 _importFromFile ($file, $parent_id)
 Static used for importing an group from xml zip file. More...
 
static lookupViewMode ($a_obj_id)
 lookup view mode $ilDB More...
 
static lookupObjectsByCode ($a_code)
 
- Static Public Member Functions inherited from ilObject
static _lookupObjIdByImportId ($a_import_id)
 
static _getAllReferences ($a_id)
 get all reference ids of object More...
 
static _lookupTitle ($a_id)
 lookup object title More...
 
static _getIdsForTitle ($title, $type='', $partialmatch=false)
 
static _lookupDescription ($a_id)
 lookup object description More...
 
static _lookupObjId ($a_id)
 
static setDeletedDates ($a_ref_ids)
 Set deleted date type $ilDB. More...
 
static _lookupType ($a_id, $a_reference=false)
 lookup object type More...
 
static _lookupObjectId ($a_ref_id)
 lookup object id More...
 
static _exists ($a_id, $a_reference=false, $a_type=null)
 checks if an object exists in object_data More...
 
static _getObjectsByType ($a_obj_type="", $a_owner="")
 Get objects by type. More...
 
static _prepareCloneSelection ($a_ref_ids, $new_type, $show_path=true)
 Prepare copy wizard object selection. More...
 
static _getIcon ($a_obj_id="", $a_size="big", $a_type="", $a_offline=false)
 Get icon for repository item. More...
 
static collectDeletionDependencies (&$deps, $a_ref_id, $a_obj_id, $a_type, $a_depth=0)
 Collect deletion dependencies. More...
 
static getDeletionDependencies ($a_obj_id)
 Get deletion dependencies. More...
 
static getLongDescriptions (array $a_obj_ids)
 Get long description data. More...
 
static getAllOwnedRepositoryObjects ($a_user_id)
 Get all ids of objects user owns. More...
 
static hasAutoRating ($a_type, $a_ref_id)
 Check if auto rating is active for parent group/course. More...
 
- Static Public Member Functions inherited from ilContainer
static _getContainerSettings ($a_id)
 
static _deleteContainerSettings ($a_id, $a_keyword=null, $a_keyword_like=false)
 
static _exportContainerSettings (ilXmlWriter $a_xml, $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 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 MAIL_ALLOWED_ALL = 1
 
const MAIL_ALLOWED_TUTORS = 2
 
 $members_obj
 
 $file_obj = null
 Group file object for handling of export files. More...
 
 $m_grpStatus
 
 $m_roleMemberId
 
 $m_roleAdminId
 
- Data Fields inherited from ilObject
const TITLE_LENGTH = 255
 max length of object title More...
 
const DESC_LENGTH = 128
 
 $ilias
 
 $lng
 
 $id
 
 $ref_id
 
 $type
 
 $title
 
 $untranslatedTitle
 
 $desc
 
 $long_desc
 
 $owner
 
 $create_date
 
 $last_update
 
 $import_id
 
 $register = false
 
 $referenced
 
 $objectList
 
 $max_title
 
 $max_desc
 
 $add_dots
 
 $obj_data_record
 object_data record More...
 
- 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_ILINC = 7
 
const VIEW_DEFAULT = self::VIEW_BY_TYPE
 
const SORT_TITLE = 0
 
const SORT_MANUAL = 1
 
const SORT_ACTIVATION = 2
 
const SORT_INHERIT = 3
 
const SORT_CREATION = 4
 
const SORT_DIRECTION_ASC = 0
 
const SORT_DIRECTION_DESC = 1
 
const SORT_NEW_ITEMS_POSITION_TOP = 0
 
const SORT_NEW_ITEMS_POSITION_BOTTOM = 1
 
const SORT_NEW_ITEMS_ORDER_TITLE = 0
 
const SORT_NEW_ITEMS_ORDER_CREATION = 1
 
const SORT_NEW_ITEMS_ORDER_ACTIVATION = 2
 

Protected Member Functions

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

Static Protected Member Functions

static translateViewMode ($a_obj_id, $a_view_mode, $a_ref_id=null)
 translate view mode More...
 

Protected Attributes

 $information
 
 $group_type = null
 
 $reg_type = GRP_REGISTRATION_DIRECT
 
 $reg_enabled = true
 
 $reg_unlimited = true
 
 $reg_start = null
 
 $reg_end = null
 
 $reg_password = ''
 
 $reg_membership_limitation = false
 
 $reg_max_members = 0
 
 $waiting_list = false
 
- Protected Attributes inherited from ilContainer
 $order_type = 0
 
 $hiddenfilesfound = false
 

Private Attributes

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

Additional Inherited Members

- Static Public Attributes inherited from ilContainer
static $data_preloaded = false
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

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

Constructor public.

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

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

References ilObject\ilObject(), and ilObject\setRegisterMode().

98  {
99  global $tree;
100 
101  $this->tree =& $tree;
102 
103  $this->type = "grp";
104  $this->ilObject($a_id,$a_call_by_reference);
105  $this->setRegisterMode(true); // ???
106  }
ilObject($a_id=0, $a_reference=true)
Constructor public.
setRegisterMode($a_bool)
+ Here is the call graph for this function:

Member Function Documentation

◆ __initFileObject()

ilObjGroup::__initFileObject ( )

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

References $file_obj.

Referenced by deleteExportFiles(), downloadExportFile(), and exportXML().

1825  {
1826  if($this->file_obj)
1827  {
1828  return $this->file_obj;
1829  }
1830  else
1831  {
1832  include_once './Modules/Group/classes/class.ilFileDataGroup.php';
1833 
1834  return $this->file_obj = new ilFileDataGroup($this);
1835  }
1836  }
$file_obj
Group file object for handling of export files.
+ Here is the caller graph for this function:

◆ _getMembers()

ilObjGroup::_getMembers (   $a_obj_id)

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

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

Referenced by _isMember(), and ilLPStatusManualByTutor\getMembers().

1695  {
1696  global $rbacreview;
1697 
1698  // get reference
1699  $ref_ids = ilObject::_getAllReferences($a_obj_id);
1700  $ref_id = current($ref_ids);
1701 
1702  $local_roles = $rbacreview->getRolesOfRoleFolder($ref_id,false);
1703 
1704  $users = array();
1705  foreach($local_roles as $role_id)
1706  {
1707  $users = array_merge($users,$rbacreview->assignedUsers($role_id));
1708  }
1709 
1710  return array_unique($users);
1711  }
static _getAllReferences($a_id)
get all reference ids of object
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ _importFromFile()

ilObjGroup::_importFromFile (   $file,
  $parent_id 
)
static

Static used for importing an group from xml zip file.

Parameters
xmlfile array structure like $_FILE from upload public

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

References ilObject\$lng, and _importFromXMLString().

Referenced by ilObjGroupGUI\importFileObject2().

1613  {
1614  global $lng;
1615 
1616  include_once './Modules/Group/classes/class.ilFileDataGroup.php';
1617 
1618  $file_obj = new ilFileDataGroup(null);
1619  $file_obj->addImportDirectory();
1620  $file_obj->createImportFile($_FILES["xmldoc"]["tmp_name"],$_FILES['xmldoc']['name']);
1621  $file_obj->unpackImportFile();
1622 
1623  if(!$file_obj->validateImportFile())
1624  {
1625  return false;
1626  }
1627  return ilObjGroup::_importFromXMLString(file_get_contents($file_obj->getImportFile()),$parent_id);
1628  }
_importFromXMLString($xml, $parent_id)
Static used for importing a group from xml string.
$file_obj
Group file object for handling of export files.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ _importFromXMLString()

ilObjGroup::_importFromXMLString (   $xml,
  $parent_id 
)
static

Static used for importing a group from xml string.

Parameters
xmlstring public

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

Referenced by _importFromFile().

1597  {
1598  include_once 'Modules/Group/classes/class.ilGroupXMLParser.php';
1599 
1600  $import_parser = new ilGroupXMLParser($xml,$parent_id);
1601 
1602  return $import_parser->startParsing();
1603  }
Group Import Parser.
+ Here is the caller graph for this function:

◆ _isMember()

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

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

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

Referenced by ilObjCourseGrouping\_checkGroupingDependencies().

1646  {
1647  global $rbacreview,$ilObjDataCache,$ilDB;
1648 
1649  $local_roles = $rbacreview->getRolesOfRoleFolder($a_ref_id,false);
1650  $user_roles = $rbacreview->assignedRoles($a_user_id);
1651 
1652  // Used for membership limitations -> check membership by given field
1653  if($a_field)
1654  {
1655  include_once './Services/User/classes/class.ilObjUser.php';
1656 
1657  $tmp_user =& ilObjectFactory::getInstanceByObjId($a_user_id);
1658  switch($a_field)
1659  {
1660  case 'login':
1661  $and = "AND login = '".$tmp_user->getLogin()."' ";
1662  break;
1663  case 'email':
1664  $and = "AND email = '".$tmp_user->getEmail()."' ";
1665  break;
1666  case 'matriculation':
1667  $and = "AND matriculation = '".$tmp_user->getMatriculation()."' ";
1668  break;
1669 
1670  default:
1671  $and = "AND usr_id = '".$a_user_id."'";
1672  break;
1673  }
1674  if(!$members = ilObjGroup::_getMembers($ilObjDataCache->lookupObjId($a_ref_id)))
1675  {
1676  return false;
1677  }
1678  $query = "SELECT * FROM usr_data as ud ".
1679  "WHERE usr_id IN (".implode(",",ilUtil::quoteArray($members)).") ".
1680  $and;
1681  $res = $ilDB->query($query);
1682 
1683  return $res->numRows() ? true : false;
1684  }
1685 
1686  if (!array_intersect($local_roles,$user_roles))
1687  {
1688  return false;
1689  }
1690 
1691  return true;
1692  }
_getMembers($a_obj_id)
getInstanceByObjId($a_obj_id, $stop_on_error=true)
get an instance of an Ilias object by object id
static quoteArray($a_array)
Quotes all members of an array for usage in DB query statement.
global $ilDB
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ _lookupIdByTitle()

ilObjGroup::_lookupIdByTitle (   $a_title)

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

References $ilDB, $query, $res, $row, and DB_FETCHMODE_OBJECT.

Referenced by ilMail\getEmailsOfRecipients(), and ilMail\getUserIds().

1631  {
1632  global $ilDB;
1633 
1634  $query = "SELECT * FROM object_data WHERE title = ".
1635  $ilDB->quote($a_title ,'text')." AND type = 'grp'";
1636  $res = $ilDB->query($query);
1637  while($row = $res->fetchRow(DB_FETCHMODE_OBJECT))
1638  {
1639  return $row->obj_id;
1640  }
1641  return 0;
1642  }
const DB_FETCHMODE_OBJECT
Definition: class.ilDB.php:11
global $ilDB
+ Here is the caller graph for this function:

◆ addAdditionalSubItemInformation()

ilObjGroup::addAdditionalSubItemInformation ( $a_item_data)

Add additional information to sub item, e.g.

used in courses for timings information etc.

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

References ilObjectActivation\addAdditionalSubItemInformation().

1818  {
1819  include_once './Services/Object/classes/class.ilObjectActivation.php';
1821  }
static addAdditionalSubItemInformation(array &$a_item)
Parse item data for list entries.
+ Here is the call graph for this function:

◆ addMember()

ilObjGroup::addMember (   $a_user_id,
  $a_mem_role 
)

add Member to Group public

Parameters
integeruser_id
integermember role_id of local group_role

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

References join().

908  {
909  global $rbacadmin;
910 
911  if (isset($a_user_id) && isset($a_mem_role) )
912  {
913  $this->join($a_user_id,$a_mem_role);
914  return true;
915  }
916  else
917  {
918  $this->ilias->raiseError(get_class($this)."::addMember(): Missing parameters !",$this->ilias->error_obj->WARNING);
919  return false;
920  }
921  }
join($a_user_id, $a_mem_role="")
join Group, assigns user to role private
redirection script todo: (a better solution should control the processing via a xml file) ...
+ Here is the call graph for this function:

◆ appendMessage()

ilObjGroup::appendMessage (   $a_message)

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

References getMessage().

1847  {
1848  if($this->getMessage())
1849  {
1850  $this->message .= "<br /> ";
1851  }
1852  $this->message .= $a_message;
1853  }
+ Here is the call graph for this function:

◆ cloneAutoGeneratedRoles()

ilObjGroup::cloneAutoGeneratedRoles (   $new_obj)

Clone group admin and member role permissions.

public

Parameters
objectnew group object

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

References $ilLog, getDefaultAdminRole(), getDefaultMemberRole(), and ilObject\getRefId().

Referenced by cloneObject().

832  {
833  global $ilLog,$rbacadmin,$rbacreview;
834 
835  $admin = $this->getDefaultAdminRole();
836  $new_admin = $new_obj->getDefaultAdminRole();
837  if(!$admin || !$new_admin || !$this->getRefId() || !$new_obj->getRefId())
838  {
839  $ilLog->write(__METHOD__.' : Error cloning auto generated role: il_grp_admin');
840  }
841  $rbacadmin->copyRolePermissions($admin,$this->getRefId(),$new_obj->getRefId(),$new_admin,true);
842  $ilLog->write(__METHOD__.' : Finished copying of role il_grp_admin.');
843 
844  $member = $this->getDefaultMemberRole();
845  $new_member = $new_obj->getDefaultMemberRole();
846  if(!$member || !$new_member)
847  {
848  $ilLog->write(__METHOD__.' : Error cloning auto generated role: il_grp_member');
849  }
850  $rbacadmin->copyRolePermissions($member,$this->getRefId(),$new_obj->getRefId(),$new_member,true);
851  $ilLog->write(__METHOD__.' : Finished copying of role grp_member.');
852  }
getDefaultAdminRole()
returns object id of created default adminstrator role public
getDefaultMemberRole()
returns object id of created default member role public
getRefId()
get reference id public
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ cloneDependencies()

ilObjGroup::cloneDependencies (   $a_target_id,
  $a_copy_id 
)

Clone object dependencies (crs items, preconditions)

public

Parameters
inttarget ref id of new course
intcopy id

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

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

813  {
814  global $tree;
815 
816  parent::cloneDependencies($a_target_id,$a_copy_id);
817 
818  include_once('Services/Object/classes/class.ilObjectActivation.php');
819  ilObjectActivation::cloneDependencies($this->getRefId(), $a_target_id, $a_copy_id);
820 
821  return true;
822  }
static cloneDependencies($a_ref_id, $a_target_id, $a_copy_id)
Clone dependencies.
getRefId()
get reference id public
+ Here is the call graph for this function:

◆ cloneObject()

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

Clone group (no member data)

public

Parameters
inttarget ref_id
intcopy id

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

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

744  {
745  global $ilDB,$ilUser;
746 
747  $new_obj = parent::cloneObject($a_target_id,$a_copy_id);
748  $new_obj->setGroupType($this->getGroupType());
749  $new_obj->initGroupStatus($this->getGroupType() ? $this->getGroupType() : $this->readGroupStatus());
750 
751  $this->cloneAutoGeneratedRoles($new_obj);
752 
753  $new_obj->setRegistrationType($this->getRegistrationType());
754  $new_obj->setInformation($this->getInformation());
755  $new_obj->setRegistrationStart($this->getRegistrationStart());
756  $new_obj->setRegistrationEnd($this->getRegistrationEnd());
757  $new_obj->enableUnlimitedRegistration($this->isRegistrationUnlimited());
758  $new_obj->setPassword($this->getPassword());
759  $new_obj->enableMembershipLimitation($this->isMembershipLimited());
760  $new_obj->setMaxMembers($this->getMaxMembers());
761  $new_obj->enableWaitingList($this->isWaitingListEnabled());
762 
763  // map
764  $new_obj->setLatitude($this->getLatitude());
765  $new_obj->setLongitude($this->getLongitude());
766  $new_obj->setLocationZoom($this->getLocationZoom());
767  $new_obj->setEnableGroupMap($this->getEnableGroupMap());
768  $new_obj->enableRegistrationAccessCode($this->isRegistrationAccessCodeEnabled());
769  include_once './Services/Membership/classes/class.ilMembershipRegistrationCodeUtils.php';
770  $new_obj->setRegistrationAccessCode(ilMembershipRegistrationCodeUtils::generateCode());
771 
772  $new_obj->setViewMode($this->getViewMode());
773  $new_obj->setMailToMembersType($this->getMailToMembersType());
774 
775  $new_obj->update();
776 
777  // #13008 - Group Defined Fields
778  include_once('Modules/Course/classes/Export/class.ilCourseDefinedFieldDefinition.php');
779  ilCourseDefinedFieldDefinition::_clone($this->getId(),$new_obj->getId());
780 
781  global $ilLog;
782  $ilLog->write(__METHOD__.': Starting add user');
783 
784  // Assign user as admin
785  include_once('./Modules/Group/classes/class.ilGroupParticipants.php');
786  $part = ilGroupParticipants::_getInstanceByObjId($new_obj->getId());
787  $part->add($ilUser->getId(),IL_GRP_ADMIN);
788  $part->updateNotification($ilUser->getId(),1);
789 
790  // Copy learning progress settings
791  include_once('Services/Tracking/classes/class.ilLPObjSettings.php');
792  $obj_settings = new ilLPObjSettings($this->getId());
793  $obj_settings->cloneSettings($new_obj->getId());
794  unset($obj_settings);
795 
796  // clone icons
797  $new_obj->saveIcons($this->getBigIconPath(),
798  $this->getSmallIconPath(),
799  $this->getTinyIconPath());
800 
801  return $new_obj;
802  }
getMaxMembers()
get max members
cloneAutoGeneratedRoles($new_obj)
Clone group admin and member role permissions.
getLongitude()
Get Longitude.
isRegistrationUnlimited()
is registration unlimited
isMembershipLimited()
is max member limited
getRegistrationType()
get registration type
const IL_GRP_ADMIN
getRegistrationEnd()
get registration end
getBigIconPath()
Get path for big icon.
getLatitude()
Get Latitude.
getTinyIconPath()
Get path for tiny icon.
getViewMode()
Get container view mode.
getRegistrationStart()
get registration start
static _clone($a_source_id, $a_target_id)
Clone fields.
getGroupType()
get group type
getId()
get object id public
getLocationZoom()
Get LocationZoom.
getEnableGroupMap()
Get Enable Group Map.
getInformation()
get Information
getMailToMembersType()
Get mail to members type.
static _getInstanceByObjId($a_obj_id)
Get singleton instance.
getSmallIconPath()
Get path for small icon.
getPassword()
get password
static generateCode()
Generate new registration key.
isRegistrationAccessCodeEnabled()
Check if access code is enabled.
global $ilUser
Definition: imgupload.php:15
global $ilDB
readGroupStatus()
get group status, redundant method because public
isWaitingListEnabled()
is waiting list enabled
+ Here is the call graph for this function:

◆ create()

ilObjGroup::create ( )

Create group.

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

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

570  {
571  global $ilDB,$ilAppEventHandler;
572 
573  if(!parent::create())
574  {
575  return false;
576  }
577 
578  $query = "INSERT INTO grp_settings (obj_id,information,grp_type,registration_type,registration_enabled,".
579  "registration_unlimited,registration_start,registration_end,registration_password,registration_mem_limit,".
580  "registration_max_members,waiting_list,latitude,longitude,location_zoom,enablemap,reg_ac_enabled,reg_ac,view_mode,mail_members_type) ".
581  "VALUES(".
582  $ilDB->quote($this->getId() ,'integer').", ".
583  $ilDB->quote($this->getInformation() ,'text').", ".
584  $ilDB->quote((int) $this->getGroupType() ,'integer').", ".
585  $ilDB->quote($this->getRegistrationType() ,'integer').", ".
586  $ilDB->quote(($this->isRegistrationEnabled() ? 1 : 0) ,'integer').", ".
587  $ilDB->quote(($this->isRegistrationUnlimited() ? 1 : 0) ,'integer').", ".
588  $ilDB->quote($this->getRegistrationStart()->get(IL_CAL_DATETIME,'') ,'timestamp').", ".
589  $ilDB->quote($this->getRegistrationEnd()->get(IL_CAL_DATETIME,'') ,'timestamp').", ".
590  $ilDB->quote($this->getPassword() ,'text').", ".
591  $ilDB->quote((int) $this->isMembershipLimited() ,'integer').", ".
592  $ilDB->quote($this->getMaxMembers() ,'integer').", ".
593  $ilDB->quote($this->isWaitingListEnabled() ? 1 : 0 ,'integer').", ".
594  $ilDB->quote($this->getLatitude() ,'text').", ".
595  $ilDB->quote($this->getLongitude() ,'text').", ".
596  $ilDB->quote($this->getLocationZoom() ,'integer').", ".
597  $ilDB->quote((int) $this->getEnableGroupMap() ,'integer').", ".
598  $ilDB->quote($this->isRegistrationAccessCodeEnabled(),'integer').', '.
599  $ilDB->quote($this->getRegistrationAccessCode(),'text').', '.
600  $ilDB->quote($this->getViewMode(false),'integer').', '.
601  $ilDB->quote($this->getMailToMembersType(),'integer').' '.
602  ")";
603  $res = $ilDB->manipulate($query);
604 
605  $ilAppEventHandler->raise('Modules/Group',
606  'create',
607  array('object' => $this,
608  'obj_id' => $this->getId(),
609  'appointments' => $this->prepareAppointments('create')));
610 
611  return $this->getId();
612  }
getMaxMembers()
get max members
isRegistrationEnabled()
is registration enabled
getLongitude()
Get Longitude.
isRegistrationUnlimited()
is registration unlimited
const IL_CAL_DATETIME
isMembershipLimited()
is max member limited
getRegistrationType()
get registration type
getRegistrationEnd()
get registration end
getLatitude()
Get Latitude.
getRegistrationAccessCode()
get access code
getViewMode()
Get container view mode.
getRegistrationStart()
get registration start
getGroupType()
get group type
getId()
get object id public
prepareAppointments($a_mode='create')
Prepare calendar appointments.
getLocationZoom()
Get LocationZoom.
getEnableGroupMap()
Get Enable Group Map.
getInformation()
get Information
getMailToMembersType()
Get mail to members type.
getPassword()
get password
isRegistrationAccessCodeEnabled()
Check if access code is enabled.
global $ilDB
isWaitingListEnabled()
is waiting list enabled
+ Here is the call graph for this function:

◆ delete()

ilObjGroup::delete ( )

delete group and all related data

public

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

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

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

667  {
668  global $ilDB,$ilAppEventHandler;
669 
670  // always call parent delete function first!!
671  if (!parent::delete())
672  {
673  return false;
674  }
675 
676  $query = "DELETE FROM grp_settings ".
677  "WHERE obj_id = ".$ilDB->quote($this->getId() ,'integer');
678  $res = $ilDB->manipulate($query);
679 
680  include_once('./Modules/Group/classes/class.ilGroupParticipants.php');
682 
683  $ilAppEventHandler->raise('Modules/Group',
684  'delete',
685  array('object' => $this,
686  'obj_id' => $this->getId(),
687  'appointments' => $this->prepareAppointments('delete')));
688 
689 
690  return true;
691  }
static _deleteAllEntries($a_obj_id)
Delete all entries Normally called for course deletion.
getId()
get object id public
prepareAppointments($a_mode='create')
Prepare calendar appointments.
global $ilDB
+ Here is the call graph for this function:

◆ deleteExportFiles()

ilObjGroup::deleteExportFiles (   $a_files)

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

References $file, and __initFileObject().

1566  {
1567  $this->__initFileObject();
1568 
1569  foreach($a_files as $file)
1570  {
1571  $this->file_obj->deleteFile($file);
1572  }
1573  return true;
1574  }
print $file
+ Here is the call graph for this function:

◆ downloadExportFile()

ilObjGroup::downloadExportFile (   $file)

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

References $file, __initFileObject(), and ilUtil\deliverFile().

1577  {
1578  $this->__initFileObject();
1579 
1580  if($abs_name = $this->file_obj->getExportFile($file))
1581  {
1582  ilUtil::deliverFile($abs_name,$file);
1583  // Not reached
1584  }
1585  return false;
1586  }
print $file
static deliverFile($a_file, $a_filename, $a_mime='', $isInline=false, $removeAfterDelivery=false, $a_exit_after=true)
deliver file for download via browser.
+ Here is the call graph for this function:

◆ enableMembershipLimitation()

ilObjGroup::enableMembershipLimitation (   $a_status)

enable max member limitation

public

Parameters
boolstatus
Returns

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

Referenced by read().

328  {
329  $this->reg_membership_limitation = $a_status;
330  }
+ Here is the caller graph for this function:

◆ enableRegistrationAccessCode()

ilObjGroup::enableRegistrationAccessCode (   $a_status)

En/disable registration access code.

Parameters
object$a_status
Returns

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

Referenced by read().

503  {
504  $this->reg_access_code_enabled = $a_status;
505  }
+ Here is the caller graph for this function:

◆ enableUnlimitedRegistration()

ilObjGroup::enableUnlimitedRegistration (   $a_status)

enable unlimited registration

public

Parameters
bool
Returns

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

Referenced by read().

236  {
237  $this->reg_unlimited = $a_status;
238  }
+ Here is the caller graph for this function:

◆ enableWaitingList()

ilObjGroup::enableWaitingList (   $a_status)

enable waiting list

public

Parameters
bool
Returns

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

Referenced by read().

373  {
374  $this->waiting_list = $a_status;
375  }
+ Here is the caller graph for this function:

◆ exportXML()

ilObjGroup::exportXML ( )

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

References __initFileObject(), and ilObject\getId().

1544  {
1545  include_once 'Modules/Group/classes/class.ilGroupXMLWriter.php';
1546 
1547  $xml_writer = new ilGroupXMLWriter($this);
1548  $xml_writer->start();
1549 
1550  $xml = $xml_writer->getXML();
1551 
1552  $name = time().'__'.$this->ilias->getSetting('inst_id').'__grp_'.$this->getId();
1553 
1554  $this->__initFileObject();
1555 
1556  $this->file_obj->addGroupDirectory();
1557  $this->file_obj->addDirectory($name);
1558  $this->file_obj->writeToFile($xml,$name.'/'.$name.'.xml');
1559  $this->file_obj->zipFile($name,$name.'.zip');
1560  $this->file_obj->deleteDirectory($name);
1561 
1562  return true;
1563  }
getId()
get object id public
redirection script todo: (a better solution should control the processing via a xml file) ...
XML writer class.
+ Here is the call graph for this function:

◆ getCountMembers()

ilObjGroup::getCountMembers ( )

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

References getGroupMemberIds().

1047  {
1048  return count($this->getGroupMemberIds());
1049  }
getGroupMemberIds()
get all group Member ids regardless of role public
+ Here is the call graph for this function:

◆ getDefaultAdminRole()

ilObjGroup::getDefaultAdminRole ( )

returns object id of created default adminstrator role public

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

References getLocalGroupRoles().

Referenced by cloneAutoGeneratedRoles().

895  {
896  $local_group_Roles = $this->getLocalGroupRoles();
897 
898  return $local_group_Roles["il_grp_admin_".$this->getRefId()];
899  }
getLocalGroupRoles($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 (   $a_grp_id = "")

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

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

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

References ilObject\getRefId().

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

1087  {
1088  global $rbacadmin, $rbacreview;
1089 
1090  if (strlen($a_grp_id) > 0)
1091  {
1092  $grp_id = $a_grp_id;
1093  }
1094  else
1095  {
1096  $grp_id = $this->getRefId();
1097  }
1098 
1099  $role_arr = $rbacreview->getRolesOfRoleFolder($grp_id);
1100 
1101  foreach ($role_arr as $role_id)
1102  {
1103  $role_Obj =& $this->ilias->obj_factory->getInstanceByObjId($role_id);
1104 
1105  $grp_Member ="il_grp_member_".$grp_id;
1106  $grp_Admin ="il_grp_admin_".$grp_id;
1107 
1108  if (strcmp($role_Obj->getTitle(), $grp_Member) == 0 )
1109  {
1110  $arr_grpDefaultRoles["grp_member_role"] = $role_Obj->getId();
1111  }
1112 
1113  if (strcmp($role_Obj->getTitle(), $grp_Admin) == 0)
1114  {
1115  $arr_grpDefaultRoles["grp_admin_role"] = $role_Obj->getId();
1116  }
1117  }
1118 
1119  return $arr_grpDefaultRoles;
1120  }
redirection script todo: (a better solution should control the processing via a xml file) ...
getRefId()
get reference id public
+ 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 public

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

References getLocalGroupRoles().

Referenced by cloneAutoGeneratedRoles().

884  {
885  $local_group_Roles = $this->getLocalGroupRoles();
886 
887  return $local_group_Roles["il_grp_member_".$this->getRefId()];
888  }
getLocalGroupRoles($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 ( )

Get Enable Group Map.

Returns
boolean Enable Group Map

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

References $enablemap.

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

465  {
466  return (bool) $this->enablemap;
467  }
+ Here is the caller graph for this function:

◆ getGroupAdminIds()

ilObjGroup::getGroupAdminIds (   $a_grpId = "")

get Group Admin Id public

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

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

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

Referenced by leaveGroup().

1058  {
1059  global $rbacreview;
1060 
1061  if (!empty($a_grpId))
1062  {
1063  $grp_id = $a_grpId;
1064  }
1065  else
1066  {
1067  $grp_id = $this->getRefId();
1068  }
1069 
1070  $usr_arr = array();
1071  $roles = $this->getDefaultGroupRoles($this->getRefId());
1072 
1073  foreach ($rbacreview->assignedUsers($this->getDefaultAdminRole()) as $member_id)
1074  {
1075  array_push($usr_arr,$member_id);
1076  }
1077 
1078  return $usr_arr;
1079  }
getDefaultGroupRoles($a_grp_id="")
get default group roles, returns the defaultlike create roles il_grp_member, il_grp_admin public ...
getRefId()
get reference id public
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getGroupMemberData()

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

get all group Members regardless of group role.

fetch all users data in one shot to improve performance public

Parameters
arrayof user ids
Returns
return array of userdata

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

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

1017  {
1018  global $rbacadmin, $rbacreview, $ilBench, $ilDB;
1019 
1020  $usr_arr= array();
1021 
1022  $q = "SELECT login,firstname,lastname,title,usr_id,last_login ".
1023  "FROM usr_data ".
1024  "WHERE usr_id IN (".implode(',',ilUtil::quoteArray($a_mem_ids)).") ";
1025 
1026  if (is_numeric($active) && $active > -1)
1027  $q .= "AND active = '$active'";
1028 
1029  $q .= 'ORDER BY lastname,firstname';
1030 
1031  $r = $ilDB->query($q);
1032 
1033  while($row = $r->fetchRow(DB_FETCHMODE_OBJECT))
1034  {
1035  $mem_arr[] = array("id" => $row->usr_id,
1036  "login" => $row->login,
1037  "firstname" => $row->firstname,
1038  "lastname" => $row->lastname,
1039  "last_login" => $row->last_login
1040  );
1041  }
1042 
1043  return $mem_arr ? $mem_arr : array();
1044  }
const DB_FETCHMODE_OBJECT
Definition: class.ilDB.php:11
static quoteArray($a_array)
Quotes all members of an array for usage in DB query statement.
global $ilBench
Definition: ilias.php:18
global $ilDB
$r
+ Here is the call graph for this function:

◆ getGroupMemberIds()

ilObjGroup::getGroupMemberIds ( )

get all group Member ids regardless of role public

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

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

References getLocalGroupRoles().

Referenced by getCountMembers(), and leaveGroup().

989  {
990  global $rbacadmin, $rbacreview;
991 
992  $usr_arr= array();
993 
994  $rol = $this->getLocalGroupRoles();
995 
996  foreach ($rol as $value)
997  {
998  foreach ($rbacreview->assignedUsers($value) as $member_id)
999  {
1000  array_push($usr_arr,$member_id);
1001  }
1002  }
1003 
1004  $mem_arr = array_unique($usr_arr);
1005 
1006  return $mem_arr ? $mem_arr : array();
1007  }
getLocalGroupRoles($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

public

Parameters
intgroup status

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

1415  {
1416  return $this->group_status;
1417  }

◆ getGroupType()

ilObjGroup::getGroupType ( )

get group type

public

Returns
int group type

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

References $group_type.

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

170  {
171  return $this->group_type;
172  }
+ Here is the caller graph for this function:

◆ getGrpStatusClosedTemplateId()

ilObjGroup::getGrpStatusClosedTemplateId ( )

get group status closed template public

Parameters
returnobj_id of roletemplate containing permissionsettings for a closed group

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

References $res, $row, and DB_FETCHMODE_ASSOC.

Referenced by initGroupStatus(), and updateGroupType().

1166  {
1167  $q = "SELECT obj_id FROM object_data WHERE type='rolt' AND title='il_grp_status_closed'";
1168  $res = $this->ilias->db->query($q);
1169  $row = $res->fetchRow(DB_FETCHMODE_ASSOC);
1170 
1171  return $row["obj_id"];
1172  }
redirection script todo: (a better solution should control the processing via a xml file) ...
const DB_FETCHMODE_ASSOC
Definition: class.ilDB.php:10
+ Here is the caller graph for this function:

◆ getGrpStatusOpenTemplateId()

ilObjGroup::getGrpStatusOpenTemplateId ( )

get group status open template public

Parameters
returnobj_id of roletemplate containing permissionsettings for an open group

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

References $res, $row, and DB_FETCHMODE_ASSOC.

Referenced by initGroupStatus(), and updateGroupType().

1180  {
1181  $q = "SELECT obj_id FROM object_data WHERE type='rolt' AND title='il_grp_status_open'";
1182  $res = $this->ilias->db->query($q);
1183  $row = $res->fetchRow(DB_FETCHMODE_ASSOC);
1184 
1185  return $row["obj_id"];
1186  }
redirection script todo: (a better solution should control the processing via a xml file) ...
const DB_FETCHMODE_ASSOC
Definition: class.ilDB.php:10
+ Here is the caller graph for this function:

◆ getInformation()

ilObjGroup::getInformation ( )

get Information

public

Parameters

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

References $information.

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

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

◆ getLatitude()

ilObjGroup::getLatitude ( )

Get Latitude.

Returns
string Latitude

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

References $latitude.

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

405  {
406  return $this->latitude;
407  }
+ Here is the caller graph for this function:

◆ getLocalGroupRoles()

ilObjGroup::getLocalGroupRoles (   $a_translate = false)

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

info is stored in object variable public

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

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

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

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

1129  {
1130  global $rbacadmin,$rbacreview;
1131 
1132  if (empty($this->local_roles))
1133  {
1134  $this->local_roles = array();
1135  $role_arr = $rbacreview->getRolesOfRoleFolder($this->getRefId());
1136 
1137  foreach ($role_arr as $role_id)
1138  {
1139  if ($rbacreview->isAssignable($role_id,$this->getRefId()) == true)
1140  {
1141  $role_Obj =& $this->ilias->obj_factory->getInstanceByObjId($role_id);
1142 
1143  if ($a_translate)
1144  {
1145  $role_name = ilObjRole::_getTranslation($role_Obj->getTitle());
1146  }
1147  else
1148  {
1149  $role_name = $role_Obj->getTitle();
1150  }
1151 
1152  $this->local_roles[$role_name] = $role_Obj->getId();
1153  }
1154  }
1155  }
1156 
1157  return $this->local_roles;
1158  }
_getTranslation($a_role_title)
redirection script todo: (a better solution should control the processing via a xml file) ...
getRefId()
get reference id public
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getLocationZoom()

ilObjGroup::getLocationZoom ( )

Get LocationZoom.

Returns
int LocationZoom

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

References $locationzoom.

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

445  {
446  return $this->locationzoom;
447  }
+ Here is the caller graph for this function:

◆ getLongitude()

ilObjGroup::getLongitude ( )

Get Longitude.

Returns
string Longitude

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

References $longitude.

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

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

◆ getMailToMembersType()

ilObjGroup::getMailToMembersType ( )

Get mail to members type.

Returns
int

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

References $mail_members.

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

522  {
523  return $this->mail_members;
524  }
+ Here is the caller graph for this function:

◆ getMaxMembers()

ilObjGroup::getMaxMembers ( )

get max members

public

Returns

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

References $reg_max_members.

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

361  {
362  return $this->reg_max_members;
363  }
+ Here is the caller graph for this function:

◆ getMemberRoles()

ilObjGroup::getMemberRoles (   $a_user_id)

get group member status public

Parameters
integeruser_id
Returns
returns array of obj_ids of assigned local roles

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

References $ilBench, and getLocalGroupRoles().

Referenced by leave().

1452  {
1453  global $rbacadmin, $rbacreview,$ilBench;
1454 
1455  $ilBench->start("Group", "getMemberRoles");
1456 
1457  $arr_assignedRoles = array();
1458 
1459  $arr_assignedRoles = array_intersect($rbacreview->assignedRoles($a_user_id),$this->getLocalGroupRoles());
1460 
1461  $ilBench->stop("Group", "getMemberRoles");
1462 
1463  return $arr_assignedRoles;
1464  }
getLocalGroupRoles($a_translate=false)
get ALL local roles of group, also those created and defined afterwards only fetch data once from dat...
global $ilBench
Definition: ilias.php:18
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getMessage()

ilObjGroup::getMessage ( )

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

Referenced by appendMessage().

1839  {
1840  return $this->message;
1841  }
+ Here is the caller graph for this function:

◆ getPassword()

ilObjGroup::getPassword ( )

get password

public

Returns
string password

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

References $reg_password.

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

316  {
317  return $this->reg_password;
318  }
+ Here is the caller graph for this function:

◆ getRegistrationAccessCode()

ilObjGroup::getRegistrationAccessCode ( )

get access code

Returns

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

References $reg_access_code.

Referenced by create(), and update().

474  {
475  return $this->reg_access_code;
476  }
+ Here is the caller graph for this function:

◆ getRegistrationEnd()

ilObjGroup::getRegistrationEnd ( )

get registration end

public

Returns
int registration end

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

References IL_CAL_DATETIME.

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

294  {
295  return $this->reg_end ? $this->reg_end : $this->reg_end = new ilDateTime(date('Y-m-d').' 16:00:00',IL_CAL_DATETIME);
296  }
const IL_CAL_DATETIME
Date and time handling
+ Here is the caller graph for this function:

◆ getRegistrationStart()

ilObjGroup::getRegistrationStart ( )

get registration start

public

Returns
int registration start

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

References IL_CAL_DATETIME.

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

270  {
271  return $this->reg_start ? $this->reg_start : $this->reg_start = new ilDateTime(date('Y-m-d').' 08:00:00',IL_CAL_DATETIME);
272  }
const IL_CAL_DATETIME
Date and time handling
+ Here is the caller graph for this function:

◆ getRegistrationType()

ilObjGroup::getRegistrationType ( )

get registration type

public

Returns
int registration type

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

References $reg_type.

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

213  {
214  return $this->reg_type;
215  }
+ Here is the caller graph for this function:

◆ getViewMode()

ilObjGroup::getViewMode (   $a_translate_inherit = true)

get view mode

public

Parameters
bool$a_translate_inherit
Returns
int view mode

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

References ilContainer\VIEW_DEFAULT.

1721  {
1722  $view = (int) $this->view_mode;
1723 
1724  if(!$view)
1725  {
1726  $view = ilContainer::VIEW_DEFAULT;
1727  }
1728 
1729  if($a_translate_inherit)
1730  {
1731  $view = self::translateViewMode($this->id, $view, $this->ref_id);
1732  }
1733 
1734  return $view;
1735  }

◆ initDefaultRoles()

ilObjGroup::initDefaultRoles ( )

init default roles settings public

Returns
array object IDs of created local roles.

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

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

1496  {
1497  include_once './Services/AccessControl/classes/class.ilObjRole.php';
1499  'il_grp_admin_'.$this->getRefId(),
1500  "Groupadmin group obj_no.".$this->getId(),
1501  'il_grp_admin',
1502  $this->getRefId()
1503  );
1504  $this->m_roleAdminId = $role->getId();
1505 
1507  'il_grp_member_'.$this->getRefId(),
1508  "Groupmember of group obj_no.".$this->getId(),
1509  'il_grp_member',
1510  $this->getRefId()
1511  );
1512  $this->m_roleMemberId = $role->getId();
1513 
1514  return array();
1515  }
static createDefaultRole($a_title, $a_description, $a_tpl_name, $a_ref_id)
getId()
get object id public
getRefId()
get reference id public
+ Here is the call graph for this function:

◆ initGroupStatus()

ilObjGroup::initGroupStatus (   $a_grpStatus = GRP_TYPE_PUBLIC)

set group status

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

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

public

Parameters
integergroup status GRP_TYPE_PUBLIC or GRP_TYPE_CLOSED

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

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

1320  {
1321  global $rbacadmin, $rbacreview, $rbacsystem;
1322 
1323  //define all relevant roles that rights are needed to be changed
1324  $arr_parentRoles = $rbacreview->getParentRoleIds($this->getRefId());
1325 
1326  $real_local_roles = $rbacreview->getRolesOfRoleFolder($this->getRefId(),false);
1327  $arr_relevantParentRoleIds = array_diff(array_keys($arr_parentRoles),$real_local_roles);
1328 
1329  //group status open (aka public) or group status closed
1330  if ($a_grpStatus == GRP_TYPE_PUBLIC || $a_grpStatus == GRP_TYPE_CLOSED)
1331  {
1332  if ($a_grpStatus == GRP_TYPE_PUBLIC)
1333  {
1334  $template_id = $this->getGrpStatusOpenTemplateId();
1335  }
1336  else
1337  {
1338  $template_id = $this->getGrpStatusClosedTemplateId();
1339  }
1340  //get defined operations from template
1341  $template_ops = $rbacreview->getOperationsOfRole($template_id, 'grp', ROLE_FOLDER_ID);
1342 
1343  foreach ($arr_relevantParentRoleIds as $parentRole)
1344  {
1345  if ($rbacreview->isProtected($arr_parentRoles[$parentRole]['parent'],$parentRole))
1346  {
1347  continue;
1348  }
1349 
1350  $granted_permissions = array();
1351 
1352  // Delete the linked role for the parent role
1353  // (just in case if it already exists).
1354 
1355  // Added additional check, since this operation is very dangerous.
1356  // If there is no role folder ALL parent roles are deleted.
1357 
1358  // @todo refactor rolf
1359  $rbacadmin->deleteLocalRole($parentRole,$this->getRefId());
1360 
1361  // Grant permissions on the group object for
1362  // the parent role. In the foreach loop we
1363  // compute the intersection of the role
1364  // template il_grp_status_open/_closed and the
1365  // permission template of the parent role.
1366  $current_ops = $rbacreview->getRoleOperationsOnObject($parentRole, $this->getRefId());
1367  $rbacadmin->revokePermission($this->getRefId(), $parentRole);
1368  foreach ($template_ops as $template_op)
1369  {
1370  if (in_array($template_op,$current_ops))
1371  {
1372  array_push($granted_permissions,$template_op);
1373  }
1374  }
1375  if (!empty($granted_permissions))
1376  {
1377  $rbacadmin->grantPermission($parentRole, $granted_permissions, $this->getRefId());
1378  }
1379 
1380  // Create a linked role for the parent role and
1381  // initialize it with the intersection of
1382  // il_grp_status_open/_closed and the permission
1383  // template of the parent role
1384 
1385  $rbacadmin->copyRolePermissionIntersection(
1386  $template_id, ROLE_FOLDER_ID,
1387  $parentRole, $arr_parentRoles[$parentRole]['parent'],
1388  $this->getRefId(), $parentRole
1389  );
1390  $rbacadmin->assignRoleToFolder($parentRole,$this->getRefId(),"false");
1391  }//END foreach
1392  }
1393  }
const GRP_TYPE_PUBLIC
getGrpStatusOpenTemplateId()
get group status open template public
getGrpStatusClosedTemplateId()
get group status closed template public
const GRP_TYPE_CLOSED
getRefId()
get reference id public
+ Here is the call graph for this function:

◆ initParticipants()

ilObjGroup::initParticipants ( )
protected

init participants object

protected

Returns

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

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

Referenced by read().

1906  {
1907  include_once('./Modules/Group/classes/class.ilGroupParticipants.php');
1908  $this->members_obj = ilGroupParticipants::_getInstanceByObjId($this->getId());
1909  }
getId()
get object id public
static _getInstanceByObjId($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 (   $a_userId)

is Admin public

Parameters
integeruser_id
boolean,trueif user is group administrator

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

References getDefaultGroupRoles().

Referenced by leaveGroup().

1473  {
1474  global $rbacreview;
1475 
1476  $grp_Roles = $this->getDefaultGroupRoles();
1477 
1478  if (in_array($a_userId,$rbacreview->assignedUsers($grp_Roles["grp_admin_role"])))
1479  {
1480  return true;
1481  }
1482  else
1483  {
1484  return false;
1485  }
1486  }
getDefaultGroupRoles($a_grp_id="")
get default group roles, returns the defaultlike create roles il_grp_member, il_grp_admin public ...
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ isGroupTypeModified()

ilObjGroup::isGroupTypeModified (   $a_old_type)

check if group type is modified

public

Parameters

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

References $group_type, getGroupType(), GRP_TYPE_UNKNOWN, and readGroupStatus().

182  {
183  if($a_old_type == GRP_TYPE_UNKNOWN)
184  {
185  $group_type = $this->readGroupStatus();
186  }
187  else
188  {
189  $group_type = $a_old_type;
190  }
191  return $group_type != $this->getGroupType();
192  }
const GRP_TYPE_UNKNOWN
getGroupType()
get group type
readGroupStatus()
get group status, redundant method because public
+ Here is the call graph for this function:

◆ isMembershipLimited()

ilObjGroup::isMembershipLimited ( )

is max member limited

public

Returns

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

References $reg_membership_limitation.

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

339  {
340  return (bool) $this->reg_membership_limitation;
341  }
+ Here is the caller graph for this function:

◆ isRegistrationAccessCodeEnabled()

ilObjGroup::isRegistrationAccessCodeEnabled ( )

Check if access code is enabled.

Returns

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

References $reg_access_code_enabled.

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

493  {
494  return (bool) $this->reg_access_code_enabled;
495  }
+ Here is the caller graph for this function:

◆ isRegistrationEnabled()

ilObjGroup::isRegistrationEnabled ( )

is registration enabled

public

Returns
bool

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

References getRegistrationType(), and GRP_REGISTRATION_DEACTIVATED.

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

224  {
226  }
const GRP_REGISTRATION_DEACTIVATED
getRegistrationType()
get registration type
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ isRegistrationUnlimited()

ilObjGroup::isRegistrationUnlimited ( )

is registration unlimited

public

Returns
bool

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

References $reg_unlimited.

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

247  {
248  return $this->reg_unlimited;
249  }
+ Here is the caller graph for this function:

◆ isWaitingListEnabled()

ilObjGroup::isWaitingListEnabled ( )

is waiting list enabled

public

Parameters

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

References $waiting_list.

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

385  {
386  return $this->waiting_list;
387  }
+ Here is the caller graph for this function:

◆ join()

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

join Group, assigns user to role private

Parameters
integermember status = obj_id of local_group_role

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

Referenced by addMember().

861  {
862  global $rbacadmin;
863 
864  if (is_array($a_mem_role))
865  {
866  foreach ($a_mem_role as $role)
867  {
868  $rbacadmin->assignUser($role,$a_user_id, false);
869  }
870  }
871  else
872  {
873  $rbacadmin->assignUser($a_mem_role,$a_user_id, false);
874  }
875 
876  return true;
877  }
+ Here is the caller graph for this function:

◆ leave()

ilObjGroup::leave (   $a_user_id)

deassign member from group role private

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

References getMemberRoles().

Referenced by leaveGroup().

962  {
963  global $rbacadmin;
964 
965  $arr_groupRoles = $this->getMemberRoles($a_user_id);
966 
967  if (is_array($arr_groupRoles))
968  {
969  foreach ($arr_groupRoles as $groupRole)
970  {
971  $rbacadmin->deassignUser($groupRole, $a_user_id);
972  }
973  }
974  else
975  {
976  $rbacadmin->deassignUser($arr_groupRoles, $a_user_id);
977  }
978 
979  return true;
980  }
getMemberRoles($a_user_id)
get group member status public
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ leaveGroup()

ilObjGroup::leaveGroup ( )

is called when a member decides to leave group public

Parameters
integeruser-Id
integergroup-Id

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

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

931  {
932  global $rbacadmin, $rbacreview;
933 
934  $member_ids = $this->getGroupMemberIds();
935 
936  if (count($member_ids) <= 1 || !in_array($this->ilias->account->getId(), $member_ids))
937  {
938  return 2;
939  }
940  else
941  {
942  if (!$this->isAdmin($this->ilias->account->getId()))
943  {
944  $this->leave($this->ilias->account->getId());
945  $member = new ilObjUser($this->ilias->account->getId());
946  $member->dropDesktopItem($this->getRefId(), "grp");
947 
948  return 0;
949  }
950  else if (count($this->getGroupAdminIds()) == 1)
951  {
952  return 1;
953  }
954  }
955  }
dropDesktopItem($a_item_id, $a_type)
drop an item from user&#39;s personal desktop
leave($a_user_id)
deassign member from group role private
redirection script todo: (a better solution should control the processing via a xml file) ...
getGroupAdminIds($a_grpId="")
get Group Admin Id public
getRefId()
get reference id public
getGroupMemberIds()
get all group Member ids regardless of role public
isAdmin($a_userId)
is Admin public
+ Here is the call graph for this function:

◆ lookupGroupStatusTemplateId()

static ilObjGroup::lookupGroupStatusTemplateId (   $a_obj_id)
static

$ilDB $ilDB

Parameters
int$a_obj_id
Returns
int

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

References $ilDB, $query, $res, $row, ilObject\$type, DB_FETCHMODE_ASSOC, and GRP_TYPE_CLOSED.

Referenced by ilRbacAdmin\adjustMovedObjectPermissions().

1195  {
1196  global $ilDB;
1197 
1198  $type = self::lookupGroupTye($a_obj_id);
1199  if($type == GRP_TYPE_CLOSED)
1200  {
1201  $query = 'SELECT obj_id FROM object_data WHERE type = '.$ilDB->quote('rolt','text').' AND title = '.$ilDB->quote('il_grp_status_closed','text');
1202  }
1203  else
1204  {
1205  $query = 'SELECT obj_id FROM object_data WHERE type = '.$ilDB->quote('rolt','text').' AND title = '.$ilDB->quote('il_grp_status_open','text');
1206  }
1207  $res = $ilDB->query($query);
1208  $row = $res->fetchRow(DB_FETCHMODE_ASSOC);
1209 
1210  return isset($row['obj_id']) ? $row['obj_id'] : 0;
1211  }
const GRP_TYPE_CLOSED
const DB_FETCHMODE_ASSOC
Definition: class.ilDB.php:10
global $ilDB
+ Here is the caller graph for this function:

◆ lookupGroupTye()

static ilObjGroup::lookupGroupTye (   $a_id)
static

Lookup group type.

Parameters
object$a_id
Returns

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

References $ilDB, $query, $res, $row, DB_FETCHMODE_OBJECT, and GRP_TYPE_UNKNOWN.

Referenced by ilObjRole\createPermissionIntersection().

114  {
115  global $ilDB;
116 
117  $query = "SELECT grp_type FROM grp_settings ".
118  "WHERE obj_id = ".$ilDB->quote($a_id,'integer');
119  $res = $ilDB->query($query);
120  while($row = $res->fetchRow(DB_FETCHMODE_OBJECT))
121  {
122  return $row->grp_type;
123  }
124  return GRP_TYPE_UNKNOWN;
125  }
const GRP_TYPE_UNKNOWN
const DB_FETCHMODE_OBJECT
Definition: class.ilDB.php:11
global $ilDB
+ Here is the caller graph for this function:

◆ lookupObjectsByCode()

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

Implements ilMembershipRegistrationCodes.

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

References $ilDB, $query, $res, $row, and DB_FETCHMODE_OBJECT.

Referenced by ilMembershipRegistrationCodeUtils\lookupObjectsByCode().

1916  {
1917  global $ilDB;
1918 
1919  $query = "SELECT obj_id FROM grp_settings ".
1920  "WHERE reg_ac_enabled = ".$ilDB->quote(1,'integer')." ".
1921  "AND reg_ac = ".$ilDB->quote($a_code,'text');
1922  $res = $ilDB->query($query);
1923 
1924  $obj_ids = array();
1925  while($row = $res->fetchRow(DB_FETCHMODE_OBJECT))
1926  {
1927  $obj_ids[] = $row->obj_id;
1928  }
1929  return $obj_ids;
1930  }
const DB_FETCHMODE_OBJECT
Definition: class.ilDB.php:11
global $ilDB
+ Here is the caller graph for this function:

◆ lookupViewMode()

static ilObjGroup::lookupViewMode (   $a_obj_id)
static

lookup view mode $ilDB

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

References $ilDB, $query, $res, $row, $view_mode, and DB_FETCHMODE_OBJECT.

1751  {
1752  global $ilDB;
1753 
1754  $query = 'SELECT view_mode FROM grp_settings '.
1755  'WHERE obj_id = '.$ilDB->quote($a_obj_id,'integer');
1756  $res = $ilDB->query($query);
1757 
1758  $view_mode = NULL;
1759  while($row = $res->fetchRow(DB_FETCHMODE_OBJECT))
1760  {
1761  $view_mode = $row->view_mode;
1762  }
1763  return self::translateViewMode($a_obj_id,$view_mode);
1764  }
const DB_FETCHMODE_OBJECT
Definition: class.ilDB.php:11
global $ilDB

◆ notify()

ilObjGroup::notify (   $a_event,
  $a_ref_id,
  $a_parent_non_rbac_id,
  $a_node_id,
  $a_params = 0 
)

notifys an object about an event occured Based on the event happend, each object may decide how it reacts.

public

Parameters
stringevent
integerreference id of object where the event occured
arraypasses optional parameters if required
Returns
boolean

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

1528  {
1529  global $tree;
1530 
1531  $parent_id = (int) $tree->getParentId($a_node_id);
1532 
1533  if ($parent_id != 0)
1534  {
1535  $obj_data =& $this->ilias->obj_factory->getInstanceByRefId($a_node_id);
1536  $obj_data->notify($a_event,$a_ref_id,$a_parent_non_rbac_id,$parent_id,$a_params);
1537  }
1538 
1539  return true;
1540  }
redirection script todo: (a better solution should control the processing via a xml file) ...

◆ prepareAppointments()

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

Prepare calendar appointments.

protected

Parameters
stringmode UPDATE|CREATE|DELETE
Returns

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

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

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

1863  {
1864  include_once('./Services/Calendar/classes/class.ilCalendarAppointmentTemplate.php');
1865 
1866  switch($a_mode)
1867  {
1868  case 'create':
1869  case 'update':
1870  if($this->isRegistrationUnlimited())
1871  {
1872  return array();
1873  }
1874  $app = new ilCalendarAppointmentTemplate(self::CAL_REG_START);
1875  $app->setTitle($this->getTitle());
1876  $app->setSubtitle('grp_cal_reg_start');
1877  $app->setTranslationType(IL_CAL_TRANSLATION_SYSTEM);
1878  $app->setDescription($this->getLongDescription());
1879  $app->setStart($this->getRegistrationStart());
1880  $apps[] = $app;
1881 
1882  $app = new ilCalendarAppointmentTemplate(self::CAL_REG_END);
1883  $app->setTitle($this->getTitle());
1884  $app->setSubtitle('grp_cal_reg_end');
1885  $app->setTranslationType(IL_CAL_TRANSLATION_SYSTEM);
1886  $app->setDescription($this->getLongDescription());
1887  $app->setStart($this->getRegistrationEnd());
1888  $apps[] = $app;
1889 
1890  return $apps;
1891 
1892  case 'delete':
1893  // Nothing to do: The category and all assigned appointments will be deleted.
1894  return array();
1895  }
1896  }
isRegistrationUnlimited()
is registration unlimited
const IL_CAL_TRANSLATION_SYSTEM
getRegistrationEnd()
get registration end
Apointment templates are used for automatic generated apointments.
getRegistrationStart()
get registration start
getTitle()
get object title public
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 ( )

Read group.

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

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

698  {
699  global $ilDB;
700 
701  parent::read();
702 
703  $query = "SELECT * FROM grp_settings ".
704  "WHERE obj_id = ".$ilDB->quote($this->getId() ,'integer');
705 
706  $res = $ilDB->query($query);
707  while($row = $res->fetchRow(DB_FETCHMODE_OBJECT))
708  {
709  $this->setInformation($row->information);
710  $this->setGroupType($row->grp_type);
711  $this->setRegistrationType($row->registration_type);
712  $this->enableUnlimitedRegistration($row->registration_unlimited);
713  $this->setRegistrationStart(new ilDateTime($row->registration_start,IL_CAL_DATETIME));
714  $this->setRegistrationEnd(new ilDateTime($row->registration_end,IL_CAL_DATETIME));
715  $this->setPassword($row->registration_password);
716  $this->enableMembershipLimitation((bool) $row->registration_mem_limit);
717  $this->setMaxMembers($row->registration_max_members);
718  $this->enableWaitingList($row->waiting_list);
719  $this->setLatitude($row->latitude);
720  $this->setLongitude($row->longitude);
721  $this->setLocationZoom($row->location_zoom);
722  $this->setEnableGroupMap($row->enablemap);
723  $this->enableRegistrationAccessCode($row->reg_ac_enabled);
724  $this->setRegistrationAccessCode($row->reg_ac);
725  $this->setViewMode($row->view_mode);
726  $this->setMailToMembersType($row->mail_members_type);
727  }
728  $this->initParticipants();
729 
730  // Inherit order type from parent course (if exists)
731  include_once('./Services/Container/classes/class.ilContainerSortingSettings.php');
733  }
const IL_CAL_DATETIME
setLongitude($a_longitude)
Set Longitude.
enableUnlimitedRegistration($a_status)
enable unlimited registration
const DB_FETCHMODE_OBJECT
Definition: class.ilDB.php:11
enableWaitingList($a_status)
enable waiting list
setLatitude($a_latitude)
Set Latitude.
getId()
get object id public
enableMembershipLimitation($a_status)
enable max member limitation
setPassword($a_pass)
set password
setViewMode($a_view_mode)
Set group view mode.
setMaxMembers($a_max)
set max members
setRegistrationEnd($a_end)
set registration end
setRegistrationType($a_type)
set registration type
Date and time handling
initParticipants()
init participants object
setGroupType($a_type)
set group type
setInformation($a_information)
set information
setEnableGroupMap($a_enablemap)
Set Enable Group Map.
setRegistrationStart($a_start)
set registration start
enableRegistrationAccessCode($a_status)
En/disable registration access code.
setLocationZoom($a_locationzoom)
Set LocationZoom.
setOrderType($a_value)
global $ilDB
static _lookupSortMode($a_obj_id)
lookup sort mode
setMailToMembersType($a_type)
Set mail to members type.
setRegistrationAccessCode($a_code)
Set refistration access code.
+ Here is the call graph for this function:

◆ readGroupStatus()

ilObjGroup::readGroupStatus ( )

get group status, redundant method because public

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

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

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

Referenced by cloneObject(), and isGroupTypeModified().

1425  {
1426  global $rbacsystem,$rbacreview;
1427 
1428  $local_roles = $rbacreview->getRolesOfRoleFolder($this->getRefId());
1429 
1430  //get all relevant roles
1431  $arr_globalRoles = array_diff($local_roles, $this->getDefaultGroupRoles());
1432 
1433  //if one global role has no permission to join the group is officially closed !
1434  foreach ($arr_globalRoles as $globalRole)
1435  {
1436  if ($rbacsystem->checkPermission($this->getRefId(), $globalRole ,"join"))
1437  {
1438  return $this->group_status = GRP_TYPE_PUBLIC;
1439  }
1440  }
1441 
1442  return $this->group_status = GRP_TYPE_CLOSED;
1443  }
getDefaultGroupRoles($a_grp_id="")
get default group roles, returns the defaultlike create roles il_grp_member, il_grp_admin public ...
const GRP_TYPE_PUBLIC
const GRP_TYPE_CLOSED
getRefId()
get reference id public
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ register()

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

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

References $waiting_list, ilDateTime\_after(), ilDateTime\_before(), ilGroupParticipants\_getInstanceByObjId(), ilObjGroupAccess\_usingRegistrationCode(), ilObject\getId(), getMaxMembers(), getRegistrationEnd(), getRegistrationStart(), ilObject\getTitle(), IL_CAL_UNIX, isMembershipLimited(), isRegistrationEnabled(), isRegistrationUnlimited(), isWaitingListEnabled(), and ilGroupMembershipMailNotification\TYPE_WAITING_LIST_MEMBER.

1939  {
1940  include_once './Services/Membership/exceptions/class.ilMembershipRegistrationException.php';
1941  include_once "./Modules/Group/classes/class.ilGroupParticipants.php";
1943 
1944  if($part->isAssigned($a_user_id))
1945  {
1946  return true;
1947  }
1948 
1949  if(!$a_force_registration)
1950  {
1951  // Availability
1952  if(!$this->isRegistrationEnabled())
1953  {
1954  include_once './Modules/Group/classes/class.ilObjGroupAccess.php';
1955 
1957  {
1958  throw new ilMembershipRegistrationException('Cant registrate to group '.$this->getId().
1959  ', group subscription is deactivated.', '456');
1960  }
1961  }
1962 
1963  // Time Limitation
1964  if(!$this->isRegistrationUnlimited())
1965  {
1966  $start = $this->getRegistrationStart();
1967  $end = $this->getRegistrationEnd();
1968  $time = new ilDateTime(time(),IL_CAL_UNIX);
1969 
1970  if( !(ilDateTime::_after($time, $start) and ilDateTime::_before($time,$end)) )
1971  {
1972  throw new ilMembershipRegistrationException('Cant registrate to group '.$this->getId().
1973  ', group is out of registration time.', '789');
1974  }
1975  }
1976 
1977  // Max members
1978  if($this->isMembershipLimited())
1979  {
1980  $free = max(0,$this->getMaxMembers() - $part->getCountMembers());
1981  include_once('./Modules/Group/classes/class.ilGroupWaitingList.php');
1982  $waiting_list = new ilGroupWaitingList($this->getId());
1983  if($this->isWaitingListEnabled() and (!$free or $waiting_list->getCountUsers()))
1984  {
1985  $this->lng->loadLanguageModule("grp");
1986  $waiting_list->addToList($a_user_id);
1987 
1988  $info = sprintf($this->lng->txt('grp_added_to_list'),
1989  $this->getTitle(),
1990  $waiting_list->getPosition($a_user_id));
1991 
1992  include_once('./Modules/Group/classes/class.ilGroupParticipants.php');
1993  include_once('./Modules/Group/classes/class.ilGroupMembershipMailNotification.php');
1994  $participants = ilGroupParticipants::_getInstanceByObjId($this->getId());
1995  $participants->sendNotification(ilGroupMembershipMailNotification::TYPE_WAITING_LIST_MEMBER,$a_user_id);
1996 
1997  throw new ilMembershipRegistrationException($info, '124');
1998  }
1999 
2000  if(!$free or $waiting_list->getCountUsers())
2001  {
2002  throw new ilMembershipRegistrationException('Cant registrate to group '.$this->getId().
2003  ', membership is limited.', '123');
2004  }
2005  }
2006  }
2007 
2008  $part->add($a_user_id,$a_role);
2009  $part->sendNotification($part->TYPE_NOTIFICATION_REGISTRATION, $a_user_id);
2010  return true;
2011  }
getMaxMembers()
get max members
isRegistrationEnabled()
is registration enabled
isRegistrationUnlimited()
is registration unlimited
isMembershipLimited()
is max member limited
getRegistrationEnd()
get registration end
static _after(ilDateTime $start, ilDateTime $end, $a_compare_field='', $a_tz='')
compare two dates and check start is after end This method does not consider tz offsets.
static _before(ilDateTime $start, ilDateTime $end, $a_compare_field='', $a_tz='')
compare two dates and check start is before end This method does not consider tz offsets.
const IL_CAL_UNIX
getRegistrationStart()
get registration start
getId()
get object id public
static _usingRegistrationCode()
Using Registration code.
Waiting list for groups.
getTitle()
get object title public
Date and time handling
static _getInstanceByObjId($a_obj_id)
Get singleton instance.
isWaitingListEnabled()
is waiting list enabled
+ Here is the call graph for this function:

◆ setEnableGroupMap()

ilObjGroup::setEnableGroupMap (   $a_enablemap)

Set Enable Group Map.

Parameters
boolean$a_enablemapEnable Group Map

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

Referenced by read().

455  {
456  $this->enablemap = $a_enablemap;
457  }
+ Here is the caller graph for this function:

◆ setGroupStatus()

ilObjGroup::setGroupStatus (   $a_status)

Set group status.

public

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

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

1403  {
1404  $this->group_status = $a_status;
1405  }

◆ setGroupType()

ilObjGroup::setGroupType (   $a_type)

set group type

public

Parameters
inttype

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

Referenced by read().

159  {
160  $this->group_type = $a_type;
161  }
+ Here is the caller graph for this function:

◆ setInformation()

ilObjGroup::setInformation (   $a_information)

set information

public

Parameters
stringinformation
Returns

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

Referenced by read().

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

◆ setLatitude()

ilObjGroup::setLatitude (   $a_latitude)

Set Latitude.

Parameters
string$a_latitudeLatitude

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

Referenced by read().

395  {
396  $this->latitude = $a_latitude;
397  }
+ Here is the caller graph for this function:

◆ setLocationZoom()

ilObjGroup::setLocationZoom (   $a_locationzoom)

Set LocationZoom.

Parameters
int$a_locationzoomLocationZoom

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

Referenced by read().

435  {
436  $this->locationzoom = $a_locationzoom;
437  }
+ Here is the caller graph for this function:

◆ setLongitude()

ilObjGroup::setLongitude (   $a_longitude)

Set Longitude.

Parameters
string$a_longitudeLongitude

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

Referenced by read().

415  {
416  $this->longitude = $a_longitude;
417  }
+ Here is the caller graph for this function:

◆ setMailToMembersType()

ilObjGroup::setMailToMembersType (   $a_type)

Set mail to members type.

See also
ilCourseConstants
Parameters
type$a_type

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

Referenced by read().

513  {
514  $this->mail_members = $a_type;
515  }
+ Here is the caller graph for this function:

◆ setMaxMembers()

ilObjGroup::setMaxMembers (   $a_max)

set max members

public

Parameters
intmax members

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

Referenced by read().

350  {
351  $this->reg_max_members = $a_max;
352  }
+ Here is the caller graph for this function:

◆ setMessage()

ilObjGroup::setMessage (   $a_message)

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

1843  {
1844  $this->message = $a_message;
1845  }

◆ setPassword()

ilObjGroup::setPassword (   $a_pass)

set password

public

Parameters
stringpassword

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

Referenced by read().

305  {
306  $this->reg_password = $a_pass;
307  }
+ Here is the caller graph for this function:

◆ setRegistrationAccessCode()

ilObjGroup::setRegistrationAccessCode (   $a_code)

Set refistration access code.

Parameters
string$a_code
Returns

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

Referenced by read().

484  {
485  $this->reg_access_code = $a_code;
486  }
+ Here is the caller graph for this function:

◆ setRegistrationEnd()

ilObjGroup::setRegistrationEnd (   $a_end)

set registration end

public

Parameters
intunix time
Returns

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

Referenced by read().

283  {
284  $this->reg_end = $a_end;
285  }
+ Here is the caller graph for this function:

◆ setRegistrationStart()

ilObjGroup::setRegistrationStart (   $a_start)

set registration start

public

Parameters
objectilDateTime
Returns

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

Referenced by read().

259  {
260  $this->reg_start = $a_start;
261  }
+ Here is the caller graph for this function:

◆ setRegistrationType()

ilObjGroup::setRegistrationType (   $a_type)

set registration type

public

Parameters
intregistration type
Returns

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

Referenced by read().

202  {
203  $this->reg_type = $a_type;
204  }
+ Here is the caller graph for this function:

◆ setViewMode()

ilObjGroup::setViewMode (   $a_view_mode)

Set group view mode.

Parameters
int$a_view_mode

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

Referenced by read().

1742  {
1743  $this->view_mode = $a_view_mode;
1744  }
+ Here is the caller graph for this function:

◆ translateViewMode()

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

translate view mode

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

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

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

1774  {
1775  global $tree;
1776 
1777  if(!$a_view_mode)
1778  {
1779  $a_view_mode = ilContainer::VIEW_DEFAULT;
1780  }
1781 
1782  // view mode is inherit => check for parent course
1783  if($a_view_mode == ilContainer::VIEW_INHERIT)
1784  {
1785  if(!$a_ref_id)
1786  {
1787  $ref = ilObject::_getAllReferences($a_obj_id);
1788  $a_ref_id = end($ref);
1789  }
1790 
1791  $crs_ref = $tree->checkForParentType($a_ref_id, 'crs');
1792  if(!$crs_ref)
1793  {
1795  }
1796 
1797  include_once './Modules/Course/classes/class.ilObjCourse.php';
1799 
1800  // validate course view mode
1801  if(!in_array($view_mode, array(ilContainer::VIEW_SESSIONS,
1803  {
1805  }
1806 
1807  return $view_mode;
1808  }
1809 
1810  return $a_view_mode;
1811  }
static _getAllReferences($a_id)
get all reference ids of object
static _lookupObjId($a_id)
+ Here is the call graph for this function:

◆ update()

ilObjGroup::update ( )

Update group.

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

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

618  {
619  global $ilDB,$ilAppEventHandler;
620 
621  if (!parent::update())
622  {
623  return false;
624  }
625 
626  $query = "UPDATE grp_settings ".
627  "SET information = ".$ilDB->quote($this->getInformation() ,'text').", ".
628  "grp_type = ".$ilDB->quote((int) $this->getGroupType() ,'integer').", ".
629  "registration_type = ".$ilDB->quote($this->getRegistrationType() ,'integer').", ".
630  "registration_enabled = ".$ilDB->quote($this->isRegistrationEnabled() ? 1 : 0 ,'integer').", ".
631  "registration_unlimited = ".$ilDB->quote($this->isRegistrationUnlimited() ? 1 : 0 ,'integer').", ".
632  "registration_start = ".$ilDB->quote($this->getRegistrationStart()->get(IL_CAL_DATETIME,'') ,'timestamp').", ".
633  "registration_end = ".$ilDB->quote($this->getRegistrationEnd()->get(IL_CAL_DATETIME,'') ,'timestamp').", ".
634  "registration_password = ".$ilDB->quote($this->getPassword() ,'text').", ".
635 // "registration_membership_limited = ".$ilDB->quote((int) $this->isMembershipLimited() ,'integer').", ".
636  "registration_mem_limit = ".$ilDB->quote((int) $this->isMembershipLimited() ,'integer').", ".
637  "registration_max_members = ".$ilDB->quote($this->getMaxMembers() ,'integer').", ".
638  "waiting_list = ".$ilDB->quote($this->isWaitingListEnabled() ? 1 : 0 ,'integer').", ".
639  "latitude = ".$ilDB->quote($this->getLatitude() ,'text').", ".
640  "longitude = ".$ilDB->quote($this->getLongitude() ,'text').", ".
641  "location_zoom = ".$ilDB->quote($this->getLocationZoom() ,'integer').", ".
642  "enablemap = ".$ilDB->quote((int) $this->getEnableGroupMap() ,'integer').", ".
643  'reg_ac_enabled = '.$ilDB->quote($this->isRegistrationAccessCodeEnabled(),'integer').', '.
644  'reg_ac = '.$ilDB->quote($this->getRegistrationAccessCode(),'text').', '.
645  'view_mode = '.$ilDB->quote($this->getViewMode(false),'integer').', '.
646  'mail_members_type = '.$ilDB->quote($this->getMailToMembersType(),'integer').' '.
647  "WHERE obj_id = ".$ilDB->quote($this->getId() ,'integer')." ";
648  $res = $ilDB->manipulate($query);
649 
650  $ilAppEventHandler->raise('Modules/Group',
651  'update',
652  array('object' => $this,
653  'obj_id' => $this->getId(),
654  'appointments' => $this->prepareAppointments('update')));
655 
656 
657  return true;
658  }
getMaxMembers()
get max members
isRegistrationEnabled()
is registration enabled
getLongitude()
Get Longitude.
isRegistrationUnlimited()
is registration unlimited
const IL_CAL_DATETIME
isMembershipLimited()
is max member limited
getRegistrationType()
get registration type
getRegistrationEnd()
get registration end
getLatitude()
Get Latitude.
getRegistrationAccessCode()
get access code
getViewMode()
Get container view mode.
getRegistrationStart()
get registration start
getGroupType()
get group type
getId()
get object id public
prepareAppointments($a_mode='create')
Prepare calendar appointments.
getLocationZoom()
Get LocationZoom.
getEnableGroupMap()
Get Enable Group Map.
getInformation()
get Information
getMailToMembersType()
Get mail to members type.
getPassword()
get password
isRegistrationAccessCodeEnabled()
Check if access code is enabled.
global $ilDB
isWaitingListEnabled()
is waiting list enabled
+ Here is the call graph for this function:

◆ updateGroupType()

ilObjGroup::updateGroupType ( )

Change group type.

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

public

Returns

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

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

1225  {
1226  global $tree,$rbacreview,$rbacadmin;
1227 
1228  $parent_roles = $rbacreview->getParentRoleIds($this->getRefId());
1229  $real_parent_roles = array_diff(array_keys($parent_roles),$this->getDefaultGroupRoles());
1230 
1231  // Delete parent roles with stopped inheritance
1232  foreach($real_parent_roles as $role_id)
1233  {
1234  // Delete local role
1235  $rbacadmin->deleteLocalRole($role_id,$this->getRefId());
1236  }
1237  $parent_roles = $rbacreview->getParentRoleIds($this->getRefId());
1238  $real_parent_roles = array_diff(array_keys($parent_roles),$this->getDefaultGroupRoles());
1239 
1240  switch($this->getGroupType())
1241  {
1242  case GRP_TYPE_PUBLIC:
1243  $template_id = $this->getGrpStatusOpenTemplateId();
1244  break;
1245 
1246  case GRP_TYPE_CLOSED:
1247  $template_id = $this->getGrpStatusClosedTemplateId();
1248  break;
1249  }
1250 
1251  $first = true;
1252  foreach($tree->getFilteredSubTree($this->getRefId(),array('grp')) as $subnode)
1253  {
1254  // Read template operations
1255  $template_ops = $rbacreview->getOperationsOfRole($template_id,$subnode['type'], ROLE_FOLDER_ID);
1256 
1257  // for all parent roles
1258  foreach($real_parent_roles as $role_id)
1259  {
1260  if($rbacreview->isProtected($parent_roles[$role_id]['parent'],$role_id))
1261  {
1262  continue;
1263  }
1264 
1265  $rbacadmin->deleteLocalRole($role_id,$subnode['child']);
1266 
1267  // Store current operations
1268  $current_ops = $rbacreview->getOperationsOfRole($role_id,$subnode['type'],$parent_roles[$role_id]['parent']);
1269 
1270  // Revoke permissions
1271  $rbacadmin->revokePermission($subnode['child'],$role_id);
1272 
1273  // Grant permissions
1274  $granted = array();
1275  foreach($template_ops as $operation)
1276  {
1277  if(in_array($operation,$current_ops))
1278  {
1279  $granted[] = $operation;
1280  }
1281  }
1282  if($granted)
1283  {
1284  $rbacadmin->grantPermission($role_id, $granted,$subnode['child']);
1285  }
1286 
1287  if($first)
1288  {
1289  // This is the group itself
1290  $rbacadmin->copyRolePermissionIntersection(
1291  $template_id, ROLE_FOLDER_ID,
1292  $role_id, $parent_roles[$role_id]['parent'],
1293  $subnode["child"],$role_id);
1294  $rbacadmin->assignRoleToFolder($role_id,$subnode['child'],"n");
1295 
1296  }
1297  }
1298  $first = false;
1299  }
1300  }
getDefaultGroupRoles($a_grp_id="")
get default group roles, returns the defaultlike create roles il_grp_member, il_grp_admin public ...
const GRP_TYPE_PUBLIC
getGrpStatusOpenTemplateId()
get group status open template public
getGrpStatusClosedTemplateId()
get group status closed template public
getGroupType()
get group type
const GRP_TYPE_CLOSED
getRefId()
get reference id public
+ Here is the call graph for this function:

◆ validate()

ilObjGroup::validate ( )

validate group settings

public

Returns
bool

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

References $ilErr, ilDateTime\_before(), getGroupType(), getMaxMembers(), getPassword(), getRegistrationEnd(), getRegistrationStart(), getRegistrationType(), ilObject\getTitle(), GRP_REGISTRATION_PASSWORD, and isMembershipLimited().

536  {
537  global $ilErr;
538 
539  if(!$this->getTitle())
540  {
541  $this->title = '';
542  $ilErr->appendMessage($this->lng->txt(self::ERR_MISSING_TITLE));
543  }
544  if(!$this->getGroupType())
545  {
546  $ilErr->appendMessage($this->lng->txt(self::ERR_MISSING_GROUP_TYPE));
547  }
548  if($this->getRegistrationType() == GRP_REGISTRATION_PASSWORD and !strlen($this->getPassword()))
549  {
550  $ilErr->appendMessage($this->lng->txt(self::ERR_MISSING_PASSWORD));
551  }
553  {
554  $ilErr->appendMessage($this->lng->txt(self::ERR_WRONG_REG_TIME_LIMIT));
555  }
556  if($this->isMembershipLimited() and (!is_numeric($this->getMaxMembers()) or $this->getMaxMembers() <= 0))
557  {
558  $ilErr->appendMessage($this->lng->txt(self::ERR_WRONG_MAX_MEMBERS));
559  }
560  return strlen($ilErr->getMessage()) == 0;
561  }
getMaxMembers()
get max members
isMembershipLimited()
is max member limited
getRegistrationType()
get registration type
getRegistrationEnd()
get registration end
static _before(ilDateTime $start, ilDateTime $end, $a_compare_field='', $a_tz='')
compare two dates and check start is before end This method does not consider tz offsets.
const GRP_REGISTRATION_PASSWORD
getRegistrationStart()
get registration start
getGroupType()
get group type
getTitle()
get object title public
getPassword()
get password
+ Here is the call graph for this function:

Field Documentation

◆ $enablemap

ilObjGroup::$enablemap = 0
private

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

Referenced by getEnableGroupMap().

◆ $file_obj

ilObjGroup::$file_obj = null

Group file object for handling of export files.

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

Referenced by __initFileObject().

◆ $group_type

ilObjGroup::$group_type = null
protected

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

Referenced by getGroupType(), and isGroupTypeModified().

◆ $information

ilObjGroup::$information
protected

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

Referenced by getInformation().

◆ $latitude

ilObjGroup::$latitude = ''
private

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

Referenced by getLatitude().

◆ $locationzoom

ilObjGroup::$locationzoom = 0
private

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

Referenced by getLocationZoom().

◆ $longitude

ilObjGroup::$longitude = ''
private

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

Referenced by getLongitude().

◆ $m_grpStatus

ilObjGroup::$m_grpStatus

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

◆ $m_roleAdminId

ilObjGroup::$m_roleAdminId

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

◆ $m_roleMemberId

ilObjGroup::$m_roleMemberId

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

◆ $mail_members

ilObjGroup::$mail_members = self::MAIL_ALLOWED_ALL
private

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

Referenced by getMailToMembersType().

◆ $members_obj

ilObjGroup::$members_obj

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

◆ $reg_access_code

ilObjGroup::$reg_access_code = ''
private

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

Referenced by getRegistrationAccessCode().

◆ $reg_access_code_enabled

ilObjGroup::$reg_access_code_enabled = false
private

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

Referenced by isRegistrationAccessCodeEnabled().

◆ $reg_enabled

ilObjGroup::$reg_enabled = true
protected

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

◆ $reg_end

ilObjGroup::$reg_end = null
protected

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

◆ $reg_max_members

ilObjGroup::$reg_max_members = 0
protected

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

Referenced by getMaxMembers().

◆ $reg_membership_limitation

ilObjGroup::$reg_membership_limitation = false
protected

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

Referenced by isMembershipLimited().

◆ $reg_password

ilObjGroup::$reg_password = ''
protected

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

Referenced by getPassword().

◆ $reg_start

ilObjGroup::$reg_start = null
protected

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

◆ $reg_type

ilObjGroup::$reg_type = GRP_REGISTRATION_DIRECT
protected

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

Referenced by getRegistrationType().

◆ $reg_unlimited

ilObjGroup::$reg_unlimited = true
protected

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

Referenced by isRegistrationUnlimited().

◆ $view_mode

ilObjGroup::$view_mode = NULL
private

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

Referenced by lookupViewMode(), and translateViewMode().

◆ $waiting_list

ilObjGroup::$waiting_list = false
protected

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

Referenced by isWaitingListEnabled(), and register().

◆ CAL_REG_END

const ilObjGroup::CAL_REG_END = 2

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

◆ CAL_REG_START

const ilObjGroup::CAL_REG_START = 1

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

◆ ERR_MISSING_GROUP_TYPE

const ilObjGroup::ERR_MISSING_GROUP_TYPE = 'grp_missing_grp_type'

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

◆ ERR_MISSING_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_REG_TIME_LIMIT

const ilObjGroup::ERR_WRONG_REG_TIME_LIMIT = 'grp_wrong_reg_time_limit'

Definition at line 45 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 48 of file class.ilObjGroup.php.

Referenced by ilObjGroupGUI\initForm().


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