ILIAS  release_4-4 Revision
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...
 
 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...
 
 createRoleFolder ()
 creates a local role folder 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...
 
 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_big_icon, $a_small_icon, $a_tiny_icon)
 save container icons More...
 
 removeBigIcon ()
 remove big icon More...
 
 removeSmallIcon ()
 remove small icon More...
 
 removeTinyIcon ()
 remove tiny 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...
 
 _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 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
 

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 1855 of file class.ilObjGroup.php.

References $file_obj.

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

1856  {
1857  if($this->file_obj)
1858  {
1859  return $this->file_obj;
1860  }
1861  else
1862  {
1863  include_once './Modules/Group/classes/class.ilFileDataGroup.php';
1864 
1865  return $this->file_obj = new ilFileDataGroup($this);
1866  }
1867  }
$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 1724 of file class.ilObjGroup.php.

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

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

1725  {
1726  global $rbacreview;
1727 
1728  // get reference
1729  $ref_ids = ilObject::_getAllReferences($a_obj_id);
1730  $ref_id = current($ref_ids);
1731 
1732  $rolf = $rbacreview->getRoleFolderOfObject($ref_id);
1733  $local_roles = $rbacreview->getRolesOfRoleFolder($rolf['ref_id'],false);
1734 
1735  $users = array();
1736  foreach($local_roles as $role_id)
1737  {
1738  $users = array_merge($users,$rbacreview->assignedUsers($role_id));
1739  }
1740 
1741  return array_unique($users);
1742  }
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 1641 of file class.ilObjGroup.php.

References ilObject\$lng, and _importFromXMLString().

Referenced by ilObjGroupGUI\importFileObject2().

1642  {
1643  global $lng;
1644 
1645  include_once './Modules/Group/classes/class.ilFileDataGroup.php';
1646 
1647  $file_obj = new ilFileDataGroup(null);
1648  $file_obj->addImportDirectory();
1649  $file_obj->createImportFile($_FILES["xmldoc"]["tmp_name"],$_FILES['xmldoc']['name']);
1650  $file_obj->unpackImportFile();
1651 
1652  if(!$file_obj->validateImportFile())
1653  {
1654  return false;
1655  }
1656  return ilObjGroup::_importFromXMLString(file_get_contents($file_obj->getImportFile()),$parent_id);
1657  }
_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 1625 of file class.ilObjGroup.php.

Referenced by _importFromFile().

1626  {
1627  include_once 'Modules/Group/classes/class.ilGroupXMLParser.php';
1628 
1629  $import_parser = new ilGroupXMLParser($xml,$parent_id);
1630 
1631  return $import_parser->startParsing();
1632  }
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 1674 of file class.ilObjGroup.php.

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

Referenced by ilObjCourseGrouping\_checkGroupingDependencies().

1675  {
1676  global $rbacreview,$ilObjDataCache,$ilDB;
1677 
1678  $rolf = $rbacreview->getRoleFolderOfObject($a_ref_id);
1679  $local_roles = $rbacreview->getRolesOfRoleFolder($rolf["ref_id"],false);
1680  $user_roles = $rbacreview->assignedRoles($a_user_id);
1681 
1682  // Used for membership limitations -> check membership by given field
1683  if($a_field)
1684  {
1685  include_once './Services/User/classes/class.ilObjUser.php';
1686 
1687  $tmp_user =& ilObjectFactory::getInstanceByObjId($a_user_id);
1688  switch($a_field)
1689  {
1690  case 'login':
1691  $and = "AND login = '".$tmp_user->getLogin()."' ";
1692  break;
1693  case 'email':
1694  $and = "AND email = '".$tmp_user->getEmail()."' ";
1695  break;
1696  case 'matriculation':
1697  $and = "AND matriculation = '".$tmp_user->getMatriculation()."' ";
1698  break;
1699 
1700  default:
1701  $and = "AND usr_id = '".$a_user_id."'";
1702  break;
1703  }
1704  if(!$members = ilObjGroup::_getMembers($ilObjDataCache->lookupObjId($a_ref_id)))
1705  {
1706  return false;
1707  }
1708  $query = "SELECT * FROM usr_data as ud ".
1709  "WHERE usr_id IN (".implode(",",ilUtil::quoteArray($members)).") ".
1710  $and;
1711  $res = $ilDB->query($query);
1712 
1713  return $res->numRows() ? true : false;
1714  }
1715 
1716  if (!array_intersect($local_roles,$user_roles))
1717  {
1718  return false;
1719  }
1720 
1721  return true;
1722  }
_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.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ _lookupIdByTitle()

