24include_once 
'./Services/Calendar/classes/class.ilCalendarRecurrence.php';
 
   25include_once 
'./Services/Booking/classes/class.ilBookingEntry.php';
 
   26include_once 
'./Services/Calendar/classes/ConsultationHours/class.ilConsultationHourAppointments.php';
 
   68            $this->user_id = 
$ilUser->getId();
 
   87        $ilHelp = 
$DIC[
'ilHelp'];
 
   88        $ilTabs = 
$DIC[
'ilTabs'];
 
   90        $ilHelp->setScreenIdComponent(
"cal");
 
   92        switch ($this->ctrl->getNextClass()) {
 
   93            case "ilpublicuserprofilegui":
 
   94                include_once(
'./Services/User/classes/class.ilPublicUserProfileGUI.php');
 
   95                #22168 don't send the current user if no GET user_id 
  103            case 'ilrepositorysearchgui':
 
  105                include_once(
'./Services/Search/classes/class.ilRepositorySearchGUI.php');
 
  108                if (isset($_REQUEST[
'assignM'])) {
 
  109                    $rep_search->setCallback(
 
  111                        'assignUsersToAppointments',
 
  114                    $ilCtrl->setParameter($this, 
'assignM', 1);
 
  115                    $ilCtrl->setReturn($this, 
'appointmentList');
 
  116                    $ilTabs->activateSubTab(
'cal_ch_app_list');
 
  117                } elseif (isset($_REQUEST[
'grp_id'])) {
 
  118                    $rep_search->setCallback(
 
  120                        'assignUsersToGroup',
 
  123                    $ilCtrl->saveParameter($this, 
'grp_id');
 
  124                    $ilCtrl->setReturn($this, 
'groupList');
 
  125                    $ilTabs->activateSubTab(
'cal_ch_app_grp');
 
  126                } elseif (isset($_REQUEST[
'apps'])) {
 
  127                    $rep_search->setCallback(
 
  129                        'assignUsersToAppointment',
 
  132                    $ilCtrl->saveParameter($this, 
'apps');
 
  133                    $ilCtrl->setReturn($this, 
'appointmentList');
 
  134                    $ilTabs->activateSubTab(
'cal_ch_app_list');
 
  136                $ilCtrl->forwardCommand($rep_search);
 
  140                $tpl->setTitle($this->lng->txt(
"cal_ch_form_header")); 
 
  143                if (
$ilUser->getId() != $this->user_id) {
 
  144                    $ilCtrl->setParameter($this, 
'user_id', $this->user_id);
 
  147                $cmd = $this->ctrl->getCmd(
'appointmentList');
 
  169        $ilTabs = 
$DIC[
'ilTabs'];
 
  171        $_SESSION[
'ch_apps'] = $_REQUEST[
'apps'];
 
  175            $GLOBALS[
'DIC'][
'ilCtrl']->redirect($this, 
'appointmentList');
 
  177        $_REQUEST[
'assignM'] = 1;
 
  178        $ilCtrl->setCmdClass(
'ilrepositorysearchgui');
 
  194            include_once 
'./Services/User/classes/class.ilObjUser.php';
 
  197        ilUtil::sendInfo($this->lng->txt(
'cal_ch_user_assignment_failed_info') . 
'<br />' . implode(
'<br />', $users), 
true);
 
  211        $unassigned_users = array();
 
  217        $ilCtrl->redirect($this, 
'appointmentList');
 
  235            $app = $_REQUEST[
'apps'];
 
  238        if (!count($users)) {
 
  244        include_once 
'./Services/Booking/classes/class.ilBookingEntry.php';
 
  247        $assigned_users = array();
 
  248        foreach ($users as $user) {
 
  253                include_once 
'./Services/Calendar/classes/ConsultationHours/class.ilConsultationHourUtils.php';
 
  255                $assigned_users[] = $user;
 
  259        $unassigned_users = array_diff($users, $assigned_users);
 
  263            $ilCtrl->redirect($this, 
'appointmentList');
 
  265            return $unassigned_users;
 
  280        $group_id = (int) $_REQUEST[
'grp_id'];
 
  286        include_once 
'./Services/Calendar/classes/ConsultationHours/class.ilConsultationHourAppointments.php';
 
  287        include_once 
'./Services/Booking/classes/class.ilBookingEntry.php';
 
  294        $assigned_users = array();
 
  295        foreach ($apps as 
$app) {
 
  297            foreach ($users as $user) {
 
  302                    include_once 
'./Services/Calendar/classes/ConsultationHours/class.ilConsultationHourUtils.php';
 
  304                    $assigned_users[] = $user;
 
  310        $ilCtrl->redirect($this, 
'bookingList');
 
  322        $ilToolbar = 
$DIC[
'ilToolbar'];
 
  323        $ilTabs = 
$DIC[
'ilTabs'];
 
  325        $ilHelp = 
$DIC[
'ilHelp'];
 
  327        $ilHelp->setScreenId(
"consultation_hours");
 
  329        $ilToolbar->setFormAction($this->ctrl->getFormAction($this));
 
  330        $ilToolbar->addButton($this->lng->txt(
'cal_ch_add_grp'), $this->ctrl->getLinkTarget($this, 
'addGroup'));
 
  333        $ilTabs->activateSubTab(
'cal_ch_app_grp');
 
  335        include_once 
'./Services/Calendar/classes/ConsultationHours/class.ilConsultationHourGroupTableGUI.php';
 
  336        include_once 
'./Services/Calendar/classes/ConsultationHours/class.ilConsultationHourGroups.php';
 
  340        $tpl->setContent($gtbl->getHTML());
 
  352        $ilTabs = 
$DIC[
'ilTabs'];
 
  356        $ilTabs->activateSubTab(
'cal_ch_app_grp');
 
  361        $tpl->setContent($form->getHTML());
 
  370        if ($form->checkInput()) {
 
  371            include_once 
'./Services/Calendar/classes/ConsultationHours/class.ilConsultationHourGroup.php';
 
  373            $group->setTitle($form->getInput(
'title'));
 
  374            $group->setMaxAssignments($form->getInput(
'multiple'));
 
  378            ilUtil::sendSuccess(
$GLOBALS[
'DIC'][
'lng']->txt(
'settings_saved'), 
true);
 
  379            $GLOBALS[
'DIC'][
'ilCtrl']->redirect($this, 
'groupList');
 
  397        $ilTabs = 
$DIC[
'ilTabs'];
 
  399        $ilCtrl->setParameter($this, 
'grp_id', (
int) $_REQUEST[
'grp_id']);
 
  401        $ilTabs->activateSubTab(
'cal_ch_app_grp');
 
  406        $tpl->setContent($form->getHTML());
 
  421        $ilTabs = 
$DIC[
'ilTabs'];
 
  423        $ilCtrl->setParameter($this, 
'grp_id', (
int) $_REQUEST[
'grp_id']);
 
  426        if ($form->checkInput()) {
 
  427            include_once 
'./Services/Calendar/classes/ConsultationHours/class.ilConsultationHourGroup.php';
 
  429            $group->setTitle($form->getInput(
'title'));
 
  430            $group->setMaxAssignments($form->getInput(
'multiple'));
 
  434            ilUtil::sendSuccess(
$GLOBALS[
'DIC'][
'lng']->txt(
'settings_saved'), 
true);
 
  435            $GLOBALS[
'DIC'][
'ilCtrl']->redirect($this, 
'groupList');
 
  452        $ilTabs = 
$DIC[
'ilTabs'];
 
  455        $ilCtrl->setParameter($this, 
'grp_id', (
int) $_REQUEST[
'grp_id']);
 
  456        $groups = array((
int) $_REQUEST[
'grp_id']);
 
  459        $ilTabs->activateSubTab(
'cal_ch_app_grp');
 
  462        include_once 
'./Services/Utilities/classes/class.ilConfirmationGUI.php';
 
  464        $confirm->setFormAction(
$ilCtrl->getFormAction($this));
 
  465        $confirm->setHeaderText(
$GLOBALS[
'DIC'][
'lng']->txt(
'cal_ch_grp_delete_sure'));
 
  466        $confirm->setConfirm(
$GLOBALS[
'DIC'][
'lng']->txt(
'delete'), 
'deleteGroup');
 
  467        $confirm->setCancel(
$GLOBALS[
'DIC'][
'lng']->txt(
'cancel'), 
'groupList');
 
  469        foreach ($groups as $grp_id) {
 
  470            include_once 
'./Services/Calendar/classes/ConsultationHours/class.ilConsultationHourGroup.php';
 
  473            $confirm->addItem(
'groups[]', $grp_id, $group->getTitle());
 
  475        $tpl->setContent($confirm->getHTML());
 
  487        foreach ((array) $_REQUEST[
'groups'] as $grp_id) {
 
  488            include_once 
'./Services/Calendar/classes/ConsultationHours/class.ilConsultationHourGroup.php';
 
  492        ilUtil::sendSuccess(
$GLOBALS[
'DIC'][
'lng']->txt(
'cal_ch_grp_deleted'));
 
  493        $ilCtrl->redirect($this, 
'groupList');
 
  501        include_once 
'./Services/Calendar/classes/ConsultationHours/class.ilConsultationHourGroup.php';
 
  504        include_once 
'Services/Form/classes/class.ilPropertyFormGUI.php';
 
  506        $form->setFormAction(
$GLOBALS[
'DIC'][
'ilCtrl']->getFormAction($this));
 
  509            $form->setTitle(
$GLOBALS[
'DIC'][
'lng']->txt(
'cal_ch_grp_update_tbl'));
 
  510            $form->addCommandButton(
'updateGroup', 
$GLOBALS[
'DIC'][
'lng']->txt(
'save'));
 
  511            $form->addCommandButton(
'groupList', 
$GLOBALS[
'DIC'][
'lng']->txt(
'cancel'));
 
  513            $form->setTitle(
$GLOBALS[
'DIC'][
'lng']->txt(
'cal_ch_grp_add_tbl'));
 
  514            $form->addCommandButton(
'saveGroup', 
$GLOBALS[
'DIC'][
'lng']->txt(
'save'));
 
  515            $form->addCommandButton(
'appointmentList', 
$GLOBALS[
'DIC'][
'lng']->txt(
'cancel'));
 
  519        $title->setMaxLength(128);
 
  521        $title->setRequired(
true);
 
  522        $title->setValue($group->getTitle());
 
  523        $form->addItem($title);
 
  526        $multiple->setRequired(
true);
 
  527        $multiple->setMinValue(1);
 
  528        $multiple->setSize(1);
 
  529        $multiple->setMaxLength(2);
 
  530        $multiple->setInfo(
$GLOBALS[
'DIC'][
'lng']->txt(
'cal_ch_grp_multiple_info'));
 
  531        $multiple->setValue($group->getMaxAssignments());
 
  532        $form->addItem($multiple);
 
  544        $ilToolbar = 
$DIC[
'ilToolbar'];
 
  545        $ilTabs = 
$DIC[
'ilTabs'];
 
  547        $ilHelp = 
$DIC[
'ilHelp'];
 
  549        $ilHelp->setScreenId(
"consultation_hours");
 
  552        $ilTabs->activateSubTab(
'cal_ch_app_bookings');
 
  554        include_once 
'./Services/Calendar/classes/ConsultationHours/class.ilConsultationHourBookingTableGUI.php';
 
  557        $tpl->setContent($btable->getHTML());
 
  575        $ilTabs = 
$DIC[
'ilTabs'];
 
  579        $ilTabs->activateSubTab(
'cal_ch_app_bookings');
 
  581        include_once(
'./Services/Utilities/classes/class.ilConfirmationGUI.php');
 
  584        $confirm->setFormAction($this->ctrl->getFormAction($this));
 
  586        if ($a_send_notification) {
 
  588            $confirm->setHeaderText($this->lng->txt(
'cal_ch_cancel_booking_sure'));
 
  589            $confirm->setConfirm($this->lng->txt(
'cal_ch_reject_booking'), 
'rejectBooking');
 
  592            $confirm->setHeaderText($this->lng->txt(
'cal_ch_delete_booking_sure'));
 
  593            $confirm->setConfirm($this->lng->txt(
'cal_ch_delete_booking'), 
'deleteBooking');
 
  596        $confirm->setCancel($this->lng->txt(
'cancel'), 
'bookingList');
 
  598        include_once 
'Services/Calendar/classes/class.ilCalendarEntry.php';
 
  599        foreach ((array) $_REQUEST[
'bookuser'] as $bookuser) {
 
  600            $ids = explode(
'_', $bookuser);
 
  602            include_once 
'./Services/Calendar/classes/class.ilCalendarEntry.php';
 
  603            include_once 
'./Services/User/classes/class.ilUserUtil.php';
 
  618        $tpl->setContent($confirm->getHTML());
 
  639        foreach ((array) $_REQUEST[
'bookuser'] as $bookuser) {
 
  640            $ids = explode(
'_', $bookuser);
 
  642            include_once 
'./Services/Calendar/classes/ConsultationHours/class.ilConsultationHourUtils.php';
 
  645        if ($a_send_notification) {
 
  646            ilUtil::sendSuccess($this->lng->txt(
'cal_ch_canceled_bookings'), 
true);
 
  648            ilUtil::sendSuccess($this->lng->txt(
'cal_ch_deleted_bookings'), 
true);
 
  650        $ilCtrl->redirect($this, 
'bookingList');
 
  662        $ilToolbar = 
$DIC[
'ilToolbar'];
 
  663        $ilHelp = 
$DIC[
'ilHelp'];
 
  664        $ilTabs = 
$DIC[
'ilTabs'];
 
  666        $ilHelp->setScreenId(
"consultation_hours");
 
  668        $ilToolbar->setFormAction($this->ctrl->getFormAction($this));
 
  669        $ilToolbar->addButton($this->lng->txt(
'cal_ch_add_sequence'), $this->ctrl->getLinkTarget($this, 
'createSequence'));
 
  672        $ilTabs->activateSubTab(
'cal_ch_app_list');
 
  674        include_once 
'./Services/Calendar/classes/ConsultationHours/class.ilConsultationHoursTableGUI.php';
 
  677        $this->tpl->setContent($tbl->getHTML());
 
  689        $this->form->getItemByPostVar(
'bo')->setValue($this->booking->getNumberOfBookings());
 
  690        $this->form->getItemByPostVar(
'ap')->setValue(1);
 
  691        $this->form->getItemByPostVar(
'du')->setMinutes(15);
 
  692        $this->form->getItemByPostVar(
'st')->setDate(
 
  693            new ilDateTime(mktime(8, 0, 0, date(
'n', time()), date(
'd', time()), date(
'Y', time())), 
IL_CAL_UNIX)
 
  696        $this->tpl->setContent($this->form->getHTML());
 
  706        include_once 
'./Services/Form/classes/class.ilPropertyFormGUI.php';
 
  708        include_once(
'./Services/YUI/classes/class.ilYuiUtil.php');
 
  712        $this->form->setFormAction($this->ctrl->getFormAction($this));
 
  716                $this->form->setTitle($this->lng->txt(
'cal_ch_add_sequence'));
 
  717                $this->form->addCommandButton(
'saveSequence', $this->lng->txt(
'save'));
 
  718                $this->form->addCommandButton(
'appointmentList', $this->lng->txt(
'cancel'));
 
  730                $this->form->setTitle($this->lng->txt(
'cal_ch_multi_edit_sequence'));
 
  731                $this->form->addCommandButton(
'updateMulti', $this->lng->txt(
'save'));
 
  732                $this->form->addCommandButton(
'appointmentList', $this->lng->txt(
'cancel'));
 
  737        include_once 
'./Services/Calendar/classes/ConsultationHours/class.ilConsultationHourGroups.php';
 
  739            $group = 
new ilSelectInputGUI($this->lng->txt(
'cal_ch_grp_selection'), 
'grp');
 
  740            $group->setOptions($options);
 
  741            $group->setRequired(
false);
 
  742            $this->form->addItem($group);
 
  748        $ti->setMaxLength(128);
 
  749        $ti->setRequired(
true);
 
  750        $this->form->addItem($ti);
 
  752        if ($a_mode != self::MODE_MULTI) {
 
  754            include_once 
'./Services/Form/classes/class.ilDateTimeInputGUI.php';
 
  756            $dur->setShowTime(
true);
 
  757            $dur->setRequired(
true);
 
  758            $this->form->addItem($dur);
 
  762            $du->setShowMinutes(
true);
 
  763            $du->setShowHours(
true);
 
  764            $this->form->addItem($du);
 
  767            $nu = 
new ilNumberInputGUI($this->lng->txt(
'cal_ch_num_appointments'), 
'ap');
 
  768            $nu->setInfo($this->lng->txt(
'cal_ch_num_appointments_info'));
 
  770            $nu->setMaxLength(2);
 
  771            $nu->setRequired(
true);
 
  773            $this->form->addItem($nu);
 
  776            include_once(
'./Services/Calendar/classes/Form/class.ilRecurrenceInputGUI.php');
 
  778            $rec->setEnabledSubForms(
 
  785            $this->form->addItem($rec);
 
  791        $nu->setMaxLength(2);
 
  793        $nu->setRequired(
true);
 
  794        $this->form->addItem($nu);
 
  798        $dead->setInfo($this->lng->txt(
'cal_ch_deadline_info'));
 
  799        $dead->setShowMinutes(
false);
 
  800        $dead->setShowHours(
true);
 
  801        $dead->setShowDays(
true);
 
  802        $this->form->addItem($dead);
 
  807        $lo->setMaxLength(128);
 
  808        $this->form->addItem($lo);
 
  814        $this->form->addItem($de);
 
  817        $tgt = 
new ilTextInputGUI($this->lng->txt(
'cal_ch_target_object'), 
'tgt');
 
  818        $tgt->setInfo($this->lng->txt(
'cal_ch_target_object_info'));
 
  820        $tgt->setMaxLength(128);
 
  821        $this->form->addItem($tgt);
 
  832        $ilObjDataCache = 
$DIC[
'ilObjDataCache'];
 
  836        if ($this->form->checkInput()) {
 
  837            $this->form->setValuesByPost();
 
  841            $booking->setNumberOfBookings($this->form->getInput(
'bo'));
 
  843            $deadline = $this->form->getInput(
'dead');
 
  844            $deadline = $deadline[
'dd'] * 24 + $deadline[
'hh'];
 
  845            $booking->setDeadlineHours($deadline);
 
  848            include_once 
'./Services/Calendar/classes/ConsultationHours/class.ilConsultationHourGroups.php';
 
  850                $booking->setBookingGroup((
int) $this->form->getInput(
'grp'));
 
  853            $tgt = explode(
',', $this->form->getInput(
'tgt'));
 
  855            foreach ((array) $tgt as $ref_id) {
 
  856                if (!trim($ref_id)) {
 
  859                $obj_id = $ilObjDataCache->lookupObjId($ref_id);
 
  861                $valid_types = array(
'crs',
'grp');
 
  862                if (!$obj_id or !in_array(
$type, $valid_types)) {
 
  864                    $this->tpl->setContent($this->form->getHTML());
 
  868                $obj_ids[] = $obj_id;
 
  870            $booking->setTargetObjIds($obj_ids);
 
  875            ilUtil::sendSuccess($this->lng->txt(
'settings_saved'), 
true);
 
  876            $this->ctrl->redirect($this, 
'appointmentList');
 
  878            $this->form->setValuesByPost();
 
  879            $this->tpl->setContent($this->form->getHTML());
 
  890        include_once 
'./Services/Calendar/classes/class.ilDateList.php';
 
  892        $start = clone $this->form->getItemByPostVar(
'st')->getDate();
 
  893        for (
$i = 0; 
$i < $this->form->getItemByPostVar(
'ap')->getValue(); 
$i++) {
 
  894            $concurrent_dates->add(clone $start);
 
  896            $start->increment(
ilDateTime::MINUTE, $this->form->getItemByPostVar(
'du')->getMinutes());
 
  897            $start->increment(
ilDateTime::HOUR, $this->form->getItemByPostVar(
'du')->getHours());
 
  898            #$start = new ilDateTime(,IL_CAL_UNIX); 
  901        include_once 
'./Services/Calendar/classes/class.ilCalendarUtil.php';
 
  905        include_once 
'./Services/Calendar/classes/class.ilCalendarCategoryAssignments.php';
 
  906        include_once 
'./Services/Calendar/classes/class.ilCalendarEntry.php';
 
  907        include_once 
'./Services/Calendar/classes/class.ilCalendarRecurrenceCalculator.php';
 
  908        include_once 
'./Services/Booking/classes/class.ilBookingPeriod.php';
 
  910        $num_appointments = 0;
 
  911        foreach ($concurrent_dates as $dt) {
 
  912            if ($num_appointments >= self::MAX_APPOINTMENTS_PER_SEQUENCE) {
 
  917            $end->increment(
ilDateTime::MINUTE, $this->form->getItemByPostVar(
'du')->getMinutes());
 
  918            $end->increment(
ilDateTime::HOUR, $this->form->getItemByPostVar(
'du')->getHours());
 
  922                $this->form->getItemByPostVar(
'frequence')->getRecurrence()
 
  929            $date_list = $calc->calculateDateList($dt, $limit);
 
  932            foreach ($date_list as $app_start) {
 
  933                $app_end = clone $app_start;
 
  934                $app_end->increment(
ilDateTime::MINUTE, $this->form->getItemByPostVar(
'du')->getMinutes());
 
  935                $app_end->increment(
ilDateTime::HOUR, $this->form->getItemByPostVar(
'du')->getHours());
 
  939                $entry->setContextId(
$booking->getId());
 
  940                $entry->setTitle($this->form->getInput(
'ti'));
 
  941                $entry->setSubtitle(
"#consultationhour#"); 
 
  942                $entry->setDescription($this->form->getInput(
'de'));
 
  943                $entry->setLocation($this->form->getInput(
'lo'));
 
  944                $entry->setStart($app_start);
 
  945                $entry->setEnd($app_end);
 
  951                $cat_assign->addAssignment($def_cat->getCategoryID());
 
  966        $ilTabs = 
$DIC[
'ilTabs'];
 
  970        $ilCtrl->setParameter($this, 
'user_id', 
'');
 
  971        $ilTabs->addTab(
'consultation_hours_' . 
$ilUser->getId(), $this->lng->txt(
'cal_ch_ch'), $this->ctrl->getLinkTarget($this, 
'appointmentList'));
 
  975            $ilTabs->addTab(
'consultation_hours_' . 
$user_id, $this->lng->txt(
'cal_ch_ch') . 
': ' . 
$login, $this->ctrl->getLinkTarget($this, 
'appointmentList'));
 
  977        $ilCtrl->setParameter($this, 
'user_id', 
'');
 
  979        $ilTabs->addTab(
'ch_settings', $this->lng->txt(
'settings'), $this->ctrl->getLinkTarget($this, 
'settings'));
 
  981        $ilTabs->activateTab(
'consultation_hours_' . $this->
getUserId());
 
  993        $ilTabs = 
$DIC[
'ilTabs'];
 
  997        $ilTabs->addSubTab(
'cal_ch_app_list', $this->lng->txt(
'cal_ch_app_list'), 
$ilCtrl->getLinkTarget($this, 
'appointmentList'));
 
  998        $ilTabs->addSubTab(
'cal_ch_app_grp', $this->lng->txt(
'cal_ch_app_grp'), 
$ilCtrl->getLinkTarget($this, 
'groupList'));
 
  999        $ilTabs->addSubTab(
'cal_ch_app_bookings', $this->lng->txt(
'cal_ch_app_bookings'), 
$ilCtrl->getLinkTarget($this, 
'bookingList'));
 
 1009        $ilTabs = 
$DIC[
'ilTabs'];
 
 1011        if (!isset($_REQUEST[
'apps'])) {
 
 1018        if ($_REQUEST[
'apps'] && !is_array($_REQUEST[
'apps'])) {
 
 1019            $_REQUEST[
'apps'] = explode(
';', $_REQUEST[
'apps']);
 
 1023        $hidden->setValue(implode(
';', $_REQUEST[
'apps']));
 
 1024        $this->form->addItem($hidden);
 
 1026        include_once 
'Services/Calendar/classes/class.ilCalendarEntry.php';
 
 1027        $first = $_REQUEST[
'apps'];
 
 1028        $first = array_shift($_REQUEST[
'apps']);
 
 1031        $this->form->getItemByPostVar(
'ti')->setValue($entry->getTitle());
 
 1032        $this->form->getItemByPostVar(
'lo')->setValue($entry->getLocation());
 
 1033        $this->form->getItemByPostVar(
'de')->setValue($entry->getDescription());
 
 1035        include_once 
'Services/Booking/classes/class.ilBookingEntry.php';
 
 1038        $this->form->getItemByPostVar(
'bo')->setValue(
$booking->getNumberOfBookings());
 
 1041        foreach (
$booking->getTargetObjIds() as $obj_id) {
 
 1043            $ref_ids[] = end($refs);
 
 1045        $this->form->getItemByPostVar(
'tgt')->setValue(implode(
',', $ref_ids));
 
 1047        $deadline = 
$booking->getDeadlineHours();
 
 1048        $this->form->getItemByPostVar(
'dead')->setDays(floor($deadline / 24));
 
 1049        $this->form->getItemByPostVar(
'dead')->setHours($deadline % 24);
 
 1052            $this->form->getItemByPostVar(
'grp')->setValue(
$booking->getBookingGroup());
 
 1055        $this->tpl->setContent($this->form->getHTML());
 
 1066        $obj_cache = 
$DIC[
'ilObjDataCache'];
 
 1069        $booking->setObjId($this->user_id);
 
 1070        $booking->setNumberOfBookings((
int) $this->form->getInput(
'bo'));
 
 1072        $deadline = $this->form->getInput(
'dead');
 
 1073        $deadline = $deadline[
'dd'] * 24 + $deadline[
'hh'];
 
 1074        $booking->setDeadlineHours($deadline);
 
 1076        $tgt = explode(
',', (
string) $this->form->getInput(
'tgt'));
 
 1078        foreach ((array) $tgt as $ref_id) {
 
 1079            if (!trim($ref_id)) {
 
 1082            $obj_id = $obj_cache->lookupObjId($ref_id);
 
 1084            $valid_types = [
'crs', 
'grp'];
 
 1085            if (!$obj_id or !in_array(
$type, $valid_types)) {
 
 1089            $obj_ids[] = $obj_id;
 
 1091        $booking->setTargetObjIds($obj_ids);
 
 1094            $booking->setBookingGroup($this->form->getInput(
'grp'));
 
 1106        foreach ($appointments as $appointment_id) {
 
 1108            $booking_appointment = new \ilCalendarEntry($appointment_id);
 
 1109            $booking_start = $booking_appointment->getStart();
 
 1110            $booking_end = $booking_appointment->getEnd();
 
 1123            foreach ($relevant_appointments as $relevant_appointment_id) {
 
 1125                $entry = new \ilCalendarEntry($relevant_appointment_id);
 
 1126                $entry->setContextId(
$booking->getId());
 
 1127                $entry->setTitle($form->
getInput(
'ti'));
 
 1128                $entry->setLocation($form->
getInput(
'lo'));
 
 1129                $entry->setDescription($form->
getInput(
'de'));
 
 1143        $ilObjDataCache = 
$DIC[
'ilObjDataCache'];
 
 1147        if ($this->form->checkInput()) {
 
 1149            $this->form->setValuesByPost();
 
 1150            $apps = explode(
';', (
string) 
$_POST[
'apps']);
 
 1161            ilUtil::sendSuccess($this->lng->txt(
'settings_saved'), 
true);
 
 1162            $this->ctrl->redirect($this, 
'appointmentList');
 
 1164        $this->tpl->setContent($this->form->getHTML());
 
 1176        if (!isset($_REQUEST[
'apps'])) {
 
 1181        include_once(
'./Services/Utilities/classes/class.ilConfirmationGUI.php');
 
 1184        $this->ctrl->saveParameter($this, array(
'seed',
'app_id',
'dt'));
 
 1187        $confirm->setFormAction($this->ctrl->getFormAction($this));
 
 1188        $confirm->setHeaderText($this->lng->txt(
'cal_delete_app_sure'));
 
 1189        $confirm->setCancel($this->lng->txt(
'cancel'), 
'cancel');
 
 1191        include_once 
'Services/Calendar/classes/class.ilCalendarEntry.php';
 
 1193        $bookings_available = array();
 
 1194        foreach ((array) $_REQUEST[
'apps'] as $entry_id) {
 
 1198            include_once 
'./Services/Booking/classes/class.ilBookingEntry.php';
 
 1204        if ($bookings_available) {
 
 1205            ilUtil::sendInfo($this->lng->txt(
'cal_ch_delete_app_booking_info') . 
'<br />' . implode(
'<br />', $bookings_available));
 
 1208        $confirm->setConfirm($this->lng->txt(
'delete'), 
'delete');
 
 1209        $confirm->setCancel($this->lng->txt(
'cancel'), 
'appointmentList');
 
 1211        $tpl->setContent($confirm->getHTML());
 
 1217    public function delete()
 
 1219        if (!isset(
$_POST[
'apps'])) {
 
 1224        include_once 
'Services/Calendar/classes/class.ilCalendarEntry.php';
 
 1225        include_once 
'Services/Calendar/classes/class.ilCalendarCategoryAssignments.php';
 
 1226        foreach (
$_POST[
'apps'] as $entry_id) {
 
 1231                    include_once 
'./Services/Calendar/classes/ConsultationHours/class.ilConsultationHourUtils.php';
 
 1236            include_once 
'./Services/Calendar/classes/class.ilCalendarEntry.php';
 
 1245        ilUtil::sendSuccess($this->lng->txt(
'cal_deleted_app'), 
true);
 
 1246        $this->ctrl->redirect($this, 
'appointmentList');
 
 1257        $ilTabs = 
$DIC[
'ilTabs'];
 
 1260        $ilTabs->clearTargets();
 
 1264        include_once 
'Services/User/classes/class.ilPublicUserProfileGUI.php';
 
 1278        if (isset($_REQUEST[
"ref_id"])) {
 
 1279            $url = $this->ctrl->getLinkTargetByClass(
'ilCalendarMonthGUI');
 
 1282        elseif (isset(
$_GET[
'panel'])) {
 
 1283            $url = $this->ctrl->getLinkTargetByClass(
'ilCalendarPresentationGUI');
 
 1287            $url = $this->ctrl->getLinkTarget($this, 
'appointmentList');
 
 1300        $ilTabs = 
$DIC[
'ilTabs'];
 
 1301        $ilHelp = 
$DIC[
'ilHelp'];
 
 1303        $ilHelp->setScreenId(
"consultation_hours_settings");
 
 1304        $ilTabs->activateTab(
'ch_settings');
 
 1307        $tpl->setContent($form->getHTML());
 
 1321        include_once 
'./Services/Form/classes/class.ilPropertyFormGUI.php';
 
 1324        $form->setFormAction($this->ctrl->getFormAction($this));
 
 1326        $mng = 
new ilTextInputGUI($this->lng->txt(
'cal_ch_manager'), 
'mng');
 
 1327        $mng->setInfo($this->lng->txt(
'cal_ch_manager_info'));
 
 1328        $form->addItem($mng);
 
 1332        $form->setTitle($this->lng->txt(
'settings'));
 
 1333        $form->addCommandButton(
'updateSettings', $this->lng->txt(
'save'));
 
 1349        $ilTabs = 
$DIC[
'ilTabs'];
 
 1352        if ($form->checkInput()) {
 
 1353            $mng = $form->getInput(
'mng');
 
 1355                ilUtil::sendSuccess($this->lng->txt(
'settings_saved'), 
true);
 
 1356                $ilCtrl->redirect($this, 
'settings');
 
 1358                $ilTabs->activateTab(
'ch_settings');
 
 1361                $field = $form->getItemByPostVar(
'mng');
 
 1362                $field->setValue($mng);
 
 1363                $tpl->setContent($form->getHTML());
 
if(!defined('PATH_SEPARATOR')) $GLOBALS['_PEAR_default_error_mode']
An exception for terminatinating execution or to throw for unit testing.
const IL_CAL_TRANSLATION_SYSTEM
const IL_CAL_FREQ_MONTHLY
static lookupBookingsOfUser($a_app_ids, $a_usr_id, ilDateTime $start=null)
Lookup bookings if user.
static getInstanceByCalendarEntryId($a_id)
Get instance by calendar entry.
static removeObsoleteEntries()
Remove unused booking entries.
static lookupBookingsForAppointment($a_app_id)
Lookup booked users for appointment @global type $ilDB.
Booking period Used for calculation of recurring events.
static _deleteByAppointmentId($a_app_id)
Delete appointment assignment.
Model for a calendar entry.
Calculates an ilDateList for a given calendar entry and recurrence rule.
static initDefaultCalendarByType($a_type_id, $a_usr_id, $a_title, $a_create=false)
Init the default calendar for given type and user.
Confirmation screen class.
static getAppointmentIds($a_user_id, $a_context_id=null, $a_start=null, $a_type=null, $a_check_owner=true)
Get all appointment ids.
static getAppointmentIdsByGroup($a_user_id, $a_ch_group_id, ilDateTime $start=null)
Get appointment ids by consultation hour group.
static getManager($a_as_name=false, $a_full_name=false, $a_user_id=null)
Get consultation hour manager for current user or specific user.
static getManagedUsers()
Get all managed consultation hours users for current users.
static setManager($a_user_name)
Set consultation hour manager for current user.
static getGroupsOfUser($a_user_id)
Get a all groups of an user.
static getCountGroupsOfUser($a_user_id)
Get number of consultation hour groups @global type $ilDB.
static getGroupSelectOptions($a_user_id)
Get group selection options.
static findCalendarAppointmentsForBooking(\ilBookingEntry $booking, \ilDateTime $start, \ilDateTime $end)
static cancelBooking($a_usr_id, $a_app_id, $a_send_notification=true)
Cancel a booking.
static bookAppointment($a_usr_id, $a_app_id)
Book an appointment.
Consultation hours editor.
const MAX_APPOINTMENTS_PER_SEQUENCE
editGroup(ilPropertyFormGUI $form=null)
Edit group @global type $ilCtrl.
deleteGroup()
Delete groups.
confirmDelete()
confirm delete for multiple entries
updateGroup()
Update group @global type $ilCtrl @global type $tpl @global type $ilTabs.
rejectBooking($a_send_notification=true)
rewriteBookingIdsForAppointments(\ilBookingEntry $booking, $appointments, \ilPropertyFormGUI $form)
appointmentList()
Show settings of consultation hours.
groupList()
Show consultation hour group @global type $ilToolbar.
edit()
Edit multiple sequence items.
initFormSequence($a_mode)
Init form.
confirmRejectBooking($a_send_notification=true)
Show delete booking confirmation.
addGroup(ilPropertyFormGUI $form=null)
Show add group form @global type $ilToolbar @global type $ilTabs.
showProfile()
show public profile of given user
sendInfoAboutUnassignedUsers($unassigned)
Send info message about unassigned users.
createSequence()
Create new sequence.
updateSettings()
save settings
deleteBooking()
Delete booking.
initSettingsForm()
build settings form
searchUsersForAppointments()
start searching for users
assignUsersToAppointments(array $users)
Assign users to multiple appointments.
bookingList()
Show list of bookings.
assignUsersToGroup(array $usr_ids)
updateMulti()
Update multiple sequence items.
settings()
display settings gui
confirmDeleteBooking()
Show delete booking confirmation.
assignUsersToAppointment(array $users, $a_app=0, $a_redirect=true)
Assign users to an appointment.
initGroupForm($a_group_id=0)
Init new/update group form.
saveSequence()
Save new sequence.
setSubTabs()
Set sub tabs @global type $ilTabs @global type $ilCtrl.
saveGroup()
Save new group.
executeCommand()
Execute command.
__construct()
Constructor.
createNewBookingEntry(\ilPropertyFormGUI $validate_form)
createAppointments(ilBookingEntry $booking)
Create calendar appointments.
confirmDeleteGroup()
Confirm delete @global type $ilCtrl @global type $ilTabs.
getProfileBackUrl()
Build context-sensitive profile back url.
Consultation hours administration.
static formatDate(ilDateTime $date, $a_skip_day=false, $a_include_wd=false, $include_seconds=false)
Format a date @access public.
@classDescription Date and time handling
static _lookupFullname($a_user_id)
Lookup Full Name.
static _getAllReferences($a_id)
get all reference ids of object
static _lookupType($a_id, $a_reference=false)
lookup object type
GUI class for public user profile presentation.
This class represents a text area property in a property form.
This class represents a text property in a property form.
static getNamePresentation( $a_user_id, $a_user_image=false, $a_profile_link=false, $a_profile_back_link="", $a_force_first_lastname=false, $a_omit_login=false, $a_sortable=true, $a_return_data_array=false, $a_ctrl_path="ilpublicuserprofilegui")
Default behaviour is:
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
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.
if(isset($_FILES['img_file']['size']) && $_FILES['img_file']['size'] > 0) $tpl