ILIAS  trunk Revision v12.0_alpha-1221-g4e438232683
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, \ilObjectService $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
 
ilObjectService $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 32 of file class.SettingsFormGUI.php.

Constructor & Destructor Documentation

◆ __construct()

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

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

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

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 63 of file class.SettingsFormGUI.php.

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

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 149 of file class.SettingsFormGUI.php.

152 $ctrl = $this->ui_service->ctrl();
153 $lng = $this->ui_service->lng();
154
155 $form = new \ilPropertyFormGUI();
156 $form->setFormAction($ctrl->getFormActionByClass(
157 $target_class
158 ));
159 $form->setId("survey_properties");
160
161 $form = $this->withGeneral($form);
162 $form = $this->withActivation($form);
163 $form = $this->withPresentation($form);
164 $form = $this->withBeforeStart($form);
165 $form = $this->withAccess($form);
166 $form = $this->withQuestionBehaviour($form);
167 $form = $this->withAfterEnd($form, $target_class);
168 $form = $this->withReminders($form);
169 $form = $this->withResults($form);
170 $form = $this->withOther($form);
171
172 $form->addCommandButton("saveProperties", $lng->txt("save"));
173
174 return $form;
175 }
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 109 of file class.SettingsFormGUI.php.

109 : array
110 {
113
114 $tut_ids = array();
115 $tut_logins = $form->getInput("tut_ids");
116 foreach ($tut_logins as $tut_login) {
117 $tut_id = \ilObjUser::_lookupId($tut_login);
118 if ($tut_id && $rbacsystem->checkAccessOfUser($tut_id, "write", $survey->getRefId())) {
119 $tut_ids[] = $tut_id;
120 }
121 }
122 return $tut_ids;
123 }
static _lookupId(string|array $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 129 of file class.SettingsFormGUI.php.

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

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 591 of file class.SettingsFormGUI.php.

591 : bool
592 {
594
595 $tree = $this->domain_service->repositoryTree();
596 $has_parent = $tree->checkForParentType($survey->getRefId(), "grp");
597 if (!$has_parent) {
598 $has_parent = $tree->checkForParentType($survey->getRefId(), "crs");
599 }
600 return (bool) $has_parent;
601 }

◆ saveForm()

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

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

793 : void {
796 $obj_service = $this->object_service;
797 $lng = $this->ui_service->lng();
798
799 if ($form->getInput("rmd")) {
800 $rmd_start = $form->getItemByPostVar("rmd_start")->getDate();
801 $rmd_end = $form->getItemByPostVar("rmd_end")->getDate();
802 if ($rmd_end && $rmd_start->get(IL_CAL_UNIX) > $rmd_end->get(IL_CAL_UNIX)) {
803 $tmp = $rmd_start;
804 $rmd_start = $rmd_end;
805 $rmd_end = $tmp;
806 }
808 $survey->setReminderStart($rmd_start);
809 $survey->setReminderEnd($rmd_end);
810 $survey->setReminderFrequency((int) $form->getInput("rmd_freq"));
811 if ($feature_config->supportsMemberReminder()) {
812 $survey->setReminderTarget((int) $form->getInput("rmd_grp"));
813 $survey->setReminderTemplate(($form->getInput("rmdt") > 0)
814 ? (int) $form->getInput("rmdt")
815 : null);
816 }
817 } else {
819 }
820
821 if ($feature_config->supportsTutorNotification()) {
822 // "one mail after all participants finished"
823 if ($form->getInput("tut")) {
824 $tut_ids = $this->getTutorIdsFromForm($form);
826 $survey->setTutorNotificationRecipients($tut_ids); // see above
827 $survey->setTutorNotificationTarget((int) $form->getInput("tut_grp"));
828 } else {
830 }
831
832 /*
833 if ($form->getInput("tut_res")) {
834 $tut_res_ids = $this->getTutorResIdsFromForm($form);
835 $survey->setTutorResultsStatus(true);
836 $survey->setTutorResultsRecipients($tut_res_ids); // see above
837 } else {
838 $survey->setTutorResultsStatus(false);
839 }*/
840 }
841
842 // #10055
843 if ($form->getInput('online') && count($survey->questions) === 0) {
844 $this->main_tpl->setOnScreenMessage('failure', $lng->txt("cannot_switch_to_online_no_questions"), true);
845 } else {
846 $survey->setOfflineStatus(!$form->getInput('online'));
847 }
848
849 $survey->setMailOwnResults((bool) $form->getInput("mail_own"));
850 $survey->setMailConfirmation((bool) $form->getInput("mail_confirm"));
851
852 // both are saved in object, too
853 $survey->setTitle($form->getInput('title'));
854 $survey->setDescription($form->getInput('description'));
855 $survey->update();
856
857 // activation
858 $period = $form->getItemByPostVar("access_period");
859 $tb = $form->getInput("time_based_avail");
860 if ($tb && $period->getStart() && $period->getEnd()) {
862 $survey->setActivationVisibility((bool) $form->getInput("access_visiblity"));
863 $survey->setActivationStartDate($period->getStart()->get(IL_CAL_UNIX));
864 $survey->setActivationEndDate($period->getEnd()->get(IL_CAL_UNIX));
865 } else {
867 }
868
869 // tile image
870 $obj_service->commonSettings()->legacyForm($form, $survey)->saveTileImage();
871
872 $start = $form->getItemByPostVar("start_date");
873 if ($start->getDate()) {
874 $datetime = explode(" ", $start->getDate()->get(IL_CAL_DATETIME));
876 } else {
878 }
879
880 $end = $form->getItemByPostVar("end_date");
881 if ($end->getDate()) {
882 $datetime = explode(" ", $end->getDate()->get(IL_CAL_DATETIME));
884 } else {
885 $survey->setEndDate("");
886 }
887
888 $purifier = new ilSvyStandardPurifier();
889
890 $introduction = $form->getInput("introduction");
891 $introduction = $purifier->purify($introduction);
892 $survey->setIntroduction($introduction);
893 $outro = $form->getInput("outro");
894 $outro = $purifier->purify($outro);
895 $survey->setOutro($outro);
896 $survey->setShowQuestionTitles((bool) $form->getInput("show_question_titles"));
897
898 // "separate mail for each participant finished"
899 $survey->setMailNotification((bool) $form->getInput('mailnotification'));
900 $survey->setMailAddresses($form->getInput('mailaddresses'));
901 $survey->setMailParticipantData($form->getInput('mailparticipantdata'));
902
903 if ($feature_config->usesAppraisees()) {
904 $survey->set360SelfAppraisee((bool) $form->getInput("self_appr"));
905 $survey->set360SelfRaters((bool) $form->getInput("self_rate"));
906 }
907
908 if ($feature_config->supportsCompetences()) {
909 $survey->setSkillService((bool) $form->getInput("skill_service"));
910 }
911
912 foreach ($this->modifier->getSurveySettingsResults(
913 $survey,
914 $this->ui_service
915 ) as $item) {
916 $this->modifier->setValuesFromForm($survey, $form);
917 }
918
919 $survey->saveToDb();
920
922 $survey->getId(),
923 $form,
924 array(
926 )
927 );
928 }
$datetime
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)
setActivationEndDate(?int $ending_time=null)
setIntroduction(string $introduction="")
setEndDate(string $end_date="")
setStartDate(string $start_date="")
setReminderFrequency(int $a_value)
setShowQuestionTitles(bool $a_show)
setActivationStartDate(?int $starting_time=null)
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)
setMailOwnResults(bool $a_value)
static updateServiceSettingsForm(int $obj_id, ilPropertyFormGUI $form, array $services)
setTitle(string $title)
setOfflineStatus(bool $status)
setDescription(string $description)

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_code"), "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 240 of file class.SettingsFormGUI.php.

