[Mydatabasepilot-cvs] MyDatabasePilot/dbProcessInit AddField.cfm,1.5,1.6
Status: Alpha
Brought to you by:
nanoface
From: <nan...@us...> - 2003-06-12 04:34:46
|
Update of /cvsroot/mydatabasepilot/MyDatabasePilot/dbProcessInit In directory sc8-pr-cvs1:/tmp/cvs-serv17649/dbProcessInit Modified Files: AddField.cfm Log Message: Internal Structure Changed: [ 753072 ] Moved FORM.fieldType#i# default setting From: dbProcessBody/AddField.cfm To: dbProcessInit/AddField.cfm Also changed value of select field fieldType#i# From: #Evaluate("FORM.fieldType#i#")# To: alterSpec[i].colType Index: AddField.cfm =================================================================== RCS file: /cvsroot/mydatabasepilot/MyDatabasePilot/dbProcessInit/AddField.cfm,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** AddField.cfm 12 Jun 2003 03:43:34 -0000 1.5 --- AddField.cfm 12 Jun 2003 04:34:42 -0000 1.6 *************** *** 1,67 **** ! <!---******************************************************************************************* ! * Copyright: MyDatabase Pilot is distributed under the terms of the GNU GPL license * ! * Template: dbProcessInit/AddField.cfm * ! * Purpose: Initialize AddField Database Process * ! ********************************************************************************************---> ! ! <!---||| Set Default Values |||---> ! <cfparam name="FORM.numberOfFields" default="1" /> ! <cfparam name="FORM.locationOfFields" default="End" /> ! ! <!--- Initiate a Read Only lock to ensure the integrity of session variables ---> ! <cflock timeout=20 throwontimeout="no" type="readonly" scope="SESSION"> ! <!----------------------------------------------------> ! <!--- Get List of Field Names and Their Properties ---> ! <!----------------------------------------------------> ! <cfmodule template="../Query/fieldList.cfm" ! queryName="fieldList" ! datasource="#SESSION.dataSource#" ! username="#SESSION.userName#" ! password="#SESSION.password#" ! table="#URL.table#" /> ! ! <!-----------------------------------> ! <!--- Create alterSpec Definition ---> ! <!-----------------------------------> ! <!--- Create alterSpec one dimensional array ---> ! <cfset alterSpec=ArrayNew(1) /> ! ! <!---||| Loop over each new field |||---> ! <cfloop from="1" to="#FORM.numberOfFields#" index="i"> ! <!--- Create a Structure for each new field ---> ! <cfset alterSpec[i]=StructNew() /> ! <cfset alterSpec[i].format="ADD COLUMN" /> ! <cfparam name="FORM.fieldName#i#" default="" /> ! <cfset alterSpec[i].colName="#Evaluate("FORM.fieldName#i#")#" /> ! </cfloop> ! ! <!-------------------------------------------------> ! <!--- Invoke alterTable Custom Tag via CFModule ---> ! <!-------------------------------------------------> ! <!---||| If execution of Alter Table was requested by the form ... |||---> ! <cfif IsDefined("FORM.ExecuteAlterTable")> ! <!--- Get Generated SQL and execute it ---> ! <cfmodule template="../Query/alterTable.cfm" ! datasource="#SESSION.dataSource#" ! username="#SESSION.userName#" ! password="#SESSION.password#" ! table="#URL.table#" ! alterSpec="#alterSpec#" ! execute="TRUE" ! sqlOutputType="BOTH" ! rawOutput="rawOutput" ! htmlOutput="htmlOutput"> ! </cfmodule> ! <!--- Otherwise ... ---> ! <cfelse> ! <!--- Get Generated SQL, but do not execute it ---> ! <cfmodule template="../Query/alterTable.cfm" ! table="#URL.table#" ! alterSpec="#alterSpec#" ! execute="FALSE" ! sqlOutputType="BOTH" ! rawOutput="rawOutput" ! htmlOutput="htmlOutput"> ! </cfmodule> ! </cfif> </cflock> --- 1,69 ---- ! <!---******************************************************************************************* ! * Copyright: MyDatabase Pilot is distributed under the terms of the GNU GPL license * ! * Template: dbProcessInit/AddField.cfm * ! * Purpose: Initialize AddField Database Process * ! ********************************************************************************************---> ! ! <!---||| Set Default Values |||---> ! <cfparam name="FORM.numberOfFields" default="1" /> ! <cfparam name="FORM.locationOfFields" default="End" /> ! ! <!--- Initiate a Read Only lock to ensure the integrity of session variables ---> ! <cflock timeout=20 throwontimeout="no" type="readonly" scope="SESSION"> ! <!----------------------------------------------------> ! <!--- Get List of Field Names and Their Properties ---> ! <!----------------------------------------------------> ! <cfmodule template="../Query/fieldList.cfm" ! queryName="fieldList" ! datasource="#SESSION.dataSource#" ! username="#SESSION.userName#" ! password="#SESSION.password#" ! table="#URL.table#" /> ! ! <!-----------------------------------> ! <!--- Create alterSpec Definition ---> ! <!-----------------------------------> ! <!--- Create alterSpec one dimensional array ---> ! <cfset alterSpec=ArrayNew(1) /> ! ! <!---||| Loop over each new field |||---> ! <cfloop from="1" to="#FORM.numberOfFields#" index="i"> ! <!--- Create a Structure for each new field ---> ! <cfset alterSpec[i]=StructNew() /> ! <cfset alterSpec[i].format="ADD COLUMN" /> ! <cfparam name="FORM.fieldName#i#" default="" /> ! <cfset alterSpec[i].colName="#Evaluate("FORM.fieldName#i#")#" /> ! <cfparam name="FORM.fieldType#i#" default="" /> ! <cfset alterSpec[i].colType="#Evaluate("FORM.fieldType#i#")#" /> ! </cfloop> ! ! <!-------------------------------------------------> ! <!--- Invoke alterTable Custom Tag via CFModule ---> ! <!-------------------------------------------------> ! <!---||| If execution of Alter Table was requested by the form ... |||---> ! <cfif IsDefined("FORM.ExecuteAlterTable")> ! <!--- Get Generated SQL and execute it ---> ! <cfmodule template="../Query/alterTable.cfm" ! datasource="#SESSION.dataSource#" ! username="#SESSION.userName#" ! password="#SESSION.password#" ! table="#URL.table#" ! alterSpec="#alterSpec#" ! execute="TRUE" ! sqlOutputType="BOTH" ! rawOutput="rawOutput" ! htmlOutput="htmlOutput"> ! </cfmodule> ! <!--- Otherwise ... ---> ! <cfelse> ! <!--- Get Generated SQL, but do not execute it ---> ! <cfmodule template="../Query/alterTable.cfm" ! table="#URL.table#" ! alterSpec="#alterSpec#" ! execute="FALSE" ! sqlOutputType="BOTH" ! rawOutput="rawOutput" ! htmlOutput="htmlOutput"> ! </cfmodule> ! </cfif> </cflock> |