36 $this->tpl = $DIC[
"tpl"];
37 $this->
ctrl = $DIC->ctrl();
38 $this->
user = $DIC->user();
39 $this->
lng = $DIC->language();
46 $next_class = $this->
ctrl->getNextClass($this);
49 $cmd = $this->
ctrl->getCmd();
51 switch ($next_class) {
99 $form->setFormAction($ilCtrl->getFormAction($this));
101 $form->setTitle($this->
lng->txt(
"cont_insert_consultation_hours"));
103 $form->setTitle($this->
lng->txt(
"cont_update_consultation_hours"));
108 $form->addItem($mode);
110 $opt_auto =
new ilRadioOption($this->
lng->txt(
"cont_cach_mode_automatic"),
"auto");
111 $opt_auto->
setInfo($this->
lng->txt(
"cont_cach_mode_automatic_info"));
112 $mode->addOption($opt_auto);
114 $opt_manual =
new ilRadioOption($this->
lng->txt(
"cont_cach_mode_manual"),
"manual");
115 $opt_manual->
setInfo($this->
lng->txt(
"cont_cach_mode_manual_info"));
116 $mode->addOption($opt_manual);
118 if (!$this->
getPageConfig()->getEnablePCType(
"PlaceHolder")) {
120 if (count($grp_ids)) {
121 $this->
lng->loadLanguageModule(
"dateplaner");
124 $opt_manual->addSubItem($groups);
126 foreach ($grp_ids as $grp_obj) {
127 $groups->addOption(
new ilCheckboxOption($grp_obj->getTitle(), $grp_obj->getGroupId()));
130 $opt_manual->setDisabled(
true);
133 $opt_manual->setDisabled(
true);
137 $mode->setValue(
"auto");
139 $form->addCommandButton(
"create_consultation_hours", $this->
lng->txt(
"select"));
140 $form->addCommandButton(
"cancelCreate", $this->
lng->txt(
"cancel"));
143 $grp_ids = $this->content_obj->getGroupIds();
144 if (count($grp_ids)) {
145 $mode->setValue(
"manual");
146 $groups->setValue($grp_ids);
148 $mode->setValue(
"auto");
151 $form->addCommandButton(
"update", $this->
lng->txt(
"select"));
152 $form->addCommandButton(
"cancelUpdate", $this->
lng->txt(
"cancel"));
161 if ($form->checkInput()) {
163 $mode = $form->getInput(
"mode");
164 if ($mode ==
"manual") {
165 $grp_ids = $form->getInput(
"grp");
169 $this->content_obj->create($this->pg_obj, $this->hier_id, $this->pc_id);
170 $this->content_obj->setData($mode, (array) $grp_ids);
171 $this->updated = $this->pg_obj->update();
172 if ($this->updated ===
true) {
173 $this->
ctrl->returnToParent($this,
"jump" . $this->hier_id);
177 $form->setValuesByPost();
184 if ($form->checkInput()) {
186 $mode = $form->getInput(
"mode");
187 if ($mode ==
"manual") {
188 $grp_ids = $form->getInput(
"grp");
191 $this->content_obj->setData($mode, $grp_ids);
192 $this->updated = $this->pg_obj->update();
193 if ($this->updated ===
true) {
194 $this->
ctrl->returnToParent($this,
"jump" . $this->hier_id);
198 $this->pg_obj->addHierIDs();
199 $form->setValuesByPost();
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
insert(ilPropertyFormGUI $a_form=null)
Insert consultation hours form.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static getGroupsOfUser(int $a_user_id)
Get a all groups of an user.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
User Interface for Editing of Page Content Objects (Paragraphs, Tables, ...)
setContent(string $a_html)
Sets content for standard template.
Class ilPageObject Handles PageObjects of ILIAS Learning Modules (see ILIAS DTD)
ilGlobalTemplateInterface $tpl
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
initForm(bool $a_insert=false)
Init consultation hours form.
edit(ilPropertyFormGUI $a_form=null)
Edit consultation hours form.
__construct(ilPageObject $a_pg_obj, ?ilPageContent $a_content_obj, string $a_hier_id, string $a_pc_id="")
__construct(Container $dic, ilPlugin $plugin)