70 $this->tabs =
$DIC->tabs();
71 $this->toolbar =
$DIC->toolbar();
72 $this->access =
$DIC->access();
73 $this->rbacsystem =
$DIC->rbac()->system();
74 $this->
user = $DIC->user();
75 $this->log =
$DIC[
"ilLog"];
80 $this->parent_gui = $a_parent_gui;
81 $this->
object = $this->parent_gui->object;
82 $this->ref_id = $this->
object->getRefId();
83 $this->has_write = (bool) $a_has_write_access;
92 if (!$this->has_write) {
93 include_once
"Modules/Survey/exceptions/class.ilSurveyException.php";
103 $cmd =
$ilCtrl->getCmd(
"maintenance");
104 $next_class = $this->ctrl->getNextClass($this);
106 switch ($next_class) {
107 case 'ilrepositorysearchgui':
108 include_once(
'./Services/Search/classes/class.ilRepositorySearchGUI.php');
111 if (!$_REQUEST[
"appr360"] && !$_REQUEST[
"rate360"]) {
112 $ilTabs->clearTargets();
113 $ilTabs->setBackTarget(
114 $this->lng->txt(
"btn_back"),
115 $this->ctrl->getLinkTarget($this,
"invite")
118 $rep_search->setCallback(
120 'inviteUserGroupObject',
126 $this->ctrl->setReturn($this,
'invite');
127 $this->ctrl->forwardCommand($rep_search);
128 $ilTabs->setTabActive(
'invitation');
129 } elseif ($_REQUEST[
"rate360"]) {
130 $ilTabs->clearTargets();
131 $ilTabs->setBackTarget(
132 $this->lng->txt(
"btn_back"),
133 $this->ctrl->getLinkTarget($this,
"listAppraisees")
136 $this->ctrl->setParameter($this,
"rate360", 1);
137 $this->ctrl->saveParameter($this,
"appr_id");
139 $rep_search->setCallback(
147 $this->ctrl->setReturn($this,
'editRaters');
148 $this->ctrl->forwardCommand($rep_search);
150 $ilTabs->activateTab(
"survey_360_appraisees");
151 $this->ctrl->setParameter($this,
"appr360", 1);
153 $rep_search->setCallback(
161 $this->ctrl->setReturn($this,
'listAppraisees');
162 $this->ctrl->forwardCommand($rep_search);
180 if ($this->object->get360Mode()) {
187 $ilToolbar->addButton(
188 $this->lng->txt(
'svy_delete_all_user_data'),
189 $this->ctrl->getLinkTarget($this,
'deleteAllUserData')
192 include_once
"./Modules/Survey/classes/tables/class.ilSurveyMaintenanceTableGUI.php";
194 $total =&$this->
object->getSurveyParticipants();
196 foreach (
$total as $user_data) {
198 if ((
bool) $user_data[
"finished"]) {
199 $finished = $user_data[
"finished_tstamp"];
201 $wt = $this->
object->getWorkingtimeForParticipant($user_data[
"active_id"]);
202 $last_access = $this->
object->getLastAccess($user_data[
"active_id"]);
203 array_push(
$data, array(
204 'id' => $user_data[
"active_id"],
205 'name' => $user_data[
"sortname"],
206 'login' => $user_data[
"login"],
207 'last_access' => $last_access,
208 'workingtime' => $wt,
209 'finished' => $finished
212 $table_gui->setData(
$data);
213 $this->tpl->setVariable(
'ADM_CONTENT', $table_gui->getHTML());
218 $surveySetting =
new ilSetting(
"survey");
219 if ($surveySetting->get(
"anonymous_participants",
false)) {
220 if ($this->object->hasAnonymizedResults() &&
221 $this->object->hasAnonymousUserList()) {
222 $end = $this->
object->getEndDate();
224 $min = $surveySetting->get(
"anonymous_participants_min", 0);
225 $total = $this->
object->getSurveyParticipants();
226 if (!$min ||
sizeof(
$total) >= $min) {
247 $ilTabs->addSubTabTarget(
249 $this->ctrl->getLinkTarget($this,
'maintenance'),
250 array(
"maintenance",
"deleteAllUserData"),
255 $ilTabs->addSubTabTarget(
256 "svy_anonymous_participants_svy",
257 $this->ctrl->getLinkTarget($this,
'listParticipants'),
258 array(
"listParticipants"),
263 if (!$this->object->isAccessibleWithoutCode()) {
264 $ilTabs->addSubTabTarget(
266 $this->ctrl->getLinkTarget($this,
'codes'),
267 array(
"codes",
"editCodes",
"createSurveyCodes",
"setCodeLanguage",
"deleteCodes",
"exportCodes",
268 "importExternalMailRecipientsFromFileForm",
"importExternalMailRecipientsFromTextForm"),
273 $hidden_tabs = array();
274 $template = $this->
object->getTemplate();
276 include_once
"Services/Administration/classes/class.ilSettingsTemplate.php";
278 $hidden_tabs =
$template->getHiddenTabs();
282 if (!in_array(
"invitation", $hidden_tabs)) {
283 $ilTabs->addSubTabTarget(
285 $this->ctrl->getLinkTarget($this,
'invite'),
286 array(
"invite",
"saveInvitationStatus",
287 "inviteUserGroup",
"disinviteUserGroup"),
292 $data = $this->
object->getExternalCodeRecipients();
294 $ilTabs->addSubTabTarget(
296 $this->ctrl->getLinkTarget($this,
"mailCodes"),
297 array(
"mailCodes",
"sendCodesMail",
"insertSavedMessage",
"deleteSavedMessage"),
309 if (is_array(
$_POST[
"user_select"])) {
310 foreach (
$_POST[
"user_select"] as $user_id) {
311 $this->
object->disinviteUser($user_id);
315 $this->ctrl->redirect($this,
"invite");
325 if (is_array($a_user_ids)) {
326 foreach ($a_user_ids as $user_id) {
327 $this->
object->inviteUser($user_id);
338 $this->ctrl->redirect($this,
"invite");
346 $mode =
$_POST[
'invitation'];
358 $this->
object->saveToDb();
360 $this->ctrl->redirect($this,
"invite");
376 include_once(
"./Services/Form/classes/class.ilPropertyFormGUI.php");
378 $form->setFormAction($this->ctrl->getFormAction($this));
379 $form->setTableWidth(
"500");
380 $form->setId(
"invite");
384 $header->setTitle($this->lng->txt(
"invitation"));
389 $invitation->setInfo($this->lng->txt(
'invitation_mode_desc'));
390 $invitation->addOption(
new ilRadioOption($this->lng->txt(
"invitation_off"), 0,
''));
391 $surveySetting =
new ilSetting(
"survey");
392 if ($surveySetting->get(
"unlimited_invitation")) {
393 $invitation->addOption(
new ilRadioOption($this->lng->txt(
"unlimited_users"), 1,
''));
395 $invitation->addOption(
new ilRadioOption($this->lng->txt(
"predefined_users"), 2,
''));
397 if ($this->object->getInvitation()) {
398 $inv = $this->
object->getInvitationMode() + 1;
400 $invitation->setValue($inv);
401 $form->addItem($invitation);
403 $form->addCommandButton(
"saveInvitationStatus", $this->lng->txt(
"save"));
405 $this->tpl->addBlockFile(
"ADM_CONTENT",
"adm_content",
"tpl.il_svy_svy_invite.html",
"Modules/Survey");
406 $this->tpl->setVariable(
"INVITATION_TABLE",
$form->getHTML());
408 if ($this->object->getInvitation() && $this->object->getInvitationMode() == 1) {
410 include_once
'./Services/Search/classes/class.ilRepositorySearchGUI.php';
415 'auto_complete_name' =>
$lng->txt(
'user'),
416 'submit_name' =>
$lng->txt(
'svy_invite_action')
420 $ilToolbar->addSpacer();
422 $ilToolbar->addButton(
423 $this->lng->txt(
"svy_search_users"),
424 $this->ctrl->getLinkTargetByClass(
'ilRepositorySearchGUI',
'')
427 $this->tpl->setVariable(
"ADM_CONTENT",
$form->getHTML());
429 $invited_users = $this->
object->getUserData($this->object->getInvitedUsers());
430 include_once
"./Modules/Survey/classes/tables/class.ilSurveyInvitedUsersTableGUI.php";
432 $table_gui->setData($invited_users);
433 $this->tpl->setVariable(
'TBL_INVITED_USERS', $table_gui->getHTML());
442 include_once
"Services/Utilities/classes/class.ilConfirmationGUI.php";
444 $cgui->setHeaderText($this->lng->txt(
"confirm_delete_all_user_data"));
445 $cgui->setFormAction($this->ctrl->getFormAction($this,
"deleteAllUserData"));
446 $cgui->setCancel($this->lng->txt(
"cancel"),
"cancelDeleteAllUserData");
447 $cgui->setConfirm($this->lng->txt(
"confirm"),
"confirmDeleteAllUserData");
448 $this->tpl->setContent($cgui->getHTML());
456 $this->
object->deleteAllUserData();
459 if ($this->object->get360Mode()) {
460 $this->
object->openAllAppraisees();
464 $this->ctrl->redirect($this,
"maintenance");
472 $this->ctrl->redirect($this,
"maintenance");
480 $this->
object->removeSelectedSurveyResults(
$_POST[
"chbUser"]);
482 $this->ctrl->redirect($this,
"maintenance");
491 $this->ctrl->redirect($this,
"maintenance");
501 if (!is_array(
$_POST[
"chbUser"]) || count(
$_POST[
"chbUser"]) == 0) {
503 $this->ctrl->redirect($this,
"maintenance");
507 include_once
"./Modules/Survey/classes/tables/class.ilSurveyMaintenanceTableGUI.php";
509 $total =&$this->
object->getSurveyParticipants();
511 foreach (
$total as $user_data) {
512 if (in_array($user_data[
'active_id'],
$_POST[
'chbUser'])) {
513 $last_access = $this->
object->getLastAccess($user_data[
"active_id"]);
514 array_push(
$data, array(
515 'id' => $user_data[
"active_id"],
516 'name' => $user_data[
"sortname"],
517 'login' => $user_data[
"login"],
518 'last_access' => $last_access
522 $table_gui->setData(
$data);
523 $this->tpl->setVariable(
'ADM_CONTENT', $table_gui->getHTML());
531 if (strcmp(
$_POST[
"lang"],
"-1") != 0) {
536 $this->ctrl->redirect($this,
'codes');
550 if ($this->object->isAccessibleWithoutCode()) {
554 $default_lang =
$ilUser->getPref(
"survey_code_language");
557 $ilToolbar->setFormAction($this->ctrl->getFormAction($this));
559 include_once(
"./Services/Form/classes/class.ilTextInputGUI.php");
563 $ilToolbar->addInputItem(
$si,
true);
565 include_once
"Services/UIComponent/Button/classes/class.ilSubmitButton.php";
568 $button->setCaption(
"create");
569 $button->setCommand(
"createSurveyCodes");
570 $ilToolbar->addButtonInstance($button);
572 $ilToolbar->addSeparator();
575 $button->setCaption(
"import_from_file");
576 $button->setCommand(
"importExternalMailRecipientsFromFileForm");
577 $ilToolbar->addButtonInstance($button);
580 $button->setCaption(
"import_from_text");
581 $button->setCommand(
"importExternalMailRecipientsFromTextForm");
582 $ilToolbar->addButtonInstance($button);
584 $ilToolbar->addSeparator();
587 $button->setCaption(
"svy_import_codes");
588 $button->setCommand(
"importAccessCodes");
589 $ilToolbar->addButtonInstance($button);
591 $ilToolbar->addSeparator();
593 $languages = $this->lng->getInstalledLanguages();
595 $this->lng->loadLanguageModule(
"meta");
596 foreach ($languages as
$lang) {
599 include_once(
"./Services/Form/classes/class.ilSelectInputGUI.php");
602 $si->setValue($default_lang);
603 $ilToolbar->addInputItem(
$si,
true);
606 $button->setCaption(
"set");
607 $button->setCommand(
"setCodeLanguage");
608 $ilToolbar->addButtonInstance($button);
610 include_once
"./Modules/Survey/classes/tables/class.ilSurveyCodesTableGUI.php";
612 $survey_codes = $this->
object->getSurveyCodesTableData(
null, $default_lang);
613 $table_gui->setData($survey_codes);
614 $this->tpl->setContent($table_gui->getHTML());
619 if (isset(
$_GET[
"new_ids"])) {
620 $ids = explode(
";",
$_GET[
"new_ids"]);
622 $ids = (array)
$_POST[
"chb_code"];
626 $this->ctrl->redirect($this,
'codes');
632 include_once
"./Modules/Survey/classes/tables/class.ilSurveyCodesEditTableGUI.php";
634 $table_gui->setData($this->object->getSurveyCodesTableData($ids));
635 $this->tpl->setContent($table_gui->getHTML());
640 if (!is_array(
$_POST[
"chb_code"])) {
641 $this->ctrl->redirect($this,
'codes');
647 if (!$this->object->updateCode(
666 $this->ctrl->redirect($this,
'codes');
671 if (is_array(
$_POST[
"chb_code"]) && (count(
$_POST[
"chb_code"]) > 0)) {
672 include_once(
"./Services/Utilities/classes/class.ilConfirmationGUI.php");
674 $cgui->setHeaderText($this->lng->txt(
"survey_code_delete_sure"));
676 $cgui->setFormAction($this->ctrl->getFormAction($this));
677 $cgui->setCancel($this->lng->txt(
"cancel"),
"codes");
678 $cgui->setConfirm($this->lng->txt(
"confirm"),
"deleteCodes");
680 $data = $this->
object->getSurveyCodesTableData(
$_POST[
"chb_code"]);
682 foreach (
$data as $item) {
687 $title = array($item[
"code"]);
688 $item[
"email"] ?
$title[] = $item[
"email"] :
null;
689 $item[
"last_name"] ?
$title[] = $item[
"last_name"] :
null;
690 $item[
"first_name"] ?
$title[] = $item[
"first_name"] :
null;
693 $cgui->addItem(
"chb_code[]", $item[
"code"],
$title);
696 $this->tpl->setContent($cgui->getHTML());
699 $this->ctrl->redirect($this,
'codes');
708 if (is_array(
$_POST[
"chb_code"]) && (count(
$_POST[
"chb_code"]) > 0)) {
709 foreach (
$_POST[
"chb_code"] as $survey_code) {
710 $this->
object->deleteSurveyCode($survey_code);
716 $this->ctrl->redirect($this,
'codes');
724 if (is_array(
$_POST[
"chb_code"]) && (count(
$_POST[
"chb_code"]) > 0)) {
725 $export = $this->
object->getSurveyCodesForExport(
null,
$_POST[
"chb_code"]);
729 $this->ctrl->redirect($this,
'codes');
738 $export = $this->
object->getSurveyCodesForExport();
750 include_once(
"./Services/Form/classes/class.ilPropertyFormGUI.php");
752 $form_import_file->setFormAction($this->ctrl->getFormAction($this));
753 $form_import_file->setTableWidth(
"100%");
754 $form_import_file->setId(
"codes_import_file");
757 $headerfile->setTitle($this->lng->txt(
"svy_import_codes"));
758 $form_import_file->addItem($headerfile);
760 $export_file =
new ilFileInputGUI($this->lng->txt(
"codes"),
"codes");
762 $this->lng->txt(
'svy_import_codes_info'),
763 $this->lng->txt(
"export_all_survey_codes")
765 $export_file->setSuffixes(array(
"csv"));
766 $export_file->setRequired(
true);
767 $form_import_file->addItem($export_file);
769 $form_import_file->addCommandButton(
"importAccessCodesAction", $this->lng->txt(
"import"));
770 $form_import_file->addCommandButton(
"codes", $this->lng->txt(
"cancel"));
772 $this->tpl->setContent($form_import_file->getHTML());
780 if (trim($_FILES[
'codes'][
'tmp_name'])) {
782 foreach ($this->object->getSurveyCodesTableData() as $item) {
783 $existing[$item[
"code"]] = $item[
"id"];
786 include_once
"./Services/Utilities/classes/class.ilCSVReader.php";
788 $reader->open($_FILES[
'codes'][
'tmp_name']);
789 foreach (
$reader->getDataArrayFromCSVFile() as
$row) {
790 if (
sizeof(
$row) == 8) {
795 if (!array_key_exists(
$code, $existing)) {
797 if (strlen($created) == 10) {
806 ,
"lastname" => $last_name
807 ,
"firstname" => $first_name
809 $this->
object->importSurveyCode(
$code, $created, $user_data);
817 $this->ctrl->redirect($this,
'codes');
825 if (is_numeric(
$_POST[
"nrOfCodes"])) {
826 $ids = $this->
object->createSurveyCodes(
$_POST[
"nrOfCodes"]);
828 $this->ctrl->setParameter($this,
"new_ids", implode(
";", $ids));
829 $this->ctrl->redirect($this,
'editCodes');
832 $this->ctrl->redirect($this,
'codes');
841 include_once(
"./Modules/Survey/classes/forms/FormMailCodesGUI.php");
843 $form_gui->setValuesByPost();
845 if ($form_gui->getSavedMessages()->getValue() > 0) {
847 $settings = $this->
object->getUserSettings(
$ilUser->getId(),
'savemessage');
848 $form_gui->getMailMessage()->setValue($settings[$form_gui->getSavedMessages()->getValue()][
'value']);
853 }
catch (Exception $e) {
855 $ilLog->write(
'Error: ' + $e->getMessage());
857 $this->tpl->setVariable(
"ADM_CONTENT", $form_gui->getHTML());
865 include_once(
"./Modules/Survey/classes/forms/FormMailCodesGUI.php");
867 $form_gui->setValuesByPost();
869 if ($form_gui->getSavedMessages()->getValue() > 0) {
870 $this->
object->deleteUserSettings($form_gui->getSavedMessages()->getValue());
872 $form_gui->setValuesByPost();
877 }
catch (Exception $e) {
879 $ilLog->write(
'Error: ' + $e->getMessage());
881 $this->tpl->setVariable(
"ADM_CONTENT", $form_gui->getHTML());
889 $mailData[
'm_subject'] = (array_key_exists(
'm_subject',
$_POST)) ?
$_POST[
'm_subject'] :
sprintf($this->lng->txt(
'default_codes_mail_subject'), $this->
object->getTitle());
890 $mailData[
'm_message'] = (array_key_exists(
'm_message',
$_POST)) ?
$_POST[
'm_message'] : $this->lng->txt(
'default_codes_mail_message');
891 $mailData[
'm_notsent'] = (array_key_exists(
'm_notsent',
$_POST)) ?
$_POST[
'm_notsent'] :
'1';
893 include_once(
"./Modules/Survey/classes/forms/FormMailCodesGUI.php");
895 $form_gui->setValuesByArray($mailData);
896 $this->tpl->setVariable(
"ADM_CONTENT", $form_gui->getHTML());
906 include_once(
"./Modules/Survey/classes/forms/FormMailCodesGUI.php");
908 if ($form_gui->checkInput()) {
909 $url_exists = strpos(
$_POST[
'm_message'],
'[url]') !==
false;
912 $form_gui->setValuesByPost();
914 if (
$_POST[
'savemessage'] == 1) {
916 $title = (strlen(
$_POST[
'savemessagetitle'])) ?
$_POST[
'savemessagetitle'] : ilStr::substr(
$_POST[
'm_message'], 0, 40) .
'...';
917 $this->
object->saveUserSettings(
$ilUser->getId(),
'savemessage',
$title,
$_POST[
'm_message']);
922 $lang = $this->lng->getDefaultLanguage();
926 $this->ctrl->redirect($this,
'mailCodes');
929 $form_gui->setValuesByPost();
931 $this->tpl->setVariable(
"ADM_CONTENT", $form_gui->getHTML());
936 if (trim(
$_POST[
'externaltext'])) {
937 $data = preg_split(
"/[\n\r]/",
$_POST[
'externaltext']);
938 $fields = preg_split(
"/;/", array_shift(
$data));
939 if (!in_array(
'email', $fields)) {
942 $this->ctrl->redirect($this,
'importExternalMailRecipientsFromTextForm');
944 $existingdata = $this->
object->getExternalCodeRecipients();
945 $existingcolumns = array();
946 if (count($existingdata)) {
947 $first = array_shift($existingdata);
948 foreach ($first as
$key => $value) {
949 array_push($existingcolumns,
$key);
952 $founddata = array();
953 foreach (
$data as $datarow) {
954 $row = preg_split(
"/;/", $datarow);
955 if (count(
$row) == count($fields)) {
957 foreach ($fields as $idx => $fieldname) {
958 if (count($existingcolumns)) {
959 if (array_key_exists($idx, $existingcolumns)) {
971 $this->
object->createSurveyCodesForExternalData($founddata);
973 $this->ctrl->redirect($this,
'codes');
976 $this->ctrl->redirect($this,
'importExternalMailRecipientsFromTextForm');
980 protected function _convertCharset($a_string, $a_from_charset=
"", $a_to_charset=
"UTF-8")
982 if (extension_loaded(
"mbstring")) {
983 if (!$a_from_charset) {
984 mb_detect_order(
"UTF-8, ISO-8859-1, Windows-1252, ASCII");
985 $a_from_charset = mb_detect_encoding($a_string);
987 if (strtoupper($a_from_charset) != $a_to_charset) {
988 return @mb_convert_encoding($a_string, $a_to_charset, $a_from_charset);
996 $bom = pack(
'H*',
'EFBBBF');
997 return preg_replace(
'/^' . $bom .
'/',
'', $a_text);
1002 if (trim($_FILES[
'externalmails'][
'tmp_name'])) {
1003 include_once
"./Services/Utilities/classes/class.ilCSVReader.php";
1005 $reader->open($_FILES[
'externalmails'][
'tmp_name']);
1007 $fields = array_shift(
$data);
1008 foreach ($fields as $idx => $field) {
1011 if (!in_array(
'email', $fields)) {
1014 $this->ctrl->redirect($this,
'codes');
1016 $existingdata = $this->
object->getExternalCodeRecipients();
1017 $existingcolumns = array();
1018 if (count($existingdata)) {
1019 $first = array_shift($existingdata);
1020 foreach ($first as
$key => $value) {
1021 array_push($existingcolumns,
$key);
1025 include_once
"Services/Utilities/classes/class.ilStr.php";
1027 $founddata = array();
1029 if (count(
$row) == count($fields)) {
1031 foreach ($fields as $idx => $fieldname) {
1035 if (count($existingcolumns)) {
1036 if (array_key_exists($idx, $existingcolumns)) {
1050 if (
sizeof($founddata)) {
1051 $this->
object->createSurveyCodesForExternalData($founddata);
1056 $this->ctrl->redirect($this,
'codes');
1066 include_once(
"./Services/Form/classes/class.ilPropertyFormGUI.php");
1068 $form_import_file->setFormAction($this->ctrl->getFormAction($this));
1069 $form_import_file->setTableWidth(
"100%");
1070 $form_import_file->setId(
"codes_import_file");
1073 $headerfile->setTitle($this->lng->txt(
"import_from_file"));
1074 $form_import_file->addItem($headerfile);
1076 $externalmails =
new ilFileInputGUI($this->lng->txt(
"externalmails"),
"externalmails");
1077 $externalmails->setInfo($this->lng->txt(
'externalmails_info'));
1078 $externalmails->setRequired(
true);
1079 $form_import_file->addItem($externalmails);
1080 if ($ilAccess->checkAccess(
"write",
"",
$_GET[
"ref_id"])) {
1081 $form_import_file->addCommandButton(
"importExternalRecipientsFromFile", $this->lng->txt(
"import"));
1083 if ($ilAccess->checkAccess(
"write",
"",
$_GET[
"ref_id"])) {
1084 $form_import_file->addCommandButton(
"codes", $this->lng->txt(
"cancel"));
1087 $this->tpl->setContent($form_import_file->getHTML());
1097 include_once(
"./Services/Form/classes/class.ilPropertyFormGUI.php");
1099 $form_import_text->setFormAction($this->ctrl->getFormAction($this));
1100 $form_import_text->setTableWidth(
"100%");
1101 $form_import_text->setId(
"codes_import_text");
1104 $headertext->setTitle($this->lng->txt(
"import_from_text"));
1105 $form_import_text->addItem($headertext);
1108 if (array_key_exists(
'externaltext',
$_SESSION) && strlen(
$_SESSION[
'externaltext'])) {
1109 $inp->setValue(
$_SESSION[
'externaltext']);
1112 $inp->setValue(
"email;firstname;lastname\n" . $this->lng->txt(
'mail_import_example2') .
"\n" . $this->lng->txt(
'mail_import_example3') .
"\n");
1114 $inp->setRequired(
true);
1117 $inp->setInfo($this->lng->txt(
'externaltext_info'));
1118 $form_import_text->addItem($inp);
1121 if ($ilAccess->checkAccess(
"write",
"",
$_GET[
"ref_id"])) {
1122 $form_import_text->addCommandButton(
"importExternalRecipientsFromText", $this->lng->txt(
"import"));
1124 if ($ilAccess->checkAccess(
"write",
"",
$_GET[
"ref_id"])) {
1125 $form_import_text->addCommandButton(
"codes", $this->lng->txt(
"cancel"));
1128 $this->tpl->setContent($form_import_text->getHTML());
1155 $this->ctrl->setParameter($this,
"appr360", 1);
1157 include_once
'./Services/Search/classes/class.ilRepositorySearchGUI.php';
1162 'auto_complete_name' => $this->lng->txt(
'user'),
1163 'submit_name' => $this->lng->txt(
'add'),
1164 'add_search' =>
true,
1165 'add_from_container' => $this->ref_id
1170 include_once(
"./Services/Skill/classes/class.ilSkillManagementSettings.php");
1172 if ($this->object->get360SkillService() && $skmg_set->isActivated()) {
1173 $ilToolbar->addSeparator();
1174 $ilToolbar->addButton(
1175 $lng->txt(
"survey_calc_skills"),
1176 $ilCtrl->getLinkTargetByClass(
"ilsurveyskilldeterminationgui"),
1181 $ilToolbar->addSeparator();
1182 $ilToolbar->addButton(
1183 $this->lng->txt(
'svy_delete_all_user_data'),
1184 $this->ctrl->getLinkTarget($this,
'deleteAllUserData')
1187 $this->ctrl->setParameter($this,
"appr360",
"");
1189 include_once
"Modules/Survey/classes/tables/class.ilSurveyAppraiseesTableGUI.php";
1191 $tbl->setData($this->object->getAppraiseesData());
1192 $this->tpl->setContent(
$tbl->getHTML());
1197 if (
sizeof($a_user_ids)) {
1199 foreach (array_unique($a_user_ids) as $user_id) {
1200 $this->
object->addAppraisee($user_id);
1205 $this->ctrl->redirect($this,
"listAppraisees");
1212 if (!
sizeof(
$_POST[
"appr_id"])) {
1214 $this->ctrl->redirect($this,
"listAppraisees");
1217 $ilTabs->clearTargets();
1218 $ilTabs->setBackTarget(
1219 $this->lng->txt(
"btn_back"),
1220 $this->ctrl->getLinkTarget($this,
"listAppraisees")
1223 include_once(
"./Services/Utilities/classes/class.ilConfirmationGUI.php");
1225 $cgui->setHeaderText($this->lng->txt(
"survey_360_sure_delete_appraises"));
1227 $cgui->setFormAction($this->ctrl->getFormAction($this,
"deleteAppraisees"));
1228 $cgui->setCancel($this->lng->txt(
"cancel"),
"listAppraisees");
1229 $cgui->setConfirm($this->lng->txt(
"confirm"),
"deleteAppraisees");
1231 $data = $this->
object->getAppraiseesData();
1234 include_once
"Services/User/classes/class.ilUserUtil.php";
1244 $this->ctrl->redirect($this,
"listAppraisees");
1247 $this->tpl->setContent($cgui->getHTML());
1252 if (
sizeof(
$_POST[
"appr_id"])) {
1253 $data = $this->
object->getAppraiseesData();
1258 $this->
object->deleteAppraisee($id);
1265 $this->ctrl->redirect($this,
"listAppraisees");
1273 if ($ilAccess->checkAccess(
"write",
"", $this->ref_id)) {
1274 $appr_id = $_REQUEST[
"appr_id"];
1276 $this->ctrl->redirect($this,
"listAppraisees");
1279 } elseif ($this->object->get360Mode() &&
1280 $this->object->get360SelfRaters() &&
1281 $this->object->isAppraisee(
$ilUser->getId()) &&
1282 !$this->object->isAppraiseeClosed(
$ilUser->getId())) {
1285 $this->ctrl->redirect($this->parent_gui,
"infoScreen");
1296 $has_write = $ilAccess->checkAccess(
"write",
"", $this->ref_id);
1298 $ilTabs->clearTargets();
1299 $ilTabs->setBackTarget(
1300 $this->lng->txt(
"btn_back"),
1301 $this->ctrl->getLinkTarget($this,
"listAppraisees")
1305 $this->ctrl->setParameter($this,
"appr_id", $appr_id);
1306 $this->ctrl->setParameter($this,
"rate360", 1);
1308 include_once
'./Services/Search/classes/class.ilRepositorySearchGUI.php';
1313 'auto_complete_name' => $this->lng->txt(
'user'),
1314 'submit_name' => $this->lng->txt(
'add'),
1315 'add_search' =>
true,
1316 'add_from_container' => $this->ref_id
1320 $this->ctrl->setParameter($this,
"rate360",
"");
1322 $ilToolbar->addSeparator();
1324 $ilToolbar->addButton(
1325 $this->lng->txt(
"survey_360_add_external_rater"),
1326 $this->ctrl->getLinkTarget($this,
"addExternalRaterForm")
1330 require_once
"Services/Link/classes/class.ilLink.php";
1333 include_once
"Modules/Survey/classes/tables/class.ilSurveyAppraiseesTableGUI.php";
1335 $tbl->setData($this->object->getRatersData($appr_id));
1336 $this->tpl->setContent(
$tbl->getHTML());
1345 $this->ctrl->setParameter($this,
"appr_id", $appr_id);
1347 $has_write = $ilAccess->checkAccess(
"write",
"", $this->ref_id);
1349 $ilTabs->clearTargets();
1350 $ilTabs->setBackTarget(
1351 $this->lng->txt(
"btn_back"),
1352 $this->ctrl->getLinkTarget($this,
"editRaters")
1360 $this->tpl->setContent($a_form->getHTML());
1365 include_once
"Services/User/classes/class.ilUserUtil.php";
1366 include_once(
"./Services/Form/classes/class.ilPropertyFormGUI.php");
1368 $form->setFormAction($this->ctrl->getFormAction($this,
"addExternalRater"));
1369 $form->setTitle($this->lng->txt(
"survey_360_add_external_rater") .
1372 $email =
new ilEmailInputGUI($this->lng->txt(
"email"),
"email");
1373 $email->setRequired(
true);
1376 $lname =
new ilTextInputGUI($this->lng->txt(
"lastname"),
"lname");
1377 $lname->setSize(30);
1378 $form->addItem($lname);
1380 $fname =
new ilTextInputGUI($this->lng->txt(
"firstname"),
"fname");
1381 $fname->setSize(30);
1382 $form->addItem($fname);
1384 $form->addCommandButton(
"addExternalRater", $this->lng->txt(
"save"));
1385 $form->addCommandButton(
"editRaters", $this->lng->txt(
"cancel"));
1392 $appr_id = $_REQUEST[
"appr_id"];
1394 $this->ctrl->redirect($this,
"listAppraisees");
1397 $this->ctrl->setParameter($this,
"appr_id", $appr_id);
1400 if (
$form->checkInput()) {
1402 "email" =>
$form->getInput(
"email"),
1403 "lastname" =>
$form->getInput(
"lname"),
1404 "firstname" =>
$form->getInput(
"fname")
1406 $anonymous_id = $this->
object->createSurveyCodesForExternalData(array(
$data));
1407 $anonymous_id = array_pop($anonymous_id);
1409 $this->
object->addRater($appr_id, 0, $anonymous_id);
1412 $this->ctrl->setParameter($this,
"appr_id", $appr_id);
1413 $this->ctrl->redirect($this,
"editRaters");
1416 $form->setValuesByPost();
1427 if (
sizeof($a_user_ids)) {
1429 foreach (array_unique($a_user_ids) as $user_id) {
1430 if ($ilAccess->checkAccess(
"write",
"", $this->ref_id) ||
1431 $this->object->get360SelfEvaluation() ||
1432 $user_id !=
$ilUser->getId()) {
1433 if ($appr_id != $user_id) {
1434 $this->
object->addRater($appr_id, $user_id);
1443 $this->ctrl->setParameter($this,
"appr_id", $appr_id);
1444 $this->ctrl->redirect($this,
"editRaters");
1452 $this->ctrl->setParameter($this,
"appr_id", $appr_id);
1453 if (!
sizeof(
$_POST[
"rtr_id"])) {
1455 $this->ctrl->redirect($this,
"editRaters");
1458 $ilTabs->clearTargets();
1459 $ilTabs->setBackTarget(
1460 $this->lng->txt(
"btn_back"),
1461 $this->ctrl->getLinkTarget($this,
"editRaters")
1464 include_once
"Services/User/classes/class.ilUserUtil.php";
1465 include_once(
"./Services/Utilities/classes/class.ilConfirmationGUI.php");
1468 $this->lng->txt(
"survey_360_sure_delete_raters"),
1472 $cgui->setFormAction($this->ctrl->getFormAction($this,
"deleteRaters"));
1473 $cgui->setCancel($this->lng->txt(
"cancel"),
"editRaters");
1474 $cgui->setConfirm($this->lng->txt(
"confirm"),
"deleteRaters");
1476 $data = $this->
object->getRatersData($appr_id);
1480 $cgui->addItem(
"rtr_id[]",
$id,
$data[
$id][
"lastname"] .
", " .
1485 $this->tpl->setContent($cgui->getHTML());
1491 $this->ctrl->setParameter($this,
"appr_id", $appr_id);
1493 if (
sizeof(
$_POST[
"rtr_id"])) {
1494 $data = $this->
object->getRatersData($appr_id);
1498 if (substr(
$id, 0, 1) ==
"u") {
1499 $this->
object->deleteRater($appr_id, substr(
$id, 1));
1501 $this->
object->deleteRater($appr_id, 0, substr(
$id, 1));
1509 $this->ctrl->redirect($this,
"editRaters");
1516 if ($this->object->get360SelfAppraisee() &&
1517 !$this->object->isAppraisee(
$ilUser->getId())) {
1518 $this->
object->addAppraisee(
$ilUser->getId());
1521 $this->ctrl->redirect($this->parent_gui,
"infoScreen");
1526 include_once(
"./Services/Form/classes/class.ilPropertyFormGUI.php");
1528 $form->setFormAction($this->ctrl->getFormAction($this,
"mailRatersAction"));
1529 $form->setTitle($this->lng->txt(
'compose'));
1531 $all_data = $this->
object->getRatersData($appr_id);
1532 $rec_data = array();
1533 foreach ($rec_ids as $rec_id) {
1534 if (isset($all_data[$rec_id])) {
1535 $rec_data[] = $all_data[$rec_id][
"lastname"] .
", " .
1536 $all_data[$rec_id][
"firstname"] .
1537 " (" . $all_data[$rec_id][
"email"] .
")";
1542 $rec->setHTML(implode(
"<br />", $rec_data));
1543 $form->addItem($rec);
1545 $subject =
new ilTextInputGUI($this->lng->txt(
'subject'),
'subject');
1546 $subject->setSize(50);
1547 $subject->setRequired(
true);
1548 $form->addItem($subject);
1550 $existingdata = $this->
object->getExternalCodeRecipients();
1551 $existingcolumns = array();
1552 if (count($existingdata)) {
1553 $first = array_shift($existingdata);
1554 foreach ($first as
$key => $value) {
1555 if (strcmp(
$key,
'code') != 0 && strcmp(
$key,
'email') != 0 && strcmp(
$key,
'sent') != 0) {
1556 array_push($existingcolumns,
'[' .
$key .
']');
1561 $mailmessage_u =
new ilTextAreaInputGUI($this->lng->txt(
'survey_360_rater_message_content_registered'),
'message_u');
1562 $mailmessage_u->setRequired(
true);
1563 $mailmessage_u->setCols(80);
1564 $mailmessage_u->setRows(10);
1565 $form->addItem($mailmessage_u);
1567 $mailmessage_a =
new ilTextAreaInputGUI($this->lng->txt(
'survey_360_rater_message_content_anonymous'),
'message_a');
1568 $mailmessage_a->setRequired(
true);
1569 $mailmessage_a->setCols(80);
1570 $mailmessage_a->setRows(10);
1571 $mailmessage_a->setInfo(
sprintf($this->lng->txt(
'message_content_info'), join($existingcolumns,
', ')));
1572 $form->addItem($mailmessage_a);
1575 $recf->setValue(implode(
";", $rec_ids));
1576 $form->addItem($recf);
1578 $form->addCommandButton(
"mailRatersAction", $this->lng->txt(
"send"));
1579 $form->addCommandButton(
"editRaters", $this->lng->txt(
"cancel"));
1581 $subject->setValue(
sprintf($this->lng->txt(
'survey_360_rater_subject_default'), $this->object->getTitle()));
1582 $mailmessage_u->setValue($this->lng->txt(
'survey_360_rater_message_content_registered_default'));
1583 $mailmessage_a->setValue($this->lng->txt(
'survey_360_rater_message_content_anonymous_default'));
1594 $this->ctrl->setParameter($this,
"appr_id", $appr_id);
1596 if (!
sizeof(
$_POST[
"rtr_id"])) {
1598 $this->ctrl->redirect($this,
"editRaters");
1604 $ilTabs->clearTargets();
1605 $ilTabs->setBackTarget(
1606 $this->lng->txt(
"btn_back"),
1607 $this->ctrl->getLinkTarget($this,
"editRaters")
1610 $this->tpl->setContent($a_form->getHTML());
1618 $this->ctrl->setParameter($this,
"appr_id", $appr_id);
1620 $rec_ids = explode(
";",
$_POST[
"rtr_id"]);
1621 if (!
sizeof($rec_ids)) {
1622 $this->ctrl->redirect($this,
"editRaters");
1626 if (
$form->checkInput()) {
1627 $txt_u =
$form->getInput(
"message_u");
1628 $txt_a =
$form->getInput(
"message_a");
1629 $subj =
$form->getInput(
"subject");
1632 $sender_id = (trim(
$ilUser->getEmail()))
1634 : ANONYMOUS_USER_ID;
1636 include_once
"./Services/Mail/classes/class.ilMail.php";
1638 $all_data = $this->
object->getRatersData($appr_id);
1639 foreach ($rec_ids as $rec_id) {
1640 if (isset($all_data[$rec_id])) {
1641 $user = $all_data[$rec_id];
1644 if (substr($rec_id, 0, 1) ==
"a") {
1647 $rcp =
$user[
"email"];
1652 $user[
"code"] = $this->lng->txt(
"survey_code_mail_on_demand");
1654 $rcp =
$user[
"login"];
1657 $mytxt = str_replace(
"[lastname]",
$user[
"lastname"], $mytxt);
1658 $mytxt = str_replace(
"[firstname]",
$user[
"firstname"], $mytxt);
1659 $mytxt = str_replace(
"[url]",
$url, $mytxt);
1660 $mytxt = str_replace(
"[code]",
$user[
"code"], $mytxt);
1662 $mail =
new ilMail($sender_id);
1673 $this->
object->set360RaterSent(
1675 (substr($rec_id, 0, 1) ==
"a") ? 0 : (
int) substr($rec_id, 1),
1676 (substr($rec_id, 0, 1) ==
"u") ? 0 : (
int) substr($rec_id, 1)
1682 $this->ctrl->redirect($this,
"editRaters");
1685 $form->setValuesByPost();
1695 $ilTabs->clearTargets();
1696 $ilTabs->setBackTarget(
1697 $this->lng->txt(
"menuback"),
1698 $this->ctrl->getLinkTarget($this->parent_gui,
"infoScreen")
1701 if (!$this->object->isAppraisee(
$ilUser->getId())) {
1702 $this->ctrl->redirect($this->parent_gui,
"infoScreen");
1705 include_once(
"./Services/Utilities/classes/class.ilConfirmationGUI.php");
1707 $cgui->setHeaderText($this->lng->txt(
"survey_360_sure_appraisee_close"));
1709 $cgui->setFormAction($this->ctrl->getFormAction($this,
"appraiseeClose"));
1710 $cgui->setCancel($this->lng->txt(
"cancel"),
"confirmAppraiseeCloseCancel");
1711 $cgui->setConfirm($this->lng->txt(
"confirm"),
"appraiseeClose");
1713 $tpl->setContent($cgui->getHTML());
1718 $this->ctrl->redirect($this->parent_gui,
"infoScreen");
1725 if (!$this->object->isAppraisee(
$ilUser->getId())) {
1726 $this->ctrl->redirect($this->parent_gui,
"infoScreen");
1729 $this->
object->closeAppraisee(
$ilUser->getId());
1731 $this->ctrl->redirect($this->parent_gui,
"infoScreen");
1740 $appr_ids =
$_POST[
"appr_id"];
1742 if (!
sizeof($appr_ids)) {
1744 $this->ctrl->redirect($this,
"listAppraisees");
1747 include_once(
"./Services/Utilities/classes/class.ilConfirmationGUI.php");
1749 $cgui->setHeaderText($this->lng->txt(
"survey_360_sure_appraisee_close_admin"));
1751 $cgui->setFormAction($this->ctrl->getFormAction($this,
"adminAppraiseesClose"));
1752 $cgui->setCancel($this->lng->txt(
"cancel"),
"listAppraisees");
1753 $cgui->setConfirm($this->lng->txt(
"confirm"),
"adminAppraiseesClose");
1755 include_once
"Services/User/classes/class.ilUserUtil.php";
1756 foreach ($appr_ids as $appr_id) {
1760 $tpl->setContent($cgui->getHTML());
1767 $appr_ids =
$_POST[
"appr_id"];
1769 if (!
sizeof($appr_ids)) {
1771 $this->ctrl->redirect($this,
"listAppraisees");
1774 $appr_data = $this->
object->getAppraiseesData();
1775 foreach ($appr_ids as $appr_id) {
1776 if (isset($appr_data[$appr_id]) && !$appr_data[$appr_id][
"closed"]) {
1777 $this->
object->closeAppraisee($appr_id);
1781 ilUtil::sendSuccess($this->lng->txt(
"survey_360_appraisee_close_action_success_admin"),
true);
1782 $this->ctrl->redirect($this,
"listAppraisees");
1790 $this->ctrl->redirect($this,
"maintenance");
1796 include_once
"Services/UIComponent/Button/classes/class.ilLinkButton.php";
1798 $button->setCaption(
"print");
1799 $button->setOnClick(
"window.print(); return false;");
1800 $button->setOmitPreventDoubleSubmission(
true);
1801 $ilToolbar->addButtonInstance($button);
1803 include_once
"Modules/Survey/classes/tables/class.ilSurveyParticipantsTableGUI.php";
1805 $this->tpl->setContent(
$tbl->getHTML());
sprintf('%.4f', $callTime)
date( 'd-M-Y', $objPHPExcel->getProperties() ->getCreated())
if(!isset( $_REQUEST[ 'ReturnTo'])) if(!isset($_REQUEST['AuthId'])) $options
An exception for terminatinating execution or to throw for unit testing.
Confirmation screen class.
@classDescription Date and time handling
static _getStaticLink( $a_ref_id, $a_type='', $a_fallback_goto=true, $append="")
Get static link.
This class handles base functions for mail handling.
const MODE_PREDEFINED_USERS
This class represents an option in a radio group.
static fillAutoCompleteToolbar($parent_object, ilToolbarGUI $toolbar=null, $a_options=array(), $a_sticky=false)
fill toolbar with
Settings template application class.
Skill management settings.
Class ilSurveyParticipantsGUI.
exportCodesObject()
Exports a list of survey codes.
cancelDeleteAllUserDataObject()
Cancels delete of all user data in maintenance.
mailRatersObject(ilPropertyFormGUI $a_form=null)
importExternalRecipientsFromFileObject()
saveInvitationStatusObject()
Saves the status of the invitation tab.
deleteSavedMessageObject()
deleteCodesConfirmObject()
confirmAppraiseeCloseObject()
deleteAllUserDataObject()
Creates a confirmation form for delete all user data.
addAppraisee($a_user_ids)
setCodesSubtabs()
Set the tabs for the access codes section.
maintenanceObject()
Participants maintenance.
importExternalMailRecipientsFromFileFormObject()
addExternalRaterFormObject(ilPropertyFormGUI $a_form=null)
importExternalMailRecipientsFromTextFormObject()
__construct(ilObjSurveyGUI $a_parent_gui, $a_has_write_access)
confirmAppraiseeCloseCancelObject()
inviteObject()
Creates the output for user/group invitation to a survey.
insertSavedMessageObject()
importAccessCodesActionObject()
Import codes from export codes file.
codesObject()
Display the survey access codes tab.
confirmDeleteAllUserDataObject()
Deletes all user data of the survey after confirmation.
createSurveyCodesObject()
Create access codes for the survey.
_convertCharset($a_string, $a_from_charset="", $a_to_charset="UTF-8")
exportAllCodesObject()
Exports all survey codes.
initMailRatersForm($appr_id, array $rec_ids)
deleteCodesObject()
Delete a list of survey codes.
confirmDeleteAppraiseesObject()
disinviteUserGroupObject()
Disinvite users or groups from a survey.
deleteSingleUserResultsObject()
Asks for a confirmation to delete selected user data of the test object.
setCodeLanguageObject()
Change survey language for direct access URL's.
importAccessCodesObject()
Import codes from export codes file (upload form)
confirmAdminAppraiseesCloseObject()
adminAppraiseesCloseObject()
cancelDeleteSelectedUserDataObject()
Cancels the deletion of all user data for the test object.
initExternalRaterForm($appr_id)
confirmDeleteRatersObject()
inviteUserGroupObject($a_user_ids=array())
Invite users or groups to a survey.
confirmDeleteSelectedUserDataObject()
Deletes all user data for the test object.
importExternalRecipientsFromTextObject()
This class represents a text area property in a property form.
This class represents a text property in a property form.
static getNamePresentation( $a_user_id, $a_user_image=false, $a_profile_link=false, $a_profile_back_link="", $a_force_first_lastname=false, $a_omit_login=false, $a_sortable=true, $a_return_data_array=false, $a_ctrl_path="ilpublicuserprofilegui")
Default behaviour is:
static sendQuestion($a_info="", $a_keep=false)
Send Question to Screen.
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
static deliverData($a_data, $a_filename, $mime="application/octet-stream", $charset="")
deliver data for download via browser.
static getASCIIFilename($a_filename)
convert utf8 to ascii filename
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
if(!array_key_exists('StateId', $_REQUEST)) $id
if(isset($_POST['submit'])) $form