ILIAS  release_7 Revision v7.30-3-g800a261c036
ilSurveyParticipantsGUI Class Reference

Class ilSurveyParticipantsGUI. More...

+ Collaboration diagram for ilSurveyParticipantsGUI:

Public Member Functions

 __construct (ilObjSurveyGUI $a_parent_gui, $a_has_write_access)
 
 executeCommand ()
 
 maintenanceObject ()
 Participants maintenance. More...
 
 deleteAllUserDataObject ()
 Creates a confirmation form for delete all user data. More...
 
 confirmDeleteAllUserDataObject ()
 Deletes all user data of the survey after confirmation. More...
 
 cancelDeleteAllUserDataObject ()
 Cancels delete of all user data in maintenance. More...
 
 confirmDeleteSelectedUserDataObject ()
 Deletes all user data for the test object. More...
 
 cancelDeleteSelectedUserDataObject ()
 Cancels the deletion of all user data for the test object. More...
 
 deleteSingleUserResultsObject ()
 Asks for a confirmation to delete selected user data of the test object. More...
 
 setCodeLanguageObject ()
 Change survey language for direct access URL's. More...
 
 codesObject ()
 Display the survey access codes tab. More...
 
 editCodesObject ()
 
 updateCodesObject ()
 
 deleteCodesConfirmObject ()
 
 deleteCodesObject ()
 Delete a list of survey codes. More...
 
 exportCodesObject ()
 Exports a list of survey codes. More...
 
 exportAllCodesObject ()
 Exports all survey codes. More...
 
 createSurveyCodesObject ()
 Create access codes for the survey. More...
 
 insertSavedMessageObject ()
 
 deleteSavedMessageObject ()
 
 mailCodesObject ()
 
 sendCodesMailObject ()
 
 importExternalRecipientsFromTextObject ()
 
 importExternalRecipientsFromFileObject ()
 
 importExternalMailRecipientsFromFileFormObject ()
 
 importExternalMailRecipientsFromTextFormObject ()
 
 listAppraiseesObject ()
 
 addAppraisee ($a_user_ids)
 
 confirmDeleteAppraiseesObject ()
 
 deleteAppraiseesObject ()
 
 handleRatersAccess ()
 
 editRatersObject ()
 
 addExternalRaterFormObject (ilPropertyFormGUI $a_form=null)
 
 addExternalRaterObject ()
 
 addRater ($a_user_ids)
 
 confirmDeleteRatersObject ()
 
 deleteRatersObject ()
 
 addSelfAppraiseeObject ()
 
 initMailRatersForm ($appr_id, array $rec_ids)
 
 mailRatersObject (ilPropertyFormGUI $a_form=null)
 
 mailRatersActionObject ()
 
 confirmAppraiseeCloseObject ()
 
 confirmAppraiseeCloseCancelObject ()
 
 appraiseeCloseObject ()
 
 confirmAdminAppraiseesCloseObject ()
 
 adminAppraiseesCloseObject ()
 
 getObject ()
 
 inviteUsers ($user_ids)
 Invite users. More...
 

Protected Member Functions

 handleWriteAccess ()
 
 filterSurveyParticipantsByAccess ($a_finished_ids=null)
 
 isAnonymousListActive ()
 
 setParticipantSubTabs (string $active)
 Set the tabs for the access codes section. More...
 
 importAccessCodesObject ()
 Import codes from export codes file (upload form) More...
 
 importAccessCodesActionObject ()
 Import codes from export codes file. More...
 
 _convertCharset ($a_string, $a_from_charset="", $a_to_charset="UTF-8")
 
 removeUTF8Bom ($a_text)
 
 initExternalRaterForm ($appr_id)
 
 listParticipantsObject ()
 

Protected Attributes

 $ctrl
 
 $lng
 
 $tpl
 
 $tabs
 
 $toolbar
 
 $access
 
 $rbacsystem
 
 $user
 
 $log
 
 $parent_gui
 
 $object
 
 $ref_id
 
 $has_write
 
 $invitation_manager
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

ilSurveyParticipantsGUI::__construct ( ilObjSurveyGUI  $a_parent_gui,
  $a_has_write_access 
)

Definition at line 74 of file class.ilSurveyParticipantsGUI.php.

References $DIC, $lng, $tpl, and user().

75  {
76  global $DIC;
77 
78  $this->tabs = $DIC->tabs();
79  $this->toolbar = $DIC->toolbar();
80  $this->access = $DIC->access();
81  $this->rbacsystem = $DIC->rbac()->system();
82  $this->user = $DIC->user();
83  $this->log = $DIC["ilLog"];
84  $ilCtrl = $DIC->ctrl();
85  $lng = $DIC->language();
86  $tpl = $DIC["tpl"];
87 
88  $this->parent_gui = $a_parent_gui;
89  $this->object = $this->parent_gui->object;
90  $this->ref_id = $this->object->getRefId();
91  $this->has_write = (bool) $a_has_write_access;
92 
93  $this->ctrl = $ilCtrl;
94  $this->lng = $lng;
95  $this->tpl = $tpl;
96  $this->invitation_manager = new Participants\InvitationsManager();
97  }
user()
Definition: user.php:4
global $DIC
Definition: goto.php:24
+ Here is the call graph for this function:

Member Function Documentation

◆ _convertCharset()

ilSurveyParticipantsGUI::_convertCharset (   $a_string,
  $a_from_charset = "",
  $a_to_charset = "UTF-8" 
)
protected

Definition at line 904 of file class.ilSurveyParticipantsGUI.php.

Referenced by importExternalRecipientsFromFileObject().

905  {
906  if (extension_loaded("mbstring")) {
907  if (!$a_from_charset) {
908  mb_detect_order("UTF-8, ISO-8859-1, Windows-1252, ASCII");
909  $a_from_charset = mb_detect_encoding($a_string);
910  }
911  if (strtoupper($a_from_charset) != $a_to_charset) {
912  return @mb_convert_encoding($a_string, $a_to_charset, $a_from_charset);
913  }
914  }
915  return $a_string;
916  }
+ Here is the caller graph for this function:

◆ addAppraisee()

ilSurveyParticipantsGUI::addAppraisee (   $a_user_ids)

Definition at line 1111 of file class.ilSurveyParticipantsGUI.php.

1112  {
1113  if (sizeof($a_user_ids)) {
1114  // #13319
1115  foreach (array_unique($a_user_ids) as $user_id) {
1116  $this->object->addAppraisee($user_id);
1117  }
1118 
1119  ilUtil::sendSuccess($this->lng->txt("settings_saved"), true);
1120  }
1121  $this->ctrl->redirect($this, "listAppraisees");
1122  }

◆ addExternalRaterFormObject()

ilSurveyParticipantsGUI::addExternalRaterFormObject ( ilPropertyFormGUI  $a_form = null)

Definition at line 1251 of file class.ilSurveyParticipantsGUI.php.

References $access, $has_write, $tabs, handleRatersAccess(), and initExternalRaterForm().

Referenced by addExternalRaterObject().

