user-email.jsp 2.64 KB
Newer Older
Matt Tucker's avatar
Matt Tucker committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
<%--
  -	$RCSfile$
  -	$Revision$
  -	$Date$
--%>

<%@ page import="org.jivesoftware.util.*,
                 org.jivesoftware.messenger.user.UserManager,
                 java.text.DateFormat"
    errorPage="error.jsp"
%>

<%@ include file="global.jsp" %>

<%  // Get parameters //
    boolean cancel = request.getParameter("cancel") != null;
17
    String username = ParamUtils.getParameter(request,"username");
Matt Tucker's avatar
Matt Tucker committed
18 19 20

    // Handle a cancel
    if (cancel) {
21
        response.sendRedirect("user-edit-form.jsp?username=" + username);
Matt Tucker's avatar
Matt Tucker committed
22 23 24 25
        return;
    }

    // Load the user object
26
    User user = userManager.getUser(username);
Matt Tucker's avatar
Matt Tucker committed
27 28
%>

Bill Lynch's avatar
Bill Lynch committed
29
<jsp:include page="header.jsp" flush="true" />
Matt Tucker's avatar
Matt Tucker committed
30 31 32 33 34 35

<%  // Title of this page and breadcrumbs
    String title = "Email User";
    String[][] breadcrumbs = {
        { "Home", "main.jsp" },
        { "User Summary", "user-summary.jsp" },
36 37
        { "Edit User", "user-edit-form.jsp?username="+username },
        { title, "user-email.jsp?username="+username }
Matt Tucker's avatar
Matt Tucker committed
38 39
    };
%>
Bill Lynch's avatar
Bill Lynch committed
40
<jsp:include page="title.jsp" flush="true" />
Matt Tucker's avatar
Matt Tucker committed
41 42 43 44 45 46

<p>
Use the form below to send an email to the user.
</p>

<form action="user-email.jsp" name="emailform">
47
<input type="hidden" name="username" value="<%= username %>">
Matt Tucker's avatar
Matt Tucker committed
48 49 50 51 52 53 54 55 56 57 58 59 60 61

<div class="jive-table">
<table cellpadding="3" cellspacing="1" border="0" width="100%">
<tr>
    <th colspan="2">
        Email Message
    </th>
</tr>
<tr>
    <td class="jive-label">
        From:
    </td>
    <td>
        <%= pageUser.getUsername() %> &lt;<%= pageUser.getInfo().getEmail() %>&gt;
62
        (<a href="user-edit-form.jsp?username=<%= user.getUsername() %>">Edit User</a>)
Matt Tucker's avatar
Matt Tucker committed
63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110
    </td>
</tr>
<tr>
    <td class="jive-label">
        TO:
    </td>
    <td>
        <input type="text" name="to" value="<%= user.getUsername() %> &lt;<%= user.getInfo().getEmail() %>&gt;"
         size="45" maxlength="150">
    </td>
</tr>
<tr>
    <td class="jive-label">
        CC:
    </td>
    <td>
        <input type="text" name="cc" value="" size="45" maxlength="150">
    </td>
</tr>
<tr>
    <td class="jive-label">
        Subject:
    </td>
    <td>
        <input type="text" name="subject" value="" size="55" maxlength="150" style="width:100%">
    </td>
</tr>
<tr>
    <td class="jive-label" valign="top">
        Message:
    </td>
    <td>
        <textarea name="body" cols="50" rows="7" wrap="virtual" style="width:100%"></textarea>
    </td>
</tr>
</table>
</div>

<br>

<input type="submit" value="Send!" name="send" onclick="alert('Not implemented yet');return false;">
<input type="submit" value="Cancel" name="cancel">
</form>

<script lang="JavaScript" type="text/javascript">
document.emailform.subject.focus();
</script>

Bill Lynch's avatar
Bill Lynch committed
111
<jsp:include page="footer.jsp" flush="true" />