noncat display and sorting
authorpines <pines@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Fri, 1 Sep 2006 16:23:39 +0000 (16:23 +0000)
committerpines <pines@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Fri, 1 Sep 2006 16:23:39 +0000 (16:23 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/trunk@5835 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/xul/staff_client/server/circ/in_house_use.js
Open-ILS/xul/staff_client/server/main/gen_offline_widgets.xul

index 14d4b65..7fb7482 100644 (file)
@@ -60,11 +60,25 @@ circ.in_house_use.prototype = {
                                                                                        function(o) {
                                                                                                return util.fm_utils.compare_aou_a_is_b_or_ancestor(o.owning_lib(), obj.data.list.au[0].ws_ou());
                                                                                        }
+                                                                               ).sort(
+
+                                                                                       function(a,b) {
+                                                                                               try { 
+                                                                                                       return util.fm_utils.sort_func_aou_by_depth_and_then_string(
+                                                                                                               [ a.owning_lib(), a.name() ],
+                                                                                                               [ b.owning_lib(), b.name() ]
+                                                                                                       );
+                                                                                               } catch(E) {
+                                                                                                       alert('error in noncat sorting: ' + E);
+                                                                                                       return 0;
+                                                                                               }
+                                                                                       }
+
                                                                                ),
                                                                                function(o) {
-                                                                                       return [ o.name(), o.id() ];
+                                                                                       return [ obj.data.hash.aou[ o.owning_lib() ].shortname() + ' : ' + o.name(), o.id() ];
                                                                                }
-                                                                       ).sort()
+                                                                       )
                                                                );
                                                                g.error.sdump('D_TRACE','items = ' + js2JSON(items));
                                                                util.widgets.remove_children( e );
index b23e66d..3807886 100644 (file)
                }
 
                function build_cnct_list() {
+                       JSAN.use('util.fm_utils');
                        return [
-                               util.functional.map_list( 
-                                       g.data.list.cnct,
-                                       function(obj) { return [ 
-                                               obj.name(), 
-                                               js2JSON( [ obj.id(), obj.circ_duration() ] )
-                                       ]; }
+                               util.functional.map_list(
+                                       util.functional.filter_list(
+                                               g.data.list.cnct,
+                                               function(o) {
+                                                       return util.fm_utils.compare_aou_a_is_b_or_ancestor(o.owning_lib(), g.data.list.au[0].ws_ou());
+                                               }
+                                       ).sort(
+
+                                               function(a,b) {
+                                                       try { 
+                                                               return util.fm_utils.sort_func_aou_by_depth_and_then_string(
+                                                                       [ a.owning_lib(), a.name() ],
+                                                                       [ b.owning_lib(), b.name() ]
+                                                               );
+                                                       } catch(E) {
+                                                               alert('error in noncat sorting: ' + E);
+                                                               return 0;
+                                                       }
+                                               }
+
+                                       ),
+                                       function(o) {
+                                               return [ g.data.hash.aou[ o.owning_lib() ].shortname() + ' : ' + o.name(), js2JSON( [ o.id(), o.circ_duration() ] ) ];
+                                       }
                                )
                        ];
                }