1252  {
1253  $ilTabs = $this->tabs;
1254  $ilAccess = $this->access;
1255 
1256  $appr_id = $this->handleRatersAccess();
1257  $this->ctrl->setParameter($this, "appr_id", $appr_id);
1258 
1259  $has_write = $ilAccess->checkAccess("write", "", $this->ref_id);
1260  if ($has_write) {
1261  $ilTabs->clearTargets();
1262  $ilTabs->setBackTarget(
1263  $this->lng->txt("btn_back"),
1264  $this->ctrl->getLinkTarget($this, "editRaters")
1265  );
1266  }
1267 
1268  if (!$a_form) {
1269  $a_form = $this->initExternalRaterForm($appr_id);
1270  }
1271 
1272  $this->tpl->setContent($a_form->getHTML());
1273  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ addExternalRaterObject()

ilSurveyParticipantsGUI::addExternalRaterObject ( )

Definition at line 1300 of file class.ilSurveyParticipantsGUI.php.

References $data, addExternalRaterFormObject(), and initExternalRaterForm().

1301  {
1302  $appr_id = $_REQUEST["appr_id"];
1303  if (!$appr_id) {
1304  $this->ctrl->redirect($this, "listAppraisees");
1305  }
1306 
1307  $this->ctrl->setParameter($this, "appr_id", $appr_id);
1308 
1309  $form = $this->initExternalRaterForm($appr_id);
1310  if ($form->checkInput()) {
1311  $data = array(
1312  "email" => $form->getInput("email"),
1313  "lastname" => $form->getInput("lname"),
1314  "firstname" => $form->getInput("fname")
1315  );
1316  $anonymous_id = $this->object->createSurveyCodesForExternalData(array($data));
1317  $anonymous_id = array_pop($anonymous_id);
1318 
1319  $this->object->addRater($appr_id, 0, $anonymous_id);
1320 
1321  ilUtil::sendSuccess($this->lng->txt("settings_saved"), true);
1322  $this->ctrl->setParameter($this, "appr_id", $appr_id);
1323  $this->ctrl->redirect($this, "editRaters");
1324  }
1325 
1326  $form->setValuesByPost();
1327  $this->addExternalRaterFormObject($form);
1328  }
$data
Definition: storeScorm.php:23
addExternalRaterFormObject(ilPropertyFormGUI $a_form=null)
+ Here is the call graph for this function:

◆ addRater()

ilSurveyParticipantsGUI::addRater (   $a_user_ids)

Definition at line 1330 of file class.ilSurveyParticipantsGUI.php.

References $access, $ilUser, $user, handleRatersAccess(), and ilUtil\sendFailure().

1331  {
1332  $ilAccess = $this->access;
1333  $ilUser = $this->user;
1334 
1335  $appr_id = $this->handleRatersAccess();
1336 
1337  if (sizeof($a_user_ids)) {
1338  // #13319
1339  foreach (array_unique($a_user_ids) as $user_id) {
1340  if ($ilAccess->checkAccess("write", "", $this->ref_id) ||
1341  $this->object->get360SelfEvaluation() ||
1342  $user_id != $ilUser->getId()) {
1343  if ($appr_id != $user_id) {
1344  $this->object->addRater($appr_id, $user_id);
1345  ilUtil::sendSuccess($this->lng->txt("settings_saved"), true);
1346  } else {
1347  ilUtil::sendFailure($this->lng->txt("svy_appraisses_cannot_be_raters"), true);
1348  }
1349  }
1350  }
1351  }
1352 
1353  $this->ctrl->setParameter($this, "appr_id", $appr_id);
1354  $this->ctrl->redirect($this, "editRaters");
1355  }
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
$ilUser
Definition: imgupload.php:18
+ Here is the call graph for this function:

◆ addSelfAppraiseeObject()

ilSurveyParticipantsGUI::addSelfAppraiseeObject ( )

Definition at line 1420 of file class.ilSurveyParticipantsGUI.php.

References $ilUser, and $user.

1421  {
1422  $ilUser = $this->user;
1423 
1424  if ($this->object->get360SelfAppraisee() &&
1425  !$this->object->isAppraisee($ilUser->getId())) {
1426  $this->object->addAppraisee($ilUser->getId());
1427  }
1428 
1429  $this->ctrl->redirect($this->parent_gui, "infoScreen");
1430  }
$ilUser
Definition: imgupload.php:18

◆ adminAppraiseesCloseObject()

ilSurveyParticipantsGUI::adminAppraiseesCloseObject ( )

Definition at line 1664 of file class.ilSurveyParticipantsGUI.php.

References $_POST, handleWriteAccess(), and ilUtil\sendFailure().

1665  {
1666  $this->handleWriteAccess();
1667 
1668  $appr_ids = $_POST["appr_id"];
1669 
1670  if (!sizeof($appr_ids)) {
1671  ilUtil::sendFailure($this->lng->txt("select_one"), true);
1672  $this->ctrl->redirect($this, "listAppraisees");
1673  }
1674 
1675  $appr_data = $this->object->getAppraiseesData();
1676  foreach ($appr_ids as $appr_id) {
1677  if (isset($appr_data[$appr_id]) && !$appr_data[$appr_id]["closed"]) {
1678  $this->object->closeAppraisee($appr_id);
1679  }
1680  }
1681 
1682  ilUtil::sendSuccess($this->lng->txt("survey_360_appraisee_close_action_success_admin"), true);
1683  $this->ctrl->redirect($this, "listAppraisees");
1684  }
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
$_POST["username"]
+ Here is the call graph for this function:

◆ appraiseeCloseObject()

ilSurveyParticipantsGUI::appraiseeCloseObject ( )

Definition at line 1624 of file class.ilSurveyParticipantsGUI.php.

References $ilUser, and $user.

1625  {
1626  $ilUser = $this->user;
1627 
1628  if (!$this->object->isAppraisee($ilUser->getId())) {
1629  $this->ctrl->redirect($this->parent_gui, "infoScreen");
1630  }
1631 
1632  $this->object->closeAppraisee($ilUser->getId());
1633  ilUtil::sendSuccess($this->lng->txt("survey_360_appraisee_close_action_success"), true);
1634  $this->ctrl->redirect($this->parent_gui, "infoScreen");
1635  }
$ilUser
Definition: imgupload.php:18

◆ cancelDeleteAllUserDataObject()

ilSurveyParticipantsGUI::cancelDeleteAllUserDataObject ( )

Cancels delete of all user data in maintenance.

Definition at line 387 of file class.ilSurveyParticipantsGUI.php.

388  {
389  $this->ctrl->redirect($this, "maintenance");
390  }

◆ cancelDeleteSelectedUserDataObject()

ilSurveyParticipantsGUI::cancelDeleteSelectedUserDataObject ( )

Cancels the deletion of all user data for the test object.

Definition at line 417 of file class.ilSurveyParticipantsGUI.php.

References ilUtil\sendInfo().

418  {
419  ilUtil::sendInfo($this->lng->txt('msg_cancel'), true);
420  $this->ctrl->redirect($this, "maintenance");
421  }
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
+ Here is the call graph for this function:

◆ codesObject()

ilSurveyParticipantsGUI::codesObject ( )

Display the survey access codes tab.

Definition at line 473 of file class.ilSurveyParticipantsGUI.php.

References $ilUser, $lang, $si, $toolbar, $user, ilSubmitButton\getInstance(), handleWriteAccess(), ilUtil\sendInfo(), and setParticipantSubTabs().

474  {
476  $ilToolbar = $this->toolbar;
477 
478  $this->handleWriteAccess();
479  $this->setParticipantSubTabs("codes");
480 
481  if ($this->object->isAccessibleWithoutCode()) {
482  return ilUtil::sendInfo($this->lng->txt("survey_codes_no_anonymization"));
483  }
484 
485  $default_lang = $ilUser->getPref("survey_code_language");
486 
487  // creation buttons
488  $ilToolbar->setFormAction($this->ctrl->getFormAction($this));
489 
490  $si = new ilTextInputGUI($this->lng->txt("new_survey_codes"), "nrOfCodes");
491  $si->setValue(1);
492  $si->setSize(3);
493  $ilToolbar->addInputItem($si, true);
494 
495  $button = ilSubmitButton::getInstance();
496  $button->setCaption("create");
497  $button->setCommand("createSurveyCodes");
498  $ilToolbar->addButtonInstance($button);
499 
500  $ilToolbar->addSeparator();
501 
502  $button = ilSubmitButton::getInstance();
503  $button->setCaption("import_from_file");
504  $button->setCommand("importExternalMailRecipientsFromFileForm");
505  $ilToolbar->addButtonInstance($button);
506 
507  $button = ilSubmitButton::getInstance();
508  $button->setCaption("import_from_text");
509  $button->setCommand("importExternalMailRecipientsFromTextForm");
510  $ilToolbar->addButtonInstance($button);
511 
512  $ilToolbar->addSeparator();
513 
514  $button = ilSubmitButton::getInstance();
515  $button->setCaption("svy_import_codes");
516  $button->setCommand("importAccessCodes");
517  $ilToolbar->addButtonInstance($button);
518 
519  $ilToolbar->addSeparator();
520 
521  $languages = $this->lng->getInstalledLanguages();
522  $options = array();
523  $this->lng->loadLanguageModule("meta");
524  foreach ($languages as $lang) {
525  $options[$lang] = $this->lng->txt("meta_l_" . $lang);
526  }
527  $si = new ilSelectInputGUI($this->lng->txt("survey_codes_lang"), "lang");
528  $si->setOptions($options);
529  $si->setValue($default_lang);
530  $ilToolbar->addInputItem($si, true);
531 
532  $button = ilSubmitButton::getInstance();
533  $button->setCaption("set");
534  $button->setCommand("setCodeLanguage");
535  $ilToolbar->addButtonInstance($button);
536 
537  $table_gui = new ilSurveyCodesTableGUI($this, 'codes');
538  $survey_codes = $this->object->getSurveyCodesTableData(null, $default_lang);
539  $table_gui->setData($survey_codes);
540  $this->tpl->setContent($table_gui->getHTML());
541  }
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
$lang
Definition: xapiexit.php:8
$ilUser
Definition: imgupload.php:18
setParticipantSubTabs(string $active)
Set the tabs for the access codes section.
+ Here is the call graph for this function:

◆ confirmAdminAppraiseesCloseObject()

ilSurveyParticipantsGUI::confirmAdminAppraiseesCloseObject ( )

Definition at line 1637 of file class.ilSurveyParticipantsGUI.php.

References $_POST, $tpl, ilUserUtil\getNamePresentation(), handleWriteAccess(), and ilUtil\sendFailure().

1638  {
1639  $tpl = $this->tpl;
1640 
1641  $this->handleWriteAccess();
1642 
1643  $appr_ids = $_POST["appr_id"];
1644 
1645  if (!sizeof($appr_ids)) {
1646  ilUtil::sendFailure($this->lng->txt("select_one"), true);
1647  $this->ctrl->redirect($this, "listAppraisees");
1648  }
1649 
1650  $cgui = new ilConfirmationGUI();
1651  $cgui->setHeaderText($this->lng->txt("survey_360_sure_appraisee_close_admin"));
1652 
1653  $cgui->setFormAction($this->ctrl->getFormAction($this, "adminAppraiseesClose"));
1654  $cgui->setCancel($this->lng->txt("cancel"), "listAppraisees");
1655  $cgui->setConfirm($this->lng->txt("confirm"), "adminAppraiseesClose");
1656 
1657  foreach ($appr_ids as $appr_id) {
1658  $cgui->addItem("appr_id[]", $appr_id, ilUserUtil::getNamePresentation($appr_id));
1659  }
1660 
1661  $tpl->setContent($cgui->getHTML());
1662  }
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 sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
$_POST["username"]
Confirmation screen class.
+ Here is the call graph for this function:

◆ confirmAppraiseeCloseCancelObject()

ilSurveyParticipantsGUI::confirmAppraiseeCloseCancelObject ( )

Definition at line 1619 of file class.ilSurveyParticipantsGUI.php.

1620  {
1621  $this->ctrl->redirect($this->parent_gui, "infoScreen");
1622  }

◆ confirmAppraiseeCloseObject()

ilSurveyParticipantsGUI::confirmAppraiseeCloseObject ( )

Definition at line 1593 of file class.ilSurveyParticipantsGUI.php.

References $ilUser, $tabs, $tpl, and $user.

1594  {
1595  $ilUser = $this->user;
1596  $tpl = $this->tpl;
1597  $ilTabs = $this->tabs;
1598 
1599  $ilTabs->clearTargets();
1600  $ilTabs->setBackTarget(
1601  $this->lng->txt("menuback"),
1602  $this->ctrl->getLinkTarget($this->parent_gui, "infoScreen")
1603  );
1604 
1605  if (!$this->object->isAppraisee($ilUser->getId())) {
1606  $this->ctrl->redirect($this->parent_gui, "infoScreen");
1607  }
1608 
1609  $cgui = new ilConfirmationGUI();
1610  $cgui->setHeaderText($this->lng->txt("survey_360_sure_appraisee_close"));
1611 
1612  $cgui->setFormAction($this->ctrl->getFormAction($this, "appraiseeClose"));
1613  $cgui->setCancel($this->lng->txt("cancel"), "confirmAppraiseeCloseCancel");
1614  $cgui->setConfirm($this->lng->txt("confirm"), "appraiseeClose");
1615 
1616  $tpl->setContent($cgui->getHTML());
1617  }
$ilUser
Definition: imgupload.php:18
Confirmation screen class.

◆ confirmDeleteAllUserDataObject()

ilSurveyParticipantsGUI::confirmDeleteAllUserDataObject ( )

Deletes all user data of the survey after confirmation.

Definition at line 362 of file class.ilSurveyParticipantsGUI.php.

References filterSurveyParticipantsByAccess().

363  {
364  if ($this->access->checkAccess('write', '', $this->object->getRefId())) {
365  $this->object->deleteAllUserData();
366  } else {
367  $participants = $this->filterSurveyParticipantsByAccess();
368  foreach ($participants as $something => $participant_data) {
369  $this->object->removeSelectedSurveyResults([$participant_data['active_id']]);
370  }
371  }
372 
373 
374 
375  // #11558 - re-open closed appraisees
376  if ($this->object->get360Mode()) {
377  $this->object->openAllAppraisees();
378  }
379 
380  ilUtil::sendSuccess($this->lng->txt("svy_all_user_data_deleted"), true);
381  $this->ctrl->redirect($this, "maintenance");
382  }
filterSurveyParticipantsByAccess($a_finished_ids=null)
+ Here is the call graph for this function:

◆ confirmDeleteAppraiseesObject()

ilSurveyParticipantsGUI::confirmDeleteAppraiseesObject ( )

Definition at line 1124 of file class.ilSurveyParticipantsGUI.php.

References $_POST, $data, $tabs, ilUserUtil\getNamePresentation(), and ilUtil\sendFailure().

1125  {
1126  $ilTabs = $this->tabs;
1127 
1128  if (!is_array($_POST["appr_id"])) {
1129  ilUtil::sendFailure($this->lng->txt("select_one"), true);
1130  $this->ctrl->redirect($this, "listAppraisees");
1131  }
1132 
1133  $ilTabs->clearTargets();
1134  $ilTabs->setBackTarget(
1135  $this->lng->txt("btn_back"),
1136  $this->ctrl->getLinkTarget($this, "listAppraisees")
1137  );
1138 
1139  $cgui = new ilConfirmationGUI();
1140  $cgui->setHeaderText($this->lng->txt("survey_360_sure_delete_appraises"));
1141 
1142  $cgui->setFormAction($this->ctrl->getFormAction($this, "deleteAppraisees"));
1143  $cgui->setCancel($this->lng->txt("cancel"), "listAppraisees");
1144  $cgui->setConfirm($this->lng->txt("confirm"), "deleteAppraisees");
1145 
1146  $data = $this->object->getAppraiseesData();
1147 
1148  $count = 0;
1149  foreach ($_POST["appr_id"] as $id) {
1150  if (isset($data[$id]) && !$data[$id]["closed"]) {
1151  $cgui->addItem("appr_id[]", $id, ilUserUtil::getNamePresentation($id));
1152  $count++;
1153  }
1154  }
1155 
1156  if (!$count) {
1157  ilUtil::sendFailure($this->lng->txt("select_one"), true);
1158  $this->ctrl->redirect($this, "listAppraisees");
1159  }
1160 
1161  $this->tpl->setContent($cgui->getHTML());
1162  }
$data
Definition: storeScorm.php:23
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 sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
$_POST["username"]
Confirmation screen class.
+ Here is the call graph for this function:

◆ confirmDeleteRatersObject()

ilSurveyParticipantsGUI::confirmDeleteRatersObject ( )

Definition at line 1357 of file class.ilSurveyParticipantsGUI.php.

References $_POST, $data, $tabs, ilUserUtil\getNamePresentation(), handleRatersAccess(), and ilUtil\sendFailure().

1358  {
1359  $ilTabs = $this->tabs;
1360 
1361  $appr_id = $this->handleRatersAccess();
1362  $this->ctrl->setParameter($this, "appr_id", $appr_id);
1363  if (!sizeof($_POST["rtr_id"])) {
1364  ilUtil::sendFailure($this->lng->txt("select_one"), true);
1365  $this->ctrl->redirect($this, "editRaters");
1366  }
1367 
1368  $ilTabs->clearTargets();
1369  $ilTabs->setBackTarget(
1370  $this->lng->txt("btn_back"),
1371  $this->ctrl->getLinkTarget($this, "editRaters")
1372  );
1373 
1374  $cgui = new ilConfirmationGUI();
1375  $cgui->setHeaderText(sprintf(
1376  $this->lng->txt("survey_360_sure_delete_raters"),
1378  ));
1379 
1380  $cgui->setFormAction($this->ctrl->getFormAction($this, "deleteRaters"));
1381  $cgui->setCancel($this->lng->txt("cancel"), "editRaters");
1382  $cgui->setConfirm($this->lng->txt("confirm"), "deleteRaters");
1383 
1384  $data = $this->object->getRatersData($appr_id);
1385 
1386  foreach ($_POST["rtr_id"] as $id) {
1387  if (isset($data[$id])) {
1388  $cgui->addItem("rtr_id[]", $id, $data[$id]["lastname"] . ", " .
1389  $data[$id]["firstname"] . " (" . $data[$id]["email"] . ")");
1390  }
1391  }
1392 
1393  $this->tpl->setContent($cgui->getHTML());
1394  }
$data
Definition: storeScorm.php:23
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 sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
$_POST["username"]
Confirmation screen class.
+ Here is the call graph for this function:

◆ confirmDeleteSelectedUserDataObject()

ilSurveyParticipantsGUI::confirmDeleteSelectedUserDataObject ( )

Deletes all user data for the test object.

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

References $_POST, and $i.

396  {
397  if (is_array($_POST["chbUser"])) {
398  $this->object->removeSelectedSurveyResults(array_filter($_POST["chbUser"], function ($i) {
399  return is_numeric($i);
400  }));
401 
402  $invitations = array_filter($_POST["chbUser"], function ($i) {
403  return (substr($i, 0, 3) == "inv");
404  });
405  foreach ($invitations as $i) {
406  $this->invitation_manager->remove($this->object->getSurveyId(), (int) substr($i, 3));
407  }
408 
409  ilUtil::sendSuccess($this->lng->txt("svy_selected_user_data_deleted"), true);
410  }
411  $this->ctrl->redirect($this, "maintenance");
412  }
$_POST["username"]
$i
Definition: metadata.php:24

◆ createSurveyCodesObject()

ilSurveyParticipantsGUI::createSurveyCodesObject ( )

Create access codes for the survey.

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

References $_POST, and ilUtil\sendFailure().

752  {
753  if (is_numeric($_POST["nrOfCodes"])) {
754  $ids = $this->object->createSurveyCodes($_POST["nrOfCodes"]);
755  ilUtil::sendSuccess($this->lng->txt('codes_created'), true);
756  $this->ctrl->setParameter($this, "new_ids", implode(";", $ids));
757  $this->ctrl->redirect($this, 'editCodes');
758  } else {
759  ilUtil::sendFailure($this->lng->txt("enter_valid_number_of_codes"), true);
760  $this->ctrl->redirect($this, 'codes');
761  }
762  }
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
$_POST["username"]
+ Here is the call graph for this function:

◆ deleteAllUserDataObject()

ilSurveyParticipantsGUI::deleteAllUserDataObject ( )

Creates a confirmation form for delete all user data.

Definition at line 349 of file class.ilSurveyParticipantsGUI.php.

350  {
351  $cgui = new ilConfirmationGUI();
352  $cgui->setHeaderText($this->lng->txt("confirm_delete_all_user_data"));
353  $cgui->setFormAction($this->ctrl->getFormAction($this, "deleteAllUserData"));
354  $cgui->setCancel($this->lng->txt("cancel"), "cancelDeleteAllUserData");
355  $cgui->setConfirm($this->lng->txt("confirm"), "confirmDeleteAllUserData");
356  $this->tpl->setContent($cgui->getHTML());
357  }
Confirmation screen class.

◆ deleteAppraiseesObject()

ilSurveyParticipantsGUI::deleteAppraiseesObject ( )

Definition at line 1164 of file class.ilSurveyParticipantsGUI.php.

References $_POST, and $data.

1165  {
1166  if (sizeof($_POST["appr_id"])) {
1167  $data = $this->object->getAppraiseesData();
1168 
1169  foreach ($_POST["appr_id"] as $id) {
1170  // #11285
1171  if (isset($data[$id]) && !$data[$id]["closed"]) {
1172  $this->object->deleteAppraisee($id);
1173  }
1174  }
1175 
1176  ilUtil::sendSuccess($this->lng->txt("settings_saved"), true);
1177  }
1178 
1179  $this->ctrl->redirect($this, "listAppraisees");
1180  }
$data
Definition: storeScorm.php:23
$_POST["username"]

◆ deleteCodesConfirmObject()

ilSurveyParticipantsGUI::deleteCodesConfirmObject ( )

Definition at line 594 of file class.ilSurveyParticipantsGUI.php.

References $_POST, $data, and ilUtil\sendFailure().

595  {
596  if (is_array($_POST["chb_code"]) && (count($_POST["chb_code"]) > 0)) {
597  $cgui = new ilConfirmationGUI();
598  $cgui->setHeaderText($this->lng->txt("survey_code_delete_sure"));
599 
600  $cgui->setFormAction($this->ctrl->getFormAction($this));
601  $cgui->setCancel($this->lng->txt("cancel"), "codes");
602  $cgui->setConfirm($this->lng->txt("confirm"), "deleteCodes");
603 
604  $data = $this->object->getSurveyCodesTableData($_POST["chb_code"]);
605 
606  foreach ($data as $item) {
607  if ($item["used"]) {
608  continue;
609  }
610 
611  $title = array($item["code"]);
612  $item["email"] ? $title[] = $item["email"] : null;
613  $item["last_name"] ? $title[] = $item["last_name"] : null;
614  $item["first_name"] ? $title[] = $item["first_name"] : null;
615  $title = implode(", ", $title);
616 
617  $cgui->addItem("chb_code[]", $item["code"], $title);
618  }
619 
620  $this->tpl->setContent($cgui->getHTML());
621  } else {
622  ilUtil::sendFailure($this->lng->txt('no_checkbox'), true);
623  $this->ctrl->redirect($this, 'codes');
624  }
625  }
$data
Definition: storeScorm.php:23
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
$_POST["username"]
Confirmation screen class.
+ Here is the call graph for this function:

◆ deleteCodesObject()

ilSurveyParticipantsGUI::deleteCodesObject ( )

Delete a list of survey codes.

Definition at line 630 of file class.ilSurveyParticipantsGUI.php.

References $_POST, and ilUtil\sendInfo().

631  {
632  if (is_array($_POST["chb_code"]) && (count($_POST["chb_code"]) > 0)) {
633  foreach ($_POST["chb_code"] as $survey_code) {
634  $this->object->deleteSurveyCode($survey_code);
635  }
636  ilUtil::sendSuccess($this->lng->txt('codes_deleted'), true);
637  } else {
638  ilUtil::sendInfo($this->lng->txt('no_checkbox'), true);
639  }
640  $this->ctrl->redirect($this, 'codes');
641  }
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
$_POST["username"]
+ Here is the call graph for this function:

◆ deleteRatersObject()

ilSurveyParticipantsGUI::deleteRatersObject ( )

Definition at line 1396 of file class.ilSurveyParticipantsGUI.php.

References $_POST, $data, and handleRatersAccess().

1397  {
1398  $appr_id = $this->handleRatersAccess();
1399  $this->ctrl->setParameter($this, "appr_id", $appr_id);
1400 
1401  if (sizeof($_POST["rtr_id"])) {
1402  $data = $this->object->getRatersData($appr_id);
1403 
1404  foreach ($_POST["rtr_id"] as $id) {
1405  if (isset($data[$id])) {
1406  if (substr($id, 0, 1) == "u") {
1407  $this->object->deleteRater($appr_id, substr($id, 1));
1408  } else {
1409  $this->object->deleteRater($appr_id, 0, substr($id, 1));
1410  }
1411  }
1412  }
1413 
1414  ilUtil::sendSuccess($this->lng->txt("settings_saved"), true);
1415  }
1416 
1417  $this->ctrl->redirect($this, "editRaters");
1418  }
$data
Definition: storeScorm.php:23
$_POST["username"]
+ Here is the call graph for this function:

◆ deleteSavedMessageObject()

ilSurveyParticipantsGUI::deleteSavedMessageObject ( )

Definition at line 787 of file class.ilSurveyParticipantsGUI.php.

References Vendor\Package\$e, $log, handleWriteAccess(), ilUtil\sendFailure(), and setParticipantSubTabs().

788  {
789  $this->handleWriteAccess();
790  $this->setParticipantSubTabs("codes");
791 
792  $form_gui = new FormMailCodesGUI($this);
793  $form_gui->setValuesByPost();
794  try {
795  if ($form_gui->getSavedMessages()->getValue() > 0) {
796  $this->object->deleteUserSettings($form_gui->getSavedMessages()->getValue());
797  $form_gui = new FormMailCodesGUI($this);
798  $form_gui->setValuesByPost();
799  ilUtil::sendSuccess($this->lng->txt('msg_message_deleted'));
800  } else {
801  ilUtil::sendFailure($this->lng->txt('msg_no_message_deleted'));
802  }
803  } catch (Exception $e) {
804  $ilLog = $this->log;
805  $ilLog->write('Error: ' + $e->getMessage());
806  }
807  $this->tpl->setVariable("ADM_CONTENT", $form_gui->getHTML());
808  }
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
Class FormMailCodesGUI.
setParticipantSubTabs(string $active)
Set the tabs for the access codes section.
+ Here is the call graph for this function:

◆ deleteSingleUserResultsObject()

ilSurveyParticipantsGUI::deleteSingleUserResultsObject ( )

Asks for a confirmation to delete selected user data of the test object.

Definition at line 426 of file class.ilSurveyParticipantsGUI.php.

References $_POST, $data, $total, handleWriteAccess(), ilUtil\sendInfo(), and ilUtil\sendQuestion().

427  {
428  $this->handleWriteAccess();
429 
430  if (!is_array($_POST["chbUser"]) || count($_POST["chbUser"]) == 0) {
431  ilUtil::sendInfo($this->lng->txt('no_checkbox'), true);
432  $this->ctrl->redirect($this, "maintenance");
433  }
434 
435  ilUtil::sendQuestion($this->lng->txt("confirm_delete_single_user_data"));
436  $table_gui = new ilSurveyMaintenanceTableGUI($this, 'maintenance', true);
437  $total = $this->object->getSurveyParticipants(null, false, true);
438  $data = array();
439  foreach ($total as $user_data) {
440  if (in_array($user_data['active_id'], $_POST['chbUser'])
441  || ($user_data['invited'] && in_array("inv" . $user_data['usr_id'], $_POST['chbUser']))) {
442  $last_access = $this->object->getLastAccess($user_data["active_id"]);
443  array_push($data, array(
444  'id' => $user_data["active_id"],
445  'name' => $user_data["sortname"],
446  'login' => $user_data["login"],
447  'last_access' => $last_access,
448  'usr_id' => $user_data["usr_id"],
449  'invited' => $user_data["invited"]
450  ));
451  }
452  }
453  $table_gui->setData($data);
454  $this->tpl->setVariable('ADM_CONTENT', $table_gui->getHTML());
455  }
$data
Definition: storeScorm.php:23
$total
Definition: Utf8Test.php:87
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
static sendQuestion($a_info="", $a_keep=false)
Send Question to Screen.
$_POST["username"]
+ Here is the call graph for this function:

◆ editCodesObject()

ilSurveyParticipantsGUI::editCodesObject ( )

Definition at line 543 of file class.ilSurveyParticipantsGUI.php.

References $_GET, $_POST, handleWriteAccess(), ilUtil\sendFailure(), and setParticipantSubTabs().

544  {
545  if (isset($_GET["new_ids"])) {
546  $ids = explode(";", $_GET["new_ids"]);
547  } else {
548  $ids = (array) $_POST["chb_code"];
549  }
550  if (!$ids) {
551  ilUtil::sendFailure($this->lng->txt('no_checkbox'), true);
552  $this->ctrl->redirect($this, 'codes');
553  }
554 
555  $this->handleWriteAccess();
556  $this->setParticipantSubTabs("codes");
557 
558  $table_gui = new ilSurveyCodesEditTableGUI($this, 'editCodes');
559  $table_gui->setData($this->object->getSurveyCodesTableData($ids));
560  $this->tpl->setContent($table_gui->getHTML());
561  }
$_GET["client_id"]
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
$_POST["username"]
setParticipantSubTabs(string $active)
Set the tabs for the access codes section.
+ Here is the call graph for this function:

◆ editRatersObject()

ilSurveyParticipantsGUI::editRatersObject ( )

Definition at line 1202 of file class.ilSurveyParticipantsGUI.php.

References $access, $has_write, $ref_id, $tabs, $toolbar, $url, ilLink\_getStaticLink(), ilRepositorySearchGUI\fillAutoCompleteToolbar(), handleRatersAccess(), and ilTable2GUI\setData().

1203  {
1204  $ilTabs = $this->tabs;
1205  $ilToolbar = $this->toolbar;
1206  $ilAccess = $this->access;
1207 
1208  $appr_id = $_REQUEST["appr_id"] = $this->handleRatersAccess();
1209 
1210  $has_write = $ilAccess->checkAccess("write", "", $this->ref_id);
1211  if ($has_write) {
1212  $ilTabs->clearTargets();
1213  $ilTabs->setBackTarget(
1214  $this->lng->txt("btn_back"),
1215  $this->ctrl->getLinkTarget($this, "listAppraisees")
1216  );
1217  }
1218 
1219  $this->ctrl->setParameter($this, "appr_id", $appr_id);
1220  $this->ctrl->setParameter($this, "rate360", 1);
1221 
1223  $this,
1224  $ilToolbar,
1225  array(
1226  'auto_complete_name' => $this->lng->txt('user'),
1227  'submit_name' => $this->lng->txt('add'),
1228  'add_search' => true,
1229  'add_from_container' => $this->ref_id
1230  )
1231  );
1232 
1233  $this->ctrl->setParameter($this, "rate360", "");
1234 
1235  $ilToolbar->addSeparator();
1236 
1237  $ilToolbar->addButton(
1238  $this->lng->txt("survey_360_add_external_rater"),
1239  $this->ctrl->getLinkTarget($this, "addExternalRaterForm")
1240  );
1241 
1242  // #13320
1243  require_once "Services/Link/classes/class.ilLink.php";
1244  $url = ilLink::_getStaticLink($this->object->getRefId());
1245 
1246  $tbl = new ilSurveyAppraiseesTableGUI($this, "editRaters", true, !$this->object->isAppraiseeClosed($appr_id), $url); // #11285
1247  $tbl->setData($this->object->getRatersData($appr_id));
1248  $this->tpl->setContent($tbl->getHTML());
1249  }
$url
static fillAutoCompleteToolbar($parent_object, ilToolbarGUI $toolbar=null, $a_options=array(), $a_sticky=false)
fill toolbar with
+ Here is the call graph for this function:

