Ejemplo n.º 1
0
 public function showTrustees($a_show_delete = false)
 {
     global $ilToolbar;
     $_SESSION['paya_delete_trustee'] = $_SESSION['paya_delete_trustee'] ? $_SESSION['paya_delete_trustee'] : array();
     $actions = array(0 => $this->lng->txt("paya_disabled"), 1 => $this->lng->txt("paya_enabled"));
     include_once "./Services/Form/classes/class.ilTextInputGUI.php";
     $ul = new ilTextInputGUI($this->lng->txt("user"), "search_str");
     $ul->setDataSource($this->ctrl->getLinkTarget($this, "performSearch", "", true));
     $ul->setSize(20);
     $ilToolbar->addInputItem($ul, true);
     $ilToolbar->addFormButton($this->lng->txt("add"), "performSearch");
     $ilToolbar->setFormAction($this->ctrl->getFormAction($this));
     $this->tpl->addBlockfile('ADM_CONTENT', 'adm_content', 'tpl.main_view.html', 'Services/Payment');
     if ($a_show_delete) {
         $oConfirmationGUI = new ilConfirmationGUI();
         // set confirm/cancel commands
         $oConfirmationGUI->setFormAction($this->ctrl->getFormAction($this, "performDeleteTrustee"));
         $oConfirmationGUI->setHeaderText($this->lng->txt("paya_sure_delete_selected_trustees"));
         $oConfirmationGUI->setCancel($this->lng->txt("cancel"), "cancelDelete");
         $oConfirmationGUI->setConfirm($this->lng->txt("confirm"), "performDeleteTrustee");
         foreach ($this->trustee_obj->getTrustees() as $trustee) {
             $delete_row = '';
             if (in_array($trustee['trustee_id'], $_POST['trustee'])) {
                 if ($tmp_obj = ilObjectFactory::getInstanceByObjId($trustee['trustee_id'], false)) {
                     $delete_row = $tmp_obj->getLogin() . ' -> ' . $tmp_obj->getFirstname() . ' ' . $tmp_obj->getLastname();
                 }
             }
             $oConfirmationGUI->addItem('', $delete_row, $delete_row);
         }
         $this->tpl->setVariable("CONFIRMATION", $oConfirmationGUI->getHTML());
     }
     if (!count($this->trustee_obj->getTrustees())) {
         ilUtil::sendInfo($this->lng->txt('paya_no_trustees'));
         return true;
     }
     $counter = 0;
     $f_result = array();
     require_once 'Services/Mail/classes/class.ilMailFormCall.php';
     foreach ($this->trustee_obj->getTrustees() as $trustee) {
         // GET USER OBJ
         if ($tmp_obj = ilObjectFactory::getInstanceByObjId($trustee['trustee_id'], false)) {
             $f_result[$counter]['trustee_id'] = ilUtil::formCheckbox(in_array($trustee['trustee_id'], $_SESSION['paya_delete_trustee']) ? 1 : 0, "trustee[]", $trustee['trustee_id']);
             $f_result[$counter]['login'] = $tmp_obj->getLogin();
             $f_result[$counter]['firstname'] = $tmp_obj->getFirstname();
             $f_result[$counter]['lastname'] = $tmp_obj->getLastname();
             $f_result[$counter]['perm_stat'] = ilUtil::formSelect((int) $trustee['perm_stat'], 'perm_stat[' . $trustee['trustee_id'] . ']', $actions, false, true);
             $f_result[$counter]['perm_obj'] = ilUtil::formSelect((int) $trustee['perm_obj'], 'perm_obj[' . $trustee['trustee_id'] . ']', $actions, false, true);
             $f_result[$counter]['perm_coupons'] = ilUtil::formSelect((int) $trustee['perm_coupons'], 'perm_coupons[' . $trustee['trustee_id'] . ']', $actions, false, true);
             #				$link_mail = "<a target=\"_blank\" href=\"./ilias.php?baseClass=ilMailGUI&type=new&rcp_to=".
             #					$tmp_obj->getLogin()."\"".$img_mail."</a>";
             $url_mail = ilMailFormCall::getLinkTarget($this, '', array(), array('type' => 'new', 'rcp_to' => $tmp_obj->getLogin()));
             $link_mail = "<div class=\"il_ContainerItemCommands\"><a class=\"il_ContainerItemCommand\" href=\"" . $url_mail . "\">" . $this->lng->txt("mail") . "</a></div>";
             $f_result[$counter]['options'] = $link_mail;
             unset($tmp_obj);
             ++$counter;
         }
     }
     return $this->__showTrusteesTable($f_result);
 }
Ejemplo n.º 2
0
 function owner()
 {
     $this->__initSubTabs("owner");
     include_once "Services/Form/classes/class.ilPropertyFormGUI.php";
     $form = new ilPropertyFormGUI();
     $form->setFormAction($this->ctrl->getFormAction($this, "owner"));
     $form->setTitle($this->lng->txt("info_owner_of_object"));
     $login = new ilTextInputGUI($this->lng->txt("login"), "owner");
     $login->setDataSource($this->ctrl->getLinkTargetByClass(array(get_class($this), 'ilRepositorySearchGUI'), 'doUserAutoComplete', '', true));
     $login->setRequired(true);
     $login->setSize(50);
     $login->setInfo($this->lng->txt("chown_warning"));
     $login->setValue(ilObjUser::_lookupLogin($this->gui_obj->object->getOwner()));
     $form->addItem($login);
     $form->addCommandButton("changeOwner", $this->lng->txt("change_owner"));
     $this->tpl->setContent($form->getHTML());
 }
Ejemplo n.º 3
0
 protected function initKeywordsForm()
 {
     global $ilUser;
     include_once "Services/Form/classes/class.ilPropertyFormGUI.php";
     $form = new ilPropertyFormGUI();
     $form->setFormAction($this->ctrl->getFormAction($this, "saveKeywordsForm"));
     $form->setTitle($this->lng->txt("blog_edit_keywords"));
     $txt = new ilTextInputGUI($this->lng->txt("blog_keywords"), "keywords");
     // $txt->setRequired(true); #10504
     $txt->setMulti(true);
     $txt->setDataSource($this->ctrl->getLinkTarget($this, "keywordAutocomplete", "", true));
     $txt->setMaxLength(200);
     $txt->setSize(50);
     $txt->setInfo($this->lng->txt("blog_keywords_info"));
     $form->addItem($txt);
     $md_section = $this->getBlogPosting()->getMDSection();
     $keywords = array();
     foreach ($ids = $md_section->getKeywordIds() as $id) {
         $md_key = $md_section->getKeyword($id);
         if (trim($md_key->getKeyword()) != "") {
             $keywords[$md_key->getKeywordLanguageCode()][] = $md_key->getKeyword();
         }
     }
     // language is not "used" anywhere
     $ulang = $ilUser->getLanguage();
     if ($keywords[$ulang]) {
         asort($keywords[$ulang]);
         $txt->setValue($keywords[$ulang]);
     }
     $form->addCommandButton("saveKeywordsForm", $this->lng->txt("save"));
     $form->addCommandButton("preview", $this->lng->txt("cancel"));
     return $form;
 }