ilObjGroup::_lookupIdByTitle (   $a_title)

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

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

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

1660  {
1661  global $ilDB;
1662 
1663  $query = "SELECT * FROM object_data WHERE title = ".
1664  $ilDB->quote($a_title ,'text')." AND type = 'grp'";
1665  $res = $ilDB->query($query);
1666  while($row = $res->fetchRow(DB_FETCHMODE_OBJECT))
1667  {
1668  return $row->obj_id;
1669  }
1670  return 0;
1671  }
const DB_FETCHMODE_OBJECT
Definition: class.ilDB.php:11
+ 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 1848 of file class.ilObjGroup.php.

References ilObjectActivation\addAdditionalSubItemInformation().

1849  {
1850  include_once './Services/Object/classes/class.ilObjectActivation.php';
1852  }
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 910 of file class.ilObjGroup.php.

References join().

911  {
912  global $rbacadmin;
913 
914  if (isset($a_user_id) && isset($a_mem_role) )
915  {
916  $this->join($a_user_id,$a_mem_role);
917  return true;
918  }
919  else
920  {
921  $this->ilias->raiseError(get_class($this)."::addMember(): Missing parameters !",$this->ilias->error_obj->WARNING);
922  return false;
923  }
924  }
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 1877 of file class.ilObjGroup.php.

References getMessage().

1878  {
1879  if($this->getMessage())
1880  {
1881  $this->message .= "<br /> ";
1882  }
1883  $this->message .= $a_message;
1884  }
+ 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  $source_rolf = $rbacreview->getRoleFolderIdOfObject($this->getRefId());
838  $target_rolf = $rbacreview->getRoleFolderIdOfObject($new_obj->getRefId());
839 
840  if(!$admin || !$new_admin || !$source_rolf || !$target_rolf)
841  {
842  $ilLog->write(__METHOD__.' : Error cloning auto generated role: il_grp_admin');
843  }
844  $rbacadmin->copyRolePermissions($admin,$source_rolf,$target_rolf,$new_admin,true);
845  $ilLog->write(__METHOD__.' : Finished copying of role il_grp_admin.');
846 
847  $member = $this->getDefaultMemberRole();
848  $new_member = $new_obj->getDefaultMemberRole();
849  if(!$member || !$new_member)
850  {
851  $ilLog->write(__METHOD__.' : Error cloning auto generated role: il_grp_member');
852  }
853  $rbacadmin->copyRolePermissions($member,$source_rolf,$target_rolf,$new_member,true);
854  $ilLog->write(__METHOD__.' : Finished copying of role grp_member.');
855  }
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 $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
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 $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.
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 $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.
+ Here is the call graph for this function:

◆ deleteExportFiles()

ilObjGroup::deleteExportFiles (   $a_files)

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

References $file, and __initFileObject().

1595  {
1596  $this->__initFileObject();
1597 
1598  foreach($a_files as $file)
1599  {
1600  $this->file_obj->deleteFile($file);
1601  }
1602  return true;
1603  }
print $file
+ Here is the call graph for this function:

◆ downloadExportFile()

ilObjGroup::downloadExportFile (   $file)

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

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

1606  {
1607  $this->__initFileObject();
1608 
1609  if($abs_name = $this->file_obj->getExportFile($file))
1610  {
1611  ilUtil::deliverFile($abs_name,$file);
1612  // Not reached
1613  }
1614  return false;
1615  }
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 1572 of file class.ilObjGroup.php.

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

1573  {
1574  include_once 'Modules/Group/classes/class.ilGroupXMLWriter.php';
1575 
1576  $xml_writer = new ilGroupXMLWriter($this);
1577  $xml_writer->start();
1578 
1579  $xml = $xml_writer->getXML();
1580 
1581  $name = time().'__'.$this->ilias->getSetting('inst_id').'__grp_'.$this->getId();
1582 
1583  $this->__initFileObject();
1584 
1585  $this->file_obj->addGroupDirectory();
1586  $this->file_obj->addDirectory($name);
1587  $this->file_obj->writeToFile($xml,$name.'/'.$name.'.xml');
1588  $this->file_obj->zipFile($name,$name.'.zip');
1589  $this->file_obj->deleteDirectory($name);
1590 
1591  return true;
1592  }
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 1049 of file class.ilObjGroup.php.

References getGroupMemberIds().