◆ executeCommand()

ilSurveyParticipantsGUI::executeCommand ( )

Definition at line 106 of file class.ilSurveyParticipantsGUI.php.

References $ctrl, $lng, and $tabs.

107  {
108  $ilCtrl = $this->ctrl;
109  $ilTabs = $this->tabs;
110  $lng = $this->lng;
111 
112  $cmd = $ilCtrl->getCmd("maintenance");
113  $next_class = $this->ctrl->getNextClass($this);
114 
115  switch ($next_class) {
116  case 'ilrepositorysearchgui':
117  $rep_search = new ilRepositorySearchGUI();
118 
119  if (!$_REQUEST["appr360"] && !$_REQUEST["rate360"]) {
120  $ilTabs->clearTargets();
121  $ilTabs->setBackTarget(
122  $this->lng->txt("btn_back"),
123  $this->ctrl->getLinkTarget($this, "maintenance")
124  );
125 
126  $rep_search->setCallback(
127  $this,
128  'inviteUsers',
129  array(
130  )
131  );
132  $rep_search->setTitle($lng->txt("svy_invite_participants"));
133  // Set tabs
134  $this->ctrl->setReturn($this, 'maintenance');
135  $this->ctrl->forwardCommand($rep_search);
136  $ilTabs->setTabActive('maintenance');
137  } elseif ($_REQUEST["rate360"]) {
138  $ilTabs->clearTargets();
139  $ilTabs->setBackTarget(
140  $this->lng->txt("btn_back"),
141  $this->ctrl->getLinkTarget($this, "listAppraisees")
142  );
143 
144  $this->ctrl->setParameter($this, "rate360", 1);
145  $this->ctrl->saveParameter($this, "appr_id");
146 
147  $rep_search->setCallback(
148  $this,
149  'addRater',
150  array(
151  )
152  );
153 
154  // Set tabs
155  $this->ctrl->setReturn($this, 'editRaters');
156  $this->ctrl->forwardCommand($rep_search);
157  } else {
158  $ilTabs->activateTab("survey_360_appraisees");
159  $this->ctrl->setParameter($this, "appr360", 1);
160 
161  $rep_search->setCallback(
162  $this,
163  'addAppraisee',
164  array(
165  )
166  );
167 
168  // Set tabs
169  $this->ctrl->setReturn($this, 'listAppraisees');
170  $this->ctrl->forwardCommand($rep_search);
171  }
172  break;
173 
174  default:
175  $cmd .= "Object";
176  $this->$cmd();
177  break;
178  }
179  }

