3 declare(strict_types=1);
    50         $this->main_tpl = $DIC->ui()->mainTemplate();
    52         $this->rbacsystem = $DIC->rbac()->system();
    59         $this->feature_config = $this->domain_service->modeFeatureConfig($survey->
getMode());
    65         $lng = $this->ui_service->lng();
    72             if ($feature_config->supportsTutorNotification()) {
    78                         $tut_ids->setAlert(
$lng->txt(
"survey_notification_tutor_recipients_invalid"));
    84                     if (!$end->getDate()) {
    86                         $tut_res->setAlert(
$lng->txt(
"svy_notification_tutor_results_alert"));
    94                         $tut_res_ids->setAlert(
$lng->txt(
"survey_notification_tutor_recipients_invalid"));
   114         $tut_logins = $form->
getInput(
"tut_ids");
   115         foreach ($tut_logins as $tut_login) {
   117             if ($tut_id && $rbacsystem->checkAccessOfUser($tut_id, 
"write", $survey->getRefId())) {
   118                 $tut_ids[] = $tut_id;
   133         $tut_res_ids = array();
   134         $tut_logins = $form->
getInput(
"tut_res_ids");
   135         foreach ($tut_logins as $tut_login) {
   137             if ($tut_id && $rbacsystem->checkAccessOfUser($tut_id, 
"write", $survey->getRefId())) {
   138                 $tut_res_ids[] = $tut_id;
   151         $ctrl = $this->ui_service->ctrl();
   152         $lng = $this->ui_service->lng();
   154         $form = new \ilPropertyFormGUI();
   155         $form->setFormAction($ctrl->getFormActionByClass(
   158         $form->setId(
"survey_properties");
   171         $form->addCommandButton(
"saveProperties", 
$lng->txt(
"save"));
   183         $lng = $this->ui_service->lng();
   187         $header = new \ilFormSectionHeaderGUI();
   188         $header->setTitle(
$lng->txt(
"settings"));
   195         $title = new \ilTextInputGUI(
$lng->txt(
"title"), 
"title");
   196         $title->setRequired(
true);
   197         $title->setValue($survey->getTitle());
   204         $desc = new \ilTextAreaInputGUI(
$lng->txt(
"description"), 
"description");
   206         $desc->setValue($survey->getLongDescription());
   211         $pool_usage = new \ilRadioGroupInputGUI(
$lng->txt(
"survey_question_pool_usage"), 
"use_pool");
   212         $opt = new \ilRadioOption(
$lng->txt(
"survey_question_pool_usage_active"), 
"1");
   213         $opt->setInfo(
$lng->txt(
"survey_question_pool_usage_active_info"));
   214         $pool_usage->addOption($opt);
   215         $opt = new \ilRadioOption(
$lng->txt(
"survey_question_pool_usage_inactive"), 
"0");
   216         $opt->setInfo(
$lng->txt(
"survey_question_pool_usage_inactive_info"));
   217         $pool_usage->addOption($opt);
   218         $pool_usage->setValue((
string) (
int) $survey->getPoolUsage());
   221         if ($feature_config->usesAppraisees()) {
   222             $self_rate = new \ilCheckboxInputGUI(
$lng->txt(
"survey_360_self_raters"), 
"self_rate");
   223             $self_rate->setInfo(
$lng->txt(
"survey_360_self_raters_info"));
   224             $self_rate->setChecked($survey->get360SelfRaters());
   227             $self_appr = new \ilCheckboxInputGUI(
$lng->txt(
"survey_360_self_appraisee"), 
"self_appr");
   228             $self_appr->setInfo(
$lng->txt(
"survey_360_self_appraisee_info"));
   229             $self_appr->setChecked($survey->get360SelfAppraisee());
   233         foreach ($this->modifier->getSurveySettingsGeneral($survey) as $item) {
   246         $lng = $this->ui_service->lng();
   250         $lng->loadLanguageModule(
'rep');
   252         $section = new \ilFormSectionHeaderGUI();
   253         $section->setTitle(
$lng->txt(
'rep_activation_availability'));
   257         $act_obj_info = $act_ref_info = 
"";
   259             $act_obj_info = 
' ' . 
$lng->txt(
'rep_activation_online_object_info');
   260             $act_ref_info = 
$lng->txt(
'rep_activation_access_ref_info');
   263         $online = new \ilCheckboxInputGUI(
$lng->txt(
'rep_activation_online'), 
'online');
   264         $online->setInfo(
$lng->txt(
'svy_activation_online_info') . $act_obj_info);
   265         $online->setChecked(!$survey->getOfflineStatus());
   268         $dur = new \ilDateDurationInputGUI(
$lng->txt(
'rep_time_based_availability'), 
"access_period");
   269         $dur->setShowTime(
true);
   270         $date = $survey->getActivationStartDate();
   274         $date = $survey->getActivationEndDate();
   280         $visible = new \ilCheckboxInputGUI(
$lng->txt(
'rep_activation_limited_visibility'), 
'access_visiblity');
   281         $visible->setInfo(
$lng->txt(
'svy_activation_limited_visibility_info'));
   282         $visible->setChecked($survey->getActivationVisibility());
   283         $dur->addSubItem($visible);
   296         $lng = $this->ui_service->lng();
   299         $section = new \ilFormSectionHeaderGUI();
   300         $section->setTitle(
$lng->txt(
'obj_presentation'));
   304         $obj_service->commonSettings()->legacyForm($form, $survey)->addTileImage();
   316         $lng = $this->ui_service->lng();
   318         $section = new \ilFormSectionHeaderGUI();
   319         $section->setTitle(
$lng->txt(
'svy_settings_section_before_start'));
   323         $intro = new \ilTextAreaInputGUI(
$lng->txt(
"introduction"), 
"introduction");
   324         $intro->setValue($survey->prepareTextareaOutput($survey->getIntroduction()));
   327         $intro->setInfo(
$lng->txt(
"survey_introduction_info"));
   329             $intro->setUseRte(
true);
   331             $intro->addPlugin(
"latex");
   332             $intro->addButton(
"latex");
   333             $intro->addButton(
"pastelatex");
   334             $intro->setRTESupport($survey->getId(), 
"svy", 
"survey", null);
   348         $lng = $this->ui_service->lng();
   353         $section = new \ilFormSectionHeaderGUI();
   354         $section->setTitle(
$lng->txt(
'svy_settings_section_access'));
   358         $start = $survey->getStartDate();
   360         $startingtime = new \ilDateTimeInputGUI(
$lng->txt(
"start_date"), 
'start_date');
   361         $startingtime->setShowTime(
true);
   368         $end = $survey->getEndDate();
   370         $endingtime = new \ilDateTimeInputGUI(
$lng->txt(
"end_date"), 
'end_date');
   371         $endingtime->setShowTime(
true);
   378         if ($feature_config->supportsAccessCodes()) {
   379             $codes = new \ilCheckboxInputGUI(
$lng->txt(
"survey_access_codes"), 
"acc_codes");
   380             $codes->setInfo(
$lng->txt(
"survey_access_codes_info"));
   381             $codes->setChecked(!$survey->isAccessibleWithoutCode());
   385                 $codes->setDisabled(
true);
   399         $lng = $this->ui_service->lng();
   403         $section = new \ilFormSectionHeaderGUI();
   404         $section->setTitle(
$lng->txt(
'svy_settings_section_question_behaviour'));
   408         $show_question_titles = new \ilCheckboxInputGUI(
$lng->txt(
"svy_show_questiontitles"), 
"show_question_titles");
   409         $show_question_titles->setValue(
"1");
   410         $show_question_titles->setChecked($survey->getShowQuestionTitles());
   411         $form->
addItem($show_question_titles);
   424         $lng = $this->ui_service->lng();
   426         $ctrl = $this->ui_service->ctrl();
   427         $invitation_manager = $this->domain_service->participants()->invitations();
   431         $info = new \ilFormSectionHeaderGUI();
   432         $info->setTitle(
$lng->txt(
"svy_settings_section_finishing"));
   435         $view_own = new \ilCheckboxInputGUI(
$lng->txt(
"svy_results_view_own"), 
"view_own");
   436         $view_own->setInfo(
$lng->txt(
"svy_results_view_own_info"));
   437         $view_own->setChecked($survey->hasViewOwnResults());
   440         $mail_confirm = new \ilCheckboxInputGUI(
$lng->txt(
"svy_results_mail_confirm"), 
"mail_confirm");
   441         $mail_confirm->setInfo(
$lng->txt(
"svy_results_mail_confirm_info"));
   442         $mail_confirm->setChecked($survey->hasMailConfirmation());
   445         $mail_own = new \ilCheckboxInputGUI(
$lng->txt(
"svy_results_mail_own"), 
"mail_own");
   446         $mail_own->setInfo(
$lng->txt(
"svy_results_mail_own_info"));
   447         $mail_own->setChecked($survey->hasMailOwnResults());
   448         $mail_confirm->addSubItem($mail_own);
   451         $finalstatement = new \ilTextAreaInputGUI(
$lng->txt(
"outro"), 
"outro");
   452         $finalstatement->setValue($survey->prepareTextareaOutput($survey->getOutro()));
   453         $finalstatement->setRows(10);
   454         $finalstatement->setCols(80);
   456             $finalstatement->setUseRte(
true);
   458             $finalstatement->addPlugin(
"latex");
   459             $finalstatement->addButton(
"latex");
   460             $finalstatement->addButton(
"pastelatex");
   461             $finalstatement->setRTESupport($survey->getId(), 
"svy", 
"survey", null);
   463         $form->
addItem($finalstatement);
   466         $mailnotification = new \ilCheckboxInputGUI(
$lng->txt(
"mailnotification"), 
"mailnotification");
   468         $mailnotification->setInfo(
$lng->txt(
"svy_result_mail_notification_info")); 
   469         $mailnotification->setValue(
"1");
   470         $mailnotification->setChecked($survey->getMailNotification());
   473         $mailaddresses = new \ilTextInputGUI(
$lng->txt(
"survey_notification_tutor_recipients"), 
"mailaddresses");
   474         $mailaddresses->setValue($survey->getMailAddresses());
   475         $mailaddresses->setSize(80);
   476         $mailaddresses->setInfo(
$lng->txt(
'mailaddresses_info'));
   477         $mailaddresses->setRequired(
true);
   480         $participantdata = new \ilTextAreaInputGUI(
$lng->txt(
"mailparticipantdata"), 
"mailparticipantdata");
   481         $participantdata->setValue($survey->getMailParticipantData());
   482         $participantdata->setRows(6);
   483         $participantdata->setCols(80);
   484         $participantdata->setUseRte(
false);
   485         $participantdata->setInfo(
$lng->txt(
"mailparticipantdata_info"));
   488         $placeholders = array(
   489             "FIRST_NAME" => 
"firstname",
   490             "LAST_NAME" => 
"lastname",
   494         foreach ($placeholders as $placeholder => $caption) {
   495             $txt[] = 
"[" . strtoupper($placeholder) . 
"]: " . 
$lng->txt($caption);
   498         $participantdatainfo = new \ilNonEditableValueGUI(
$lng->txt(
"svy_placeholders_label"), 
"", 
true);
   499         $participantdatainfo->setValue(
$lng->txt(
"mailparticipantdata_placeholder") . 
"<br />" . 
$txt);
   501         $mailnotification->addSubItem($mailaddresses);
   502         $mailnotification->addSubItem($participantdata);
   503         $mailnotification->addSubItem($participantdatainfo);
   504         $form->
addItem($mailnotification);
   507         if ($feature_config->supportsTutorNotification()) {
   508             $num_inv = count($invitation_manager->getAllForSurvey($survey->getSurveyId()));
   511             $tut = new \ilCheckboxInputGUI(
$lng->txt(
"survey_notification_tutor_setting"), 
"tut");
   512             $tut->setChecked($survey->getTutorNotificationStatus());
   515             $tut_logins = array();
   516             $tuts = $survey->getTutorNotificationRecipients();
   518                 foreach ($tuts as $tut_id) {
   521                         $tut_logins[] = $tmp[
"login"];
   525             $tut_ids = new \ilTextInputGUI(
$lng->txt(
"survey_notification_tutor_recipients"), 
"tut_ids");
   526             $tut_ids->setDataSource($ctrl->getLinkTargetByClass($target_class, 
"doAutoComplete", 
"", 
true));
   527             $tut_ids->setRequired(
true);
   528             $tut_ids->setMulti(
true);
   529             $tut_ids->setMultiValues($tut_logins);
   530             $tut_ids->setValue(array_shift($tut_logins));
   531             $tut->addSubItem($tut_ids);
   534             $tut_grp = new \ilRadioGroupInputGUI(
$lng->txt(
"survey_notification_target_group"), 
"tut_grp");
   535             $tut_grp->setRequired(
true);
   536             $tut_grp->setValue((
string) $survey->getTutorNotificationTarget());
   537             $tut->addSubItem($tut_grp);
   540             $tut_grp_crs = new \ilRadioOption(
   541                 $lng->txt(
"survey_notification_target_group_parent_course"),
   545                 $tut_grp_crs->setInfo(
$lng->txt(
"survey_notification_target_group_parent_course_inactive"));
   547                 $tut_grp_crs->setInfo(sprintf(
   548                     $lng->txt(
"survey_notification_target_group_invited_info"),
   549                     count($survey->getNotificationTargetUserIds(
false))
   552             $tut_grp->addOption($tut_grp_crs);
   555             $tut_grp_inv = new \ilRadioOption(
   556                 $lng->txt(
"survey_notification_target_group_invited"),
   559             $tut_grp_inv->setInfo(sprintf(
$lng->txt(
"survey_notification_target_group_invited_info"), $num_inv));
   560             $tut_grp->addOption($tut_grp_inv);
   604         $tree = $this->domain_service->repositoryTree();
   605         $has_parent = $tree->checkForParentType($survey->getRefId(), 
"grp");
   607             $has_parent = $tree->checkForParentType($survey->getRefId(), 
"crs");
   609         return (
bool) $has_parent;
   619         $lng = $this->ui_service->lng();
   621         $invitation_manager = $this->domain_service->participants()->invitations();
   625         $info = new \ilFormSectionHeaderGUI();
   626         $info->setTitle(
$lng->txt(
"svy_settings_section_reminders"));
   629         $rmd = new \ilCheckboxInputGUI(
$lng->txt(
"survey_reminder_setting"), 
"rmd");
   630         $rmd->setChecked($survey->getReminderStatus());
   633         $rmd_start = new \ilDateTimeInputGUI(
$lng->txt(
"survey_reminder_start"), 
"rmd_start");
   634         $rmd_start->setRequired(
true);
   635         $start = $survey->getReminderStart();
   637             $rmd_start->setDate($start);
   639         $rmd->addSubItem($rmd_start);
   641         $end = $survey->getReminderEnd();
   642         $rmd_end = new \ilDateTimeInputGUI(
$lng->txt(
"survey_reminder_end"), 
"rmd_end");
   644             $rmd_end->setDate($end);
   646         $rmd->addSubItem($rmd_end);
   648         $rmd_freq = new \ilNumberInputGUI(
$lng->txt(
"survey_reminder_frequency"), 
"rmd_freq");
   649         $rmd_freq->setRequired(
true);
   650         $rmd_freq->setSize(3);
   651         $rmd_freq->setSuffix(
$lng->txt(
"survey_reminder_frequency_days"));
   652         $rmd_freq->setValue((
string) $survey->getReminderFrequency());
   653         $rmd_freq->setMinValue(1);
   654         $rmd->addSubItem($rmd_freq);
   656         if ($feature_config->supportsMemberReminder()) {
   657             $rmd_grp = new \ilRadioGroupInputGUI(
$lng->txt(
"survey_notification_target_group"), 
"rmd_grp");
   658             $rmd_grp->setRequired(
true);
   659             $rmd_grp->setValue((
string) $survey->getReminderTarget());
   660             $rmd->addSubItem($rmd_grp);
   662             $rmd_grp_crs = new \ilRadioOption(
   663                 $lng->txt(
"survey_notification_target_group_parent_course"),
   667                 $rmd_grp_crs->setInfo(
$lng->txt(
"survey_notification_target_group_parent_course_inactive"));
   669                 $rmd_grp_crs->setInfo(sprintf(
   670                     $lng->txt(
"survey_notification_target_group_invited_info"),
   671                     count($survey->getNotificationTargetUserIds(
false))
   674             $rmd_grp->addOption($rmd_grp_crs);
   676             $rmd_grp_inv = new \ilRadioOption(
   677                 $lng->txt(
"survey_notification_target_group_invited"),
   680             $num_inv = count($invitation_manager->getAllForSurvey($survey->getSurveyId()));
   681             $rmd_grp_inv->setInfo(sprintf(
$lng->txt(
"survey_notification_target_group_invited_info"), $num_inv));
   682             $rmd_grp->addOption($rmd_grp_inv);
   684             $mtmpl = $survey->getReminderMailTemplates();
   686                 $rmdt = new \ilRadioGroupInputGUI(
$lng->txt(
"svy_reminder_mail_template"), 
"rmdt");
   687                 $rmdt->setRequired(
true);
   688                 $rmdt->addOption(
new \
ilRadioOption(
$lng->txt(
"svy_reminder_mail_template_none"), 
"-1"));
   689                 foreach ($mtmpl as $mtmpl_id => $mtmpl_caption) {
   690                     $option = new \ilRadioOption($mtmpl_caption, (
string) $mtmpl_id);
   691                     $rmdt->addOption($option);
   694                 $reminderTemplateValue = -1;
   695                 if ($survey->getReminderTemplate()) {
   696                     $reminderTemplateValue = $survey->getReminderTemplate();
   698                 $rmdt->setValue((
string) $reminderTemplateValue);
   699                 $rmd->addSubItem($rmdt);
   703         foreach ($this->modifier->getSurveySettingsReminderTargets(
   707             $rmd->addSubItem($item);
   719         $lng = $this->ui_service->lng();
   725         $results = new \ilFormSectionHeaderGUI();
   729         if ($feature_config->supportsSumScore()) {
   731             $sum_score = new \ilCheckboxInputGUI(
$lng->txt(
"survey_calculate_sum_score"), 
"calculate_sum_score");
   732             $sum_score->setInfo(
$lng->txt(
"survey_calculate_sum_score_info"));
   733             $sum_score->setValue(
"1");
   734             $sum_score->setChecked($survey->getCalculateSumScore());
   738         foreach ($this->modifier->getSurveySettingsResults(
   754         $lng = $this->ui_service->lng();
   762         $skmg_set = new \ilSkillManagementSettings();
   764         if ($feature_config->supportsCompetences() && $skmg_set->isActivated()) {
   765             $skill_service = new \ilCheckboxInputGUI(
$lng->txt(
"survey_activate_skill_service"), 
"skill_service");
   766             $skill_service->setInfo(
$lng->txt(
"survey_activate_skill_service_info"));
   767             $skill_service->setChecked($survey->getSkillService());
   768             $other_items[] = $skill_service;
   772             ->getObjectPositionSettingsByType($survey->getType());
   774         if (count($other_items) > 0 ||
   775             $position_settings->isActive()
   777             $feat = new \ilFormSectionHeaderGUI();
   778             $feat->setTitle(
$lng->txt(
'obj_features'));
   781             foreach ($other_items as $item) {
   786         if ($position_settings->isActive()) {
   806         $lng = $this->ui_service->lng();
   813                 $rmd_start = $rmd_end;
   816             $survey->setReminderStatus(
true);
   817             $survey->setReminderStart($rmd_start);
   818             $survey->setReminderEnd($rmd_end);
   819             $survey->setReminderFrequency((
int) $form->
getInput(
"rmd_freq"));
   820             if ($feature_config->supportsMemberReminder()) {
   821                 $survey->setReminderTarget((
int) $form->
getInput(
"rmd_grp"));
   822                 $survey->setReminderTemplate(($form->
getInput(
"rmdt") > 0)
   827             $survey->setReminderStatus(
false);
   830         if ($feature_config->supportsTutorNotification()) {
   834                 $survey->setTutorNotificationStatus(
true);
   835                 $survey->setTutorNotificationRecipients($tut_ids); 
   836                 $survey->setTutorNotificationTarget((
int) $form->
getInput(
"tut_grp"));
   838                 $survey->setTutorNotificationStatus(
false);
   852         if ($form->
getInput(
'online') && count($survey->questions) === 0) {
   853             $this->main_tpl->setOnScreenMessage(
'failure', 
$lng->txt(
"cannot_switch_to_online_no_questions"), 
true);
   855             $survey->setOfflineStatus(!$form->
getInput(
'online'));
   858         $survey->setViewOwnResults((
bool) $form->
getInput(
"view_own"));
   859         $survey->setMailOwnResults((
bool) $form->
getInput(
"mail_own"));
   860         $survey->setMailConfirmation((
bool) $form->
getInput(
"mail_confirm"));
   863         $survey->setTitle($form->
getInput(
'title'));
   864         $survey->setDescription($form->
getInput(
'description'));
   869         if ($period->getStart() && $period->getEnd()) {
   870             $survey->setActivationLimited(
true);
   871             $survey->setActivationVisibility((
bool) $form->
getInput(
"access_visiblity"));
   872             $survey->setActivationStartDate($period->getStart()->get(
IL_CAL_UNIX));
   873             $survey->setActivationEndDate($period->getEnd()->get(
IL_CAL_UNIX));
   875             $survey->setActivationLimited(
false);
   879         $obj_service->commonSettings()->legacyForm($form, $survey)->saveTileImage();
   882         if ($start->getDate()) {
   886             $survey->setStartDate(
"");
   890         if ($end->getDate()) {
   894             $survey->setEndDate(
"");
   896         $survey->setIntroduction($form->
getInput(
"introduction"));
   897         $survey->setOutro($form->
getInput(
"outro"));
   898         $survey->setShowQuestionTitles((
bool) $form->
getInput(
"show_question_titles"));
   899         $survey->setPoolUsage((
bool) $form->
getInput(
"use_pool"));
   902         $survey->setMailNotification((
bool) $form->
getInput(
'mailnotification'));
   903         $survey->setMailAddresses($form->
getInput(
'mailaddresses'));
   904         $survey->setMailParticipantData($form->
getInput(
'mailparticipantdata'));
   906         if ($feature_config->usesAppraisees()) {
   907             $survey->set360SelfAppraisee((
bool) $form->
getInput(
"self_appr"));
   908             $survey->set360SelfRaters((
bool) $form->
getInput(
"self_rate"));
   911         if ($feature_config->supportsCompetences()) {
   912             $survey->setSkillService((
bool) $form->
getInput(
"skill_service"));
   915         foreach ($this->modifier->getSurveySettingsResults(
   919             $this->modifier->setValuesFromForm($survey, $form);
 
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
 
static _hasDatasets(int $survey_id)
 
static _getRichTextEditor()
Returns the identifier for the Rich Text Editor. 
 
Survey internal ui service. 
 
static _getAllReferences(int $id)
get all reference ids for object ID 
 
static _lookupName(int $a_user_id)
lookup user name 
 
static _lookupId($a_user_str)
 
static updateServiceSettingsForm(int $obj_id, ilPropertyFormGUI $form, array $services)
 
const NOTIFICATION_PARENT_COURSE
 
const NOTIFICATION_INVITED_USERS
 
static initServiceSettingsForm(int $obj_id, ilPropertyFormGUI $form, array $services)
 
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
 
const ORGU_POSITION_ACCESS
 
static _getUsedHTMLTags(string $a_module="")
Returns an array of all allowed HTML tags for text editing.