5 require_once(
"./Modules/Portfolio/classes/class.ilPCConsultationHours.php");
6 require_once(
"./Services/COPage/classes/class.ilPageContentGUI.php");
35 $next_class = $this->ctrl->getNextClass($this);
38 $cmd = $this->ctrl->getCmd();
65 $tpl->setContent($a_form->getHTML());
83 $tpl->setContent($a_form->getHTML());
96 include_once(
"./Services/Form/classes/class.ilPropertyFormGUI.php");
98 $form->setFormAction($ilCtrl->getFormAction($this));
101 $form->setTitle($this->lng->txt(
"cont_insert_consultation_hours"));
105 $form->setTitle($this->lng->txt(
"cont_update_consultation_hours"));
110 $form->addItem($mode);
112 $opt_auto =
new ilRadioOption($this->lng->txt(
"cont_cach_mode_automatic"),
"auto");
113 $opt_auto->
setInfo($this->lng->txt(
"cont_cach_mode_automatic_info"));
114 $mode->addOption($opt_auto);
116 $opt_manual =
new ilRadioOption($this->lng->txt(
"cont_cach_mode_manual"),
"manual");
117 $opt_manual->
setInfo($this->lng->txt(
"cont_cach_mode_manual_info"));
118 $mode->addOption($opt_manual);
122 include_once
"Services/Calendar/classes/ConsultationHours/class.ilConsultationHourGroups.php";
126 $this->lng->loadLanguageModule(
"dateplaner");
129 $opt_manual->addSubItem($groups);
131 foreach($grp_ids as $grp_obj)
133 $groups->addOption(
new ilCheckboxOption($grp_obj->getTitle(), $grp_obj->getGroupId()));
138 $opt_manual->setDisabled(
true);
143 $opt_manual->setDisabled(
true);
148 $mode->setValue(
"auto");
150 $form->addCommandButton(
"create_consultation_hours", $this->lng->txt(
"select"));
151 $form->addCommandButton(
"cancelCreate", $this->lng->txt(
"cancel"));
156 $grp_ids = $this->content_obj->getGroupIds();
159 $mode->setValue(
"manual");
160 $groups->setValue($grp_ids);
164 $mode->setValue(
"auto");
167 $form->addCommandButton(
"update", $this->lng->txt(
"select"));
168 $form->addCommandButton(
"cancelUpdate", $this->lng->txt(
"cancel"));
180 if($form->checkInput())
183 $mode = $form->getInput(
"mode");
184 if($mode ==
"manual")
186 $grp_ids = $form->getInput(
"grp");
190 $this->content_obj->create($this->pg_obj, $this->hier_id, $this->pc_id);
191 $this->content_obj->setData($mode, (array)$grp_ids);
192 $this->updated = $this->pg_obj->update();
193 if ($this->updated ===
true)
195 $this->ctrl->returnToParent($this,
"jump".$this->hier_id);
199 $form->setValuesByPost();
200 return $this->
insert($form);
209 if($form->checkInput())
212 $mode = $form->getInput(
"mode");
213 if($mode ==
"manual")
215 $grp_ids = $form->getInput(
"grp");
218 $this->content_obj->setData($mode, $grp_ids);
219 $this->updated = $this->pg_obj->update();
220 if ($this->updated ===
true)
222 $this->ctrl->returnToParent($this,
"jump".$this->hier_id);
226 $this->pg_obj->addHierIDs();
227 $form->setValuesByPost();
228 return $this->
edit($form);