Update of /cvsroot/hcoop/portal
In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv30531

Modified Files:
        poll.mlt poll.sml 
Log Message:
Add delete links on poll pages

Index: poll.mlt
===================================================================
RCS file: /cvsroot/hcoop/portal/poll.mlt,v
retrieving revision 1.11
retrieving revision 1.12
diff -C2 -d -r1.11 -r1.12
*** poll.mlt    4 Aug 2009 15:33:54 -0000       1.11
--- poll.mlt    4 Aug 2009 15:44:00 -0000       1.12
***************
*** 143,155 ****
  
  elseif $"del" <> "" then
-       Group.requireGroupName "poll";
        showNormal := false;
!       val poll = Poll.lookupPoll (Web.stoi ($"del")) %>
        <h3>Are you sure you want to delete poll <a href="poll?id=<% #id poll 
%>"><% Web.html (#title poll) %></a>?</h3>
        <a href="poll?del2=<% $"del" %>">Yes, delete <% Web.html (#title poll) 
%>!</a>
  
  <% elseif $"del2" <> "" then
-       Group.requireGroupName "poll";
        val poll = Poll.lookupPoll (Web.stoi ($"del2"));
        Poll.deletePoll (Web.stoi ($"del2")) %>
        <h3><% Web.html (#title poll) %> deleted!</h3>
--- 143,155 ----
  
  elseif $"del" <> "" then
        showNormal := false;
!       val poll = Poll.lookupPoll (Web.stoi ($"del"));
!       Poll.requireCanModify poll %>
        <h3>Are you sure you want to delete poll <a href="poll?id=<% #id poll 
%>"><% Web.html (#title poll) %></a>?</h3>
        <a href="poll?del2=<% $"del" %>">Yes, delete <% Web.html (#title poll) 
%>!</a>
  
  <% elseif $"del2" <> "" then
        val poll = Poll.lookupPoll (Web.stoi ($"del2"));
+       Poll.requireCanModify poll;
        Poll.deletePoll (Web.stoi ($"del2")) %>
        <h3><% Web.html (#title poll) %> deleted!</h3>
***************
*** 321,324 ****
--- 321,326 ----
  <% if canModify then %>
  <br><hr><br>
+ <h3><a href="?del=<% id %>">Delete this poll</a></h3>
+ 
  <h3>Add a new choice</h3>
  

Index: poll.sml
===================================================================
RCS file: /cvsroot/hcoop/portal/poll.sml,v
retrieving revision 1.9
retrieving revision 1.10
diff -C2 -d -r1.9 -r1.10
*** poll.sml    4 Aug 2009 15:33:55 -0000       1.9
--- poll.sml    4 Aug 2009 15:44:00 -0000       1.10
***************
*** 178,184 ****
  fun canModify (poll : poll) =
      Group.inGroupName "poll"
!     orelse (#usr poll = Init.getUserId()
!           andalso (dateLtNow (#starts poll)
!                    orelse not (#ready poll)))
  
  fun requireCanModify poll =
--- 178,184 ----
  fun canModify (poll : poll) =
      Group.inGroupName "poll"
!     orelse ((#usr poll = Init.getUserId()
!            andalso (dateLtNow (#starts poll)
!                     orelse not (#ready poll))))
  
  fun requireCanModify poll =


------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with 
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
hcoop-cvs mailing list
hcoop-cvs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/hcoop-cvs

Reply via email to