ILIAS  release_8 Revision v8.24
ILIAS\Survey\Settings\SettingsFormGUI Class Reference

Settings form. More...

+ Collaboration diagram for ILIAS\Survey\Settings\SettingsFormGUI:

Public Member Functions

 __construct (InternalGUIService $ui_service, InternalDomainService $domain_service, \ilObjectServiceInterface $object_service, \ilObjSurvey $survey, UIModifier $modifier)
 
 checkForm (\ilPropertyFormGUI $form)
 
 getForm (string $target_class)
 
 withGeneral (\ilPropertyFormGUI $form)
 add general section More...
 
 withActivation (\ilPropertyFormGUI $form)
 add activation section More...
 
 withPresentation (\ilPropertyFormGUI $form)
 add presentation section More...
 
 withBeforeStart (\ilPropertyFormGUI $form)
 add "before start" section More...
 
 withAccess (\ilPropertyFormGUI $form)
 add access section More...
 
 withQuestionBehaviour (\ilPropertyFormGUI $form)
 add question behaviour section More...
 
 withAfterEnd (\ilPropertyFormGUI $form, string $target_class)
 add "after ending" section More...
 
 withReminders (\ilPropertyFormGUI $form)
 add reminders section More...
 
 withResults (\ilPropertyFormGUI $form)
 add results section More...
 
 withOther (\ilPropertyFormGUI $form)
 add "other" section More...
 
 saveForm (\ilPropertyFormGUI $form)
 

Protected Member Functions

 getTutorIdsFromForm (\ilPropertyFormGUI $form)
 
 getTutorResIdsFromForm (\ilPropertyFormGUI $form)
 
 hasGroupCourseParent ()
 Check for group course parent. More...
 

Protected Attributes

InternalGUIService $ui_service
 
ilObjectServiceInterface $object_service
 
ilObjSurvey $survey
 
UIModifier $modifier
 
InternalDomainService $domain_service
 
ILIAS Survey Mode FeatureConfig $feature_config
 
ilRbacSystem $rbacsystem
 

Private Attributes

ilGlobalTemplateInterface $main_tpl
 

Detailed Description

Settings form.

Author
Alexander Killing killi.nosp@m.ng@l.nosp@m.eifos.nosp@m..de

Definition at line 31 of file class.SettingsFormGUI.php.

Constructor & Destructor Documentation

◆ __construct()

ILIAS\Survey\Settings\SettingsFormGUI::__construct ( InternalGUIService  $ui_service,
InternalDomainService  $domain_service,
\ilObjectServiceInterface  $object_service,
\ilObjSurvey  $survey,
UIModifier  $modifier 
)

Definition at line 42 of file class.SettingsFormGUI.php.

48 {
49 global $DIC;
50 $this->main_tpl = $DIC->ui()->mainTemplate();
51
52 $this->rbacsystem = $DIC->rbac()->system();
53
54 $this->survey = $survey;
55 $this->object_service = $object_service;
56 $this->ui_service = $ui_service;
57 $this->domain_service = $domain_service;
58 $this->modifier = $modifier;
59 $this->feature_config = $this->domain_service->modeFeatureConfig($survey->getMode());
60 }
global $DIC
Definition: feed.php:28

References $DIC, ILIAS\Survey\Settings\SettingsFormGUI\$domain_service, ILIAS\Survey\Settings\SettingsFormGUI\$modifier, ILIAS\Survey\Settings\SettingsFormGUI\$object_service, ILIAS\Survey\Settings\SettingsFormGUI\$survey, ILIAS\Survey\Settings\SettingsFormGUI\$ui_service, and ilObjSurvey\getMode().

+ Here is the call graph for this function:

Member Function Documentation

◆ checkForm()

ILIAS\Survey\Settings\SettingsFormGUI::checkForm ( \ilPropertyFormGUI  $form)

Definition at line 62 of file class.SettingsFormGUI.php.

62 : bool
63 {
65 $lng = $this->ui_service->lng();
66
67 $valid = false;
68
69 if ($form->checkInput()) {
70 $valid = true;
71
72 if ($feature_config->supportsTutorNotification()) {
73 if ($form->getInput("tut")) {
74 $tut_ids = $this->getTutorIdsFromForm($form);
75 // check if given "tutors" have write permission
76 if (!$tut_ids) {
77 $tut_ids = $form->getItemByPostVar("tut_ids");
78 $tut_ids->setAlert($lng->txt("survey_notification_tutor_recipients_invalid"));
79 $valid = false;
80 }
81 }
82 if ($form->getInput("tut_res")) {
83 $end = $form->getItemByPostVar("end_date");
84 if (!$end->getDate()) {
85 $tut_res = $form->getItemByPostVar("tut_res");
86 $tut_res->setAlert($lng->txt("svy_notification_tutor_results_alert"));
87 $valid = false;
88 }
89
90 // check if given "tutors" have write permission
91 $tut_res_ids = $this->getTutorResIdsFromForm($form);
92 if (!$tut_res_ids) {
93 $tut_res_ids = $form->getItemByPostVar("tut_res_ids");
94 $tut_res_ids->setAlert($lng->txt("survey_notification_tutor_recipients_invalid"));
95 $valid = false;
96 }
97 }
98 }
99 }
100
101 return $valid;
102 }
getTutorResIdsFromForm(\ilPropertyFormGUI $form)
ILIAS Survey Mode FeatureConfig $feature_config
$valid
$lng

