Bugzilla – Attachment 35902 Details for
Bug 8064
Merge several biblio records
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
[PASSED QA] Bug 8064: Fix issues with control fields and non-repeatable check
PASSED-QA-Bug-8064-Fix-issues-with-control-fields-.patch (text/plain), 3.33 KB, created by
Kyle M Hall (khall)
on 2015-02-13 14:20:35 UTC
(
hide
)
Description:
[PASSED QA] Bug 8064: Fix issues with control fields and non-repeatable check
Filename:
MIME Type:
Creator:
Kyle M Hall (khall)
Created:
2015-02-13 14:20:35 UTC
Size:
3.33 KB
patch
obsolete
>From 9830bee8d1ba2cb7f640784219497addf9743b9d Mon Sep 17 00:00:00 2001 >From: Julian Maurice <julian.maurice@biblibre.com> >Date: Fri, 20 Dec 2013 11:01:09 +0100 >Subject: [PATCH] [PASSED QA] Bug 8064: Fix issues with control fields and non-repeatable check > >Fields < 010 were systematically unchecked during target rebuild because >they have no subfields (unchecking manually all subfields of a field >automatically uncheck the field) >When user check a field or a subfield, we have to uncheck it before >calling (sub)field_can_be_added. Otherwise, field is treated as if it >was already in target record, and this is a problem for non-repeatable >fields. > >Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com> > >Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> >--- > koha-tmpl/intranet-tmpl/prog/en/js/merge-record.js | 26 ++++++++++++++----- > 1 files changed, 19 insertions(+), 7 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/js/merge-record.js b/koha-tmpl/intranet-tmpl/prog/en/js/merge-record.js >index ab74e1a..9c3f492 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/js/merge-record.js >+++ b/koha-tmpl/intranet-tmpl/prog/en/js/merge-record.js >@@ -124,7 +124,11 @@ function rebuild_target($sources, $target) { > var fields = target_record[tag]; > for (i in fields) { > var field = fields[i]; >- if (field.subfields.length > 0) { >+ if (parseInt(tag) < 10) { >+ var $field_clone = $('#' + field.id).clone(); >+ $field_clone.find('.fieldpick').remove(); >+ $target.append($field_clone); >+ } else if (field.subfields.length > 0) { > var $field_clone = $('#' + field.id).clone(); > $field_clone.find('ul').empty(); > $field_clone.find('.fieldpick').remove(); >@@ -137,7 +141,7 @@ function rebuild_target($sources, $target) { > $field_clone.find('ul').append($subfield_clone); > } > } else { >- $('#' + field.id).find('input.fieldpick').attr('checked', false); >+ $('#' + field.id).find('input.fieldpick').removeAttr('checked'); > } > } > } >@@ -149,12 +153,16 @@ function rebuild_target($sources, $target) { > $(document).ready(function(){ > // When a field is checked / unchecked > $('input.fieldpick').click(function() { >- // (un)check all subfields > var ischecked = this.checked; >- if (ischecked && !field_can_be_added($('#tabs'), $(this).parent())) { >- return false; >+ if (ischecked) { >+ $(this).removeAttr('checked'); >+ if (!field_can_be_added($('#tabs'), $(this).parent())) { >+ return false; >+ } >+ $(this).attr('checked', 'checked'); > } > >+ // (un)check all subfields > $(this).parent().find("input.subfieldpick").each(function() { > this.checked = ischecked; > }); >@@ -164,8 +172,12 @@ $(document).ready(function(){ > // When a field or subfield is checked / unchecked > $("input.subfieldpick").click(function() { > var ischecked = this.checked; >- if (ischecked && !subfield_can_be_added($('#tabs'), $(this).parent())) { >- return false; >+ if (ischecked) { >+ $(this).removeAttr('checked'); >+ if (!subfield_can_be_added($('#tabs'), $(this).parent())) { >+ return false; >+ } >+ $(this).attr('checked', 'checked'); > } > rebuild_target($('#tabs'), $('#resultul')); > }); >-- >1.7.2.5
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 8064
:
9498
|
18433
|
18840
|
18923
|
19411
|
19413
|
21351
|
22749
|
23708
|
23709
|
23710
|
24078
|
24079
|
24080
|
26055
|
26056
|
26057
|
26058
|
28726
|
28829
|
28830
|
28831
|
28832
|
28833
|
29324
|
29325
|
29326
|
29327
|
29328
|
29921
|
29922
|
29923
|
29924
|
29925
|
35738
|
35739
|
35740
|
35741
|
35742
|
35900
|
35901
|
35902
|
35903
|
35904
|
35905
|
44633
|
44634
|
44635
|
44636
|
44637
|
44638