Commit 39eb481b authored by Robert Ricci's avatar Robert Ricci

Add a box to change the head of a project on the project approval

'action' page. This will be used when a student applies to start
a project - we'll have the professor, PI, etc. apply to join the
project, then change the head UID when we approve it.

Changing the head uid is repected when _any_ action is taken
(postponing, more info requests, etc.) Any mail gets sent to the
new head, and NOT the old head.
parent a4e8ca5b
...@@ -39,6 +39,17 @@ if (($row = mysql_fetch_row($query_result)) == 0) { ...@@ -39,6 +39,17 @@ if (($row = mysql_fetch_row($query_result)) == 0) {
} }
$headuid = $row[0]; $headuid = $row[0];
#
# If the user wanted to change the head uid, do that now (we change both
# the head_uid and the leader of the default project)
#
if (isset($head_uid) && strcmp($head_uid,"")) {
$headuid = $head_uid;
DBQueryFatal("UPDATE projects set head_uid='$headuid' where pid='$pid'");
DBQueryFatal("UPDATE groups set leader='$headuid' where pid='$pid' and " .
"gid='$pid'");
}
# #
# Get the current status for the headuid, which we might need to change # Get the current status for the headuid, which we might need to change
# anyway, and to verify that the user is a valid user. We also need # anyway, and to verify that the user is a valid user. We also need
......
...@@ -109,6 +109,27 @@ echo "<tr> ...@@ -109,6 +109,27 @@ echo "<tr>
</td> </td>
</tr>\n"; </tr>\n";
#
# Allow the approver to change the project's head UID - gotta find everyone in
# the default group, first
#
echo "<tr>
<td align=center>
Head UID:
<select name=head_uid>
<option value=''>(Unchanged)</option>";
$query_result =
DBQueryFatal("select uid from group_membership where pid='$pid' and " .
"gid='$pid'");
while ($row = mysql_fetch_array($query_result)) {
$thisuid = $row[uid];
echo " <option value='$thisuid'>$thisuid</option>\n";
}
echo " </select>
</td>
</tr>\n";
# #
# XXX # XXX
# Temporary Plab hack. # Temporary Plab hack.
......
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