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

Evergreen Git git at git.evergreen-ils.org
Mon Jul 25 16:57:50 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  6d4d47b3c971ed024334bea57c509f7326247594 (commit)
      from  431fab78e5153f87dcb3acf2251ad19efadeba13 (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 6d4d47b3c971ed024334bea57c509f7326247594
Author: Jason Etheridge <jason at esilibrary.com>
Date:   Mon Jul 11 07:22:01 2011 -0400

    Add support for Holds and Items counts in dynamic staff Record Summary
    
    (use 'holds' and 'items' with your
    oils.bib_brief.*.dynamic_grid_replacement.data customizations)
    
    Also make the Bib Call # retrieval asynchronous and dependent on the field being
    configured for display.  This branch has merged in (and depends on) the changes
    from collab/phasefx/dynamic_bib_brief
    
    Signed-off-by: Jason Etheridge <jason at esilibrary.com>
    Signed-off-by: Bill Erickson <berick at esilibrary.com>

diff --git a/Open-ILS/xul/staff_client/chrome/content/main/constants.js b/Open-ILS/xul/staff_client/chrome/content/main/constants.js
index 4d61b10..57c631c 100644
--- a/Open-ILS/xul/staff_client/chrome/content/main/constants.js
+++ b/Open-ILS/xul/staff_client/chrome/content/main/constants.js
@@ -139,6 +139,7 @@ var api = {
     'FM_AHR_ONSHELF_RETRIEVE' : { 'app' : 'open-ils.circ', 'method' : 'open-ils.circ.captured_holds.on_shelf.retrieve' },
     'FM_AHR_ID_LIST_ONSHELF_RETRIEVE' : { 'app' : 'open-ils.circ', 'method' : 'open-ils.circ.captured_holds.id_list.on_shelf.retrieve', 'secure' : false },
     'FM_AHR_ID_LIST_EXPIRED_ONSHELF_RETRIEVE' : { 'app' : 'open-ils.circ', 'method' : 'open-ils.circ.captured_holds.id_list.expired_on_shelf.retrieve', 'secure' : false },
+    'FM_AHR_COUNT_FOR_BRE' : { 'app' : 'open-ils.circ', 'method' : 'open-ils.circ.bre.holds.count', 'secure' : false },
     'FM_AHR_COUNT_RETRIEVE' : { 'app' : 'open-ils.actor', 'method' : 'open-ils.actor.user.hold_requests.count', 'cacheable' : true, 'ttl' : 60000  },
     'FM_AHR_COUNT_RETRIEVE.authoritative' : { 'app' : 'open-ils.actor', 'method' : 'open-ils.actor.user.hold_requests.count.authoritative', 'cacheable' : true, 'ttl' : 60000  },
     'FM_AHR_CANCEL' : { 'app' : 'open-ils.circ', 'method' : 'open-ils.circ.hold.cancel' },
diff --git a/Open-ILS/xul/staff_client/server/cat/bib_brief_overlay.js b/Open-ILS/xul/staff_client/server/cat/bib_brief_overlay.js
index b7dc24a..bc6d784 100644
--- a/Open-ILS/xul/staff_client/server/cat/bib_brief_overlay.js
+++ b/Open-ILS/xul/staff_client/server/cat/bib_brief_overlay.js
@@ -35,6 +35,10 @@ function bib_brief_overlay(params) {
         }
 
         JSAN.use('util.widgets');
+        function exists(name) {
+            var nodes = document.getElementsByAttribute('name',name);
+            return nodes.length > 0;
+        }
         function set(name,value) {
             if (params.print_data) {
                 params.print_data[name] = value;
@@ -90,28 +94,76 @@ function bib_brief_overlay(params) {
             }
         }
 
-        // Let's fetch a bib call number
-        JSAN.use('OpenILS.data');
-        var data = new OpenILS.data();
-        var label_class = data.hash.aous['cat.default_classification_scheme'];
-        if (!label_class) {
-            label_class = 1;
-        }
-        var cn_blob_array = net.simple_request('BLOB_MARC_CALLNUMBERS_RETRIEVE',[params.mvr_id, label_class]);
-        if (! cn_blob_array) { cn_blob_array = []; }
-        var tooltip_text = '';
-        for (var i = 0; i < cn_blob_array.length; i++) {
-            var cn_blob_obj = cn_blob_array[i];
-            for (var j in cn_blob_obj) {
-                tooltip_text += j + ' : ' + cn_blob_obj[j] + '\n';
+        // Let's fetch a bib call number, if the "bib_call_number" field exists
+        // in our display
+        if (exists('bib_call_number')) {
+            JSAN.use('OpenILS.data');
+            var data = new OpenILS.data();
+            var label_class = data.hash.aous[
+                'cat.default_classification_scheme'
+            ];
+            if (!label_class) {
+                label_class = 1;
             }
+            net.simple_request(
+                'BLOB_MARC_CALLNUMBERS_RETRIEVE',
+                [params.mvr_id, label_class],
+                function(req) {
+                    var cn_blob_array = req.getResultObject();
+                    if (! cn_blob_array) { cn_blob_array = []; }
+                    var tooltip_text = '';
+                    for (var i = 0; i < cn_blob_array.length; i++) {
+                        var cn_blob_obj = cn_blob_array[i];
+                        for (var j in cn_blob_obj) {
+                            tooltip_text += j + ' : ' + cn_blob_obj[j] + '\n';
+                        }
+                    }
+                    if (tooltip_text) {
+                        var cn_blob_obj = cn_blob_array[0];
+                        for (var j in cn_blob_obj) {
+                            set('bib_call_number',cn_blob_obj[j]);
+                        }
+                        set_tooltip('bib_call_number',tooltip_text);
+                    }
+                }
+            );
         }
-        if (tooltip_text) {
-            var cn_blob_obj = cn_blob_array[0];
-            for (var j in cn_blob_obj) {
-                set('bib_call_number',cn_blob_obj[j]);
-            }
-            set_tooltip('bib_call_number',tooltip_text);
+
+        // Let's fetch the hold count for the bib, if the "holds" field exists
+        // in our display
+        if (exists('holds')) {
+            net.simple_request(
+                'FM_AHR_COUNT_FOR_BRE',
+                [params.mvr_id],
+                function(req) {
+                    var hold_count = req.getResultObject();
+                    set('holds',hold_count);
+                }
+            );
+        }
+
+        // Let's fetch the item count for the bib, if the "items" field exists
+        // in our display
+        if (exists('items')) {
+            JSAN.use('OpenILS.data');
+            var data = new OpenILS.data();
+            net.simple_request(
+                'FM_ACP_COUNT.authoritative',
+                [ data.tree.aou.id(), params.mvr_id ],
+                function(req){
+                    var count_blob = req.getResultObject()[0];
+                    set('items',count_blob.count);
+                    set_tooltip(
+                        'items',
+                        $('catStrings')
+                        ? $('catStrings').getFormattedString(
+                            'staff.cat.bib_brief.items.available.tooltip',
+                            [count_blob.available]
+                        )
+                        : count_blob.available
+                    );
+                }
+            );
         }
 
     } catch(E) {
diff --git a/Open-ILS/xul/staff_client/server/locale/en-US/cat.properties b/Open-ILS/xul/staff_client/server/locale/en-US/cat.properties
index 6c4eb06..ee2912f 100644
--- a/Open-ILS/xul/staff_client/server/locale/en-US/cat.properties
+++ b/Open-ILS/xul/staff_client/server/locale/en-US/cat.properties
@@ -542,3 +542,8 @@ staff.cat.bib_brief.editor.label=Last Edited By:
 staff.cat.bib_brief.editor.accesskey=
 staff.cat.bib_brief.edit_date.label=Last Edited On:
 staff.cat.bib_brief.edit_date.accesskey=
+staff.cat.bib_brief.holds.label=Holds:
+staff.cat.bib_brief.holds.accesskey=
+staff.cat.bib_brief.items.label=Items:
+staff.cat.bib_brief.items.accesskey=
+staff.cat.bib_brief.items.available.tooltip=%1$s available

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

Summary of changes:
 .../staff_client/chrome/content/main/constants.js  |    1 +
 .../staff_client/server/cat/bib_brief_overlay.js   |   92 +++++++++++++++----
 .../server/locale/en-US/cat.properties             |    5 +
 3 files changed, 78 insertions(+), 20 deletions(-)


hooks/post-receive
-- 
Evergreen ILS


More information about the open-ils-commits mailing list