Ejemplo n.º 4
0
 /**
  * Add standard fields to form
  */
 function addStandardFieldsToForm($a_form, $a_user = NULL, array $custom_fields = NULL)
 {
     global $ilSetting, $lng, $rbacreview, $ilias;
     // custom registration settings
     if (self::$mode == self::MODE_REGISTRATION) {
         include_once 'Services/Registration/classes/class.ilRegistrationSettings.php';
         $registration_settings = new ilRegistrationSettings();
         self::$user_field["username"]["group"] = "login_data";
         self::$user_field["password"]["group"] = "login_data";
         self::$user_field["language"]["default"] = $lng->lang_key;
         // different position for role
         $roles = self::$user_field["roles"];
         unset(self::$user_field["roles"]);
         self::$user_field["roles"] = $roles;
         self::$user_field["roles"]["group"] = "settings";
     }
     $fields = $this->getStandardFields();
     $current_group = "";
     $custom_fields_done = false;
     foreach ($fields as $f => $p) {
         // next group? -> diplay subheader
         if ($p["group"] != $current_group && ilUserProfile::userSettingVisible($f)) {
             if (is_array($custom_fields) && !$custom_fields_done) {
                 // should be appended to "other" or at least before "settings"
                 if ($current_group == "other" || $p["group"] == "settings") {
                     // add "other" subheader
                     if ($current_group != "other") {
                         $sh = new ilFormSectionHeaderGUI();
                         $sh->setTitle($lng->txt("other"));
                         $a_form->addItem($sh);
                     }
                     foreach ($custom_fields as $custom_field) {
                         $a_form->addItem($custom_field);
                     }
                     $custom_fields_done = true;
                 }
             }
             $sh = new ilFormSectionHeaderGUI();
             $sh->setTitle($lng->txt($p["group"]));
             $a_form->addItem($sh);
             $current_group = $p["group"];
         }
         $m = "";
         if (isset($p["method"])) {
             $m = $p["method"];
         }
         $lv = isset($p["lang_var"]) && $p["lang_var"] != "" ? $p["lang_var"] : $f;
         switch ($p["input"]) {
             case "login":
                 if ((int) $ilSetting->get('allow_change_loginname') || self::$mode == self::MODE_REGISTRATION) {
                     $val = new ilTextInputGUI($lng->txt('username'), 'username');
                     if ($a_user) {
                         $val->setValue($a_user->getLogin());
                     }
                     $val->setMaxLength(32);
                     $val->setSize(40);
                     $val->setRequired(true);
                 } else {
                     // user account name
                     $val = new ilNonEditableValueGUI($lng->txt("username"), 'ne_un');
                     if ($a_user) {
                         $val->setValue($a_user->getLogin());
                     }
                 }
                 $a_form->addItem($val);
                 break;
             case "text":
                 if (ilUserProfile::userSettingVisible($f)) {
                     $ti = new ilTextInputGUI($lng->txt($lv), "usr_" . $f);
                     if ($a_user) {
                         $ti->setValue($a_user->{$m}());
                     }
                     $ti->setMaxLength($p["maxlength"]);
                     $ti->setSize($p["size"]);
                     $ti->setRequired($ilSetting->get("require_" . $f));
                     if (!$ti->getRequired() || $ti->getValue()) {
                         $ti->setDisabled($ilSetting->get("usr_settings_disable_" . $f));
                     }
                     $a_form->addItem($ti);
                 }
                 break;
             case "sel_country":
                 if (ilUserProfile::userSettingVisible($f)) {
                     include_once "./Services/Form/classes/class.ilCountrySelectInputGUI.php";
                     $ci = new ilCountrySelectInputGUI($lng->txt($lv), "usr_" . $f);
                     if ($a_user) {
                         $ci->setValue($a_user->{$m}());
                     }
                     $ci->setRequired($ilSetting->get("require_" . $f));
                     if (!$ci->getRequired() || $ci->getValue()) {
                         $ci->setDisabled($ilSetting->get("usr_settings_disable_" . $f));
                     }
                     $a_form->addItem($ci);
                 }
                 break;
             case "birthday":
                 if (ilUserProfile::userSettingVisible($f)) {
                     $bi = new ilBirthdayInputGUI($lng->txt($lv), "usr_" . $f);
                     include_once "./Services/Calendar/classes/class.ilDateTime.php";
                     $date = null;
                     if ($a_user && strlen($a_user->{$m}())) {
                         $date = new ilDateTime($a_user->{$m}(), IL_CAL_DATE);
                         $bi->setDate($date);
                     }
                     $bi->setShowEmpty(true);
                     $bi->setStartYear(1900);
                     $bi->setRequired($ilSetting->get("require_" . $f));
                     if (!$bi->getRequired() || $date) {
                         $bi->setDisabled($ilSetting->get("usr_settings_disable_" . $f));
                     }
                     $a_form->addItem($bi);
                 }
                 break;
             case "radio":
                 if (ilUserProfile::userSettingVisible($f)) {
                     $rg = new ilRadioGroupInputGUI($lng->txt($lv), "usr_" . $f);
                     if ($a_user) {
                         $rg->setValue($a_user->{$m}());
                     }
                     foreach ($p["values"] as $k => $v) {
                         $op = new ilRadioOption($lng->txt($v), $k);
                         $rg->addOption($op);
                     }
                     $rg->setRequired($ilSetting->get("require_" . $f));
                     if (!$rg->getRequired() || $rg->getValue()) {
                         $rg->setDisabled($ilSetting->get("usr_settings_disable_" . $f));
                     }
                     $a_form->addItem($rg);
                 }
                 break;
             case "picture":
                 if (ilUserProfile::userSettingVisible("upload") && $a_user) {
                     $ii = new ilImageFileInputGUI($lng->txt("personal_picture"), "userfile");
                     $ii->setDisabled($ilSetting->get("usr_settings_disable_upload"));
                     $upload = $a_form->getFileUpload("userfile");
                     if ($upload["name"]) {
                         $ii->setPending($upload["name"]);
                     } else {
                         $im = ilObjUser::_getPersonalPicturePath($a_user->getId(), "small", true, true);
                         if ($im != "") {
                             $ii->setImage($im);
                             $ii->setAlt($lng->txt("personal_picture"));
                         }
                     }
                     // ilinc link as info
                     if (ilUserProfile::userSettingVisible("upload") and $ilSetting->get("ilinc_active")) {
                         include_once './Modules/ILinc/classes/class.ilObjiLincUser.php';
                         $ilinc_user = new ilObjiLincUser($a_user);
                         if ($ilinc_user->id) {
                             include_once './Modules/ILinc/classes/class.ilnetucateXMLAPI.php';
                             $ilincAPI = new ilnetucateXMLAPI();
                             $ilincAPI->uploadPicture($ilinc_user);
                             $response = $ilincAPI->sendRequest("uploadPicture");
                             // return URL to user's personal page
                             $url = trim($response->data['url']['cdata']);
                             $desc = $lng->txt("ilinc_upload_pic_text") . " " . '<a href="' . $url . '">' . $lng->txt("ilinc_upload_pic_linktext") . '</a>';
                             $ii->setInfo($desc);
                         }
                     }
                     $a_form->addItem($ii);
                 }
                 break;
             case "roles":
                 if (self::$mode == self::MODE_DESKTOP) {
                     if (ilUserProfile::userSettingVisible("roles")) {
                         $global_roles = $rbacreview->getGlobalRoles();
                         foreach ($global_roles as $role_id) {
                             if (in_array($role_id, $rbacreview->assignedRoles($a_user->getId()))) {
                                 $roleObj = $ilias->obj_factory->getInstanceByObjId($role_id);
                                 $role_names .= $roleObj->getTitle() . ", ";
                                 unset($roleObj);
                             }
                         }
                         $dr = new ilNonEditableValueGUI($lng->txt("default_roles"), "ne_dr");
                         $dr->setValue(substr($role_names, 0, -2));
                         $a_form->addItem($dr);
                     }
                 } else {
                     if (self::$mode == self::MODE_REGISTRATION) {
                         if ($registration_settings->roleSelectionEnabled()) {
                             include_once "./Services/AccessControl/classes/class.ilObjRole.php";
                             $options = array();
                             foreach (ilObjRole::_lookupRegisterAllowed() as $role) {
                                 $options[$role["id"]] = $role["title"];
                             }
                             // registration form validation will take care of missing field / value
                             if ($options) {
                                 if (sizeof($options) > 1) {
                                     $ta = new ilSelectInputGUI($lng->txt('default_role'), "usr_" . $f);
                                     $ta->setOptions($options);
                                     $ta->setRequired($ilSetting->get("require_" . $f));
                                     if (!$ta->getRequired()) {
                                         $ta->setDisabled($ilSetting->get("usr_settings_disable_" . $f));
                                     }
                                 } else {
                                     $ta = new ilHiddenInputGUI("usr_" . $f);
                                     $ta->setValue(array_shift(array_keys($options)));
                                 }
                                 $a_form->addItem($ta);
                             }
                         }
                     }
                 }
                 break;
             case "email":
                 if (ilUserProfile::userSettingVisible($f)) {
                     $em = new ilEMailInputGUI($lng->txt($lv), "usr_" . $f);
                     if ($a_user) {
                         $em->setValue($a_user->{$m}());
                     }
                     $em->setRequired($ilSetting->get("require_" . $f));
                     if (!$em->getRequired() || $em->getValue()) {
                         $em->setDisabled($ilSetting->get("usr_settings_disable_" . $f));
                     }
                     if (self::MODE_REGISTRATION == self::$mode) {
                         $em->setRetype(true);
                     }
                     $a_form->addItem($em);
                 }
                 break;
             case "textarea":
                 if (ilUserProfile::userSettingVisible($f)) {
                     $ta = new ilTextAreaInputGUI($lng->txt($lv), "usr_" . $f);
                     if ($a_user) {
                         $ta->setValue($a_user->{$m}());
                     }
                     $ta->setRows($p["rows"]);
                     $ta->setCols($p["cols"]);
                     $ta->setRequired($ilSetting->get("require_" . $f));
                     if (!$ta->getRequired() || $ta->getValue()) {
                         $ta->setDisabled($ilSetting->get("usr_settings_disable_" . $f));
                     }
                     $a_form->addItem($ta);
                 }
                 break;
             case "messenger":
                 if (ilUserProfile::userSettingVisible("instant_messengers")) {
                     $im_arr = $p["types"];
                     foreach ($im_arr as $im_name) {
                         $im = new ilTextInputGUI($lng->txt("im_" . $im_name), "usr_im_" . $im_name);
                         if ($a_user) {
                             $im->setValue($a_user->getInstantMessengerId($im_name));
                         }
                         $im->setMaxLength($p["maxlength"]);
                         $im->setSize($p["size"]);
                         $im->setRequired($ilSetting->get("require_" . "instant_messengers"));
                         if (!$im->getRequired() || $im->getValue()) {
                             $im->setDisabled($ilSetting->get("usr_settings_disable_" . "instant_messengers"));
                         }
                         $a_form->addItem($im);
                     }
                 }
                 break;
             case "password":
                 if (self::$mode == self::MODE_REGISTRATION) {
                     if (!$registration_settings->passwordGenerationEnabled()) {
                         $ta = new ilPasswordInputGUI($lng->txt($lv), "usr_" . $f);
                         $ta->setRequired(true);
                         // $ta->setDisabled($ilSetting->get("usr_settings_disable_".$f));
                     } else {
                         $ta = new ilNonEditableValueGUI($lng->txt($lv));
                         $ta->setValue($lng->txt("reg_passwd_via_mail"));
                     }
                     $a_form->addItem($ta);
                 }
                 break;
             case "language":
                 if (ilUserProfile::userSettingVisible($f)) {
                     $ta = new ilSelectInputGUI($lng->txt($lv), "usr_" . $f);
                     if ($a_user) {
                         $ta->setValue($a_user->{$m}());
                     }
                     $options = array();
                     $lng->loadLanguageModule("meta");
                     foreach ($lng->getInstalledLanguages() as $lang_key) {
                         $options[$lang_key] = $lng->txt("meta_l_" . $lang_key);
                     }
                     asort($options);
                     // #9728
                     $ta->setOptions($options);
                     $ta->setRequired($ilSetting->get("require_" . $f));
                     if (!$ta->getRequired() || $ta->getValue()) {
                         $ta->setDisabled($ilSetting->get("usr_settings_disable_" . $f));
                     }
                     $a_form->addItem($ta);
                 }
                 break;
             case "multitext":
                 if (ilUserProfile::userSettingVisible($f)) {
                     $ti = new ilTextInputGUI($lng->txt($lv), "usr_" . $f);
                     $ti->setMulti(true);
                     if ($a_user) {
                         $ti->setValue($a_user->{$m}());
                     }
                     $ti->setMaxLength($p["maxlength"]);
                     $ti->setSize($p["size"]);
                     $ti->setRequired($ilSetting->get("require_" . $f));
                     if (!$ti->getRequired() || $ti->getValue()) {
                         $ti->setDisabled($ilSetting->get("usr_settings_disable_" . $f));
                     }
                     if ($this->ajax_href) {
                         // add field to ajax call
                         $ti->setDataSource($this->ajax_href . "&f=" . $f);
                     }
                     $a_form->addItem($ti);
                 }
                 break;
         }
     }
     // append custom fields as "other"
     if (is_array($custom_fields) && !$custom_fields_done) {
         // add "other" subheader
         if ($current_group != "other") {
             $sh = new ilFormSectionHeaderGUI();
             $sh->setTitle($lng->txt("other"));
             $a_form->addItem($sh);
         }
         foreach ($custom_fields as $custom_field) {
             $a_form->addItem($custom_field);
         }
     }
 }
 /**
  * Creates Toolbar entries
  */
 function addToolbar()
 {
     global $ilToolbar;
     $ilToolbar->setFormAction($this->ilCtrl->getFormAction($this, "perminfo"));
     $ilToolbar->addText($this->lng->txt('user'));
     include_once "./Services/Form/classes/class.ilTextInputGUI.php";
     $login = new ilTextInputGUI($this->lng->txt("username"), "user_login");
     $login->setDataSource($this->ilCtrl->getLinkTargetByClass(array(get_class($this), 'ilRepositorySearchGUI'), 'doUserAutoComplete', '', true));
     $login->setSize(15);
     $login->setValue($this->user->getLogin());
     $ilToolbar->addInputItem($login);
     $ilToolbar->addFormButton($this->lng->txt("info_change_user_view"), "perminfo");
     //$ilToolbar->addText($lng->txt("info_enter_login_or_id"));
 }
 /**
  * 
  */
 public function initFilter()
 {
     /**
      * @var $tpl ilTemplate
      */
     global $tpl;
     include_once 'Services/Form/classes/class.ilTextInputGUI.php';
     $ul = new ilTextInputGUI($this->lng->txt('login') . '/' . $this->lng->txt('email') . '/' . $this->lng->txt('name'), 'query');
     $ul->setDataSource($this->ctrl->getLinkTarget($this->getParentObject(), 'addUserAutoComplete', '', true));
     $ul->setSize(20);
     $ul->setSubmitFormOnEnter(true);
     $this->addFilterItem($ul);
     $ul->readFromSession();
     $this->filter['query'] = $ul->getValue();
     include_once 'Services/Form/classes/class.ilSelectInputGUI.php';
     $options = array();
     $languages = ilObject::_getObjectsByType('lng');
     foreach ($languages as $lng) {
         $options[$lng['title']] = $this->lng->txt('meta_l_' . $lng['title']);
     }
     asort($options);
     $options = array('' => $this->lng->txt('any_language')) + $options;
     $si = new ilSelectInputGUI($this->lng->txt('language'), 'lng');
     $si->setOptions($options);
     $this->addFilterItem($si);
     $si->readFromSession();
     $this->filter['lng'] = $si->getValue();
     include_once 'Services/Form/classes/class.ilDateDurationInputGUI.php';
     $tpl->addJavaScript('./Services/Form/js/date_duration.js');
     $duration = new ilDateDurationInputGUI($this->lng->txt('tos_period'), 'period');
     $duration->setStartText($this->lng->txt('tos_period_from'));
     $duration->setEndText($this->lng->txt('tos_period_until'));
     $duration->setStart(new ilDateTime(strtotime('-1 year', time()), IL_CAL_UNIX));
     $duration->setEnd(new ilDateTime(time(), IL_CAL_UNIX));
     $duration->setShowTime(true);
     $this->addFilterItem($duration, true);
     $duration->readFromSession();
     $this->optional_filter['period'] = $duration->getValue();
 }
