* @name Quering
* @{ */
+ /**
+ * Get the number of reported errors
+ * @return int
+ */
+ public function getNumErrorReports() {
+ $ar = pg_fetch_array(db_query("SELECT COUNT(*) AS count FROM mod_errorreporter;"), 0);
+ return intval($ar["count"]);
+ }
+
/**
* Get all error reports in the database.
* If this function fails, it returns <tt>null</tt>. Call getLastError() to get more information.
}
// Show already existent (and visible) error reports
-Title(_c("error-reporter:Reports that have already been submitted:"));
-echo sprintf("<p>%s</p>", _c("error-reporter:These errors should not be resubmitted."));
-$view->printErrorReports($doc->getErrorReports(array(ER_ERM_SORT_DATE => ER_ERM_SORT_DESC)));
+if($doc->getNumErrorReports() > 0) {
+ Title(_c("error-reporter:Reports that have already been submitted:"));
+ echo sprintf("<p>%s</p>", _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 "<p />\n";