References ILIAS\Survey\Settings\SettingsFormGUI\$feature_config, $lng, $valid, ilPropertyFormGUI\checkInput(), ilPropertyFormGUI\getInput(), ilPropertyFormGUI\getItemByPostVar(), ILIAS\Survey\Settings\SettingsFormGUI\getTutorIdsFromForm(), and ILIAS\Survey\Settings\SettingsFormGUI\getTutorResIdsFromForm().

+ Here is the call graph for this function:

◆ getForm()

ILIAS\Survey\Settings\SettingsFormGUI::getForm ( string  $target_class)
Exceptions

ilCtrlException

Exceptions

ilDateTimeException

Definition at line 148 of file class.SettingsFormGUI.php.

151 $ctrl = $this->ui_service->ctrl();
152 $lng = $this->ui_service->lng();
153
154 $form = new \ilPropertyFormGUI();
155 $form->setFormAction($ctrl->getFormActionByClass(
156 $target_class
157 ));
158 $form->setId("survey_properties");
159
160 $form = $this->withGeneral($form);
161 $form = $this->withActivation($form);
162 $form = $this->withPresentation($form);
163 $form = $this->withBeforeStart($form);
164 $form = $this->withAccess($form);
165 $form = $this->withQuestionBehaviour($form);
166 $form = $this->withAfterEnd($form, $target_class);
167 $form = $this->withReminders($form);
168 $form = $this->withResults($form);
169 $form = $this->withOther($form);
170
171 $form->addCommandButton("saveProperties", $lng->txt("save"));
172
173 return $form;
174 }
withAfterEnd(\ilPropertyFormGUI $form, string $target_class)
add "after ending" section
withGeneral(\ilPropertyFormGUI $form)
add general section
withAccess(\ilPropertyFormGUI $form)
add access section
withReminders(\ilPropertyFormGUI $form)
add reminders section
withResults(\ilPropertyFormGUI $form)
add results section
withActivation(\ilPropertyFormGUI $form)
add activation section
withBeforeStart(\ilPropertyFormGUI $form)
add "before start" section
withPresentation(\ilPropertyFormGUI $form)
add presentation section
withOther(\ilPropertyFormGUI $form)
add "other" section
withQuestionBehaviour(\ilPropertyFormGUI $form)
add question behaviour section
This class represents a property form user interface.

◆ getTutorIdsFromForm()

ILIAS\Survey\Settings\SettingsFormGUI::getTutorIdsFromForm ( \ilPropertyFormGUI  $form)
protected
Parameters
\ilPropertyFormGUI$form
Returns
array

Definition at line 108 of file class.SettingsFormGUI.php.

108 : array
109 {
112
113 $tut_ids = array();
114 $tut_logins = $form->getInput("tut_ids");
115 foreach ($tut_logins as $tut_login) {
116 $tut_id = \ilObjUser::_lookupId($tut_login);
117 if ($tut_id && $rbacsystem->checkAccessOfUser($tut_id, "write", $survey->getRefId())) {
118 $tut_ids[] = $tut_id;
119 }
120 }
121 return $tut_ids;
122 }
static _lookupId($a_user_str)
checkAccessOfUser(int $a_user_id, string $a_operations, int $a_ref_id, string $a_type="")

References ILIAS\Survey\Settings\SettingsFormGUI\$rbacsystem, ILIAS\Survey\Settings\SettingsFormGUI\$survey, ilObjUser\_lookupId(), ilRbacSystem\checkAccessOfUser(), ilPropertyFormGUI\getInput(), and ilObject\getRefId().

Referenced by ILIAS\Survey\Settings\SettingsFormGUI\checkForm().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getTutorResIdsFromForm()

ILIAS\Survey\Settings\SettingsFormGUI::getTutorResIdsFromForm ( \ilPropertyFormGUI  $form)
protected
Parameters
\ilPropertyFormGUI$form
Returns
array

Definition at line 128 of file class.SettingsFormGUI.php.

