ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5f
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...
 
 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)
 Clone course (no member data) More...
 
 cloneSettings (ilObjSession $new_obj)
 clone settings More...
 
 cloneDependencies ($a_target_id, $a_copy_id)
 Clone dependencies. More...
 
 create ()
 create new session More...
 
 update ()
 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 ()
 
- Public Member Functions inherited from ilObject
 ilObject ($a_id=0, $a_reference=true)
 Constructor public. More...
 
 withReferences ()
 determines wehter objects are referenced or not (got ref ids or not) More...
 
 read ($a_force_db=false)
 read object data from db into object More...
 
 getId ()
 get object id public More...
 
 setId ($a_id)
 set object id public More...
 
 setRefId ($a_id)
 set reference id public More...
 
 getRefId ()
 get reference id public More...
 
 getType ()
 get object type public More...
 
 setType ($a_type)
 set object type public More...
 
 getPresentationTitle ()
 get presentation title Normally same as title Overwritten for sessions More...
 
 getTitle ()
 get object title public More...
 
 getUntranslatedTitle ()
 get untranslated object title public More...
 
 setTitle ($a_title)
 set object title More...
 
 getDescription ()
 get object description More...
 
 setDescription ($a_desc)
 set object description More...
 
 getLongDescription ()
 get object long description (stored in object_description) More...
 
 getImportId ()
 get import id More...
 
 setImportId ($a_import_id)
 set import id More...
 
 getOwner ()
 get object owner More...
 
 getOwnerName ()
 
 _lookupOwnerName ($a_owner_id)
 lookup owner name for owner id More...
 
 setOwner ($a_owner)
 set object owner More...
 
 getCreateDate ()
 get create date public More...
 
 getLastUpdateDate ()
 get last update date public More...
 
 getDiskUsage ()
 Gets the disk usage of the object in bytes. More...
 
 setObjDataRecord ($a_record)
 set object_data record (note: this method should only be called from the ilObjectFactory class) More...
 
 create ()
 create More...
 
 update ()
 update object in db More...
 
 MDUpdateListener ($a_element)
 Meta data update listener. More...
 
 createMetaData ()
 create meta data entry More...
 
 updateMetaData ()
 update meta data entry More...
 
 deleteMetaData ()
 delete meta data entry More...
 
 updateOwner ()
 update owner of object in db More...
 
 _getIdForImportId ($a_import_id)
 get current object id for import id (static) More...
 
 _lookupOwner ($a_id)
 lookup object owner More...
 
 _lookupLastUpdate ($a_id, $a_as_string=false)
 lookup last update More...
 
 _getLastUpdateOfObjects ($a_objs)
 Get last update for a set of media objects. More...
 
 _setDeletedDate ($a_ref_id)
 only called in ilTree::saveSubTree More...
 
 _resetDeletedDate ($a_ref_id)
 only called in ilObjectGUI::insertSavedNodes More...
 
 _lookupDeletedDate ($a_ref_id)
 only called in ilObjectGUI::insertSavedNodes More...
 
 _writeTitle ($a_obj_id, $a_title)
 write title to db (static) More...
 
 _writeDescription ($a_obj_id, $a_desc)
 write description to db (static) More...
 
 _writeImportId ($a_obj_id, $a_import_id)
 write import id to db (static) More...
 
 _isInTrash ($a_ref_id)
 checks wether object is in trash More...
 
 _hasUntrashedReference ($a_obj_id)
 checks wether an object has at least one reference that is not in trash More...
 
 _getObjectsDataForType ($a_type, $a_omit_trash=false)
 get all objects of a certain type More...
 
 putInTree ($a_parent_ref)
 maybe this method should be in tree object!? More...
 
 setPermissions ($a_parent_ref)
 set permissions of object More...
 
 setParentRolePermissions ($a_parent_ref)
 Initialize the permissions of parent roles (local roles of categories, global roles...) This method is overwritten in e.g courses, groups for building permission intersections with non_member templates. More...
 
 createReference ()
 creates reference for object More...
 
 countReferences ()
 count references of object More...
 
 delete ()
 delete object or referenced object (in the case of a referenced object, object data is only deleted if last reference is deleted) This function removes an object entirely from system!! More...
 
 initDefaultRoles ()
 init default roles settings Purpose of this function is to create a local role folder and local roles, that are needed depending on the object type If you want to setup default local roles you MUST overwrite this method in derived object classes (see ilObjForum for an example) public More...
 
 applyDidacticTemplate ($a_tpl_id)
 Apply template. More...
 
 notify ($a_event, $a_ref_id, $a_parent_non_rbac_id, $a_node_id, $a_params=0)
 notifys an object about an event occured Based on the event passed, each object may decide how it reacts. More...
 
 setRegisterMode ($a_bool)
 
 isUserRegistered ($a_user_id=0)
 
 requireRegistration ()
 
 getXMLZip ()
 
 getHTMLDirectory ()
 
 cloneObject ($a_target_id, $a_copy_id=0, $a_omit_tree=false)
 Clone object permissions, put in tree ... More...
 
 appendCopyInfo ($a_target_id, $a_copy_id)
 Prepend Copy info if object with same name exists in that container. More...
 
 cloneDependencies ($a_target_id, $a_copy_id)
 Clone object dependencies. More...
 
 cloneMetaData ($target_obj)
 Copy meta data. More...
 
 _lookupCreationDate ($a_id)
 Lookup creation date. More...
 
 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 _getAllReferences ($a_id)
 get all reference ids of object More...
 