1050  {
1051  return count($this->getGroupMemberIds());
1052  }
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 897 of file class.ilObjGroup.php.

References getLocalGroupRoles().

Referenced by cloneAutoGeneratedRoles().

898  {
899  $local_group_Roles = $this->getLocalGroupRoles();
900 
901  return $local_group_Roles["il_grp_admin_".$this->getRefId()];
902  }
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 1089 of file class.ilObjGroup.php.

References ilObject\getRefId().

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

1090  {
1091  global $rbacadmin, $rbacreview;
1092 
1093  if (strlen($a_grp_id) > 0)
1094  {
1095  $grp_id = $a_grp_id;
1096  }
1097  else
1098  {
1099  $grp_id = $this->getRefId();
1100  }
1101 
1102  $rolf = $rbacreview->getRoleFolderOfObject($grp_id);
1103  $role_arr = $rbacreview->getRolesOfRoleFolder($rolf["ref_id"]);
1104 
1105  foreach ($role_arr as $role_id)
1106  {
1107  $role_Obj =& $this->ilias->obj_factory->getInstanceByObjId($role_id);
1108 
1109  $grp_Member ="il_grp_member_".$grp_id;
1110  $grp_Admin ="il_grp_admin_".$grp_id;
1111 
1112  if (strcmp($role_Obj->getTitle(), $grp_Member) == 0 )
1113  {
1114  $arr_grpDefaultRoles["grp_member_role"] = $role_Obj->getId();
1115  }
1116 
1117  if (strcmp($role_Obj->getTitle(), $grp_Admin) == 0)
1118  {
1119  $arr_grpDefaultRoles["grp_admin_role"] = $role_Obj->getId();
1120  }
1121  }
1122 
1123  return $arr_grpDefaultRoles;
1124  }
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 886 of file class.ilObjGroup.php.

References getLocalGroupRoles().

Referenced by cloneAutoGeneratedRoles().

887  {
888  $local_group_Roles = $this->getLocalGroupRoles();
889 
890  return $local_group_Roles["il_grp_member_".$this->getRefId()];
891  }
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 1060 of file class.ilObjGroup.php.

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

Referenced by leaveGroup().

1061  {
1062  global $rbacreview;
1063 
1064  if (!empty($a_grpId))
1065  {
1066  $grp_id = $a_grpId;
1067  }
1068  else
1069  {
1070  $grp_id = $this->getRefId();
1071  }
1072 
1073  $usr_arr = array();
1074  $roles = $this->getDefaultGroupRoles($this->getRefId());
1075 
1076  foreach ($rbacreview->assignedUsers($this->getDefaultAdminRole()) as $member_id)
1077  {
1078  array_push($usr_arr,$member_id);
1079  }
1080 
1081  return $usr_arr;
1082  }
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 1019 of file class.ilObjGroup.php.

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

1020  {
1021  global $rbacadmin, $rbacreview, $ilBench, $ilDB;
1022 
1023  $usr_arr= array();
1024 
1025  $q = "SELECT login,firstname,lastname,title,usr_id,last_login ".
1026  "FROM usr_data ".
1027  "WHERE usr_id IN (".implode(',',ilUtil::quoteArray($a_mem_ids)).") ";
1028 
1029  if (is_numeric($active) && $active > -1)
1030  $q .= "AND active = '$active'";
1031 
1032  $q .= 'ORDER BY lastname,firstname';
1033 
1034  $r = $ilDB->query($q);
1035 
1036  while($row = $r->fetchRow(DB_FETCHMODE_OBJECT))
1037  {
1038  $mem_arr[] = array("id" => $row->usr_id,
1039  "login" => $row->login,
1040  "firstname" => $row->firstname,
1041  "lastname" => $row->lastname,
1042  "last_login" => $row->last_login
1043  );
1044  }
1045 
1046  return $mem_arr ? $mem_arr : array();
1047  }
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
$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 991 of file class.ilObjGroup.php.

References getLocalGroupRoles().

Referenced by getCountMembers(), and leaveGroup().

992  {
993  global $rbacadmin, $rbacreview;
994 
995  $usr_arr= array();
996 
997  $rol = $this->getLocalGroupRoles();
998 
999  foreach ($rol as $value)
1000  {
1001  foreach ($rbacreview->assignedUsers($value) as $member_id)
1002  {
1003  array_push($usr_arr,$member_id);
1004  }
1005  }
1006 
1007  $mem_arr = array_unique($usr_arr);
1008 
1009  return $mem_arr ? $mem_arr : array();
1010  }
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 1408 of file class.ilObjGroup.php.

