<%@LANGUAGE="VBSCRIPT"%> <% Option explicit Response.Expires = 0 ' always load the page, dont store %> <% '===================================================== ' Change Group '===================================================== %> <% '------------ ACCESS CONTROL ------------------ %> <% '------------ Variable Definition ------------- Dim parPv_id Dim parProj_id Dim parNewRtag_id Dim parRfile Dim bPreventSubmit '------------ Constants Declaration ----------- '------------ Variable Init ------------------- Set pkgInfoHash = CreateObject("Scripting.Dictionary") parPv_id = QStrPar("pv_id") parProj_id= QStrPar("proj_id") parNewRtag_id = QStrPar("new_rtag_id") parRfile = Request("rfile") If IsNull(parProj_id) Then parProj_id = "0" If IsNull(parNewRtag_id) Then parNewRtag_id = "0" If IsNull(parRfile) Then parRfile = "dependencies.asp" bPreventSubmit = false '---------------------------------------------- %> <% Sub Get_Pkg_Info_From_Rel ( SSrtag_id, SSpv_id ) Dim rsTemp, Query_String Query_String = _ " SELECT pkg.pkg_name, pv.pkg_version, wip.view_id, vi.view_name"&_ " FROM packages pkg, package_versions pv, work_in_progress wip, views vi"&_ " WHERE pkg.pkg_id = pv.pkg_id"&_ " AND pv.pv_id = wip.pv_id"&_ " AND vi.view_id = wip.view_id"&_ " AND wip.rtag_id = "& SSrtag_id &_ " AND wip.pv_id = "& SSpv_id Set rsTemp = OraDatabase.DbCreateDynaset( Query_String, cint(0)) If ((NOT rsTemp.BOF) AND (NOT rsTemp.EOF)) Then pkgInfoHash.Add "pkg_name", (rsTemp.Fields("pkg_name")) pkgInfoHash.Add "pkg_version", (rsTemp.Fields("pkg_version")) pkgInfoHash.Add "view_id", (rsTemp.Fields("view_id")) pkgInfoHash.Add "view_name", (rsTemp.Fields("view_name")) End If rsTemp.Close Set rsTemp = nothing End Sub '------------------------------------------------------------------------------------------------------------------------------------------ ' Formulate the HTML for a combo box listing all the Projects, and select the one that matches ' the proj-id passed in as a parameter. If the parameter value could not be found, correct it to the first valid proj-id ' in the list. '------------------------------------------------------------------------------------------------------------------------------------------ Function Get_Projects ( NNproj_id ) Dim rsTemp, Query_String, projName, tempLINK, selectedFound, s selectedFound = False Query_String = "SELECT * FROM projects ORDER BY UPPER( proj_name )" Set rsTemp = OraDatabase.DbCreateDynaset( Query_String, cint(0)) s = "Project" s = s + "" ' Correct for a situation where selectedFound is still FALSE. If NOT selectedFound Then rsTemp.MoveFirst If ((NOT rsTemp.BOF) AND (NOT rsTemp.EOF)) Then NNproj_id = CStr(rsTemp.Fields("proj_id")) Else NNproj_id = "0" End If End If rsTemp.Close Set rsTemp = nothing s = s + "" Get_Projects = s End Function '------------------------------------------------------------------------------------------------------------------------------------------ ' Formulate the HTML for a combo box listing all the Release for a specified project, and select the one that matches ' the release-tag passed in as a parameter. If the parameter value could not be found, correct it to the first valid release-tag ' in the list. '------------------------------------------------------------------------------------------------------------------------------------------ Function Get_Releases ( NNproj_id, NNrtag_id ) Dim rsTemp, Query_String, releaseName, tempLINK, selectedFound, s, numReleases selectedFound = False numReleases = 0 Query_String = "SELECT rtag_id, rtag_name "&_ " FROM release_tags rt"&_ " WHERE rt.proj_id = "& NNproj_id &_ " AND ((rt.official = 'N') OR (rt.official = 'C') OR (rt.official = 'R'))"&_ " ORDER BY UPPER(rtag_name)" Set rsTemp = OraDatabase.DbCreateDynaset( Query_String, cint(0)) s = "Release" s = s + "" ' Correct for a situation where selectedFound is still FALSE. If NOT selectedFound Then rsTemp.MoveFirst If ((NOT rsTemp.BOF) AND (NOT rsTemp.EOF)) Then NNrtag_id = CStr(rsTemp.Fields("rtag_id")) Else NNrtag_id = "0" End If End If ' If no releases were found then replace drop down list with some warning text and disable form submission If numReleases = 0 Then bPreventSubmit = True s = "ReleaseWARNING: No active releases found. The operation cannot be performed." End If rsTemp.Close Set rsTemp = nothing s = s + "" Get_Releases = s End Function '------------------------------------------------------------------------------------------------------- ' Call stored procedures to move the WIP from the source release to the destination release '------------------------------------------------------------------------------------------------------- Sub MoveWip(source_RtagId, destination_RtagId, pvId, viewId) OraDatabase.Parameters.Add "RTAG_ID", source_RtagId, ORAPARM_INPUT, ORATYPE_NUMBER OraDatabase.Parameters.Add "PV_ID", pvId, ORAPARM_INPUT, ORATYPE_VARCHAR2 OraDatabase.Parameters.Add "USER_ID", objAccessControl.UserId, ORAPARM_INPUT, ORATYPE_NUMBER OraDatabase.Parameters.Add "VIEW_ID", viewId, ORAPARM_INPUT, ORATYPE_NUMBER objEH.TryORA ( OraSession ) OraDatabase.ExecuteSQL _ "BEGIN PK_WORK_IN_PROGRESS.REMOVE_PACKAGE ( :PV_ID, :RTAG_ID, :USER_ID ); END;" If Err.Number = 0 Then OraDatabase.Parameters.Remove "RTAG_ID" OraDatabase.Parameters.Add "RTAG_ID", destination_RtagId, ORAPARM_INPUT, ORATYPE_NUMBER OraDatabase.ExecuteSQL _ "BEGIN PK_WORK_IN_PROGRESS.ADD_PACKAGE ( :PV_ID, :VIEW_ID, :RTAG_ID, :USER_ID ); END;" End If objEH.CatchORA ( OraSession ) OraDatabase.Parameters.Remove "RTAG_ID" OraDatabase.Parameters.Remove "PV_ID" OraDatabase.Parameters.Remove "USER_ID" OraDatabase.Parameters.Remove "VIEW_ID" End Sub %> <% ' get pkgInfoHash items for the source WIP Call Get_Pkg_Info_From_Rel ( parRtag_id, parPv_id ) ' Make sure this WIP can be moved - prevent if it has a pending test build instruction, etc If (DaemonInstructionPreventsEditing(Request("rtag_id"), Request("pv_id"))) Then Call RaiseMsgInParent(enum_MSG_ERROR, "This WIP has one or more daemon instructions present.

