ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
ilObjSession Class Reference
+ Inheritance diagram for ilObjSession:
+ Collaboration diagram for ilObjSession:

Public Member Functions

 __construct ($a_id=0, $a_call_by_reference=true)
 Constructor public. More...
 
 getPresentationTitle ()
 get title (overwritten from base class) More...
 
 initDefaultRoles ()
 Create local session participant role. More...
 
 getEventId ()
 sget event id More...
 
 setLocation ($a_location)
 set location More...
 
 getLocation ()
 get location More...
 
 setName ($a_name)
 set name More...
 
 getName ()
 get name More...
 
 setPhone ($a_phone)
 set phone More...
 
 getPhone ()
 get phone More...
 
 setEmail ($a_email)
 set email More...
 
 getEmail ()
 get email More...
 
 hasTutorSettings ()
 check if there any tutor settings More...
 
 setDetails ($a_details)
 set details More...
 
 getDetails ()
 get details More...
 
 setRegistrationType ($a_type)
 
 getRegistrationType ()
 
 isRegistrationUserLimitEnabled ()
 
 enableRegistrationUserLimit ($a_limit)
 
 getRegistrationMinUsers ()
 
 setRegistrationMinUsers ($a_users)
 
 getRegistrationMaxUsers ()
 
 setRegistrationMaxUsers ($a_users)
 
 isRegistrationWaitingListEnabled ()
 
 enableRegistrationWaitingList ($a_stat)
 
 setWaitingListAutoFill ($a_value)
 
 hasWaitingListAutoFill ()
 
 enabledRegistration ()
 is registration enabled More...
 
 getAppointments ()
 get appointments More...
 
 addAppointment ($appointment)
 add appointment More...
 
 setAppointments ($appointments)
 set appointments More...
 
 getFirstAppointment ()
 get first appointment More...
 
 getFiles ()
 get files More...
 
 validate ()
 validate More...
 
 cloneObject ($a_target_id, $a_copy_id=0, $a_omit_tree=false)
 Clone course (no member data) More...
 
 cloneSettings (ilObjSession $new_obj)
 clone settings More...
 
 cloneDependencies ($a_target_id, $a_copy_id)
 Clone dependencies. More...
 
 create ($a_skip_meta_data=false)
 create new session More...
 
 update ($a_skip_meta_update=false)
 update object More...
 
 delete ()
 delete session and all related data More...
 
 read ()
 read session data More...
 
 initFiles ()
 init files More...
 
 prepareCalendarAppointments ($a_mode='create')
 Prepare calendar appointments. More...
 
 handleAutoFill ()
 Handle auto fill for session members. More...
 
 getMailToMembersType ()
 Get mail to members type. More...
 
 getMembersObject ()
 Get members objects. More...
 
- Public Member Functions inherited from ilObject
 __construct ($a_id=0, $a_reference=true)
 Constructor public. More...
 
 withReferences ()
 determines wehter objects are referenced or not (got ref ids or not) More...
 
 read ()
 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 ()
 
 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...
 
 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...
 
 putInTree ($a_parent_ref)
 maybe this method should be in tree object!? More...
 
 setPermissions ($a_parent_ref)
 set permissions of object More...
 
 setParentRolePermissions ($a_parent_ref)
 Initialize the permissions of parent roles (local roles of categories, global roles...) This method is overwritten in e.g courses, groups for building permission intersections with non_member templates. More...
 
 createReference ()
 creates reference for object More...
 
 countReferences ()
 count references of object More...
 
 initDefaultRoles ()
 init default roles settings Purpose of this function is to create a local role folder and local roles, that are needed depending on the object type If you want to setup default local roles you MUST overwrite this method in derived object classes (see ilObjForum for an example) public More...
 
 applyDidacticTemplate ($a_tpl_id)
 Apply template. More...
 
 setRegisterMode ($a_bool)
 
 isUserRegistered ($a_user_id=0)
 
 requireRegistration ()
 
 getXMLZip ()
 
 getHTMLDirectory ()
 
 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...
 
 getPossibleSubObjects ($a_filter=true)
 get all possible subobjects of this type the object can decide which types of subobjects are possible jut in time overwrite if the decision distinguish from standard model More...
 

Static Public Member Functions

static _lookupRegistrationEnabled ($a_obj_id)
 lookup registration enabled More...
 
static lookupSession ($a_obj_id)
 Get session data. More...
 
- Static Public Member Functions inherited from ilObject
static _lookupObjIdByImportId ($a_import_id)
 
static _lookupImportId ($a_obj_id)
 
static _lookupOwnerName ($a_owner_id)
 lookup owner name for owner id More...
 
static _getIdForImportId ($a_import_id)
 get current object id for import id (static) More...
 
static _getAllReferences ($a_id)
 get all reference ids of object More...
 
static _lookupTitle ($a_id)
 lookup object title More...
 
static _lookupOwner ($a_id)
 lookup object owner More...
 
static _getIdsForTitle ($title, $type='', $partialmatch=false)
 
static _lookupDescription ($a_id)
 lookup object description More...
 
static _lookupLastUpdate ($a_id, $a_as_string=false)
 lookup last update More...
 
static _getLastUpdateOfObjects ($a_objs)
 Get last update for a set of media objects. More...
 
static _lookupObjId ($a_id)
 
static _setDeletedDate ($a_ref_id)
 only called in ilTree::saveSubTree More...
 
static setDeletedDates ($a_ref_ids)
 Set deleted date type $ilDB. More...
 
static _resetDeletedDate ($a_ref_id)
 only called in ilObjectGUI::insertSavedNodes More...
 
