ACQ Upload import-copy option
authorBill Erickson <berick@esilibrary.com>
Mon, 26 Mar 2012 15:29:08 +0000 (11:29 -0400)
committerMike Rylander <mrylander@gmail.com>
Sun, 1 Apr 2012 02:30:49 +0000 (22:30 -0400)
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 <berick@esilibrary.com>
Signed-off-by: Jason Stephenson <jstephenson@mvlc.org>
Signed-off-by: Mike Rylander <mrylander@gmail.com>
Open-ILS/src/perlmods/lib/OpenILS/Application/Acq/Order.pm
Open-ILS/src/templates/acq/common/vlagent.tt2
Open-ILS/src/templates/acq/picklist/upload.tt2
Open-ILS/web/js/ui/default/acq/common/vlagent.js

index 8baf9ea..0533d50 100644 (file)
@@ -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;
index 7c8ee66..8d5ede7 100644 (file)
         <td>[% l('Insufficient Quality Fall-Through Profile') %]</td>
         <td><div id='acq_vl:fall_through_merge_profile'></div></td>
     </tr>
+    [% IF vl_show_copy_option %]
+    <tr>
+        <td>[% l('Load Items for Imported Records') %]</td>
+        <td><input dojoType='dijit.form.CheckBox' id='acq_vl:create_assets'></input></td>
+    </tr>
+    [% END %]
 [% END %]
 
 [% BLOCK vlagent_results %]
index fcd79cd..6d04d7f 100644 (file)
@@ -34,7 +34,7 @@
             </tr>
 
             <tr><td colspan='2'><hr/></td></tr>
-            [% PROCESS vlagent_form %]
+            [% PROCESS vlagent_form vl_show_copy_option=1 %]
             <tr><td colspan='2'><hr/></td></tr>
 
             <tr>
index dbfc70f..c92a135 100644 (file)
@@ -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;