Rev 7493 | Blame | Compare with Previous | Last modification | View Log | RSS feed
<%@LANGUAGE="VBSCRIPT"%><%'====================================================='| |'| Add Release |'| |'=====================================================%><%Option explicit' Good idea to set when using redirectResponse.Expires = 0 ' always load the page, dont store%><!--#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"--><%' Set rfile parameter. This is a return page after LoginCall objPMod.StoreParameter ( "rfile", "rtree.asp" )objPMod.PersistInQryString("proj_id")'------------ ACCESS CONTROL ------------------%><!--#include file="_access_control_login.asp"--><!--#include file="_access_control_general.asp"--><!--#include file="_access_control_project.asp"--><%'------------ Variable Definition -------------Dim rsQryDim parSourceRtagIdDim isSnapshotDim isBranchDim newRtagId'------------ Constants Declaration -----------'------------ Variable Init -------------------parSourceRtagId = Request("source_rtag_id")objPMod.PersistInQryString("proj_id")isSnapshot = RequestBool("snapshot", FALSE)isBranch = RequestBool("branch", FALSE)'----------------------------------------------%><%'--------------------------------------------------------------------------------------------------------------------------Sub GetFormDetails ( nSourceRtagId, ByRef outobjDetails )Dim rsQry, query' Exit if nSourceRtagId is emptyIf nSourceRtagId = "" Then Exit SubOraDatabase.Parameters.Add "SOURCE_RTAG_ID", nSourceRtagId, ORAPARM_INPUT, ORATYPE_NUMBERquery = _" SELECT pr.PROJ_NAME ||' > '|| rt.RTAG_NAME ||' ['|| rt.RTAG_VERSION ||'.'|| rt.RTAG_LIFE_CYCLE ||']' AS LOCATION, "&_" rt.RTAG_NAME," &_" rt.DESCRIPTION" &_" FROM RELEASE_TAGS rt,"&_" PROJECTS pr"&_" WHERE rt.PROJ_ID = pr.PROJ_ID"&_" AND rt.RTAG_ID = :SOURCE_RTAG_ID"Set rsQry = OraDatabase.DbCreateDynaset( query, ORADYN_DEFAULT )OraDatabase.Parameters.Remove "SOURCE_RTAG_ID"If rsQry.RecordCount > 0 ThenoutobjDetails.Item ("location") = rsQry("location")outobjDetails.Item ("rtag_name") = rsQry("rtag_name")outobjDetails.Item ("description") = rsQry("description")ElseErr.Raise 8, "Sub GetFormDetails in "& ScriptName, "Empty record set returned. nSourceRtagId="& nSourceRtagIdEnd IfrsQry.CloseSet rsQry = NothingEnd Sub'--------------------------------------------------------------------------------------------------------------------------Sub AddRelease ()OraDatabase.Parameters.Add "SOURCE_RTAG_ID", Request("source_rtag_id"), ORAPARM_INPUT, ORATYPE_NUMBEROraDatabase.Parameters.Add "PROJ_ID", Request("proj_id"), ORAPARM_INPUT, ORATYPE_NUMBEROraDatabase.Parameters.Add "RTAG_NAME", Trim(Request("rtag_name")), ORAPARM_INPUT, ORATYPE_VARCHAR2OraDatabase.Parameters.Add "RTAG_DESCRIPTION", Trim(Request("rtag_description")), ORAPARM_INPUT, ORATYPE_VARCHAR2OraDatabase.Parameters.Add "USER_ID", objAccessControl.UserId, ORAPARM_INPUT, ORATYPE_NUMBEROraDatabase.Parameters.Add "IS_BRANCH", Iif(isBranch, "Y", "N"), ORAPARM_INPUT, ORATYPE_CHAROraDatabase.Parameters.Add "OMODE", Request("mode"), ORAPARM_INPUT, ORATYPE_CHAROraDatabase.Parameters.Add "ORTAGID", NULL, ORAPARM_OUTPUT,ORATYPE_NUMBERobjEH.ErrorRedirect = FALSEOn Error Resume NextobjEH.TryORA ( OraSession )OraDatabase.ExecuteSQL "BEGIN PK_RELEASE.NEW_RELEASE ( :RTAG_NAME, :RTAG_DESCRIPTION, :PROJ_ID, :SOURCE_RTAG_ID, :IS_BRANCH, :USER_ID, :OMODE, :ORTAGID); END;"newRtagId = OraDatabase.Parameters("ORTAGID").ValueobjEH.CatchORA ( OraSession )OraDatabase.Parameters.Remove "SOURCE_RTAG_ID"OraDatabase.Parameters.Remove "PROJ_ID"OraDatabase.Parameters.Remove "RTAG_NAME"OraDatabase.Parameters.Remove "RTAG_DESCRIPTION"OraDatabase.Parameters.Remove "USER_ID"OraDatabase.Parameters.Remove "IS_BRANCH"OraDatabase.Parameters.Remove "OMODE"OraDatabase.Parameters.Remove "ORTAGID"End Sub'--------------------------------------------------------------------------------------------------------------------------%><%'------------ RUN BEFORE PAGE RENDER ----------' --- Get Form details from DB ---Call GetFormDetails ( parSourceRtagId, objFormCollector )' --- Load Validation Rules ---objForm.UpdateRules ("id='rtag_name' IsRequired='Y' IsName='Y' MinStringLength='2' MaxStringLength='150'")objForm.UpdateRules ("id='rtag_description' IsRequired='Y' MaxStringLength='4000' MinStringLength='10'")' --- Enter Form Validation Rule Changes here... ----'----------------------------------------------------' --- RUN onPostBack ---If Request("action") <> "" ThenIf objForm.IsValidOnPostBack Then' --- Form is Valid ---Call AddRelease()If objEH.Finally ThenIf Request("mode") = "S" ThenCall OpenInWindow ( "dependencies.asp?rtag_id="& Request("source_rtag_id") )ElseIf newRtagId <> "" ThenCall OpenInWindow ( "dependencies.asp?rtag_id="& newRtagId )ElseCall OpenInWindow ( "rtree.asp?DONE=OK&"& objPMod.ComposeURL() )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 rel="stylesheet" href="images/release_manager_style.css?ver=<%=VixVerNum%>" type="text/css"><link rel="stylesheet" href="images/navigation.css?ver=<%=VixVerNum%>" type="text/css"><script language="JavaScript" src="images/common.js?ver=<%=VixVerNum%>"></script><!--#include file="_jquery_includes.asp"--><!-- DROPDOWN MENUS --><!--#include file="_menu_def.asp"--><script language="JavaScript1.2" src="images/popup_menu.js?ver=<%=VixVerNum%>"></script></head><body bgcolor="#FFFFFF" text="#000000" leftmargin="0" topmargin="0" onLoad="FormName.rtag_name.focus();"><!-- HEADER --><!--#include file="_header.asp"--><!-- BODY ----><%'-- FROM START ---------------------------------------------------------------------------------------------------------objFormComponent.FormName = "FormName"objFormComponent.Action = ScriptNameCall objFormComponent.FormStart()Dim fName : fName = objFormCollector.Item("rtag_name")Dim cmtPrefix : cmtPrefix = iif(isSnapshot, "Snapshot of ", "Cloned from ")Dim CommentComment = Request("rtag_description")If Comment = "" ThenComment = objFormCollector.Item("description")If fName <> "" AND NOT isSnapshot ThenIf Comment <> "" Then Comment = Comment & vbCrLfComment = Comment & cmtPrefix & "'" & fName & "'"End IfEnd IfDim rtagNamertagName = Request("rtag_name")If rtagName = "" ThenIf fName <> "" Then rtagName = cmtPrefix & fNameEnd If%><table width="100%" border="0" cellspacing="0" cellpadding="0"><tr><td class='bg_panel'></td><td width="100%" rowspan="2" align="center" bgcolor="#EEEFEF"><div><div class=panel><div class='rounded_box_caption'><%=Iif(isSnapshot, "Create Snapshot", "New Release")%><div><div class = "rounded_box"><div><%If isSnapshot ThenCall Messenger ( "A snapshot will be created from <br>"& objFormCollector.Item("location"), 3, "100%" )ElseIf parSourceRtagId <> "" ThenCall Messenger ( "New release will be created from <br>"& objFormCollector.Item("location"), 3, "100%" )End If%><!-- MESSAGE +++++++++++++++++++++++++++++++++++++++++++++++++++ --><!--#include file="messages/_msg_inline.asp"--><!-- +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ --></div><div class='PanelFrame'><table width="100%" border="0" cellspacing="2" cellpadding="0"><tr><td nowrap class="form_iname">Release Name </td><td nowrap><%=objFormComponent.TextBox ( "rtag_name", objForm.GetValue( "rtag_name", rtagName ), "class='form_ivalue' size='60'" )%></td><td><%=objForm.Validate ("rtag_name")%></td></tr><%If NOT isSnapshot Then%><tr><td nowrap class="form_iname">Branch Release</td><td nowrap class="form_iname"><input name="branch" type="radio" value="N" checked>No<input name="branch" type="radio" value="Y" <%=iif(isBranch, " checked","")%>>Yes</td><td></td></tr><%End If%><tr><td nowrap class="form_iname">Release Mode</td><td nowrap class="form_iname"><%If isSnapshot Then%><input name="mode" type="radio" value="S" checked>Snapshot<%Else%><input name="mode" type="radio" value="N" checked>Open<input name="mode" type="radio" value="Y" <%=iif(Request("mode") = "Y", " checked","")%>>Closed<input name="mode" type="radio" value="A" <%=iif(Request("mode") = "A", " checked","")%>>Archived<%End If%></td></tr><tr><td nowrap class="form_iname top">Comments</td><td><%=objFormComponent.TextArea ( "rtag_description", objForm.GetValue("rtag_description", Comment ), 10, 60, "class='form_ivalue'" )%></td><td><%=objForm.Validate ("rtag_description")%></td></tr></table></div><div class='buttonPanel'><!-- ACTION BUTTONS ----------------------------------------------><%=objFormComponent.SubmitButton ( "Submit", "class='form_btn'" )%> <%=objFormComponent.CancelButton ( "Cancel", "class='form_btn'", "rtree.asp?CANCEL=OK&"& objPMod.ComposeURL() )%><%=objPMod.ComposeHiddenTags()%><input type="hidden" name="source_rtag_id" value="<%=parSourceRtagId%>"><input type="hidden" name="action" value="true"><!-- ACTION BUTTONS END ------------------------------------------></div></div></div></div></td></tr><%Call objFormComponent.FormEnd()'-- FROM END -------------%></table><!-- FOOTER --><!--#include file="_footer.asp"--></body></html>