[open-ils-commits] [GIT] Evergreen ILS branch master updated. 21d99800e0e3f99615cbe2725c6e1a371256166c

Evergreen Git git at git.evergreen-ils.org
Tue Jun 12 12:32:20 EDT 2012


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Evergreen ILS".

The branch, master has been updated
       via  21d99800e0e3f99615cbe2725c6e1a371256166c (commit)
       via  1839b4447b869a65769cd7fba6f8eb2ed22c47e1 (commit)
       via  c2da665dd33ad80a601c8cc65698306ad6a8d092 (commit)
      from  e31c4337304ae6ebe819011ad8e1bd396acd0761 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 21d99800e0e3f99615cbe2725c6e1a371256166c
Author: Thomas Berezansky <tsbere at mvlc.org>
Date:   Mon Jun 11 09:43:08 2012 -0400

    Vandelay: Add some padding for inspect queue list
    
    Signed-off-by: Thomas Berezansky <tsbere at mvlc.org>
    Signed-off-by: Lebbeous Fogle-Weekley <lebbeous at esilibrary.com>

diff --git a/Open-ILS/web/css/skin/default/vandelay.css b/Open-ILS/web/css/skin/default/vandelay.css
index b1987f8..7f70d35 100644
--- a/Open-ILS/web/css/skin/default/vandelay.css
+++ b/Open-ILS/web/css/skin/default/vandelay.css
@@ -48,3 +48,5 @@ table.dijitTooltipTable { border-collapse: separate; }
 .queue-pager-span { padding-right: 5px; margin-right: 5px; border-right: 2px solid #e8e1cf; }
 #vl-queue-paging-table td { padding-bottom: 0px; }
 #vl-file-label { margin-right: 10px; }
+
+#vlQueueSelectList td { padding-top: 5px; padding-bottom: 5px; }

commit 1839b4447b869a65769cd7fba6f8eb2ed22c47e1
Author: Thomas Berezansky <tsbere at mvlc.org>
Date:   Mon Jun 11 09:26:17 2012 -0400

    Vandelay: Update Current Type/ID on queue retrieve
    
    Because other parts of the javascript need those values.
    
    Signed-off-by: Thomas Berezansky <tsbere at mvlc.org>
    Signed-off-by: Lebbeous Fogle-Weekley <lebbeous at esilibrary.com>

diff --git a/Open-ILS/web/js/ui/default/vandelay/vandelay.js b/Open-ILS/web/js/ui/default/vandelay/vandelay.js
index 9988eb2..5b959fc 100644
--- a/Open-ILS/web/js/ui/default/vandelay/vandelay.js
+++ b/Open-ILS/web/js/ui/default/vandelay/vandelay.js
@@ -498,7 +498,9 @@ function retrieveQueuedRecords(type, queueId, onload, doExport) {
     selectableGridRecords = {};
 
     if(!type) type = currentType;
+    else currentType = type;
     if(!queueId) queueId = currentQueueId;
+    else currentQueueId = queueId;
     if(!onload) onload = handleRetrieveRecords;
 
     var method = 'open-ils.vandelay.'+type+'_queue.records.retrieve';

commit c2da665dd33ad80a601c8cc65698306ad6a8d092
Author: Thomas Berezansky <tsbere at mvlc.org>
Date:   Wed Mar 14 12:04:25 2012 -0400

    Vandelay: Rewrite Inspect Queues Interface
    
    This accomplishes several things:
    1 - Load the list of queues on page load
    2 - Single-click access (rather than select and click) to queues
    3 - Batch Deletion of Queues
    
    Signed-off-by: Thomas Berezansky <tsbere at mvlc.org>
    Signed-off-by: Lebbeous Fogle-Weekley <lebbeous at esilibrary.com>

diff --git a/Open-ILS/src/templates/vandelay/inc/queueselect.tt2 b/Open-ILS/src/templates/vandelay/inc/queueselect.tt2
index 91416c9..e6be903 100644
--- a/Open-ILS/src/templates/vandelay/inc/queueselect.tt2
+++ b/Open-ILS/src/templates/vandelay/inc/queueselect.tt2
@@ -1,26 +1,27 @@
 <!-- Form for choosing which queue to view -->
 <h1>[% l('Select a Queue to Inspect') %]</h1><br/>
-<table class='form_table'>
-    <tr>
-        <td>[% l('Queue Type') %]</td>
-        <td>
-            <select jsId='vlQueueSelectType' dojoType='dijit.form.FilteringSelect' onchange='vlShowQueueSelect();'>
-                <option value='bib' selected='selected'>[% l('Bibliographic Records') %]</option>
-                <option value='bib-acq'>[% l('Acquisitions Records') %]</option>
-                <option value='auth'>[% l('Authority Records') %]</option>
-            </select>
-        </td>
-    </tr>
-    <tr>
-        <td>[% l('Queue') %]</td>
-        <td>
-            <select jsId='vlQueueSelectQueueList' dojoType='dijit.form.FilteringSelect'>
-            </select>
-        </td>
-    </tr>
-    <tr>
-        <td colspan='2'>
-            <button dojoType='dijit.form.Button' onclick='vlFetchQueueFromForm();'>[% l('Retrieve Queue') %]</button>
-        </td>
-    </tr>
+[% l('Queue Type') %]
+<select jsId='vlQueueSelectType' dojoType='dijit.form.FilteringSelect' onchange='vlShowQueueSelect();'>
+    <option value='bib' selected='selected'>[% l('Bibliographic Records') %]</option>
+    <option value='bib-acq'>[% l('Acquisitions Records') %]</option>
+    <option value='auth'>[% l('Authority Records') %]</option>
+</select>
+<table>
+    <thead>
+        <tr>
+            <td><input type="checkbox" disabled="true" /> &nbsp;</td>
+            <td>[% l('Queue') %]</td>
+        </tr>
+    </thead>
+    <tbody id="vlQueueSelectList">
+    </tbody>
+    <tfoot>
+        <tr>
+            <td>&nbsp;</td>
+            <td><input type="button" value="[% l('Delete Selected') %]" onclick='
+                if(confirm("[% l('Are you sure you want to delete the selected queues?') %]")) {
+                    vlDeleteSelectedQueues();
+                }' /></td>
+        </tr>
+    </tfoot>
 </table>
diff --git a/Open-ILS/web/js/ui/default/vandelay/vandelay.js b/Open-ILS/web/js/ui/default/vandelay/vandelay.js
index 5d7d6a3..9988eb2 100644
--- a/Open-ILS/web/js/ui/default/vandelay/vandelay.js
+++ b/Open-ILS/web/js/ui/default/vandelay/vandelay.js
@@ -344,10 +344,8 @@ function runStartupCommands() {
     dojo.style('vl-nav-bar', 'visibility', 'visible');
     if(currentQueueId)
         return retrieveQueuedRecords(currentType, currentQueueId, handleRetrieveRecords);
-    if (cgi.param('page', 'inspectq')) {
-        vlShowQueueSelect();
-        return displayGlobalDiv('vl-queue-select-div');
-    }
+    if (cgi.param('page', 'inspectq'))
+        return vlShowQueueSelect();
         
     vlShowUploadForm();
 }
@@ -1354,28 +1352,29 @@ function batchUpload() {
     }
 }
 
-
-function vlFleshQueueSelect(selector, type) {
-    var data;
-    if (type == 'bib') {
-        var bibList = allUserBibQueues.filter(
-            function(q) {
-                return (q.queue_type() == 'bib');
-            }
-        );
-        data = vbq.toStoreData(bibList);
-    } else if (type == 'bib-acq') {
-        // ACQ queues are a special type of bib queue
-        var acqList = allUserBibQueues.filter(
-            function(q) {
-                return (q.queue_type() == 'acq');
-            }
-        );
-        data = vbq.toStoreData(acqList);
-    } else {
-        data = vaq.toStoreData(allUserAuthQueues);
+// Inspect Queue no longer uses stores, so put type matching here instead
+function vlGetQueueData(type, asStore) {
+    var filter;
+    switch(type) {
+        case 'bib-acq':
+            filter = 'acq';
+        case 'bib':
+            if(!filter) filter = 'bib';
+            var bibList = allUserBibQueues.filter(
+                function(q) {
+                    return (q.queue_type() == filter);
+                }
+            );
+            if (!asStore) return bibList;
+            return vbq.toStoreData(bibList);
+        case 'auth':
+            if (!asStore) return allUserAuthQueues;
+            return vaq.toStoreData(allUserAuthQueues);
     }
+}
 
+function vlFleshQueueSelect(selector, type) {
+    var data = vlGetQueueData(type, true);
     selector.store = new dojo.data.ItemFileReadStore({data:data});
     selector.setValue(null);
     selector.setDisplayedValue('');
@@ -1459,9 +1458,48 @@ function vlShowUploadForm() {
 
 }
 
+function vlDeleteSelectedQueues() {
+    var checkboxes = document.getElementById('vlQueueSelectList').getElementsByTagName('input');
+    var type = vlQueueSelectType.attr('value').replace(/-.*/, '');
+    for(var i = 0; i < checkboxes.length; i++) {
+        if(checkboxes[i].getAttribute('name') == 'delete' && checkboxes[i].checked) {
+            vlDeleteQueue(type, checkboxes[i].getAttribute('value'), function () {});
+        }
+    }
+    window.location.reload();
+}
+
 function vlShowQueueSelect() {
     displayGlobalDiv('vl-queue-select-div');
-    vlFleshQueueSelect(vlQueueSelectQueueList, vlQueueSelectType.getValue());
+    var type = vlQueueSelectType.attr('value');
+    var data = vlGetQueueData(type, false);
+    type = type.replace(/-.*/, ''); // To remove any sub-typeish info.
+    var tbody = document.getElementById('vlQueueSelectList');
+    // Clear it out
+    while(tbody.firstChild) {
+        tbody.removeChild(tbody.firstChild);
+    }
+    // Add entries
+    for(var entry in data) {
+        var name = data[entry].name();
+        if(!name.match(/\S/))
+            name = '-';
+        var tr = document.createElement('tr');
+        var td = document.createElement('td');
+        var checkbox = document.createElement('input');
+        checkbox.setAttribute('type', 'checkbox');
+        checkbox.setAttribute('name', 'delete');
+        checkbox.setAttribute('value', data[entry].id());
+        td.appendChild(checkbox);
+        tr.appendChild(td);
+        td = document.createElement('td');
+        var a = document.createElement('a');
+        a.textContent = name;
+        a.setAttribute('href', "javascript:retrieveQueuedRecords('" + type + "', " + data[entry].id() + ");");
+        td.appendChild(a);
+        tr.appendChild(td);
+        tbody.appendChild(tr);
+    }
 }
 
 function vlShowMatchSetEditor() {
@@ -1475,12 +1513,6 @@ function vlShowMatchSetEditor() {
     );
 }
 
-function vlFetchQueueFromForm() {
-    currentType = vlQueueSelectType.attr('value').replace(/-.*/, ''); // trim bib-acq
-    currentQueueId = vlQueueSelectQueueList.getValue();
-    retrieveQueuedRecords(currentType, currentQueueId, handleRetrieveRecords);
-}
-
 function vlOpenMarcEditWindow(rec, postReloadHTMLHandler) {
     /*
         To run in Firefox directly, must set signed.applets.codebase_principal_support

-----------------------------------------------------------------------

Summary of changes:
 .../src/templates/vandelay/inc/queueselect.tt2     |   47 +++++-----
 Open-ILS/web/css/skin/default/vandelay.css         |    2 +
 Open-ILS/web/js/ui/default/vandelay/vandelay.js    |   96 +++++++++++++-------
 3 files changed, 91 insertions(+), 54 deletions(-)


hooks/post-receive
-- 
Evergreen ILS


More information about the open-ils-commits mailing list