24 include_once(
'./Services/Calendar/classes/class.ilCalendarCategories.php');
25 include_once(
'./Services/Table/classes/class.ilTable2GUI.php');
55 $this->lng->loadLanguageModule(
'dateplaner');
58 $this->
setId(
'calinbox');
62 $this->
addColumn($this->lng->txt(
'date'),
'begin',
"30%");
63 $this->
addColumn($this->lng->txt(
'title'),
'title',
"40%");
64 #$this->addColumn($this->lng->txt('cal_duration'),'duration',"15%");
65 $this->
addColumn($this->lng->txt(
'cal_recurrences'),
'frequence',
"15%");
66 $this->
addColumn($this->lng->txt(
'last_update'),
'last_update',
"15%");
69 $this->
setFormAction($this->ctrl->getFormAction($a_parent_obj));
70 $this->
setRowTemplate(
"tpl.show_changed_appointment_row.html",
"Services/Calendar");
93 if ($a_set[
"milestone"])
95 $this->tpl->setCurrentBlock(
"img_ms");
97 $this->tpl->setVariable(
"ALT_MS", $lng->txt(
"cal_milestone"));
98 $this->tpl->parseCurrentBlock();
101 $this->tpl->setVariable(
'VAL_DESCRIPTION',$a_set[
'description']);
103 $this->tpl->setVariable(
'VAL_TITLE_LINK',$a_set[
'title']);
104 $this->ctrl->setParameterByClass(
'ilcalendarappointmentgui',
'app_id',$a_set[
'id']);
105 $this->tpl->setVariable(
'VAL_LINK',$this->ctrl->getLinkTargetByClass(
'ilcalendarappointmentgui',
'edit'));
107 switch($a_set[
'frequence'])
110 $this->tpl->setVariable(
'VAL_FREQUENCE',$this->lng->txt(
'cal_daily'));
114 $this->tpl->setVariable(
'VAL_FREQUENCE',$this->lng->txt(
'cal_weekly'));
118 $this->tpl->setVariable(
'VAL_FREQUENCE',$this->lng->txt(
'cal_monthly'));
122 $this->tpl->setVariable(
'VAL_FREQUENCE',$this->lng->txt(
'cal_yearly'));
126 #$this->tpl->setVariable('VAL_FREQUENCE',$this->lng->txt('cal_no_recurrence'));
129 if($a_set[
'fullday'])
143 $this->tpl->setVariable(
'VAL_BEGIN',$date);
175 include_once(
'./Services/Calendar/classes/class.ilCalendarEntry.php');
176 include_once(
'./Services/Calendar/classes/class.ilCalendarRecurrences.php');
177 $appointments = array();
179 foreach($a_apps as $event)
181 $entry = $event[
'event'];
185 $tmp_arr[
'id'] = $entry->getEntryId();
186 $tmp_arr[
'milestone'] = $entry->isMilestone();
187 $tmp_arr[
'title'] = $entry->getPresentationTitle();
188 $tmp_arr[
'description'] = $entry->getDescription();
189 $tmp_arr[
'fullday'] = $entry->isFullday();
190 #$tmp_arr['begin'] = $entry->getStart()->get(IL_CAL_UNIX);
191 #$tmp_arr['end'] = $entry->getEnd()->get(IL_CAL_UNIX);
193 $tmp_arr[
'begin'] = $event[
'dstart'];
194 $tmp_arr[
'end'] = $event[
'dend'];
196 $tmp_arr[
'duration'] = $tmp_arr[
'end'] - $tmp_arr[
'begin'];
197 if($tmp_arr[
'fullday'])
199 $tmp_arr[
'duration'] += (60 * 60 * 24);
201 if(!$tmp_arr[
'fullday'] and $tmp_arr[
'end'] == $tmp_arr[
'begin'])
203 $tmp_arr[
'duration'] =
'';
206 $tmp_arr[
'last_update'] = $entry->getLastUpdate()->get(
IL_CAL_UNIX);
207 $tmp_arr[
'frequence'] = $rec->getFrequenceType();
209 $appointments[] = $tmp_arr;
213 $appointments = array_slice($appointments, 0, $this->
getLimit());
215 $this->
setData($appointments ? $appointments : array());