<!-- #include virtual="/NR/System/WBC/Internals/Integration/InternalHooks/URLGenerationHooks/TaskAssistantHooks.inc" -->
<!-- #include virtual="/NR/System/WBC/Customizable/Hooks/URLGenerationHooks/TaskAssistantHooks.inc" -->

<%
' *****************************************************************************
' Copyright (C) 2001 Microsoft Corporation. All rights reserved.
'
'	IMPORTANT.  Please read the legal.txt file, located in the
'	"<CMS Install Directory>\Server\httpexec\WBC\Internals"
'	directory, governing the use of this internal file."
' *****************************************************************************

' *****************************************************************************
'
' File:		/NR/System/WBC/Internals/LinksSupport/TasksAssistant.inc
'
' Version: 	Microsoft Content Management Server
' Author:	Microsoft Corporation.
'
' Purpose:	Provides helper functions for the WBC console to get the
'			required URL for invoking the various tasks assistant
'			dialogs, namely the Production Manager and Approval Assistant.
'
' *****************************************************************************


' -----------------------------------------------------------------------------
'
'	[PUBLIC] Return the URL required to invoke the Approval Assistant dialog.
'
' -----------------------------------------------------------------------------
Function GetApprovalAssistantURL()

	GetApprovalAssistantURL = "#"

	If IsWBCVisible Then

		' -- Disable WBC mode propagation policy because we want to
		'		generate all the query string parameters ourselves
		Call DisableROMPropagationPolicyForWBCMode()

		Dim pThis
		Set pThis = GetCurrentObject()

		GetApprovalAssistantURL = IDS_FRAMEWORK_VIRTUAL_PATH & _
				"/Internals/WBCFuncPages/Cross-Browser/TasksAssistant/ApprovalAssistant/ApprovalAssistant.asp?" & _
				pThis.QueryStringModeUpdate

		' -- call Internal Hook
		Call OnInternalCustomizeApprovalAssistantURL( pThis, GetApprovalAssistantURL )

		' -- call Customizable Hook
		Call OnCustomizeApprovalAssistantURL( pThis, GetApprovalAssistantURL )

		' -- restore WBC mode propagation policy
		Call SetROMPropagationPolicyForWBCMode()

	End If  'if WBC visible

End Function  'GetApprovalAssistantURL

' ---- [Public] For backward compatibility with version 3.x
Function GetApprovalsPendingURL()
	GetApprovalsPendingURL = GetApprovalAssistantURL()
End Function


' -----------------------------------------------------------------------------
'
'	[PUBLIC] Return the URL required to invoke the Production Manager dialog.
'
' -----------------------------------------------------------------------------
Function GetProductionManagerURL()

	GetProductionManagerURL = "#"

	If IsWBCVisible Then

		' -- Disable WBC mode propagation policy because we want to
		'		generate all the query string parameters ourselves
		Call DisableROMPropagationPolicyForWBCMode()

		Dim pThis
		Set pThis = GetCurrentObject()

		GetProductionManagerURL = IDS_FRAMEWORK_VIRTUAL_PATH & _
				"/Internals/WBCFuncPages/Cross-Browser/TasksAssistant/ProductionManager/ProductionManager.asp?" & _
				pThis.QueryStringModeUpdate

		' -- call Internal Hook
		Call OnInternalCustomizeProductionManagerURL( pThis, GetProductionManagerURL )

		' -- call Customizable Hook
		Call OnCustomizeProductionManagerURL( pThis, GetProductionManagerURL )

		' -- restore WBC mode propagation policy
		Call SetROMPropagationPolicyForWBCMode()

	End If  'if WBC visible

End Function  'GetProductionManagerURL

' ---- [Public] For backward compatibility with version 3.x
Function GetPagesInProductionURL()
	GetPagesInProductionURL = GetProductionManagerURL()
End Function


' -----------------------------------------------------------------------------
'
'	[PUBLIC] This function checks if the tasks assistant links are visible
'	in the current context. To be visible, the current AutoSession.this
'	object must be a posting or channel, the WBC purpose must be basic,
'	and the mode must be unpublished.
'
' -----------------------------------------------------------------------------
Function AreTaskAssistantsVisible()

	AreTaskAssistantsVisible = (AutoSession.IsModeUnpublished) And _
					(Not ((AutoSession.ThisPosting Is Nothing) And _
					(AutoSession.ThisChannel Is Nothing)) ) And _
					(Request.QueryString(IDS_QPARAM_WBCPURPOSE) = IDS_WBCPURPOSE_BASIC)

End Function  'AreTasksAssistantsVisible

%>