1409  {
1410  return $this->group_status;
1411  }

◆ 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 1170 of file class.ilObjGroup.php.

References $res, $row, and DB_FETCHMODE_ASSOC.

Referenced by initGroupStatus(), and updateGroupType().

1171  {
1172  $q = "SELECT obj_id FROM object_data WHERE type='rolt' AND title='il_grp_status_closed'";
1173  $res = $this->ilias->db->query($q);
1174  $row = $res->fetchRow(DB_FETCHMODE_ASSOC);
1175 
1176  return $row["obj_id"];
1177  }
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 1184 of file class.ilObjGroup.php.

References $res, $row, and DB_FETCHMODE_ASSOC.

Referenced by initGroupStatus(), and updateGroupType().

1185  {
1186  $q = "SELECT obj_id FROM object_data WHERE type='rolt' AND title='il_grp_status_open'";
1187  $res = $this->ilias->db->query($q);
1188  $row = $res->fetchRow(DB_FETCHMODE_ASSOC);
1189 
1190  return $row["obj_id"];
1191  }
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 1132 of file class.ilObjGroup.php.

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

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

1133  {
1134  global $rbacadmin,$rbacreview;
1135 
1136  if (empty($this->local_roles))
1137  {
1138  $this->local_roles = array();
1139  $rolf = $rbacreview->getRoleFolderOfObject($this->getRefId());
1140  $role_arr = $rbacreview->getRolesOfRoleFolder($rolf["ref_id"]);
1141 
1142  foreach ($role_arr as $role_id)
1143  {
1144  if ($rbacreview->isAssignable($role_id,$rolf["ref_id"]) == true)
1145  {
1146  $role_Obj =& $this->ilias->obj_factory->getInstanceByObjId($role_id);
1147 
1148  if ($a_translate)
1149  {
1150  $role_name = ilObjRole::_getTranslation($role_Obj->getTitle());
1151  }
1152  else
1153  {
1154  $role_name = $role_Obj->getTitle();
1155  }
1156 
1157  $this->local_roles[$role_name] = $role_Obj->getId();
1158  }
1159  }
1160  }
1161 
1162  return $this->local_roles;
1163  }
_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 1450 of file class.ilObjGroup.php.

References $ilBench, and getLocalGroupRoles().

Referenced by leave().

1451  {
1452  global $rbacadmin, $rbacreview,$ilBench;
1453 
1454  $ilBench->start("Group", "getMemberRoles");
1455 
1456  $arr_assignedRoles = array();
1457 
1458  $arr_assignedRoles = array_intersect($rbacreview->assignedRoles($a_user_id),$this->getLocalGroupRoles());
1459 
1460  $ilBench->stop("Group", "getMemberRoles");
1461 
1462  return $arr_assignedRoles;
1463  }
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 1869 of file class.ilObjGroup.php.

Referenced by appendMessage().

1870  {
1871  return $this->message;
1872  }
+ 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 1751 of file class.ilObjGroup.php.

References ilContainer\VIEW_DEFAULT.

1752  {
1753  $view = (int) $this->view_mode;
1754 
1755  if(!$view)
1756  {
1757  $view = ilContainer::VIEW_DEFAULT;
1758  }
1759 
1760  if($a_translate_inherit)
1761  {
1762  $view = self::translateViewMode($this->id, $view, $this->ref_id);
1763  }
1764 
1765  return $view;
1766  }

◆ initDefaultRoles()

ilObjGroup::initDefaultRoles ( )

init default roles settings public

Returns
array object IDs of created local roles.

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

References $m_roleAdminId, $m_roleMemberId, $r, ilObject\createRoleFolder(), DB_FETCHMODE_OBJECT, ilObject\getId(), and ilObject\getRefId().

