33include_once(
'./Services/Calendar/classes/class.ilTimeZone.php');
34include_once(
'./Services/Calendar/classes/class.ilDateTime.php');
62 $lng->loadLanguageModule(
'dateplaner');
84 $ilTabs->clearTargets();
85 $ilTabs->setBackTarget(
86 $this->lng->txt(
'cal_back_to_cal'),
87 $this->ctrl->getLinkTarget($this,
'cancel')
90 $next_class = $this->ctrl->getNextClass($this);
95 $cmd = $this->ctrl->getCmd(
"add");
120 $this->ctrl->returnToParent($this);
130 protected function initForm($a_mode, $a_as_milestone =
false, $a_edit_single_app =
false)
134 include_once(
'./Services/Form/classes/class.ilPropertyFormGUI.php');
135 include_once(
'./Services/Calendar/classes/class.ilCalendarRecurrenceGUI.php');
136 include_once(
'./Services/Calendar/classes/class.ilCalendarCategories.php');
137 include_once(
'./Services/Calendar/classes/class.ilCalendarCategoryAssignments.php');
138 include_once(
'./Services/Calendar/classes/class.ilCalendarCategory.php');
142 include_once(
'./Services/YUI/classes/class.ilYuiUtil.php');
148 $this->ctrl->saveParameter($this,array(
'seed',
'idate'));
149 $this->form->setFormAction($this->ctrl->getFormAction($this));
152 $this->form->setTitle($this->lng->txt(
'cal_new_ms'));
153 $this->form->addCommandButton(
'saveMilestone',$this->lng->txt(
'cal_add_milestone'));
154 $this->form->addCommandButton(
'cancel',$this->lng->txt(
'cancel'));
158 $this->form->setTitle($this->lng->txt(
'cal_new_app'));
159 $this->form->addCommandButton(
'save',$this->lng->txt(
'cal_add_appointment'));
160 $this->form->addCommandButton(
'cancel',$this->lng->txt(
'cancel'));
167 $this->form->setTitle($this->lng->txt(
'cal_edit_milestone'));
171 $this->form->setTitle($this->lng->txt(
'cal_edit_appointment'));
173 $this->ctrl->saveParameter($this,array(
'seed',
'app_id',
'idate'));
174 $this->form->setFormAction($this->ctrl->getFormAction($this));
177 $cat = $ass->getFirstAssignment();
178 include_once(
'./Services/Calendar/classes/class.ilCalendarCategory.php');
182 && ($type ==
"grp" || $type ==
"crs"))
185 $this->form->addCommandButton(
'editResponsibleUsers',$this->lng->txt(
'cal_change_responsible_users'));
187 $this->form->addCommandButton(
'update',$this->lng->txt(
'save'));
189 $this->form->addCommandButton(
'cancel',$this->lng->txt(
'cancel'));
194 $title->setValue($this->app->getTitle());
195 $title->setRequired(
true);
196 $title->setMaxLength(128);
198 $this->form->addItem($title);
201 $calendar =
new ilSelectInputGUI($this->lng->txt(
'cal_category_selection'),
'calendar');
204 $calendar->setValue((
int)
$_POST[
'calendar']);
205 $selected_calendar = (int)
$_POST[
'calendar'];
207 else if(
$_GET[
'category_id'])
209 $calendar->setValue((
int)
$_GET[
'category_id']);
210 $selected_calendar = (int)
$_GET[
'category_id'];
212 elseif($a_mode ==
'edit')
215 $cat = $ass->getFirstAssignment();
216 $calendar->setValue($cat);
217 $selected_calendar = $cat;
219 elseif(isset(
$_GET[
'ref_id']))
221 include_once(
'./Services/Calendar/classes/class.ilCalendarCategories.php');
226 $calendar->setRequired(
true);
228 $calendar->setOptions($cats->prepareCategoriesOfUserForSelection());
230 include_once
'./Services/Calendar/classes/class.ilCalendarSettings.php';
233 $notification_cals = $cats->getNotificationCalendars();
234 $notification_cals = count($notification_cals) ? implode(
',',$notification_cals) :
'';
235 $calendar->addCustomAttribute(
"onchange=\"ilToggleNotification(new Array(".$notification_cals.
"));\"");
237 $this->form->addItem($calendar);
239 if (!$a_as_milestone)
241 include_once
'./Services/Form/classes/class.ilDateDurationInputGUI.php';
242 $tpl->addJavaScript(
'./Services/Form/js/date_duration.js');
244 $dur->setStartText($this->lng->txt(
'cal_start'));
245 $dur->setEndText($this->lng->txt(
'cal_end'));
246 $dur->enableToggleFullTime(
247 $this->lng->txt(
'cal_fullday_title'),
248 $this->app->isFullday() ?
true :
false
250 $dur->setShowTime(
true);
251 $dur->setStart($this->app->getStart());
252 $dur->setEnd($this->app->getEnd());
253 $this->form->addItem($dur);
256 include_once(
'./Services/Calendar/classes/Form/class.ilRecurrenceInputGUI.php');
258 $rec->setRecurrence($this->rec);
259 $this->form->addItem(
$rec);
262 $where =
new ilTextInputGUI($this->lng->txt(
'cal_where'),
'location');
263 $where->setValue($this->app->getLocation());
264 $where->setMaxLength(128);
266 $this->form->addItem($where);
271 $deadline->setDate($this->app->getStart());
272 $deadline->setShowTime(
false);
273 $deadline->setMinuteStepSize(5);
274 $this->form->addItem($deadline);
277 $completion_vals = array();
278 for($i = 0; $i <= 100; $i+=5)
280 $completion_vals[$i] = $i.
" %";
284 $compl->setOptions($completion_vals);
285 $compl->setValue($this->app->getCompletion());
286 $this->form->addItem($compl);
290 $desc->setValue($this->app->getDescription());
292 $this->form->addItem($desc);
294 if ($a_as_milestone && $a_mode ==
"edit" && $resp_info)
297 $users = $this->app->readResponsibleUsers();
301 foreach($users as
$r)
303 $value.= $delim.$r[
"lastname"].
", ".
$r[
"firstname"].
" [".
$r[
"login"].
"]";
306 if (count($users) > 0)
308 $resp->setValue($value);
312 $resp->setValue(
"-");
315 $this->form->addItem($resp);
322 $notu->setInfo($this->lng->txt(
'cal_user_notification_info'));
324 $notu->setMaxLength(64);
327 foreach($this->notification->getRecipients() as $rcp)
329 switch ($rcp[
'type'])
336 $values[] = $rcp[
'email'];
341 $notu->setValues($values);
343 $notu->setValues(array(
''));
344 $this->form->addItem($notu);
348 include_once
'./Services/Calendar/classes/class.ilCalendarSettings.php';
361 $tpl->addJavaScript(
'./Services/Calendar/js/toggle_notification.js');
363 $not->setInfo($this->lng->txt(
'cal_notification_info'));
365 $not->setChecked($this->app->isNotificationEnabled());
366 $not->setDisabled($disabled);
367 $this->form->addItem($not);
380 global
$tpl, $ilHelp;
382 $ilHelp->setScreenIdComponent(
"cal");
383 $ilHelp->setScreenId(
"app");
384 $ilHelp->setSubScreenId(
"create");
387 $tpl->setContent($this->form->getHTML());
398 global
$tpl, $ilHelp;
400 $ilHelp->setScreenIdComponent(
"cal");
401 $ilHelp->setScreenId(
"app");
402 $ilHelp->setSubScreenId(
"create_milestone");
405 $tpl->setContent($this->form->getHTML());
423 protected function save($a_as_milestone =
false)
427 $this->
load($a_as_milestone);
429 if($this->app->validate() and $this->notification->validate())
431 if(!(
int)
$_POST[
'calendar'])
437 $cat_id = (int)
$_POST[
'calendar'];
441 $this->notification->setEntryId($this->app->getEntryId());
442 $this->notification->save();
443 $this->rec->setEntryId($this->app->getEntryId());
446 include_once(
'./Services/Calendar/classes/class.ilCalendarCategoryAssignments.php');
448 $ass->addAssignment($cat_id);
451 include_once
'./Services/Calendar/classes/class.ilCalendarSettings.php';
461 include_once(
'./Services/Calendar/classes/class.ilCalendarCategory.php');
466 && ($type ==
"grp" || $type ==
"crs"))
471 elseif($a_as_milestone)
474 $this->ctrl->returnToParent($this);
479 $this->ctrl->returnToParent($this);
504 include_once
'./Services/Calendar/classes/class.ilCalendarMailNotification.php';
506 $notification->setAppointmentId($this->app->getEntryId());
508 foreach($this->notification->getRecipients() as $rcp)
513 $notification->setSender(ANONYMOUS_USER_ID);
514 $notification->setRecipients(array($rcp[
'usr_id']));
519 $notification->setSender(ANONYMOUS_USER_ID);
520 $notification->setRecipients(array($rcp[
'email']));
524 $notification->send();
535 include_once(
'./Services/Calendar/classes/class.ilCalendarCategory.php');
538 include_once
'./Services/Calendar/classes/class.ilCalendarMailNotification.php';
540 $notification->setAppointmentId($app_id);
542 switch($cat_info[
'type'])
546 switch($cat_info[
'obj_type'])
551 $notification->setRefId(
$ref_id);
552 $notification->setType(
561 $notification->setRefId(
$ref_id);
562 $notification->setType(
571 $notification->send();
579 include_once(
'./Services/Calendar/classes/class.ilCalendarCategoryAssignments.php');
581 include_once(
'./Services/Calendar/classes/class.ilCalendarCategory.php');
595 include_once(
"./Services/Calendar/classes/class.ilMilestoneResponsiblesTableGUI.php");
597 $this->app->getEntryId());
598 $tpl->setContent($table_gui->getHTML());
608 $this->app->writeResponsibleUsers(
$_POST[
"user_id"]);
609 $ilCtrl->returnToParent($this);
619 include_once
'./Services/Calendar/classes/class.ilCalendarRecurrences.php';
623 return $this->
edit(TRUE);
626 $this->ctrl->saveParameter($this,array(
'seed',
'app_id',
'dt',
'idate'));
628 include_once(
'./Services/Utilities/classes/class.ilConfirmationGUI.php');
630 $confirm->setFormAction($this->ctrl->getFormAction($this));
631 #$confirm->setHeaderText($this->lng->txt('cal_edit_app_sure'));
632 $confirm->setCancel($this->lng->txt(
'cancel'),
'cancel');
633 $confirm->addItem(
'appointments[]',$this->app->getEntryId(),$this->app->getTitle());
634 $confirm->addButton($this->lng->txt(
'cal_edit_single'),
'editSingle');
635 $confirm->setConfirm($this->lng->txt(
'cal_edit_recurrences'),
'edit');
637 $GLOBALS[
'tpl']->setContent($confirm->getHTML());
646 $GLOBALS[
'ilCtrl']->setParameter($this,
'rexcl',1);
657 protected function edit($a_edit_single_app =
false)
661 $ilHelp->setScreenIdComponent(
"cal");
662 $ilHelp->setScreenId(
"app");
663 if ($this->app->isMilestone())
665 $ilHelp->setSubScreenId(
"edit_milestone");
669 $ilHelp->setSubScreenId(
"edit");
672 include_once(
'./Services/Calendar/classes/class.ilCalendarCategory.php');
673 include_once(
'./Services/Calendar/classes/class.ilCalendarCategories.php');
674 include_once(
'./Services/Calendar/classes/class.ilCalendarCategoryAssignments.php');
676 $GLOBALS[
'ilCtrl']->saveParameter($this,array(
'seed',
'app_id',
'dt',
'idate'));
680 $GLOBALS[
'ilCtrl']->setParameter($this,
'rexl',1);
684 include_once
'./Services/Calendar/classes/class.ilCalendarRecurrenceCalculator.php';
689 $yesterday = clone $current_date;
691 $tomorrow = clone $current_date;
695 foreach($calc->calculateDateList($current_date, $tomorrow, 1) as $date_entry)
712 if(!$cats->isVisible($cat_id))
714 $ilErr->raiseError($this->lng->txt(
'permission_denied'),
$ilErr->WARNING);
717 if(!$cats->isEditable($cat_id) or $this->app->isAutoGenerated())
723 $this->
initForm(
'edit', $this->app->isMilestone(), $a_edit_single_app);
724 $tpl->setContent($this->form->getHTML());
737 include_once(
"./Services/InfoScreen/classes/class.ilInfoScreenGUI.php");
739 $info->setFormAction($this->ctrl->getFormAction($this));
741 if ($this->app->isMilestone())
743 $info->addSection($this->lng->txt(
'cal_ms_details'));
747 $info->addSection($this->lng->txt(
'cal_details'));
751 $info->addProperty($this->lng->txt(
'appointment'),
753 $this->app->getStart(),
754 $this->app->getEnd()));
755 $info->addProperty($this->lng->txt(
'title'),$this->app->getPresentationTitle());
758 if(strlen($desc = $this->app->getDescription()))
764 if(strlen($loc = $this->app->getLocation()))
766 $info->addProperty($this->lng->txt(
'cal_where'),$loc);
770 if ($this->app->isMilestone() && $this->app->getCompletion() > 0)
772 $info->addProperty($this->lng->txt(
'cal_task_completion'),
773 $this->app->getCompletion().
" %");
776 include_once(
'./Services/Calendar/classes/class.ilCalendarCategoryAssignments.php');
781 && ($type ==
"grp" || $type ==
"crs"))
784 $users = $this->app->readResponsibleUsers();
786 foreach($users as
$r)
788 $value.= $delim.$r[
"lastname"].
", ".
$r[
"firstname"].
" [".
$r[
"login"].
"]";
791 if (count($users) > 0)
793 $info->addProperty($this->lng->txt(
'cal_responsible'),
802 $info->addSection($this->lng->txt(
'additional_info'));
807 include_once(
'./Services/Link/classes/class.ilLink.php');
809 $info->addProperty($this->lng->txt(
'perma_link'),
'<a class="small" href="'.$href.
'" target="_top">'.$href.
'</a>');
825 $single_editing = (
$_REQUEST[
'rexl'] ? true :
false);
827 $this->
load($this->app->isMilestone());
829 if($this->app->validate() and $this->notification->validate())
831 if(!(
int)
$_POST[
'calendar'])
837 $cat_id = (int)
$_POST[
'calendar'];
852 $this->notification->save();
855 include_once(
'./Services/Calendar/classes/class.ilCalendarCategoryAssignments.php');
857 $GLOBALS[
'ilLog']->write($this->app->getEntryId());
858 $ass->deleteAssignments();
859 $ass->addAssignment($cat_id);
862 include_once
'./Services/Calendar/classes/class.ilCalendarSettings.php';
873 $this->ctrl->returnToParent($this);
894 include_once(
'./Services/Utilities/classes/class.ilConfirmationGUI.php');
896 $this->ctrl->saveParameter($this,array(
'seed',
'app_id',
'dt',
'idate'));
899 $confirm->setFormAction($this->ctrl->getFormAction($this));
900 $confirm->setHeaderText($this->lng->txt(
'cal_delete_app_sure'));
901 $confirm->setCancel($this->lng->txt(
'cancel'),
'cancel');
902 $confirm->addItem(
'appointments[]',$this->app->getEntryId(),$this->app->getTitle());
904 include_once(
'./Services/Calendar/classes/class.ilCalendarRecurrences.php');
906 && !$this->app->isMilestone())
908 $confirm->addButton($this->lng->txt(
'cal_delete_single'),
'deleteexclude');
909 $confirm->setConfirm($this->lng->txt(
'cal_delete_recurrences'),
'delete');
913 $confirm->setConfirm($this->lng->txt(
'delete'),
'delete');
916 $tpl->setContent($confirm->getHTML());
927 protected function delete()
929 foreach(
$_POST[
'appointments'] as $app_id)
934 include_once(
'./Services/Calendar/classes/class.ilCalendarCategoryAssignments.php');
937 include_once
'./Services/Calendar/classes/class.ilCalendarUserNotification.php';
941 $this->ctrl->returnToParent($this);
953 include_once(
'./Services/Calendar/classes/class.ilCalendarRecurrenceExclusion.php');
962 $this->ctrl->returnToParent($this);
977 $this->timezone =
$ilUser->getTimeZone();
986 if(!isset(
$_GET[
'hour']))
989 $this->default_fulltime =
true;
993 if((
int)
$_GET[
'hour'] < 10)
995 $time =
'0'.(int)
$_GET[
'hour'].
':00:00';
999 $time = (int)
$_GET[
'hour'].
':00:00';
1002 $this->default_fulltime =
false;
1015 $this->seed = clone
$seed;
1016 $this->default_fulltime =
true;
1028 include_once(
'./Services/Calendar/classes/class.ilCalendarEntry.php');
1029 include_once(
'./Services/Calendar/classes/class.ilCalendarRecurrences.php');
1032 include_once
'./Services/Calendar/classes/class.ilCalendarUserNotification.php';
1038 $this->app->setStart($start);
1041 if($this->default_fulltime)
1043 #$seed_end->increment(IL_CAL_DAY,1);
1049 $this->app->setEnd($seed_end);
1050 $this->app->setFullday($this->default_fulltime);
1068 protected function load($a_as_milestone =
false)
1070 if ($a_as_milestone)
1072 $this->app->setMilestone(
true);
1080 $this->app->enableNotification((
int)
$_POST[
'not']);
1081 if ($a_as_milestone)
1083 $this->app->setFullday(
true);
1087 $this->app->setFullday(isset(
$_POST[
'event'][
'fulltime']) ?
true :
false);
1090 if($this->app->isFullday())
1092 $start =
new ilDate(
$_POST[
'event'][
'start'][
'date'][
'y'].
'-'.
$_POST[
'event'][
'start'][
'date'][
'm'].
'-'.
$_POST[
'event'][
'start'][
'date'][
'd'],
1094 $this->app->setStart($start);
1096 $end =
new ilDate(
$_POST[
'event'][
'end'][
'date'][
'y'].
'-'.
$_POST[
'event'][
'end'][
'date'][
'm'].
'-'.
$_POST[
'event'][
'end'][
'date'][
'd'],
1099 if ($a_as_milestone)
1102 $this->app->setEnd($start);
1106 $this->app->setEnd($end);
1111 $start_dt[
'year'] = (int)
$_POST[
'event'][
'start'][
'date'][
'y'];
1112 $start_dt[
'mon'] = (int)
$_POST[
'event'][
'start'][
'date'][
'm'];
1113 $start_dt[
'mday'] = (int)
$_POST[
'event'][
'start'][
'date'][
'd'];
1114 $start_dt[
'hours'] = (int)
$_POST[
'event'][
'start'][
'time'][
'h'];
1115 $start_dt[
'minutes'] = (int)
$_POST[
'event'][
'start'][
'time'][
'm'];
1117 $this->app->setStart($start);
1119 $end_dt[
'year'] = (int)
$_POST[
'event'][
'end'][
'date'][
'y'];
1120 $end_dt[
'mon'] = (int)
$_POST[
'event'][
'end'][
'date'][
'm'];
1121 $end_dt[
'mday'] = (int)
$_POST[
'event'][
'end'][
'date'][
'd'];
1122 $end_dt[
'hours'] = (int)
$_POST[
'event'][
'end'][
'time'][
'h'];
1123 $end_dt[
'minutes'] = (int)
$_POST[
'event'][
'end'][
'time'][
'm'];
1125 $this->app->setEnd($end);
1133 $this->notification->setRecipients(array());
1135 foreach((array)
$_POST[
'notu'] as $rcp)
1140 if(strlen($rcp) == 0)
1147 $this->notification->addRecipient(
1154 $this->notification->addRecipient(
1171 $this->rec->reset();
1173 switch(
$_POST[
'frequence'])
1176 $this->rec->setFrequenceType(
$_POST[
'frequence']);
1177 $this->rec->setInterval((
int)
$_POST[
'count_DAILY']);
1181 $this->rec->setFrequenceType(
$_POST[
'frequence']);
1182 $this->rec->setInterval((
int)
$_POST[
'count_WEEKLY']);
1183 if(is_array(
$_POST[
'byday_WEEKLY']))
1190 $this->rec->setFrequenceType(
$_POST[
'frequence']);
1191 $this->rec->setInterval((
int)
$_POST[
'count_MONTHLY']);
1192 switch((
int)
$_POST[
'subtype_MONTHLY'])
1199 switch((
int)
$_POST[
'monthly_byday_day'])
1203 $this->rec->setBYSETPOS((
int)
$_POST[
'monthly_byday_num']);
1204 $this->rec->setBYDAY(
'MO,TU,WE,TH,FR');
1209 $this->rec->setBYMONTHDAY((
int)
$_POST[
'monthly_byday_num']);
1213 $this->rec->setBYDAY((
int)
$_POST[
'monthly_byday_num'].
$_POST[
'monthly_byday_day']);
1219 $this->rec->setBYMONTHDAY((
int)
$_POST[
'monthly_bymonthday']);
1225 $this->rec->setFrequenceType(
$_POST[
'frequence']);
1226 $this->rec->setInterval((
int)
$_POST[
'count_YEARLY']);
1227 switch((
int)
$_POST[
'subtype_YEARLY'])
1234 $this->rec->setBYMONTH((
int)
$_POST[
'yearly_bymonth_byday']);
1235 $this->rec->setBYDAY((
int)
$_POST[
'yearly_byday_num'].
$_POST[
'yearly_byday']);
1239 $this->rec->setBYMONTH((
int)
$_POST[
'yearly_bymonth_by_monthday']);
1240 $this->rec->setBYMONTHDAY((
int)
$_POST[
'yearly_bymonthday']);
1247 switch((
int)
$_POST[
'until_type'])
1250 $this->rec->setFrequenceUntilDate(
null);
1255 $this->rec->setFrequenceUntilDate(
null);
1256 $this->rec->setFrequenceUntilCount((
int)
$_POST[
'count']);
1260 $end_dt[
'year'] = (int)
$_POST[
'until_end'][
'date'][
'y'];
1261 $end_dt[
'mon'] = (int)
$_POST[
'until_end'][
'date'][
'm'];
1262 $end_dt[
'mday'] = (int)
$_POST[
'until_end'][
'date'][
'd'];
1264 $this->rec->setFrequenceUntilCount(0);
1280 switch(
$_POST[
'frequence'])
1285 if($this->rec->getRecurrenceId())
1287 $this->rec->delete();
1292 if($this->rec->getRecurrenceId())
1294 $this->rec->update();
1317 $cat->setTitle($this->lng->txt(
'cal_default_calendar'));
1318 $cat->setObjId(
$ilUser->getId());
1321 include_once
'./Services/Calendar/classes/class.ilCalendarCache.php';
1342 include_once
'Services/Utilities/classes/class.ilConfirmationGUI.php';
1345 $this->ctrl->setParameter($this,
'dstart',(
int)
$_REQUEST[
'dstart']);
1346 $this->ctrl->setParameter($this,
'dend',(
int)
$_REQUEST[
'dend']);
1349 $conf->setHeaderText($this->lng->txt(
'cal_confirm_reg_info'));
1350 $conf->setConfirm($this->lng->txt(
'cal_reg_register'),
'register');
1351 $conf->setCancel($this->lng->txt(
'cancel'),
'cancel');
1352 $conf->addItem(
'app_id', $entry->getEntryId(), $entry->getTitle().
' ('.$start.
')');
1354 $tpl->setContent($conf->getHTML());
1361 protected function register()
1365 include_once
'./Services/Calendar/classes/class.ilCalendarRegistration.php';
1374 $this->ctrl->returnToParent($this);
1392 include_once
'Services/Utilities/classes/class.ilConfirmationGUI.php';
1395 $this->ctrl->setParameter($this,
'dstart',(
int)
$_REQUEST[
'dstart']);
1396 $this->ctrl->setParameter($this,
'dend',(
int)
$_REQUEST[
'dend']);
1399 $conf->setHeaderText($this->lng->txt(
'cal_confirm_unreg_info'));
1400 $conf->setConfirm($this->lng->txt(
'cal_reg_unregister'),
'unregister');
1401 $conf->setCancel($this->lng->txt(
'cancel'),
'cancel');
1402 $conf->addItem(
'app_id', $entry->getEntryId(), $entry->getTitle().
' ('.$start.
')');
1404 $tpl->setContent($conf->getHTML());
1415 include_once
'./Services/Calendar/classes/class.ilCalendarRegistration.php';
1424 $this->ctrl->returnToParent($this);
1434 $entry = (int)
$_GET[
'app_id'];
1435 $user = (int)
$_GET[
'bkid'];
1437 $this->ctrl->saveParameter($this,
'app_id');
1439 include_once
'Services/Calendar/classes/class.ilCalendarEntry.php';
1440 include_once
'Services/Booking/classes/class.ilBookingEntry.php';
1447 $tpl->setContent($form->getHTML());
1457 include_once
'./Services/Form/classes/class.ilPropertyFormGUI.php';
1459 $form->setFormAction($this->ctrl->getFormAction($this));
1460 $form->addCommandButton(
'bookconfirmed',$this->lng->txt(
'cal_confirm_booking'));
1461 $form->addCommandButton(
'cancel',$this->lng->txt(
'cancel'));
1464 $form->addItem($date);
1467 $form->addItem($title);
1469 $message =
new ilTextAreaInputGUI($this->lng->txt(
'cal_ch_booking_message_tbl'),
'comment');
1470 $message->setRows(5);
1471 $form->addItem($message);
1487 if($form->checkInput())
1490 include_once
'./Services/Calendar/classes/class.ilCalendarEntry.php';
1493 include_once
'./Services/Booking/classes/class.ilBookingEntry.php';
1496 if(!$booking->isAppointmentBookableForUser($entry,
$GLOBALS[
'ilUser']->getId()))
1499 $this->ctrl->returnToParent($this);
1502 include_once
'./Services/Calendar/classes/ConsultationHours/class.ilConsultationHourUtils.php';
1505 include_once
'./Services/Booking/classes/class.ilBookingEntry.php';
1509 $this->ctrl->returnToParent($this);
1520 $entry = (int)
$_GET[
'app_id'];
1522 include_once
'Services/Calendar/classes/class.ilCalendarEntry.php';
1528 include_once
'Services/Booking/classes/class.ilBookingEntry.php';
1530 if(!$booking->hasBooked($entry->getEntryId()))
1532 $this->ctrl->returnToParent($this);
1540 $entry_title =
' '.$entry->getTitle();
1544 $this->ctrl->returnToParent($this);
1550 include_once
'Services/Utilities/classes/class.ilConfirmationGUI.php';
1553 $conf->setHeaderText($this->lng->txt(
'cal_cancel_booking_info'));
1554 $conf->setConfirm($this->lng->txt(
'cal_cancel_booking'),
'cancelconfirmed');
1555 $conf->setCancel($this->lng->txt(
'cancel'),
'cancel');
1556 $conf->addItem(
'app_id', $entry->getEntryId(), $title.
' - '.$entry_title);
1558 $tpl->setContent($conf->getHTML());
1569 $entry = (int)
$_POST[
'app_id'];
1570 $user = (int)
$_GET[
'bkid'];
1572 include_once
'Services/Calendar/classes/class.ilCalendarEntry.php';
1579 include_once
'Services/Calendar/classes/ConsultationHours/class.ilConsultationHourAppointments.php';
1580 $GLOBALS[
'ilLog']->dump($entry->getStart());
1583 $entry->getContextId(),
1590 foreach((array) $apps as $own_app)
1593 $ref_entry->delete();
1596 include_once
'Services/Booking/classes/class.ilBookingEntry.php';
1598 $booking->cancelBooking($entry->getEntryId());
1604 include_once
'Modules/BookingManager/classes/class.ilBookingReservation.php';
1613 $this->ctrl->returnToParent($this);
1623 include_once
'Services/Calendar/classes/class.ilCalendarCategoryAssignments.php';
1624 include_once
'Services/Calendar/classes/class.ilCalendarCategory.php';
1626 $assignment = $assignment->getFirstAssignment();
1636 if(!isset(
$_GET[
'autoCompleteField']))
1638 $a_fields = array(
'login',
'firstname',
'lastname',
'email');
1642 $a_fields = array((
string)
$_GET[
'autoCompleteField']);
1645 $GLOBALS[
'ilLog']->write(print_r($a_fields,
true));
1646 include_once
'./Services/User/classes/class.ilUserAutoComplete.php';
1648 $auto->setSearchFields($a_fields);
1649 $auto->enableFieldSearchableCheck(
true);
1650 $auto->setMoreLinkAvailable(
true);
1657 echo $auto->getList(
$_REQUEST[
'query']);
const IL_CAL_FREQ_MONTHLY
static writeBookingMessage($a_entry_id, $a_usr_id, $a_message)
Write booking message.
Administrate calendar appointments.
askEdit()
Check edit single apppointment / edit all appointments for recurring appointments.
initForm($a_mode, $a_as_milestone=false, $a_edit_single_app=false)
init form
deleteExclude($a_return=true)
delete single item of recurrence list
__construct(ilDate $seed, ilDate $initialDate, $a_appointment_id=0)
Constructor.
calendarEntryToCategory(ilCalendarEntry $entry)
Get category object of given calendar entry.
editSingle()
Edit one single appointment ^.
initInitialDate(ilDate $initialDate)
init initial date
bookconfirmed()
Book consultation appointment, was confirmed.
saveMilestone()
save milestone
distributeUserNotifications()
Send mail to selected users @global ilObjUser $ilUser.
loadRecurrenceSettings($a_as_milestone=false)
load recurrence settings
executeCommand()
Execute command.
showResponsibleUsersList($a_grp_id)
Show responsible uses of a milestone (default set is participants of group)
distributeNotifications($a_cat_id, $app_id, $a_new_appointment=true)
Distribute mail notifications.
saveRecurrenceSettings()
save recurrence settings
edit($a_edit_single_app=false)
edit appointment
createDefaultCalendar()
Create a default calendar.
load($a_as_milestone=false)
load post
confirmRegister()
Register to an appointment.
cancelConfirmed()
Cancel consultation appointment or ressource booking, was confirmed This will delete the calendar ent...
doUserAutoComplete()
Do auto completion.
showInfoScreen()
show info screen
book()
Confirmation screen for booking of consultation appointment.
loadNotificationRecipients()
save($a_as_milestone=false)
save appointment
saveMilestoneResponsibleUsers()
Save milestone responsibilites.
getAppointment()
Get current appointment.
initAppointment($a_app_id=0)
init appointment
initSeed(ilDate $seed)
init seed
initTimeZone()
init timezone
addMilestone()
add milestone
editResponsibleUsers()
Edit responsible users.
cancelBooking()
Confirmation screen to cancel consultation appointment or ressource booking depends on calendar categ...
confirmUnregister()
Confirmation screen to unregister calendar.
unregister()
Unregister calendar, was confirmed.
static getInstance()
get singleton instance
static _lookupCategoryIdByObjId($a_obj_id)
lookup category by obj_id
static _getInstance($a_usr_id=0)
get singleton instance
static _lookupCategory($a_cal_id)
Lookup category id.
static _deleteByAppointmentId($a_app_id)
Delete appointment assignment.
Stores calendar categories.
Model for a calendar entry.
Distributes calendar mail notifications.
const TYPE_USER_ANONYMOUS
const TYPE_CRS_NEW_NOTIFICATION
const TYPE_CRS_NOTIFICATION
const TYPE_GRP_NOTIFICATION
const TYPE_GRP_NEW_NOTIFICATION
Calculates an ilDateList for a given calendar entry and recurrence rule.
Stores exclusion dates for calendar recurrences.
static _getRecurrences($a_cal_id)
get all recurrences of an appointment
static _getFirstRecurrence($a_cal_id)
get first recurrence
registration for calendar appointments
static _getInstance()
get singleton instance
static deleteCalendarEntry($a_cal_id)
Delete notification for a calendar entry @global ilDB $ilDB.
Confirmation screen class.
setFormAction($a_form_action)
static getAppointmentIds($a_user_id, $a_context_id=NULL, $a_start=NULL, $a_type=NULL, $a_check_owner=true)
Get all appointment ids.
static bookAppointment($a_usr_id, $a_app_id)
Book an appointment.
static formatPeriod(ilDateTime $start, ilDateTime $end)
Format a period of two date Shows: 14.
static formatDate(ilDateTime $date)
Format a date @access public.
@classDescription Date and time handling
static _equals(ilDateTime $start, ilDateTime $end, $a_compare_field='', $a_tz='')
Check if two date are equal.
static _getStaticLink($a_ref_id, $a_type='', $a_fallback_goto=true, $append="")
Get static link.
TableGUI class for selection of milestone responsibles.
This class represents a non editable value in a property form.
static _lookupLogin($a_user_id)
lookup login
_lookupFullname($a_user_id)
Lookup Full Name.
static _loginExists($a_login, $a_user_id=0)
check if a login name already exists You may exclude a user from the check by giving his user id as 2...
static _lookupObjId($a_id)
static _getAllReferences($a_id)
get all reference ids of object
static _lookupType($a_id, $a_reference=false)
lookup object type
This class represents a text area property in a property form.
This class represents a text property in a property form.
This class represents a text wizard property in a property form.
Auto completion class for user lists.
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
static makeClickable($a_text, $detectGotoLinks=false)
makeClickable In Texten enthaltene URLs und Mail-Adressen klickbar machen
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled
static initDomEvent()
Init YUI DomEvent.
const IL_CAL_FREQ_DAILY
Model of calendar entry recurrcences.
$GLOBALS['PHPCAS_CLIENT']
This global variable is used by the interface class phpCAS.
if($_REQUEST['ilias_path']) define('ILIAS_HTTP_PATH' $_REQUEST['ilias_path']