*
* see 'globals.php3' for details
*/
#
# script for submitting/revising a camera ready copy
# and showing the relevant form
#
require "globals.php3";
require "utils.php3";
check_stopped_or_expired_cameraready("cameraready.php3");
if ( $action == "submit" ) {
$paperfile_name = trim($paperfile_name);
if (preg_match("/.*\/$/", $paperfile_name, $matches)) {
print_esub_header("Camera ready submission failed");
print "You submitted a directory name. Please try again with a full path filename.
";
print_esub_footer("revise.php3");
return;
}
$uid = trim(str_replace("\n", " ", $uid));
$title = trim(str_replace("\n", " ", strtolower($title)));
$authors = trim(str_replace("\n", " ", strtolower($authors)));
$contact = trim(str_replace("\n", " ", strtolower($contact)));
$paperfile = trim(str_replace("\n", " ", $paperfile));
if ($USE_AFFILIATIONS) {
$affiliations = trim(str_replace("\n", " ", $affiliations));
}
if ($USE_CATEGORIES) {
$category = trim(str_replace("\n", " ", $category));
}
if ($USE_ABSTRACTS) {
$abstract = trim($abstract);
}
if (!strcmp($uid,"")) {
### uniqueID not specified: try again
print_esub_header("Revision failed");
print "A Unique ID is needed to submit a cameraready version.
";
print "Please try again.
";
print_esub_footer("cameraready.php3");
return;
} else {
### revision
list($exist, $location) = find_uid($uid);
if (!$exist) {
### send warning mail to CONTACT
mail($CONTACT_EMAIL,
"$CONFERENCE_SHORT: UNSUCCESSFUL camera ready version submission for Paper-Id $uid",
"UNSUCCESSFUL camera ready version submission for Paper-Id $uid",
"From: $CONFERENCE_EMAIL\nReply-To: $CONFERENCE_EMAIL\nX-Mailer: PHP/" . phpversion());
print_esub_header("Camera ready submission failed");
print "There is no paper corresponding to the Unique ID \"" . $uid . "\"
";
print "Please check the Unique ID and try again.
";
print_esub_footer("cameraready.php3");
return;
}
### Get optional fields
$connection = db_connect();
$query = "SELECT title, contact, authors, affiliations, abstract, category, status, final_location, receipt, paper_id FROM $DB_TABLE WHERE uid='$uid'";
$result = mysql_db_query($DB, $query, $connection)
or my_error_handler($query);
$row = mysql_fetch_row($result);
if ($title == "") { $title = stripslashes($row[0]); }
if ($contact == "") {
$contact = stripslashes($row[1]);
$is_new_contact = 0;
} else {
$is_new_contact = strcmp($contact, $row[1]);
}
$old_contact = $row[1];
if ($authors == "") { $authors = stripslashes($row[2]); }
if ($USE_AFFILIATIONS && ($affiliations == "")) {
$affiliations = stripslashes($row[3]);
}
if ($USE_ABSTRACTS && ($abstract == "")) {
$abstract = stripslashes($row[4]);
}
if ($USE_CATEGORIES && ($category == "")) {
$category = stripslashes($row[5]);
}
$status = stripslashes($row[6]);
$final_filename = stripslashes($row[7]); # used to re-enter when no file uploaded
$receipt = stripslashes($row[8]); # idem
$paper_id = stripslashes($row[9]);
if ($status != 'Accepted') {
### send warning mail to CONTACT
mail($CONTACT_EMAIL,
"$CONFERENCE_SHORT: ATTEMPTED camera ready version submission for Paper-Id $uid",
"ATTEMPTED camera ready version submission for Paper-Id $uid\n\nThe status of the paper is $status",
"From: $CONFERENCE_EMAIL\nReply-To: $CONFERENCE_EMAIL\nX-Mailer: PHP/" . phpversion());
print_esub_header("Camera ready submission failed");
print "Your paper has not been accepted.
";
print "If this is an error, please contact $CONTACT
";
print_esub_footer("cameraready.php3");
return;
}
### If user submitted a revision file, remove the old file and put the new one there.
### Otherwise, do nothing to the file.
if ($paperfile_name != "") {
### tell them to try again if they typed in a wrong filename
if (!file_exists($paperfile)) {
print_esub_header("Camera ready submission failed");
print "You have submitted a non-existent file. Please check that ";
print "your filename is correct and try again\n";
print_esub_footer("cameraready.php3");
return;
}
if ($final_filename != "" &&
file_exists($SUBMISSIONS_DIR . "/final/" . $final_filename)) {
if ($KEEP_REVISIONS) {
rename($SUBMISSIONS_DIR . "/final/" . $final_filename,
$SUBMISSIONS_DIR . "/finalrevisions/" . $final_filename);
} else {
unlink($SUBMISSIONS_DIR . "/final/" . $final_filename);
}
# else : first submission of camera ready version: nothing to do
}
$filename = $paper_id . "_" . $paperfile_name;
$cameraready_location = $SUBMISSIONS_DIR . "/final/" . $filename ;
if (file_exists($cameraready_location)) {
unlink($cameraready_location);
}
copy($paperfile, $cameraready_location);
chmod($cameraready_location, 0755);
$receipt = generate_receipt($cameraready_location);
} else {
# when not submitting a new paper, make sure al the old fields
# regarding the previously uploaded file (if any) are preserved
$filename = $final_filename;
$cameraready_location = $SUBMISSIONS_DIR . "/final/" . $filename ;
}
store_revision($uid, $title, $authors, $contact, $receipt, $category, $abstract, $affiliations, $filename);
if (has_administrator_access($script_name)) {
$submission_info = ascii_format_submission_info($title, $contact, $authors, $affiliations, $category, $abstract, $uid, $receipt, $filename);
send_cameraready_notice($CONFERENCE_EMAIL, $title, $submission_info . "\n\nChanges made by $PHP_AUTH_USER.\nMail NOT sent to " . $contact);
} else {
$submission_info = ascii_format_submission_info($title, $contact, $authors, $affiliations, $category, $abstract, $uid, $receipt, $paperfile_name);
send_cameraready_receipt($contact, $title, $submission_info);
$submission_info = ascii_format_submission_info($title, $contact, $authors, $affiliations, $category, $abstract, $uid, $receipt, $filename);
send_cameraready_notice($CONFERENCE_EMAIL, $title, $submission_info);
### If the contact person is changed, also notify the previous contact person.
# This protects against people sabotaging work of others and getting away with it.
if ($is_new_contact) {
send_cameraready_receipt($old_contact, $title, $submission_info);
}
}
$message = html_format_submission_info($title, $contact, $authors, $affiliations, $category, $abstract, $uid, $receipt, $paperfile_name);
print_esub_header("Revision received");
print "Your revision has been successfully received. Here's the information being sent to you via email.
";
print $message;
print "
We received your cameraready submission.
\n";
print "
If you don't receive an email with this information from us in a ";
print "reasonable amount of time, you may have mistyped the contact email address. ";
print "Please let us know.";
if (has_administrator_access($script_name)) {
print " Some tips:
The displayed box size does not limit the amount of text you can type; if
you have a long title or lots of authors, just keep typing. But there is a
maximum of $MAX_INPUT_LENGTH characters.
Make sure you input a postscript file in the corresponding field. If
you provide, for example, a directory name rather than a file name,
your browser may simply go into a loop and not send anything to our
server.
EOT;
echo "$html";
print_esub_footer("cameraready.php3");
}
?>
Mail NOT sent to the contact person.";
}
print_esub_footer("cameraready.php3");
}
} else {
print_esub_header("Camera ready version");
$html = <<