Bugzilla – Attachment 88419 Details for
Bug 18823
Advanced editor - Rancor - add ability to edit records in import batches
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 18823: Rancor - save override warnings
Bug-18823-Rancor---save-override-warnings.patch (text/plain), 5.28 KB, created by
Alex Arnaud
on 2019-04-23 08:35:24 UTC
(
hide
)
Description:
Bug 18823: Rancor - save override warnings
Filename:
MIME Type:
Creator:
Alex Arnaud
Created:
2019-04-23 08:35:24 UTC
Size:
5.28 KB
patch
obsolete
>From 4f44b90d94ef9be034b4413f7bff80257a6f46e4 Mon Sep 17 00:00:00 2001 >From: Cori Lynn Arnold <carnold@dgiinc.com> >Date: Mon, 15 Oct 2018 18:16:26 +0000 >Subject: [PATCH] Bug 18823: Rancor - save override warnings > >Rebase. > >Signed-off-by: cori <corilynn.arnold@gmail.com> >Rebased-on: 2019-03-20 Alex Arnaud <alex.arnaud@biblibre.com> >--- > koha-tmpl/intranet-tmpl/lib/koha/cateditor/koha-backend.js | 12 +++++++----- > koha-tmpl/intranet-tmpl/prog/en/includes/cateditor-ui.inc | 8 +++++--- > 2 files changed, 12 insertions(+), 8 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/lib/koha/cateditor/koha-backend.js b/koha-tmpl/intranet-tmpl/lib/koha/cateditor/koha-backend.js >index 373f385..7cc1e64 100644 >--- a/koha-tmpl/intranet-tmpl/lib/koha/cateditor/koha-backend.js >+++ b/koha-tmpl/intranet-tmpl/lib/koha/cateditor/koha-backend.js >@@ -287,7 +287,9 @@ define( [ '/cgi-bin/koha/svc/cataloguing/framework?frameworkcode=&callback=defin > } ); > }, > >- ValidateRecord: function( frameworkcode, record ) { >+ ValidateRecord: function( frameworkcode, record, options ) { >+ options = options || {}; >+ > var errors = []; > > var mandatoryTags = KohaBackend.GetTagsBy( record.frameworkcode, 'mandatory', '1' ); >@@ -296,7 +298,7 @@ define( [ '/cgi-bin/koha/svc/cataloguing/framework?frameworkcode=&callback=defin > var nonRepeatableSubfields = KohaBackend.GetSubfieldsBy( record.frameworkcode, 'repeatable', '0' ); > > $.each( mandatoryTags, function( tag ) { >- if ( !record.hasField( tag ) ) errors.push( { type: 'missingTag', tag: tag } ); >+ if ( !record.hasField( tag ) && !options.override_warnings ) errors.push( { type: 'missingTag', tag: tag } ); > } ); > > var seenTags = {}; >@@ -309,7 +311,7 @@ define( [ '/cgi-bin/koha/svc/cataloguing/framework?frameworkcode=&callback=defin > } > > if ( seenTags[ field.tagnumber() ] && nonRepeatableTags[ field.tagnumber() ] ) { >- errors.push( { type: 'unrepeatableTag', line: field.sourceLine, tag: field.tagnumber() } ); >+ if ( !options.override_warnings ) errors.push( { type: 'unrepeatableTag', line: field.sourceLine, tag: field.tagnumber() } ); > return; > } > >@@ -319,7 +321,7 @@ define( [ '/cgi-bin/koha/svc/cataloguing/framework?frameworkcode=&callback=defin > > $.each( field.subfields(), function( undef, subfield ) { > if ( seenSubfields[ subfield[0] ] != null && ( nonRepeatableSubfields[ field.tagnumber() ] || {} )[ subfield[0] ] ) { >- errors.push( { type: 'unrepeatableSubfield', subfield: subfield[0], line: field.sourceLine } ); >+ if ( !options.override_warnings ) errors.push( { type: 'unrepeatableSubfield', subfield: subfield[0], line: field.sourceLine } ); > } else { > seenSubfields[ subfield[0] ] = subfield[1]; > } >@@ -327,7 +329,7 @@ define( [ '/cgi-bin/koha/svc/cataloguing/framework?frameworkcode=&callback=defin > > $.each( mandatorySubfields[ field.tagnumber() ] || {}, function( subfield ) { > if ( !seenSubfields[ subfield ] ) { >- errors.push( { type: 'missingSubfield', subfield: subfield[0], line: field.sourceLine } ); >+ if ( !options.override_warnings ) errors.push( { type: 'missingSubfield', subfield: subfield[0], line: field.sourceLine } ); > } > } ); > } ); >diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/cateditor-ui.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/cateditor-ui.inc >index bb890a1..7570ffc 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/includes/cateditor-ui.inc >+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/cateditor-ui.inc >@@ -402,7 +402,7 @@ require( [ 'koha-backend', 'search', 'macros', 'marc-editor', 'marc-record', 'pr > $( 'title', document.head ).html( _("Koha › Cataloging › ") + backend.titleForRecord.format( parts[1] ) ); > } > >- function saveRecord( recid, editor, callback ) { >+ function saveRecord( recid, editor, callback, options ) { > var parts = recid.split('/'); > if ( parts.length != 2 ) return false; > >@@ -417,7 +417,7 @@ require( [ 'koha-backend', 'search', 'macros', 'marc-editor', 'marc-record', 'pr > return; > } > >- var errors = KohaBackend.ValidateRecord( '', record ); >+ var errors = KohaBackend.ValidateRecord( '', record, options ); > if ( errors.length ) { > state.saving = false; > callback( { error: 'invalid', errors: errors } ); >@@ -451,7 +451,7 @@ require( [ 'koha-backend', 'search', 'macros', 'marc-editor', 'marc-record', 'pr > } > > if (callback) callback( data ); >- } ); >+ }, options ); > } > > function loadRecord( recid, editor, callback ) { >@@ -1160,6 +1160,8 @@ require( [ 'koha-backend', 'search', 'macros', 'marc-editor', 'marc-record', 'pr > } > } > >+ var options = { override_warnings: $(this).is('#save-with-override') } >+ > $.each( enabledTargets, function() { > saveRecord( this.id, editor, finishCb, options ); > } ); >-- >2.7.4
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 18823
:
64434
|
66882
|
66883
|
66884
|
66885
|
66919
|
77240
|
77241
|
77242
|
77243
|
77244
|
79240
|
79241
|
79242
|
79243
|
79244
|
80519
|
80536
|
80604
|
80606
|
80608
|
80613
|
80626
|
80627
|
80628
|
80637
|
80639
|
80651
|
80861
|
80866
|
80868
|
80869
|
80870
|
80871
|
80872
|
80873
|
80947
|
85355
|
85356
|
85357
|
85358
|
85359
|
85376
|
85719
|
85720
|
85785
|
85828
|
86087
|
86173
|
86174
|
86175
|
86176
|
86177
|
86178
|
86179
|
86180
|
86181
|
86182
|
86183
|
86791
|
86792
|
86793
|
86794
|
86795
|
86796
|
86797
|
86798
|
86799
|
88417
|
88418
|
88419
|
88420
|
88421
|
88422
|
88423
|
88424
|
88425
|
88426
|
88427
|
88428
|
88429
|
88430
|
88431
|
88432
|
88493
|
88494
|
88495
|
88496
|
88497
|
88498
|
88499
|
88500
|
88501
|
88502
|
88503
|
88504
|
88505
|
88506
|
88507
|
88508
|
91205
|
91206
|
91207
|
91208
|
91209
|
91210
|
91211
|
91212
|
91213
|
91214
|
91215
|
91216
|
91217
|
91218
|
91219
|
92051
|
92120
|
92124
|
94436
|
94437
|
94438
|
94439
|
94440
|
94441
|
94442
|
94443
|
94444
|
94445
|
94446
|
94447
|
94448
|
94449
|
94450
|
94451
|
94452
|
99092
|
99093
|
99094
|
99095
|
99096
|
99097
|
99098
|
99099
|
99100
|
99101
|
99102
|
99103
|
99104
|
99105
|
99106
|
99107
|
99108
|
99109