1495  {
1496  global $rbacadmin, $rbacreview;
1497 
1498  // create a local role folder
1499  $rfoldObj =& $this->createRoleFolder();
1500 
1501  // ADMIN ROLE
1502  // create role and assign role to rolefolder...
1503  $roleObj = $rfoldObj->createRole("il_grp_admin_".$this->getRefId(),"Groupadmin of group obj_no.".$this->getId());
1504  $this->m_roleAdminId = $roleObj->getId();
1505 
1506  //set permission template of new local role
1507  $q = "SELECT obj_id FROM object_data WHERE type='rolt' AND title='il_grp_admin'";
1508  $r = $this->ilias->db->getRow($q, DB_FETCHMODE_OBJECT);
1509  $rbacadmin->copyRoleTemplatePermissions($r->obj_id,ROLE_FOLDER_ID,$rfoldObj->getRefId(),$roleObj->getId());
1510 
1511  // set object permissions of group object
1512  $ops = $rbacreview->getOperationsOfRole($roleObj->getId(),"grp",$rfoldObj->getRefId());
1513  $rbacadmin->grantPermission($roleObj->getId(),$ops,$this->getRefId());
1514 
1515  // set object permissions of role folder object
1516  //$ops = $rbacreview->getOperationsOfRole($roleObj->getId(),"rolf",$rfoldObj->getRefId());
1517  //$rbacadmin->grantPermission($roleObj->getId(),$ops,$rfoldObj->getRefId());
1518 
1519  // MEMBER ROLE
1520  // create role and assign role to rolefolder...
1521  $roleObj = $rfoldObj->createRole("il_grp_member_".$this->getRefId(),"Groupmember of group obj_no.".$this->getId());
1522  $this->m_roleMemberId = $roleObj->getId();
1523 
1524  //set permission template of new local role
1525  $q = "SELECT obj_id FROM object_data WHERE type='rolt' AND title='il_grp_member'";
1526  $r = $this->ilias->db->getRow($q, DB_FETCHMODE_OBJECT);
1527  $rbacadmin->copyRoleTemplatePermissions($r->obj_id,ROLE_FOLDER_ID,$rfoldObj->getRefId(),$roleObj->getId());
1528 
1529  // set object permissions of group object
1530  $ops = $rbacreview->getOperationsOfRole($roleObj->getId(),"grp",$rfoldObj->getRefId());
1531  $rbacadmin->grantPermission($roleObj->getId(),$ops,$this->getRefId());
1532 
1533  // set object permissions of role folder object
1534  //$ops = $rbacreview->getOperationsOfRole($roleObj->getId(),"rolf",$rfoldObj->getRefId());
1535  //$rbacadmin->grantPermission($roleObj->getId(),$ops,$rfoldObj->getRefId());
1536 
1537  unset($rfoldObj);
1538  unset($roleObj);
1539 
1540  $roles[] = $this->m_roleAdminId;
1541  $roles[] = $this->m_roleMemberId;
1542 
1543  return $roles ? $roles : array();
1544  }
const DB_FETCHMODE_OBJECT
Definition: class.ilDB.php:11
getId()
get object id public
redirection script todo: (a better solution should control the processing via a xml file) ...
getRefId()
get reference id public
createRoleFolder()
creates a local role folder
$r
+ 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 1310 of file class.ilObjGroup.php.

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

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

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

Referenced by read().

1937  {
1938  include_once('./Modules/Group/classes/class.ilGroupParticipants.php');
1939  $this->members_obj = ilGroupParticipants::_getInstanceByObjId($this->getId());
1940  }
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 1471 of file class.ilObjGroup.php.

References getDefaultGroupRoles().

Referenced by leaveGroup().

1472  {
1473  global $rbacreview;
1474 
1475  $grp_Roles = $this->getDefaultGroupRoles();
1476 
1477  if (in_array($a_userId,$rbacreview->assignedUsers($grp_Roles["grp_admin_role"])))
1478  {
1479  return true;
1480  }
1481  else
1482  {
1483  return false;
1484  }
1485  }
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 863 of file class.ilObjGroup.php.

Referenced by addMember().

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

◆ leave()

ilObjGroup::leave (   $a_user_id)

deassign member from group role private

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

References getMemberRoles().

Referenced by leaveGroup().

965  {
966  global $rbacadmin;
967 
968  $arr_groupRoles = $this->getMemberRoles($a_user_id);
969 
970  if (is_array($arr_groupRoles))
971  {
972  foreach ($arr_groupRoles as $groupRole)
973  {
974  $rbacadmin->deassignUser($groupRole, $a_user_id);
975  }
976  }
977  else
978  {
979  $rbacadmin->deassignUser($arr_groupRoles, $a_user_id);
980  }
981 
982  return true;
983  }
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 933 of file class.ilObjGroup.php.

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

