5include_once(
'./Modules/Session/classes/class.ilSessionAppointment.php');
 
    6include_once 
'./Services/Membership/classes/class.ilMembershipRegistrationSettings.php';
 
   73    public function __construct($a_id = 0, $a_call_by_reference = 
true)
 
   79        $this->session_logger = 
$GLOBALS[
'DIC']->logger()->sess();
 
   83        parent::__construct($a_id, $a_call_by_reference);
 
  100        $query = 
"SELECT reg_type FROM event " .
 
  101            "WHERE obj_id = " . 
$ilDB->quote($a_obj_id, 
'integer') . 
" ";
 
  120        $query = 
"SELECT * FROM event " .
 
  121            "WHERE obj_id = " . 
$ilDB->quote($a_obj_id);
 
  130        return (array) 
$data;
 
  170        include_once 
'./Services/AccessControl/classes/class.ilObjRole.php';
 
  172            self::LOCAL_ROLE_PARTICIPANT_PREFIX . 
'_' . $this->
getRefId(),
 
  173            'Participant of session obj_no.' . $this->
getId(),
 
  174            self::LOCAL_ROLE_PARTICIPANT_PREFIX,
 
  179            $this->session_logger->warning(
'Could not create default session role.');
 
  204        $this->location = $a_location;
 
  226        $this->name = $a_name;
 
  248        $this->phone = $a_phone;
 
  271        $this->email = $a_email;
 
  292        return strlen($this->
getName()) or
 
  306        $this->details = $a_details;
 
  337        $this->reg_limited = $a_limit;
 
  347        $this->reg_min_users = $a_users;
 
  357        $this->reg_limited_users = $a_users;
 
  367        $this->reg_waiting_list = $a_stat;
 
  372        $this->reg_waiting_list_autofill = (bool) $a_value;
 
  386        $this->show_members = (bool) $a_status;
 
  417        return $this->appointments ? $this->appointments : array();
 
  429        $this->appointments[] = $appointment;
 
  452        return is_object($this->appointments[0]) ? $this->appointments[0] : ($this->appointments[0] = 
new ilSessionAppointment());
 
  464        return $this->files ? $this->files : array();
 
  503            $ilErr->appendMessage($this->lng->txt(
"sess_max_members_needed"));
 
  518    public function cloneObject($a_target_id, $a_copy_id = 0, $a_omit_tree = 
false)
 
  523        $new_obj = parent::cloneObject($a_target_id, $a_copy_id, $a_omit_tree);
 
  526        $new_obj->applyDidacticTemplate($dtpl);
 
  536        $new_obj->setAppointments(array($new_app));
 
  537        $new_obj->update(
true);
 
  540        foreach ($this->files as $file) {
 
  541            $file->cloneFiles($new_obj->getEventId());
 
  549        include_once(
'Services/Tracking/classes/class.ilLPObjSettings.php');
 
  551        $obj_settings->cloneSettings($new_obj->getId());
 
  552        unset($obj_settings);
 
  607        $ilObjDataCache = 
$DIC[
'ilObjDataCache'];
 
  609        parent::cloneDependencies($a_target_id, $a_copy_id);
 
  611        $target_obj_id = $ilObjDataCache->lookupObjId($a_target_id);
 
  613        include_once(
'./Modules/Session/classes/class.ilEventItems.php');
 
  615        $session_materials->cloneItems($this->
getId(), $a_copy_id);
 
  627    public function create($a_skip_meta_data = 
false)
 
  634        $ilAppEventHandler = 
$DIC[
'ilAppEventHandler'];
 
  638        if (!$a_skip_meta_data) {
 
  642        $next_id = 
$ilDB->nextId(
'event');
 
  643        $query = 
"INSERT INTO event (event_id,obj_id,location,tutor_name,tutor_phone,tutor_email,details,registration, " .
 
  644            'reg_type, reg_limit_users, reg_limited, reg_waiting_list, reg_min_users, reg_auto_wait,show_members,mail_members) ' .
 
  646            $ilDB->quote($next_id, 
'integer') . 
", " .
 
  647            $this->db->quote($this->
getId(), 
'integer') . 
", " .
 
  648            $this->db->quote($this->
getLocation(), 
'text') . 
"," .
 
  649            $this->db->quote($this->
getName(), 
'text') . 
", " .
 
  650            $this->db->quote($this->
getPhone(), 
'text') . 
", " .
 
  651            $this->db->quote($this->
getEmail(), 
'text') . 
", " .
 
  652            $this->db->quote($this->
getDetails(), 
'text') . 
"," .
 
  664        $this->event_id = $next_id;
 
  666        $ilAppEventHandler->raise(
 
  669            array(
'object' => $this,
 
  670                'obj_id' => $this->
getId(),
 
  674        return $this->
getId();
 
  684    public function update($a_skip_meta_update = 
false)
 
  691        $ilAppEventHandler = 
$DIC[
'ilAppEventHandler'];
 
  696        if (!$a_skip_meta_update) {
 
  700        $query = 
"UPDATE event SET " .
 
  701            "location = " . $this->db->quote($this->
getLocation(), 
'text') . 
"," .
 
  702            "tutor_name = " . $this->db->quote($this->
getName(), 
'text') . 
", " .
 
  703            "tutor_phone = " . $this->db->quote($this->
getPhone(), 
'text') . 
", " .
 
  704            "tutor_email = " . $this->db->quote($this->
getEmail(), 
'text') . 
", " .
 
  705            "details = " . $this->db->quote($this->
getDetails(), 
'text') . 
", " .
 
  713            'show_members = ' . $this->db->quote($this->
getShowMembers(), 
'integer') . 
', ' .
 
  715            "WHERE obj_id = " . $this->db->quote($this->
getId(), 
'integer') . 
" ";
 
  718        $ilAppEventHandler->raise(
 
  721            array(
'object' => $this,
 
  722                'obj_id' => $this->
getId(),
 
  734    public function delete()
 
  741        $ilAppEventHandler = 
$DIC[
'ilAppEventHandler'];
 
  743        if (!parent::delete()) {
 
  750        $query = 
"DELETE FROM event " .
 
  751            "WHERE obj_id = " . $this->db->quote($this->
getId(), 
'integer') . 
" ";
 
  754        include_once(
'./Modules/Session/classes/class.ilSessionAppointment.php');
 
  757        include_once(
'./Modules/Session/classes/class.ilEventItems.php');
 
  760        include_once(
'./Modules/Session/classes/class.ilEventParticipants.php');
 
  763        foreach ($this->
getFiles() as $file) {
 
  767        $ilAppEventHandler->raise(
 
  770            array(
'object' => $this,
 
  771                'obj_id' => $this->
getId(),
 
  790        $query = 
"SELECT * FROM event WHERE " .
 
  791            "obj_id = " . $this->db->quote($this->
getId(), 
'integer') . 
" ";
 
  808            $this->event_id = 
$row->event_id;
 
  825        include_once(
'./Modules/Session/classes/class.ilSessionAppointment.php');
 
  838        include_once(
'./Modules/Session/classes/class.ilSessionFile.php');
 
  852        include_once(
'./Services/Calendar/classes/class.ilCalendarAppointmentTemplate.php');
 
  860                $app->setTitle($this->
getTitle() ? $this->
getTitle() : $this->lng->txt(
'obj_sess'));
 
  865                $app->setFullday($sess_app->isFullday());
 
  866                $app->setStart($sess_app->getStart());
 
  867                $app->setEnd($sess_app->getEnd());
 
  887            $this->session_logger->debug(
'Waiting list or auto fill is disabled.');
 
  892        $current = $parts->getCountParticipants();
 
  896            $this->session_logger->debug(
'Maximum number of participants not reached.');
 
  897            $this->session_logger->debug(
'Maximum number of members: ' . $max);
 
  898            $this->session_logger->debug(
'Current number of members: ' . 
$current);
 
  903        foreach ($session_waiting_list->getUserIds() as $user_id) {
 
  906                $this->session_logger->warning(
'Found invalid user id on waiting list: ' . $user_id);
 
  909            if (in_array($user_id, $parts->getParticipants())) {
 
  910                $this->session_logger->notice(
'User on waiting list already session member: ' . $user_id);
 
  915                $this->session_logger->debug(
'Registration enabled: register user');
 
  916                $parts->register($user_id);
 
  917                $parts->sendNotification(
 
  922                $this->session_logger->debug(
'Registration disabled: set user status to participated.');
 
  923                $parts->getEventParticipants()->updateParticipation($user_id, 
true);
 
  924                $parts->sendNotification(
 
  930            $session_waiting_list->removeFromList($user_id);
 
An exception for terminatinating execution or to throw for unit testing.
const IL_CAL_TRANSLATION_NONE
Apointment templates are used for automatic generated apointments.
static _lookupContainerSetting($a_id, $a_keyword, $a_default_value=null)
Lookup a container setting.
static _writeContainerSetting($a_id, $a_keyword, $a_value)
static formatDate(ilDateTime $date, $a_skip_day=false, $a_include_wd=false, $include_seconds=false)
Format a date @access public.
static formatPeriod(ilDateTime $start, ilDateTime $end, $a_skip_starting_day=false)
Format a period of two date Shows: 14.
static lookupTemplateId($a_ref_id)
Lookup template id @global ilDB $ilDB.
static _delete($a_event_id)
static _deleteByEvent($a_event_id)
static createDefaultRole($a_title, $a_description, $a_tpl_name, $a_ref_id)
__construct($a_id=0, $a_call_by_reference=true)
Constructor @access public.
getFirstAppointment()
get first appointment
const LOCAL_ROLE_PARTICIPANT_PREFIX
enabledRegistration()
is registration enabled
getShowMembers()
Member gallery enabled.
getEnableMap()
ALways disabled.
static _lookupRegistrationEnabled($a_obj_id)
lookup registration enabled
getMailToMembersType()
Get mail to members type.
setLocation($a_location)
set location
setEmail($a_email)
set email
getLocation()
get location
$reg_waiting_list_autofill
initDefaultRoles()
Create local session participant role.
update($a_skip_meta_update=false)
update object
getEventId()
sget event id
setRegistrationType($a_type)
setRegistrationMinUsers($a_users)
initAppointments()
init appointments
setPhone($a_phone)
set phone
setDetails($a_details)
set details
getAppointments()
get appointments
prepareCalendarAppointments($a_mode='create')
Prepare calendar appointments.
setAppointments($appointments)
set appointments
setWaitingListAutoFill($a_value)
setMailToMembersType($a_type)
Set mail to members type.
cloneDependencies($a_target_id, $a_copy_id)
Clone dependencies.
getPresentationTitle()
get title (overwritten from base class)
setShowMembers($a_status)
Show members gallery.
getRegistrationMinUsers()
enableRegistrationUserLimit($a_limit)
cloneSettings(ilObjSession $new_obj)
clone settings
static lookupSession($a_obj_id)
Get session data.
getPresentationTitleAppointmentPeriod()
initParticipants()
init participants object
create($a_skip_meta_data=false)
create new session
getMembersObject()
Get members objects.
isRegistrationUserLimitEnabled()
getRegistrationMaxUsers()
enableRegistrationWaitingList($a_stat)
addAppointment($appointment)
add appointment
handleAutoFill()
Handle auto fill for session members.
hasTutorSettings()
check if there any tutor settings
isRegistrationWaitingListEnabled()
setRegistrationMaxUsers($a_users)
static getInstanceByObjId($a_obj_id, $stop_on_error=true)
get an instance of an Ilias object by object id
Class ilObject Basic functions for all objects.
deleteMetaData()
delete meta data entry
updateMetaData()
update meta data entry
createMetaData()
create meta data entry
getRefId()
get reference id @access public
getLongDescription()
get object long description (stored in object_description)
cloneMetaData($target_obj)
Copy meta data.
getId()
get object id @access public
getTitle()
get object title @access public
class ilSessionAppointment
static _readAppointmentsBySession($a_event_id)
static _deleteBySession($a_event_id)
static _readFilesByEvent($a_event_id)
const TYPE_ACCEPTED_SUBSCRIPTION_MEMBER
Session participation handling.
static _getInstanceByObjId($a_obj_id)
Get instance.
$GLOBALS['JPEG_Segment_Names']
Global Variable: XMP_tag_captions.
update($pash, $contents, Config $config)
foreach($_POST as $key=> $value) $res