static _lookupTitle ($a_id)
 lookup object title More...
 
static _getIdsForTitle ($title, $type='', $partialmatch=false)
 
static _lookupDescription ($a_id)
 lookup object description More...
 
static _lookupObjId ($a_id)
 
static setDeletedDates ($a_ref_ids)
 Set deleted date type $ilDB. More...
 
static _lookupType ($a_id, $a_reference=false)
 lookup object type More...
 
static _lookupObjectId ($a_ref_id)
 lookup object id More...
 
static _exists ($a_id, $a_reference=false, $a_type=null)
 checks if an object exists in object_data More...
 
static _getObjectsByType ($a_obj_type="", $a_owner="")
 Get objects by type. More...
 
static _prepareCloneSelection ($a_ref_ids, $new_type, $show_path=true)
 Prepare copy wizard object selection. More...
 
static _getIcon ($a_obj_id="", $a_size="big", $a_type="", $a_offline=false)
 Get icon for repository item. More...
 
static collectDeletionDependencies (&$deps, $a_ref_id, $a_obj_id, $a_type, $a_depth=0)
 Collect deletion dependencies. More...
 
static getDeletionDependencies ($a_obj_id)
 Get deletion dependencies. More...
 
static getLongDescriptions (array $a_obj_ids)
 Get long description data. More...
 
static getAllOwnedRepositoryObjects ($a_user_id)
 Get all ids of objects user owns. More...
 
static fixMissingTitles ($a_type, array &$a_obj_title_map)
 Try to fix missing object titles. More...
 
static hasAutoRating ($a_type, $a_ref_id)
 Check if auto rating is active for parent group/course. More...
 

Data Fields

const CAL_REG_START = 1
 
- Data Fields inherited from ilObject
const TITLE_LENGTH = 255
 max length of object title More...
 
const DESC_LENGTH = 128
 
 $ilias
 
 $lng
 
 $id
 
 $ref_id
 
 $type
 
 $title
 
 $untranslatedTitle
 
 $desc
 
 $long_desc
 
 $owner
 
 $create_date
 
 $last_update
 
 $import_id
 
 $register = false
 
 $referenced
 
 $objectList
 
 $max_title
 
 $max_desc
 
 $add_dots
 
 $obj_data_record
 object_data record More...
 