128 : array
129 {
132
133 $tut_res_ids = array();
134 $tut_logins = $form->getInput("tut_res_ids");
135 foreach ($tut_logins as $tut_login) {
136 $tut_id = \ilObjUser::_lookupId($tut_login);
137 if ($tut_id && $rbacsystem->checkAccessOfUser($tut_id, "write", $survey->getRefId())) {
138 $tut_res_ids[] = $tut_id;
139 }
140 }
141 return $tut_res_ids;
142 }

References ILIAS\Survey\Settings\SettingsFormGUI\$rbacsystem, ILIAS\Survey\Settings\SettingsFormGUI\$survey, ilObjUser\_lookupId(), ilRbacSystem\checkAccessOfUser(), ilPropertyFormGUI\getInput(), and ilObject\getRefId().

Referenced by ILIAS\Survey\Settings\SettingsFormGUI\checkForm().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ hasGroupCourseParent()

ILIAS\Survey\Settings\SettingsFormGUI::hasGroupCourseParent ( )
protected

Check for group course parent.

Definition at line 600 of file class.SettingsFormGUI.php.

600 : bool
601 {
603
604 $tree = $this->domain_service->repositoryTree();
605 $has_parent = $tree->checkForParentType($survey->getRefId(), "grp");
606 if (!$has_parent) {
607 $has_parent = $tree->checkForParentType($survey->getRefId(), "crs");
608 }
609 return (bool) $has_parent;
610 }

◆ saveForm()

ILIAS\Survey\Settings\SettingsFormGUI::saveForm ( \ilPropertyFormGUI  $form)

Definition at line 800 of file class.SettingsFormGUI.php.

