contact: fix build
[hcoop/portal.git] / pref.mlt
index 0f908d6..b457c3d 100644 (file)
--- a/pref.mlt
+++ b/pref.mlt
@@ -1,10 +1,17 @@
 <% val you = Init.getUserId ();
+
 val yourname = Init.getUserName ();
 val youremail = yourname ^ "@hcoop.net";
 
 @header [("title", ["Member preferences"])];
 
 if $"cmd" = "mod" then
+       val you_all = Init.getUser ();
+
+       Init.modUser {you_all with
+         paypal = (case $"paypal" of "" => NONE | s => SOME s),
+         checkout = (case $"checkout" of "" => NONE | s => SOME s)};
+
        if $"dir" = "on" then
                Pref.setDirectory you
        else
@@ -15,25 +22,46 @@ if $"cmd" = "mod" then
                        Pref.subscribe ("hcoop-discuss", youremail)
                    else
                        Pref.unsubscribe ("hcoop-discuss", youremail)) then
-               %><h3><b>Error setting <tt>hcoop-discuss</tt> status</b></h3><%
+               %><h3>Error setting <tt>hcoop-discuss</tt> status</h3><%
+       end;
+
+       if not (iff $"help" = "on" then
+                       Pref.subscribe ("hcoop-help", youremail)
+                   else
+                       Pref.unsubscribe ("hcoop-help", youremail)) then
+               %><h3>Error setting <tt>hcoop-help</tt> status</h3><%
        end;
 
        if not (iff $"misc" = "on" then
                        Pref.subscribe ("hcoop-misc", youremail)
                    else
                        Pref.unsubscribe ("hcoop-misc", youremail)) then
-               %><h3><b>Error setting <tt>hcoop-misc</tt> status</b></h3><%
+               %><h3>Error setting <tt>hcoop-misc</tt> status</h3><%
        end;
 
-       %><h3><b>Preferences updated</b></h3><%
-end %>
+       if not (iff $"sysadmin" = "on" then
+                       Pref.subscribe ("hcoop-sysadmin", youremail)
+                   else
+                       Pref.unsubscribe ("hcoop-sysadmin", youremail)) then
+               %><h3>Error setting <tt>hcoop-sysadmin</tt> status</h3><%
+       end;
+
+       %><h3>Preferences updated</h3><%
+end;
+
+val you_all = Init.lookupUser you %>
 
-<form action="pref">
+<form action="pref" method="post">
 <input type="hidden" name="cmd" value="mod">
-<table>
-<tr> <td align="right"><input type="checkbox" name="dir"<% if Pref.hasDirectory you then %> checked<% end %>></td> <td>Include me in the public member directory.</td> </tr>
-<tr> <td align="right"><input type="checkbox" name="discuss"<% if Pref.subscribed ("hcoop-discuss", youremail) then %> checked<% end %>></td> <td>Include me on the <tt>hcoop-discuss</tt> mailing list. <i>(On-topic discussion and sporadically high volume)</i></td> </tr>
-<tr> <td align="right"><input type="checkbox" name="misc"<% if Pref.subscribed ("hcoop-misc", youremail) then %> checked<% end %>></td> <td>Include me on the <tt>hcoop-misc</tt> mailing list. <i>(Off-topic)</i></td> </tr>
+<table class="blanks">
+<tr> <td><a href="http://www.paypal.com/">PayPal</a> e-mail address:</td> <td><input name="paypal" size="60" value="<% switch #paypal you_all of NONE => "" | SOME s => s end %>"></td> </tr>
+<tr> <td colspan="2" style="font-weight: normal; text-align: left">(E-mail addresses you enter here should match those seen by recipients of payments that you send.)</td> </tr>
+<tr></tr>
+<tr> <td><input type="checkbox" name="dir"<% if Pref.hasDirectory you then %> checked<% end %>></td> <td>Include me in the public member directory.</td> </tr>
+<tr> <td><input type="checkbox" name="discuss"<% if Pref.subscribed ("hcoop-discuss", youremail) then %> checked<% end %>></td> <td>Include me on the <tt>hcoop-discuss</tt> mailing list. <i>(On-topic discussion and sporadically high volume)</i></td> </tr>
+<tr> <td><input type="checkbox" name="help"<% if Pref.subscribed ("hcoop-help", youremail) then %> checked<% end %>></td> <td>Include me on the <tt>hcoop-help</tt> mailing list. <i>(Members-helping-members support on how to use HCoop services)</i></td> </tr>
+<tr> <td><input type="checkbox" name="sysadmin"<% if Pref.subscribed ("hcoop-sysadmin", youremail) then %> checked<% end %>></td> <td>Include me on the <tt>hcoop-sysadmin</tt> mailing list. <i>(Discussion about technical adminstrative planning and related issues, not dealing directly with member support requests)</i></td> </tr>
+<tr> <td><input type="checkbox" name="misc"<% if Pref.subscribed ("hcoop-misc", youremail) then %> checked<% end %>></td> <td>Include me on the <tt>hcoop-misc</tt> mailing list. <i>(Off-topic)</i></td> </tr>
 <tr> <td><input type="submit" value="Save"></td> </tr>
 </table>