|
Lines 12-20
div#result { margin-top: 1em; }
Link Here
|
| 12 |
|
12 |
|
| 13 |
// When submiting the form |
13 |
// When submiting the form |
| 14 |
function mergeformsubmit() { |
14 |
function mergeformsubmit() { |
| 15 |
$("ul#ulrecord1").remove(); |
15 |
$("#tabs").remove(); |
| 16 |
$("ul#ulrecord2").remove(); |
16 |
} |
| 17 |
} |
|
|
| 18 |
|
17 |
|
| 19 |
|
18 |
|
| 20 |
$(document).ready(function(){ |
19 |
$(document).ready(function(){ |
|
Lines 24-169
$(document).ready(function(){
Link Here
|
| 24 |
// Getting marc structure via ajax |
23 |
// Getting marc structure via ajax |
| 25 |
tagslib = []; |
24 |
tagslib = []; |
| 26 |
$.getJSON("/cgi-bin/koha/cataloguing/merge_ajax.pl", {frameworkcode : "[% framework %]" }, function(json) { |
25 |
$.getJSON("/cgi-bin/koha/cataloguing/merge_ajax.pl", {frameworkcode : "[% framework %]" }, function(json) { |
| 27 |
tagslib = json; |
26 |
tagslib = json; |
| 28 |
}); |
27 |
}); |
| 29 |
|
28 |
|
| 30 |
|
29 |
|
| 31 |
// Toggle a field / subfield |
30 |
// Toggle a field / subfield |
| 32 |
function toggleField(pField) { |
31 |
function toggleField(pField) { |
| 33 |
|
32 |
|
| 34 |
// Getting the key of the clicked checkbox |
33 |
// Getting the key of the clicked checkbox |
| 35 |
var ckid = $(pField).attr("id"); |
34 |
var ckid = $(pField).attr("id"); |
| 36 |
var tab = ckid.split('_'); |
35 |
var tab = ckid.split('_'); |
| 37 |
var source = tab[1]; // From which record the click came from |
36 |
var source = tab[1]; // From which record the click came from |
| 38 |
var key = tab[2]; |
37 |
var key = tab[2]; |
| 39 |
var type = $(pField).attr("class"); |
38 |
var type = $(pField).attr("class"); |
| 40 |
|
39 |
|
| 41 |
// Getting field/subfield |
40 |
// Getting field/subfield |
| 42 |
var field; |
41 |
var field; |
| 43 |
var subfield; |
42 |
var subfield; |
| 44 |
if (type == "subfieldpick") { |
43 |
if (type == "subfieldpick") { |
| 45 |
|
44 |
field = $(pField).parent().parent().parent().find("span.field").text(); |
| 46 |
field = $(pField).parent().parent().parent().find("span.field").text(); |
45 |
subfield = $(pField).parent().find("span.subfield").text(); |
| 47 |
subfield = $(pField).parent().find("span.subfield").text(); |
46 |
} else { |
| 48 |
} else { |
47 |
field = $(pField).parent().find("span.field").text(); |
| 49 |
|
48 |
} |
| 50 |
field = $(pField).parent().find("span.field").text(); |
49 |
|
| 51 |
} |
50 |
// If the field has just been checked |
| 52 |
|
51 |
if (pField.checked) { |
| 53 |
// If the field has just been checked |
52 |
// We check for repeatability |
| 54 |
if (pField.checked) { |
53 |
var canbeadded = true; |
| 55 |
|
54 |
if (type == "subfieldpick") { |
| 56 |
// We check for repeatability |
55 |
var repeatable = 1; |
| 57 |
var canbeadded = true; |
56 |
var alreadyexists = 0; |
| 58 |
if (type == "subfieldpick") { |
57 |
if (tagslib[field] && tagslib[field][subfield]) { |
| 59 |
var repeatable = 1; |
58 |
// Note : we can't use the dot notation here (tagslib.021) |
| 60 |
var alreadyexists = 0; |
59 |
// because the key is a number |
| 61 |
if (tagslib[field] && tagslib[field][subfield]) { |
60 |
repeatable = tagslib[field][subfield].repeatable; |
| 62 |
repeatable = tagslib[field][subfield].repeatable; // Note : we can't use the dot notation here (tagslib.021) because the key is a number |
61 |
// TODO : Checking for subfields |
| 63 |
// TODO : Checking for subfields |
62 |
} |
| 64 |
} |
63 |
} else { |
| 65 |
} else { |
64 |
if (tagslib[field]) { |
| 66 |
if (tagslib[field]) { |
65 |
repeatable = tagslib[field].repeatable; |
| 67 |
repeatable = tagslib[field].repeatable; |
66 |
alreadyexists = $("#resultul span.field:contains(" + field + ")"); |
| 68 |
alreadyexists = $("#resultul span.field:contains(" + field + ")"); |
67 |
if (repeatable == 0 && alreadyexists.length != 0) { |
| 69 |
if (repeatable == 0 && alreadyexists.length != 0) { |
68 |
canbeadded = false; |
| 70 |
canbeadded = false; |
69 |
} |
| 71 |
} |
70 |
} |
| 72 |
} |
71 |
} |
| 73 |
} |
72 |
// If the field is not repeatable, we check if it already exists in the result table |
| 74 |
// If the field is not repeatable, we check if it already exists in the result table |
73 |
if (canbeadded == false) { |
| 75 |
if (canbeadded == false) { |
74 |
alert(_('The field is non-repeatable and already exists in the destination record. Therefore, you cannot add it.')); |
| 76 |
alert(_('The field is non-repeatable and already exists in the destination record. Therefore, you cannot add it.')); |
75 |
pField.checked = 0; |
| 77 |
pField.checked = 0; |
76 |
} else { |
| 78 |
} else { |
77 |
// Cloning the field or subfield we picked |
| 79 |
|
78 |
var clone = $(pField).parent().clone(); |
| 80 |
// Cloning the field or subfield we picked |
79 |
|
| 81 |
var clone = $(pField).parent().clone(); |
80 |
// Removing the checkboxes from it |
| 82 |
|
81 |
$(clone).find("input.subfieldpick, input.fieldpick").each(function() { |
| 83 |
// Removing the checkboxes from it |
82 |
$(this).remove(); |
| 84 |
$(clone).find("input.subfieldpick, input.fieldpick").each(function() { |
83 |
}); |
| 85 |
$(this).remove(); |
84 |
|
| 86 |
}); |
85 |
// If we are a subfield |
| 87 |
|
86 |
if (type == "subfieldpick") { |
| 88 |
|
87 |
// then we need to find who is our parent field... |
| 89 |
// If we are a subfield |
88 |
fieldkey = $(pField).parent().parent().parent().attr("id"); |
| 90 |
if (type == "subfieldpick") { |
89 |
|
| 91 |
// then we need to find who is our parent field... |
90 |
// Find where to add the subfield |
| 92 |
fieldkey = $(pField).parent().parent().parent().attr("id"); |
91 |
|
| 93 |
|
92 |
// First, check if the field is not already in the destination record |
| 94 |
// Find where to add the subfield |
93 |
if ($("#resultul li#" + fieldkey).length > 0) { |
| 95 |
|
94 |
// If so, we add our field to it |
| 96 |
// First, check if the field is not already in the destination record |
95 |
$("#resultul li#" + fieldkey + " ul").append(clone); |
| 97 |
if ($("#resultul li#" + fieldkey).length > 0) { |
96 |
} else { |
| 98 |
// If so, we add our field to it |
97 |
// If not, we add the subfield to the first matching field |
| 99 |
$("#resultul li#" + fieldkey + " ul").append(clone); |
98 |
var where = 0; |
| 100 |
} else { |
99 |
$("#resultul li span.field").each(function() { |
| 101 |
// If not, we add the subfield to the first matching field |
100 |
if (where == 0 && $(this).text() == field) { |
| 102 |
var where = 0; |
101 |
where = this; |
| 103 |
$("#resultul li span.field").each(function() { |
102 |
} |
| 104 |
if (where == 0 && $(this).text() == field) { |
103 |
}); |
| 105 |
where = this; |
104 |
|
| 106 |
} |
105 |
// If there is no matching field in the destination record |
| 107 |
}); |
106 |
if (where == 0) { |
| 108 |
|
107 |
// TODO: |
| 109 |
// If there is no matching field in the destination record |
108 |
// We select the whole field and removing non-selected subfields, instead of... |
| 110 |
if (where == 0) { |
109 |
|
| 111 |
|
110 |
// Alerting the user |
| 112 |
// TODO: |
111 |
alert(_('This subfield cannot be added: there is no ' + field + ' field in the destination record.')); |
| 113 |
// We select the whole field and removing non-selected subfields, instead of... |
112 |
pField.checked = false; |
| 114 |
|
113 |
|
| 115 |
// Alerting the user |
114 |
} else { |
| 116 |
alert(_('This subfield cannot be added: there is no ' + field + ' field in the destination record.')); |
115 |
$(where).nextAll("ul").append(clone); |
| 117 |
pField.checked = false; |
116 |
} |
| 118 |
|
117 |
} |
| 119 |
} else { |
118 |
} else { |
| 120 |
$(where).nextAll("ul").append(clone); |
119 |
// If we are a field |
| 121 |
} |
120 |
var where = 0; |
| 122 |
|
121 |
// Find where to add the field |
| 123 |
} |
122 |
$("#resultul li span.field").each(function() { |
| 124 |
|
123 |
if (where == 0 && $(this).text() > field) { |
| 125 |
|
124 |
where = this; |
| 126 |
|
125 |
} |
| 127 |
} else { |
126 |
}); |
| 128 |
// If we are a field |
127 |
$(where).parent().before(clone); |
| 129 |
var where = 0; |
128 |
} |
| 130 |
// Find where to add the field |
129 |
} |
| 131 |
$("#resultul li span.field").each(function() { |
130 |
} else { |
| 132 |
if (where == 0 && $(this).text() > field) { |
131 |
// Else, we remove it from the results tab |
| 133 |
where = this; |
132 |
$("ul#resultul li#k" + key).remove(); |
| 134 |
} |
133 |
} |
| 135 |
}); |
134 |
} |
| 136 |
|
|
|
| 137 |
$(where).parent().before(clone); |
| 138 |
} |
| 139 |
} |
| 140 |
} else { |
| 141 |
|
| 142 |
// Else, we remove it from the results tab |
| 143 |
$("ul#resultul li#k" + key).remove(); |
| 144 |
} |
| 145 |
} |
| 146 |
|
135 |
|
| 147 |
|
136 |
|
| 148 |
// When a field is checked / unchecked |
137 |
// When a field is checked / unchecked |
| 149 |
$('input.fieldpick').click(function() { |
138 |
$('input.fieldpick').click(function() { |
| 150 |
toggleField(this); |
139 |
toggleField(this); |
| 151 |
// (un)check all subfields |
140 |
// (un)check all subfields |
| 152 |
var ischecked = this.checked; |
141 |
var ischecked = this.checked; |
| 153 |
$(this).parent().find("input.subfieldpick").each(function() { |
142 |
$(this).parent().find("input.subfieldpick").each(function() { |
| 154 |
this.checked = ischecked; |
143 |
this.checked = ischecked; |
| 155 |
}); |
144 |
}); |
| 156 |
}); |
145 |
}); |
| 157 |
|
146 |
|
| 158 |
// When a field or subfield is checked / unchecked |
147 |
// When a field or subfield is checked / unchecked |
| 159 |
$("input.subfieldpick").click(function() { |
148 |
$("input.subfieldpick").click(function() { |
| 160 |
toggleField(this); |
149 |
toggleField(this); |
| 161 |
}); |
150 |
}); |
| 162 |
|
151 |
|
| 163 |
}); |
152 |
}); |
| 164 |
|
153 |
|
| 165 |
function changeFramework(fw) { |
154 |
function changeFramework(fw) { |
| 166 |
$("#Frameworks").val(fw); |
155 |
$("#frameworkcode").val(fw); |
| 167 |
} |
156 |
} |
| 168 |
|
157 |
|
| 169 |
//]]> |
158 |
//]]> |
|
Lines 182-195
function changeFramework(fw) {
Link Here
|
| 182 |
|
171 |
|
| 183 |
<h1>Merging records</h1> |
172 |
<h1>Merging records</h1> |
| 184 |
[% IF ( result ) %] |
173 |
[% IF ( result ) %] |
| 185 |
[% IF ( errors ) %] |
174 |
[% IF ( errors.size ) %] |
| 186 |
[% FOREACH error IN errors %] |
175 |
[% FOREACH error IN errors %] |
| 187 |
<div class="dialog alert">[% error.error %].<br />Therefore, the record to be merged has not been deleted.</div> |
176 |
<div class="dialog alert">[% error.error %].<br />Therefore, the record to be merged has not been deleted.</div> |
| 188 |
[% END %] |
177 |
[% END %] |
| 189 |
|
178 |
|
| 190 |
[% ELSE %] |
179 |
[% ELSE %] |
| 191 |
<script type="text/javascript">window.location.href="/cgi-bin/koha/catalogue/MARCdetail.pl?biblionumber=[% biblio1 %]"</script> |
180 |
<script type="text/javascript">window.location.href="/cgi-bin/koha/catalogue/MARCdetail.pl?biblionumber=[% ref_biblionumber %]"</script> |
| 192 |
<p>The merging was successful. <a href="/cgi-bin/koha/catalogue/MARCdetail.pl?biblionumber=[% biblio1 %]">Click here to see the merged record.</a></p> |
181 |
<p>The merging was successful. <a href="/cgi-bin/koha/catalogue/MARCdetail.pl?biblionumber=[% ref_biblionumber %]">Click here to see the merged record.</a></p> |
| 193 |
[% END %] |
182 |
[% END %] |
| 194 |
|
183 |
|
| 195 |
[% ELSE %] |
184 |
[% ELSE %] |
|
Lines 198-228
function changeFramework(fw) {
Link Here
|
| 198 |
<p>Please choose which record will be the reference for the merge. The record chosen as reference will be kept, and the other will be deleted.</p> |
187 |
<p>Please choose which record will be the reference for the merge. The record chosen as reference will be kept, and the other will be deleted.</p> |
| 199 |
<form id="mergeform" action="/cgi-bin/koha/cataloguing/merge.pl" method="post"> |
188 |
<form id="mergeform" action="/cgi-bin/koha/cataloguing/merge.pl" method="post"> |
| 200 |
<fieldset class="rows"> |
189 |
<fieldset class="rows"> |
| 201 |
<legend>Merge reference</legend> |
190 |
<legend>Merge reference</legend> |
| 202 |
<ol> |
191 |
<ol> |
| 203 |
<li class="radio"><input type="radio" value="[% biblio1 %]" checked="checked" id="mergereference1" name="mergereference" onclick="changeFramework('[% frameworkcode1 %]')" /><label for="mergereference1">[% title1 %] [% FOREACH subtitl1 IN subtitle1 %] [% subtitl1.subfield %][% END %] (<a href="/cgi-bin/koha/catalogue/showmarc.pl?id=[% biblio1 %]" title="MARC" rel="gb_page_center[600,500]">[% biblio1 %]</a>)</label></li> |
192 |
[% FOREACH record IN records %] |
| 204 |
<li class="radio"><input type="radio" value="[% biblio2 %]" id="mergereference2" name="mergereference" onclick="changeFramework('[% frameworkcode2 %]')" /><label for="mergereference2">[% title2 %] [% FOREACH subtitl2 IN subtitle2 %] [% subtitl2.subfield %][% END %] (<a href="/cgi-bin/koha/catalogue/showmarc.pl?id=[% biblio2 %]" title="MARC" rel="gb_page_center[600,500]">[% biblio2 %]</a>)</label></li> |
193 |
<li class="radio"> |
| 205 |
|
194 |
[% IF loop.first %] |
| 206 |
[% IF frameworkselect %] |
195 |
<input type="radio" value="[% record.biblionumber %]" checked="checked" id="ref_biblionumber[% record.biblionumber %]" name="ref_biblionumber" onclick="changeFramework('[% record.frameworkcode %]')" /> |
| 207 |
<li><label for="frameworkcode">Using framework:</label> |
196 |
[% ELSE %] |
| 208 |
<select name="frameworkcode" id="frameworkcode"> |
197 |
<input type="radio" value="[% record.biblionumber %]" id="ref_biblionumber[% record.biblionumber %]" name="ref_biblionumber" onclick="changeFramework('[% record.frameworkcode %]')" /> |
| 209 |
<option value="Default">Default</option> |
198 |
[% END %] |
| 210 |
[% FOREACH frameworkcodeloo IN frameworkselect %] |
199 |
<label for="ref_biblionumber[% record.biblionumber %]"> |
| 211 |
[% IF ( frameworkcodeloo.selected ) %] |
200 |
[% record.data.title %] |
| 212 |
<option value="[% frameworkcodeloo.value %]" selected="selected"> |
201 |
[% FOREACH subtitle IN record.subtitles %] |
| 213 |
[% ELSE %] |
202 |
[% subtitle.subfield %] |
| 214 |
<option value="[% frameworkcodeloo.value %]"> |
203 |
[% END %] |
| 215 |
[% END %] |
204 |
(<a href="/cgi-bin/koha/catalogue/showmarc.pl?id=[% record.biblionumber %]" title="MARC" rel="gb_page_center[600,500]">[% record.biblionumber %]</a>) |
| 216 |
[% frameworkcodeloo.frameworktext %] |
205 |
</label> |
| 217 |
</option> |
206 |
</li> |
| 218 |
[% END %] |
207 |
[% END %] |
| 219 |
</select></li> |
208 |
|
|
|
209 |
[% IF frameworkselect.size %] |
| 210 |
<li> |
| 211 |
<label for="frameworkcode">Using framework:</label> |
| 212 |
<select name="frameworkcode" id="frameworkcode"> |
| 213 |
<option value="">Default</option> |
| 214 |
[% FOREACH frameworkcode IN frameworkselect %] |
| 215 |
[% IF ( frameworkcode.selected ) %] |
| 216 |
<option value="[% frameworkcode.value %]" selected="selected"> |
| 217 |
[% ELSE %] |
| 218 |
<option value="[% frameworkcode.value %]"> |
| 219 |
[% END %] |
| 220 |
[% frameworkcode.frameworktext %] |
| 221 |
</option> |
| 222 |
[% END %] |
| 223 |
</select> |
| 224 |
</li> |
| 225 |
[% END %] |
| 226 |
</ol> |
| 227 |
|
| 228 |
[% FOREACH record IN records %] |
| 229 |
<input type="hidden" name="biblionumber" value="[% record.biblionumber %]" /> |
| 220 |
[% END %] |
230 |
[% END %] |
| 221 |
</ol> |
231 |
<fieldset class="action"> |
| 222 |
|
232 |
<input type="submit" value="Next" /> |
| 223 |
<input type="hidden" name="biblionumber" value="[% biblio1 %]" /> |
233 |
</fieldset> |
| 224 |
<input type="hidden" name="biblionumber" value="[% biblio2 %]" /> |
|
|
| 225 |
<fieldset class="action"><input type="submit" value="Next" /></fieldset> |
| 226 |
</fieldset> |
234 |
</fieldset> |
| 227 |
</form> |
235 |
</form> |
| 228 |
[% ELSE %] |
236 |
[% ELSE %] |
|
Lines 238-369
function changeFramework(fw) {
Link Here
|
| 238 |
<div id="tabs" class="toptabs"> |
246 |
<div id="tabs" class="toptabs"> |
| 239 |
<h2>Source records</h2> |
247 |
<h2>Source records</h2> |
| 240 |
<ul> |
248 |
<ul> |
| 241 |
<li><a href="#tabrecord1">[% biblio1 %]</a></li> |
249 |
[% FOREACH record IN records %] |
| 242 |
<li><a href="#tabrecord2">[% biblio2 %]</a></li> |
250 |
<li> |
|
|
251 |
<a href="#tabrecord[% record.biblionumber %]"> |
| 252 |
[% record.biblionumber %] |
| 253 |
[% IF record.reference %](ref)[% END %] |
| 254 |
</a> |
| 255 |
</li> |
| 256 |
[% END %] |
| 243 |
</ul> |
257 |
</ul> |
| 244 |
<div id="tabrecord1"> |
258 |
[% IF ( records.size ) %] |
| 245 |
[% IF ( record1 ) %] |
259 |
[% FOREACH record IN records %] |
| 246 |
|
260 |
<div id="tabrecord[% record.biblionumber %]"> |
| 247 |
<div class="record"> |
261 |
<div class="record"> |
| 248 |
<ul id="ulrecord1"> |
262 |
<ul id="ulrecord[% record.biblionumber %]"> |
| 249 |
[% FOREACH record IN record1 %] |
263 |
[% FOREACH field IN record.display.fields %] |
| 250 |
[% FOREACH fiel IN record.field %] |
264 |
<li id="k[% field.key %]"> |
| 251 |
<li id="k[% fiel.key %]"> |
265 |
[% IF (record.reference) %] |
| 252 |
<input type="checkbox" checked="checked" class="fieldpick" id="rec_1_[% fiel.key %]" /> |
266 |
<input type="checkbox" checked="checked" class="fieldpick" id="rec_[% record.biblionumber %]_[% field.key %]" /> |
| 253 |
<span class="field">[% fiel.tag %]</span> |
267 |
[% ELSE %] |
| 254 |
|
268 |
<input type="checkbox" class="fieldpick" id="rec_[% record.biblionumber %]_[% field.key %]" /> |
| 255 |
<input type="hidden" name="tag_[% fiel.tag %]_indicator1_[% fiel.key %]" value="[% fiel.indicator1 %]" /> |
269 |
[% END %] |
| 256 |
<input type="hidden" name="tag_[% fiel.tag %]_indicator2_[% fiel.key %]" value="[% fiel.indicator2 %]" /> |
270 |
<span class="field">[% field.tag %]</span> |
| 257 |
[% IF ( fiel.value ) %] / [% fiel.value %] |
271 |
|
| 258 |
<input type="hidden" name="tag_[% fiel.tag %]_code_00_[% fiel.key %]" value="00" /> |
272 |
<input type="hidden" name="tag_[% field.tag %]_indicator1_[% field.key %]" value="[% field.indicator1 %]" /> |
| 259 |
<input type="hidden" name="tag_[% fiel.tag %]_subfield_00_[% fiel.key %]" value="[% fiel.value %]" /> |
273 |
<input type="hidden" name="tag_[% field.tag %]_indicator2_[% field.key %]" value="[% field.indicator2 %]" /> |
| 260 |
[% END %] |
274 |
[% IF ( field.value ) %] |
| 261 |
|
275 |
/ [% field.value %] |
| 262 |
[% IF ( fiel.subfield ) %] |
276 |
<input type="hidden" name="tag_[% field.tag %]_code_00_[% field.key %]" value="00" /> |
| 263 |
<ul> |
277 |
<input type="hidden" name="tag_[% field.tag %]_subfield_00_[% field.key %]" value="[% field.value %]" /> |
| 264 |
[% FOREACH subfiel IN fiel.subfield %] |
278 |
[% END %] |
| 265 |
<li id="k[% subfiel.subkey %]"> |
279 |
|
| 266 |
<input type="checkbox" checked="checked" class="subfieldpick" id="rec_1_[% subfiel.subkey %]" /> |
280 |
[% IF ( field.subfield.size ) %] |
| 267 |
<span class="subfield">[% subfiel.subtag %]</span> / [% subfiel.value %] |
281 |
<ul> |
| 268 |
<input type="hidden" name="tag_[% subfiel.tag %]_code_[% subfiel.subtag %]_[% subfiel.key %]_[% subfiel.subkey %]" value="[% subfiel.subtag %]" /> |
282 |
[% FOREACH subfield IN field.subfield %] |
| 269 |
<input type="hidden" name="tag_[% subfiel.tag %]_subfield_[% subfiel.subtag %]_[% subfiel.key %]_[% subfiel.subkey %]" value="[% subfiel.value |html%]" /> |
283 |
<li id="k[% subfield.subkey %]"> |
| 270 |
</li> |
284 |
[% IF (record.reference) %] |
| 271 |
[% END %] |
285 |
<input type="checkbox" checked="checked" class="subfieldpick" id="rec_[% record.biblionumber %]_[% subfield.subkey %]" /> |
| 272 |
</ul> |
286 |
[% ELSE %] |
| 273 |
[% END %] |
287 |
<input type="checkbox" class="subfieldpick" id="rec_[% record.biblionumber %]_[% subfield.subkey %]" /> |
| 274 |
[% END %] |
288 |
[% END %] |
| 275 |
</li> |
289 |
<span class="subfield">[% subfield.subtag %]</span> / [% subfield.value %] |
| 276 |
[% END %] |
290 |
<input type="hidden" name="tag_[% field.tag %]_code_[% subfield.subtag %]_[% field.key %]_[% subfield.subkey %]" value="[% subfield.subtag %]" /> |
| 277 |
</ul> |
291 |
<input type="hidden" name="tag_[% field.tag %]_subfield_[% subfield.subtag %]_[% subfield.key %]_[% subfield.subkey %]" value="[% subfield.value |html%]" /> |
| 278 |
</div><!-- /div.record --> |
292 |
</li> |
| 279 |
[% END %] |
293 |
[% END %] |
| 280 |
</div><!-- /div#tabrecord1 --> |
294 |
</ul> |
| 281 |
<div id="tabrecord2"> |
295 |
[% END %] |
| 282 |
[% IF ( record2 ) %] |
296 |
</li> |
| 283 |
|
297 |
[% END %] |
| 284 |
<div class="record"> |
298 |
</ul> |
| 285 |
<ul id="ulrecord2"> |
299 |
</div><!-- /div.record --> |
| 286 |
[% FOREACH record IN record2 %] |
300 |
</div><!-- /div#tabrecordXXX --> |
| 287 |
[% FOREACH fiel IN record.field %] |
301 |
[% END %] |
| 288 |
<li id="k[% fiel.key %]"> |
302 |
[% END %] |
| 289 |
<input type="checkbox" class="fieldpick" id="rec_2_[% fiel.key %]" /> |
|
|
| 290 |
<span class="field">[% fiel.tag %]</span> |
| 291 |
|
| 292 |
<input type="hidden" name="tag_[% fiel.tag %]_indicator1_[% fiel.key %]" value="[% fiel.indicator1 %]" /> |
| 293 |
<input type="hidden" name="tag_[% fiel.tag %]_indicator2_[% fiel.key %]" value="[% fiel.indicator2 %]" /> |
| 294 |
[% IF ( fiel.value ) %] / [% fiel.value %] |
| 295 |
<input type="hidden" name="tag_[% fiel.tag %]_code_00_[% fiel.key %]" value="00" /> |
| 296 |
<input type="hidden" name="tag_[% fiel.tag %]_subfield_00_[% fiel.key %]" value="[% fiel.value |html%]" /> |
| 297 |
[% END %] |
| 298 |
|
| 299 |
[% IF ( fiel.subfield ) %] |
| 300 |
<ul> |
| 301 |
[% FOREACH subfiel IN fiel.subfield %] |
| 302 |
<li id="k[% subfiel.subkey %]"> |
| 303 |
<input type="checkbox" class="subfieldpick" id="rec_2_[% subfiel.subkey %]" /> |
| 304 |
<span class="subfield">[% subfiel.subtag %]</span> / [% subfiel.value %] |
| 305 |
<input type="hidden" name="tag_[% subfiel.tag %]_code_[% subfiel.subtag %]_[% subfiel.key %]_[% subfiel.subkey %]" value="[% subfiel.subtag %]" /> |
| 306 |
<input type="hidden" name="tag_[% subfiel.tag %]_subfield_[% subfiel.subtag %]_[% subfiel.key %]_[% subfiel.subkey %]" value="[% subfiel.value |html%]" /> |
| 307 |
</li> |
| 308 |
[% END %] |
| 309 |
</ul> |
| 310 |
[% END %] |
| 311 |
[% END %] |
| 312 |
</li> |
| 313 |
[% END %] |
| 314 |
</ul> |
| 315 |
</div> |
| 316 |
<!-- /div.record --> |
| 317 |
|
| 318 |
|
| 319 |
|
| 320 |
|
| 321 |
[% END %] |
| 322 |
</div><!-- /div#tabrecord2 --> |
| 323 |
</div> <!-- // #tabs --> |
303 |
</div> <!-- // #tabs --> |
| 324 |
</div> |
304 |
</div> |
| 325 |
<div class="yui-u"> |
305 |
<div class="yui-u"> |
| 326 |
<div id="result"> |
306 |
<div id="result"> |
| 327 |
<h2>Destination record</h2> |
307 |
<h2>Destination record</h2> |
| 328 |
<div style="border:1px solid #E8E8E8;padding:1em;margin-top:2em;"> |
308 |
<div style="border:1px solid #E8E8E8;padding:1em;margin-top:2em;"> |
| 329 |
<ul id="resultul"> |
309 |
<ul id="resultul"> |
| 330 |
[% FOREACH record IN record1 %] |
310 |
[% FOREACH field IN ref_record.display.fields %]<li id="k[% field.key %]"><span class="field">[% field.tag %]</span> |
| 331 |
[% FOREACH fiel IN record.field %]<li id="k[% fiel.key %]"><span class="field">[% fiel.tag %]</span> |
311 |
<input type="hidden" name="tag_[% field.tag %]_indicator1_[% field.key %]" value="[% field.indicator1 %]" /> |
| 332 |
<input type="hidden" name="tag_[% fiel.tag %]_indicator1_[% fiel.key %]" value="[% fiel.indicator1 %]" /> |
312 |
<input type="hidden" name="tag_[% field.tag %]_indicator2_[% field.key %]" value="[% field.indicator2 %]" /> |
| 333 |
<input type="hidden" name="tag_[% fiel.tag %]_indicator2_[% fiel.key %]" value="[% fiel.indicator2 %]" /> |
313 |
[% IF ( field.value ) %] / |
| 334 |
[% IF ( fiel.value ) %] / |
314 |
[% field.value %] |
| 335 |
[% fiel.value %] |
315 |
<input type="hidden" name="tag_[% field.tag %]_code_00_[% field.key %]" value="00" /> |
| 336 |
<input type="hidden" name="tag_[% fiel.tag %]_code_00_[% fiel.key %]" value="00" /> |
316 |
<input type="hidden" name="tag_[% field.tag %]_subfield_00_[% field.key %]" value="[% field.value |html%]" /> |
| 337 |
<input type="hidden" name="tag_[% fiel.tag %]_subfield_00_[% fiel.key %]" value="[% fiel.value |html%]" /> |
317 |
[% END %] |
| 338 |
[% END %] |
318 |
|
| 339 |
|
319 |
[% IF ( field.subfield ) %] |
| 340 |
[% IF ( fiel.subfield ) %] |
320 |
<ul> |
| 341 |
<ul> |
321 |
[% FOREACH subfield IN field.subfield %] |
| 342 |
[% FOREACH subfiel IN fiel.subfield %] |
322 |
<li id="k[% subfield.subkey %]"> |
| 343 |
<li id="k[% subfiel.subkey %]"> |
323 |
<span class="subfield">[% subfield.subtag %]</span> / [% subfield.value %] |
| 344 |
<span class="subfield">[% subfiel.subtag %]</span> / [% subfiel.value %] |
324 |
<input type="hidden" name="tag_[% field.tag %]_code_[% subfield.subtag %]_[% field.key %]_[% subfield.subkey %]" value="[% subfield.subtag %]" /> |
| 345 |
<input type="hidden" name="tag_[% subfiel.tag %]_code_[% subfiel.subtag %]_[% subfiel.key %]_[% subfiel.subkey %]" value="[% subfiel.subtag %]" /> |
325 |
<input type="hidden" name="tag_[% field.tag %]_subfield_[% subfield.subtag %]_[% field.key %]_[% subfield.subkey %]" value="[% subfield.value |html%]" /> |
| 346 |
<input type="hidden" name="tag_[% subfiel.tag %]_subfield_[% subfiel.subtag %]_[% subfiel.key %]_[% subfiel.subkey %]" value="[% subfiel.value |html%]" /> |
326 |
</li> |
| 347 |
</li> |
327 |
[% END %] |
| 348 |
[% END %] |
328 |
</ul> |
| 349 |
</ul> |
329 |
[% END %] |
| 350 |
[% END %] |
330 |
|
| 351 |
|
331 |
[% END %] |
| 352 |
[% END %] |
332 |
</li> |
| 353 |
</li> |
333 |
|
| 354 |
[% END %] |
334 |
</ul> |
| 355 |
|
|
|
| 356 |
</ul> |
| 357 |
</div> |
335 |
</div> |
| 358 |
</div> <!-- // #result --> |
336 |
</div> <!-- // #result --> |
| 359 |
</div> <!-- .yui-u --> |
337 |
</div> <!-- .yui-u --> |
| 360 |
|
338 |
|
| 361 |
<input type="hidden" name="biblio1" value="[% biblio1 %]" /> |
339 |
<input type="hidden" name="ref_biblionumber" value="[% ref_biblionumber %]" /> |
| 362 |
<input type="hidden" name="biblio2" value="[% biblio2 %]" /> |
340 |
[% FOREACH record IN records %] |
| 363 |
<input type="hidden" name="mergereference" value="[% mergereference %]" /> |
341 |
<input type="hidden" name="biblionumber" value="[% record.biblionumber %]" /> |
|
|
342 |
[% END %] |
| 364 |
<input type="hidden" name="frameworkcode" value="[% framework %]" /> |
343 |
<input type="hidden" name="frameworkcode" value="[% framework %]" /> |
| 365 |
|
344 |
|
| 366 |
<fieldset class="action"><input type="submit" name="merge" value="Merge" /></fieldset> |
345 |
<fieldset class="action"> |
|
|
346 |
<input type="submit" name="merge" value="Merge" /> |
| 347 |
</fieldset> |
| 367 |
</div> |
348 |
</div> |
| 368 |
</form> |
349 |
</form> |
| 369 |
[% END %] |
350 |
[% END %] |