@Echo off
REM #Doc: Controls VolumeRevokeGrand Check for TC for customer
REM #Doc: #New:24.05.2018/J.Fes
REM #Doc: Scripted documentation please review Header VolumeRevokeGrant_Run.cmd

REM  if "%~1" neq "" goto :start
REM  Echo please run now %~0 Start
REM  Echo %~0 Start | Clip
REM  cmd
REM  exit


:start
 set toRun=
 set CmdCurRoot_DP=%~dp0
 set CmdCurRoot_DP=%CmdCurRoot_DP:~0,-1%
 if not defined BinPublic_DP set BinPublic_DP=%CmdCurRoot_DP%\..\..\..\..\03-BinPublic
 set JobMgrDefaults_DP=%CmdCurRoot_DP%\..\_JobMgrDefaults
 set path=%CmdCurRoot_DP%;%JobMgrDefaults_DP%;%BinPublic_DP%;%path%

 call ColorSet "INIT"
 Call DateTimeGet

 rem #ToDo: define dir containing plm easy tool
 set tcpbBin_DP=%CmdCurRoot_DP%\tc14_bin64

 REM #ToDo: define get TcPrompt Custom script
 set TCPrompt_Custom_DPNE=%CmdCurRoot_DP%\TcPrompt_Custom.cmd

 rem -- TC Prompt for Custom
 set TCPrompt_Custom_Opt=TcOnly


 set titleTxt=VolRG:[%TcSiteId% Vol:%TC_RevokeGrandVol% for:%TC_RevokeGrandType%:%TC_RevokeGrandName%][%DateTimeStamp%][\\%ComputerName%]
 title %titleTxt%
 Call Banner "Vol-RG"
 Call Echo "----------------------------------------------------------------------------"
 Call Echo "Revoke Grand Process............: Parameters / Info"
 Call Echo "Process Date Time Stamp.........: %DateTimeStamp%"
 Call Echo "Revoke Grand Volume.............: %TC_RevokeGrandVol%"
 Call Echo "Revoke Grand Volume Temp........: %TC_RevokeGrandVolTemp%"
 Call Echo "Revoke Grand Process Log Root...: %JobMgr_Log_DP%"
 Call Echo "for User-or-Group:Name..........: %TC_RevokeGrandType%:%TC_RevokeGrandName%"
 Call Echo "PLM-EASY Directory..............: %tcpbBin_DP%"
 Call Echo "JobMgr_Debug....................: %JobMgr_Debug%"
 Call Echo "JobMgr_Test.....................: %JobMgr_Test%"


 if /i "%JobMgr_Debug%" neq "ON" goto :JumbOverDebug
  call Echo "---------------------------------------------------------------------------"
  set JobMgr_Tc
  set TC_RevokeGrand
  call Echo "---------------------------------------------------------------------------"
  call Echo "#Debug 01.......................: TC_RevokeGrand Start"
  pause
 :JumbOverDebug

 if exist "%TCPrompt_Custom_DPNE%" Call "%TCPrompt_Custom_DPNE%"
 if "%JobMgr_TCPromptGet_ResCode%" equ "0" Call :StartRevokeGrand
goto :myExit

 rem ---------------------------------------------------------------------------
:StartRevokeGrand
 Call Echo "----  ----  ----  ----  ----  ----  ----  ----  ----  ----  ----  ----  ----"
 call "%CmdCurRoot_DP%\VolumeRevokeGrant_Run.cmd"
 goto :eof

 rem ---------------------------------------------------------------------------
:myExit

if /i "%JobMgr_Debug%" neq "ON" goto :JumbOverDebug
 call Echo "---------------------------------------------------------------------------"
 call Echo "#Debug..........................: Process End(%~0)"
 pause
:JumbOverDebug

if /i "%JobMgr_Test%" neq "ON" goto :JumbOverTest
 Banner TestEnd
 call Echo "---------------------------------------------------------------------------"
 call Echo "#Test..........................: #Process End(%~0)"
 pause
:JumbOverTest