Protected Member Functions

 initAppointments ()
 init appointments 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()
 

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 48 of file class.ilObjSession.php.

References $ilDB.

49  {
50  global $ilDB;
51 
52  $this->db = $ilDB;
53  $this->type = "sess";
54  parent::__construct($a_id,$a_call_by_reference);
55  }
global $ilDB

Member Function Documentation

◆ _lookupRegistrationEnabled()

static ilObjSession::_lookupRegistrationEnabled (   $a_obj_id)
static

lookup registration enabled

public

Parameters

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

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

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

66  {
67  global $ilDB;
68 
69  $query = "SELECT reg_type FROM event ".
70  "WHERE obj_id = ".$ilDB->quote($a_obj_id ,'integer')." ";
71  $res = $ilDB->query($query);
72  while($row = $res->fetchRow(DB_FETCHMODE_OBJECT))
73  {
74  return (bool) $row->reg_type != ilMembershipRegistrationSettings::TYPE_NONE;
75  }
76  return false;
77  }
const DB_FETCHMODE_OBJECT
Definition: class.ilDB.php:11
global $ilDB
+ Here is the caller graph for this function:

◆ addAppointment()

ilObjSession::addAppointment (   $appointment)

add appointment

public

Parameters
objectilSessionAppointment
Returns

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

350  {
351  $this->appointments[] = $appointment;
352  }

◆ 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 489 of file class.ilObjSession.php.

References ilObject\getId().

490  {
491  global $ilObjDataCache;
492 
493  parent::cloneDependencies($a_target_id,$a_copy_id);
494 
495  $target_obj_id = $ilObjDataCache->lookupObjId($a_target_id);
496 
497  include_once('./Modules/Session/classes/class.ilEventItems.php');
498  $session_materials = new ilEventItems($target_obj_id);
499  $session_materials->cloneItems($this->getId(),$a_copy_id);
500 
501  return true;
502  }
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 
)

Clone course (no member data)

public

Parameters
inttarget ref_id
intcopy id

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

References $file, $ilDB, $ilUser, cloneSettings(), getFirstAppointment(), ilObject\getId(), and read().

420  {
421  global $ilDB,$ilUser,$ilAppEventHandler;
422 
423  $new_obj = parent::cloneObject($a_target_id,$a_copy_id);
424 
425  $this->read();
426 
427  // Copy settings
428  $this->cloneSettings($new_obj);
429 
430  // Clone appointment
431  $new_app = $this->getFirstAppointment()->cloneObject($new_obj->getId());
432  $new_obj->setAppointments(array($new_app));
433  $new_obj->update();
434 
435  // Clone session files
436  foreach($this->files as $file)
437  {
438  $file->cloneFiles($new_obj->getEventId());
439  }
440 
441  // Raise update forn new appointments
442 
443 
444 
445  // Copy learning progress settings
446  include_once('Services/Tracking/classes/class.ilLPObjSettings.php');
447  $obj_settings = new ilLPObjSettings($this->getId());
448  $obj_settings->cloneSettings($new_obj->getId());
449  unset($obj_settings);
450 
451  return $new_obj;
452  }
print $file
cloneSettings(ilObjSession $new_obj)
clone settings
read()
read session data
getId()
get object id public
global $ilUser
Definition: imgupload.php:15
global $ilDB
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 461 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().

462  {
463  // @var
464  $new_obj->setLocation($this->getLocation());
465  $new_obj->setName($this->getName());
466  $new_obj->setPhone($this->getPhone());
467  $new_obj->setEmail($this->getEmail());
468  $new_obj->setDetails($this->getDetails());
469 
470  $new_obj->setRegistrationType($this->getRegistrationType());
476 
477  $new_obj->update();
478 
479  return true;
480  }
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
update()
update object
setRegistrationMaxUsers($a_users)
enableRegistrationWaitingList($a_stat)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ create()

ilObjSession::create ( )

create new session

public

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

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

