ILIAS  release_4-3 Revision
 All Data Structures Namespaces Files Functions Variables Groups Pages
ilObjGroup Class Reference

Class ilObjGroup. More...

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

Public Member Functions

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

Static Public Member Functions

static lookupGroupTye ($a_id)
 Lookup group type.
 _importFromXMLString ($xml, $parent_id)
 Static used for importing a group from xml string.
 _importFromFile ($file, $parent_id)
 Static used for importing an group from xml zip file.
static lookupViewMode ($a_obj_id)
 lookup view mode $ilDB
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
static _lookupTitle ($a_id)
 lookup object title
static _getIdsForTitle ($title, $type= '', $partialmatch=false)
static _lookupDescription ($a_id)
 lookup object description
static _lookupObjId ($a_id)
static _lookupType ($a_id, $a_reference=false)
 lookup object type
static _lookupObjectId ($a_ref_id)
 lookup object id
 _exists ($a_id, $a_reference=false)
 checks if an object exists in object_data
static _getObjectsByType ($a_obj_type="", $a_owner="")
 Get objects by type.
static _prepareCloneSelection ($a_ref_ids, $new_type, $show_path=true)
 Prepare copy wizard object selection.
static _getIcon ($a_obj_id="", $a_size="big", $a_type="", $a_offline=false)
 Get icon for repository item.
static collectDeletionDependencies (&$deps, $a_ref_id, $a_obj_id, $a_type, $a_depth=0)
 Collect deletion dependencies.
static getDeletionDependencies ($a_obj_id)
 Get deletion dependencies.
static getLongDescriptions (array $a_obj_ids)
 Get long description data.
static getAllOwnedRepositoryObjects ($a_user_id)
 Get all ids of objects user owns.

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'
 $members_obj
 $file_obj = null
 Group file object for handling of export files.
 $m_grpStatus
 $m_roleMemberId
 $m_roleAdminId
- Data Fields inherited from ilObject
const TITLE_LENGTH = 128
 max length of object title
 $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
- 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.
 initParticipants ()
 init participants object

Static Protected Member Functions

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

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

Additional Inherited Members

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

Detailed Description

Constructor & Destructor Documentation

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

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

{
global $tree;
$this->tree =& $tree;
$this->type = "grp";
$this->ilObject($a_id,$a_call_by_reference);
$this->setRegisterMode(true); // ???
}

+ Here is the call graph for this function:

Member Function Documentation

ilObjGroup::__initFileObject ( )

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

References $file_obj.

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

{
if($this->file_obj)
{
}
else
{
include_once './Modules/Group/classes/class.ilFileDataGroup.php';
return $this->file_obj = new ilFileDataGroup($this);
}
}

+ Here is the caller graph for this function:

ilObjGroup::_getMembers (   $a_obj_id)

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

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

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

