 		</p>
 	</cfoutput>
 </cfif>
+<!------------------------------------------------------>
+
+<cfif action is "edit_collection">
+	<cfoutput>
+		<!--- pre-check this ---->
+		<cfif len(LOAN_POLICY_URL) gt 0 and not isvalid('url',LOAN_POLICY_URL)>
+			LOAN_POLICY_URL is not a valid URL. Use your back button.<cfabort>
+		</cfif>
+
+
+		<cfquery name="u" datasource="user_login" username="#session.dbuser#" password="#decrypt(session.epw,session.sessionKey)#">
+			update pre_new_collection set
+				GUID_PREFIX='#GUID_PREFIX#',
+				COLLECTION_CDE='#COLLECTION_CDE#',
+				INSTITUTION_ACRONYM='#INSTITUTION_ACRONYM#',
+				DESCR='#escapeQuotes(DESCR)#',
+				COLLECTION='#COLLECTION#',
+				LOAN_POLICY_URL='#LOAN_POLICY_URL#',
+				INSTITUTION='#INSTITUTION#',
+				PREFERRED_TAXONOMY_SOURCE='#PREFERRED_TAXONOMY_SOURCE#',
+				CATALOG_NUMBER_FORMAT='#CATALOG_NUMBER_FORMAT#',
+				USE_LICENSE_ID=<cfif len(USE_LICENSE_ID) gt 0>#USE_LICENSE_ID#<cfelse>null</cfif>,
+				WEB_LINK='#WEB_LINK#',
+				WEB_LINK_TEXT='#WEB_LINK_TEXT#',
+				mentor='#mentor#',
+				mentor_contact='#mentor_contact#',
+				contact_email='#contact_email#',
+				admin_username='#admin_username#'
+			where
+				ncid=#ncid#
+		</cfquery>
+		<cflocation addtoken="false" url="/new_collection.cfm?action=manage&id=#hash(niid)####guid_prefix#">
+	</cfoutput>
+</cfif>
+<!------------------------------------------------------>
 
 <cfif action is "setColnStatus">
 	<cfquery name="d" datasource="user_login" username="#session.dbuser#" password="#decrypt(session.epw,session.sessionKey)#">

		</div>

		<cfif d.status is "approve_to_pre-create_collections">
			<div class="infoDiv">
				Use this form to pre-create collections. This should be done by the person who will manage the collection and their assigned Mentor.
			</div>

			<cfdump var=#c#>


			<cfloop query="c">
				<p>
					<a name="#c.guid_prefix#"></a>
				</p>
				<form name="f" method="post" action="new_collection.cfm">
					<input type="hidden" name="action" value="edit_collection">
					<input type="hidden" name="niid" value="#d.niid#">
					<input type="hidden" name="ncid" value="#c.ncid#">
					<div class="infoDiv">
						GUID_Prefix is the core of the primary specimen identifier. It is combined with catalog number and Arctos' URL to
						produce a resolvable globally-unique specimen identifier. This must be unique across all Arctos collections.
						The format MUST be {string}:{string}. GUID_Prefix cannot be changed without breaking all links to specimens; choose carefully.
						The traditional format is {institution_acronym}:{collection_cde}, but this is not a requirement. Maximum length is 20 characters.
						You may wish to register your collection in <a href="http://grbio.org" target="_blank" class="external">GRBIO</a>.
						<ul>
							<li><a target="_blank" class="external" href="http://handbook.arctosdb.org/documentation/catalog.html##guid-prefix">Documentation</a></li>
						</ul>
						<label for="GUID_PREFIX">GUID_Prefix</label>
						<input type="text" name="GUID_PREFIX" id="GUID_PREFIX" class="reqdClr" required value="#c.GUID_PREFIX#">
					</div>

					<div class="infoDiv">
						Collection is displayed as a child of institution in the Collection search box on SpecimenSearch.
						It should be the same for all collections of similar type across institutions. Examples:

						<ul>
							<li>Amphibian and reptile specimens</li>
							<li>Insect specimens</li>
							<li>Mammal observations</li>
						</ul>
						<ul>
							<li><a target="_blank" class="external" href="http://handbook.arctosdb.org/documentation/catalog.html##collection">Documentation</a></li>
						</ul>

						<label for="COLLECTION">Collection</label>
						<input type="text" name="COLLECTION" id="COLLECTION" class="reqdClr" required value="#c.COLLECTION#" size="80">
					</div>
					<div class="infoDiv">
						Collection Code controls which code tables your collection will use.
						<ul>
							<li><a target="_blank" class="external" href="http://handbook.arctosdb.org/documentation/catalog.html##collection-code">Documentation</a></li>
							<li><a target="_blank" class="external" href="http://arctos.database.museum/info/ctDocumentation.cfm?table=CTCOLLECTION_CDE">Code Table</a></li>
						</ul>

						<label for="COLLECTION_CDE">Collection Code</label>
						<select name="COLLECTION_CDE" id="COLLECTION_CDE" class="reqdClr" required>
							<cfloop query="ctcollection_cde">
								<option	<cfif c.collection_cde is ctcollection_cde.collection_cde> selected="selected" </cfif>
									value="#collection_cde#">#collection_cde#</option>
							</cfloop>
						</select>
					</div>
					<div class="infoDiv">
						Description of the collection. Maximum length is 4000 characters.
						<ul>
							<li><a target="_blank" class="external" href="http://handbook.arctosdb.org/documentation/catalog.html##description">Documentation</a></li>
						</ul>

						<label for="DESCR">Description</label>
						<textarea class="hugetextarea reqdClr" name="DESCR" id="DESCR" required >#c.DESCR#</textarea>
					</div>
					<div class="infoDiv">
						URL to more information, such as the collection's home page.
						<label for="WEB_LINK">Web Link</label>
						<input type="text" name="WEB_LINK" id="WEB_LINK"  value="#c.WEB_LINK#" size="80">
					</div>
					<div class="infoDiv">
						Clickable text to display with web link.
						<label for="WEB_LINK_TEXT">Web Link Text</label>
						<input type="text" name="WEB_LINK_TEXT" id="WEB_LINK_TEXT" value="#c.WEB_LINK_TEXT#" size="80">
					</div>
					<div class="infoDiv">
						License to govern the usage of your data in Arctos. File an Issue if you need a new license. Note that data shared via DWC
						may be licensed differently, and Media are individually licensed.

						<ul>
							<li><a target="_blank" class="external" href="/info/ctDocumentation.cfm?table=CTMEDIA_LICENSE">Code Table</a></li>
						</ul>
						<label for="USE_LICENSE_ID">License</label>
						<select name="use_license_id" id="use_license_id" >
							<option value="NULL">-none-</option>
							<cfloop query="CTMEDIA_LICENSE">
								<option	<cfif c.use_license_id is MEDIA_LICENSE_ID> selected="selected" </cfif>
									value="#MEDIA_LICENSE_ID#">#DISPLAY#</option>
							</cfloop>
						</select>
					</div>
					<div class="infoDiv">
						Allowable format of catalog number. Integer provides more functionality and is preferred. Please discuss with your Mentor
						if you are considering anything else.

						<ul>
							<li><a target="_blank" class="external" href="http://handbook.arctosdb.org/documentation/catalog.html##catalog-number">Documentation</a></li>
						</ul>
						<label for="CATALOG_NUMBER_FORMAT">Catalog Number Format</label>
						<select name="catalog_number_format" id="catalog_number_format" class="reqdClr" required >
							<option <cfif d.catalog_number_format is "integer">selected="selected" </cfif>value="integer">integer</option>
							<option <cfif d.catalog_number_format is "prefix-integer-suffix">selected="selected" </cfif>value="prefix-integer-suffix">prefix-integer-suffix</option>
							<option <cfif d.catalog_number_format is "string">selected="selected" </cfif>value="string">string</option>
						</select>
					</div>
					<div class="infoDiv">
						URL to collection's loan policy. A loan policy is required; the contents of the loan policy are entirely up to the data owners.
						File an Issue for assistance in creating or hosting a loan policy.

						<label for="LOAN_POLICY_URL">Loan Policy URL</label>
						<input type="text" name="LOAN_POLICY_URL" id="LOAN_POLICY_URL" class="reqdClr" required value="#c.LOAN_POLICY_URL#" size="80">
					</div>
					<div class="infoDiv">
						Taxonomy Source is "your" classification. Choose an existing source, or file an Issue to import data or use an external
						source through GlobalNames.org.
						<ul>
							<li><a target="_blank" class="external" href="http://handbook.arctosdb.org/documentation/taxonomy.html##source-arctos">Documentation</a></li>
							<li><a target="_blank" class="external" href="http://handbook.arctosdb.org/how_to/How-to-manage-taxonomic-classifications.html">How-To</a></li>
						</ul>

						<label for="PREFERRED_TAXONOMY_SOURCE">Taxonomy Source</label>
						<select name="preferred_taxonomy_source" id="preferred_taxonomy_source" class="reqdClr" required>
							<cfloop query="cttaxonomy_source">
								<option	<cfif c.preferred_taxonomy_source is cttaxonomy_source.source> selected="selected" </cfif>
									value="#source#">#source#</option>
							</cfloop>
						</select>
					</div>
					<div class="infoDiv">
						Person(s) who will work with the collection during import and initial use.
						<label for="mentor">mentor (Arctos username preferred; comma-list OK)</label>
						<input type="text" name="mentor" id="mentor"  value="#c.mentor#" size="80">
					</div>
					<div class="infoDiv">
						Mentor's email; how can we contact the Mentor?
						<label for="mentor_contact">mentor_contact (email; comma-list OK)</label>
						<input type="text" name="mentor_contact" id="mentor_contact" value="#c.mentor_contact#" size="80">
					</div>
					<div class="infoDiv">
						Arctos username(s) who will receive initial manage_collection access. Comma-separated list OK. These Operators can
						create and manage other collection users. Anyone listed here should already have an Arctos account arranged by the Mentor.

						<ul>
							<li><a target="_blank" class="external" href="http://handbook.arctosdb.org/documentation/users.html">Documentation</a></li>
							<li><a target="_blank" class="external" href="http://handbook.arctosdb.org/how_to/How-to-Create-a-New-User-Account-for-Operators.html">How-To</a></li>
							<li><a target="_blank" class="external" href="http://handbook.arctosdb.org/how_to/How-to-Invite-an-Operator.html">How-To</a></li>
						</ul>
						<label for="admin_username">admin_username</label>
						<input type="text" name="admin_username" id="admin_username"  value="#d.admin_username#" size="80">
					</div>

					<div class="infoDiv">
						Primary email contact for collection personell. Comma-list is OK.
						<label for="contact_email">contact_email</label>
						<input type="text" name="contact_email" id="contact_email" value="#d.contact_email#" size="80">
					</div>
					<br><input type="submit" value="Update Collection Request">
				</form>
			</cfloop>
		</cfif>
	</cfoutput>
</cfif>
<!-------------------------------------------------------------------------------------->

<!-------------------------------------------------------------------------------------->
<cfif action is "createInstitutionRequest">
