[open-ils-commits] [GIT] Evergreen ILS branch rel_2_1 updated. 8390c62d61720e1807c2fca5e4f2da82ccea0f51
Evergreen Git
git at git.evergreen-ils.org
Thu May 26 03:50:13 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, rel_2_1 has been updated
via 8390c62d61720e1807c2fca5e4f2da82ccea0f51 (commit)
from 35c47b6df891d2a88e77a29a35577b7e9a3249b2 (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 8390c62d61720e1807c2fca5e4f2da82ccea0f51
Author: Jason Etheridge <jason at esilibrary.com>
Date: Thu May 26 03:55:26 2011 -0400
Don't rely on call number column being rendered before prefix/suffix/class columns. Also, remove prefix/suffix/class from the check-in interface, since those column definitions can make extra network calls and we want that interface to be as fast as possible.
Signed-off-by: Jason Etheridge <jason at esilibrary.com>
diff --git a/Open-ILS/xul/staff_client/server/circ/checkin.js b/Open-ILS/xul/staff_client/server/circ/checkin.js
index 9a36d7e..31dd9a1 100644
--- a/Open-ILS/xul/staff_client/server/circ/checkin.js
+++ b/Open-ILS/xul/staff_client/server/circ/checkin.js
@@ -32,7 +32,7 @@ circ.checkin.prototype = {
'checkin_time' : { 'hidden' : false }
},
{
- 'except_these' : [ 'uses', 'checkin_time_full', 'call_number' ]
+ 'except_these' : [ 'uses', 'checkin_time_full', 'call_number', 'prefix', 'suffix', 'label_class' ]
}
).concat(
patron.util.columns( { 'family_name' : { 'hidden' : 'false' } } )
diff --git a/Open-ILS/xul/staff_client/server/circ/util.js b/Open-ILS/xul/staff_client/server/circ/util.js
index 9f55e4b..979bc5e 100644
--- a/Open-ILS/xul/staff_client/server/circ/util.js
+++ b/Open-ILS/xul/staff_client/server/circ/util.js
@@ -637,8 +637,47 @@ circ.util.columns = function(modify,params) {
'flex' : 1,
'primary' : false,
'hidden' : true,
- 'editable' : false, 'render' : function(my) {
- if (typeof my.acn == 'undefined') return '';
+ '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 '';
+ } 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 ];
+ }
+ }
+ }
+
+ if (typeof my.acn != 'object') return '';
return (typeof my.acn.prefix() == 'object')
? my.acn.prefix().label()
: data.lookup("acnp", my.acn.prefix() ).label();
@@ -652,8 +691,47 @@ circ.util.columns = function(modify,params) {
'flex' : 1,
'primary' : false,
'hidden' : true,
- 'editable' : false, 'render' : function(my) {
- if (typeof my.acn == 'undefined') return '';
+ '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 '';
+ } 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 ];
+ }
+ }
+ }
+
+ if (typeof my.acn != 'object') return '';
return (typeof my.acn.suffix() == 'object')
? my.acn.suffix().label()
: data.lookup("acns", my.acn.suffix() ).label();
@@ -667,8 +745,47 @@ circ.util.columns = function(modify,params) {
'flex' : 1,
'primary' : false,
'hidden' : true,
- 'editable' : false, 'render' : function(my) {
- if (typeof my.acn == 'undefined') return '';
+ '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 '';
+ } 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 ];
+ }
+ }
+ }
+
+ if (typeof my.acn != 'object') return '';
return (typeof my.acn.label_class() == 'object') ? my.acn.label_class().name() : my.acn.label_class();
},
'persist' : 'hidden width ordinal'
-----------------------------------------------------------------------
Summary of changes:
Open-ILS/xul/staff_client/server/circ/checkin.js | 2 +-
Open-ILS/xul/staff_client/server/circ/util.js | 129 +++++++++++++++++++++-
2 files changed, 124 insertions(+), 7 deletions(-)
hooks/post-receive
--
Evergreen ILS
More information about the open-ils-commits
mailing list