From: Mike Rylander Date: Mon, 7 Apr 2014 19:42:45 +0000 (-0400) Subject: LP#1303987: Fully populate Ills from context menu X-Git-Tag: sprint4-merge-nov22~2164 X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=f82055d180f0249be8de9013a36d22a04943f6a9;p=working%2FEvergreen.git LP#1303987: Fully populate Ills from context menu The Ills fixed field is 4 characters long (allowing for up to four types of illustrations to be noted, per 008/006), but the fixed field editor dropdown menus are not (a) multi-select capable nor (b) ready to support multi-value-per-field, because, well Ills is the only one like this, and that would be a pretty big complication to the code. However, even though multi-select is not supported, we should still apply the value selected and update the fixed field, otherwise the value is not updated in the record itself. Signed-off-by: Mike Rylander Signed-off-by: Remington Steed Signed-off-by: Dan Wells --- diff --git a/Open-ILS/src/perlmods/lib/OpenILS/Application/Cat.pm b/Open-ILS/src/perlmods/lib/OpenILS/Application/Cat.pm index e48cc62c0a..1057d710d8 100644 --- a/Open-ILS/src/perlmods/lib/OpenILS/Application/Cat.pm +++ b/Open-ILS/src/perlmods/lib/OpenILS/Application/Cat.pm @@ -1344,8 +1344,9 @@ sub fixed_field_values_by_rec_type { my $e = new_editor; my $values = $e->json_query({ select => { - crad => ["fixed_field"], - ccvm => [qw/code value/], + crad => ["fixed_field"], + ccvm => [qw/code value/], + cmfpm => [qw/length default_val/], }, distinct => 1, from => { @@ -1374,7 +1375,7 @@ sub fixed_field_values_by_rec_type { my $result = {}; for my $row (@$values) { $result->{$row->{fixed_field}} ||= []; - push @{$result->{$row->{fixed_field}}}, [@$row{qw/code value/}]; + push @{$result->{$row->{fixed_field}}}, [@$row{qw/code value length default_val/}]; } return $result; diff --git a/Open-ILS/xul/staff_client/server/cat/marcedit.js b/Open-ILS/xul/staff_client/server/cat/marcedit.js index 61adec92a8..8359afcef0 100644 --- a/Open-ILS/xul/staff_client/server/cat/marcedit.js +++ b/Open-ILS/xul/staff_client/server/cat/marcedit.js @@ -991,9 +991,14 @@ function getFFContextMenu(type, name) { * a function of the size of the dataset defined in the * ccvm/cmfpm tables. */ var code = v[0]; + var len = v[2]; + var def = v[3]; var el = document.getElementById(name + "_tb"); window[funcname] = function() { el.value = code; + while (el.value.length < len) { + el.value += def; + } updateFixedFields(el); oils_lock_page(); };