[open-ils-commits] r18223 - branches/rel_2_0/Open-ILS/web/opac/extras/circ (senator)
svn at svn.open-ils.org
svn at svn.open-ils.org
Thu Oct 7 13:19:49 EDT 2010
Author: senator
Date: 2010-10-07 13:19:45 -0400 (Thu, 07 Oct 2010)
New Revision: 18223
Modified:
branches/rel_2_0/Open-ILS/web/opac/extras/circ/alt_holds_print.html
Log:
Backport r18222 from trunk: reasonable default sorting for expired holds list
Modified: branches/rel_2_0/Open-ILS/web/opac/extras/circ/alt_holds_print.html
===================================================================
--- branches/rel_2_0/Open-ILS/web/opac/extras/circ/alt_holds_print.html 2010-10-07 17:18:58 UTC (rev 18222)
+++ branches/rel_2_0/Open-ILS/web/opac/extras/circ/alt_holds_print.html 2010-10-07 17:19:45 UTC (rev 18223)
@@ -111,10 +111,25 @@
);
}
+ function place_by_sortkey(node, container) {
+ /*Don't use a forEach() or anything like that here. too slow.*/
+ var sortkey = dojo.attr(node, "sortkey");
+ for (var i = 0; i < container.childNodes.length; i++) {
+ var rover = container.childNodes[i];
+ if (rover.nodeType != 1) continue;
+ if (dojo.attr(rover, "sortkey") > sortkey) {
+ dojo.place(node, rover, "before");
+ return;
+ }
+ }
+ dojo.place(node, container, "last");
+ }
+
function do_shelf_expired_holds(user, cgi) {
progress_dialog.show(true);
var any = false;
+ var target = dojo.byId("target");
fieldmapper.standardRequest(
["open-ils.circ",
"open-ils.circ.captured_holds.expired.print.stream"], {
@@ -174,7 +189,10 @@
"delay": false
});
- dojo.place(tr, "target");
+ dojo.attr(
+ tr, "sortkey", hold.usr.display_name
+ );
+ place_by_sortkey(tr, target);
}
);
},
More information about the open-ils-commits
mailing list