4 include_once
"./Services/Object/classes/class.ilObjectGUI.php";
29 $lng->loadLanguageModule(
"survey");
31 $this->ctrl->saveParameter($this,
"ref_id");
38 global $ilAccess, $ilNavigationHistory,
$ilErr, $ilTabs;
40 $this->external_rater_360 =
false;
41 if(!$this->creation_mode &&
42 $this->object->get360Mode() &&
43 $_SESSION[
"anonymous_id"][$this->
object->getId()] &&
45 $_SESSION[
"anonymous_id"][$this->
object->getId()]))
47 $this->external_rater_360 =
true;
50 if(!$this->external_rater_360)
52 if (!$ilAccess->checkAccess(
"read",
"", $this->ref_id) &&
53 !$ilAccess->checkAccess(
"visible",
"", $this->ref_id))
55 $ilErr->raiseError($this->lng->txt(
"permission_denied"), $ilErr->MESSAGE);
60 $ilAccess->checkAccess(
"read",
"", $this->ref_id))
62 $this->ctrl->setParameterByClass(
"ilobjsurveygui",
"ref_id", $this->ref_id);
63 $link = $this->ctrl->getLinkTargetByClass(
"ilobjsurveygui",
"");
64 $ilNavigationHistory->addItem($this->ref_id, $link,
"svy");
68 $cmd = $this->ctrl->getCmd(
"properties");
71 if (
$cmd ==
"saveTags")
73 $this->ctrl->setCmdClass(
"ilinfoscreengui");
77 if(!$this->ctrl->getCmdClass() &&
$cmd ==
"questionsrepo")
80 $this->ctrl->setCmd(
"questions");
81 $this->ctrl->setCmdClass(
"ilsurveyeditorgui");
84 $next_class = $this->ctrl->getNextClass($this);
85 $this->ctrl->setReturn($this,
"properties");
91 case "ilinfoscreengui":
92 if(!in_array($this->ctrl->getCmdClass(),
93 array(
'ilpublicuserprofilegui',
'ilobjportfoliogui')))
101 $ilTabs->clearTargets();
102 include_once(
"./Services/InfoScreen/classes/class.ilInfoScreenGUI.php");
104 $this->ctrl->forwardCommand($info);
108 case 'ilmdeditorgui':
110 $ilTabs->activateTab(
"meta_data");
112 include_once
'Services/MetaData/classes/class.ilMDEditorGUI.php';
113 $md_gui =&
new ilMDEditorGUI($this->object->getId(), 0, $this->
object->getType());
114 $md_gui->
addObserver($this->
object,
'MDUpdateListener',
'General');
116 $this->ctrl->forwardCommand($md_gui);
119 case "ilsurveyevaluationgui":
120 $ilTabs->activateTab(
"svy_results");
122 include_once(
"./Modules/Survey/classes/class.ilSurveyEvaluationGUI.php");
124 $this->ctrl->forwardCommand($eval_gui);
127 case "ilsurveyexecutiongui":
128 $ilTabs->clearTargets();
129 include_once(
"./Modules/Survey/classes/class.ilSurveyExecutionGUI.php");
131 $this->ctrl->forwardCommand($exec_gui);
134 case 'ilpermissiongui':
135 $ilTabs->activateTab(
"perm_settings");
137 include_once(
"Services/AccessControl/classes/class.ilPermissionGUI.php");
139 $this->ctrl->forwardCommand($perm_gui);
142 case 'ilobjectcopygui':
143 include_once
'./Services/Object/classes/class.ilObjectCopyGUI.php';
146 $this->ctrl->forwardCommand($cp);
149 case "ilcommonactiondispatchergui":
150 include_once(
"Services/Object/classes/class.ilCommonActionDispatcherGUI.php");
152 $this->ctrl->forwardCommand($gui);
156 case 'ilsurveyskillgui':
157 $ilTabs->activateTab(
"survey_competences");
158 include_once(
"./Modules/Survey/classes/class.ilSurveySkillGUI.php");
160 $this->ctrl->forwardCommand($gui);
163 case 'ilsurveyskilldeterminationgui':
164 $ilTabs->activateTab(
"maintenance");
165 include_once(
"./Modules/Survey/classes/class.ilSurveySkillDeterminationGUI.php");
167 $this->ctrl->forwardCommand($gui);
170 case 'ilsurveyeditorgui':
172 $ilTabs->activateTab(
"survey_questions");
173 include_once(
"./Modules/Survey/classes/class.ilSurveyEditorGUI.php");
175 $this->ctrl->forwardCommand($gui);
178 case 'ilsurveyconstraintsgui':
180 $ilTabs->activateTab(
"constraints");
181 include_once(
"./Modules/Survey/classes/class.ilSurveyConstraintsGUI.php");
183 $this->ctrl->forwardCommand($gui);
186 case 'ilsurveyparticipantsgui':
187 if(!$this->object->get360Mode())
189 $ilTabs->activateTab(
"maintenance");
193 $ilTabs->activateTab(
"survey_360_appraisees");
195 include_once(
"./Modules/Survey/classes/class.ilSurveyParticipantsGUI.php");
197 $this->ctrl->forwardCommand($gui);
207 if (strtolower(
$_GET[
"baseClass"]) !=
"iladministrationgui" &&
223 include_once(
"./Modules/Survey/classes/class.ilSurveyEvaluationGUI.php");
225 $this->ctrl->setCmdClass(get_class($eval_gui));
226 $this->ctrl->redirect($eval_gui,
"evaluation");
231 include_once
"Services/Administration/classes/class.ilSettingsTemplate.php";
235 foreach($templates as $item)
237 $a_options[
"svytpl_".$item[
"id"]] = array($item[
"title"],
238 nl2br(trim($item[
"description"])));
243 $a_options[
"svy360_1"] = array($this->lng->txt(
"survey_360_mode"),
244 $this->lng->txt(
"survey_360_mode_info"));
256 $a_new_object->applySettingsTemplate(
$tpl);
260 if($a_new_object->get360Mode())
266 $a_new_object->saveToDB();
271 $a_new_object->
getRefId().
"&cmd=properties");
281 global $ilAccess,
$ilUser, $ilHelp;
288 $ilHelp->setScreenIdComponent(
"svy");
290 $hidden_tabs = array();
291 $template = $this->
object->getTemplate();
294 include_once
"Services/Administration/classes/class.ilSettingsTemplate.php";
296 $hidden_tabs = $template->getHiddenTabs();
299 if ($ilAccess->checkAccess(
"write",
"", $this->ref_id))
301 $tabs_gui->addTab(
"survey_questions",
302 $this->lng->txt(
"survey_questions"),
303 $this->ctrl->getLinkTargetByClass(array(
"ilsurveyeditorgui",
"ilsurveypagegui"),
"renderPage"));
306 if ($ilAccess->checkAccess(
"visible",
"", $this->ref_id))
308 $tabs_gui->addTab(
"info_short",
309 $this->lng->txt(
"info_short"),
310 $this->ctrl->getLinkTarget($this,
'infoScreen'));
314 if ($ilAccess->checkAccess(
"write",
"", $this->ref_id))
316 $tabs_gui->addTab(
"settings",
317 $this->lng->txt(
"settings"),
318 $this->ctrl->getLinkTarget($this,
'properties'));
320 else if ($ilAccess->checkAccess(
"read",
"", $this->ref_id))
322 if($this->object->get360Mode() &&
323 $this->
object->get360SelfRaters() &&
324 $this->
object->isAppraisee($ilUser->getId()) &&
325 !$this->object->isAppraiseeClosed($ilUser->getId()))
327 $tabs_gui->addTab(
"survey_360_edit_raters",
328 $this->lng->txt(
"survey_360_edit_raters"),
329 $this->ctrl->getLinkTargetByClass(
'ilsurveyparticipantsgui',
'editRaters'));
336 if ($ilAccess->checkAccess(
"write",
"", $this->ref_id) &&
337 !in_array(
"constraints", $hidden_tabs) &&
338 !$this->
object->get360Mode())
341 $tabs_gui->addTab(
"constraints",
342 $this->lng->txt(
"constraints"),
343 $this->ctrl->getLinkTargetByClass(
"ilsurveyconstraintsgui",
"constraints"));
346 if ($ilAccess->checkAccess(
"write",
"", $this->ref_id))
349 if($this->object->get360Mode())
352 include_once(
"./Services/Skill/classes/class.ilSkillManagementSettings.php");
354 if ($this->object->get360SkillService() && $skmg_set->isActivated())
356 $tabs_gui->addTab(
"survey_competences",
357 $this->lng->txt(
"survey_competences"),
358 $this->ctrl->getLinkTargetByClass(
"ilsurveyskillgui",
"listQuestionAssignment"));
361 $tabs_gui->addTab(
"survey_360_appraisees",
362 $this->lng->txt(
"survey_360_appraisees"),
363 $this->ctrl->getLinkTargetByClass(
'ilsurveyparticipantsgui',
'listAppraisees'));
368 $tabs_gui->addTab(
"maintenance",
369 $this->lng->txt(
"maintenance"),
370 $this->ctrl->getLinkTargetByClass(
'ilsurveyparticipantsgui',
'maintenance'));
374 include_once
"./Modules/Survey/classes/class.ilObjSurveyAccess.php";
375 if ($ilAccess->checkAccess(
"write",
"", $this->ref_id) ||
379 $tabs_gui->addTab(
"svy_results",
380 $this->lng->txt(
"svy_results"),
381 $this->ctrl->getLinkTargetByClass(
"ilsurveyevaluationgui",
"evaluation"));
384 if ($ilAccess->checkAccess(
"write",
"", $this->ref_id))
386 if(!in_array(
"meta_data", $hidden_tabs))
389 $tabs_gui->addTab(
"meta_data",
390 $this->lng->txt(
"meta_data"),
391 $this->ctrl->getLinkTargetByClass(
'ilmdeditorgui',
'listSection'));
394 if(!in_array(
"export", $hidden_tabs))
397 $tabs_gui->addTab(
"export",
398 $this->lng->txt(
"export"),
399 $this->ctrl->getLinkTarget($this,
'export'));
403 if ($ilAccess->checkAccess(
"edit_permission",
"", $this->ref_id))
406 $tabs_gui->addTab(
"perm_settings",
407 $this->lng->txt(
"perm_settings"),
408 $this->ctrl->getLinkTargetByClass(array(get_class($this),
'ilpermissiongui'),
"perm"));
422 if (!$ilAccess->checkAccess(
"write",
"", $this->ref_id))
426 $this->ctrl->redirect($this,
"infoScreen");
447 if ($form->checkInput())
451 if(!$this->object->get360Mode())
453 if($form->getInput(
"tut"))
457 $tut_logins = $form->getInput(
"tut_ids");
458 foreach($tut_logins as $tut_login)
461 if($tut_id && $rbacsystem->checkAccessOfUser($tut_id,
"write", $this->object->getRefId()))
463 $tut_ids[] = $tut_id;
468 $tut_ids = $form->getItemByPostVar(
"tut_ids");
469 $tut_ids->setAlert($this->lng->txt(
"survey_notification_tutor_recipients_invalid"));
477 if(!$this->object->get360Mode())
479 if($form->getInput(
"rmd"))
481 $rmd_start = $form->getInput(
"rmd_start");
482 $rmd_start = $rmd_start[
"date"];
484 if($form->getInput(
"rmd_end_tgl"))
486 $rmd_end = $form->getInput(
"rmd_end");
487 $rmd_end = $rmd_end[
"date"];
488 if($rmd_start > $rmd_end)
491 $rmd_start = $rmd_end;
498 $this->
object->setReminderStatus(
true);
499 $this->
object->setReminderStart($rmd_start);
500 $this->
object->setReminderEnd($rmd_end);
501 $this->
object->setReminderFrequency($form->getInput(
"rmd_freq"));
502 $this->
object->setReminderTarget($form->getInput(
"rmd_grp"));
506 $this->
object->setReminderStatus(
false);
509 if($form->getInput(
"tut"))
511 $this->
object->setTutorNotificationStatus(
true);
512 $this->
object->setTutorNotificationRecipients($tut_ids);
513 $this->
object->setTutorNotificationTarget($form->getInput(
"tut_grp"));
517 $this->
object->setTutorNotificationStatus(
false);
522 if (
$_POST[
'online'] && count($this->object->questions) == 0)
528 $template_settings = null;
529 $template = $this->
object->getTemplate();
532 include_once
"Services/Administration/classes/class.ilSettingsTemplate.php";
534 $template_settings = $template->getSettings();
537 include_once
'Services/MetaData/classes/class.ilMD.php';
538 $md_obj =&
new ilMD($this->object->getId(), 0,
"svy");
546 $md_desc_ids = $md_section->getDescriptionIds();
549 $md_desc = $md_section->getDescription(array_pop($md_desc_ids));
554 $this->
object->setViewOwnResults(
$_POST[
"view_own"]);
555 $this->
object->setMailOwnResults(
$_POST[
"mail_own"]);
560 $this->
object->update();
562 $this->
object->setStatus(
$_POST[
'online']);
567 $this->
object->setActivationLimited(
true);
568 $this->
object->setActivationVisibility(
$_POST[
"access_visiblity"]);
570 $period = $form->getItemByPostVar(
"access_period");
571 $this->
object->setActivationStartDate($period->getStart()->get(
IL_CAL_UNIX));
572 $this->
object->setActivationEndDate($period->getEnd()->get(
IL_CAL_UNIX));
576 $this->
object->setActivationLimited(
false);
580 if(!$template_settings[
"enabled_start_date"][
"hide"])
582 if (
$_POST[
"enabled_start_date"])
584 $this->
object->setStartDateAndTime(
$_POST[
"start_date"][
'date'],
$_POST[
"start_date"][
'time']);
588 $this->
object->setStartDate(null);
592 if(!$template_settings[
"enabled_end_date"][
"hide"])
594 if (
$_POST[
"enabled_end_date"])
596 $this->
object->setEndDateAndTime(
$_POST[
"end_date"][
'date'],
$_POST[
"end_date"][
'time']);
600 $this->
object->setEndDate(null);
605 include_once
"./Services/AdvancedEditing/classes/class.ilObjAdvancedEditing.php";
606 $introduction =
$_POST[
"introduction"];
607 $this->
object->setIntroduction($introduction);
609 $this->
object->setOutro($outro);
611 if(!$template_settings[
"show_question_titles"][
"hide"])
613 $this->
object->setShowQuestionTitles(
$_POST[
"show_question_titles"]);
616 if(!$template_settings[
"use_pool"][
"hide"])
618 $this->
object->setPoolUsage(
$_POST[
"use_pool"]);
621 $this->
object->setMailNotification(
$_POST[
'mailnotification']);
622 $this->
object->setMailAddresses(
$_POST[
'mailaddresses']);
623 $this->
object->setMailParticipantData(
$_POST[
'mailparticipantdata']);
626 if($this->object->get360Mode())
628 $this->
object->set360SelfEvaluation((
bool)
$_POST[
"self_eval"]);
629 $this->
object->set360SelfAppraisee((
bool)$_POST[
"self_appr"]);
630 $this->
object->set360SelfRaters((
bool)$_POST[
"self_rate"]);
631 $this->
object->set360Results((
int)$_POST[
"ts_res"]);;
632 $this->
object->set360SkillService((
int)$_POST[
"skill_service"]);
636 $this->
object->setEvaluationAccess(
$_POST[
"evaluation_access"]);
638 $hasDatasets = $this->
object->_hasDatasets($this->object->getSurveyId());
641 $codes = (bool)
$_POST[
"acc_codes"];
642 $anon = ((string)
$_POST[
"anonymization_options"] ==
"statanon");
667 unset(
$_SESSION[
"anonymous_id"][$this->object->getId()]);
671 $this->
object->saveToDb();
681 $this->ctrl->redirect($this,
"properties");
685 $form->setValuesByPost();
696 $template_settings = $hide_rte_switch = null;
697 $template = $this->
object->getTemplate();
700 include_once
"Services/Administration/classes/class.ilSettingsTemplate.php";
703 $template_settings = $template->getSettings();
704 $hide_rte_switch = $template_settings[
"rte_switch"][
"hide"];
707 include_once(
"./Services/Form/classes/class.ilPropertyFormGUI.php");
709 $form->setFormAction($this->ctrl->getFormAction($this));
710 $form->setTableWidth(
"100%");
711 $form->setId(
"survey_properties");
715 $header->setTitle($this->lng->txt(
"settings"));
716 $form->addItem($header);
721 include_once
'Services/MetaData/classes/class.ilMD.php';
722 $md_obj =
new ilMD($this->object->getId(), 0,
"svy");
727 $title->setValue($md_section->getTitle());
728 $form->addItem($title);
730 $ids = $md_section->getDescriptionIds();
733 $desc_obj = $md_section->getDescription(array_pop($ids));
738 $desc->setValue($desc_obj->getDescription());
739 $form->addItem($desc);
743 $pool_usage =
new ilRadioGroupInputGUI($this->lng->txt(
"survey_question_pool_usage"),
"use_pool");
744 $opt =
new ilRadioOption($this->lng->txt(
"survey_question_pool_usage_active"), 1);
745 $opt->
setInfo($this->lng->txt(
"survey_question_pool_usage_active_info"));
746 $pool_usage->addOption($opt);
747 $opt =
new ilRadioOption($this->lng->txt(
"survey_question_pool_usage_inactive"), 0);
748 $opt->
setInfo($this->lng->txt(
"survey_question_pool_usage_inactive_info"));
749 $pool_usage->addOption($opt);
750 $pool_usage->setValue($this->object->getPoolUsage());
751 $form->addItem($pool_usage);
754 if($this->object->get360Mode())
756 $self_eval =
new ilCheckboxInputGUI($this->lng->txt(
"survey_360_self_evaluation"),
"self_eval");
757 $self_eval->
setInfo($this->lng->txt(
"survey_360_self_evaluation_info"));
758 $self_eval->setChecked($this->object->get360SelfEvaluation());
759 $form->addItem($self_eval);
761 $self_rate =
new ilCheckboxInputGUI($this->lng->txt(
"survey_360_self_raters"),
"self_rate");
762 $self_rate->
setInfo($this->lng->txt(
"survey_360_self_raters_info"));
763 $self_rate->setChecked($this->object->get360SelfRaters());
764 $form->addItem($self_rate);
766 $self_appr =
new ilCheckboxInputGUI($this->lng->txt(
"survey_360_self_appraisee"),
"self_appr");
767 $self_appr->
setInfo($this->lng->txt(
"survey_360_self_appraisee_info"));
768 $self_appr->setChecked($this->object->get360SelfAppraisee());
769 $form->addItem($self_appr);
775 include_once
"Services/Object/classes/class.ilObjectActivation.php";
776 $this->lng->loadLanguageModule(
'rep');
779 $section->setTitle($this->lng->txt(
'rep_activation_availability'));
783 $act_obj_info = $act_ref_info =
"";
786 $act_obj_info =
' '.$this->lng->txt(
'rep_activation_online_object_info');
787 $act_ref_info = $this->lng->txt(
'rep_activation_access_ref_info');
791 $online->
setInfo($this->lng->txt(
'svy_activation_online_info').$act_obj_info);
792 $online->setChecked($this->object->isOnline());
793 $form->addItem($online);
795 $act_type =
new ilCheckboxInputGUI($this->lng->txt(
'rep_visibility_until'),
'access_type');
797 $act_type->
setChecked($this->object->isActivationLimited());
799 $this->tpl->addJavaScript(
'./Services/Form/js/date_duration.js');
800 include_once
"Services/Form/classes/class.ilDateDurationInputGUI.php";
803 $date = $this->
object->getActivationStartDate();
805 $dur->setStartText($this->lng->txt(
'rep_activation_limited_start'));
806 $date = $this->
object->getActivationEndDate();
808 $dur->setEndText($this->lng->txt(
'rep_activation_limited_end'));
809 $act_type->addSubItem($dur);
811 $visible =
new ilCheckboxInputGUI($this->lng->txt(
'rep_activation_limited_visibility'),
'access_visiblity');
812 $visible->
setInfo($this->lng->txt(
'svy_activation_limited_visibility_info'));
813 $visible->setChecked($this->object->getActivationVisibility());
814 $act_type->addSubItem($visible);
816 $form->addItem($act_type);
822 $section->setTitle($this->lng->txt(
'svy_settings_section_before_start'));
827 $intro->
setValue($this->object->prepareTextareaOutput($this->object->getIntroduction()));
830 $intro->setUseRte(TRUE);
831 $intro->setInfo($this->lng->txt(
"survey_introduction_info"));
832 include_once
"./Services/AdvancedEditing/classes/class.ilObjAdvancedEditing.php";
834 $intro->addPlugin(
"latex");
835 $intro->addButton(
"latex");
836 $intro->addButton(
"pastelatex");
837 $intro->setRTESupport($this->object->getId(),
"svy",
"survey", null, $hide_rte_switch);
838 $form->addItem($intro);
844 $section->setTitle($this->lng->txt(
'svy_settings_section_access'));
848 $start = $this->
object->getStartDate();
849 $enablestartingtime =
new ilCheckboxInputGUI($this->lng->txt(
"start_date"),
"enabled_start_date");
852 $enablestartingtime->setChecked($start);
855 $startingtime->setShowTime(
true);
860 $enablestartingtime->addSubItem($startingtime);
861 $form->addItem($enablestartingtime);
864 $end = $this->
object->getEndDate();
865 $enableendingtime =
new ilCheckboxInputGUI($this->lng->txt(
"end_date"),
"enabled_end_date");
868 $enableendingtime->setChecked($end);
871 $endingtime->setShowTime(
true);
876 $enableendingtime->addSubItem($endingtime);
877 $form->addItem($enableendingtime);
880 if(!$this->object->get360Mode())
883 $codes->
setInfo($this->lng->txt(
"survey_access_codes_info"));
884 $codes->setChecked(!$this->object->isAccessibleWithoutCode());
885 $form->addItem($codes);
887 if ($this->object->_hasDatasets($this->object->getSurveyId()))
889 $codes->setDisabled(
true);
897 $section->setTitle($this->lng->txt(
'svy_settings_section_question_behaviour'));
901 $show_question_titles =
new ilCheckboxInputGUI($this->lng->txt(
"svy_show_questiontitles"),
"show_question_titles");
903 $show_question_titles->setChecked($this->object->getShowQuestionTitles());
904 $form->addItem($show_question_titles);
910 $info->setTitle($this->lng->txt(
"svy_settings_section_finishing"));
911 $form->addItem($info);
913 $view_own =
new ilCheckboxInputGUI($this->lng->txt(
"svy_results_view_own"),
"view_own");
914 $view_own->
setInfo($this->lng->txt(
"svy_results_view_own_info"));
915 $view_own->setChecked($this->object->hasViewOwnResults());
916 $form->addItem($view_own);
918 $mail_own =
new ilCheckboxInputGUI($this->lng->txt(
"svy_results_mail_own"),
"mail_own");
919 $mail_own->
setInfo($this->lng->txt(
"svy_results_mail_own_info"));
920 $mail_own->setChecked($this->object->hasMailOwnResults());
921 $form->addItem($mail_own);
925 $finalstatement->
setValue($this->object->prepareTextareaOutput($this->object->getOutro()));
926 $finalstatement->setRows(10);
927 $finalstatement->setCols(80);
928 $finalstatement->setUseRte(TRUE);
930 $finalstatement->addPlugin(
"latex");
931 $finalstatement->addButton(
"latex");
932 $finalstatement->addButton(
"pastelatex");
933 $finalstatement->setRTESupport($this->object->getId(),
"svy",
"survey", null, $hide_rte_switch);
934 $form->addItem($finalstatement);
937 $mailnotification =
new ilCheckboxInputGUI($this->lng->txt(
"mailnotification"),
"mailnotification");
939 $mailnotification->
setInfo($this->lng->txt(
"svy_result_mail_notification_info"));
940 $mailnotification->setValue(1);
941 $mailnotification->setChecked($this->object->getMailNotification());
944 $mailaddresses =
new ilTextInputGUI($this->lng->txt(
"mailaddresses"),
"mailaddresses");
945 $mailaddresses->
setValue($this->object->getMailAddresses());
946 $mailaddresses->setSize(80);
947 $mailaddresses->setInfo($this->lng->txt(
'mailaddresses_info'));
948 $mailaddresses->setRequired(
true);
951 $participantdata =
new ilTextAreaInputGUI($this->lng->txt(
"mailparticipantdata"),
"mailparticipantdata");
952 $participantdata->
setValue($this->object->getMailParticipantData());
953 $participantdata->setRows(6);
954 $participantdata->setCols(80);
955 $participantdata->setUseRte(
false);
956 $participantdata->setInfo($this->lng->txt(
"mailparticipantdata_info"));
959 $placeholders = array(
960 "FIRST_NAME" =>
"firstname",
961 "LAST_NAME" =>
"lastname",
965 foreach($placeholders as $placeholder => $caption)
967 $txt[] =
"[".strtoupper($placeholder).
"]: ".$this->lng->txt($caption);
970 $participantdatainfo =
new ilNonEditableValueGUI($this->lng->txt(
"mailparticipantdata_placeholder"),
"",
true);
973 $mailnotification->addSubItem($mailaddresses);
974 $mailnotification->addSubItem($participantdata);
975 $mailnotification->addSubItem($participantdatainfo);
976 $form->addItem($mailnotification);
979 if(!$this->object->get360Mode())
983 $has_parent = $tree->checkForParentType($this->object->getRefId(),
"grp");
986 $has_parent = $tree->checkForParentType($this->object->getRefId(),
"crs");
988 $num_inv =
sizeof($this->
object->getInvitedUsers());
991 $tut =
new ilCheckboxInputGUI($this->lng->txt(
"survey_notification_tutor_setting"),
"tut");
992 $tut->
setChecked($this->object->getTutorNotificationStatus());
993 $form->addItem($tut);
995 $tut_logins = array();
996 $tuts = $this->
object->getTutorNotificationRecipients();
999 foreach($tuts as $tut_id)
1004 $tut_logins[] = $tmp[
"login"];
1008 $tut_ids =
new ilTextInputGUI($this->lng->txt(
"survey_notification_tutor_recipients"),
"tut_ids");
1009 $tut_ids->
setDataSource($this->ctrl->getLinkTarget($this,
"doAutoComplete",
"",
true));
1010 $tut_ids->setRequired(
true);
1011 $tut_ids->setMulti(
true);
1012 $tut_ids->setMultiValues($tut_logins);
1013 $tut_ids->setValue(array_shift($tut_logins));
1014 $tut->addSubItem($tut_ids);
1016 $tut_grp =
new ilRadioGroupInputGUI($this->lng->txt(
"survey_notification_target_group"),
"tut_grp");
1018 $tut_grp->setValue($this->object->getTutorNotificationTarget());
1019 $tut->addSubItem($tut_grp);
1021 $tut_grp_crs =
new ilRadioOption($this->lng->txt(
"survey_notification_target_group_parent_course"),
1025 $tut_grp_crs->
setInfo($this->lng->txt(
"survey_notification_target_group_parent_course_inactive"));
1027 $tut_grp->addOption($tut_grp_crs);
1029 $tut_grp_inv =
new ilRadioOption($this->lng->txt(
"survey_notification_target_group_invited"),
1031 $tut_grp_inv->
setInfo(sprintf($this->lng->txt(
"survey_notification_target_group_invited_info"), $num_inv));
1032 $tut_grp->addOption($tut_grp_inv);
1039 if(!$this->object->get360Mode())
1042 $info->setTitle($this->lng->txt(
"svy_settings_section_reminders"));
1043 $form->addItem($info);
1046 $rmd->
setChecked($this->object->getReminderStatus());
1047 $form->addItem($rmd);
1049 $rmd_start =
new ilDateTimeInputGUI($this->lng->txt(
"survey_reminder_start"),
"rmd_start");
1051 $start = $this->
object->getReminderStart();
1054 $rmd_start->setDate($start);
1056 $rmd->addSubItem($rmd_start);
1058 $end = $this->
object->getReminderEnd();
1059 $rmd_end =
new ilDateTimeInputGUI($this->lng->txt(
"survey_reminder_end"),
"rmd_end");
1063 $rmd_end->setDate($end);
1065 $rmd->addSubItem($rmd_end);
1067 $rmd_freq =
new ilNumberInputGUI($this->lng->txt(
"survey_reminder_frequency"),
"rmd_freq");
1069 $rmd_freq->setSize(3);
1070 $rmd_freq->setSuffix($this->lng->txt(
"survey_reminder_frequency_days"));
1071 $rmd_freq->setValue($this->object->getReminderFrequency());
1072 $rmd_freq->setMinValue(1);
1073 $rmd->addSubItem($rmd_freq);
1075 $rmd_grp =
new ilRadioGroupInputGUI($this->lng->txt(
"survey_notification_target_group"),
"rmd_grp");
1077 $rmd_grp->setValue($this->object->getReminderTarget());
1078 $rmd->addSubItem($rmd_grp);
1080 $rmd_grp_crs =
new ilRadioOption($this->lng->txt(
"survey_notification_target_group_parent_course"),
1084 $rmd_grp_crs->
setInfo($this->lng->txt(
"survey_notification_target_group_parent_course_inactive"));
1086 $rmd_grp->addOption($rmd_grp_crs);
1088 $rmd_grp_inv =
new ilRadioOption($this->lng->txt(
"survey_notification_target_group_invited"),
1090 $rmd_grp_inv->
setInfo(sprintf($this->lng->txt(
"survey_notification_target_group_invited_info"), $num_inv));
1091 $rmd_grp->addOption($rmd_grp_inv);
1098 $results->setTitle($this->lng->txt(
"results"));
1102 if(!$this->object->get360Mode())
1104 $evaluation_access =
new ilRadioGroupInputGUI($this->lng->txt(
'evaluation_access'),
"evaluation_access");
1107 $option->
setInfo($this->lng->txt(
"svy_evaluation_access_off_info"));
1108 $evaluation_access->addOption($option);
1111 $option->
setInfo($this->lng->txt(
"svy_evaluation_access_all_info"));
1112 $evaluation_access->addOption($option);
1115 $option->
setInfo($this->lng->txt(
"svy_evaluation_access_participants_info"));
1116 $evaluation_access->addOption($option);
1118 $evaluation_access->setValue($this->object->getEvaluationAccess());
1119 $form->addItem($evaluation_access);
1122 $anonymization_options =
new ilRadioGroupInputGUI($this->lng->txt(
"survey_results_anonymization"),
"anonymization_options");
1124 $option =
new ilCheckboxOption($this->lng->txt(
"survey_results_personalized"),
"statpers");
1125 $option->
setInfo($this->lng->txt(
"survey_results_personalized_info"));
1126 $anonymization_options->addOption($option);
1128 $option =
new ilCheckboxOption($this->lng->txt(
"survey_results_anonymized"),
"statanon");
1129 $option->
setInfo($this->lng->txt(
"survey_results_anonymized_info"));
1130 $anonymization_options->addOption($option);
1131 $anonymization_options->setValue($this->object->hasAnonymizedResults()
1134 $form->addItem($anonymization_options);
1136 if ($this->object->_hasDatasets($this->object->getSurveyId()))
1138 $anonymization_options->setDisabled(
true);
1145 $ts_results->
setValue($this->object->get360Results());
1148 $option->
setInfo($this->lng->txt(
"survey_360_results_none_info"));
1149 $ts_results->addOption($option);
1152 $option->
setInfo($this->lng->txt(
"survey_360_results_own_info"));
1153 $ts_results->addOption($option);
1156 $option->
setInfo($this->lng->txt(
"survey_360_results_all_info"));
1157 $ts_results->addOption($option);
1158 $form->addItem($ts_results);
1164 include_once(
"./Services/Skill/classes/class.ilSkillManagementSettings.php");
1166 if($this->object->get360Mode() && $skmg_set->isActivated())
1169 $other->setTitle($this->lng->txt(
"other"));
1170 $form->addItem($other);
1172 $skill_service =
new ilCheckboxInputGUI($this->lng->txt(
"survey_activate_skill_service"),
"skill_service");
1173 $skill_service->
setInfo($this->lng->txt(
"survey_activate_skill_service_info"));
1174 $skill_service->setChecked($this->object->get360SkillService());
1175 $form->addItem($skill_service);
1179 $form->addCommandButton(
"saveProperties", $this->lng->txt(
"save"));
1182 if($template_settings)
1184 foreach($template_settings as $id => $item)
1188 $form->removeItemByPostVar($id);
1203 global $ilTabs, $ilHelp;
1207 $ilTabs->activateTab(
"settings");
1210 if ($this->object->get360Mode())
1212 $ilHelp->setScreenId(
"settings_360");
1222 if($this->object->getTemplate())
1224 $link = $this->ctrl->getLinkTarget($this,
"confirmResetTemplate");
1225 $link =
"<a href=\"".$link.
"\">".$this->lng->txt(
"survey_using_template_link").
"</a>";
1226 $message =
"<div style=\"margin-top:10px\">".
1227 $this->tpl->getMessageHTML(sprintf($this->lng->txt(
"survey_using_template"),
1232 $this->tpl->setContent($a_form->getHTML().$message);
1237 $fields = array(
'login',
'firstname',
'lastname',
'email');
1239 include_once
'./Services/User/classes/class.ilUserAutoComplete.php';
1241 $auto->setSearchFields($fields);
1242 $auto->setResultField(
'login');
1243 $auto->enableFieldSearchableCheck(
true);
1244 $auto->setMoreLinkAvailable(
true);
1261 $this->tpl->addBlockFile(
"ADM_CONTENT",
"adm_content",
"tpl.il_svy_svy_confirm_resettemplate.html",
"Modules/Survey");
1262 $this->tpl->setCurrentBlock(
"adm_content");
1263 $this->tpl->setVariable(
"BTN_CONFIRM_REMOVE", $this->lng->txt(
"confirm"));
1264 $this->tpl->setVariable(
"BTN_CANCEL_REMOVE", $this->lng->txt(
"cancel"));
1265 $this->tpl->setVariable(
"FORM_ACTION", $this->ctrl->getFormAction($this,
"resetTemplateObject"));
1266 $this->tpl->parseCurrentBlock();
1274 $this->
object->setTemplate(null);
1275 $this->
object->saveToDB();
1278 $this->ctrl->redirect($this,
"properties");
1289 include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
1291 $form->setTarget(
"_top");
1292 $form->setFormAction($this->ctrl->getFormAction($this));
1293 $form->setTitle($this->lng->txt(
"import_svy"));
1295 include_once(
"./Services/Form/classes/class.ilFileInputGUI.php");
1296 $fi =
new ilFileInputGUI($this->lng->txt(
"import_file"),
"importfile");
1298 $fi->setRequired(
true);
1299 $form->addItem($fi);
1301 include_once(
"./Modules/Survey/classes/class.ilObjSurvey.php");
1303 $questionspools = $svy->getAvailableQuestionpools(
true,
true,
true);
1305 $pools =
new ilSelectInputGUI($this->lng->txt(
"select_questionpool_short"),
"spl");
1306 $pools->
setOptions(array(
""=>$this->lng->txt(
"dont_use_questionpool")) + $questionspools);
1307 $pools->setRequired(
false);
1308 $form->addItem($pools);
1310 $form->addCommandButton(
"importFile", $this->lng->txt(
"import"));
1311 $form->addCommandButton(
"cancel", $this->lng->txt(
"cancel"));
1323 $parent_id =
$_GET[
"ref_id"];
1329 $ilErr->raiseError($this->lng->txt(
"no_create_permission"));
1332 $this->lng->loadLanguageModule($new_type);
1333 $this->ctrl->setParameter($this,
"new_type", $new_type);
1336 if ($form->checkInput())
1338 include_once(
"./Modules/Survey/classes/class.ilObjSurvey.php");
1340 $newObj->setType($new_type);
1341 $newObj->setTitle(
"dummy");
1342 $newObj->setDescription(
"dummy");
1343 $newObj->create(
true);
1347 $error = $newObj->importObject($_FILES[
"importfile"], $form->getInput(
"spl"));
1351 $this->ilias->raiseError($error, $this->ilias->error_obj->MESSAGE);
1357 "&baseClass=ilObjSurveyGUI");
1360 include_once
"Services/Administration/classes/class.ilSettingsTemplate.php";
1365 $tpl->addJavaScript(
"./Modules/Scorm2004/scripts/questions/jquery.js");
1368 $this->tpl->setCurrentBlock(
"template_option");
1369 $this->tpl->setVariable(
"VAL_TEMPLATE_OPTION",
"");
1370 $this->tpl->setVariable(
"TXT_TEMPLATE_OPTION", $this->lng->txt(
"none"));
1371 $this->tpl->parseCurrentBlock();
1373 foreach($templates as $item)
1375 $this->tpl->setCurrentBlock(
"template_option");
1376 $this->tpl->setVariable(
"VAL_TEMPLATE_OPTION", $item[
"id"]);
1377 $this->tpl->setVariable(
"TXT_TEMPLATE_OPTION", $item[
"title"]);
1378 $this->tpl->parseCurrentBlock();
1380 $desc = str_replace(
"\n",
"", nl2br($item[
"description"]));
1381 $desc = str_replace(
"\r",
"", $desc);
1383 $this->tpl->setCurrentBlock(
"js_data");
1384 $this->tpl->setVariable(
"JS_DATA_ID", $item[
"id"]);
1385 $this->tpl->setVariable(
"JS_DATA_TEXT", $desc);
1386 $this->tpl->parseCurrentBlock();
1389 $this->tpl->setCurrentBlock(
"templates");
1390 $this->tpl->setVariable(
"TXT_TEMPLATE", $this->lng->txt(
"svy_settings_template"));
1391 $this->tpl->parseCurrentBlock();
1396 $form->setValuesByPost();
1397 $tpl->setContent($form->getHtml());
1405 global $ilTabs, $ilToolbar;
1408 $ilTabs->activateTab(
"export");
1410 include_once
"Services/UIComponent/Button/classes/class.ilLinkButton.php";
1412 $button->setCaption(
"svy_create_export_file");
1413 $button->setUrl($this->ctrl->getLinkTarget($this,
"createExportFile"));
1414 $ilToolbar->addButtonInstance($button);
1416 $export_dir = $this->
object->getExportDirectory();
1417 $export_files = $this->
object->getExportFiles($export_dir);
1419 if(count($export_files) > 0)
1421 foreach($export_files as $exp_file)
1423 $file_arr = explode(
"__", $exp_file);
1425 array_push(
$data, array(
1426 'file' => $exp_file,
1427 'size' => filesize($export_dir.
"/".$exp_file),
1433 include_once
"./Modules/Survey/classes/tables/class.ilSurveyExportTableGUI.php";
1435 $table_gui->setData(
$data);
1436 $this->tpl->setVariable(
'ADM_CONTENT', $table_gui->getHTML());
1445 include_once(
"./Modules/Survey/classes/class.ilSurveyExport.php");
1447 $survey_exp->buildExportFile();
1448 $this->ctrl->redirect($this,
"export");
1456 if(!isset(
$_POST[
"file"]))
1459 $this->ctrl->redirect($this,
"export");
1462 if (count(
$_POST[
"file"]) > 1)
1465 $this->ctrl->redirect($this,
"export");
1470 $export_dir = $this->
object->getExportDirectory();
1471 include_once
"./Services/Utilities/classes/class.ilUtil.php";
1483 $ilTabs->activateTab(
"export");
1485 if (!isset(
$_POST[
"file"]))
1488 $this->ctrl->redirect($this,
"export");
1493 $export_dir = $this->
object->getExportDirectory();
1494 $export_files = $this->
object->getExportFiles($export_dir);
1496 if (count(
$_POST[
"file"]) > 0)
1498 foreach (
$_POST[
"file"] as $exp_file)
1500 $file_arr = explode(
"__", $exp_file);
1502 array_push(
$data, array(
1503 'file' => $exp_file,
1504 'size' => filesize($export_dir.
"/".$exp_file),
1510 include_once
"./Modules/Survey/classes/tables/class.ilSurveyExportTableGUI.php";
1512 $table_gui->setData(
$data);
1513 $this->tpl->setVariable(
'ADM_CONTENT', $table_gui->getHTML());
1523 $this->ctrl->redirect($this,
"export");
1532 $export_dir = $this->
object->getExportDirectory();
1535 $file = basename($file);
1537 $exp_file = $export_dir.
"/".
$file;
1538 $exp_dir = $export_dir.
"/".substr($file, 0, strlen($file) - 4);
1539 if (@is_file($exp_file))
1543 if (@is_dir($exp_dir))
1545 include_once
"./Services/Utilities/classes/class.ilUtil.php";
1550 $this->ctrl->redirect($this,
"export");
1565 $this->ctrl->setCmd(
"showSummary");
1566 $this->ctrl->setCmdClass(
"ilinfoscreengui");
1575 global $ilAccess, $ilTabs,
$ilUser, $ilToolbar;
1577 if (!$this->external_rater_360 &&
1578 !$ilAccess->checkAccess(
"visible",
"", $this->ref_id))
1580 $this->ilias->raiseError($this->lng->txt(
"msg_no_perm_read"),$this->ilias->error_obj->MESSAGE);
1583 $ilTabs->activateTab(
"info_short");
1585 include_once
"./Modules/Survey/classes/class.ilSurveyExecutionGUI.php";
1588 include_once(
"./Services/InfoScreen/classes/class.ilInfoScreenGUI.php");
1590 $info->enablePrivateNotes();
1593 $canStart = $this->
object->canStartSurvey(null, $this->external_rater_360);
1595 $showButtons = $canStart[
"result"];
1598 if($canStart[
"edit_settings"] &&
1599 $ilAccess->checkAccess(
"write",
"", $this->ref_id))
1601 $canStart[
"messages"][] =
"<a href=\"".$this->ctrl->getLinkTarget($this,
"properties").
"\">» ".
1602 $this->lng->txt(
"survey_edit_settings").
"</a>";
1607 $big_button =
false;
1611 $is_appraisee =
false;
1612 if($this->object->get360Mode() &&
1613 $this->
object->isAppraisee($ilUser->getId()))
1615 $info->addSection($this->lng->txt(
"survey_360_appraisee_info"));
1617 $appr_data = $this->
object->getAppraiseesData();
1618 $appr_data = $appr_data[$ilUser->getId()];
1619 $info->addProperty($this->lng->txt(
"survey_360_raters_status_info"), $appr_data[
"finished"]);
1621 if(!$appr_data[
"closed"])
1623 include_once
"Services/UIComponent/Button/classes/class.ilLinkButton.php";
1625 $button->setCaption(
"survey_360_appraisee_close_action");
1626 $button->setUrl($this->ctrl->getLinkTargetByClass(
"ilsurveyparticipantsgui",
"confirmappraiseeclose"));
1627 $close_button_360 =
'<div>'.$button->render().
'</div>';
1629 $txt =
"survey_360_appraisee_close_action_info";
1630 if($this->object->get360SkillService())
1634 $info->addProperty($this->lng->txt(
"status"),
1635 $close_button_360.$this->lng->txt(
$txt));
1642 $info->addProperty($this->lng->txt(
"status"),
1643 sprintf($this->lng->txt(
"survey_360_appraisee_close_action_status"),
1647 $is_appraisee =
true;
1654 $code_input =
false;
1655 $anonymous_code =
$_POST[
"anonymous_id"];
1656 if ($anonymous_code)
1660 if(!$this->object->checkSurveyCode($anonymous_code))
1662 $anonymous_code = null;
1667 $this->
object->bindSurveyCodeToUser($ilUser->getId(), $anonymous_code);
1670 if ($anonymous_code)
1672 $_SESSION[
"anonymous_id"][$this->
object->getId()] = $anonymous_code;
1676 $anonymous_code =
$_SESSION[
"anonymous_id"][$this->
object->getId()];
1684 if($this->object->getAnonymize() && !$anonymous_code)
1686 $anonymous_code = $this->
object->findCodeForUser($ilUser->getId());
1690 $participant_status = $this->
object->getUserSurveyExecutionStatus($anonymous_code);
1691 if($participant_status)
1693 $anonymous_code = $participant_status[
"code"];
1694 $participant_status = $participant_status[
"runs"];
1698 if(!$this->object->isAccessibleWithoutCode() &&
1701 (!$anonymous_code || !$this->
object->isAnonymousKey($anonymous_code)))
1703 $anonymous_code = null;
1708 $_SESSION[
"anonymous_id"][$this->
object->getId()] = $anonymous_code;
1711 if(!$is_appraisee &&
1713 !$this->object->isAccessibleWithoutCode())
1715 $info->setFormAction($this->ctrl->getFormAction($this,
"infoScreen"));
1716 $info->addSection($this->lng->txt(
"anonymization"));
1717 $info->addProperty(
"", $this->lng->txt(
"anonymize_anonymous_introduction"));
1718 $info->addPropertyTextinput($this->lng->txt(
"enter_anonymous_id"),
"anonymous_id",
"", 8,
"infoScreen", $this->lng->txt(
"submit"),
true);
1723 if(!$this->object->get360Mode())
1727 $info->addHiddenElement(
"anonymous_id", $anonymous_code);
1730 $survey_started = $this->
object->isSurveyStarted($ilUser->getId(), $anonymous_code);
1731 if ($survey_started === 1)
1733 if($ilUser->getId() != ANONYMOUS_USER_ID)
1735 if($this->object->hasViewOwnResults())
1737 include_once
"Services/UIComponent/Button/classes/class.ilLinkButton.php";
1739 $button->setCaption(
"svy_view_own_results");
1740 $button->setUrl($this->ctrl->getLinkTarget($this,
"viewUserResults"));
1741 $ilToolbar->addButtonInstance($button);
1744 if($this->object->hasMailOwnResults())
1746 if($this->object->hasViewOwnResults())
1748 $ilToolbar->addSeparator();
1751 require_once
"Services/Form/classes/class.ilTextInputGUI.php";
1754 $mail->setValue($ilUser->getEmail());
1755 $ilToolbar->addInputItem($mail,
true);
1757 $ilToolbar->setFormAction($this->ctrl->getFormAction($this,
"mailUserResults"));
1759 include_once
"Services/UIComponent/Button/classes/class.ilSubmitButton.php";
1761 $button->setCaption(
"svy_mail_own_results");
1762 $button->setCommand(
"mailUserResults");
1763 $ilToolbar->addButtonInstance($button);
1769 elseif ($survey_started === 0)
1771 $big_button = array(
"resume", $this->lng->txt(
"resume_survey"));
1773 elseif ($survey_started === FALSE)
1775 $big_button = array(
"start", $this->lng->txt(
"start_survey"));
1781 $appr_ids = array();
1786 $anonymous_id = $this->
object->getAnonymousIdByCode($anonymous_code);
1789 $appr_ids = $this->
object->getAppraiseesToRate(0, $anonymous_id);
1795 if(!$appr_ids && $ilUser->getId() != ANONYMOUS_USER_ID)
1797 $appr_ids = $this->
object->getAppraiseesToRate($ilUser->getId());
1800 if(
sizeof($appr_ids))
1803 $active_appraisees = array();
1804 if($participant_status)
1806 foreach($participant_status as $item)
1808 $active_appraisees[$item[
"appr_id"]] = $item[
"finished"];
1814 foreach($appr_ids as $appr_id)
1816 if($this->object->isAppraiseeClosed($appr_id))
1819 $list[$appr_id] = $this->lng->txt(
"survey_360_appraisee_is_closed");
1821 else if(array_key_exists($appr_id, $active_appraisees))
1824 if($active_appraisees[$appr_id])
1826 $list[$appr_id] = $this->lng->txt(
"already_completed_survey");
1831 $list[$appr_id] = array(
"resume", $this->lng->txt(
"resume_survey"));
1837 $list[$appr_id] = array(
"start", $this->lng->txt(
"start_survey"));
1841 $info->addSection($this->lng->txt(
"survey_360_rate_other_appraisees"));
1843 include_once
"Services/User/classes/class.ilUserUtil.php";
1844 foreach($list as $appr_id => $item)
1848 if(!is_array($item))
1850 $info->addProperty($appr_name, $item);
1854 $this->ctrl->setParameter($output_gui,
"appr_id", $appr_id);
1855 $href = $this->ctrl->getLinkTarget($output_gui, $item[0]);
1856 $this->ctrl->setParameter($output_gui,
"appr_id",
"");
1858 include_once
"Services/UIComponent/Button/classes/class.ilLinkButton.php";
1860 $button->setCaption($item[1],
false);
1861 $button->setUrl($href);
1862 $big_button_360 =
'<div>'.$button->render().
'</div>';
1864 $info->addProperty($appr_name, $big_button_360);
1868 else if(!$is_appraisee)
1875 if($this->object->get360Mode() &&
1876 $this->
object->get360SelfAppraisee() &&
1877 !$this->
object->isAppraisee($ilUser->getId()) &&
1878 $ilUser->getId() != ANONYMOUS_USER_ID)
1880 $link = $this->ctrl->getLinkTargetByClass(
"ilsurveyparticipantsgui",
"addSelfAppraisee");
1881 $link =
'<a href="'.$link.
'">'.$this->lng->txt(
"survey_360_add_self_appraisee").
'</a>';
1882 $info->addProperty(
" ", $link);
1888 $ilToolbar->setFormAction($this->ctrl->getFormAction($output_gui,
"infoScreen"));
1890 include_once
"Services/UIComponent/Button/classes/class.ilSubmitButton.php";
1892 $button->setCaption($big_button[1],
false);
1893 $button->setCommand($big_button[0]);
1894 $button->setPrimary(
true);
1895 $ilToolbar->addButtonInstance($button);
1897 $ilToolbar->setCloseFormTag(
false);
1898 $info->setOpenFormTag(
false);
1907 if (strlen($this->object->getIntroduction()))
1909 $introduction = $this->
object->getIntroduction();
1910 $info->addSection($this->lng->txt(
"introduction"));
1911 $info->addProperty(
"", $this->object->prepareTextareaOutput($introduction).
1912 "<br />".$info->getHiddenToggleButton());
1916 $info->addSection(
"");
1917 $info->addProperty(
"", $info->getHiddenToggleButton());
1920 $info->hideFurtherSections(
false);
1922 if(!$this->object->get360Mode())
1924 $info->addSection($this->lng->txt(
"svy_general_properties"));
1926 $info->addProperty($this->lng->txt(
"survey_results_anonymization"),
1927 !$this->
object->hasAnonymizedResults()
1928 ? $this->lng->txt(
"survey_results_personalized_info")
1929 : $this->lng->txt(
"survey_results_anonymized_info"));
1931 include_once
"./Modules/Survey/classes/class.ilObjSurveyAccess.php";
1932 if ($ilAccess->checkAccess(
"write",
"", $this->ref_id) ||
1935 $info->addProperty($this->lng->txt(
"evaluation_access"), $this->lng->txt(
"evaluation_access_info"));
1939 $info->addMetaDataSections($this->object->getId(),0, $this->
object->getType());
1941 $this->ctrl->forwardCommand($info);
1947 switch ($this->ctrl->getCmd())
1953 case "redirectQuestion":
1954 $ilLocator->addItem($this->object->getTitle(), $this->ctrl->getLinkTarget($this,
"infoScreen"),
"",
$_GET[
"ref_id"]);
1957 case "checkEvaluationAccess":
1958 case "evaluationdetails":
1959 case "evaluationuser":
1960 $ilLocator->addItem($this->object->getTitle(), $this->ctrl->getLinkTargetByClass(
"ilsurveyevaluationgui",
"evaluation"),
"",
$_GET[
"ref_id"]);
1969 $ilLocator->addItem($this->object->getTitle(), $this->ctrl->getLinkTarget($this,
"infoScreen"),
"",
$_GET[
"ref_id"]);
1972 $ilLocator->addItem($this->object->getTitle(), $this->ctrl->getLinkTarget($this,
""),
"",
$_GET[
"ref_id"]);
1979 $q_id = (int)
$_GET[
"q_id"];
1980 include_once
"./Modules/SurveyQuestionPool/classes/class.SurveyQuestion.php";
1982 $this->ctrl->setParameterByClass($q_type,
"q_id", $q_id);
1984 $this->ctrl->getLinkTargetByClass(array(
"ilSurveyEditorGUI", $q_type),
"editQuestion"));
1997 public static function _goto($a_target, $a_access_code =
"")
2002 include_once
"./Services/Utilities/classes/class.ilUtil.php";
2003 if (strlen($a_access_code))
2006 $_GET[
"baseClass"] =
"ilObjSurveyGUI";
2007 $_GET[
"cmd"] =
"infoScreen";
2008 $_GET[
"ref_id"] = $a_target;
2009 include(
"ilias.php");
2013 if ($ilAccess->checkAccess(
"read",
"", $a_target))
2015 $_GET[
"baseClass"] =
"ilObjSurveyGUI";
2016 $_GET[
"cmd"] =
"infoScreen";
2017 $_GET[
"ref_id"] = $a_target;
2018 include(
"ilias.php");
2021 else if ($ilAccess->checkAccess(
"read",
"", ROOT_FOLDER_ID))
2028 $ilErr->raiseError($lng->txt(
"msg_no_perm_read_lm"), $ilErr->FATAL);
2033 $rtpl =
new ilTemplate(
"tpl.svy_view_user_results.html",
true,
true,
"Modules/Survey");
2035 $show_titles = (bool)$this->object->getShowQuestionTitles();
2037 foreach($this->object->getSurveyPages() as $page)
2039 if(count($page) > 0)
2042 if(count($page) > 1)
2044 if((
bool)$page[0][
"questionblock_show_blocktitle"])
2046 $rtpl->setVariable(
"BLOCK_TITLE", trim($page[0][
"questionblock_title"]));
2051 foreach($page as $question)
2053 $question_gui = $this->
object->getQuestionGUI($question[
"type_tag"], $question[
"question_id"]);
2054 if(is_object($question_gui))
2056 $rtpl->setCurrentBlock(
"question_bl");
2059 if(strlen($question[
"heading"]))
2061 $rtpl->setVariable(
"HEADING", trim($question[
"heading"]));
2064 $rtpl->setVariable(
"QUESTION_DATA",
2065 $question_gui->getPrintView(
2067 (
bool)$question[
"questionblock_show_questiontext"],
2068 $this->object->getId(),
2069 $this->
object->loadWorkingData($question[
"question_id"], $a_active_id)
2073 $rtpl->parseCurrentBlock();
2077 $rtpl->setCurrentBlock(
"block_bl");
2078 $rtpl->parseCurrentBlock();
2082 return $rtpl->get();
2089 $anonymous_code =
$_SESSION[
"anonymous_id"][$this->
object->getId()];
2090 $active_id = $this->
object->getActiveID($ilUser->getId(), $anonymous_code, 0);
2091 if($this->object->isSurveyStarted($ilUser->getId(), $anonymous_code) !== 1 ||
2094 $this->ctrl->redirect($this,
"infoScreen");
2097 $ilTabs->clearTargets();
2098 $ilTabs->setBackTarget($this->lng->txt(
"btn_back"),
2099 $this->ctrl->getLinkTarget($this,
"infoScreen"));
2102 $tpl->setContent($html);
2109 $show_titles = (bool)$this->object->getShowQuestionTitles();
2111 foreach($this->object->getSurveyPages() as $page)
2113 if(count($page) > 0)
2115 $res[] =
"\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n";
2118 if(count($page) > 1)
2120 if((
bool)$page[0][
"questionblock_show_blocktitle"])
2122 $res[$this->lng->txt(
"questionblock")] = trim($page[0][
"questionblock_title"]).
"\n";
2128 $page_res = array();
2130 foreach($page as $question)
2132 $question_gui = $this->
object->getQuestionGUI($question[
"type_tag"], $question[
"question_id"]);
2133 if(is_object($question_gui))
2135 $question_parts = array();
2138 if(strlen($question[
"heading"]))
2140 $question_parts[$this->lng->txt(
"heading")] = trim($question[
"heading"]);
2145 $question_parts[$this->lng->txt(
"title")] = trim($question[
"title"]);
2148 if((
bool)$question[
"questionblock_show_questiontext"])
2150 $question_parts[$this->lng->txt(
"question")] = trim(strip_tags($question_gui->object->getQuestionText()));
2153 $answers = $question_gui->getParsedAnswers(
2154 $this->object->loadWorkingData($question[
"question_id"], $a_active_id),
2158 if(
sizeof($answers))
2161 if(
sizeof($answers) > 1 ||
2162 get_class($question_gui) ==
"SurveyTextQuestionGUI")
2168 foreach($answers as $answer)
2171 if($answer[
"textanswer"])
2173 $text =
' ("'.$answer[
"textanswer"].
'")';
2175 if(!isset($answer[
"cols"]))
2177 if(isset($answer[
"title"]))
2179 $parts[] = $answer[
"title"].$text;
2181 else if(isset($answer[
"value"]))
2183 $parts[] = $answer[
"value"];
2187 $parts[] = substr($text, 2, -1);
2194 foreach($answer[
"cols"] as $col)
2196 $tmp[] = $col[
"title"];
2198 $parts[] = $answer[
"title"].
": ".implode(
", ", $tmp).$text;
2202 $question_parts[$this->lng->txt(
"answer")] =
2203 ($multiline ?
"\n" :
"").implode(
"\n", $parts);
2207 foreach($question_parts as $type => $value)
2209 $tmp[] = $type.
": ".$value;
2211 $page_res[] = implode(
"\n", $tmp);
2215 $res[] = implode(
"\n\n-------------------------------\n\n", $page_res);
2219 $res[] =
"\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n";
2221 return implode(
"\n",
$res);
2228 $finished = $this->
object->getSurveyParticipants(array($a_active_id));
2229 $finished = array_pop($finished);
2232 require_once
"Services/Mail/classes/class.ilMail.php";
2233 require_once
"Services/Link/classes/class.ilLink.php";
2236 $body .= $this->lng->txt(
"svy_mail_own_results_body").
"\n";
2237 $body .=
"\n".$this->lng->txt(
"obj_svy").
": ".$this->
object->getTitle().
"\n";
2239 $body .=
"\n".$this->lng->txt(
"survey_results_finished").
": ".$finished.
"\n\n";
2246 require_once
"Services/Mail/classes/class.ilMail.php";
2247 $mail =
new ilMail(ANONYMOUS_USER_ID);
2248 $mail->sendMimeMail(
2252 sprintf($this->lng->txt(
"svy_mail_own_results_subject"), $this->
object->getTitle()),
2263 $anonymous_code =
$_SESSION[
"anonymous_id"][$this->
object->getId()];
2264 $active_id = $this->
object->getActiveID($ilUser->getId(), $anonymous_code, 0);
2265 if($this->object->isSurveyStarted($ilUser->getId(), $anonymous_code) !== 1 ||
2268 $this->ctrl->redirect($this,
"infoScreen");
2271 $recipient =
$_POST[
"mail"];
2274 $this->ctrl->redirect($this,
"infoScreen");
2280 $this->ctrl->redirect($this,
"infoScreen");