Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion main/gradebook/lib/GradebookUtils.php
Original file line number Diff line number Diff line change
Expand Up @@ -796,7 +796,13 @@ public static function get_list_users_certificates($cat_id = null, $userList = [
$userListCondition = implode("','", $userList);
$sql .= " AND u.user_id IN ('$userListCondition')";
}
$sql .= ' ORDER BY u.firstname';
$sortLastname = api_get_configuration_value('sort_lastname_export_certificates');
if ($sortLastname) {
$sql .= ' ORDER BY u.lastname';
} else {
$sql .= ' ORDER BY u.firstname';
}

$rs = Database::query($sql);

$list_users = [];
Expand Down
3 changes: 3 additions & 0 deletions main/install/configuration.dist.php
Original file line number Diff line number Diff line change
Expand Up @@ -813,3 +813,6 @@
// You need add a new option called "confirmation" to the registration settings
//INSERT INTO settings_options (variable, value, display_text) VALUES ('allow_registration', 'confirmation', 'MailConfirmation');
// ------ (End) Custom DB changes

// Sort by lastname in export all certificates.
// $_configuration['sort_lastname_export_certificates'] = false;