Rev 5560 | Rev 5957 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | RSS feed
<%@LANGUAGE="VBSCRIPT"%><%'====================================================='|'| wAddDaemonInstructionSimple.asp'| Either ripple or test-build the current package'| This window has few options'|'=====================================================%><%Option explicitResponse.Expires = 0%><!--#include file="common/conf.asp"--><!--#include file="common/globals.asp"--><!--#include file="common/formating.asp"--><!--#include file="common/qstr.asp"--><!--#include file="common/common_subs.asp"--><!--#include file="common/_form_window_common.asp"--><!--#include file="common/common_dbedit.asp"--><!--#include file="common/daemon_instructions.asp"--><%'------------ ACCESS CONTROL ------------------%><!--#include file="_access_control_general.asp"--><%'------------ VARIABLE DEFINITION -------------Dim sMessage, sMessageTypeDim parPv_idDim parOp_codeDim parRfileDim bPreventSubmitDim ripplePresent, rippleDisableDim testPresent, testDisable, testChecked'------------ CONSTANTS DECLARATION -----------'------------ VARIABLE INIT -------------------sMessage = NULLsMessageType = 3bPreventSubmit = False' collect all parameters from query stringparPv_id = Request("pv_id")parOp_code = Request("op_code")parRfile = Request("rfile")Set objFormCollector = CreateObject("Scripting.Dictionary")'------------ CONDITIONS ----------------------'----------------------------------------------%><%'------------------------------------------------------------------------------------------------------------------------------------------' For the specified Release, get a list of all that release's daemon configurations.' Return True if at least one daemon configuration was found, else False'------------------------------------------------------------------------------------------------------------------------------------------Function DaemonsAvailable(NNrtag_id)Dim rsTemp, Query_StringDaemonsAvailable = TrueQuery_String = "SELECT * "&_" FROM release_config rc"&_" WHERE rc.rtag_id = "& NNrtag_idSet rsTemp = OraDatabase.DbCreateDynaset( Query_String, cint(0))If rsTemp.RecordCount = 0 ThenDaemonsAvailable = FalseEnd IfrsTemp.CloseSet rsTemp = nothingEnd Function'' Add a lineof text to the System Message'Sub sMessageAdd(text)If NOT isNull(sMessage) ThensMessage = sMessage & "<br>"End IfsMessage = sMessage & textEnd Sub%><%'------------ RUN BEFORE PAGE RENDER ----------' Make sure we dont have any null strings or empty strings for our parametersIf IsNull(parOp_code) OR parOp_code = "" ThenparOp_code = "-1"End IfIf IsNull(parRtag_id) OR parRtag_id = "" ThenparRtag_id = "0"End IfIf IsNull(parRfile) OR parRfile = "" ThenparRfile = "dependencies.asp"End If' Check if form submit is happeningIf CBool(Request("action")) ThenIf CInt(parOp_code) >= 0 ThenDim RepeatSecondsDim ScheduledDateTimeDim ReleaseModeReleaseMode = GetReleaseMode(parRtag_id)If NOT objAccessControl.UserLogedIn ThensMessage = "User is no longer logged in"sMessageType = 1ElseIf NOT UserCanAddOrEditThisDaemonInst(DB_PROJ_ID, ReleaseMode, parOp_code) ThensMessage = "You have been denied permission to add/update daemon instructions for the specified release."sMessageType = 1End IfIf isNull(sMessage) Then' do daemon instruction validation, continuing only if it passesIf ValidateDaemonInstruction(parOp_code, parRtag_id, parPv_id) = True ThenRepeatSeconds = 0ScheduledDateTime = ORA_SYSDATETIME' We are adding a new recordobjEH.TryORA ( OraSession )On Error Resume NextOraDatabase.ExecuteSQL "BEGIN PK_BUILDAPI.insert_daemon_inst( "& parOp_code & ", " &_parRtag_id & ", " &_parPv_id & ", " &_ScheduledDateTime & ", " &_CStr(RepeatSeconds) & ", " &_ORA_SYSDATETIME & ", " &_objAccessControl.UserId & "); END;"objEH.CatchORA ( OraSession )If objEH.Finally ThenCall OpenInParentWindow (parRfile & "?rtag_id=" & parRtag_id & "&pv_id=" & parPv_id)Response.EndEnd IfElsesMessage = "Invalid Request."sMessageType = 1End IfEnd IfElsesMessage = "No action selected."sMessageType = 1End IfEnd If' Prevent editing if build instruction is already presenttestPresent = DaemonInstructionPresent(parRtag_id, parPv_id, 1 )ripplePresent = DaemonInstructionPresent(parRtag_id, parPv_id, 0 )If ripplePresent ThenrippleDisable = " disabled"sMessageAdd "Ripple Instruction already present"End IfIf testPresent ThentestDisable = " disabled"sMessageAdd "Test Instruction already present"End IfIf ripplePresent AND testPresent ThenbPreventSubmit = trueIf sMessageType = 3 ThensMessageType = 2End IfEnd If'----------------------------------------------%><html><head><title>Release Manager</title><link rel="shortcut icon" href="<%=FavIcon%>"/><meta HTTP-EQUIV="Pragma" CONTENT="no-cache"><meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"><link href="images/release_manager_style.css" rel="stylesheet" type="text/css"><script language="JavaScript" src="scripts/common.js"></script></head><body leftmargin="0" topmargin="0"><table width="600px" border="0" cellspacing="0" cellpadding="5"><%'-- FROM START --------------------------------------------------------------------------------------------------------------objFormComponent.FormName = "DaemonInstruction"objFormComponent.FormClass = "form_tight"objFormComponent.Action = ScriptName &_"?proj_id="& DB_PROJ_ID &_"&rtag_id="& parRtag_id &_"&pv_id=" & parPv_id &_"&rfile=" & parRfileobjFormComponent.OnSubmit = "ShowProgress();"Call objFormComponent.FormStart()%><tr><td><!-- MESSAGE ++++++++++++++++++++++++++++++++++++++++++++++ --><%Call Messenger ( sMessage , sMessageType, "100%" )%><!-- MESSAGE +++++++++++++++++++++++++++++++++++++++++++++++++++ --><!--#include file="messages/_msg_inline.asp"--><table class="full_table form_item form_field_bg" style="padding: 5;"><tr><td class="nowrap form_align" ><input type="radio" name="op_code" value="0" <%=rippleDisable%>> Ripple the current package.<td>This will cause a new package version to be created.<br>All packages that depend on this package will also be rippled.</tr><tr><td colspan=2><hr width=80%></tr><tr><td class="nowrap form_align"><input type="radio" name="op_code" value="1" <%=testChecked%><%=testDisable%>> Test Build the current package.<td>No new version will be created, nor will a build ripple be propagated.<br>This will simply ensure that the current package can be built with<br>the current build machine configuration.</tr></table></td><%Dim disableText : disableText = ""If NOT (DaemonsAvailable(parRtag_id) AND NOT bPreventSubmit) ThendisableText = "disabled=""disabled"""End If%><tr><td><span style="float:left"><%=ProgressBar()%></span><button name="btn" style="float:right" type="reset" onclick="parent.closeIFrame();">Cancel</button><button name="btn" style="float:right;margin-right: 5px;" type="submit" <%=disableText%> >Add/Update</button></tr><%=objPMod.ComposeHiddenTags()%><input type="hidden" name="action" value="true"><input type="hidden" id="rtag_id" name="rtag_id" value="<%=parRtag_id%>"><input type="hidden" id="pv_id" name="pv_id" value="<%=parPv_id%>"><input type="hidden" id="rfile" name="rfile" value="<%=parRfile%>"><%Call objFormComponent.FormEnd()'-- FROM END ----------------------------------------------------------------------------------------------------------------%></table></body></html><%'------------ RUN AFTER PAGE RENDER -----------Set objFormCollector = Nothing'----------------------------------------------Call Destroy_All_Objects%>