802 : void {
805 $obj_service = $this->object_service;
806 $lng = $this->ui_service->lng();
807
808 if ($form->getInput("rmd")) {
809 $rmd_start = $form->getItemByPostVar("rmd_start")->getDate();
810 $rmd_end = $form->getItemByPostVar("rmd_end")->getDate();
811 if ($rmd_end && $rmd_start->get(IL_CAL_UNIX) > $rmd_end->get(IL_CAL_UNIX)) {
812 $tmp = $rmd_start;
813 $rmd_start = $rmd_end;
814 $rmd_end = $tmp;
815 }
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)
823 ? (int) $form->getInput("rmdt")
824 : null);
825 }
826 } else {
828 }
829
830 if ($feature_config->supportsTutorNotification()) {
831
832 // "one mail after all participants finished"
833 if ($form->getInput("tut")) {
834 $tut_ids = $this->getTutorIdsFromForm($form);
836 $survey->setTutorNotificationRecipients($tut_ids); // see above
837 $survey->setTutorNotificationTarget((int) $form->getInput("tut_grp"));
838 } else {
840 }
841
842 /*
843 if ($form->getInput("tut_res")) {
844 $tut_res_ids = $this->getTutorResIdsFromForm($form);
845 $survey->setTutorResultsStatus(true);
846 $survey->setTutorResultsRecipients($tut_res_ids); // see above
847 } else {
848 $survey->setTutorResultsStatus(false);
849 }*/
850 }
851
852 // #10055
853 if ($form->getInput('online') && count($survey->questions) === 0) {
854 $this->main_tpl->setOnScreenMessage('failure', $lng->txt("cannot_switch_to_online_no_questions"), true);
855 } else {
856 $survey->setOfflineStatus(!$form->getInput('online'));
857 }
858
859 $survey->setViewOwnResults((bool) $form->getInput("view_own"));
860 $survey->setMailOwnResults((bool) $form->getInput("mail_own"));
861 $survey->setMailConfirmation((bool) $form->getInput("mail_confirm"));
862
863 // both are saved in object, too
864 $survey->setTitle($form->getInput('title'));
865 $survey->setDescription($form->getInput('description'));
866 $survey->update();
867
868 // activation
869 $period = $form->getItemByPostVar("access_period");
870 if ($period->getStart() && $period->getEnd()) {
872 $survey->setActivationVisibility((bool) $form->getInput("access_visiblity"));
873 $survey->setActivationStartDate($period->getStart()->get(IL_CAL_UNIX));
874 $survey->setActivationEndDate($period->getEnd()->get(IL_CAL_UNIX));
875 } else {
877 }
878
879 // tile image
880 $obj_service->commonSettings()->legacyForm($form, $survey)->saveTileImage();
881
882 $start = $form->getItemByPostVar("start_date");
883 if ($start->getDate()) {
884 $datetime = explode(" ", $start->getDate()->get(IL_CAL_DATETIME));
885 $survey->setStartDateAndTime($datetime[0], $datetime[1]);
886 } else {
888 }
889
890 $end = $form->getItemByPostVar("end_date");
891 if ($end->getDate()) {
892 $datetime = explode(" ", $end->getDate()->get(IL_CAL_DATETIME));
893 $survey->setEndDateAndTime($datetime[0], $datetime[1]);
894 } else {
895 $survey->setEndDate("");
896 }
897 $survey->setIntroduction($form->getInput("introduction"));
898 $survey->setOutro($form->getInput("outro"));
899 $survey->setShowQuestionTitles((bool) $form->getInput("show_question_titles"));
900 $survey->setPoolUsage((bool) $form->getInput("use_pool"));
901
902 // "separate mail for each participant finished"
903 $survey->setMailNotification((bool) $form->getInput('mailnotification'));
904 $survey->setMailAddresses($form->getInput('mailaddresses'));
905 $survey->setMailParticipantData($form->getInput('mailparticipantdata'));
906
907 if ($feature_config->usesAppraisees()) {
908 $survey->set360SelfAppraisee((bool) $form->getInput("self_appr"));
909 $survey->set360SelfRaters((bool) $form->getInput("self_rate"));
910 }
911
912 if ($feature_config->supportsCompetences()) {
913 $survey->setSkillService((bool) $form->getInput("skill_service"));
914 }
915
916 foreach ($this->modifier->getSurveySettingsResults(
917 $survey,
918 $this->ui_service
919 ) as $item) {
920 $this->modifier->setValuesFromForm($survey, $form);
921 }
922
923 $survey->saveToDb();
924
926 $survey->getId(),
927 $form,
928 array(
930 )
931 );
932 }
const IL_CAL_UNIX
const IL_CAL_DATETIME
set360SelfAppraisee(bool $a_value)
setEndDateAndTime(string $end_date, string $end_time)
setStartDateAndTime(string $start_date, string $start_time)
setReminderStatus(bool $a_value)
update($a_upload=false)
setTutorNotificationStatus(bool $a_value)
Activates mail being sent to tutors after all participants have finished the survey.
setOutro(string $outro="")
setReminderTemplate(?int $a_value)
setSkillService(bool $a_val)
setIntroduction(string $introduction="")
setEndDate(string $end_date="")
setStartDate(string $start_date="")
setActivationEndDate(int $ending_time=null)
setReminderFrequency(int $a_value)
setShowQuestionTitles(bool $a_show)
setActivationVisibility(bool $a_value)
setMailNotification(bool $a_notification)
Activate mail to tutors each time a participant finishes the survey.
setTutorNotificationRecipients(array $a_value)
Set tutor recipients for "all participants have finished" mail.
setReminderTarget(int $a_value)
setMailParticipantData(string $a_data)
Set preceding text (incl.
setTutorNotificationTarget(int $a_value)
setMailConfirmation(bool $a_value)
setReminderStart(?ilDate $a_value=null)
setReminderEnd(?ilDate $a_value=null)
set360SelfRaters(bool $a_value)
setMailAddresses(string $a_addresses)
Set (Tutor) Recipients of "single participant has finished" mails.
setActivationLimited(bool $a_value)
setPoolUsage(bool $a_value)
setMailOwnResults(bool $a_value)
setActivationStartDate(int $starting_time=null)
setViewOwnResults(bool $a_value)
static updateServiceSettingsForm(int $obj_id, ilPropertyFormGUI $form, array $services)
setTitle(string $title)
setOfflineStatus(bool $status)
setDescription(string $desc)

References ILIAS\Survey\Mode\$feature_config, ilPropertyFormGUI\getInput(), ilPropertyFormGUI\getItemByPostVar(), IL_CAL_UNIX, and ILIAS\Survey\Mode\FeatureConfig\supportsMemberReminder().

+ Here is the call graph for this function:

◆ withAccess()

ILIAS\Survey\Settings\SettingsFormGUI::withAccess ( \ilPropertyFormGUI  $form)

add access section

Definition at line 344 of file class.SettingsFormGUI.php.

348 $lng = $this->ui_service->lng();
350
351 // access
352
353 $section = new \ilFormSectionHeaderGUI();
354 $section->setTitle($lng->txt('svy_settings_section_access'));
355 $form->addItem($section);
356
357 // enable start date
358 $start = $survey->getStartDate();
359 // start date
360 $startingtime = new \ilDateTimeInputGUI($lng->txt("start_date"), 'start_date');
361 $startingtime->setShowTime(true);
362 if ($start) {
363 $startingtime->setDate(new \ilDateTime($start, IL_CAL_TIMESTAMP));
364 }
365 $form->addItem($startingtime);
366
367 // enable end date
368 $end = $survey->getEndDate();
369 // end date
370 $endingtime = new \ilDateTimeInputGUI($lng->txt("end_date"), 'end_date');
371 $endingtime->setShowTime(true);
372 if ($end) {
373 $endingtime->setDate(new \ilDateTime($end, IL_CAL_TIMESTAMP));
374 }
375 $form->addItem($endingtime);
376
377 // anonymization
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());
382 $form->addItem($codes);
383
385 $codes->setDisabled(true);
386 }
387 }
388
389 return $form;
390 }
const IL_CAL_TIMESTAMP
@classDescription Date and time handling
static _hasDatasets(int $survey_id)