"&_ "Please delete them or allow them to be consumed before attempting to move the WIP.") Call CloseWindow Else ' check for form submission If CBool(QStrPar("action")) AND (QStrPar("btn") = "Move") AND objAccessControl.UserLogedIn Then 'Process submition Call MoveWip(parRtag_id, parNewRtag_id, parPv_id, pkgInfoHash.Item("view_id")) Call OpenInParentWindow (parRfile &"?pv_id="& parPv_id &"&rtag_id="& parNewRtag_id ) Call CloseWindow Else ' Call HTML rendering functions, but throw away the strings returned since we only want to ensure that ' the current state of the bPreventSubmit flag has been acquired in order to show/hide the submit button Call Get_Projects(parProj_id) Call Get_Releases(parProj_id, parNewRtag_id) End If End If %> Release Manager
 Move WIP To Another Release <%If NOT bPreventSubmit Then%> <%End If%>
  <%=Get_Projects(parProj_id)%> <%=Get_Releases(parProj_id, parNewRtag_id)%> ">
WIP Details  
  Package <%=pkgInfoHash.Item("pkg_name")%>
  Version <%=pkgInfoHash.Item("pkg_version")%>
  View <%=pkgInfoHash.Item("view_name")%>
Select Destination Release  
  
  
   
 
WARNING:
The destination release may not satisfy any or all the dependencies that come with the WIP you are about to move. It is your responsibility to rectify this in the destination release.