 			<p>
 				<a href="/new_collection.cfm?action=setColnStatus&scnrm=true&status=#status#&niid=#niid#">continue to change status from #old_status# to #status#</a>
 			</p>
+		<cfelse>
+			<cfset scnrm="true">
 		</cfif>
+		<cfif isdefined("scnrm") and scnrm is "true">
+			<cfquery name="d" datasource="user_login" username="#session.dbuser#" password="#decrypt(session.epw,session.sessionKey)#">
+				update pre_new_institution set status='#status#' where niid ='#niid#'
+			</cfquery>
+			<cfquery name="q" datasource="user_login" username="#session.dbuser#" password="#decrypt(session.epw,session.sessionKey)#">
+				select institution from pre_new_institution  where niid ='#niid#'
+			</cfquery>
+			<cfmail to="#mailtol#" subject="Arctos Join Request: Status Update" from="joinrequest@#Application.fromEmail#" cc="arctos.database@gmail.com" type="html">
+				Status has changed to #status# for pending institution #q.institution#
+			</cfmail>
+			<cflocation addtoken="false" url="/new_collection.cfm?action=manage&id=#hash(niid)#">
+		</cfif>
+
+
 	</cfoutput>
 </cfif>
 <!-------------------------------------->

<cfset title="New Collection Portal">
<!--- this should probably be a global setting; hard-code for now --->
<cfset mailtol="ccicero@berkeley.edu,campbell@carachupa.org,jegelewicz66@gmail.com,dustymc@gmail.com,lkv@berkeley.edu">
<cfif not isdefined("session.roles") or session.roles does not contain "global_admin">
	<!--- some sections of this form are public; others are restricted ---->
	<cfif

<cfif action is "setColnStatus">
	<cfoutput>
		<cfdump var=#form#>


		<cfif old_status is status>
			No changes - request denied<cfabort>
		<cfelseif status is "denied">
			Are you sure you want to set status to DENIED? This can be un-done only by a DBA with the authorization of the Arctos Working Group.
			<p>
				<a href="/new_collection.cfm?action=setColnStatus&scnrm=true&status=#status#&niid=#niid#">continue to set status</a>
			</p>
			<cfabort>
		<cfelseif old_status is "new" and status is not "approve_to_pre-create_collections">
			Out of order - request denied<cfabort>
		<cfelseif old_status is "approve_to_pre-create_collections" and status is not "approve_to_create_collections">
			Out of order - request denied<cfabort>
		<cfelseif old_status is "approve_to_create_collections" and status is not "complete">
			Out of order - request denied<cfabort>
		<cfelseif  status is "approve_to_create_collections">
			<cfquery name="cs" datasource="user_login" username="#session.dbuser#" password="#decrypt(session.epw,session.sessionKey)#">
				select * from pre_new_collection where niid=#niid#
			</cfquery>