Ejemplo n.º 7
0
 public function showForm()
 {
     global $rbacsystem, $ilUser, $ilCtrl, $lng, $ilTabs;
     $this->tpl->addBlockFile("ADM_CONTENT", "adm_content", "tpl.mail_new.html", "Services/Mail");
     $this->tpl->setTitle($this->lng->txt("mail"));
     $this->lng->loadLanguageModule("crs");
     if (ilMailFormCall::isRefererStored()) {
         $ilTabs->setBackTarget($lng->txt('back'), $ilCtrl->getLinkTarget($this, 'cancelMail'));
     }
     switch ($_GET["type"]) {
         case 'reply':
             if ($_SESSION['mail_id']) {
                 $_GET['mail_id'] = $_SESSION['mail_id'];
             }
             $mailData = $this->umail->getMail($_GET["mail_id"]);
             $mailData["m_subject"] = $this->umail->formatReplySubject();
             $mailData["m_message"] = $this->umail->formatReplyMessage();
             $mailData["m_message"] = $this->umail->prependSignature();
             // NO ATTACHMENTS FOR REPLIES
             $mailData["attachments"] = array();
             //$mailData["rcp_cc"] = $this->umail->formatReplyRecipientsForCC();
             $mailData["rcp_cc"] = '';
             $mailData["rcp_to"] = $this->umail->formatReplyRecipient();
             $_SESSION["mail_id"] = "";
             break;
         case 'search_res':
             $mailData = $this->umail->getSavedData();
             /*if($_SESSION["mail_search_results"])
             		{
             			$mailData = $this->umail->appendSearchResult($_SESSION["mail_search_results"],$_SESSION["mail_search"]);
             		}
             		unset($_SESSION["mail_search"]);
             		unset($_SESSION["mail_search_results"]);*/
             if ($_SESSION["mail_search_results_to"]) {
                 $mailData = $this->umail->appendSearchResult($_SESSION["mail_search_results_to"], 'to');
             }
             if ($_SESSION["mail_search_results_cc"]) {
                 $mailData = $this->umail->appendSearchResult($_SESSION["mail_search_results_cc"], 'cc');
             }
             if ($_SESSION["mail_search_results_bcc"]) {
                 $mailData = $this->umail->appendSearchResult($_SESSION["mail_search_results_bcc"], 'bc');
             }
             unset($_SESSION["mail_search_results_to"]);
             unset($_SESSION["mail_search_results_cc"]);
             unset($_SESSION["mail_search_results_bcc"]);
             break;
         case 'attach':
             $mailData = $this->umail->getSavedData();
             break;
         case 'draft':
             $_SESSION["draft"] = $_GET["mail_id"];
             $mailData = $this->umail->getMail($_GET["mail_id"]);
             break;
         case 'forward':
             $mailData = $this->umail->getMail($_GET["mail_id"]);
             $mailData["rcp_to"] = $mailData["rcp_cc"] = $mailData["rcp_bcc"] = '';
             $mailData["m_subject"] = $this->umail->formatForwardSubject();
             $mailData["m_message"] = $this->umail->prependSignature();
             if (count($mailData["attachments"])) {
                 if ($error = $this->mfile->adoptAttachments($mailData["attachments"], $_GET["mail_id"])) {
                     ilUtil::sendInfo($error);
                 }
             }
             break;
         case 'new':
             if ($_GET['rcp_to']) {
                 // Note: For security reasons, ILIAS only allows Plain text strings in E-Mails.
                 $mailData["rcp_to"] = ilUtil::securePlainString($_GET['rcp_to']);
             } else {
                 if ($_SESSION['rcp_to']) {
                     $mailData["rcp_to"] = $_SESSION['rcp_to'];
                 }
             }
             if ($_GET['rcp_cc']) {
                 // Note: For security reasons, ILIAS only allows Plain text strings in E-Mails.
                 $mailData["rcp_cc"] = ilUtil::securePlainString($_GET['rcp_cc']);
             } else {
                 if ($_SESSION['rcp_cc']) {
                     $mailData["rcp_cc"] = $_SESSION['rcp_cc'];
                 }
             }
             if ($_GET['rcp_bcc']) {
                 // Note: For security reasons, ILIAS only allows Plain text strings in E-Mails.
                 $mailData["rcp_bcc"] = ilUtil::securePlainString($_GET['rcp_bcc']);
             } else {
                 if ($_SESSION['rcp_bcc']) {
                     $mailData["rcp_bcc"] = $_SESSION['rcp_bcc'];
                 }
             }
             $mailData['m_message'] = '';
             if (strlen($sig = ilMailFormCall::getSignature())) {
                 $mailData['m_message'] = $sig;
                 $mailData['m_message'] .= chr(13) . chr(10) . chr(13) . chr(10);
             }
             $mailData['m_message'] .= $this->umail->appendSignature();
             $_SESSION['rcp_to'] = '';
             $_SESSION['rcp_cc'] = '';
             $_SESSION['rcp_bcc'] = '';
             break;
         case 'role':
             if (is_array($_POST['roles'])) {
                 // Note: For security reasons, ILIAS only allows Plain text strings in E-Mails.
                 $mailData['rcp_to'] = ilUtil::securePlainString(implode(',', $_POST['roles']));
             } elseif (is_array($_SESSION['mail_roles'])) {
                 $mailData['rcp_to'] = ilUtil::securePlainString(implode(',', $_SESSION['mail_roles']));
             }
             $mailData['m_message'] = '';
             if (strlen($sig = ilMailFormCall::getSignature())) {
                 $mailData['m_message'] = $sig;
                 $mailData['m_message'] .= chr(13) . chr(10) . chr(13) . chr(10);
             }
             $mailData['m_message'] .= $_POST["additional_message_text"] . chr(13) . chr(10) . $this->umail->appendSignature();
             $_POST["additional_message_text"] = "";
             $_SESSION['mail_roles'] = "";
             break;
         case 'address':
             $mailData["rcp_to"] = urldecode($_GET["rcp"]);
             break;
         default:
             // GET DATA FROM POST
             $mailData = $_POST;
             // strip slashes
             foreach ($mailData as $key => $value) {
                 if (is_string($value)) {
                     // Note: For security reasons, ILIAS only allows Plain text strings in E-Mails.
                     $mailData[$key] = ilUtil::securePlainString($value);
                 }
             }
             break;
     }
     include_once './Services/Form/classes/class.ilPropertyFormGUI.php';
     $form_gui = new ilPropertyFormGUI();
     $form_gui->setTitle($this->lng->txt('compose'));
     $form_gui->setOpenTag(false);
     $this->tpl->setVariable('FORM_ACTION', $this->ctrl->getFormAction($this, 'sendMessage'));
     $this->tpl->setVariable('BUTTON_TO', $lng->txt("search_recipients"));
     $this->tpl->setVariable('BUTTON_COURSES_TO', $lng->txt("mail_my_courses"));
     $this->tpl->setVariable('BUTTON_GROUPS_TO', $lng->txt("mail_my_groups"));
     $this->tpl->setVariable('BUTTON_MAILING_LISTS_TO', $lng->txt("mail_my_mailing_lists"));
     $dsDataLink = $ilCtrl->getLinkTarget($this, 'lookupRecipientAsync', '', true);
     // RECIPIENT
     $inp = new ilTextInputGUI($this->lng->txt('mail_to'), 'rcp_to');
     $inp->setRequired(true);
     $inp->setSize(50);
     $inp->setValue($mailData["rcp_to"]);
     $inp->setDataSource($dsDataLink, ",");
     $inp->setMaxLength(null);
     $form_gui->addItem($inp);
     // CC
     $inp = new ilTextInputGUI($this->lng->txt('cc'), 'rcp_cc');
     $inp->setSize(50);
     $inp->setValue($mailData["rcp_cc"]);
     $inp->setDataSource($dsDataLink, ",");
     $inp->setMaxLength(null);
     $form_gui->addItem($inp);
     // BCC
     $inp = new ilTextInputGUI($this->lng->txt('bc'), 'rcp_bcc');
     $inp->setSize(50);
     $inp->setValue($mailData["rcp_bcc"]);
     $inp->setDataSource($dsDataLink, ",");
     $inp->setMaxLength(null);
     $form_gui->addItem($inp);
     // SUBJECT
     $inp = new ilTextInputGUI($this->lng->txt('subject'), 'm_subject');
     $inp->setSize(50);
     $inp->setRequired(true);
     $inp->setValue($mailData["m_subject"]);
     $form_gui->addItem($inp);
     // Attachments
     include_once 'Services/Mail/classes/class.ilMailFormAttachmentFormPropertyGUI.php';
     $att = new ilMailFormAttachmentPropertyGUI($this->lng->txt($mailData["attachments"] ? 'edit' : 'add'));
     if (is_array($mailData["attachments"]) && count($mailData["attachments"])) {
         foreach ($mailData["attachments"] as $data) {
             if (is_file($this->mfile->getMailPath() . '/' . $ilUser->getId() . "_" . $data)) {
                 $hidden = new ilHiddenInputGUI('attachments[]');
                 $form_gui->addItem($hidden);
                 $size = filesize($this->mfile->getMailPath() . '/' . $ilUser->getId() . "_" . $data);
                 $label = $data . " [" . ilFormat::formatSize($size) . "]";
                 $att->addItem($label);
                 $hidden->setValue(urlencode($data));
             }
         }
     }
     $form_gui->addItem($att);
     // ONLY IF SYSTEM MAILS ARE ALLOWED
     if ($rbacsystem->checkAccess("system_message", $this->umail->getMailObjectReferenceId())) {
         $chb = new ilCheckboxInputGUI($this->lng->txt('type'), 'm_type[]');
         $chb->setOptionTitle($this->lng->txt('system_message'));
         $chb->setValue('system');
         $chb->setChecked(false);
         if (is_array($mailData["m_type"]) and in_array('system', $mailData["m_type"])) {
             $chb->setChecked(true);
         }
         $form_gui->addItem($chb);
     }
     // MESSAGE
     $inp = new ilTextAreaInputGUI($this->lng->txt('message_content'), 'm_message');
     //$inp->setValue(htmlspecialchars($mailData["m_message"], false));
     $inp->setValue($mailData["m_message"]);
     $inp->setRequired(false);
     $inp->setCols(60);
     $inp->setRows(10);
     // PLACEHOLDERS
     $chb = new ilCheckboxInputGUI($this->lng->txt('activate_serial_letter_placeholders'), 'use_placeholders');
     $chb->setOptionTitle($this->lng->txt('activate_serial_letter_placeholders'));
     $chb->setValue(1);
     $chb->setChecked(false);
     $form_gui->addItem($inp);
     include_once 'Services/Mail/classes/class.ilMailFormPlaceholdersPropertyGUI.php';
     $prop = new ilMailFormPlaceholdersPropertyGUI();
     $chb->addSubItem($prop);
     if ($mailData['use_placeholders']) {
         $chb->setChecked(true);
     }
     $form_gui->addItem($chb);
     $form_gui->addCommandButton('sendMessage', $this->lng->txt('send_mail'));
     $form_gui->addCommandButton('saveDraft', $this->lng->txt('save_message'));
     if (ilMailFormCall::isRefererStored()) {
         $form_gui->addCommandButton('cancelMail', $this->lng->txt('cancel'));
     }
     $this->tpl->parseCurrentBlock();
     $this->tpl->setVariable('FORM', $form_gui->getHTML());
     $this->tpl->addJavaScript('Services/Mail/js/ilMailComposeFunctions.js');
     $this->tpl->show();
 }
 private function createParticipantsMultiTextInput()
 {
     $participants_input = new ilTextInputGUI($this->lng->txt("rep_robj_xrs_participants_list"), "participants");
     $participants_input->setMulti(true);
     $ajax_datasource = $this->ctrl->getLinkTarget($this, 'doUserAutoComplete', '', true);
     $participants_input->setDataSource($ajax_datasource);
     $participants_input->setInfo($this->getMaxRoomAllocationInfo());
     return $participants_input;
 }
