From 185eecff52ed662395ac4846bd7ec579b26a2880 Mon Sep 17 00:00:00 2001 From: Jason Woofenden Date: Thu, 13 Nov 2008 08:29:11 -0500 Subject: [PATCH] metaform: fixed SQL for decimal and other weird numeric types --- metaform.php | 2 +- metaform/template.php | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/metaform.php b/metaform.php index f7a5740..e9c73ec 100644 --- a/metaform.php +++ b/metaform.php @@ -170,7 +170,7 @@ function make_sql() { if($sql != 'n/a') { $tem->set('name', $name); $tem->set('type', $sql); - if($sql == 'int') { + if(substr($sql, 0, 3) == 'int' || substr($sql, 0, 7) == 'decimal') { $tem->set('default', '0'); } elseif($format == 'yesno') { $tem->set('default', '"No"'); diff --git a/metaform/template.php b/metaform/template.php index a0b657f..7697c48 100644 --- a/metaform/template.php +++ b/metaform/template.php @@ -88,6 +88,8 @@ function ~form_name~_main() { if($ret) { return $ret; } + + # sections displayed with tem_show() will be coppied to the main template if you have one. tem_show('main_body'); } -- 1.7.10.4