From 56e951f903503f7699753e430fdd749d6b48a34c Mon Sep 17 00:00:00 2001 From: erickson Date: Fri, 5 Sep 2008 20:38:58 +0000 Subject: [PATCH] added upload-to-existing-queue. styling records to overlay slightly differently git-svn-id: svn://svn.open-ils.org/ILS/trunk@10551 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- Open-ILS/web/vandelay/vandelay.html | 42 ++++++++++++++++++----------- Open-ILS/web/vandelay/vandelay.js | 28 ++++++++++++++----- 2 files changed, 47 insertions(+), 23 deletions(-) diff --git a/Open-ILS/web/vandelay/vandelay.html b/Open-ILS/web/vandelay/vandelay.html index bf0b5bbe36..7151fe3a65 100644 --- a/Open-ILS/web/vandelay/vandelay.html +++ b/Open-ILS/web/vandelay/vandelay.html @@ -41,12 +41,16 @@ text-align:center; margin: 20px; } + .overlay_selected { + padding: 2px; + background: #d9e8f9; + border: 1px solid red; + } - + -
Import Records
@@ -55,10 +59,10 @@
-
+
@@ -69,23 +73,29 @@
- - + - + + + - - - - @@ -206,7 +216,7 @@
Queue Name - + Record Type +
Record TypeCreate a Upload New Queue - + or Add to an Existing Queue +
Purpose + +
+
+
Queue Type - diff --git a/Open-ILS/web/vandelay/vandelay.js b/Open-ILS/web/vandelay/vandelay.js index 265304a1b6..8f9596d10a 100644 --- a/Open-ILS/web/vandelay/vandelay.js +++ b/Open-ILS/web/vandelay/vandelay.js @@ -50,7 +50,6 @@ var bibAttrsFetched = false; var authAttrsFetched = false; var attrDefMap = {}; // maps attr def code names to attr def ids var currentType; -var cgi = new openils.CGI(); var currentQueueId = null; var userCache = {}; var currentMatchedRecords; // set of loaded matched bib records @@ -59,6 +58,7 @@ var currentImportRecId; // when analyzing matches, this is the current import re var userBibQueues; var userAuthQueues; var selectableGridRecords; +var cgi = new openils.CGI(); /** * Grab initial data @@ -166,7 +166,7 @@ function runStartupCommands() { currentType = cgi.param('qtype'); if(currentQueueId) return retrievenueuedRecords(currentType, currentQueueId, handleRetrieveRecords); - displayGlobalDiv('vl-marc-upload-div'); + vlShowUploadForm(); } /** @@ -234,6 +234,7 @@ function processSpool(key, queueId, type, onload) { } function retrieveQueuedRecords(type, queueId, onload) { + displayGlobalDiv('vl-generic-progress'); queuedRecords = []; queuedRecordsMap = {}; currentOverlayRecordsMap = {}; @@ -424,6 +425,7 @@ function vlHandleOverlayTargetSelected() { console.log("found overlay target " + matchRecId); currentOverlayRecordsMap[currentImportRecId] = matchRecId; dojo.byId('vl-record-list-selected-' + currentImportRecId).checked = true; + dojo.byId('vl-record-list-selected-' + currentImportRecId).parentNode.className = 'overlay_selected'; return; } } @@ -494,7 +496,7 @@ function vlQueueGridDrawSelectBox(rowIdx) { if(!data) return ''; var domId = 'vl-record-list-selected-' +data.id; selectableGridRecords[domId] = data.id; - return ""; + return "
"; } function vlSelectAllGridRecords() { @@ -563,21 +565,34 @@ function batchUpload() { currentQueueId = queue.id(); uploadMARC(handleUploadMARC); }; - - createQueue(queueName, currentType, handleCreateQueue); + + if(vlUploadQueueSelector.getValue() && !queueName) { + currentQueueId = vlUploadQueueSelector.getValue(); + console.log('adding records to existing queue ' + currentQueueId); + uploadMARC(handleUploadMARC); + } else { + createQueue(queueName, currentType, handleCreateQueue); + } } function vlFleshQueueSelect(selector, type) { var data = (type == 'bib') ? vbq.toStoreData(userBibQueues) : vaq.toStoreData(userAuthQueues); selector.store = new dojo.data.ItemFileReadStore({data:data}); + selector.setValue(null); + selector.setDisplayedValue(''); if(data[0]) selector.setValue(data[0].id()); } +function vlShowUploadForm() { + displayGlobalDiv('vl-marc-upload-div'); + vlFleshQueueSelect(vlUploadQueueSelector, vlUploadRecordType.getValue()); +} + function vlShowQueueSelect() { displayGlobalDiv('vl-queue-select-div'); - vlFleshQueueSelect(vlQueueSelectQueueList, 'bib'); + vlFleshQueueSelect(vlQueueSelectQueueList, vlQueueSelectType.getValue()); } function vlFetchQueueFromForm() { @@ -585,6 +600,5 @@ function vlFetchQueueFromForm() { currentQueueId = vlQueueSelectQueueList.getValue(); retrieveQueuedRecords(currentType, currentQueueId, handleRetrieveRecords); } - dojo.addOnLoad(vlInit); -- 2.43.2