From 12125bc37fa95a75410654d98226793f4ae73756 Mon Sep 17 00:00:00 2001 From: Angel Fernando Quiroz Campos Date: Thu, 5 Jan 2023 14:26:10 -0500 Subject: [PATCH] Add example for CSV file when importing course agenda reminders - refs BT#20356 --- main/admin/importCourseEventsExample.csv | 2 ++ main/admin/import_course_agenda_reminders.php | 11 ++++++++++- 2 files changed, 12 insertions(+), 1 deletion(-) create mode 100644 main/admin/importCourseEventsExample.csv diff --git a/main/admin/importCourseEventsExample.csv b/main/admin/importCourseEventsExample.csv new file mode 100644 index 0000000000..a77526150a --- /dev/null +++ b/main/admin/importCourseEventsExample.csv @@ -0,0 +1,2 @@ +CourseCode;UserName;StartDate;EndDate +xxx;xxx;YYYY-MM-DD HH:ii:ss;YYYY-MM-DD HH:ii:ss diff --git a/main/admin/import_course_agenda_reminders.php b/main/admin/import_course_agenda_reminders.php index 11724512d6..22fb235bcf 100644 --- a/main/admin/import_course_agenda_reminders.php +++ b/main/admin/import_course_agenda_reminders.php @@ -21,11 +21,20 @@ $tags[] = '((date_end))'; $tagsHelp = ''.get_lang('Tags').'' .'
'.implode("\n", $tags).'
'; +$fileHelpText = get_lang('ImportCSVFileLocation').'
' + .Display::url( + get_lang('ExampleCSVFile'), + 'importCourseEventsExample.csv', + ['target' => '_blank', 'download' => 'importCourseEventsExample.csv'] + ) + .'
CourseCode;UserName;StartDate;EndDate
+xxx;xxx;YYYY-MM-DD HH:ii:ss;YYYY-MM-DD HH:ii:ss
'; + $form = new FormValidator('agenda_reminders'); $form->addHeader(get_lang('CsvImport')); $form->addFile( 'events_file', - [get_lang('ImportAsCSV'), get_lang('ImportCSVFileLocation')], + [get_lang('ImportAsCSV'), $fileHelpText], ['accept' => 'text/csv'] ); $form->addRule('events_file', get_lang('ThisFieldIsRequired'), 'required');