46 $lng->loadLanguageModule(
'dateplaner');
49 $this->logger =
$GLOBALS[
'DIC']->logger()->cal();
71 $ilTabs =
$DIC[
'ilTabs'];
75 $ilTabs->clearTargets();
76 $ilTabs->setBackTarget(
77 $this->lng->txt(
'cal_back_to_cal'),
78 $this->ctrl->getLinkTarget($this,
'cancel')
81 $next_class = $this->ctrl->getNextClass($this);
82 switch ($next_class) {
85 $cmd = $this->ctrl->getCmd(
"add");
110 $this->ctrl->returnToParent($this);
120 protected function initForm($a_mode, $a_as_milestone =
false, $a_edit_single_app =
false)
129 include_once(
'./Services/YUI/classes/class.ilYuiUtil.php');
134 $this->ctrl->saveParameter($this, array(
'seed',
'idate'));
135 $this->form->setFormAction($this->ctrl->getFormAction($this));
136 if ($a_as_milestone) {
137 $this->form->setTitle($this->lng->txt(
'cal_new_ms'));
138 $this->form->addCommandButton(
'saveMilestone', $this->lng->txt(
'cal_add_milestone'));
139 $this->form->addCommandButton(
'cancel', $this->lng->txt(
'cancel'));
141 $this->form->setTitle($this->lng->txt(
'cal_new_app'));
142 $this->form->addCommandButton(
'save', $this->lng->txt(
'cal_add_appointment'));
143 $this->form->addCommandButton(
'cancel', $this->lng->txt(
'cancel'));
148 if ($a_as_milestone) {
149 $this->form->setTitle($this->lng->txt(
'cal_edit_milestone'));
151 $this->form->setTitle($this->lng->txt(
'cal_edit_appointment'));
153 $this->ctrl->saveParameter($this, array(
'seed',
'app_id',
'idate'));
154 $this->form->setFormAction($this->ctrl->getFormAction($this));
157 $cat = $ass->getFirstAssignment();
158 include_once(
'./Services/Calendar/classes/class.ilCalendarCategory.php');
164 $this->form->addCommandButton(
'editResponsibleUsers', $this->lng->txt(
'cal_change_responsible_users'));
166 $this->form->addCommandButton(
'update', $this->lng->txt(
'save'));
168 $this->form->addCommandButton(
'cancel', $this->lng->txt(
'cancel'));
173 $title->setValue($this->app->getTitle());
174 $title->setRequired(
true);
175 $title->setMaxLength(128);
177 $this->form->addItem(
$title);
183 $selected_calendar = (int)
$_POST[
'calendar'];
184 } elseif (
$_GET[
'category_id']) {
186 $selected_calendar = (int)
$_GET[
'category_id'];
187 } elseif ($a_mode ==
'edit') {
189 $cat = $ass->getFirstAssignment();
191 $selected_calendar = $cat;
192 } elseif (isset(
$_GET[
'ref_id'])) {
193 include_once(
'./Services/Calendar/classes/class.ilCalendarCategories.php');
198 $cats->readSingleCalendar($selected_calendar);
201 $categories = $cats->prepareCategoriesOfUserForSelection();
202 $selected_calendar = key((array) $categories);
207 $calendar->setOptions($cats->prepareCategoriesOfUserForSelection());
209 include_once
'./Services/Calendar/classes/class.ilCalendarSettings.php';
211 $notification_cals = $cats->getNotificationCalendars();
212 $notification_cals = count($notification_cals) ? implode(
',', $notification_cals) :
'';
213 $calendar->addCustomAttribute(
"onchange=\"ilToggleNotification([" . $notification_cals .
"]);\"");
217 if (!$a_as_milestone) {
218 include_once
'./Services/Form/classes/class.ilDateDurationInputGUI.php';
219 $tpl->addJavaScript(
'./Services/Form/js/date_duration.js');
221 $dur->setRequired(
true);
222 $dur->enableToggleFullTime(
223 $this->lng->txt(
'cal_fullday_title'),
224 $this->app->isFullday() ?
true :
false
226 $dur->setShowTime(
true);
227 $dur->setStart($this->app->getStart());
228 $dur->setEnd($this->app->getEnd());
229 $this->form->addItem($dur);
232 include_once(
'./Services/Calendar/classes/Form/class.ilRecurrenceInputGUI.php');
234 $rec->setRecurrence($this->rec);
235 $this->form->addItem(
$rec);
238 $where =
new ilTextInputGUI($this->lng->txt(
'cal_where'),
'location');
239 $where->setValue($this->app->getLocation());
240 $where->setMaxLength(128);
242 $this->form->addItem($where);
245 $deadline->setDate($this->app->getStart());
246 $deadline->setShowTime(
false);
247 $deadline->setMinuteStepSize(5);
248 $this->form->addItem($deadline);
251 $completion_vals = array();
252 for (
$i = 0;
$i <= 100;
$i += 5) {
253 $completion_vals[
$i] =
$i .
" %";
256 $this->lng->txt(
'cal_task_completion'),
259 $compl->setOptions($completion_vals);
260 $compl->setValue($this->app->getCompletion());
261 $this->form->addItem($compl);
265 $desc->setValue($this->app->getDescription());
267 $this->form->addItem($desc);
269 if ($a_as_milestone && $a_mode ==
"edit" && $resp_info) {
271 $users = $this->app->readResponsibleUsers();
275 $value .= $delim .
$r[
"lastname"] .
", " .
$r[
"firstname"] .
" [" .
$r[
"login"] .
"]";
279 $resp->setValue($value);
281 $resp->setValue(
"-");
284 $this->form->addItem($resp);
290 $notu->setInfo($this->lng->txt(
'cal_user_notification_info'));
292 $notu->setMaxLength(64);
295 foreach ($this->
notification->getRecipients() as $rcp) {
296 switch ($rcp[
'type']) {
309 $notu->setValues(array(
''));
311 $this->form->addItem($notu);
315 include_once
'./Services/Calendar/classes/class.ilCalendarSettings.php';
325 $tpl->addJavaScript(
'./Services/Calendar/js/toggle_notification.js');
327 $not->setInfo($this->lng->txt(
'cal_notification_info'));
329 $not->setChecked($this->app->isNotificationEnabled());
330 $not->setDisabled($disabled);
331 $this->form->addItem($not);
348 $ilHelp =
$DIC[
'ilHelp'];
350 $ilHelp->setScreenIdComponent(
"cal");
351 $ilHelp->setScreenId(
"app");
352 $ilHelp->setSubScreenId(
"create");
357 $tpl->setContent($this->form->getHTML());
371 $ilHelp =
$DIC[
'ilHelp'];
373 $ilHelp->setScreenIdComponent(
"cal");
374 $ilHelp->setScreenId(
"app");
375 $ilHelp->setSubScreenId(
"create_milestone");
378 $tpl->setContent($this->form->getHTML());
396 protected function save($a_as_milestone =
false)
402 $this->
load(
'create', $a_as_milestone);
404 if ($this->app->validate() and $this->notification->validate()) {
405 if (!(
int)
$_POST[
'calendar']) {
408 $cat_id = (int)
$_POST[
'calendar'];
412 $this->
notification->setEntryId($this->app->getEntryId());
414 $this->rec->setEntryId($this->app->getEntryId());
417 include_once(
'./Services/Calendar/classes/class.ilCalendarCategoryAssignments.php');
419 $ass->addAssignment($cat_id);
422 include_once
'./Services/Calendar/classes/class.ilCalendarSettings.php';
430 include_once(
'./Services/Calendar/classes/class.ilCalendarCategory.php');
436 ilUtil::sendSuccess($this->lng->txt(
'cal_created_milestone_resp_q'),
true);
438 } elseif ($a_as_milestone) {
439 ilUtil::sendSuccess($this->lng->txt(
'cal_created_milestone'),
true);
440 $this->ctrl->returnToParent($this);
442 ilUtil::sendSuccess($this->lng->txt(
'cal_created_appointment'),
true);
443 $this->ctrl->returnToParent($this);
446 $this->form->setValuesByPost();
448 return $this->
add($this->form);
450 if ($a_as_milestone) {
467 include_once
'./Services/Calendar/classes/class.ilCalendarMailNotification.php';
469 $notification->setAppointmentId($this->app->getEntryId());
471 foreach ($this->
notification->getRecipients() as $rcp) {
472 switch ($rcp[
'type']) {
474 $notification->setSender(ANONYMOUS_USER_ID);
475 $notification->setRecipients(array($rcp[
'usr_id']));
480 $notification->setSender(ANONYMOUS_USER_ID);
481 $notification->setRecipients(array($rcp[
'email']));
485 $notification->send();
496 include_once(
'./Services/Calendar/classes/class.ilCalendarCategory.php');
499 include_once
'./Services/Calendar/classes/class.ilCalendarMailNotification.php';
501 $notification->setAppointmentId($app_id);
503 switch ($cat_info[
'type']) {
506 switch ($cat_info[
'obj_type']) {
509 $ref_id = current($ref_ids);
510 $notification->setRefId($ref_id);
511 $notification->setType(
520 $ref_id = current($ref_ids);
521 $notification->setRefId($ref_id);
522 $notification->setType(
532 $notification->send();
540 include_once(
'./Services/Calendar/classes/class.ilCalendarCategoryAssignments.php');
542 include_once(
'./Services/Calendar/classes/class.ilCalendarCategory.php');
558 include_once(
"./Services/Calendar/classes/class.ilMilestoneResponsiblesTableGUI.php");
563 $this->app->getEntryId()
565 $tpl->setContent($table_gui->getHTML());
577 $this->app->writeResponsibleUsers(
$_POST[
"user_id"]);
578 $ilCtrl->returnToParent($this);
588 include_once
'./Services/Calendar/classes/class.ilCalendarRecurrences.php';
591 return $this->
edit(
true);
594 $this->ctrl->saveParameter($this, array(
'seed',
'app_id',
'dt',
'idate'));
596 include_once(
'./Services/Utilities/classes/class.ilConfirmationGUI.php');
598 $confirm->setFormAction($this->ctrl->getFormAction($this));
599 #$confirm->setHeaderText($this->lng->txt('cal_edit_app_sure'));
600 $confirm->setCancel($this->lng->txt(
'cancel'),
'cancel');
601 $confirm->addItem(
'appointments[]', $this->app->getEntryId(), $this->app->getTitle());
602 $confirm->addButton($this->lng->txt(
'cal_edit_single'),
'editSingle');
603 $confirm->setConfirm($this->lng->txt(
'cal_edit_recurrences'),
'edit');
605 $GLOBALS[
'DIC'][
'tpl']->setContent($confirm->getHTML());
613 $_REQUEST[
'rexl'] = 1;
614 $GLOBALS[
'DIC'][
'ilCtrl']->setParameter($this,
'rexcl', 1);
633 $ilHelp =
$DIC[
'ilHelp'];
635 $ilHelp->setScreenIdComponent(
"cal");
636 $ilHelp->setScreenId(
"app");
637 if ($this->app->isMilestone()) {
638 $ilHelp->setSubScreenId(
"edit_milestone");
640 $ilHelp->setSubScreenId(
"edit");
643 include_once(
'./Services/Calendar/classes/class.ilCalendarCategory.php');
644 include_once(
'./Services/Calendar/classes/class.ilCalendarCategories.php');
645 include_once(
'./Services/Calendar/classes/class.ilCalendarCategoryAssignments.php');
647 $GLOBALS[
'DIC'][
'ilCtrl']->saveParameter($this, array(
'seed',
'app_id',
'dt',
'idate'));
649 if ($_REQUEST[
'rexl']) {
650 $GLOBALS[
'DIC'][
'ilCtrl']->setParameter($this,
'rexl', 1);
654 include_once
'./Services/Calendar/classes/class.ilCalendarRecurrenceCalculator.php';
659 $yesterday = clone $current_date;
661 $tomorrow = clone $current_date;
665 foreach ($calc->calculateDateList($current_date, $tomorrow, 1) as $date_entry) {
680 if (!$cats->isVisible($cat_id)) {
681 $ilErr->raiseError($this->lng->txt(
'permission_denied'),
$ilErr->WARNING);
684 if (!$cats->isEditable($cat_id) or $this->app->isAutoGenerated()) {
689 $this->
initForm(
'edit', $this->app->isMilestone(), $a_edit_single_app);
691 $tpl->setContent($this->form->getHTML());
707 include_once(
"./Services/InfoScreen/classes/class.ilInfoScreenGUI.php");
709 $info->setFormAction($this->ctrl->getFormAction($this));
711 if ($this->app->isMilestone()) {
712 $info->addSection($this->lng->txt(
'cal_ms_details'));
714 $info->addSection($this->lng->txt(
'cal_details'));
719 $this->lng->txt(
'appointment'),
721 $this->app->getStart(),
725 $info->addProperty($this->lng->txt(
'title'), $this->app->getPresentationTitle());
728 if (strlen($desc = $this->app->getDescription())) {
729 $info->addProperty($this->lng->txt(
'description'), $desc);
733 if (strlen($loc = $this->app->getLocation())) {
734 $info->addProperty($this->lng->txt(
'cal_where'), $loc);
738 if ($this->app->isMilestone() && $this->app->getCompletion() > 0) {
740 $this->lng->txt(
'cal_task_completion'),
741 $this->app->getCompletion() .
" %"
745 include_once(
'./Services/Calendar/classes/class.ilCalendarCategoryAssignments.php');
752 $users = $this->app->readResponsibleUsers();
755 $value .= $delim .
$r[
"lastname"] .
", " .
$r[
"firstname"] .
" [" .
$r[
"login"] .
"]";
760 $this->lng->txt(
'cal_responsible'),
769 $info->addSection($this->lng->txt(
'additional_info'));
774 include_once(
'./Services/Link/classes/class.ilLink.php');
776 $info->addProperty($this->lng->txt(
'perma_link'),
'<a class="small" href="' . $href .
'" target="_top">' . $href .
'</a>');
794 $single_editing = ($_REQUEST[
'rexl'] ? true :
false);
796 $this->
load(
'edit', $this->app->isMilestone());
798 if ($this->app->validate() and $this->notification->validate()) {
799 if (!(
int)
$_POST[
'calendar']) {
802 $cat_id = (int)
$_POST[
'calendar'];
805 if ($single_editing) {
818 include_once(
'./Services/Calendar/classes/class.ilCalendarCategoryAssignments.php');
820 $this->logger->debug($this->app->getEntryId());
821 $ass->deleteAssignments();
822 $ass->addAssignment($cat_id);
825 include_once
'./Services/Calendar/classes/class.ilCalendarSettings.php';
833 ilUtil::sendSuccess($this->lng->txt(
'msg_obj_modified'),
true);
834 $this->ctrl->returnToParent($this);
836 $this->form->setValuesByPost();
839 $this->
edit(
false, $this->form);
854 include_once(
'./Services/Utilities/classes/class.ilConfirmationGUI.php');
856 $this->ctrl->saveParameter($this, array(
'seed',
'app_id',
'dt',
'idate'));
859 $confirm->setFormAction($this->ctrl->getFormAction($this));
860 $confirm->setHeaderText($this->lng->txt(
'cal_delete_app_sure'));
861 $confirm->setCancel($this->lng->txt(
'cancel'),
'cancel');
862 $confirm->addItem(
'appointments[]', $this->app->getEntryId(), $this->app->getTitle());
864 include_once(
'./Services/Calendar/classes/class.ilCalendarRecurrences.php');
866 && !$this->app->isMilestone()) {
867 $confirm->addButton($this->lng->txt(
'cal_delete_single'),
'deleteexclude');
868 $confirm->setConfirm($this->lng->txt(
'cal_delete_recurrences'),
'delete');
870 $confirm->setConfirm($this->lng->txt(
'delete'),
'delete');
873 $tpl->setContent($confirm->getHTML());
883 protected function delete()
885 foreach (
$_POST[
'appointments'] as $app_id) {
889 include_once(
'./Services/Calendar/classes/class.ilCalendarCategoryAssignments.php');
892 include_once
'./Services/Calendar/classes/class.ilCalendarUserNotification.php';
895 ilUtil::sendSuccess($this->lng->txt(
'cal_deleted_app'),
true);
896 $this->ctrl->returnToParent($this);
908 include_once(
'./Services/Calendar/classes/class.ilCalendarRecurrenceExclusion.php');
910 $excl->setEntryId($_REQUEST[
'app_id']);
915 ilUtil::sendSuccess($this->lng->txt(
'cal_deleted_app'),
true);
916 $this->ctrl->returnToParent($this);
933 $this->timezone =
$ilUser->getTimeZone();
942 if (!isset(
$_GET[
'hour'])) {
944 $this->default_fulltime =
true;
946 if ((
int)
$_GET[
'hour'] < 10) {
952 $this->default_fulltime =
false;
965 $this->seed = clone
$seed;
966 $this->default_fulltime =
true;
978 include_once(
'./Services/Calendar/classes/class.ilCalendarEntry.php');
979 include_once(
'./Services/Calendar/classes/class.ilCalendarRecurrences.php');
982 include_once
'./Services/Calendar/classes/class.ilCalendarUserNotification.php';
987 $this->app->setStart(
$start);
990 if ($this->default_fulltime) {
991 #$seed_end->increment(IL_CAL_DAY,1);
995 $this->app->setEnd($seed_end);
996 $this->app->setFullday($this->default_fulltime);
1011 protected function load($a_mode, $a_as_milestone =
false)
1014 $this->
initForm($a_mode, $a_as_milestone);
1015 $this->form->checkInput();
1017 if ($a_as_milestone) {
1018 $this->app->setMilestone(
true);
1026 $this->app->enableNotification((
int)
$_POST[
'not']);
1028 if ($a_as_milestone) {
1029 $start = $this->form->getItemByPostVar(
'event_start');
1032 $this->app->setFullday(
true);
1035 $this->app->setStart(
$start);
1036 $this->app->setEnd(
$start);
1038 $period = $this->form->getItemByPostVar(
'event');
1039 $start = $period->getStart();
1040 $end = $period->getEnd();
1043 $this->app->setStart(
$start);
1044 $this->app->setEnd(
$end);
1055 foreach ((array)
$_POST[
'notu'] as $rcp) {
1059 if (strlen($rcp) == 0) {
1086 $this->rec->reset();
1088 switch (
$_POST[
'frequence']) {
1090 $this->rec->setFrequenceType(
$_POST[
'frequence']);
1091 $this->rec->setInterval((
int)
$_POST[
'count_DAILY']);
1095 $this->rec->setFrequenceType(
$_POST[
'frequence']);
1096 $this->rec->setInterval((
int)
$_POST[
'count_WEEKLY']);
1097 if (is_array(
$_POST[
'byday_WEEKLY'])) {
1103 $this->rec->setFrequenceType(
$_POST[
'frequence']);
1104 $this->rec->setInterval((
int)
$_POST[
'count_MONTHLY']);
1105 switch ((
int)
$_POST[
'subtype_MONTHLY']) {
1111 switch ((
int)
$_POST[
'monthly_byday_day']) {
1114 $this->rec->setBYSETPOS((
int)
$_POST[
'monthly_byday_num']);
1115 $this->rec->setBYDAY(
'MO,TU,WE,TH,FR');
1120 $this->rec->setBYMONTHDAY((
int)
$_POST[
'monthly_byday_num']);
1124 $this->rec->setBYDAY((
int)
$_POST[
'monthly_byday_num'] .
$_POST[
'monthly_byday_day']);
1130 $this->rec->setBYMONTHDAY((
int)
$_POST[
'monthly_bymonthday']);
1136 $this->rec->setFrequenceType(
$_POST[
'frequence']);
1137 $this->rec->setInterval((
int)
$_POST[
'count_YEARLY']);
1138 switch ((
int)
$_POST[
'subtype_YEARLY']) {
1144 $this->rec->setBYMONTH((
int)
$_POST[
'yearly_bymonth_byday']);
1145 $this->rec->setBYDAY((
int)
$_POST[
'yearly_byday_num'] .
$_POST[
'yearly_byday']);
1149 $this->rec->setBYMONTH((
int)
$_POST[
'yearly_bymonth_by_monthday']);
1150 $this->rec->setBYMONTHDAY((
int)
$_POST[
'yearly_bymonthday']);
1157 switch ((
int)
$_POST[
'until_type']) {
1159 $this->rec->setFrequenceUntilDate(
null);
1164 $this->rec->setFrequenceUntilDate(
null);
1165 $this->rec->setFrequenceUntilCount((
int)
$_POST[
'count']);
1170 $dt->setRequired(
true);
1171 if ($dt->checkInput()) {
1172 $this->rec->setFrequenceUntilCount(0);
1173 $this->rec->setFrequenceUntilDate($dt->getDate());
1188 switch (
$_POST[
'frequence']) {
1192 if ($this->rec->getRecurrenceId()) {
1193 $this->rec->delete();
1198 if ($this->rec->getRecurrenceId()) {
1199 $this->rec->update();
1223 $cat->setTitle($this->lng->txt(
'cal_default_calendar'));
1224 $cat->setObjId(
$ilUser->getId());
1227 include_once
'./Services/Calendar/classes/class.ilCalendarCache.php';
1250 include_once
'Services/Utilities/classes/class.ilConfirmationGUI.php';
1253 $this->ctrl->setParameter($this,
'dstart', (
int) $_REQUEST[
'dstart']);
1254 $this->ctrl->setParameter($this,
'dend', (
int) $_REQUEST[
'dend']);
1257 $conf->setHeaderText($this->lng->txt(
'cal_confirm_reg_info'));
1258 $conf->setConfirm($this->lng->txt(
'cal_reg_register'),
'register');
1259 $conf->setCancel($this->lng->txt(
'cancel'),
'cancel');
1260 $conf->addItem(
'app_id', $entry->getEntryId(), $entry->getTitle() .
' (' .
$start .
')');
1262 $tpl->setContent($conf->getHTML());
1269 protected function register()
1275 include_once
'./Services/Calendar/classes/class.ilCalendarRegistration.php';
1283 ilUtil::sendSuccess($this->lng->txt(
'cal_reg_registered'),
true);
1284 $this->ctrl->returnToParent($this);
1304 include_once
'Services/Utilities/classes/class.ilConfirmationGUI.php';
1307 $this->ctrl->setParameter($this,
'dstart', (
int) $_REQUEST[
'dstart']);
1308 $this->ctrl->setParameter($this,
'dend', (
int) $_REQUEST[
'dend']);
1311 $conf->setHeaderText($this->lng->txt(
'cal_confirm_unreg_info'));
1312 $conf->setConfirm($this->lng->txt(
'cal_reg_unregister'),
'unregister');
1313 $conf->setCancel($this->lng->txt(
'cancel'),
'cancel');
1314 $conf->addItem(
'app_id', $entry->getEntryId(), $entry->getTitle() .
' (' .
$start .
')');
1316 $tpl->setContent($conf->getHTML());
1329 include_once
'./Services/Calendar/classes/class.ilCalendarRegistration.php';
1337 ilUtil::sendSuccess($this->lng->txt(
'cal_reg_unregistered'),
true);
1338 $this->ctrl->returnToParent($this);
1351 $entry = (int)
$_GET[
'app_id'];
1354 $this->ctrl->saveParameter($this,
'app_id');
1356 include_once
'Services/Calendar/classes/class.ilCalendarEntry.php';
1357 include_once
'Services/Booking/classes/class.ilBookingEntry.php';
1374 include_once
'./Services/Form/classes/class.ilPropertyFormGUI.php';
1376 $form->setFormAction($this->ctrl->getFormAction($this));
1377 $form->addCommandButton(
'bookconfirmed', $this->lng->txt(
'cal_confirm_booking'));
1378 $form->addCommandButton(
'cancel', $this->lng->txt(
'cancel'));
1381 $form->addItem($date);
1402 $entry = (int) $_REQUEST[
'app_id'];
1403 $user = (int) $_REQUEST[
'bkid'];
1406 if (
$form->checkInput()) {
1408 include_once
'./Services/Calendar/classes/class.ilCalendarEntry.php';
1411 include_once
'./Services/Booking/classes/class.ilBookingEntry.php';
1414 if (!$booking->isAppointmentBookableForUser($entry,
$GLOBALS[
'DIC'][
'ilUser']->getId())) {
1416 $this->ctrl->returnToParent($this);
1419 include_once
'./Services/Calendar/classes/ConsultationHours/class.ilConsultationHourUtils.php';
1422 include_once
'./Services/Booking/classes/class.ilBookingEntry.php';
1425 ilUtil::sendSuccess($this->lng->txt(
'cal_booking_confirmed'),
true);
1426 $this->ctrl->returnToParent($this);
1440 $entry = (int)
$_GET[
'app_id'];
1442 include_once
'Services/Calendar/classes/class.ilCalendarEntry.php';
1447 include_once
'Services/Booking/classes/class.ilBookingEntry.php';
1449 if (!$booking->hasBooked($entry->getEntryId())) {
1450 $this->ctrl->returnToParent($this);
1456 $entry_title =
' ' . $entry->getTitle();
1458 $this->ctrl->returnToParent($this);
1464 include_once
'Services/Utilities/classes/class.ilConfirmationGUI.php';
1467 $conf->setHeaderText($this->lng->txt(
'cal_cancel_booking_info'));
1468 $conf->setConfirm($this->lng->txt(
'cal_cancel_booking'),
'cancelconfirmed');
1469 $conf->setCancel($this->lng->txt(
'cancel'),
'cancel');
1470 $conf->addItem(
'app_id', $entry->getEntryId(),
$title .
' - ' . $entry_title);
1472 $tpl->setContent($conf->getHTML());
1485 $entry = (int)
$_POST[
'app_id'];
1488 include_once
'Services/Calendar/classes/class.ilCalendarEntry.php';
1494 include_once
'Services/Calendar/classes/ConsultationHours/class.ilConsultationHourAppointments.php';
1497 $entry->getContextId(),
1504 foreach ((array) $apps as $own_app) {
1506 $ref_entry->delete();
1509 include_once
'Services/Booking/classes/class.ilBookingEntry.php';
1511 $booking->cancelBooking($entry->getEntryId());
1515 include_once
'Modules/BookingManager/classes/class.ilBookingReservation.php';
1523 ilUtil::sendSuccess($this->lng->txt(
'cal_cancel_booking_confirmed'),
true);
1524 $this->ctrl->returnToParent($this);
1534 include_once
'Services/Calendar/classes/class.ilCalendarCategoryAssignments.php';
1535 include_once
'Services/Calendar/classes/class.ilCalendarCategory.php';
1537 $assignment = $assignment->getFirstAssignment();
1547 if (!isset(
$_GET[
'autoCompleteField'])) {
1548 $a_fields = array(
'login',
'firstname',
'lastname',
'email');
1550 $a_fields = array((
string)
$_GET[
'autoCompleteField']);
1553 include_once
'./Services/User/classes/class.ilUserAutoComplete.php';
1555 $auto->setSearchFields($a_fields);
1556 $auto->enableFieldSearchableCheck(
true);
1557 $auto->setMoreLinkAvailable(
true);
1559 if (($_REQUEST[
'fetchall'])) {
1563 echo $auto->getList($_REQUEST[
'query']);
An exception for terminatinating execution or to throw for unit testing.
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.
load($a_mode, $a_as_milestone=false)
load post
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
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.
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 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 initDomEvent()
Init YUI DomEvent.
const IL_CAL_FREQ_DAILY
Model of calendar entry recurrcences.
catch(Exception $e) $message
$GLOBALS['JPEG_Segment_Names']
Global Variable: XMP_tag_captions.
if(isset($_POST['submit'])) $form