243 $lng = $this->ui_service->lng();
245
246 // activation
247 $lng->loadLanguageModule('rep');
248
249 $section = new \ilFormSectionHeaderGUI();
250 $section->setTitle($lng->txt('rep_activation_availability'));
251 $form->addItem($section);
252
253 // additional info only with multiple references
254 $act_obj_info = $act_ref_info = "";
255 if (count(\ilObject::_getAllReferences($survey->getId())) > 1) {
256 $act_obj_info = ' ' . $lng->txt('rep_activation_online_object_info');
257 $act_ref_info = $lng->txt('rep_activation_access_ref_info');
258 }
259
260 $online = new \ilCheckboxInputGUI($lng->txt('rep_activation_online'), 'online');
261 $online->setInfo($lng->txt('svy_activation_online_info') . $act_obj_info);
262 $online->setChecked(!$survey->getOfflineStatus());
263 $form->addItem($online);
264
265 $time_based_aval = new \ilCheckboxInputGUI($lng->txt('rep_time_based_availability'), 'time_based_avail');
266 $time_based_aval->setChecked(
267 (int) $survey->getActivationStartDate() > 0 ||
268 (int) $survey->getActivationEndDate() > 0
269 );
270 $form->addItem($time_based_aval);
271
272 $dur = new \ilDateDurationInputGUI($lng->txt('rep_time_period'), "access_period");
273 $dur->setShowTime(true);
275 $dur->setStart($date
276 ? new \ilDateTime($date, IL_CAL_UNIX)
277 : null);
278 $date = $survey->getActivationEndDate();
279 $dur->setEnd($date
280 ? new \ilDateTime($date, IL_CAL_UNIX)
281 : null);
282 $time_based_aval->addSubItem($dur);
283
284 $visible = new \ilCheckboxInputGUI($lng->txt('rep_activation_limited_visibility'), 'access_visiblity');
285 $visible->setInfo($lng->txt('svy_activation_limited_visibility_info'));
286 $visible->setChecked($survey->getActivationVisibility());
287 $time_based_aval->addSubItem($visible);
288
289 return $form;
290 }
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 $mail_confirm = new \ilCheckboxInputGUI($lng->txt("svy_results_mail_confirm"), "mail_confirm");
436 $mail_confirm->setInfo($lng->txt("svy_results_mail_confirm_info"));
437 $mail_confirm->setChecked($survey->hasMailConfirmation());
438 $form->addItem($mail_confirm);
439
440 $mail_own = new \ilCheckboxInputGUI($lng->txt("svy_results_mail_own"), "mail_own");
441 $mail_own->setInfo($lng->txt("svy_results_mail_own_info"));
442 $mail_own->setChecked($survey->hasMailOwnResults());
443 $mail_confirm->addSubItem($mail_own);
444
445 // final statement
446 $finalstatement = new \ilTextAreaInputGUI($lng->txt("outro"), "outro");
447 $finalstatement->setValue($survey->prepareTextareaOutput($survey->getOutro()));
448 $finalstatement->setRows(10);
449 $finalstatement->setCols(80);
450 if ((new \ilRTESettings($this->domain_service->lng(), $this->domain_service->user()))->getRichTextEditor() === "tinymce") {
451 $finalstatement->setUseRte(true);
452 $finalstatement->setRteTagSet("mini");
453 }
454 $form->addItem($finalstatement);
455
456 // mail notification
457 $mailnotification = new \ilCheckboxInputGUI($lng->txt("mailnotification"), "mailnotification");
458 // $mailnotification->setOptionTitle($lng->txt("activate"));
459 $mailnotification->setInfo($lng->txt("svy_result_mail_notification_info")); // #11762
460 $mailnotification->setValue("1");
461 $mailnotification->setChecked($survey->getMailNotification());
462
463 // addresses
464 $mailaddresses = new \ilTextInputGUI($lng->txt("survey_notification_tutor_recipients"), "mailaddresses");
465 $mailaddresses->setValue($survey->getMailAddresses());
466 $mailaddresses->setSize(80);
467 $mailaddresses->setInfo($lng->txt('mailaddresses_info'));
468 $mailaddresses->setRequired(true);
469
470 // participant data
471 $participantdata = new \ilTextAreaInputGUI($lng->txt("mailparticipantdata"), "mailparticipantdata");
472 $participantdata->setValue($survey->getMailParticipantData());
473 $participantdata->setRows(6);
474 $participantdata->setCols(80);
475 $participantdata->setUseRte(false);
476 $participantdata->setInfo($lng->txt("mailparticipantdata_info"));
477
478 // #12755 - because of privacy concerns we restrict user data to a minimum
479 $placeholders = array(
480 "FIRST_NAME" => "firstname",
481 "LAST_NAME" => "lastname",
482 "LOGIN" => "login"
483 );
484 $txt = array();
485 foreach ($placeholders as $placeholder => $caption) {
486 $txt[] = "[" . strtoupper($placeholder) . "]: " . $lng->txt($caption);
487 }
488 $txt = implode("<br />", $txt);
489 $participantdatainfo = new \ilNonEditableValueGUI($lng->txt("svy_placeholders_label"), "", true);
490 $participantdatainfo->setValue($lng->txt("mailparticipantdata_placeholder") . "<br />" . $txt);
491
492 $mailnotification->addSubItem($mailaddresses);
493 $mailnotification->addSubItem($participantdata);
494 $mailnotification->addSubItem($participantdatainfo);
495 $form->addItem($mailnotification);
496
497 // tutor notification - currently not available for 360°
498 if ($feature_config->supportsTutorNotification()) {
499 $num_inv = count($invitation_manager->getAllForSurvey($survey->getSurveyId()));
500
501 // notification, if "all participants" have finished the survey
502 $tut = new \ilCheckboxInputGUI($lng->txt("survey_notification_tutor_setting"), "tut");
503 $tut->setChecked($survey->getTutorNotificationStatus());
504 $form->addItem($tut);
505
506 $tut_logins = array();
508 if ($tuts) {
509 foreach ($tuts as $tut_id) {
510 $tmp = \ilObjUser::_lookupName((int) $tut_id);
511 if ($tmp["login"]) {
512 $tut_logins[] = $tmp["login"];
513 }
514 }
515 }
516 $tut_ids = new \ilTextInputGUI($lng->txt("survey_notification_tutor_recipients"), "tut_ids");
517 $tut_ids->setDataSource($ctrl->getLinkTargetByClass($target_class, "doAutoComplete", "", true));
518 $tut_ids->setRequired(true);
519 $tut_ids->setMulti(true);
520 $tut_ids->setMultiValues($tut_logins);
521 $tut_ids->setValue(array_shift($tut_logins));
522 $tut->addSubItem($tut_ids);
523
524 // radio to define who are "all participants"
525 $tut_grp = new \ilRadioGroupInputGUI($lng->txt("survey_notification_target_group"), "tut_grp");
526 $tut_grp->setRequired(true);
527 $tut_grp->setValue((string) $survey->getTutorNotificationTarget());
528 $tut->addSubItem($tut_grp);
529
530 // (a) ... the member of the parent group or course
531 $tut_grp_crs = new \ilRadioOption(
532 $lng->txt("survey_notification_target_group_parent_course"),
534 );
535 if (!$this->hasGroupCourseParent()) {
536 $tut_grp_crs->setInfo($lng->txt("survey_notification_target_group_parent_course_inactive"));
537 } else {
538 $tut_grp_crs->setInfo(sprintf(
539 $lng->txt("survey_notification_target_group_invited_info"),
541 ));
542 }
543 $tut_grp->addOption($tut_grp_crs);
544
545 // (b) ... all invited users
546 $tut_grp_inv = new \ilRadioOption(
547 $lng->txt("survey_notification_target_group_invited"),
549 );
550 $tut_grp_inv->setInfo(sprintf($lng->txt("survey_notification_target_group_invited_info"), $num_inv));
551 $tut_grp->addOption($tut_grp_inv);
552
553 /*
554 $tut_res = new \ilCheckboxInputGUI($lng->txt("svy_notification_tutor_results"), "tut_res");
555 $tut_res->setInfo($lng->txt("svy_notification_tutor_results_info"));
556 $tut_res->setChecked($survey->getTutorResultsStatus());
557 $form->addItem($tut_res);
558
559 $tut_res_logins = array();
560 $tuts = $survey->getTutorResultsRecipients();
561 if ($tuts) {
562 foreach ($tuts as $tut_id) {
563 $tmp = \ilObjUser::_lookupName((int) $tut_id);
564 if ($tmp["login"]) {
565 $tut_res_logins[] = $tmp["login"];
566 }
567 }
568 }
569 $tut_res_ids = new \ilTextInputGUI($lng->txt("survey_notification_tutor_recipients"), "tut_res_ids");
570 $tut_res_ids->setDataSource(
571 $ctrl->getLinkTargetByClass(
572 $target_class,
573 "doAutoComplete",
574 "",
575 true
576 )
577 );
578 $tut_res_ids->setRequired(true);
579 $tut_res_ids->setMulti(true);
580 $tut_res_ids->setMultiValues($tut_res_logins);
581 $tut_res_ids->setValue(array_shift($tut_res_logins));
582 $tut_res->addSubItem($tut_res_ids);*/
583 }
584
585 return $form;
586 }
hasGroupCourseParent()
Check for group course parent.
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)
$info
Definition: entry_point.php:21

