Stable merged into unstable again (due to failure on binary file during previous...
[fa-stable.git] / includes / data_checks.inc
index 798e84c4b5c10070a4526a2ccbc7a2ad987b0898..f50e94540319f94d40b1a684c2e93f7de3751081 100644 (file)
@@ -485,5 +485,16 @@ function check_num($postname, $min=null, $max=null, $dflt=0) {
     return 1;
 }
 
-
-?>
\ No newline at end of file
+function check_is_closed($type, $type_no, $msg=null)
+{
+       global $systypes_array;
+       
+    if (($type_no > 0) && is_closed_trans($type, $type_no))
+    {
+       if (!$msg)
+               $msg = sprintf(_("%s #%s is closed for further edition."), $systypes_array[$type], $type_no);
+       display_error($msg, true);
+       end_page();
+       exit;
+    }
+}