cvsimport
[hcoop/zz_old/portal.git] / issue.mlt
index 0a5414e..f8a7230 100644 (file)
--- a/issue.mlt
+++ b/issue.mlt
@@ -12,15 +12,15 @@ ref showNormal = true;
 if $"cmd" = "new" then
        showNormal := false %>
 
-<h3><b>New issue</b></h3>
+<h3>New issue</h3>
 
 <form action="issue" method="post">
 <input type="hidden" name="cat" value="<% catId %>">
 <input type="hidden" name="cmd" value="add">
-<table>
-<tr> <td align="right"><b>Title</b>:</td> <td><input name="title"></td> </tr>
-<tr> <td align="right"><input type="checkbox" name="priv"></td> <td>Only make this issue accessible to the admins for this support category.</td> </tr>
-<tr> <td align="right"><b>Description</b>:</td> <td><textarea name="body" rows="10" cols="80" wrap="soft"></textarea></td> </tr>
+<table class="blanks">
+<tr> <td>Title:</td> <td><input name="title"></td> </tr>
+<tr> <td><input type="checkbox" name="priv"></td> <td>Only make this issue accessible to the admins for this support category.</td> </tr>
+<tr> <td>Description:</td> <td><textarea name="body" rows="10" cols="80" wrap="soft"></textarea></td> </tr>
 <tr> <td><input type="submit" value="Add"></td> </tr>
 </table>
 </form>
@@ -28,19 +28,19 @@ if $"cmd" = "new" then
 <% elseif $"cmd" = "add" then
        val title = $"title";
        if not (Support.validTitle title) then
-               %><h3><b>Invalid title</b></h3><%
+               %><h3>Invalid title</h3><%
        else
                val id = Support.addIssue (you, catId, title, $"priv" = "on", Support.NEW);
                val _ = Support.addPost (you, id, $"body");
                if not (Support.notifyCreation id) then
-                       %><h3><b>Error sending e-mail notification</b></h3><%
+                       %><h3>Error sending e-mail notification</h3><%
                end;
                viewingIssue := SOME id
        end
 
 elseif $"cmd" = "list" then
        showNormal := false %>
-       <h3><b>All issues</b></h3>
+       <h3>All issues</h3>
 
 <table>
 <% foreach (name, issue) in Support.listCategoryIssues catId do
@@ -64,23 +64,23 @@ end %>
        val id = Web.stoi ($"mod");
        val issue = Support.lookupIssue id;
        if catId <> #cat issue then
-               %><h3><b>Inconsistent cat field</b></h3><%
+               %><h3>Inconsistent cat field</h3><%
        elseif not admin then
-               %><h3><b>You aren't authorized to modify that.</b></h3><%
+               %><h3>You aren't authorized to modify that.</h3><%
        else %>
-<h3><b>Modify issue</b></h3>
+<h3>Modify issue</h3>
 
 <form action="issue" method="post">
 <input type="hidden" name="cat" value="<% catId %>">
 <input type="hidden" name="save" value="<% id %>">
-<table>
-<tr> <td align="right"><b>Category</b>:</td> <td><select name="newCat">
+<table class="blanks">
+<tr> <td>Category:</td> <td><select name="newCat">
 <% foreach cat in Support.listCategories () do %>
        <option value="<% #id cat %>"<% if #id cat = catId then %> selected<% end %>><% Web.html (#name cat) %></option>
 <% end %></select></td> </tr>
-<tr> <td align="right"><b>Title</b>:</td> <td><input name="title" value="<% Web.html (#title issue) %>"></td> </tr>
-<tr> <td align="right"><input type="checkbox" name="priv"<% if #priv issue then %> checked<% end %>></td> <td>Only make this issue accessible to the admins for this support category.</td> </tr>
-<tr> <td align="right"><b>Status</b>:</td> <td><select name="status">
+<tr> <td>Title:</td> <td><input name="title" value="<% Web.html (#title issue) %>"></td> </tr>
+<tr> <td><input type="checkbox" name="priv"<% if #priv issue then %> checked<% end %>></td> <td>Only make this issue accessible to the admins for this support category.</td> </tr>
+<tr> <td>Status:</td> <td><select name="status">
        <option value="0"<% if #status issue = Support.NEW then %> selected<% end %>>New</option>
        <option value="1"<% if #status issue = Support.PENDING then %> selected<% end %>>Pending</option>
        <option value="2"<% if #status issue = Support.CLOSED then %> selected<% end %>>Closed</option>
@@ -99,13 +99,13 @@ elseif $"save" <> "" then
        val newCat = Support.lookupCategory (Web.stoi ($"newCat"));
 
        if catId <> #cat issue then
