td.errors-form-description { width: 12em; } "); $getAction = @$_GET["action"]; $getUid = @$_GET["uid"]; $postMachine = @stripslashes($_POST["machine"]); $postText = @stripslashes($_POST["text"]); $postHidden = @$_POST["hidden"]; $postSubmit = @$_POST["submit"]; $strError = ""; PageBlue(_c("error-reporter:Report an error"), "mod_error-reporter"); if(!erConfig::userHasAccess()) { printf("
%s
\n", ER_ERROR_ACCESS_DENIED); _PageBlue(); exit(); } // Probably we have to delete an error report if($getAction == "delete" and isset($getUid)) { // Are you really sure? if(@$_POST["surely_delete"] == _("Delete")) { $doc->deleteErrorReport($getUid); // Reload to get rid of POST data header("Location: {$_SERVER["PHP_SELF"]}"); } elseif(@$_POST["surely_cancel"] == _("Cancel")) { header("Location: {$_SERVER["PHP_SELF"]}"); } else { // Ask the user to delete the message Title(_c("error-reporter:Delete an error report")); // Check if the specified report exists if(!$doc->getErrorReportByID($getUid)) { echo sprintf("%s
", _c("error-reporter:The specified error report does not exist!")); Option(_("Back"), null, "href='".$_SERVER["PHP_SELF"]."'", "back"); } else { if(erConfig::userIsAdmin() or $doc->userIsOwner($getUid)) { echo sprintf("", _("Delete"), _("Cancel")); } else { echo sprintf("%s
", _c("error-reporter:You are not allowed to delete this report.")); Option(_("Back"), null, "href='".$_SERVER["PHP_SELF"]."'", "back"); } } _PageBlue(); exit(); } } // form for reloading the page via javascript echo sprintf("\n", $_SERVER["PHP_SELF"]); // probably we have to insert an error report if(($getAction == "submit" and $postSubmit == _c("error-reporter:Submit"))) { // All fields must be filled out if((trim($postMachine) == "") or (trim($postText) == "")) { $strError = _c("error-reporter:You have to fill out all the fields in ". "the form."); } else { // Write to database $nNewUid = null; $er = new erErrorReport(time(), $_SESSION["act"], $postMachine, $postText, $postHidden == "true"); try { $nNewUid = $doc->writeErrorReport($er); } catch(Exception $e) { echo sprintf("%s
", $e->getMessage()); } if($nNewUid !== null) { echo sprintf("%s
", _c("error-reporter:The report was ". "submitted. Thank you for your help.")); } $postText = ""; $postMachine = ""; $postHidden = "false"; } } // Show already existent (and visible) error reports if($doc->getNumErrorReports() > 0) { Title(_c("error-reporter:Reports that have already been submitted:")); echo sprintf("%s
", _c("error-reporter:These errors should not be ". "resubmitted.")); $view->printErrorReports($doc->getErrorReports(array(ER_ERM_SORT_DATE => ER_ERM_SORT_DESC))); } // Form for submitting a new error report echo "\n"; Title(_c("error-reporter:Report an error")); Option(_c("error-reporter:Recommened reading"), _c("error-reporter:“How to ". "Report Bugs Effectively”, by Simon G. Tatham"), "target='_blank' href='". _c("error-reporter:http://www.chiark.greenend.org.uk/~sgtatham/bugs.html"). "'"); // Print the error here if($strError != "") echo "$strError
\n"; echo sprintf("%s
\n", _c("error-reporter:Please write your report as ". "precise as possible to help us solve the problem. The more precise the ". "report is, the faster the error can be fixed. Please include also any ". "error messages you have recieved.")); echo "\n"; _PageBlue(); ?>