512  {
513  global $ilDB;
514  global $ilAppEventHandler;
515 
516  parent::create();
517 
518  $next_id = $ilDB->nextId('event');
519  $query = "INSERT INTO event (event_id,obj_id,location,tutor_name,tutor_phone,tutor_email,details,registration, ".
520  'reg_type, reg_limit_users, reg_limited, reg_waiting_list, reg_min_users, reg_auto_wait) '.
521  "VALUES( ".
522  $ilDB->quote($next_id,'integer').", ".
523  $this->db->quote($this->getId() ,'integer').", ".
524  $this->db->quote($this->getLocation() ,'text').",".
525  $this->db->quote($this->getName() ,'text').", ".
526  $this->db->quote($this->getPhone() ,'text').", ".
527  $this->db->quote($this->getEmail() ,'text').", ".
528  $this->db->quote($this->getDetails() ,'text').",".
529  $this->db->quote($this->enabledRegistration() ,'integer').", ".
530  $this->db->quote($this->getRegistrationType(),'integer').', '.
531  $this->db->quote($this->getRegistrationMaxUsers(),'integer').', '.
532  $this->db->quote($this->isRegistrationUserLimitEnabled(),'integer').', '.
533  $this->db->quote($this->isRegistrationWaitingListEnabled(),'integer').', '.
534  $this->db->quote($this->getRegistrationMinUsers(),'integer').', '.
535  $this->db->quote($this->hasWaitingListAutoFill(),'integer').' '.
536  ")";
537  $res = $ilDB->manipulate($query);
538  $this->event_id = $next_id;
539 
540  $ilAppEventHandler->raise('Modules/Session',
541  'create',
542  array('object' => $this,
543  'obj_id' => $this->getId(),
544  'appointments' => $this->prepareCalendarAppointments('create')));
545 
546  return $this->getId();
547  }
enabledRegistration()
is registration enabled
getEmail()
get email
getLocation()
get location
getId()
get object id public
prepareCalendarAppointments($a_mode='create')
Prepare calendar appointments.
getPhone()
get phone
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 595 of file class.ilObjSession.php.

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

596  {
597  global $ilDB;
598  global $ilAppEventHandler;
599 
600  if(!parent::delete())
601  {
602  return false;
603  }
604  $query = "DELETE FROM event ".
605  "WHERE obj_id = ".$this->db->quote($this->getId() ,'integer')." ";
606  $res = $ilDB->manipulate($query);
607 
608  include_once('./Modules/Session/classes/class.ilSessionAppointment.php');
610 
611  include_once('./Modules/Session/classes/class.ilEventItems.php');
612  ilEventItems::_delete($this->getId());
613 
614  include_once('./Modules/Session/classes/class.ilEventParticipants.php');
616 
617  foreach($this->getFiles() as $file)
618  {
619  $file->delete();
620  }
621 
622  $ilAppEventHandler->raise('Modules/Session',
623  'delete',
624  array('object' => $this,
625  'obj_id' => $this->getId(),
626  'appointments' => $this->prepareCalendarAppointments('delete')));
627 
628 
629  return true;
630  }
_delete($a_event_id)
print $file
getId()
get object id public
prepareCalendarAppointments($a_mode='create')
Prepare calendar appointments.
getFiles()
get files
global $ilDB
+ Here is the call graph for this function:

◆ enabledRegistration()

ilObjSession::enabledRegistration ( )

is registration enabled

public

Returns

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

References ilMembershipRegistrationSettings\TYPE_NONE.

Referenced by create(), and update().

+ Here is the caller graph for this function:

◆ enableRegistrationUserLimit()

ilObjSession::enableRegistrationUserLimit (   $a_limit)

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

Referenced by cloneSettings(), and read().

276  {
277  $this->reg_limited = $a_limit;
278  }
+ Here is the caller graph for this function:

◆ enableRegistrationWaitingList()

ilObjSession::enableRegistrationWaitingList (   $a_stat)

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

