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 ,
'integer').
" ";
86 return (
bool)
$row->registration;
100 $query =
"SELECT * FROM event ".
101 "WHERE obj_id = ".$ilDB->quote($a_obj_id);
111 return (array)
$data;
156 $this->location = $a_location;
178 $this->name = $a_name;
200 $this->phone = $a_phone;
223 $this->email = $a_email;
244 return strlen($this->
getName()) or
258 $this->details = $a_details;
281 $this->registration = (bool) $a_registration;
303 return $this->appointments ? $this->appointments : array();
315 $this->appointments[] = $appointment;
338 return is_object($this->appointments[0]) ? $this->appointments[0] : ($this->appointments[0] =
new ilSessionAppointment());
350 return $this->files ? $this->files : array();
375 global
$ilDB,$ilUser,$ilAppEventHandler;
386 $new_obj->setAppointments(array($new_app));
390 foreach($this->files as
$file)
392 $file->cloneFiles($new_obj->getEventId());
400 include_once(
'Services/Tracking/classes/class.ilLPObjSettings.php');
402 $obj_settings->cloneSettings($new_obj->getId());
403 unset($obj_settings);
418 $new_obj->setName($this->
getName());
419 $new_obj->setPhone($this->
getPhone());
420 $new_obj->setEmail($this->
getEmail());
437 global $ilObjDataCache;
441 $target_obj_id = $ilObjDataCache->lookupObjId($a_target_id);
443 include_once(
'./Modules/Session/classes/class.ilEventItems.php');
445 $session_materials->cloneItems($this->
getId(),$a_copy_id);
460 global $ilAppEventHandler;
464 $next_id = $ilDB->nextId(
'event');
465 $query =
"INSERT INTO event (event_id,obj_id,location,tutor_name,tutor_phone,tutor_email,details,registration) ".
467 $ilDB->quote($next_id,
'integer').
", ".
468 $this->db->quote($this->
getId() ,
'integer').
", ".
469 $this->db->quote($this->
getLocation() ,
'text').
",".
470 $this->db->quote($this->
getName() ,
'text').
", ".
471 $this->db->quote($this->
getPhone() ,
'text').
", ".
472 $this->db->quote($this->
getEmail() ,
'text').
", ".
473 $this->db->quote($this->
getDetails() ,
'text').
",".
477 $this->event_id = $next_id;
479 $ilAppEventHandler->raise(
'Modules/Session',
481 array(
'object' => $this,
482 'obj_id' => $this->
getId(),
485 return $this->
getId();
498 global $ilAppEventHandler;
500 if(!parent::update())
504 $query =
"UPDATE event SET ".
505 "location = ".$this->db->quote($this->
getLocation() ,
'text').
",".
506 "tutor_name = ".$this->db->quote($this->
getName() ,
'text').
", ".
507 "tutor_phone = ".$this->db->quote($this->
getPhone() ,
'text').
", ".
508 "tutor_email = ".$this->db->quote($this->
getEmail() ,
'text').
", ".
509 "details = ".$this->db->quote($this->
getDetails() ,
'text').
", ".
511 "WHERE obj_id = ".$this->db->quote($this->
getId() ,
'integer').
" ";
514 $ilAppEventHandler->raise(
'Modules/Session',
516 array(
'object' => $this,
517 'obj_id' => $this->
getId(),
529 public function delete()
532 global $ilAppEventHandler;
534 if(!parent::delete())
538 $query =
"DELETE FROM event ".
539 "WHERE obj_id = ".$this->db->quote($this->
getId() ,
'integer').
" ";
542 include_once(
'./Modules/Session/classes/class.ilSessionAppointment.php');
545 include_once(
'./Modules/Session/classes/class.ilEventItems.php');
548 include_once(
'./Modules/Session/classes/class.ilEventParticipants.php');
556 $ilAppEventHandler->raise(
'Modules/Session',
558 array(
'object' => $this,
559 'obj_id' => $this->
getId(),
577 $query =
"SELECT * FROM event WHERE ".
578 "obj_id = ".$this->db->quote($this->
getId() ,
'integer').
" ";
589 $this->event_id =
$row->event_id;
606 include_once(
'./Modules/Session/classes/class.ilSessionAppointment.php');
619 include_once(
'./Modules/Session/classes/class.ilSessionFile.php');
633 include_once(
'./Services/Calendar/classes/class.ilCalendarAppointmentTemplate.php');
642 $app->setTitle($this->
getTitle() ? $this->
getTitle() : $this->lng->txt(
'obj_sess'));
646 $app->setFullday($sess_app->isFullday());
647 $app->setStart($sess_app->getStart());
648 $app->setEnd($sess_app->getEnd());