static _lookupDeletedDate ($a_ref_id)
 only called in ilObjectGUI::insertSavedNodes More...
 
static _writeTitle ($a_obj_id, $a_title)
 write title to db (static) More...
 
static _writeDescription ($a_obj_id, $a_desc)
 write description to db (static) More...
 
static _writeImportId ($a_obj_id, $a_import_id)
 write import id to db (static) More...
 
static _lookupType ($a_id, $a_reference=false)
 lookup object type More...
 
static _isInTrash ($a_ref_id)
 checks wether object is in trash More...
 
static _hasUntrashedReference ($a_obj_id)
 checks wether an object has at least one reference that is not in trash More...
 
static _lookupObjectId ($a_ref_id)
 lookup object id More...
 
static _getObjectsDataForType ($a_type, $a_omit_trash=false)
 get all objects of a certain type 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 fixMissingTitles ($a_type, array &$a_obj_title_map)
 Try to fix missing object titles. More...
 
static _lookupCreationDate ($a_id)
 Lookup creation date. More...
 
static hasAutoRating ($a_type, $a_ref_id)
 Check if auto rating is active for parent group/course. More...
 

Data Fields

const LOCAL_ROLE_PARTICIPANT_PREFIX = 'il_sess_participant'
 
const CAL_REG_START = 1
 
- Data Fields inherited from ilObject
const TITLE_LENGTH = 255
 max length of object title More...
 
const DESC_LENGTH = 128
 
 $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
 

Protected Member Functions

 initAppointments ()
 init appointments More...
 
 initParticipants ()
 init participants object More...
 

Protected Attributes

 $db
 
 $location
 
 $name
 
 $phone
 
 $email
 
 $details
 
 $registration
 
 $event_id
 
 $reg_type = ilMembershipRegistrationSettings::TYPE_NONE
 
 $reg_limited = 0
 
 $reg_min_users = 0
 
 $reg_limited_users = 0
 
 $reg_waiting_list = 0
 
 $reg_waiting_list_autofill
 
 $appointments
 
 $files = array()
 
 $session_logger = null
 
- Protected Attributes inherited from ilObject
 $objDefinition
 
 $db
 
 $log
 
 $error
 
 $tree
 
 $app_event_handler
 
 $rbacadmin
 
 $rbacreview
 

Detailed Description

Definition at line 16 of file class.ilObjSession.php.

Constructor & Destructor Documentation

◆ __construct()

ilObjSession::__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 55 of file class.ilObjSession.php.

References $GLOBALS, and $ilDB.

56  {
57  global $ilDB;
58 
59  $this->session_logger = $GLOBALS['DIC']->logger()->sess();
60 
61  $this->db = $ilDB;
62  $this->type = "sess";
63  parent::__construct($a_id, $a_call_by_reference);
64  }
$GLOBALS['loaded']
Global hash that tracks already loaded includes.
global $ilDB

Member Function Documentation

◆ _lookupRegistrationEnabled()

static ilObjSession::_lookupRegistrationEnabled (   $a_obj_id)
static

lookup registration enabled

public

Parameters

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

References $ilDB, $query, $res, $row, ilDBConstants\FETCHMODE_OBJECT, and ilMembershipRegistrationSettings\TYPE_NONE.

Referenced by ilLPStatusEvent\_getStatusInfo(), and ilLPStatusEvent\determineStatus().

75  {
76  global $ilDB;
77 
78  $query = "SELECT reg_type FROM event " .
79  "WHERE obj_id = " . $ilDB->quote($a_obj_id, 'integer') . " ";
80  $res = $ilDB->query($query);
81  while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
82  return (bool) $row->reg_type != ilMembershipRegistrationSettings::TYPE_NONE;
83  }
84  return false;
85  }
foreach($_POST as $key=> $value) $res
$query
global $ilDB
+ Here is the caller graph for this function:

◆ addAppointment()

ilObjSession::addAppointment (   $appointment)

add appointment

public

Parameters
objectilSessionAppointment
Returns

Definition at line 370 of file class.ilObjSession.php.

371  {
372  $this->appointments[] = $appointment;
373  }

◆ cloneDependencies()

ilObjSession::cloneDependencies (   $a_target_id,
  $a_copy_id 
)

Clone dependencies.

Parameters
inttarget id ref_id of new session
intcopy_id
Returns

Definition at line 507 of file class.ilObjSession.php.

References ilObject\getId().

508  {
509  global $ilObjDataCache;
510 
511  parent::cloneDependencies($a_target_id, $a_copy_id);
512 
513  $target_obj_id = $ilObjDataCache->lookupObjId($a_target_id);
514 
515  include_once('./Modules/Session/classes/class.ilEventItems.php');
516  $session_materials = new ilEventItems($target_obj_id);
517  $session_materials->cloneItems($this->getId(), $a_copy_id);
518 
519  return true;
520  }
getId()
get object id public
class ilEvent
+ Here is the call graph for this function:

◆ cloneObject()

ilObjSession::cloneObject (   $a_target_id,
  $a_copy_id = 0,
  $a_omit_tree = false 
)

Clone course (no member data)

public

Parameters
inttarget ref_id
intcopy id

Definition at line 439 of file class.ilObjSession.php.

References $file, array, ilObject\cloneMetaData(), cloneSettings(), files, getFirstAppointment(), ilObject\getId(), and read().

