<!--#include file="CNCASPPageManager_PageLifeCycleOp.inc"-->

<%
' *****************************************************************************
' File:		/NR/System/WBC/Internals/WBCFuncPages/Cross-Browser/
'			PageOperation/PageLifeCycle/
'			PageLifeCycleOp.asp
'
' Author:	Microsoft Corporation.
' Purpose:	Process the workflow operation of a page. Entry point is Edit mode of
'			current page. Exit pt is back to the edit mode of the current page
'
' Query String Parameters:
'	IDS_QSTR_PAGEOPERATIONEDIT_LASTMODIFIEDDATE - Last modified date used for chking
'                                                 page in client was updated in the server by
'												  by someone else
'	IDS_QPARAM_WBCACTION - User's action. Possible values are submit, delete, approve and decline
' ************************************************************************

' ---- Initialize the ASPPageManager
Dim g_pASPPageManager
Set g_pASPPageManager = New CNCASPPageManager_PageLifeCycleOp
Call g_pASPPageManager.InitManager()

%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">

<html>
<head>
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="expires" content="-1">
<meta name="Author" content="Microsoft Corporation.">
<meta name="Description" content="Process the operation of a posting">
<meta name="robots" content="NOINDEX,NOFOLLOW">
<meta http-equiv="Content-Type" content="text/html;charset=<%= g_pASPPageManager.Charset %>">
<title><%= IDS_UI_BROWSER_TITLE %></title>
<% Call EmbedWBCHeadSection %>

</head>

<body>

<form name="NC_PageLifeCycleOp"
	  action=""
	  method="post"
	  enctype="multipart/form-data"
	  onsubmit="return false;">

<%	If (g_pASPPageManager.ErrorString() <> IDS_E_NO_ERROR) Then %>

	<table width="100%" border="0" cellspacing="0" cellpadding="0">

		<!-- Show the Top Title -->
		<tr class="WBC_styclsBackground1">
			<td align=right><img border=0 src="<%=IDS_PATH_IMAGE_LOGO %>"></td>
			<td width=100% valign="middle"  class="WBC_styclsHeaderText">
				<%= IDS_UI_PAGE_OPERATION %>
			</td>
			<td><img src="<%=IDS_TRANSPARENT_GIF%>"
						width="<%= C_INT_MAIN_MARGIN %>" height="<%=C_INT_HEADER_HEIGHT%>" border="0"></td>
		</tr>

		<!-- Show the breadcrumb trail -->
		<tr class="WBC_styclsBackground2">
			<td><img src="<%=IDS_TRANSPARENT_GIF%>"
				width="<%= C_INT_MAIN_MARGIN %>" height="<%=C_INT_SUBHEAD_HEIGHT%>" border="0"></td>
			<td class="WBC_styclsSubheadText">
<%		If g_pASPPageManager.ActionType = IDS_ACTION_SUBMIT Then %>
				<%=IDS_UI_PAGE_SUBMIT%>
<%		ElseIf g_pASPPageManager.ActionType = IDS_ACTION_APPROVE Then %>
				<%=IDS_UI_PAGE_APPROVE%>
<%		ElseIf g_pASPPageManager.ActionType = IDS_ACTION_DECLINE Then %>
				<%=IDS_UI_PAGE_DECLINE%>
<%		ElseIf g_pASPPageManager.ActionType = IDS_ACTION_DELETE Then %>
				<%=IDS_UI_PAGE_DELETE%>
<%		Else	%>
				<%=IDS_UI_ERR_UNKNOWN %>
<%		End If %>
			</td>
			<td><img src="<%=IDS_TRANSPARENT_GIF%>"
				width="<%= C_INT_MAIN_MARGIN %>" height="<%=C_INT_SUBHEAD_HEIGHT%>" border="0"></td>
		</tr>
		<tr>
			<td><img src="<%=IDS_TRANSPARENT_GIF%>"
				width="15" height="<%= C_INT_MAIN_SPACING %>" border="0"></td>
		</tr>

		<!-- Set the margin width for the rest of the page -->
		<tr>
			<td rowspan="999"><img src="<%=IDS_TRANSPARENT_GIF%>"
						width="<%= C_INT_MAIN_MARGIN %>" height="1" border="0"></td>
			<td><img src="<%=IDS_TRANSPARENT_GIF%>"
						width="100%" height="1" border="0"></td>
			<td rowspan="999"><img src="<%=IDS_TRANSPARENT_GIF%>"
						width="<%= C_INT_MAIN_MARGIN %>" height="1" border="0"></td>
		</tr>

		<!-- Display the fact that there is an error -->
		<tr>
			<td class="WBC_styclsBackground1">
				<table width="100%" border="0" cellspacing="<%= C_INT_THICK_BORDER %>" cellpadding="5">
					<tr class="WBC_styclsBackground2">
						<td>
							<span class="WBC_styclsHeavyTextColor1"><%= IDS_UI_ERROR %>:</span>&nbsp;&nbsp;