◆ withBeforeStart()

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

add "before start" section

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

320 $lng = $this->ui_service->lng();
321
322 $section = new \ilFormSectionHeaderGUI();
323 $section->setTitle($lng->txt('svy_settings_section_before_start'));
324 $form->addItem($section);
325
326 // introduction
327 $intro = new \ilTextAreaInputGUI($lng->txt("introduction"), "introduction");
329 $intro->setRows(10);
330 $intro->setCols(80);
331 $intro->setInfo($lng->txt("survey_introduction_info"));
332 if ((new \ilRTESettings($this->domain_service->lng(), $this->domain_service->user()))->getRichTextEditor() === "tinymce") {
333 $intro->setUseRte(true);
334 $intro->setRteTagSet("mini");
335 }
336 $form->addItem($intro);
337
338 return $form;
339 }

◆ withGeneral()

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

add general section

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

184 $lng = $this->ui_service->lng();
186
187 // general properties
188 $header = new \ilFormSectionHeaderGUI();
189 $header->setTitle($lng->txt("settings"));
190 $form->addItem($header);
191
192 // title & description (meta data)
193 //$md_obj = new ilMD($this->object->getId(), 0, "svy");
194 //$md_section = $md_obj->getGeneral();
195
196 $title = new \ilTextInputGUI($lng->txt("title"), "title");
197 $title->setRequired(true);
198 $title->setValue($survey->getTitle());
199 $form->addItem($title);
200
201 //$ids = $md_section->getDescriptionIds();
202 //if ($ids) {
203 // $desc_obj = $md_section->getDescription(array_pop($ids));
204
205 $desc = new \ilTextAreaInputGUI($lng->txt("description"), "description");
206 $desc->setRows(4);
207 $desc->setValue($survey->getLongDescription());
208 $form->addItem($desc);
209
210 $ne = new \ilNonEditableValueGUI($lng->txt("type"));
211 $ne->setValue(
212 $this->domain_service
213 ->modeProvider($survey->getMode())
214 ->getTitle()
215 );
216 $form->addItem($ne);
217
218 if ($feature_config->usesAppraisees()) {
219 $self_rate = new \ilCheckboxInputGUI($lng->txt("survey_360_self_raters"), "self_rate");
220 $self_rate->setInfo($lng->txt("survey_360_self_raters_info"));
221 $self_rate->setChecked($survey->get360SelfRaters());
222 $form->addItem($self_rate);
223
224 $self_appr = new \ilCheckboxInputGUI($lng->txt("survey_360_self_appraisee"), "self_appr");
225 $self_appr->setInfo($lng->txt("survey_360_self_appraisee_info"));
226 $self_appr->setChecked($survey->get360SelfAppraisee());
227 $form->addItem($self_appr);
228 }
229
230 foreach ($this->modifier->getSurveySettingsGeneral($survey) as $item) {
231 $form->addItem($item);
232 }
233 return $form;
234 }
getLongDescription()
get object long description (stored in object_description)

