|
From: <ken...@us...> - 2008-09-11 21:36:02
|
Revision: 655
http://andro.svn.sourceforge.net/andro/?rev=655&view=rev
Author: kendowns
Date: 2008-09-11 21:36:12 +0000 (Thu, 11 Sep 2008)
Log Message:
-----------
Modified Paths:
--------------
trunk/andro/application/androBuild.php
Modified: trunk/andro/application/androBuild.php
===================================================================
--- trunk/andro/application/androBuild.php 2008-09-11 03:56:44 UTC (rev 654)
+++ trunk/andro/application/androBuild.php 2008-09-11 21:36:12 UTC (rev 655)
@@ -3829,18 +3829,31 @@
// The EMPTY clause determines what to do if empty.
// Normally that is an error, but the "Allow_empty" flag
- // gives 'em a pass. Notice the HUGE ASSUMPTION that
- // allow empty has a single-column key.
+ // gives 'em a pass.
+ // KFD 9/11/08, this used to ASSUME a single-column key,
+ // now we allow multi-column keys
//
if ($ufk["allow_empty"] == "Y") {
- $chd = $chdlist[0];
- $chd_type = $this->utabs[$ufk["table_id_chd"]]["flat"][$chd]["formshort"];
- //$this->logEntry("Doing $chd_type for $chd");
- $chd_blank= ($chd_type=='int' || $chd_type=='numb') ? "0" : '####';
- //$emptyList .= $this->AddList($emptyList," || ")."COALESCE(new.".$chd.",####)";
+ # KFD 9/11/08. For PROMAT application, our first need to
+ #
+ #$chd = $chdlist[0];
+ #$chd_type = $this->utabs[$ufk["table_id_chd"]]["flat"][$chd]["formshort"];
+ #$chd_blank= ($chd_type=='int' || $chd_type=='numb') ? "0" : '####';
+ #$onEmpty =
+ # " -- 8001 FK Insert/Update Child Validation\n".
+ # " IF COALESCE(new.$chd,$chd_blank) <> $chd_blank THEN\n";
+ $lEmpty = array();
+ foreach($chdlist as $chd) {
+ $chd_type
+ =$this->utabs[$ufk["table_id_chd"]]["flat"][$chd]["formshort"];
+ $chd_blank= ($chd_type=='int' || $chd_type=='numb') ? "0" : '####';
+ $lEmpty[] = "COALESCE(NEW.$chd,$chd_blank) <> $chd_blank";
+ }
$onEmpty =
- " -- 8001 FK Insert/Update Child Validation\n".
- " IF COALESCE(new.$chd,$chd_blank) <> $chd_blank THEN\n";
+ " -- 8001 FK Insert/Update Child Validation\n".
+ " IF ".implode("\n AND ",$lEmpty)." THEN\n";
+ #
+ # KFD 9/11/08 (END)
}
else {
$onEmpty="";
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|