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

Evergreen Git git at git.evergreen-ils.org
Fri Jun 24 19:18:32 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  bbf03b1937f4a60758f0538f145a1a08921eda78 (commit)
       via  ca161469259582e86544dcb4c176b9d8dca47a3c (commit)
      from  e030096a394f6fce5de809d395423f9f8e82bd25 (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 bbf03b1937f4a60758f0538f145a1a08921eda78
Author: Jason Etheridge <jason at esilibrary.com>
Date:   Tue May 31 15:46:50 2011 -0400

    Specify the display field for linked objects with fm_columns
    
    If a display field isn't specified, it defaults to the key field,
    which is essentially the same as not fleshing the object in the first
    place.  Let me know if fieldmapper has or gains a way of specifying
    such "display" fields, and we can augment fm_columns to use it as well.
    
    Signed-off-by: Jason Etheridge <jason at esilibrary.com>
    Signed-off-by: Dan Scott <dan at coffeecode.net>

diff --git a/Open-ILS/xul/staff_client/server/patron/search_result.js b/Open-ILS/xul/staff_client/server/patron/search_result.js
index fadbb68..5099ce8 100644
--- a/Open-ILS/xul/staff_client/server/patron/search_result.js
+++ b/Open-ILS/xul/staff_client/server/patron/search_result.js
@@ -36,7 +36,10 @@ patron.search_result.prototype = {
             'au_family_name' : { 'hidden' : false },
             'au_first_given_name' : { 'hidden' : false },
             'au_second_given_name' : { 'hidden' : false },
-            'au_dob' : { 'hidden' : false }
+            'au_dob' : { 'hidden' : false },
+            'au_profile' : { 'fleshed_display_field' : 'name' },
+            'au_ident_type' : { 'fleshed_display_field' : 'name' },
+            'au_ident_type2' : { 'fleshed_display_field' : 'name' }
         }).concat(
             obj.list.fm_columns('ac',{
                 '*' : { 'remove_virtual' : true, 'expanded_label' : true, 'hidden' : true },

commit ca161469259582e86544dcb4c176b9d8dca47a3c
Author: Jason Etheridge <jason at esilibrary.com>
Date:   Tue May 31 15:45:25 2011 -0400

    Let fm_columns use cached data.hash objects for linked fields
    
    Signed-off-by: Jason Etheridge <jason at esilibrary.com>
    Signed-off-by: Dan Scott <dan at coffeecode.net>

diff --git a/Open-ILS/xul/staff_client/chrome/content/util/list.js b/Open-ILS/xul/staff_client/chrome/content/util/list.js
index 1edabec..a125c4d 100644
--- a/Open-ILS/xul/staff_client/chrome/content/util/list.js
+++ b/Open-ILS/xul/staff_client/chrome/content/util/list.js
@@ -1716,6 +1716,7 @@ util.list.prototype = {
                 var col_id = prefix + hint + '_' + my_field.name;
                 var dataobj = hint;
                 var datafield = my_field.name;
+                var fleshed_display_field;
                 if (column_extras) {
                     if (column_extras['*']) {
                         if (column_extras['*']['dataobj']) {
@@ -1729,6 +1730,9 @@ util.list.prototype = {
                         if (column_extras[col_id]['datafield']) {
                             datafield = column_extras[col_id]['datafield'];
                         }
+                        if (column_extras[col_id]['fleshed_display_field']) {
+                            fleshed_display_field = column_extras[col_id]['fleshed_display_field'];
+                        }
                     }
                 }
                 var def = {
@@ -1743,7 +1747,24 @@ util.list.prototype = {
                 // my_field.datatype => bool float id int interval link money number org_unit text timestamp
                 if (my_field.datatype == 'link') {
                     def.render = function(my) { 
-                        return typeof my[dataobj][datafield]() == 'object' ? my[dataobj][datafield]()[my_field.key]() : my[dataobj][datafield](); 
+                        // is the object fleshed?
+                        return my[dataobj][datafield]() && typeof my[dataobj][datafield]() == 'object'
+                            // yes, show the display field
+                            ? my[dataobj][datafield]()[fleshed_display_field||my_field.key]()
+                            // no, do we have its class in data.hash?
+                            : ( typeof data.hash[ my[dataobj].Structure.field_map[datafield].class ] != 'undefined'
+                                // yes, do we have this particular object cached?
+                                ? ( data.hash[ my[dataobj].Structure.field_map[datafield].class ][ my[dataobj][datafield]() ]
+                                    // yes, show the display field
+                                    ? data.hash[ my[dataobj].Structure.field_map[datafield].class ][ my[dataobj][datafield]() ][
+                                        fleshed_display_field||my_field.key
+                                    ]()
+                                    // no, just show the raw value
+                                    : my[dataobj][datafield]()
+                                )
+                                // no, just show the raw value
+                                : my[dataobj][datafield]()
+                            ); 
                     }
                 } else {
                     def.render = function(my) { return my[dataobj][datafield](); }

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

Summary of changes:
 .../xul/staff_client/chrome/content/util/list.js   |   23 +++++++++++++++++++-
 .../staff_client/server/patron/search_result.js    |    5 +++-
 2 files changed, 26 insertions(+), 2 deletions(-)


hooks/post-receive
-- 
Evergreen ILS


More information about the open-ils-commits mailing list