X-Git-Url: http://git.hcoop.net/bpt/portal.git/blobdiff_plain/b340786b13dacb1070c79713ebc4eaf298d27943..64ec9551fc56c42188e195cbbe24c79ad18b293f:/location.sml diff --git a/location.sml b/location.sml index fd73de8..616fd6c 100644 --- a/location.sml +++ b/location.sml @@ -135,7 +135,7 @@ fun recordResidents () = addToParents (loc, count) end in - C.fold db folder NM.empty ($`SELECT loc, id, name, rname, bal, joined + C.fold db folder NM.empty ($`SELECT loc, id, name, rname, bal, joined, app, shares, paypal, checkout FROM Lives JOIN WebUser ON usr = id`) end @@ -172,7 +172,7 @@ fun locationTree (root, lim) = in C.fold db folder acc ($`SELECT id, parent, name FROM Location WHERE parent ^(intOptToSqlCompare root) - ORDER BY name`) + ORDER BY name DESC`) end in locationTree' (root, lim, []) @@ -207,7 +207,7 @@ fun locationTreeWithUser (root, lim, usr) = C.fold db folder acc ($`SELECT loc, id, parent, name FROM Location LEFT OUTER JOIN Lives ON (id = loc AND usr = ^(C.intToSql usr)) WHERE parent ^(intOptToSqlCompare root) - ORDER BY name`) + ORDER BY name DESC`) end in locationTree' (root, lim, []) @@ -244,7 +244,7 @@ fun locationTreeWithCounts (root, lim) = C.fold db folder acc ($`SELECT id, parent, name FROM Location WHERE parent ^(intOptToSqlCompare root) - ORDER BY name`) + ORDER BY name DESC`) end in locationTree' (root, lim, []) @@ -293,10 +293,11 @@ fun removeFromLocation (lives : lives) = end fun residentsOneLevel loc = - C.map (getDb ()) mkUserRow ($`SELECT id, name, rname, bal, joined FROM Lives, WebUser - WHERE loc = ^(C.intToSql loc) - AND usr = id - ORDER BY name`) + C.map (getDb ()) mkUserRow ($`SELECT id, name, rname, bal, joined, app, shares, paypal, checkout + FROM Lives, WebUser + WHERE loc = ^(C.intToSql loc) + AND usr = id + ORDER BY name`) fun alreadyExists (parent, name) = case C.oneRow (getDb ()) ($`SELECT COUNT( * ) FROM Location @@ -315,4 +316,4 @@ fun subLocations par = WHERE parent ^(intOptToSqlCompare par) ORDER BY name`) -end \ No newline at end of file +end