{
global $rbacreview;
// get reference
$ref_ids = ilObject::_getAllReferences($a_obj_id);
$ref_id = current($ref_ids);
$rolf = $rbacreview->getRoleFolderOfObject($ref_id);
$local_roles = $rbacreview->getRolesOfRoleFolder($rolf['ref_id'],false);
$users = array();
foreach($local_roles as $role_id)
{
$users = array_merge($users,$rbacreview->assignedUsers($role_id));
}
return array_unique($users);
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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

References $file_obj, ilObject\$lng, and _importFromXMLString().

Referenced by ilObjGroupGUI\importFileObject2().

{
global $lng;
include_once './Modules/Group/classes/class.ilFileDataGroup.php';
$file_obj->addImportDirectory();
$file_obj->createImportFile($_FILES["xmldoc"]["tmp_name"],$_FILES['xmldoc']['name']);
$file_obj->unpackImportFile();
if(!$file_obj->validateImportFile())
{
return false;
}
return ilObjGroup::_importFromXMLString(file_get_contents($file_obj->getImportFile()),$parent_id);
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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

Static used for importing a group from xml string.

Parameters
xmlstring public

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

Referenced by _importFromFile().

{
include_once 'Modules/Group/classes/class.ilGroupXMLParser.php';
$import_parser = new ilGroupXMLParser($xml,$parent_id);
return $import_parser->startParsing();
}

+ Here is the caller graph for this function:

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

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

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

Referenced by ilObjCourseGrouping\_checkGroupingDependencies().

{
global $rbacreview,$ilObjDataCache,$ilDB;
$rolf = $rbacreview->getRoleFolderOfObject($a_ref_id);
$local_roles = $rbacreview->getRolesOfRoleFolder($rolf["ref_id"],false);
$user_roles = $rbacreview->assignedRoles($a_user_id);
// Used for membership limitations -> check membership by given field
if($a_field)
{
include_once './Services/User/classes/class.ilObjUser.php';
$tmp_user =& ilObjectFactory::getInstanceByObjId($a_user_id);
switch($a_field)
{
case 'login':
$and = "AND login = '".$tmp_user->getLogin()."' ";
break;
case 'email':
$and = "AND email = '".$tmp_user->getEmail()."' ";
break;
case 'matriculation':
$and = "AND matriculation = '".$tmp_user->getMatriculation()."' ";
break;
default:
$and = "AND usr_id = '".$a_user_id."'";
break;
}
if(!$members = ilObjGroup::_getMembers($ilObjDataCache->lookupObjId($a_ref_id)))
{
return false;
}
$query = "SELECT * FROM usr_data as ud ".
"WHERE usr_id IN (".implode(",",ilUtil::quoteArray($members)).") ".
$and;
$res = $ilDB->query($query);
return $res->numRows() ? true : false;
}
if (!array_intersect($local_roles,$user_roles))
{
return false;
}
return true;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilObjGroup::_lookupIdByTitle (   $a_title)

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

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

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

{
global $ilDB;
$query = "SELECT * FROM object_data WHERE title = ".
$ilDB->quote($a_title ,'text')." AND type = 'grp'";
$res = $ilDB->query($query);
while($row = $res->fetchRow(DB_FETCHMODE_OBJECT))
{
return $row->obj_id;
}
return 0;
}

+ Here is the caller graph for this function:

ilObjGroup::addAdditionalSubItemInformation ( $a_item_data)

Add additional information to sub item, e.g.

used in courses for timings information etc.

Reimplemented from ilContainer.

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

{
include_once './Services/Object/classes/class.ilObjectActivation.php';
}
ilObjGroup::addMember (   $a_user_id,
  $a_mem_role 
)

add Member to Group public

Parameters
integeruser_id
integermember role_id of local group_role

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

References join().

{
global $rbacadmin;
if (isset($a_user_id) && isset($a_mem_role) )
{
$this->join($a_user_id,$a_mem_role);
return true;
}
else
{
$this->ilias->raiseError(get_class($this)."::addMember(): Missing parameters !",$this->ilias->error_obj->WARNING);
return false;
}
}

+ Here is the call graph for this function:

ilObjGroup::appendMessage (   $a_message)

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

References getMessage().

{
if($this->getMessage())
{
$this->message .= "<br /> ";
}
$this->message .= $a_message;
}

+ Here is the call graph for this function:

ilObjGroup::cloneAutoGeneratedRoles (   $new_obj)

Clone group admin and member role permissions.

public

Parameters
objectnew group object

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

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

Referenced by cloneObject().

{
global $ilLog,$rbacadmin,$rbacreview;
$admin = $this->getDefaultAdminRole();
$new_admin = $new_obj->getDefaultAdminRole();
$source_rolf = $rbacreview->getRoleFolderIdOfObject($this->getRefId());
$target_rolf = $rbacreview->getRoleFolderIdOfObject($new_obj->getRefId());
if(!$admin || !$new_admin || !$source_rolf || !$target_rolf)
{
$ilLog->write(__METHOD__.' : Error cloning auto generated role: il_grp_admin');
}
$rbacadmin->copyRolePermissions($admin,$source_rolf,$target_rolf,$new_admin,true);
$ilLog->write(__METHOD__.' : Finished copying of role il_grp_admin.');
$member = $this->getDefaultMemberRole();
$new_member = $new_obj->getDefaultMemberRole();
if(!$member || !$new_member)
{
$ilLog->write(__METHOD__.' : Error cloning auto generated role: il_grp_member');
}
$rbacadmin->copyRolePermissions($member,$source_rolf,$target_rolf,$new_member,true);
$ilLog->write(__METHOD__.' : Finished copying of role grp_member.');
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilObjGroup::cloneDependencies (   $a_target_id,
  $a_copy_id 
)

Clone object dependencies (crs items, preconditions)

public

Parameters
inttarget ref id of new course
intcopy id

Reimplemented from ilContainer.

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

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

{
global $tree;
parent::cloneDependencies($a_target_id,$a_copy_id);
include_once('Services/Object/classes/class.ilObjectActivation.php');
ilObjectActivation::cloneDependencies($this->getRefId(), $a_target_id, $a_copy_id);
include_once('Services/Tracking/classes/class.ilLPCollections.php');
$lp_collection = new ilLPCollections($this->getId());
$lp_collection->cloneCollections($a_target_id,$a_copy_id);
return true;
}

+ Here is the call graph for this function:

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

Clone group (no member data)

public

Parameters
inttarget ref_id
intcopy id

Reimplemented from ilContainer.

Definition at line 737 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(), getMaxMembers(), getPassword(), getRegistrationEnd(), getRegistrationStart(), getRegistrationType(), ilContainer\getSmallIconPath(), ilContainer\getTinyIconPath(), ilContainer\getViewMode(), IL_GRP_ADMIN, isMembershipLimited(), isRegistrationAccessCodeEnabled(), isRegistrationUnlimited(), isWaitingListEnabled(), and readGroupStatus().

{
global $ilDB,$ilUser;
$new_obj = parent::cloneObject($a_target_id,$a_copy_id);
$new_obj->setGroupType($this->getGroupType());
$new_obj->initGroupStatus($this->getGroupType() ? $this->getGroupType() : $this->readGroupStatus());
$this->cloneAutoGeneratedRoles($new_obj);
$new_obj->setRegistrationType($this->getRegistrationType());
$new_obj->setInformation($this->getInformation());
$new_obj->setRegistrationStart($this->getRegistrationStart());
$new_obj->setRegistrationEnd($this->getRegistrationEnd());
$new_obj->enableUnlimitedRegistration($this->isRegistrationUnlimited());
$new_obj->setPassword($this->getPassword());
$new_obj->enableMembershipLimitation($this->isMembershipLimited());
$new_obj->setMaxMembers($this->getMaxMembers());
$new_obj->enableWaitingList($this->isWaitingListEnabled());
// map
$new_obj->setLatitude($this->getLatitude());
$new_obj->setLongitude($this->getLongitude());
$new_obj->setLocationZoom($this->getLocationZoom());
$new_obj->setEnableGroupMap($this->getEnableGroupMap());
$new_obj->enableRegistrationAccessCode($this->isRegistrationAccessCodeEnabled());
include_once './Services/Membership/classes/class.ilMembershipRegistrationCodeUtils.php';
$new_obj->setRegistrationAccessCode(ilMembershipRegistrationCodeUtils::generateCode());
$new_obj->setViewMode($this->getViewMode());
$new_obj->update();
// #13008 - Group Defined Fields
include_once('Modules/Course/classes/Export/class.ilCourseDefinedFieldDefinition.php');
ilCourseDefinedFieldDefinition::_clone($this->getId(),$new_obj->getId());
global $ilLog;
$ilLog->write(__METHOD__.': Starting add user');
// Assign user as admin
include_once('./Modules/Group/classes/class.ilGroupParticipants.php');
$part = ilGroupParticipants::_getInstanceByObjId($new_obj->getId());
$part->add($ilUser->getId(),IL_GRP_ADMIN);
$part->updateNotification($ilUser->getId(),1);
// Copy learning progress settings
include_once('Services/Tracking/classes/class.ilLPObjSettings.php');
$obj_settings = new ilLPObjSettings($this->getId());
$obj_settings->cloneSettings($new_obj->getId());
unset($obj_settings);
// clone icons
$new_obj->saveIcons($this->getBigIconPath(),
$this->getSmallIconPath(),
$this->getTinyIconPath());
return $new_obj;
}

+ Here is the call graph for this function:

ilObjGroup::create ( )

Create group.

Reimplemented from ilContainer.

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

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

{
global $ilDB,$ilAppEventHandler;
if(!parent::create())
{
return false;
}
$query = "INSERT INTO grp_settings (obj_id,information,grp_type,registration_type,registration_enabled,".
"registration_unlimited,registration_start,registration_end,registration_password,registration_mem_limit,".
"registration_max_members,waiting_list,latitude,longitude,location_zoom,enablemap,reg_ac_enabled,reg_ac,view_mode) ".
"VALUES(".
$ilDB->quote($this->getId() ,'integer').", ".
$ilDB->quote($this->getInformation() ,'text').", ".
$ilDB->quote((int) $this->getGroupType() ,'integer').", ".
$ilDB->quote($this->getRegistrationType() ,'integer').", ".
$ilDB->quote(($this->isRegistrationEnabled() ? 1 : 0) ,'integer').", ".
$ilDB->quote(($this->isRegistrationUnlimited() ? 1 : 0) ,'integer').", ".
$ilDB->quote($this->getRegistrationStart()->get(IL_CAL_DATETIME,'') ,'timestamp').", ".
$ilDB->quote($this->getRegistrationEnd()->get(IL_CAL_DATETIME,'') ,'timestamp').", ".
$ilDB->quote($this->getPassword() ,'text').", ".
$ilDB->quote((int) $this->isMembershipLimited() ,'integer').", ".
$ilDB->quote($this->getMaxMembers() ,'integer').", ".
$ilDB->quote($this->isWaitingListEnabled() ? 1 : 0 ,'integer').", ".
$ilDB->quote($this->getLatitude() ,'text').", ".
$ilDB->quote($this->getLongitude() ,'text').", ".
$ilDB->quote($this->getLocationZoom() ,'integer').", ".
$ilDB->quote((int) $this->getEnableGroupMap() ,'integer').", ".
$ilDB->quote($this->isRegistrationAccessCodeEnabled(),'integer').', '.
$ilDB->quote($this->getRegistrationAccessCode(),'text').', '.
$ilDB->quote($this->getViewMode(false),'integer').' '.
")";
$res = $ilDB->manipulate($query);
$ilAppEventHandler->raise('Modules/Group',
'create',
array('object' => $this,
'obj_id' => $this->getId(),
'appointments' => $this->prepareAppointments('create')));
return $this->getId();
}

+ Here is the call graph for this function:

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

Reimplemented from ilObject.

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

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

{
global $ilDB,$ilAppEventHandler;
// always call parent delete function first!!
if (!parent::delete())
{
return false;
}
$query = "DELETE FROM grp_settings ".
"WHERE obj_id = ".$ilDB->quote($this->getId() ,'integer');
$res = $ilDB->manipulate($query);
include_once('./Modules/Group/classes/class.ilGroupParticipants.php');
$ilAppEventHandler->raise('Modules/Group',
'delete',
array('object' => $this,
'obj_id' => $this->getId(),
'appointments' => $this->prepareAppointments('delete')));
return true;
}

+ Here is the call graph for this function:

ilObjGroup::deleteExportFiles (   $a_files)

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

References $file, and __initFileObject().

{
$this->__initFileObject();
foreach($a_files as $file)
{
$this->file_obj->deleteFile($file);
}
return true;
}

+ Here is the call graph for this function:

ilObjGroup::downloadExportFile (   $file)

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

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

{
$this->__initFileObject();
if($abs_name = $this->file_obj->getExportFile($file))
{
// Not reached
}
return false;
}

+ Here is the call graph for this function:

ilObjGroup::enableMembershipLimitation (   $a_status)

enable max member limitation

public

Parameters
boolstatus
Returns

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

Referenced by read().

{
$this->reg_membership_limitation = $a_status;
}

+ Here is the caller graph for this function:

ilObjGroup::enableRegistrationAccessCode (   $a_status)

En/disable registration access code.

Parameters
object$a_status
Returns

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

Referenced by read().

{
$this->reg_access_code_enabled = $a_status;
}

+ Here is the caller graph for this function:

ilObjGroup::enableUnlimitedRegistration (   $a_status)

enable unlimited registration

public

Parameters
bool
Returns

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

Referenced by read().

{
$this->reg_unlimited = $a_status;
}

+ Here is the caller graph for this function:

ilObjGroup::enableWaitingList (   $a_status)

enable waiting list

public

Parameters
bool
Returns

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

Referenced by read().

{
$this->waiting_list = $a_status;
}

+ Here is the caller graph for this function:

ilObjGroup::exportXML ( )

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

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

{
include_once 'Modules/Group/classes/class.ilGroupXMLWriter.php';
$xml_writer = new ilGroupXMLWriter($this);
$xml_writer->start();
$xml = $xml_writer->getXML();
$name = time().'__'.$this->ilias->getSetting('inst_id').'__grp_'.$this->getId();
$this->__initFileObject();
$this->file_obj->addGroupDirectory();
$this->file_obj->addDirectory($name);
$this->file_obj->writeToFile($xml,$name.'/'.$name.'.xml');
$this->file_obj->zipFile($name,$name.'.zip');
$this->file_obj->deleteDirectory($name);
return true;
}

+ Here is the call graph for this function:

ilObjGroup::getCountMembers ( )

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

References getGroupMemberIds().

{
return count($this->getGroupMemberIds());
}

+ Here is the call graph for this function:

ilObjGroup::getDefaultAdminRole ( )

returns object id of created default adminstrator role public

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

References getLocalGroupRoles().

Referenced by cloneAutoGeneratedRoles().

{
$local_group_Roles = $this->getLocalGroupRoles();
return $local_group_Roles["il_grp_admin_".$this->getRefId()];
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilObjGroup::getDefaultGroupRoles (   $a_grp_id = "")

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

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

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

References ilObject\getRefId().

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

{
global $rbacadmin, $rbacreview;
if (strlen($a_grp_id) > 0)
{
$grp_id = $a_grp_id;
}
else
{
$grp_id = $this->getRefId();
}
$rolf = $rbacreview->getRoleFolderOfObject($grp_id);
$role_arr = $rbacreview->getRolesOfRoleFolder($rolf["ref_id"]);
foreach ($role_arr as $role_id)
{
$role_Obj =& $this->ilias->obj_factory->getInstanceByObjId($role_id);
$grp_Member ="il_grp_member_".$grp_id;
$grp_Admin ="il_grp_admin_".$grp_id;
if (strcmp($role_Obj->getTitle(), $grp_Member) == 0 )
{
$arr_grpDefaultRoles["grp_member_role"] = $role_Obj->getId();
}
if (strcmp($role_Obj->getTitle(), $grp_Admin) == 0)
{
$arr_grpDefaultRoles["grp_admin_role"] = $role_Obj->getId();
}
}
return $arr_grpDefaultRoles;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilObjGroup::getDefaultMemberRole ( )

returns object id of created default member role public

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

References getLocalGroupRoles().

Referenced by cloneAutoGeneratedRoles().

{
$local_group_Roles = $this->getLocalGroupRoles();
return $local_group_Roles["il_grp_member_".$this->getRefId()];
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilObjGroup::getEnableGroupMap ( )

Get Enable Group Map.

Returns
boolean Enable Group Map

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

References $enablemap.

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

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

+ Here is the caller graph for this function:

ilObjGroup::getGroupAdminIds (   $a_grpId = "")

get Group Admin Id public

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

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

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

Referenced by leaveGroup().

{
global $rbacreview;
if (!empty($a_grpId))
{
$grp_id = $a_grpId;
}
else
{
$grp_id = $this->getRefId();
}
$usr_arr = array();
$roles = $this->getDefaultGroupRoles($this->getRefId());
foreach ($rbacreview->assignedUsers($this->getDefaultAdminRole()) as $member_id)
{
array_push($usr_arr,$member_id);
}
return $usr_arr;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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

get all group Members regardless of group role.

fetch all users data in one shot to improve performance public

Parameters
arrayof user ids
Returns
return array of userdata

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

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

{
global $rbacadmin, $rbacreview, $ilBench, $ilDB;
$usr_arr= array();
$q = "SELECT login,firstname,lastname,title,usr_id,last_login ".
"FROM usr_data ".
"WHERE usr_id IN (".implode(',',ilUtil::quoteArray($a_mem_ids)).") ";
if (is_numeric($active) && $active > -1)
$q .= "AND active = '$active'";
$q .= 'ORDER BY lastname,firstname';
$r = $ilDB->query($q);
while($row = $r->fetchRow(DB_FETCHMODE_OBJECT))
{
$mem_arr[] = array("id" => $row->usr_id,
"login" => $row->login,
"firstname" => $row->firstname,
"lastname" => $row->lastname,
"last_login" => $row->last_login
);
}
return $mem_arr ? $mem_arr : array();
}

+ Here is the call graph for this function:

ilObjGroup::getGroupMemberIds ( )

get all group Member ids regardless of role public

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

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

References getLocalGroupRoles().

Referenced by getCountMembers(), and leaveGroup().

{
global $rbacadmin, $rbacreview;
$usr_arr= array();
$rol = $this->getLocalGroupRoles();
foreach ($rol as $value)
{
foreach ($rbacreview->assignedUsers($value) as $member_id)
{
array_push($usr_arr,$member_id);
}
}
$mem_arr = array_unique($usr_arr);
return $mem_arr ? $mem_arr : array();
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilObjGroup::getGroupStatus ( )

get group status

public

Parameters
intgroup status

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

{
return $this->group_status;
}
ilObjGroup::getGroupType ( )

get group type

public

Returns
int group type

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

References $group_type.

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

{
}

+ Here is the caller graph for this function:

ilObjGroup::getGrpStatusClosedTemplateId ( )

get group status closed template public

Parameters
returnobj_id of roletemplate containing permissionsettings for a closed group

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

References $res, $row, and DB_FETCHMODE_ASSOC.

Referenced by initGroupStatus(), and updateGroupType().

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

+ Here is the caller graph for this function:

ilObjGroup::getGrpStatusOpenTemplateId ( )

get group status open template public

Parameters
returnobj_id of roletemplate containing permissionsettings for an open group

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

References $res, $row, and DB_FETCHMODE_ASSOC.

Referenced by initGroupStatus(), and updateGroupType().

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

+ Here is the caller graph for this function:

ilObjGroup::getInformation ( )

get Information

public

Parameters
@returnstring information

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

References $information.

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

{
}

+ Here is the caller graph for this function:

ilObjGroup::getLatitude ( )

Get Latitude.

Returns
string Latitude

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

References $latitude.

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

{
}

+ Here is the caller graph for this function:

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

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

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

{
global $rbacadmin,$rbacreview;
if (empty($this->local_roles))
{
$this->local_roles = array();
$rolf = $rbacreview->getRoleFolderOfObject($this->getRefId());
$role_arr = $rbacreview->getRolesOfRoleFolder($rolf["ref_id"]);
foreach ($role_arr as $role_id)
{
if ($rbacreview->isAssignable($role_id,$rolf["ref_id"]) == true)
{
$role_Obj =& $this->ilias->obj_factory->getInstanceByObjId($role_id);
if ($a_translate)
{
$role_name = ilObjRole::_getTranslation($role_Obj->getTitle());
}
else
{
$role_name = $role_Obj->getTitle();
}
$this->local_roles[$role_name] = $role_Obj->getId();
}
}
}
return $this->local_roles;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilObjGroup::getLocationZoom ( )

Get LocationZoom.

Returns
int LocationZoom

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

References $locationzoom.

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

{
}

+ Here is the caller graph for this function:

ilObjGroup::getLongitude ( )

Get Longitude.

Returns
string Longitude

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

References $longitude.

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

{
}

+ Here is the caller graph for this function:

ilObjGroup::getMaxMembers ( )

get max members

public

Returns

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

References $reg_max_members.

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

+ Here is the caller graph for this function:

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

References $ilBench, and getLocalGroupRoles().

Referenced by leave().

{
global $rbacadmin, $rbacreview,$ilBench;
$ilBench->start("Group", "getMemberRoles");
$arr_assignedRoles = array();
$arr_assignedRoles = array_intersect($rbacreview->assignedRoles($a_user_id),$this->getLocalGroupRoles());
$ilBench->stop("Group", "getMemberRoles");
return $arr_assignedRoles;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilObjGroup::getMessage ( )

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

Referenced by appendMessage().

{
return $this->message;
}

+ Here is the caller graph for this function:

ilObjGroup::getPassword ( )

get password

public

Returns
string password

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

References $reg_password.

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

{
}

+ Here is the caller graph for this function:

ilObjGroup::getRegistrationAccessCode ( )

get access code

Returns

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

References $reg_access_code.

Referenced by create(), and update().

+ Here is the caller graph for this function:

ilObjGroup::getRegistrationEnd ( )

get registration end

public

Returns
int registration end

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

References IL_CAL_DATETIME.

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

{
return $this->reg_end ? $this->reg_end : $this->reg_end = new ilDateTime(date('Y-m-d').' 16:00:00',IL_CAL_DATETIME);
}

+ Here is the caller graph for this function:

ilObjGroup::getRegistrationStart ( )

get registration start

public

Returns
int registration start

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

References IL_CAL_DATETIME.

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

{
return $this->reg_start ? $this->reg_start : $this->reg_start = new ilDateTime(date('Y-m-d').' 08:00:00',IL_CAL_DATETIME);
}

+ Here is the caller graph for this function:

ilObjGroup::getRegistrationType ( )

get registration type

public

Returns
int registration type

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

References $reg_type.

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

{
}

+ Here is the caller graph for this function:

ilObjGroup::getViewMode (   $a_translate_inherit = true)

get view mode

public

Parameters
bool$a_translate_inherit
Returns
int view mode

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

References translateViewMode(), and ilContainer\VIEW_DEFAULT.

{
$view = (int) $this->view_mode;
if(!$view)
{
}
if($a_translate_inherit)
{
$view = self::translateViewMode($this->id, $view, $this->ref_id);
}
return $view;
}

+ Here is the call graph for this function:

ilObjGroup::initDefaultRoles ( )

init default roles settings public

Returns
array object IDs of created local roles.

Reimplemented from ilObject.

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

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

{
global $rbacadmin, $rbacreview;
// create a local role folder
$rfoldObj =& $this->createRoleFolder();
// ADMIN ROLE
// create role and assign role to rolefolder...
$roleObj = $rfoldObj->createRole("il_grp_admin_".$this->getRefId(),"Groupadmin of group obj_no.".$this->getId());
$this->m_roleAdminId = $roleObj->getId();
//set permission template of new local role
$q = "SELECT obj_id FROM object_data WHERE type='rolt' AND title='il_grp_admin'";
$r = $this->ilias->db->getRow($q, DB_FETCHMODE_OBJECT);
$rbacadmin->copyRoleTemplatePermissions($r->obj_id,ROLE_FOLDER_ID,$rfoldObj->getRefId(),$roleObj->getId());
// set object permissions of group object
$ops = $rbacreview->getOperationsOfRole($roleObj->getId(),"grp",$rfoldObj->getRefId());
$rbacadmin->grantPermission($roleObj->getId(),$ops,$this->getRefId());
// set object permissions of role folder object
//$ops = $rbacreview->getOperationsOfRole($roleObj->getId(),"rolf",$rfoldObj->getRefId());
//$rbacadmin->grantPermission($roleObj->getId(),$ops,$rfoldObj->getRefId());
// MEMBER ROLE
// create role and assign role to rolefolder...
$roleObj = $rfoldObj->createRole("il_grp_member_".$this->getRefId(),"Groupmember of group obj_no.".$this->getId());
$this->m_roleMemberId = $roleObj->getId();
//set permission template of new local role
$q = "SELECT obj_id FROM object_data WHERE type='rolt' AND title='il_grp_member'";
$r = $this->ilias->db->getRow($q, DB_FETCHMODE_OBJECT);
$rbacadmin->copyRoleTemplatePermissions($r->obj_id,ROLE_FOLDER_ID,$rfoldObj->getRefId(),$roleObj->getId());
// set object permissions of group object
$ops = $rbacreview->getOperationsOfRole($roleObj->getId(),"grp",$rfoldObj->getRefId());
$rbacadmin->grantPermission($roleObj->getId(),$ops,$this->getRefId());
// set object permissions of role folder object
//$ops = $rbacreview->getOperationsOfRole($roleObj->getId(),"rolf",$rfoldObj->getRefId());
//$rbacadmin->grantPermission($roleObj->getId(),$ops,$rfoldObj->getRefId());
unset($rfoldObj);
unset($roleObj);
return $roles ? $roles : array();
}

+ Here is the call graph for this function:

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

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

{
global $rbacadmin, $rbacreview, $rbacsystem;
//get Rolefolder of group
$rolf_data = $rbacreview->getRoleFolderOfObject($this->getRefId());
//define all relevant roles that rights are needed to be changed
$arr_parentRoles = $rbacreview->getParentRoleIds($this->getRefId());
$real_local_roles = $rbacreview->getRolesOfRoleFolder($rolf_data['ref_id'],false);
$arr_relevantParentRoleIds = array_diff(array_keys($arr_parentRoles),$real_local_roles);
//group status open (aka public) or group status closed
if ($a_grpStatus == GRP_TYPE_PUBLIC || $a_grpStatus == GRP_TYPE_CLOSED)
{
if ($a_grpStatus == GRP_TYPE_PUBLIC)
{
$template_id = $this->getGrpStatusOpenTemplateId();
}
else
{
$template_id = $this->getGrpStatusClosedTemplateId();
}
//get defined operations from template
$template_ops = $rbacreview->getOperationsOfRole($template_id, 'grp', ROLE_FOLDER_ID);
foreach ($arr_relevantParentRoleIds as $parentRole)
{
if ($rbacreview->isProtected($arr_parentRoles[$parentRole]['parent'],$parentRole))
{
continue;
}
$granted_permissions = array();
// Delete the linked role for the parent role
// (just in case if it already exists).
// Added additional check, since this operation is very dangerous.
// If there is no role folder ALL parent roles are deleted.
if(isset($rolf_data['child']) and $rolf_data['child'])
{
$rbacadmin->deleteLocalRole($parentRole,$rolf_data["child"]);
}
// Grant permissions on the group object for
// the parent role. In the foreach loop we
// compute the intersection of the role
// template il_grp_status_open/_closed and the
// permission template of the parent role.
$current_ops = $rbacreview->getRoleOperationsOnObject($parentRole, $this->getRefId());
$rbacadmin->revokePermission($this->getRefId(), $parentRole);
foreach ($template_ops as $template_op)
{
if (in_array($template_op,$current_ops))
{
array_push($granted_permissions,$template_op);
}
}
if (!empty($granted_permissions))
{
$rbacadmin->grantPermission($parentRole, $granted_permissions, $this->getRefId());
}
// Create a linked role for the parent role and
// initialize it with the intersection of
// il_grp_status_open/_closed and the permission
// template of the parent role
$rbacadmin->copyRolePermissionIntersection(
$template_id, ROLE_FOLDER_ID,
$parentRole, $arr_parentRoles[$parentRole]['parent'],
$rolf_data["child"], $parentRole
);
$rbacadmin->assignRoleToFolder($parentRole,$rolf_data["child"],"false");
}//END foreach
}
}

+ Here is the call graph for this function:

ilObjGroup::initParticipants ( )
protected

init participants object

protected

Returns

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

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

Referenced by read().

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

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilObjGroup::isAdmin (   $a_userId)

is Admin public

Parameters
integeruser_id
boolean,trueif user is group administrator

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

References getDefaultGroupRoles().

Referenced by leaveGroup().

{
global $rbacreview;
$grp_Roles = $this->getDefaultGroupRoles();
if (in_array($a_userId,$rbacreview->assignedUsers($grp_Roles["grp_admin_role"])))
{
return true;
}
else
{
return false;
}
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilObjGroup::isGroupTypeModified (   $a_old_type)

check if group type is modified

public

Parameters
@return

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

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

{
if($a_old_type == GRP_TYPE_UNKNOWN)
{
}
else
{
$group_type = $a_old_type;
}
return $group_type != $this->getGroupType();
}

+ Here is the call graph for this function:

ilObjGroup::isMembershipLimited ( )

is max member limited

public

Returns

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

References $reg_membership_limitation.

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

+ Here is the caller graph for this function:

ilObjGroup::isRegistrationAccessCodeEnabled ( )

Check if access code is enabled.

Returns

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

References $reg_access_code_enabled.

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

{
}

+ Here is the caller graph for this function:

ilObjGroup::isRegistrationEnabled ( )

is registration enabled

public

Returns
bool

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

References getRegistrationType(), and GRP_REGISTRATION_DEACTIVATED.

Referenced by create(), and update().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilObjGroup::isRegistrationUnlimited ( )

is registration unlimited

public

Returns
bool

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

References $reg_unlimited.

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

{
}

+ Here is the caller graph for this function:

ilObjGroup::isWaitingListEnabled ( )

is waiting list enabled

public

Parameters
@returnbool

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

References $waiting_list.

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

{
}

+ Here is the caller graph for this function:

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

join Group, assigns user to role private

Parameters
integermember status = obj_id of local_group_role

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

Referenced by addMember().

{
global $rbacadmin;
if (is_array($a_mem_role))
{
foreach ($a_mem_role as $role)
{
$rbacadmin->assignUser($role,$a_user_id, false);
}
}
else
{
$rbacadmin->assignUser($a_mem_role,$a_user_id, false);
}
return true;
}

+ Here is the caller graph for this function:

ilObjGroup::leave (   $a_user_id)

deassign member from group role private

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

References getMemberRoles().

Referenced by leaveGroup().

{
global $rbacadmin;
$arr_groupRoles = $this->getMemberRoles($a_user_id);
if (is_array($arr_groupRoles))
{
foreach ($arr_groupRoles as $groupRole)
{
$rbacadmin->deassignUser($groupRole, $a_user_id);
}
}
else
{
$rbacadmin->deassignUser($arr_groupRoles, $a_user_id);
}
return true;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilObjGroup::leaveGroup ( )

is called when a member decides to leave group public

Parameters
integeruser-Id
integergroup-Id

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

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

{
global $rbacadmin, $rbacreview;
$member_ids = $this->getGroupMemberIds();
if (count($member_ids) <= 1 || !in_array($this->ilias->account->getId(), $member_ids))
{
return 2;
}
else
{
if (!$this->isAdmin($this->ilias->account->getId()))
{
$this->leave($this->ilias->account->getId());
$member = new ilObjUser($this->ilias->account->getId());
$member->dropDesktopItem($this->getRefId(), "grp");
return 0;
}
else if (count($this->getGroupAdminIds()) == 1)
{
return 1;
}
}
}

+ Here is the call graph for this function:

static ilObjGroup::lookupGroupTye (   $a_id)
static

Lookup group type.

Parameters
object$a_id
Returns

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

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

Referenced by ilObjRole\createPermissionIntersection().

{
global $ilDB;
$query = "SELECT grp_type FROM grp_settings ".
"WHERE obj_id = ".$ilDB->quote($a_id,'integer');
$res = $ilDB->query($query);
while($row = $res->fetchRow(DB_FETCHMODE_OBJECT))
{
return $row->grp_type;
}
}

+ Here is the caller graph for this function:

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

Implements ilMembershipRegistrationCodes.

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

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

Referenced by ilMembershipRegistrationCodeUtils\lookupObjectsByCode().

{
global $ilDB;
$query = "SELECT obj_id FROM grp_settings ".
"WHERE reg_ac_enabled = ".$ilDB->quote(1,'integer')." ".
"AND reg_ac = ".$ilDB->quote($a_code,'text');
$res = $ilDB->query($query);
$obj_ids = array();
while($row = $res->fetchRow(DB_FETCHMODE_OBJECT))
{
$obj_ids[] = $row->obj_id;
}
return $obj_ids;
}

+ Here is the caller graph for this function:

static ilObjGroup::lookupViewMode (   $a_obj_id)
static

lookup view mode $ilDB

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

References $query, $res, $row, $view_mode, DB_FETCHMODE_OBJECT, and translateViewMode().

{
global $ilDB;
$query = 'SELECT view_mode FROM grp_settings '.
'WHERE obj_id = '.$ilDB->quote($a_obj_id,'integer');
$res = $ilDB->query($query);
$view_mode = NULL;
while($row = $res->fetchRow(DB_FETCHMODE_OBJECT))
{
$view_mode = $row->view_mode;
}
}

+ Here is the call graph for this function:

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

Reimplemented from ilObject.

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

{
global $tree;
$parent_id = (int) $tree->getParentId($a_node_id);
if ($parent_id != 0)
{
$obj_data =& $this->ilias->obj_factory->getInstanceByRefId($a_node_id);
$obj_data->notify($a_event,$a_ref_id,$a_parent_non_rbac_id,$parent_id,$a_params);
}
return true;
}
ilObjGroup::prepareAppointments (   $a_mode = 'create')
protected

Prepare calendar appointments.

protected

Parameters
stringmode UPDATE|CREATE|DELETE
Returns

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

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

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

{
include_once('./Services/Calendar/classes/class.ilCalendarAppointmentTemplate.php');
switch($a_mode)
{
case 'create':
case 'update':
{
return array();
}
$app = new ilCalendarAppointmentTemplate(self::CAL_REG_START);
$app->setTitle($this->getTitle());
$app->setSubtitle('grp_cal_reg_start');
$app->setTranslationType(IL_CAL_TRANSLATION_SYSTEM);
$app->setDescription($this->getLongDescription());
$app->setStart($this->getRegistrationStart());
$apps[] = $app;
$app = new ilCalendarAppointmentTemplate(self::CAL_REG_END);
$app->setTitle($this->getTitle());
$app->setSubtitle('grp_cal_reg_end');
$app->setTranslationType(IL_CAL_TRANSLATION_SYSTEM);
$app->setDescription($this->getLongDescription());
$app->setStart($this->getRegistrationEnd());
$apps[] = $app;
return $apps;
case 'delete':
// Nothing to do: The category and all assigned appointments will be deleted.
return array();
}
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilObjGroup::read ( )

Read group.

Reimplemented from ilContainer.

Definition at line 692 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(), setMaxMembers(), ilContainer\setOrderType(), setPassword(), setRegistrationAccessCode(), setRegistrationEnd(), setRegistrationStart(), setRegistrationType(), and setViewMode().

{
global $ilDB;
$query = "SELECT * FROM grp_settings ".
"WHERE obj_id = ".$ilDB->quote($this->getId() ,'integer');
$res = $ilDB->query($query);
while($row = $res->fetchRow(DB_FETCHMODE_OBJECT))
{
$this->setInformation($row->information);
$this->setGroupType($row->grp_type);
$this->setRegistrationType($row->registration_type);
$this->enableUnlimitedRegistration($row->registration_unlimited);
$this->setRegistrationStart(new ilDateTime($row->registration_start,IL_CAL_DATETIME));
$this->setRegistrationEnd(new ilDateTime($row->registration_end,IL_CAL_DATETIME));
$this->setPassword($row->registration_password);
$this->enableMembershipLimitation((bool) $row->registration_mem_limit);
$this->setMaxMembers($row->registration_max_members);
$this->enableWaitingList($row->waiting_list);
$this->setLatitude($row->latitude);
$this->setLongitude($row->longitude);
$this->setLocationZoom($row->location_zoom);
$this->setEnableGroupMap($row->enablemap);
$this->enableRegistrationAccessCode($row->reg_ac_enabled);
$this->setViewMode($row->view_mode);
}
$this->initParticipants();
// Inherit order type from parent course (if exists)
include_once('./Services/Container/classes/class.ilContainerSortingSettings.php');
}

+ Here is the call graph for this function:

ilObjGroup::readGroupStatus ( )

get group status, redundant method because public

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

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

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

Referenced by cloneObject(), and isGroupTypeModified().

{
global $rbacsystem,$rbacreview;
$role_folder = $rbacreview->getRoleFolderOfObject($this->getRefId());
$local_roles = $rbacreview->getRolesOfRoleFolder($role_folder["ref_id"]);
//get Rolefolder of group
$rolf_data = $rbacreview->getRoleFolderOfObject($this->getRefId());
//get all relevant roles
$arr_globalRoles = array_diff($local_roles, $this->getDefaultGroupRoles());
//if one global role has no permission to join the group is officially closed !
foreach ($arr_globalRoles as $globalRole)
{
$ops_of_role = $rbacreview->getOperationsOfRole($globalRole,"grp", ROLE_FOLDER_ID);
if ($rbacsystem->checkPermission($this->getRefId(), $globalRole ,"join"))
{
return $this->group_status = GRP_TYPE_PUBLIC;
}
}
return $this->group_status = GRP_TYPE_CLOSED;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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

References $waiting_list, ilGroupParticipants\_getInstanceByObjId(), ilObjGroupAccess\_registrationEnabled(), ilObject\getId(), getMaxMembers(), ilObject\getRefId(), isRegistrationUnlimited(), and isWaitingListEnabled().

{
include_once './Services/Membership/exceptions/class.ilMembershipRegistrationException.php';
include_once "./Modules/Group/classes/class.ilGroupParticipants.php";
if($part->isAssigned($a_user_id))
{
return true;
}
if(!$a_force_registration)
{
// Availability
include_once './Modules/Group/classes/class.ilObjGroupAccess.php';
{
$this->lng->loadLanguageModule('crs');
throw new ilMembershipRegistrationException('456',$this->getRefId());
}
// Max members
{
$free = max(0,$this->getMaxMembers() - $part->getCountMembers());
include_once('./Modules/Group/classes/class.ilGroupWaitingList.php');
if($this->isWaitingListEnabled() and (!$free or $waiting_list->getCountUsers()))
{
throw new ilMembershipRegistrationException('123',$this->getRefId());
}
}
}
$part->add($a_user_id,$a_role);
$part->sendNotification($part->TYPE_NOTIFICATION_REGISTRATION, $a_user_id);
return true;
}

+ Here is the call graph for this function:

ilObjGroup::setEnableGroupMap (   $a_enablemap)

Set Enable Group Map.

Parameters
boolean$a_enablemapEnable Group Map

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

Referenced by read().

{
$this->enablemap = $a_enablemap;
}

+ Here is the caller graph for this function:

ilObjGroup::setGroupStatus (   $a_status)

Set group status.

public

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

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

{
$this->group_status = $a_status;
}
ilObjGroup::setGroupType (   $a_type)

set group type

public

Parameters
inttype

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

Referenced by read().

{
$this->group_type = $a_type;
}

+ Here is the caller graph for this function:

ilObjGroup::setInformation (   $a_information)

set information

public

Parameters
stringinformation
Returns

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

Referenced by read().

{
$this->information = $a_information;
}

+ Here is the caller graph for this function:

ilObjGroup::setLatitude (   $a_latitude)

Set Latitude.

Parameters
string$a_latitudeLatitude

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

Referenced by read().

{
$this->latitude = $a_latitude;
}

+ Here is the caller graph for this function:

ilObjGroup::setLocationZoom (   $a_locationzoom)

Set LocationZoom.

Parameters
int$a_locationzoomLocationZoom

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

Referenced by read().

{
$this->locationzoom = $a_locationzoom;
}

+ Here is the caller graph for this function:

ilObjGroup::setLongitude (   $a_longitude)

Set Longitude.

Parameters
string$a_longitudeLongitude

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

Referenced by read().

{
$this->longitude = $a_longitude;
}

+ Here is the caller graph for this function:

ilObjGroup::setMaxMembers (   $a_max)

set max members

public

Parameters
intmax members

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

Referenced by read().

{
$this->reg_max_members = $a_max;
}

+ Here is the caller graph for this function:

ilObjGroup::setMessage (   $a_message)

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

{
$this->message = $a_message;
}
ilObjGroup::setPassword (   $a_pass)

set password

public

Parameters
stringpassword

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

Referenced by read().

{
$this->reg_password = $a_pass;
}

+ Here is the caller graph for this function:

ilObjGroup::setRegistrationAccessCode (   $a_code)

Set refistration access code.

Parameters
string$a_code
Returns

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

Referenced by read().

{
$this->reg_access_code = $a_code;
}

+ Here is the caller graph for this function:

ilObjGroup::setRegistrationEnd (   $a_end)

set registration end

public

Parameters
intunix time
Returns

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

Referenced by read().

{
$this->reg_end = $a_end;
}

+ Here is the caller graph for this function:

ilObjGroup::setRegistrationStart (   $a_start)

set registration start

public

Parameters
objectilDateTime
Returns

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

Referenced by read().

{
$this->reg_start = $a_start;
}

+ Here is the caller graph for this function:

ilObjGroup::setRegistrationType (   $a_type)

set registration type

public

Parameters
intregistration type
Returns

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

Referenced by read().

{
$this->reg_type = $a_type;
}

+ Here is the caller graph for this function:

ilObjGroup::setViewMode (   $a_view_mode)

Set group view mode.

Parameters
int$a_view_mode

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

Referenced by read().

{
$this->view_mode = $a_view_mode;
}

+ Here is the caller graph for this function:

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 1801 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.

Referenced by getViewMode(), and lookupViewMode().

{
global $tree;
if(!$a_view_mode)
{
$a_view_mode = ilContainer::VIEW_DEFAULT;
}
// view mode is inherit => check for parent course
if($a_view_mode == ilContainer::VIEW_INHERIT)
{
if(!$a_ref_id)
{
$ref = ilObject::_getAllReferences($a_obj_id);
$a_ref_id = end($ref);
}
$crs_ref = $tree->checkForParentType($a_ref_id, 'crs');
if(!$crs_ref)
{
}
include_once './Modules/Course/classes/class.ilObjCourse.php';
// validate course view mode
if(!in_array($view_mode, array(ilContainer::VIEW_SESSIONS,
{
}
return $view_mode;
}
return $a_view_mode;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilObjGroup::update ( )

Update group.

Reimplemented from ilContainer.

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

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

{
global $ilDB,$ilAppEventHandler;
if (!parent::update())
{
return false;
}
$query = "UPDATE grp_settings ".
"SET information = ".$ilDB->quote($this->getInformation() ,'text').", ".
"grp_type = ".$ilDB->quote((int) $this->getGroupType() ,'integer').", ".
"registration_type = ".$ilDB->quote($this->getRegistrationType() ,'integer').", ".
"registration_enabled = ".$ilDB->quote($this->isRegistrationEnabled() ? 1 : 0 ,'integer').", ".
"registration_unlimited = ".$ilDB->quote($this->isRegistrationUnlimited() ? 1 : 0 ,'integer').", ".
"registration_start = ".$ilDB->quote($this->getRegistrationStart()->get(IL_CAL_DATETIME,'') ,'timestamp').", ".
"registration_end = ".$ilDB->quote($this->getRegistrationEnd()->get(IL_CAL_DATETIME,'') ,'timestamp').", ".
"registration_password = ".$ilDB->quote($this->getPassword() ,'text').", ".
// "registration_membership_limited = ".$ilDB->quote((int) $this->isMembershipLimited() ,'integer').", ".
"registration_mem_limit = ".$ilDB->quote((int) $this->isMembershipLimited() ,'integer').", ".
"registration_max_members = ".$ilDB->quote($this->getMaxMembers() ,'integer').", ".
"waiting_list = ".$ilDB->quote($this->isWaitingListEnabled() ? 1 : 0 ,'integer').", ".
"latitude = ".$ilDB->quote($this->getLatitude() ,'text').", ".
"longitude = ".$ilDB->quote($this->getLongitude() ,'text').", ".
"location_zoom = ".$ilDB->quote($this->getLocationZoom() ,'integer').", ".
"enablemap = ".$ilDB->quote((int) $this->getEnableGroupMap() ,'integer').", ".
'reg_ac_enabled = '.$ilDB->quote($this->isRegistrationAccessCodeEnabled(),'integer').', '.
'reg_ac = '.$ilDB->quote($this->getRegistrationAccessCode(),'text').', '.
'view_mode = '.$ilDB->quote($this->getViewMode(false),'integer').' '.
"WHERE obj_id = ".$ilDB->quote($this->getId() ,'integer')." ";
$res = $ilDB->manipulate($query);
$ilAppEventHandler->raise('Modules/Group',
'update',
array('object' => $this,
'obj_id' => $this->getId(),
'appointments' => $this->prepareAppointments('update')));
return true;
}

+ Here is the call graph for this function:

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

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

{
global $tree,$rbacreview,$rbacadmin;
$parent_roles = $rbacreview->getParentRoleIds($this->getRefId());
$real_parent_roles = array_diff(array_keys($parent_roles),$this->getDefaultGroupRoles());
$rolf_data = $rbacreview->getRoleFolderOfObject($this->getRefId());
// Delete parent roles with stopped inheritance
foreach($real_parent_roles as $role_id)
{
// Delete local role
if(isset($rolf_data['child']) and $rolf_data['child'])
{
$rbacadmin->deleteLocalRole($role_id,$rolf_data['child']);
}
}
$parent_roles = $rbacreview->getParentRoleIds($this->getRefId());
$real_parent_roles = array_diff(array_keys($parent_roles),$this->getDefaultGroupRoles());
switch($this->getGroupType())
{
$template_id = $this->getGrpStatusOpenTemplateId();
break;
$template_id = $this->getGrpStatusClosedTemplateId();
break;
}
$first = true;
foreach($tree->getFilteredSubTree($this->getRefId(),array('rolf','grp')) as $subnode)
{
// Read template operations
$template_ops = $rbacreview->getOperationsOfRole($template_id,$subnode['type'], ROLE_FOLDER_ID);
$rolf_data = $rbacreview->getRoleFolderOfObject($subnode['child']);
// for all parent roles
foreach($real_parent_roles as $role_id)
{
if($rbacreview->isProtected($parent_roles[$role_id]['parent'],$role_id))
{
continue;
}
// Delete local role
if(isset($rolf_data['child']) and $rolf_data['child'])
{
$rbacadmin->deleteLocalRole($role_id,$rolf_data['child']);
}
// Store current operations
$current_ops = $rbacreview->getOperationsOfRole($role_id,$subnode['type'],$parent_roles[$role_id]['parent']);
// Revoke permissions
$rbacadmin->revokePermission($subnode['child'],$role_id);
// Grant permissions
$granted = array();
foreach($template_ops as $operation)
{
if(in_array($operation,$current_ops))
{
$granted[] = $operation;
}
}
if($granted)
{
$rbacadmin->grantPermission($role_id, $granted,$subnode['child']);
}
if($first)
{
// This is the group itself
$rbacadmin->copyRolePermissionIntersection(
$template_id, ROLE_FOLDER_ID,
$role_id, $parent_roles[$role_id]['parent'],
$rolf_data["child"],$role_id);
$rbacadmin->assignRoleToFolder($role_id,$rolf_data["child"],"n");
}
}
$first = false;
}
}

+ Here is the call graph for this function:

ilObjGroup::validate ( )

validate group settings

public

Returns
bool

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

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

{
global $ilErr;
if(!$this->getTitle())
{
$this->title = '';
$ilErr->appendMessage($this->lng->txt(self::ERR_MISSING_TITLE));
}
if(!$this->getGroupType())
{
$ilErr->appendMessage($this->lng->txt(self::ERR_MISSING_GROUP_TYPE));
}
if($this->getRegistrationType() == GRP_REGISTRATION_PASSWORD and !strlen($this->getPassword()))
{
$ilErr->appendMessage($this->lng->txt(self::ERR_MISSING_PASSWORD));
}
{
$ilErr->appendMessage($this->lng->txt(self::ERR_WRONG_REG_TIME_LIMIT));
}
if($this->isMembershipLimited() and (!is_numeric($this->getMaxMembers()) or $this->getMaxMembers() <= 0))
{
$ilErr->appendMessage($this->lng->txt(self::ERR_WRONG_MAX_MEMBERS));
}
return strlen($ilErr->getMessage()) == 0;
}

+ Here is the call graph for this function:

Field Documentation

ilObjGroup::$enablemap = 0
private

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

Referenced by getEnableGroupMap().

ilObjGroup::$file_obj = null

Group file object for handling of export files.

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

Referenced by __initFileObject(), and _importFromFile().

ilObjGroup::$group_type = null
protected

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

Referenced by getGroupType(), and isGroupTypeModified().

ilObjGroup::$information
protected

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

Referenced by getInformation().

ilObjGroup::$latitude = ''
private

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

Referenced by getLatitude().

ilObjGroup::$locationzoom = 0
private

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

Referenced by getLocationZoom().

ilObjGroup::$longitude = ''
private

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

Referenced by getLongitude().

ilObjGroup::$m_grpStatus

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

ilObjGroup::$m_roleAdminId

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

Referenced by initDefaultRoles().

ilObjGroup::$m_roleMemberId

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

Referenced by initDefaultRoles().

ilObjGroup::$members_obj

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

ilObjGroup::$reg_access_code = ''
private

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

Referenced by getRegistrationAccessCode().

ilObjGroup::$reg_access_code_enabled = false
private

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

Referenced by isRegistrationAccessCodeEnabled().

ilObjGroup::$reg_enabled = true
protected

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

ilObjGroup::$reg_end = null
protected

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

ilObjGroup::$reg_max_members = 0
protected

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

Referenced by getMaxMembers().

ilObjGroup::$reg_membership_limitation = false
protected

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

Referenced by isMembershipLimited().

ilObjGroup::$reg_password = ''
protected

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

Referenced by getPassword().

ilObjGroup::$reg_start = null
protected

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

ilObjGroup::$reg_type = GRP_REGISTRATION_DIRECT
protected

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

Referenced by getRegistrationType().

ilObjGroup::$reg_unlimited = true
protected

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

Referenced by isRegistrationUnlimited().

ilObjGroup::$view_mode = NULL
private

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

Referenced by lookupViewMode(), and translateViewMode().

ilObjGroup::$waiting_list = false
protected

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

Referenced by isWaitingListEnabled(), and register().

const ilObjGroup::CAL_REG_END = 2

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

const ilObjGroup::CAL_REG_START = 1

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

const ilObjGroup::ERR_MISSING_GROUP_TYPE = 'grp_missing_grp_type'

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

const ilObjGroup::ERR_MISSING_PASSWORD = 'grp_missing_password'

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

const ilObjGroup::ERR_MISSING_TITLE = 'msg_no_title'

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

const ilObjGroup::ERR_WRONG_MAX_MEMBERS = 'grp_wrong_max_members'

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

const ilObjGroup::ERR_WRONG_REG_TIME_LIMIT = 'grp_wrong_reg_time_limit'

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

const ilObjGroup::GRP_ADMIN = 2
const ilObjGroup::GRP_MEMBER = 1

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