◆ withOther()

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

add "other" section

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

745 $lng = $this->ui_service->lng();
748
749 $other_items = [];
750
751 // competence service activation for 360 mode
752
753 $skmg_set = new \ilSkillManagementSettings();
754
755 if ($feature_config->supportsCompetences() && $skmg_set->isActivated()) {
756 $skill_service = new \ilCheckboxInputGUI($lng->txt("survey_activate_skill_service"), "skill_service");
757 $skill_service->setInfo($lng->txt("survey_activate_skill_service_info"));
758 $skill_service->setChecked($survey->getSkillService());
759 $other_items[] = $skill_service;
760 }
761
762 $position_settings = \ilOrgUnitGlobalSettings::getInstance()
763 ->getObjectPositionSettingsByType($survey->getType());
764
765 if (count($other_items) > 0 ||
766 $position_settings->isActive()
767 ) {
768 $feat = new \ilFormSectionHeaderGUI();
769 $feat->setTitle($lng->txt('obj_features'));
770 $form->addItem($feat);
771
772 foreach ($other_items as $item) {
773 $form->addItem($item);
774 }
775 }
776
777 if ($position_settings->isActive()) {
778 // add orgunit settings
780 $survey->getId(),
781 $form,
782 array(
784 )
785 );
786 }
787
788 return $form;
789 }
static initServiceSettingsForm(int $obj_id, ilPropertyFormGUI $form, array $services)

