Commit 4960367f authored by Leigh B. Stoller's avatar Leigh B. Stoller

Add form to allow a new text message when resending the approval

message.
parent 54705b2b
<?php
#
# EMULAB-COPYRIGHT
# Copyright (c) 2000-2003, 2005, 2006 University of Utah and the Flux Group.
# Copyright (c) 2003-2007 University of Utah and the Flux Group.
# All rights reserved.
#
include("defs.php3");
include("showstuff.php3");
#
# Only known and logged in users can do this.
......@@ -33,6 +34,78 @@ if (!isset($pid) ||
if (! ($target_project = Project::Lookup($pid))) {
USERERROR("The project $pid is not a valid project", 1);
}
#
# Form to allow text input.
#
function SPITFORM($pid, $message, $errors)
{
global $this_user;
if ($errors) {
echo "<table class=nogrid
align=center border=0 cellpadding=6 cellspacing=0>
<tr>
<th align=center colspan=2>
<font size=+1 color=red>
&nbsp;Oops, please fix the following errors!&nbsp;
</font>
</td>
</tr>\n";
while (list ($name, $message) = each ($errors)) {
echo "<tr>
<td align=right>
<font color=red>$name:&nbsp;</font></td>
<td align=left>
<font color=red>$message</font></td>
</tr>\n";
}
echo "</table><br>\n";
}
#
# Show stuff
#
SHOWPROJECT($pid, $this_user->uid());
echo "<br>";
echo "<table align=center border=1>\n";
echo "<form action='resendapproval.php?pid=$pid' method='post'>\n";
echo "<tr>
<td>Use the text box (70 columns wide) to add a message to the
email notification. </td>
</tr>\n";
echo "<tr>
<td align=center class=left>
<textarea name=message rows=15 cols=70></textarea>
</td>
</tr>\n";
echo "<tr>
<td align=center>
<b><input type='submit' value='Submit' name='submit'></td>
</tr>
</form>
</table>\n";
}
#
# On first load, display a virgin form and exit.
#
if (! $submit) {
SPITFORM($pid, "", null);
PAGEFOOTER();
return;
}
# If there is a message in the text box, it is appended below.
if (! isset($message)) {
$message = "";
}
if (! ($leader = $target_project->GetLeader())) {
TBERROR("Error getting leader for $pid", 1);
}
......@@ -41,20 +114,21 @@ $headuid_email = $leader->email();
$headname = $leader->name();
TBMAIL("$headname '$headuid' <$headuid_email>",
"Project '$pid' Approval",
"\n".
"This message is to notify you that your project '$pid'\n".
"has been approved. We recommend that you save this link so that\n".
"you can send it to people you wish to have join your project.\n".
"Otherwise, tell them to go to ${TBBASE} and join it.\n".
"\n".
" ${TBBASE}/joinproject.php3?target_pid=$pid\n".
"\n".
"Thanks,\n".
"Testbed Operations\n",
"From: $TBMAIL_APPROVAL\n".
"Bcc: $TBMAIL_APPROVAL\n".
"Errors-To: $TBMAIL_WWW");
"Project '$pid' Approval",
"\n".
"This message is to notify you that your project '$pid'\n".
"has been approved. We recommend that you save this link so that\n".
"you can send it to people you wish to have join your project.\n".
"Otherwise, tell them to go to ${TBBASE} and join it.\n".
"\n".
" ${TBBASE}/joinproject.php3?target_pid=$pid\n".
"\n".
($message != "" ? "${message}\n\n" : "") .
"Thanks,\n".
"Testbed Operations\n",
"From: $TBMAIL_APPROVAL\n".
"Bcc: $TBMAIL_APPROVAL\n".
"Errors-To: $TBMAIL_WWW");
echo "<center>
<h2>Done!</h2>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment