Skip to content

Commit

Permalink
41335: No notification when 'Import user data from file' left blank
Browse files Browse the repository at this point in the history
  • Loading branch information
alex40724 committed Nov 14, 2024
1 parent 717bd17 commit 8612a2a
Showing 1 changed file with 18 additions and 5 deletions.
23 changes: 18 additions & 5 deletions Modules/Survey/Participants/class.ilSurveyParticipantsGUI.php
Original file line number Diff line number Diff line change
Expand Up @@ -1001,6 +1001,15 @@ protected function removeUTF8Bom(string $a_text): string

public function importExternalRecipientsFromFileObject(): void
{
$this->handleWriteAccess();
$form = $this->getImportExternalMailRecipientsFromFileForm();

if (!$form->checkInput()) {
$this->setParticipantSubTabs("codes");
$this->tpl->setContent($form->getHTML());
return;
}

if (trim($_FILES['externalmails']['tmp_name'])) {
$reader = new ilCSVReader();
$reader->open($_FILES['externalmails']['tmp_name']);
Expand Down Expand Up @@ -1061,10 +1070,15 @@ public function importExternalRecipientsFromFileObject(): void

public function importExternalMailRecipientsFromFileFormObject(): void
{
$ilAccess = $this->access;

$this->handleWriteAccess();
$this->setParticipantSubTabs("mail_survey_codes");
$this->setParticipantSubTabs("codes");
$form = $this->getImportExternalMailRecipientsFromFileForm();
$this->tpl->setContent($form->getHTML());
}

public function getImportExternalMailRecipientsFromFileForm(): ilPropertyFormGUI
{
$ilAccess = $this->access;

$form_import_file = new ilPropertyFormGUI();
$form_import_file->setFormAction($this->ctrl->getFormAction($this));
Expand All @@ -1085,8 +1099,7 @@ public function importExternalMailRecipientsFromFileFormObject(): void
if ($ilAccess->checkAccess("write", "", $this->edit_request->getRefId())) {
$form_import_file->addCommandButton("codes", $this->lng->txt("cancel"));
}

$this->tpl->setContent($form_import_file->getHTML());
return $form_import_file;
}

public function importExternalMailRecipientsFromTextFormObject(): void
Expand Down

0 comments on commit 8612a2a

Please sign in to comment.