24 include_once(
'./Modules/Session/classes/class.ilSessionAppointment.php');
59 public function __construct($a_id = 0,$a_call_by_reference =
true)
81 $query =
"SELECT registration FROM event ".
82 "WHERE obj_id = ".$ilDB->quote($a_obj_id).
" ";
83 $res = $ilDB->query($query);
86 return (
bool) $row->registration;
134 $this->location = $a_location;
156 $this->name = $a_name;
178 $this->phone = $a_phone;
201 $this->email = $a_email;
222 return strlen($this->
getName()) or
236 $this->details = $a_details;
259 $this->registration = (bool) $a_registration;
281 return $this->appointments ? $this->appointments : array();
293 $this->appointments[] = $appointment;
316 return is_object($this->appointments[0]) ? $this->appointments[0] : ($this->appointments[0] =
new ilSessionAppointment());
328 return $this->files ? $this->files : array();
344 $ilErr->appendMessage($this->lng->txt(
'fill_out_all_required_fields'));
360 global $ilDB,$ilUser,$ilAppEventHandler;
371 $new_obj->setAppointments(array($new_app));
375 foreach($this->files as
$file)
377 $file->cloneFiles($new_obj->getEventId());
385 include_once(
'Services/Tracking/classes/class.ilLPObjSettings.php');
387 $obj_settings->cloneSettings($new_obj->getId());
388 unset($obj_settings);
403 $new_obj->setName($this->
getName());
404 $new_obj->setPhone($this->
getPhone());
405 $new_obj->setEmail($this->
getEmail());
422 global $ilObjDataCache;
426 $target_obj_id = $ilObjDataCache->lookupObjId($a_target_id);
428 include_once(
'./Modules/Session/classes/class.ilEventItems.php');
430 $session_materials->cloneItems($this->
getId(),$a_copy_id);
444 global $ilAppEventHandler;
448 $query =
"INSERT INTO event SET ".
449 "obj_id = ".$this->db->quote($this->
getId()).
", ".
450 "location = ".$this->db->quote($this->
getLocation()).
",".
451 "tutor_name = ".$this->db->quote($this->
getName()).
", ".
452 "tutor_phone = ".$this->db->quote($this->
getPhone()).
", ".
453 "tutor_email = ".$this->db->quote($this->
getEmail()).
", ".
454 "details = ".$this->db->quote($this->
getDetails()).
",".
457 $this->db->query($query);
458 $this->event_id = $this->db->getLastInsertId();
460 $ilAppEventHandler->raise(
'Modules/Session',
462 array(
'object' => $this,
463 'obj_id' => $this->
getId(),
466 return $this->
getId();
478 global $ilAppEventHandler;
480 if(!parent::update())
484 $query =
"UPDATE event SET ".
485 "location = ".$this->db->quote($this->
getLocation()).
",".
486 "tutor_name = ".$this->db->quote($this->
getName()).
", ".
487 "tutor_phone = ".$this->db->quote($this->
getPhone()).
", ".
488 "tutor_email = ".$this->db->quote($this->
getEmail()).
", ".
489 "details = ".$this->db->quote($this->
getDetails()).
", ".
491 "WHERE obj_id = ".$this->db->quote($this->
getId()).
" ";
493 $this->db->query($query);
495 $ilAppEventHandler->raise(
'Modules/Session',
497 array(
'object' => $this,
498 'obj_id' => $this->
getId(),
510 public function delete()
512 global $ilAppEventHandler;
514 if(!parent::delete())
518 $query =
"DELETE FROM event ".
519 "WHERE obj_id = ".$this->db->quote($this->
getId()).
" ";
520 $this->db->query($query);
522 include_once(
'./Modules/Session/classes/class.ilSessionAppointment.php');
525 include_once(
'./Modules/Session/classes/class.ilEventItems.php');
528 include_once(
'./Modules/Session/classes/class.ilEventParticipants.php');
536 $ilAppEventHandler->raise(
'Modules/Session',
538 array(
'object' => $this,
539 'obj_id' => $this->
getId(),
557 $query =
"SELECT * FROM event WHERE ".
558 "obj_id = ".$this->db->quote($this->
getId()).
" ";
559 $res = $this->db->query($query);
564 $this->
setName($row->tutor_name);
569 $this->event_id = $row->event_id;
586 include_once(
'./Modules/Session/classes/class.ilSessionAppointment.php');
599 include_once(
'./Modules/Session/classes/class.ilSessionFile.php');
613 include_once(
'./Services/Calendar/classes/class.ilCalendarAppointmentTemplate.php');
626 $app->setFullday($sess_app->isFullday());
627 $app->setStart($sess_app->getStart());
628 $app->setEnd($sess_app->getEnd());