440  {
441  $new_obj = parent::cloneObject($a_target_id, $a_copy_id, $a_omit_tree);
442 
443  $this->read();
444 
445  $this->cloneSettings($new_obj);
446  $this->cloneMetaData($new_obj);
447 
448 
449  // Clone appointment
450  $new_app = $this->getFirstAppointment()->cloneObject($new_obj->getId());
451  $new_obj->setAppointments(array($new_app));
452  $new_obj->update(true);
453 
454  // Clone session files
455  foreach ($this->files as $file) {
456  $file->cloneFiles($new_obj->getEventId());
457  }
458 
459  // Raise update forn new appointments
460 
461 
462 
463  // Copy learning progress settings
464  include_once('Services/Tracking/classes/class.ilLPObjSettings.php');
465  $obj_settings = new ilLPObjSettings($this->getId());
466  $obj_settings->cloneSettings($new_obj->getId());
467  unset($obj_settings);
468 
469  return $new_obj;
470  }
cloneSettings(ilObjSession $new_obj)
clone settings
read()
read session data
getId()
get object id public
cloneMetaData($target_obj)
Copy meta data.
Create styles array
The data for the language used.
Done writing files
if(!file_exists("$old.txt")) if($old===$new) if(file_exists("$new.txt")) $file
getFirstAppointment()
get first appointment
+ Here is the call graph for this function:

◆ cloneSettings()

ilObjSession::cloneSettings ( ilObjSession  $new_obj)

clone settings

public

Parameters
ilObjSession
Returns

Definition at line 479 of file class.ilObjSession.php.

References enableRegistrationUserLimit(), enableRegistrationWaitingList(), getDetails(), getEmail(), getLocation(), getName(), getPhone(), getRegistrationMaxUsers(), getRegistrationMinUsers(), getRegistrationType(), hasWaitingListAutoFill(), isRegistrationUserLimitEnabled(), isRegistrationWaitingListEnabled(), setDetails(), setEmail(), setLocation(), setName(), setPhone(), setRegistrationMaxUsers(), setRegistrationMinUsers(), setRegistrationType(), setWaitingListAutoFill(), and update().

Referenced by cloneObject().

480  {
481  // @var
482  $new_obj->setLocation($this->getLocation());
483  $new_obj->setName($this->getName());
484  $new_obj->setPhone($this->getPhone());
485  $new_obj->setEmail($this->getEmail());
486  $new_obj->setDetails($this->getDetails());
487 
488  $new_obj->setRegistrationType($this->getRegistrationType());
494 
495  $new_obj->update(true);
496 
497  return true;
498  }
enableRegistrationUserLimit($a_limit)
getEmail()
get email
getLocation()
get location
setLocation($a_location)
set location
setPhone($a_phone)
set phone
setWaitingListAutoFill($a_value)
setName($a_name)
set name
setEmail($a_email)
set email
setRegistrationMinUsers($a_users)
setRegistrationType($a_type)
getPhone()
get phone
setDetails($a_details)
set details
getDetails()
get details
setRegistrationMaxUsers($a_users)
enableRegistrationWaitingList($a_stat)
update($a_skip_meta_update=false)
update object
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ create()

ilObjSession::create (   $a_skip_meta_data = false)

create new session

public

Definition at line 529 of file class.ilObjSession.php.

References $ilDB, $query, $res, array, ilObject\createMetaData(), enabledRegistration(), getDetails(), getEmail(), ilObject\getId(), getLocation(), getName(), getPhone(), getRegistrationMaxUsers(), getRegistrationMinUsers(), getRegistrationType(), hasWaitingListAutoFill(), isRegistrationUserLimitEnabled(), isRegistrationWaitingListEnabled(), and prepareCalendarAppointments().

530  {
531  global $ilDB;
532  global $ilAppEventHandler;
533 
534  parent::create();
535 
536  if (!$a_skip_meta_data) {
537  $this->createMetaData();
538  }
539 
540  $next_id = $ilDB->nextId('event');
541  $query = "INSERT INTO event (event_id,obj_id,location,tutor_name,tutor_phone,tutor_email,details,registration, " .
542  'reg_type, reg_limit_users, reg_limited, reg_waiting_list, reg_min_users, reg_auto_wait) ' .
543  "VALUES( " .
544  $ilDB->quote($next_id, 'integer') . ", " .
545  $this->db->quote($this->getId(), 'integer') . ", " .
546  $this->db->quote($this->getLocation(), 'text') . "," .
547  $this->db->quote($this->getName(), 'text') . ", " .
548  $this->db->quote($this->getPhone(), 'text') . ", " .
549  $this->db->quote($this->getEmail(), 'text') . ", " .
550  $this->db->quote($this->getDetails(), 'text') . "," .
551  $this->db->quote($this->enabledRegistration(), 'integer') . ", " .
552  $this->db->quote($this->getRegistrationType(), 'integer') . ', ' .
553  $this->db->quote($this->getRegistrationMaxUsers(), 'integer') . ', ' .
554  $this->db->quote($this->isRegistrationUserLimitEnabled(), 'integer') . ', ' .
555  $this->db->quote($this->isRegistrationWaitingListEnabled(), 'integer') . ', ' .
556  $this->db->quote($this->getRegistrationMinUsers(), 'integer') . ', ' .
557  $this->db->quote($this->hasWaitingListAutoFill(), 'integer') . ' ' .
558  ")";
559  $res = $ilDB->manipulate($query);
560  $this->event_id = $next_id;
561 
562  $ilAppEventHandler->raise(
563  'Modules/Session',
564  'create',
565  array('object' => $this,
566  'obj_id' => $this->getId(),
567  'appointments' => $this->prepareCalendarAppointments('create'))
568  );
569 
570  return $this->getId();
571  }
enabledRegistration()
is registration enabled
getEmail()
get email
getLocation()
get location
createMetaData()
create meta data entry
foreach($_POST as $key=> $value) $res
getId()
get object id public
prepareCalendarAppointments($a_mode='create')
Prepare calendar appointments.
getPhone()
get phone
$query
Create styles array
The data for the language used.
getDetails()
get details
global $ilDB
+ Here is the call graph for this function:

