Bugzilla – Attachment 134280 Details for
Bug 30037
Set default profile when staging MARC records on import
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
[PATCH] Bug 30037: Select profile when staging records
PATCH-Bug-30037-Select-profile-when-staging-record.patch (text/plain), 2.53 KB, created by
Florian
on 2022-04-28 15:18:52 UTC
(
hide
)
Description:
[PATCH] Bug 30037: Select profile when staging records
Filename:
MIME Type:
Creator:
Florian
Created:
2022-04-28 15:18:52 UTC
Size:
2.53 KB
patch
obsolete
>From f25825924a38f33d9ecd1291fb76bdf39fdfcc10 Mon Sep 17 00:00:00 2001 >From: Florian Bontemps <florian.bontemps@biblibre.com> >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 <didier.gautheron@biblibre.com> >--- > .../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 = $("<option/>"); > select.append(opt); >- if(id && profile.profile_id == id) { >+ if(id) { >+ if(id &&profile.profile_id == id) { >+ opt.prop('selected', true); >+ } >+ }else if (setDefault == false) { > opt.prop('selected', true); > } >+ setDefault = true; > opt.attr("value", profile.profile_id); > opt.text(profile.name); > opt.data("profile", profile); >-- >2.30.2
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 30037
:
131329
| 134280