Ejemplo n.º 9
0
 protected function initSearchForm()
 {
     global $ilCtrl;
     if ($_GET["ref"] != "wsp") {
         $this->saveMailData();
         $title = $this->lng->txt('search_recipients');
     } else {
         $this->lng->loadLanguageModule("wsp");
         $title = $this->lng->txt("wsp_share_search_users");
     }
     // searchform
     include_once 'Services/Form/classes/class.ilPropertyFormGUI.php';
     $form = new ilPropertyFormGUI();
     $form->setTitle($title);
     $form->setId('search_rcp');
     $form->setFormAction($ilCtrl->getFormAction($this, 'search'));
     $inp = new ilTextInputGUI($this->lng->txt("search_for"), 'search');
     $inp->setSize(30);
     $dsDataLink = $ilCtrl->getLinkTarget($this, 'lookupRecipientAsync', '', true, false);
     $inp->setDataSource($dsDataLink);
     if (strlen(trim($_SESSION["mail_search_search"])) > 0) {
         $inp->setValue(ilUtil::prepareFormOutput(trim($_SESSION["mail_search_search"]), true));
     }
     $form->addItem($inp);
     $form->addCommandButton('search', $this->lng->txt("search"));
     $form->addCommandButton('cancel', $this->lng->txt("cancel"));
     return $form;
 }
Ejemplo n.º 10
0
 /**
  * Init quick edit form.
  */
 public function initQuickEditForm()
 {
     global $lng, $ilCtrl;
     include_once "Services/Form/classes/class.ilPropertyFormGUI.php";
     $this->form = new ilPropertyFormGUI();
     // title
     $ti = new ilTextInputGUI($this->lng->txt("title"), "gen_title");
     $ti->setMaxLength(200);
     $ti->setSize(50);
     $ti->setRequired(true);
     $ti->setValue($this->md_section->getTitle());
     $this->form->addItem($ti);
     // description(s)
     foreach ($ids = $this->md_section->getDescriptionIds() as $id) {
         $md_des = $this->md_section->getDescription($id);
         $ta = new ilTextAreaInputGUI($this->lng->txt("meta_description"), "gen_description[" . $id . "][description]");
         $ta->setCols(50);
         $ta->setRows(4);
         $ta->setValue($md_des->getDescription());
         if (count($ids) > 1) {
             $ta->setInfo($this->lng->txt("meta_l_" . $md_des->getDescriptionLanguageCode()));
         }
         $this->form->addItem($ta);
     }
     // language(s)
     $first = "";
     $options = ilMDLanguageItem::_getLanguages();
     foreach ($ids = $this->md_section->getLanguageIds() as $id) {
         $md_lan = $this->md_section->getLanguage($id);
         $first_lang = $md_lan->getLanguageCode();
         $si = new ilSelectInputGUI($this->lng->txt("meta_language"), "gen_language[" . $id . "][language]");
         $si->setOptions($options);
         $si->setValue($md_lan->getLanguageCode());
         $this->form->addItem($si);
         $first = false;
     }
     if ($first) {
         $si = new ilSelectInputGUI($this->lng->txt("meta_language"), "gen_language[][language]");
         $si->setOptions($options);
         $this->form->addItem($si);
     }
     // keyword(s)
     $first = true;
     $keywords = array();
     foreach ($ids = $this->md_section->getKeywordIds() as $id) {
         $md_key = $this->md_section->getKeyword($id);
         if (trim($md_key->getKeyword()) != "") {
             $keywords[$md_key->getKeywordLanguageCode()][] = $md_key->getKeyword();
         }
     }
     foreach ($keywords as $lang => $keyword_set) {
         $kw = new ilTextInputGUI($this->lng->txt("keywords"), "keywords[value][" . $lang . "]");
         $kw->setDataSource($this->ctrl->getLinkTarget($this, "keywordAutocomplete", "", true));
         $kw->setMaxLength(200);
         $kw->setSize(50);
         $kw->setMulti(true);
         if (count($keywords) > 1) {
             $kw->setInfo($this->lng->txt("meta_l_" . $lang));
         }
         $this->form->addItem($kw);
         asort($keyword_set);
         $kw->setValue($keyword_set);
     }
     if (count($keywords) == 0) {
         $kw = new ilTextInputGUI($this->lng->txt("keywords"), "keywords[value][" . $first_lang . "]");
         $kw->setDataSource($this->ctrl->getLinkTarget($this, "keywordAutocomplete", "", true));
         $kw->setMaxLength(200);
         $kw->setSize(50);
         $kw->setMulti(true);
         $this->form->addItem($kw);
     }
     // Lifecycle...
     // Authors
     $ta = new ilTextAreaInputGUI($this->lng->txt('authors') . "<br />" . "(" . sprintf($this->lng->txt('md_separated_by'), $this->md_settings->getDelimiter()) . ")", "life_authors");
     $ta->setCols(50);
     $ta->setRows(2);
     if (is_object($this->md_section = $this->md_obj->getLifecycle())) {
         $sep = $ent_str = "";
         foreach ($ids = $this->md_section->getContributeIds() as $con_id) {
             $md_con = $this->md_section->getContribute($con_id);
             if ($md_con->getRole() == "Author") {
                 foreach ($ent_ids = $md_con->getEntityIds() as $ent_id) {
                     $md_ent = $md_con->getEntity($ent_id);
                     $ent_str = $ent_str . $sep . $md_ent->getEntity();
                     $sep = $this->md_settings->getDelimiter() . " ";
                 }
             }
         }
         $ta->setValue($ent_str);
     }
     $this->form->addItem($ta);
     // copyright
     include_once "./Services/MetaData/classes/class.ilCopyrightInputGUI.php";
     $cp = new ilCopyrightInputGUI($this->lng->txt("meta_copyright"), "copyright");
     $cp->setCols(50);
     $cp->setRows(3);
     $desc = ilMDRights::_lookupDescription($this->md_obj->getRBACId(), $this->md_obj->getObjId());
     $val["ta"] = $desc;
     $cp->setValue($val);
     $this->form->addItem($cp);
     // typical learning time
     include_once "./Services/MetaData/classes/class.ilTypicalLearningTimeInputGUI.php";
     $tlt = new ilTypicalLearningTimeInputGUI($this->lng->txt("meta_typical_learning_time"), "tlt");
     $edu = $this->md_obj->getEducational();
     if (is_object($edu)) {
         $tlt->setValueByLOMDuration($edu->getTypicalLearningTime());
     }
     $this->form->addItem($tlt);
     $this->form->addCommandButton("updateQuickEdit", $lng->txt("save"));
     $this->form->setTitle($this->lng->txt("meta_quickedit"));
     $this->form->setFormAction($ilCtrl->getFormAction($this));
     return $this->form;
 }