934  {
935  global $rbacadmin, $rbacreview;
936 
937  $member_ids = $this->getGroupMemberIds();
938 
939  if (count($member_ids) <= 1 || !in_array($this->ilias->account->getId(), $member_ids))
940  {
941  return 2;
942  }
943  else
944  {
945  if (!$this->isAdmin($this->ilias->account->getId()))
946  {
947  $this->leave($this->ilias->account->getId());
948  $member = new ilObjUser($this->ilias->account->getId());
949  $member->dropDesktopItem($this->getRefId(), "grp");
950 
951  return 0;
952  }
953  else if (count($this->getGroupAdminIds()) == 1)
954  {
955  return 1;
956  }
957  }
958  }
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:

◆ 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 $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
+ 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 1946 of file class.ilObjGroup.php.

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

Referenced by ilMembershipRegistrationCodeUtils\lookupObjectsByCode().

1947  {
1948  global $ilDB;
1949 
1950  $query = "SELECT obj_id FROM grp_settings ".
1951  "WHERE reg_ac_enabled = ".$ilDB->quote(1,'integer')." ".
1952  "AND reg_ac = ".$ilDB->quote($a_code,'text');
1953  $res = $ilDB->query($query);
1954 
1955  $obj_ids = array();
1956  while($row = $res->fetchRow(DB_FETCHMODE_OBJECT))
1957  {
1958  $obj_ids[] = $row->obj_id;
1959  }
1960  return $obj_ids;
1961  }
const DB_FETCHMODE_OBJECT
Definition: class.ilDB.php:11
+ Here is the caller graph for this function:

◆ lookupViewMode()

static ilObjGroup::lookupViewMode (   $a_obj_id)
static

lookup view mode $ilDB

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

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

1782  {
1783  global $ilDB;
1784 
1785  $query = 'SELECT view_mode FROM grp_settings '.
1786  'WHERE obj_id = '.$ilDB->quote($a_obj_id,'integer');
1787  $res = $ilDB->query($query);
1788 
1789  $view_mode = NULL;
1790  while($row = $res->fetchRow(DB_FETCHMODE_OBJECT))
1791  {
1792  $view_mode = $row->view_mode;
1793  }
1794  return self::translateViewMode($a_obj_id,$view_mode);
1795  }
const DB_FETCHMODE_OBJECT
Definition: class.ilDB.php:11

◆ 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 1556 of file class.ilObjGroup.php.

1557  {
1558  global $tree;
1559 
1560  $parent_id = (int) $tree->getParentId($a_node_id);
1561 
1562  if ($parent_id != 0)
1563  {
1564  $obj_data =& $this->ilias->obj_factory->getInstanceByRefId($a_node_id);
1565  $obj_data->notify($a_event,$a_ref_id,$a_parent_non_rbac_id,$parent_id,$a_params);
1566  }
1567 
1568  return true;
1569  }
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 1893 of file class.ilObjGroup.php.

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

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

1894  {
1895  include_once('./Services/Calendar/classes/class.ilCalendarAppointmentTemplate.php');
1896 
1897  switch($a_mode)
1898  {
1899  case 'create':
1900  case 'update':
1901  if($this->isRegistrationUnlimited())
1902  {
1903  return array();
1904  }
1905  $app = new ilCalendarAppointmentTemplate(self::CAL_REG_START);
1906  $app->setTitle($this->getTitle());
1907  $app->setSubtitle('grp_cal_reg_start');
1908  $app->setTranslationType(IL_CAL_TRANSLATION_SYSTEM);
1909  $app->setDescription($this->getLongDescription());
1910  $app->setStart($this->getRegistrationStart());
1911  $apps[] = $app;
1912 
1913  $app = new ilCalendarAppointmentTemplate(self::CAL_REG_END);
1914  $app->setTitle($this->getTitle());
1915  $app->setSubtitle('grp_cal_reg_end');
1916  $app->setTranslationType(IL_CAL_TRANSLATION_SYSTEM);
1917  $app->setDescription($this->getLongDescription());
1918  $app->setStart($this->getRegistrationEnd());
1919  $apps[] = $app;
1920 
1921  return $apps;
1922 
1923  case 'delete':
1924  // Nothing to do: The category and all assigned appointments will be deleted.
1925  return array();
1926  }
1927  }
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 $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)
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 1418 of file class.ilObjGroup.php.

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

Referenced by cloneObject(), and isGroupTypeModified().

