private function createRecurrenceGUI()
 {
     $this->getRecurrenceFromSession();
     $r = new ilRecurrenceInputGUI($this->lng->txt('cal_recurrences'), 'frequence');
     $subforms = array(IL_CAL_FREQ_DAILY, IL_CAL_FREQ_WEEKLY, IL_CAL_FREQ_MONTHLY);
     //ohne jährlich
     $r->setEnabledSubForms($subforms);
     $r->allowUnlimitedRecurrences(false);
     $r->setRecurrence($this->rec);
     return $r;
 }
 /**
  * Init Form 
  *
  * @access protected
  */
 protected function initForm($a_mode)
 {
     global $ilUser;
     if (is_object($this->form)) {
         return true;
     }
     $this->lng->loadLanguageModule('dateplaner');
     include_once "./Services/Form/classes/class.ilPropertyFormGUI.php";
     include_once './Services/YUI/classes/class.ilYuiUtil.php';
     ilYuiUtil::initDomEvent();
     $this->form = new ilPropertyFormGUI();
     $this->form->setMultipart(true);
     $this->form->setTableWidth('600px');
     $this->form->setFormAction($this->ctrl->getFormAction($this));
     $this->form->setMultipart(true);
     /*
     $full = new ilCheckboxInputGUI('','fulltime');
     $full->setChecked($this->object->getFirstAppointment()->enabledFulltime() ? true : false);
     $full->setOptionTitle($this->lng->txt('event_fulltime_info'));
     $full->setAdditionalAttributes('onchange="ilToggleSessionTime(this);"');
     #$this->form->addItem($full);
     */
     $this->lng->loadLanguageModule('dateplaner');
     include_once './Services/Form/classes/class.ilDateDurationInputGUI.php';
     #$this->tpl->addJavaScript('./Modules/Session/js/toggle_session_time.js');
     $this->tpl->addJavaScript('./Services/Form/js/date_duration.js');
     $dur = new ilDateDurationInputGUI($this->lng->txt('cal_fullday'), 'event');
     $dur->setStartText($this->lng->txt('event_start_date'));
     $dur->setEndText($this->lng->txt('event_end_date'));
     $dur->enableToggleFullTime($this->lng->txt('event_fulltime_info'), $this->object->getFirstAppointment()->enabledFulltime() ? true : false);
     $dur->setMinuteStepSize(5);
     $dur->setShowTime(true);
     $dur->setShowDate(true);
     $dur->setStart($this->object->getFirstAppointment()->getStart());
     $dur->setEnd($this->object->getFirstAppointment()->getEnd());
     $this->form->addItem($dur);
     /*
     // start
     $start = new ilDateTimeInputGUI($this->lng->txt('event_start_date'),'start');
     $start->setMinuteStepSize(5);
     $start->setDate($this->object->getFirstAppointment()->getStart());
     $start->setShowTime(true);
     #$this->form->addItem($start);
     
     // end
     $end = new ilDateTimeInputGUI($this->lng->txt('event_end_date'),'end');
     $end->setMinuteStepSize(5);
     $end->setDate($this->object->getFirstAppointment()->getEnd());
     $end->setShowTime(true);
     #$this->form->addItem($end);
     */
     // Recurrence
     if ($a_mode == 'create') {
         if (!is_object($this->rec)) {
             include_once './Modules/Session/classes/class.ilEventRecurrence.php';
             $this->rec = new ilEventRecurrence();
         }
         include_once './Services/Calendar/classes/Form/class.ilRecurrenceInputGUI.php';
         $rec = new ilRecurrenceInputGUI($this->lng->txt('cal_recurrences'), 'frequence');
         $rec->allowUnlimitedRecurrences(false);
         $rec->setRecurrence($this->rec);
         $this->form->addItem($rec);
     }
     $section = new ilFormSectionHeaderGUI();
     $section->setTitle($this->lng->txt('event_section_information'));
     $this->form->addItem($section);
     // title
     $title = new ilTextInputGUI($this->lng->txt('event_title'), 'title');
     $title->setValue($this->object->getTitle());
     $title->setSize(50);
     $title->setMaxLength(70);
     $this->form->addItem($title);
     // desc
     $desc = new ilTextAreaInputGUI($this->lng->txt('event_desc'), 'desc');
     $desc->setValue($this->object->getLongDescription());
     $desc->setRows(4);
     $desc->setCols(50);
     $this->form->addItem($desc);
     // location
     $desc = new ilTextAreaInputGUI($this->lng->txt('event_location'), 'location');
     $desc->setValue($this->object->getLocation());
     $desc->setRows(4);
     $desc->setCols(50);
     $this->form->addItem($desc);
     // workflow
     $details = new ilTextAreaInputGUI($this->lng->txt('event_details_workflow'), 'details');
     $details->setValue($this->object->getDetails());
     $details->setCols(50);
     $details->setRows(4);
     $this->form->addItem($details);
     // section
     $section = new ilFormSectionHeaderGUI();
     $section->setTitle($this->lng->txt('event_tutor_data'));
     $this->form->addItem($section);
     // name
     $tutor_name = new ilTextInputGUI($this->lng->txt('tutor_name'), 'tutor_name');
     $tutor_name->setValue($this->object->getName());
     $tutor_name->setSize(20);
     $tutor_name->setMaxLength(70);
     $this->form->addItem($tutor_name);
     // email
     $tutor_email = new ilTextInputGUI($this->lng->txt('tutor_email'), 'tutor_email');
     $tutor_email->setValue($this->object->getEmail());
     $tutor_email->setSize(20);
     $tutor_email->setMaxLength(70);
     $this->form->addItem($tutor_email);
     // phone
     $tutor_phone = new ilTextInputGUI($this->lng->txt('tutor_phone'), 'tutor_phone');
     $tutor_phone->setValue($this->object->getPhone());
     $tutor_phone->setSize(20);
     $tutor_phone->setMaxLength(70);
     $this->form->addItem($tutor_phone);
     $section = new ilFormSectionHeaderGUI();
     $section->setTitle($this->lng->txt('crs_further_settings'));
     $this->form->addItem($section);
     // registration
     $reg = new ilCheckboxInputGUI($this->lng->txt('event_registration'), 'registration');
     $reg->setChecked($this->object->enabledRegistration() ? true : false);
     $reg->setOptionTitle($this->lng->txt('event_registration_info'));
     $this->form->addItem($reg);
     $section = new ilFormSectionHeaderGUI();
     $section->setTitle($this->lng->txt('event_assign_files'));
     $this->form->addItem($section);
     $files = new ilFileWizardInputGUI($this->lng->txt('objs_file'), 'files');
     $files->setFilenames(array(0 => ''));
     $this->form->addItem($files);
     switch ($a_mode) {
         case 'create':
             $this->form->setTitle($this->lng->txt('event_table_create'));
             $this->form->setTitleIcon(ilUtil::getImagePath('icon_event.png'));
             $this->form->addCommandButton('save', $this->lng->txt('event_btn_add'));
             $this->form->addCommandButton('saveAndAssignMaterials', $this->lng->txt('event_btn_add_edit'));
             $this->form->addCommandButton('cancel', $this->lng->txt('cancel'));
             return true;
         case 'edit':
             $this->form->setTitle($this->lng->txt('event_table_update'));
             $this->form->setTitleIcon(ilUtil::getImagePath('icon_event.png'));
             $this->form->addCommandButton('update', $this->lng->txt('save'));
             $this->form->addCommandButton('cancel', $this->lng->txt('cancel'));
             return true;
     }
     return true;
 }
 /**
  * Creates recurrence gui.
  * Includes some settings to modify initial recurrence gui.
  *
  * @param type $a_qsearch_form
  */
 private function createRecurrenceFormItem()
 {
     $this->getRecurrence();
     $rec = new ilRecurrenceInputGUI($this->lng->txt('cal_recurrences'), 'frequence');
     // set possible frequence types (IL_CAL_FREQ_YEARLY not needed)
     $subforms = array(IL_CAL_FREQ_DAILY, IL_CAL_FREQ_WEEKLY, IL_CAL_FREQ_MONTHLY);
     $rec->setRecurrence($this->rec);
     $rec->setEnabledSubForms($subforms);
     // no unlimited recurrences
     $rec->allowUnlimitedRecurrences(false);
     return $rec;
 }