4 include_once(
"./Services/DataSet/classes/class.ilDataSet.php");
29 parent::__construct();
30 $this->logger = $DIC->logger()->sess();
49 return array(
"4.1.0",
"5.0.0",
"5.1.0",
'5.4.0');
60 return "http://www.ilias.de/xml/Modules/Session/" . $a_entity;
69 protected function getTypes($a_entity, $a_version)
71 if ($a_entity ==
"sess") {
77 "Description" =>
"text",
79 "TutorName" =>
"text",
80 "TutorEmail" =>
"text",
81 "TutorPhone" =>
"text",
83 "Registration" =>
"integer",
84 "EventStart" =>
"text",
86 "StartingTime" =>
"integer",
87 "EndingTime" =>
"integer",
88 "Fulltime" =>
"integer" 94 "Description" =>
"text",
96 "TutorName" =>
"text",
97 "TutorEmail" =>
"text",
98 "TutorPhone" =>
"text",
100 "Registration" =>
"integer",
101 "EventStart" =>
"text",
102 "EventEnd" =>
"text",
103 "StartingTime" =>
"integer",
104 "EndingTime" =>
"integer",
105 "Fulltime" =>
"integer",
106 "LimitedRegistration" =>
"integer",
107 "WaitingList" =>
"integer",
108 "LimitUsers" =>
"integer" 114 "Description" =>
"text",
115 "Location" =>
"text",
116 "TutorName" =>
"text",
117 "TutorEmail" =>
"text",
118 "TutorPhone" =>
"text",
120 "Registration" =>
"integer",
121 "EventStart" =>
"text",
122 "EventEnd" =>
"text",
123 "StartingTime" =>
"integer",
124 "EndingTime" =>
"integer",
125 "Fulltime" =>
"integer",
126 "LimitedRegistration" =>
"integer",
127 "WaitingList" =>
"integer",
128 "AutoWait" =>
"integer",
129 "LimitUsers" =>
"integer",
130 "MinUsers" =>
"integer" 136 "Description" =>
"text",
137 "Location" =>
"text",
138 "TutorName" =>
"text",
139 "TutorEmail" =>
"text",
140 "TutorPhone" =>
"text",
142 "Registration" =>
"integer",
143 "EventStart" =>
"text",
144 "EventEnd" =>
"text",
145 "StartingTime" =>
"integer",
146 "EndingTime" =>
"integer",
147 "Fulltime" =>
"integer",
148 "LimitedRegistration" =>
"integer",
149 "WaitingList" =>
"integer",
150 "AutoWait" =>
"integer",
151 "LimitUsers" =>
"integer",
152 "MinUsers" =>
"integer",
153 'MailMembers' =>
'integer',
154 'ShowMembers' =>
'integer',
160 if ($a_entity ==
"sess_item") {
161 switch ($a_version) {
167 "SessionId" =>
"integer",
180 public function readData($a_entity, $a_version, $a_ids, $a_field =
"")
184 $ilDB = $DIC[
'ilDB'];
186 if (!is_array($a_ids)) {
187 $a_ids = array($a_ids);
190 if ($a_entity ==
"sess") {
191 switch ($a_version) {
194 " location, tutor_name, tutor_email, tutor_phone, details, registration, " .
195 " e_start event_start, e_end event_end, starting_time, ending_time, fulltime " .
196 " FROM event ev JOIN object_data od ON (ev.obj_id = od.obj_id) " .
197 " JOIN event_appointment ea ON (ev.obj_id = ea.event_id) " .
199 $ilDB->in(
"ev.obj_id", $a_ids,
false,
"integer"));
202 $this->
getDirectDataFromQuery($q =
"SELECT ev.obj_id id, od.title title, odes.description description, " .
203 " location, tutor_name, tutor_email, tutor_phone, details, reg_type registration, " .
204 " reg_limited limited_registration, reg_waiting_list waiting_list, " .
205 " reg_limit_users limit_users, " .
206 " e_start event_start, e_end event_end, starting_time, ending_time, fulltime " .
207 " FROM event ev JOIN object_data od ON (ev.obj_id = od.obj_id) " .
208 " JOIN event_appointment ea ON (ev.obj_id = ea.event_id) " .
209 " JOIN object_description odes ON (ev.obj_id = odes.obj_id) " .
211 $ilDB->in(
"ev.obj_id", $a_ids,
false,
"integer"));
214 $this->
getDirectDataFromQuery($q =
"SELECT ev.obj_id id, od.title title, odes.description description, " .
215 " location, tutor_name, tutor_email, tutor_phone, details, reg_type registration, " .
216 " reg_limited limited_registration, reg_waiting_list waiting_list, reg_auto_wait auto_wait, " .
217 " reg_limit_users limit_users, reg_min_users min_users, " .
218 " e_start event_start, e_end event_end, starting_time, ending_time, fulltime " .
219 " FROM event ev JOIN object_data od ON (ev.obj_id = od.obj_id) " .
220 " JOIN event_appointment ea ON (ev.obj_id = ea.event_id) " .
221 " JOIN object_description odes ON (ev.obj_id = odes.obj_id) " .
223 $ilDB->in(
"ev.obj_id", $a_ids,
false,
"integer"));
226 $this->
getDirectDataFromQuery($q =
"SELECT ev.obj_id id, od.title title, odes.description description, " .
227 " location, tutor_name, tutor_email, tutor_phone, details, reg_type registration, " .
228 " reg_limited limited_registration, reg_waiting_list waiting_list, reg_auto_wait auto_wait, " .
229 " reg_limit_users limit_users, reg_min_users min_users, " .
230 " e_start event_start, e_end event_end, starting_time, ending_time, fulltime, mail_members, show_members " .
231 " FROM event ev JOIN object_data od ON (ev.obj_id = od.obj_id) " .
232 " JOIN event_appointment ea ON (ev.obj_id = ea.event_id) " .
233 " JOIN object_description odes ON (ev.obj_id = odes.obj_id) " .
235 $ilDB->in(
"ev.obj_id", $a_ids,
false,
"integer"));
242 if ($a_entity ==
"sess_item") {
243 switch ($a_version) {
248 " FROM event_items " .
250 $ilDB->in(
"event_id", $a_ids,
false,
"integer"));
264 if ($a_entity ==
"sess") {
266 if (!$a_set[
"Fulltime"]) {
268 #$start = new ilDateTime($a_set["EventStart"], IL_CAL_DATETIME); 269 #$a_set["EventStart"] = $start->get(IL_CAL_DATETIME,'','UTC'); 270 #$end = new ilDateTime($a_set["EventEnd"], IL_CAL_DATETIME); 271 #$a_set["EventEnd"] = $end->get(IL_CAL_DATETIME,'','UTC'); 274 if ($a_entity ==
"sess_item") {
291 "sess_item" => array(
"ids" => $a_rec[
"Id"])
305 public function importRecord($a_entity, $a_types, $a_rec, $a_mapping, $a_schema_version)
309 include_once(
"./Modules/Session/classes/class.ilObjSession.php");
310 include_once(
"./Modules/Session/classes/class.ilSessionAppointment.php");
312 if ($new_id = $a_mapping->getMapping(
'Services/Container',
'objs', $a_rec[
'Id'])) {
316 $this->logger->debug(
'Session creation without existing instance');
318 $newObj->setType(
"sess");
319 $newObj->create(
true);
320 $newObj->createReference();
321 $newObj->putInTree($this->target_id);
322 $newObj->setPermissions($this->target_id);
324 $newObj->setTitle($a_rec[
"Title"]);
325 $newObj->setDescription($a_rec[
"Description"]);
326 $newObj->setLocation($a_rec[
"Location"]);
327 $newObj->setName($a_rec[
"TutorName"]);
328 $newObj->setPhone($a_rec[
"TutorPhone"]);
329 $newObj->setEmail($a_rec[
"TutorEmail"]);
330 $newObj->setDetails($a_rec[
"Details"]);
332 switch ($a_schema_version) {
335 $newObj->setRegistrationType($a_rec[
"Registration"]);
337 $newObj->enableRegistrationUserLimit($a_rec[
"LimitedRegistration"]);
338 $newObj->setRegistrationMaxUsers($a_rec[
"LimitUsers"]);
339 $newObj->enableRegistrationWaitingList($a_rec[
"WaitingList"]);
341 if (isset($a_rec[
"MinUsers"])) {
342 $newObj->setRegistrationMinUsers($a_rec[
"MinUsers"]);
345 if (isset($a_rec[
"AutoWait"])) {
346 $newObj->setWaitingListAutoFill($a_rec[
"AutoWait"]);
350 if (isset($a_rec[
'MailMembers'])) {
351 $newObj->setMailToMembersType($a_rec[
'MailMembers']);
353 if (isset($a_rec[
'ShowMembers'])) {
354 $newObj->setShowMembers($a_rec[
'ShowMembers']);
360 $newObj->update(
true);
367 $app->setStart($a_rec[
"EventStart"]);
368 $app->setEnd($a_rec[
"EventEnd"]);
371 $app->toggleFullTime($a_rec[
"Fulltime"]);
372 $app->setSessionId($newObj->getId());
378 $this->current_obj = $newObj;
379 $a_mapping->addMapping(
"Modules/Session",
"sess", $a_rec[
"Id"], $newObj->getId());
380 $a_mapping->addMapping(
'Services/Object',
'objs', $a_rec[
'Id'], $newObj->getId());
381 $a_mapping->addMapping(
'Services/AdvancedMetaData',
'parent', $a_rec[
'Id'], $newObj->getId());
382 $a_mapping->addMapping(
385 $a_rec[
"Id"] .
":0:sess",
386 $newObj->getId() .
":0:sess" 395 if ($obj_id = $a_mapping->getMapping(
'Services/Container',
'objs', $a_rec[
'ItemId'])) {
397 include_once
'./Modules/Session/classes/class.ilEventItems.php';
413 foreach ($a_obj_ids as $obj_id) {
415 foreach ($ref_ids as $ref_id) {
417 $this->
data[$counter++][
'Type'] = (int) $tpl_id;
429 $this->logger->debug(
'Apply didactic template');
431 if ((
int) $tpl_id == 0) {
432 $this->logger->debug(
'Default permissions');
439 if ($template->isAutoGenerated()) {
440 $this->logger->debug(
'Apply first auto generated');
static lookupTemplateId($a_ref_id)
Lookup template id ilDB $ilDB.
getSupportedVersions()
Get supported versions.
applyDidacticTemplate(ilObject $rep_object, $tpl_id)
readData($a_entity, $a_version, $a_ids, $a_field="")
Read data.
setTargetId(int $target_id)
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.
applyDidacticTemplate($a_tpl_id)
Apply template.
getXmlNamespace($a_entity, $a_schema_version)
Get xml namespace.
static _lookupObjId($a_id)
static getInstanceByObjectType($a_obj_type)
Get instance by obj type.
getXmlRecord($a_entity, $a_version, $a_set)
Get xml record (export)
static getInstanceByRefId($a_ref_id, $stop_on_error=true)
get an instance of an Ilias object by reference id
readDidacticTemplateType($a_obj_ids)
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