1419  {
1420  global $rbacsystem,$rbacreview;
1421 
1422  $role_folder = $rbacreview->getRoleFolderOfObject($this->getRefId());
1423  $local_roles = $rbacreview->getRolesOfRoleFolder($role_folder["ref_id"]);
1424 
1425  //get Rolefolder of group
1426  $rolf_data = $rbacreview->getRoleFolderOfObject($this->getRefId());
1427  //get all relevant roles
1428  $arr_globalRoles = array_diff($local_roles, $this->getDefaultGroupRoles());
1429 
1430  //if one global role has no permission to join the group is officially closed !
1431  foreach ($arr_globalRoles as $globalRole)
1432  {
1433  $ops_of_role = $rbacreview->getOperationsOfRole($globalRole,"grp", ROLE_FOLDER_ID);
1434 
1435  if ($rbacsystem->checkPermission($this->getRefId(), $globalRole ,"join"))
1436  {
1437  return $this->group_status = GRP_TYPE_PUBLIC;
1438  }
1439  }
1440 
1441  return $this->group_status = GRP_TYPE_CLOSED;
1442  }
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 1969 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.

1970  {
1971  include_once './Services/Membership/exceptions/class.ilMembershipRegistrationException.php';
1972  include_once "./Modules/Group/classes/class.ilGroupParticipants.php";
1974 
1975  if($part->isAssigned($a_user_id))
1976  {
1977  return true;
1978  }
1979 
1980  if(!$a_force_registration)
1981  {
1982  // Availability
1983  if(!$this->isRegistrationEnabled())
1984  {
1985  include_once './Modules/Group/classes/class.ilObjGroupAccess.php';
1986 
1988  {
1989  throw new ilMembershipRegistrationException('Cant registrate to group '.$this->getId().
1990  ', group subscription is deactivated.', '456');
1991  }
1992  }
1993 
1994  // Time Limitation
1995  if(!$this->isRegistrationUnlimited())
1996  {
1997  $start = $this->getRegistrationStart();
1998  $end = $this->getRegistrationEnd();
1999  $time = new ilDateTime(time(),IL_CAL_UNIX);
2000 
2001  if( !(ilDateTime::_after($time, $start) and ilDateTime::_before($time,$end)) )
2002  {
2003  throw new ilMembershipRegistrationException('Cant registrate to group '.$this->getId().
2004  ', group is out of registration time.', '789');
2005  }
2006  }
2007 
2008  // Max members
2009  if($this->isMembershipLimited())
2010  {
2011  $free = max(0,$this->getMaxMembers() - $part->getCountMembers());
2012  include_once('./Modules/Group/classes/class.ilGroupWaitingList.php');
2013  $waiting_list = new ilGroupWaitingList($this->getId());
2014  if($this->isWaitingListEnabled() and (!$free or $waiting_list->getCountUsers()))
2015  {
2016  $this->lng->loadLanguageModule("grp");
2017  $waiting_list->addToList($a_user_id);
2018 
2019  $info = sprintf($this->lng->txt('grp_added_to_list'),
2020  $this->getTitle(),
2021  $waiting_list->getPosition($a_user_id));
2022 
2023  include_once('./Modules/Group/classes/class.ilGroupParticipants.php');
2024  include_once('./Modules/Group/classes/class.ilGroupMembershipMailNotification.php');
2025  $participants = ilGroupParticipants::_getInstanceByObjId($this->getId());
2026  $participants->sendNotification(ilGroupMembershipMailNotification::TYPE_WAITING_LIST_MEMBER,$a_user_id);
2027 
2028  throw new ilMembershipRegistrationException($info, '124');
2029  }
2030 
2031  if(!$free or $waiting_list->getCountUsers())
2032  {
2033  throw new ilMembershipRegistrationException('Cant registrate to group '.$this->getId().
2034  ', membership is limited.', '123');
2035  }
2036  }
2037  }
2038 
2039  $part->add($a_user_id,$a_role);
2040  $part->sendNotification($part->TYPE_NOTIFICATION_REGISTRATION, $a_user_id);
2041  return true;
2042  }
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 1396 of file class.ilObjGroup.php.

1397  {
1398  $this->group_status = $a_status;
1399  }

◆ 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 1873 of file class.ilObjGroup.php.

1874  {
1875  $this->message = $a_message;
1876  }

◆ 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 1772 of file class.ilObjGroup.php.

Referenced by read().

1773  {
1774  $this->view_mode = $a_view_mode;
1775  }
+ 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 1804 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.

