[open-ils-commits] r14014 - trunk/Open-ILS/xul/staff_client/server/cat (phasefx)
svn at svn.open-ils.org
svn at svn.open-ils.org
Sun Sep 13 11:08:22 EDT 2009
Author: phasefx
Date: 2009-09-13 11:08:19 -0400 (Sun, 13 Sep 2009)
New Revision: 14014
Modified:
trunk/Open-ILS/xul/staff_client/server/cat/z3950.js
Log:
Patch from Warren Layton for asciibetical ordering of services in z39.50 client. Native Catalog always goes to the top. Thanks!
---
The attached patch presents the Z39.50 targets in the Staff Client in
alphabetical order - a problem for us because we're starting to have
quite a few configured.
I'm not sure if this is the most elegant solution so feedback is
definitely welcome.
Cheers,
Warren
Modified: trunk/Open-ILS/xul/staff_client/server/cat/z3950.js
===================================================================
--- trunk/Open-ILS/xul/staff_client/server/cat/z3950.js 2009-09-13 02:26:10 UTC (rev 14013)
+++ trunk/Open-ILS/xul/staff_client/server/cat/z3950.js 2009-09-13 15:08:19 UTC (rev 14014)
@@ -345,18 +345,27 @@
if (typeof robj.ilsevent != 'undefined') throw(robj);
obj.services = robj;
var x = document.getElementById('service_rows');
- for (var i in obj.services) {
+ var services = new Array();
+ for (var i in obj.services) {
+ var label;
+ if (obj.services[i].label) {
+ label = obj.services[i].label;
+ } else if (obj.services[i].name) {
+ label = obj.services[i].name;
+ } else {
+ label = i;
+ }
+ var j = [label, i];
+ services.push(j);
+ }
+ services.sort();
+ for (var j=0; j < services.length; j++) {
+ var i = services[j][1];
try {
if (i == 'native-evergreen-catalog') continue;
var r = document.createElement('row'); x.appendChild(r);
var cb = document.createElement('checkbox');
- if (obj.services[i].label) {
- cb.setAttribute('label',obj.services[i].label);
- } else if (obj.services[i].name) {
- cb.setAttribute('label',obj.services[i].name);
- } else {
- cb.setAttribute('label',i);
- }
+ cb.setAttribute('label',services[j][0]);
cb.setAttribute('tooltiptext',i + ' : ' + obj.services[i].db + '@' + obj.services[i].host + ':' + obj.services[i].port);
cb.setAttribute('mytype','service_class'); cb.setAttribute('service',i);
cb.setAttribute('id',i+'_service'); r.appendChild(cb);
More information about the open-ils-commits
mailing list