<%@LANGUAGE="VBSCRIPT"%> <% '===================================================== '| | '| Add Release | '| | '===================================================== %> <% Option explicit ' Good idea to set when using redirect Response.Expires = 0 ' always load the page, dont store %> <% ' Set rfile parameter. This is a return page after Login Call objPMod.StoreParameter ( "rfile", "rtree.asp" ) objPMod.PersistInQryString("proj_id") '------------ ACCESS CONTROL ------------------ %> <% '------------ Variable Definition ------------- Dim rsQry Dim parSourceRtagId Dim isSnapshot Dim isBranch Dim 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 empty If nSourceRtagId = "" Then Exit Sub OraDatabase.Parameters.Add "SOURCE_RTAG_ID", nSourceRtagId, ORAPARM_INPUT, ORATYPE_NUMBER query = _ " 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 Then outobjDetails.Item ("location") = rsQry("location") outobjDetails.Item ("rtag_name") = rsQry("rtag_name") outobjDetails.Item ("description") = rsQry("description") Else Err.Raise 8, "Sub GetFormDetails in "& ScriptName, "Empty record set returned. nSourceRtagId="& nSourceRtagId End If rsQry.Close Set rsQry = Nothing End Sub '-------------------------------------------------------------------------------------------------------------------------- Sub AddRelease () OraDatabase.Parameters.Add "SOURCE_RTAG_ID", Request("source_rtag_id"), ORAPARM_INPUT, ORATYPE_NUMBER OraDatabase.Parameters.Add "PROJ_ID", Request("proj_id"), ORAPARM_INPUT, ORATYPE_NUMBER OraDatabase.Parameters.Add "RTAG_NAME", Trim(Request("rtag_name")), ORAPARM_INPUT, ORATYPE_VARCHAR2 OraDatabase.Parameters.Add "RTAG_DESCRIPTION", Trim(Request("rtag_description")), ORAPARM_INPUT, ORATYPE_VARCHAR2 OraDatabase.Parameters.Add "USER_ID", objAccessControl.UserId, ORAPARM_INPUT, ORATYPE_NUMBER OraDatabase.Parameters.Add "IS_BRANCH", Iif(isBranch, "Y", "N"), ORAPARM_INPUT, ORATYPE_CHAR OraDatabase.Parameters.Add "OMODE", Request("mode"), ORAPARM_INPUT, ORATYPE_CHAR OraDatabase.Parameters.Add "ORTAGID", NULL, ORAPARM_OUTPUT,ORATYPE_NUMBER objEH.ErrorRedirect = FALSE On Error Resume Next objEH.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").Value objEH.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") <> "" Then If objForm.IsValidOnPostBack Then ' --- Form is Valid --- Call AddRelease() If objEH.Finally Then If Request("mode") = "S" Then Call OpenInWindow ( "dependencies.asp?rtag_id="& Request("source_rtag_id") ) Else If newRtagId <> "" Then Call OpenInWindow ( "dependencies.asp?rtag_id="& newRtagId ) Else Call OpenInWindow ( "rtree.asp?DONE=OK&"& objPMod.ComposeURL() ) End If End If End If End If End If '---------------------------------------------- %> Release Manager <% '-- FROM START --------------------------------------------------------------------------------------------------------- objFormComponent.FormName = "FormName" objFormComponent.Action = ScriptName Call objFormComponent.FormStart() Dim fName : fName = objFormCollector.Item("rtag_name") Dim cmtPrefix : cmtPrefix = iif(isSnapshot, "Snapshot of ", "Cloned from ") Dim Comment Comment = Request("rtag_description") If Comment = "" Then Comment = objFormCollector.Item("description") If fName <> "" AND NOT isSnapshot Then If Comment <> "" Then Comment = Comment & vbCrLf Comment = Comment & cmtPrefix & "'" & fName & "'" End If End If Dim rtagName rtagName = Request("rtag_name") If rtagName = "" Then If fName <> "" Then rtagName = cmtPrefix & fName End If %> <% Call objFormComponent.FormEnd() '-- FROM END ------------- %>
<%=Iif(isSnapshot, "Create Snapshot", "New Release")%>
<% If isSnapshot Then Call Messenger ( "A snapshot will be created from
"& objFormCollector.Item("location"), 3, "100%" ) ElseIf parSourceRtagId <> "" Then Call Messenger ( "New release will be created from
"& objFormCollector.Item("location"), 3, "100%" ) End If %>
<%If NOT isSnapshot Then%> <%End If%>
Release Name <%=objFormComponent.TextBox ( "rtag_name", objForm.GetValue( "rtag_name", rtagName ), "class='form_ivalue' size='60'" )%> <%=objForm.Validate ("rtag_name")%>
Branch Release No >Yes
Release Mode <%If isSnapshot Then%> Snapshot <%Else%> Open >Closed >Archived <%End If%>
Comments <%=objFormComponent.TextArea ( "rtag_description", objForm.GetValue("rtag_description", Comment ), 10, 60, "class='form_ivalue'" )%> <%=objForm.Validate ("rtag_description")%>
<%=objFormComponent.SubmitButton ( "Submit", "class='form_btn'" )%>  <%=objFormComponent.CancelButton ( "Cancel", "class='form_btn'", "rtree.asp?CANCEL=OK&"& objPMod.ComposeURL() )%> <%=objPMod.ComposeHiddenTags()%>