/** * Updates properties */ public function updateProperties() { /** * @var $ilCtrl ilCtrl */ global $ilCtrl; $this->initPropertiesForm(); $formValid = $this->form->checkInput(); $duration = $this->form->getInput("duration"); if ($this->form->getInput('time_type_selection') == 'permanent_room' && ilAdobeConnectServer::getSetting('enable_perm_room', '1')) { $durationValid = true; } else { if ($duration['hh'] * 60 + $duration['mm'] < 10) { global $lng; $this->form->getItemByPostVar('duration')->setAlert($lng->txt('min_duration_error')); $durationValid = false; } else { $durationValid = true; } } $oldObject = new ilObjAdobeConnect(); $oldObject->setId($this->object->getId()); $oldObject->doRead(); $time_mismatch = false; if ($formValid && $durationValid) { $newStartDate = $this->form->getItemByPostVar("start_date")->getDate(); $newDuration = $this->form->getInput("duration"); $unix_newStartDate = $newStartDate->getUnixTime(); $newEndDate = new ilDateTime($unix_newStartDate + $newDuration['hh'] * 3600 + $newDuration['mm'] * 60, IL_CAL_UNIX); if (!ilDateTime::_equals($newStartDate, $oldObject->getStartDate()) || !ilDateTime::_equals($newEndDate, $oldObject->getEndDate())) { $serverConfig = ilAdobeConnectServer::_getInstance(); // $minTime = new ilDateTime(time() + $serverConfig->getScheduleLeadTime() * 60 * 60, IL_CAL_UNIX); /* if(ilDateTime::_before($newStartDate, $minTime)) { ilUtil::sendFailure(sprintf($this->pluginObj->txt('xavc_lead_time_mismatch'), ilDatePresentation::formatDate($minTime)), true); $time_mismatch = true; } */ } $this->object->setTitle($this->form->getInput("title")); $this->object->setDescription($this->form->getInput("desc")); $this->object->setInstructions($this->form->getInput('instructions')); $this->object->setContactInfo($this->form->getInput('contact_info')); $enable_perm_room = ilAdobeConnectServer::getSetting('enable_perm_room', '1') && $this->form->getInput('time_type_selection') == 'permanent_room' ? true : false; $this->object->setPermanentRoom($enable_perm_room ? 1 : 0); $this->object->setReadContents((int) $this->form->getInput('read_contents')); $this->object->setReadRecords((int) $this->form->getInput('read_records')); $access_level = ilObjAdobeConnect::ACCESS_LEVEL_PROTECTED; if (in_array($this->form->getInput('access_level'), array(ilObjAdobeConnect::ACCESS_LEVEL_PRIVATE, ilObjAdobeConnect::ACCESS_LEVEL_PROTECTED, ilObjAdobeConnect::ACCESS_LEVEL_PUBLIC))) { $access_level = $this->form->getInput('access_level'); } $this->object->setPermission($access_level); if (!$time_mismatch || $this->form->getInput('time_type_selection') == 'permanent_room' && ilAdobeConnectServer::getSetting('enable_perm_room', '1')) { $this->object->setStartDate($this->form->getItemByPostVar("start_date")->getDate()); $duration = $this->form->getInput("duration"); $this->object->setDuration(array("hours" => $duration["hh"], "minutes" => $duration["mm"])); } $concurrent_vcs = $this->object->checkConcurrentMeetingDates(); $num_max_ac_obj = ilAdobeConnectServer::getSetting('ac_interface_objects'); if ((int) $num_max_ac_obj <= 0 || (int) count($concurrent_vcs) < (int) $num_max_ac_obj) { $this->object->update(); ilUtil::sendSuccess($this->lng->txt("msg_obj_modified"), true); $ilCtrl->redirect($this, 'editProperties'); } else { ilUtil::sendFailure($this->pluginObj->txt('maximum_concurrent_vcs_reached'), true); $ilCtrl->redirect($this, 'editProperties'); } } $this->form->setValuesByPost(); }
/** * Updates properties */ public function updateProperties() { /** * @var $ilCtrl ilCtrl */ global $ilCtrl, $lng; $this->initPropertiesForm(); $formValid = $this->form->checkInput(); $duration = $this->form->getInput("duration"); if ($this->form->getInput('time_type_selection') == 'permanent_room') { $durationValid = true; } else { if ($duration['hh'] * 60 + $duration['mm'] < 10) { $this->form->getItemByPostVar('duration')->setAlert($lng->txt('min_duration_error')); $durationValid = false; } else { $durationValid = true; } } $oldObject = new ilObjAdobeConnect(); $oldObject->setId($this->object->getId()); $oldObject->doRead(); $time_mismatch = false; if ($formValid && $durationValid) { $newStartDate = $this->form->getItemByPostVar("start_date")->getDate(); $newDuration = $this->form->getInput("duration"); $unix_newStartDate = $newStartDate->getUnixTime(); $newEndDate = new ilDateTime($unix_newStartDate + $newDuration['hh'] * 3600 + $newDuration['mm'] * 60, IL_CAL_UNIX); if (!ilDateTime::_equals($newStartDate, $oldObject->getStartDate()) || !ilDateTime::_equals($newEndDate, $oldObject->getEndDate())) { $serverConfig = ilAdobeConnectServer::_getInstance(); $minTime = new ilDateTime(time() + $serverConfig->getScheduleLeadTime() * 60 * 60, IL_CAL_UNIX); } $this->object->setTitle($this->form->getInput("title")); $this->object->setDescription($this->form->getInput("desc")); $this->object->setInstructions($this->form->getInput('instructions')); $this->object->setContactInfo($this->form->getInput('contact_info')); $this->object->setPermanentRoom($this->form->getInput('time_type_selection') == 'permanent_room' ? 1 : 0); $this->object->setReadContents((int) $this->form->getInput('read_contents')); $this->object->setReadRecords((int) $this->form->getInput('read_records')); $this->object->setMeetingLang($this->form->getInput('meeting_lang')); $this->object->setMaxPax($this->form->getInput('max_pax')); $access_level = ilObjAdobeConnect::ACCESS_LEVEL_PROTECTED; if (in_array($this->form->getInput('access_level'), array(ilObjAdobeConnect::ACCESS_LEVEL_PRIVATE, ilObjAdobeConnect::ACCESS_LEVEL_PROTECTED, ilObjAdobeConnect::ACCESS_LEVEL_PUBLIC))) { $access_level = $this->form->getInput('access_level'); } $this->object->setPermission($access_level); if (!$time_mismatch || $this->form->getInput('time_type_selection') == 'permanent_room') { $this->object->setStartDate($this->form->getItemByPostVar("start_date")->getDate()); $duration = $this->form->getInput("duration"); $this->object->setDuration(array("hours" => $duration["hh"], "minutes" => $duration["mm"])); } $concurrent_vcs = $this->object->checkConcurrentMeetingDates(); $num_max_ac_obj = ilAdobeConnectServer::getSetting('ac_interface_objects'); if ((int) $num_max_ac_obj <= 0 || (int) count($concurrent_vcs) < (int) $num_max_ac_obj) { $this->object->update(); ilUtil::sendSuccess($this->lng->txt("msg_obj_modified"), true); $ilCtrl->redirect($this, 'editProperties'); } else { ilUtil::sendFailure($this->pluginObj->txt('maximum_concurrent_vcs_reached'), true); $ilCtrl->redirect($this, 'editProperties'); } } else { $this->pluginObj->includeClass('class.ilAdobeConnectServer.php'); $this->tabs->activateTab("properties"); $this->object->setTitle($this->form->getInput("title")); $this->object->setDescription($this->form->getInput("desc")); $this->object->setInstructions($this->form->getInput('instructions')); $this->object->setContactInfo($this->form->getInput('contact_info')); $this->object->setPermanentRoom($this->form->getInput('time_type_selection') == 'permanent_room' ? 1 : 0); $this->object->setReadContents((int) $this->form->getInput('read_contents')); $this->object->setReadRecords((int) $this->form->getInput('read_records')); $this->object->setMeetingLang($this->form->getInput('meeting_lang')); $this->object->setMaxPax($this->form->getInput('max_pax')); $this->getPropertiesValues(); $settings = ilAdobeConnectServer::_getInstance(); $max_allowed_pax = $settings->getSetting('max_pax'); if (empty($max_allowed_pax)) { $max_allowed_pax = 200; } if ($this->object->getMaxPax() > $max_allowed_pax) { $this->form->getItemByPostVar('max_pax')->setAlert($this->pluginObj->txt('max_size_error') . ' ' . $max_allowed_pax); } if (ilAdobeConnectServer::getSetting('show_free_slots')) { $this->showCreationForm($this->form); } else { $this->tpl->setContent($this->form->getHtml()); } } $this->form->setValuesByPost(); }