public function addCustomerObject()
 {
     global $ilToolbar;
     if ($_POST['sell_id'] != '') {
         $_GET['sell_id'] = $_POST['sell_id'];
     }
     if ($_GET['user_id'] != '') {
         $_POST['user_id'] = $_GET['user_id'];
     }
     if (!isset($_GET['sell_id'])) {
         ilUtil::sendInfo($this->lng->txt('paya_no_booking_id_given'));
         $this->showObjectSelectorObject();
         return true;
     }
     if (!isset($_POST['user_id'])) {
         ilUtil::sendInfo($this->lng->txt('paya_no_user_id_given'));
         $this->searchUserSPObject();
         return true;
     }
     $this->tpl->addBlockFile('ADM_CONTENT', 'adm_content', 'tpl.main_view.html', 'Services/Payment');
     $this->ctrl->setParameter($this, 'sell_id', $_GET['sell_id']);
     $ilToolbar->addButton($this->lng->txt('back'), $this->ctrl->getLinkTarget($this, 'searchUserSP'));
     $this->ctrl->setParameter($this, 'user_id', $_POST['user_id']);
     $pObjectId = ilPaymentObject::_lookupPobjectId($_GET['sell_id']);
     $obj = new ilPaymentObject($this->user_obj, $pObjectId);
     // get obj
     $tmp_obj = ilObjectFactory::getInstanceByRefId($_GET['sell_id'], false);
     if ($tmp_obj) {
         $tmp_object['title'] = $tmp_obj->getTitle();
     } else {
         $tmp_object['title'] = $this->lng->txt('object_not_found');
     }
     // get customer_obj
     $tmp_user = ilObjectFactory::getInstanceByObjId($_POST['user_id']);
     // get vendor_obj
     $tmp_vendor = ilObjectFactory::getInstanceByObjId($obj->getVendorId());
     /**/
     $oForm = new ilPropertyFormGUI();
     $oForm->setFormAction($this->ctrl->getFormAction($this, 'saveCustomer'));
     $oForm->setTitle($this->lng->txt($tmp_user->getFullname() . ' [' . $tmp_user->getLogin() . ']'));
     //transaction
     $oTransaction = new ilTextInputGUI();
     $oTransaction->setTitle($this->lng->txt('paya_transaction'));
     //$oTransaction->setValue(ilUtil::prepareFormOutut($_POST['transaction'], true));
     $oTransaction->setValue($_POST['transaction']);
     $oTransaction->setPostVar('transaction');
     $oForm->addItem($oTransaction);
     //object
     $oObject = new ilNonEditableValueGUI($this->lng->txt('title'));
     $oObject->setValue($tmp_obj->getTitle());
     $oForm->addItem($oObject);
     //vendor
     $oVendor = new ilNonEditableValueGUI($this->lng->txt('paya_vendor'));
     $oVendor->setValue($tmp_vendor->getFullname() . ' [' . $tmp_vendor->getLogin() . ']');
     $oForm->addItem($oVendor);
     // pay methods
     $oPayMethods = new ilSelectInputGUI($this->lng->txt('paya_pay_method'), 'pay_method');
     $payOptions = ilPaymethods::getPayMethodsOptions(false);
     $oPayMethods->setOptions($payOptions);
     $oPayMethods->setValue($_POST['pay_method']);
     $oPayMethods->setPostVar('pay_method');
     $oForm->addItem($oPayMethods);
     //duration
     $duration_options = array();
     $price_obj = new ilPaymentPrices($pObjectId);
     $standard_prices = array();
     $extension_prices = array();
     $standard_prices = $price_obj->getPrices();
     $extension_prices = $price_obj->getExtensionPrices();
     $prices = array_merge($standard_prices, $extension_prices);
     if (is_array($prices)) {
         $genSet = ilPaymentSettings::_getInstance();
         $currency_unit = $genSet->get('currency_unit');
         foreach ($prices as $price) {
             switch ($price['price_type']) {
                 case ilPaymentPrices::TYPE_DURATION_MONTH:
                     $txt_duration = $price['duration'] . ' ' . $this->lng->txt('paya_months') . ' -> ' . $price['price'] . ' ' . $currency_unit;
                     break;
                 case ilPaymentPrices::TYPE_DURATION_DATE:
                     include_once './Services/Calendar/classes/class.ilDatePresentation.php';
                     $txt_duration = ilDatePresentation::formatDate(new ilDate($price['duration_from'], IL_CAL_DATE)) . ' - ' . ilDatePresentation::formatDate(new ilDate($price['duration_until'], IL_CAL_DATE)) . " -> " . ilPaymentPrices::_getPriceString($price["price_id"]) . ' ' . $currency_unit;
                     break;
                 case ilPaymentPrices::TYPE_UNLIMITED_DURATION:
                     $txt_duration = $this->lng->txt('unlimited_duration') . ' -> ' . $price['price'] . ' ' . $currency_unit;
                     break;
             }
             $txt_extension = '';
             if ($price['extension'] == 1) {
                 $txt_extension = ' (' . $this->lng->txt('extension_price') . ') ';
             }
             $duration_options[$price['price_id']] .= $txt_duration . '' . $txt_extension;
         }
     }
     $oDuration = new ilSelectInputGUI($this->lng->txt('duration'), 'price_id');
     $oDuration->setOptions($duration_options);
     $oDuration->setValue($_POST['price_id']);
     $oForm->addItem($oDuration);
     //payed
     $o_payed = new ilSelectInputGUI();
     $payed_option = array('1' => $this->lng->txt('yes'), '0' => $this->lng->txt('no'));
     $o_payed->setTitle($this->lng->txt('paya_payed'));
     $o_payed->setOptions($payed_option);
     $o_payed->setValue($_POST['payed']);
     $o_payed->setPostVar('payed');
     $oForm->addItem($o_payed);
     $o_access = new ilSelectInputGUI();
     $access_option = array('1' => $this->lng->txt('yes'), '0' => $this->lng->txt('no'));
     $o_access->setTitle($this->lng->txt('paya_access'));
     $o_access->setOptions($access_option);
     $o_access->setValue($_POST['access']);
     $o_access->setPostVar('access');
     $oForm->addItem($o_access);
     $oForm->addCommandButton('saveCustomer', $this->lng->txt('save'));
     $oForm->addCommandButton('bookings', $this->lng->txt('cancel'));
     $this->tpl->setVariable('FORM', $oForm->getHTML());
     return true;
 }
 function initAddPageLayoutForm()
 {
     global $lng, $ilCtrl;
     $lng->loadLanguageModule("content");
     include_once "Services/Form/classes/class.ilPropertyFormGUI.php";
     $form_gui = new ilPropertyFormGUI();
     $form_gui->setFormAction($ilCtrl->getFormAction($this));
     $form_gui->setTitle($lng->txt("sty_create_pgl"));
     include_once "Services/Form/classes/class.ilRadioMatrixInputGUI.php";
     $title_input = new ilTextInputGUI($lng->txt("title"), "pgl_title");
     $title_input->setSize(50);
     $title_input->setMaxLength(128);
     $title_input->setValue($this->layout_object->title);
     $title_input->setTitle($lng->txt("title"));
     $title_input->setRequired(true);
     $desc_input = new ilTextAreaInputGUI($lng->txt("description"), "pgl_desc");
     $desc_input->setValue($this->layout_object->description);
     $desc_input->setRows(3);
     $desc_input->setCols(37);
     // special page?
     $options = array("0" => $lng->txt("cont_layout_template"), "1" => $lng->txt("cont_special_page"));
     $si = new ilSelectInputGUI($this->lng->txt("type"), "special_page");
     $si->setOptions($options);
     // modules
     $mods = new ilCheckboxGroupInputGUI($this->lng->txt("modules"), "module");
     // $mods->setRequired(true);
     foreach (ilPageLayout::getAvailableModules() as $mod_id => $mod_caption) {
         $mod = new ilCheckboxOption($mod_caption, $mod_id);
         $mods->addOption($mod);
     }
     $ttype_input = new ilSelectInputGUI($lng->txt("sty_based_on"), "pgl_template");
     $arr_templates = ilPageLayout::getLayouts();
     $arr_templates1 = ilPageLayout::getLayouts(false, true);
     foreach ($arr_templates1 as $v) {
         $arr_templates[] = $v;
     }
     $options = array();
     $options['-1'] = $lng->txt("none");
     foreach ($arr_templates as $templ) {
         $templ->readObject();
         $key = $templ->getId();
         $value = $templ->getTitle();
         $options[$key] = $value;
     }
     $ttype_input->setOptions($options);
     $ttype_input->setValue(-1);
     $ttype_input->setRequired(true);
     $desc_input->setTitle($lng->txt("description"));
     $desc_input->setRequired(false);
     $form_gui->addItem($title_input);
     $form_gui->addItem($desc_input);
     $form_gui->addItem($si);
     $form_gui->addItem($mods);
     $form_gui->addItem($ttype_input);
     $form_gui->addCommandButton("createPg", $lng->txt("save"));
     $form_gui->addCommandButton("cancelCreate", $lng->txt("cancel"));
     return $form_gui;
 }
 /**
  * Configure soap settings
  * 
  * @access	public
  */
 function editSOAPObject()
 {
     global $rbacsystem, $rbacreview, $ilSetting, $ilCtrl, $lng;
     if (!$rbacsystem->checkAccess("read", $this->object->getRefId())) {
         $this->ilias->raiseError($this->lng->txt("permission_denied"), $this->ilias->error_obj->MESSAGE);
     }
     $this->tabs_gui->setTabActive('auth_soap');
     //set Template
     $this->tpl->addBlockFile('ADM_CONTENT', 'adm_content', 'tpl.auth_soap.html', 'Services/Authentication');
     // compose role list
     $role_list = $rbacreview->getRolesByFilter(2, $this->object->getId());
     $roles = array();
     foreach ($role_list as $role) {
         $roles[$role['obj_id']] = $role['title'];
     }
     //set property form gui
     include_once "./Services/Form/classes/class.ilPropertyFormGUI.php";
     $soap_config = new ilPropertyFormGUI();
     $soap_config->setTitle($this->lng->txt("auth_soap_auth"));
     $soap_config->setDescription($this->lng->txt("auth_soap_auth_desc"));
     $soap_config->setFormAction($this->ctrl->getFormAction($this, "editSOAP"));
     $soap_config->addCommandButton("saveSOAP", $this->lng->txt("save"));
     $soap_config->addCommandButton("editSOAP", $this->lng->txt("cancel"));
     //set activ
     $active = new ilCheckboxInputGUI();
     $active->setTitle($this->lng->txt("active"));
     $active->setPostVar("soap[active]");
     //set server
     $server = new ilTextInputGUI();
     $server->setTitle($this->lng->txt("server"));
     $server->setInfo($this->lng->txt("auth_soap_server_desc"));
     $server->setPostVar("soap[server]");
     $server->setSize(50);
     $server->setMaxLength(256);
     $server->setRequired(true);
     //set port
     $port = new ilTextInputGUI();
     $port->setTitle($this->lng->txt("port"));
     $port->setInfo($this->lng->txt("auth_soap_port_desc"));
     $port->setPostVar("soap[port]");
     $port->setSize(7);
     $port->setMaxLength(5);
     //set https
     $https = new ilCheckboxInputGUI();
     $https->setTitle($this->lng->txt("auth_soap_use_https"));
     $https->setPostVar("soap[use_https]");
     //set uri
     $uri = new ilTextInputGUI();
     $uri->setTitle($this->lng->txt("uri"));
     $uri->setInfo($this->lng->txt("auth_soap_uri_desc"));
     $uri->setPostVar("soap[uri]");
     $uri->setSize(50);
     $uri->setMaxLength(256);
     //set namespace
     $namespace = new ilTextInputGUI();
     $namespace->setTitle($this->lng->txt("auth_soap_namespace"));
     $namespace->setInfo($this->lng->txt("auth_soap_namespace_desc"));
     $namespace->setPostVar("soap[namespace]");
     $namespace->setSize(50);
     $namespace->setMaxLength(256);
     //set dotnet
     $dotnet = new ilCheckboxInputGUI();
     $dotnet->setTitle($this->lng->txt("auth_soap_use_dotnet"));
     $dotnet->setPostVar("soap[use_dotnet]");
     //set create users
     $createuser = new ilCheckboxInputGUI();
     $createuser->setTitle($this->lng->txt("auth_create_users"));
     $createuser->setInfo($this->lng->txt("auth_soap_create_users_desc"));
     $createuser->setPostVar("soap[create_users]");
     //set account mail
     $sendmail = new ilCheckboxInputGUI();
     $sendmail->setTitle($this->lng->txt("user_send_new_account_mail"));
     $sendmail->setInfo($this->lng->txt("auth_new_account_mail_desc"));
     $sendmail->setPostVar("soap[account_mail]");
     //set user default role
     $defaultrole = new ilSelectInputGUI();
     $defaultrole->setTitle($this->lng->txt("auth_user_default_role"));
     $defaultrole->setInfo($this->lng->txt("auth_soap_user_default_role_desc"));
     $defaultrole->setPostVar("soap[user_default_role]");
     $defaultrole->setOptions($roles);
     //set allow local authentication
     $allowlocal = new ilCheckboxInputGUI();
     $allowlocal->setTitle($this->lng->txt("auth_allow_local"));
     $allowlocal->setInfo($this->lng->txt("auth_soap_allow_local_desc"));
     $allowlocal->setPostVar("soap[allow_local]");
     // get all settings
     $settings = $ilSetting->getAll();
     // get values in error case
     if ($_SESSION["error_post_vars"]) {
         $active->setChecked($_SESSION["error_post_vars"]["soap"]["active"]);
         $server->setValue($_SESSION["error_post_vars"]["soap"]["server"]);
         $port->setValue($_SESSION["error_post_vars"]["soap"]["port"]);
         $https->setChecked($_SESSION["error_post_vars"]["soap"]["use_https"]);
         $uri->setValue($_SESSION["error_post_vars"]["soap"]["uri"]);
         $namespace->setValue($_SESSION["error_post_vars"]["soap"]["namespace"]);
         $dotnet->setChecked($_SESSION["error_post_vars"]["soap"]["use_dotnet"]);
         $createuser->setChecked($_SESSION["error_post_vars"]["soap"]["create_users"]);
         $allowlocal->setChecked($_SESSION["error_post_vars"]["soap"]["allow_local"]);
         $defaultrole->setValue($_SESSION["error_post_vars"]["soap"]["user_default_role"]);
         $sendmail->setChecked($_SESSION["error_post_vars"]["soap"]["account_mail"]);
     } else {
         $active->setChecked($settings["soap_auth_active"]);
         $server->setValue($settings["soap_auth_server"]);
         $port->setValue($settings["soap_auth_port"]);
         $https->setChecked($settings["soap_auth_use_https"]);
         $uri->setValue($settings["soap_auth_uri"]);
         $namespace->setValue($settings["soap_auth_namespace"]);
         $dotnet->setChecked($settings["soap_auth_use_dotnet"]);
         $createuser->setChecked($settings["soap_auth_create_users"]);
         $allowlocal->setChecked($settings["soap_auth_allow_local"]);
         $defaultrole->setValue($settings["soap_auth_user_default_role"]);
         $sendmail->setChecked($settings["soap_auth_account_mail"]);
     }
     if (!$defaultrole->getValue()) {
         $defaultrole->setValue(4);
     }
     //add Items to property gui
     $soap_config->addItem($active);
     $soap_config->addItem($server);
     $soap_config->addItem($port);
     $soap_config->addItem($https);
     $soap_config->addItem($uri);
     $soap_config->addItem($namespace);
     $soap_config->addItem($dotnet);
     $soap_config->addItem($createuser);
     $soap_config->addItem($sendmail);
     $soap_config->addItem($defaultrole);
     $soap_config->addItem($allowlocal);
     $this->tpl->setVariable("CONFIG_FORM", $soap_config->getHTML());
     // test form
     $form = new ilPropertyFormGUI();
     $form->setFormAction($ilCtrl->getFormAction($this));
     $form->setTitle("Test Request");
     $text_prop = new ilTextInputGUI("ext_uid", "ext_uid");
     $form->addItem($text_prop);
     $text_prop2 = new ilTextInputGUI("soap_pw", "soap_pw");
     $form->addItem($text_prop2);
     $cb = new ilCheckboxInputGUI("new_user", "new_user");
     $form->addItem($cb);
     $form->addCommandButton("testSoapAuthConnection", "Send");
     if ($ilCtrl->getCmd() == "testSoapAuthConnection") {
         include_once "./Services/SOAPAuth/classes/class.ilSOAPAuth.php";
         $ret = "<br />" . ilSOAPAuth::testConnection(ilUtil::stripSlashes($_POST["ext_uid"]), ilUtil::stripSlashes($_POST["soap_pw"]), (bool) $_POST["new_user"]);
     }
     $this->tpl->setVariable("TEST_FORM", $form->getHTML() . $ret);
 }
