3 declare(strict_types=1);
19 return array(
"4.3.0");
25 protected function getXmlNamespace(
string $a_entity,
string $a_schema_version): string
27 return "http://www.ilias.de/xml/Services/Calendar/" . $a_entity;
33 protected function getTypes(
string $a_entity,
string $a_version): array
36 if ($a_entity ==
"calendar") {
50 if ($a_entity ==
"cal_entry") {
57 "Description" =>
"text",
59 "Fullday" =>
"integer",
62 "Informations" =>
"text",
63 "AutoGenerated" =>
"integer",
64 "ContextId" =>
"integer",
65 "TranslationType" =>
"integer",
66 "IsMilestone" =>
"integer",
67 "Completion" =>
"integer",
68 "Notification" =>
"integer" 74 if ($a_entity ==
"cal_assignment") {
79 "EntryId" =>
"integer" 85 if ($a_entity ==
"recurrence_rule") {
89 "RuleId" =>
"integer",
90 "EntryId" =>
"integer",
91 "CalRecurrence" =>
"integer",
93 "FreqUntilDate" =>
"text",
94 "FreqUntilCount" =>
"integer",
95 "Intervall" =>
"integer",
99 "Bymonthday" =>
"text",
100 "Byyearday" =>
"text",
101 "Bysetpos" =>
"text",
102 "Weekstart" =>
"text" 112 public function readData(
string $a_entity,
string $a_version, array $a_ids): void
116 $ilDB = $DIC[
'ilDB'];
118 if (!is_array($a_ids)) {
119 $a_ids = array($a_ids);
123 if ($a_entity ==
"calendar") {
124 switch ($a_version) {
127 " FROM cal_categories " .
129 $this->db->in(
"cat_id", $a_ids,
false,
"integer"));
135 if ($a_entity ==
"cal_assignment") {
136 switch ($a_version) {
139 " FROM cal_cat_assignments " .
141 $this->db->in(
"cat_id", $a_ids,
false,
"integer"));
147 if ($a_entity ==
"cal_entry") {
148 switch ($a_version) {
151 " starta, enda, informations, auto_generated, context_id, translation_type, is_milestone, completion, notification " .
152 " FROM cal_entries " .
154 $this->db->in(
"cal_id", $a_ids,
false,
"integer"));
160 if ($a_entity ==
"recurrence_rule") {
161 switch ($a_version) {
163 $this->
getDirectDataFromQuery(
"SELECT rule_id, cal_id entry_id, cal_recurrence, freq_type, freq_until_date, freq_until_count, " .
164 " intervall, byday, byweekno, bymonth, bymonthday, byyearday, bysetpos, weekstart " .
165 " FROM cal_recurrence_rules " .
167 $this->db->in(
"cal_id", $a_ids,
false,
"integer"));
179 ?array $a_rec = null,
186 foreach ($assignmnts as $cal_id) {
187 $entries[$cal_id] = $cal_id;
190 "cal_entry" => array(
"ids" => $entries),
191 "cal_assignment" => array(
"ids" => $a_rec[
"CatId"] ?? null)
195 "recurrence_rule" => array(
"ids" => $a_rec[
"Id"] ?? null)
210 string $a_schema_version
216 if (($a_rec[
"Type"] ?? 0) == 1) {
217 $usr_id = (
int) $a_mapping->
getMapping(
"Services/User",
"usr", $a_rec[
"ObjId"]);
220 $category->setTitle((
string) $a_rec[
"Title"]);
221 $category->setColor((
string) $a_rec[
"Color"]);
223 $category->setObjId((
int) $usr_id);
229 (
string) $category->getCategoryID()
238 if ((
int) ($a_rec[
"ContextId"] ?? 0) == 0) {
240 $entry->setTitle((
string) $a_rec[
"Title"]);
241 $entry->setSubtitle((
string) $a_rec[
"Subtitle"]);
242 $entry->setDescription((
string) $a_rec[
"Description"]);
243 $entry->setLocation((
string) $a_rec[
"Location"]);
244 $entry->setFullday((
bool) $a_rec[
"Fullday"]);
245 if ($a_rec[
"Starta"] !=
"") {
248 if (($a_rec[
"Enda"] ??
'') !=
"") {
251 $entry->setFurtherInformations((
string) ($a_rec[
"Informations"] ??
''));
252 $entry->setAutoGenerated((
bool) ($a_rec[
"AutoGenerated"] ??
false));
253 $entry->setContextId((
int) ($a_rec[
"ContextId"] ?? 0));
254 $entry->setMilestone((
bool) ($a_rec[
"Milestone"] ??
false));
255 $entry->setCompletion((
int) ($a_rec[
"Completion"] ?? 0));
256 $entry->setTranslationType((
int) ($a_rec[
"TranslationType"] ?? 0));
257 $entry->enableNotification((
bool) ($a_rec[
"Notification"] ??
false));
263 (
string) $entry->getEntryId()
268 case "cal_assignment":
269 $cat_id = (
int) $a_mapping->
getMapping(
"Services/Calendar",
"calendar", $a_rec[
"CatId"]);
270 $entry_id = (
int) $a_mapping->
getMapping(
"Services/Calendar",
"cal_entry", $a_rec[
"EntryId"]);
271 if ($cat_id > 0 && $entry_id > 0) {
273 $ass->addAssignment($cat_id);
277 case "recurrence_rule":
278 $entry_id = $a_mapping->
getMapping(
"Services/Calendar",
"cal_entry", $a_rec[
"EntryId"]);
281 $rec->setEntryId((
int) $entry_id);
282 $rec->setRecurrence((
int) $a_rec[
"CalRecurrence"]);
283 $rec->setFrequenceType((
string) $a_rec[
"FreqType"]);
284 if ($a_rec[
"FreqUntilDate"] !=
"") {
287 $rec->setFrequenceUntilCount((
int) $a_rec[
"FreqUntilCount"]);
288 $rec->setInterval((
int) ($a_rec[
"Interval"] ?? 0));
289 $rec->setBYDAY((
string) ($a_rec[
"Byday"] ??
''));
290 $rec->setBYWEEKNO((
string) ($a_rec[
"Byweekno"] ??
''));
291 $rec->setBYMONTH((
string) ($a_rec[
"Bymonth"] ??
''));
292 $rec->setBYMONTHDAY((
string) ($a_rec[
"Bymonthday"] ??
''));
293 $rec->setBYYEARDAY((
string) ($a_rec[
"Byyearday"] ??
''));
294 $rec->setBYSETPOS((
string) ($a_rec[
"Bysetpos"] ??
''));
295 $rec->setWeekstart((
string) ($a_rec[
"Weekstart"] ??
''));
301 (
string) $rec->getRecurrenceId()
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
getXmlNamespace(string $a_entity, string $a_schema_version)
getTypes(string $a_entity, string $a_version)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
readData(string $a_entity, string $a_version, array $a_ids)
Stores calendar categories.
addMapping(string $a_comp, string $a_entity, string $a_old_id, string $a_new_id)
getMapping(string $a_comp, string $a_entity, string $a_old_id)
importRecord(string $a_entity, array $a_types, array $a_rec, ilImportMapping $a_mapping, string $a_schema_version)
getDirectDataFromQuery(string $a_query, bool $a_convert_to_leading_upper=true, bool $a_set=true)
Get data from query.This is a standard procedure, all db field names are directly mapped to abstract ...
static _getAssignedAppointments(array $a_cat_id)
Get assigned apointments.
static _lookupType(int $id, bool $reference=false)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
getDependencies(string $a_entity, string $a_version, ?array $a_rec=null, ?array $a_ids=null)