◆ withActivation()

ILIAS\Survey\Settings\SettingsFormGUI::withActivation ( \ilPropertyFormGUI  $form)

add activation section

Exceptions

ilDateTimeException

Definition at line 243 of file class.SettingsFormGUI.php.

246 $lng = $this->ui_service->lng();
248
249 // activation
250 $lng->loadLanguageModule('rep');
251
252 $section = new \ilFormSectionHeaderGUI();
253 $section->setTitle($lng->txt('rep_activation_availability'));
254 $form->addItem($section);
255
256 // additional info only with multiple references
257 $act_obj_info = $act_ref_info = "";
258 if (count(\ilObject::_getAllReferences($survey->getId())) > 1) {
259 $act_obj_info = ' ' . $lng->txt('rep_activation_online_object_info');
260 $act_ref_info = $lng->txt('rep_activation_access_ref_info');
261 }
262
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());
266 $form->addItem($online);
267
268 $dur = new \ilDateDurationInputGUI($lng->txt('rep_visibility_until'), "access_period");
269 $dur->setShowTime(true);
271 $dur->setStart($date
272 ? new \ilDateTime($date, IL_CAL_UNIX)
273 : null);
274 $date = $survey->getActivationEndDate();
275 $dur->setEnd($date
276 ? new \ilDateTime($date, IL_CAL_UNIX)
277 : null);
278 $form->addItem($dur);
279
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);
284
285 return $form;
286 }
static _getAllReferences(int $id)
get all reference ids for object ID

◆ withAfterEnd()

ILIAS\Survey\Settings\SettingsFormGUI::withAfterEnd ( \ilPropertyFormGUI  $form,
string  $target_class 
)

add "after ending" section

Definition at line 419 of file class.SettingsFormGUI.php.

