[open-ils-commits] [GIT] Evergreen ILS branch rel_2_5 updated. d25029ef179856810b79fd4bafc971ae27f1376d

Evergreen Git git at git.evergreen-ils.org
Tue Aug 26 21:49:01 EDT 2014


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_5 has been updated
       via  d25029ef179856810b79fd4bafc971ae27f1376d (commit)
       via  0dadd7a8436bd4ad961535529c5f14c116496ffa (commit)
       via  f0f6fb38b898f41a80e3e3356091f1764a71f8c9 (commit)
      from  14ba95775bd15bc3b10fff2b0d590c2c9880f995 (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 d25029ef179856810b79fd4bafc971ae27f1376d
Author: Kathy Lussier <klussier at masslnc.org>
Date:   Tue Aug 19 14:29:56 2014 -0400

    lp1182605 Add sort value for holds interfaces
    
    Holds interfaces were still sorting incorrectly, so let's add a sort value
    there.
    
    Signed-off-by: Kathy Lussier <klussier at masslnc.org>
    Signed-off-by: Remington Steed <rjs7 at calvin.edu>
    Signed-off-by: Dan Wells <dbw2 at calvin.edu>

diff --git a/Open-ILS/xul/staff_client/server/circ/util.js b/Open-ILS/xul/staff_client/server/circ/util.js
index 043c1af..736aad5 100644
--- a/Open-ILS/xul/staff_client/server/circ/util.js
+++ b/Open-ILS/xul/staff_client/server/circ/util.js
@@ -2452,10 +2452,14 @@ circ.util.hold_columns = function(modify,params) {
             'flex' : 1,
             'primary' : false,
             'hidden' : true,
+	    'sort_value' : function(my,scratch_data) {
+	                        var result_label = "label_sortkey";
+				return sort_call_numbers_by_label_sortkey(my,scratch_data, result_label);
+		       },
             'editable' : false, 'render' : function(my,scratch_data) {
 				var result_label = "render_label";
 				return sort_call_numbers_by_label_sortkey(my, scratch_data, result_label);
-			   } 
+			} 
         },
         {
             'id' : 'prefix',

commit 0dadd7a8436bd4ad961535529c5f14c116496ffa
Author: Victoria Lewis <vcamklewis at gmail.com>
Date:   Wed Apr 30 15:09:07 2014 -0700

    lp1182605 Abstracting out common functionality from code that sorts call numbers by label_sortkey
    
    Code had been added to insure that LC call numbers are sorting as they should by asset.call_number.label_sortkey.
    Code was duplicated in the 'call_number column' in the 'columns' group and in the 'hold_columns'group.
    
    I abstracted the logic out of 'sort_value' and 'render' in the 'call_number' column in the 'columns' group and from
    'render' in the 'call_number' column in the 'hold_columns' group to a utility function  called
    'sort_call_numbers_by_label_sortkey'.
    
    Signed-off-by: Victoria Lewis <vcamklewis at gmail.com>
    
    modified:   xul/staff_client/server/circ/util.js
    Signed-off-by: Kathy Lussier <klussier at masslnc.org>
    Signed-off-by: Remington Steed <rjs7 at calvin.edu>
    Signed-off-by: Dan Wells <dbw2 at calvin.edu>

diff --git a/Open-ILS/xul/staff_client/server/circ/util.js b/Open-ILS/xul/staff_client/server/circ/util.js
index 0420116..043c1af 100644
--- a/Open-ILS/xul/staff_client/server/circ/util.js
+++ b/Open-ILS/xul/staff_client/server/circ/util.js
@@ -566,93 +566,16 @@ circ.util.columns = function(modify,params) {
             'primary' : false,
             'hidden' : true,
             'sort_value' : 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' && my.acp.call_number() != null) {
-                        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 == 'undefined' || scratch_data == null) {
-                            scratch_data = {};
-                        }
-                        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_sortkey();
-                }
-            },
+				var result_label = "label_sortkey";
+				return sort_call_numbers_by_label_sortkey(my, scratch_data, result_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' && my.acp.call_number() != null) {
-                        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 == 'undefined' || scratch_data == null) {
-                            scratch_data = {};
-                        }
-                        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();
-                }
-            }
+				
+				var result_label = "render_label";
+				return sort_call_numbers_by_label_sortkey(my, scratch_data, result_label);
+			}  
+
         },
         {
             'id' : 'owning_lib',
@@ -2530,49 +2453,9 @@ circ.util.hold_columns = function(modify,params) {
             'primary' : false,
             'hidden' : true,
             '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' && my.acp.call_number() != null) {
-                        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 == 'undefined' || scratch_data == null) {
-                            scratch_data = {};
-                        }
-                        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();
-                }
-            }
+				var result_label = "render_label";
+				return sort_call_numbers_by_label_sortkey(my, scratch_data, result_label);
+			   } 
         },
         {
             'id' : 'prefix',
@@ -3966,4 +3849,57 @@ circ.util.find_acq_po = function(session, copy_id) {
     );
 };
 
+
+function  sort_call_numbers_by_label_sortkey(my, scratch_data, result_label){
+				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' && my.acp.call_number() != null) {
+                        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 == 'undefined' || scratch_data == null) {
+                            scratch_data = {};
+                        }
+                        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(result_label == "label_sortkey"){
+						return my.acn.label_sortkey();
+					}
+					else if(result_label == "render_label"){
+						return my.acn.label();
+					}
+                }
+            }; 
+
+
 dump('exiting circ/util.js\n');

commit f0f6fb38b898f41a80e3e3356091f1764a71f8c9
Author: Kyle Tomita <tomitakyle at gmail.com>
Date:   Mon Dec 2 15:50:17 2013 -0800

    LP1182605 : LC call numbers sort improperly in tabular displays
    
    The issue was that the column was sorting on the label (call number)
    and not label_sortkey.  An attribute 'sort_value' was added that used
    label_sortkey.
    
    Signed-off-by: Kyle Tomita <tomitakyle at gmail.com>
    
    modified:   Open-ILS/xul/staff_client/server/circ/util.js
    (cherry picked from commit 696ce9e6c36bffd1d8c884baab2f5d36687e741b)
    
    Signed-off-by: Victoria Lewis <vcamklewis at gmail.com>
    Signed-off-by: Kathy Lussier <klussier at masslnc.org>
    Signed-off-by: Remington Steed <rjs7 at calvin.edu>
    Signed-off-by: Dan Wells <dbw2 at calvin.edu>

diff --git a/Open-ILS/xul/staff_client/server/circ/util.js b/Open-ILS/xul/staff_client/server/circ/util.js
index 67472c4..0420116 100644
--- a/Open-ILS/xul/staff_client/server/circ/util.js
+++ b/Open-ILS/xul/staff_client/server/circ/util.js
@@ -565,6 +565,50 @@ circ.util.columns = function(modify,params) {
             'flex' : 1,
             'primary' : false,
             'hidden' : true,
+            'sort_value' : 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' && my.acp.call_number() != null) {
+                        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 == 'undefined' || scratch_data == null) {
+                            scratch_data = {};
+                        }
+                        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_sortkey();
+                }
+            },
             'editable' : false, 'render' : function(my,scratch_data) {
                 var acn_id;
                 if (my.acn) {

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

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


hooks/post-receive
-- 
Evergreen ILS


More information about the open-ils-commits mailing list