 
 
 ---->
+
+<cfif action is "edit">
+	<p>
+		<a href="/Admin/CodeTableEditor.cfm">Back to table list</a>
+	</p>
+	<cfif tbl is "CTGEOLOGY_ATTRIBUTE">
+		<!----
+			<cflocation url="/info/geol_hierarchy.cfm" addtoken="false">
+			let's do this inline
+		---->
+		<cflocation url="CodeTableEditor.cfm?action=editGeologyTree">
+	<cfelseif tbl is "ctspecimen_part_name"><!---------------------------------------------------->
+		<!----<cflocation url="/Admin/ctspecimen_part_name.cfm" addtoken="false">---->
+		<cflocation url="CodeTableEditor.cfm?action=editSpecimenPart">
+	<cfelseif tbl is "CTATTRIBUTE_TYPE"><!---------------------------------------------------->
+		<cflocation url="/Admin/ctattribute_type.cfm" addtoken="false">
+	<cfelseif tbl is "ctspec_part_att_att"><!---------------------------------------------------->
+		<cflocation url="/Admin/ctspec_part_att_att.cfm" addtoken="false">
+	<cfelseif tbl is "ctmedia_license"><!---------------------------------------------------->
+		<cflocation url="/Admin/ctmedia_license.cfm" addtoken="false">
+	<cfelseif tbl is "ctattribute_code_tables"><!---------------------------------------------------->
+		<cflocation url="CodeTableEditor.cfm?action=editAttCodeTables">
+	<cfelseif tbl is "ctpublication_attribute"><!---------------------------------------------------->
+		<cflocation url="CodeTableEditor.cfm?action=editPubAtt">
+	<cfelseif tbl is "cttaxon_term"><!---------------------------------------------------->
+		<cflocation url="CodeTableEditor.cfm?action=editTaxTrm">
+	<cfelseif tbl is "ctcoll_other_id_type"><!--------------------------------------------------------------->
+		<cflocation url="CodeTableEditor.cfm?action=editCollOIDT">
+	<cfelseif tbl is "ctspecimen_part_list_order"><!--- special section to handle  another  funky code table --->
+		<cflocation url="CodeTableEditor.cfm?action=editSpecPartOrder">
+	<cfelseif tbl is "ctcollection_cde"><!--- this IS the thing that makes this form funky.... --->
+		use SQL<cfabort>
+	<cfelse><!---------------------------- normal CTs --------------->
+		<cfquery name="asldfjaisakdshas" datasource="user_login" username="#session.dbuser#" password="#decrypt(session.epw,session.sessionKey)#" cachedwithin="#createtimespan(0,0,60,0)#">
+			select * from #tbl# where 1=2
+		</cfquery>
+		<cfif listcontainsnocase(asldfjaisakdshas.columnlist,'collection_cde')>
+			<cflocation url="CodeTableEditor.cfm?action=editWithCollectionCode&tbl=#tbl#">
+		<cfelse>
+			<cflocation url="CodeTableEditor.cfm?action=editNoCollectionCode&tbl=#tbl#">
+		</cfif>
+	</cfif>
+</cfif>
+<!--------------------------------------------->
+
 <cfquery name="ctcollcde" datasource="user_login" username="#session.dbuser#" password="#decrypt(session.epw,session.sessionKey)#" cachedwithin="#createtimespan(0,0,60,0)#">
 	select distinct collection_cde from ctcollection_cde
 </cfquery>

				<cfset i = #i#+1>
			</cfloop>
		</table>
	<cfelseif tbl is "ctspecimen_part_list_order"><!--- special section to handle  another  funky code table --->
		<cfquery name="thisRec" datasource="user_login" username="#session.dbuser#" password="#decrypt(session.epw,session.sessionKey)#">
			select * from ctspecimen_part_list_order order by
			list_order,partname

			</cfloop>
		</table>
		---->

</cfif>
<!---------------------------------------------------------------------------->
<cfif action is "editCollOIDT">


		<cfquery name="q" datasource="user_login" username="#session.dbuser#" password="#decrypt(session.epw,session.sessionKey)#">
			select * from ctcoll_other_id_type order by sort_order,other_id_type
		</cfquery>
