From 8013acbe2219e5769cfb78e9d97eaca34aae56ef Mon Sep 17 00:00:00 2001 From: erickson Date: Thu, 18 Sep 2008 21:28:02 +0000 Subject: [PATCH] added queue delete option and begining of support for auto-import on non-colidding records git-svn-id: svn://svn.open-ils.org/ILS/trunk@10638 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- .../perlmods/OpenILS/Application/Vandelay.pm | 65 +++++++++++++++++++ Open-ILS/web/vandelay/vandelay.html | 17 ++++- Open-ILS/web/vandelay/vandelay.js | 15 +++++ 3 files changed, 95 insertions(+), 2 deletions(-) diff --git a/Open-ILS/src/perlmods/OpenILS/Application/Vandelay.pm b/Open-ILS/src/perlmods/OpenILS/Application/Vandelay.pm index 4f90680dd8..b827613489 100644 --- a/Open-ILS/src/perlmods/OpenILS/Application/Vandelay.pm +++ b/Open-ILS/src/perlmods/OpenILS/Application/Vandelay.pm @@ -398,6 +398,37 @@ sub import_record_list { return {complete => 1}; } +=head note done +__PACKAGE__->register_method( + api_name => "open-ils.vandelay.bib_queue.import", + method => 'import_queue', + api_level => 1, + argc => 2, + stream => 1, + record_type => 'bib' +); + +__PACKAGE__->register_method( + api_name => "open-ils.vandelay.auth_queue.import", + method => 'import_queue', + api_level => 1, + argc => 2, + stream => 1, + record_type => 'auth' +); + +sub import_record_list { + my($self, $conn, $auth, $rec_ids, $args) = @_; + my $e = new_editor(xact => 1, authtoken => $auth); + return $e->die_event unless $e->checkauth; + $args ||= {}; + my $err = import_record_list_impl($self, $conn, $auth, $e, $rec_ids, $args); + return $err if $err; + $e->commit; + return {complete => 1}; +} +=cut + sub import_record_list_impl { my($self, $conn, $auth, $e, $rec_ids, $args) = @_; @@ -537,6 +568,40 @@ sub owner_queue_retrieve { return undef; } +__PACKAGE__->register_method( + api_name => "open-ils.vandelay.bib_queue.delete", + method => "delete_queue", + api_level => 1, + argc => 2, + record_type => 'bib' +); +__PACKAGE__->register_method( + api_name => "open-ils.vandelay.auth_queue.delete", + method => "delete_queue", + api_level => 1, + argc => 2, + record_type => 'auth' +); +sub delete_queue { + my($self, $conn, $auth, $q_id) = @_; + my $e = new_editor(xact => 1, authtoken => $auth); + return $e->die_event unless $e->checkauth; + if($self->{record_type} eq 'bib') { + return $e->die_event unless $e->allowed('CREATE_BIB_IMPORT_QUEUE'); + my $queue = $e->retrieve_vandelay_bib_queue($q_id) + or return $e->die_event; + $e->delete_vandelay_bib_queue($queue) + or return $e->die_event; + } else { + return $e->die_event unless $e->allowed('CREATE_AUTHORITY_IMPORT_QUEUE'); + my $queue = $e->retrieve_vandelay_authority_queue($q_id) + or return $e->die_event; + $e->delete_vandelay_authority_queue($queue) + or return $e->die_event; + } + $e->commit; + return 1; +} 1; diff --git a/Open-ILS/web/vandelay/vandelay.html b/Open-ILS/web/vandelay/vandelay.html index 47b9f79772..cfbd741958 100644 --- a/Open-ILS/web/vandelay/vandelay.html +++ b/Open-ILS/web/vandelay/vandelay.html @@ -103,6 +103,7 @@ + + + Auto-Import Non-Colliding Records + + + + File to Upload: @@ -170,17 +178,22 @@ +
- Only show records with possible matches + Limit to Collision Matches Results Per Page - diff --git a/Open-ILS/web/vandelay/vandelay.js b/Open-ILS/web/vandelay/vandelay.js index 3f3c28cd6d..3528bf8834 100644 --- a/Open-ILS/web/vandelay/vandelay.js +++ b/Open-ILS/web/vandelay/vandelay.js @@ -514,6 +514,21 @@ function buildRecordGrid(type) { } } +function vlDeleteQueue(type, queueId, onload) { + fieldmapper.standardRequest( + ['open-ils.vandelay', 'open-ils.vandelay.'+type+'_queue.delete'], + { async: true, + params: [authtoken, queueId], + oncomplete: function(r) { + var resp = r.recv().content(); + if(e = openils.Event.parse(resp)) + return alert(e); + onload(); + } + } + ); +} + function vlQueueGridDrawSelectBox(rowIdx) { var data = this.grid.model.getRow(rowIdx); -- 2.43.2