ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
class.ilCalendarCategoryGUI.php
Go to the documentation of this file.
1 <?php
2 /*
3  +-----------------------------------------------------------------------------+
4  | ILIAS open source |
5  +-----------------------------------------------------------------------------+
6  | Copyright (c) 1998-2006 ILIAS open source, University of Cologne |
7  | |
8  | This program is free software; you can redistribute it and/or |
9  | modify it under the terms of the GNU General Public License |
10  | as published by the Free Software Foundation; either version 2 |
11  | of the License, or (at your option) any later version. |
12  | |
13  | This program is distributed in the hope that it will be useful, |
14  | but WITHOUT ANY WARRANTY; without even the implied warranty of |
15  | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
16  | GNU General Public License for more details. |
17  | |
18  | You should have received a copy of the GNU General Public License |
19  | along with this program; if not, write to the Free Software |
20  | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
21  +-----------------------------------------------------------------------------+
22 */
23 
36 {
37  const SEARCH_USER = 1;
38  const SEARCH_ROLE = 2;
39 
40  const VIEW_MANAGE = 1;
41 
42  protected $user_id;
43  protected $tpl;
44  protected $ctrl;
45  protected $lng;
46 
47  protected $editable = false;
48  protected $visible = false;
49 
57  public function __construct($a_user_id,$seed)
58  {
59  global $lng,$ilCtrl;
60 
61  $this->user_id = $a_user_id;
62  $this->seed = $seed;
63  $this->lng = $lng;
64  $this->lng->loadLanguageModule('dateplaner');
65  $this->ctrl = $ilCtrl;
66  }
67 
75  public function executeCommand()
76  {
77  global $ilUser, $ilSetting,$tpl;
78 
79  $next_class = $this->ctrl->getNextClass($this);
80  $this->ctrl->saveParameter($this,'category_id');
81  $this->ctrl->setParameter($this,'seed',$this->seed->get(IL_CAL_DATE));
82  switch($next_class)
83  {
84  case 'ilcalendarappointmentgui':
85  $this->ctrl->setReturn($this,'details');
86 
87  include_once('./Services/Calendar/classes/class.ilCalendarAppointmentGUI.php');
88  $app = new ilCalendarAppointmentGUI($this->seed,$this->seed, (int) $_GET['app_id']);
89  $this->ctrl->forwardCommand($app);
90  break;
91 
92  default:
93  $cmd = $this->ctrl->getCmd("show");
94  $this->$cmd();
95  if(!in_array($cmd, array("details", "askDeleteAppointments", "deleteAppointments")))
96  {
97  return true;
98  }
99  }
100  return false;
101  }
102 
109  protected function cancel()
110  {
111  $this->ctrl->returnToParent($this);
112  }
113 
120  protected function add()
121  {
122  global $tpl, $ilTabs;
123 
124  $ilTabs->clearTargets();
125 
126  if($_REQUEST['backv'] == self::VIEW_MANAGE)
127  {
128  $back = 'manage';
129  }
130  else
131  {
132  $back = 'cancel';
133  }
134 
135  $ilTabs->setBackTarget($this->lng->txt("cal_back_to_list"), $this->ctrl->getLinkTarget($this, $back));
136 
137  $this->tpl = new ilTemplate('tpl.edit_category.html',true,true,'Services/Calendar');
138  $this->initFormCategory('create');
139  $this->tpl->setVariable('EDIT_CAT',$this->form->getHTML());
140  $tpl->setContent($this->tpl->get());
141  }
142 
148  protected function save()
149  {
150  global $ilUser;
151 
152  include_once('./Services/Calendar/classes/class.ilCalendarCategory.php');
153  $category = new ilCalendarCategory(0);
154  $category->setTitle(ilUtil::stripSlashes($_POST['title']));
155  $category->setColor('#'.ilUtil::stripSlashes($_POST['color']));
156  $category->setLocationType((int) $_POST['type_rl']);
157  $category->setRemoteUrl(ilUtil::stripSlashes($_POST['remote_url']));
158  $category->setRemoteUser(ilUtil::stripSlashes($_POST['remote_user']));
159  $category->setRemotePass(ilUtil::stripSlashes($_POST['remote_pass']));
160 
161  if(isset($_POST['type']) and $_POST['type'] == ilCalendarCategory::TYPE_GLOBAL)
162  {
163  $category->setType((int) $_POST['type']);
164  $category->setObjId(0);
165  }
166  else
167  {
168  $category->setType(ilCalendarCategory::TYPE_USR);
169  $category->setObjId($ilUser->getId());
170  }
171 
172  if(!$category->validate())
173  {
174  ilUtil::sendFailure($this->lng->txt('err_check_input'));
175  $this->add();
176  return false;
177  }
178  $category->add();
179 
180 
181  try {
182 
183  if($category->getLocationType() == ilCalendarCategory::LTYPE_REMOTE)
184  {
185  $this->doSynchronisation($category);
186  }
187  }
188  catch(Exception $e)
189  {
190  // Delete calendar if creation failed
191  $category->delete();
192  ilUtil::sendFailure($e->getMessage());
193  $this->manage();
194  return true;
195  }
196 
197  ilUtil::sendSuccess($this->lng->txt('settings_saved'),true);
198  // $this->ctrl->returnToParent($this);
199  $this->manage(true);
200  }
201 
208  protected function edit()
209  {
210  global $tpl, $ilTabs;
211 
212  if(!$_GET['category_id'])
213  {
214  ilUtil::sendFailure($this->lng->txt('select_one'),true);
215  $this->ctrl->returnToParent($this);
216  }
217 
218  $this->readPermissions();
219  $this->checkVisible();
220 
221  if(!$this->isEditable())
222  {
223  ilUtil::sendFailure($this->lng->txt('permission_denied'));
224  $this->manage();
225  return false;
226  }
227 
228  $ilTabs->clearTargets();
229  $ilTabs->setBackTarget($this->lng->txt("cal_back_to_list"), $this->ctrl->getLinkTarget($this, "manage"));
230 
231  $this->initFormCategory('edit');
232  $tpl->setContent($this->form->getHTML());
233  }
234 
241  protected function details()
242  {
243  global $tpl;
244 
245  if(!$_GET['category_id'])
246  {
247  ilUtil::sendFailure($this->lng->txt('select_one'),true);
248  $this->ctrl->returnToParent($this);
249  }
250 
251  $this->readPermissions();
252  $this->checkVisible();
253 
254  $category = new ilCalendarCategory((int) $_GET['category_id']);
255  if(!in_array($category->getType(), array(ilCalendarCategory::TYPE_CH, ilCalendarCategory::TYPE_BOOK)))
256  {
257  include_once "./Services/UIComponent/Toolbar/classes/class.ilToolbarGUI.php";
258  $toolbar = new ilToolbarGui();
259  $toolbar->addButton($this->lng->txt("cal_add_appointment"), $this->ctrl->getLinkTargetByClass("ilcalendarappointmentgui", "add"));
260 
261  if(!in_array($category->getType(), array(ilCalendarCategory::TYPE_CH, ilCalendarCategory::TYPE_BOOK)))
262  {
263  $toolbar->addButton($this->lng->txt("cal_import_appointments"), $this->ctrl->getLinkTarget($this, "importAppointments"));
264  }
265  $toolbar = $toolbar->getHTML();
266  }
267 
268  // Non editable category
269  include_once("./Services/InfoScreen/classes/class.ilInfoScreenGUI.php");
270  $info = new ilInfoScreenGUI($this);
271  $info->setFormAction($this->ctrl->getFormAction($this));
272 
273  $info->addSection($this->lng->txt('cal_cal_details'));
274 
275  // Calendar Name
276  $info->addProperty($this->lng->txt('cal_calendar_name'),$category->getTitle());
277  switch($category->getType())
278  {
280  $info->addProperty($this->lng->txt('cal_cal_type'),$this->lng->txt('cal_type_personal'));
281  break;
282 
284  $info->addProperty($this->lng->txt('cal_cal_type'),$this->lng->txt('cal_type_system'));
285  break;
286 
288  $info->addProperty($this->lng->txt('cal_cal_type'),$this->lng->txt('cal_type_'.$category->getObjType()));
289 
290  $info->addSection($this->lng->txt('additional_info'));
291  $info->addProperty($this->lng->txt('perma_link'),$this->addReferenceLinks($category->getObjId()));
292  break;
293 
296  // nothing to do
297  break;
298  }
299 
300  // Ical link
301  include_once("./Services/News/classes/class.ilRSSButtonGUI.php");
302  $this->ctrl->setParameterByClass('ilcalendarsubscriptiongui','cal_id',(int) $_GET['category_id']);
303  $info->addProperty(
304  $this->lng->txt('cal_ical_infoscreen'),
306  $this->ctrl->getLinkTargetByClass(array('ilcalendarpresentationgui','ilcalendarsubscriptiongui'))
307  );
308 
309  $tpl->setContent($toolbar.$info->getHTML().$this->showAssignedAppointments());
310  }
311 
312  protected function synchroniseCalendar()
313  {
314  if(!$_GET['category_id'])
315  {
316  ilUtil::sendFailure($this->lng->txt('select_one'),true);
317  $this->ctrl->returnToParent($this);
318  }
319 
320  $category = new ilCalendarCategory((int) $_GET['category_id']);
321 
322  try {
323  $this->doSynchronisation($category);
324  }
325  catch(Exception $e) {
326  ilUtil::sendFailure($e->getMessage(),true);
327  $this->ctrl->redirect($this,'manage');
328  }
329  ilUtil::sendSuccess($this->lng->txt('cal_cal_sync_success'),true);
330  $this->ctrl->redirect($this,'manage');
331  }
332 
337  protected function doSynchronisation(ilCalendarCategory $category)
338  {
339  include_once './Services/Calendar/classes/class.ilCalendarRemoteReader.php';
340  $remote = new ilCalendarRemoteReader($category->getRemoteUrl());
341  $remote->setUser($category->getRemoteUser());
342  $remote->setPass($category->getRemotePass());
343  $remote->read();
344  $remote->import($category);
345  }
346 
353  protected function update()
354  {
355  if(!$_GET['category_id'])
356  {
357  ilUtil::sendFailure($this->lng->txt('select_one'),true);
358  $this->ctrl->returnToParent($this);
359  }
360  $this->readPermissions();
361  if(!$this->isEditable())
362  {
363  ilUtil::sendFailure($this->lng->txt('permission_denied'));
364  $this->edit();
365  return false;
366  }
367 
368  include_once('./Services/Calendar/classes/class.ilCalendarCategory.php');
369  $category = new ilCalendarCategory((int) $_GET['category_id']);
370  $category->setTitle(ilUtil::stripSlashes($_POST['title']));
371  $category->setColor('#'.ilUtil::stripSlashes($_POST['color']));
372  $category->update();
373 
374  ilUtil::sendSuccess($this->lng->txt('settings_saved'),true);
375  // $this->ctrl->returnToParent($this);
376  $this->manage();
377  }
378 
385  protected function confirmDelete()
386  {
387  global $tpl;
388 
389  if(!$_POST['selected_cat_ids'])
390  {
391  ilUtil::sendFailure($this->lng->txt('select_one'),true);
392  $this->manage();
393  }
394 
395  /*
396  $this->readPermissions();
397  if(!$this->isEditable())
398  {
399  ilUtil::sendFailure($this->lng->txt('permission_denied'));
400  $this->manage();
401  return false;
402  }
403  */
404 
405  include_once('./Services/Utilities/classes/class.ilConfirmationGUI.php');
406  $confirmation_gui = new ilConfirmationGUI();
407 
408  $confirmation_gui->setFormAction($this->ctrl->getFormAction($this));
409  $confirmation_gui->setHeaderText($this->lng->txt('cal_del_cal_sure'));
410  $confirmation_gui->setConfirm($this->lng->txt('delete'),'delete');
411  $confirmation_gui->setCancel($this->lng->txt('cancel'),'manage');
412 
413  include_once('./Services/Calendar/classes/class.ilCalendarCategory.php');
414  foreach($_POST['selected_cat_ids'] as $cat_id)
415  {
416  $category = new ilCalendarCategory((int)$cat_id);
417  $confirmation_gui->addItem('category_id[]',$cat_id,$category->getTitle());
418  }
419 
420  $tpl->setContent($confirmation_gui->getHTML());
421  }
422 
430  protected function delete()
431  {
432  global $ilCtrl;
433 
434  if(!$_POST['category_id'])
435  {
436  ilUtil::sendFailure($this->lng->txt('select_one'),true);
437  $this->manage();
438  }
439 
440  /*
441  $this->readPermissions();
442  if(!$this->isEditable())
443  {
444  ilUtil::sendFailure($this->lng->txt('permission_denied'));
445  $this->edit();
446  return false;
447  }
448  */
449 
450  include_once('./Services/Calendar/classes/class.ilCalendarCategory.php');
451  foreach($_POST['category_id'] as $cat_id)
452  {
453  $category = new ilCalendarCategory((int)$cat_id);
454  $category->delete();
455  }
456 
457  ilUtil::sendSuccess($this->lng->txt('cal_cal_deleted'), true);
458  $ilCtrl->redirect($this, 'manage');
459  }
460 
461 
462 
470  public function saveSelection()
471  {
472  global $ilUser;
473 
474  include_once('./Services/Calendar/classes/class.ilCalendarCategories.php');
475  include_once('./Services/Calendar/classes/class.ilCalendarHidden.php');
476 
477  $selected_cat_ids = $_POST['selected_cat_ids'] ? $_POST['selected_cat_ids'] : array();
478  $shown_cat_ids = $_POST['shown_cat_ids'] ? $_POST['shown_cat_ids'] : array();
479 
480  $cats = ilCalendarCategories::_getInstance($ilUser->getId());
481  $cat_ids = $cats->getCategories();
482 
483  $hidden_cats = ilCalendarHidden::_getInstanceByUserId($ilUser->getId());
484  $hidden_cat_ids = $hidden_cats->getHidden();
485 
486  $hidden = array();
487 
488  foreach($hidden_cat_ids as $hidden_cat_id)
489  {
490  if( !in_array($hidden_cat_id,$shown_cat_ids) )
491  {
492  $hidden[] = $hidden_cat_id;
493  }
494  }
495 
496  foreach($shown_cat_ids as $shown_cat_id)
497  {
498  $shown_cat_id = (int)$shown_cat_id;
499  if( !in_array($shown_cat_id, $selected_cat_ids) )
500  {
501  $hidden[] = $shown_cat_id;
502  }
503  }
504 
505  $hidden_categories = ilCalendarHidden::_getInstanceByUserId($this->user_id);
506  $hidden_categories->hideSelected($hidden);
507  $hidden_categories->save();
508 
509  ilUtil::sendSuccess($this->lng->txt('settings_saved'),true);
510  $this->ctrl->returnToParent($this);
511  }
512 
520  public function showCategories()
521  {
522  include_once('./Services/Calendar/classes/class.ilCalendarCategoryTableGUI.php');
523  $table_gui = new ilCalendarCategoryTableGUI($this,$this->seed);
524  $nav_parameter = $table_gui->getNavParameter();
525 
526  if($_POST[$nav_parameter] != "")
527  {
528  if($_POST[$nav_parameter."1"] != $_POST[$nav_parameter])
529  {
530  $nav_value = $_POST[$nav_parameter."1"];
531  }
532  elseif($_POST[$nav_parameter."2"] != $_POST[$nav_parameter])
533  {
534  $nav_value = $_POST[$nav_parameter."2"];
535  }
536  }
537  else
538  {
539  $nav_value = $_GET[$nav_parameter];
540  }
541 
542  $_SESSION[$nav_parameter] = $nav_value;
543 
544  $this->ctrl->returnToParent($this);
545  }
546 
554  public function shareSearch()
555  {
556  global $tpl, $ilTabs;
557 
558  if(!$_GET['category_id'])
559  {
560  ilUtil::sendFailure($this->lng->txt('select_one'),true);
561  $this->ctrl->returnToParent($this);
562  }
563 
564  $this->readPermissions();
565  if(!$this->isEditable())
566  {
567  ilUtil::sendFailure($this->lng->txt('permission_denied'));
568  $this->manage();
569  return false;
570  }
571 
572  $ilTabs->clearTargets();
573  $ilTabs->setBackTarget($this->lng->txt("cal_back_to_list"), $this->ctrl->getLinkTarget($this, "manage"));
574 
575  $_SESSION['cal_query'] = '';
576 
577  $this->ctrl->saveParameter($this,'category_id');
578  $this->initFormSearch();
579 
580  include_once('./Services/Calendar/classes/class.ilCalendarSharedListTableGUI.php');
581  $table = new ilCalendarSharedListTableGUI($this,'shareSearch');
582  $table->setTitle($this->lng->txt('cal_shared_header'));
583  $table->setCalendarId((int) $_GET['category_id']);
584  $table->parse();
585 
586  $tpl->setContent($this->form->getHTML().'<br />'.$table->getHTML());
587  }
588 
595  public function sharePerformSearch()
596  {
597  global $ilTabs;
598 
599  $this->lng->loadLanguageModule('search');
600 
601  if(!$_GET['category_id'])
602  {
603  ilUtil::sendFailure($this->lng->txt('select_one'),true);
604  $this->ctrl->returnToParent($this);
605  }
606  $this->ctrl->saveParameter($this,'category_id');
607 
608 
609  if(!isset($_POST['query']))
610  {
611  $query = $_SESSION['cal_query'];
612  $type = $_SESSION['cal_type'];
613  }
614  elseif($_POST['query'])
615  {
616  $query = $_SESSION['cal_query'] = $_POST['query'];
617  $type = $_SESSION['cal_type'] = $_POST['query_type'];
618  }
619 
620  if(!$query)
621  {
622  ilUtil::sendFailure($this->lng->txt('msg_no_search_string'));
623  $this->shareSearch();
624  return false;
625  }
626 
627 
628  include_once 'Services/Search/classes/class.ilQueryParser.php';
629  include_once 'Services/Search/classes/class.ilObjectSearchFactory.php';
630  include_once 'Services/Search/classes/class.ilSearchResult.php';
631 
632  $res_sum = new ilSearchResult();
633 
634  $query_parser = new ilQueryParser(ilUtil::stripSlashes($query));
635  $query_parser->setCombination(QP_COMBINATION_OR);
636  $query_parser->setMinWordLength(3);
637  $query_parser->parse();
638 
639 
640  switch($type)
641  {
642  case self::SEARCH_USER:
643  $search = ilObjectSearchFactory::_getUserSearchInstance($query_parser);
644  $search->enableActiveCheck(true);
645 
646  $search->setFields(array('login'));
647  $res = $search->performSearch();
648  $res_sum->mergeEntries($res);
649 
650  $search->setFields(array('firstname'));
651  $res = $search->performSearch();
652  $res_sum->mergeEntries($res);
653 
654  $search->setFields(array('lastname'));
655  $res = $search->performSearch();
656  $res_sum->mergeEntries($res);
657 
658  $res_sum->filter(ROOT_FOLDER_ID,QP_COMBINATION_OR);
659  break;
660 
661  case self::SEARCH_ROLE:
662 
663  include_once 'Services/Search/classes/Like/class.ilLikeObjectSearch.php';
664  $search = new ilLikeObjectSearch($query_parser);
665  $search->setFilter(array('role'));
666 
667  $res = $search->performSearch();
668  $res_sum->mergeEntries($res);
669 
670  $res_sum->filter(ROOT_FOLDER_ID,QP_COMBINATION_OR);
671  break;
672  }
673 
674  if(!count($res_sum->getResults()))
675  {
676  ilUtil::sendFailure($this->lng->txt('search_no_match'));
677  $this->shareSearch();
678  return true;
679  }
680 
681  $ilTabs->clearTargets();
682  $ilTabs->setBackTarget($this->lng->txt("cal_back_to_search"), $this->ctrl->getLinkTarget($this, "shareSearch"));
683 
684  switch($type)
685  {
686  case self::SEARCH_USER:
687  $this->showUserList($res_sum->getResultIds());
688  break;
689 
690  case self::SEARCH_ROLE:
691  $this->showRoleList($res_sum->getResultIds());
692  break;
693  }
694  }
695 
699  public function shareAssignEditable()
700  {
701  return $this->shareAssign(true);
702  }
703 
710  public function shareAssign($a_editable = false)
711  {
712  global $ilUser;
713 
714  if(!$_GET['category_id'])
715  {
716  ilUtil::sendFailure($this->lng->txt('select_one'),true);
717  $this->ctrl->returnToParent($this);
718  }
719  if(!count($_POST['user_ids']))
720  {
721  ilUtil::sendFailure($this->lng->txt('select_one'));
722  $this->sharePerformSearch();
723  return false;
724  }
725 
726  $this->readPermissions();
727  if(!$this->isEditable())
728  {
729  ilUtil::sendFailure($this->lng->txt('permission_denied'));
730  $this->shareSearch();
731  return false;
732  }
733 
734 
735  include_once('./Services/Calendar/classes/class.ilCalendarShared.php');
736  $shared = new ilCalendarShared((int) $_GET['category_id']);
737 
738  foreach($_POST['user_ids'] as $user_id)
739  {
740  if($ilUser->getId() != $user_id)
741  {
742  $shared->share($user_id,ilCalendarShared::TYPE_USR,$a_editable);
743  }
744  }
745  ilUtil::sendSuccess($this->lng->txt('cal_shared_selected_usr'));
746  $this->shareSearch();
747  }
748 
752  protected function shareAssignRolesEditable()
753  {
754  return $this->shareAssignRoles(true);
755  }
756 
764  public function shareAssignRoles($a_editable = false)
765  {
766  global $ilUser;
767 
768  if(!$_GET['category_id'])
769  {
770  ilUtil::sendFailure($this->lng->txt('select_one'),true);
771  $this->ctrl->returnToParent($this);
772  }
773  if(!count($_POST['role_ids']))
774  {
775  ilUtil::sendFailure($this->lng->txt('select_one'));
776  $this->sharePerformSearch();
777  return false;
778  }
779 
780  $this->readPermissions();
781  if(!$this->isEditable())
782  {
783  ilUtil::sendFailure($this->lng->txt('permission_denied'));
784  $this->shareSearch();
785  return false;
786  }
787 
788  include_once('./Services/Calendar/classes/class.ilCalendarShared.php');
789  $shared = new ilCalendarShared((int) $_GET['category_id']);
790 
791  foreach($_POST['role_ids'] as $role_id)
792  {
793  $shared->share($role_id,ilCalendarShared::TYPE_ROLE,$a_editable);
794  }
795  ilUtil::sendSuccess($this->lng->txt('cal_shared_selected_usr'));
796  $this->shareSearch();
797  }
798 
806  public function shareDeassign()
807  {
808  if(!$_GET['category_id'])
809  {
810  ilUtil::sendFailure($this->lng->txt('select_one'),true);
811  $this->ctrl->returnToParent($this);
812  }
813  if(!count($_POST['obj_ids']))
814  {
815  ilUtil::sendFailure($this->lng->txt('select_one'));
816  $this->shareSearch();
817  return false;
818  }
819 
820  $this->readPermissions();
821  if(!$this->isEditable())
822  {
823  ilUtil::sendFailure($this->lng->txt('permission_denied'));
824  $this->shareSearch();
825  return false;
826  }
827 
828 
829  include_once('./Services/Calendar/classes/class.ilCalendarShared.php');
830  $shared = new ilCalendarShared((int) $_GET['category_id']);
831 
832  foreach($_POST['obj_ids'] as $obj_id)
833  {
834  $shared->stopSharing($obj_id);
835  }
836  ilUtil::sendSuccess($this->lng->txt('cal_unshared_selected_usr'));
837  $this->shareSearch();
838  return true;
839  }
840 
841 
849  protected function showUserList($a_ids = array())
850  {
851  global $tpl;
852 
853  include_once('./Services/Calendar/classes/class.ilCalendarSharedUserListTableGUI.php');
854 
855  $table = new ilCalendarSharedUserListTableGUI($this,'sharePerformSearch');
856  $table->setTitle($this->lng->txt('cal_share_search_usr_header'));
857  $table->setFormAction($this->ctrl->getFormAction($this));
858  $table->setUsers($a_ids);
859  $table->parse();
860 
861  // $table->addCommandButton('shareSearch',$this->lng->txt('search_new'));
862  // $table->addCommandButton('manage',$this->lng->txt('cancel'));
863 
864  $tpl->setContent($table->getHTML());
865  }
866 
874  protected function showRoleList($a_ids = array())
875  {
876  global $tpl;
877 
878  include_once('./Services/Calendar/classes/class.ilCalendarSharedRoleListTableGUI.php');
879 
880  $table = new ilCalendarSharedRoleListTableGUI($this,'sharePerformSearch');
881  $table->setTitle($this->lng->txt('cal_share_search_role_header'));
882  $table->setFormAction($this->ctrl->getFormAction($this));
883  $table->setRoles($a_ids);
884  $table->parse();
885 
886  // $table->addCommandButton('shareSearch',$this->lng->txt('search_new'));
887  // $table->addCommandButton('manage',$this->lng->txt('cancel'));
888 
889  $tpl->setContent($table->getHTML());
890  }
891 
899  protected function initFormSearch()
900  {
901  global $lng;
902 
903  $lng->loadLanguageModule('search');
904 
905  if(!is_object($this->form))
906  {
907  include_once('Services/Form/classes/class.ilPropertyFormGUI.php');
908  $this->form = new ilPropertyFormGUI();
909  $this->form->setFormAction($this->ctrl->getFormAction($this));
910  $this->form->setTitle($this->lng->txt('cal_share_search_header'));
911  }
912 
913  $type = new ilRadioGroupInputGUI($this->lng->txt('search_type'),'query_type');
914  $type->setValue($_POST['query_type'] ? $_POST['query_type'] : self::SEARCH_USER);
915  $type->setRequired(true);
916 
917  $user = new ilRadioOption($this->lng->txt('obj_user'),self::SEARCH_USER);
918  $type->addOption($user);
919 
920  $role = new ilRadioOption($this->lng->txt('obj_role'),self::SEARCH_ROLE);
921  $type->addOption($role);
922 
923  $this->form->addItem($type);
924 
925  $search = new ilTextInputGUI($this->lng->txt('cal_search'),'query');
926  $search->setValue($_POST['query']);
927  $search->setSize(16);
928  $search->setMaxLength(128);
929  $search->setRequired(true);
930  $search->setInfo($this->lng->txt('cal_search_info_share'));
931 
932  $this->form->addItem($search);
933  $this->form->addCommandButton('sharePerformSearch',$this->lng->txt('search'));
934  // $this->form->addCommandButton('manage',$this->lng->txt('cancel'));
935  }
936 
943  protected function initFormCategory($a_mode)
944  {
945  global $rbacsystem,$ilUser, $ilHelp;
946 
947  $ilHelp->setScreenIdComponent("cal");
948  $ilHelp->setScreenId("cal");
949  if ($a_mode == "edit")
950  {
951  $ilHelp->setSubScreenId("edit");
952  }
953  else
954  {
955  $ilHelp->setSubScreenId("create");
956  }
957 
958  include_once('./Services/Form/classes/class.ilPropertyFormGUI.php');
959  include_once('./Services/Calendar/classes/class.ilCalendarCategory.php');
960 
961  include_once('./Services/Calendar/classes/class.ilCalendarCategories.php');
962  $cat_info = ilCalendarCategories::_getInstance()->getCategoryInfo((int) $_GET['category_id']);
963 
964  $this->form = new ilPropertyFormGUI();
965  #$this->form->setTableWidth('40%');
966  switch($a_mode)
967  {
968  case 'edit':
969  $category = new ilCalendarCategory((int) $_GET['category_id']);
970  $this->form->setTitle($this->lng->txt('cal_edit_category'));
971  $this->ctrl->saveParameter($this,array('seed','category_id'));
972  $this->form->setFormAction($this->ctrl->getFormAction($this));
973  if($this->isEditable())
974  {
975  $this->form->addCommandButton('update',$this->lng->txt('save'));
976 
977  /*
978  if($cat_info['type'] == ilCalendarCategory::TYPE_USR)
979  {
980  $this->form->addCommandButton('shareSearch',$this->lng->txt('cal_share'));
981  }
982  $this->form->addCommandButton('confirmDelete',$this->lng->txt('delete'));
983  */
984 
985  $this->form->addCommandButton('manage',$this->lng->txt('cancel'));
986  }
987  break;
988  case 'create':
989  $this->editable = true;
990  $category = new ilCalendarCategory(0);
991  $this->ctrl->saveParameter($this,array('category_id'));
992  $this->form->setFormAction($this->ctrl->getFormAction($this));
993  $this->form->setTitle($this->lng->txt('cal_add_category'));
994  $this->form->addCommandButton('save',$this->lng->txt('save'));
995  $this->form->addCommandButton('manage',$this->lng->txt('cancel'));
996  break;
997  }
998 
999  // Calendar name
1000  $title = new ilTextInputGUI($this->lng->txt('cal_calendar_name'),'title');
1001  if($a_mode == 'edit')
1002  {
1003  $title->setDisabled(!$this->isEditable());
1004  }
1005  $title->setRequired(true);
1006  $title->setMaxLength(64);
1007  $title->setSize(32);
1008  $title->setValue($category->getTitle());
1009  $this->form->addItem($title);
1010 
1011 
1012  include_once('./Services/Calendar/classes/class.ilCalendarSettings.php');
1013  if($a_mode == 'create' and $rbacsystem->checkAccess('edit_event',ilCalendarSettings::_getInstance()->getCalendarSettingsId()))
1014  {
1015  $type = new ilRadioGroupInputGUI($this->lng->txt('cal_cal_type'),'type');
1016  $type->setValue($category->getType());
1017  $type->setRequired(true);
1018 
1019  $opt = new ilRadioOption($this->lng->txt('cal_type_personal'),ilCalendarCategory::TYPE_USR);
1020  $type->addOption($opt);
1021 
1022  $opt = new ilRadioOption($this->lng->txt('cal_type_system'),ilCalendarCategory::TYPE_GLOBAL);
1023  $type->addOption($opt);
1024  $type->setInfo($this->lng->txt('cal_type_info'));
1025  $this->form->addItem($type);
1026  }
1027 
1028 
1029  $color = new ilColorPickerInputGUI($this->lng->txt('cal_calendar_color'),'color');
1030  $color->setValue($category->getColor());
1031  if(!$this->isEditable())
1032  {
1033  $color->setDisabled(true);
1034  }
1035  $color->setRequired(true);
1036  $this->form->addItem($color);
1037 
1038  $location = new ilRadioGroupInputGUI($this->lng->txt('cal_type_rl'), 'type_rl');
1039  $location->setDisabled($a_mode == 'edit');
1040  $location_local = new ilRadioOption($this->lng->txt('cal_type_local'), ilCalendarCategory::LTYPE_LOCAL);
1041  $location->addOption($location_local);
1042  $location_remote = new ilRadioOption($this->lng->txt('cal_type_remote'), ilCalendarCategory::LTYPE_REMOTE);
1043  $location->addOption($location_remote);
1044  $location->setValue($category->getLocationType());
1045 
1046 
1047  $url = new ilTextInputGUI($this->lng->txt('cal_remote_url'), 'remote_url');
1048  $url->setDisabled($a_mode == 'edit');
1049  $url->setValue($category->getRemoteUrl());
1050  $url->setMaxLength(500);
1051  $url->setSize(60);
1052  $url->setRequired(true);
1053  $location_remote->addSubItem($url);
1054 
1055  $user = new ilTextInputGUI($this->lng->txt('username'),'remote_user');
1056  $user->setDisabled($a_mode == 'edit');
1057  $user->setValue($category->getRemoteUser());
1058  $user->setMaxLength(50);
1059  $user->setSize(20);
1060  $user->setRequired(false);
1061  $location_remote->addSubItem($user);
1062 
1063  $pass = new ilPasswordInputGUI($this->lng->txt('password'),'remote_pass');
1064  $pass->setDisabled($a_mode == 'edit');
1065  $pass->setValue($category->getRemotePass());
1066  $pass->setMaxLength(50);
1067  $pass->setSize(20);
1068  $pass->setRetype(false);
1069  $pass->setInfo($this->lng->txt('remote_pass_info'));
1070  $location_remote->addSubItem($pass);
1071 
1072  $this->form->addItem($location);
1073 
1074  }
1075 
1079  protected function unshare()
1080  {
1081  global $ilUser;
1082 
1083  if(!$_GET['category_id'])
1084  {
1085  ilUtil::sendFailure($this->lng->txt('select_one'),true);
1086  $this->ctrl->returnToParent($this);
1087  }
1088 
1089  $this->readPermissions();
1090  $this->checkVisible();
1091 
1092  include_once('./Services/Calendar/classes/class.ilCalendarSharedStatus.php');
1093  $status = new ilCalendarSharedStatus($ilUser->getId());
1094 
1095  include_once('./Services/Calendar/classes/class.ilCalendarShared.php');
1096  if(!ilCalendarShared::isSharedWithUser($ilUser->getId(), $_GET['category_id']))
1097  {
1098  ilUtil::sendFailure($this->lng->txt('permission_denied'));
1099  $this->inbox();
1100  return false;
1101  }
1102  $status->decline($_GET['category_id']);
1103 
1104  ilUtil::sendSuccess($this->lng->txt('settings_saved'), true);
1105  $this->ctrl->redirect($this, 'manage');
1106  }
1107 
1114  protected function showAssignedAppointments()
1115  {
1116  include_once('./Services/Calendar/classes/class.ilCalendarCategoryTableGUI.php');
1117  include_once('./Services/Calendar/classes/class.ilCalendarCategoryAssignments.php');
1118  include_once('./Services/Calendar/classes/class.ilCalendarAppointmentsTableGUI.php');
1119 
1120  $table_gui = new ilCalendarAppointmentsTableGUI($this, 'details', (int)$_GET['category_id']);
1121  $table_gui->setTitle($this->lng->txt('cal_assigned_appointments'));
1122  $table_gui->setAppointments(
1124  ilCalendarCategories::_getInstance()->getSubitemCategories((int) $_GET['category_id'])));
1125  return $table_gui->getHTML();
1126  }
1127 
1134  protected function askDeleteAppointments()
1135  {
1136  global $tpl;
1137 
1138  if(!count($_POST['appointments']))
1139  {
1140  ilUtil::sendFailure($this->lng->txt('select_one'));
1141  $this->details();
1142  return true;
1143  }
1144 
1145  include_once('./Services/Utilities/classes/class.ilConfirmationGUI.php');
1146  $confirmation_gui = new ilConfirmationGUI();
1147 
1148  $this->ctrl->setParameter($this,'category_id',(int) $_GET['category_id']);
1149  $confirmation_gui->setFormAction($this->ctrl->getFormAction($this));
1150  $confirmation_gui->setHeaderText($this->lng->txt('cal_del_app_sure'));
1151  $confirmation_gui->setConfirm($this->lng->txt('delete'),'deleteAppointments');
1152  $confirmation_gui->setCancel($this->lng->txt('cancel'),'details');
1153 
1154  include_once('./Services/Calendar/classes/class.ilCalendarEntry.php');
1155  foreach($_POST['appointments'] as $app_id)
1156  {
1157  $app = new ilCalendarEntry($app_id);
1158  $confirmation_gui->addItem('appointments[]',(int) $app_id,$app->getTitle());
1159  }
1160 
1161  $tpl->setContent($confirmation_gui->getHTML());
1162  }
1163 
1170  protected function deleteAppointments()
1171  {
1172  if(!count($_POST['appointments']))
1173  {
1174  ilUtil::sendFailure($this->lng->txt('select_one'));
1175  $this->details();
1176  return true;
1177  }
1178  include_once('./Services/Calendar/classes/class.ilCalendarEntry.php');
1179  foreach($_POST['appointments'] as $app_id)
1180  {
1181  $app = new ilCalendarEntry($app_id);
1182  $app->delete();
1183 
1184  include_once('./Services/Calendar/classes/class.ilCalendarCategoryAssignments.php');
1186  }
1187 
1188  ilUtil::sendSuccess($this->lng->txt('settings_saved'));
1189  $this->details();
1190  return true;
1191 
1192  }
1193 
1194  public function getHTML()
1195  {
1196  global $ilUser, $ilCtrl;
1197 
1198  include_once("./Services/Calendar/classes/class.ilCalendarSelectionBlockGUI.php");
1199  $block_gui = new ilCalendarSelectionBlockGUI($this->seed);
1200  $html = $ilCtrl->getHTML($block_gui);
1201  return $html;
1202  }
1203 
1204 
1210  protected function appendCalendarSelection()
1211  {
1212  global $ilUser;
1213 
1214  $this->lng->loadLanguageModule('pd');
1215 
1216  $tpl = new ilTemplate('tpl.calendar_selection.html',true,true,'Services/Calendar');
1217  include_once('./Services/Calendar/classes/class.ilCalendarUserSettings.php');
1218  switch(ilCalendarUserSettings::_getInstance()->getCalendarSelectionType())
1219  {
1221  $tpl->setVariable('HTEXT',$this->lng->txt('pd_my_memberships'));
1222  $tpl->touchBlock('head_item');
1223  $tpl->touchBlock('head_delim');
1224  $tpl->touchBlock('head_item');
1225 
1226  $this->ctrl->setParameter($this,'calendar_mode',ilCalendarUserSettings::CAL_SELECTION_ITEMS);
1227  $this->ctrl->setParameter($this,'seed',$this->seed->get(IL_CAL_DATE));
1228  $tpl->setVariable('HHREF',$this->ctrl->getLinkTarget($this,'switchCalendarMode'));
1229  $tpl->setVariable('HLINK',$this->lng->txt('pd_my_offers'));
1230  $tpl->touchBlock('head_item');
1231  break;
1232 
1234  $this->ctrl->setParameter($this,'calendar_mode',ilCalendarUserSettings::CAL_SELECTION_MEMBERSHIP);
1235  $this->ctrl->setParameter($this,'seed',$this->seed->get(IL_CAL_DATE));
1236  $tpl->setVariable('HHREF',$this->ctrl->getLinkTarget($this,'switchCalendarMode'));
1237  $tpl->setVariable('HLINK',$this->lng->txt('pd_my_memberships'));
1238  $tpl->touchBlock('head_item');
1239  $tpl->touchBlock('head_delim');
1240  $tpl->touchBlock('head_item');
1241 
1242  $tpl->setVariable('HTEXT',$this->lng->txt('pd_my_offers'));
1243  $tpl->touchBlock('head_item');
1244  break;
1245 
1246 
1247  }
1248  return $tpl->get();
1249  }
1250 
1255  protected function switchCalendarMode()
1256  {
1257  include_once('./Services/Calendar/classes/class.ilCalendarUserSettings.php');
1258  ilCalendarUserSettings::_getInstance()->setCalendarSelectionType((int) $_GET['calendar_mode']);
1260 
1261  $this->ctrl->returnToParent($this);
1262 
1263  }
1264 
1265 
1273  private function readPermissions()
1274  {
1275  global $ilUser,$rbacsystem,$ilAccess;
1276 
1277  $this->editable = false;
1278  $this->visible = false;
1279  $this->importable = false;
1280 
1281  include_once('./Services/Calendar/classes/class.ilCalendarShared.php');
1282 
1283  $shared = ilCalendarShared::getSharedCalendarsForUser($ilUser->getId());
1284  $cat = new ilCalendarCategory((int) $_GET['category_id']);
1285 
1286  switch($cat->getType())
1287  {
1289 
1290  if($cat->getObjId() == $ilUser->getId())
1291  {
1292  $this->visible = true;
1293  $this->editable = true;
1294  $this->importable = true;
1295  }
1296  elseif(isset($shared[$cat->getCategoryID()]))
1297  {
1298  $this->visible = true;
1299  }
1300  break;
1301 
1303  $this->importable = $this->editable = $rbacsystem->checkAccess('edit_event',ilCalendarSettings::_getInstance()->getCalendarSettingsId());
1304  $this->visible = true;
1305  break;
1306 
1308  $this->editable = false;
1309 
1310  $refs = ilObject::_getAllReferences($cat->getObjId());
1311  foreach($refs as $ref)
1312  {
1313  if($ilAccess->checkAccess('read','',$ref))
1314  {
1315  $this->visible = true;
1316  }
1317  if($ilAccess->checkAccess('edit_event','',$ref))
1318  {
1319  $this->importable = true;
1320  }
1321  }
1322  break;
1323 
1326  $this->editable = $ilUser->getId() == $cat->getCategoryID();
1327  $this->visible = true;
1328  $this->importable = false;
1329  break;
1330  }
1331 
1332  }
1333 
1339  protected function checkVisible()
1340  {
1341  global $ilErr;
1342 
1343  if(!$this->visible)
1344  {
1345  $ilErr->raiseError($this->lng->txt('permission_denied'),$ilErr->FATAL);
1346  }
1347  }
1348 
1354  private function isEditable()
1355  {
1356  return $this->editable;
1357  }
1358 
1359  protected function isImportable()
1360  {
1361  return $this->importable;
1362  }
1363 
1364 
1370  protected function addReferenceLinks($a_obj_id)
1371  {
1372  global $tree;
1373 
1374  $tpl = new ilTemplate('tpl.cal_reference_links.html',true,true,'Services/Calendar');
1375 
1376  foreach(ilObject::_getAllReferences($a_obj_id) as $ref_id => $ref_id)
1377  {
1378  include_once('./Services/Link/classes/class.ilLink.php');
1379 
1380  $parent_ref_id = $tree->getParentId($ref_id);
1381  $parent_obj_id = ilObject::_lookupObjId($parent_ref_id);
1382  $parent_type = ilObject::_lookupType($parent_obj_id);
1383  $parent_title = ilObject::_lookupTitle($parent_obj_id);
1384 
1385  $type = ilObject::_lookupType($a_obj_id);
1386  $title = ilObject::_lookupTitle($a_obj_id);
1387 
1388  $tpl->setCurrentBlock('reference');
1389  $tpl->setVariable('PIMG_SRC',ilUtil::getTypeIconPath($parent_type,$parent_obj_id,'tiny'));
1390  $tpl->setVariable('PIMG_ALT',$this->lng->txt('obj_'.$parent_type));
1391  $tpl->setVariable('PARENT_TITLE',$parent_title);
1392  $tpl->setVariable('PARENT_HREF',ilLink::_getLink($parent_ref_id));
1393 
1394  $tpl->setVariable('SRC',ilUtil::getTypeIconPath($type,$a_obj_id,'tiny'));
1395  $tpl->setVariable('ALT',$this->lng->txt('obj_'.$type));
1396  $tpl->setVariable('TITLE',$title);
1397  $tpl->setVariable('HREF',ilLink::_getLink($ref_id));
1398  $tpl->parseCurrentBlock();
1399  }
1400  return $tpl->get();
1401  }
1402 
1409  protected function manage($a_reset_offsets = false)
1410  {
1411  global $lng, $ilCtrl, $tpl;
1412 
1413  include_once('./Services/Calendar/classes/class.ilCalendarManageTableGUI.php');
1414  $table_gui = new ilCalendarManageTableGUI($this);
1415 
1416  if($a_reset_offsets)
1417  {
1418  $table_gui->resetToDefaults();
1419  }
1420 
1421  $table_gui->parse();
1422 
1423  include_once "./Services/UIComponent/Toolbar/classes/class.ilToolbarGUI.php";
1424  $toolbar = new ilToolbarGui();
1425  $ilCtrl->setParameter($this,'backv',self::VIEW_MANAGE);
1426  $toolbar->addButton($lng->txt("cal_add_calendar"), $ilCtrl->getLinkTarget($this, "add"));
1427 
1428  $tpl->setContent($toolbar->getHTML().$table_gui->getHTML());
1429  }
1430 
1434  protected function importAppointments(ilPropertyFormGUI $form = null)
1435  {
1436  global $ilTabs, $tpl;
1437 
1438  if(!$_GET['category_id'])
1439  {
1440  ilUtil::sendFailure($this->lng->txt('select_one'),true);
1441  $this->ctrl->returnToParent($this);
1442  }
1443 
1444  $this->ctrl->setParameter($this,'category_id',(int) $_GET['category_id']);
1445 
1446  // Check permissions
1447  $this->readPermissions();
1448  $this->checkVisible();
1449 
1450  if(!$this->isImportable())
1451  {
1452  ilUtil::sendFailure($this->lng->txt('permission_denied'));
1453  $this->manage();
1454  return false;
1455  }
1456 
1457  $ilTabs->clearTargets();
1458  $ilTabs->setBackTarget($this->lng->txt("cal_back_to_list"), $this->ctrl->getLinkTarget($this, "manage"));
1459 
1460 
1461  if(!$form instanceof ilPropertyFormGUI)
1462  {
1463  $form = $this->initImportForm();
1464  }
1465  $tpl->setContent($form->getHTML());
1466  }
1467 
1471  protected function initImportForm()
1472  {
1473  include_once './Services/Form/classes/class.ilPropertyFormGUI.php';
1474  $form = new ilPropertyFormGUI();
1475  $form->setTitle($this->lng->txt('cal_import_tbl'));
1476  $form->setFormAction($this->ctrl->getFormAction($this));
1477 
1478  $form->addCommandButton('uploadAppointments',$this->lng->txt('import'));
1479 
1480  $ics = new ilFileInputGUI($this->lng->txt('cal_import_file'), 'file');
1481  $ics->setALlowDeletion(false);
1482  $ics->setSuffixes(array('ics'));
1483  $ics->setInfo($this->lng->txt('cal_import_file_info'));
1484  $form->addItem($ics);
1485 
1486  return $form;
1487  }
1488 
1492  protected function uploadAppointments()
1493  {
1494  // @todo permission check
1495 
1496  $form = $this->initImportForm();
1497  if($form->checkInput())
1498  {
1499  $file = $form->getInput('file');
1500  $tmp = ilUtil::ilTempnam();
1501 
1502  ilUtil::moveUploadedFile($file['tmp_name'], $file['name'], $tmp);
1503 
1504  $num = $this->doImportFile($tmp, (int) $_REQUEST['category_id']);
1505 
1506  ilUtil::sendSuccess(sprintf($this->lng->txt('cal_imported_success'), (int) $num),true);
1507  $this->ctrl->redirect($this,'manage');
1508  }
1509 
1510  ilUtil::sendFailure($this->lng->txt('cal_err_file_upload'),true);
1511  $this->initImportForm($form);
1512  }
1513 
1519  protected function doImportFile($file, $category_id)
1520  {
1521  include_once './Services/Calendar/classes/../classes/iCal/class.ilICalParser.php';
1522  include_once './Services/Calendar/classes/class.ilCalendarCategoryAssignments.php';
1523 
1524  $GLOBALS['ilLog']->write(__METHOD__.': Starting ical import...');
1525 
1527 
1529  $parser->setCategoryId($category_id);
1530  $parser->parse();
1531 
1533 
1534  return $assigned_after - $assigned_before;
1535  }
1536 }
1537 ?>
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
global $ilErr
Definition: raiseError.php:16
This class represents an option in a radio group.
initImportForm()
Create import form.
static get($a_type, $a_href="")
Get icon html.
Model for a calendar entry.
static _getInstance()
get singleton instance
Class ilInfoScreenGUI.
initFormCategory($a_mode)
init edit/create category form
sharePerformSearch()
share perform search
$_SESSION["AccountId"]
show presentation of calendar category side block
This class represents a property form user interface.
static getSharedCalendarsForUser($a_usr_id=0)
get shared calendars of user
$_GET["client_id"]
$location
Definition: buildRTE.php:44
addReferenceLinks($a_obj_id)
Show links to references.
setALlowDeletion($a_val)
Set allow deletion.
unshare()
Stop calendar sharing.
This class represents a file property in a property form.
Stores status (accepted/declined) of shared calendars.
shareAssignRoles($a_editable=false)
share assign roles
Color picker form for selecting color hexcodes using yui library.
$GLOBALS['loaded']
Global hash that tracks already loaded includes.
$cmd
Definition: sahs_server.php:35
saveSelection()
save selection of categories
static lookupNumberOfAssignedAppointments($a_cat_ids)
Get number of assigned appoitments.
show list of alle calendars to manage
static _lookupTitle($a_id)
lookup object title
isEditable()
check if calendar is editable private
$url
Definition: shib_logout.php:72
Stores calendar categories.
Reader for remote ical calendars.
showUserList($a_ids=array())
show user list
BlockGUI class calendar selection.
__construct($a_user_id, $seed)
Constructor.
setInfo($a_info)
Set Info.
static getTypeIconPath($a_type, $a_obj_id, $a_size='small')
Get type icon path path Return image path for icon_xxx.pngs Or (if enabled) path to custom icon Depre...
Handles shared calendars.
switchCalendarMode()
Switch calendar selection nmode.
static _getAllReferences($a_id)
get all reference ids of object
const QP_COMBINATION_OR
doSynchronisation(ilCalendarCategory $category)
Sync calendar.
static _getInstanceByUserId($a_user_id)
get instance by user id
global $ilCtrl
Definition: ilias.php:18
$info
Definition: example_052.php:80
importAppointments(ilPropertyFormGUI $form=null)
import appointments
deleteAppointments()
delete appointments
showAssignedAppointments()
show assigned aapointments
static _getUserSearchInstance($query_parser)
get reference of ilLikeUserSearch
This class represents a property in a property form.
static moveUploadedFile($a_file, $a_name, $a_target, $a_raise_errors=true, $a_mode="move_uploaded")
move uploaded file
static _getInstance()
get instance for logged in user
static _lookupObjId($a_id)
special template class to simplify handling of ITX/PEAR
This class represents a text property in a property form.
shareAssign($a_editable=false)
share assign
This class represents a password property in a property form.
$ilUser
Definition: imgupload.php:18
shareAssignRolesEditable()
Share editable.
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled
static _deleteByAppointmentId($a_app_id)
Delete appointment assignment.
static _getInstance($a_usr_id=0)
get singleton instance
askDeleteAppointments()
ask delete appointments
Create styles array
The data for the language used.
static _lookupType($a_id, $a_reference=false)
lookup object type
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
static _getAssignedAppointments($a_cat_id)
Get assigned apointments.
static ilTempnam($a_temp_path=null)
Create a temporary file in an ILIAS writable directory.
doImportFile($file, $category_id)
Import ics.
const IL_CAL_DATE
shareAssignEditable()
Share with write access.
$parser
Definition: BPMN2Parser.php:24
Administrate calendar appointments.
$ref_id
Definition: sahs_server.php:39
global $ilSetting
Definition: privfeed.php:17
if(!file_exists("$old.txt")) if($old===$new) if(file_exists("$new.txt")) $file
showRoleList($a_ids=array())
show role list
setValue($a_value)
Set Value.
details()
show calendar details
setDisabled($a_disabled)
Set Disabled.
$_POST["username"]
$html
Definition: example_001.php:87
static isSharedWithUser($a_usr_id, $a_calendar_id)
is shared with user
manage($a_reset_offsets=false)
Manage calendars type $lng type $ilCtrl type $tpl.
shareDeassign()
desassign users/roles from calendar
Administration, Side-Block presentation of calendar categories.
Confirmation screen class.
uploadAppointments()
Upload appointments.