84        $this->user_id = $a_user_id;
 
   86        $this->lng = 
$DIC->language();
 
   87        $this->lng->loadLanguageModule(
'dateplaner');
 
   88        $this->lng->loadLanguageModule(
'dash');
 
   89        $this->ctrl = 
$DIC->ctrl();
 
   90        $this->ref_id = $a_ref_id;
 
   92        $this->tabs = 
$DIC->tabs();
 
   93        $this->tpl = 
$DIC->ui()->mainTemplate();
 
   95        $this->lng->loadLanguageModule(
"dateplaner");
 
   97        if (in_array($this->ctrl->getNextClass(), array(
"", 
"ilcalendarcategorygui")) && $this->ctrl->getCmd() == 
"manage") {
 
   99                $this->ctrl->returnToParent($this);
 
  101            if ((
int) 
$_GET[
'category_id'] > 0) {
 
  103                $this->ctrl->setParameter($this, 
"category_id", 
"");
 
  104                $this->ctrl->setParameterByClass(
"ilcalendarpresentationgui", 
"category_id", 
"");
 
  105                $this->ctrl->redirect($this, 
"manage");
 
  109        $this->category_id = (int) 
$_GET[
'category_id'];
 
  111        include_once(
"./Services/Calendar/classes/class.ilCalendarActions.php");
 
  130        $next_class = $this->ctrl->getNextClass($this);
 
  131        $this->ctrl->saveParameter($this, 
'category_id');
 
  132        $this->ctrl->setParameter($this, 
'seed', $this->seed->get(
IL_CAL_DATE));
 
  134        if (array_key_exists(
'backvm', $_REQUEST)) {
 
  135            $this->ctrl->setParameter($this, 
'backvm', 1);
 
  137        switch ($next_class) {
 
  138            case 'ilcalendarappointmentgui':
 
  139                $this->ctrl->setReturn($this, 
'details');
 
  141                include_once(
'./Services/Calendar/classes/class.ilCalendarAppointmentGUI.php');
 
  143                $this->ctrl->forwardCommand(
$app);
 
  147                $cmd = $this->ctrl->getCmd(
"show");
 
  149                if (!in_array($cmd, array(
"details", 
"askDeleteAppointments", 
"deleteAppointments"))) {
 
  164        if (array_key_exists(
'backvm', $_REQUEST)) {
 
  165            $this->ctrl->redirect($this, 
'manage');
 
  169        $this->ctrl->returnToParent($this);
 
  185        $ilTabs = 
$DIC[
'ilTabs'];
 
  187        $ilTabs->clearTargets();
 
  188        $ilTabs->setBackTarget($this->lng->txt(
"cal_back_to_list"), $this->ctrl->getLinkTarget($this, 
'cancel'));
 
  190        $ed_tpl = 
new ilTemplate(
'tpl.edit_category.html', 
true, 
true, 
'Services/Calendar');
 
  195        $ed_tpl->setVariable(
'EDIT_CAT', $form->getHTML());
 
  196        $tpl->setContent($ed_tpl->get());
 
  207        if ($form->checkInput()) {
 
  209            $category->setTitle($form->getInput(
'title'));
 
  210            $category->setColor(
'#' . $form->getInput(
'color'));
 
  211            $category->setLocationType($form->getInput(
'type_rl'));
 
  212            $category->setRemoteUrl($form->getInput(
'remote_url'));
 
  213            $category->setRemoteUser($form->getInput(
'remote_user'));
 
  214            $category->setRemotePass($form->getInput(
'remote_pass'));
 
  216                $category->setType((
int) $form->getInput(
'type'));
 
  217                $category->setObjId(0);
 
  225            $form->setValuesByPost();
 
  235        } 
catch (Exception 
$e) {
 
  239            $form->setValuesByPost();
 
  244        ilUtil::sendSuccess($this->lng->txt(
'settings_saved'), 
true);
 
  245        $GLOBALS[
'DIC']->ctrl()->redirect($this, 
'manage');
 
  259        $tabs->activateTab(
"edit");
 
  263        if (!$this->category_id) {
 
  265            $this->ctrl->returnToParent($this);
 
  268        if (!$this->actions->checkSettingsCal($this->category_id)) {
 
  270            $this->ctrl->returnToParent($this);
 
  276        $tpl->setContent($form->getHTML());
 
  290        if (!$this->category_id) {
 
  292            $this->ctrl->returnToParent($this);
 
  299        include_once(
"./Services/InfoScreen/classes/class.ilInfoScreenGUI.php");
 
  301        $info->setFormAction($this->ctrl->getFormAction($this));
 
  303        $info->addSection($this->lng->txt(
'cal_cal_details'));
 
  305        $tpl->setContent($info->getHTML() . $this->showAssignedAppointments());
 
  310        if (!$this->category_id) {
 
  312            $this->ctrl->returnToParent($this);
 
  319        } 
catch (Exception 
$e) {
 
  321            $this->ctrl->redirect($this, 
'manage');
 
  323        ilUtil::sendSuccess($this->lng->txt(
'cal_cal_sync_success'), 
true);
 
  324        $this->ctrl->redirect($this, 
'manage');
 
  333        include_once 
'./Services/Calendar/classes/class.ilCalendarRemoteReader.php';
 
  338        $remote->import($category);
 
  349        if (!$this->category_id) {
 
  351            $this->ctrl->returnToParent($this);
 
  361        if ($form->checkInput()) {
 
  364                $category->setTitle($form->getInput(
'title'));
 
  366            $category->setColor(
'#' . $form->getInput(
'color'));
 
  368            ilUtil::sendSuccess($this->lng->txt(
'settings_saved'), 
true);
 
  369            if ($this->ref_id > 0) {
 
  370                $this->ctrl->returnToParent($this);
 
  372                $this->ctrl->redirect($this, 
"manage");
 
  375            $form->setValuesByPost();
 
  393        $cat_ids = (is_array(
$_POST[
'selected_cat_ids']) && count(
$_POST[
'selected_cat_ids']) > 0)
 
  394            ? 
$_POST[
'selected_cat_ids']
 
  395            : (
$_GET[
"category_id"] > 0 ? array(
$_GET[
"category_id"]) : 
null);
 
  397        if (!is_array($cat_ids)) {
 
  412        include_once(
'./Services/Utilities/classes/class.ilConfirmationGUI.php');
 
  415        $confirmation_gui->setFormAction($this->ctrl->getFormAction($this));
 
  416        $confirmation_gui->setHeaderText($this->lng->txt(
'cal_del_cal_sure'));
 
  417        $confirmation_gui->setConfirm($this->lng->txt(
'delete'), 
'delete');
 
  418        $confirmation_gui->setCancel($this->lng->txt(
'cancel'), 
'manage');
 
  420        include_once(
'./Services/Calendar/classes/class.ilCalendarCategory.php');
 
  421        foreach ($cat_ids as $cat_id) {
 
  423            $confirmation_gui->addItem(
'category_id[]', $cat_id, $category->getTitle());
 
  426        $tpl->setContent($confirmation_gui->getHTML());
 
  436    protected function delete()
 
  440        $ilCtrl = 
$DIC[
'ilCtrl'];
 
  442        if (!
$_POST[
'category_id']) {
 
  457        include_once(
'./Services/Calendar/classes/class.ilCalendarCategory.php');
 
  458        foreach (
$_POST[
'category_id'] as $cat_id) {
 
  463        ilUtil::sendSuccess($this->lng->txt(
'cal_cal_deleted'), 
true);
 
  464        $ilCtrl->redirect($this, 
'manage');
 
  482        include_once(
'./Services/Calendar/classes/class.ilCalendarCategories.php');
 
  483        include_once(
'./Services/Calendar/classes/class.ilCalendarVisibility.php');
 
  485        $selected_cat_ids = 
$_POST[
'selected_cat_ids'] ? 
$_POST[
'selected_cat_ids'] : array();
 
  486        $shown_cat_ids = 
$_POST[
'shown_cat_ids'] ? 
$_POST[
'shown_cat_ids'] : array();
 
  489        $cat_ids = $cats->getCategories();
 
  495        if ($this->obj_id > 0) {
 
  496            $old_selection = $cat_visibility->getVisible();
 
  498            $old_selection = $cat_visibility->getHidden();
 
  502        $new_selection = array();
 
  506        foreach ($old_selection as $cat_id) {
 
  507            if (!in_array($cat_id, $shown_cat_ids)) {
 
  508                $new_selection[] = $cat_id;
 
  512        foreach ($shown_cat_ids as $shown_cat_id) {
 
  513            $shown_cat_id = (int) $shown_cat_id;
 
  514            if ($this->obj_id > 0) {
 
  515                if (in_array($shown_cat_id, $selected_cat_ids)) {
 
  516                    $new_selection[] = $shown_cat_id;
 
  519                if (!in_array($shown_cat_id, $selected_cat_ids)) {
 
  520                    $new_selection[] = $shown_cat_id;
 
  525        if ($this->obj_id > 0) {
 
  526            $cat_visibility->showSelected($new_selection);
 
  528            $cat_visibility->hideSelected($new_selection);
 
  531        $cat_visibility->save();
 
  533        ilUtil::sendSuccess($this->lng->txt(
'settings_saved'), 
true);
 
  534        $this->ctrl->returnToParent($this);
 
  551        $tabs->activateTab(
"share");
 
  553        if (!$this->category_id) {
 
  555            $this->ctrl->returnToParent($this);
 
  568        $this->ctrl->saveParameter($this, 
'category_id');
 
  570        include_once(
'./Services/Calendar/classes/class.ilCalendarSharedListTableGUI.php');
 
  572        $table->setTitle($this->lng->txt(
'cal_cal_shared_with'));
 
  573        $table->setCalendarId($this->category_id);
 
  577        $tpl->setContent($table->getHTML());
 
  591        $tabs->activateTab(
"share");
 
  593        $this->lng->loadLanguageModule(
'search');
 
  595        if (!$this->category_id) {
 
  597            $this->ctrl->returnToParent($this);
 
  599        $this->ctrl->saveParameter($this, 
'category_id');
 
  602        if (!isset(
$_POST[
'query'])) {
 
  605        } elseif (
$_POST[
'query']) {
 
  616        include_once 
'Services/Search/classes/class.ilQueryParser.php';
 
  617        include_once 
'Services/Search/classes/class.ilObjectSearchFactory.php';
 
  618        include_once 
'Services/Search/classes/class.ilSearchResult.php';
 
  624        $query_parser->setMinWordLength(3);
 
  625        $query_parser->parse();
 
  631                $search->enableActiveCheck(
true);
 
  633                $search->setFields(array(
'login'));
 
  634                $res = $search->performSearch();
 
  635                $res_sum->mergeEntries(
$res);
 
  637                $search->setFields(array(
'firstname'));
 
  638                $res = $search->performSearch();
 
  639                $res_sum->mergeEntries(
$res);
 
  641                $search->setFields(array(
'lastname'));
 
  642                $res = $search->performSearch();
 
  643                $res_sum->mergeEntries(
$res);
 
  650                include_once 
'Services/Search/classes/Like/class.ilLikeObjectSearch.php';
 
  652                $search->setFilter(array(
'role'));
 
  654                $res = $search->performSearch();
 
  655                $res_sum->mergeEntries(
$res);
 
  661        if (!count($res_sum->getResults())) {
 
  701        if (!$this->category_id) {
 
  703            $this->ctrl->returnToParent($this);
 
  705        if (!isset(
$_POST[
'user_ids']) || !count(
$_POST[
'user_ids'])) {
 
  719        include_once(
'./Services/Calendar/classes/class.ilCalendarShared.php');
 
  727        ilUtil::sendSuccess($this->lng->txt(
'cal_shared_selected_usr'));
 
  752        if (!$this->category_id) {
 
  754            $this->ctrl->returnToParent($this);
 
  756        if (!isset(
$_POST[
'role_ids']) || !count(
$_POST[
'role_ids'])) {
 
  769        include_once(
'./Services/Calendar/classes/class.ilCalendarShared.php');
 
  772        foreach (
$_POST[
'role_ids'] as $role_id) {
 
  775        ilUtil::sendSuccess($this->lng->txt(
'cal_shared_selected_usr'));
 
  788        if (!$this->category_id) {
 
  790            $this->ctrl->returnToParent($this);
 
  792        if (!isset(
$_POST[
'obj_ids']) || !count(
$_POST[
'obj_ids'])) {
 
  806        include_once(
'./Services/Calendar/classes/class.ilCalendarShared.php');
 
  809        foreach (
$_POST[
'obj_ids'] as $obj_id) {
 
  810            $shared->stopSharing($obj_id);
 
  812        ilUtil::sendSuccess($this->lng->txt(
'cal_unshared_selected_usr'));
 
  831        include_once(
'./Services/Calendar/classes/class.ilCalendarSharedUserListTableGUI.php');
 
  834        $table->setTitle($this->lng->txt(
'cal_share_search_usr_header'));
 
  835        $table->setFormAction($this->ctrl->getFormAction($this));
 
  836        $table->setUsers($a_ids);
 
  842        $tpl->setContent($table->getHTML());
 
  858        include_once(
'./Services/Calendar/classes/class.ilCalendarSharedRoleListTableGUI.php');
 
  861        $table->setTitle($this->lng->txt(
'cal_share_search_role_header'));
 
  862        $table->setFormAction($this->ctrl->getFormAction($this));
 
  863        $table->setRoles($a_ids);
 
  869        $tpl->setContent($table->getHTML());
 
  881        $tb = 
$DIC->toolbar();
 
  884        $lng->loadLanguageModule(
'search');
 
  886        $tb->setFormAction($this->ctrl->getFormAction($this));
 
  889        $search = 
new ilTextInputGUI($this->lng->txt(
'cal_search'), 
'query');
 
  890        $search->setValue(
$_POST[
'query']);
 
  891        $search->setSize(16);
 
  892        $search->setMaxLength(128);
 
  894        $tb->addInputItem($search, 
true);
 
  897        include_once(
"./Services/Form/classes/class.ilSelectInputGUI.php");
 
  899            self::SEARCH_USER => $this->lng->txt(
'obj_user'),
 
  900            self::SEARCH_ROLE => $this->lng->txt(
'obj_role'),
 
  904        $si->setOptions($options);
 
  905        $si->setInfo($this->lng->txt(
""));
 
  906        $tb->addInputItem(
$si);
 
  909        $tb->addFormButton($this->lng->txt(
'search'), 
"sharePerformSearch");
 
  923        $rbacsystem = 
$DIC[
'rbacsystem'];
 
  925        $ilHelp = 
$DIC[
'ilHelp'];
 
  927        $ilHelp->setScreenIdComponent(
"cal");
 
  928        $ilHelp->setScreenId(
"cal");
 
  929        if ($a_mode == 
"edit") {
 
  930            $ilHelp->setSubScreenId(
"edit");
 
  932            $ilHelp->setSubScreenId(
"create");
 
  935        include_once(
'./Services/Calendar/classes/class.ilCalendarCategories.php');
 
  939        #$this->form->setTableWidth('40%'); 
  943                $this->form->setTitle($this->lng->txt(
'cal_edit_category'));
 
  944                $this->ctrl->saveParameter($this, array(
'seed',
'category_id'));
 
  945                $this->form->setFormAction($this->ctrl->getFormAction($this));
 
  947                    $this->form->addCommandButton(
'update', $this->lng->txt(
'save'));
 
  959                $this->editable = 
true;
 
  961                $this->ctrl->saveParameter($this, array(
'category_id'));
 
  962                $this->form->setFormAction($this->ctrl->getFormAction($this));
 
  963                $this->form->setTitle($this->lng->txt(
'cal_add_category'));
 
  964                $this->form->addCommandButton(
'save', $this->lng->txt(
'save'));
 
  968        $this->form->addCommandButton(
'cancel', $this->lng->txt(
'cancel'));
 
  971        $title = 
new ilTextInputGUI($this->lng->txt(
'cal_calendar_name'), 
'title');
 
  972        if ($a_mode == 
'edit') {
 
  974                $title->setDisabled(
true);
 
  977        $title->setRequired(
true);
 
  978        $title->setMaxLength(64);
 
  980        $title->setValue($category->getTitle());
 
  981        $this->form->addItem($title);
 
  984        include_once(
'./Services/Calendar/classes/class.ilCalendarSettings.php');
 
  987            $type->setValue($category->getType());
 
  988            $type->setRequired(
true);
 
  991            $type->addOption($opt);
 
  994            $type->addOption($opt);
 
  995            $type->setInfo($this->lng->txt(
'cal_type_info'));
 
  996            $this->form->addItem(
$type);
 
 1001        $color->setValue($category->getColor());
 
 1003            $color->setDisabled(
true);
 
 1005        $color->setRequired(
true);
 
 1006        $this->form->addItem($color);
 
 1009        $location->setDisabled($a_mode == 
'edit');
 
 1014        $location->setValue($category->getLocationType());
 
 1018        $url->setDisabled($a_mode == 
'edit');
 
 1019        $url->setValue($category->getRemoteUrl());
 
 1020        $url->setMaxLength(500);
 
 1022        $url->setRequired(
true);
 
 1023        $location_remote->addSubItem(
$url);
 
 1025        $user = 
new ilTextInputGUI($this->lng->txt(
'username'), 
'remote_user');
 
 1026        $user->setDisabled($a_mode == 
'edit');
 
 1027        $user->setValue($category->getRemoteUser());
 
 1028        $user->setMaxLength(50);
 
 1030        $user->setRequired(
false);
 
 1031        $location_remote->addSubItem($user);
 
 1034        $pass->setDisabled($a_mode == 
'edit');
 
 1035        $pass->setValue($category->getRemotePass());
 
 1036        $pass->setMaxLength(50);
 
 1038        $pass->setRetype(
false);
 
 1039        $pass->setInfo($this->lng->txt(
'remote_pass_info'));
 
 1040        $location_remote->addSubItem(
$pass);
 
 1046            $this->form->addItem($ne);
 
 1053            $this->form->addItem($ne);
 
 1069        if (!$this->category_id) {
 
 1071            $this->ctrl->returnToParent($this);
 
 1077        include_once(
'./Services/Calendar/classes/class.ilCalendarSharedStatus.php');
 
 1080        include_once(
'./Services/Calendar/classes/class.ilCalendarShared.php');
 
 1086        $status->decline($this->category_id);
 
 1088        ilUtil::sendSuccess($this->lng->txt(
'settings_saved'), 
true);
 
 1089        $this->ctrl->redirect($this, 
'manage');
 
 1100        include_once(
'./Services/Calendar/classes/class.ilCalendarCategoryTableGUI.php');
 
 1101        include_once(
'./Services/Calendar/classes/class.ilCalendarCategoryAssignments.php');
 
 1102        include_once(
'./Services/Calendar/classes/class.ilCalendarAppointmentsTableGUI.php');
 
 1105        $table_gui->setTitle($this->lng->txt(
'cal_assigned_appointments'));
 
 1106        $table_gui->setAppointments(
 
 1111        return $table_gui->getHTML();
 
 1126        if (!isset(
$_POST[
'appointments']) || !count(
$_POST[
'appointments'])) {
 
 1132        include_once(
'./Services/Utilities/classes/class.ilConfirmationGUI.php');
 
 1135        $this->ctrl->setParameter($this, 
'category_id', $this->category_id);
 
 1136        $confirmation_gui->setFormAction($this->ctrl->getFormAction($this));
 
 1137        $confirmation_gui->setHeaderText($this->lng->txt(
'cal_del_app_sure'));
 
 1138        $confirmation_gui->setConfirm($this->lng->txt(
'delete'), 
'deleteAppointments');
 
 1139        $confirmation_gui->setCancel($this->lng->txt(
'cancel'), 
'details');
 
 1141        include_once(
'./Services/Calendar/classes/class.ilCalendarEntry.php');
 
 1142        foreach (
$_POST[
'appointments'] as $app_id) {
 
 1144            $confirmation_gui->addItem(
'appointments[]', (
int) $app_id, 
$app->getTitle());
 
 1147        $tpl->setContent($confirmation_gui->getHTML());
 
 1158        if (!isset(
$_POST[
'appointments']) || !count(
$_POST[
'appointments'])) {
 
 1163        include_once(
'./Services/Calendar/classes/class.ilCalendarEntry.php');
 
 1164        foreach (
$_POST[
'appointments'] as $app_id) {
 
 1168            include_once(
'./Services/Calendar/classes/class.ilCalendarCategoryAssignments.php');
 
 1172        ilUtil::sendSuccess($this->lng->txt(
'settings_saved'));
 
 1182        $ilCtrl = 
$DIC[
'ilCtrl'];
 
 1184        include_once(
"./Services/Calendar/classes/class.ilCalendarSelectionBlockGUI.php");
 
 1186        $html = $ilCtrl->getHTML($block_gui);
 
 1202        $this->lng->loadLanguageModule(
'pd');
 
 1204        $tpl = 
new ilTemplate(
'tpl.calendar_selection.html', 
true, 
true, 
'Services/Calendar');
 
 1205        include_once(
'./Services/Calendar/classes/class.ilCalendarUserSettings.php');
 
 1208                $tpl->setVariable(
'HTEXT', $this->lng->txt(
'dash_memberships'));
 
 1209                $tpl->touchBlock(
'head_item');
 
 1210                $tpl->touchBlock(
'head_delim');
 
 1211                $tpl->touchBlock(
'head_item');
 
 1214                $this->ctrl->setParameter($this, 
'seed', $this->seed->get(
IL_CAL_DATE));
 
 1215                $tpl->setVariable(
'HHREF', $this->ctrl->getLinkTarget($this, 
'switchCalendarMode'));
 
 1216                $tpl->setVariable(
'HLINK', $this->lng->txt(
'dash_favourites'));
 
 1217                $tpl->touchBlock(
'head_item');
 
 1222                $this->ctrl->setParameter($this, 
'seed', $this->seed->get(
IL_CAL_DATE));
 
 1223                $tpl->setVariable(
'HHREF', $this->ctrl->getLinkTarget($this, 
'switchCalendarMode'));
 
 1224                $tpl->setVariable(
'HLINK', $this->lng->txt(
'dash_memberships'));
 
 1225                $tpl->touchBlock(
'head_item');
 
 1226                $tpl->touchBlock(
'head_delim');
 
 1227                $tpl->touchBlock(
'head_item');
 
 1229                $tpl->setVariable(
'HTEXT', $this->lng->txt(
'dash_favourites'));
 
 1230                $tpl->touchBlock(
'head_item');
 
 1244        include_once(
'./Services/Calendar/classes/class.ilCalendarUserSettings.php');
 
 1248        $this->ctrl->returnToParent($this);
 
 1264        $rbacsystem = 
$DIC[
'rbacsystem'];
 
 1265        $ilAccess = 
$DIC[
'ilAccess'];
 
 1267        $this->editable = 
false;
 
 1269        $this->visible = 
false;
 
 1270        $this->importable = 
false;
 
 1272        include_once(
'./Services/Calendar/classes/class.ilCalendarShared.php');
 
 1277        switch ($cat->getType()) {
 
 1280                if ($cat->getObjId() == 
$ilUser->getId()) {
 
 1281                    $this->visible = 
true;
 
 1282                    $this->editable = 
true;
 
 1283                    $this->importable = 
true;
 
 1284                } elseif (isset($shared[$cat->getCategoryID()])) {
 
 1285                    $this->visible = 
true;
 
 1291                $this->visible = 
true;
 
 1295                $this->editable = 
false;
 
 1298                foreach ($refs as $ref) {
 
 1299                    if ($ilAccess->checkAccess(
'read', 
'', $ref)) {
 
 1300                        $this->visible = 
true;
 
 1302                    if ($ilAccess->checkAccess(
'edit_event', 
'', $ref)) {
 
 1303                        $this->importable = 
true;
 
 1305                    if ($ilAccess->checkAccess(
'write', 
'', $ref)) {
 
 1306                        $this->editable = 
true;
 
 1313                $this->editable = 
$ilUser->getId() == $cat->getCategoryID();
 
 1314                $this->visible = 
true;
 
 1315                $this->importable = 
false;
 
 1331        if (!$this->visible) {
 
 1332            $ilErr->raiseError($this->lng->txt(
'permission_denied'), 
$ilErr->FATAL);
 
 1348        return $this->importable;
 
 1361        $tree = 
$DIC[
'tree'];
 
 1363        $tpl = 
new ilTemplate(
'tpl.cal_reference_links.html', 
true, 
true, 
'Services/Calendar');
 
 1366            include_once(
'./Services/Link/classes/class.ilLink.php');
 
 1368            $parent_ref_id = $tree->getParentId($ref_id);
 
 1376            $tpl->setCurrentBlock(
'reference');
 
 1379            $tpl->setVariable(
'PARENT_TITLE', $parent_title);
 
 1384            $tpl->setVariable(
'TITLE', $title);
 
 1386            $tpl->parseCurrentBlock();
 
 1397    protected function manage($a_reset_offsets = 
false)
 
 1402        $ilCtrl = 
$DIC[
'ilCtrl'];
 
 1407        include_once(
'./Services/Calendar/classes/class.ilCalendarManageTableGUI.php');
 
 1410        if ($a_reset_offsets) {
 
 1411            $table_gui->resetToDefaults();
 
 1414        $table_gui->parse();
 
 1416        include_once 
"./Services/UIComponent/Toolbar/classes/class.ilToolbarGUI.php";
 
 1417        $toolbar = 
new ilToolbarGui();
 
 1418        $ilCtrl->setParameter($this, 
'backvm', 1);
 
 1419        $toolbar->addButton(
$lng->txt(
"cal_add_calendar"), $ilCtrl->getLinkTarget($this, 
"add"));
 
 1421        $tpl->setContent($toolbar->getHTML() . $table_gui->getHTML());
 
 1431        $ilTabs = 
$DIC[
'ilTabs'];
 
 1434        if (!$this->category_id) {
 
 1436            $this->ctrl->returnToParent($this);
 
 1438        $this->ctrl->setParameter($this, 
'category_id', $this->category_id);
 
 1446            $this->ctrl->returnToParent($this);
 
 1449        $ilTabs->clearTargets();
 
 1450        $ilTabs->setBackTarget($this->lng->txt(
"back"), $this->ctrl->getLinkTarget($this, 
"cancel"));
 
 1456        $tpl->setContent($form->getHTML());
 
 1464        include_once 
'./Services/Form/classes/class.ilPropertyFormGUI.php';
 
 1466        $form->setTitle($this->lng->txt(
'cal_import_tbl'));
 
 1467        $form->setFormAction($this->ctrl->getFormAction($this));
 
 1469        $form->addCommandButton(
'uploadAppointments', $this->lng->txt(
'import'));
 
 1471        $ics = 
new ilFileInputGUI($this->lng->txt(
'cal_import_file'), 
'file');
 
 1472        $ics->setALlowDeletion(
false);
 
 1473        $ics->setSuffixes(array(
'ics'));
 
 1474        $ics->setInfo($this->lng->txt(
'cal_import_file_info'));
 
 1475        $form->addItem($ics);
 
 1486        if ($form->checkInput()) {
 
 1487            $file = $form->getInput(
'file');
 
 1492            $num = $this->
doImportFile($tmp, (
int) $_REQUEST[
'category_id']);
 
 1494            ilUtil::sendSuccess(sprintf($this->lng->txt(
'cal_imported_success'), (
int) $num), 
true);
 
 1495            $this->ctrl->redirect($this, 
'cancel');
 
 1509        include_once 
'./Services/Calendar/classes/../classes/iCal/class.ilICalParser.php';
 
 1510        include_once 
'./Services/Calendar/classes/class.ilCalendarCategoryAssignments.php';
 
 1520        return $assigned_after - $assigned_before;
 
 1537            $lng->txt(
"calendar"),
 
 1538            $ilCtrl->getLinkTarget($this, 
"manage")
 
 1542        $calendars = $status->getOpenInvitations();
 
 1546            $lng->txt(
"cal_shared_calendars"),
 
 1547            $ilCtrl->getLinkTarget($this, 
"invitations")
 
 1550        $ilTabs->activateSubTab($a_active);
 
 1564        include_once(
'./Services/Calendar/classes/class.ilCalendarInboxSharedTableGUI.php');
 
 1565        include_once(
'./Services/Calendar/classes/class.ilCalendarShared.php');
 
 1572        $this->tpl->setContent($table->getHTML());
 
 1588        if (!
$_POST[
'cal_ids'] or !is_array(
$_POST[
'cal_ids'])) {
 
 1594        include_once(
'./Services/Calendar/classes/class.ilCalendarSharedStatus.php');
 
 1597        include_once(
'./Services/Calendar/classes/class.ilCalendarShared.php');
 
 1598        foreach (
$_POST[
'cal_ids'] as $calendar_id) {
 
 1604            $status->accept($calendar_id);
 
 1607        ilUtil::sendSuccess($this->lng->txt(
'settings_saved'), 
true);
 
 1609        $this->ctrl->redirect($this, 
'invitations');
 
 1624        if (!
$_POST[
'cal_ids'] or !is_array(
$_POST[
'cal_ids'])) {
 
 1630        include_once(
'./Services/Calendar/classes/class.ilCalendarSharedStatus.php');
 
 1633        include_once(
'./Services/Calendar/classes/class.ilCalendarShared.php');
 
 1634        foreach (
$_POST[
'cal_ids'] as $calendar_id) {
 
 1640            $status->decline($calendar_id);
 
 1643        ilUtil::sendSuccess($this->lng->txt(
'settings_saved'), 
true);
 
 1645        $this->ctrl->redirect($this, 
'invitations');
 
if(!defined('PATH_SEPARATOR')) $GLOBALS['_PEAR_default_error_mode']
An exception for terminatinating execution or to throw for unit testing.
static getInstance()
Get instance.
Administrate calendar appointments.
static _getInstance($a_usr_id=0)
get singleton instance
static _getAssignedAppointments($a_cat_id)
Get assigned apointments.
static lookupNumberOfAssignedAppointments($a_cat_ids)
Get number of assigned appoitments.
static _deleteByAppointmentId($a_app_id)
Delete appointment assignment.
Administration, Side-Block presentation of calendar categories.
showAssignedAppointments()
show assigned aapointments
addSubTabs($a_active)
Add subtabs.
shareSearch()
share calendar
initFormCategory($a_mode)
init edit/create category form
appendCalendarSelection()
readPermissions()
read permissions
details()
show calendar details
invitations()
Invitations.
sharePerformSearch()
share perform search
initImportForm()
Create import form.
deleteAppointments()
delete appointments
switchCalendarMode()
Switch calendar selection nmode.
__construct($a_user_id, $seed, $a_ref_id=0)
Constructor.
declineShared()
accept shared calendar
saveSelection()
save selection of categories
doImportFile($file, $category_id)
Import ics.
isEditable()
check if calendar is editable @access private
shareAssignRolesEditable()
Share editable.
uploadAppointments()
Upload appointments.
shareAssignRoles($a_editable=false)
share assign roles
add(ilPropertyFormGUI $form=null)
add new calendar
unshare()
Stop calendar sharing.
manage($a_reset_offsets=false)
Manage calendars @global type $lng @global type $ilCtrl @global type $tpl.
confirmDelete()
confirm delete
showUserList($a_ids=array())
show user list
edit(ilPropertyFormGUI $form=null)
edit category
shareDeassign()
desassign users/roles from calendar
addReferenceLinks($a_obj_id)
Show links to references.
shareAssignEditable()
Share with write access.
askDeleteAppointments()
ask delete appointments
doSynchronisation(ilCalendarCategory $category)
Sync calendar.
executeCommand()
Execute command.
acceptShared()
accept shared calendar
importAppointments(ilPropertyFormGUI $form=null)
import appointments
shareAssign($a_editable=false)
share assign
getSearchToolbar()
Get search toolbar.
showRoleList($a_ids=array())
show role list
Stores calendar categories.
Model for a calendar entry.
Show shared calendars for a specific user.
show list of alle calendars to manage
Reader for remote ical calendars.
BlockGUI class calendar selection.
static _getInstance()
get singleton instance
Stores status (accepted/declined) of shared calendars.
Handles shared calendars.
static isSharedWithUser($a_usr_id, $a_calendar_id)
is shared with user
static getSharedCalendarsForUser($a_usr_id=0)
get shared calendars of user
const CAL_SELECTION_ITEMS
static _getInstance()
get instance for logged in user
const CAL_SELECTION_MEMBERSHIP
static _getInstanceByUserId($a_user_id, $a_ref_id=0)
get instance by user id
Confirmation screen class.
static _getLink($a_ref_id, $a_type='', $a_params=array(), $append="")
This class represents a non editable value in a property form.
static _getUserSearchInstance($query_parser)
get reference of ilLikeUserSearch
static _lookupObjId($a_id)
static _lookupTitle($a_id)
lookup object title
static _getAllReferences($a_id)
get all reference ids of object
static _lookupType($a_id, $a_reference=false)
lookup object type
This class represents an option in a radio group.
special template class to simplify handling of ITX/PEAR
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 moveUploadedFile($a_file, $a_name, $a_target, $a_raise_errors=true, $a_mode="move_uploaded")
move uploaded file
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
static ilTempnam($a_temp_path=null)
Returns a unique and non existing Path for e temporary file or directory.
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled
foreach($_POST as $key=> $value) $res