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") {
60 if ($a_entity ==
"cal_entry") {
67 "Description" =>
"text",
69 "Fullday" =>
"integer",
72 "Informations" =>
"text",
73 "AutoGenerated" =>
"integer",
74 "ContextId" =>
"integer",
75 "TranslationType" =>
"integer",
76 "IsMilestone" =>
"integer",
77 "Completion" =>
"integer",
78 "Notification" =>
"integer" 84 if ($a_entity ==
"cal_assignment") {
89 "EntryId" =>
"integer" 95 if ($a_entity ==
"recurrence_rule") {
99 "RuleId" =>
"integer",
100 "EntryId" =>
"integer",
101 "CalRecurrence" =>
"integer",
102 "FreqType" =>
"text",
103 "FreqUntilDate" =>
"text",
104 "FreqUntilCount" =>
"integer",
105 "Intervall" =>
"integer",
107 "Byweekno" =>
"text",
109 "Bymonthday" =>
"text",
110 "Byyearday" =>
"text",
111 "Bysetpos" =>
"text",
112 "Weekstart" =>
"text" 124 public function readData($a_entity, $a_version, $a_ids, $a_field =
"")
128 if (!is_array($a_ids)) {
129 $a_ids =
array($a_ids);
133 if ($a_entity ==
"calendar") {
134 switch ($a_version) {
137 " FROM cal_categories " .
139 $ilDB->in(
"cat_id", $a_ids,
false,
"integer"));
145 if ($a_entity ==
"cal_assignment") {
146 switch ($a_version) {
149 " FROM cal_cat_assignments " .
151 $ilDB->in(
"cat_id", $a_ids,
false,
"integer"));
157 if ($a_entity ==
"cal_entry") {
158 switch ($a_version) {
161 " starta, enda, informations, auto_generated, context_id, translation_type, is_milestone, completion, notification " .
162 " FROM cal_entries " .
164 $ilDB->in(
"cal_id", $a_ids,
false,
"integer"));
171 if ($a_entity ==
"recurrence_rule") {
172 switch ($a_version) {
174 $this->
getDirectDataFromQuery(
"SELECT rule_id, cal_id entry_id, cal_recurrence, freq_type, freq_until_date, freq_until_count, " .
175 " intervall, byday, byweekno, bymonth, bymonthday, byyearday, bysetpos, weekstart " .
176 " FROM cal_recurrence_rules " .
178 $ilDB->in(
"cal_id", $a_ids,
false,
"integer"));
191 include_once(
"./Services/Calendar/classes/class.ilCalendarCategoryAssignments.php");
194 foreach ($assignmnts as $cal_id) {
195 $entries[$cal_id] = $cal_id;
198 "cal_entry" =>
array(
"ids" => $entries),
199 "cal_assignment" =>
array(
"ids" => $a_rec[
"CatId"])
203 "recurrence_rule" =>
array(
"ids" => $a_rec[
"Id"])
216 public function importRecord($a_entity, $a_types, $a_rec, $a_mapping, $a_schema_version)
222 if ($a_rec[
"Type"] == 1) {
223 $usr_id = $a_mapping->getMapping(
"Services/User",
"usr", $a_rec[
"ObjId"]);
225 include_once(
'./Services/Calendar/classes/class.ilCalendarCategory.php');
227 $category->setTitle($a_rec[
"Title"]);
228 $category->setColor($a_rec[
"Color"]);
230 $category->setObjId($usr_id);
232 $a_mapping->addMapping(
236 $category->getCategoryID()
245 if ((
int) $a_rec[
"ContextId"] == 0) {
246 include_once(
'./Services/Calendar/classes/class.ilCalendarEntry.php');
248 $entry->setTitle($a_rec[
"Title"]);
249 $entry->setSubtitle($a_rec[
"Subtitle"]);
250 $entry->setDescription($a_rec[
"Description"]);
251 $entry->setLocation($a_rec[
"Location"]);
252 $entry->setFullday($a_rec[
"Fullday"]);
253 if ($a_rec[
"Starta"] !=
"") {
256 if ($a_rec[
"Enda"] !=
"") {
259 $entry->setFurtherInformations($a_rec[
"Informations"]);
260 $entry->setAutoGenerated($a_rec[
"AutoGenerated"]);
261 $entry->setContextId($a_rec[
"ContextId"]);
262 $entry->setMilestone($a_rec[
"Milestone"]);
263 $entry->setCompletion($a_rec[
"Completion"]);
264 $entry->setTranslationType($a_rec[
"TranslationType"]);
265 $entry->enableNotification($a_rec[
"Notification"]);
267 $a_mapping->addMapping(
276 case "cal_assignment":
277 $cat_id = $a_mapping->getMapping(
"Services/Calendar",
"calendar", $a_rec[
"CatId"]);
278 $entry_id = $a_mapping->getMapping(
"Services/Calendar",
"cal_entry", $a_rec[
"EntryId"]);
279 if ($cat_id > 0 && $entry_id > 0) {
280 include_once(
'./Services/Calendar/classes/class.ilCalendarCategoryAssignments.php');
282 $ass->addAssignment($cat_id);
286 case "recurrence_rule":
287 $entry_id = $a_mapping->getMapping(
"Services/Calendar",
"cal_entry", $a_rec[
"EntryId"]);
289 include_once(
'./Services/Calendar/classes/class.ilCalendarRecurrence.php');
291 $rec->setEntryId($entry_id);
292 $rec->setRecurrence($a_rec[
"CalRecurrence"]);
293 $rec->setFrequenceType($a_rec[
"FreqType"]);
294 if ($a_rec[
"FreqUntilDate"] !=
"") {
297 $rec->setFrequenceUntilCount($a_rec[
"FreqUntilCount"]);
298 $rec->setInterval($a_rec[
"Interval"]);
299 $rec->setBYDAY($a_rec[
"Byday"]);
300 $rec->setBYWEEKNO($a_rec[
"Byweekno"]);
301 $rec->setBYMONTH($a_rec[
"Bymonth"]);
302 $rec->setBYMONTHDAY($a_rec[
"Bymonthday"]);
303 $rec->setBYYEARDAY($a_rec[
"Byyearday"]);
304 $rec->setBYSETPOS($a_rec[
"Bysetpos"]);
305 $rec->setWeekstart($a_rec[
"Weekstart"]);
307 $a_mapping->addMapping(
311 $rec->getRecurrenceId()
Model for a calendar entry.
getSupportedVersions()
Get supported versions.
getTypes($a_entity, $a_version)
Get field types for entity.
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 ...
importRecord($a_entity, $a_types, $a_rec, $a_mapping, $a_schema_version)
Import record.
readData($a_entity, $a_version, $a_ids, $a_field="")
Read data.
Stores calendar categories.
getDependencies($a_entity, $a_version, $a_rec, $a_ids)
Determine the dependent sets of data.
Create styles array
The data for the language used.
static _lookupType($a_id, $a_reference=false)
lookup object type
static _getAssignedAppointments($a_cat_id)
Get assigned apointments.
A dataset contains in data in a common structure that can be shared and transformed for different pur...
getXmlNamespace($a_entity, $a_schema_version)
Get xml namespace.