From b922420e98cfb3fefdba1987c3c5d20dd5493ece Mon Sep 17 00:00:00 2001 From: Bill Erickson Date: Mon, 26 Mar 2012 11:29:08 -0400 Subject: [PATCH] ACQ Upload import-copy option With the addition of the new Vandelay features in ACQ, the "Load bibs and Items" option was replaced with Vandeley import options. In the context of ACQ, however, Vandelay is only concerned with importing bibs and not copies. Subsequently, the user lost the ability to both create catalog records and catalog copies in one step during ACQ upload. The patch remedies that by providing a new "Load Items for Imported Records" option within the upload page. When enabled, all successfully loaded ACQ copies will also be imported as real/catalog copies. Note that it's only added to the upload page, because all other ACQ interfaces assume that both bibs and copies should be created (e.g. during PO activation). Signed-off-by: Bill Erickson Signed-off-by: Jason Stephenson Signed-off-by: Mike Rylander --- Open-ILS/src/perlmods/lib/OpenILS/Application/Acq/Order.pm | 3 ++- Open-ILS/src/templates/acq/common/vlagent.tt2 | 6 ++++++ Open-ILS/src/templates/acq/picklist/upload.tt2 | 2 +- Open-ILS/web/js/ui/default/acq/common/vlagent.js | 5 ++++- 4 files changed, 13 insertions(+), 3 deletions(-) diff --git a/Open-ILS/src/perlmods/lib/OpenILS/Application/Acq/Order.pm b/Open-ILS/src/perlmods/lib/OpenILS/Application/Acq/Order.pm index 8baf9eaa7f..0533d50d01 100644 --- a/Open-ILS/src/perlmods/lib/OpenILS/Application/Acq/Order.pm +++ b/Open-ILS/src/perlmods/lib/OpenILS/Application/Acq/Order.pm @@ -1420,7 +1420,8 @@ sub upload_records { } elsif ($vandelay) { $vandelay->{new_rec_perm} = 'IMPORT_ACQ_LINEITEM_BIB_RECORD_UPLOAD'; - create_lineitem_list_assets($mgr, \@li_list, $vandelay, 1) or return $e->die_event; + create_lineitem_list_assets($mgr, \@li_list, $vandelay, + !$vandelay->{create_assets}) or return $e->die_event; } return $mgr->respond_complete; diff --git a/Open-ILS/src/templates/acq/common/vlagent.tt2 b/Open-ILS/src/templates/acq/common/vlagent.tt2 index 7c8ee66761..8d5ede7954 100644 --- a/Open-ILS/src/templates/acq/common/vlagent.tt2 +++ b/Open-ILS/src/templates/acq/common/vlagent.tt2 @@ -43,6 +43,12 @@ [% l('Insufficient Quality Fall-Through Profile') %]
+ [% IF vl_show_copy_option %] + + [% l('Load Items for Imported Records') %] + + + [% END %] [% END %] [% BLOCK vlagent_results %] diff --git a/Open-ILS/src/templates/acq/picklist/upload.tt2 b/Open-ILS/src/templates/acq/picklist/upload.tt2 index fcd79cde28..6d04d7f9a0 100644 --- a/Open-ILS/src/templates/acq/picklist/upload.tt2 +++ b/Open-ILS/src/templates/acq/picklist/upload.tt2 @@ -34,7 +34,7 @@
- [% PROCESS vlagent_form %] + [% PROCESS vlagent_form vl_show_copy_option=1 %]
diff --git a/Open-ILS/web/js/ui/default/acq/common/vlagent.js b/Open-ILS/web/js/ui/default/acq/common/vlagent.js index dbfc70f38c..c92a135f2c 100644 --- a/Open-ILS/web/js/ui/default/acq/common/vlagent.js +++ b/Open-ILS/web/js/ui/default/acq/common/vlagent.js @@ -14,6 +14,7 @@ function VLAgent(args) { {key : 'auto_overlay_best_match'}, {key : 'match_quality_ratio'}, {key : 'queue_name'}, + {key : 'create_assets'}, {key : 'match_set', cls : 'vms'}, {key : 'bib_source', cls : 'cbs'}, {key : 'merge_profile', cls : 'vmp'}, @@ -44,6 +45,7 @@ function VLAgent(args) { } else { // bools widg.dijit = dijit.byId('acq_vl:' + widg.key); + if (!widg.dijit) return; // some fields optional self.attachOnChange(widg); } } @@ -132,7 +134,8 @@ function VLAgent(args) { var values = {}; dojo.forEach(this.widgets, function(widg) { - values[widg.key] = widg.dijit.attr('value'); + if (widg.dijit) + values[widg.key] = widg.dijit.attr('value'); } ); return values; -- 2.11.0