Ejemplo n.º 11
0
 /**
  * Init filter
  */
 function initFilter()
 {
     global $lng, $rbacreview, $ilUser, $ilCtrl;
     // Show context filter
     if ($this->getMode() == self::MODE_LOCAL_USER) {
         include_once './Services/User/classes/class.ilLocalUser.php';
         $parent_ids = ilLocalUser::_getFolderIds();
         if (count($parent_ids) > 1) {
             include_once "./Services/Form/classes/class.ilSelectInputGUI.php";
             $co = new ilSelectInputGUI($lng->txt('context'), 'time_limit_owner');
             $ref_id = $this->getUserFolderId();
             $opt[0] = $this->lng->txt('all_users');
             $opt[$this->getUserFolderId()] = $lng->txt('users') . ' (' . ilObject::_lookupTitle(ilObject::_lookupObjId($this->getUserFolderId())) . ')';
             foreach ($parent_ids as $parent_id) {
                 if ($parent_id == $this->getUserFolderId()) {
                     continue;
                 }
                 switch ($parent_id) {
                     case USER_FOLDER_ID:
                         $opt[USER_FOLDER_ID] = $lng->txt('global_user');
                         break;
                     default:
                         $opt[$parent_id] = $lng->txt('users') . ' (' . ilObject::_lookupTitle(ilObject::_lookupObjId($parent_id)) . ')';
                         break;
                 }
             }
             $co->setOptions($opt);
             $this->addFilterItem($co);
             $co->readFromSession();
             $this->filter['time_limit_owner'] = $co->getValue();
         }
     }
     // User name, login, email filter
     include_once "./Services/Form/classes/class.ilTextInputGUI.php";
     $ul = new ilTextInputGUI($lng->txt("login") . "/" . $lng->txt("email") . "/" . $lng->txt("name"), "query");
     $ul->setDataSource($ilCtrl->getLinkTarget($this->getParentObject(), "addUserAutoComplete", "", true));
     $ul->setSize(20);
     $ul->setSubmitFormOnEnter(true);
     $this->addFilterItem($ul);
     $ul->readFromSession();
     $this->filter["query"] = $ul->getValue();
     /*
     include_once("./Services/Form/classes/class.ilTextInputGUI.php");
     $ti = new ilTextInputGUI($lng->txt("login")."/".$lng->txt("email")."/".$lng->txt("name"), "query");
     $ti->setMaxLength(64);
     $ti->setSize(20);
     $ti->setSubmitFormOnEnter(true);
     $this->addFilterItem($ti);
     $ti->readFromSession();
     $this->filter["query"] = $ti->getValue();
     */
     // activation
     include_once "./Services/Form/classes/class.ilSelectInputGUI.php";
     $options = array("" => $lng->txt("user_all"), "active" => $lng->txt("active"), "inactive" => $lng->txt("inactive"));
     $si = new ilSelectInputGUI($this->lng->txt("user_activation"), "activation");
     $si->setOptions($options);
     $this->addFilterItem($si);
     $si->readFromSession();
     $this->filter["activation"] = $si->getValue();
     // limited access
     include_once "./Services/Form/classes/class.ilCheckboxInputGUI.php";
     $cb = new ilCheckboxInputGUI($this->lng->txt("user_limited_access"), "limited_access");
     $this->addFilterItem($cb);
     $cb->readFromSession();
     $this->filter["limited_access"] = $cb->getChecked();
     // last login
     include_once "./Services/Form/classes/class.ilDateTimeInputGUI.php";
     $di = new ilDateTimeInputGUI($this->lng->txt("user_last_login_before"), "last_login");
     $default_date = new ilDateTime(time(), IL_CAL_UNIX);
     $default_date->increment(IL_CAL_DAY, 1);
     $di->setDate($default_date);
     $this->addFilterItem($di);
     $di->readFromSession();
     $this->filter["last_login"] = $di->getDate();
     if ($this->getMode() == self::MODE_USER_FOLDER) {
         // no assigned courses
         include_once "./Services/Form/classes/class.ilCheckboxInputGUI.php";
         $cb = new ilCheckboxInputGUI($this->lng->txt("user_no_courses"), "no_courses");
         $this->addFilterItem($cb);
         $cb->readFromSession();
         $this->filter["no_courses"] = $cb->getChecked();
         // no assigned groups
         include_once "./Services/Form/classes/class.ilCheckboxInputGUI.php";
         $ng = new ilCheckboxInputGUI($this->lng->txt("user_no_groups"), "no_groups");
         $this->addFilterItem($ng);
         $ng->readFromSession();
         $this->filter['no_groups'] = $ng->getChecked();
         // course/group members
         include_once "./Services/Form/classes/class.ilRepositorySelectorInputGUI.php";
         $rs = new ilRepositorySelectorInputGUI($lng->txt("user_member_of_course_group"), "course_group");
         $rs->setSelectText($lng->txt("user_select_course_group"));
         $rs->setHeaderMessage($lng->txt("user_please_select_course_group"));
         $rs->setClickableTypes(array("crs", "grp"));
         $this->addFilterItem($rs);
         $rs->readFromSession();
         $this->filter["course_group"] = $rs->getValue();
     }
     // global roles
     $options = array("" => $lng->txt("user_any"));
     $roles = $rbacreview->getRolesByFilter(2, $ilUser->getId());
     foreach ($roles as $role) {
         $options[$role["rol_id"]] = $role["title"];
     }
     $si = new ilSelectInputGUI($this->lng->txt("user_global_role"), "global_role");
     $si->setOptions($options);
     $this->addFilterItem($si);
     $si->readFromSession();
     $this->filter["global_role"] = $si->getValue();
 }
 /**
  * Show user's addressbook
  */
 public function showAddressbook()
 {
     global $rbacsystem, $lng, $ilUser, $ilCtrl, $ilias;
     $this->tpl->setTitle($this->lng->txt("mail_addressbook"));
     $this->tpl->addBlockFile("ADM_CONTENT", "adm_content", "tpl.mail_addressbook.html", "Services/Contact");
     // check if current user may send mails
     include_once "Services/Mail/classes/class.ilMail.php";
     $mail = new ilMail($_SESSION["AccountId"]);
     $mailing_allowed = $rbacsystem->checkAccess('internal_mail', $mail->getMailObjectReferenceId());
     // searchbox
     include_once './Services/Form/classes/class.ilPropertyFormGUI.php';
     $searchform = new ilPropertyFormGUI();
     $searchform->setFormAction($this->ctrl->getFormAction($this, "saveEntry"));
     $dsDataLink = $ilCtrl->getLinkTarget($this, 'lookupAddressbookAsync', '', true, false);
     $inp = new ilTextInputGUI($this->lng->txt('search_for'), 'search_qry');
     $inp->setDataSource($dsDataLink);
     $searchform->addItem($inp);
     $searchform->addCommandButton('search', $this->lng->txt("send"));
     $this->tpl->setVariable('SEARCHFORM', $searchform->getHtml());
     $this->tpl->setVariable('ACTION', $this->ctrl->getFormAction($this, "saveEntry"));
     $this->tpl->setVariable("TXT_SEARCH_FOR", $this->lng->txt("search_for"));
     $this->tpl->setVariable("BUTTON_SEARCH", $this->lng->txt("send"));
     if (strlen(trim($_SESSION["addr_search"])) > 0) {
         $this->tpl->setVariable("VALUE_SEARCH_FOR", ilUtil::prepareFormOutput(trim($_SESSION["addr_search"]), true));
     }
     $tbl = new ilAddressbookTableGUI($this);
     $tbl->setTitle($lng->txt("mail_addr_entries"));
     $tbl->setRowTemplate("tpl.mail_addressbook_row.html", "Services/Contact");
     $tbl->setDefaultOrderField('login');
     $result = array();
     $this->abook->setSearchQuery($_SESSION['addr_search']);
     $entries = $this->abook->getEntries();
     $tbl->addColumn('', 'check', '10%', true);
     $tbl->addColumn($this->lng->txt('login'), 'login', '20%');
     $tbl->addColumn($this->lng->txt('firstname'), 'firstname', '20%');
     $tbl->addColumn($this->lng->txt('lastname'), 'lastname', '20%');
     $tbl->addColumn($this->lng->txt('email'), 'email', '20%');
     $tbl->addColumn($this->lng->txt('actions'), '', '10%');
     include_once "./Services/UIComponent/AdvancedSelectionList/classes/class.ilAdvancedSelectionListGUI.php";
     if (count($entries)) {
         $tbl->enable('select_all');
         $tbl->setSelectAllCheckbox('addr_id');
         $chatSettings = new ilSetting('chatroom');
         $chat_active = $chatSettings->get("chat_enabled", false);
         $counter = 0;
         foreach ($entries as $entry) {
             $result[$counter]['check'] = ilUtil::formCheckbox(0, 'addr_id[]', $entry["addr_id"]);
             $this->ctrl->setParameter($this, 'addr_id', $entry['addr_id']);
             $result[$counter]['login'] = '';
             if ($entry["login"] != "") {
                 if ($mailing_allowed) {
                     $result[$counter]['login_linked_link'] = $this->ctrl->getLinkTarget($this, 'mailToUsers');
                     $result[$counter]['login'] = $result[$counter]['login_linked_login'] = $entry["login"];
                 } else {
                     $result[$counter]['login'] = $result[$counter]['login_unliked'] = $entry["login"];
                 }
             }
             $result[$counter]['firstname'] = $entry["firstname"];
             $result[$counter]['lastname'] = $entry["lastname"];
             if ($_GET["baseClass"] == "ilMailGUI" && $rbacsystem->checkAccess("smtp_mail", $this->umail->getMailObjectReferenceId())) {
                 $result[$counter]['email'] = $result[$counter]['email_linked_email'] = $entry["email"];
                 $result[$counter]['email_linked_link'] = $this->ctrl->getLinkTarget($this, "mailToUsers");
             } else {
                 $result[$counter]['email'] = $result[$counter]['email_unlinked'] = $entry["email"];
             }
             $current_selection_list = new ilAdvancedSelectionListGUI();
             $current_selection_list->setListTitle($this->lng->txt("actions"));
             $current_selection_list->setId("act_" . $counter);
             $current_selection_list->addItem($this->lng->txt("edit"), '', $this->ctrl->getLinkTarget($this, "showAddressForm"));
             if ($mailing_allowed) {
                 $current_selection_list->addItem($this->lng->txt("send_mail_to"), '', $this->ctrl->getLinkTarget($this, "mailToUsers"));
             }
             $current_selection_list->addItem($this->lng->txt("delete"), '', $this->ctrl->getLinkTarget($this, "confirmDelete"));
             if ($chat_active) {
                 $current_selection_list->addItem($this->lng->txt("invite_to_chat"), '', $this->ctrl->getLinkTarget($this, "inviteToChat"));
             }
             $this->ctrl->clearParameters($this);
             $result[$counter]['COMMAND_SELECTION_LIST'] = $current_selection_list->getHTML();
             ++$counter;
         }
         if ($mailing_allowed) {
             $tbl->addMultiCommand('mailToUsers', $this->lng->txt('send_mail_to'));
         }
         $tbl->addMultiCommand('confirmDelete', $this->lng->txt('delete'));
         if ($chat_active) {
             $tbl->addMultiCommand('inviteToChat', $this->lng->txt('invite_to_chat'));
         }
     } else {
         $tbl->disable('header');
         $tbl->disable('footer');
         $tbl->setNoEntriesText($this->lng->txt('mail_search_no'));
     }
     $tbl->setData($result);
     $tbl->addCommandButton('showAddressForm', $this->lng->txt('add'));
     $this->tpl->setVariable('TABLE', $tbl->getHTML());
     $this->tpl->show();
     unset($_SESSION['addr_search']);
     return true;
 }
Ejemplo n.º 13
0
 protected function initKeywordsForm()
 {
     global $ilUser;
     include_once "Services/Form/classes/class.ilPropertyFormGUI.php";
     $form = new ilPropertyFormGUI();
     $form->setFormAction($this->ctrl->getFormAction($this, "saveKeywordsForm"));
     $form->setTitle($this->lng->txt("blog_edit_keywords"));
     $txt = new ilTextInputGUI($this->lng->txt("blog_keywords"), "keywords");
     // $txt->setRequired(true); #10504
     $txt->setMulti(true);
     $txt->setDataSource($this->ctrl->getLinkTarget($this, "keywordAutocomplete", "", true));
     $txt->setMaxLength(200);
     $txt->setSize(50);
     $txt->setInfo($this->lng->txt("blog_keywords_info"));
     $form->addItem($txt);
     $md_section = $this->getBlogPosting()->getMDSection();
     $keywords = array();
     foreach ($ids = $md_section->getKeywordIds() as $id) {
         $md_key = $md_section->getKeyword($id);
         if (trim($md_key->getKeyword()) != "") {
             $keywords[$md_key->getKeywordLanguageCode()][] = $md_key->getKeyword();
         }
     }
     // language is not "used" anywhere
     $ulang = $ilUser->getLanguage();
     if ($keywords[$ulang]) {
         asort($keywords[$ulang]);
         $txt->setValue($keywords[$ulang]);
     }
     // other keywords in blog
     $other = array();
     foreach (array_keys(ilBlogPosting::getAllPostings($this->getBlogPosting()->getBlogId())) as $posting_id) {
         if ($posting_id != $this->getBlogPosting()->getId()) {
             $other = array_merge($other, ilBlogPosting::getKeywords($this->getBlogPosting()->getBlogId(), $posting_id));
         }
     }
     if (is_array($keywords[$ulang])) {
         $other = array_diff($other, $keywords[$ulang]);
     }
     if (sizeof($other)) {
         $html = "";
         foreach ($other as $item) {
             $html .= '<span class="ilTag">' . $item . '</span>';
         }
         $info = new ilNonEditableValueGUI($this->lng->txt("blog_keywords_other"), "", true);
         $info->setInfo($this->lng->txt("blog_keywords_other_info"));
         $info->setValue($html);
         $form->addItem($info);
     }
     $form->addCommandButton("saveKeywordsForm", $this->lng->txt("save"));
     $form->addCommandButton("preview", $this->lng->txt("cancel"));
     return $form;
 }