◆ exportAllCodesObject()

ilSurveyParticipantsGUI::exportAllCodesObject ( )

Exports all survey codes.

Definition at line 660 of file class.ilSurveyParticipantsGUI.php.

References ilUtil\deliverData(), and ilUtil\getASCIIFilename().

661  {
662  $export = $this->object->getSurveyCodesForExport();
663  ilUtil::deliverData($export, ilUtil::getASCIIFilename($this->object->getTitle() . ".csv"));
664  }
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
+ Here is the call graph for this function:

◆ exportCodesObject()

ilSurveyParticipantsGUI::exportCodesObject ( )

Exports a list of survey codes.

Definition at line 646 of file class.ilSurveyParticipantsGUI.php.

References $_POST, ilUtil\deliverData(), ilUtil\getASCIIFilename(), and ilUtil\sendFailure().

647  {
648  if (is_array($_POST["chb_code"]) && (count($_POST["chb_code"]) > 0)) {
649  $export = $this->object->getSurveyCodesForExport(null, $_POST["chb_code"]);
650  ilUtil::deliverData($export, ilUtil::getASCIIFilename($this->object->getTitle() . ".csv"));
651  } else {
652  ilUtil::sendFailure($this->lng->txt("no_checkbox"), true);
653  $this->ctrl->redirect($this, 'codes');
654  }
655  }
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 sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
$_POST["username"]
+ Here is the call graph for this function:

◆ filterSurveyParticipantsByAccess()

ilSurveyParticipantsGUI::filterSurveyParticipantsByAccess (   $a_finished_ids = null)
protected

