5require_once(
"./Modules/Portfolio/classes/class.ilPCConsultationHours.php");
 
    6require_once(
"./Services/COPage/classes/class.ilPageContentGUI.php");
 
   29    public function __construct($a_pg_obj, $a_content_obj, $a_hier_id, $a_pc_id = 
"")
 
   33        $this->tpl = 
$DIC[
"tpl"];
 
   34        $this->ctrl = 
$DIC->ctrl();
 
   35        $this->
user = $DIC->user();
 
   36        $this->lng = 
$DIC->language();
 
   37        parent::__construct($a_pg_obj, $a_content_obj, $a_hier_id, $a_pc_id);
 
   46        $next_class = $this->ctrl->getNextClass($this);
 
   49        $cmd = $this->ctrl->getCmd();
 
   51        switch ($next_class) {
 
   74        $tpl->setContent($a_form->getHTML());
 
   91        $tpl->setContent($a_form->getHTML());
 
  106        include_once(
"./Services/Form/classes/class.ilPropertyFormGUI.php");
 
  110            $form->setTitle($this->lng->txt(
"cont_insert_consultation_hours"));
 
  112            $form->setTitle($this->lng->txt(
"cont_update_consultation_hours"));
 
  116        $mode->setRequired(
true);
 
  117        $form->addItem($mode);
 
  119        $opt_auto = 
new ilRadioOption($this->lng->txt(
"cont_cach_mode_automatic"), 
"auto");
 
  120        $opt_auto->setInfo($this->lng->txt(
"cont_cach_mode_automatic_info"));
 
  121        $mode->addOption($opt_auto);
 
  123        $opt_manual = 
new ilRadioOption($this->lng->txt(
"cont_cach_mode_manual"), 
"manual");
 
  124        $opt_manual->setInfo($this->lng->txt(
"cont_cach_mode_manual_info"));
 
  125        $mode->addOption($opt_manual);
 
  127        if (!$this->
getPageConfig()->getEnablePCType(
"PlaceHolder")) {
 
  128            include_once 
"Services/Calendar/classes/ConsultationHours/class.ilConsultationHourGroups.php";
 
  130            if (
sizeof($grp_ids)) {
 
  131                $this->lng->loadLanguageModule(
"dateplaner");
 
  133                $groups->setRequired(
true);
 
  134                $opt_manual->addSubItem($groups);
 
  136                foreach ($grp_ids as $grp_obj) {
 
  137                    $groups->addOption(
new ilCheckboxOption($grp_obj->getTitle(), $grp_obj->getGroupId()));
 
  140                $opt_manual->setDisabled(
true);
 
  143            $opt_manual->setDisabled(
true);
 
  147            $mode->setValue(
"auto");
 
  149            $form->addCommandButton(
"create_consultation_hours", $this->lng->txt(
"select"));
 
  150            $form->addCommandButton(
"cancelCreate", $this->lng->txt(
"cancel"));
 
  153            $grp_ids = $this->content_obj->getGroupIds();
 
  154            if (
sizeof($grp_ids)) {
 
  155                $mode->setValue(
"manual");
 
  156                $groups->setValue($grp_ids);
 
  158                $mode->setValue(
"auto");
 
  161            $form->addCommandButton(
"update", $this->lng->txt(
"select"));
 
  162            $form->addCommandButton(
"cancelUpdate", $this->lng->txt(
"cancel"));
 
  174        if (
$form->checkInput()) {
 
  176            $mode = 
$form->getInput(
"mode");
 
  177            if ($mode == 
"manual") {
 
  178                $grp_ids = 
$form->getInput(
"grp");
 
  182            $this->content_obj->create($this->pg_obj, $this->hier_id, $this->pc_id);
 
  183            $this->content_obj->setData($mode, (array) $grp_ids);
 
  184            $this->updated = $this->pg_obj->update();
 
  185            if ($this->updated === 
true) {
 
  186                $this->ctrl->returnToParent($this, 
"jump" . $this->hier_id);
 
  190        $form->setValuesByPost();
 
  200        if (
$form->checkInput()) {
 
  202            $mode = 
$form->getInput(
"mode");
 
  203            if ($mode == 
"manual") {
 
  204                $grp_ids = 
$form->getInput(
"grp");
 
  207            $this->content_obj->setData($mode, $grp_ids);
 
  208            $this->updated = $this->pg_obj->update();
 
  209            if ($this->updated === 
true) {
 
  210                $this->ctrl->returnToParent($this, 
"jump" . $this->hier_id);
 
  214        $this->pg_obj->addHierIDs();
 
  215        $form->setValuesByPost();
 
An exception for terminatinating execution or to throw for unit testing.
This class represents an option in a checkbox group.
static getGroupsOfUser($a_user_id)
Get a all groups of an user.
Class ilPCConsultationHoursGUI.
executeCommand()
execute command
create()
Create new consultation hours.
insert(ilPropertyFormGUI $a_form=null)
Insert consultation hours form.
edit(ilPropertyFormGUI $a_form=null)
Edit consultation hours form.
update()
Update consultation hours.
initForm($a_insert=false)
Init consultation hours form.
__construct($a_pg_obj, $a_content_obj, $a_hier_id, $a_pc_id="")
Constructor @access public.
Class ilPCConsultationHours.
User Interface for Editing of Page Content Objects (Paragraphs, Tables, ...)
getPageConfig()
Get Page Config.
displayValidationError()
display validation errors
This class represents an option in a radio group.
if(isset($_POST['submit'])) $form