4 include_once(
"./Services/DataSet/classes/class.ilDataSet.php");
23 return array(
"4.1.0",
"5.0.0");
34 return "http://www.ilias.de/xml/Modules/Session/".$a_entity;
43 protected function getTypes($a_entity, $a_version)
45 if ($a_entity ==
"sess")
53 "Description" =>
"text",
55 "TutorName" =>
"text",
56 "TutorEmail" =>
"text",
57 "TutorPhone" =>
"text",
59 "Registration" =>
"integer",
60 "EventStart" =>
"text",
62 "StartingTime" =>
"integer",
63 "EndingTime" =>
"integer",
64 "Fulltime" =>
"integer"
70 "Description" =>
"text",
72 "TutorName" =>
"text",
73 "TutorEmail" =>
"text",
74 "TutorPhone" =>
"text",
76 "Registration" =>
"integer",
77 "EventStart" =>
"text",
79 "StartingTime" =>
"integer",
80 "EndingTime" =>
"integer",
81 "Fulltime" =>
"integer",
82 "LimitedRegistration" =>
"integer",
83 "WaitingList" =>
"integer",
84 "LimitUsers" =>
"integer"
89 if ($a_entity ==
"sess_item")
96 "SessionId" =>
"integer",
110 function readData($a_entity, $a_version, $a_ids, $a_field =
"")
114 if (!is_array($a_ids))
116 $a_ids = array($a_ids);
119 if ($a_entity ==
"sess")
125 " location, tutor_name, tutor_email, tutor_phone, details, registration, ".
126 " e_start event_start, e_end event_end, starting_time, ending_time, fulltime ".
127 " FROM event ev JOIN object_data od ON (ev.obj_id = od.obj_id) ".
128 " JOIN event_appointment ea ON (ev.obj_id = ea.event_id) ".
130 $ilDB->in(
"ev.obj_id", $a_ids,
false,
"integer"));
134 " location, tutor_name, tutor_email, tutor_phone, details, reg_type registration, ".
135 " reg_limited limited_registration, reg_waiting_list waiting_list, ".
136 " reg_limit_users limit_users, ".
137 " e_start event_start, e_end event_end, starting_time, ending_time, fulltime ".
138 " FROM event ev JOIN object_data od ON (ev.obj_id = od.obj_id) ".
139 " JOIN event_appointment ea ON (ev.obj_id = ea.event_id) ".
140 " JOIN object_description odes ON (ev.obj_id = odes.obj_id) ".
142 $ilDB->in(
"ev.obj_id", $a_ids,
false,
"integer"));
147 if ($a_entity ==
"sess_item")
154 " FROM event_items ".
156 $ilDB->in(
"event_id", $a_ids,
false,
"integer"));
171 if ($a_entity ==
"sess")
174 if(!$a_set[
"Fulltime"])
177 #$start = new ilDateTime($a_set["EventStart"], IL_CAL_DATETIME);
178 #$a_set["EventStart"] = $start->get(IL_CAL_DATETIME,'','UTC');
179 #$end = new ilDateTime($a_set["EventEnd"], IL_CAL_DATETIME);
180 #$a_set["EventEnd"] = $end->get(IL_CAL_DATETIME,'','UTC');
183 if ($a_entity ==
"sess_item")
202 "sess_item" => array(
"ids" => $a_rec[
"Id"])
216 function importRecord($a_entity, $a_types, $a_rec, $a_mapping, $a_schema_version)
221 include_once(
"./Modules/Session/classes/class.ilObjSession.php");
222 include_once(
"./Modules/Session/classes/class.ilSessionAppointment.php");
224 if($new_id = $a_mapping->getMapping(
'Services/Container',
'objs',$a_rec[
'Id']))
231 $newObj->setType(
"sess");
232 $newObj->create(
true);
234 $newObj->setTitle($a_rec[
"Title"]);
235 $newObj->setDescription($a_rec[
"Description"]);
236 $newObj->setLocation($a_rec[
"Location"]);
237 $newObj->setName($a_rec[
"TutorName"]);
238 $newObj->setPhone($a_rec[
"TutorPhone"]);
239 $newObj->setEmail($a_rec[
"TutorEmail"]);
240 $newObj->setDetails($a_rec[
"Details"]);
242 if($a_schema_version ==
"5.0.0")
244 $newObj->setRegistrationType($a_rec[
"Registration"]);
246 $newObj->enableRegistrationUserLimit($a_rec[
"LimitedRegistration"]);
247 $newObj->setRegistrationMaxUsers($a_rec[
"LimitUsers"]);
248 $newObj->enableRegistrationWaitingList($a_rec[
"WaitingList"]);
258 $app->setStart($a_rec[
"EventStart"]);
259 $app->setEnd($a_rec[
"EventEnd"]);
262 $app->toggleFullTime($a_rec[
"Fulltime"]);
263 $app->setSessionId($newObj->getId());
269 $this->current_obj = $newObj;
270 $a_mapping->addMapping(
"Modules/Session",
"sess", $a_rec[
"Id"], $newObj->getId());
276 if($obj_id = $a_mapping->getMapping(
'Services/Container',
'objs',$a_rec[
'ItemId']))
279 include_once
'./Modules/Session/classes/class.ilEventItems.php';