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":
98 $ilTabs->activateTab(
"meta_data");
100 include_once
'Services/MetaData/classes/class.ilMDEditorGUI.php';
101 $md_gui =&
new ilMDEditorGUI($this->object->getId(), 0, $this->
object->getType());
102 $md_gui->
addObserver($this->
object,
'MDUpdateListener',
'General');
104 $this->ctrl->forwardCommand($md_gui);
107 case "ilsurveyevaluationgui":
108 $ilTabs->activateTab(
"svy_results");
110 include_once(
"./Modules/Survey/classes/class.ilSurveyEvaluationGUI.php");
112 $this->ctrl->forwardCommand($eval_gui);
115 case "ilsurveyexecutiongui":
116 $ilTabs->clearTargets();
117 include_once(
"./Modules/Survey/classes/class.ilSurveyExecutionGUI.php");
119 $this->ctrl->forwardCommand($exec_gui);
122 case 'ilpermissiongui':
123 $ilTabs->activateTab(
"perm_settings");
125 include_once(
"Services/AccessControl/classes/class.ilPermissionGUI.php");
127 $this->ctrl->forwardCommand($perm_gui);
130 case 'ilobjectcopygui':
131 include_once
'./Services/Object/classes/class.ilObjectCopyGUI.php';
134 $this->ctrl->forwardCommand($cp);
137 case "ilcommonactiondispatchergui":
138 include_once(
"Services/Object/classes/class.ilCommonActionDispatcherGUI.php");
140 $this->ctrl->forwardCommand($gui);
144 case 'ilsurveyskillgui':
145 $ilTabs->activateTab(
"survey_competences");
146 include_once(
"./Modules/Survey/classes/class.ilSurveySkillGUI.php");
148 $this->ctrl->forwardCommand($gui);
151 case 'ilsurveyskilldeterminationgui':
152 $ilTabs->activateTab(
"maintenance");
153 include_once(
"./Modules/Survey/classes/class.ilSurveySkillDeterminationGUI.php");
155 $this->ctrl->forwardCommand($gui);
158 case 'ilsurveyeditorgui':
160 $ilTabs->activateTab(
"survey_questions");
161 include_once(
"./Modules/Survey/classes/class.ilSurveyEditorGUI.php");
163 $this->ctrl->forwardCommand($gui);
166 case 'ilsurveyconstraintsgui':
168 $ilTabs->activateTab(
"constraints");
169 include_once(
"./Modules/Survey/classes/class.ilSurveyConstraintsGUI.php");
171 $this->ctrl->forwardCommand($gui);
174 case 'ilsurveyparticipantsgui':
175 if(!$this->object->get360Mode())
177 $ilTabs->activateTab(
"maintenance");
181 $ilTabs->activateTab(
"survey_360_appraisees");
183 include_once(
"./Modules/Survey/classes/class.ilSurveyParticipantsGUI.php");
185 $this->ctrl->forwardCommand($gui);
195 if (strtolower(
$_GET[
"baseClass"]) !=
"iladministrationgui" &&
211 include_once(
"./Modules/Survey/classes/class.ilSurveyEvaluationGUI.php");
213 $this->ctrl->setCmdClass(get_class($eval_gui));
214 $this->ctrl->redirect($eval_gui,
"evaluation");
219 include_once
"Services/Administration/classes/class.ilSettingsTemplate.php";
223 foreach($templates as $item)
225 $a_options[
"svytpl_".$item[
"id"]] = array($item[
"title"],
226 nl2br(trim($item[
"description"])));
231 $a_options[
"svy360_1"] = array($this->lng->txt(
"survey_360_mode"),
232 $this->lng->txt(
"survey_360_mode_info"));
244 $a_new_object->applySettingsTemplate(
$tpl);
248 if($a_new_object->get360Mode())
253 $a_new_object->saveToDB();
258 $a_new_object->
getRefId().
"&cmd=properties");
268 global $ilAccess,
$ilUser, $ilHelp;
275 $ilHelp->setScreenIdComponent(
"svy");
277 $hidden_tabs = array();
278 $template = $this->
object->getTemplate();
281 include_once
"Services/Administration/classes/class.ilSettingsTemplate.php";
283 $hidden_tabs = $template->getHiddenTabs();
286 if ($ilAccess->checkAccess(
"write",
"", $this->ref_id))
288 $tabs_gui->addTab(
"survey_questions",
289 $this->lng->txt(
"survey_questions"),
290 $this->ctrl->getLinkTargetByClass(array(
"ilsurveyeditorgui",
"ilsurveypagegui"),
"renderPage"));
293 if ($ilAccess->checkAccess(
"visible",
"", $this->ref_id))
295 $tabs_gui->addTab(
"info_short",
296 $this->lng->txt(
"info_short"),
297 $this->ctrl->getLinkTarget($this,
'infoScreen'));
301 if ($ilAccess->checkAccess(
"write",
"", $this->ref_id))
303 $tabs_gui->addTab(
"settings",
304 $this->lng->txt(
"settings"),
305 $this->ctrl->getLinkTarget($this,
'properties'));
307 else if ($ilAccess->checkAccess(
"read",
"", $this->ref_id))
309 if($this->object->get360Mode() &&
310 $this->
object->get360SelfRaters() &&
311 $this->
object->isAppraisee($ilUser->getId()) &&
312 !$this->object->isAppraiseeClosed($ilUser->getId()))
314 $tabs_gui->addTab(
"survey_360_edit_raters",
315 $this->lng->txt(
"survey_360_edit_raters"),
316 $this->ctrl->getLinkTargetByClass(
'ilsurveyparticipantsgui',
'editRaters'));
323 if ($ilAccess->checkAccess(
"write",
"", $this->ref_id) &&
324 !in_array(
"constraints", $hidden_tabs) &&
325 !$this->
object->get360Mode())
328 $tabs_gui->addTab(
"constraints",
329 $this->lng->txt(
"constraints"),
330 $this->ctrl->getLinkTargetByClass(
"ilsurveyconstraintsgui",
"constraints"));
333 if ($ilAccess->checkAccess(
"write",
"", $this->ref_id))
336 if($this->object->get360Mode())
339 include_once(
"./Services/Skill/classes/class.ilSkillManagementSettings.php");
341 if ($this->object->get360SkillService() && $skmg_set->isActivated())
343 $tabs_gui->addTab(
"survey_competences",
344 $this->lng->txt(
"survey_competences"),
345 $this->ctrl->getLinkTargetByClass(
"ilsurveyskillgui",
"listQuestionAssignment"));
348 $tabs_gui->addTab(
"survey_360_appraisees",
349 $this->lng->txt(
"survey_360_appraisees"),
350 $this->ctrl->getLinkTargetByClass(
'ilsurveyparticipantsgui',
'listAppraisees'));
355 $tabs_gui->addTab(
"maintenance",
356 $this->lng->txt(
"maintenance"),
357 $this->ctrl->getLinkTargetByClass(
'ilsurveyparticipantsgui',
'maintenance'));
361 include_once
"./Modules/Survey/classes/class.ilObjSurveyAccess.php";
362 if ($ilAccess->checkAccess(
"write",
"", $this->ref_id) ||
366 $tabs_gui->addTab(
"svy_results",
367 $this->lng->txt(
"svy_results"),
368 $this->ctrl->getLinkTargetByClass(
"ilsurveyevaluationgui",
""));
371 if ($ilAccess->checkAccess(
"write",
"", $this->ref_id))
373 if(!in_array(
"meta_data", $hidden_tabs))
376 $tabs_gui->addTab(
"meta_data",
377 $this->lng->txt(
"meta_data"),
378 $this->ctrl->getLinkTargetByClass(
'ilmdeditorgui',
'listSection'));
381 if(!in_array(
"export", $hidden_tabs))
384 $tabs_gui->addTab(
"export",
385 $this->lng->txt(
"export"),
386 $this->ctrl->getLinkTarget($this,
'export'));
390 if ($ilAccess->checkAccess(
"edit_permission",
"", $this->ref_id))
393 $tabs_gui->addTab(
"perm_settings",
394 $this->lng->txt(
"perm_settings"),
395 $this->ctrl->getLinkTargetByClass(array(get_class($this),
'ilpermissiongui'),
"perm"));
409 if (!$ilAccess->checkAccess(
"write",
"", $this->ref_id))
413 $this->ctrl->redirect($this,
"infoScreen");
434 if ($form->checkInput())
438 if(!$this->object->get360Mode())
440 if($form->getInput(
"tut"))
444 $tut_logins = $form->getInput(
"tut_ids");
445 foreach($tut_logins as $tut_login)
448 if($tut_id && $rbacsystem->checkAccessOfUser($tut_id,
"write", $this->object->getRefId()))
450 $tut_ids[] = $tut_id;
455 $tut_ids = $form->getItemByPostVar(
"tut_ids");
456 $tut_ids->setAlert($this->lng->txt(
"survey_notification_tutor_recipients_invalid"));
464 if(!$this->object->get360Mode())
466 if($form->getInput(
"rmd"))
468 $rmd_start = $form->getInput(
"rmd_start");
469 $rmd_start = $rmd_start[
"date"];
471 if($form->getInput(
"rmd_end_tgl"))
473 $rmd_end = $form->getInput(
"rmd_end");
474 $rmd_end = $rmd_end[
"date"];
475 if($rmd_start > $rmd_end)
478 $rmd_start = $rmd_end;
485 $this->
object->setReminderStatus(
true);
486 $this->
object->setReminderStart($rmd_start);
487 $this->
object->setReminderEnd($rmd_end);
488 $this->
object->setReminderFrequency($form->getInput(
"rmd_freq"));
489 $this->
object->setReminderTarget($form->getInput(
"rmd_grp"));
493 $this->
object->setReminderStatus(
false);
496 if($form->getInput(
"tut"))
498 $this->
object->setTutorNotificationStatus(
true);
499 $this->
object->setTutorNotificationRecipients($tut_ids);
500 $this->
object->setTutorNotificationTarget($form->getInput(
"tut_grp"));
504 $this->
object->setTutorNotificationStatus(
false);
509 if (
$_POST[
'online'] && count($this->object->questions) == 0)
515 $template_settings = null;
516 $template = $this->
object->getTemplate();
519 include_once
"Services/Administration/classes/class.ilSettingsTemplate.php";
521 $template_settings = $template->getSettings();
524 include_once
'Services/MetaData/classes/class.ilMD.php';
525 $md_obj =&
new ilMD($this->object->getId(), 0,
"svy");
533 $md_desc_ids = $md_section->getDescriptionIds();
536 $md_desc = $md_section->getDescription(array_pop($md_desc_ids));
544 $this->
object->update();
546 $this->
object->setStatus(
$_POST[
'online']);
551 $this->
object->setActivationLimited(
true);
552 $this->
object->setActivationVisibility(
$_POST[
"access_visiblity"]);
554 $period = $form->getItemByPostVar(
"access_period");
555 $this->
object->setActivationStartDate($period->getStart()->get(
IL_CAL_UNIX));
556 $this->
object->setActivationEndDate($period->getEnd()->get(
IL_CAL_UNIX));
560 $this->
object->setActivationLimited(
false);
564 if(!$template_settings[
"enabled_start_date"][
"hide"])
566 if (
$_POST[
"enabled_start_date"])
568 $this->
object->setStartDateAndTime(
$_POST[
"start_date"][
'date'],
$_POST[
"start_date"][
'time']);
572 $this->
object->setStartDate(null);
576 if(!$template_settings[
"enabled_end_date"][
"hide"])
578 if (
$_POST[
"enabled_end_date"])
580 $this->
object->setEndDateAndTime(
$_POST[
"end_date"][
'date'],
$_POST[
"end_date"][
'time']);
584 $this->
object->setEndDate(null);
589 include_once
"./Services/AdvancedEditing/classes/class.ilObjAdvancedEditing.php";
590 $introduction =
$_POST[
"introduction"];
591 $this->
object->setIntroduction($introduction);
593 $this->
object->setOutro($outro);
595 if(!$template_settings[
"show_question_titles"][
"hide"])
597 $this->
object->setShowQuestionTitles(
$_POST[
"show_question_titles"]);
600 if(!$template_settings[
"use_pool"][
"hide"])
602 $this->
object->setPoolUsage(
$_POST[
"use_pool"]);
605 $this->
object->setMailNotification(
$_POST[
'mailnotification']);
606 $this->
object->setMailAddresses(
$_POST[
'mailaddresses']);
607 $this->
object->setMailParticipantData(
$_POST[
'mailparticipantdata']);
610 if($this->object->get360Mode())
612 $this->
object->set360SelfEvaluation((
bool)
$_POST[
"self_eval"]);
613 $this->
object->set360SelfAppraisee((
bool)$_POST[
"self_appr"]);
614 $this->
object->set360SelfRaters((
bool)$_POST[
"self_rate"]);
615 $this->
object->set360Results((
int)$_POST[
"ts_res"]);;
616 $this->
object->set360SkillService((
int)$_POST[
"skill_service"]);
620 $this->
object->setEvaluationAccess(
$_POST[
"evaluation_access"]);
622 $hasDatasets = $this->
object->_hasDatasets($this->object->getSurveyId());
628 if(array_key_exists(
$_POST[
"anonymization_options"], $anon_map))
630 $this->
object->setAnonymize($anon_map[
$_POST[
"anonymization_options"]]);
637 $this->
object->saveToDb();
647 $this->ctrl->redirect($this,
"properties");
651 $form->setValuesByPost();
662 $template_settings = $hide_rte_switch = null;
663 $template = $this->
object->getTemplate();
666 include_once
"Services/Administration/classes/class.ilSettingsTemplate.php";
669 $template_settings = $template->getSettings();
670 $hide_rte_switch = $template_settings[
"rte_switch"][
"hide"];
673 include_once(
"./Services/Form/classes/class.ilPropertyFormGUI.php");
675 $form->setFormAction($this->ctrl->getFormAction($this));
676 $form->setTableWidth(
"100%");
677 $form->setId(
"survey_properties");
681 $header->setTitle($this->lng->txt(
"settings"));
682 $form->addItem($header);
686 include_once
'Services/MetaData/classes/class.ilMD.php';
687 $md_obj =
new ilMD($this->object->getId(), 0,
"svy");
692 $title->setValue($md_section->getTitle());
693 $form->addItem($title);
695 $ids = $md_section->getDescriptionIds();
698 $desc_obj = $md_section->getDescription(array_pop($ids));
703 $desc->setValue($desc_obj->getDescription());
704 $form->addItem($desc);
708 if(!$this->object->get360Mode())
710 $anonymization_options =
new ilRadioGroupInputGUI($this->lng->txt(
"survey_auth_mode"),
"anonymization_options");
711 $hasDatasets = $this->
object->_hasDatasets($this->object->getSurveyId());
716 $anonymization_options->addOption(
new ilCheckboxOption($this->lng->txt(
"anonymize_personalized"),
717 'personalized',
''));
719 $this->lng->txt(
"anonymize_without_code"),
'anonymize_without_code',
''));
721 $this->lng->txt(
"anonymize_with_code"),
'anonymize_with_code',
''));
722 if(!$this->object->getAnonymize())
724 $anonymization_options->setValue(
'personalized');
728 $anonymization_options->setValue(($this->object->isAccessibleWithoutCode()) ?
729 'anonymize_without_code' :
'anonymize_with_code');
731 $anonymization_options->setInfo($this->lng->txt(
"anonymize_survey_description"));
732 $form->addItem($anonymization_options);
737 $self_eval =
new ilCheckboxInputGUI($this->lng->txt(
"survey_360_self_evaluation"),
"self_eval");
738 $self_eval->
setChecked($this->object->get360SelfEvaluation());
739 $form->addItem($self_eval);
741 $self_rate =
new ilCheckboxInputGUI($this->lng->txt(
"survey_360_self_raters"),
"self_rate");
742 $self_rate->
setChecked($this->object->get360SelfRaters());
743 $form->addItem($self_rate);
745 $self_appr =
new ilCheckboxInputGUI($this->lng->txt(
"survey_360_self_appraisee"),
"self_appr");
746 $self_appr->
setChecked($this->object->get360SelfAppraisee());
747 $form->addItem($self_appr);
751 $pool_usage =
new ilRadioGroupInputGUI($this->lng->txt(
"survey_question_pool_usage"),
"use_pool");
752 $opt =
new ilRadioOption($this->lng->txt(
"survey_question_pool_usage_active"), 1);
753 $opt->
setInfo($this->lng->txt(
"survey_question_pool_usage_active_info"));
754 $pool_usage->addOption($opt);
755 $opt =
new ilRadioOption($this->lng->txt(
"survey_question_pool_usage_inactive"), 0);
756 $opt->
setInfo($this->lng->txt(
"survey_question_pool_usage_inactive_info"));
757 $pool_usage->addOption($opt);
758 $pool_usage->setValue($this->object->getPoolUsage());
759 $form->addItem($pool_usage);
764 include_once
"Services/Object/classes/class.ilObjectActivation.php";
765 $this->lng->loadLanguageModule(
'rep');
768 $section->setTitle($this->lng->txt(
'rep_activation_availability'));
772 $act_obj_info = $act_ref_info =
"";
775 $act_obj_info =
' '.$this->lng->txt(
'rep_activation_online_object_info');
776 $act_ref_info = $this->lng->txt(
'rep_activation_access_ref_info');
780 $online->
setInfo($this->lng->txt(
'svy_activation_online_info').$act_obj_info);
781 $online->setChecked($this->object->isOnline());
782 $form->addItem($online);
784 $act_type =
new ilCheckboxInputGUI($this->lng->txt(
'rep_visibility_until'),
'access_type');
786 $act_type->
setChecked($this->object->isActivationLimited());
788 $this->tpl->addJavaScript(
'./Services/Form/js/date_duration.js');
789 include_once
"Services/Form/classes/class.ilDateDurationInputGUI.php";
792 $date = $this->
object->getActivationStartDate();
794 $dur->setStartText($this->lng->txt(
'rep_activation_limited_start'));
795 $date = $this->
object->getActivationEndDate();
797 $dur->setEndText($this->lng->txt(
'rep_activation_limited_end'));
798 $act_type->addSubItem($dur);
800 $visible =
new ilCheckboxInputGUI($this->lng->txt(
'rep_activation_limited_visibility'),
'access_visiblity');
801 $visible->
setInfo($this->lng->txt(
'svy_activation_limited_visibility_info'));
802 $visible->setChecked($this->object->getActivationVisibility());
803 $act_type->addSubItem($visible);
805 $form->addItem($act_type);
809 $start = $this->
object->getStartDate();
810 $enablestartingtime =
new ilCheckboxInputGUI($this->lng->txt(
"start_date"),
"enabled_start_date");
813 $enablestartingtime->setChecked($start);
816 $startingtime->setShowDate(
true);
817 $startingtime->setShowTime(
true);
822 $enablestartingtime->addSubItem($startingtime);
823 $form->addItem($enablestartingtime);
826 $end = $this->
object->getEndDate();
827 $enableendingtime =
new ilCheckboxInputGUI($this->lng->txt(
"end_date"),
"enabled_end_date");
830 $enableendingtime->setChecked($end);
833 $endingtime->setShowDate(
true);
834 $endingtime->setShowTime(
true);
839 $enableendingtime->addSubItem($endingtime);
840 $form->addItem($enableendingtime);
845 $info->setTitle($this->lng->txt(
"svy_presentation_properties"));
846 $form->addItem($info);
849 $show_question_titles =
new ilCheckboxInputGUI($this->lng->txt(
"svy_show_questiontitles"),
"show_question_titles");
851 $show_question_titles->setChecked($this->object->getShowQuestionTitles());
852 $form->addItem($show_question_titles);
856 $intro->
setValue($this->object->prepareTextareaOutput($this->object->getIntroduction()));
859 $intro->setUseRte(TRUE);
860 $intro->setInfo($this->lng->txt(
"survey_introduction_info"));
861 include_once
"./Services/AdvancedEditing/classes/class.ilObjAdvancedEditing.php";
863 $intro->addPlugin(
"latex");
864 $intro->addButton(
"latex");
865 $intro->addButton(
"pastelatex");
866 $intro->setRTESupport($this->object->getId(),
"svy",
"survey", null, $hide_rte_switch);
867 $form->addItem($intro);
871 $finalstatement->
setValue($this->object->prepareTextareaOutput($this->object->getOutro()));
872 $finalstatement->setRows(10);
873 $finalstatement->setCols(80);
874 $finalstatement->setUseRte(TRUE);
876 $finalstatement->addPlugin(
"latex");
877 $finalstatement->addButton(
"latex");
878 $finalstatement->addButton(
"pastelatex");
879 $finalstatement->setRTESupport($this->object->getId(),
"svy",
"survey", null, $hide_rte_switch);
880 $form->addItem($finalstatement);
885 $results->setTitle($this->lng->txt(
"results"));
889 if(!$this->object->get360Mode())
891 $evaluation_access =
new ilRadioGroupInputGUI($this->lng->txt(
'evaluation_access'),
"evaluation_access");
892 $evaluation_access->
setInfo($this->lng->txt(
'evaluation_access_description'));
896 $evaluation_access->setValue($this->object->getEvaluationAccess());
897 $form->addItem($evaluation_access);
903 $ts_results->
setValue($this->object->get360Results());
907 $form->addItem($ts_results);
911 $mailnotification =
new ilCheckboxInputGUI($this->lng->txt(
"mailnotification"),
"mailnotification");
913 $mailnotification->
setInfo($this->lng->txt(
"svy_result_mail_notification_info"));
914 $mailnotification->setValue(1);
915 $mailnotification->setChecked($this->object->getMailNotification());
918 $mailaddresses =
new ilTextInputGUI($this->lng->txt(
"mailaddresses"),
"mailaddresses");
919 $mailaddresses->
setValue($this->object->getMailAddresses());
920 $mailaddresses->setSize(80);
921 $mailaddresses->setInfo($this->lng->txt(
'mailaddresses_info'));
922 $mailaddresses->setRequired(
true);
925 $participantdata =
new ilTextAreaInputGUI($this->lng->txt(
"mailparticipantdata"),
"mailparticipantdata");
926 $participantdata->
setValue($this->object->getMailParticipantData());
927 $participantdata->setRows(6);
928 $participantdata->setCols(80);
929 $participantdata->setUseRte(
false);
930 $participantdata->setInfo($this->lng->txt(
'mailparticipantdata_info'));
933 $placeholders = array(
934 "FIRST_NAME" =>
"firstname",
935 "LAST_NAME" =>
"lastname",
939 foreach($placeholders as $placeholder => $caption)
941 $txt[] =
"[".strtoupper($placeholder).
"]: ".$this->lng->txt($caption);
943 $txt = implode(
"<br />", $txt);
944 $participantdatainfo =
new ilNonEditableValueGUI($this->lng->txt(
"mailparticipantdata_placeholder"),
"",
true);
945 $participantdatainfo->
setValue($txt);
947 $mailnotification->addSubItem($mailaddresses);
948 $mailnotification->addSubItem($participantdata);
949 $mailnotification->addSubItem($participantdatainfo);
950 $form->addItem($mailnotification);
953 if(!$this->object->get360Mode())
957 $has_parent = $tree->checkForParentType($this->object->getRefId(),
"grp");
960 $has_parent = $tree->checkForParentType($this->object->getRefId(),
"crs");
962 $num_inv =
sizeof($this->
object->getInvitedUsers());
965 $ntf->setTitle($this->lng->txt(
"survey_notification_settings"));
966 $form->addItem($ntf);
970 $rmd->
setChecked($this->object->getReminderStatus());
971 $form->addItem($rmd);
973 $rmd_start =
new ilDateTimeInputGUI($this->lng->txt(
"survey_reminder_start"),
"rmd_start");
975 $start = $this->
object->getReminderStart();
978 $rmd_start->setDate($start);
980 $rmd->addSubItem($rmd_start);
982 $end = $this->
object->getReminderEnd();
987 $rmd_end->setDate($end);
989 $rmd->addSubItem($rmd_end);
991 $rmd_freq =
new ilNumberInputGUI($this->lng->txt(
"survey_reminder_frequency"),
"rmd_freq");
993 $rmd_freq->setSize(3);
994 $rmd_freq->setSuffix($this->lng->txt(
"survey_reminder_frequency_days"));
995 $rmd_freq->setValue($this->object->getReminderFrequency());
996 $rmd_freq->setMinValue(1);
997 $rmd->addSubItem($rmd_freq);
999 $rmd_grp =
new ilRadioGroupInputGUI($this->lng->txt(
"survey_notification_target_group"),
"rmd_grp");
1001 $rmd_grp->setValue($this->object->getReminderTarget());
1002 $rmd->addSubItem($rmd_grp);
1004 $rmd_grp_crs =
new ilRadioOption($this->lng->txt(
"survey_notification_target_group_parent_course"),
1008 $rmd_grp_crs->
setInfo($this->lng->txt(
"survey_notification_target_group_parent_course_inactive"));
1010 $rmd_grp->addOption($rmd_grp_crs);
1012 $rmd_grp_inv =
new ilRadioOption($this->lng->txt(
"survey_notification_target_group_invited"),
1014 $rmd_grp_inv->
setInfo(sprintf($this->lng->txt(
"survey_notification_target_group_invited_info"), $num_inv));
1015 $rmd_grp->addOption($rmd_grp_inv);
1019 $tut =
new ilCheckboxInputGUI($this->lng->txt(
"survey_notification_tutor_setting"),
"tut");
1020 $tut->
setChecked($this->object->getTutorNotificationStatus());
1021 $form->addItem($tut);
1023 $tut_logins = array();
1024 $tuts = $this->
object->getTutorNotificationRecipients();
1027 foreach($tuts as $tut_id)
1032 $tut_logins[] = $tmp[
"login"];
1036 $tut_ids =
new ilTextInputGUI($this->lng->txt(
"survey_notification_tutor_recipients"),
"tut_ids");
1037 $tut_ids->
setDataSource($this->ctrl->getLinkTarget($this,
"doAutoComplete",
"",
true));
1038 $tut_ids->setRequired(
true);
1039 $tut_ids->setMulti(
true);
1040 $tut_ids->setMultiValues($tut_logins);
1041 $tut_ids->setValue(array_shift($tut_logins));
1042 $tut->addSubItem($tut_ids);
1044 $tut_grp =
new ilRadioGroupInputGUI($this->lng->txt(
"survey_notification_target_group"),
"tut_grp");
1046 $tut_grp->setValue($this->object->getTutorNotificationTarget());
1047 $tut->addSubItem($tut_grp);
1049 $tut_grp_crs =
new ilRadioOption($this->lng->txt(
"survey_notification_target_group_parent_course"),
1053 $tut_grp_crs->
setInfo($this->lng->txt(
"survey_notification_target_group_parent_course_inactive"));
1055 $tut_grp->addOption($tut_grp_crs);
1057 $tut_grp_inv =
new ilRadioOption($this->lng->txt(
"survey_notification_target_group_invited"),
1059 $tut_grp_inv->
setInfo(sprintf($this->lng->txt(
"survey_notification_target_group_invited_info"), $num_inv));
1060 $tut_grp->addOption($tut_grp_inv);
1064 include_once(
"./Services/Skill/classes/class.ilSkillManagementSettings.php");
1066 if($this->object->get360Mode() && $skmg_set->isActivated())
1069 $other->setTitle($this->lng->txt(
"other"));
1070 $form->addItem($other);
1072 $skill_service =
new ilCheckboxInputGUI($this->lng->txt(
"survey_activate_skill_service"),
"skill_service");
1073 $skill_service->
setChecked($this->object->get360SkillService());
1074 $form->addItem($skill_service);
1077 $form->addCommandButton(
"saveProperties", $this->lng->txt(
"save"));
1080 if($template_settings)
1082 foreach($template_settings as $id => $item)
1086 $form->removeItemByPostVar($id);
1101 global $ilAccess, $ilTabs, $ilHelp;
1105 $ilTabs->activateTab(
"settings");
1108 if ($this->object->get360Mode())
1110 $ilHelp->setScreenId(
"settings_360");
1120 if($this->object->getTemplate())
1122 $link = $this->ctrl->getLinkTarget($this,
"confirmResetTemplate");
1123 $link =
"<a href=\"".$link.
"\">".$this->lng->txt(
"survey_using_template_link").
"</a>";
1124 $message =
"<div style=\"margin-top:10px\">".
1125 $this->tpl->getMessageHTML(sprintf($this->lng->txt(
"survey_using_template"),
1130 $this->tpl->setContent($a_form->getHTML().$message);
1135 $fields = array(
'login',
'firstname',
'lastname',
'email');
1137 include_once
'./Services/User/classes/class.ilUserAutoComplete.php';
1139 $auto->setSearchFields($fields);
1140 $auto->setResultField(
'login');
1141 $auto->enableFieldSearchableCheck(
true);
1152 $this->tpl->addBlockFile(
"ADM_CONTENT",
"adm_content",
"tpl.il_svy_svy_confirm_resettemplate.html",
"Modules/Survey");
1153 $this->tpl->setCurrentBlock(
"adm_content");
1154 $this->tpl->setVariable(
"BTN_CONFIRM_REMOVE", $this->lng->txt(
"confirm"));
1155 $this->tpl->setVariable(
"BTN_CANCEL_REMOVE", $this->lng->txt(
"cancel"));
1156 $this->tpl->setVariable(
"FORM_ACTION", $this->ctrl->getFormAction($this,
"resetTemplateObject"));
1157 $this->tpl->parseCurrentBlock();
1165 $this->
object->setTemplate(null);
1166 $this->
object->saveToDB();
1169 $this->ctrl->redirect($this,
"properties");
1180 include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
1182 $form->setTarget(
"_top");
1183 $form->setFormAction($this->ctrl->getFormAction($this));
1184 $form->setTitle($this->lng->txt(
"import_svy"));
1186 include_once(
"./Services/Form/classes/class.ilFileInputGUI.php");
1187 $fi =
new ilFileInputGUI($this->lng->txt(
"import_file"),
"importfile");
1189 $fi->setRequired(
true);
1190 $form->addItem($fi);
1192 include_once(
"./Modules/Survey/classes/class.ilObjSurvey.php");
1194 $questionspools = $svy->getAvailableQuestionpools(
true,
true,
true);
1196 $pools =
new ilSelectInputGUI($this->lng->txt(
"select_questionpool_short"),
"spl");
1197 $pools->
setOptions(array(
""=>$this->lng->txt(
"dont_use_questionpool")) + $questionspools);
1198 $pools->setRequired(
false);
1199 $form->addItem($pools);
1201 $form->addCommandButton(
"importFile", $this->lng->txt(
"import"));
1202 $form->addCommandButton(
"cancel", $this->lng->txt(
"cancel"));
1214 $parent_id =
$_GET[
"ref_id"];
1220 $ilErr->raiseError($this->lng->txt(
"no_create_permission"));
1223 $this->lng->loadLanguageModule($new_type);
1224 $this->ctrl->setParameter($this,
"new_type", $new_type);
1227 if ($form->checkInput())
1229 include_once(
"./Modules/Survey/classes/class.ilObjSurvey.php");
1231 $newObj->setType($new_type);
1232 $newObj->setTitle(
"dummy");
1233 $newObj->setDescription(
"dummy");
1234 $newObj->create(
true);
1238 $error = $newObj->importObject($_FILES[
"importfile"], $form->getInput(
"spl"));
1242 $this->ilias->raiseError($error, $this->ilias->error_obj->MESSAGE);
1248 "&baseClass=ilObjSurveyGUI");
1251 include_once
"Services/Administration/classes/class.ilSettingsTemplate.php";
1256 $tpl->addJavaScript(
"./Modules/Scorm2004/scripts/questions/jquery.js");
1259 $this->tpl->setCurrentBlock(
"template_option");
1260 $this->tpl->setVariable(
"VAL_TEMPLATE_OPTION",
"");
1261 $this->tpl->setVariable(
"TXT_TEMPLATE_OPTION", $this->lng->txt(
"none"));
1262 $this->tpl->parseCurrentBlock();
1264 foreach($templates as $item)
1266 $this->tpl->setCurrentBlock(
"template_option");
1267 $this->tpl->setVariable(
"VAL_TEMPLATE_OPTION", $item[
"id"]);
1268 $this->tpl->setVariable(
"TXT_TEMPLATE_OPTION", $item[
"title"]);
1269 $this->tpl->parseCurrentBlock();
1271 $desc = str_replace(
"\n",
"", nl2br($item[
"description"]));
1272 $desc = str_replace(
"\r",
"", $desc);
1274 $this->tpl->setCurrentBlock(
"js_data");
1275 $this->tpl->setVariable(
"JS_DATA_ID", $item[
"id"]);
1276 $this->tpl->setVariable(
"JS_DATA_TEXT", $desc);
1277 $this->tpl->parseCurrentBlock();
1280 $this->tpl->setCurrentBlock(
"templates");
1281 $this->tpl->setVariable(
"TXT_TEMPLATE", $this->lng->txt(
"svy_settings_template"));
1282 $this->tpl->parseCurrentBlock();
1287 $form->setValuesByPost();
1288 $tpl->setContent($form->getHtml());
1299 $ilTabs->activateTab(
"export");
1301 $export_dir = $this->
object->getExportDirectory();
1302 $export_files = $this->
object->getExportFiles($export_dir);
1304 if(count($export_files) > 0)
1306 foreach($export_files as $exp_file)
1308 $file_arr = explode(
"__", $exp_file);
1310 array_push(
$data, array(
1311 'file' => $exp_file,
1312 'size' => filesize($export_dir.
"/".$exp_file),
1318 include_once
"./Modules/Survey/classes/tables/class.ilSurveyExportTableGUI.php";
1320 $table_gui->setData(
$data);
1321 $this->tpl->setVariable(
'ADM_CONTENT', $table_gui->getHTML());
1330 include_once(
"./Modules/Survey/classes/class.ilSurveyExport.php");
1332 $survey_exp->buildExportFile();
1333 $this->ctrl->redirect($this,
"export");
1341 if(!isset(
$_POST[
"file"]))
1344 $this->ctrl->redirect($this,
"export");
1347 if (count(
$_POST[
"file"]) > 1)
1350 $this->ctrl->redirect($this,
"export");
1355 $export_dir = $this->
object->getExportDirectory();
1356 include_once
"./Services/Utilities/classes/class.ilUtil.php";
1368 $ilTabs->activateTab(
"export");
1370 if (!isset(
$_POST[
"file"]))
1373 $this->ctrl->redirect($this,
"export");
1378 $export_dir = $this->
object->getExportDirectory();
1379 $export_files = $this->
object->getExportFiles($export_dir);
1381 if (count(
$_POST[
"file"]) > 0)
1383 foreach (
$_POST[
"file"] as $exp_file)
1385 $file_arr = explode(
"__", $exp_file);
1387 array_push(
$data, array(
1388 'file' => $exp_file,
1389 'size' => filesize($export_dir.
"/".$exp_file),
1395 include_once
"./Modules/Survey/classes/tables/class.ilSurveyExportTableGUI.php";
1397 $table_gui->setData(
$data);
1398 $this->tpl->setVariable(
'ADM_CONTENT', $table_gui->getHTML());
1408 $this->ctrl->redirect($this,
"export");
1417 $export_dir = $this->
object->getExportDirectory();
1420 $file = basename($file);
1422 $exp_file = $export_dir.
"/".
$file;
1423 $exp_dir = $export_dir.
"/".substr($file, 0, strlen($file) - 4);
1424 if (@is_file($exp_file))
1428 if (@is_dir($exp_dir))
1430 include_once
"./Services/Utilities/classes/class.ilUtil.php";
1435 $this->ctrl->redirect($this,
"export");
1450 $this->ctrl->setCmd(
"showSummary");
1451 $this->ctrl->setCmdClass(
"ilinfoscreengui");
1460 global $ilAccess, $ilTabs,
$ilUser, $ilToolbar;
1462 if (!$this->external_rater_360 &&
1463 !$ilAccess->checkAccess(
"visible",
"", $this->ref_id))
1465 $this->ilias->raiseError($this->lng->txt(
"msg_no_perm_read"),$this->ilias->error_obj->MESSAGE);
1468 $ilTabs->activateTab(
"info_short");
1470 include_once
"./Modules/Survey/classes/class.ilSurveyExecutionGUI.php";
1473 include_once(
"./Services/InfoScreen/classes/class.ilInfoScreenGUI.php");
1475 $info->enablePrivateNotes();
1478 $canStart = $this->
object->canStartSurvey(null, $this->external_rater_360);
1480 $showButtons = $canStart[
"result"];
1483 if($canStart[
"edit_settings"] &&
1484 $ilAccess->checkAccess(
"write",
"", $this->ref_id))
1486 $canStart[
"messages"][] =
"<a href=\"".$this->ctrl->getLinkTarget($this,
"properties").
"\">» ".
1487 $this->lng->txt(
"survey_edit_settings").
"</a>";
1492 $big_button =
false;
1496 $is_appraisee =
false;
1497 if($this->object->get360Mode() &&
1498 $this->
object->isAppraisee($ilUser->getId()))
1500 $info->addSection($this->lng->txt(
"survey_360_appraisee_info"));
1502 $appr_data = $this->
object->getAppraiseesData();
1503 $appr_data = $appr_data[$ilUser->getId()];
1504 $info->addProperty($this->lng->txt(
"survey_360_raters_status_info"), $appr_data[
"finished"]);
1506 if(!$appr_data[
"closed"])
1508 $close_button_360 =
'<div>'.
1509 '<a class="submit" href="'.$this->ctrl->getLinkTargetByClass(
"ilsurveyparticipantsgui",
"confirmappraiseeclose").
'">'.
1510 $this->lng->txt(
"survey_360_appraisee_close_action").
'</a></div>';
1512 $txt =
"survey_360_appraisee_close_action_info";
1513 if($this->object->get360SkillService())
1517 $info->addProperty($this->lng->txt(
"status"),
1518 $close_button_360.$this->lng->txt($txt));
1525 $info->addProperty($this->lng->txt(
"status"),
1526 sprintf($this->lng->txt(
"survey_360_appraisee_close_action_status"),
1530 $is_appraisee =
true;
1537 $code_input =
false;
1538 $anonymous_code =
$_POST[
"anonymous_id"];
1539 if ($anonymous_code)
1543 if(!$this->object->checkSurveyCode($anonymous_code))
1545 $anonymous_code = null;
1550 $this->
object->bindSurveyCodeToUser($ilUser->getId(), $anonymous_code);
1553 if ($anonymous_code)
1555 $_SESSION[
"anonymous_id"][$this->
object->getId()] = $anonymous_code;
1559 $anonymous_code =
$_SESSION[
"anonymous_id"][$this->
object->getId()];
1567 if($this->object->getAnonymize() && !$anonymous_code)
1569 $anonymous_code = $this->
object->findCodeForUser($ilUser->getId());
1573 $participant_status = $this->
object->getUserSurveyExecutionStatus($anonymous_code);
1574 if($participant_status)
1576 $anonymous_code = $participant_status[
"code"];
1577 $participant_status = $participant_status[
"runs"];
1581 if(!$this->object->isAccessibleWithoutCode() &&
1584 (!$anonymous_code || !$this->
object->isAnonymousKey($anonymous_code)))
1586 $anonymous_code = null;
1591 $_SESSION[
"anonymous_id"][$this->
object->getId()] = $anonymous_code;
1594 if(!$is_appraisee &&
1596 !$this->object->isAccessibleWithoutCode())
1598 $info->setFormAction($this->ctrl->getFormAction($this,
"infoScreen"));
1599 $info->addSection($this->lng->txt(
"anonymization"));
1600 $info->addProperty(
"", $this->lng->txt(
"anonymize_anonymous_introduction"));
1601 $info->addPropertyTextinput($this->lng->txt(
"enter_anonymous_id"),
"anonymous_id",
"", 8,
"infoScreen", $this->lng->txt(
"submit"),
true);
1606 if(!$this->object->get360Mode())
1610 $info->addHiddenElement(
"anonymous_id", $anonymous_code);
1613 $survey_started = $this->
object->isSurveyStarted($ilUser->getId(), $anonymous_code);
1614 if ($survey_started === 1)
1618 elseif ($survey_started === 0)
1620 $big_button = array(
"resume", $this->lng->txt(
"resume_survey"));
1622 elseif ($survey_started === FALSE)
1624 $big_button = array(
"start", $this->lng->txt(
"start_survey"));
1630 $appr_ids = array();
1635 $anonymous_id = $this->
object->getAnonymousIdByCode($anonymous_code);
1638 $appr_ids = $this->
object->getAppraiseesToRate(0, $anonymous_id);
1644 if(!$appr_ids && $ilUser->getId() != ANONYMOUS_USER_ID)
1646 $appr_ids = $this->
object->getAppraiseesToRate($ilUser->getId());
1649 if(
sizeof($appr_ids))
1652 $active_appraisees = array();
1653 if($participant_status)
1655 foreach($participant_status as $item)
1657 $active_appraisees[$item[
"appr_id"]] = $item[
"finished"];
1663 foreach($appr_ids as $appr_id)
1665 if($this->object->isAppraiseeClosed($appr_id))
1668 $list[$appr_id] = $this->lng->txt(
"survey_360_appraisee_is_closed");
1670 else if(array_key_exists($appr_id, $active_appraisees))
1673 if($active_appraisees[$appr_id])
1675 $list[$appr_id] = $this->lng->txt(
"already_completed_survey");
1680 $list[$appr_id] = array(
"resume", $this->lng->txt(
"resume_survey"));
1686 $list[$appr_id] = array(
"start", $this->lng->txt(
"start_survey"));
1690 $info->addSection($this->lng->txt(
"survey_360_rate_other_appraisees"));
1692 include_once
"Services/User/classes/class.ilUserUtil.php";
1693 foreach($list as $appr_id => $item)
1697 if(!is_array($item))
1699 $info->addProperty($appr_name, $item);
1703 $this->ctrl->setParameter($output_gui,
"appr_id", $appr_id);
1704 $href = $this->ctrl->getLinkTarget($output_gui, $item[0]);
1705 $this->ctrl->setParameter($output_gui,
"appr_id",
"");
1707 $big_button_360 =
'<div>'.
1708 '<a class="submit" href="'.$href.
'">'.$item[1].
'</a></div>';
1710 $info->addProperty($appr_name, $big_button_360);
1714 else if(!$is_appraisee)
1721 if($this->object->get360Mode() &&
1722 $this->
object->get360SelfAppraisee() &&
1723 !$this->
object->isAppraisee($ilUser->getId()) &&
1724 $ilUser->getId() != ANONYMOUS_USER_ID)
1726 $link = $this->ctrl->getLinkTargetByClass(
"ilsurveyparticipantsgui",
"addSelfAppraisee");
1727 $link =
'<a href="'.$link.
'">'.$this->lng->txt(
"survey_360_add_self_appraisee").
'</a>';
1728 $info->addProperty(
" ", $link);
1734 $ilToolbar->setFormAction($this->ctrl->getFormAction($output_gui,
"infoScreen"));
1735 $ilToolbar->addFormButton($big_button[1], $big_button[0],
"",
true);
1736 $ilToolbar->setCloseFormTag(
false);
1737 $info->setOpenFormTag(
false);
1746 if (strlen($this->object->getIntroduction()))
1748 $introduction = $this->
object->getIntroduction();
1749 $info->addSection($this->lng->txt(
"introduction"));
1750 $info->addProperty(
"", $this->object->prepareTextareaOutput($introduction).
1751 "<br />".$info->getHiddenToggleButton());
1755 $info->addSection(
"");
1756 $info->addProperty(
"", $info->getHiddenToggleButton());
1759 $info->hideFurtherSections(
false);
1761 $info->addSection($this->lng->txt(
"svy_general_properties"));
1762 if (strlen($this->object->getAuthor()))
1764 $info->addProperty($this->lng->txt(
"author"), $this->
object->getAuthor());
1766 $info->addProperty($this->lng->txt(
"title"), $this->
object->getTitle());
1767 switch ($this->object->getAnonymize())
1770 $info->addProperty($this->lng->txt(
"anonymization"), $this->lng->txt(
"anonymize_personalized"));
1773 if (
$_SESSION[
"AccountId"] == ANONYMOUS_USER_ID)
1775 $info->addProperty($this->lng->txt(
"anonymization"), $this->lng->txt(
"info_anonymize_with_code"));
1779 $info->addProperty($this->lng->txt(
"anonymization"), $this->lng->txt(
"info_anonymize_registered_user"));
1783 $info->addProperty($this->lng->txt(
"anonymization"), $this->lng->txt(
"info_anonymize_without_code"));
1786 include_once
"./Modules/Survey/classes/class.ilObjSurveyAccess.php";
1789 $info->addProperty($this->lng->txt(
"evaluation_access"), $this->lng->txt(
"evaluation_access_info"));
1791 $info->addMetaDataSections($this->object->getId(),0, $this->
object->getType());
1792 $this->ctrl->forwardCommand($info);
1798 switch ($this->ctrl->getCmd())
1804 case "redirectQuestion":
1805 $ilLocator->addItem($this->object->getTitle(), $this->ctrl->getLinkTarget($this,
"infoScreen"),
"",
$_GET[
"ref_id"]);
1808 case "checkEvaluationAccess":
1809 case "evaluationdetails":
1810 case "evaluationuser":
1811 $ilLocator->addItem($this->object->getTitle(), $this->ctrl->getLinkTargetByClass(
"ilsurveyevaluationgui",
"evaluation"),
"",
$_GET[
"ref_id"]);
1820 $ilLocator->addItem($this->object->getTitle(), $this->ctrl->getLinkTarget($this,
"infoScreen"),
"",
$_GET[
"ref_id"]);
1823 $ilLocator->addItem($this->object->getTitle(), $this->ctrl->getLinkTarget($this,
""),
"",
$_GET[
"ref_id"]);
1830 $q_id = (int)
$_GET[
"q_id"];
1831 include_once
"./Modules/SurveyQuestionPool/classes/class.SurveyQuestion.php";
1833 $this->ctrl->setParameterByClass($q_type,
"q_id", $q_id);
1835 $this->ctrl->getLinkTargetByClass(array(
"ilSurveyEditorGUI", $q_type),
"editQuestion"));
1848 function _goto($a_target, $a_access_code =
"")
1853 include_once
"./Services/Utilities/classes/class.ilUtil.php";
1854 if (strlen($a_access_code))
1857 $_GET[
"baseClass"] =
"ilObjSurveyGUI";
1858 $_GET[
"cmd"] =
"infoScreen";
1859 $_GET[
"ref_id"] = $a_target;
1860 include(
"ilias.php");
1864 if ($ilAccess->checkAccess(
"read",
"", $a_target))
1866 $_GET[
"baseClass"] =
"ilObjSurveyGUI";
1867 $_GET[
"cmd"] =
"infoScreen";
1868 $_GET[
"ref_id"] = $a_target;
1869 include(
"ilias.php");
1872 else if ($ilAccess->checkAccess(
"read",
"", ROOT_FOLDER_ID))
1879 $ilErr->raiseError($lng->txt(
"msg_no_perm_read_lm"), $ilErr->FATAL);