/**
  * Init form
  * @param int $a_mode
  * @return 
  */
 protected function initFormSequence($a_mode)
 {
     include_once './Services/Form/classes/class.ilPropertyFormGUI.php';
     include_once './Services/YUI/classes/class.ilYuiUtil.php';
     ilYuiUtil::initDomEvent();
     $this->form = new ilPropertyFormGUI();
     $this->form->setFormAction($this->ctrl->getFormAction($this));
     switch ($a_mode) {
         case self::MODE_CREATE:
             $this->form->setTitle($this->lng->txt('cal_ch_add_sequence'));
             $this->form->addCommandButton('saveSequence', $this->lng->txt('save'));
             $this->form->addCommandButton('appointmentList', $this->lng->txt('cancel'));
             break;
             /*
             			case self::MODE_UPDATE:
             				$this->form->setTitle($this->lng->txt('cal_ch_edit_sequence'));
             				$this->form->addCommandButton('updateSequence', $this->lng->txt('save'));
             				$this->form->addCommandButton('appointmentList', $this->lng->txt('cancel'));
             				break;
             */
         /*
         			case self::MODE_UPDATE:
         				$this->form->setTitle($this->lng->txt('cal_ch_edit_sequence'));
         				$this->form->addCommandButton('updateSequence', $this->lng->txt('save'));
         				$this->form->addCommandButton('appointmentList', $this->lng->txt('cancel'));
         				break;
         */
         case self::MODE_MULTI:
             $this->form->setTitle($this->lng->txt('cal_ch_multi_edit_sequence'));
             $this->form->addCommandButton('updateMulti', $this->lng->txt('save'));
             $this->form->addCommandButton('appointmentList', $this->lng->txt('cancel'));
             break;
     }
     // in case of existing groups show a selection
     include_once './Services/Calendar/classes/ConsultationHours/class.ilConsultationHourGroups.php';
     if (count($options = ilConsultationHourGroups::getGroupSelectOptions($this->getUserId()))) {
         $group = new ilSelectInputGUI($this->lng->txt('cal_ch_grp_selection'), 'grp');
         $group->setOptions($options);
         $group->setRequired(false);
         $this->form->addItem($group);
     }
     // Title
     $ti = new ilTextInputGUI($this->lng->txt('title'), 'ti');
     $ti->setSize(32);
     $ti->setMaxLength(128);
     $ti->setRequired(true);
     $this->form->addItem($ti);
     if ($a_mode != self::MODE_MULTI) {
         // Start
         include_once './Services/Form/classes/class.ilDateTimeInputGUI.php';
         $dur = new ilDateTimeInputGUI($this->lng->txt('cal_start'), 'st');
         $dur->setShowTime(true);
         $dur->setMinuteStepSize(5);
         $this->form->addItem($dur);
         // Duration
         $du = new ilDurationInputGUI($this->lng->txt('cal_ch_duration'), 'du');
         $du->setShowMinutes(true);
         $du->setShowHours(true);
         $this->form->addItem($du);
         // Number of appointments
         $nu = new ilNumberInputGUI($this->lng->txt('cal_ch_num_appointments'), 'ap');
         $nu->setInfo($this->lng->txt('cal_ch_num_appointments_info'));
         $nu->setSize(2);
         $nu->setMaxLength(2);
         $nu->setRequired(true);
         $nu->setMinValue(1);
         $this->form->addItem($nu);
         // Recurrence
         include_once './Services/Calendar/classes/Form/class.ilRecurrenceInputGUI.php';
         $rec = new ilRecurrenceInputGUI($this->lng->txt('cal_recurrences'), 'frequence');
         $rec->setEnabledSubForms(array(IL_CAL_FREQ_DAILY, IL_CAL_FREQ_WEEKLY, IL_CAL_FREQ_MONTHLY));
         $this->form->addItem($rec);
     }
     // Number of bookings
     $nu = new ilNumberInputGUI($this->lng->txt('cal_ch_num_bookings'), 'bo');
     $nu->setSize(2);
     $nu->setMaxLength(2);
     $nu->setMinValue(1);
     $nu->setRequired(true);
     $this->form->addItem($nu);
     // Deadline
     $dead = new ilDurationInputGUI($this->lng->txt('cal_ch_deadline'), 'dead');
     $dead->setInfo($this->lng->txt('cal_ch_deadline_info'));
     $dead->setShowMinutes(false);
     $dead->setShowHours(true);
     $dead->setShowDays(true);
     $this->form->addItem($dead);
     // Location
     $lo = new ilTextInputGUI($this->lng->txt('cal_where'), 'lo');
     $lo->setSize(32);
     $lo->setMaxLength(128);
     $this->form->addItem($lo);
     // Description
     $de = new ilTextAreaInputGUI($this->lng->txt('description'), 'de');
     $de->setRows(10);
     $de->setCols(60);
     $this->form->addItem($de);
     // Target Object
     $tgt = new ilTextInputGUI($this->lng->txt('cal_ch_target_object'), 'tgt');
     $tgt->setInfo($this->lng->txt('cal_ch_target_object_info'));
     $tgt->setSize(16);
     $tgt->setMaxLength(128);
     $this->form->addItem($tgt);
 }