<?php // ============================================================================ // PREPRINTS/DELETE_PREPRINT.PHP // ============================================================================ require_once "config.manage.php"; core_declare_input("rowId"); if (!$authClass->isAdmin()) { errorPage("Preprints may only be deleted by administrative staff"); } $deleteRes = $dbClass->query("SELECT * FROM publications WHERE RowId='" . $rowId . "'"); $row = $dbClass->next_record($deleteRes); $q = $dbClass->query("UPDATE publications SET " . "Status='free', Field='', Location='', Authors='', " . "Title='', PublIn='' WHERE RowId='" . $rowId . "'"); mail2secretary("Deleted"); logIt("delete", pp_preprintID($row["Year"], $row["Report"]), uid2gecos($row["Id"])); if (file_exists($row["Location"])) { unlink($row["Location"]); } require "show_preprints.php";
} if (!($account = core_getpwuid($res_UID, $dbClass))) { bugPage("no account found for UID='{$res_UID}'"); } $res_login = $account["name"]; if (!$authClass->isAdmin() && $res_login != $AUTH_login) { errorPage("Reserving of preprint nbrs for others is only " . "permitted for administrative staff."); } $res_gecos = $account["gecos"]; $res_ppn = pp_reserveNumber($nor_pp_year, $res_UID, $field, $authors, $title); // reread back the record $q = $dbClass->query("SELECT * FROM publications WHERE Year={$nor_pp_year} AND Report={$res_ppn} AND Field='{$field}'"); $row = $dbClass->next_record($q); $_POST["rowId"] = $row["RowId"]; require "update_preprint.inc.php"; mail2secretary("Reserved"); mail_PPsubmitter("Reserved"); logIt("submit", pp_preprintID($nor_pp_year, $res_ppn), $res_gecos); echo x("p", x("i", "Preprint number <b>{$res_ppn}</b> has been reserved for {$res_gecos}<br>Please quote:")); show_preprint($_POST["rowId"], "index.php", $showcancelButton = False); endPage(); // ========================================================================== /// @fn void ( void ) /// /// ... /// /// @global /// @parameter ... /// @return ... /// @gobals[out] - none /// @sideeffect - none
function mailReminder() { // remind about pending preprint global $row, $mailClass; mail2secretary("Reminder"); }
$t = new table("class='framed'", "<center>" . "<form action='update_preprint.php' enctype='multipart/form-data' method='post'>\n" . "<input type='hidden' name='pp_id' value='" . pp_preprintID($row["Year"], $row["Report"]) . "'>\n" . "<input type='hidden' name='nor_pp_period' value='{$nor_pp_period}'>\n" . "<input type='hidden' name='nor_pp_mode' value='{$nor_pp_mode}'>\n"); getEditDialog(); $t->tro("align='left'"); $t->th("", "entry owner"); $t->td("", make_user_selection($row["Id"])); $t->trc(); $t->tr("", "", "<input name='button' type='submit' value='continue'> " . "<input name='button' type='submit' value='cancel'>", " "); $t->close("</form></center>"); break; case NOR_PP_MODE_REGISTER: nor_pp_require_row_owner($rowId, $AUTH_login); startPage("Preprint registered in database"); $dbClass->query("UPDATE publications SET Status='registered',Tm='" . time() . "' WHERE RowId='{$rowId}'"); $res = $dbClass->query("SELECT * FROM publications WHERE RowId={$rowId}"); $row = mysql_fetch_array($res); mail2secretary("Registered"); echo "<p>Your preprint has been registered, and is waiting for acceptance</p>\n"; echo "<p><a href='show_preprints.php'>Return to preprints</a>.</p>"; show_preprint($rowId, "show_preprints.php"); break; case NOR_PP_MODE_DELETE: nor_pp_require_row_owner($rowId, $AUTH_login); startPage("Delete Preprint"); echo "<h2>Do you want to delete this preprint ?</h2>\n"; show_preprint($rowId, "delete_preprint.php"); break; case NOR_PP_MODE_ACCEPT: if ($authClass->isAdmin()) { startPage("Accept Preprint"); echo "<h2>Do you want to accept the following preprint ?</h2>\n"; show_preprint($rowId, "accept_preprint.php");
<?php // ============================================================================ // PREPRINTS/ACCEPT_PREPRINT.PHP // ============================================================================ include_once "config.manage.php"; core_declare_input("rowId"); if (!$authClass->isAdmin()) { errorPage("Preprints may only be accepted by administrative staff"); } $time = time(); $dbClass->query("update publications set Status='ok', Tm=" . $time . " where RowId=" . $rowId); $res = $dbClass->query("select * from publications where RowId=" . $rowId); while ($row = $dbClass->next_record($res)) { mail2secretary("Accepted"); logIt("accept", pp_preprintID($row["Year"], $row["Report"]), uid2gecos($row["Id"])); } header("Location: show_preprints.php");