Definition at line 181 of file class.ilSurveyParticipantsGUI.php.

Referenced by confirmDeleteAllUserDataObject(), and maintenanceObject().

182  {
183  $all_participants = $this->object->getSurveyParticipants($a_finished_ids, false, true);
184  $participant_ids = [];
185  foreach ($all_participants as $participant) {
186  $participant_ids[] = $participant['usr_id'];
187  }
188 
189  $filtered_participant_ids = $this->access->filterUserIdsByRbacOrPositionOfCurrentUser(
190  'read_results',
191  'access_results',
192  $this->object->getRefId(),
193  $participant_ids
194  );
195 
196  $participants = [];
197  foreach ($all_participants as $username => $user_data) {
198  if (!$user_data['usr_id']) {
199  $participants[$username] = $user_data;
200  }
201  if (in_array($user_data['usr_id'], $filtered_participant_ids)) {
202  $participants[$username] = $user_data;
203  }
204  }
205 
206  return $participants;
207  }
+ Here is the caller graph for this function:

◆ getObject()

ilSurveyParticipantsGUI::getObject ( )

Definition at line 1707 of file class.ilSurveyParticipantsGUI.php.

References $object.

1708  {
1709  return $this->object;
1710  }

◆ handleRatersAccess()

ilSurveyParticipantsGUI::handleRatersAccess ( )

Definition at line 1182 of file class.ilSurveyParticipantsGUI.php.

References $access, $ilUser, and $user.

Referenced by addExternalRaterFormObject(), addRater(), confirmDeleteRatersObject(), deleteRatersObject(), editRatersObject(), mailRatersActionObject(), and mailRatersObject().

1183  {
1184  $ilAccess = $this->access;
1185  $ilUser = $this->user;
1186 
1187  if ($ilAccess->checkAccess("write", "", $this->ref_id)) {
1188  $appr_id = $_REQUEST["appr_id"];
1189  if (!$appr_id) {
1190  $this->ctrl->redirect($this, "listAppraisees");
1191  }
1192  return $appr_id;
1193  } elseif ($this->object->get360Mode() &&
1194  $this->object->get360SelfRaters() &&
1195  $this->object->isAppraisee($ilUser->getId()) &&
1196  !$this->object->isAppraiseeClosed($ilUser->getId())) {
1197  return $ilUser->getId();
1198  }
1199  $this->ctrl->redirect($this->parent_gui, "infoScreen");
1200  }
$ilUser
Definition: imgupload.php:18
+ Here is the caller graph for this function:

◆ handleWriteAccess()

◆ importAccessCodesActionObject()

ilSurveyParticipantsGUI::importAccessCodesActionObject ( )
protected

Import codes from export codes file.

Definition at line 701 of file class.ilSurveyParticipantsGUI.php.

References Vendor\Package\$e, $email, $url, IL_CAL_DATE, IL_CAL_DATETIME, IL_CAL_UNIX, and ilUtil\sendFailure().

702  {
703  if (trim($_FILES['codes']['tmp_name'])) {
704  $existing = array();
705  foreach ($this->object->getSurveyCodesTableData() as $item) {
706  $existing[$item["code"]] = $item["id"];
707  }
708 
709  $reader = new ilCSVReader();
710  $reader->open($_FILES['codes']['tmp_name']);
711  foreach ($reader->getDataArrayFromCSVFile() as $row) {
712  // numeric check of used column due to #26176
713  if (sizeof($row) == 8 && is_numeric($row[5])) {
714  // used/sent/url are not relevant when importing
715  list($code, $email, $last_name, $first_name, $created, $used, $sent, $url) = $row;
716 
717  // unique code?
718  if (!array_key_exists($code, $existing)) {
719  // could be date or datetime
720  try {
721  if (strlen($created) == 10) {
722  $created = new ilDate($created, IL_CAL_DATE);
723  } else {
724  $created = new ilDateTime($created, IL_CAL_DATETIME);
725  }
726  $created = $created->get(IL_CAL_UNIX);
727  } catch (Exception $e) {
728  ilUtil::sendFailure($e->getMessage(), true);
729  $this->ctrl->redirect($this, 'codes');
730  }
731 
732  $user_data = array(
733  "email" => $email
734  ,"lastname" => $last_name
735  ,"firstname" => $first_name
736  );
737  $this->object->importSurveyCode($code, $created, $user_data);
738  }
739  }
740  }
741 
742  ilUtil::sendSuccess($this->lng->txt('codes_created'), true);
743  }
744 
745  $this->ctrl->redirect($this, 'codes');
746  }
const IL_CAL_DATETIME
const IL_CAL_UNIX
Class for single dates.
if($orgName !==null) if($spconfig->hasValue('contacts')) $email
Definition: metadata.php:285
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
const IL_CAL_DATE
$url
+ Here is the call graph for this function:

◆ importAccessCodesObject()

ilSurveyParticipantsGUI::importAccessCodesObject ( )
protected

Import codes from export codes file (upload form)

Definition at line 669 of file class.ilSurveyParticipantsGUI.php.

References handleWriteAccess(), ilFormPropertyGUI\setInfo(), and setParticipantSubTabs().

670  {
671  $this->handleWriteAccess();
672  $this->setParticipantSubTabs("codes");
673 
674  $form_import_file = new ilPropertyFormGUI();
675  $form_import_file->setFormAction($this->ctrl->getFormAction($this));
676  $form_import_file->setTableWidth("100%");
677  $form_import_file->setId("codes_import_file");
678 
679  $headerfile = new ilFormSectionHeaderGUI();
680  $headerfile->setTitle($this->lng->txt("svy_import_codes"));
681  $form_import_file->addItem($headerfile);
682 
683  $export_file = new ilFileInputGUI($this->lng->txt("codes"), "codes");
684  $export_file->setInfo(sprintf(
685  $this->lng->txt('svy_import_codes_info'),
686  $this->lng->txt("export_all_survey_codes")
687  ));
688  $export_file->setSuffixes(array("csv"));
689  $export_file->setRequired(true);
690  $form_import_file->addItem($export_file);
691 
692  $form_import_file->addCommandButton("importAccessCodesAction", $this->lng->txt("import"));
693  $form_import_file->addCommandButton("codes", $this->lng->txt("cancel"));
694 
695  $this->tpl->setContent($form_import_file->getHTML());
696  }
This class represents a property form user interface.
This class represents a section header in a property form.
This class represents a file property in a property form.
setInfo($a_info)
Set Information Text.
setParticipantSubTabs(string $active)
Set the tabs for the access codes section.
+ Here is the call graph for this function:

◆ importExternalMailRecipientsFromFileFormObject()

ilSurveyParticipantsGUI::importExternalMailRecipientsFromFileFormObject ( )

Definition at line 980 of file class.ilSurveyParticipantsGUI.php.

References $_GET, $access, handleWriteAccess(), ilFormPropertyGUI\setInfo(), and setParticipantSubTabs().

981  {
982  $ilAccess = $this->access;
983 
984  $this->handleWriteAccess();
985  $this->setParticipantSubTabs("mail_survey_codes");
986 
987  $form_import_file = new ilPropertyFormGUI();
988  $form_import_file->setFormAction($this->ctrl->getFormAction($this));
989  $form_import_file->setTableWidth("100%");
990  $form_import_file->setId("codes_import_file");
991 
992  $headerfile = new ilFormSectionHeaderGUI();
993  $headerfile->setTitle($this->lng->txt("import_from_file"));
994  $form_import_file->addItem($headerfile);
995 
996  $externalmails = new ilFileInputGUI($this->lng->txt("externalmails"), "externalmails");
997  $externalmails->setInfo($this->lng->txt('externalmails_info'));
998  $externalmails->setRequired(true);
999  $form_import_file->addItem($externalmails);
1000  if ($ilAccess->checkAccess("write", "", $_GET["ref_id"])) {
1001  $form_import_file->addCommandButton("importExternalRecipientsFromFile", $this->lng->txt("import"));
1002  }
1003  if ($ilAccess->checkAccess("write", "", $_GET["ref_id"])) {
1004  $form_import_file->addCommandButton("codes", $this->lng->txt("cancel"));
1005  }
1006 
1007  $this->tpl->setContent($form_import_file->getHTML());
1008  }
This class represents a property form user interface.
$_GET["client_id"]
This class represents a section header in a property form.
This class represents a file property in a property form.
setInfo($a_info)
Set Information Text.
setParticipantSubTabs(string $active)
Set the tabs for the access codes section.
+ Here is the call graph for this function:

◆ importExternalMailRecipientsFromTextFormObject()

ilSurveyParticipantsGUI::importExternalMailRecipientsFromTextFormObject ( )

Definition at line 1010 of file class.ilSurveyParticipantsGUI.php.

References $_GET, $_SESSION, $access, handleWriteAccess(), setParticipantSubTabs(), and ilTextAreaInputGUI\setValue().

1011  {
1012  $ilAccess = $this->access;
1013 
1014  $this->handleWriteAccess();
1015  $this->setParticipantSubTabs("mail_survey_codes");
1016 
1017  $form_import_text = new ilPropertyFormGUI();
1018  $form_import_text->setFormAction($this->ctrl->getFormAction($this));
1019  $form_import_text->setTableWidth("100%");
1020  $form_import_text->setId("codes_import_text");
1021 
1022  $headertext = new ilFormSectionHeaderGUI();
1023  $headertext->setTitle($this->lng->txt("import_from_text"));
1024  $form_import_text->addItem($headertext);
1025 
1026  $inp = new ilTextAreaInputGUI($this->lng->txt('externaltext'), 'externaltext');
1027  if (array_key_exists('externaltext', $_SESSION) && strlen($_SESSION['externaltext'])) {
1028  $inp->setValue($_SESSION['externaltext']);
1029  } else {
1030  // $this->lng->txt('mail_import_example1') #14897
1031  $inp->setValue("email;firstname;lastname\n" . $this->lng->txt('mail_import_example2') . "\n" . $this->lng->txt('mail_import_example3') . "\n");
1032  }
1033  $inp->setRequired(true);
1034  $inp->setCols(80);
1035  $inp->setRows(10);
1036  $inp->setInfo($this->lng->txt('externaltext_info'));
1037  $form_import_text->addItem($inp);
1038  unset($_SESSION['externaltext']);
1039 
1040  if ($ilAccess->checkAccess("write", "", $_GET["ref_id"])) {
1041  $form_import_text->addCommandButton("importExternalRecipientsFromText", $this->lng->txt("import"));
1042  }
1043  if ($ilAccess->checkAccess("write", "", $_GET["ref_id"])) {
1044  $form_import_text->addCommandButton("codes", $this->lng->txt("cancel"));
1045  }
1046 
1047  $this->tpl->setContent($form_import_text->getHTML());
1048  }
$_SESSION["AccountId"]
This class represents a property form user interface.
$_GET["client_id"]
This class represents a section header in a property form.
setValue($a_value)
Set Value.
This class represents a text area property in a property form.
setParticipantSubTabs(string $active)
Set the tabs for the access codes section.
+ Here is the call graph for this function:

◆ importExternalRecipientsFromFileObject()

ilSurveyParticipantsGUI::importExternalRecipientsFromFileObject ( )

Definition at line 924 of file class.ilSurveyParticipantsGUI.php.

References $data, _convertCharset(), removeUTF8Bom(), and ilUtil\sendFailure().

925  {
926  if (trim($_FILES['externalmails']['tmp_name'])) {
927  $reader = new ilCSVReader();
928  $reader->open($_FILES['externalmails']['tmp_name']);
929  $data = $reader->getDataArrayFromCSVFile();
930  $fields = array_shift($data);
931  foreach ($fields as $idx => $field) {
932  $fields[$idx] = $this->removeUTF8Bom($field);
933  }
934  if (!in_array('email', $fields)) {
935  $reader->close();
936  ilUtil::sendFailure($this->lng->txt('err_external_rcp_no_email'), true);
937  $this->ctrl->redirect($this, 'codes');
938  }
939  $existingdata = $this->object->getExternalCodeRecipients();
940  $existingcolumns = array();
941  if (count($existingdata)) {
942  $first = array_shift($existingdata);
943  foreach ($first as $key => $value) {
944  array_push($existingcolumns, $key);
945  }
946  }
947 
948  $founddata = array();
949  foreach ($data as $row) {
950  if (count($row) == count($fields)) {
951  $dataset = array();
952  foreach ($fields as $idx => $fieldname) {
953  // #14811
954  $row[$idx] = $this->_convertCharset($row[$idx]);
955 
956  if (count($existingcolumns)) {
957  if (array_key_exists($idx, $existingcolumns)) {
958  $dataset[$fieldname] = $row[$idx];
959  }
960  } else {
961  $dataset[$fieldname] = $row[$idx];
962  }
963  }
964  if (strlen($dataset['email'])) {
965  array_push($founddata, $dataset);
966  }
967  }
968  }
969  $reader->close();
970 
971  if (sizeof($founddata)) {
972  $this->object->createSurveyCodesForExternalData($founddata);
973  ilUtil::sendSuccess($this->lng->txt('external_recipients_imported'), true);
974  }
975  }
976 
977  $this->ctrl->redirect($this, 'codes');
978  }
$data
Definition: storeScorm.php:23
_convertCharset($a_string, $a_from_charset="", $a_to_charset="UTF-8")
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
+ Here is the call graph for this function:

◆ importExternalRecipientsFromTextObject()

ilSurveyParticipantsGUI::importExternalRecipientsFromTextObject ( )

Definition at line 858 of file class.ilSurveyParticipantsGUI.php.

References $_POST, $_SESSION, $data, and ilUtil\sendFailure().

859  {
860  if (trim($_POST['externaltext'])) {
861  $data = preg_split("/[\n\r]/", $_POST['externaltext']);
862  $fields = preg_split("/;/", array_shift($data));
863  if (!in_array('email', $fields)) {
864  $_SESSION['externaltext'] = $_POST['externaltext'];
865  ilUtil::sendFailure($this->lng->txt('err_external_rcp_no_email_column'), true);
866  $this->ctrl->redirect($this, 'importExternalMailRecipientsFromTextForm');
867  }
868  $existingdata = $this->object->getExternalCodeRecipients();
869  $existingcolumns = array();
870  if (count($existingdata)) {
871  $first = array_shift($existingdata);
872  foreach ($first as $key => $value) {
873  array_push($existingcolumns, $key);
874  }
875  }
876  $founddata = array();
877  foreach ($data as $datarow) {
878  $row = preg_split("/;/", $datarow);
879  if (count($row) == count($fields)) {
880  $dataset = array();
881  foreach ($fields as $idx => $fieldname) {
882  if (count($existingcolumns)) {
883  if (array_key_exists($idx, $existingcolumns)) {
884  $dataset[$fieldname] = $row[$idx];
885  }
886  } else {
887  $dataset[$fieldname] = $row[$idx];
888  }
889  }
890  if (strlen($dataset['email'])) {
891  array_push($founddata, $dataset);
892  }
893  }
894  }
895  $this->object->createSurveyCodesForExternalData($founddata);
896  ilUtil::sendSuccess($this->lng->txt('external_recipients_imported'), true);
897  $this->ctrl->redirect($this, 'codes');
898  }
899 
900  $this->ctrl->redirect($this, 'importExternalMailRecipientsFromTextForm');
901  }
$data
Definition: storeScorm.php:23
$_SESSION["AccountId"]
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
$_POST["username"]
+ Here is the call graph for this function:

◆ initExternalRaterForm()

ilSurveyParticipantsGUI::initExternalRaterForm (   $appr_id)
protected

Definition at line 1275 of file class.ilSurveyParticipantsGUI.php.

References $email, and ilUserUtil\getNamePresentation().

Referenced by addExternalRaterFormObject(), and addExternalRaterObject().

1276  {
1277  $form = new ilPropertyFormGUI();
1278  $form->setFormAction($this->ctrl->getFormAction($this, "addExternalRater"));
1279  $form->setTitle($this->lng->txt("survey_360_add_external_rater") .
1280  ": " . ilUserUtil::getNamePresentation($appr_id));
1281 
1282  $email = new ilEmailInputGUI($this->lng->txt("email"), "email");
1283  $email->setRequired(true);
1284  $form->addItem($email);
1285 
1286  $lname = new ilTextInputGUI($this->lng->txt("lastname"), "lname");
1287  $lname->setSize(30);
1288  $form->addItem($lname);
1289 
1290  $fname = new ilTextInputGUI($this->lng->txt("firstname"), "fname");
1291  $fname->setSize(30);
1292  $form->addItem($fname);
1293 
1294  $form->addCommandButton("addExternalRater", $this->lng->txt("save"));
1295  $form->addCommandButton("editRaters", $this->lng->txt("cancel"));
1296 
1297  return $form;
1298  }
This class represents a property form user interface.
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:
if($orgName !==null) if($spconfig->hasValue('contacts')) $email
Definition: metadata.php:285
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ initMailRatersForm()

ilSurveyParticipantsGUI::initMailRatersForm (   $appr_id,
array  $rec_ids 
)

Definition at line 1432 of file class.ilSurveyParticipantsGUI.php.

References ilFormPropertyGUI\setRequired().

Referenced by mailRatersActionObject(), and mailRatersObject().

1433  {
1434  $form = new ilPropertyFormGUI();
1435  $form->setFormAction($this->ctrl->getFormAction($this, "mailRatersAction"));
1436  $form->setTitle($this->lng->txt('compose'));
1437 
1438  $all_data = $this->object->getRatersData($appr_id);
1439  $rec_data = array();
1440  foreach ($rec_ids as $rec_id) {
1441  if (isset($all_data[$rec_id])) {
1442  $rec_data[] = $all_data[$rec_id]["lastname"] . ", " .
1443  $all_data[$rec_id]["firstname"] .
1444  " (" . $all_data[$rec_id]["email"] . ")";
1445  }
1446  }
1447  sort($rec_data);
1448  $rec = new ilCustomInputGUI($this->lng->txt('recipients'));
1449  $rec->setHTML(implode("<br />", $rec_data));
1450  $form->addItem($rec);
1451 
1452  $subject = new ilTextInputGUI($this->lng->txt('subject'), 'subject');
1453  $subject->setSize(50);
1454  $subject->setRequired(true);
1455  $form->addItem($subject);
1456 
1457  $existingdata = $this->object->getExternalCodeRecipients();
1458  $existingcolumns = array();
1459  if (count($existingdata)) {
1460  $first = array_shift($existingdata);
1461  foreach ($first as $key => $value) {
1462  if (strcmp($key, 'code') != 0 && strcmp($key, 'email') != 0 && strcmp($key, 'sent') != 0) {
1463  array_push($existingcolumns, '[' . $key . ']');
1464  }
1465  }
1466  }
1467 
1468  $mailmessage_u = new ilTextAreaInputGUI($this->lng->txt('survey_360_rater_message_content_registered'), 'message_u');
1469  $mailmessage_u->setRequired(true);
1470  $mailmessage_u->setCols(80);
1471  $mailmessage_u->setRows(10);
1472  $form->addItem($mailmessage_u);
1473 
1474  $mailmessage_a = new ilTextAreaInputGUI($this->lng->txt('survey_360_rater_message_content_anonymous'), 'message_a');
1475  $mailmessage_a->setRequired(true);
1476  $mailmessage_a->setCols(80);
1477  $mailmessage_a->setRows(10);
1478  $mailmessage_a->setInfo(sprintf($this->lng->txt('message_content_info'), join(', ', $existingcolumns)));
1479  $form->addItem($mailmessage_a);
1480 
1481  $recf = new ilHiddenInputGUI("rtr_id");
1482  $recf->setValue(implode(";", $rec_ids));
1483  $form->addItem($recf);
1484 
1485  $form->addCommandButton("mailRatersAction", $this->lng->txt("send"));
1486  $form->addCommandButton("editRaters", $this->lng->txt("cancel"));
1487 
1488  $subject->setValue(sprintf($this->lng->txt('survey_360_rater_subject_default'), $this->object->getTitle()));
1489  $mailmessage_u->setValue($this->lng->txt('survey_360_rater_message_content_registered_default'));
1490  $mailmessage_a->setValue($this->lng->txt('survey_360_rater_message_content_anonymous_default'));
1491 
1492  return $form;
1493  }
This class represents a property form user interface.
This class represents a hidden form property in a property form.
This class represents a custom property in a property form.
This class represents a text area property in a property form.
setRequired($a_required)
Set Required.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ insertSavedMessageObject()

ilSurveyParticipantsGUI::insertSavedMessageObject ( )

Definition at line 764 of file class.ilSurveyParticipantsGUI.php.

References Vendor\Package\$e, $ilUser, $log, $user, handleWriteAccess(), ilUtil\sendFailure(), and setParticipantSubTabs().

765  {
766  $this->handleWriteAccess();
767  $this->setParticipantSubTabs("codes");
768 
769  $form_gui = new FormMailCodesGUI($this);
770  $form_gui->setValuesByPost();
771  try {
772  if ($form_gui->getSavedMessages()->getValue() > 0) {
774  $settings = $this->object->getUserSettings($ilUser->getId(), 'savemessage');
775  $form_gui->getMailMessage()->setValue($settings[$form_gui->getSavedMessages()->getValue()]['value']);
776  ilUtil::sendSuccess($this->lng->txt('msg_message_inserted'));
777  } else {
778  ilUtil::sendFailure($this->lng->txt('msg_no_message_inserted'));
779  }
780  } catch (Exception $e) {
781  $ilLog = $this->log;
782  $ilLog->write('Error: ' + $e->getMessage());
783  }
784  $this->tpl->setVariable("ADM_CONTENT", $form_gui->getHTML());
785  }
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
Class FormMailCodesGUI.
$ilUser
Definition: imgupload.php:18
setParticipantSubTabs(string $active)
Set the tabs for the access codes section.
+ Here is the call graph for this function:

