[open-ils-commits] SPAM: r10638 - in trunk/Open-ILS:
src/perlmods/OpenILS/Application web/vandelay
svn at svn.open-ils.org
svn at svn.open-ils.org
Thu Sep 18 17:28:07 EDT 2008
Author: erickson
Date: 2008-09-18 17:28:02 -0400 (Thu, 18 Sep 2008)
New Revision: 10638
Modified:
trunk/Open-ILS/src/perlmods/OpenILS/Application/Vandelay.pm
trunk/Open-ILS/web/vandelay/vandelay.html
trunk/Open-ILS/web/vandelay/vandelay.js
Log:
added queue delete option and begining of support for auto-import on non-colidding records
Modified: trunk/Open-ILS/src/perlmods/OpenILS/Application/Vandelay.pm
===================================================================
--- trunk/Open-ILS/src/perlmods/OpenILS/Application/Vandelay.pm 2008-09-18 18:09:43 UTC (rev 10637)
+++ trunk/Open-ILS/src/perlmods/OpenILS/Application/Vandelay.pm 2008-09-18 21:28:02 UTC (rev 10638)
@@ -398,6 +398,37 @@
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 @@
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;
Modified: trunk/Open-ILS/web/vandelay/vandelay.html
===================================================================
--- trunk/Open-ILS/web/vandelay/vandelay.html 2008-09-18 18:09:43 UTC (rev 10637)
+++ trunk/Open-ILS/web/vandelay/vandelay.html 2008-09-18 21:28:02 UTC (rev 10638)
@@ -103,6 +103,7 @@
</select>
</td>
</tr>
+ <!--
<tr>
<td>Purpose</td>
<td colspan='4'>
@@ -112,7 +113,14 @@
</select>
</td>
</tr>
+ -->
<tr>
+ <td>Auto-Import Non-Colliding Records</td>
+ <td colspan='4'>
+ <input jsId='vlUploadQueueAutoImport' checked='checked' dojoType='dijit.form.CheckBox'/>
+ </td>
+ </tr>
+ <tr>
<td>
<span id="vl-file-label">File to Upload:</span>
</td>
@@ -170,17 +178,22 @@
<tr>
<td align='left'>
<button dojoType='dijit.form.Button' onclick='vlImportSelectedRecords();'>Import Selected</button>
+ <button dojoType='dijit.form.Button' onclick='
+ if(confirm("Are you sure want to delete this queue?")) {
+ vlDeleteQueue(currentType, currentQueueId,
+ function() { displayGlobalDiv("vl-marc-upload-div"); });
+ }'>Delete Queue</button>
</td>
<td align='middle'>
<style>.filter_td { padding-right: 5px; border-right: 2px solid #e8e1cf; } </style>
<table><tr>
<td class='filter_td'>
- Only show records with possible matches
+ Limit to Collision Matches
<input dojoType='dijit.form.CheckBox' jsId='vlQueueGridShowMatches' checked='checked'/>
</td>
<td class='filter_td' style='padding-left:5px;'>
Results Per Page
- <select style='width:50px;' jsId='vlQueueDisplayLimit' dojoType='dijit.form.FilteringSelect' value='10'>
+ <select style='width:56px;' jsId='vlQueueDisplayLimit' dojoType='dijit.form.FilteringSelect' value='10'>
<option value='10'>10</option>
<option value='20'>20</option>
<option value='50'>50</option>
Modified: trunk/Open-ILS/web/vandelay/vandelay.js
===================================================================
--- trunk/Open-ILS/web/vandelay/vandelay.js 2008-09-18 18:09:43 UTC (rev 10637)
+++ trunk/Open-ILS/web/vandelay/vandelay.js 2008-09-18 21:28:02 UTC (rev 10638)
@@ -514,7 +514,22 @@
}
}
+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);
if(!data) return '';
More information about the open-ils-commits
mailing list