◆ delete()

ilObjSession::delete ( )

delete session and all related data

public

Returns
bool

Definition at line 624 of file class.ilObjSession.php.

References $file, $ilDB, $query, $res, ilEventItems\_delete(), ilEventParticipants\_deleteByEvent(), ilSessionAppointment\_deleteBySession(), array, ilObject\deleteMetaData(), getFiles(), ilObject\getId(), and prepareCalendarAppointments().

625  {
626  global $ilDB;
627  global $ilAppEventHandler;
628 
629  if (!parent::delete()) {
630  return false;
631  }
632 
633  // delete meta data
634  $this->deleteMetaData();
635 
636  $query = "DELETE FROM event " .
637  "WHERE obj_id = " . $this->db->quote($this->getId(), 'integer') . " ";
638  $res = $ilDB->manipulate($query);
639 
640  include_once('./Modules/Session/classes/class.ilSessionAppointment.php');
642 
643  include_once('./Modules/Session/classes/class.ilEventItems.php');
644  ilEventItems::_delete($this->getId());
645 
646  include_once('./Modules/Session/classes/class.ilEventParticipants.php');
648 
649  foreach ($this->getFiles() as $file) {
650  $file->delete();
651  }
652 
653  $ilAppEventHandler->raise(
654  'Modules/Session',
655  'delete',
656  array('object' => $this,
657  'obj_id' => $this->getId(),
658  'appointments' => $this->prepareCalendarAppointments('delete'))
659  );
660 
661 
662  return true;
663  }
static _deleteBySession($a_event_id)
foreach($_POST as $key=> $value) $res
getId()
get object id public
prepareCalendarAppointments($a_mode='create')
Prepare calendar appointments.
getFiles()
get files
$query
static _deleteByEvent($a_event_id)
Create styles array
The data for the language used.
global $ilDB
deleteMetaData()
delete meta data entry
if(!file_exists("$old.txt")) if($old===$new) if(file_exists("$new.txt")) $file
static _delete($a_event_id)
+ Here is the call graph for this function:

◆ enabledRegistration()

ilObjSession::enabledRegistration ( )

is registration enabled

public

Returns

Definition at line 347 of file class.ilObjSession.php.

References ilMembershipRegistrationSettings\TYPE_NONE.

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

+ Here is the caller graph for this function:

◆ enableRegistrationUserLimit()

ilObjSession::enableRegistrationUserLimit (   $a_limit)

Definition at line 296 of file class.ilObjSession.php.

Referenced by cloneSettings(), and read().

297  {
298  $this->reg_limited = $a_limit;
299  }
+ Here is the caller graph for this function:

◆ enableRegistrationWaitingList()

ilObjSession::enableRegistrationWaitingList (   $a_stat)

Definition at line 326 of file class.ilObjSession.php.

Referenced by cloneSettings(), and read().

327  {
328  $this->reg_waiting_list = $a_stat;
329  }
+ Here is the caller graph for this function:

◆ getAppointments()

ilObjSession::getAppointments ( )

get appointments

public

Returns
array

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

References array.

359  {
360  return $this->appointments ? $this->appointments : array();
361  }
Create styles array
The data for the language used.

◆ getDetails()

ilObjSession::getDetails ( )

get details

public

Returns
string details

Definition at line 276 of file class.ilObjSession.php.

References $details.

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

277  {
278  return $this->details;
279  }
+ Here is the caller graph for this function:

◆ getEmail()

ilObjSession::getEmail ( )

get email

public

Returns
string email

Definition at line 241 of file class.ilObjSession.php.

References $email.

Referenced by cloneSettings(), create(), hasTutorSettings(), and update().

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

◆ getEventId()

ilObjSession::getEventId ( )

sget event id

public

Returns

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

References $event_id.

Referenced by initFiles().

153  {
154  return $this->event_id;
155  }
+ Here is the caller graph for this function:

◆ getFiles()

ilObjSession::getFiles ( )

get files

public

Parameters

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

References array, and files.

Referenced by delete().

406  {
407  return $this->files ? $this->files : array();
408  }
Create styles array
The data for the language used.
Done writing files
+ Here is the caller graph for this function:

◆ getFirstAppointment()

ilObjSession::getFirstAppointment ( )

get first appointment

public

Returns
ilSessionAppointment

Definition at line 393 of file class.ilObjSession.php.

Referenced by cloneObject(), getPresentationTitle(), and prepareCalendarAppointments().

394  {
395  return is_object($this->appointments[0]) ? $this->appointments[0] : ($this->appointments[0] = new ilSessionAppointment());
396  }
class ilSessionAppointment
+ Here is the caller graph for this function:

◆ getLocation()

ilObjSession::getLocation ( )

get location

public

Returns
string location

Definition at line 174 of file class.ilObjSession.php.

References $location.

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

175  {
176  return $this->location;
177  }
+ Here is the caller graph for this function:

◆ getMailToMembersType()

ilObjSession::getMailToMembersType ( )

Get mail to members type.

Returns
int

Definition at line 826 of file class.ilObjSession.php.

827  {
828  return false;
829  }

◆ getMembersObject()

ilObjSession::getMembersObject ( )

Get members objects.

Returns
ilGroupParticipants

Definition at line 849 of file class.ilObjSession.php.

References initParticipants().

850  {
851  // #17886
852  if (!$this->members_obj instanceof ilGroupParticipants) {
853  $this->initParticipants();
854  }
855  return $this->members_obj;
856  }
initParticipants()
init participants object
+ Here is the call graph for this function:

◆ getName()

ilObjSession::getName ( )

get name

public

Returns
string name

Definition at line 196 of file class.ilObjSession.php.

References $name.

Referenced by cloneSettings(), create(), hasTutorSettings(), and update().

197  {
198  return $this->name;
199  }
+ Here is the caller graph for this function:

◆ getPhone()

ilObjSession::getPhone ( )

get phone

public

Returns
string phone

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

References $phone.

Referenced by cloneSettings(), create(), hasTutorSettings(), and update().

219  {
220  return $this->phone;
221  }
+ Here is the caller graph for this function:

◆ getPresentationTitle()

ilObjSession::getPresentationTitle ( )

get title (overwritten from base class)

public

Returns

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

References ilDatePresentation\formatDate(), getFirstAppointment(), ilObject\getTitle(), and IL_CAL_UNIX.

117  {
118  $date = new ilDate($this->getFirstAppointment()->getStart()->getUnixTime(), IL_CAL_UNIX);
119  if ($this->getTitle()) {
120  return ilDatePresentation::formatDate($this->getFirstAppointment()->getStart()) . ': ' . $this->getTitle();
121  } else {
122  return ilDatePresentation::formatDate($date);
123  }
124  }
static formatDate(ilDateTime $date, $a_skip_day=false, $a_include_wd=false)
Format a date public.
const IL_CAL_UNIX
Class for single dates.
getTitle()
get object title public
getFirstAppointment()
get first appointment
+ Here is the call graph for this function:

◆ getRegistrationMaxUsers()

ilObjSession::getRegistrationMaxUsers ( )

Definition at line 311 of file class.ilObjSession.php.

References $reg_limited_users.

Referenced by cloneSettings(), create(), handleAutoFill(), update(), and validate().

312  {
314  }
+ Here is the caller graph for this function:

◆ getRegistrationMinUsers()

ilObjSession::getRegistrationMinUsers ( )

Definition at line 301 of file class.ilObjSession.php.

References $reg_min_users.

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

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

◆ getRegistrationType()

ilObjSession::getRegistrationType ( )

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

References $reg_type.

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

287  {
288  return $this->reg_type;
289  }
+ Here is the caller graph for this function:

◆ handleAutoFill()

ilObjSession::handleAutoFill ( )

Handle auto fill for session members.

Definition at line 764 of file class.ilObjSession.php.

References $current, ilSessionParticipants\_getInstanceByObjId(), enabledRegistration(), ilObject\getId(), ilObjectFactory\getInstanceByObjId(), getRegistrationMaxUsers(), hasWaitingListAutoFill(), isRegistrationWaitingListEnabled(), and ilSessionMembershipMailNotification\TYPE_ACCEPTED_SUBSCRIPTION_MEMBER.

765  {
766  if (
768  !$this->hasWaitingListAutoFill()
769  ) {
770  $this->session_logger->debug('Waiting list or auto fill is disabled.');
771  return true;
772  }
773 
775  $current = $parts->getCountParticipants();
776  $max = $this->getRegistrationMaxUsers();
777 
778  if ($max <= $current) {
779  $this->session_logger->debug('Maximum number of participants not reached.');
780  $this->session_logger->debug('Maximum number of members: ' . $max);
781  $this->session_logger->debug('Current number of members: ' . $current);
782  return true;
783  }
784 
785  $session_waiting_list = new ilSessionWaitingList($this->getId());
786  foreach ($session_waiting_list->getUserIds() as $user_id) {
787  $user = ilObjectFactory::getInstanceByObjId($user_id);
788  if (!$user instanceof ilObjUser) {
789  $this->session_logger->warning('Found invalid user id on waiting list: ' . $user_id);
790  continue;
791  }
792  if (in_array($user_id, $parts->getParticipants())) {
793  $this->session_logger->notice('User on waiting list already session member: ' . $user_id);
794  continue;
795  }
796 
797  if ($this->enabledRegistration()) {
798  $this->session_logger->debug('Registration enabled: register user');
799  $parts->register($user_id);
800  $parts->sendNotification(
802  $user_id
803  );
804  } else {
805  $this->session_logger->debug('Registration disabled: set user status to participated.');
806  $parts->getEventParticipants()->updateParticipation($user_id, true);
807  $parts->sendNotification(
809  $user_id
810  );
811  }
812 
813  $session_waiting_list->removeFromList($user_id);
814 
815  $current++;
816  if ($current >= $max) {
817  break;
818  }
819  }
820  }
enabledRegistration()
is registration enabled
static _getInstanceByObjId($a_obj_id)
Get instance.
getId()
get object id public
static getInstanceByObjId($a_obj_id, $stop_on_error=true)
get an instance of an Ilias object by object id
+ Here is the call graph for this function:

◆ hasTutorSettings()

ilObjSession::hasTutorSettings ( )

check if there any tutor settings

public

Definition at line 251 of file class.ilObjSession.php.

References getEmail(), getName(), and getPhone().

252  {
253  return strlen($this->getName()) or
254  strlen($this->getEmail()) or
255  strlen($this->getPhone());
256  }
getEmail()
get email
getPhone()
get phone
+ Here is the call graph for this function:

◆ hasWaitingListAutoFill()

ilObjSession::hasWaitingListAutoFill ( )

Definition at line 336 of file class.ilObjSession.php.

References $reg_waiting_list_autofill.

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

337  {
338  return (bool) $this->reg_waiting_list_autofill;
339  }
+ Here is the caller graph for this function:

◆ initAppointments()

ilObjSession::initAppointments ( )
protected

init appointments

protected

Parameters

