4use Psr\Http\Message\RequestInterface;
5use Psr\Http\Message\ServerRequestInterface;
47 $this->lng =
$DIC->language();
48 $this->lng->loadLanguageModule(
'dateplaner');
49 $this->ctrl =
$DIC->ctrl();
50 $this->tpl =
$DIC->ui()->mainTemplate();
51 $this->logger =
$GLOBALS[
'DIC']->logger()->cal();
52 $this->request =
$DIC->http()->request();
67 $ilTabs =
$DIC[
'ilTabs'];
71 $ilTabs->clearTargets();
72 $ilTabs->setBackTarget(
73 $this->lng->txt(
'cal_back_to_cal'),
74 $this->ctrl->getLinkTarget($this,
'cancel')
77 $next_class = $this->ctrl->getNextClass($this);
78 switch ($next_class) {
81 $cmd = $this->ctrl->getCmd(
"add");
105 $this->ctrl->returnToParent($this);
115 protected function initForm($a_mode, $a_as_milestone =
false, $a_edit_single_app =
false)
124 include_once(
'./Services/YUI/classes/class.ilYuiUtil.php');
129 $this->ctrl->saveParameter($this, array(
'seed',
'idate'));
130 $this->form->setFormAction($this->ctrl->getFormAction($this));
131 if ($a_as_milestone) {
132 $this->form->setTitle($this->lng->txt(
'cal_new_ms'));
133 $this->form->addCommandButton(
'saveMilestone', $this->lng->txt(
'cal_add_milestone'));
134 $this->form->addCommandButton(
'cancel', $this->lng->txt(
'cancel'));
136 $this->form->setTitle($this->lng->txt(
'cal_new_app'));
137 $this->form->addCommandButton(
'save', $this->lng->txt(
'cal_add_appointment'));
138 $this->form->addCommandButton(
'cancel', $this->lng->txt(
'cancel'));
143 if ($a_as_milestone) {
144 $this->form->setTitle($this->lng->txt(
'cal_edit_milestone'));
146 $this->form->setTitle($this->lng->txt(
'cal_edit_appointment'));
148 $this->ctrl->saveParameter($this, array(
'seed',
'app_id',
'idate'));
149 $this->form->setFormAction($this->ctrl->getFormAction($this));
152 $cat = $ass->getFirstAssignment();
153 include_once(
'./Services/Calendar/classes/class.ilCalendarCategory.php');
159 $this->form->addCommandButton(
'editResponsibleUsers', $this->lng->txt(
'cal_change_responsible_users'));
161 $this->form->addCommandButton(
'update', $this->lng->txt(
'save'));
163 $this->form->addCommandButton(
'cancel', $this->lng->txt(
'cancel'));
168 $title->setValue($this->app->getTitle());
169 $title->setRequired(
true);
170 $title->setMaxLength(128);
172 $this->form->addItem($title);
175 $calendar =
new ilSelectInputGUI($this->lng->txt(
'cal_category_selection'),
'calendar');
177 $calendar->setValue((
int)
$_POST[
'calendar']);
178 $selected_calendar = (int)
$_POST[
'calendar'];
179 } elseif (
$_GET[
'category_id']) {
180 $calendar->setValue((
int)
$_GET[
'category_id']);
181 $selected_calendar = (int)
$_GET[
'category_id'];
182 } elseif ($a_mode ==
'edit') {
184 $cat = $ass->getFirstAssignment();
185 $calendar->setValue($cat);
186 $selected_calendar = $cat;
187 } elseif (isset(
$_GET[
'ref_id'])) {
188 include_once(
'./Services/Calendar/classes/class.ilCalendarCategories.php');
193 $cats->readSingleCalendar($selected_calendar);
196 $categories = $cats->prepareCategoriesOfUserForSelection();
197 $selected_calendar = key((array) $categories);
198 $calendar->setValue($selected_calendar);
200 $calendar->setRequired(
true);
202 $calendar->setOptions($cats->prepareCategoriesOfUserForSelection());
204 include_once
'./Services/Calendar/classes/class.ilCalendarSettings.php';
206 $notification_cals = $cats->getNotificationCalendars();
207 $notification_cals = count($notification_cals) ? implode(
',', $notification_cals) :
'';
208 $calendar->addCustomAttribute(
"onchange=\"ilToggleNotification([" . $notification_cals .
"]);\"");
210 $this->form->addItem($calendar);
212 if (!$a_as_milestone) {
213 include_once
'./Services/Form/classes/class.ilDateDurationInputGUI.php';
214 $tpl->addJavaScript(
'./Services/Form/js/date_duration.js');
216 $dur->setRequired(
true);
217 $dur->enableToggleFullTime(
218 $this->lng->txt(
'cal_fullday_title'),
219 $this->app->isFullday() ?
true :
false
221 $dur->setShowTime(
true);
222 $dur->setStart($this->app->getStart());
223 $dur->setEnd($this->app->getEnd());
224 $this->form->addItem($dur);
227 include_once(
'./Services/Calendar/classes/Form/class.ilRecurrenceInputGUI.php');
229 $rec->setRecurrence($this->rec);
230 $this->form->addItem(
$rec);
233 $where =
new ilTextInputGUI($this->lng->txt(
'cal_where'),
'location');
234 $where->setValue($this->app->getLocation());
235 $where->setMaxLength(128);
237 $this->form->addItem($where);
240 $deadline->setDate($this->app->getStart());
241 $deadline->setShowTime(
false);
242 $deadline->setMinuteStepSize(5);
243 $this->form->addItem($deadline);
246 $completion_vals = array();
247 for (
$i = 0;
$i <= 100;
$i += 5) {
248 $completion_vals[
$i] =
$i .
" %";
251 $this->lng->txt(
'cal_task_completion'),
254 $compl->setOptions($completion_vals);
255 $compl->setValue($this->app->getCompletion());
256 $this->form->addItem($compl);
260 $desc->setValue($this->app->getDescription());
262 $this->form->addItem($desc);
264 if ($a_as_milestone && $a_mode ==
"edit" && $resp_info) {
266 $users = $this->app->readResponsibleUsers();
269 foreach ($users as $r) {
270 $value .= $delim . $r[
"lastname"] .
", " . $r[
"firstname"] .
" [" . $r[
"login"] .
"]";
273 if (count($users) > 0) {
274 $resp->setValue($value);
276 $resp->setValue(
"-");
279 $this->form->addItem(
$resp);
285 $notu->setInfo($this->lng->txt(
'cal_user_notification_info'));
287 $notu->setMaxLength(64);
290 foreach ($this->
notification->getRecipients() as $rcp) {
291 switch ($rcp[
'type']) {
297 $values[] = $rcp[
'email'];
301 if (count($values)) {
302 $notu->setValues($values);
304 $notu->setValues(array(
''));
306 $this->form->addItem($notu);
310 include_once
'./Services/Calendar/classes/class.ilCalendarSettings.php';
320 $tpl->addJavaScript(
'./Services/Calendar/js/toggle_notification.js');
322 $not->setInfo($this->lng->txt(
'cal_notification_info'));
324 $not->setChecked($this->app->isNotificationEnabled());
325 $not->setDisabled($disabled);
326 $this->form->addItem($not);
342 $ilHelp =
$DIC->help();
344 $ilHelp->setScreenIdComponent(
"cal");
345 $ilHelp->setScreenId(
"app");
346 $ilHelp->setSubScreenId(
"create");
351 $this->tpl->setContent($this->form->getHTML());
365 $ilHelp =
$DIC[
'ilHelp'];
367 $ilHelp->setScreenIdComponent(
"cal");
368 $ilHelp->setScreenId(
"app");
369 $ilHelp->setSubScreenId(
"create_milestone");
372 $tpl->setContent($this->form->getHTML());
390 protected function save($a_as_milestone =
false)
396 $this->
load(
'create', $a_as_milestone);
398 if ($this->app->validate() and $this->notification->validate()) {
399 if (!(
int)
$_POST[
'calendar']) {
402 $cat_id = (int)
$_POST[
'calendar'];
406 $this->
notification->setEntryId($this->app->getEntryId());
408 $this->rec->setEntryId($this->app->getEntryId());
411 include_once(
'./Services/Calendar/classes/class.ilCalendarCategoryAssignments.php');
413 $ass->addAssignment($cat_id);
416 include_once
'./Services/Calendar/classes/class.ilCalendarSettings.php';
424 include_once(
'./Services/Calendar/classes/class.ilCalendarCategory.php');
430 ilUtil::sendSuccess($this->lng->txt(
'cal_created_milestone_resp_q'),
true);
432 } elseif ($a_as_milestone) {
433 ilUtil::sendSuccess($this->lng->txt(
'cal_created_milestone'),
true);
434 $this->ctrl->returnToParent($this);
436 ilUtil::sendSuccess($this->lng->txt(
'cal_created_appointment'),
true);
437 $this->ctrl->returnToParent($this);
440 $this->form->setValuesByPost();
442 return $this->
add($this->form);
444 if ($a_as_milestone) {
461 include_once
'./Services/Calendar/classes/class.ilCalendarMailNotification.php';
463 $notification->setAppointmentId($this->app->getEntryId());
465 foreach ($this->
notification->getRecipients() as $rcp) {
466 switch ($rcp[
'type']) {
469 $notification->setRecipients(array($rcp[
'usr_id']));
475 $notification->setRecipients(array($rcp[
'email']));
479 $notification->send();
490 include_once(
'./Services/Calendar/classes/class.ilCalendarCategory.php');
493 include_once
'./Services/Calendar/classes/class.ilCalendarMailNotification.php';
495 $notification->setAppointmentId($app_id);
497 switch ($cat_info[
'type']) {
500 switch ($cat_info[
'obj_type']) {
503 $ref_id = current($ref_ids);
504 $notification->setRefId($ref_id);
505 $notification->setType(
514 $ref_id = current($ref_ids);
515 $notification->setRefId($ref_id);
516 $notification->setType(
526 $notification->send();
534 include_once(
'./Services/Calendar/classes/class.ilCalendarCategoryAssignments.php');
536 include_once(
'./Services/Calendar/classes/class.ilCalendarCategory.php');
552 include_once(
"./Services/Calendar/classes/class.ilMilestoneResponsiblesTableGUI.php");
557 $this->app->getEntryId()
559 $tpl->setContent($table_gui->getHTML());
569 $ilCtrl =
$DIC[
'ilCtrl'];
571 $this->app->writeResponsibleUsers(
$_POST[
"user_id"]);
572 $ilCtrl->returnToParent($this);
582 include_once
'./Services/Calendar/classes/class.ilCalendarRecurrences.php';
585 return $this->
edit(
true);
588 $this->ctrl->saveParameter($this, array(
'seed',
'app_id',
'dt',
'idate'));
590 include_once(
'./Services/Utilities/classes/class.ilConfirmationGUI.php');
592 $confirm->setFormAction($this->ctrl->getFormAction($this));
593 #$confirm->setHeaderText($this->lng->txt('cal_edit_app_sure'));
594 $confirm->setCancel($this->lng->txt(
'cancel'),
'cancel');
595 $confirm->addItem(
'appointments[]', $this->app->getEntryId(), $this->app->getTitle());
596 $confirm->addButton($this->lng->txt(
'cal_edit_single'),
'editSingle');
597 $confirm->setConfirm($this->lng->txt(
'cal_edit_recurrences'),
'edit');
599 $GLOBALS[
'DIC'][
'tpl']->setContent($confirm->getHTML());
607 $_REQUEST[
'rexl'] = 1;
608 $GLOBALS[
'DIC'][
'ilCtrl']->setParameter($this,
'rexcl', 1);
627 $ilHelp =
$DIC[
'ilHelp'];
629 $ilHelp->setScreenIdComponent(
"cal");
630 $ilHelp->setScreenId(
"app");
631 if ($this->app->isMilestone()) {
632 $ilHelp->setSubScreenId(
"edit_milestone");
634 $ilHelp->setSubScreenId(
"edit");
637 include_once(
'./Services/Calendar/classes/class.ilCalendarCategory.php');
638 include_once(
'./Services/Calendar/classes/class.ilCalendarCategories.php');
639 include_once(
'./Services/Calendar/classes/class.ilCalendarCategoryAssignments.php');
641 $GLOBALS[
'DIC'][
'ilCtrl']->saveParameter($this, array(
'seed',
'app_id',
'dt',
'idate'));
643 if ($_REQUEST[
'rexl']) {
644 $GLOBALS[
'DIC'][
'ilCtrl']->setParameter($this,
'rexl', 1);
647 include_once
'./Services/Calendar/classes/class.ilCalendarRecurrenceCalculator.php';
652 $yesterday = clone $current_date;
654 $tomorrow = clone $current_date;
658 foreach ($calc->calculateDateList($current_date, $tomorrow, 1) as $date_entry) {
673 if (!$cats->isVisible($cat_id)) {
674 $ilErr->raiseError($this->lng->txt(
'permission_denied'),
$ilErr->WARNING);
677 if (!$cats->isEditable($cat_id) or $this->app->isAutoGenerated()) {
682 $this->
initForm(
'edit', $this->app->isMilestone(), $a_edit_single_app);
684 $tpl->setContent($this->form->getHTML());
700 include_once(
"./Services/InfoScreen/classes/class.ilInfoScreenGUI.php");
702 $info->setFormAction($this->ctrl->getFormAction($this));
704 if ($this->app->isMilestone()) {
705 $info->addSection($this->lng->txt(
'cal_ms_details'));
707 $info->addSection($this->lng->txt(
'cal_details'));
712 $this->lng->txt(
'appointment'),
714 $this->app->getStart(),
718 $info->addProperty($this->lng->txt(
'title'), $this->app->getPresentationTitle());
721 if (strlen($desc = $this->app->getDescription())) {
722 $info->addProperty($this->lng->txt(
'description'), $desc);
726 if (strlen($loc = $this->app->getLocation())) {
727 $info->addProperty($this->lng->txt(
'cal_where'), $loc);
731 if ($this->app->isMilestone() && $this->app->getCompletion() > 0) {
733 $this->lng->txt(
'cal_task_completion'),
734 $this->app->getCompletion() .
" %"
738 include_once(
'./Services/Calendar/classes/class.ilCalendarCategoryAssignments.php');
745 $users = $this->app->readResponsibleUsers();
747 foreach ($users as $r) {
748 $value .= $delim . $r[
"lastname"] .
", " . $r[
"firstname"] .
" [" . $r[
"login"] .
"]";
751 if (count($users) > 0) {
753 $this->lng->txt(
'cal_responsible'),
762 $info->addSection($this->lng->txt(
'additional_info'));
767 include_once(
'./Services/Link/classes/class.ilLink.php');
769 $info->addProperty($this->lng->txt(
'perma_link'),
'<a class="small" href="' . $href .
'" target="_top">' . $href .
'</a>');
772 $tpl->setContent($info->getHTML());
787 $single_editing = ($_REQUEST[
'rexl'] ?
true :
false);
789 $this->
load(
'edit', $this->app->isMilestone());
790 if ($this->app->validate() and $this->notification->validate()) {
791 if (!(
int)
$_POST[
'calendar']) {
794 $cat_id = (int)
$_POST[
'calendar'];
797 if ($single_editing) {
800 $selected_ut = (int) ($this->request->getQueryParams()[
'dt'] ?? 0);
801 if ($selected_ut > 0) {
803 $exclusion->setEntryId($original_id);
816 include_once(
'./Services/Calendar/classes/class.ilCalendarCategoryAssignments.php');
818 $this->logger->debug($this->app->getEntryId());
819 $ass->deleteAssignments();
820 $ass->addAssignment($cat_id);
823 include_once
'./Services/Calendar/classes/class.ilCalendarSettings.php';
831 ilUtil::sendSuccess($this->lng->txt(
'msg_obj_modified'),
true);
832 $this->ctrl->returnToParent($this);
834 $this->form->setValuesByPost();
837 $this->
edit(
false, $this->form);
852 $this->ctrl->saveParameter(
862 $app_id = (int) ($this->request->getQueryParams()[
'app_id'] ?? 0);
865 $this->ctrl->returnToParent($this);
872 !$this->app->isMilestone()
875 $confirm->setFormAction($this->ctrl->getFormAction($this));
876 $confirm->setHeaderText($this->lng->txt(
'cal_delete_app_sure'));
877 $confirm->setCancel($this->lng->txt(
'cancel'),
'cancel');
878 $confirm->addItem(
'appointments[]', $this->app->getEntryId(), $this->app->getTitle());
879 $confirm->setConfirm($this->lng->txt(
'delete'),
'delete');
880 $this->tpl->setContent($confirm->getHTML());
889 $this->tpl->setContent($table->getHTML());
902 protected function delete()
904 $app_ids = (array) ($this->request->getParsedBody()[
'appointment_ids'] ?? []);
906 $this->logger->dump($app_ids);
907 $app_ids = (array) ($this->request->getQueryParams()[
'app_id'] ?? []);
910 $this->ctrl->returnToParent($this);
912 foreach ($app_ids as $app_id) {
916 include_once(
'./Services/Calendar/classes/class.ilCalendarCategoryAssignments.php');
919 include_once
'./Services/Calendar/classes/class.ilCalendarUserNotification.php';
922 ilUtil::sendSuccess($this->lng->txt(
'cal_deleted_app'),
true);
923 $this->ctrl->returnToParent($this);
935 $recurrence_ids = (array) ($this->request->getParsedBody()[
'recurrence_ids'] ?? []);
936 $app_id = (int) ($this->request->getQueryParams()[
'app_id'] ?? 0);
937 if (!count($recurrence_ids)) {
939 $this->ctrl->redirect($this,
'askDelete');
942 $this->ctrl->returnToParent($this);
944 foreach ($recurrence_ids as $rdate) {
946 $exclusion->setEntryId($app_id);
951 ilUtil::sendSuccess($this->lng->txt(
'cal_deleted_app'),
true);
952 $this->ctrl->returnToParent($this);
969 $this->timezone =
$ilUser->getTimeZone();
978 if (!isset(
$_GET[
'hour'])) {
980 $this->default_fulltime =
true;
982 if ((
int)
$_GET[
'hour'] < 10) {
983 $time =
'0' . (int)
$_GET[
'hour'] .
':00:00';
985 $time = (int)
$_GET[
'hour'] .
':00:00';
988 $this->default_fulltime =
false;
1001 $this->seed = clone
$seed;
1002 $this->default_fulltime =
true;
1014 include_once(
'./Services/Calendar/classes/class.ilCalendarEntry.php');
1015 include_once(
'./Services/Calendar/classes/class.ilCalendarRecurrences.php');
1018 include_once
'./Services/Calendar/classes/class.ilCalendarUserNotification.php';
1023 $this->app->setStart($start);
1026 if ($this->default_fulltime) {
1027 #$seed_end->increment(IL_CAL_DAY,1);
1031 $this->app->setEnd($seed_end);
1032 $this->app->setFullday($this->default_fulltime);
1047 protected function load($a_mode, $a_as_milestone =
false)
1050 $this->
initForm($a_mode, $a_as_milestone);
1051 $this->form->checkInput();
1053 if ($a_as_milestone) {
1054 $this->app->setMilestone(
true);
1062 $this->app->enableNotification((
int)
$_POST[
'not']);
1064 if ($a_as_milestone) {
1065 $start = $this->form->getItemByPostVar(
'event_start');
1066 $start = $start->getDate();
1068 $this->app->setFullday(
true);
1071 $this->app->setStart($start);
1072 $this->app->setEnd($start);
1074 $period = $this->form->getItemByPostVar(
'event');
1075 $start = $period->getStart();
1076 $end = $period->getEnd();
1078 $this->app->setFullday($start instanceof
ilDate);
1079 $this->app->setStart($start);
1080 $this->app->setEnd($end);
1091 foreach ((array)
$_POST[
'notu'] as $rcp) {
1095 if (strlen($rcp) == 0) {
1122 $this->rec->reset();
1124 switch (
$_POST[
'frequence']) {
1126 $this->rec->setFrequenceType(
$_POST[
'frequence']);
1127 $this->rec->setInterval((
int)
$_POST[
'count_DAILY']);
1131 $this->rec->setFrequenceType(
$_POST[
'frequence']);
1132 $this->rec->setInterval((
int)
$_POST[
'count_WEEKLY']);
1133 if (is_array(
$_POST[
'byday_WEEKLY'])) {
1139 $this->rec->setFrequenceType(
$_POST[
'frequence']);
1140 $this->rec->setInterval((
int)
$_POST[
'count_MONTHLY']);
1141 switch ((
int)
$_POST[
'subtype_MONTHLY']) {
1147 switch ((
int)
$_POST[
'monthly_byday_day']) {
1150 $this->rec->setBYSETPOS((
int)
$_POST[
'monthly_byday_num']);
1151 $this->rec->setBYDAY(
'MO,TU,WE,TH,FR');
1156 $this->rec->setBYMONTHDAY((
int)
$_POST[
'monthly_byday_num']);
1160 $this->rec->setBYDAY((
int)
$_POST[
'monthly_byday_num'] .
$_POST[
'monthly_byday_day']);
1166 $this->rec->setBYMONTHDAY((
int)
$_POST[
'monthly_bymonthday']);
1172 $this->rec->setFrequenceType(
$_POST[
'frequence']);
1173 $this->rec->setInterval((
int)
$_POST[
'count_YEARLY']);
1174 switch ((
int)
$_POST[
'subtype_YEARLY']) {
1180 $this->rec->setBYMONTH((
int)
$_POST[
'yearly_bymonth_byday']);
1181 $this->rec->setBYDAY((
int)
$_POST[
'yearly_byday_num'] .
$_POST[
'yearly_byday']);
1185 $this->rec->setBYMONTH((
int)
$_POST[
'yearly_bymonth_by_monthday']);
1186 $this->rec->setBYMONTHDAY((
int)
$_POST[
'yearly_bymonthday']);
1193 switch ((
int)
$_POST[
'until_type']) {
1195 $this->rec->setFrequenceUntilDate(
null);
1200 $this->rec->setFrequenceUntilDate(
null);
1201 $this->rec->setFrequenceUntilCount((
int)
$_POST[
'count']);
1206 $dt->setRequired(
true);
1207 if ($dt->checkInput()) {
1208 $this->rec->setFrequenceUntilCount(0);
1209 $this->rec->setFrequenceUntilDate($dt->getDate());
1224 switch (
$_POST[
'frequence']) {
1228 if ($this->rec->getRecurrenceId()) {
1229 $this->rec->delete();
1234 if ($this->rec->getRecurrenceId()) {
1235 $this->rec->update();
1259 $cat->setTitle($this->lng->txt(
'cal_default_calendar'));
1260 $cat->setObjId(
$ilUser->getId());
1263 include_once
'./Services/Calendar/classes/class.ilCalendarCache.php';
1286 include_once
'Services/Utilities/classes/class.ilConfirmationGUI.php';
1289 $this->ctrl->setParameter($this,
'dstart', (
int) $_REQUEST[
'dstart']);
1290 $this->ctrl->setParameter($this,
'dend', (
int) $_REQUEST[
'dend']);
1293 $conf->setHeaderText($this->lng->txt(
'cal_confirm_reg_info'));
1294 $conf->setConfirm($this->lng->txt(
'cal_reg_register'),
'register');
1295 $conf->setCancel($this->lng->txt(
'cancel'),
'cancel');
1296 $conf->addItem(
'app_id', $entry->getEntryId(), $entry->getTitle() .
' (' . $start .
')');
1298 $tpl->setContent($conf->getHTML());
1305 protected function register()
1311 include_once
'./Services/Calendar/classes/class.ilCalendarRegistration.php';
1319 ilUtil::sendSuccess($this->lng->txt(
'cal_reg_registered'),
true);
1320 $this->ctrl->returnToParent($this);
1340 include_once
'Services/Utilities/classes/class.ilConfirmationGUI.php';
1343 $this->ctrl->setParameter($this,
'dstart', (
int) $_REQUEST[
'dstart']);
1344 $this->ctrl->setParameter($this,
'dend', (
int) $_REQUEST[
'dend']);
1347 $conf->setHeaderText($this->lng->txt(
'cal_confirm_unreg_info'));
1348 $conf->setConfirm($this->lng->txt(
'cal_reg_unregister'),
'unregister');
1349 $conf->setCancel($this->lng->txt(
'cancel'),
'cancel');
1350 $conf->addItem(
'app_id', $entry->getEntryId(), $entry->getTitle() .
' (' . $start .
')');
1352 $tpl->setContent($conf->getHTML());
1365 include_once
'./Services/Calendar/classes/class.ilCalendarRegistration.php';
1373 ilUtil::sendSuccess($this->lng->txt(
'cal_reg_unregistered'),
true);
1374 $this->ctrl->returnToParent($this);
1387 $entry_id = (int)
$_GET[
'app_id'];
1388 $this->ctrl->saveParameter($this,
'app_id');
1390 include_once
'Services/Calendar/classes/class.ilCalendarEntry.php';
1391 include_once
'Services/Booking/classes/class.ilBookingEntry.php';
1393 $booking = new \ilBookingEntry($entry->getContextId());
1394 $user = $booking->getObjId();
1401 $tpl->setContent($form->getHTML());
1411 include_once
'./Services/Form/classes/class.ilPropertyFormGUI.php';
1413 $form->setFormAction($this->ctrl->getFormAction($this));
1414 $form->addCommandButton(
'bookconfirmed', $this->lng->txt(
'cal_confirm_booking'));
1415 $form->addCommandButton(
'cancel', $this->lng->txt(
'cancel'));
1418 $form->addItem($date);
1421 $form->addItem($title);
1439 $entry = (int) $_REQUEST[
'app_id'];
1441 if ($form->checkInput()) {
1443 include_once
'./Services/Calendar/classes/class.ilCalendarEntry.php';
1446 include_once
'./Services/Booking/classes/class.ilBookingEntry.php';
1449 if (!$booking->isAppointmentBookableForUser($entry,
$GLOBALS[
'DIC'][
'ilUser']->getId())) {
1451 $this->ctrl->returnToParent($this);
1454 include_once
'./Services/Calendar/classes/ConsultationHours/class.ilConsultationHourUtils.php';
1457 include_once
'./Services/Booking/classes/class.ilBookingEntry.php';
1460 ilUtil::sendSuccess($this->lng->txt(
'cal_booking_confirmed'),
true);
1461 $this->ctrl->returnToParent($this);
1475 $entry = (int)
$_GET[
'app_id'];
1477 include_once
'Services/Calendar/classes/class.ilCalendarEntry.php';
1482 include_once
'Services/Booking/classes/class.ilBookingEntry.php';
1484 if (!$booking->hasBooked($entry->getEntryId())) {
1485 $this->ctrl->returnToParent($this);
1491 $entry_title =
' ' . $entry->getTitle();
1493 $this->ctrl->returnToParent($this);
1499 include_once
'Services/Utilities/classes/class.ilConfirmationGUI.php';
1502 $conf->setHeaderText($this->lng->txt(
'cal_cancel_booking_info'));
1503 $conf->setConfirm($this->lng->txt(
'cal_cancel_booking'),
'cancelconfirmed');
1504 $conf->setCancel($this->lng->txt(
'cancel'),
'cancel');
1505 $conf->addItem(
'app_id', $entry->getEntryId(), $title .
' - ' . $entry_title);
1507 $tpl->setContent($conf->getHTML());
1520 $entry = (int)
$_POST[
'app_id'];
1522 include_once
'Services/Calendar/classes/class.ilCalendarEntry.php';
1528 include_once
'Services/Calendar/classes/ConsultationHours/class.ilConsultationHourAppointments.php';
1531 $entry->getContextId(),
1538 foreach ((array) $apps as $own_app) {
1540 $ref_entry->delete();
1543 include_once
'Services/Booking/classes/class.ilBookingEntry.php';
1545 $booking->cancelBooking($entry->getEntryId());
1556 ilUtil::sendSuccess($this->lng->txt(
'cal_cancel_booking_confirmed'),
true);
1557 $this->ctrl->returnToParent($this);
1567 include_once
'Services/Calendar/classes/class.ilCalendarCategoryAssignments.php';
1568 include_once
'Services/Calendar/classes/class.ilCalendarCategory.php';
1570 $assignment = $assignment->getFirstAssignment();
1580 if (!isset(
$_GET[
'autoCompleteField'])) {
1581 $a_fields = array(
'login',
'firstname',
'lastname',
'email');
1583 $a_fields = array((
string)
$_GET[
'autoCompleteField']);
1586 include_once
'./Services/User/classes/class.ilUserAutoComplete.php';
1588 $auto->setSearchFields($a_fields);
1589 $auto->enableFieldSearchableCheck(
true);
1590 $auto->setMoreLinkAvailable(
true);
1592 if (($_REQUEST[
'fetchall'])) {
1596 echo $auto->getList($_REQUEST[
'query']);
if(!defined('PATH_SEPARATOR')) $GLOBALS['_PEAR_default_error_mode']
An exception for terminatinating execution or to throw for unit testing.
const IL_CAL_FREQ_MONTHLY
return true
Flag indicating whether or not HTTP headers will be sent when outputting captcha image/audio.
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)
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.
load($a_mode, $a_as_milestone=false)
load post
loadRecurrenceSettings($a_as_milestone=false)
load recurrence settings
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
createDefaultCalendar()
Create a default calendar.
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()
add(ilPropertyFormGUI $form=null)
add new appointment
save($a_as_milestone=false)
save appointment
saveMilestoneResponsibleUsers()
Save milestone responsibilites.
getAppointment()
Get current appointment.
edit($a_edit_single_app=false, ilPropertyFormGUI $form=null)
edit 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.
Class ilCalendarRecurrenceTableGUI.
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 formatDate(ilDateTime $date, $a_skip_day=false, $a_include_wd=false, $include_seconds=false)
Format a date @access public.
static formatPeriod(ilDateTime $start, ilDateTime $end, $a_skip_starting_day=false)
Format a period of two date Shows: 14.
@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
static _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 sendQuestion($a_info="", $a_keep=false)
Send Question to Screen.
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
static initDomEvent(ilGlobalTemplateInterface $a_main_tpl=null)
Init YUI DomEvent.
const IL_CAL_FREQ_DAILY
Model of calendar entry recurrcences.