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

Evergreen Git git at git.evergreen-ils.org
Thu Dec 22 10:26:24 EST 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  be003fdfc99174e951e117d30d968919be073fe8 (commit)
       via  0f7bab7be9b762600b6801dee4e8d7cef3b6b468 (commit)
      from  b68d391e7f60162551443d10b99f343039e271ee (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 be003fdfc99174e951e117d30d968919be073fe8
Author: Bill Erickson <berick at esilibrary.com>
Date:   Thu Dec 22 10:13:03 2011 -0500

    SVF in bib record summary: extract attrs on the server
    
    This repairs a FIXME within the custom bib overlay code related to
    parsing metabib.record_attr stores within the JS.  Instead, now we use
    an attr parsing utility function which compiles a regular hash so the
    client no longer needs to parse it.
    
    Signed-off-by: Bill Erickson <berick at esilibrary.com>

diff --git a/Open-ILS/src/perlmods/lib/OpenILS/Application/Cat.pm b/Open-ILS/src/perlmods/lib/OpenILS/Application/Cat.pm
index 6a9ee33..a018e3f 100644
--- a/Open-ILS/src/perlmods/lib/OpenILS/Application/Cat.pm
+++ b/Open-ILS/src/perlmods/lib/OpenILS/Application/Cat.pm
@@ -448,7 +448,7 @@ sub biblio_record_record_metadata {
             my $rec = $editor->retrieve_biblio_record_entry($_);
         $rec->creator($editor->retrieve_actor_user($rec->creator));
         $rec->editor($editor->retrieve_actor_user($rec->editor));
-        $rec->attrs($editor->retrieve_metabib_record_attr($rec->id));
+        $rec->attrs($U->get_bre_attrs([$rec->id], $editor)->{$rec->id});
         $rec->clear_marc; # slim the record down
         push( @results, $rec );
     }
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 f939e68..de791b1 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
@@ -97,16 +97,10 @@ function bib_brief_overlay(params) {
         // Let's loop through bre.attrs.attrs and put them with any matching
         // elements in bib_brief_overlay.xul
         if (params.bre.attrs()) {
-            // FIXME -- we should do this in the perl; what's below isn't robust
-            var attrs = JSON2js(
-                '{' +
-                params.bre.attrs().attrs().replace(
-                    '=>',':','g').replace('NULL','null','g')
-                + '}'
-            );
+            var attrs = params.bre.attrs();
             for (var attr in attrs) {
                 if (exists(attr)) {
-                    set(attr,attrs[attr]);
+                    set(attr,attrs[attr].code);
                     set_tooltip(attr,attr);
                 }
             }

commit 0f7bab7be9b762600b6801dee4e8d7cef3b6b468
Author: Jason Etheridge <jason at esilibrary.com>
Date:   Thu Dec 8 17:48:42 2011 -0500

    support SVF in staff client bib record summary
    
    This is in support of https://bugs.launchpad.net/evergreen/+bug/822928, re: Cat Date
    
    So for example, let's suppose you want to store a "Cat Date" in MARC tag 915, subfield a.
    
    You could do this in the database:
    
    INSERT INTO config.record_attr_definition (name,label,filter,sorter,tag,sf_list)
        VALUES ( 'cat_date', 'Cat Date', 'f', 't', '915', 'd' );
    
    Add this to server/locale/en-US/cat_custom.properties (optional but recommended):
    
    staff.cat.bib_brief.cat_date.label=Cat Date:
    staff.cat.bib_brief.cat_date.accesskey=
    
    And then add something like this to server/skin/custom.js:
    
        try {
    
            netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
            var prefs = Components.classes['@mozilla.org/preferences-service;1'].getService(Components.interfaces['nsIPrefBranch']);
    
            prefs.setCharPref(
                'oils.bib_brief.horizontal.dynamic_grid_replacement.data',
                js2JSON([
                    ["title",           "edition",  "editor",       "cat_date"],
                    ["author",          "pubdate",  "edit_date",    "holds"],
                    ["bib_call_number", "tcn",      "create_date",  "items"]
                ])
            );
    
            prefs.setCharPref(
                'oils.bib_brief.alternate_copy_summary.dynamic_grid_replacement.data',
                js2JSON([
                    ["title",       "edition",  "editor",       "cat_date"],
                    ["author",      "pubdate",  "edit_date",    "holds"],
                    ["call_number", "tcn",      "create_date",  "items"]
                ])
            );
    
        } catch(E) {
            dump('Error in custom.js trying to set oils.bib_brief.*.dynamic_grid_replacement.data: ' + E + '\n');
        }
    
    Finally, re-ingest any records with tag 915d (you can simply edit the MARC via
    the MARC Editor for a specific record, or if the ingest.reingest.force_on_same_marc
    row in config.internal_flag is enabled and you're not doing this during library
    hours, you can re-ingest all records with UPDATE biblio.record_entry SET marc = marc;)
    
    Signed-off-by: Jason Etheridge <jason at esilibrary.com>
    Signed-off-by: Bill Erickson <berick at esilibrary.com>

diff --git a/Open-ILS/src/perlmods/lib/OpenILS/Application/Cat.pm b/Open-ILS/src/perlmods/lib/OpenILS/Application/Cat.pm
index 8e311f6..6a9ee33 100644
--- a/Open-ILS/src/perlmods/lib/OpenILS/Application/Cat.pm
+++ b/Open-ILS/src/perlmods/lib/OpenILS/Application/Cat.pm
@@ -427,9 +427,9 @@ __PACKAGE__->register_method(
     method        => "biblio_record_record_metadata",
     api_name      => "open-ils.cat.biblio.record.metadata.retrieve",
     authoritative => 1,
-    argc          => 1, #(session_id, biblio_tree ) 
-    notes         => "Walks the tree and commits any changed nodes " .
-                     "adds any new nodes, and deletes any deleted nodes",
+    argc          => 2, #(session_id, list of bre ids )
+    notes         => "Returns a list of slim-downed bre objects based on the " .
+                     "ids passed in",
 );
 
 sub biblio_record_record_metadata {
@@ -448,6 +448,7 @@ sub biblio_record_record_metadata {
             my $rec = $editor->retrieve_biblio_record_entry($_);
         $rec->creator($editor->retrieve_actor_user($rec->creator));
         $rec->editor($editor->retrieve_actor_user($rec->editor));
+        $rec->attrs($editor->retrieve_metabib_record_attr($rec->id));
         $rec->clear_marc; # slim the record down
         push( @results, $rec );
     }
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 bc6d784..f939e68 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
@@ -94,6 +94,24 @@ function bib_brief_overlay(params) {
             }
         }
 
+        // Let's loop through bre.attrs.attrs and put them with any matching
+        // elements in bib_brief_overlay.xul
+        if (params.bre.attrs()) {
+            // FIXME -- we should do this in the perl; what's below isn't robust
+            var attrs = JSON2js(
+                '{' +
+                params.bre.attrs().attrs().replace(
+                    '=>',':','g').replace('NULL','null','g')
+                + '}'
+            );
+            for (var attr in attrs) {
+                if (exists(attr)) {
+                    set(attr,attrs[attr]);
+                    set_tooltip(attr,attr);
+                }
+            }
+        }
+
         // Let's fetch a bib call number, if the "bib_call_number" field exists
         // in our display
         if (exists('bib_call_number')) {

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

Summary of changes:
 .../src/perlmods/lib/OpenILS/Application/Cat.pm    |    7 ++++---
 .../staff_client/server/cat/bib_brief_overlay.js   |   12 ++++++++++++
 2 files changed, 16 insertions(+), 3 deletions(-)


hooks/post-receive
-- 
Evergreen ILS


More information about the open-ils-commits mailing list