Definition at line 706 of file class.ilObjSession.php.

References ilSessionAppointment\_readAppointmentsBySession(), and ilObject\getId().

Referenced by read().

707  {
708  // get assigned appointments
709  include_once('./Modules/Session/classes/class.ilSessionAppointment.php');
710  $this->appointments = ilSessionAppointment::_readAppointmentsBySession($this->getId());
711  }
getId()
get object id public
static _readAppointmentsBySession($a_event_id)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ initDefaultRoles()

ilObjSession::initDefaultRoles ( )

Create local session participant role.

Definition at line 129 of file class.ilObjSession.php.

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

130  {
131  include_once './Services/AccessControl/classes/class.ilObjRole.php';
133  self::LOCAL_ROLE_PARTICIPANT_PREFIX . '_' . $this->getRefId(),
134  'Participant of session obj_no.' . $this->getId(),
135  self::LOCAL_ROLE_PARTICIPANT_PREFIX,
136  $this->getRefId()
137  );
138 
139  if (!$role instanceof ilObjRole) {
140  $this->session_logger->warning('Could not create default session role.');
141  $this->session_logger->logStack(ilLogLevel::WARNING);
142  }
143  return array();
144  }
Class ilObjRole.
static createDefaultRole($a_title, $a_description, $a_tpl_name, $a_ref_id)
getId()
get object id public
Create styles array
The data for the language used.
getRefId()
get reference id public
+ Here is the call graph for this function:

◆ initFiles()

ilObjSession::initFiles ( )

init files

protected

Parameters

Definition at line 720 of file class.ilObjSession.php.

References ilSessionFile\_readFilesByEvent(), files, and getEventId().

Referenced by read().

721  {
722  include_once('./Modules/Session/classes/class.ilSessionFile.php');
724  }
getEventId()
sget event id
Done writing files
static _readFilesByEvent($a_event_id)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ initParticipants()

ilObjSession::initParticipants ( )
protected

init participants object

protected

Returns

Definition at line 838 of file class.ilObjSession.php.

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

Referenced by getMembersObject().

839  {
840  include_once('./Modules/Session/classes/class.ilSessionParticipants.php');
841  $this->members_obj = ilSessionParticipants::_getInstanceByObjId($this->getId());
842  }
static _getInstanceByObjId($a_obj_id)
Get instance.
getId()
get object id public
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ isRegistrationUserLimitEnabled()

ilObjSession::isRegistrationUserLimitEnabled ( )

Definition at line 291 of file class.ilObjSession.php.

References $reg_limited.

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

292  {
293  return $this->reg_limited;
294  }
+ Here is the caller graph for this function:

◆ isRegistrationWaitingListEnabled()

ilObjSession::isRegistrationWaitingListEnabled ( )

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

References $reg_waiting_list.

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

322  {
324  }
+ Here is the caller graph for this function:

◆ lookupSession()

static ilObjSession::lookupSession (   $a_obj_id)
static

Get session data.

Parameters
object$a_obj_id
Returns

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

References $data, $ilDB, $query, $res, $row, array, and ilDBConstants\FETCHMODE_OBJECT.

Referenced by ilObjSessionListGUI\getProperties().

93  {
94  global $ilDB;
95 
96  $query = "SELECT * FROM event " .
97  "WHERE obj_id = " . $ilDB->quote($a_obj_id);
98  $res = $ilDB->query($query);
99  while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
100  $data['location'] = $row->location ? $row->location : '';
101  $data['details'] = $row->details ? $row->details : '';
102  $data['name'] = $row->tutor_name ? $row->tutor_name : '';
103  $data['email'] = $row->tutor_email ? $row->tutor_email : '';
104  $data['phone'] = $row->tutor_phone ? $row->tutor_phone : '';
105  }
106  return (array) $data;
107  }
foreach($_POST as $key=> $value) $res
$query
Create styles array
The data for the language used.
global $ilDB
+ Here is the caller graph for this function:

◆ prepareCalendarAppointments()

ilObjSession::prepareCalendarAppointments (   $a_mode = 'create')

Prepare calendar appointments.

public

Parameters
stringmode UPDATE|CREATE|DELETE
Returns

Definition at line 734 of file class.ilObjSession.php.

References array, getFirstAppointment(), ilObject\getLongDescription(), ilObject\getTitle(), and IL_CAL_TRANSLATION_NONE.

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

735  {
736  include_once('./Services/Calendar/classes/class.ilCalendarAppointmentTemplate.php');
737 
738  switch ($a_mode) {
739  case 'create':
740  case 'update':
741 
742  $app = new ilCalendarAppointmentTemplate(self::CAL_REG_START);
743  $app->setTranslationType(IL_CAL_TRANSLATION_NONE);
744  $app->setTitle($this->getTitle() ? $this->getTitle() : $this->lng->txt('obj_sess'));
745  $app->setDescription($this->getLongDescription());
746 
747  $sess_app = $this->getFirstAppointment();
748  $app->setFullday($sess_app->isFullday());
749  $app->setStart($sess_app->getStart());
750  $app->setEnd($sess_app->getEnd());
751  $apps[] = $app;
752 
753  return $apps;
754 
755  case 'delete':
756  // Nothing to do: The category and all assigned appointments will be deleted.
757  return array();
758  }
759  }
const IL_CAL_TRANSLATION_NONE
Apointment templates are used for automatic generated apointments.
getTitle()
get object title public
Create styles array
The data for the language used.
getLongDescription()
get object long description (stored in object_description)
getFirstAppointment()
get first appointment
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ read()

ilObjSession::read ( )

read session data

public

Parameters

Definition at line 672 of file class.ilObjSession.php.

