4 include_once(
"./Services/DataSet/classes/class.ilDataSet.php");
23 return array(
"4.1.0",
"5.0.0",
"5.1.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") {
51 "Description" =>
"text",
53 "TutorName" =>
"text",
54 "TutorEmail" =>
"text",
55 "TutorPhone" =>
"text",
57 "Registration" =>
"integer",
58 "EventStart" =>
"text",
60 "StartingTime" =>
"integer",
61 "EndingTime" =>
"integer",
62 "Fulltime" =>
"integer" 68 "Description" =>
"text",
70 "TutorName" =>
"text",
71 "TutorEmail" =>
"text",
72 "TutorPhone" =>
"text",
74 "Registration" =>
"integer",
75 "EventStart" =>
"text",
77 "StartingTime" =>
"integer",
78 "EndingTime" =>
"integer",
79 "Fulltime" =>
"integer",
80 "LimitedRegistration" =>
"integer",
81 "WaitingList" =>
"integer",
82 "LimitUsers" =>
"integer" 88 "Description" =>
"text",
90 "TutorName" =>
"text",
91 "TutorEmail" =>
"text",
92 "TutorPhone" =>
"text",
94 "Registration" =>
"integer",
95 "EventStart" =>
"text",
97 "StartingTime" =>
"integer",
98 "EndingTime" =>
"integer",
99 "Fulltime" =>
"integer",
100 "LimitedRegistration" =>
"integer",
101 "WaitingList" =>
"integer",
102 "AutoWait" =>
"integer",
103 "LimitUsers" =>
"integer",
104 "MinUsers" =>
"integer" 109 if ($a_entity ==
"sess_item") {
110 switch ($a_version) {
115 "SessionId" =>
"integer",
128 public function readData($a_entity, $a_version, $a_ids, $a_field =
"")
132 if (!is_array($a_ids)) {
133 $a_ids =
array($a_ids);
136 if ($a_entity ==
"sess") {
137 switch ($a_version) {
140 " location, tutor_name, tutor_email, tutor_phone, details, registration, " .
141 " e_start event_start, e_end event_end, starting_time, ending_time, fulltime " .
142 " FROM event ev JOIN object_data od ON (ev.obj_id = od.obj_id) " .
143 " JOIN event_appointment ea ON (ev.obj_id = ea.event_id) " .
145 $ilDB->in(
"ev.obj_id", $a_ids,
false,
"integer"));
148 $this->
getDirectDataFromQuery($q =
"SELECT ev.obj_id id, od.title title, odes.description description, " .
149 " location, tutor_name, tutor_email, tutor_phone, details, reg_type registration, " .
150 " reg_limited limited_registration, reg_waiting_list waiting_list, " .
151 " reg_limit_users limit_users, " .
152 " e_start event_start, e_end event_end, starting_time, ending_time, fulltime " .
153 " FROM event ev JOIN object_data od ON (ev.obj_id = od.obj_id) " .
154 " JOIN event_appointment ea ON (ev.obj_id = ea.event_id) " .
155 " JOIN object_description odes ON (ev.obj_id = odes.obj_id) " .
157 $ilDB->in(
"ev.obj_id", $a_ids,
false,
"integer"));
160 $this->
getDirectDataFromQuery($q =
"SELECT ev.obj_id id, od.title title, odes.description description, " .
161 " location, tutor_name, tutor_email, tutor_phone, details, reg_type registration, " .
162 " reg_limited limited_registration, reg_waiting_list waiting_list, reg_auto_wait auto_wait, " .
163 " reg_limit_users limit_users, reg_min_users min_users, " .
164 " e_start event_start, e_end event_end, starting_time, ending_time, fulltime " .
165 " FROM event ev JOIN object_data od ON (ev.obj_id = od.obj_id) " .
166 " JOIN event_appointment ea ON (ev.obj_id = ea.event_id) " .
167 " JOIN object_description odes ON (ev.obj_id = odes.obj_id) " .
169 $ilDB->in(
"ev.obj_id", $a_ids,
false,
"integer"));
174 if ($a_entity ==
"sess_item") {
175 switch ($a_version) {
180 " FROM event_items " .
182 $ilDB->in(
"event_id", $a_ids,
false,
"integer"));
196 if ($a_entity ==
"sess") {
198 if (!$a_set[
"Fulltime"]) {
200 #$start = new ilDateTime($a_set["EventStart"], IL_CAL_DATETIME); 201 #$a_set["EventStart"] = $start->get(IL_CAL_DATETIME,'','UTC'); 202 #$end = new ilDateTime($a_set["EventEnd"], IL_CAL_DATETIME); 203 #$a_set["EventEnd"] = $end->get(IL_CAL_DATETIME,'','UTC'); 206 if ($a_entity ==
"sess_item") {
223 "sess_item" =>
array(
"ids" => $a_rec[
"Id"])
237 public function importRecord($a_entity, $a_types, $a_rec, $a_mapping, $a_schema_version)
241 include_once(
"./Modules/Session/classes/class.ilObjSession.php");
242 include_once(
"./Modules/Session/classes/class.ilSessionAppointment.php");
244 if ($new_id = $a_mapping->getMapping(
'Services/Container',
'objs', $a_rec[
'Id'])) {
248 $newObj->setType(
"sess");
249 $newObj->create(
true);
251 $newObj->setTitle($a_rec[
"Title"]);
252 $newObj->setDescription($a_rec[
"Description"]);
253 $newObj->setLocation($a_rec[
"Location"]);
254 $newObj->setName($a_rec[
"TutorName"]);
255 $newObj->setPhone($a_rec[
"TutorPhone"]);
256 $newObj->setEmail($a_rec[
"TutorEmail"]);
257 $newObj->setDetails($a_rec[
"Details"]);
259 switch ($a_schema_version) {
262 $newObj->setRegistrationType($a_rec[
"Registration"]);
264 $newObj->enableRegistrationUserLimit($a_rec[
"LimitedRegistration"]);
265 $newObj->setRegistrationMaxUsers($a_rec[
"LimitUsers"]);
266 $newObj->enableRegistrationWaitingList($a_rec[
"WaitingList"]);
268 if (isset($a_rec[
"MinUsers"])) {
269 $newObj->setRegistrationMinUsers($a_rec[
"MinUsers"]);
272 if (isset($a_rec[
"AutoWait"])) {
273 $newObj->setWaitingListAutoFill($a_rec[
"AutoWait"]);
278 $newObj->update(
true);
285 $app->setStart($a_rec[
"EventStart"]);
286 $app->setEnd($a_rec[
"EventEnd"]);
289 $app->toggleFullTime($a_rec[
"Fulltime"]);
290 $app->setSessionId($newObj->getId());
296 $this->current_obj = $newObj;
297 $a_mapping->addMapping(
"Modules/Session",
"sess", $a_rec[
"Id"], $newObj->getId());
298 $a_mapping->addMapping(
'Services/Object',
'objs', $a_rec[
'Id'], $newObj->getId());
299 $a_mapping->addMapping(
'Services/AdvancedMetaData',
'parent', $a_rec[
'Id'], $newObj->getId());
300 $a_mapping->addMapping(
303 $a_rec[
"Id"] .
":0:sess",
304 $newObj->getId() .
":0:sess" 313 if ($obj_id = $a_mapping->getMapping(
'Services/Container',
'objs', $a_rec[
'ItemId'])) {
315 include_once
'./Modules/Session/classes/class.ilEventItems.php';
getSupportedVersions()
Get supported versions.
readData($a_entity, $a_version, $a_ids, $a_field="")
Read data.
getDirectDataFromQuery($a_query, $a_convert_to_leading_upper=true, $a_set=true)
Get data from query.This is a standard procedure, all db field names are directly mapped to abstract ...
static _getAllReferences($a_id)
get all reference ids of object
getDependencies($a_entity, $a_version, $a_rec, $a_ids)
Determine the dependent sets of data.
importRecord($a_entity, $a_types, $a_rec, $a_mapping, $a_schema_version)
Import record.
getTypes($a_entity, $a_version)
Get field types for entity.
getXmlNamespace($a_entity, $a_schema_version)
Get xml namespace.
static _lookupObjId($a_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.
getXmlRecord($a_entity, $a_version, $a_set)
Get xml record (export)
addItem($a_item_ref_id)
Add one item.
A dataset contains in data in a common structure that can be shared and transformed for different pur...
class ilSessionAppointment