Bugzilla – Attachment 131329 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]
Bug 30037: Select profile when staging notices
Bug-30037-Select-profile-when-staging-notices.patch (text/plain), 2.43 KB, created by
Florian
on 2022-03-03 15:05:56 UTC
(
hide
)
Description:
Bug 30037: Select profile when staging notices
Filename:
MIME Type:
Creator:
Florian
Created:
2022-03-03 15:05:56 UTC
Size:
2.43 KB
patch
obsolete
>From fe07ab8fc9719b08b0984aea3ce91842e9a68550 Mon Sep 17 00:00:00 2001 >From: Florian Bontemps <florian.bontemps@biblibre.com> >Date: Thu, 3 Mar 2022 14:48:50 +0000 >Subject: [PATCH] Bug 30037: Select profile when staging notices > >This is a first draft for making the profile selection process easier. Currently, if you have multiple profiles set up when staging Notices 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 (which should be the oldest) will be selected by default. > >To test: >1) You will need a Marc notice to stage. >2) If you don't have any, create multiple profiles for staging Marc recos 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. > >Thanks-to: Didier Gautheron <didier.gautheron@biblibre.com> >--- > .../prog/en/modules/tools/stage-marc-import.tt | 10 +++++++++- > 1 file changed, 9 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 7877265d90..622f87fd04 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 >@@ -482,12 +482,20 @@ > .then(resolve, reject); > }) > .then(function(profiles) { >+ var setDefault = false; > 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