-               %><h3><b>Inconsistent cat field</b></h3><%
+               %><h3>Inconsistent cat field</h3><%
        elseif (iff admin then not (Group.inGroupNum (#grp newCat)) else false) then
-               %><h3><b>Authorization failure</b></h3><%
+               %><h3>Authorization failure</h3><%
        elseif not (Support.validTitle title) then
-               %><h3><b>Invalid title</b></h3><%
+               %><h3>Invalid title</h3><%
        elseif (iff status < 0 then false else status > 2) then
-               %><h3><b>Invalid status</b></h3><%
+               %><h3>Invalid status</h3><%
        else
                val status = (case status of
                                  0 => Support.NEW
@@ -117,11 +117,11 @@ elseif $"save" <> "" then
                                status = status};
                if status <> oldStatus then
                        if not (Support.notifyStatus (you, oldStatus, status, id)) then
-                               %><h3><b>Error sending e-mail notification</b></h3><%
+                               %><h3>Error sending e-mail notification</h3><%
                        end
                end;
                viewingIssue := SOME id
-               %><h3><b>Issue saved</b></h3<%
+               %><h3>Issue saved</b></h3<%
        end
 
 elseif $"del" <> "" then
@@ -130,11 +130,11 @@ elseif $"del" <> "" then
        val issue = Support.lookupIssue id;
 
        if catId <> #cat issue then
-               %><h3><b>Inconsistent cat field</b></h3><%
+               %><h3>Inconsistent cat field</h3><%
        elseif not admin then
-               %><h3><b>Authorization failure</b></h3><%
+               %><h3>Authorization failure</h3><%
        else
-               %><h3><b>Are you sure you want to delete "<% Web.html (#title issue) %>"?</b></h3>
+               %><h3>Are you sure you want to delete "<% Web.html (#title issue) %>"?</h3>
                <a href="issue?cat=<% catId %>&del2=<% id %>">Yes, delete "<% Web.html (#title issue) %>"!</a><%
        end
 
@@ -143,12 +143,12 @@ elseif $"del2" <> "" then
        val issue = Support.lookupIssue id;
 
        if catId <> #cat issue then
-               %><h3><b>Inconsistent cat field</b></h3><%
+               %><h3>Inconsistent cat field</h3><%
        elseif not admin then
-               %><h3><b>Authorization failure</b></h3><%
+               %><h3>Authorization failure</h3><%
        else
                Support.deleteIssue id
-               %><h3><b>Issue "<% Web.html (#title issue) %>" deleted</b></h3><%
+               %><h3>Issue "<% Web.html (#title issue) %>" deleted</h3><%
        end
 
 elseif $"cmd" = "post" then
@@ -157,15 +157,15 @@ elseif $"cmd" = "post" then
        val issue = Support.lookupIssue id;
 
        if catId <> #cat issue then
-               %><h3><b>Inconsistent cat field</b></h3><%
+               %><h3>Inconsistent cat field</h3><%
        elseif not (Support.allowedToSee id) then
-               %><h3><b>Authorization failure</b></h3><%
+               %><h3>Authorization failure</h3><%
        else
                val id = Support.addPost (you, id, $"body");
                if not (Support.notifyPost id) then
-                       %><h3><b>Error sending e-mail notification</b></h3><%
+                       %><h3>Error sending e-mail notification</h3><%
                end
-               %><h3><b>Posted</b></h3><%
+               %><h3>Posted</h3><%
        end
 
 elseif $"modPost" <> "" then
@@ -174,11 +174,11 @@ elseif $"modPost" <> "" then
        val post = Support.lookupPost id;
        val issue = Support.lookupIssue (#iss post);
        if catId <> #cat issue then
-               %><h3><b>Inconsistent cat field</b></h3><%
+               %><h3>Inconsistent cat field</h3><%
        elseif not admin then
-               %><h3><b>You aren't authorized to modify that.</b></h3><%
+               %><h3>You aren't authorized to modify that.</h3><%
        else %>
-<h3><b>Modify post</b></h3>
+<h3>Modify post</h3>
 
 <form action="issue" method="post">
 <input type="hidden" name="cat" value="<% catId %>">
@@ -194,13 +194,13 @@ elseif $"savePost" <> "" then
        val issue = Support.lookupIssue (#iss post);
 
        if catId <> #cat issue then
-               %><h3><b>Inconsistent cat field</b></h3><%
+               %><h3>Inconsistent cat field</h3><%
        elseif not admin then
-               %><h3><b>Authorization failure</b></h3><%
+               %><h3>Authorization failure</h3><%
        else
                Support.modPost {post with body = $"body"};
                viewingIssue := SOME (#iss post)
-               %><h3><b>Post saved</b></h3<%
+               %><h3>Post saved</b></h3<%
        end
 
 elseif $"delPost" <> "" then
@@ -210,11 +210,11 @@ elseif $"delPost" <> "" then
        val issue = Support.lookupIssue (#iss post);
 
        if catId <> #cat issue then
-               %><h3><b>Inconsistent cat field</b></h3><%
+               %><h3>Inconsistent cat field</h3><%
        elseif not admin then
-               %><h3><b>Authorization failure</b></h3><%
+               %><h3>Authorization failure</h3><%
        else
-               %><h3><b>Are you sure you want to delete this post?</b></h3>
+               %><h3>Are you sure you want to delete this post?</h3>
                <blockquote><% Web.htmlNl (#body post) %></blockquote>
                <a href="issue?cat=<% catId %>&delPost2=<% id %>">Yes, delete it!</a><%
        end
@@ -225,13 +225,13 @@ elseif $"delPost2" <> "" then
        val issue = Support.lookupIssue (#iss post);
 
        if catId <> #cat issue then
-               %><h3><b>Inconsistent cat field</b></h3><%
+               %><h3>Inconsistent cat field</h3><%
        elseif not admin then
-               %><h3><b>Authorization failure</b></h3><%
+               %><h3>Authorization failure</h3><%
        else
                Support.deletePost id;
                viewingIssue := SOME (#iss post)
-               %><h3><b>Post deleted</b></h3><%
+               %><h3>Post deleted</h3><%
        end
 
 elseif $"id" <> "" then
@@ -244,22 +244,28 @@ switch viewingIssue of
                val canEdit = Support.allowedToEdit id;
                val canView = Support.allowedToSee id;
                if catId <> #cat issue then
-                       %><h3><b>Inconsistent cat field</b></h3><%
+                       %><h3>Inconsistent cat field</h3><%
                elseif not canView then
-                       %><h3><b>You aren't authorized to view that.</b></h3><%
+                       %><h3>You aren't authorized to view that.</h3><%
                else
                        val user = Init.lookupUser (#usr issue) %>
 
-<table>
-<tr> <td align="right"><b>Title</b>:</td> <td><% Web.html (#title issue) %></td> </tr>
-<tr> <td align="right"><b>Created by</b>:</td> <td><a href="user?id=<% #usr issue %>"><% #name user %></a></td> </tr>
-<tr> <td align="right"><b>At</b>:</td> <td><% #stamp issue %></td> </tr>
-<tr> <td align="right"><b>Private</b>:</td> <td><% if #priv issue then %>yes<% else %>no<% end %></td> </tr>
-<tr> <td align="right"><b>Status</b>:</td> <td><% switch #status issue of
+<table class="blanks">
+<tr> <td>Title:</td> <td><% Web.html (#title issue) %></td> </tr>
+<tr> <td>Created by:</td> <td><a href="user?id=<% #usr issue %>"><% #name user %></a></td> </tr>
+<tr> <td>At:</td> <td><% #stamp issue %></td> </tr>
+<tr> <td>Private:</td> <td><% if #priv issue then %>yes<% else %>no<% end %></td> </tr>
+<tr> <td>Status:</td> <td><% switch #status issue of
          Support.NEW => %>New<%
        | Support.PENDING => %>Pending<%
        | Support.CLOSED => %>Closed<%
        end %></td> </tr>
+<%     switch #pstamp issue of
+                 SOME stamp => %><tr> <td>Changed to pending:</td> <td><% stamp %></td> </tr><%
+       end;
+       switch #cstamp issue of
+                 SOME stamp => %><tr> <td>Closed:</td> <td><% stamp %></td> </tr><%
+       end %>
 </table>
 
 <% if admin then %>
@@ -281,7 +287,7 @@ foreach (name, post) in Support.listPosts id do %>
 
 <br><hr><br>
 
-<h3><b>Post to this thread</b></h3>
+<h3>Post to this thread</h3>
 
 <form action="issue" method="post">
 <input type="hidden" name="cat" value="<% catId %>">
@@ -297,9 +303,9 @@ foreach (name, post) in Support.listPosts id do %>
 if showNormal then %>
 
 <a href="issue?cat=<% catId %>&cmd=new">New issue</a><br>
-<a href="issue?cat=<% catId %>&cmd=list">List all issues</a>
+<a href="issue?cat=<% catId %>&cmd=list">List all issues (including closed issues)</a>
 
-<h3><b>Open issues</b></h3>
+<h3>Open issues</h3>
 
 <table>
 <% val issues = iff admin then Support.listOpenCategoryIssuesAdmin catId