From f25825924a38f33d9ecd1291fb76bdf39fdfcc10 Mon Sep 17 00:00:00 2001 From: Florian Bontemps Date: Thu, 28 Apr 2022 15:13:22 +0000 Subject: [PATCH] [PATCH] Bug 30037: Select profile when staging records This is a second draft for making the profile selection process easier. Currently, if you have multiple profiles set up when staging Records on import, the defaut selection will always be "Do not use profile". With this patch, if at least one profile is already set up, the first one in the list (in alphabetical order) will be selected by default. To test: 1) You will need a Marc record to stage. 2) If you don't have any, create multiple profiles for staging Marc records for import (in the Tools section); two should be enough, they should have different settings. 3) See that "Do not use profile" is always preselected. 4) Apply patch. 5) Reload the page : Now, the first profile of your list should be preselected. 6) Confirm that manually picking a different profile still loads different settings 7) Sign off. Now rebased. Thanks-to: Didier Gautheron --- .../prog/en/modules/tools/stage-marc-import.tt | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/stage-marc-import.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/stage-marc-import.tt index 3ab3419d85..0bf33e1087 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/stage-marc-import.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/stage-marc-import.tt @@ -494,15 +494,21 @@ .then(resolve, reject); }) .then(function(profiles) { + var setDefault = false; profiles.sort( function(a, b) { return a.name.localeCompare(b.name); }); profiles.forEach(function(profile) { const opt = $("