424 $lng = $this->ui_service->lng();
426 $ctrl = $this->ui_service->ctrl();
427 $invitation_manager = $this->domain_service->participants()->invitations();
428
429 // finishing
430
431 $info = new \ilFormSectionHeaderGUI();
432 $info->setTitle($lng->txt("svy_settings_section_finishing"));
433 $form->addItem($info);
434
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());
438 $form->addItem($view_own);
439
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());
443 $form->addItem($mail_confirm);
444
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);
449
450 // final statement
451 $finalstatement = new \ilTextAreaInputGUI($lng->txt("outro"), "outro");
452 $finalstatement->setValue($survey->prepareTextareaOutput($survey->getOutro()));
453 $finalstatement->setRows(10);
454 $finalstatement->setCols(80);
455 if (\ilObjAdvancedEditing::_getRichTextEditor() === "tinymce") {
456 $finalstatement->setUseRte(true);
457 $finalstatement->setRteTags(\ilObjAdvancedEditing::_getUsedHTMLTags("survey"));
458 $finalstatement->addPlugin("latex");
459 $finalstatement->addButton("latex");
460 $finalstatement->addButton("pastelatex");
461 $finalstatement->setRTESupport($survey->getId(), "svy", "survey", null);
462 }
463 $form->addItem($finalstatement);
464
465 // mail notification
466 $mailnotification = new \ilCheckboxInputGUI($lng->txt("mailnotification"), "mailnotification");
467 // $mailnotification->setOptionTitle($lng->txt("activate"));
468 $mailnotification->setInfo($lng->txt("svy_result_mail_notification_info")); // #11762
469 $mailnotification->setValue("1");
470 $mailnotification->setChecked($survey->getMailNotification());
471
472 // addresses
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);
478
479 // participant data
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"));
486
487 // #12755 - because of privacy concerns we restrict user data to a minimum
488 $placeholders = array(
489 "FIRST_NAME" => "firstname",
490 "LAST_NAME" => "lastname",
491 "LOGIN" => "login"
492 );
493 $txt = array();
494 foreach ($placeholders as $placeholder => $caption) {
495 $txt[] = "[" . strtoupper($placeholder) . "]: " . $lng->txt($caption);
496 }
497 $txt = implode("<br />", $txt);
498 $participantdatainfo = new \ilNonEditableValueGUI($lng->txt("svy_placeholders_label"), "", true);
499 $participantdatainfo->setValue($lng->txt("mailparticipantdata_placeholder") . "<br />" . $txt);
500
501 $mailnotification->addSubItem($mailaddresses);
502 $mailnotification->addSubItem($participantdata);
503 $mailnotification->addSubItem($participantdatainfo);
504 $form->addItem($mailnotification);
505
506 // tutor notification - currently not available for 360°
507 if ($feature_config->supportsTutorNotification()) {
508 $num_inv = count($invitation_manager->getAllForSurvey($survey->getSurveyId()));
509
510 // notification, if "all participants" have finished the survey
511 $tut = new \ilCheckboxInputGUI($lng->txt("survey_notification_tutor_setting"), "tut");
512 $tut->setChecked($survey->getTutorNotificationStatus());
513 $form->addItem($tut);
514
515 $tut_logins = array();
517 if ($tuts) {
518 foreach ($tuts as $tut_id) {
519 $tmp = \ilObjUser::_lookupName((int) $tut_id);
520 if ($tmp["login"]) {
521 $tut_logins[] = $tmp["login"];
522 }
523 }
524 }
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);
532
533 // radio to define who are "all participants"
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);
538
539 // (a) ... the member of the parent group or course
540 $tut_grp_crs = new \ilRadioOption(
541 $lng->txt("survey_notification_target_group_parent_course"),
543 );
544 if (!$this->hasGroupCourseParent()) {
545 $tut_grp_crs->setInfo($lng->txt("survey_notification_target_group_parent_course_inactive"));
546 } else {
547 $tut_grp_crs->setInfo(sprintf(
548 $lng->txt("survey_notification_target_group_invited_info"),
550 ));
551 }
552 $tut_grp->addOption($tut_grp_crs);
553
554 // (b) ... all invited users
555 $tut_grp_inv = new \ilRadioOption(
556 $lng->txt("survey_notification_target_group_invited"),
558 );
559 $tut_grp_inv->setInfo(sprintf($lng->txt("survey_notification_target_group_invited_info"), $num_inv));
560 $tut_grp->addOption($tut_grp_inv);
561
562 /*
563 $tut_res = new \ilCheckboxInputGUI($lng->txt("svy_notification_tutor_results"), "tut_res");
564 $tut_res->setInfo($lng->txt("svy_notification_tutor_results_info"));
565 $tut_res->setChecked($survey->getTutorResultsStatus());
566 $form->addItem($tut_res);
567
568 $tut_res_logins = array();
569 $tuts = $survey->getTutorResultsRecipients();
570 if ($tuts) {
571 foreach ($tuts as $tut_id) {
572 $tmp = \ilObjUser::_lookupName((int) $tut_id);
573 if ($tmp["login"]) {
574 $tut_res_logins[] = $tmp["login"];
575 }
576 }
577 }
578 $tut_res_ids = new \ilTextInputGUI($lng->txt("survey_notification_tutor_recipients"), "tut_res_ids");
579 $tut_res_ids->setDataSource(
580 $ctrl->getLinkTargetByClass(
581 $target_class,
582 "doAutoComplete",
583 "",
584 true
585 )
586 );
587 $tut_res_ids->setRequired(true);
588 $tut_res_ids->setMulti(true);
589 $tut_res_ids->setMultiValues($tut_res_logins);
590 $tut_res_ids->setValue(array_shift($tut_res_logins));
591 $tut_res->addSubItem($tut_res_ids);*/
592 }
593
594 return $form;
595 }
hasGroupCourseParent()
Check for group course parent.
static _getRichTextEditor()
Returns the identifier for the Rich Text Editor.
static _getUsedHTMLTags(string $a_module="")
Returns an array of all allowed HTML tags for text editing.
prepareTextareaOutput(string $txt_output)
Prepares a string for a text area output in surveys.
getTutorNotificationRecipients()
Mail being sent to tutors after all participants have finished the survey?
const NOTIFICATION_INVITED_USERS
const NOTIFICATION_PARENT_COURSE
getTutorNotificationTarget()
Group that is checked for the "all participants have finished" mail Either a) all members of a parent...
getNotificationTargetUserIds(bool $a_use_invited)
These users must finish the survey to trigger the tutor notification "all users finished the survey" ...
getMailParticipantData()
Preceding text (incl.
getMailAddresses()
(Tutor) Recipients of "single participant has finished" mails
getMailNotification()
Send mail to tutors each time a participant finishes the survey?
static _lookupName(int $a_user_id)
lookup user name
$txt
Definition: error.php:13

◆ withBeforeStart()

ILIAS\Survey\Settings\SettingsFormGUI::withBeforeStart ( \ilPropertyFormGUI  $form)

add "before start" section

Definition at line 312 of file class.SettingsFormGUI.php.

316 $lng = $this->ui_service->lng();
317
318 $section = new \ilFormSectionHeaderGUI();
319 $section->setTitle($lng->txt('svy_settings_section_before_start'));
320 $form->addItem($section);
321
322 // introduction
323 $intro = new \ilTextAreaInputGUI($lng->txt("introduction"), "introduction");
325 $intro->setRows(10);
326 $intro->setCols(80);
327 $intro->setInfo($lng->txt("survey_introduction_info"));
328 if (\ilObjAdvancedEditing::_getRichTextEditor() === "tinymce") {
329 $intro->setUseRte(true);
330 $intro->setRteTags(\ilObjAdvancedEditing::_getUsedHTMLTags("survey"));
331 $intro->addPlugin("latex");
332 $intro->addButton("latex");
333 $intro->addButton("pastelatex");
334 $intro->setRTESupport($survey->getId(), "svy", "survey", null);
335 }
336 $form->addItem($intro);
337
338 return $form;
339 }