Example #4
0
 /**
  * init form
  *
  * @access protected
  * @param
  * @return
  */
 protected function initEditForm()
 {
     include_once './Services/Form/classes/class.ilPropertyFormGUI.php';
     include_once './Services/Calendar/classes/class.ilDateTime.php';
     $form = new ilPropertyFormGUI();
     $form->setTitle($this->lng->txt('crs_edit'));
     $form->addCommandButton('update', $this->lng->txt('save'));
     $form->addCommandButton('cancel', $this->lng->txt('cancel'));
     $form->setFormAction($this->ctrl->getFormAction($this, 'update'));
     // title
     $title = new ilTextInputGUI($this->lng->txt('title'), 'title');
     $title->setSubmitFormOnEnter(true);
     $title->setValue($this->object->getTitle());
     $title->setSize(min(40, ilObject::TITLE_LENGTH));
     $title->setMaxLength(ilObject::TITLE_LENGTH);
     $title->setRequired(true);
     $form->addItem($title);
     // desc
     $desc = new ilTextAreaInputGUI($this->lng->txt('description'), 'desc');
     $desc->setValue($this->object->getLongDescription());
     $desc->setRows(2);
     $desc->setCols(40);
     $form->addItem($desc);
     // Show didactic template type
     $this->initDidacticTemplate($form);
     // activation/availability
     $this->lng->loadLanguageModule('rep');
     $section = new ilFormSectionHeaderGUI();
     $section->setTitle($this->lng->txt('rep_activation_availability'));
     $form->addItem($section);
     $online = new ilCheckboxInputGUI($this->lng->txt('rep_activation_online'), 'activation_online');
     $online->setChecked(!$this->object->getOfflineStatus());
     $online->setInfo($this->lng->txt('crs_activation_online_info'));
     $form->addItem($online);
     $act_type = new ilCheckboxInputGUI($this->lng->txt('crs_visibility_until'), 'activation_type');
     $act_type->setChecked($this->object->getActivationType() == IL_CRS_ACTIVATION_LIMITED);
     // $act_type->setInfo($this->lng->txt('crs_availability_until_info'));
     $this->tpl->addJavaScript('./Services/Form/js/date_duration.js');
     include_once "Services/Form/classes/class.ilDateDurationInputGUI.php";
     $dur = new ilDateDurationInputGUI($this->lng->txt('rep_time_period'), "access_period");
     $dur->setShowTime(true);
     $dur->setStart(new ilDateTime($this->object->getActivationStart(), IL_CAL_UNIX));
     $dur->setStartText($this->lng->txt('rep_activation_limited_start'));
     $dur->setEnd(new ilDateTime($this->object->getActivationEnd(), IL_CAL_UNIX));
     $dur->setEndText($this->lng->txt('rep_activation_limited_end'));
     $act_type->addSubItem($dur);
     $visible = new ilCheckboxInputGUI($this->lng->txt('rep_activation_limited_visibility'), 'activation_visibility');
     $visible->setInfo($this->lng->txt('crs_activation_limited_visibility_info'));
     $visible->setChecked($this->object->getActivationVisibility());
     $act_type->addSubItem($visible);
     $form->addItem($act_type);
     $section = new ilFormSectionHeaderGUI();
     $section->setTitle($this->lng->txt('crs_reg'));
     $form->addItem($section);
     $reg_proc = new ilRadioGroupInputGUI($this->lng->txt('crs_registration_type'), 'subscription_type');
     $reg_proc->setValue($this->object->getSubscriptionLimitationType() != IL_CRS_SUBSCRIPTION_DEACTIVATED ? $this->object->getSubscriptionType() : IL_CRS_SUBSCRIPTION_DEACTIVATED);
     // $reg_proc->setInfo($this->lng->txt('crs_reg_type_info'));
     $opt = new ilRadioOption($this->lng->txt('crs_subscription_options_direct'), IL_CRS_SUBSCRIPTION_DIRECT);
     $reg_proc->addOption($opt);
     $opt = new ilRadioOption($this->lng->txt('crs_subscription_options_password'), IL_CRS_SUBSCRIPTION_PASSWORD);
     $pass = new ilTextInputGUI($this->lng->txt("password"), 'subscription_password');
     $pass->setInfo($this->lng->txt('crs_reg_password_info'));
     $pass->setSubmitFormOnEnter(true);
     $pass->setSize(12);
     $pass->setMaxLength(12);
     $pass->setValue($this->object->getSubscriptionPassword());
     $opt->addSubItem($pass);
     $reg_proc->addOption($opt);
     $opt = new ilRadioOption($this->lng->txt('crs_subscription_options_confirmation'), IL_CRS_SUBSCRIPTION_CONFIRMATION);
     $opt->setInfo($this->lng->txt('crs_registration_confirmation_info'));
     $reg_proc->addOption($opt);
     $opt = new ilRadioOption($this->lng->txt('crs_reg_no_selfreg'), IL_CRS_SUBSCRIPTION_DEACTIVATED);
     $opt->setInfo($this->lng->txt('crs_registration_deactivated'));
     $reg_proc->addOption($opt);
     $form->addItem($reg_proc);
     // Registration codes
     $reg_code = new ilCheckboxInputGUI($this->lng->txt('crs_reg_code'), 'reg_code_enabled');
     $reg_code->setChecked($this->object->isRegistrationAccessCodeEnabled());
     $reg_code->setValue(1);
     $reg_code->setInfo($this->lng->txt('crs_reg_code_enabled_info'));
     /*
     $code = new ilNonEditableValueGUI($this->lng->txt('crs_reg_code_value'));
     $code->setValue($this->object->getRegistrationAccessCode());
     $reg_code->addSubItem($code);
     */
     #$link = new ilNonEditableValueGUI($this->lng->txt('crs_reg_code_link'));
     // Create default access code
     if (!$this->object->getRegistrationAccessCode()) {
         include_once './Services/Membership/classes/class.ilMembershipRegistrationCodeUtils.php';
         $this->object->setRegistrationAccessCode(ilMembershipRegistrationCodeUtils::generateCode());
     }
     $reg_link = new ilHiddenInputGUI('reg_code');
     $reg_link->setValue($this->object->getRegistrationAccessCode());
     $form->addItem($reg_link);
     $link = new ilCustomInputGUI($this->lng->txt('crs_reg_code_link'));
     include_once './Services/Link/classes/class.ilLink.php';
     $val = ilLink::_getLink($this->object->getRefId(), $this->object->getType(), array(), '_rcode' . $this->object->getRegistrationAccessCode());
     $link->setHTML('<font class="small">' . $val . '</font>');
     $reg_code->addSubItem($link);
     $form->addItem($reg_code);
     // time limit
     $time_limit = new ilCheckboxInputGUI($this->lng->txt('crs_registration_limited'), 'subscription_limitation_type');
     $time_limit->setChecked($this->object->getSubscriptionLimitationType() == IL_CRS_SUBSCRIPTION_LIMITED ? true : false);
     include_once "Services/Form/classes/class.ilDateDurationInputGUI.php";
     $sdur = new ilDateDurationInputGUI($this->lng->txt('crs_registration_period'), "subscription_period");
     $sdur->setShowTime(true);
     $sdur->setStart(new ilDateTime($this->object->getSubscriptionStart(), IL_CAL_UNIX));
     $sdur->setStartText($this->lng->txt('crs_start'));
     $sdur->setEnd(new ilDateTime($this->object->getSubscriptionEnd(), IL_CAL_UNIX));
     $sdur->setEndText($this->lng->txt('crs_end'));
     $time_limit->addSubItem($sdur);
     $form->addItem($time_limit);
     // Max members
     $lim = new ilCheckboxInputGUI($this->lng->txt('crs_subscription_max_members_short'), 'subscription_membership_limitation');
     $lim->setValue(1);
     $lim->setChecked($this->object->isSubscriptionMembershipLimited());
     $max = new ilTextInputGUI('', 'subscription_max');
     $max->setSubmitFormOnEnter(true);
     $max->setSize(4);
     $max->setMaxLength(4);
     $max->setValue($this->object->getSubscriptionMaxMembers() ? $this->object->getSubscriptionMaxMembers() : '');
     $max->setTitle($this->lng->txt('crs_subscription_max_members'));
     $max->setInfo($this->lng->txt('crs_reg_max_info'));
     $lim->addSubItem($max);
     $wait = new ilCheckboxInputGUI($this->lng->txt('crs_waiting_list'), 'waiting_list');
     $wait->setChecked($this->object->enabledWaitingList());
     $wait->setInfo($this->lng->txt('crs_wait_info'));
     $lim->addSubItem($wait);
     $form->addItem($lim);
     $pres = new ilFormSectionHeaderGUI();
     $pres->setTitle($this->lng->txt('crs_view_mode'));
     $form->addItem($pres);
     // presentation type
     $view_type = new ilRadioGroupInputGUI($this->lng->txt('crs_presentation_type'), 'view_mode');
     $view_type->setValue($this->object->getViewMode());
     $opts = new ilRadioOption($this->lng->txt('cntr_view_sessions'), IL_CRS_VIEW_SESSIONS);
     $opts->setInfo($this->lng->txt('cntr_view_info_sessions'));
     $view_type->addOption($opts);
     // Limited sessions
     $sess = new ilCheckboxInputGUI($this->lng->txt('sess_limit'), 'sl');
     $sess->setValue(1);
     $sess->setChecked($this->object->isSessionLimitEnabled());
     $sess->setInfo($this->lng->txt('sess_limit_info'));
     $prev = new ilNumberInputGUI($this->lng->txt('sess_num_prev'), 'sp');
     #$prev->setSubmitFormOnEnter(true);
     $prev->setMinValue(0);
     $prev->setValue($this->object->getNumberOfPreviousSessions() == -1 ? '' : $this->object->getNumberOfPreviousSessions());
     $prev->setSize(2);
     $prev->setMaxLength(3);
     $sess->addSubItem($prev);
     $next = new ilNumberInputGUI($this->lng->txt('sess_num_next'), 'sn');
     #$next->setSubmitFormOnEnter(true);
     $next->setMinValue(0);
     $next->setValue($this->object->getNumberOfNextSessions() == -1 ? '' : $this->object->getNumberOfnextSessions());
     $next->setSize(2);
     $next->setMaxLength(3);
     $sess->addSubItem($next);
     $opts->addSubItem($sess);
     $optsi = new ilRadioOption($this->lng->txt('cntr_view_simple'), IL_CRS_VIEW_SIMPLE);
     $optsi->setInfo($this->lng->txt('cntr_view_info_simple'));
     $view_type->addOption($optsi);
     $optbt = new ilRadioOption($this->lng->txt('cntr_view_by_type'), IL_CRS_VIEW_BY_TYPE);
     $optbt->setInfo($this->lng->txt('cntr_view_info_by_type'));
     $view_type->addOption($optbt);
     $opto = new ilRadioOption($this->lng->txt('crs_view_objective'), IL_CRS_VIEW_OBJECTIVE);
     $opto->setInfo($this->lng->txt('crs_view_info_objective'));
     $view_type->addOption($opto);
     $optt = new ilRadioOption($this->lng->txt('crs_view_timing'), IL_CRS_VIEW_TIMING);
     $optt->setInfo($this->lng->txt('crs_view_info_timing'));
     $view_type->addOption($optt);
     $form->addItem($view_type);
     $this->initSortingForm($form, array(ilContainer::SORT_TITLE, ilContainer::SORT_MANUAL, ilContainer::SORT_CREATION, ilContainer::SORT_ACTIVATION));
     // lp vs. course status
     include_once "Services/Tracking/classes/class.ilObjUserTracking.php";
     if (ilObjUserTracking::_enabledLearningProgress()) {
         include_once './Services/Object/classes/class.ilObjectLP.php';
         $olp = ilObjectLP::getInstance($this->object->getId());
         if ($olp->getCurrentMode()) {
             $lp_status = new ilFormSectionHeaderGUI();
             $lp_status->setTitle($this->lng->txt('crs_course_status_of_users'));
             $form->addItem($lp_status);
             $lp_status_options = new ilRadioGroupInputGUI($this->lng->txt('crs_status_determination'), "status_dt");
             //				$lp_status_options->setRequired(true);
             $lp_status_options->setValue($this->object->getStatusDetermination());
             $lp_option = new ilRadioOption($this->lng->txt('crs_status_determination_lp'), ilObjCourse::STATUS_DETERMINATION_LP, $this->lng->txt('crs_status_determination_lp_info'));
             $lp_status_options->addOption($lp_option);
             $lp_status_options->addOption(new ilRadioOption($this->lng->txt('crs_status_determination_manual'), ilObjCourse::STATUS_DETERMINATION_MANUAL));
             $form->addItem($lp_status_options);
         }
     }
     // additional features
     $feat = new ilFormSectionHeaderGUI();
     $feat->setTitle($this->lng->txt('obj_features'));
     $form->addItem($feat);
     include_once './Services/Object/classes/class.ilObjectServiceSettingsGUI.php';
     ilObjectServiceSettingsGUI::initServiceSettingsForm($this->object->getId(), $form, array(ilObjectServiceSettingsGUI::CALENDAR_VISIBILITY, ilObjectServiceSettingsGUI::NEWS_VISIBILITY, ilObjectServiceSettingsGUI::AUTO_RATING_NEW_OBJECTS, ilObjectServiceSettingsGUI::TAG_CLOUD));
     $mem = new ilCheckboxInputGUI($this->lng->txt('crs_show_members'), 'show_members');
     $mem->setChecked($this->object->getShowMembers());
     $mem->setInfo($this->lng->txt('crs_show_members_info'));
     $form->addItem($mem);
     // Show members type
     $mail_type = new ilRadioGroupInputGUI($this->lng->txt('crs_mail_type'), 'mail_type');
     $mail_type->setValue($this->object->getMailToMembersType());
     $mail_tutors = new ilRadioOption($this->lng->txt('crs_mail_tutors_only'), ilCourseConstants::MAIL_ALLOWED_TUTORS, $this->lng->txt('crs_mail_tutors_only_info'));
     $mail_type->addOption($mail_tutors);
     $mail_all = new ilRadioOption($this->lng->txt('crs_mail_all'), ilCourseConstants::MAIL_ALLOWED_ALL, $this->lng->txt('crs_mail_all_info'));
     $mail_type->addOption($mail_all);
     $form->addItem($mail_type);
     // Notification Settings
     /*$notification = new ilFormSectionHeaderGUI();
     		$notification->setTitle($this->lng->txt('crs_notification'));
     		$form->addItem($notification);*/
     // Self notification
     $not = new ilCheckboxInputGUI($this->lng->txt('crs_auto_notification'), 'auto_notification');
     $not->setValue(1);
     $not->setInfo($this->lng->txt('crs_auto_notification_info'));
     $not->setChecked($this->object->getAutoNotification());
     $form->addItem($not);
     // Further information
     //$further = new ilFormSectionHeaderGUI();
     //$further->setTitle($this->lng->txt('crs_further_settings'));
     //$form->addItem($further);
     $desk = new ilCheckboxInputGUI($this->lng->txt('crs_add_remove_from_desktop'), 'abo');
     $desk->setChecked($this->object->getAboStatus());
     $desk->setInfo($this->lng->txt('crs_add_remove_from_desktop_info'));
     $form->addItem($desk);
     // Edit ecs export settings
     include_once 'Modules/Course/classes/class.ilECSCourseSettings.php';
     $ecs = new ilECSCourseSettings($this->object);
     $ecs->addSettingsToForm($form, 'crs');
     return $form;
 }
 public function renameSubFolder()
 {
     /**
      * @var $ilCtrl ilCtrl
      * @var $tpl    ilTemplate
      */
     global $ilCtrl, $tpl;
     include_once 'Services/Form/classes/class.ilPropertyFormGUI.php';
     $tpl->addBlockFile('ADM_CONTENT', 'adm_content', 'tpl.mail.html', 'Services/Mail');
     $tpl->setTitle($this->lng->txt('mail'));
     $oForm = new ilPropertyFormGUI();
     $oForm->setFormAction($ilCtrl->getFormAction($this, 'performRenameSubFolder'));
     $oForm->setTitle($this->lng->txt('mail_rename_folder'));
     //title
     $oTitle = new ilTextInputGUI();
     $oTitle->setTitle($this->lng->txt('title'));
     $tmp_data = $this->mbox->getFolderData($_GET["mobj_id"]);
     $oTitle->setValue($tmp_data["title"]);
     $oTitle->setPostVar('subfolder_title');
     $oForm->addItem($oTitle);
     $oForm->addCommandButton('performRenameSubFolder', $this->lng->txt('save'));
     $oForm->addCommandButton('showFolder', $this->lng->txt('cancel'));
     $tpl->setVariable('FORM', $oForm->getHTML());
     $tpl->show();
     return true;
 }
 function initForm($a_mode)
 {
     global $ilCtrl, $lng, $ilSetting;
     include_once "Services/Form/classes/class.ilPropertyFormGUI.php";
     $form_gui = new ilPropertyFormGUI();
     $form_gui->setFormAction($ilCtrl->getFormAction($this));
     $form_gui->setTitle($lng->txt("cont_ed_pglprop"));
     // title
     $title_input = new ilTextInputGUI($lng->txt("title"), "pgl_title");
     $title_input->setSize(50);
     $title_input->setMaxLength(128);
     $title_input->setValue($this->layout_object->title);
     $title_input->setTitle($lng->txt("title"));
     $title_input->setRequired(true);
     // description
     $desc_input = new ilTextAreaInputGUI($lng->txt("description"), "pgl_desc");
     $desc_input->setValue($this->layout_object->description);
     $desc_input->setRows(3);
     $desc_input->setCols(37);
     $desc_input->setTitle($lng->txt("description"));
     $desc_input->setRequired(false);
     // modules
     $mods = new ilCheckboxGroupInputGUI($this->lng->txt("modules"), "module");
     // $mods->setRequired(true);
     $mods->setValue($this->layout_object->getModules());
     foreach (ilPageLayout::getAvailableModules() as $mod_id => $mod_caption) {
         $mod = new ilCheckboxOption($mod_caption, $mod_id);
         $mods->addOption($mod);
     }
     $form_gui->addItem($title_input);
     $form_gui->addItem($desc_input);
     $form_gui->addItem($mods);
     // style
     $fixed_style = $ilSetting->get("fixed_content_style_id");
     $style_id = $this->layout_object->getStyleId();
     if ($fixed_style > 0) {
         $st = new ilNonEditableValueGUI($lng->txt("cont_current_style"));
         $st->setValue(ilObject::_lookupTitle($fixed_style) . " (" . $this->lng->txt("global_fixed") . ")");
         $form_gui->addItem($st);
     } else {
         include_once "./Services/Style/classes/class.ilObjStyleSheet.php";
         $st_styles = ilObjStyleSheet::_getStandardStyles(true, false);
         $st_styles[0] = $this->lng->txt("default");
         ksort($st_styles);
         $style_sel = new ilSelectInputGUI($lng->txt("obj_sty"), "style_id");
         $style_sel->setOptions($st_styles);
         $style_sel->setValue($style_id);
         $form_gui->addItem($style_sel);
     }
     $form_gui->addCommandButton("updateProperties", $lng->txt($a_mode));
     return $form_gui;
 }
 /**
  * Object Property GUI
  */
 private function propertyGUI($a_action, $a_type, $a_height, $a_mode)
 {
     global $ilCtrl, $lng;
     include_once "Services/Form/classes/class.ilPropertyFormGUI.php";
     $this->form_gui = new ilPropertyFormGUI();
     $this->form_gui->setFormAction($ilCtrl->getFormAction($this));
     $this->form_gui->setTitle($lng->txt("cont_ed_plachprop"));
     include_once "Services/Form/classes/class.ilRadioMatrixInputGUI.php";
     $ttype_input = new ilRadioMatrixInputGUI($lng->txt("type"), "plach_type");
     $options = array("Text" => $lng->txt("cont_ed_plachtext"), "Media" => $lng->txt("cont_ed_plachmedia"), "Question" => $lng->txt("cont_ed_plachquestion"));
     $ttype_input->setOptions($options);
     $ttype_input->setValue($a_type);
     $ttype_input->setRequired(true);
     $theight_input = new ilTextInputGUI($lng->txt("height"), "plach_height");
     $theight_input->setSize(4);
     $theight_input->setMaxLength(3);
     $a_height = preg_replace("/px/", "", $a_height);
     $theight_input->setValue($a_height);
     $theight_input->setTitle($lng->txt("height") . " (px)");
     $theight_input->setRequired(true);
     $this->form_gui->addItem($ttype_input);
     $this->form_gui->addItem($theight_input);
     $this->form_gui->addCommandButton($a_action, $lng->txt($a_mode));
     $this->form_gui->addCommandButton("cancelCreate", $lng->txt("cancel"));
     $this->tpl->setContent($this->form_gui->getHTML());
 }
 /**
  * init create/edit form
  *
  * @access protected
  * @param string edit or create
  * @return
  */
 protected function initForm($a_mode = 'edit')
 {
     global $ilUser, $tpl, $tree;
     if (is_object($this->form)) {
         return true;
     }
     include_once "./Services/Form/classes/class.ilPropertyFormGUI.php";
     $this->form = new ilPropertyFormGUI();
     switch ($a_mode) {
         case 'edit':
             $this->form->setFormAction($this->ctrl->getFormAction($this, 'update'));
             break;
         default:
             $this->form->setTableWidth('600px');
             $this->form->setFormAction($this->ctrl->getFormAction($this, 'save'));
             break;
     }
     // title
     $title = new ilTextInputGUI($this->lng->txt('title'), 'title');
     $title->setSubmitFormOnEnter(true);
     $title->setValue($this->object->getTitle());
     $title->setSize(40);
     $title->setMaxLength(128);
     $title->setRequired(true);
     $this->form->addItem($title);
     // desc
     $desc = new ilTextAreaInputGUI($this->lng->txt('description'), 'desc');
     $desc->setValue($this->object->getLongDescription());
     $desc->setRows(2);
     $desc->setCols(40);
     $this->form->addItem($desc);
     // Group type
     $grp_type = new ilRadioGroupInputGUI($this->lng->txt('grp_typ'), 'grp_type');
     if ($a_mode == 'edit') {
         $type = $this->object->getGroupType() ? $this->object->getGroupType() : $this->object->readGroupStatus();
     } else {
         $type = $this->object->getGroupType() ? $this->object->getGroupType() : GRP_TYPE_PUBLIC;
     }
     $grp_type->setValue($type);
     $grp_type->setRequired(true);
     // PUBLIC GROUP
     $opt_public = new ilRadioOption($this->lng->txt('grp_public'), GRP_TYPE_PUBLIC, $this->lng->txt('grp_public_info'));
     $grp_type->addOption($opt_public);
     // CLOSED GROUP
     $opt_closed = new ilRadioOption($this->lng->txt('grp_closed'), GRP_TYPE_CLOSED, $this->lng->txt('grp_closed_info'));
     $grp_type->addOption($opt_closed);
     if ($a_mode == 'update_group_type') {
         $grp_type->setAlert($this->lng->txt('grp_type_changed_info'));
     }
     $this->form->addItem($grp_type);
     if ($a_mode == 'edit') {
         // Group registration ############################################################
         $pres = new ilFormSectionHeaderGUI();
         $pres->setTitle($this->lng->txt('grp_setting_header_registration'));
         $this->form->addItem($pres);
         // Registration type
         $reg_type = new ilRadioGroupInputGUI($this->lng->txt('group_registration_mode'), 'registration_type');
         $reg_type->setValue($this->object->getRegistrationType());
         $opt_dir = new ilRadioOption($this->lng->txt('grp_reg_direct'), GRP_REGISTRATION_DIRECT);
         #$this->lng->txt('grp_reg_direct_info'));
         $reg_type->addOption($opt_dir);
         $opt_pass = new ilRadioOption($this->lng->txt('grp_pass_request'), GRP_REGISTRATION_PASSWORD);
         $pass = new ilTextInputGUI('', 'password');
         $pass->setInfo($this->lng->txt('grp_reg_password_info'));
         $pass->setValue($this->object->getPassword());
         $pass->setSize(10);
         $pass->setMaxLength(32);
         $opt_pass->addSubItem($pass);
         $reg_type->addOption($opt_pass);
         $opt_req = new ilRadioOption($this->lng->txt('grp_reg_request'), GRP_REGISTRATION_REQUEST, $this->lng->txt('grp_reg_request_info'));
         $reg_type->addOption($opt_req);
         $opt_deact = new ilRadioOption($this->lng->txt('grp_reg_disabled'), GRP_REGISTRATION_DEACTIVATED, $this->lng->txt('grp_reg_disabled_info'));
         $reg_type->addOption($opt_deact);
         // Registration codes
         $reg_code = new ilCheckboxInputGUI($this->lng->txt('grp_reg_code'), 'reg_code_enabled');
         $reg_code->setChecked($this->object->isRegistrationAccessCodeEnabled());
         $reg_code->setValue(1);
         $reg_code->setInfo($this->lng->txt('grp_reg_code_enabled_info'));
         $this->form->addItem($reg_type);
         // time limit
         $time_limit = new ilCheckboxInputGUI($this->lng->txt('grp_reg_limited'), 'reg_limit_time');
         $time_limit->setOptionTitle($this->lng->txt('grp_reg_limit_time'));
         $time_limit->setChecked($this->object->isRegistrationUnlimited() ? false : true);
         $this->lng->loadLanguageModule('dateplaner');
         include_once './Services/Form/classes/class.ilDateDurationInputGUI.php';
         $tpl->addJavaScript('./Services/Form/js/date_duration.js');
         $dur = new ilDateDurationInputGUI($this->lng->txt('grp_reg_period'), 'reg');
         $dur->setStartText($this->lng->txt('cal_start'));
         $dur->setEndText($this->lng->txt('cal_end'));
         $dur->setMinuteStepSize(5);
         $dur->setShowDate(true);
         $dur->setShowTime(true);
         $dur->setStart($this->object->getRegistrationStart());
         $dur->setEnd($this->object->getRegistrationEnd());
         $time_limit->addSubItem($dur);
         $this->form->addItem($time_limit);
         // max member
         $lim = new ilCheckboxInputGUI($this->lng->txt('reg_grp_max_members_short'), 'registration_membership_limited');
         $lim->setValue(1);
         $lim->setOptionTitle($this->lng->txt('reg_grp_max_members'));
         $lim->setChecked($this->object->isMembershipLimited());
         $max = new ilTextInputGUI('', 'registration_max_members');
         $max->setValue($this->object->getMaxMembers() ? $this->object->getMaxMembers() : '');
         $max->setTitle($this->lng->txt('members') . ':');
         $max->setSize(3);
         $max->setMaxLength(4);
         $max->setInfo($this->lng->txt('grp_reg_max_members_info'));
         $lim->addSubItem($max);
         $wait = new ilCheckboxInputGUI('', 'waiting_list');
         $wait->setValue(1);
         $wait->setOptionTitle($this->lng->txt('grp_waiting_list'));
         $wait->setInfo($this->lng->txt('grp_waiting_list_info'));
         $wait->setChecked($this->object->isWaitingListEnabled() ? true : false);
         $lim->addSubItem($wait);
         $this->form->addItem($lim);
         // Registration codes
         if (!$this->object->getRegistrationAccessCode()) {
             include_once './Services/Membership/classes/class.ilMembershipRegistrationCodeUtils.php';
             $this->object->setRegistrationAccessCode(ilMembershipRegistrationCodeUtils::generateCode());
         }
         $reg_link = new ilHiddenInputGUI('reg_code');
         $reg_link->setValue($this->object->getRegistrationAccessCode());
         $this->form->addItem($reg_link);
         $link = new ilCustomInputGUI($this->lng->txt('grp_reg_code_link'));
         include_once './Services/Link/classes/class.ilLink.php';
         $val = ilLink::_getLink($this->object->getRefId(), $this->object->getType(), array(), '_rcode' . $this->object->getRegistrationAccessCode());
         $link->setHTML('<font class="small">' . $val . '</font>');
         $reg_code->addSubItem($link);
         $this->form->addItem($reg_code);
         // Group presentation
         $hasParentCourse = $tree->checkForParentType($this->object->getRefId(), 'crs');
         $pres = new ilFormSectionHeaderGUI();
         $pres->setTitle($this->lng->txt('grp_setting_header_presentation'));
         $this->form->addItem($pres);
         // presentation type
         $view_type = new ilRadioGroupInputGUI($this->lng->txt('grp_presentation_type'), 'view_mode');
         if ($hasParentCourse) {
             switch ($this->object->getViewMode()) {
                 case ilContainer::VIEW_SESSIONS:
                     $course_view_mode = ' (' . $this->lng->txt('cntr_view_sessions') . ')';
                     break;
                 case ilContainer::VIEW_SIMPLE:
                     $course_view_mode = ' (' . $this->lng->txt('cntr_view_simple') . ')';
                     break;
                 case ilContainer::VIEW_BY_TYPE:
                     $course_view_mode = ' (' . $this->lng->txt('cntr_view_by_type') . ')';
                     break;
             }
             $opt = new ilRadioOption($this->lng->txt('grp_view_inherit') . $course_view_mode, ilContainer::VIEW_INHERIT);
             $opt->setInfo($this->lng->txt('grp_view_inherit_info'));
             $view_type->addOption($opt);
         }
         if ($hasParentCourse && $this->object->getViewMode(false) == ilContainer::VIEW_INHERIT) {
             $view_type->setValue(ilContainer::VIEW_INHERIT);
         } else {
             $view_type->setValue($this->object->getViewMode(true));
         }
         $opt = new ilRadioOption($this->lng->txt('cntr_view_simple'), ilContainer::VIEW_SIMPLE);
         $opt->setInfo($this->lng->txt('grp_view_info_simple'));
         $view_type->addOption($opt);
         $opt = new ilRadioOption($this->lng->txt('cntr_view_by_type'), ilContainer::VIEW_BY_TYPE);
         $opt->setInfo($this->lng->txt('grp_view_info_by_type'));
         $view_type->addOption($opt);
         $this->form->addItem($view_type);
         $sog = new ilRadioGroupInputGUI($this->lng->txt('sorting_header'), 'sor');
         $sog->setRequired(true);
         if ($a_mode == 'edit') {
             $sog->setValue(ilContainerSortingSettings::_readSortMode(ilObject::_lookupObjId($this->object->getRefId())));
         } elseif ($hasParentCourse) {
             $sog->setValue(ilContainer::SORT_INHERIT);
         } else {
             $sog->setValue(ilContainer::SORT_TITLE);
         }
         if ($hasParentCourse) {
             $sde = new ilRadioOption();
             $sde->setValue(ilContainer::SORT_INHERIT);
             $title = $this->lng->txt('sort_inherit_prefix');
             $title .= ' (' . ilContainerSortingSettings::sortModeToString(ilContainerSortingSettings::lookupSortModeFromParentContainer(ilObject::_lookupObjectId($ref_id))) . ') ';
             $sde->setTitle($title);
             $sde->setInfo($this->lng->txt('sorting_info_inherit'));
             $sog->addOption($sde);
         }
         $sma = new ilRadioOption();
         $sma->setValue(ilContainer::SORT_TITLE);
         $sma->setTitle($this->lng->txt('sorting_title_header'));
         $sma->setInfo($this->lng->txt('sorting_info_title'));
         $sog->addOption($sma);
         $sti = new ilRadioOption();
         $sti->setValue(ilContainer::SORT_MANUAL);
         $sti->setTitle($this->lng->txt('sorting_manual_header'));
         $sti->setInfo($this->lng->txt('sorting_info_manual'));
         $sog->addOption($sti);
         $this->form->addItem($sog);
         include_once './Services/Object/classes/class.ilObjectServiceSettingsGUI.php';
         ilObjectServiceSettingsGUI::initServiceSettingsForm($this->object->getId(), $this->form, array(ilObjectServiceSettingsGUI::CALENDAR_VISIBILITY, ilObjectServiceSettingsGUI::NEWS_VISIBILITY));
     }
     switch ($a_mode) {
         case 'create':
             $this->form->setTitle($this->lng->txt('grp_new'));
             $this->form->setTitleIcon(ilUtil::getImagePath('icon_grp.png'));
             $this->form->addCommandButton('save', $this->lng->txt('grp_new'));
             $this->form->addCommandButton('cancel', $this->lng->txt('cancel'));
             return true;
         case 'edit':
             $this->form->setTitle($this->lng->txt('grp_edit'));
             $this->form->setTitleIcon(ilUtil::getImagePath('icon_grp.png'));
             // Edit ecs export settings
             include_once 'Modules/Group/classes/class.ilECSGroupSettings.php';
             $ecs = new ilECSGroupSettings($this->object);
             $ecs->addSettingsToForm($this->form, 'grp');
             $this->form->addCommandButton('update', $this->lng->txt('save'));
             $this->form->addCommandButton('cancel', $this->lng->txt('cancel'));
             return true;
         case 'update_group_type':
             $grp_type->setValue($type == GRP_TYPE_PUBLIC ? GRP_TYPE_CLOSED : GRP_TYPE_PUBLIC);
             $this->form->setTitle($this->lng->txt('grp_edit'));
             $this->form->setTitleIcon(ilUtil::getImagePath('icon_grp.png'));
             return true;
     }
     return true;
 }
 public function settings()
 {
     global $rbacreview;
     $this->tabs_gui->setSubTabActive('shib_settings');
     // set already saved data or default value for port
     $settings = $this->ilias->getAllSettings();
     // Compose role list
     $role_list = $rbacreview->getRolesByFilter(2);
     $role = array();
     if (!isset($settings["shib_user_default_role"])) {
         $settings["shib_user_default_role"] = 4;
     }
     if (!isset($settings["shib_idp_list"]) || $settings["shib_idp_list"] == '') {
         $settings["shib_idp_list"] = "urn:mace:organization1:providerID, Example Organization 1\nurn:mace:organization2:providerID, Example Organization 2, /Shibboleth.sso/WAYF/SWITCHaai";
     }
     if (!isset($settings["shib_login_button"]) || $settings["shib_login_button"] == '') {
         $settings["shib_login_button"] = "templates/default/images/shib_login_button.png";
     }
     if (!isset($settings["shib_hos_type"]) || $settings["shib_hos_type"] == '') {
         $settings["shib_hos_type"] = 'internal_wayf';
     }
     foreach ($role_list as $data) {
         $role[$data["obj_id"]] = $data["title"];
     }
     // Set text field content
     $shib_settings = array('shib_login', 'shib_title', 'shib_firstname', 'shib_lastname', 'shib_email', 'shib_gender', 'shib_institution', 'shib_department', 'shib_zipcode', 'shib_city', 'shib_country', 'shib_street', 'shib_phone_office', 'shib_phone_home', 'shib_phone_mobile', 'shib_language', 'shib_matriculation');
     //set PropertyFormGUI
     include_once "./Services/Form/classes/class.ilPropertyFormGUI.php";
     $propertys = new ilPropertyFormGUI();
     $propertys->setTitle($this->lng->txt("shib"));
     $propertys->setFormAction($this->ctrl->getFormAction($this, "save"));
     $propertys->addCommandButton("save", $this->lng->txt("save"));
     $propertys->addCommandButton("settings", $this->lng->txt("cancel"));
     //set enable shibboleth support
     $enable = new ilCheckboxInputGUI();
     $enable->setTitle($this->lng->txt("shib_active"));
     $read_me_link = "./Services/AuthShibboleth/README.SHIBBOLETH.txt";
     $info = "<a href='" . $read_me_link . "' target='_blank'>" . $this->lng->txt("auth_shib_instructions") . "</a>";
     $enable->setInfo($info);
     $enable->setPostVar("shib[active]");
     $enable->setChecked($settings["shib_active"]);
     //set allow local authentication
     $local = new ilCheckboxInputGUI();
     $local->setTitle($this->lng->txt("auth_allow_local"));
     $local->setPostVar("shib[auth_allow_local]");
     $local->setChecked($settings['shib_auth_allow_local']);
     //set user default role
     $defaultrole = new ilSelectInputGUI();
     $defaultrole->setTitle($this->lng->txt("shib_user_default_role"));
     $defaultrole->setPostVar("shib[user_default_role]");
     $defaultrole->setOptions($role);
     $defaultrole->setRequired(true);
     $defaultrole->setValue($settings["shib_user_default_role"]);
     //set name of federation
     $name = new ilTextInputGUI();
     $name->setTitle($this->lng->txt("shib_federation_name"));
     $name->setPostVar("shib[federation_name]");
     $name->setSize(40);
     $name->setMaxLength(50);
     $name->setRequired(true);
     $name->setValue(stripslashes($settings["shib_federation_name"]));
     //set Organize selection group
     include_once "./Services/Form/classes/class.ilRadioGroupInputGUI.php";
     include_once "./Services/Form/classes/class.ilRadioOption.php";
     $organize = new ilRadioGroupInputGUI();
     $organize->setTitle($this->lng->txt("shib_login_type"));
     $organize->setPostVar("shib[hos_type]");
     $organize->setRequired(true);
     $organize->setValue($settings["shib_hos_type"]);
     //set 1. option internalwayf
     $internalwayf = new ilRadioOption();
     $internalwayf->setTitle($this->lng->txt("shib_login_internal_wayf"));
     $internalwayf->setValue("internal_wayf");
     //set 1. option internalwayf textbox idplist
     $idplist = new ilTextAreaInputGUI();
     $idplist->setInfo($this->lng->txt("shib_idp_list"));
     $idplist->setPostVar("shib[idp_list]");
     $idplist->setRows(3);
     $idplist->setCols(50);
     $idplist->setValue($settings["shib_idp_list"]);
     //set 2. Option externalwayf
     $externalwayf = new ilRadioOption();
     $externalwayf->setTitle($this->lng->txt("shib_login_external_wayf"));
     $externalwayf->setValue("external_wayf");
     //set 2. Option externalwayf textfield path to login button image
     $loginbutton = new ilTextInputGUI();
     $loginbutton->setInfo($this->lng->txt("shib_login_button"));
     $loginbutton->setPostVar("shib[login_button]");
     $loginbutton->setSize(50);
     $loginbutton->setMaxLength(255);
     $loginbutton->setValue($settings["shib_login_button"]);
     //set 3. Option embeddedwayf
     $embeddedwayf = new ilRadioOption();
     $embeddedwayf->setTitle($this->lng->txt("shib_login_embedded_wayf"));
     $embeddedwayf->setInfo($this->lng->txt("shib_login_embedded_wayf_description"));
     $embeddedwayf->setValue("embedded_wayf");
     //set login instructions
     $logininstruction = new ilTextAreaInputGUI();
     $logininstruction->setTitle($this->lng->txt("auth_login_instructions"));
     $logininstruction->setPostVar("shib[login_instructions]");
     $logininstruction->setRows(3);
     $logininstruction->setCols(50);
     $logininstruction->setValue(stripslashes($settings["shib_login_instructions"]));
     //set path to data manipulation API
     $dataconv = new ilTextInputGUI();
     $dataconv->setTitle($this->lng->txt("shib_data_conv"));
     $dataconv->setPostVar("shib[data_conv]");
     $dataconv->setSize(80);
     $dataconv->setMaxLength(512);
     $dataconv->setValue($settings["shib_data_conv"]);
     //field mappings
     $fields = array();
     foreach ($shib_settings as $setting) {
         $field = ereg_replace('shib_', '', $setting);
         $textinput = new ilTextInputGUI();
         $textinput->setTitle($this->lng->txt($setting));
         $textinput->setPostVar("shib[" . $field . "]");
         $textinput->setValue($settings[$setting]);
         $textinput->setSize(40);
         $textinput->setMaxLength(50);
         $checkinput = new ilCheckboxInputGUI("");
         $checkinput->setOptionTitle($this->lng->txt("shib_update"));
         $checkinput->setPostVar("shib[update_" . $field . "]");
         $checkinput->setChecked($settings["shib_update_" . $field]);
         if ($setting == 'shib_login' || $setting == 'shib_title' || $setting == 'shib_firstname' || $setting == 'shib_lastname' || $setting == 'shib_email') {
             $textinput->setRequired(true);
         }
         $fields[$setting] = array("text" => $textinput, "check" => $checkinput);
     }
     $propertys->addItem($enable);
     $propertys->addItem($local);
     $propertys->addItem($defaultrole);
     $propertys->addItem($name);
     $internalwayf->addSubItem($idplist);
     $organize->addOption($internalwayf);
     $externalwayf->addSubItem($loginbutton);
     $organize->addOption($externalwayf);
     $organize->addOption($embeddedwayf);
     $propertys->addItem($organize);
     $propertys->addItem($logininstruction);
     $propertys->addItem($dataconv);
     foreach ($shib_settings as $setting) {
         $propertys->addItem($fields[$setting]["text"]);
         if ($setting != "shib_login") {
             $propertys->addItem($fields[$setting]["check"]);
         }
     }
     $this->tpl->setContent($propertys->getHTML());
 }
 /**
  * init form
  *
  * @access protected
  * @param
  * @return
  */
 protected function initEditForm()
 {
     include_once './Services/Form/classes/class.ilPropertyFormGUI.php';
     include_once './Services/Calendar/classes/class.ilDateTime.php';
     $form = new ilPropertyFormGUI();
     $form->setTitle($this->lng->txt('crs_edit'));
     $form->setTitleIcon(ilUtil::getImagePath('icon_crs_s.png'));
     $form->addCommandButton('update', $this->lng->txt('save'));
     $form->addCommandButton('cancel', $this->lng->txt('cancel'));
     $form->setFormAction($this->ctrl->getFormAction($this, 'update'));
     // title
     $title = new ilTextInputGUI($this->lng->txt('title'), 'title');
     $title->setSubmitFormOnEnter(true);
     $title->setValue($this->object->getTitle());
     $title->setSize(40);
     $title->setMaxLength(128);
     $title->setRequired(true);
     $form->addItem($title);
     // desc
     $desc = new ilTextAreaInputGUI($this->lng->txt('description'), 'desc');
     $desc->setValue($this->object->getLongDescription());
     $desc->setRows(2);
     $desc->setCols(40);
     $form->addItem($desc);
     // Show didactic template type
     $this->initDidacticTemplate($form);
     // activation/availability
     $this->lng->loadLanguageModule('rep');
     $section = new ilFormSectionHeaderGUI();
     $section->setTitle($this->lng->txt('rep_activation_availability'));
     $form->addItem($section);
     $online = new ilCheckboxInputGUI($this->lng->txt('rep_activation_online'), 'activation_online');
     $online->setChecked(!$this->object->getOfflineStatus());
     $online->setInfo($this->lng->txt('crs_activation_online_info'));
     $form->addItem($online);
     $act_type = new ilRadioGroupInputGUI($this->lng->txt('rep_activation_access'), 'activation_type');
     $act_type->setValue($this->object->getActivationType());
     $opt = new ilRadioOption($this->lng->txt('crs_visibility_limitless'), IL_CRS_ACTIVATION_UNLIMITED);
     $opt->setInfo($this->lng->txt('crs_availability_limitless_info'));
     $act_type->addOption($opt);
     $opt = new ilRadioOption($this->lng->txt('crs_visibility_until'), IL_CRS_ACTIVATION_LIMITED);
     $opt->setInfo($this->lng->txt('crs_availability_until_info'));
     $start = new ilDateTimeInputGUI($this->lng->txt('rep_activation_limited_start'), 'activation_start');
     #$start->setMode(ilDateTimeInputGUI::MODE_INPUT);
     $start->setShowTime(true);
     $start_date = new ilDateTime($this->object->getActivationStart(), IL_CAL_UNIX);
     $start->setDate($start_date);
     $opt->addSubItem($start);
     $end = new ilDateTimeInputGUI($this->lng->txt('rep_activation_limited_end'), 'activation_end');
     #$end->setMode(ilDateTimeInputGUI::MODE_INPUT);
     $end->setShowTime(true);
     $end_date = new ilDateTime($this->object->getActivationEnd(), IL_CAL_UNIX);
     $end->setDate($end_date);
     $opt->addSubItem($end);
     $visible = new ilCheckboxInputGUI($this->lng->txt('rep_activation_limited_visibility'), 'activation_visibility');
     $visible->setInfo($this->lng->txt('crs_activation_limited_visibility_info'));
     $visible->setChecked($this->object->getActivationVisibility());
     $opt->addSubItem($visible);
     $act_type->addOption($opt);
     $form->addItem($act_type);
     $section = new ilFormSectionHeaderGUI();
     $section->setTitle($this->lng->txt('crs_reg'));
     $form->addItem($section);
     $reg_type = new ilRadioGroupInputGUI($this->lng->txt('crs_reg_period'), 'subscription_limitation_type');
     $reg_type->setValue($this->object->getSubscriptionLimitationType());
     $opt = new ilRadioOption($this->lng->txt('crs_reg_deactivated'), IL_CRS_SUBSCRIPTION_DEACTIVATED);
     $opt->setInfo($this->lng->txt('crs_registration_deactivated'));
     $reg_type->addOption($opt);
     $opt = new ilRadioOption($this->lng->txt('crs_registration_unlimited'), IL_CRS_SUBSCRIPTION_UNLIMITED);
     $opt->setInfo($this->lng->txt('crs_reg_unlim_info'));
     $reg_type->addOption($opt);
     $opt = new ilRadioOption($this->lng->txt('crs_registration_limited'), IL_CRS_SUBSCRIPTION_LIMITED);
     $opt->setInfo($this->lng->txt('crs_reg_lim_info'));
     $start = new ilDateTimeInputGUI($this->lng->txt('crs_start'), 'subscription_start');
     $start->setShowTime(true);
     $start_date = new ilDateTime($this->object->getSubscriptionStart(), IL_CAL_UNIX);
     $start->setDate($start_date);
     $opt->addSubItem($start);
     $end = new ilDateTimeInputGUI($this->lng->txt('crs_end'), 'subscription_end');
     $end->setShowTime(true);
     $end_date = new ilDateTime($this->object->getSubscriptionEnd(), IL_CAL_UNIX);
     $end->setDate($end_date);
     $opt->addSubItem($end);
     $reg_type->addOption($opt);
     $form->addItem($reg_type);
     $reg_proc = new ilRadioGroupInputGUI($this->lng->txt('crs_registration_type'), 'subscription_type');
     $reg_proc->setValue($this->object->getSubscriptionType());
     $reg_proc->setInfo($this->lng->txt('crs_reg_type_info'));
     $opt = new ilRadioOption($this->lng->txt('crs_subscription_options_confirmation'), IL_CRS_SUBSCRIPTION_CONFIRMATION);
     $reg_proc->addOption($opt);
     $opt = new ilRadioOption($this->lng->txt('crs_subscription_options_direct'), IL_CRS_SUBSCRIPTION_DIRECT);
     $reg_proc->addOption($opt);
     $opt = new ilRadioOption($this->lng->txt('crs_subscription_options_password'), IL_CRS_SUBSCRIPTION_PASSWORD);
     $pass = new ilTextInputGUI('', 'subscription_password');
     $pass->setSubmitFormOnEnter(true);
     $pass->setSize(12);
     $pass->setMaxLength(12);
     $pass->setValue($this->object->getSubscriptionPassword());
     $opt->addSubItem($pass);
     $reg_proc->addOption($opt);
     $form->addItem($reg_proc);
     // Registration codes
     $reg_code = new ilCheckboxInputGUI('', 'reg_code_enabled');
     $reg_code->setChecked($this->object->isRegistrationAccessCodeEnabled());
     $reg_code->setValue(1);
     $reg_code->setInfo($this->lng->txt('crs_reg_code_enabled_info'));
     $reg_code->setOptionTitle($this->lng->txt('crs_reg_code'));
     /*
     $code = new ilNonEditableValueGUI($this->lng->txt('crs_reg_code_value'));
     $code->setValue($this->object->getRegistrationAccessCode());
     $reg_code->addSubItem($code);
     */
     #$link = new ilNonEditableValueGUI($this->lng->txt('crs_reg_code_link'));
     // Create default access code
     if (!$this->object->getRegistrationAccessCode()) {
         include_once './Services/Membership/classes/class.ilMembershipRegistrationCodeUtils.php';
         $this->object->setRegistrationAccessCode(ilMembershipRegistrationCodeUtils::generateCode());
     }
     $reg_link = new ilHiddenInputGUI('reg_code');
     $reg_link->setValue($this->object->getRegistrationAccessCode());
     $form->addItem($reg_link);
     $link = new ilCustomInputGUI($this->lng->txt('crs_reg_code_link'));
     include_once './Services/Link/classes/class.ilLink.php';
     $val = ilLink::_getLink($this->object->getRefId(), $this->object->getType(), array(), '_rcode' . $this->object->getRegistrationAccessCode());
     $link->setHTML('<font class="small">' . $val . '</font>');
     $reg_code->addSubItem($link);
     $form->addItem($reg_code);
     // Max members
     $lim = new ilCheckboxInputGUI($this->lng->txt('crs_subscription_max_members_short'), 'subscription_membership_limitation');
     $lim->setValue(1);
     $lim->setOptionTitle($this->lng->txt('crs_subscription_max_members'));
     $lim->setChecked($this->object->isSubscriptionMembershipLimited());
     $max = new ilTextInputGUI('', 'subscription_max');
     $max->setSubmitFormOnEnter(true);
     $max->setSize(4);
     $max->setMaxLength(4);
     $max->setValue($this->object->getSubscriptionMaxMembers() ? $this->object->getSubscriptionMaxMembers() : '');
     $max->setTitle($this->lng->txt('members') . ':');
     $max->setInfo($this->lng->txt('crs_reg_max_info'));
     $lim->addSubItem($max);
     $wait = new ilCheckboxInputGUI('', 'waiting_list');
     $wait->setOptionTitle($this->lng->txt('crs_waiting_list'));
     $wait->setChecked($this->object->enabledWaitingList());
     $wait->setInfo($this->lng->txt('crs_wait_info'));
     $lim->addSubItem($wait);
     $form->addItem($lim);
     $not = new ilCheckboxInputGUI($this->lng->txt('crs_auto_notification'), 'auto_notification');
     $not->setValue(1);
     $not->setInfo($this->lng->txt('crs_auto_notification_info'));
     $not->setChecked($this->object->getAutoNotification());
     $form->addItem($not);
     $pres = new ilFormSectionHeaderGUI();
     $pres->setTitle($this->lng->txt('crs_view_mode'));
     $form->addItem($pres);
     // presentation type
     $view_type = new ilRadioGroupInputGUI($this->lng->txt('crs_presentation_type'), 'view_mode');
     $view_type->setValue($this->object->getViewMode());
     $opts = new ilRadioOption($this->lng->txt('cntr_view_sessions'), IL_CRS_VIEW_SESSIONS);
     $opts->setInfo($this->lng->txt('cntr_view_info_sessions'));
     $view_type->addOption($opts);
     // Limited sessions
     $sess = new ilCheckboxInputGUI($this->lng->txt('sess_limit'), 'sl');
     $sess->setValue(1);
     $sess->setChecked($this->object->isSessionLimitEnabled());
     $sess->setInfo($this->lng->txt('sess_limit_info'));
     $prev = new ilNumberInputGUI($this->lng->txt('sess_num_prev'), 'sp');
     #$prev->setSubmitFormOnEnter(true);
     $prev->setMinValue(0);
     $prev->setValue($this->object->getNumberOfPreviousSessions() == -1 ? '' : $this->object->getNumberOfPreviousSessions());
     $prev->setSize(2);
     $prev->setMaxLength(3);
     $sess->addSubItem($prev);
     $next = new ilNumberInputGUI($this->lng->txt('sess_num_next'), 'sn');
     #$next->setSubmitFormOnEnter(true);
     $next->setMinValue(0);
     $next->setValue($this->object->getNumberOfNextSessions() == -1 ? '' : $this->object->getNumberOfnextSessions());
     $next->setSize(2);
     $next->setMaxLength(3);
     $sess->addSubItem($next);
     $opts->addSubItem($sess);
     $optsi = new ilRadioOption($this->lng->txt('cntr_view_simple'), IL_CRS_VIEW_SIMPLE);
     $optsi->setInfo($this->lng->txt('cntr_view_info_simple'));
     $view_type->addOption($optsi);
     $optbt = new ilRadioOption($this->lng->txt('cntr_view_by_type'), IL_CRS_VIEW_BY_TYPE);
     $optbt->setInfo($this->lng->txt('cntr_view_info_by_type'));
     $view_type->addOption($optbt);
     $opto = new ilRadioOption($this->lng->txt('crs_view_objective'), IL_CRS_VIEW_OBJECTIVE);
     $opto->setInfo($this->lng->txt('crs_view_info_objective'));
     $view_type->addOption($opto);
     $optt = new ilRadioOption($this->lng->txt('crs_view_timing'), IL_CRS_VIEW_TIMING);
     $optt->setInfo($this->lng->txt('crs_view_info_timing'));
     $view_type->addOption($optt);
     /*
     	$opt = new ilRadioOption($this->lng->txt('crs_view_archive'),IL_CRS_VIEW_ARCHIVE);
     	$opt->setInfo($this->lng->txt('crs_archive_info'));
     	
     		$down = new ilCheckboxInputGUI('','archive_type');
     		$down->setOptionTitle($this->lng->txt('crs_archive_download'));
     		$down->setChecked($this->object->getArchiveType() == IL_CRS_ARCHIVE_DOWNLOAD);
     		$opt->addSubItem($down);
     		
     		$start = new ilDateTimeInputGUI($this->lng->txt('crs_start'),'archive_start');
     		$start->setShowTime(true);
     		$start_date = new ilDateTime($this->object->getArchiveStart(),IL_CAL_UNIX);
     		$start->setDate($start_date);
     		$opt->addSubItem($start);
     
     		$end = new ilDateTimeInputGUI($this->lng->txt('crs_end'),'archive_end');
     		$end->setShowTime(true);
     		$end_date = new ilDateTime($this->object->getArchiveEnd(),IL_CAL_UNIX);
     		$end->setDate($end_date);
     		$opt->addSubItem($end);
     		
     	$view_type->addOption($opt);
     */
     $form->addItem($view_type);
     // sorting type
     $sort = new ilRadioGroupInputGUI($this->lng->txt('crs_sortorder_abo'), 'order_type');
     $sort->setValue($this->object->getOrderType());
     $opt = new ilRadioOption($this->lng->txt('crs_sort_title'), ilContainer::SORT_TITLE);
     $opt->setInfo($this->lng->txt('crs_sort_title_info'));
     $sort->addOption($opt);
     $opt = new ilRadioOption($this->lng->txt('crs_sort_manual'), ilContainer::SORT_MANUAL);
     $opt->setInfo($this->lng->txt('crs_sort_manual_info'));
     $sort->addOption($opt);
     $opt = new ilRadioOption($this->lng->txt('crs_sort_activation'), ilContainer::SORT_ACTIVATION);
     $opt->setInfo($this->lng->txt('crs_sort_timing_info'));
     $sort->addOption($opt);
     $form->addItem($sort);
     include_once './Services/Object/classes/class.ilObjectServiceSettingsGUI.php';
     ilObjectServiceSettingsGUI::initServiceSettingsForm($this->object->getId(), $form, array(ilObjectServiceSettingsGUI::CALENDAR_VISIBILITY, ilObjectServiceSettingsGUI::NEWS_VISIBILITY));
     // lp vs. course status
     include_once "Services/Tracking/classes/class.ilObjUserTracking.php";
     if (ilObjUserTracking::_enabledLearningProgress()) {
         include_once './Services/Tracking/classes/class.ilLPObjSettings.php';
         $lp_settings = new ilLPObjSettings($this->object->getId());
         if ($lp_settings->getMode()) {
             $lp_status = new ilFormSectionHeaderGUI();
             $lp_status->setTitle($this->lng->txt('crs_course_status_of_users'));
             $form->addItem($lp_status);
             $lp_status_options = new ilRadioGroupInputGUI($this->lng->txt('crs_status_determination'), "status_dt");
             $lp_status_options->setRequired(true);
             $lp_status_options->setValue($this->object->getStatusDetermination());
             $lp_option = new ilRadioOption($this->lng->txt('crs_status_determination_lp'), ilObjCourse::STATUS_DETERMINATION_LP);
             $lp_status_options->addOption($lp_option);
             $lp_status_options->addOption(new ilRadioOption($this->lng->txt('crs_status_determination_manual'), ilObjCourse::STATUS_DETERMINATION_MANUAL));
             $form->addItem($lp_status_options);
         }
     }
     $further = new ilFormSectionHeaderGUI();
     $further->setTitle($this->lng->txt('crs_further_settings'));
     $form->addItem($further);
     $desk = new ilCheckboxInputGUI($this->lng->txt('crs_add_remove_from_desktop'), 'abo');
     $desk->setChecked($this->object->getAboStatus());
     $desk->setInfo($this->lng->txt('crs_add_remove_from_desktop_info'));
     $form->addItem($desk);
     $mem = new ilCheckboxInputGUI($this->lng->txt('crs_show_members'), 'show_members');
     $mem->setChecked($this->object->getShowMembers());
     $mem->setInfo($this->lng->txt('crs_show_members_info'));
     $form->addItem($mem);
     // Edit ecs export settings
     include_once 'Modules/Course/classes/class.ilECSCourseSettings.php';
     $ecs = new ilECSCourseSettings($this->object);
     $ecs->addSettingsToForm($form, 'crs');
     return $form;
 }
 public function showObjects()
 {
     /** 
      * @var $ilToolbar ilToolbarGUI */
     global $ilToolbar;
     include_once './Services/Payment/classes/class.ilPayMethods.php';
     $ilToolbar->addButton($this->lng->txt('paya_sell_object'), $this->ctrl->getLinkTarget($this, 'showObjectSelector'));
     if (!$_POST['show_filter'] && $_POST['updateView'] == '1') {
         $this->resetObjectFilter();
     } else {
         if ($_POST['updateView'] == 1) {
             $_SESSION['pay_objects']['updateView'] = $_POST['updateView'];
             $_SESSION['pay_objects']['show_filter'] = $_POST['show_filter'];
             $_SESSION['pay_objects']['title_type'] = $_POST['title_type'];
             $_SESSION['pay_objects']['title_value'] = $_POST['title_value'];
             $_SESSION['pay_objects']['pay_method'] = $_POST['pay_method'];
             $_SESSION['pay_objects']['vendor'] = $_POST['vendor'];
         }
     }
     $this->tpl->addBlockfile('ADM_CONTENT', 'adm_content', 'tpl.main_view.html', 'Services/Payment');
     $this->__initPaymentObject();
     $this->lng->loadLanguageModule('search');
     $filter_form = new ilPropertyFormGUI();
     $filter_form->setFormAction($this->ctrl->getFormAction($this));
     $filter_form->setTitle($this->lng->txt('pay_filter'));
     $filter_form->setId('filter_form');
     $filter_form->setTableWidth('100 %');
     //hide_filter
     $o_hide_check = new ilCheckBoxInputGUI($this->lng->txt('show_filter'), 'show_filter');
     $o_hide_check->setValue(1);
     $o_hide_check->setChecked($_SESSION['pay_objects']['show_filter'] ? 1 : 0);
     $o_hidden = new ilHiddenInputGUI('updateView');
     $o_hidden->setValue(1);
     $o_hidden->setPostVar('updateView');
     $o_hide_check->addSubItem($o_hidden);
     //title
     $radio_group = new ilRadioGroupInputGUI($this->lng->txt('search_in_title'), 'title_type');
     $radio_option = new ilRadioOption($this->lng->txt('search_any_word'), 'or');
     $radio_group->addOption($radio_option);
     $radio_option = new ilRadioOption($this->lng->txt('search_all_words'), 'and');
     $radio_group->addOption($radio_option);
     $radio_group->setRequired(false);
     $radio_group->setValue('or');
     $radio_group->setPostVar('title_type');
     $o_title = new ilTextInputGUI();
     $o_title->setValue($_SESSION['pay_objects']['title_value']);
     $o_title->setPostVar('title_value');
     $o_title->setTitle($this->lng->txt('title'));
     $o_hide_check->addSubItem($radio_group);
     $o_hide_check->addSubItem($o_title);
     //vendor
     $o_vendor = new ilTextInputGUI();
     $o_vendor->setTitle($this->lng->txt('paya_vendor'));
     $o_vendor->setValue($_SESSION['pay_objects']['vendor']);
     $o_vendor->setPostVar('vendor');
     $o_hide_check->addSubItem($o_vendor);
     // paymethod
     $o_paymethod = new ilSelectInputGUI();
     $o_paymethod->setTitle($this->lng->txt('payment_system'));
     $o_paymethod->setOptions(ilPaymethods::getPayMethodsOptions('all'));
     $o_paymethod->setValue($_SESSION['pay_objects']['pay_method']);
     $o_paymethod->setPostVar('pay_method');
     $o_hide_check->addSubItem($o_paymethod);
     $filter_form->addCommandButton('showObjects', $this->lng->txt('pay_update_view'));
     $filter_form->addCommandButton('resetObjectFilter', $this->lng->txt('pay_reset_filter'));
     $filter_form->addItem($o_hide_check);
     if (!count($objects = ilPaymentObject::_getObjectsData($this->user_obj->getId()))) {
         ilUtil::sendInfo($this->lng->txt('paya_no_objects_assigned'));
         return true;
     }
     $this->tpl->setVariable('FORM', $filter_form->getHTML());
     $counter = 0;
     foreach ($objects as $data) {
         /** @var $tmp_obj ilObject */
         $tmp_obj = ilObjectFactory::getInstanceByRefId($data['ref_id'], false);
         if ($tmp_obj) {
             $f_result[$counter]['title'] = $tmp_obj->getTitle();
         } else {
             $f_result[$counter]['title'] = $this->lng->txt('object_not_found');
         }
         switch ($data['status']) {
             case $this->pobject->STATUS_BUYABLE:
                 $f_result[$counter]['status'] = $this->lng->txt('paya_buyable');
                 break;
             case $this->pobject->STATUS_NOT_BUYABLE:
                 $f_result[$counter]['status'] = $this->lng->txt('paya_not_buyable');
                 break;
             case $this->pobject->STATUS_EXPIRES:
                 $f_result[$counter]['status'] = $this->lng->txt('paya_expires');
                 break;
         }
         $str_paymethod = ilPayMethods::getStringByPaymethod($data['pay_method']);
         $f_result[$counter]['pay_method'] = $str_paymethod;
         if ($data['vat_id'] <= 0) {
             $vat_rate = $this->lng->txt('payment_vat_has_to_be_defined_by_administration_short');
         } else {
             try {
                 $oVAT = new ilShopVats((int) $data['vat_id']);
                 $vat_rate = ilShopUtils::_formatVAT((double) $oVAT->getRate());
             } catch (ilShopException $e) {
                 $vat_rate = $this->lng->txt('payment_vat_has_to_be_defined_by_administration_short');
             }
         }
         $f_result[$counter]['vat_rate'] = $vat_rate;
         /** @var $tmp_user ilObjUser */
         $tmp_user = ilObjectFactory::getInstanceByObjId($data['vendor_id']);
         $f_result[$counter]['vendor'] = $tmp_user->getFullname() . ' [' . $tmp_user->getLogin() . ']';
         // Get number of purchasers
         $f_result[$counter]['purchasers'] = ilPaymentBookings::_getCountBookingsByObject($data['pobject_id']);
         // edit link
         $this->ctrl->setParameter($this, 'pobject_id', $data['pobject_id']);
         $link_change = "<div class=\"il_ContainerItemCommands\"><a class=\"il_ContainerItemCommand\" href=\"" . $this->ctrl->getLinkTarget($this, "editDetails") . "\">" . $this->lng->txt("edit") . "</a></div>";
         $f_result[$counter]['options'] = $link_change;
         unset($tmp_user);
         unset($tmp_obj);
         ++$counter;
     }
     return $this->__showObjectsTable($f_result);
 }
 /**
  * Object Property GUI
  */
 protected function propertyGUI($a_action, $a_type, $a_height, $a_mode)
 {
     global $lng;
     include_once "Services/Form/classes/class.ilPropertyFormGUI.php";
     $this->form_gui = new ilPropertyFormGUI();
     $this->form_gui->setFormAction($this->ctrl->getFormAction($this));
     $this->form_gui->setTitle($lng->txt("cont_ed_plachprop"));
     $ttype_input = new ilRadioGroupInputGUI($lng->txt("type"), "plach_type");
     $type_captions = $this->getTypeCaptions();
     foreach ($this->getAvailableTypes() as $type) {
         $ttype_input->addOption(new ilRadioOption($type_captions[$type], $type));
     }
     $ttype_input->setRequired(true);
     $this->form_gui->addItem($ttype_input);
     $theight_input = new ilTextInputGUI($lng->txt("height"), "plach_height");
     $theight_input->setSize(4);
     $theight_input->setMaxLength(3);
     $theight_input->setTitle($lng->txt("height") . " (px)");
     $theight_input->setRequired(true);
     $this->form_gui->addItem($theight_input);
     $theight_input->setValue(preg_replace("/px/", "", $a_height));
     $ttype_input->setValue($a_type);
     $this->form_gui->addCommandButton($a_action, $lng->txt($a_mode));
     $this->form_gui->addCommandButton("cancelCreate", $lng->txt("cancel"));
     $this->tpl->setContent($this->form_gui->getHTML());
 }