4 include_once(
"./Services/DataSet/classes/class.ilDataSet.php");
23 return array(
"4.3.0");
34 return "http://www.ilias.de/xml/Services/Calendar/".$a_entity;
43 protected function getTypes($a_entity, $a_version)
46 if ($a_entity ==
"calendar")
62 if ($a_entity ==
"cal_entry")
71 "Description" =>
"text",
73 "Fullday" =>
"integer",
76 "Informations" =>
"text",
77 "AutoGenerated" =>
"integer",
78 "ContextId" =>
"integer",
79 "TranslationType" =>
"integer",
80 "IsMilestone" =>
"integer",
81 "Completion" =>
"integer",
82 "Notification" =>
"integer"
88 if ($a_entity ==
"cal_assignment")
95 "EntryId" =>
"integer"
101 if ($a_entity ==
"recurrence_rule")
107 "RuleId" =>
"integer",
108 "EntryId" =>
"integer",
109 "CalRecurrence" =>
"integer",
110 "FreqType" =>
"text",
111 "FreqUntilDate" =>
"text",
112 "FreqUntilCount" =>
"integer",
113 "Intervall" =>
"integer",
115 "Byweekno" =>
"text",
117 "Bymonthday" =>
"text",
118 "Byyearday" =>
"text",
119 "Bysetpos" =>
"text",
120 "Weekstart" =>
"text"
132 function readData($a_entity, $a_version, $a_ids, $a_field =
"")
136 if (!is_array($a_ids))
138 $a_ids = array($a_ids);
142 if ($a_entity ==
"calendar")
148 " FROM cal_categories ".
150 $ilDB->in(
"cat_id", $a_ids,
false,
"integer"));
156 if ($a_entity ==
"cal_assignment")
162 " FROM cal_cat_assignments ".
164 $ilDB->in(
"cat_id", $a_ids,
false,
"integer"));
170 if ($a_entity ==
"cal_entry")
176 " starta, enda, informations, auto_generated, context_id, translation_type, is_milestone, completion, notification ".
177 " FROM cal_entries ".
179 $ilDB->in(
"cal_id", $a_ids,
false,
"integer"));
186 if ($a_entity ==
"recurrence_rule")
191 $this->
getDirectDataFromQuery(
"SELECT rule_id, cal_id entry_id, cal_recurrence, freq_type, freq_until_date, freq_until_count, ".
192 " intervall, byday, byweekno, bymonth, bymonthday, byyearday, bysetpos, weekstart ".
193 " FROM cal_recurrence_rules ".
195 $ilDB->in(
"cal_id", $a_ids,
false,
"integer"));
209 include_once(
"./Services/Calendar/classes/class.ilCalendarCategoryAssignments.php");
212 foreach ($assignmnts as $cal_id)
214 $entries[$cal_id] = $cal_id;
217 "cal_entry" => array(
"ids" => $entries),
218 "cal_assignment" => array(
"ids" => $a_rec[
"CatId"])
222 "recurrence_rule" => array(
"ids" => $a_rec[
"Id"])
235 function importRecord($a_entity, $a_types, $a_rec, $a_mapping, $a_schema_version)
242 if ($a_rec[
"Type"] == 1)
244 $usr_id = $a_mapping->getMapping(
"Services/User",
"usr", $a_rec[
"ObjId"]);
247 include_once(
'./Services/Calendar/classes/class.ilCalendarCategory.php');
249 $category->setTitle($a_rec[
"Title"]);
250 $category->setColor($a_rec[
"Color"]);
254 $a_mapping->addMapping(
"Services/Calendar",
"calendar", $a_rec[
"CatId"],
255 $category->getCategoryID());
263 if ((
int) $a_rec[
"ContextId"] == 0)
265 include_once(
'./Services/Calendar/classes/class.ilCalendarEntry.php');
267 $entry->setTitle($a_rec[
"Title"]);
268 $entry->setSubtitle($a_rec[
"Subtitle"]);
269 $entry->setDescription($a_rec[
"Description"]);
270 $entry->setLocation($a_rec[
"Location"]);
271 $entry->setFullday($a_rec[
"Fullday"]);
272 if ($a_rec[
"Starta"] !=
"")
276 if ($a_rec[
"Enda"] !=
"")
280 $entry->setFurtherInformations($a_rec[
"Informations"]);
281 $entry->setAutoGenerated($a_rec[
"AutoGenerated"]);
282 $entry->setContextId($a_rec[
"ContextId"]);
283 $entry->setMilestone($a_rec[
"Milestone"]);
284 $entry->setCompletion($a_rec[
"Completion"]);
285 $entry->setTranslationType($a_rec[
"TranslationType"]);
286 $entry->enableNotification($a_rec[
"Notification"]);
288 $a_mapping->addMapping(
"Services/Calendar",
"cal_entry", $a_rec[
"Id"],
289 $entry->getEntryId());
293 case "cal_assignment":
294 $cat_id = $a_mapping->getMapping(
"Services/Calendar",
"calendar", $a_rec[
"CatId"]);
295 $entry_id = $a_mapping->getMapping(
"Services/Calendar",
"cal_entry", $a_rec[
"EntryId"]);
296 if ($cat_id > 0 && $entry_id > 0)
298 include_once(
'./Services/Calendar/classes/class.ilCalendarCategoryAssignments.php');
300 $ass->addAssignment($cat_id);
304 case "recurrence_rule":
305 $entry_id = $a_mapping->getMapping(
"Services/Calendar",
"cal_entry", $a_rec[
"EntryId"]);
308 include_once(
'./Services/Calendar/classes/class.ilCalendarRecurrence.php');
310 $rec->setEntryId($entry_id);
311 $rec->setRecurrence($a_rec[
"CalRecurrence"]);
312 $rec->setFrequenceType($a_rec[
"FreqType"]);
313 if ($a_rec[
"FreqUntilDate"] !=
"")
317 $rec->setFrequenceUntilCount($a_rec[
"FreqUntilCount"]);
318 $rec->setInterval($a_rec[
"Interval"]);
319 $rec->setBYDAY($a_rec[
"Byday"]);
320 $rec->setBYWEEKNO($a_rec[
"Byweekno"]);
321 $rec->setBYMONTH($a_rec[
"Bymonth"]);
322 $rec->setBYMONTHDAY($a_rec[
"Bymonthday"]);
323 $rec->setBYYEARDAY($a_rec[
"Byyearday"]);
324 $rec->setBYSETPOS($a_rec[
"Bysetpos"]);
325 $rec->setWeekstart($a_rec[
"Weekstart"]);
327 $a_mapping->addMapping(
"Services/Calendar",
"recurrence_rule", $a_rec[
"RuleId"],
328 $rec->getRecurrenceId());