Referenced by cloneSettings(), and read().

306  {
307  $this->reg_waiting_list = $a_stat;
308  }
+ Here is the caller graph for this function:

◆ getAppointments()

ilObjSession::getAppointments ( )

get appointments

public

Returns
array

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

338  {
339  return $this->appointments ? $this->appointments : array();
340  }

◆ getDetails()

ilObjSession::getDetails ( )

get details

public

Returns
string details

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

References $details.

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

256  {
257  return $this->details;
258  }
+ Here is the caller graph for this function:

◆ getEmail()

ilObjSession::getEmail ( )

get email

public

Returns
string email

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

References $email.

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

221  {
222  return $this->email;
223  }
+ Here is the caller graph for this function:

◆ getEventId()

ilObjSession::getEventId ( )

sget event id

public

Returns

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

References $event_id.

Referenced by initFiles().

132  {
133  return $this->event_id;
134  }
+ Here is the caller graph for this function:

◆ getFiles()

ilObjSession::getFiles ( )

get files

public

Parameters

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

Referenced by delete().

385  {
386  return $this->files ? $this->files : array();
387  }
+ Here is the caller graph for this function:

◆ getFirstAppointment()

ilObjSession::getFirstAppointment ( )

get first appointment

public

Returns
object ilSessionAppointment

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

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

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

◆ getLocation()

ilObjSession::getLocation ( )

get location

public

Returns
string location

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

References $location.

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

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

◆ getName()

ilObjSession::getName ( )

get name

public

Returns
string name

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

References $name.

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

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

◆ getPhone()

ilObjSession::getPhone ( )

get phone

public

Returns
string phone

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

References $phone.

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

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

◆ getPresentationTitle()

ilObjSession::getPresentationTitle ( )

get title (overwritten from base class)

public

Returns

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

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

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

◆ getRegistrationMaxUsers()

ilObjSession::getRegistrationMaxUsers ( )

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

References $reg_limited_users.

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

291  {
293  }
+ Here is the caller graph for this function:

◆ getRegistrationMinUsers()

ilObjSession::getRegistrationMinUsers ( )

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

References $reg_min_users.

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

281  {
282  return $this->reg_min_users;
283  }
+ Here is the caller graph for this function:

◆ getRegistrationType()

ilObjSession::getRegistrationType ( )

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

References $reg_type.

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

266  {
267  return $this->reg_type;
268  }
+ Here is the caller graph for this function:

◆ handleAutoFill()

ilObjSession::handleAutoFill ( )

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

References ilEventParticipants\_register(), ilObject\getId(), ilObjectFactory\getInstanceByObjId(), getRegistrationMaxUsers(), hasWaitingListAutoFill(), and isRegistrationWaitingListEnabled().

731  {
732  if($this->isRegistrationWaitingListEnabled() &&
733  $this->hasWaitingListAutoFill())
734  {
735  // :TODO: what about ilSessionParticipants?
736 
737  include_once './Modules/Session/classes/class.ilEventParticipants.php';
738  $part_obj = new ilEventParticipants($this->getId());
739  $all_reg = $part_obj->getRegistered();
740  $now = sizeof($all_reg);
741  $max = $this->getRegistrationMaxUsers();
742  if($max > $now)
743  {
744  include_once('./Modules/Session/classes/class.ilSessionWaitingList.php');
745  $waiting_list = new ilSessionWaitingList($this->getId());
746 
747  foreach($waiting_list->getUserIds() as $user_id)
748  {
749  if(!$tmp_obj = ilObjectFactory::getInstanceByObjId($user_id,false))
750  {
751  continue;
752  }
753  if(in_array($user_id, $all_reg))
754  {
755  continue;
756  }
757 
758  ilEventParticipants::_register($user_id, $this->getId());
759  $waiting_list->removeFromList($user_id);
760 
761  $now++;
762  if($now >= $max)
763  {
764  break;
765  }
766  }
767  }
768  }
769  }
_register($a_usr_id, $a_event_id)
getId()
get object id public
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 230 of file class.ilObjSession.php.

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