Ejemplo n.º 14
0
 /**
  * Returns form to insert a wiki link per ajax
  */
 function insertWikiLink()
 {
     global $lng, $ilCtrl;
     include_once "Services/Form/classes/class.ilPropertyFormGUI.php";
     $form = new ilPropertyFormGUI();
     $form->addCommandButton("addWikiLink", $lng->txt("wiki_add_link"));
     $form->addCommandButton("searchWikiLink", $lng->txt("search"));
     // Target page
     $tp = new ilTextInputGUI($this->lng->txt("wiki_target_page"), "target_page");
     $tp->setSize(18);
     $tp->setRequired(true);
     $tp->setInfo("...");
     $tp->setDataSource($ilCtrl->getLinkTarget($this, "insertWikiLinkAC", "", true));
     $form->addItem($tp);
     // Link text
     $lt = new ilTextInputGUI($this->lng->txt("wiki_link_text"), "link_text");
     $lt->setSize(18);
     $form->addItem($lt);
     //$form->setTitle($lng->txt("wiki_link"));
     echo $form->getHTML();
     exit;
 }
 function initAddCodesForm()
 {
     global $rbacreview, $ilObjDataCache, $lng;
     include_once 'Services/Form/classes/class.ilPropertyFormGUI.php';
     $this->form_gui = new ilPropertyFormGUI();
     $this->form_gui->setFormAction($this->ctrl->getFormAction($this, 'createCodes'));
     $this->form_gui->setTitle($this->lng->txt('registration_codes_edit_header'));
     $count = new ilNumberInputGUI($this->lng->txt('registration_codes_number'), 'reg_codes_number');
     $count->setSize(4);
     $count->setMaxLength(4);
     $count->setMinValue(1);
     $count->setMaxValue(1000);
     $count->setRequired(true);
     $this->form_gui->addItem($count);
     $sec = new ilFormSectionHeaderGUI();
     $sec->setTitle($this->lng->txt('registration_codes_roles_title'));
     $this->form_gui->addItem($sec);
     include_once './Services/AccessControl/classes/class.ilObjRole.php';
     $options = array("" => $this->lng->txt('registration_codes_no_assigned_role'));
     foreach ($rbacreview->getGlobalRoles() as $role_id) {
         if (!in_array($role_id, array(SYSTEM_ROLE_ID, ANONYMOUS_ROLE_ID))) {
             $options[$role_id] = $ilObjDataCache->lookupTitle($role_id);
         }
     }
     $roles = new ilSelectInputGUI($this->lng->txt("registration_codes_roles"), "reg_codes_role");
     $roles->setInfo($this->lng->txt("registration_codes_override_info"));
     $roles->setOptions($options);
     $this->form_gui->addItem($roles);
     $local = new ilTextInputGUI($this->lng->txt("registration_codes_roles_local"), "reg_codes_local");
     $local->setMulti(true);
     $local->setDataSource($this->ctrl->getLinkTarget($this, "getLocalRoleAutoComplete", "", true));
     $this->form_gui->addItem($local);
     $sec = new ilFormSectionHeaderGUI();
     $sec->setTitle($this->lng->txt('reg_access_limitations'));
     $this->form_gui->addItem($sec);
     $limit = new ilRadioGroupInputGUI($this->lng->txt("reg_access_limitation_mode"), "reg_limit");
     $limit->setInfo($this->lng->txt("registration_codes_override_info"));
     $this->form_gui->addItem($limit);
     $opt = new ilRadioOption($this->lng->txt("registration_codes_roles_limitation_none"), "none");
     $limit->addOption($opt);
     $opt = new ilRadioOption($this->lng->txt("reg_access_limitation_none"), "unlimited");
     $limit->addOption($opt);
     $opt = new ilRadioOption($this->lng->txt("reg_access_limitation_mode_absolute"), "absolute");
     $limit->addOption($opt);
     $dt = new ilDateTimeInputGUI($this->lng->txt("reg_access_limitation_mode_absolute_target"), "abs_date");
     $dt->setRequired(true);
     $opt->addSubItem($dt);
     $opt = new ilRadioOption($this->lng->txt("reg_access_limitation_mode_relative"), "relative");
     $limit->addOption($opt);
     $days = new ilTextInputGUI("", "rel_date[d]");
     $days->setSize(5);
     $days->setSuffix($this->lng->txt("days"));
     $mon = new ilTextInputGUI("", "rel_date[m]");
     $mon->setSize(5);
     $mon->setSuffix($this->lng->txt("months"));
     $yr = new ilTextInputGUI("", "rel_date[y]");
     $yr->setSize(5);
     $yr->setSuffix($this->lng->txt("years"));
     // custom input won't reload
     if (is_array($_POST["rel_date"])) {
         $days->setValue($_POST["rel_date"]["d"]);
         $mon->setValue($_POST["rel_date"]["m"]);
         $yr->setValue($_POST["rel_date"]["y"]);
     }
     $dur = new ilCustomInputGUI($this->lng->txt("reg_access_limitation_mode_relative_target"));
     $dur->setRequired(true);
     $dur->setHTML($days->getToolbarHTML() . " " . $mon->getToolbarHTML() . " " . $yr->getToolbarHTML());
     $opt->addSubItem($dur);
     $this->form_gui->addCommandButton('createCodes', $this->lng->txt('create'));
 }
 private function createAndSetParticipantsMultiTextInput($a_bookingData)
 {
     global $rssPermission;
     $participants_input = new ilTextInputGUI($this->lng->txt("rep_robj_xrs_participants_list"), "participants");
     $participants_input->setMulti(true);
     $ajax_datasource = $this->ctrl->getLinkTarget($this, 'doUserAutoComplete', '', true);
     $participants_input->setDataSource($ajax_datasource);
     $participants_input->setInfo($this->getMaxRoomAllocationInfo());
     if (!empty($a_bookingData[0])) {
         $participants_input->setValue($a_bookingData[0]);
     }
     $participants_input->setMultiValues($a_bookingData);
     if ($this->mode == 'show' || !$rssPermission->checkPrivilege(ilRoomSharingPrivilegesConstants::ADD_PARTICIPANTS)) {
         $participants_input->setDisabled(true);
     }
     return $participants_input;
 }