References $query, $res, $row, enableRegistrationUserLimit(), enableRegistrationWaitingList(), ilDBConstants\FETCHMODE_OBJECT, ilObject\getId(), initAppointments(), initFiles(), setDetails(), setEmail(), setLocation(), setName(), setPhone(), setRegistrationMaxUsers(), setRegistrationMinUsers(), setRegistrationType(), and setWaitingListAutoFill().

Referenced by cloneObject().

673  {
674  parent::read();
675 
676  $query = "SELECT * FROM event WHERE " .
677  "obj_id = " . $this->db->quote($this->getId(), 'integer') . " ";
678  $res = $this->db->query($query);
679 
680  while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
681  $this->setLocation($row->location);
682  $this->setName($row->tutor_name);
683  $this->setPhone($row->tutor_phone);
684  $this->setEmail($row->tutor_email);
685  $this->setDetails($row->details);
686  $this->setRegistrationType($row->reg_type);
687  $this->enableRegistrationUserLimit($row->reg_limited);
688  $this->enableRegistrationWaitingList($row->reg_waiting_list);
689  $this->setWaitingListAutoFill($row->reg_auto_wait);
690  $this->setRegistrationMaxUsers($row->reg_limit_users);
691  $this->setRegistrationMinUsers($row->reg_min_users);
692  $this->event_id = $row->event_id;
693  }
694 
695  $this->initAppointments();
696  $this->initFiles();
697  }
enableRegistrationUserLimit($a_limit)
initFiles()
init files
setLocation($a_location)
set location
setPhone($a_phone)
set phone
initAppointments()
init appointments
setWaitingListAutoFill($a_value)
setName($a_name)
set name
setEmail($a_email)
set email
setRegistrationMinUsers($a_users)
foreach($_POST as $key=> $value) $res
getId()
get object id public
setRegistrationType($a_type)
$query
setDetails($a_details)
set details
setRegistrationMaxUsers($a_users)
enableRegistrationWaitingList($a_stat)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setAppointments()

ilObjSession::setAppointments (   $appointments)

set appointments

public

Parameters
arrayilSessionAppointments
Returns

Definition at line 382 of file class.ilObjSession.php.

References $appointments.

383  {
384  $this->appointments = $appointments;
385  }

◆ setDetails()

ilObjSession::setDetails (   $a_details)

set details

public

Parameters
stringdetails

Definition at line 265 of file class.ilObjSession.php.

Referenced by cloneSettings(), and read().

266  {
267  $this->details = $a_details;
268  }
+ Here is the caller graph for this function:

◆ setEmail()

ilObjSession::setEmail (   $a_email)

set email

public

Parameters
stringemail
Returns

Definition at line 230 of file class.ilObjSession.php.

Referenced by cloneSettings(), and read().

231  {
232  $this->email = $a_email;
233  }
+ Here is the caller graph for this function:

◆ setLocation()

ilObjSession::setLocation (   $a_location)

set location

public

Parameters
stringlocation

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

Referenced by cloneSettings(), and read().

164  {
165  $this->location = $a_location;
166  }
+ Here is the caller graph for this function:

◆ setName()

ilObjSession::setName (   $a_name)

set name

public

Parameters
stringname

Definition at line 185 of file class.ilObjSession.php.

Referenced by cloneSettings(), and read().

186  {
187  $this->name = $a_name;
188  }
+ Here is the caller graph for this function:

◆ setPhone()

ilObjSession::setPhone (   $a_phone)

set phone

public

Parameters
stringphone

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

Referenced by cloneSettings(), and read().

208  {
209  $this->phone = $a_phone;
210  }
+ Here is the caller graph for this function:

◆ setRegistrationMaxUsers()

ilObjSession::setRegistrationMaxUsers (   $a_users)

Definition at line 316 of file class.ilObjSession.php.

Referenced by cloneSettings(), and read().

317  {
318  $this->reg_limited_users = $a_users;
319  }
+ Here is the caller graph for this function:

◆ setRegistrationMinUsers()

ilObjSession::setRegistrationMinUsers (   $a_users)

Definition at line 306 of file class.ilObjSession.php.

Referenced by cloneSettings(), and read().

307  {
308  $this->reg_min_users = $a_users;
309  }
+ Here is the caller graph for this function:

◆ setRegistrationType()

ilObjSession::setRegistrationType (   $a_type)

Definition at line 281 of file class.ilObjSession.php.

References $a_type.

Referenced by cloneSettings(), and read().

282  {
283  $this->reg_type = $a_type;
284  }
$a_type
Definition: workflow.php:92
+ Here is the caller graph for this function:

◆ setWaitingListAutoFill()

ilObjSession::setWaitingListAutoFill (   $a_value)

Definition at line 331 of file class.ilObjSession.php.

Referenced by cloneSettings(), and read().

332  {
333  $this->reg_waiting_list_autofill = (bool) $a_value;
334  }
+ Here is the caller graph for this function:

◆ update()

ilObjSession::update (   $a_skip_meta_update = false)

update object

public

Parameters

Definition at line 580 of file class.ilObjSession.php.

References $ilDB, $query, $res, array, enabledRegistration(), getDetails(), getEmail(), ilObject\getId(), getLocation(), getName(), getPhone(), getRegistrationMaxUsers(), getRegistrationMinUsers(), getRegistrationType(), hasWaitingListAutoFill(), isRegistrationUserLimitEnabled(), isRegistrationWaitingListEnabled(), prepareCalendarAppointments(), League\Flysystem\Adapter\Polyfill\update(), and ilObject\updateMetaData().

Referenced by cloneSettings().

