[open-ils-commits] r14314 - branches/rel_1_4_0/Open-ILS/xul/staff_client/server/cat (miker)
svn at svn.open-ils.org
svn at svn.open-ils.org
Thu Oct 8 13:50:15 EDT 2009
Author: miker
Date: 2009-10-08 13:50:11 -0400 (Thu, 08 Oct 2009)
New Revision: 14314
Modified:
branches/rel_1_4_0/Open-ILS/xul/staff_client/server/cat/marcedit.js
Log:
Backporting r14305 to fix <controlfield> creation and use (when missing) bug:
When we add a <controlfield> element we need to set it to be 40 characters
long, and full of spaces, otherwise the Fixed Field editor cannot properly
set the positions.
Additionally, when a Fixed Field is edited but there is no backing
<controlfield> element (say, trying to set the Audn when there is no 008)
then we will add the needed <controlfield>.
Modified: branches/rel_1_4_0/Open-ILS/xul/staff_client/server/cat/marcedit.js
===================================================================
--- branches/rel_1_4_0/Open-ILS/xul/staff_client/server/cat/marcedit.js 2009-10-08 17:49:22 UTC (rev 14313)
+++ branches/rel_1_4_0/Open-ILS/xul/staff_client/server/cat/marcedit.js 2009-10-08 17:50:11 UTC (rev 14314)
@@ -473,13 +473,13 @@
return false;
}
} else if (event.keyCode == 64 && event.ctrlKey) { // ctrl + F6
- createControlField('006','');
+ createControlField('006',' ');
loadRecord(xml_record);
} else if (event.keyCode == 65 && event.ctrlKey) { // ctrl + F7
- createControlField('007','');
+ createControlField('007',' ');
loadRecord(xml_record);
} else if (event.keyCode == 66 && event.ctrlKey) { // ctrl + F8
- createControlField('008','');
+ createControlField('008',' ');
loadRecord(xml_record);
}
return true;
@@ -1115,8 +1115,19 @@
for (var i in ff_pos[name]) {
if (!ff_pos[name][i][rtype]) continue;
- if (!parts[i]) continue;
+ if (!parts[i]) {
+ // we're missing the required field. Add it now.
+ var newfield;
+ if (i == '_6') newfield = '006';
+ else if (i == '_7') newfield = '007';
+ else if (i == '_8') newfield = '008';
+ else continue;
+
+ createControlField(newfield,' ');
+ parts[i] = _record.controlfield.(@tag==newfield);
+ }
+
var before = parts[i].substr(0, ff_pos[name][i][rtype].start);
var after = parts[i].substr(ff_pos[name][i][rtype].start + ff_pos[name][i][rtype].len);
More information about the open-ils-commits
mailing list