1805  {
1806  global $tree;
1807 
1808  if(!$a_view_mode)
1809  {
1810  $a_view_mode = ilContainer::VIEW_DEFAULT;
1811  }
1812 
1813  // view mode is inherit => check for parent course
1814  if($a_view_mode == ilContainer::VIEW_INHERIT)
1815  {
1816  if(!$a_ref_id)
1817  {
1818  $ref = ilObject::_getAllReferences($a_obj_id);
1819  $a_ref_id = end($ref);
1820  }
1821 
1822  $crs_ref = $tree->checkForParentType($a_ref_id, 'crs');
1823  if(!$crs_ref)
1824  {
1826  }
1827 
1828  include_once './Modules/Course/classes/class.ilObjCourse.php';
1830 
1831  // validate course view mode
1832  if(!in_array($view_mode, array(ilContainer::VIEW_SESSIONS,
1834  {
1836  }
1837 
1838  return $view_mode;
1839  }
1840 
1841  return $a_view_mode;
1842  }
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 $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.
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 1204 of file class.ilObjGroup.php.

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

1205  {
1206  global $tree,$rbacreview,$rbacadmin;
1207 
1208  $parent_roles = $rbacreview->getParentRoleIds($this->getRefId());
1209  $real_parent_roles = array_diff(array_keys($parent_roles),$this->getDefaultGroupRoles());
1210  $rolf_data = $rbacreview->getRoleFolderOfObject($this->getRefId());
1211 
1212  // Delete parent roles with stopped inheritance
1213  foreach($real_parent_roles as $role_id)
1214  {
1215  // Delete local role
1216  if(isset($rolf_data['child']) and $rolf_data['child'])
1217  {
1218  $rbacadmin->deleteLocalRole($role_id,$rolf_data['child']);
1219  }
1220  }
1221  $parent_roles = $rbacreview->getParentRoleIds($this->getRefId());
1222  $real_parent_roles = array_diff(array_keys($parent_roles),$this->getDefaultGroupRoles());
1223 
1224  switch($this->getGroupType())
1225  {
1226  case GRP_TYPE_PUBLIC:
1227  $template_id = $this->getGrpStatusOpenTemplateId();
1228  break;
1229 
1230  case GRP_TYPE_CLOSED:
1231  $template_id = $this->getGrpStatusClosedTemplateId();
1232  break;
1233  }
1234 
1235  $first = true;
1236  foreach($tree->getFilteredSubTree($this->getRefId(),array('rolf','grp')) as $subnode)
1237  {
1238  // Read template operations
1239  $template_ops = $rbacreview->getOperationsOfRole($template_id,$subnode['type'], ROLE_FOLDER_ID);
1240 
1241  $rolf_data = $rbacreview->getRoleFolderOfObject($subnode['child']);
1242 
1243 
1244  // for all parent roles
1245  foreach($real_parent_roles as $role_id)
1246  {
1247  if($rbacreview->isProtected($parent_roles[$role_id]['parent'],$role_id))
1248  {
1249  continue;
1250  }
1251 
1252  // Delete local role
1253  if(isset($rolf_data['child']) and $rolf_data['child'])
1254  {
1255  $rbacadmin->deleteLocalRole($role_id,$rolf_data['child']);
1256  }
1257 
1258  // Store current operations
1259  $current_ops = $rbacreview->getOperationsOfRole($role_id,$subnode['type'],$parent_roles[$role_id]['parent']);
1260 
1261  // Revoke permissions
1262  $rbacadmin->revokePermission($subnode['child'],$role_id);
1263 
1264  // Grant permissions
1265  $granted = array();
1266  foreach($template_ops as $operation)
1267  {
1268  if(in_array($operation,$current_ops))
1269  {
1270  $granted[] = $operation;
1271  }
1272  }
1273  if($granted)
1274  {
1275  $rbacadmin->grantPermission($role_id, $granted,$subnode['child']);
1276  }
1277 
1278  if($first)
1279  {
1280  // This is the group itself
1281  $rbacadmin->copyRolePermissionIntersection(
1282  $template_id, ROLE_FOLDER_ID,
1283  $role_id, $parent_roles[$role_id]['parent'],
1284  $rolf_data["child"],$role_id);
1285  $rbacadmin->assignRoleToFolder($role_id,$rolf_data["child"],"n");
1286 
1287  }
1288  }
1289  $first = false;
1290  }
1291  }
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.

Referenced by initDefaultRoles().

◆ $m_roleMemberId

ilObjGroup::$m_roleMemberId

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

Referenced by initDefaultRoles().

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

◆ GRP_MEMBER

const ilObjGroup::GRP_MEMBER = 1

◆ MAIL_ALLOWED_ALL

const ilObjGroup::MAIL_ALLOWED_ALL = 1

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

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

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