581  {
582  global $ilDB;
583  global $ilAppEventHandler;
584 
585  if (!parent::update()) {
586  return false;
587  }
588  if (!$a_skip_meta_update) {
589  $this->updateMetaData();
590  }
591 
592  $query = "UPDATE event SET " .
593  "location = " . $this->db->quote($this->getLocation(), 'text') . "," .
594  "tutor_name = " . $this->db->quote($this->getName(), 'text') . ", " .
595  "tutor_phone = " . $this->db->quote($this->getPhone(), 'text') . ", " .
596  "tutor_email = " . $this->db->quote($this->getEmail(), 'text') . ", " .
597  "details = " . $this->db->quote($this->getDetails(), 'text') . ", " .
598  "registration = " . $this->db->quote($this->enabledRegistration(), 'integer') . ", " .
599  "reg_type = " . $this->db->quote($this->getRegistrationType(), 'integer') . ", " .
600  "reg_limited = " . $this->db->quote($this->isRegistrationUserLimitEnabled(), 'integer') . ", " .
601  "reg_limit_users = " . $this->db->quote($this->getRegistrationMaxUsers(), 'integer') . ", " .
602  "reg_min_users = " . $this->db->quote($this->getRegistrationMinUsers(), 'integer') . ", " .
603  "reg_waiting_list = " . $this->db->quote($this->isRegistrationWaitingListEnabled(), 'integer') . ", " .
604  "reg_auto_wait = " . $this->db->quote($this->hasWaitingListAutoFill(), 'integer') . " " .
605  "WHERE obj_id = " . $this->db->quote($this->getId(), 'integer') . " ";
606  $res = $ilDB->manipulate($query);
607 
608  $ilAppEventHandler->raise(
609  'Modules/Session',
610  'update',
611  array('object' => $this,
612  'obj_id' => $this->getId(),
613  'appointments' => $this->prepareCalendarAppointments('update'))
614  );
615  return true;
616  }
enabledRegistration()
is registration enabled
getEmail()
get email
getLocation()
get location
updateMetaData()
update meta data entry
foreach($_POST as $key=> $value) $res
getId()
get object id public
prepareCalendarAppointments($a_mode='create')
Prepare calendar appointments.
getPhone()
get phone
$query
Create styles array
The data for the language used.
update($pash, $contents, Config $config)
getDetails()
get details
global $ilDB
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ validate()

ilObjSession::validate ( )

validate

public

Parameters

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

References $ilErr, getRegistrationMaxUsers(), and isRegistrationUserLimitEnabled().

418  {
419  global $ilErr;
420 
421  // #17114
422  if ($this->isRegistrationUserLimitEnabled() &&
423  !$this->getRegistrationMaxUsers()) {
424  $ilErr->appendMessage($this->lng->txt("sess_max_members_needed"));
425  return false;
426  }
427 
428  return true;
429  }
global $ilErr
Definition: raiseError.php:16
+ Here is the call graph for this function:

Field Documentation

◆ $appointments

ilObjSession::$appointments
protected

Definition at line 39 of file class.ilObjSession.php.

Referenced by setAppointments().

◆ $db

ilObjSession::$db
protected

Definition at line 22 of file class.ilObjSession.php.

◆ $details

ilObjSession::$details
protected

Definition at line 28 of file class.ilObjSession.php.

Referenced by getDetails().

◆ $email

ilObjSession::$email
protected

Definition at line 27 of file class.ilObjSession.php.

Referenced by getEmail().

◆ $event_id

ilObjSession::$event_id
protected

Definition at line 30 of file class.ilObjSession.php.

Referenced by getEventId().

◆ $files

ilObjSession::$files = array()
protected

Definition at line 40 of file class.ilObjSession.php.

◆ $location

ilObjSession::$location
protected

Definition at line 24 of file class.ilObjSession.php.

Referenced by getLocation().

◆ $name

ilObjSession::$name
protected

Definition at line 25 of file class.ilObjSession.php.

Referenced by getName().

◆ $phone

ilObjSession::$phone
protected

Definition at line 26 of file class.ilObjSession.php.

Referenced by getPhone().

◆ $reg_limited

ilObjSession::$reg_limited = 0
protected

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

Referenced by isRegistrationUserLimitEnabled().

◆ $reg_limited_users

ilObjSession::$reg_limited_users = 0
protected

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

Referenced by getRegistrationMaxUsers().

◆ $reg_min_users

ilObjSession::$reg_min_users = 0
protected

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

Referenced by getRegistrationMinUsers().

◆ $reg_type

ilObjSession::$reg_type = ilMembershipRegistrationSettings::TYPE_NONE
protected

Definition at line 32 of file class.ilObjSession.php.

Referenced by getRegistrationType().

◆ $reg_waiting_list

ilObjSession::$reg_waiting_list = 0
protected

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

Referenced by isRegistrationWaitingListEnabled().

◆ $reg_waiting_list_autofill

ilObjSession::$reg_waiting_list_autofill
protected

Definition at line 37 of file class.ilObjSession.php.

Referenced by hasWaitingListAutoFill().

◆ $registration

ilObjSession::$registration
protected

Definition at line 29 of file class.ilObjSession.php.

◆ $session_logger

ilObjSession::$session_logger = null
protected

Definition at line 45 of file class.ilObjSession.php.

◆ CAL_REG_START

const ilObjSession::CAL_REG_START = 1

Definition at line 20 of file class.ilObjSession.php.

◆ LOCAL_ROLE_PARTICIPANT_PREFIX

const ilObjSession::LOCAL_ROLE_PARTICIPANT_PREFIX = 'il_sess_participant'

Definition at line 18 of file class.ilObjSession.php.


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