Bugzilla – Attachment 86218 Details for
Bug 21049
Rancor 007 field does not retain value
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 21049: Fix value of material select for Rancor 007 widget
Bug-21049-Fix-value-of-material-select-for-Rancor-.patch (text/plain), 2.73 KB, created by
Michal Denar
on 2019-03-06 21:24:40 UTC
(
hide
)
Description:
Bug 21049: Fix value of material select for Rancor 007 widget
Filename:
MIME Type:
Creator:
Michal Denar
Created:
2019-03-06 21:24:40 UTC
Size:
2.73 KB
patch
obsolete
>From 2841830d7ada9dcfa1acbe50fdc150eee82da0f8 Mon Sep 17 00:00:00 2001 >From: Julian Maurice <julian.maurice@biblibre.com> >Date: Wed, 6 Mar 2019 08:43:18 +0100 >Subject: [PATCH] Bug 21049: Fix value of material select for Rancor 007 widget > >The material type is selected in accordance with position 0 of 007 > >Test plan: >1. Create a new record using the advanced editor >2. Select a material type for field 007 and set at least the position 0 > of this field >3. Save the record and reload the page >4. The material type should remain selected >5. Try with all available material types > >Signed-off-by: Michal Denar <black23@gmail.com> >--- > koha-tmpl/intranet-tmpl/lib/koha/cateditor/widget.js | 7 +++++++ > .../prog/en/includes/cateditor-widgets-marc21.inc | 20 ++++++++++++++++++++ > 2 files changed, 27 insertions(+) > >diff --git a/koha-tmpl/intranet-tmpl/lib/koha/cateditor/widget.js b/koha-tmpl/intranet-tmpl/lib/koha/cateditor/widget.js >index bfb1ea1697..be0623699c 100644 >--- a/koha-tmpl/intranet-tmpl/lib/koha/cateditor/widget.js >+++ b/koha-tmpl/intranet-tmpl/lib/koha/cateditor/widget.js >@@ -121,6 +121,13 @@ define( [ 'resources' ], function( Resources ) { > materialInfo[ $(this).attr('id') ] = this; > } ); > >+ if (widget.getMaterial) { >+ const material = widget.getMaterial(); >+ if (material) { >+ $matSelect.val(material); >+ } >+ } >+ > $matSelect.change( function() { > widget.loadXMLMaterial( materialInfo[ $matSelect.val() ] ); > widget.nodeChanged(); >diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/cateditor-widgets-marc21.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/cateditor-widgets-marc21.inc >index f1cb70c1cd..bec78fe5ba 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/includes/cateditor-widgets-marc21.inc >+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/cateditor-widgets-marc21.inc >@@ -222,6 +222,26 @@ require( [ 'koha-backend', 'widget' ], function( KohaBackend, Widget ) { > > return $result[0]; > }, >+ materialTypeMapping: { >+ a: 'MPS', >+ c: 'ER', >+ d: 'GL', >+ f: 'TM', >+ g: 'PG', >+ h: 'MF', >+ k: 'NG', >+ m: 'MP', >+ o: 'KT', >+ q: 'NM', >+ r: 'RI', >+ s: 'SR', >+ t: 'TC', >+ v: 'VR', >+ z: 'UN' >+ }, >+ getMaterial: function () { >+ return this.materialTypeMapping[this.text.substring(0, 1)]; >+ }, > postCreate: function( node, mark ) { > this.createFromXML( 'marc21/xml/007' ); > } >-- >2.11.0
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 21049
:
86131
|
86218
|
86351
|
86352
|
86848
|
86849
|
86935
|
86936