◆ withGeneral()

ILIAS\Survey\Settings\SettingsFormGUI::withGeneral ( \ilPropertyFormGUI  $form)

add general section

Definition at line 179 of file class.SettingsFormGUI.php.

183 $lng = $this->ui_service->lng();
185
186 // general properties
187 $header = new \ilFormSectionHeaderGUI();
188 $header->setTitle($lng->txt("settings"));
189 $form->addItem($header);
190
191 // title & description (meta data)
192 //$md_obj = new ilMD($this->object->getId(), 0, "svy");
193 //$md_section = $md_obj->getGeneral();
194
195 $title = new \ilTextInputGUI($lng->txt("title"), "title");
196 $title->setRequired(true);
197 $title->setValue($survey->getTitle());
198 $form->addItem($title);
199
200 //$ids = $md_section->getDescriptionIds();
201 //if ($ids) {
202 // $desc_obj = $md_section->getDescription(array_pop($ids));
203
204 $desc = new \ilTextAreaInputGUI($lng->txt("description"), "description");
205 $desc->setRows(4);
206 $desc->setValue($survey->getLongDescription());
207 $form->addItem($desc);
208 //}
209
210 // pool usage
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());
219 $form->addItem($pool_usage);
220
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());
225 $form->addItem($self_rate);
226
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());
230 $form->addItem($self_appr);
231 }
232
233 foreach ($this->modifier->getSurveySettingsGeneral($survey) as $item) {
234 $form->addItem($item);
235 }
236 return $form;
237 }
getLongDescription()
get object long description (stored in object_description)

◆ withOther()

ILIAS\Survey\Settings\SettingsFormGUI::withOther ( \ilPropertyFormGUI  $form)

add "other" section

Definition at line 751 of file class.SettingsFormGUI.php.

754 $lng = $this->ui_service->lng();
757
758 $other_items = [];
759
760 // competence service activation for 360 mode
761
762 $skmg_set = new \ilSkillManagementSettings();
763
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;
769 }
770
771 $position_settings = \ilOrgUnitGlobalSettings::getInstance()
772 ->getObjectPositionSettingsByType($survey->getType());
773
774 if (count($other_items) > 0 ||
775 $position_settings->isActive()
776 ) {
777 $feat = new \ilFormSectionHeaderGUI();
778 $feat->setTitle($lng->txt('obj_features'));
779 $form->addItem($feat);
780
781 foreach ($other_items as $item) {
782 $form->addItem($item);
783 }
784 }
785
786 if ($position_settings->isActive()) {
787 // add orgunit settings
789 $survey->getId(),
790 $form,
791 array(
793 )
794 );
795 }
796
797 return $form;
798 }
static initServiceSettingsForm(int $obj_id, ilPropertyFormGUI $form, array $services)

◆ withPresentation()

ILIAS\Survey\Settings\SettingsFormGUI::withPresentation ( \ilPropertyFormGUI  $form)

add presentation section

Definition at line 291 of file class.SettingsFormGUI.php.

294 $obj_service = $this->object_service;
296 $lng = $this->ui_service->lng();
297
298 // presentation
299 $section = new \ilFormSectionHeaderGUI();
300 $section->setTitle($lng->txt('obj_presentation'));
301 $form->addItem($section);
302
303 // tile image
304 $obj_service->commonSettings()->legacyForm($form, $survey)->addTileImage();
305
306 return $form;
307 }

◆ withQuestionBehaviour()

ILIAS\Survey\Settings\SettingsFormGUI::withQuestionBehaviour ( \ilPropertyFormGUI  $form)

add question behaviour section

Definition at line 395 of file class.SettingsFormGUI.php.

