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

Evergreen Git git at git.evergreen-ils.org
Tue Aug 9 15:43:33 EDT 2011


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  b6d197000576d45d9acbb63509ee85f092acf6ad (commit)
      from  0b8ca5bc8fc514d4897d3c9f596d9e135ab428a8 (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 b6d197000576d45d9acbb63509ee85f092acf6ad
Author: Bill Erickson <berick at esilibrary.com>
Date:   Thu Aug 4 18:14:00 2011 -0400

    Show copy status/location names in Vandelay items grid
    
    Signed-off-by: Bill Erickson <berick at esilibrary.com>
    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 97be36b..44898bb 100644
--- a/Open-ILS/web/js/ui/default/vandelay/vandelay.js
+++ b/Open-ILS/web/js/ui/default/vandelay/vandelay.js
@@ -88,13 +88,15 @@ var vlBibSources = [];
 var importItemDefs = [];
 var matchSets = {};
 var mergeProfiles = [];
+var copyStatusCache = {};
+var copyLocationCache = {};
 
 /**
   * Grab initial data
   */
 function vlInit() {
     authtoken = openils.User.authtoken;
-    var initNeeded = 7; // how many async responses do we need before we're init'd 
+    var initNeeded = 8; // how many async responses do we need before we're init'd 
     var initCount = 0; // how many async reponses we've received
 
     openils.Util.registerEnterHandler(
@@ -184,6 +186,16 @@ function vlInit() {
         }
     );
 
+    new openils.PermaCrud().retrieveAll('ccs',
+        {   async: true,
+            oncomplete: function(r) {
+                var stats = openils.Util.readResponse(r);
+                dojo.forEach(stats, function(stat){copyStatusCache[stat.id()] = stat});
+                checkInitDone();
+            }
+        }
+    );
+
     vlAttrEditorInit();
     vlExportInit();
 }
@@ -792,6 +804,29 @@ function vlGetOrg(rowIdx, item) {
     return '';
 }
 
+function vlCopyStatus(rowIdx, item) {
+    if(!item) return '';
+    var value = this.grid.store.getValue(item, this.field);
+    if(value) return copyStatusCache[value].name();
+    return '';
+}
+
+// Note, we don't pre-fetch all copy locations because there could be 
+// a lot of them.  Instead, fetch-and-cache on demand.
+function vlCopyLocation(rowIdx, item) {
+    if(item) {
+        var value = this.grid.store.getValue(item, this.field);
+        if(value) {
+            if(!copyLocationCache[value]) {
+                copyLocationCache[value] = 
+                    new openils.PermaCrud().retrieve('acpl', value);
+            }
+            return copyLocationCache[value].name();
+        }
+    }
+    return '';
+}
+
 function vlFormatViewMatchMARC(id) {
     return '<a href="javascript:void(0);" onclick="vlLoadMARCHtml(' + id + ', true, '+
         'function(){displayGlobalDiv(\'vl-match-div\');});">' + this.name + '</a>';
diff --git a/Open-ILS/web/templates/default/vandelay/inc/import_errors.tt2 b/Open-ILS/web/templates/default/vandelay/inc/import_errors.tt2
index 5554f00..588260e 100644
--- a/Open-ILS/web/templates/default/vandelay/inc/import_errors.tt2
+++ b/Open-ILS/web/templates/default/vandelay/inc/import_errors.tt2
@@ -37,6 +37,8 @@
                     <tr>
                         <th field='owning_lib' get='vlGetOrg'/>
                         <th field='circ_lib' get='vlGetOrg'/>
+                        <th field='status' get='vlCopyStatus'/>
+                        <th field='location' get='vlCopyLocation'/>
                     </tr>
                 </thead>
         </table>
@@ -69,6 +71,8 @@
                     <tr>
                         <th field='owning_lib' get='vlGetOrg'/>
                         <th field='circ_lib' get='vlGetOrg'/>
+                        <th field='status' get='vlCopyStatus'/>
+                        <th field='location' get='vlCopyLocation'/>
                     </tr>
                 </thead>
         </table>

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

Summary of changes:
 Open-ILS/web/js/ui/default/vandelay/vandelay.js    |   37 +++++++++++++++++++-
 .../default/vandelay/inc/import_errors.tt2         |    4 ++
 2 files changed, 40 insertions(+), 1 deletions(-)


hooks/post-receive
-- 
Evergreen ILS


More information about the open-ils-commits mailing list