|
Lines 10-170
div#result { margin-top: 1em; }
Link Here
|
| 10 |
<script type="text/javascript"> |
10 |
<script type="text/javascript"> |
| 11 |
//<![CDATA[ |
11 |
//<![CDATA[ |
| 12 |
|
12 |
|
|
|
13 |
[% UNLESS (result) %] |
| 14 |
[% IF (choosereference) %] |
| 15 |
function changeFramework(fw) { |
| 16 |
$("#frameworkcode").val(fw); |
| 17 |
} |
| 18 |
[% ELSE %] |
| 19 |
function check_mandatory () { |
| 20 |
var missing = { |
| 21 |
'fields': [], |
| 22 |
'subfields': [] |
| 23 |
}; |
| 24 |
for (tag in tagslib) { |
| 25 |
if (tag == '000' || tag == '001') |
| 26 |
continue; |
| 27 |
if (tagslib[tag].mandatory == 1) { |
| 28 |
if ($("#resultul span.field:contains("+ tag +")").length == 0) { |
| 29 |
missing.fields.push(tag); |
| 30 |
} |
| 31 |
} |
| 32 |
for (subfieldcode in tagslib[tag]) { |
| 33 |
if (subfieldcode == 'lib' || subfieldcode == 'mandatory' |
| 34 |
|| subfieldcode == 'repeatable' || subfieldcode == 'tab') { |
| 35 |
continue; |
| 36 |
} |
| 37 |
if (tagslib[tag][subfieldcode].mandatory == 1 && tagslib[tag][subfieldcode].tab >= 0) { |
| 38 |
var fields = $("#resultul span.field:contains("+ tag +")"); |
| 39 |
$(fields).each(function() { |
| 40 |
var subfields = $(this).parent().find("span.subfield:contains("+ subfieldcode +")"); |
| 41 |
if (subfields.length == 0) { |
| 42 |
missing.subfields.push( { |
| 43 |
'tag': tag, |
| 44 |
'subfieldcode': subfieldcode |
| 45 |
} ); |
| 46 |
} |
| 47 |
}); |
| 48 |
} |
| 49 |
} |
| 50 |
} |
| 51 |
|
| 52 |
return missing; |
| 53 |
} |
| 54 |
|
| 13 |
// When submiting the form |
55 |
// When submiting the form |
| 14 |
function mergeformsubmit() { |
56 |
function mergeformsubmit() { |
| 15 |
$("ul#ulrecord1").remove(); |
57 |
var missing = check_mandatory(); |
| 16 |
$("ul#ulrecord2").remove(); |
58 |
var alert_msg = ''; |
| 17 |
} |
59 |
var error = 0; |
| 18 |
|
60 |
if (missing.fields.length > 0) { |
| 19 |
|
61 |
alert_msg += _("Following required fields are missing:") + "\n"; |
| 20 |
$(document).ready(function(){ |
62 |
for (var i in missing.fields) { |
| 21 |
// Creating tabs |
63 |
alert_msg += "\t- " + missing.fields[i] + "\n"; |
| 22 |
$("#tabs").tabs(); |
64 |
error ++; |
| 23 |
|
65 |
} |
| 24 |
// Getting marc structure via ajax |
66 |
alert_msg += "\n"; |
| 25 |
tagslib = []; |
67 |
} |
| 26 |
$.getJSON("/cgi-bin/koha/cataloguing/merge_ajax.pl", {frameworkcode : "[% framework %]" }, function(json) { |
68 |
if (missing.subfields.length > 0) { |
| 27 |
tagslib = json; |
69 |
alert_msg += _("Following required subfields are missing:") + "\n"; |
| 28 |
}); |
70 |
for (var i in missing.subfields) { |
| 29 |
|
71 |
var subfield = missing.subfields[i]; |
| 30 |
|
72 |
alert_msg += "\t- " + subfield.tag + "$" + subfield.subfieldcode + "\n"; |
| 31 |
// Toggle a field / subfield |
73 |
error ++; |
| 32 |
function toggleField(pField) { |
74 |
} |
| 33 |
|
75 |
} |
| 34 |
// Getting the key of the clicked checkbox |
76 |
|
| 35 |
var ckid = $(pField).attr("id"); |
77 |
if (error != 0) { |
| 36 |
var tab = ckid.split('_'); |
78 |
alert(alert_msg); |
| 37 |
var source = tab[1]; // From which record the click came from |
79 |
return false; |
| 38 |
var key = tab[2]; |
80 |
} else { |
| 39 |
var type = $(pField).attr("class"); |
81 |
$("#tabs").remove(); |
| 40 |
|
82 |
} |
| 41 |
// Getting field/subfield |
83 |
} |
| 42 |
var field; |
84 |
|
| 43 |
var subfield; |
85 |
$(document).ready(function(){ |
| 44 |
if (type == "subfieldpick") { |
86 |
// Creating tabs |
| 45 |
|
87 |
$("#tabs").tabs(); |
| 46 |
field = $(pField).parent().parent().parent().find("span.field").text(); |
88 |
|
| 47 |
subfield = $(pField).parent().find("span.subfield").text(); |
89 |
// Getting marc structure via ajax |
| 48 |
} else { |
90 |
tagslib = []; |
| 49 |
|
91 |
$.getJSON("/cgi-bin/koha/cataloguing/merge_ajax.pl", {frameworkcode : "[% framework %]" }, function(json) { |
| 50 |
field = $(pField).parent().find("span.field").text(); |
92 |
tagslib = json; |
| 51 |
} |
93 |
}); |
| 52 |
|
94 |
|
| 53 |
// If the field has just been checked |
95 |
|
| 54 |
if (pField.checked) { |
96 |
// Toggle a field / subfield |
| 55 |
|
97 |
function toggleField(pField) { |
| 56 |
// We check for repeatability |
98 |
// Getting the key of the clicked checkbox |
| 57 |
var canbeadded = true; |
99 |
var ckid = $(pField).attr("id"); |
| 58 |
if (type == "subfieldpick") { |
100 |
var tab = ckid.split('_'); |
| 59 |
var repeatable = 1; |
101 |
var source = tab[1]; // From which record the click came from |
| 60 |
var alreadyexists = 0; |
102 |
var key = tab[2]; |
| 61 |
if (tagslib[field] && tagslib[field][subfield]) { |
103 |
var type = $(pField).attr("class"); |
| 62 |
repeatable = tagslib[field][subfield].repeatable; // Note : we can't use the dot notation here (tagslib.021) because the key is a number |
104 |
|
| 63 |
// TODO : Checking for subfields |
105 |
// Getting field/subfield |
| 64 |
} |
106 |
var field; |
| 65 |
} else { |
107 |
var subfield; |
| 66 |
if (tagslib[field]) { |
108 |
if (type == "subfieldpick") { |
| 67 |
repeatable = tagslib[field].repeatable; |
109 |
field = $(pField).parent().parent().parent().find("span.field").text(); |
| 68 |
alreadyexists = $("#resultul span.field:contains(" + field + ")"); |
110 |
subfield = $(pField).parent().find("span.subfield").text(); |
| 69 |
if (repeatable == 0 && alreadyexists.length != 0) { |
111 |
} else { |
| 70 |
canbeadded = false; |
112 |
field = $(pField).parent().find("span.field").text(); |
| 71 |
} |
113 |
} |
| 72 |
} |
114 |
|
| 73 |
} |
115 |
// If the field has just been checked |
| 74 |
// If the field is not repeatable, we check if it already exists in the result table |
116 |
if (pField.checked) { |
| 75 |
if (canbeadded == false) { |
117 |
// We check for repeatability |
| 76 |
alert(_("The field is non-repeatable and already exists in the destination record. Therefore, you cannot add it.")); |
118 |
var canbeadded = true; |
| 77 |
pField.checked = 0; |
119 |
if (type == "subfieldpick") { |
| 78 |
} else { |
120 |
var repeatable = 1; |
| 79 |
|
121 |
var alreadyexists = 0; |
| 80 |
// Cloning the field or subfield we picked |
122 |
if (tagslib[field] && tagslib[field][subfield]) { |
| 81 |
var clone = $(pField).parent().clone(); |
123 |
// Note : we can't use the dot notation here (tagslib.021) |
| 82 |
|
124 |
// because the key is a number |
| 83 |
// Removing the checkboxes from it |
125 |
repeatable = tagslib[field][subfield].repeatable; |
| 84 |
$(clone).find("input.subfieldpick, input.fieldpick").each(function() { |
126 |
if (repeatable == 0) { |
| 85 |
$(this).remove(); |
127 |
canbeadded = false; |
| 86 |
}); |
128 |
$("#resultul span.field:contains(" + field + ")") |
| 87 |
|
129 |
.each(function() { |
| 88 |
|
130 |
if ($(this).parent() |
| 89 |
// If we are a subfield |
131 |
.find("span.subfield:contains(" + subfield + ")") |
| 90 |
if (type == "subfieldpick") { |
132 |
.length == 0) |
| 91 |
// then we need to find who is our parent field... |
133 |
{ |
| 92 |
fieldkey = $(pField).parent().parent().parent().attr("id"); |
134 |
canbeadded = true; |
| 93 |
|
135 |
} |
| 94 |
// Find where to add the subfield |
136 |
}); |
| 95 |
|
137 |
} |
| 96 |
// First, check if the field is not already in the destination record |
138 |
} |
| 97 |
if ($("#resultul li#" + fieldkey).length > 0) { |
139 |
} else { |
| 98 |
// If so, we add our field to it |
140 |
if (tagslib[field]) { |
| 99 |
$("#resultul li#" + fieldkey + " ul").append(clone); |
141 |
repeatable = tagslib[field].repeatable; |
| 100 |
} else { |
142 |
alreadyexists = $("#resultul span.field:contains(" + field + ")"); |
| 101 |
// If not, we add the subfield to the first matching field |
143 |
if (repeatable == 0 && alreadyexists.length != 0) { |
| 102 |
var where = 0; |
144 |
canbeadded = false; |
| 103 |
$("#resultul li span.field").each(function() { |
145 |
} |
| 104 |
if (where == 0 && $(this).text() == field) { |
146 |
} |
| 105 |
where = this; |
147 |
} |
| 106 |
} |
148 |
// If the field is not repeatable, we check if it already exists in the result table |
| 107 |
}); |
149 |
if (canbeadded == false) { |
| 108 |
|
150 |
var field_or_subfield = (type == "subfieldpick") ? _("subfield") : _("field"); |
| 109 |
// If there is no matching field in the destination record |
151 |
alert(_("The " + field_or_subfield + " is non-repeatable and already exists in the destination record. Therefore, you cannot add it.")); |
| 110 |
if (where == 0) { |
152 |
pField.checked = 0; |
| 111 |
|
153 |
} else { |
| 112 |
// TODO: |
154 |
// Cloning the field or subfield we picked |
| 113 |
// We select the whole field and removing non-selected subfields, instead of... |
155 |
var clone = $(pField).parent().clone(); |
| 114 |
|
156 |
|
| 115 |
// Alerting the user |
157 |
// Removing the checkboxes from it |
| 116 |
alert(_("This subfield cannot be added: there is no") + " " + field + " " + _("field in the destination record.")); |
158 |
$(clone).find("input.subfieldpick, input.fieldpick").each(function() { |
| 117 |
pField.checked = false; |
159 |
$(this).remove(); |
| 118 |
|
160 |
}); |
| 119 |
} else { |
161 |
$(clone).find('label').each(function() { |
| 120 |
$(where).nextAll("ul").append(clone); |
162 |
$(this).replaceWith($(this).contents()); |
| 121 |
} |
163 |
}); |
| 122 |
|
164 |
|
| 123 |
} |
165 |
// If we are a subfield |
| 124 |
|
166 |
if (type == "subfieldpick") { |
| 125 |
|
167 |
// then we need to find who is our parent field... |
| 126 |
|
168 |
fieldkey = $(pField).parent().parent().parent().attr("id"); |
| 127 |
} else { |
169 |
|
| 128 |
// If we are a field |
170 |
// Find where to add the subfield |
| 129 |
var where = 0; |
171 |
|
| 130 |
// Find where to add the field |
172 |
// First, check if the field is not already in the destination record |
| 131 |
$("#resultul li span.field").each(function() { |
173 |
if ($("#resultul li#" + fieldkey).length > 0) { |
| 132 |
if (where == 0 && $(this).text() > field) { |
174 |
// If so, we add our field to it |
| 133 |
where = this; |
175 |
$("#resultul li#" + fieldkey + " ul").append(clone); |
| 134 |
} |
176 |
} else { |
| 135 |
}); |
177 |
// If not, we add the subfield to the first matching field |
| 136 |
|
178 |
var where = 0; |
| 137 |
$(where).parent().before(clone); |
179 |
$("#resultul li span.field").each(function() { |
| 138 |
} |
180 |
if (where == 0 && $(this).text() == field) { |
| 139 |
} |
181 |
where = this; |
| 140 |
} else { |
182 |
} |
| 141 |
|
183 |
}); |
| 142 |
// Else, we remove it from the results tab |
184 |
|
| 143 |
$("ul#resultul li#k" + key).remove(); |
185 |
// If there is no matching field in the destination record |
| 144 |
} |
186 |
if (where == 0) { |
| 145 |
} |
187 |
// TODO: |
| 146 |
|
188 |
// We select the whole field and removing non-selected subfields, instead of... |
| 147 |
|
189 |
|
| 148 |
// When a field is checked / unchecked |
190 |
// Alerting the user |
| 149 |
$('input.fieldpick').click(function() { |
191 |
alert(_("This subfield cannot be added: there is no " + field + " field in the destination record.")); |
| 150 |
toggleField(this); |
192 |
pField.checked = false; |
| 151 |
// (un)check all subfields |
193 |
|
| 152 |
var ischecked = this.checked; |
194 |
} else { |
| 153 |
$(this).parent().find("input.subfieldpick").each(function() { |
195 |
$(where).nextAll("ul").append(clone); |
| 154 |
this.checked = ischecked; |
196 |
} |
| 155 |
}); |
197 |
} |
| 156 |
}); |
198 |
} else { |
|
|
199 |
// If we are a field |
| 200 |
var where = 0; |
| 201 |
// Find where to add the field |
| 202 |
$("#resultul li span.field").each(function() { |
| 203 |
if (where == 0 && $(this).text() > field) { |
| 204 |
where = this; |
| 205 |
} |
| 206 |
}); |
| 207 |
if (where) { |
| 208 |
$(where).parent().before(clone); |
| 209 |
} else { |
| 210 |
$("#resultul").prepend(clone); |
| 211 |
} |
| 212 |
} |
| 213 |
} |
| 214 |
} else { |
| 215 |
// Else, we remove it from the results tab |
| 216 |
$("ul#resultul li#k" + key).remove(); |
| 217 |
} |
| 218 |
} |
| 219 |
|
| 220 |
// Check all checkboxes in first tab, and uncheck all others to avoid |
| 221 |
// inconsistencies from a page refresh. |
| 222 |
$('#tabs div#tabrecord[% ref_biblionumber %]').find('input[type="checkbox"]').attr('checked', true); |
| 223 |
$('#tabs > div:not("#tabrecord[% ref_biblionumber %]")').find('input[type="checkbox"]').removeAttr('checked'); |
| 224 |
|
| 225 |
// When a field is checked / unchecked |
| 226 |
$('input.fieldpick').click(function() { |
| 227 |
toggleField(this); |
| 228 |
// (un)check all subfields |
| 229 |
var ischecked = this.checked; |
| 230 |
$(this).parent().find("input.subfieldpick").each(function() { |
| 231 |
this.checked = ischecked; |
| 232 |
}); |
| 233 |
}); |
| 234 |
|
| 235 |
// When a field or subfield is checked / unchecked |
| 236 |
$("input.subfieldpick").click(function() { |
| 237 |
toggleField(this); |
| 238 |
}); |
| 157 |
|
239 |
|
| 158 |
// When a field or subfield is checked / unchecked |
|
|
| 159 |
$("input.subfieldpick").click(function() { |
| 160 |
toggleField(this); |
| 161 |
}); |
240 |
}); |
| 162 |
|
241 |
[% END %] |
| 163 |
}); |
242 |
[% END %] |
| 164 |
|
|
|
| 165 |
function changeFramework(fw) { |
| 166 |
$("#Frameworks").val(fw); |
| 167 |
} |
| 168 |
|
243 |
|
| 169 |
//]]> |
244 |
//]]> |
| 170 |
</script> |
245 |
</script> |
|
Lines 182-204
function changeFramework(fw) {
Link Here
|
| 182 |
|
257 |
|
| 183 |
<h1>Merging records</h1> |
258 |
<h1>Merging records</h1> |
| 184 |
[% IF ( result ) %] |
259 |
[% IF ( result ) %] |
| 185 |
[% IF ( errors ) %] |
260 |
[% IF ( errors.size ) %] |
| 186 |
|
261 |
[% FOREACH error IN errors %] |
| 187 |
[% FOREACH error IN errors %] |
262 |
<div class="dialog alert"> |
| 188 |
<div class="dialog alert"> |
|
|
| 189 |
|
| 190 |
[% IF error.code == 'CANNOT_MOVE' %] |
263 |
[% IF error.code == 'CANNOT_MOVE' %] |
| 191 |
The following items could not be moved from the old record to the new one: [% error.value %] |
264 |
The following items could not be moved from the old record to the new one: [% error.value %] |
| 192 |
[% ELSE %] |
265 |
[% ELSE %] |
| 193 |
[% error %] |
266 |
[% error %] |
| 194 |
[% END %] |
267 |
[% END %] |
| 195 |
|
268 |
<br /> |
| 196 |
<br />Therefore, the record to be merged has not been deleted.</div> |
269 |
Therefore, the record to be merged has not been deleted. |
| 197 |
[% END %] |
270 |
</div> |
|
|
271 |
[% END %] |
| 198 |
|
272 |
|
| 199 |
[% ELSE %] |
273 |
[% ELSE %] |
| 200 |
<script type="text/javascript">window.location.href="/cgi-bin/koha/catalogue/MARCdetail.pl?biblionumber=[% biblio1 %]"</script> |
274 |
<p>The merge was successful. <a href="/cgi-bin/koha/catalogue/MARCdetail.pl?biblionumber=[% ref_biblionumber %]">Click here to see the merged record.</a></p> |
| 201 |
<p>The merging was successful. <a href="/cgi-bin/koha/catalogue/MARCdetail.pl?biblionumber=[% biblio1 %]">Click here to see the merged record.</a></p> |
275 |
<h3>Report</h3> |
|
|
276 |
<table> |
| 277 |
<thead> |
| 278 |
<tr> |
| 279 |
<th>Biblionumber</th> |
| 280 |
[% FOREACH key IN report_header.keys.sort %] |
| 281 |
[% tag = key.substr(0, 3) %] |
| 282 |
[% code = key.substr(3, 1) %] |
| 283 |
[% IF code == '@' %] |
| 284 |
[% header = tag %] |
| 285 |
[% ELSE %] |
| 286 |
[% header = tag _ '$' _ code %] |
| 287 |
[% END %] |
| 288 |
<th>[% header %]</th> |
| 289 |
[% END %] |
| 290 |
</tr> |
| 291 |
</thead> |
| 292 |
<tbody> |
| 293 |
[% FOREACH record IN report_records %] |
| 294 |
<tr> |
| 295 |
<td> |
| 296 |
[% record.biblionumber %] |
| 297 |
[% IF loop.first %] |
| 298 |
(record kept) |
| 299 |
[% END %] |
| 300 |
</td> |
| 301 |
[% FOREACH key IN report_header.keys.sort %] |
| 302 |
<td> |
| 303 |
[% values = record.fields.$key %] |
| 304 |
[% IF values %] |
| 305 |
[% FOREACH value IN record.fields.$key %] |
| 306 |
[% value %] |
| 307 |
[% UNLESS loop.last %]<br />[% END %] |
| 308 |
[% END %] |
| 309 |
[% END %] |
| 310 |
</td> |
| 311 |
[% END %] |
| 312 |
</tr> |
| 313 |
[% END %] |
| 314 |
</tbody> |
| 315 |
</table> |
| 202 |
[% END %] |
316 |
[% END %] |
| 203 |
|
317 |
|
| 204 |
[% ELSE %] |
318 |
[% ELSE %] |
|
Lines 207-252
function changeFramework(fw) {
Link Here
|
| 207 |
<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> |
321 |
<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> |
| 208 |
<form id="mergeform" action="/cgi-bin/koha/cataloguing/merge.pl" method="post"> |
322 |
<form id="mergeform" action="/cgi-bin/koha/cataloguing/merge.pl" method="post"> |
| 209 |
<fieldset class="rows"> |
323 |
<fieldset class="rows"> |
| 210 |
<legend>Merge reference</legend> |
324 |
<legend>Merge reference</legend> |
| 211 |
<ol> |
325 |
<ol> |
| 212 |
<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> |
326 |
[% FOREACH record IN records %] |
| 213 |
<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> |
327 |
<li class="radio"> |
| 214 |
|
328 |
[% IF loop.first %] |
| 215 |
[% IF frameworkselect %] |
329 |
<input type="radio" value="[% record.biblionumber %]" checked="checked" id="ref_biblionumber[% record.biblionumber %]" name="ref_biblionumber" onclick="changeFramework('[% record.frameworkcode %]')" /> |
| 216 |
<li><label for="frameworkcode">Using framework:</label> |
330 |
[% ELSE %] |
| 217 |
<select name="frameworkcode" id="frameworkcode"> |
331 |
<input type="radio" value="[% record.biblionumber %]" id="ref_biblionumber[% record.biblionumber %]" name="ref_biblionumber" onclick="changeFramework('[% record.frameworkcode %]')" /> |
| 218 |
<option value="Default">Default</option> |
332 |
[% END %] |
| 219 |
[% FOREACH frameworkcodeloo IN frameworkselect %] |
333 |
<label for="ref_biblionumber[% record.biblionumber %]"> |
| 220 |
[% IF ( frameworkcodeloo.selected ) %] |
334 |
[% record.data.title %] |
| 221 |
<option value="[% frameworkcodeloo.value %]" selected="selected"> |
335 |
[% FOREACH subtitle IN record.subtitles %] |
| 222 |
[% ELSE %] |
336 |
[% subtitle.subfield %] |
| 223 |
<option value="[% frameworkcodeloo.value %]"> |
337 |
[% END %] |
| 224 |
[% END %] |
338 |
(<a href="/cgi-bin/koha/catalogue/showmarc.pl?id=[% record.biblionumber %]" title="MARC" rel="gb_page_center[600,500]">[% record.biblionumber %]</a>) |
| 225 |
[% frameworkcodeloo.frameworktext %] |
339 |
</label> |
| 226 |
</option> |
340 |
</li> |
| 227 |
[% END %] |
341 |
[% END %] |
| 228 |
</select></li> |
342 |
|
|
|
343 |
[% IF frameworkselect.size %] |
| 344 |
<li> |
| 345 |
<label for="frameworkcode">Using framework:</label> |
| 346 |
<select name="frameworkcode" id="frameworkcode"> |
| 347 |
<option value="">Default</option> |
| 348 |
[% FOREACH frameworkcode IN frameworkselect %] |
| 349 |
[% IF ( frameworkcode.selected ) %] |
| 350 |
<option value="[% frameworkcode.value %]" selected="selected"> |
| 351 |
[% ELSE %] |
| 352 |
<option value="[% frameworkcode.value %]"> |
| 353 |
[% END %] |
| 354 |
[% frameworkcode.frameworktext %] |
| 355 |
</option> |
| 356 |
[% END %] |
| 357 |
</select> |
| 358 |
</li> |
| 359 |
[% END %] |
| 360 |
</ol> |
| 361 |
|
| 362 |
[% FOREACH record IN records %] |
| 363 |
<input type="hidden" name="biblionumber" value="[% record.biblionumber %]" /> |
| 229 |
[% END %] |
364 |
[% END %] |
| 230 |
</ol> |
365 |
<fieldset class="action"> |
| 231 |
|
366 |
<input type="submit" value="Next" /> |
| 232 |
<input type="hidden" name="biblionumber" value="[% biblio1 %]" /> |
367 |
</fieldset> |
| 233 |
<input type="hidden" name="biblionumber" value="[% biblio2 %]" /> |
|
|
| 234 |
<fieldset class="action"><input type="submit" value="Next" /></fieldset> |
| 235 |
</fieldset> |
368 |
</fieldset> |
| 236 |
</form> |
369 |
</form> |
| 237 |
[% ELSE %] |
370 |
[% ELSE %] |
| 238 |
[% IF ( errors ) %] |
371 |
[% IF ( errors.size ) %] |
| 239 |
<div class="dialog alert"> |
372 |
<div class="dialog alert"> |
| 240 |
[% FOREACH error IN errors %] |
373 |
[% FOREACH error IN errors %] |
| 241 |
<p> |
374 |
<p>[% error %]</p> |
| 242 |
[% IF error.code == 'WRONG_COUNT' %] |
375 |
[% END %] |
| 243 |
Number of records provided for merging: [% error.value %]. Currently only 2 records can be merged at a time. |
|
|
| 244 |
[% ELSE %] |
| 245 |
[% error %] |
| 246 |
[% END %] |
| 247 |
|
| 248 |
</p> |
| 249 |
[% END %] |
| 250 |
</div> |
376 |
</div> |
| 251 |
[% ELSE %] |
377 |
[% ELSE %] |
| 252 |
<form id="mergeform" action="/cgi-bin/koha/cataloguing/merge.pl" method="post" onsubmit="return mergeformsubmit()"> |
378 |
<form id="mergeform" action="/cgi-bin/koha/cataloguing/merge.pl" method="post" onsubmit="return mergeformsubmit()"> |
|
Lines 256-387
function changeFramework(fw) {
Link Here
|
| 256 |
<div id="tabs" class="toptabs"> |
382 |
<div id="tabs" class="toptabs"> |
| 257 |
<h2>Source records</h2> |
383 |
<h2>Source records</h2> |
| 258 |
<ul> |
384 |
<ul> |
| 259 |
<li><a href="#tabrecord1">[% biblio1 %]</a></li> |
385 |
[% FOREACH record IN records %] |
| 260 |
<li><a href="#tabrecord2">[% biblio2 %]</a></li> |
386 |
<li> |
|
|
387 |
<a href="#tabrecord[% record.biblionumber %]"> |
| 388 |
[% record.biblionumber %] |
| 389 |
[% IF record.reference %](ref)[% END %] |
| 390 |
</a> |
| 391 |
</li> |
| 392 |
[% END %] |
| 261 |
</ul> |
393 |
</ul> |
| 262 |
<div id="tabrecord1"> |
394 |
[% IF ( records.size ) %] |
| 263 |
[% IF ( record1 ) %] |
395 |
[% FOREACH record IN records %] |
| 264 |
|
396 |
<div id="tabrecord[% record.biblionumber %]"> |
| 265 |
<div class="record"> |
397 |
<div class="record"> |
| 266 |
<ul id="ulrecord1"> |
398 |
<ul id="ulrecord[% record.biblionumber %]"> |
| 267 |
[% FOREACH record IN record1 %] |
399 |
[% FOREACH field IN record.display.fields %] |
| 268 |
[% FOREACH fiel IN record.field %] |
400 |
[% IF field.tag != biblionumbertag %] |
| 269 |
<li id="k[% fiel.key %]"> |
401 |
<li id="k[% field.key %]"> |
| 270 |
<input type="checkbox" checked="checked" class="fieldpick" id="rec_1_[% fiel.key %]" /> |
402 |
[% IF (record.reference) %] |
| 271 |
<span class="field">[% fiel.tag %]</span> |
403 |
<input type="checkbox" checked="checked" class="fieldpick" id="rec_[% record.biblionumber %]_[% field.key %]" /> |
| 272 |
|
404 |
[% ELSE %] |
| 273 |
<input type="hidden" name="tag_[% fiel.tag %]_indicator1_[% fiel.key %]" value="[% fiel.indicator1 %]" /> |
405 |
<input type="checkbox" class="fieldpick" id="rec_[% record.biblionumber %]_[% field.key %]" /> |
| 274 |
<input type="hidden" name="tag_[% fiel.tag %]_indicator2_[% fiel.key %]" value="[% fiel.indicator2 %]" /> |
406 |
[% END %] |
| 275 |
[% IF ( fiel.value ) %] / [% fiel.value %] |
407 |
<label for="rec_[% record.biblionumber %]_[% field.key %]"><span class="field">[% field.tag %]</span></label> |
| 276 |
<input type="hidden" name="tag_[% fiel.tag %]_code_00_[% fiel.key %]" value="00" /> |
408 |
|
| 277 |
<input type="hidden" name="tag_[% fiel.tag %]_subfield_00_[% fiel.key %]" value="[% fiel.value %]" /> |
409 |
<input type="hidden" name="tag_[% field.tag %]_indicator1_[% field.key %]" value="[% field.indicator1 %]" /> |
| 278 |
[% END %] |
410 |
<input type="hidden" name="tag_[% field.tag %]_indicator2_[% field.key %]" value="[% field.indicator2 %]" /> |
| 279 |
|
411 |
[% IF ( field.value ) %] |
| 280 |
[% IF ( fiel.subfield ) %] |
412 |
/ [% field.value %] |
| 281 |
<ul> |
413 |
<input type="hidden" name="tag_[% field.tag %]_code_00_[% field.key %]" value="00" /> |
| 282 |
[% FOREACH subfiel IN fiel.subfield %] |
414 |
<input type="hidden" name="tag_[% field.tag %]_subfield_00_[% field.key %]" value="[% field.value %]" /> |
| 283 |
<li id="k[% subfiel.subkey %]"> |
415 |
[% END %] |
| 284 |
<input type="checkbox" checked="checked" class="subfieldpick" id="rec_1_[% subfiel.subkey %]" /> |
416 |
|
| 285 |
<span class="subfield">[% subfiel.subtag %]</span> / [% subfiel.value %] |
417 |
[% IF ( field.subfield.size ) %] |
| 286 |
<input type="hidden" name="tag_[% subfiel.tag %]_code_[% subfiel.subtag %]_[% subfiel.key %]_[% subfiel.subkey %]" value="[% subfiel.subtag %]" /> |
418 |
<ul> |
| 287 |
<input type="hidden" name="tag_[% subfiel.tag %]_subfield_[% subfiel.subtag %]_[% subfiel.key %]_[% subfiel.subkey %]" value="[% subfiel.value |html%]" /> |
419 |
[% FOREACH subfield IN field.subfield %] |
| 288 |
</li> |
420 |
<li id="k[% subfield.subkey %]"> |
| 289 |
[% END %] |
421 |
[% IF (record.reference) %] |
| 290 |
</ul> |
422 |
<input type="checkbox" checked="checked" class="subfieldpick" id="rec_[% record.biblionumber %]_[% subfield.subkey %]" /> |
| 291 |
[% END %] |
423 |
[% ELSE %] |
| 292 |
[% END %] |
424 |
<input type="checkbox" class="subfieldpick" id="rec_[% record.biblionumber %]_[% subfield.subkey %]" /> |
| 293 |
</li> |
425 |
[% END %] |
| 294 |
[% END %] |
426 |
<label for="rec_[% record.biblionumber %]_[% subfield.subkey %]"><span class="subfield">[% subfield.subtag %]</span> / [% subfield.value %]</label> |
| 295 |
</ul> |
427 |
<input type="hidden" name="tag_[% field.tag %]_code_[% subfield.subtag %]_[% field.key %]_[% subfield.subkey %]" value="[% subfield.subtag %]" /> |
| 296 |
</div><!-- /div.record --> |
428 |
<input type="hidden" name="tag_[% field.tag %]_subfield_[% subfield.subtag %]_[% subfield.key %]_[% subfield.subkey %]" value="[% subfield.value |html%]" /> |
| 297 |
[% END %] |
429 |
</li> |
| 298 |
</div><!-- /div#tabrecord1 --> |
430 |
[% END %] |
| 299 |
<div id="tabrecord2"> |
431 |
</ul> |
| 300 |
[% IF ( record2 ) %] |
432 |
[% END %] |
| 301 |
|
433 |
</li> |
| 302 |
<div class="record"> |
434 |
[% END %] |
| 303 |
<ul id="ulrecord2"> |
435 |
[% END %] |
| 304 |
[% FOREACH record IN record2 %] |
436 |
</ul> |
| 305 |
[% FOREACH fiel IN record.field %] |
437 |
</div><!-- /div.record --> |
| 306 |
<li id="k[% fiel.key %]"> |
438 |
</div><!-- /div#tabrecordXXX --> |
| 307 |
<input type="checkbox" class="fieldpick" id="rec_2_[% fiel.key %]" /> |
439 |
[% END %] |
| 308 |
<span class="field">[% fiel.tag %]</span> |
440 |
[% END %] |
| 309 |
|
|
|
| 310 |
<input type="hidden" name="tag_[% fiel.tag %]_indicator1_[% fiel.key %]" value="[% fiel.indicator1 %]" /> |
| 311 |
<input type="hidden" name="tag_[% fiel.tag %]_indicator2_[% fiel.key %]" value="[% fiel.indicator2 %]" /> |
| 312 |
[% IF ( fiel.value ) %] / [% fiel.value %] |
| 313 |
<input type="hidden" name="tag_[% fiel.tag %]_code_00_[% fiel.key %]" value="00" /> |
| 314 |
<input type="hidden" name="tag_[% fiel.tag %]_subfield_00_[% fiel.key %]" value="[% fiel.value |html%]" /> |
| 315 |
[% END %] |
| 316 |
|
| 317 |
[% IF ( fiel.subfield ) %] |
| 318 |
<ul> |
| 319 |
[% FOREACH subfiel IN fiel.subfield %] |
| 320 |
<li id="k[% subfiel.subkey %]"> |
| 321 |
<input type="checkbox" class="subfieldpick" id="rec_2_[% subfiel.subkey %]" /> |
| 322 |
<span class="subfield">[% subfiel.subtag %]</span> / [% subfiel.value %] |
| 323 |
<input type="hidden" name="tag_[% subfiel.tag %]_code_[% subfiel.subtag %]_[% subfiel.key %]_[% subfiel.subkey %]" value="[% subfiel.subtag %]" /> |
| 324 |
<input type="hidden" name="tag_[% subfiel.tag %]_subfield_[% subfiel.subtag %]_[% subfiel.key %]_[% subfiel.subkey %]" value="[% subfiel.value |html%]" /> |
| 325 |
</li> |
| 326 |
[% END %] |
| 327 |
</ul> |
| 328 |
[% END %] |
| 329 |
[% END %] |
| 330 |
</li> |
| 331 |
[% END %] |
| 332 |
</ul> |
| 333 |
</div> |
| 334 |
<!-- /div.record --> |
| 335 |
|
| 336 |
|
| 337 |
|
| 338 |
|
| 339 |
[% END %] |
| 340 |
</div><!-- /div#tabrecord2 --> |
| 341 |
</div> <!-- // #tabs --> |
441 |
</div> <!-- // #tabs --> |
| 342 |
</div> |
442 |
</div> |
| 343 |
<div class="yui-u"> |
443 |
<div class="yui-u"> |
| 344 |
<div id="result"> |
444 |
<div id="result"> |
| 345 |
<h2>Destination record</h2> |
445 |
<h2>Destination record</h2> |
| 346 |
<div style="border:1px solid #E8E8E8;padding:1em;margin-top:2em;"> |
446 |
<div style="border:1px solid #E8E8E8;padding:1em;margin-top:2em;"> |
| 347 |
<ul id="resultul"> |
447 |
<ul id="resultul"> |
| 348 |
[% FOREACH record IN record1 %] |
448 |
[% FOREACH field IN ref_record.display.fields %] |
| 349 |
[% FOREACH fiel IN record.field %]<li id="k[% fiel.key %]"><span class="field">[% fiel.tag %]</span> |
449 |
[% IF field.tag != biblionumbertag %] |
| 350 |
<input type="hidden" name="tag_[% fiel.tag %]_indicator1_[% fiel.key %]" value="[% fiel.indicator1 %]" /> |
450 |
<li id="k[% field.key %]"> |
| 351 |
<input type="hidden" name="tag_[% fiel.tag %]_indicator2_[% fiel.key %]" value="[% fiel.indicator2 %]" /> |
451 |
<span class="field">[% field.tag %]</span> |
| 352 |
[% IF ( fiel.value ) %] / |
452 |
<input type="hidden" name="tag_[% field.tag %]_indicator1_[% field.key %]" value="[% field.indicator1 %]" /> |
| 353 |
[% fiel.value %] |
453 |
<input type="hidden" name="tag_[% field.tag %]_indicator2_[% field.key %]" value="[% field.indicator2 %]" /> |
| 354 |
<input type="hidden" name="tag_[% fiel.tag %]_code_00_[% fiel.key %]" value="00" /> |
454 |
[% IF ( field.value ) %] |
| 355 |
<input type="hidden" name="tag_[% fiel.tag %]_subfield_00_[% fiel.key %]" value="[% fiel.value |html%]" /> |
455 |
/ [% field.value %] |
| 356 |
[% END %] |
456 |
<input type="hidden" name="tag_[% field.tag %]_code_00_[% field.key %]" value="00" /> |
| 357 |
|
457 |
<input type="hidden" name="tag_[% field.tag %]_subfield_00_[% field.key %]" value="[% field.value |html%]" /> |
| 358 |
[% IF ( fiel.subfield ) %] |
458 |
[% END %] |
| 359 |
<ul> |
459 |
|
| 360 |
[% FOREACH subfiel IN fiel.subfield %] |
460 |
[% IF ( field.subfield ) %] |
| 361 |
<li id="k[% subfiel.subkey %]"> |
461 |
<ul> |
| 362 |
<span class="subfield">[% subfiel.subtag %]</span> / [% subfiel.value %] |
462 |
[% FOREACH subfield IN field.subfield %] |
| 363 |
<input type="hidden" name="tag_[% subfiel.tag %]_code_[% subfiel.subtag %]_[% subfiel.key %]_[% subfiel.subkey %]" value="[% subfiel.subtag %]" /> |
463 |
<li id="k[% subfield.subkey %]"> |
| 364 |
<input type="hidden" name="tag_[% subfiel.tag %]_subfield_[% subfiel.subtag %]_[% subfiel.key %]_[% subfiel.subkey %]" value="[% subfiel.value |html%]" /> |
464 |
<span class="subfield">[% subfield.subtag %]</span> / [% subfield.value %] |
| 365 |
</li> |
465 |
<input type="hidden" name="tag_[% field.tag %]_code_[% subfield.subtag %]_[% field.key %]_[% subfield.subkey %]" value="[% subfield.subtag %]" /> |
| 366 |
[% END %] |
466 |
<input type="hidden" name="tag_[% field.tag %]_subfield_[% subfield.subtag %]_[% field.key %]_[% subfield.subkey %]" value="[% subfield.value |html%]" /> |
| 367 |
</ul> |
467 |
</li> |
| 368 |
[% END %] |
468 |
[% END %] |
| 369 |
|
469 |
</ul> |
| 370 |
[% END %] |
470 |
[% END %] |
| 371 |
</li> |
471 |
</li> |
| 372 |
[% END %] |
472 |
[% END %] |
| 373 |
|
473 |
[% END %] |
| 374 |
</ul> |
474 |
</ul> |
| 375 |
</div> |
475 |
</div> |
| 376 |
</div> <!-- // #result --> |
476 |
</div> <!-- // #result --> |
| 377 |
</div> <!-- .yui-u --> |
477 |
</div> <!-- .yui-u --> |
| 378 |
|
478 |
|
| 379 |
<input type="hidden" name="biblio1" value="[% biblio1 %]" /> |
479 |
<input type="hidden" name="ref_biblionumber" value="[% ref_biblionumber %]" /> |
| 380 |
<input type="hidden" name="biblio2" value="[% biblio2 %]" /> |
480 |
[% FOREACH record IN records %] |
| 381 |
<input type="hidden" name="mergereference" value="[% mergereference %]" /> |
481 |
<input type="hidden" name="biblionumber" value="[% record.biblionumber %]" /> |
|
|
482 |
[% END %] |
| 382 |
<input type="hidden" name="frameworkcode" value="[% framework %]" /> |
483 |
<input type="hidden" name="frameworkcode" value="[% framework %]" /> |
| 383 |
|
484 |
|
| 384 |
<fieldset class="action"><input type="submit" name="merge" value="Merge" /></fieldset> |
485 |
<fieldset class="action"> |
|
|
486 |
<input type="submit" name="merge" value="Merge" /> |
| 487 |
<label for="report_fields">Fields to display in report:</label> |
| 488 |
<input type="text" name="report_fields" id="report_fields" value="[% MergeReportFields %]" /> |
| 489 |
<span class="hint">(Example: "001,245ab,600") |
| 490 |
</fieldset> |
| 385 |
</div> |
491 |
</div> |
| 386 |
</form> |
492 |
</form> |
| 387 |
[% END %] |
493 |
[% END %] |