ILIAS  release_4-4 Revision
All Data Structures Namespaces Files Functions Variables Modules Pages
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  $this->ctrl->setParameterByClass('ilcalendarsubscriptiongui','cal_id',(int) $_GET['category_id']);
302  $info->addProperty(
303  $this->lng->txt('cal_ical_infoscreen'),
304  '<img src="'.ilUtil::getImagePath('ical.png').'" />',
305  $this->ctrl->getLinkTargetByClass(array('ilcalendarpresentationgui','ilcalendarsubscriptiongui'))
306  );
307 
308  $tpl->setContent($toolbar.$info->getHTML().$this->showAssignedAppointments());
309  }
310 
311  protected function synchroniseCalendar()
312  {
313  if(!$_GET['category_id'])
314  {
315  ilUtil::sendFailure($this->lng->txt('select_one'),true);
316  $this->ctrl->returnToParent($this);
317  }
318 
319  $category = new ilCalendarCategory((int) $_GET['category_id']);
320 
321  try {
322  $this->doSynchronisation($category);
323  }
324  catch(Exception $e) {
325  ilUtil::sendFailure($e->getMessage(),true);
326  $this->ctrl->redirect($this,'manage');
327  }
328  ilUtil::sendSuccess($this->lng->txt('cal_cal_sync_success'),true);
329  $this->ctrl->redirect($this,'manage');
330  }
331 
336  protected function doSynchronisation(ilCalendarCategory $category)
337  {
338  include_once './Services/Calendar/classes/class.ilCalendarRemoteReader.php';
339  $remote = new ilCalendarRemoteReader($category->getRemoteUrl());
340  $remote->setUser($category->getRemoteUser());
341  $remote->setPass($category->getRemotePass());
342  $remote->read();
343  $remote->import($category);
344  }
345 
352  protected function update()
353  {
354  if(!$_GET['category_id'])
355  {
356  ilUtil::sendFailure($this->lng->txt('select_one'),true);
357  $this->ctrl->returnToParent($this);
358  }
359  $this->readPermissions();
360  if(!$this->isEditable())
361  {
362  ilUtil::sendFailure($this->lng->txt('permission_denied'));
363  $this->edit();
364  return false;
365  }
366 
367  include_once('./Services/Calendar/classes/class.ilCalendarCategory.php');
368  $category = new ilCalendarCategory((int) $_GET['category_id']);
369  $category->setTitle(ilUtil::stripSlashes($_POST['title']));
370  $category->setColor('#'.ilUtil::stripSlashes($_POST['color']));
371  $category->update();
372 
373  ilUtil::sendSuccess($this->lng->txt('settings_saved'),true);
374  // $this->ctrl->returnToParent($this);
375  $this->manage();
376  }
377 
384  protected function confirmDelete()
385  {
386  global $tpl;
387 
388  if(!$_POST['selected_cat_ids'])
389  {
390  ilUtil::sendFailure($this->lng->txt('select_one'),true);
391  $this->manage();
392  }
393 
394  /*
395  $this->readPermissions();
396  if(!$this->isEditable())
397  {
398  ilUtil::sendFailure($this->lng->txt('permission_denied'));
399  $this->manage();
400  return false;
401  }
402  */
403 
404  include_once('./Services/Utilities/classes/class.ilConfirmationGUI.php');
405  $confirmation_gui = new ilConfirmationGUI();
406 
407  $confirmation_gui->setFormAction($this->ctrl->getFormAction($this));
408  $confirmation_gui->setHeaderText($this->lng->txt('cal_del_cal_sure'));
409  $confirmation_gui->setConfirm($this->lng->txt('delete'),'delete');
410  $confirmation_gui->setCancel($this->lng->txt('cancel'),'manage');
411 
412  include_once('./Services/Calendar/classes/class.ilCalendarCategory.php');
413  foreach($_POST['selected_cat_ids'] as $cat_id)
414  {
415  $category = new ilCalendarCategory((int)$cat_id);
416  $confirmation_gui->addItem('category_id[]',$cat_id,$category->getTitle());
417  }
418 
419  $tpl->setContent($confirmation_gui->getHTML());
420  }
421 
429  protected function delete()
430  {
431  global $ilCtrl;
432 
433  if(!$_POST['category_id'])
434  {
435  ilUtil::sendFailure($this->lng->txt('select_one'),true);
436  $this->manage();
437  }
438 
439  /*
440  $this->readPermissions();
441  if(!$this->isEditable())
442  {
443  ilUtil::sendFailure($this->lng->txt('permission_denied'));
444  $this->edit();
445  return false;
446  }
447  */
448 
449  include_once('./Services/Calendar/classes/class.ilCalendarCategory.php');
450  foreach($_POST['category_id'] as $cat_id)
451  {
452  $category = new ilCalendarCategory((int)$cat_id);
453  $category->delete();
454  }
455 
456  ilUtil::sendSuccess($this->lng->txt('cal_cal_deleted'), true);
457  $ilCtrl->redirect($this, 'manage');
458  }
459 
460 
461 
469  public function saveSelection()
470  {
471  global $ilUser;
472 
473  include_once('./Services/Calendar/classes/class.ilCalendarCategories.php');
474  include_once('./Services/Calendar/classes/class.ilCalendarHidden.php');
475 
476  $selected_cat_ids = $_POST['selected_cat_ids'] ? $_POST['selected_cat_ids'] : array();
477  $shown_cat_ids = $_POST['shown_cat_ids'] ? $_POST['shown_cat_ids'] : array();
478 
479  $cats = ilCalendarCategories::_getInstance($ilUser->getId());
480  $cat_ids = $cats->getCategories();
481 
482  $hidden_cats = ilCalendarHidden::_getInstanceByUserId($ilUser->getId());
483  $hidden_cat_ids = $hidden_cats->getHidden();
484 
485  $hidden = array();
486 
487  foreach($hidden_cat_ids as $hidden_cat_id)
488  {
489  if( !in_array($hidden_cat_id,$shown_cat_ids) )
490  {
491  $hidden[] = $hidden_cat_id;
492  }
493  }
494 
495  foreach($shown_cat_ids as $shown_cat_id)
496  {
497  $shown_cat_id = (int)$shown_cat_id;
498  if( !in_array($shown_cat_id, $selected_cat_ids) )
499  {
500  $hidden[] = $shown_cat_id;
501  }
502  }
503 
504  $hidden_categories = ilCalendarHidden::_getInstanceByUserId($this->user_id);
505  $hidden_categories->hideSelected($hidden);
506  $hidden_categories->save();
507 
508  ilUtil::sendSuccess($this->lng->txt('settings_saved'),true);
509  $this->ctrl->returnToParent($this);
510  }
511 
519  public function showCategories()
520  {
521  include_once('./Services/Calendar/classes/class.ilCalendarCategoryTableGUI.php');
522  $table_gui = new ilCalendarCategoryTableGUI($this,$this->seed);
523  $nav_parameter = $table_gui->getNavParameter();
524 
525  if($_POST[$nav_parameter] != "")
526  {
527  if($_POST[$nav_parameter."1"] != $_POST[$nav_parameter])
528  {
529  $nav_value = $_POST[$nav_parameter."1"];
530  }
531  elseif($_POST[$nav_parameter."2"] != $_POST[$nav_parameter])
532  {
533  $nav_value = $_POST[$nav_parameter."2"];
534  }
535  }
536  else
537  {
538  $nav_value = $_GET[$nav_parameter];
539  }
540 
541  $_SESSION[$nav_parameter] = $nav_value;
542 
543  $this->ctrl->returnToParent($this);
544  }
545 
553  public function shareSearch()
554  {
555  global $tpl, $ilTabs;
556 
557  if(!$_GET['category_id'])
558  {
559  ilUtil::sendFailure($this->lng->txt('select_one'),true);
560  $this->ctrl->returnToParent($this);
561  }
562 
563  $this->readPermissions();
564  if(!$this->isEditable())
565  {
566  ilUtil::sendFailure($this->lng->txt('permission_denied'));
567  $this->manage();
568  return false;
569  }
570 
571  $ilTabs->clearTargets();
572  $ilTabs->setBackTarget($this->lng->txt("cal_back_to_list"), $this->ctrl->getLinkTarget($this, "manage"));
573 
574  $_SESSION['cal_query'] = '';
575 
576  $this->ctrl->saveParameter($this,'category_id');
577  $this->initFormSearch();
578 
579  include_once('./Services/Calendar/classes/class.ilCalendarSharedListTableGUI.php');
580  $table = new ilCalendarSharedListTableGUI($this,'shareSearch');
581  $table->setTitle($this->lng->txt('cal_shared_header'));
582  $table->setCalendarId((int) $_GET['category_id']);
583  $table->parse();
584 
585  $tpl->setContent($this->form->getHTML().'<br />'.$table->getHTML());
586  }
587 
594  public function sharePerformSearch()
595  {
596  global $ilTabs;
597 
598  $this->lng->loadLanguageModule('search');
599 
600  if(!$_GET['category_id'])
601  {
602  ilUtil::sendFailure($this->lng->txt('select_one'),true);
603  $this->ctrl->returnToParent($this);
604  }
605  $this->ctrl->saveParameter($this,'category_id');
606 
607 
608  if(!isset($_POST['query']))
609  {
610  $query = $_SESSION['cal_query'];
611  $type = $_SESSION['cal_type'];
612  }
613  elseif($_POST['query'])
614  {
615  $query = $_SESSION['cal_query'] = $_POST['query'];
616  $type = $_SESSION['cal_type'] = $_POST['query_type'];
617  }
618 
619  if(!$query)
620  {
621  ilUtil::sendFailure($this->lng->txt('msg_no_search_string'));
622  $this->shareSearch();
623  return false;
624  }
625 
626 
627  include_once 'Services/Search/classes/class.ilQueryParser.php';
628  include_once 'Services/Search/classes/class.ilObjectSearchFactory.php';
629  include_once 'Services/Search/classes/class.ilSearchResult.php';
630 
631  $res_sum = new ilSearchResult();
632 
633  $query_parser = new ilQueryParser(ilUtil::stripSlashes($query));
634  $query_parser->setCombination(QP_COMBINATION_OR);
635  $query_parser->setMinWordLength(3);
636  $query_parser->parse();
637 
638 
639  switch($type)
640  {
641  case self::SEARCH_USER:
642  $search = ilObjectSearchFactory::_getUserSearchInstance($query_parser);
643  $search->enableActiveCheck(true);
644 
645  $search->setFields(array('login'));
646  $res = $search->performSearch();
647  $res_sum->mergeEntries($res);
648 
649  $search->setFields(array('firstname'));
650  $res = $search->performSearch();
651  $res_sum->mergeEntries($res);
652 
653  $search->setFields(array('lastname'));
654  $res = $search->performSearch();
655  $res_sum->mergeEntries($res);
656 
657  $res_sum->filter(ROOT_FOLDER_ID,QP_COMBINATION_OR);
658  break;
659 
660  case self::SEARCH_ROLE:
661 
662  include_once 'Services/Search/classes/Like/class.ilLikeObjectSearch.php';
663  $search = new ilLikeObjectSearch($query_parser);
664  $search->setFilter(array('role'));
665 
666  $res = $search->performSearch();
667  $res_sum->mergeEntries($res);
668 
669  $res_sum->filter(ROOT_FOLDER_ID,QP_COMBINATION_OR);
670  break;
671  }
672 
673  if(!count($res_sum->getResults()))
674  {
675  ilUtil::sendFailure($this->lng->txt('search_no_match'));
676  $this->shareSearch();
677  return true;
678  }
679 
680  $ilTabs->clearTargets();
681  $ilTabs->setBackTarget($this->lng->txt("cal_back_to_search"), $this->ctrl->getLinkTarget($this, "shareSearch"));
682 
683  switch($type)
684  {
685  case self::SEARCH_USER:
686  $this->showUserList($res_sum->getResultIds());
687  break;
688 
689  case self::SEARCH_ROLE:
690  $this->showRoleList($res_sum->getResultIds());
691  break;
692  }
693  }
694 
698  public function shareAssignEditable()
699  {
700  return $this->shareAssign(true);
701  }
702 
709  public function shareAssign($a_editable = false)
710  {
711  global $ilUser;
712 
713  if(!$_GET['category_id'])
714  {
715  ilUtil::sendFailure($this->lng->txt('select_one'),true);
716  $this->ctrl->returnToParent($this);
717  }
718  if(!count($_POST['user_ids']))
719  {
720  ilUtil::sendFailure($this->lng->txt('select_one'));
721  $this->sharePerformSearch();
722  return false;
723  }
724 
725  $this->readPermissions();
726  if(!$this->isEditable())
727  {
728  ilUtil::sendFailure($this->lng->txt('permission_denied'));
729  $this->shareSearch();
730  return false;
731  }
732 
733 
734  include_once('./Services/Calendar/classes/class.ilCalendarShared.php');
735  $shared = new ilCalendarShared((int) $_GET['category_id']);
736 
737  foreach($_POST['user_ids'] as $user_id)
738  {
739  if($ilUser->getId() != $user_id)
740  {
741  $shared->share($user_id,ilCalendarShared::TYPE_USR,$a_editable);
742  }
743  }
744  ilUtil::sendSuccess($this->lng->txt('cal_shared_selected_usr'));
745  $this->shareSearch();
746  }
747 
751  protected function shareAssignRolesEditable()
752  {
753  return $this->shareAssignRolesEditable(true);
754  }
755 
763  public function shareAssignRoles($a_editable = false)
764  {
765  global $ilUser;
766 
767  if(!$_GET['category_id'])
768  {
769  ilUtil::sendFailure($this->lng->txt('select_one'),true);
770  $this->ctrl->returnToParent($this);
771  }
772  if(!count($_POST['role_ids']))
773  {
774  ilUtil::sendFailure($this->lng->txt('select_one'));
775  $this->sharePerformSearch();
776  return false;
777  }
778 
779  $this->readPermissions();
780  if(!$this->isEditable())
781  {
782  ilUtil::sendFailure($this->lng->txt('permission_denied'));
783  $this->shareSearch();
784  return false;
785  }
786 
787  include_once('./Services/Calendar/classes/class.ilCalendarShared.php');
788  $shared = new ilCalendarShared((int) $_GET['category_id']);
789 
790  foreach($_POST['role_ids'] as $role_id)
791  {
792  $shared->share($role_id,ilCalendarShared::TYPE_ROLE,$a_editable);
793  }
794  ilUtil::sendSuccess($this->lng->txt('cal_shared_selected_usr'));
795  $this->shareSearch();
796  }
797 
805  public function shareDeassign()
806  {
807  if(!$_GET['category_id'])
808  {
809  ilUtil::sendFailure($this->lng->txt('select_one'),true);
810  $this->ctrl->returnToParent($this);
811  }
812  if(!count($_POST['obj_ids']))
813  {
814  ilUtil::sendFailure($this->lng->txt('select_one'));
815  $this->shareSearch();
816  return false;
817  }
818 
819  $this->readPermissions();
820  if(!$this->isEditable())
821  {
822  ilUtil::sendFailure($this->lng->txt('permission_denied'));
823  $this->shareSearch();
824  return false;
825  }
826 
827 
828  include_once('./Services/Calendar/classes/class.ilCalendarShared.php');
829  $shared = new ilCalendarShared((int) $_GET['category_id']);
830 
831  foreach($_POST['obj_ids'] as $obj_id)
832  {
833  $shared->stopSharing($obj_id);
834  }
835  ilUtil::sendSuccess($this->lng->txt('cal_unshared_selected_usr'));
836  $this->shareSearch();
837  return true;
838  }
839 
840 
848  protected function showUserList($a_ids = array())
849  {
850  global $tpl;
851 
852  include_once('./Services/Calendar/classes/class.ilCalendarSharedUserListTableGUI.php');
853 
854  $table = new ilCalendarSharedUserListTableGUI($this,'sharePerformSearch');
855  $table->setTitle($this->lng->txt('cal_share_search_usr_header'));
856  $table->setFormAction($this->ctrl->getFormAction($this));
857  $table->setUsers($a_ids);
858  $table->parse();
859 
860  // $table->addCommandButton('shareSearch',$this->lng->txt('search_new'));
861  // $table->addCommandButton('manage',$this->lng->txt('cancel'));
862 
863  $tpl->setContent($table->getHTML());
864  }
865 
873  protected function showRoleList($a_ids = array())
874  {
875  global $tpl;
876 
877  include_once('./Services/Calendar/classes/class.ilCalendarSharedRoleListTableGUI.php');
878 
879  $table = new ilCalendarSharedRoleListTableGUI($this,'sharePerformSearch');
880  $table->setTitle($this->lng->txt('cal_share_search_role_header'));
881  $table->setFormAction($this->ctrl->getFormAction($this));
882  $table->setRoles($a_ids);
883  $table->parse();
884 
885  // $table->addCommandButton('shareSearch',$this->lng->txt('search_new'));
886  // $table->addCommandButton('manage',$this->lng->txt('cancel'));
887 
888  $tpl->setContent($table->getHTML());
889  }
890 
898  protected function initFormSearch()
899  {
900  global $lng;
901 
902  $lng->loadLanguageModule('search');
903 
904  if(!is_object($this->form))
905  {
906  include_once('Services/Form/classes/class.ilPropertyFormGUI.php');
907  $this->form = new ilPropertyFormGUI();
908  $this->form->setFormAction($this->ctrl->getFormAction($this));
909  $this->form->setTitle($this->lng->txt('cal_share_search_header'));
910  }
911 
912  $type = new ilRadioGroupInputGUI($this->lng->txt('search_type'),'query_type');
913  $type->setValue($_POST['query_type'] ? $_POST['query_type'] : self::SEARCH_USER);
914  $type->setRequired(true);
915 
916  $user = new ilRadioOption($this->lng->txt('obj_user'),self::SEARCH_USER);
917  $type->addOption($user);
918 
919  $role = new ilRadioOption($this->lng->txt('obj_role'),self::SEARCH_ROLE);
920  $type->addOption($role);
921 
922  $this->form->addItem($type);
923 
924  $search = new ilTextInputGUI($this->lng->txt('cal_search'),'query');
925  $search->setValue($_POST['query']);
926  $search->setSize(16);
927  $search->setMaxLength(128);
928  $search->setRequired(true);
929  $search->setInfo($this->lng->txt('cal_search_info_share'));
930 
931  $this->form->addItem($search);
932  $this->form->addCommandButton('sharePerformSearch',$this->lng->txt('search'));
933  // $this->form->addCommandButton('manage',$this->lng->txt('cancel'));
934  }
935 
942  protected function initFormCategory($a_mode)
943  {
944  global $rbacsystem,$ilUser, $ilHelp;
945 
946  $ilHelp->setScreenIdComponent("cal");
947  $ilHelp->setScreenId("cal");
948  if ($a_mode == "edit")
949  {
950  $ilHelp->setSubScreenId("edit");
951  }
952  else
953  {
954  $ilHelp->setSubScreenId("create");
955  }
956 
957  include_once('./Services/Form/classes/class.ilPropertyFormGUI.php');
958  include_once('./Services/Calendar/classes/class.ilCalendarCategory.php');
959 
960  include_once('./Services/Calendar/classes/class.ilCalendarCategories.php');
961  $cat_info = ilCalendarCategories::_getInstance()->getCategoryInfo((int) $_GET['category_id']);
962 
963  $this->form = new ilPropertyFormGUI();
964  #$this->form->setTableWidth('40%');
965  switch($a_mode)
966  {
967  case 'edit':
968  $category = new ilCalendarCategory((int) $_GET['category_id']);
969  $this->form->setTitle($this->lng->txt('cal_edit_category'));
970  $this->ctrl->saveParameter($this,array('seed','category_id'));
971  $this->form->setFormAction($this->ctrl->getFormAction($this));
972  if($this->isEditable())
973  {
974  $this->form->addCommandButton('update',$this->lng->txt('save'));
975 
976  /*
977  if($cat_info['type'] == ilCalendarCategory::TYPE_USR)
978  {
979  $this->form->addCommandButton('shareSearch',$this->lng->txt('cal_share'));
980  }
981  $this->form->addCommandButton('confirmDelete',$this->lng->txt('delete'));
982  */
983 
984  $this->form->addCommandButton('manage',$this->lng->txt('cancel'));
985  }
986  break;
987  case 'create':
988  $this->editable = true;
989  $category = new ilCalendarCategory(0);
990  $this->ctrl->saveParameter($this,array('category_id'));
991  $this->form->setFormAction($this->ctrl->getFormAction($this));
992  $this->form->setTitle($this->lng->txt('cal_add_category'));
993  $this->form->addCommandButton('save',$this->lng->txt('save'));
994  $this->form->addCommandButton('manage',$this->lng->txt('cancel'));
995  break;
996  }
997 
998  // Calendar name
999  $title = new ilTextInputGUI($this->lng->txt('cal_calendar_name'),'title');
1000  if($a_mode == 'edit')
1001  {
1002  $title->setDisabled(!$this->isEditable());
1003  }
1004  $title->setRequired(true);
1005  $title->setMaxLength(64);
1006  $title->setSize(32);
1007  $title->setValue($category->getTitle());
1008  $this->form->addItem($title);
1009 
1010 
1011  include_once('./Services/Calendar/classes/class.ilCalendarSettings.php');
1012  if($a_mode == 'create' and $rbacsystem->checkAccess('edit_event',ilCalendarSettings::_getInstance()->getCalendarSettingsId()))
1013  {
1014  $type = new ilRadioGroupInputGUI($this->lng->txt('cal_cal_type'),'type');
1015  $type->setValue($category->getType());
1016  $type->setRequired(true);
1017 
1018  $opt = new ilRadioOption($this->lng->txt('cal_type_personal'),ilCalendarCategory::TYPE_USR);
1019  $type->addOption($opt);
1020 
1021  $opt = new ilRadioOption($this->lng->txt('cal_type_system'),ilCalendarCategory::TYPE_GLOBAL);
1022  $type->addOption($opt);
1023  $type->setInfo($this->lng->txt('cal_type_info'));
1024  $this->form->addItem($type);
1025  }
1026 
1027 
1028  $color = new ilColorPickerInputGUI($this->lng->txt('cal_calendar_color'),'color');
1029  $color->setValue($category->getColor());
1030  if(!$this->isEditable())
1031  {
1032  $color->setDisabled(true);
1033  }
1034  $color->setRequired(true);
1035  $this->form->addItem($color);
1036 
1037  $location = new ilRadioGroupInputGUI($this->lng->txt('cal_type_rl'), 'type_rl');
1038  $location->setDisabled($a_mode == 'edit');
1039  $location_local = new ilRadioOption($this->lng->txt('cal_type_local'), ilCalendarCategory::LTYPE_LOCAL);
1040  $location->addOption($location_local);
1041  $location_remote = new ilRadioOption($this->lng->txt('cal_type_remote'), ilCalendarCategory::LTYPE_REMOTE);
1042  $location->addOption($location_remote);
1043  $location->setValue($category->getLocationType());
1044 
1045 
1046  $url = new ilTextInputGUI($this->lng->txt('cal_remote_url'), 'remote_url');
1047  $url->setDisabled($a_mode == 'edit');
1048  $url->setValue($category->getRemoteUrl());
1049  $url->setMaxLength(500);
1050  $url->setSize(60);
1051  $url->setRequired(true);
1052  $location_remote->addSubItem($url);
1053 
1054  $user = new ilTextInputGUI($this->lng->txt('username'),'remote_user');
1055  $user->setDisabled($a_mode == 'edit');
1056  $user->setValue($category->getRemoteUser());
1057  $user->setMaxLength(50);
1058  $user->setSize(20);
1059  $user->setRequired(false);
1060  $location_remote->addSubItem($user);
1061 
1062  $pass = new ilPasswordInputGUI($this->lng->txt('password'),'remote_pass');
1063  $pass->setDisabled($a_mode == 'edit');
1064  $pass->setValue($category->getRemotePass());
1065  $pass->setMaxLength(50);
1066  $pass->setSize(20);
1067  $pass->setRetype(false);
1068  $pass->setInfo($this->lng->txt('remote_pass_info'));
1069  $location_remote->addSubItem($pass);
1070 
1071  $this->form->addItem($location);
1072 
1073  }
1074 
1078  protected function unshare()
1079  {
1080  global $ilUser;
1081 
1082  if(!$_GET['category_id'])
1083  {
1084  ilUtil::sendFailure($this->lng->txt('select_one'),true);
1085  $this->ctrl->returnToParent($this);
1086  }
1087 
1088  $this->readPermissions();
1089  $this->checkVisible();
1090 
1091  include_once('./Services/Calendar/classes/class.ilCalendarSharedStatus.php');
1092  $status = new ilCalendarSharedStatus($ilUser->getId());
1093 
1094  include_once('./Services/Calendar/classes/class.ilCalendarShared.php');
1095  if(!ilCalendarShared::isSharedWithUser($ilUser->getId(), $_GET['category_id']))
1096  {
1097  ilUtil::sendFailure($this->lng->txt('permission_denied'));
1098  $this->inbox();
1099  return false;
1100  }
1101  $status->decline($_GET['category_id']);
1102 
1103  ilUtil::sendSuccess($this->lng->txt('settings_saved'), true);
1104  $this->ctrl->redirect($this, 'manage');
1105  }
1106 
1113  protected function showAssignedAppointments()
1114  {
1115  include_once('./Services/Calendar/classes/class.ilCalendarCategoryTableGUI.php');
1116  include_once('./Services/Calendar/classes/class.ilCalendarCategoryAssignments.php');
1117  include_once('./Services/Calendar/classes/class.ilCalendarAppointmentsTableGUI.php');
1118 
1119  $table_gui = new ilCalendarAppointmentsTableGUI($this, 'details', (int)$_GET['category_id']);
1120  $table_gui->setTitle($this->lng->txt('cal_assigned_appointments'));
1121  $table_gui->setAppointments(
1123  ilCalendarCategories::_getInstance()->getSubitemCategories((int) $_GET['category_id'])));
1124  return $table_gui->getHTML();
1125  }
1126 
1133  protected function askDeleteAppointments()
1134  {
1135  global $tpl;
1136 
1137  if(!count($_POST['appointments']))
1138  {
1139  ilUtil::sendFailure($this->lng->txt('select_one'));
1140  $this->details();
1141  return true;
1142  }
1143 
1144  include_once('./Services/Utilities/classes/class.ilConfirmationGUI.php');
1145  $confirmation_gui = new ilConfirmationGUI();
1146 
1147  $this->ctrl->setParameter($this,'category_id',(int) $_GET['category_id']);
1148  $confirmation_gui->setFormAction($this->ctrl->getFormAction($this));
1149  $confirmation_gui->setHeaderText($this->lng->txt('cal_del_app_sure'));
1150  $confirmation_gui->setConfirm($this->lng->txt('delete'),'deleteAppointments');
1151  $confirmation_gui->setCancel($this->lng->txt('cancel'),'details');
1152 
1153  include_once('./Services/Calendar/classes/class.ilCalendarEntry.php');
1154  foreach($_POST['appointments'] as $app_id)
1155  {
1156  $app = new ilCalendarEntry($app_id);
1157  $confirmation_gui->addItem('appointments[]',(int) $app_id,$app->getTitle());
1158  }
1159 
1160  $tpl->setContent($confirmation_gui->getHTML());
1161  }
1162 
1169  protected function deleteAppointments()
1170  {
1171  if(!count($_POST['appointments']))
1172  {
1173  ilUtil::sendFailure($this->lng->txt('select_one'));
1174  $this->details();
1175  return true;
1176  }
1177  include_once('./Services/Calendar/classes/class.ilCalendarEntry.php');
1178  foreach($_POST['appointments'] as $app_id)
1179  {
1180  $app = new ilCalendarEntry($app_id);
1181  $app->delete();
1182 
1183  include_once('./Services/Calendar/classes/class.ilCalendarCategoryAssignments.php');
1185  }
1186 
1187  ilUtil::sendSuccess($this->lng->txt('settings_saved'));
1188  $this->details();
1189  return true;
1190 
1191  }
1192 
1193  public function getHTML()
1194  {
1195  global $ilUser, $ilCtrl;
1196 
1197  include_once("./Services/Calendar/classes/class.ilCalendarSelectionBlockGUI.php");
1198  $block_gui = new ilCalendarSelectionBlockGUI($this->seed);
1199  $html = $ilCtrl->getHTML($block_gui);
1200  return $html;
1201  }
1202 
1203 
1209  protected function appendCalendarSelection()
1210  {
1211  global $ilUser;
1212 
1213  $this->lng->loadLanguageModule('pd');
1214 
1215  $tpl = new ilTemplate('tpl.calendar_selection.html',true,true,'Services/Calendar');
1216  include_once('./Services/Calendar/classes/class.ilCalendarUserSettings.php');
1217  switch(ilCalendarUserSettings::_getInstance()->getCalendarSelectionType())
1218  {
1220  $tpl->setVariable('HTEXT',$this->lng->txt('pd_my_memberships'));
1221  $tpl->touchBlock('head_item');
1222  $tpl->touchBlock('head_delim');
1223  $tpl->touchBlock('head_item');
1224 
1225  $this->ctrl->setParameter($this,'calendar_mode',ilCalendarUserSettings::CAL_SELECTION_ITEMS);
1226  $this->ctrl->setParameter($this,'seed',$this->seed->get(IL_CAL_DATE));
1227  $tpl->setVariable('HHREF',$this->ctrl->getLinkTarget($this,'switchCalendarMode'));
1228  $tpl->setVariable('HLINK',$this->lng->txt('pd_my_offers'));
1229  $tpl->touchBlock('head_item');
1230  break;
1231 
1233  $this->ctrl->setParameter($this,'calendar_mode',ilCalendarUserSettings::CAL_SELECTION_MEMBERSHIP);
1234  $this->ctrl->setParameter($this,'seed',$this->seed->get(IL_CAL_DATE));
1235  $tpl->setVariable('HHREF',$this->ctrl->getLinkTarget($this,'switchCalendarMode'));
1236  $tpl->setVariable('HLINK',$this->lng->txt('pd_my_memberships'));
1237  $tpl->touchBlock('head_item');
1238  $tpl->touchBlock('head_delim');
1239  $tpl->touchBlock('head_item');
1240 
1241  $tpl->setVariable('HTEXT',$this->lng->txt('pd_my_offers'));
1242  $tpl->touchBlock('head_item');
1243  break;
1244 
1245 
1246  }
1247  return $tpl->get();
1248  }
1249 
1254  protected function switchCalendarMode()
1255  {
1256  include_once('./Services/Calendar/classes/class.ilCalendarUserSettings.php');
1257  ilCalendarUserSettings::_getInstance()->setCalendarSelectionType((int) $_GET['calendar_mode']);
1259 
1260  $this->ctrl->returnToParent($this);
1261 
1262  }
1263 
1264 
1272  private function readPermissions()
1273  {
1274  global $ilUser,$rbacsystem,$ilAccess;
1275 
1276  $this->editable = false;
1277  $this->visible = false;
1278  $this->importable = false;
1279 
1280  include_once('./Services/Calendar/classes/class.ilCalendarShared.php');
1281 
1282  $shared = ilCalendarShared::getSharedCalendarsForUser($ilUser->getId());
1283  $cat = new ilCalendarCategory((int) $_GET['category_id']);
1284 
1285  switch($cat->getType())
1286  {
1288 
1289  if($cat->getObjId() == $ilUser->getId())
1290  {
1291  $this->visible = true;
1292  $this->editable = true;
1293  $this->importable = true;
1294  }
1295  elseif(isset($shared[$cat->getCategoryID()]))
1296  {
1297  $this->visible = true;
1298  }
1299  break;
1300 
1302  $this->importable = $this->editable = $rbacsystem->checkAccess('edit_event',ilCalendarSettings::_getInstance()->getCalendarSettingsId());
1303  $this->visible = true;
1304  break;
1305 
1307  $this->editable = false;
1308 
1309  $refs = ilObject::_getAllReferences($cat->getObjId());
1310  foreach($refs as $ref)
1311  {
1312  if($ilAccess->checkAccess('read','',$ref))
1313  {
1314  $this->visible = true;
1315  }
1316  if($ilAccess->checkAccess('edit_event','',$ref))
1317  {
1318  $this->importable = true;
1319  }
1320  }
1321  break;
1322 
1325  $this->editable = $ilUser->getId() == $cat->getCategoryID();
1326  $this->visible = true;
1327  $this->importable = false;
1328  break;
1329  }
1330 
1331  }
1332 
1338  protected function checkVisible()
1339  {
1340  global $ilErr;
1341 
1342  if(!$this->visible)
1343  {
1344  $ilErr->raiseError($this->lng->txt('permission_denied'),$ilErr->FATAL);
1345  }
1346  }
1347 
1353  private function isEditable()
1354  {
1355  return $this->editable;
1356  }
1357 
1358  protected function isImportable()
1359  {
1360  return $this->importable;
1361  }
1362 
1363 
1369  protected function addReferenceLinks($a_obj_id)
1370  {
1371  global $tree;
1372 
1373  $tpl = new ilTemplate('tpl.cal_reference_links.html',true,true,'Services/Calendar');
1374 
1375  foreach(ilObject::_getAllReferences($a_obj_id) as $ref_id => $ref_id)
1376  {
1377  include_once('./Services/Link/classes/class.ilLink.php');
1378 
1379  $parent_ref_id = $tree->getParentId($ref_id);
1380  $parent_obj_id = ilObject::_lookupObjId($parent_ref_id);
1381  $parent_type = ilObject::_lookupType($parent_obj_id);
1382  $parent_title = ilObject::_lookupTitle($parent_obj_id);
1383 
1384  $type = ilObject::_lookupType($a_obj_id);
1385  $title = ilObject::_lookupTitle($a_obj_id);
1386 
1387  $tpl->setCurrentBlock('reference');
1388  $tpl->setVariable('PIMG_SRC',ilUtil::getTypeIconPath($parent_type,$parent_obj_id,'tiny'));
1389  $tpl->setVariable('PIMG_ALT',$this->lng->txt('obj_'.$parent_type));
1390  $tpl->setVariable('PARENT_TITLE',$parent_title);
1391  $tpl->setVariable('PARENT_HREF',ilLink::_getLink($parent_ref_id));
1392 
1393  $tpl->setVariable('SRC',ilUtil::getTypeIconPath($type,$a_obj_id,'tiny'));
1394  $tpl->setVariable('ALT',$this->lng->txt('obj_'.$type));
1395  $tpl->setVariable('TITLE',$title);
1396  $tpl->setVariable('HREF',ilLink::_getLink($ref_id));
1397  $tpl->parseCurrentBlock();
1398  }
1399  return $tpl->get();
1400  }
1401 
1408  protected function manage($a_reset_offsets = false)
1409  {
1410  global $lng, $ilCtrl, $tpl;
1411 
1412  include_once('./Services/Calendar/classes/class.ilCalendarManageTableGUI.php');
1413  $table_gui = new ilCalendarManageTableGUI($this);
1414 
1415  if($a_reset_offsets)
1416  {
1417  $table_gui->resetToDefaults();
1418  }
1419 
1420  $table_gui->parse();
1421 
1422  include_once "./Services/UIComponent/Toolbar/classes/class.ilToolbarGUI.php";
1423  $toolbar = new ilToolbarGui();
1424  $ilCtrl->setParameter($this,'backv',self::VIEW_MANAGE);
1425  $toolbar->addButton($lng->txt("cal_add_calendar"), $ilCtrl->getLinkTarget($this, "add"));
1426 
1427  $tpl->setContent($toolbar->getHTML().$table_gui->getHTML());
1428  }
1429 
1433  protected function importAppointments(ilPropertyFormGUI $form = null)
1434  {
1435  global $ilTabs, $tpl;
1436 
1437  if(!$_GET['category_id'])
1438  {
1439  ilUtil::sendFailure($this->lng->txt('select_one'),true);
1440  $this->ctrl->returnToParent($this);
1441  }
1442 
1443  $this->ctrl->setParameter($this,'category_id',(int) $_GET['category_id']);
1444 
1445  // Check permissions
1446  $this->readPermissions();
1447  $this->checkVisible();
1448 
1449  if(!$this->isImportable())
1450  {
1451  ilUtil::sendFailure($this->lng->txt('permission_denied'));
1452  $this->manage();
1453  return false;
1454  }
1455 
1456  $ilTabs->clearTargets();
1457  $ilTabs->setBackTarget($this->lng->txt("cal_back_to_list"), $this->ctrl->getLinkTarget($this, "manage"));
1458 
1459 
1460  if(!$form instanceof ilPropertyFormGUI)
1461  {
1462  $form = $this->initImportForm();
1463  }
1464  $tpl->setContent($form->getHTML());
1465  }
1466 
1470  protected function initImportForm()
1471  {
1472  include_once './Services/Form/classes/class.ilPropertyFormGUI.php';
1473  $form = new ilPropertyFormGUI();
1474  $form->setTitle($this->lng->txt('cal_import_tbl'));
1475  $form->setFormAction($this->ctrl->getFormAction($this));
1476 
1477  $form->addCommandButton('uploadAppointments',$this->lng->txt('import'));
1478 
1479  $ics = new ilFileInputGUI($this->lng->txt('cal_import_file'), 'file');
1480  $ics->setALlowDeletion(false);
1481  $ics->setSuffixes(array('ics'));
1482  $ics->setInfo($this->lng->txt('cal_import_file_info'));
1483  $form->addItem($ics);
1484 
1485  return $form;
1486  }
1487 
1491  protected function uploadAppointments()
1492  {
1493  // @todo permission check
1494 
1495  $form = $this->initImportForm();
1496  if($form->checkInput())
1497  {
1498  $file = $form->getInput('file');
1499  $tmp = ilUtil::ilTempnam();
1500 
1501  ilUtil::moveUploadedFile($file['tmp_name'], $file['name'], $tmp);
1502 
1503  $num = $this->doImportFile($tmp, (int) $_REQUEST['category_id']);
1504 
1505  ilUtil::sendSuccess(sprintf($this->lng->txt('cal_imported_success'), (int) $num),true);
1506  $this->ctrl->redirect($this,'manage');
1507  }
1508 
1509  ilUtil::sendFailure($this->lng->txt('cal_err_file_upload'),true);
1510  $this->initImportForm($form);
1511  }
1512 
1518  protected function doImportFile($file, $category_id)
1519  {
1520  include_once './Services/Calendar/classes/../classes/iCal/class.ilICalParser.php';
1521  include_once './Services/Calendar/classes/class.ilCalendarCategoryAssignments.php';
1522 
1523  $GLOBALS['ilLog']->write(__METHOD__.': Starting ical import...');
1524 
1525  $assigned_before = ilCalendarCategoryAssignments::lookupNumberOfAssignedAppointments(array($category_id));
1526 
1528  $parser->setCategoryId($category_id);
1529  $parser->parse();
1530 
1531  $assigned_after = ilCalendarCategoryAssignments::lookupNumberOfAssignedAppointments(array($category_id));
1532 
1533  return $assigned_after - $assigned_before;
1534  }
1535 }
1536 ?>
< a tabindex="-1" style="border-style: none;" href="#" title="Refresh Image" onclick="document.getElementById('siimage').src = './securimage_show.php?sid=' + Math.random(); this.blur(); return false">< img src="./images/refresh.png" alt="Reload Image" height="32" width="32" onclick="this.blur()" align="bottom" border="0"/></a >< br/>< strong > Enter Code *if($_SERVER['REQUEST_METHOD']=='POST' &&@ $_POST['do']=='contact') $_SESSION['ctform']['success']
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
This class represents an option in a radio group.
initImportForm()
Create import form.
print $file
Model for a calendar entry.
static _getInstance()
get singleton instance
Class ilInfoScreenGUI.
initFormCategory($a_mode)
init edit/create category form
$_POST['username']
Definition: cron.php:12
sharePerformSearch()
share perform search
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.
$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
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...
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
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.
$GLOBALS['ct_recipient']
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.
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
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.
doImportFile($file, $category_id)
Import ics.
const IL_CAL_DATE
shareAssignEditable()
Share with write access.
global $ilUser
Definition: imgupload.php:15
static ilTempnam()
Create a temporary file in an ILIAS writable directory.
Administrate calendar appointments.
$ref_id
Definition: sahs_server.php:39
global $ilSetting
Definition: privfeed.php:40
if($_REQUEST['ilias_path']) define('ILIAS_HTTP_PATH' $_REQUEST['ilias_path']
Definition: index.php:7
showRoleList($a_ids=array())
show role list
setValue($a_value)
Set Value.
details()
show calendar details
setDisabled($a_disabled)
Set Disabled.
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.