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

Evergreen Git git at git.evergreen-ils.org
Thu May 19 22:18:24 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  0512432770a4bec4526a7094d79b14a53eb13c71 (commit)
      from  b60c8641e4ad2cf2db2056c9bc155f23ee4bdad9 (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 0512432770a4bec4526a7094d79b14a53eb13c71
Author: Jason Etheridge <jason at esilibrary.com>
Date:   Thu May 19 22:25:16 2011 -0400

    CN prefix/suffix columns in xul-based hold interfaces
    
    Signed-off-by: Jason Etheridge <jason at esilibrary.com>

diff --git a/Open-ILS/xul/staff_client/server/circ/util.js b/Open-ILS/xul/staff_client/server/circ/util.js
index 32f3a60..f3c1e04 100644
--- a/Open-ILS/xul/staff_client/server/circ/util.js
+++ b/Open-ILS/xul/staff_client/server/circ/util.js
@@ -2217,15 +2217,86 @@ circ.util.hold_columns = function(modify,params) {
             'editable' : false, 'render' : function(my) { return my.patron_first_given_name ? my.patron_first_given_name : ""; }
         },
         {
-            'persist' : 'hidden width ordinal',
             'id' : 'callnumber',
-            'label' : document.getElementById('circStrings').getString('staff.circ.utils.callnumber'),
+            'fm_class' : 'acp',
+            'label' : document.getElementById('commonStrings').getString('staff.acp_label_call_number'),
             'flex' : 1,
             'primary' : false,
             'hidden' : true,
-            'editable' : false, 'render' : function(my) { return my.acn.label(); }
+            'editable' : false, 'render' : function(my,scratch_data) {
+                var acn_id;
+                if (my.acn) {
+                    if (typeof my.acn == 'object') {
+                        acn_id = my.acn.id();
+                    } else {
+                        acn_id = my.acn;
+                    }
+                } else if (my.acp) {
+                    if (typeof my.acp.call_number() == 'object') {
+                        acn_id = my.acp.call_number().id();
+                    } else {
+                        acn_id = my.acp.call_number();
+                    }
+                }
+                if (!acn_id && acn_id != 0) {
+                    return '';
+                } else if (acn_id == -1) {
+                    return document.getElementById('circStrings').getString('staff.circ.utils.not_cataloged');
+                } else if (acn_id == -2) {
+                    return document.getElementById('circStrings').getString('staff.circ.utils.retrieving');
+                } else {
+                    if (!my.acn) {
+                        if (typeof scratch_data['acn_map'] == 'undefined') {
+                            scratch_data['acn_map'] = {};
+                        }
+                        if (typeof scratch_data['acn_map'][ acn_id ] == 'undefined') {
+                            var x = network.simple_request("FM_ACN_RETRIEVE.authoritative",[ acn_id ]);
+                            if (x.ilsevent) {
+                                return document.getElementById('circStrings').getString('staff.circ.utils.not_cataloged');
+                            } else {
+                                my.acn = x;
+                                scratch_data['acn_map'][ acn_id ] = my.acn;
+                            }
+                        } else {
+                            my.acn = scratch_data['acn_map'][ acn_id ];
+                        }
+                    }
+                    return my.acn.label();
+                }
+            },
+            'persist' : 'hidden width ordinal'
         },
-                {
+        {
+            'id' : 'prefix',
+            'fm_class' : 'acn',
+            'label' : document.getElementById('circStrings').getString('staff.circ.utils.prefix'),
+            'flex' : 1,
+            'primary' : false,
+            'hidden' : true,
+            'editable' : false, 'render' : function(my) {
+                if (typeof my.acn == 'undefined') return '';
+                return (typeof my.acn.prefix() == 'object')
+                    ? my.acn.prefix().label()
+                    : data.lookup("acnp", my.acn.prefix() ).label();
+            },
+            'persist' : 'hidden width ordinal'
+        },
+        {
+            'id' : 'suffix',
+            'fm_class' : 'acn',
+            'label' : document.getElementById('circStrings').getString('staff.circ.utils.suffix'),
+            'flex' : 1,
+            'primary' : false,
+            'hidden' : true,
+            'editable' : false, 'render' : function(my) {
+                if (typeof my.acn == 'undefined') return '';
+                return (typeof my.acn.suffix() == 'object')
+                    ? my.acn.suffix().label()
+                    : data.lookup("acns", my.acn.suffix() ).label();
+            },
+            'persist' : 'hidden width ordinal'
+        },
+        {
             'persist' : 'hidden width ordinal',
             'id' : 'total_holds',
             'label' : document.getElementById('circStrings').getString('staff.circ.utils.total_holds'),

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

Summary of changes:
 Open-ILS/xul/staff_client/server/circ/util.js |   79 +++++++++++++++++++++++-
 1 files changed, 75 insertions(+), 4 deletions(-)


hooks/post-receive
-- 
Evergreen ILS


More information about the open-ils-commits mailing list