Rev 7225 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | RSS feed
<%@LANGUAGE="VBSCRIPT"%><%'=====================================================' wAddBuildPlatform.asp'=====================================================%><%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"--><%'------------ ACCESS CONTROL ------------------%><!--#include file="_access_control_login.asp"--><!--#include file="_access_control_general.asp"--><%'------------ VARIABLE DEFINITION -------------Dim rsQryDim sMessageDim Query_StringDim nameDim bp_idDim active, activeCheckedDim description'------------ CONSTANTS DECLARATION -----------'------------ VARIABLE INIT -------------------sMessage = NULLSet objFormCollector = CreateObject("Scripting.Dictionary")'------------ CONDITIONS ----------------------'----------------------------------------------'--------------------------------------------------------------------------------------------------------------------------Function GetMachType ()Dim rsQry, queryDim selectDataOraDatabase.Parameters.Add "BP_ID", Request("bp_id"), ORAPARM_INPUT, ORATYPE_NUMBER' Where to get the selection data' If this is a form re-display, then its comming from a RequestIf CBool(Request("action")) ThenselectData = "," & Request("machType") & ","selectData = Replace(selectData," ","",1,-1)ElseselectData = ""query = "SELECT bfc.gbe_id FROM build_platforms_config bfc WHERE bfc.bp_id = :BP_ID"Set rsQry = OraDatabase.DbCreateDynaset( query, ORADYN_DEFAULT )While (NOT rsQry.BOF) AND (NOT rsQry.EOF)selectData = selectData & "," & rsQry("GBE_ID")rsQry.MoveNextWendrsQry.Close()Set rsQry = NothingselectData = selectData & ","End IfGetMachType = "<table>"query = "SELECT gm.gbe_id,gm.gbe_value FROM gbe_machtype gm ORDER BY gbe_value"Set rsQry = OraDatabase.DbCreateDynaset( query, ORADYN_DEFAULT )While (NOT rsQry.BOF) AND (NOT rsQry.EOF)Dim checkTextIf InStr(selectData, "," & rsQry("GBE_ID") & ",") > 0 ThencheckText = "checked"elsecheckText = ""End IfGetMachType = GetMachType & "<tr class=body_txt>"GetMachType = GetMachType & "<td> <input type=checkbox name=machType value='"& rsQry("GBE_ID") &"' "& checkText &">" & rsQry("GBE_VALUE") & "</td>"GetMachType = GetMachType & "</tr>"rsQry.MoveNextWendrsQry.Close()Set rsQry = NothingOraDatabase.Parameters.Remove "BP_ID"GetMachType = GetMachType & "</table>"End Function%><%'------------ RUN BEFORE PAGE RENDER ----------If CBool(Request("action")) ThenIf Len(Request("name")) <= 0 ThensMessage = "Platform name must be specified"ElseIf Len(Request("name")) <= 3 ThensMessage = "Platform name is too short"ElseIf Request("bp_id") <> "" Then' UPDATE an existing entryOraDatabase.Parameters.Add "BP_ID", Request("bp_id"), ORAPARM_INPUT, ORATYPE_NUMBEROraDatabase.Parameters.Add "NAME", Request("name"), ORAPARM_INPUT, ORATYPE_VARCHAR2OraDatabase.Parameters.Add "DESCRIPTION", Request("description"), ORAPARM_INPUT, ORATYPE_VARCHAR2OraDatabase.Parameters.Add "ACTIVE", Request("active"), ORAPARM_INPUT, ORATYPE_CHAROraDatabase.Parameters.Add "MACHTYPE", Request("machType"), ORAPARM_INPUT, ORATYPE_VARCHAR2Query_String = "SELECT * FROM BUILD_PLATFORMS WHERE BP_ID <> :BP_ID AND UPPER(BP_NAME) = UPPER(:NAME)"Set rsQry = OraDatabase.DbCreateDynaset( Query_String, cint(0))If rsQry.RecordCount = 0 ThenobjEH.ErrorRedirect = FALSEobjEH.TryORA ( OraSession )On Error Resume NextOraDatabase.ExecuteSQL _"BEGIN PK_BUILDAPI.UPDATE_BUILD_PLATFORM(:BP_ID, :NAME, :DESCRIPTION, :ACTIVE, :MACHTYPE); END;"objEH.CatchORA ( OraSession )ElsesMessage = "A Platform of that name already exists"End IfOraDatabase.Parameters.Remove "BP_ID"OraDatabase.Parameters.Remove "NAME"OraDatabase.Parameters.Remove "DESCRIPTION"OraDatabase.Parameters.Remove "ACTIVE"OraDatabase.Parameters.Remove "MACHTYPE"rsQry.CloseSet rsQry = nothingIf IsNULL(sMessage) ThenIf objEH.Finally ThenCall OpenInParentWindow ("admin_build_platforms.asp?bp_id="&Request("bp_id"))Call CloseWindow()End IfEnd IfElse' Add A new entryOraDatabase.Parameters.Add "NAME", Request("name"), ORAPARM_INPUT, ORATYPE_VARCHAR2OraDatabase.Parameters.Add "DESCRIPTION", Request("description"), ORAPARM_INPUT, ORATYPE_VARCHAR2OraDatabase.Parameters.Add "ACTIVE", Request("active"), ORAPARM_INPUT, ORATYPE_CHAROraDatabase.Parameters.Add "MACHTYPE", Request("machType"), ORAPARM_INPUT, ORATYPE_VARCHAR2Query_String = "SELECT * FROM BUILD_PLATFORMS WHERE UPPER(BP_NAME) = UPPER(:NAME)"Set rsQry = OraDatabase.DbCreateDynaset( Query_String, cint(0))If rsQry.RecordCount = 0 ThenobjEH.ErrorRedirect = FALSEobjEH.TryORA ( OraSession )On Error Resume NextOraDatabase.ExecuteSQL _"BEGIN PK_BUILDAPI.ADD_BUILD_PLATFORM(:NAME, :DESCRIPTION, :ACTIVE, :MACHTYPE); END;"objEH.CatchORA ( OraSession )ElsesMessage = "A Platform of that name already exists"End IfOraDatabase.Parameters.Remove "NAME"OraDatabase.Parameters.Remove "DESCRIPTION"OraDatabase.Parameters.Remove "ACTIVE"OraDatabase.Parameters.Remove "MACHTYPE"rsQry.CloseSet rsQry = nothingIf IsNULL(sMessage) ThenIf objEH.Finally ThenCall OpenInParentWindow ("admin_build_platforms.asp")Call CloseWindow()End IfEnd IfEnd IfEnd 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?ver=<%=VixVerNum%>" rel="stylesheet" type="text/css"><script language="JavaScript" src="scripts/common.js?ver=<%=VixVerNum%>"></script></head><body leftmargin="0" topmargin="0" onLoad="self.focus();FormName.name.focus();"><table width="100%" border="0" cellspacing="0" cellpadding="10"><tr><td class="body_txt">Add a new Build Platform or edit an existing Build Platform.</td></tr><%'-- FROM START --------------------------------------------------------------------------------------------------------------objFormComponent.FormName = "FormName"objFormComponent.FormClass = "form_tight"objFormComponent.Action = ScriptNameobjFormComponent.OnSubmit = "ShowProgress();"Call objFormComponent.FormStart()%><tr><td class="form_field_bg" ><!-- NEW PRODUCT ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ --><%Call Messenger ( sMessage , 3, "100%" )%><!-- MESSAGE +++++++++++++++++++++++++++++++++++++++++++++++++++ --><!--#include file="messages/_msg_inline.asp"--><br><%If CBool(Request("action")) Thenname = Request("name")active = Request("active")description = Request("description")ElseIf Request("bp_id") <> "" ThenDim rsTempQuery_String = "select * from build_platforms bp where bp.bp_id = "& Request("bp_id")Set rsTemp = OraDatabase.DbCreateDynaset( Query_String, cint(0))name = rsTemp("bp_name")active = rsTemp("bp_active")description = rsTemp("bp_description")rsTemp.Close()Set rsTemp = NothingElseactive = "Y"End IfactiveChecked = ""if active = "Y" Then activeChecked = "checked"If Request("bp_id") <> "" Then%><input type="hidden" name="bp_id" value="<%=Request("bp_id")%>"><%End If%><table width="50%" border="0"><tr><td><span class="body_txt nowrap">Platform Name</span></td><td><input name="name" type="text" class="body_txt" value="<%=name%>" size=50 maxlength=50></td></tr><tr><td><span class="body_txt nowrap">Allow Use</span></td><td><input type="checkbox" name="active" value="Y" <%=activeChecked%>><span class="body_txt">Allow users to add this platform to a build filter</span></td></tr><tr><td><span class="body_txt nowrap">Description</span></td><td><textarea name="Description" cols=50 rows=5 class='body_txt'><%=Description%></textarea></td></tr><tr><td><span class="body_txt nowrap">Supported<br>MachTypes</span></td><td style="border: darkgrey 1px solid;"><%=GetMachType()%></td></tr></table></td></tr><tr><td><table class="full_table"><tr><td><%=ProgressBar()%></td><td align="right"><input name="btn" type="submit" class="form_btn" value="Add/Update"><input name="btn" type="reset" class="form_btn" value="Cancel" onclick="parent.closeIFrame();"></td></tr></table></td></tr><%=objPMod.ComposeHiddenTags()%><input type="hidden" name="action" value="true"><%Call objFormComponent.FormEnd()'-- FROM END ----------------------------------------------------------------------------------------------------------------%></table></body></html><%'------------ RUN AFTER PAGE RENDER -----------Set objFormCollector = Nothing'----------------------------------------------Call Destroy_All_Objects%>