33 include_once(
'./Services/Calendar/classes/class.ilTimeZone.php');
34 include_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));
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');
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')
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');
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.
" %";
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)
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');
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()))
760 $info->addProperty($this->lng->txt(
'description'),$desc);
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>');
812 $tpl->setContent($info->getHTML());
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');
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';
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';
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']);
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
getAppointment()
Get current appointment.
static getInstance()
get singleton instance
static _lookupCategory($a_cal_id)
Lookup category id.
static _getRecurrences($a_cal_id)
get all recurrences of an appointment
const IL_CAL_FREQ_MONTHLY
Model for a calendar entry.
static _getInstance()
get singleton instance
cancelConfirmed()
Cancel consultation appointment or ressource booking, was confirmed This will delete the calendar ent...
setValue($a_value)
Set Value.
setStatus($a_status)
Set booking status.
initTimeZone()
init timezone
static _getStaticLink($a_ref_id, $a_type='', $a_fallback_goto=true, $append="")
Get static link.
setFormAction($a_form_action)
static _getFirstRecurrence($a_cal_id)
get first recurrence
static getAppointmentIds($a_user_id, $a_context_id=NULL, $a_start=NULL, $a_type=NULL, $a_check_owner=true)
Get all appointment ids.
Distributes calendar mail notifications.
static formatPeriod(ilDateTime $start, ilDateTime $end)
Format a period of two date Shows: 14.
initAppointment($a_app_id=0)
init appointment
addMilestone()
add milestone
setValue($a_value)
Set Value.
loadNotificationRecipients()
initInitialDate(ilDate $initialDate)
init initial date
doUserAutoComplete()
Do auto completion.
static _lookupCategoryIdByObjId($a_obj_id)
lookup category by obj_id
initSeed(ilDate $seed)
init seed
saveMilestoneResponsibleUsers()
Save milestone responsibilites.
Stores calendar categories.
unregister()
Unregister calendar, was confirmed.
editResponsibleUsers()
Edit responsible users.
askEdit()
Check edit single apppointment / edit all appointments for recurring appointments.
TableGUI class for selection of milestone responsibles.
static _getAllReferences($a_id)
get all reference ids of object
_lookupFullname($a_user_id)
Lookup Full Name.
deleteExclude($a_return=true)
delete single item of recurrence list
Auto completion class for user lists.
showInfoScreen()
show info screen
edit($a_edit_single_app=false)
edit appointment
confirmUnregister()
Confirmation screen to unregister calendar.
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...
load($a_as_milestone=false)
load post
static writeBookingMessage($a_entry_id, $a_usr_id, $a_message)
Write booking message.
const TYPE_GRP_NEW_NOTIFICATION
static _equals(ilDateTime $start, ilDateTime $end, $a_compare_field='', $a_tz='')
Check if two date are equal.
Calculates an ilDateList for a given calendar entry and recurrence rule.
distributeUserNotifications()
Send mail to selected users ilObjUser $ilUser.
const IL_CAL_FREQ_DAILY
Model of calendar entry recurrcences.
calendarEntryToCategory(ilCalendarEntry $entry)
Get category object of given calendar entry.
static _lookupObjId($a_id)
registration for calendar appointments
const TYPE_CRS_NOTIFICATION
This class represents a text property in a property form.
static formatDate(ilDateTime $date)
Format a date public.
static initDomEvent()
Init YUI DomEvent.
cancelBooking($a_entry_id, $a_user_id=false)
cancel calendar booking for user
_lookupLogin($a_user_id)
lookup login
save($a_as_milestone=false)
save appointment
initForm($a_mode, $a_as_milestone=false, $a_edit_single_app=false)
init form
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled
static _deleteByAppointmentId($a_app_id)
Delete appointment assignment.
static _getInstance($a_usr_id=0)
get singleton instance
cancelBooking()
Confirmation screen to cancel consultation appointment or ressource booking depends on calendar categ...
distributeNotifications($a_cat_id, $app_id, $a_new_appointment=true)
Distribute mail notifications.
static _lookupType($a_id, $a_reference=false)
lookup object type
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
addAssignment($a_cal_cat_id)
add assignment
bookconfirmed()
Book consultation appointment, was confirmed.
__construct(ilDate $seed, ilDate $initialDate, $a_appointment_id=0)
Constructor.
loadRecurrenceSettings($a_as_milestone=false)
load recurrence settings
This class represents a non editable value in a property form.
setRows($a_rows)
Set Rows.
editSingle()
Edit one single appointment ^.
Administrate calendar appointments.
saveMilestone()
save milestone
This class represents a text area property in a property form.
const TYPE_GRP_NOTIFICATION
saveRecurrenceSettings()
save recurrence settings
if($_REQUEST['ilias_path']) define('ILIAS_HTTP_PATH' $_REQUEST['ilias_path']
Stores exclusion dates for calendar recurrences.
createDefaultCalendar()
Create a default calendar.
This class represents a text wizard property in a property form.
book()
Confirmation screen for booking of consultation appointment.
static deleteCalendarEntry($a_cal_id)
Delete notification for a calendar entry ilDB $ilDB.
get($a_format, $a_format_str='')
get formatted date
setValue($a_value)
Set Value.
const TYPE_CRS_NEW_NOTIFICATION
executeCommand()
Execute command.
const TYPE_USER_ANONYMOUS
confirmRegister()
Register to an appointment.
getFirstAssignment()
get first assignment
showResponsibleUsersList($a_grp_id)
Show responsible uses of a milestone (default set is participants of group)
Confirmation screen class.
static bookAppointment($a_usr_id, $a_app_id)
Book an appointment.