Add report on who hasn't migrated yet
[hcoop/portal.git] / users.mlt
index cd7582b..3fdf91b 100644 (file)
--- a/users.mlt
+++ b/users.mlt
@@ -17,7 +17,7 @@ if $"cmd" = "Create" then
                                          "" => Balance.addBalance ($"name")
                                        | s => Web.stoi s);
 
-                       val id = Init.addUser ($"name", $"rname", bal, ap);
+                       val id = Init.addUser ($"name", $"rname", bal, ap, 1);
                        Group.addToGroups (id, map Web.stoi (Web.getMultiParam "grp"));
 
                        if $"amount" <> "" then
@@ -74,9 +74,8 @@ elseif $"mod" <> "" then
        Init.grandfatherUsers()
        %><h3>Grandfathered</h3>
 
-<% end %>
-
-<% if showNormal then %>
+<% elseif $"cmd" = "addform" then
+        showNormal := false %>        
 <h3>New member</h3>
 
 <form action="users" method="post">
@@ -101,6 +100,29 @@ elseif $"mod" <> "" then
 </table>
 </form>
 
+<% elseif $"cmd" = "unmigrated" then
+   showNormal := false;
+   val users = Init.unmigratedUsers () %>
+
+<h3>Unmigrated members (<% length users %>)</h3>
+
+<table>
+<% foreach user in users do %>
+       <tr> <td><a href="user?id=<% #id user %>"><% Web.html (#name user) %></a></td> <td>
+<% val bal = Balance.lookupBalance (#bal user);
+if #name bal <> #name user then %>
+<i><% Web.html (#name bal) %></i>
+<% end %>
+       </td> </tr>
+<% end %>
+</table>
+
+<% end %>
+
+<% if showNormal then %>
+
+<a href="users?cmd=addform">Add a user manually</a><br>
+
 <h3>Manage current members</h3>
 
 <table>
@@ -115,6 +137,7 @@ if #name bal <> #name user then %>
 </table>
 
 <br><a href="users?cmd=grandfather">Grandfather old users to have applications</a><br>
+<a href="users?cmd=unmigrated">Who hasn't migrated yet?</a><br>
 
 <% end %>