231  {
232  return strlen($this->getName()) or
233  strlen($this->getEmail()) or
234  strlen($this->getPhone());
235  }
getEmail()
get email
getPhone()
get phone
+ Here is the call graph for this function:

◆ hasWaitingListAutoFill()

ilObjSession::hasWaitingListAutoFill ( )

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

References $reg_waiting_list_autofill.

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

316  {
318  }
+ Here is the caller graph for this function:

◆ initAppointments()

ilObjSession::initAppointments ( )
protected

init appointments

protected

Parameters

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

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

Referenced by read().

675  {
676  // get assigned appointments
677  include_once('./Modules/Session/classes/class.ilSessionAppointment.php');
678  $this->appointments = ilSessionAppointment::_readAppointmentsBySession($this->getId());
679  }
getId()
get object id public
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ initFiles()

ilObjSession::initFiles ( )

init files

protected

Parameters

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

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

Referenced by read().

689  {
690  include_once('./Modules/Session/classes/class.ilSessionFile.php');
691  $this->files = ilSessionFile::_readFilesByEvent($this->getEventId());
692  }
getEventId()
sget event id
_readFilesByEvent($a_event_id)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ isRegistrationUserLimitEnabled()

ilObjSession::isRegistrationUserLimitEnabled ( )

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

References $reg_limited.

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

271  {
272  return $this->reg_limited;
273  }
+ Here is the caller graph for this function:

◆ isRegistrationWaitingListEnabled()

ilObjSession::isRegistrationWaitingListEnabled ( )

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

References $reg_waiting_list.

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

301  {
303  }
+ 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 84 of file class.ilObjSession.php.

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

Referenced by ilObjSessionListGUI\getProperties().

85  {
86  global $ilDB;
87 
88  $query = "SELECT * FROM event ".
89  "WHERE obj_id = ".$ilDB->quote($a_obj_id);
90  $res = $ilDB->query($query);
91  while($row = $res->fetchRow(DB_FETCHMODE_OBJECT))
92  {
93  $data['location'] = $row->location ? $row->location : '';
94  $data['details'] = $row->details ? $row->details : '';
95  $data['name'] = $row->tutor_name ? $row->tutor_name : '';
96  $data['email'] = $row->tutor_email ? $row->tutor_email : '';
97  $data['phone'] = $row->tutor_phone ? $row->tutor_phone : '';
98  }
99  return (array) $data;
100  }
const DB_FETCHMODE_OBJECT
Definition: class.ilDB.php:11
$data
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 702 of file class.ilObjSession.php.

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

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

703  {
704  include_once('./Services/Calendar/classes/class.ilCalendarAppointmentTemplate.php');
705 
706  switch($a_mode)
707  {
708  case 'create':
709  case 'update':
710 
711  $app = new ilCalendarAppointmentTemplate(self::CAL_REG_START);
712  $app->setTranslationType(IL_CAL_TRANSLATION_NONE);
713  $app->setTitle($this->getTitle() ? $this->getTitle() : $this->lng->txt('obj_sess'));
714  $app->setDescription($this->getLongDescription());
715 
716  $sess_app = $this->getFirstAppointment();
717  $app->setFullday($sess_app->isFullday());
718  $app->setStart($sess_app->getStart());
719  $app->setEnd($sess_app->getEnd());
720  $apps[] = $app;
721 
722  return $apps;
723 
724  case 'delete':
725  // Nothing to do: The category and all assigned appointments will be deleted.
726  return array();
727  }
728  }
const IL_CAL_TRANSLATION_NONE
Apointment templates are used for automatic generated apointments.
getTitle()
get object title public
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 639 of file class.ilObjSession.php.

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

Referenced by cloneObject().

640  {
641  parent::read();
642 
643  $query = "SELECT * FROM event WHERE ".
644  "obj_id = ".$this->db->quote($this->getId() ,'integer')." ";
645  $res = $this->db->query($query);
646 
647  while($row = $res->fetchRow(DB_FETCHMODE_OBJECT))
648  {
649  $this->setLocation($row->location);
650  $this->setName($row->tutor_name);
651  $this->setPhone($row->tutor_phone);
652  $this->setEmail($row->tutor_email);
653  $this->setDetails($row->details);
654  $this->setRegistrationType($row->reg_type);
655  $this->enableRegistrationUserLimit($row->reg_limited);
656  $this->enableRegistrationWaitingList($row->reg_waiting_list);
657  $this->setWaitingListAutoFill($row->reg_auto_wait);
658  $this->setRegistrationMaxUsers($row->reg_limit_users);
659  $this->setRegistrationMinUsers($row->reg_min_users);
660  $this->event_id = $row->event_id;
661  }
662 
663  $this->initAppointments();
664  $this->initFiles();
665  }
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
const DB_FETCHMODE_OBJECT
Definition: class.ilDB.php:11
setRegistrationMinUsers($a_users)
getId()
get object id public
setRegistrationType($a_type)
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 361 of file class.ilObjSession.php.

References $appointments.

362  {
363  $this->appointments = $appointments;
364  }

◆ setDetails()

ilObjSession::setDetails (   $a_details)

set details

public

Parameters
stringdetails

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

Referenced by cloneSettings(), and read().

245  {
246  $this->details = $a_details;
247  }
+ Here is the caller graph for this function:

◆ setEmail()

ilObjSession::setEmail (   $a_email)

set email

public

Parameters
stringemail
Returns

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

Referenced by cloneSettings(), and read().

210  {
211  $this->email = $a_email;
212  }
+ Here is the caller graph for this function:

◆ setLocation()

ilObjSession::setLocation (   $a_location)

set location

public

Parameters
stringlocation

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

Referenced by cloneSettings(), and read().

143  {
144  $this->location = $a_location;
145  }
+ Here is the caller graph for this function:

◆ setName()

ilObjSession::setName (   $a_name)

set name

public

Parameters
stringname

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

Referenced by cloneSettings(), and read().

165  {
166  $this->name = $a_name;
167  }
+ Here is the caller graph for this function:

◆ setPhone()

ilObjSession::setPhone (   $a_phone)

set phone

public

Parameters
stringphone

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

Referenced by cloneSettings(), and read().

187  {
188  $this->phone = $a_phone;
189  }
+ Here is the caller graph for this function:

◆ setRegistrationMaxUsers()

ilObjSession::setRegistrationMaxUsers (   $a_users)

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

Referenced by cloneSettings(), and read().

296  {
297  $this->reg_limited_users = $a_users;
298  }
+ Here is the caller graph for this function:

◆ setRegistrationMinUsers()

ilObjSession::setRegistrationMinUsers (   $a_users)

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

Referenced by cloneSettings(), and read().

286  {
287  $this->reg_min_users = $a_users;
288  }
+ Here is the caller graph for this function:

◆ setRegistrationType()

ilObjSession::setRegistrationType (   $a_type)

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

Referenced by cloneSettings(), and read().

261  {
262  $this->reg_type = $a_type;
263  }
+ Here is the caller graph for this function:

◆ setWaitingListAutoFill()

ilObjSession::setWaitingListAutoFill (   $a_value)

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

Referenced by cloneSettings(), and read().

311  {
312  $this->reg_waiting_list_autofill = (bool)$a_value;
313  }
+ Here is the caller graph for this function:

◆ update()

ilObjSession::update ( )

update object

public

Parameters

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

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

Referenced by cloneSettings().

557  {
558  global $ilDB;
559  global $ilAppEventHandler;
560 
561  if(!parent::update())
562  {
563  return false;
564  }
565  $query = "UPDATE event SET ".
566  "location = ".$this->db->quote($this->getLocation() ,'text').",".
567  "tutor_name = ".$this->db->quote($this->getName() ,'text').", ".
568  "tutor_phone = ".$this->db->quote($this->getPhone() ,'text').", ".
569  "tutor_email = ".$this->db->quote($this->getEmail() ,'text').", ".
570  "details = ".$this->db->quote($this->getDetails() ,'text').", ".
571  "registration = ".$this->db->quote($this->enabledRegistration() ,'integer').", ".
572  "reg_type = ".$this->db->quote($this->getRegistrationType() ,'integer').", ".
573  "reg_limited = ".$this->db->quote($this->isRegistrationUserLimitEnabled() ,'integer').", ".
574  "reg_limit_users = ".$this->db->quote($this->getRegistrationMaxUsers() ,'integer').", ".
575  "reg_min_users = ".$this->db->quote($this->getRegistrationMinUsers() ,'integer').", ".
576  "reg_waiting_list = ".$this->db->quote($this->isRegistrationWaitingListEnabled(),'integer').", ".
577  "reg_auto_wait = ".$this->db->quote($this->hasWaitingListAutoFill(),'integer')." ".
578  "WHERE obj_id = ".$this->db->quote($this->getId() ,'integer')." ";
579  $res = $ilDB->manipulate($query);
580 
581  $ilAppEventHandler->raise('Modules/Session',
582  'update',
583  array('object' => $this,
584  'obj_id' => $this->getId(),
585  'appointments' => $this->prepareCalendarAppointments('update')));
586  return true;
587  }
enabledRegistration()
is registration enabled
getEmail()
get email
getLocation()
get location
getId()
get object id public
prepareCalendarAppointments($a_mode='create')
Prepare calendar appointments.
getPhone()
get phone
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 396 of file class.ilObjSession.php.

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

397  {
398  global $ilErr;
399 
400  // #17114
401  if($this->isRegistrationUserLimitEnabled() &&
402  !$this->getRegistrationMaxUsers())
403  {
404  $ilErr->appendMessage($this->lng->txt("sess_max_members_needed"));
405  return false;
406  }
407 
408  return true;
409  }
+ Here is the call graph for this function:

Field Documentation

◆ $appointments

ilObjSession::$appointments
protected

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

Referenced by setAppointments().

◆ $db

ilObjSession::$db
protected

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

◆ $details

ilObjSession::$details
protected

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

Referenced by getDetails().

◆ $email

ilObjSession::$email
protected

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

Referenced by getEmail().

◆ $event_id

ilObjSession::$event_id
protected

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

Referenced by getEventId().

◆ $files

ilObjSession::$files = array()
protected

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

◆ $location

ilObjSession::$location
protected

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

Referenced by getLocation().

◆ $name

ilObjSession::$name
protected

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

Referenced by getName().

◆ $phone

ilObjSession::$phone
protected

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

Referenced by getPhone().

◆ $reg_limited

ilObjSession::$reg_limited = 0
protected

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

Referenced by isRegistrationUserLimitEnabled().

◆ $reg_limited_users

ilObjSession::$reg_limited_users = 0
protected

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

Referenced by getRegistrationMaxUsers().

◆ $reg_min_users

ilObjSession::$reg_min_users = 0
protected

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

Referenced by getRegistrationMinUsers().

◆ $reg_type

ilObjSession::$reg_type = ilMembershipRegistrationSettings::TYPE_NONE
protected

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

Referenced by getRegistrationType().

◆ $reg_waiting_list

ilObjSession::$reg_waiting_list = 0
protected

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

Referenced by isRegistrationWaitingListEnabled().

◆ $reg_waiting_list_autofill

ilObjSession::$reg_waiting_list_autofill
protected

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

Referenced by hasWaitingListAutoFill().

◆ $registration

ilObjSession::$registration
protected

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

◆ CAL_REG_START

const ilObjSession::CAL_REG_START = 1

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


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