[open-ils-commits] r18222 - trunk/Open-ILS/web/opac/extras/circ (senator)
svn at svn.open-ils.org
svn at svn.open-ils.org
Thu Oct 7 13:19:02 EDT 2010
Author: senator
Date: 2010-10-07 13:18:58 -0400 (Thu, 07 Oct 2010)
New Revision: 18222
Modified:
trunk/Open-ILS/web/opac/extras/circ/alt_holds_print.html
Log:
Add some reasonable default sorting to this expired holds list
Modified: trunk/Open-ILS/web/opac/extras/circ/alt_holds_print.html
===================================================================
--- trunk/Open-ILS/web/opac/extras/circ/alt_holds_print.html 2010-10-07 15:16:12 UTC (rev 18221)
+++ trunk/Open-ILS/web/opac/extras/circ/alt_holds_print.html 2010-10-07 17:18:58 UTC (rev 18222)
@@ -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