399 $lng = $this->ui_service->lng();
400
401 // question behaviour
402
403 $section = new \ilFormSectionHeaderGUI();
404 $section->setTitle($lng->txt('svy_settings_section_question_behaviour'));
405 $form->addItem($section);
406
407 // show question titles
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);
412
413 return $form;
414 }

◆ withReminders()

ILIAS\Survey\Settings\SettingsFormGUI::withReminders ( \ilPropertyFormGUI  $form)

add reminders section

Definition at line 615 of file class.SettingsFormGUI.php.

619 $lng = $this->ui_service->lng();
621 $invitation_manager = $this->domain_service->participants()->invitations();
622
623 // reminders
624
625 $info = new \ilFormSectionHeaderGUI();
626 $info->setTitle($lng->txt("svy_settings_section_reminders"));
627 $form->addItem($info);
628
629 $rmd = new \ilCheckboxInputGUI($lng->txt("survey_reminder_setting"), "rmd");
630 $rmd->setChecked($survey->getReminderStatus());
631 $form->addItem($rmd);
632
633 $rmd_start = new \ilDateTimeInputGUI($lng->txt("survey_reminder_start"), "rmd_start");
634 $rmd_start->setRequired(true);
635 $start = $survey->getReminderStart();
636 if ($start) {
637 $rmd_start->setDate($start);
638 }
639 $rmd->addSubItem($rmd_start);
640
641 $end = $survey->getReminderEnd();
642 $rmd_end = new \ilDateTimeInputGUI($lng->txt("survey_reminder_end"), "rmd_end");
643 if ($end) {
644 $rmd_end->setDate($end);
645 }
646 $rmd->addSubItem($rmd_end);
647
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);
655
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);
661
662 $rmd_grp_crs = new \ilRadioOption(
663 $lng->txt("survey_notification_target_group_parent_course"),
665 );
666 if (!$this->hasGroupCourseParent()) {
667 $rmd_grp_crs->setInfo($lng->txt("survey_notification_target_group_parent_course_inactive"));
668 } else {
669 $rmd_grp_crs->setInfo(sprintf(
670 $lng->txt("survey_notification_target_group_invited_info"),
672 ));
673 }
674 $rmd_grp->addOption($rmd_grp_crs);
675
676 $rmd_grp_inv = new \ilRadioOption(
677 $lng->txt("survey_notification_target_group_invited"),
679 );
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);
683
684 $mtmpl = $survey->getReminderMailTemplates();
685 if ($mtmpl) {
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);
692 }
693
694 $reminderTemplateValue = -1;
696 $reminderTemplateValue = $survey->getReminderTemplate();
697 }
698 $rmdt->setValue((string) $reminderTemplateValue);
699 $rmd->addSubItem($rmdt);
700 }
701 }
702
703 foreach ($this->modifier->getSurveySettingsReminderTargets(
704 $survey,
705 $this->ui_service
706 ) as $item) {
707 $rmd->addSubItem($item);
708 }
709
710 return $form;
711 }
getReminderTemplate(bool $selectDefault=false)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...

◆ withResults()

ILIAS\Survey\Settings\SettingsFormGUI::withResults ( \ilPropertyFormGUI  $form)

add results section

Definition at line 716 of file class.SettingsFormGUI.php.

719 $lng = $this->ui_service->lng();
722
723 // results
724
725 $results = new \ilFormSectionHeaderGUI();
726 $results->setTitle($lng->txt("results"));
727 $form->addItem($results);
728
729 if ($feature_config->supportsSumScore()) {
730 // calculate sum score
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());
735 $form->addItem($sum_score);
736 }
737
738 foreach ($this->modifier->getSurveySettingsResults(
739 $survey,
740 $this->ui_service
741 ) as $item) {
742 $form->addItem($item);
743 }
744
745 return $form;
746 }
$results

Field Documentation

◆ $domain_service

InternalDomainService ILIAS\Survey\Settings\SettingsFormGUI::$domain_service
protected

◆ $feature_config

ILIAS Survey Mode FeatureConfig ILIAS\Survey\Settings\SettingsFormGUI::$feature_config
protected

◆ $main_tpl

ilGlobalTemplateInterface ILIAS\Survey\Settings\SettingsFormGUI::$main_tpl
private

Definition at line 40 of file class.SettingsFormGUI.php.

◆ $modifier

UIModifier ILIAS\Survey\Settings\SettingsFormGUI::$modifier
protected

◆ $object_service

ilObjectServiceInterface ILIAS\Survey\Settings\SettingsFormGUI::$object_service
protected

◆ $rbacsystem

ilRbacSystem ILIAS\Survey\Settings\SettingsFormGUI::$rbacsystem
protected

◆ $survey

◆ $ui_service

InternalGUIService ILIAS\Survey\Settings\SettingsFormGUI::$ui_service
protected

The documentation for this class was generated from the following file: