5 include_once(
'./Modules/Session/classes/class.ilSessionAppointment.php');
6 include_once
'./Services/Membership/classes/class.ilMembershipRegistrationSettings.php';
55 public function __construct($a_id = 0, $a_call_by_reference =
true)
59 $this->session_logger =
$GLOBALS[
'DIC']->logger()->sess();
63 parent::__construct($a_id, $a_call_by_reference);
78 $query =
"SELECT reg_type FROM event " .
79 "WHERE obj_id = " . $ilDB->quote($a_obj_id,
'integer') .
" ";
96 $query =
"SELECT * FROM event " .
97 "WHERE obj_id = " . $ilDB->quote($a_obj_id);
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,
140 $this->session_logger->warning(
'Could not create default session role.');
165 $this->location = $a_location;
187 $this->name = $a_name;
209 $this->phone = $a_phone;
232 $this->email = $a_email;
253 return strlen($this->
getName()) or
267 $this->details = $a_details;
298 $this->reg_limited = $a_limit;
308 $this->reg_min_users = $a_users;
318 $this->reg_limited_users = $a_users;
328 $this->reg_waiting_list = $a_stat;
333 $this->reg_waiting_list_autofill = (bool) $a_value;
360 return $this->appointments ? $this->appointments :
array();
372 $this->appointments[] = $appointment;
395 return is_object($this->appointments[0]) ? $this->appointments[0] : ($this->appointments[0] =
new ilSessionAppointment());
424 $ilErr->appendMessage($this->lng->txt(
"sess_max_members_needed"));
439 public function cloneObject($a_target_id, $a_copy_id = 0, $a_omit_tree =
false)
441 $new_obj = parent::cloneObject($a_target_id, $a_copy_id, $a_omit_tree);
451 $new_obj->setAppointments(
array($new_app));
452 $new_obj->update(
true);
456 $file->cloneFiles($new_obj->getEventId());
464 include_once(
'Services/Tracking/classes/class.ilLPObjSettings.php');
466 $obj_settings->cloneSettings($new_obj->getId());
467 unset($obj_settings);
509 global $ilObjDataCache;
511 parent::cloneDependencies($a_target_id, $a_copy_id);
513 $target_obj_id = $ilObjDataCache->lookupObjId($a_target_id);
515 include_once(
'./Modules/Session/classes/class.ilEventItems.php');
517 $session_materials->cloneItems($this->
getId(), $a_copy_id);
529 public function create($a_skip_meta_data =
false)
532 global $ilAppEventHandler;
536 if (!$a_skip_meta_data) {
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) ' .
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') .
"," .
560 $this->event_id = $next_id;
562 $ilAppEventHandler->raise(
565 array(
'object' => $this,
566 'obj_id' => $this->
getId(),
570 return $this->
getId();
580 public function update($a_skip_meta_update =
false)
583 global $ilAppEventHandler;
588 if (!$a_skip_meta_update) {
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') .
", " .
605 "WHERE obj_id = " . $this->db->quote($this->
getId(),
'integer') .
" ";
608 $ilAppEventHandler->raise(
611 array(
'object' => $this,
612 'obj_id' => $this->
getId(),
624 public function delete()
627 global $ilAppEventHandler;
629 if (!parent::delete()) {
636 $query =
"DELETE FROM event " .
637 "WHERE obj_id = " . $this->db->quote($this->
getId(),
'integer') .
" ";
640 include_once(
'./Modules/Session/classes/class.ilSessionAppointment.php');
643 include_once(
'./Modules/Session/classes/class.ilEventItems.php');
646 include_once(
'./Modules/Session/classes/class.ilEventParticipants.php');
653 $ilAppEventHandler->raise(
656 array(
'object' => $this,
657 'obj_id' => $this->
getId(),
676 $query =
"SELECT * FROM event WHERE " .
677 "obj_id = " . $this->db->quote($this->
getId(),
'integer') .
" ";
692 $this->event_id =
$row->event_id;
709 include_once(
'./Modules/Session/classes/class.ilSessionAppointment.php');
722 include_once(
'./Modules/Session/classes/class.ilSessionFile.php');
736 include_once(
'./Services/Calendar/classes/class.ilCalendarAppointmentTemplate.php');
744 $app->setTitle($this->
getTitle() ? $this->
getTitle() : $this->lng->txt(
'obj_sess'));
748 $app->setFullday($sess_app->isFullday());
749 $app->setStart($sess_app->getStart());
750 $app->setEnd($sess_app->getEnd());
770 $this->session_logger->debug(
'Waiting list or auto fill is disabled.');
775 $current = $parts->getCountParticipants();
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);
786 foreach ($session_waiting_list->getUserIds() as $user_id) {
789 $this->session_logger->warning(
'Found invalid user id on waiting list: ' . $user_id);
792 if (in_array($user_id, $parts->getParticipants())) {
793 $this->session_logger->notice(
'User on waiting list already session member: ' . $user_id);
798 $this->session_logger->debug(
'Registration enabled: register user');
799 $parts->register($user_id);
800 $parts->sendNotification(
805 $this->session_logger->debug(
'Registration disabled: set user status to participated.');
806 $parts->getEventParticipants()->updateParticipation($user_id,
true);
807 $parts->sendNotification(
813 $session_waiting_list->removeFromList($user_id);
840 include_once(
'./Modules/Session/classes/class.ilSessionParticipants.php');
855 return $this->members_obj;
create($a_skip_meta_data=false)
create new session
getPresentationTitle()
get title (overwritten from base class)
enabledRegistration()
is registration enabled
enableRegistrationUserLimit($a_limit)
getMembersObject()
Get members objects.
addAppointment($appointment)
add appointment
const IL_CAL_TRANSLATION_NONE
getEventId()
sget event id
getLocation()
get location
setLocation($a_location)
set location
cloneSettings(ilObjSession $new_obj)
clone settings
__construct($a_id=0, $a_call_by_reference=true)
Constructor public.
updateMetaData()
update meta data entry
setPhone($a_phone)
set phone
const LOCAL_ROLE_PARTICIPANT_PREFIX
initAppointments()
init appointments
static formatDate(ilDateTime $date, $a_skip_day=false, $a_include_wd=false)
Format a date public.
$GLOBALS['loaded']
Global hash that tracks already loaded includes.
createMetaData()
create meta data entry
cloneObject($a_target_id, $a_copy_id=0, $a_omit_tree=false)
Clone course (no member data)
setWaitingListAutoFill($a_value)
setEmail($a_email)
set email
Apointment templates are used for automatic generated apointments.
getRegistrationMinUsers()
isRegistrationWaitingListEnabled()
static _getInstanceByObjId($a_obj_id)
Get instance.
getAppointments()
get appointments
static createDefaultRole($a_title, $a_description, $a_tpl_name, $a_ref_id)
static lookupSession($a_obj_id)
Get session data.
static _deleteBySession($a_event_id)
cloneDependencies($a_target_id, $a_copy_id)
Clone dependencies.
setRegistrationMinUsers($a_users)
getRegistrationMaxUsers()
foreach($_POST as $key=> $value) $res
getId()
get object id public
isRegistrationUserLimitEnabled()
handleAutoFill()
Handle auto fill for session members.
static _lookupRegistrationEnabled($a_obj_id)
lookup registration enabled
setRegistrationType($a_type)
hasTutorSettings()
check if there any tutor settings
prepareCalendarAppointments($a_mode='create')
Prepare calendar appointments.
getTitle()
get object title public
cloneMetaData($target_obj)
Copy meta data.
getMailToMembersType()
Get mail to members type.
static _deleteByEvent($a_event_id)
static getInstanceByObjId($a_obj_id, $stop_on_error=true)
get an instance of an Ilias object by object id
Create styles array
The data for the language used.
initDefaultRoles()
Create local session participant role.
update($pash, $contents, Config $config)
setAppointments($appointments)
set appointments
setDetails($a_details)
set details
const TYPE_ACCEPTED_SUBSCRIPTION_MEMBER
getLongDescription()
get object long description (stored in object_description)
getRefId()
get reference id public
static _readAppointmentsBySession($a_event_id)
setRegistrationMaxUsers($a_users)
deleteMetaData()
delete meta data entry
initParticipants()
init participants object
if(!file_exists("$old.txt")) if($old===$new) if(file_exists("$new.txt")) $file
static _readFilesByEvent($a_event_id)
enableRegistrationWaitingList($a_stat)
update($a_skip_meta_update=false)
update object
class ilSessionAppointment
$reg_waiting_list_autofill
static _delete($a_event_id)
getFirstAppointment()
get first appointment