Skip to content

Commit

Permalink
Merge pull request #171 from catalyst/upload-csv-regression-fix-400
Browse files Browse the repository at this point in the history
bugfix: upload csv output order regression
  • Loading branch information
keevan authored Jul 8, 2024
2 parents e5a6cf3 + 2abf609 commit 98da9b6
Showing 1 changed file with 18 additions and 18 deletions.
36 changes: 18 additions & 18 deletions upload.php
Original file line number Diff line number Diff line change
Expand Up @@ -71,24 +71,6 @@
// Validate entries.
$errors = $bm->validate();

// List out any issues in a table.
if (!empty($errors)) {
// Print summary statement.
echo \core\notification::error(get_string('error:bookingsuploadfileerrorsfound', 'mod_facetoface', count($errors)));

$table = new html_table();
$table->attributes['class'] = 'f2fbookingsuploadlist m-auto generaltable mb-2';

$table->head[] = get_string('uucsvline', 'tool_uploaduser');
$table->head[] = get_string('status');
$table->data = $errors;

echo html_writer::tag('div', html_writer::table($table), ['class' => 'flexible-wrap mb-4']);
} else {
// Bonus: show a preview/summary for good records (e.g. 40 records will be processed).
echo \core\notification::success(get_string('facetoface:uploadreadytoprocess', 'mod_facetoface'));
}

// Set form data to allow user to continue and process the uploaded file on their next form submit.
} else if ($process && $fileid && $f) {
// Form submitted, and ready for processing -> process.
Expand Down Expand Up @@ -146,6 +128,24 @@

echo $OUTPUT->header();

// List out any issues in a table.
if (!empty($errors)) {
// Print summary statement.
echo \core\notification::error(get_string('error:bookingsuploadfileerrorsfound', 'mod_facetoface', count($errors)));

$table = new html_table();
$table->attributes['class'] = 'f2fbookingsuploadlist m-auto generaltable mb-2';

$table->head[] = get_string('uucsvline', 'tool_uploaduser');
$table->head[] = get_string('status');
$table->data = $errors;

echo html_writer::tag('div', html_writer::table($table), ['class' => 'flexible-wrap mb-4']);
} else {
// Bonus: show a preview/summary for good records (e.g. 40 records will be processed).
echo \core\notification::success(get_string('facetoface:uploadreadytoprocess', 'mod_facetoface'));
}

$mform->display();

// Display footer.
Expand Down

0 comments on commit 98da9b6

Please sign in to comment.