◆ withPresentation()

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

add presentation section

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

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

◆ 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 606 of file class.SettingsFormGUI.php.

610 $lng = $this->ui_service->lng();
612 $invitation_manager = $this->domain_service->participants()->invitations();
613
614 // reminders
615
616 $info = new \ilFormSectionHeaderGUI();
617 $info->setTitle($lng->txt("svy_settings_section_reminders"));
618 $form->addItem($info);
619
620 $rmd = new \ilCheckboxInputGUI($lng->txt("survey_reminder_setting"), "rmd");
621 $rmd->setChecked($survey->getReminderStatus());
622 $form->addItem($rmd);
623
624 $rmd_start = new \ilDateTimeInputGUI($lng->txt("survey_reminder_start"), "rmd_start");
625 $rmd_start->setRequired(true);
626 $start = $survey->getReminderStart();
627 if ($start) {
628 $rmd_start->setDate($start);
629 }
630 $rmd->addSubItem($rmd_start);
631
632 $end = $survey->getReminderEnd();
633 $rmd_end = new \ilDateTimeInputGUI($lng->txt("survey_reminder_end"), "rmd_end");
634 if ($end) {
635 $rmd_end->setDate($end);
636 }
637 $rmd->addSubItem($rmd_end);
638
639 $rmd_freq = new \ilNumberInputGUI($lng->txt("survey_reminder_frequency"), "rmd_freq");
640 $rmd_freq->setRequired(true);
641 $rmd_freq->setSize(3);
642 $rmd_freq->setSuffix($lng->txt("survey_reminder_frequency_days"));
643 $rmd_freq->setValue((string) $survey->getReminderFrequency());
644 $rmd_freq->setMinValue(1);
645 $rmd->addSubItem($rmd_freq);
646
647 if ($feature_config->supportsMemberReminder()) {
648 $rmd_grp = new \ilRadioGroupInputGUI($lng->txt("survey_notification_target_group"), "rmd_grp");
649 $rmd_grp->setRequired(true);
650 $rmd_grp->setValue((string) $survey->getReminderTarget());
651 $rmd->addSubItem($rmd_grp);
652
653 $rmd_grp_crs = new \ilRadioOption(
654 $lng->txt("survey_notification_target_group_parent_course"),
656 );
657 if (!$this->hasGroupCourseParent()) {
658 $rmd_grp_crs->setInfo($lng->txt("survey_notification_target_group_parent_course_inactive"));
659 } else {
660 $rmd_grp_crs->setInfo(sprintf(
661 $lng->txt("survey_notification_target_group_invited_info"),
663 ));
664 }
665 $rmd_grp->addOption($rmd_grp_crs);
666
667 $rmd_grp_inv = new \ilRadioOption(
668 $lng->txt("survey_notification_target_group_invited"),
670 );
671 $num_inv = count($invitation_manager->getAllForSurvey($survey->getSurveyId()));
672 $rmd_grp_inv->setInfo(sprintf($lng->txt("survey_notification_target_group_invited_info"), $num_inv));
673 $rmd_grp->addOption($rmd_grp_inv);
674
676 if ($mtmpl) {
677 $rmdt = new \ilRadioGroupInputGUI($lng->txt("svy_reminder_mail_template"), "rmdt");
678 $rmdt->setRequired(true);
679 $rmdt->addOption(new \ilRadioOption($lng->txt("svy_reminder_mail_template_none"), "-1"));
680 foreach ($mtmpl as $mtmpl_id => $mtmpl_caption) {
681 $option = new \ilRadioOption($mtmpl_caption, (string) $mtmpl_id);
682 $rmdt->addOption($option);
683 }
684
685 $reminderTemplateValue = -1;
687 $reminderTemplateValue = $survey->getReminderTemplate();
688 }
689 $rmdt->setValue((string) $reminderTemplateValue);
690 $rmd->addSubItem($rmdt);
691 }
692 }
693
694 foreach ($this->modifier->getSurveySettingsReminderTargets(
695 $survey,
696 $this->ui_service
697 ) as $item) {
698 $rmd->addSubItem($item);
699 }
700
701 return $form;
702 }
getReminderTemplate(bool $selectDefault=false)
getReminderMailTemplates(?int &$defaultTemplateId=null)
This class represents an option in a radio group.

◆ withResults()

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

add results section

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

710 $lng = $this->ui_service->lng();
713
714 // results
715
716 $results = new \ilFormSectionHeaderGUI();
717 $results->setTitle($lng->txt("results"));
718 $form->addItem($results);
719
720 if ($feature_config->supportsSumScore()) {
721 // calculate sum score
722 $sum_score = new \ilCheckboxInputGUI($lng->txt("survey_calculate_sum_score"), "calculate_sum_score");
723 $sum_score->setInfo($lng->txt("survey_calculate_sum_score_info"));
724 $sum_score->setValue("1");
725 $sum_score->setChecked($survey->getCalculateSumScore());
726 $form->addItem($sum_score);
727 }
728
729 foreach ($this->modifier->getSurveySettingsResults(
730 $survey,
731 $this->ui_service
732 ) as $item) {
733 $form->addItem($item);
734 }
735
736 return $form;
737 }
$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 41 of file class.SettingsFormGUI.php.

◆ $modifier

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

◆ $object_service

ilObjectService 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: