CAT-103 Clean up pauseComp()
authorKyle Huckins <khuckins@catalystdevworks.com>
Tue, 3 Jan 2017 23:20:08 +0000 (15:20 -0800)
committerBill Erickson <berickxx@gmail.com>
Thu, 21 Mar 2019 19:46:23 +0000 (15:46 -0400)
Remove instances of pauseComp() in copy_browser.js
and cat/util.js in favor of .authoritative calls.

Make open-ils.search.asset.copy.batch.retrieve
authoritative.

Signed-off-by: Kyle Huckins <khuckins@catalystdevworks.com>
Open-ILS/src/perlmods/lib/OpenILS/Application/Search/Biblio.pm
Open-ILS/xul/staff_client/server/cat/util.js

index edb1a8a..e08b505 100644 (file)
@@ -379,7 +379,7 @@ sub biblio_id_to_copy {
     my( $self, $client, $ids ) = @_;
     my $e = new_editor();
     $logger->info("Fetching copies @$ids");
-    return $e->search_asset_copy({ id => $ids });
+    return $e->search_asset_copy({id => $ids});
 }
 
 
index 9cf3260..02b5fbb 100644 (file)
@@ -211,9 +211,7 @@ cat.util.transfer_copies = function(params) {
             alert($("catStrings").getString('staff.cat.util.transfer_copies.successful_transfer'));
         }
 
-        cat.util.pauseComp(1000);
-
-        return network.simple_request('FM_ACP_UNFLESHED_BATCH_RETRIEVE', [ params.copy_ids ]);
+        return network.simple_request('FM_ACP_UNFLESHED_BATCH_RETRIEVE.authoritative', [ params.copy_ids ]);
 
     } catch(E) {
         error.standard_unexpected_error_alert($("catStrings").getString('staff.cat.util.transfer_copies.transfer_error'),E);
@@ -523,10 +521,8 @@ cat.util.mark_item_damaged = function(copy_ids) {
                     $("catStrings").getFormattedString('staff.cat.util.mark_item_damaged.multiple_item_damaged', [count]));
             }
         }
-
-        cat.util.pauseComp(1000);
         
-        return network.simple_request('FM_ACP_UNFLESHED_BATCH_RETRIEVE', [ copy_ids ]);
+        return network.simple_request('FM_ACP_UNFLESHED_BATCH_RETRIEVE.authoritative', [ copy_ids ]);
 
     } catch(E) {
         if (error) error.standard_unexpected_error_alert('cat.util.mark_item_damaged',E); else alert('FIXME: ' + E);
@@ -583,9 +579,7 @@ cat.util.mark_item_missing = function(copy_ids) {
             }
         }
 
-        cat.util.pauseComp(1000);
-
-        return network.simple_request('FM_ACP_UNFLESHED_BATCH_RETRIEVE', [ copy_ids ]);
+        return network.simple_request('FM_ACP_UNFLESHED_BATCH_RETRIEVE.authoritative', [ copy_ids ]);
 
     } catch(E) {
         if (error) error.standard_unexpected_error_alert('cat.util.mark_item_missing',E); else alert('FIXME: ' + E);
@@ -957,9 +951,7 @@ cat.util.mark_item_as_missing_pieces = function(copy_ids) {
             }
         }
 
-        cat.util.pauseComp(1000);
-
-        return network.simple_request('FM_ACP_UNFLESHED_BATCH_RETRIEVE', [ copy_ids ]);
+        return network.simple_request('FM_ACP_UNFLESHED_BATCH_RETRIEVE.authoritative', [ copy_ids ]);
     } catch(E) {
         alert('Error in cat.util.mark_item_as_missing_pieces: ' + E);
         return false;
@@ -1196,9 +1188,7 @@ cat.util.update_copies_by_id = function(copy_ids) {
             }
         }
 
-               cat.util.pauseComp(1000);
-
-               var copies = network.simple_request('FM_ACP_UNFLESHED_BATCH_RETRIEVE', [ copy_ids ]);
+               var copies = network.simple_request('FM_ACP_UNFLESHED_BATCH_RETRIEVE.authoritative', [ copy_ids ]);
                if (typeof copies.ilsevent != 'undefined') throw(copies);
 
                return copies;
@@ -1263,7 +1253,7 @@ cat.util.request_copies_by_volumes = function(vol_ids){
 
                JSAN.use('util.network'); var network = new util.network();
 
-               return network.simple_request('FM_ACP_BATCH_RETRIEVE_VIA_ACN_LIST', vol_ids);
+               return network.simple_request('FM_ACP_BATCH_RETRIEVE_VIA_ACN_LIST.authoritative', vol_ids);
     } catch(E) {
         alert('Error in cat.util.request_items: ' + E);
         return null;
@@ -1389,12 +1379,4 @@ cat.util.get_cbs_for_bre_id = function(doc_id) {
     }
 }
 
-cat.util.pauseComp = function(ms) {
-    var curr = new Date().getTime();
-    ms += curr;
-    while (curr < ms){
-        curr = new Date().getTime();
-    }
-}
-
 dump('exiting cat/util.js\n');