home *** CD-ROM | disk | FTP | other *** search
/ Chip 2005 May / CMCD0505.ISO / Software / Shareware / Programare / bugzero / jsp / prefs.jsp < prev    next >
Text File  |  2004-12-10  |  4KB  |  122 lines

  1. <%@ page
  2.     import="com.websina.bean.*,com.websina.util.*,com.websina.util.log.Log"
  3. %>
  4. <html>
  5. <head>
  6. <head><title>User Preferences</title>
  7. </head>
  8. <body topmargin=0>
  9. <%@ include file="_header.jspf" %>
  10. <%      
  11.   if (com.websina.bean.Group.getInstance().isGuest(person.getGroup()) && !guestPrefsAllowed) {
  12.     response.sendRedirect("home.jsp");
  13.     return;
  14.   }
  15.   String title = label.get("user_preferences");
  16.   String tmp; 
  17.   String requiredMark = "<font color=red>*</font>";
  18. %>
  19. <center>
  20. <%-- the title part --%>
  21. <table bgcolor="#ffffff" cellpadding=0 cellspacing=0 width=100% border=0>
  22.   <tr><td align=center height=30><font size=+1><b><%=title%></b></font>
  23. </table>
  24.  
  25. <% String msg = request.getParameter("msg");
  26.    if (msg != null) { %>
  27. <p><font color=red><b><%=msg%></b></font>
  28. <% } %>
  29. <p>
  30. <form name="prefForm" method="post" action="<%=contextPath%>/servlet/prefs">
  31.  
  32. <table cellpadding=2 cellspacing=0 border=0 class="box">
  33. <%-- the name part --%>
  34. <tr><td class="e8" colspan=2 align=center>
  35. <b><%=label.get("username")%>:</b> <font color="#cccc00"><b><%=person.getUsername()%></b></font>
  36. </td></tr>
  37. <tr>
  38. <td><b><%=label.get("password")%></b></td>
  39. <td><input type=password name="password" size=32 maxlength=50></td>
  40. </tr>
  41. <tr>
  42. <td><b><%=label.get("confirm_password")%></b></td>
  43. <td><input type=password name="password2" size=32 maxlength=50></td>
  44. </tr>
  45. <tr>
  46. <td><b><%=label.get("email")%></b><%=requiredMark%></td>
  47. <%
  48.   tmp = person.getEmail();
  49.   if (tmp == null) tmp = "";
  50. %>
  51. <td><input type=text name="email" value="<%=tmp%>" size=32 maxlength=100></td>
  52. </tr>
  53. <tr>
  54. <td><b><%=label.get("fullname")%></b><%=requiredMark%></td>
  55. <%
  56.   tmp = person.getFullname();
  57.   if (tmp == null) tmp = "";
  58. %>
  59. <td><input type=text name="fullname" value="<%=tmp%>" size=32 maxlength=100></td>
  60. </tr>
  61. <tr height=32 valign=top>
  62. <td><b><%=label.get("default_project")%></b> </td>
  63. <td>
  64. <select name="default_project">
  65.   <%=ListMaker.makeOptionList(person.getProjectList(), person.getProject()) %>
  66. </select></td>
  67. </tr>
  68. <tr><td colspan=2><b><%=label.get("signature")%></b></td></tr>
  69. <tr><td colspan=2>
  70. <textarea name=signature rows=5 cols=40 style="width: 100%; overflow: auto;">
  71. <%=HtmlParser.escapeTag(person.getSignature())%></textarea></td></tr>
  72.  
  73. <%-- the save/cancel buttons --%>
  74. <tr><td colspan=2 align=center height=30>
  75. <input class="button" type="button" value="<%=label.get("save_button")%>" onClick="
  76. if(!isEqual(form.password,form.password2, 'Password does not match, please re-enter')) return false;
  77. if(isEmpty(form.email,'Email is required.')) return false;
  78. if(!validEmail(form.email.value))return false;
  79. if(isEmpty(form.fullname,'Full name is required')) return false;
  80. this.disabled=true; submit();">
  81. <input class="button" type="button" value="<%=label.get("cancel_button")%>"
  82. onClick="location.href='prefs.jsp';">
  83. </td></tr>
  84. </table>
  85.  
  86. <% String mode = person.getBrowseMode();
  87.    String mode1 = null;
  88.    String mode2 = null;
  89.    if (mode==null || mode.equals("0")) {
  90.      mode = "0";
  91.      mode1 = "checked";
  92.      mode2 = "";
  93.    } else {
  94.      mode1 = "";
  95.      mode2 = "checked";
  96.    }
  97. %>
  98. <table bgcolor="#ffffff" cellpadding=4 cellspacing=4 border=0>
  99. <tr><td height=20> </td></tr>
  100. <tr><td>
  101. <b><%=label.get("browse_mode")%></b>    
  102. </td><td>
  103. <%=label.get("browse_mode_list")%>:
  104. <input type=radio name="browse_mode" <%=mode1%> value="0"
  105. onClick="if(<%=mode%>!='0')location.href='<%=contextPath%>/servlet/prefs?browse_mode=0';">
  106. </td><td>
  107. <%=label.get("browse_mode_next")%>:
  108. <input type=radio name="browse_mode" <%=mode2%> value="1" 
  109. onClick="if(<%=mode%>!='1')location.href='<%=contextPath%>/servlet/prefs?browse_mode=1';">
  110. </td></tr>
  111. <tr><td colspan=2>
  112. <b><%=label.get("prefs_email_notification")%></b>
  113. </td><td align=right>
  114. <input class="button" type="button" value="<%=label.get("go_button")%>" 
  115. onClick="location.href='trigger.jsp';">
  116. </td></tr>
  117. </table>
  118. </form>
  119. </center>
  120.  
  121. </body>
  122. </html>