Commit f629146b authored by Leigh B. Stoller's avatar Leigh B. Stoller

Some minor changes for the started/ended/expires/created date problems

that Mike reported.
parent ecaf874b
......@@ -323,9 +323,9 @@ sub startexp($)
$query_result =
DBQueryFatal("insert into experiments ".
"(eid, pid, expt_created, expt_name, ".
"expt_head_uid, expt_start, state, batchmode) ".
"expt_head_uid, state, batchmode) ".
"VALUES ('$eid', '$pid', '$rightnow', '$longname', ".
"'$creator', '$rightnow', 'new', 1)");
"'$creator', 'new', 1)");
#
# Try to start the experiment. If it fails, the experiment is gone.
......
......@@ -185,9 +185,9 @@ $created = `date '+%Y:%m:%d %H:%M:%S'`;
# is looking for batch experiments to run. Easy race avoidance.
#
DBQueryFatal("INSERT INTO batch_experiments ".
"(eid, pid, created, started, expires, ".
"(eid, pid, created, expires, ".
" name, creator_uid, status) ".
"VALUES ('$eid', '$pid', '$created', '$created', '$expires', ".
"VALUES ('$eid', '$pid', '$created', '$expires', ".
"'$longname', '$uid', 'new')");
exit 0;
......
......@@ -266,6 +266,17 @@ $expt_name = $row[0];
$expt_created = $row[1];
$expt_expires = $row[2];
#
# Gen up a date for the started field of the record, and insert it.
#
$expt_started = `date '+20%y-%m-%d %H:%M:%S'`;
if ($expt_started =~ /^([-\@\w: ]+)$/) {
$expt_started = $1;
DBQueryWarn("update experiments set expt_start='$expt_started' ".
"WHERE eid='$eid' and pid='$pid'");
}
print STDOUT "Setup Success\n";
#
......@@ -334,6 +345,7 @@ print $MAIL "PID: $pid\n";
print $MAIL "Name: $expt_name\n";
print $MAIL "Created: $expt_created\n";
print $MAIL "Expires: $expt_expires\n";
print $MAIL "Started: $expt_started\n";
print $MAIL "Directory: $eiddir\n\n";
if (open(IN, "$repfile")) {
......
......@@ -113,21 +113,8 @@ echo "<tr>
<td colspan=2>Expiration date:</td>
<td><input type=\"text\" value=\"$year:$month:$rest\"
name=\"exp_expires\"></td>
</tr>\n";
echo "<tr>
<td colspan=2>Experiment starts:</td>
<td><input type=\"text\" value=\"$year:$thismonth:$rest\"
name=\"exp_start\"></td>
<td><input type=\"hidden\" value=\"$year:$thismonth:$rest\"
name=\"exp_created\"></td>
</tr>\n";
echo "<tr>
<td colspan=2>Experiment ends:</td>
<td><input type=\"text\" value=\"$year:$month:$rest\"
name=\"exp_end\"></td>
</tr>\n";
echo "<tr>
......
......@@ -199,10 +199,9 @@ else {
$query_result = mysql_db_query($TBDBNAME,
"INSERT INTO experiments ".
"(eid, pid, expt_created, expt_expires, expt_name, ".
"expt_head_uid, expt_start, expt_end, state, shared) ".
"expt_head_uid, state, shared) ".
"VALUES ('$exp_id', '$exp_pid', '$exp_created', '$exp_expires', ".
"'$exp_name', '$uid', '$exp_start', '$exp_end', ".
"'$expt_state', $exp_shared)");
"'$exp_name', '$uid', '$expt_state', $exp_shared)");
if (! $query_result) {
$err = mysql_error();
TBERROR("Database Error adding new experiment $exp_id: $err\n", 1);
......@@ -242,9 +241,7 @@ if ($nonsfile) {
"PID: $exp_pid\n".
"Name: $exp_name\n".
"Created: $exp_created\n".
"Expires: $exp_expires\n".
"Start: $exp_start\n".
"End: $exp_end\n",
"Expires: $exp_expires\n",
"From: $TBMAIL_WWW\n".
"Bcc: $TBMAIL_LOGS\n".
"Errors-To: $TBMAIL_WWW");
......
......@@ -273,18 +273,13 @@ function SHOWEXP($pid, $eid) {
</tr>\n";
echo "<tr>
<td>Starts: </td>
<td class=\"left\">$exp_start</td>
</tr>\n";
echo "<tr>
<td>Ends: </td>
<td class=\"left\">$exp_end</td>
<td>Expires: </td>
<td class=\"left\">$exp_expires</td>
</tr>\n";
echo "<tr>
<td>Expires: </td>
<td class=\"left\">$exp_expires</td>
<td>Started: </td>
<td class=\"left\">$exp_start</td>
</tr>\n";
echo "<tr>
......
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