◆ inviteUsers()

ilSurveyParticipantsGUI::inviteUsers (   $user_ids)

Invite users.

Parameters
int[]

Definition at line 1717 of file class.ilSurveyParticipantsGUI.php.

References $ctrl, and $lng.

1718  {
1719  $lng = $this->lng;
1720  $ctrl = $this->ctrl;
1721 
1722  if (is_array($user_ids)) {
1723  foreach ($user_ids as $user_id) {
1724  $this->invitation_manager->add($this->object->getSurveyId(), (int) $user_id);
1725  }
1726  }
1727  ilUtil::sendSuccess($lng->txt("svy_users_invited"), true);
1728  $ctrl->redirect($this, "maintenance");
1729  }

◆ isAnonymousListActive()

ilSurveyParticipantsGUI::isAnonymousListActive ( )
protected

Definition at line 277 of file class.ilSurveyParticipantsGUI.php.

References $total.

Referenced by listParticipantsObject(), and setParticipantSubTabs().

278  {
279  $surveySetting = new ilSetting("survey");
280 
281  if ($surveySetting->get("anonymous_participants", false)) {
282  if ($this->object->hasAnonymizedResults() &&
283  $this->object->hasAnonymousUserList()) {
284  $end = $this->object->getEndDate();
285  if ($end && $end < date("YmdHis")) {
286  $min = $surveySetting->get("anonymous_participants_min", 0);
287  $total = $this->object->getSurveyParticipants();
288  if (!$min || sizeof($total) >= $min) {
289  return true;
290  }
291  }
292  }
293  }
294  return false;
295  }
$total
Definition: Utf8Test.php:87
+ Here is the caller graph for this function:

◆ listAppraiseesObject()

ilSurveyParticipantsGUI::listAppraiseesObject ( )

Definition at line 1066 of file class.ilSurveyParticipantsGUI.php.

References $ctrl, $lng, $ref_id, $toolbar, ilRepositorySearchGUI\fillAutoCompleteToolbar(), and handleWriteAccess().

Referenced by maintenanceObject().

1067  {
1068  $ilToolbar = $this->toolbar;
1069  $lng = $this->lng;
1070  $ilCtrl = $this->ctrl;
1071 
1072  $this->handleWriteAccess();
1073 
1074  $this->ctrl->setParameter($this, "appr360", 1);
1075 
1077  $this,
1078  $ilToolbar,
1079  array(
1080  'auto_complete_name' => $this->lng->txt('user'),
1081  'submit_name' => $this->lng->txt('add'),
1082  'add_search' => true,
1083  'add_from_container' => $this->ref_id
1084  )
1085  );
1086 
1087  // competence calculations
1088  $skmg_set = new ilSkillManagementSettings();
1089  if ($this->object->getSkillService() && $skmg_set->isActivated()) {
1090  $ilToolbar->addSeparator();
1091  $ilToolbar->addButton(
1092  $lng->txt("survey_calc_skills"),
1093  $ilCtrl->getLinkTargetByClass("ilsurveyskilldeterminationgui"),
1094  ""
1095  );
1096  }
1097 
1098  $ilToolbar->addSeparator();
1099  $ilToolbar->addButton(
1100  $this->lng->txt('svy_delete_all_user_data'),
1101  $this->ctrl->getLinkTarget($this, 'deleteAllUserData')
1102  );
1103 
1104  $this->ctrl->setParameter($this, "appr360", "");
1105 
1106  $tbl = new ilSurveyAppraiseesTableGUI($this, "listAppraisees");
1107  $tbl->setData($this->object->getAppraiseesData());
1108  $this->tpl->setContent($tbl->getHTML());
1109  }
static fillAutoCompleteToolbar($parent_object, ilToolbarGUI $toolbar=null, $a_options=array(), $a_sticky=false)
fill toolbar with
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ listParticipantsObject()

ilSurveyParticipantsGUI::listParticipantsObject ( )
protected

Definition at line 1686 of file class.ilSurveyParticipantsGUI.php.

References $toolbar, ilLinkButton\getInstance(), handleWriteAccess(), isAnonymousListActive(), and setParticipantSubTabs().

1687  {
1688  $ilToolbar = $this->toolbar;
1689 
1690  if (!$this->isAnonymousListActive()) {
1691  $this->ctrl->redirect($this, "maintenance");
1692  }
1693 
1694  $this->handleWriteAccess();
1695  $this->setParticipantSubTabs("anon_participants");
1696 
1697  $button = ilLinkButton::getInstance();
1698  $button->setCaption("print");
1699  $button->setOnClick("window.print(); return false;");
1700  $button->setOmitPreventDoubleSubmission(true);
1701  $ilToolbar->addButtonInstance($button);
1702 
1703  $tbl = new ilSurveyParticipantsTableGUI($this, "listParticipants", $this->object);
1704  $this->tpl->setContent($tbl->getHTML());
1705  }
setParticipantSubTabs(string $active)
Set the tabs for the access codes section.
+ Here is the call graph for this function:

◆ mailCodesObject()

ilSurveyParticipantsGUI::mailCodesObject ( )

Definition at line 810 of file class.ilSurveyParticipantsGUI.php.

References $_POST, handleWriteAccess(), and setParticipantSubTabs().

811  {
812  $this->handleWriteAccess();
813  $this->setParticipantSubTabs("codes");
814 
815  $mailData['m_subject'] = (array_key_exists('m_subject', $_POST)) ? $_POST['m_subject'] : sprintf($this->lng->txt('default_codes_mail_subject'), $this->object->getTitle());
816  $mailData['m_message'] = (array_key_exists('m_message', $_POST)) ? $_POST['m_message'] : $this->lng->txt('default_codes_mail_message');
817  $mailData['m_notsent'] = (array_key_exists('m_notsent', $_POST)) ? $_POST['m_notsent'] : '1';
818 
819  $form_gui = new FormMailCodesGUI($this);
820  $form_gui->setValuesByArray($mailData);
821  $this->tpl->setVariable("ADM_CONTENT", $form_gui->getHTML());
822  }
Class FormMailCodesGUI.
$_POST["username"]
setParticipantSubTabs(string $active)
Set the tabs for the access codes section.
+ Here is the call graph for this function:

◆ mailRatersActionObject()

ilSurveyParticipantsGUI::mailRatersActionObject ( )

Definition at line 1520 of file class.ilSurveyParticipantsGUI.php.

References $_POST, $ilUser, $url, $user, ilLink\_getStaticLink(), ANONYMOUS_USER_ID, handleRatersAccess(), initMailRatersForm(), and mailRatersObject().

1521  {
1522  $ilUser = $this->user;
1523 
1524  $appr_id = $this->handleRatersAccess();
1525  $this->ctrl->setParameter($this, "appr_id", $appr_id);
1526 
1527  $rec_ids = explode(";", $_POST["rtr_id"]);
1528  if (!sizeof($rec_ids)) {
1529  $this->ctrl->redirect($this, "editRaters");
1530  }
1531 
1532  $form = $this->initMailRatersForm($appr_id, $rec_ids);
1533  if ($form->checkInput()) {
1534  $txt_u = $form->getInput("message_u");
1535  $txt_a = $form->getInput("message_a");
1536  $subj = $form->getInput("subject");
1537 
1538  // #12743
1539  $sender_id = (trim($ilUser->getEmail()))
1540  ? $ilUser->getId()
1542 
1543  $all_data = $this->object->getRatersData($appr_id);
1544  foreach ($rec_ids as $rec_id) {
1545  if (isset($all_data[$rec_id])) {
1546  $user = $all_data[$rec_id];
1547 
1548  // anonymous
1549  if (substr($rec_id, 0, 1) == "a") {
1550  $mytxt = $txt_a;
1551  $url = $user["href"];
1552  $rcp = $user["email"];
1553  }
1554  // reg
1555  else {
1556  $mytxt = $txt_u;
1557  $user["code"] = $this->lng->txt("survey_code_mail_on_demand");
1558  $url = ilLink::_getStaticLink($this->object->getRefId());
1559  $rcp = $user["login"]; // #15141
1560  }
1561 
1562  $mytxt = str_replace("[lastname]", $user["lastname"], $mytxt);
1563  $mytxt = str_replace("[firstname]", $user["firstname"], $mytxt);
1564  $mytxt = str_replace("[url]", $url, $mytxt);
1565  $mytxt = str_replace("[code]", $user["code"], $mytxt);
1566 
1567  $mail = new ilMail($sender_id);
1568  $mail->enqueue(
1569  $rcp, // to
1570  "", // cc
1571  "", // bcc
1572  $subj, // subject
1573  $mytxt, // message
1574  array() // attachments
1575  );
1576 
1577  $this->object->set360RaterSent(
1578  $appr_id,
1579  (substr($rec_id, 0, 1) == "a") ? 0 : (int) substr($rec_id, 1),
1580  (substr($rec_id, 0, 1) == "u") ? 0 : (int) substr($rec_id, 1)
1581  );
1582  }
1583  }
1584 
1585  ilUtil::sendSuccess($this->lng->txt("mail_sent"), true);
1586  $this->ctrl->redirect($this, "editRaters");
1587  }
1588 
1589  $form->setValuesByPost();
1590  $this->mailRatersObject($form);
1591  }
const ANONYMOUS_USER_ID
Definition: constants.php:25
initMailRatersForm($appr_id, array $rec_ids)
$url
$ilUser
Definition: imgupload.php:18
mailRatersObject(ilPropertyFormGUI $a_form=null)
$_POST["username"]
+ Here is the call graph for this function:

◆ mailRatersObject()

ilSurveyParticipantsGUI::mailRatersObject ( ilPropertyFormGUI  $a_form = null)

Definition at line 1495 of file class.ilSurveyParticipantsGUI.php.

References $_POST, $tabs, handleRatersAccess(), initMailRatersForm(), and ilUtil\sendFailure().

Referenced by mailRatersActionObject().

1496  {
1497  $ilTabs = $this->tabs;
1498 
1499  if (!$a_form) {
1500  $appr_id = $this->handleRatersAccess();
1501  $this->ctrl->setParameter($this, "appr_id", $appr_id);
1502 
1503  if (!sizeof($_POST["rtr_id"])) {
1504  ilUtil::sendFailure($this->lng->txt("select_one"), true);
1505  $this->ctrl->redirect($this, "editRaters");
1506  }
1507 
1508  $a_form = $this->initMailRatersForm($appr_id, $_POST["rtr_id"]);
1509  }
1510 
1511  $ilTabs->clearTargets();
1512  $ilTabs->setBackTarget(
1513  $this->lng->txt("btn_back"),
1514  $this->ctrl->getLinkTarget($this, "editRaters")
1515  );
1516 
1517  $this->tpl->setContent($a_form->getHTML());
1518  }
initMailRatersForm($appr_id, array $rec_ids)
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
$_POST["username"]
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ maintenanceObject()

ilSurveyParticipantsGUI::maintenanceObject ( )

Participants maintenance.

Definition at line 213 of file class.ilSurveyParticipantsGUI.php.

References $data, $lng, $toolbar, $total, filterSurveyParticipantsByAccess(), handleWriteAccess(), listAppraiseesObject(), ilObjSurvey\MODE_SELF_EVAL, and setParticipantSubTabs().

214  {
215  $ilToolbar = $this->toolbar;
216  $lng = $this->lng;
217 
218  if ($this->object->get360Mode()) {
219  return $this->listAppraiseesObject();
220  }
221 
222  //Btn Determine Competence Levels
223  if ($this->object->getMode() == ilObjSurvey::MODE_SELF_EVAL) {
224  $skmg_set = new ilSkillManagementSettings();
225  if ($this->object->getSkillService() && $skmg_set->isActivated()) {
226  $ilToolbar->addButton(
227  $this->lng->txt("survey_calc_skills"),
228  $this->ctrl->getLinkTargetByClass("ilsurveyskilldeterminationgui"),
229  ""
230  );
231  }
232  }
233 
234  $this->handleWriteAccess();
235  $this->setParticipantSubTabs("overview");
236 
237  $ilToolbar->addButton(
238  $this->lng->txt('svy_remove_all_participants'),
239  $this->ctrl->getLinkTarget($this, 'deleteAllUserData')
240  );
241 
242  $ilToolbar->addSeparator();
243 
244  if ($this->object->isAccessibleWithoutCode()) {
245  $ilToolbar->addButton(
246  $this->lng->txt("svy_invite_participants"),
247  $this->ctrl->getLinkTargetByClass('ilRepositorySearchGUI', '')
248  );
249  }
250 
251  $table_gui = new ilSurveyMaintenanceTableGUI($this, 'maintenance');
252 
254  $data = array();
255  foreach ($total as $user_data) {
256  $finished = false;
257  if ((bool) $user_data["finished"]) {
258  $finished = $user_data["finished_tstamp"];
259  }
260  $wt = $this->object->getWorkingtimeForParticipant($user_data["active_id"]);
261  $last_access = $this->object->getLastAccess($user_data["active_id"]);
262  array_push($data, array(
263  'id' => $user_data["active_id"],
264  'name' => $user_data["sortname"],
265  'usr_id' => $user_data["usr_id"],
266  'login' => $user_data["login"],
267  'last_access' => $last_access,
268  'workingtime' => $wt,
269  'finished' => $finished,
270  'invited' => $user_data["invited"]
271  ));
272  }
273  $table_gui->setData($data);
274  $this->tpl->setVariable('ADM_CONTENT', $table_gui->getHTML());
275  }
$data
Definition: storeScorm.php:23
$total
Definition: Utf8Test.php:87
filterSurveyParticipantsByAccess($a_finished_ids=null)
setParticipantSubTabs(string $active)
Set the tabs for the access codes section.
+ Here is the call graph for this function:

◆ removeUTF8Bom()

ilSurveyParticipantsGUI::removeUTF8Bom (   $a_text)
protected

Definition at line 918 of file class.ilSurveyParticipantsGUI.php.

Referenced by importExternalRecipientsFromFileObject().

919  {
920  $bom = pack('H*', 'EFBBBF');
921  return preg_replace('/^' . $bom . '/', '', $a_text);
922  }
+ Here is the caller graph for this function:

◆ sendCodesMailObject()

ilSurveyParticipantsGUI::sendCodesMailObject ( )

Definition at line 824 of file class.ilSurveyParticipantsGUI.php.

References $_POST, $ilUser, $lang, $user, handleWriteAccess(), ilUtil\sendFailure(), and setParticipantSubTabs().

825  {
827 
828  $this->handleWriteAccess();
829  $this->setParticipantSubTabs("mail_survey_codes");
830 
831  $form_gui = new FormMailCodesGUI($this);
832  if ($form_gui->checkInput()) {
833  $url_exists = strpos($_POST['m_message'], '[url]') !== false;
834  if (!$url_exists) {
835  ilUtil::sendFailure($this->lng->txt('please_enter_mail_url'));
836  $form_gui->setValuesByPost();
837  } else {
838  if ($_POST['savemessage'] == 1) {
840  $title = (strlen($_POST['savemessagetitle'])) ? $_POST['savemessagetitle'] : ilStr::substr($_POST['m_message'], 0, 40) . '...';
841  $this->object->saveUserSettings($ilUser->getId(), 'savemessage', $title, $_POST['m_message']);
842  }
843 
844  $lang = $ilUser->getPref("survey_code_language");
845  if (!$lang) {
846  $lang = $this->lng->getDefaultLanguage();
847  }
848  $this->object->sendCodes($_POST['m_notsent'], $_POST['m_subject'], nl2br($_POST['m_message']), $lang);
849  ilUtil::sendSuccess($this->lng->txt('mail_sent'), true);
850  $this->ctrl->redirect($this, 'mailCodes');
851  }
852  } else {
853  $form_gui->setValuesByPost();
854  }
855  $this->tpl->setVariable("ADM_CONTENT", $form_gui->getHTML());
856  }
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
$lang
Definition: xapiexit.php:8
Class FormMailCodesGUI.
$ilUser
Definition: imgupload.php:18
$_POST["username"]
setParticipantSubTabs(string $active)
Set the tabs for the access codes section.
+ Here is the call graph for this function:

◆ setCodeLanguageObject()

ilSurveyParticipantsGUI::setCodeLanguageObject ( )

Change survey language for direct access URL's.

Definition at line 460 of file class.ilSurveyParticipantsGUI.php.

References $_POST, $ilUser, and $user.

461  {
462  if (strcmp($_POST["lang"], "-1") != 0) {
464  $ilUser->writePref("survey_code_language", $_POST["lang"]);
465  }
466  ilUtil::sendSuccess($this->lng->txt('language_changed'), true);
467  $this->ctrl->redirect($this, 'codes');
468  }
$ilUser
Definition: imgupload.php:18
$_POST["username"]

◆ setParticipantSubTabs()

ilSurveyParticipantsGUI::setParticipantSubTabs ( string  $active)
protected

Set the tabs for the access codes section.

Parameters
string$active

Definition at line 302 of file class.ilSurveyParticipantsGUI.php.

References $data, $tabs, and isAnonymousListActive().

Referenced by codesObject(), deleteSavedMessageObject(), editCodesObject(), importAccessCodesObject(), importExternalMailRecipientsFromFileFormObject(), importExternalMailRecipientsFromTextFormObject(), insertSavedMessageObject(), listParticipantsObject(), mailCodesObject(), maintenanceObject(), and sendCodesMailObject().

303  {
304  $ilTabs = $this->tabs;
305 
306  // not used in 360° mode
307 
308  // overview
309  $ilTabs->addSubTab(
310  "overview",
311  $this->lng->txt("svy_part_overview"),
312  $this->ctrl->getLinkTarget($this, 'maintenance')
313  );
314 
315  if ($this->isAnonymousListActive()) {
316  $ilTabs->addSubTab(
317  "anon_participants",
318  $this->lng->txt("svy_anonymous_participants_svy"),
319  $this->ctrl->getLinkTarget($this, 'listParticipants')
320  );
321  }
322 
323  if (!$this->object->isAccessibleWithoutCode()) {
324  $ilTabs->addSubTab(
325  "codes",
326  $this->lng->txt("svy_codes"),
327  $this->ctrl->getLinkTarget($this, 'codes')
328  );
329  }
330 
331 
332  $data = $this->object->getExternalCodeRecipients();
333  if (count($data)) {
334  $ilTabs->addSubTab(
335  "mail_survey_codes",
336  $this->lng->txt("mail_survey_codes"),
337  $this->ctrl->getLinkTarget($this, "mailCodes")
338  );
339  }
340 
341  $ilTabs->activateSubTab($active);
342  }
$data
Definition: storeScorm.php:23
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ updateCodesObject()

ilSurveyParticipantsGUI::updateCodesObject ( )

Definition at line 563 of file class.ilSurveyParticipantsGUI.php.

References $_POST, $errors, and ilUtil\sendFailure().

564  {
565  if (!is_array($_POST["chb_code"])) {
566  $this->ctrl->redirect($this, 'codes');
567  }
568 
569  $errors = array();
570  $error_message = "";
571  foreach ($_POST["chb_code"] as $id) {
572  if (!$this->object->updateCode(
573  $id,
574  $_POST["chb_mail"][$id],
575  $_POST["chb_lname"][$id],
576  $_POST["chb_fname"][$id],
577  $_POST["chb_sent"][$id]
578  )) {
579  array_push($errors, array($_POST["chb_mail"][$id], $_POST["chb_lname"][$id], $_POST["chb_fname"][$id]));
580  };
581  }
582  if (empty($errors)) {
583  ilUtil::sendSuccess($this->lng->txt('settings_saved'), true);
584  } else {
585  foreach ($errors as $error) {
586  $error_message .= sprintf($this->lng->txt("error_save_code"), $error[0], $error[1], $error[2]);
587  }
588  ilUtil::sendFailure($error_message, true);
589  }
590 
591  $this->ctrl->redirect($this, 'codes');
592  }
$errors
Definition: imgupload.php:49
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
$_POST["username"]
+ Here is the call graph for this function:

Field Documentation

◆ $access

◆ $ctrl

ilSurveyParticipantsGUI::$ctrl
protected

◆ $has_write

ilSurveyParticipantsGUI::$has_write
protected

◆ $invitation_manager

ilSurveyParticipantsGUI::$invitation_manager
protected

Definition at line 72 of file class.ilSurveyParticipantsGUI.php.

◆ $lng

ilSurveyParticipantsGUI::$lng
protected

◆ $log

ilSurveyParticipantsGUI::$log
protected

◆ $object

ilSurveyParticipantsGUI::$object
protected

Definition at line 65 of file class.ilSurveyParticipantsGUI.php.

Referenced by getObject().

◆ $parent_gui

ilSurveyParticipantsGUI::$parent_gui
protected

Definition at line 64 of file class.ilSurveyParticipantsGUI.php.

◆ $rbacsystem

ilSurveyParticipantsGUI::$rbacsystem
protected

Definition at line 52 of file class.ilSurveyParticipantsGUI.php.

◆ $ref_id

ilSurveyParticipantsGUI::$ref_id
protected

Definition at line 66 of file class.ilSurveyParticipantsGUI.php.

Referenced by editRatersObject(), and listAppraiseesObject().

◆ $tabs

◆ $toolbar

ilSurveyParticipantsGUI::$toolbar
protected

◆ $tpl

ilSurveyParticipantsGUI::$tpl
protected

◆ $user


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