heading for reported errors is only shown if there are already reported errors
[iserv-mod-error-reporter.git] / src / index.php
index f02af6c..725a98d 100644 (file)
@@ -122,9 +122,11 @@ if(($getAction == "submit" and $postSubmit == _("Insert")))
 }
 
 // Show already existent (and visible) error reports
 }
 
 // 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";
 
 // Form for submitting a new error report
 echo "<p />\n";
This page took 0.021722 seconds and 4 git commands to generate.