Ejemplo n.º 17
0
 /**
  * Init survey settings form
  * 
  * @return ilPropertyFormGUI
  */
 function initPropertiesForm()
 {
     $template_settings = $hide_rte_switch = null;
     $template = $this->object->getTemplate();
     if ($template) {
         include_once "Services/Administration/classes/class.ilSettingsTemplate.php";
         $template = new ilSettingsTemplate($template);
         $template_settings = $template->getSettings();
         $hide_rte_switch = $template_settings["rte_switch"]["hide"];
     }
     include_once "./Services/Form/classes/class.ilPropertyFormGUI.php";
     $form = new ilPropertyFormGUI();
     $form->setFormAction($this->ctrl->getFormAction($this));
     $form->setTableWidth("100%");
     $form->setId("survey_properties");
     // general properties
     $header = new ilFormSectionHeaderGUI();
     $header->setTitle($this->lng->txt("settings"));
     $form->addItem($header);
     // title & description (meta data)
     include_once 'Services/MetaData/classes/class.ilMD.php';
     $md_obj = new ilMD($this->object->getId(), 0, "svy");
     $md_section = $md_obj->getGeneral();
     $title = new ilTextInputGUI($this->lng->txt("title"), "title");
     $title->setRequired(true);
     $title->setValue($md_section->getTitle());
     $form->addItem($title);
     $ids = $md_section->getDescriptionIds();
     if ($ids) {
         $desc_obj = $md_section->getDescription(array_pop($ids));
         $desc = new ilTextAreaInputGUI($this->lng->txt("description"), "description");
         $desc->setCols(50);
         $desc->setRows(4);
         $desc->setValue($desc_obj->getDescription());
         $form->addItem($desc);
     }
     // pool usage
     $pool_usage = new ilRadioGroupInputGUI($this->lng->txt("survey_question_pool_usage"), "use_pool");
     $opt = new ilRadioOption($this->lng->txt("survey_question_pool_usage_active"), 1);
     $opt->setInfo($this->lng->txt("survey_question_pool_usage_active_info"));
     $pool_usage->addOption($opt);
     $opt = new ilRadioOption($this->lng->txt("survey_question_pool_usage_inactive"), 0);
     $opt->setInfo($this->lng->txt("survey_question_pool_usage_inactive_info"));
     $pool_usage->addOption($opt);
     $pool_usage->setValue($this->object->getPoolUsage());
     $form->addItem($pool_usage);
     // 360°: appraisees
     if ($this->object->get360Mode()) {
         $self_eval = new ilCheckboxInputGUI($this->lng->txt("survey_360_self_evaluation"), "self_eval");
         $self_eval->setInfo($this->lng->txt("survey_360_self_evaluation_info"));
         $self_eval->setChecked($this->object->get360SelfEvaluation());
         $form->addItem($self_eval);
         $self_rate = new ilCheckboxInputGUI($this->lng->txt("survey_360_self_raters"), "self_rate");
         $self_rate->setInfo($this->lng->txt("survey_360_self_raters_info"));
         $self_rate->setChecked($this->object->get360SelfRaters());
         $form->addItem($self_rate);
         $self_appr = new ilCheckboxInputGUI($this->lng->txt("survey_360_self_appraisee"), "self_appr");
         $self_appr->setInfo($this->lng->txt("survey_360_self_appraisee_info"));
         $self_appr->setChecked($this->object->get360SelfAppraisee());
         $form->addItem($self_appr);
     }
     // activation
     include_once "Services/Object/classes/class.ilObjectActivation.php";
     $this->lng->loadLanguageModule('rep');
     $section = new ilFormSectionHeaderGUI();
     $section->setTitle($this->lng->txt('rep_activation_availability'));
     $form->addItem($section);
     // additional info only with multiple references
     $act_obj_info = $act_ref_info = "";
     if (sizeof(ilObject::_getAllReferences($this->object->getId())) > 1) {
         $act_obj_info = ' ' . $this->lng->txt('rep_activation_online_object_info');
         $act_ref_info = $this->lng->txt('rep_activation_access_ref_info');
     }
     $online = new ilCheckboxInputGUI($this->lng->txt('rep_activation_online'), 'online');
     $online->setInfo($this->lng->txt('svy_activation_online_info') . $act_obj_info);
     $online->setChecked($this->object->isOnline());
     $form->addItem($online);
     $act_type = new ilCheckboxInputGUI($this->lng->txt('rep_visibility_until'), 'access_type');
     // $act_type->setInfo($this->lng->txt('svy_availability_until_info'));
     $act_type->setChecked($this->object->isActivationLimited());
     $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);
     $date = $this->object->getActivationStartDate();
     $dur->setStart(new ilDateTime($date ? $date : time(), IL_CAL_UNIX));
     $dur->setStartText($this->lng->txt('rep_activation_limited_start'));
     $date = $this->object->getActivationEndDate();
     $dur->setEnd(new ilDateTime($date ? $date : time(), 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'), 'access_visiblity');
     $visible->setInfo($this->lng->txt('svy_activation_limited_visibility_info'));
     $visible->setChecked($this->object->getActivationVisibility());
     $act_type->addSubItem($visible);
     $form->addItem($act_type);
     // before start
     $section = new ilFormSectionHeaderGUI();
     $section->setTitle($this->lng->txt('svy_settings_section_before_start'));
     $form->addItem($section);
     // introduction
     $intro = new ilTextAreaInputGUI($this->lng->txt("introduction"), "introduction");
     $intro->setValue($this->object->prepareTextareaOutput($this->object->getIntroduction()));
     $intro->setRows(10);
     $intro->setCols(80);
     $intro->setUseRte(TRUE);
     $intro->setInfo($this->lng->txt("survey_introduction_info"));
     include_once "./Services/AdvancedEditing/classes/class.ilObjAdvancedEditing.php";
     $intro->setRteTags(ilObjAdvancedEditing::_getUsedHTMLTags("survey"));
     $intro->addPlugin("latex");
     $intro->addButton("latex");
     $intro->addButton("pastelatex");
     $intro->setRTESupport($this->object->getId(), "svy", "survey", null, $hide_rte_switch);
     $form->addItem($intro);
     // access
     $section = new ilFormSectionHeaderGUI();
     $section->setTitle($this->lng->txt('svy_settings_section_access'));
     $form->addItem($section);
     // enable start date
     $start = $this->object->getStartDate();
     $enablestartingtime = new ilCheckboxInputGUI($this->lng->txt("start_date"), "enabled_start_date");
     $enablestartingtime->setValue(1);
     // $enablestartingtime->setOptionTitle($this->lng->txt("enabled"));
     $enablestartingtime->setChecked($start);
     // start date
     $startingtime = new ilDateTimeInputGUI('', 'start_date');
     $startingtime->setShowTime(true);
     if ($start) {
         $startingtime->setDate(new ilDate($start, IL_CAL_TIMESTAMP));
     }
     $enablestartingtime->addSubItem($startingtime);
     $form->addItem($enablestartingtime);
     // enable end date
     $end = $this->object->getEndDate();
     $enableendingtime = new ilCheckboxInputGUI($this->lng->txt("end_date"), "enabled_end_date");
     $enableendingtime->setValue(1);
     // $enableendingtime->setOptionTitle($this->lng->txt("enabled"));
     $enableendingtime->setChecked($end);
     // end date
     $endingtime = new ilDateTimeInputGUI('', 'end_date');
     $endingtime->setShowTime(true);
     if ($end) {
         $endingtime->setDate(new ilDate($end, IL_CAL_TIMESTAMP));
     }
     $enableendingtime->addSubItem($endingtime);
     $form->addItem($enableendingtime);
     // anonymization
     if (!$this->object->get360Mode()) {
         $codes = new ilCheckboxInputGUI($this->lng->txt("survey_access_codes"), "acc_codes");
         $codes->setInfo($this->lng->txt("survey_access_codes_info"));
         $codes->setChecked(!$this->object->isAccessibleWithoutCode());
         $form->addItem($codes);
         if ($this->object->_hasDatasets($this->object->getSurveyId())) {
             $codes->setDisabled(true);
         }
     }
     // question behaviour
     $section = new ilFormSectionHeaderGUI();
     $section->setTitle($this->lng->txt('svy_settings_section_question_behaviour'));
     $form->addItem($section);
     // show question titles
     $show_question_titles = new ilCheckboxInputGUI($this->lng->txt("svy_show_questiontitles"), "show_question_titles");
     $show_question_titles->setValue(1);
     $show_question_titles->setChecked($this->object->getShowQuestionTitles());
     $form->addItem($show_question_titles);
     // finishing
     $info = new ilFormSectionHeaderGUI();
     $info->setTitle($this->lng->txt("svy_settings_section_finishing"));
     $form->addItem($info);
     $view_own = new ilCheckboxInputGUI($this->lng->txt("svy_results_view_own"), "view_own");
     $view_own->setInfo($this->lng->txt("svy_results_view_own_info"));
     $view_own->setChecked($this->object->hasViewOwnResults());
     $form->addItem($view_own);
     $mail_own = new ilCheckboxInputGUI($this->lng->txt("svy_results_mail_own"), "mail_own");
     $mail_own->setInfo($this->lng->txt("svy_results_mail_own_info"));
     $mail_own->setChecked($this->object->hasMailOwnResults());
     $form->addItem($mail_own);
     // final statement
     $finalstatement = new ilTextAreaInputGUI($this->lng->txt("outro"), "outro");
     $finalstatement->setValue($this->object->prepareTextareaOutput($this->object->getOutro()));
     $finalstatement->setRows(10);
     $finalstatement->setCols(80);
     $finalstatement->setUseRte(TRUE);
     $finalstatement->setRteTags(ilObjAdvancedEditing::_getUsedHTMLTags("survey"));
     $finalstatement->addPlugin("latex");
     $finalstatement->addButton("latex");
     $finalstatement->addButton("pastelatex");
     $finalstatement->setRTESupport($this->object->getId(), "svy", "survey", null, $hide_rte_switch);
     $form->addItem($finalstatement);
     // mail notification
     $mailnotification = new ilCheckboxInputGUI($this->lng->txt("mailnotification"), "mailnotification");
     // $mailnotification->setOptionTitle($this->lng->txt("activate"));
     $mailnotification->setInfo($this->lng->txt("svy_result_mail_notification_info"));
     // #11762
     $mailnotification->setValue(1);
     $mailnotification->setChecked($this->object->getMailNotification());
     // addresses
     $mailaddresses = new ilTextInputGUI($this->lng->txt("mailaddresses"), "mailaddresses");
     $mailaddresses->setValue($this->object->getMailAddresses());
     $mailaddresses->setSize(80);
     $mailaddresses->setInfo($this->lng->txt('mailaddresses_info'));
     $mailaddresses->setRequired(true);
     // participant data
     $participantdata = new ilTextAreaInputGUI($this->lng->txt("mailparticipantdata"), "mailparticipantdata");
     $participantdata->setValue($this->object->getMailParticipantData());
     $participantdata->setRows(6);
     $participantdata->setCols(80);
     $participantdata->setUseRte(false);
     $participantdata->setInfo($this->lng->txt("mailparticipantdata_info"));
     // #12755 - because of privacy concerns we restrict user data to a minimum
     $placeholders = array("FIRST_NAME" => "firstname", "LAST_NAME" => "lastname", "LOGIN" => "login");
     $txt = array();
     foreach ($placeholders as $placeholder => $caption) {
         $txt[] = "[" . strtoupper($placeholder) . "]: " . $this->lng->txt($caption);
     }
     $txt = implode("<br />", $txt);
     $participantdatainfo = new ilNonEditableValueGUI($this->lng->txt("mailparticipantdata_placeholder"), "", true);
     $participantdatainfo->setValue($txt);
     $mailnotification->addSubItem($mailaddresses);
     $mailnotification->addSubItem($participantdata);
     $mailnotification->addSubItem($participantdatainfo);
     $form->addItem($mailnotification);
     // tutor notification - currently not available for 360°
     if (!$this->object->get360Mode()) {
         // parent course?
         global $tree;
         $has_parent = $tree->checkForParentType($this->object->getRefId(), "grp");
         if (!$has_parent) {
             $has_parent = $tree->checkForParentType($this->object->getRefId(), "crs");
         }
         $num_inv = sizeof($this->object->getInvitedUsers());
         // notification
         $tut = new ilCheckboxInputGUI($this->lng->txt("survey_notification_tutor_setting"), "tut");
         $tut->setChecked($this->object->getTutorNotificationStatus());
         $form->addItem($tut);
         $tut_logins = array();
         $tuts = $this->object->getTutorNotificationRecipients();
         if ($tuts) {
             foreach ($tuts as $tut_id) {
                 $tmp = ilObjUser::_lookupName($tut_id);
                 if ($tmp["login"]) {
                     $tut_logins[] = $tmp["login"];
                 }
             }
         }
         $tut_ids = new ilTextInputGUI($this->lng->txt("survey_notification_tutor_recipients"), "tut_ids");
         $tut_ids->setDataSource($this->ctrl->getLinkTarget($this, "doAutoComplete", "", true));
         $tut_ids->setRequired(true);
         $tut_ids->setMulti(true);
         $tut_ids->setMultiValues($tut_logins);
         $tut_ids->setValue(array_shift($tut_logins));
         $tut->addSubItem($tut_ids);
         $tut_grp = new ilRadioGroupInputGUI($this->lng->txt("survey_notification_target_group"), "tut_grp");
         $tut_grp->setRequired(true);
         $tut_grp->setValue($this->object->getTutorNotificationTarget());
         $tut->addSubItem($tut_grp);
         $tut_grp_crs = new ilRadioOption($this->lng->txt("survey_notification_target_group_parent_course"), ilObjSurvey::NOTIFICATION_PARENT_COURSE);
         if (!$has_parent) {
             $tut_grp_crs->setInfo($this->lng->txt("survey_notification_target_group_parent_course_inactive"));
         }
         $tut_grp->addOption($tut_grp_crs);
         $tut_grp_inv = new ilRadioOption($this->lng->txt("survey_notification_target_group_invited"), ilObjSurvey::NOTIFICATION_INVITED_USERS);
         $tut_grp_inv->setInfo(sprintf($this->lng->txt("survey_notification_target_group_invited_info"), $num_inv));
         $tut_grp->addOption($tut_grp_inv);
     }
     // reminders
     // reminder - currently not available for 360°
     if (!$this->object->get360Mode()) {
         $info = new ilFormSectionHeaderGUI();
         $info->setTitle($this->lng->txt("svy_settings_section_reminders"));
         $form->addItem($info);
         $rmd = new ilCheckboxInputGUI($this->lng->txt("survey_reminder_setting"), "rmd");
         $rmd->setChecked($this->object->getReminderStatus());
         $form->addItem($rmd);
         $rmd_start = new ilDateTimeInputGUI($this->lng->txt("survey_reminder_start"), "rmd_start");
         $rmd_start->setRequired(true);
         $start = $this->object->getReminderStart();
         if ($start) {
             $rmd_start->setDate($start);
         }
         $rmd->addSubItem($rmd_start);
         $end = $this->object->getReminderEnd();
         $rmd_end = new ilDateTimeInputGUI($this->lng->txt("survey_reminder_end"), "rmd_end");
         $rmd_end->enableDateActivation("", "rmd_end_tgl", (bool) $end);
         if ($end) {
             $rmd_end->setDate($end);
         }
         $rmd->addSubItem($rmd_end);
         $rmd_freq = new ilNumberInputGUI($this->lng->txt("survey_reminder_frequency"), "rmd_freq");
         $rmd_freq->setRequired(true);
         $rmd_freq->setSize(3);
         $rmd_freq->setSuffix($this->lng->txt("survey_reminder_frequency_days"));
         $rmd_freq->setValue($this->object->getReminderFrequency());
         $rmd_freq->setMinValue(1);
         $rmd->addSubItem($rmd_freq);
         $rmd_grp = new ilRadioGroupInputGUI($this->lng->txt("survey_notification_target_group"), "rmd_grp");
         $rmd_grp->setRequired(true);
         $rmd_grp->setValue($this->object->getReminderTarget());
         $rmd->addSubItem($rmd_grp);
         $rmd_grp_crs = new ilRadioOption($this->lng->txt("survey_notification_target_group_parent_course"), ilObjSurvey::NOTIFICATION_PARENT_COURSE);
         if (!$has_parent) {
             $rmd_grp_crs->setInfo($this->lng->txt("survey_notification_target_group_parent_course_inactive"));
         }
         $rmd_grp->addOption($rmd_grp_crs);
         $rmd_grp_inv = new ilRadioOption($this->lng->txt("survey_notification_target_group_invited"), ilObjSurvey::NOTIFICATION_INVITED_USERS);
         $rmd_grp_inv->setInfo(sprintf($this->lng->txt("survey_notification_target_group_invited_info"), $num_inv));
         $rmd_grp->addOption($rmd_grp_inv);
     }
     // results
     $results = new ilFormSectionHeaderGUI();
     $results->setTitle($this->lng->txt("results"));
     $form->addItem($results);
     // evaluation access
     if (!$this->object->get360Mode()) {
         $evaluation_access = new ilRadioGroupInputGUI($this->lng->txt('evaluation_access'), "evaluation_access");
         $option = new ilCheckboxOption($this->lng->txt("evaluation_access_off"), ilObjSurvey::EVALUATION_ACCESS_OFF, '');
         $option->setInfo($this->lng->txt("svy_evaluation_access_off_info"));
         $evaluation_access->addOption($option);
         $option = new ilCheckboxOption($this->lng->txt("evaluation_access_all"), ilObjSurvey::EVALUATION_ACCESS_ALL, '');
         $option->setInfo($this->lng->txt("svy_evaluation_access_all_info"));
         $evaluation_access->addOption($option);
         $option = new ilCheckboxOption($this->lng->txt("evaluation_access_participants"), ilObjSurvey::EVALUATION_ACCESS_PARTICIPANTS, '');
         $option->setInfo($this->lng->txt("svy_evaluation_access_participants_info"));
         $evaluation_access->addOption($option);
         $evaluation_access->setValue($this->object->getEvaluationAccess());
         $form->addItem($evaluation_access);
         $anonymization_options = new ilRadioGroupInputGUI($this->lng->txt("survey_results_anonymization"), "anonymization_options");
         $option = new ilCheckboxOption($this->lng->txt("survey_results_personalized"), "statpers");
         $option->setInfo($this->lng->txt("survey_results_personalized_info"));
         $anonymization_options->addOption($option);
         $option = new ilCheckboxOption($this->lng->txt("survey_results_anonymized"), "statanon");
         $option->setInfo($this->lng->txt("survey_results_anonymized_info"));
         $anonymization_options->addOption($option);
         $anonymization_options->setValue($this->object->hasAnonymizedResults() ? "statanon" : "statpers");
         $form->addItem($anonymization_options);
         if ($this->object->_hasDatasets($this->object->getSurveyId())) {
             $anonymization_options->setDisabled(true);
         }
     } else {
         $ts_results = new ilRadioGroupInputGUI($this->lng->txt("survey_360_results"), "ts_res");
         $ts_results->setValue($this->object->get360Results());
         $option = new ilRadioOption($this->lng->txt("survey_360_results_none"), ilObjSurvey::RESULTS_360_NONE);
         $option->setInfo($this->lng->txt("survey_360_results_none_info"));
         $ts_results->addOption($option);
         $option = new ilRadioOption($this->lng->txt("survey_360_results_own"), ilObjSurvey::RESULTS_360_OWN);
         $option->setInfo($this->lng->txt("survey_360_results_own_info"));
         $ts_results->addOption($option);
         $option = new ilRadioOption($this->lng->txt("survey_360_results_all"), ilObjSurvey::RESULTS_360_ALL);
         $option->setInfo($this->lng->txt("survey_360_results_all_info"));
         $ts_results->addOption($option);
         $form->addItem($ts_results);
     }
     // competence service activation for 360 mode
     include_once "./Services/Skill/classes/class.ilSkillManagementSettings.php";
     $skmg_set = new ilSkillManagementSettings();
     if ($this->object->get360Mode() && $skmg_set->isActivated()) {
         $other = new ilFormSectionHeaderGUI();
         $other->setTitle($this->lng->txt("other"));
         $form->addItem($other);
         $skill_service = new ilCheckboxInputGUI($this->lng->txt("survey_activate_skill_service"), "skill_service");
         $skill_service->setInfo($this->lng->txt("survey_activate_skill_service_info"));
         $skill_service->setChecked($this->object->get360SkillService());
         $form->addItem($skill_service);
     }
     $form->addCommandButton("saveProperties", $this->lng->txt("save"));
     // remove items when using template
     if ($template_settings) {
         foreach ($template_settings as $id => $item) {
             if ($item["hide"]) {
                 $form->removeItemByPostVar($id);
             }
         }
     }
     return $form;
 }
 public function initFilter()
 {
     include_once 'Services/Form/classes/class.ilTextInputGUI.php';
     $ul = new ilTextInputGUI($this->lng->txt('login') . '/' . $this->lng->txt('email') . '/' . $this->lng->txt('name'), 'query');
     $ul->setDataSource($this->ctrl->getLinkTarget($this->getParentObject(), 'lookupAddressbookAsync', '', true));
     $ul->setSize(20);
     $ul->setSubmitFormOnEnter(true);
     $this->addFilterItem($ul);
     $ul->readFromSession();
     $this->filter['query'] = $ul->getValue();
 }
 public function initFormSearch()
 {
     global $ilCtrl;
     include_once './Services/Form/classes/class.ilPropertyFormGUI.php';
     $this->form = new ilPropertyFormGUI();
     $this->form->setFormAction($this->ctrl->getFormAction($this, 'search'));
     $this->form->setTitle($this->getTitle());
     $this->form->addCommandButton('performSearch', $this->lng->txt('search'));
     $this->form->addCommandButton('cancel', $this->lng->txt('cancel'));
     $kind = new ilRadioGroupInputGUI($this->lng->txt('search_type'), 'search_for');
     $kind->setValue($this->search_type);
     $this->form->addItem($kind);
     // Users
     $users = new ilRadioOption($this->lng->txt('search_for_users'), 'usr');
     // UDF
     include_once 'Services/Search/classes/class.ilUserSearchOptions.php';
     foreach (ilUserSearchOptions::_getSearchableFieldsInfo(!$this->isSearchableCheckEnabled()) as $info) {
         switch ($info['type']) {
             case FIELD_TYPE_UDF_SELECT:
             case FIELD_TYPE_SELECT:
                 $sel = new ilSelectInputGUI($info['lang'], "rep_query[usr][" . $info['db'] . "]");
                 $sel->setOptions($info['values']);
                 $users->addSubItem($sel);
                 break;
             case FIELD_TYPE_UDF_TEXT:
             case FIELD_TYPE_TEXT:
                 if (isset($info['autoComplete']) and $info['autoComplete']) {
                     $ilCtrl->setParameterByClass(get_class($this), 'autoCompleteField', $info['db']);
                     $ul = new ilTextInputGUI($info['lang'], "rep_query[usr][" . $info['db'] . "]");
                     $ul->setDataSource($ilCtrl->getLinkTarget($this, "doUserAutoComplete", "", true));
                     $ul->setSize(30);
                     $ul->setMaxLength(120);
                     $users->addSubItem($ul);
                 } else {
                     $txt = new ilTextInputGUI($info['lang'], "rep_query[usr][" . $info['db'] . "]");
                     $txt->setSize(30);
                     $txt->setMaxLength(120);
                     $users->addSubItem($txt);
                 }
                 break;
         }
     }
     $kind->addOption($users);
     // Role
     $roles = new ilRadioOption($this->lng->txt('search_for_role_members'), 'role');
     $role = new ilTextInputGUI($this->lng->txt('search_role_title'), 'rep_query[role][title]');
     $role->setSize(30);
     $role->setMaxLength(120);
     $roles->addSubItem($role);
     $kind->addOption($roles);
     // Course
     $groups = new ilRadioOption($this->lng->txt('search_for_crs_members'), 'crs');
     $group = new ilTextInputGUI($this->lng->txt('search_crs_title'), 'rep_query[crs][title]');
     $group->setSize(30);
     $group->setMaxLength(120);
     $groups->addSubItem($group);
     $kind->addOption($groups);
     // Group
     $groups = new ilRadioOption($this->lng->txt('search_for_grp_members'), 'grp');
     $group = new ilTextInputGUI($this->lng->txt('search_grp_title'), 'rep_query[grp][title]');
     $group->setSize(30);
     $group->setMaxLength(120);
     $groups->addSubItem($group);
     $kind->addOption($groups);
 }
Ejemplo n.º 20
0
 public function showAddressForm()
 {
     /**
      * @var $lng ilLanguage
      * @var $ilSetting ilSetting
      */
     global $lng, $ilSetting;
     $this->tpl->setTitle($this->lng->txt("mail_addressbook"));
     $this->tpl->addBlockFile("ADM_CONTENT", "adm_content", "tpl.mail_addressbook_form.html", "Services/Contact");
     include_once "./Services/Form/classes/class.ilPropertyFormGUI.php";
     $form = new ilPropertyFormGUI();
     $form->setTitle($_GET['addr_id'] ? $lng->txt("mail_edit_entry") : $lng->txt("mail_new_entry"));
     if ($_GET['addr_id']) {
         $this->ctrl->setParameter($this, 'addr_id', $_GET['addr_id']);
     }
     $entry = $this->abook->getEntry($_GET['addr_id']);
     $form->setFormAction($this->ctrl->getFormAction($this, "saveEntry"));
     $login = new ilTextInputGUI($this->lng->txt("username"), "login");
     $login->setValue(isset($_POST['login']) ? ilUtil::prepareFormOutput($_POST['login'], true) : ilUtil::prepareFormOutput($entry['login']));
     $login->setDataSource($this->ctrl->getLinkTarget($this, 'lookupUsersAsync', '', true));
     $form->addItem($login);
     if ($ilSetting->get('cron_upd_adrbook', 0)) {
         $formItem = new ilCheckboxInputGUI('', 'auto_update');
         $formItem->setChecked(isset($_POST['auto_update']) ? ilUtil::prepareFormOutput($_POST['auto_update'], true) : ilUtil::prepareFormOutput($entry['auto_update']));
         $formItem->setInfo($this->lng->txt('cron_update_addressbook'));
         $login->addSubItem($formItem);
     }
     $formItem = new ilTextInputGUI($this->lng->txt("firstname"), "firstname");
     $formItem->setValue(isset($_POST['firstname']) ? ilUtil::prepareFormOutput($_POST['firstname'], true) : ilUtil::prepareFormOutput($entry['firstname']));
     $form->addItem($formItem);
     $formItem = new ilTextInputGUI($this->lng->txt("lastname"), "lastname");
     $formItem->setValue(isset($_POST['lastname']) ? ilUtil::prepareFormOutput($_POST['lastname'], true) : ilUtil::prepareFormOutput($entry['lastname']));
     $form->addItem($formItem);
     $formItem = new ilTextInputGUI($this->lng->txt("email"), "email");
     $formItem->setValue(isset($_POST['email']) ? ilUtil::prepareFormOutput($_POST['email'], true) : ilUtil::prepareFormOutput($entry['email']));
     $formItem->setDataSource($this->ctrl->getLinkTarget($this, 'lookupEmailsAsync', '', true));
     $form->addItem($formItem);
     $form->addCommandButton('saveEntry', $this->lng->txt('save'));
     $form->addCommandButton('cancel', $this->lng->txt('cancel'));
     $this->tpl->setVariable('FORM', $form->getHTML());
     $this->tpl->show();
     return true;
 }