<%		If g_pASPPageManager.ErrorString() = IDS_E_PAGE_DOES_NOT_EXIST Then %>
						<span class="WBC_styclsTextColor1"><%= IDS_UI_PAGE_DOES_NOT_EXIST %></span>
<%		ElseIf g_pASPPageManager.ErrorString() = IDS_E_ERR_ACTION_TYPE_MISSING Then %>
						<span class="WBC_styclsTextColor1"><%= IDS_UI_ERR_ACTION_TYPE_MISSING %></span>
<%		ElseIf g_pASPPageManager.ErrorString() = IDS_E_ERR_IN_SUBMIT Then %>
						<span class="WBC_styclsTextColor1"><%= IDS_UI_ERR_IN_SUBMIT %></span>
<%		ElseIf g_pASPPageManager.ErrorString() = IDS_E_ERR_IN_APPROVE Then %>
						<span class="WBC_styclsTextColor1"><%= IDS_UI_ERR_IN_APPROVE %></span>
<%		ElseIf g_pASPPageManager.ErrorString() = IDS_E_ERR_IN_DECLINE Then %>
						<span class="WBC_styclsTextColor1"><%= IDS_UI_ERR_IN_DECLINE %></span>
<%		ElseIf g_pASPPageManager.ErrorString() = IDS_E_ERR_IN_DELETE Then %>
						<span class="WBC_styclsTextColor1"><%= IDS_UI_ERR_IN_DELETE %></span>
<%		Else %>
						<span class="WBC_styclsTextColor1"><%= IDS_UI_ERR_UNKNOWN %></span>
<%		End If %>
						</td>
					</tr>
					<tr class="WBC_styclsBackground2">
						<td>
							<span class="WBC_styclsHeavyTextColor1"><%= IDS_UI_ERROR_DESCRIPTION %>:</span>&nbsp;&nbsp;
							<span class="WBC_styclsTextColor1"><%= AutoSession.LastError.Description %></span>
						</td>
					</tr>
					<tr class="WBC_styclsBackground2">
						<td>
							<span class="WBC_styclsHeavyTextColor1"><%= IDS_UI_ERROR_DETAILS %>:</span>&nbsp;&nbsp;
							<span class="WBC_styclsTextColor1"><%= AutoSession.LastError.InternalDetails %></span>
						</td>
					</tr>
				</table>
			</td>
		</tr>
		<tr>
			<td colspan=3><img src="<%=IDS_TRANSPARENT_GIF%>"
				width="15" height="<%= C_INT_MAIN_SPACING %>" border="0"></td>
		</tr>
		<tr>
			<td colspan=3><%= IDS_UI_PLEASE_TRY_AGAIN %></td>
		</tr>
		<tr>
			<td colspan=3>
				<li>
					<a target="_self" href="#" onclick="WBC_submitForm('NC_PageLifeCycleOp', '<%= g_pASPPageManager.URLRetryActionLink %>'); return false">
					<%=IDS_UI_ATTEMPT%><%=LCase(g_pASPPageManager.ActionType)%><%=IDS_UI_OPERATION_AGAIN%> </a>
				</li>

				<li>
					<a target="_top" href="<%= g_pASPPageManager.URLCancelActionLink %>">
					<%=IDS_UI_CANCEL%><%=LCase(g_pASPPageManager.ActionType)%><%=IDS_UI_OPERATION%> </a>
				</li>

			</td>
		</tr>
	</table>
<%	Else
		If g_pASPPageManager.HookFailed Then
			' Note: URLGoToEditMode is based on whether hook failed or not
			'       For example, if in delete case, the pre delete hook return false, then
			'       what we want is return back to the "suppose to be deleted" node and
			'		not the channel node %>
			<script language="JavaScript" type="text/javascript">
			<!--
				window.top.location =  '<%= g_pASPPageManager.URLGoToEditMode %>'
			// -->
			</script>
<%		Else
			call ServerSideRedirect(g_pASPPageManager.URLGoToEditMode)
		End If
	End If
%>


</form>

</body>
</html>
