Rev 125 | Blame | Last modification | View Log | RSS feed
<%'=====================================================' COMMON MAKE RELEASE BUTTON SUBs'====================================================='' Conventions within this code'' 1) Where a paramter list contains both RTAG_ID and PV_ID, the RTAG_ID will precede the PV_ID parameter' 2) Functions/Subs that are not used externally, are name decorated PRIVATE_' 3) Functions/Subs that are used extennally, are name decorated PUBLIC_'''%><%Dim AutoBuildPermissionDeniedDim ManualBuildPermissionDeniedDim RaiseWIPExistsAutoBuildPermissionDenied = FALSEManualBuildPermissionDenied = FALSE'-----------------------------------------------------------------------------------------------------------------------------' This is the pattern for approval determination. If the release is in open mode, permission is given. If the release is' in restrictive/ccb mode, permission is given dependent on the accessControlObjectName being granted for the user.'Function PRIVATE_Is_Allowed_To(NNrtag_id, accessControlObjectName)Dim ReleaseModeReleaseMode = GetReleaseMode ( NNrtag_id )PRIVATE_Is_Allowed_To = FALSEIf ReleaseMode <> enumDB_RELEASE_IN_CLOSED_MODE AND ReleaseMode <> enumDB_RELEASE_IN_ARCHIVE_MODE ThenIf ( ReleaseMode = enumDB_RELEASE_IN_OPEN_MODE ) ThenPRIVATE_Is_Allowed_To = TRUEElseIf objAccessControl.IsActive(accessControlObjectName) ThenPRIVATE_Is_Allowed_To = TRUEEnd IfEnd IfEnd IfEnd Function'-----------------------------------------------------------------------------------------------------------------------------Function PRIVATE_Is_Allowed_To_Approve_Merge(NNrtag_id)PRIVATE_Is_Allowed_To_Approve_Merge = PRIVATE_Is_Allowed_To(NNrtag_id, "ApproveForAutoBuild") _OR PRIVATE_Is_Allowed_To(NNrtag_id, "ApproveForManualBuild")End Function'----------------------------------------------------------------------------------------------------------------------------------------Function PRIVATE_Is_Allowed_To_Approve_ManualBuild(NNrtag_id)PRIVATE_Is_Allowed_To_Approve_ManualBuild = PRIVATE_Is_Allowed_To(NNrtag_id, "ApproveForManualBuild")End Function'----------------------------------------------------------------------------------------------------------------------------------------Function PRIVATE_Is_Allowed_To_Approve_AutoBuild(NNrtag_id)PRIVATE_Is_Allowed_To_Approve_AutoBuild = PRIVATE_Is_Allowed_To(NNrtag_id, "ApproveForAutoBuild")End Function'=============================================================================================================================' APPROVING PENDING MERGE OPERATIONS - Used from _approve_merge.asp as well as from within this file itself'' All functions in this section originally came from _approve_merge.asp and were placed here to support their use in more' than the original singular context. Being relocated here allows them to be used in the additional "Bulk Release" context.'============================================================================================================================='-----------------------------------------------------------------------------------------------------------------------------' USED to approve a pending merge operation. Used internally by the bulk release operationSub PRIVATE_ApproveMerge ( NNrtag_id, NNpv_id )On Error Resume NextobjEH.ErrorRedirect = TRUEOraDatabase.Parameters.Add "PV_ID", NNpv_id, ORAPARM_INPUT, ORATYPE_NUMBEROraDatabase.Parameters.Add "RTAG_ID", NNrtag_id, ORAPARM_INPUT, ORATYPE_NUMBEROraDatabase.Parameters.Add "USER_ID", objAccessControl.UserId, ORAPARM_INPUT, ORATYPE_NUMBERobjEH.TryORA ( OraSession )OraDatabase.ExecuteSQL _"BEGIN "&_" PK_ENVIRONMENT.APPROVE_MERGE ( :PV_ID, :RTAG_ID, :USER_ID );"&_"END; "objEH.CatchORA ( OraSession )OraDatabase.Parameters.Remove "PV_ID"OraDatabase.Parameters.Remove "RTAG_ID"OraDatabase.Parameters.Remove "USER_ID"End Sub'-----------------------------------------------------------------------------------------------------------------------------' USED to approve a pending merge operation. Used externally from the _approve_merge.asp file, loaded when the btnApproveMerge' action button is pressed.Sub PUBLIC_ApproveMerge ( NNrtag_id, NNpv_id )' validate before carrying out the mergeIf PRIVATE_Is_A_Valid_Pending_Merge(NNrtag_id, NNpv_id, "A") OR PRIVATE_Is_A_Valid_Pending_Merge(NNrtag_id, NNpv_id, "S") ThenIf PRIVATE_Is_Allowed_To_Approve_Merge(NNrtag_id) ThenCall PRIVATE_ApproveMerge(parRtag_id, NNpv_id)End IfEnd IfEnd Sub'-----------------------------------------------------------------------------------------------------------------------------' USED to validate an attempt to approve a pending merge operationFunction PRIVATE_Is_A_Valid_Pending_Merge(NNrtag_id, NNpv_id, op)Dim rsQryOraDatabase.Parameters.Add "PV_ID", NNpv_id, ORAPARM_INPUT, ORATYPE_NUMBEROraDatabase.Parameters.Add "RTAG_ID", NNrtag_id, ORAPARM_INPUT, ORATYPE_NUMBERSet rsQry = OraDatabase.DbCreateDynaset( GetQuery("PlannedPackageVersionDetails.sql"), cint(0))If ((NOT rsQry.BOF) AND (NOT rsQry.EOF)) Then' Does the actual operation field in the database match that specified as a parameter?If (rsQry.Fields("operation") = op) ThenPRIVATE_Is_A_Valid_Pending_Merge = TRUEElsePRIVATE_Is_A_Valid_Pending_Merge = FALSEEnd IfElsePRIVATE_Is_A_Valid_Pending_Merge = FALSEEnd IfOraDatabase.Parameters.Remove "PV_ID"OraDatabase.Parameters.Remove "RTAG_ID"rsQry.Close()Set rsQry = NothingEnd Function'=============================================================================================================================' APPROVING MANUAL BUILD PENDING VERSIONS - Used from _make_released.asp as well as from within this file itself'' All functions in this section originally came from _make_released.asp and were placed here to support their use in more' than the original singular context. Being relocated here allows them to be used in the additional "Bulk Release" context.'============================================================================================================================='----------------------------------------------------------------------------------------------------------------------------------------' This function came from _make_released.asp and is very similar to the PRIVATE_NotifyInterestAutoBuild, except the subject/body' text is different. Unlike its auto-build counterpart, this one is called during the process of making a manual build release' official.' One question arises... can we not harmonize the email notification code somewhat, between manual and autobuild releases?'' Currently, the function is called internally as part of the bulk release operation, and from _generate_release_notes.asp,' loaded by _make_released.asp which in turn is loaded when a user presses the btnMakeReleased action button for manual' built pending versions.Sub PUBLIC_NotifyInterestManualBuild( NNrtag_id, NNpv_id )Err.ClearOn Error Resume NextDim Query_String, rsQry, myMailQuery_String = _" SELECT * FROM PACKAGE_INTEREST PI, PACKAGES PKG, PACKAGE_VERSIONS PV, USERS U,"&_" RELEASE_TAGS RT, PROJECTS PRJ WHERE PKG.PKG_ID = PI.PKG_ID AND "&_" RT.RTAG_ID = "& NNrtag_id &""&_" AND PV.PV_ID = "& NNpv_id &" AND PV.PKG_ID = PKG.PKG_ID AND "&_" PRJ.PROJ_ID = RT.PROJ_ID AND PRJ.PROJ_ID = PI.PROJ_ID AND U.USER_ID = PI.USER_ID"Set rsQry = OraDatabase.DbCreateDynaset( Query_String , cint(0) )If rsQry.RecordCount <> "" ThenWhile ((NOT rsQry.BOF) AND (NOT rsQry.EOF))If rsQry("user_email") <> "" ThenSet myMail=Server.CreateObject("Persits.MailSender")myMail.Host = SMTP_HOSTmyMail.Subject="Version "& rsQry("pkg_version") &" of Package "& rsQry("pkg_name") &" in Project " & rsQry("proj_name") &" on Release Branch " & rsQry("rtag_name") &" has been released."myMail.Body = "You have received this email as a result of your interest in this package. If you do not wish to receive further emails then remove your package interest from the notifications area in Release Manager."myMail.From=ADMIN_EMAILmyMail.AddAddress rsQry("user_email")myMail.Sendset myMail=nothingEnd IfrsQry.MoveNextWendEnd IfrsQry.Close()set rsQry = nothingEnd Sub'----------------------------------------------------------------------------------------------------------------------------------------' Currently, this function is called internally as part of the bulk release operation, and from _generate_release_notes.asp,' loaded by _make_released.asp which in turn is loaded when a user presses the btnMakeReleased action button for manual' built pending versions. It initiates the execution of the windows script file that performs additional database updates' that are needed to make official a package version that has already been built and published into dpkg_archive. This includes' collecting info on all files that were published to dpkg_archive, and inserting that info into the RELEASED_COMPONENTS table.Function PUBLIC_Run_onMakeOfficial ( nRtag_id, nPv_id )Dim objWSH, proj_id, Qry, sRtagNamePUBLIC_Run_onMakeOfficial = FALSEOn Error Resume NextobjEH.TryORA ( OraSession )OraDatabase.ExecuteSQL " UPDATE package_versions "&_" SET release_notes_info = '"& enum_RELEASE_NOTES_GENERATING &"'"&_" WHERE pv_id = "& nPv_idobjEH.CatchORA ( OraSession )If objEH.LastOraFailed = FALSE ThenSet objWSH = Server.CreateObject("WScript.Shell")'Used for getting the package name and package versionOraDatabase.Parameters.Add "RTAG_ID", nRtag_id, ORAPARM_INPUT, ORATYPE_NUMBERSet Qry = OraDatabase.DbCreateDynaset( "SELECT * FROM RELEASE_TAGS WHERE RTAG_ID = :RTAG_ID", 0 )proj_id = Qry("proj_id")sRtagName = UCase( Qry("rtag_name") )Qry.Close()Set Qry = NothingOraDatabase.Parameters.Remove "RTAG_ID"'If proj_id = 281 Or proj_id = 221 Then' objWSH.Run "cmd.exe /c cscript.exe //B //NoLogo "& rootPath & SCRIPTS_FOLDER_STEP &"\on_Make_Official.wsf //job:GetComponents //job:GenerateReleaseNotes //job:PostRun "&_' "/pv_id:"& nPv_id , _' 0, False'ElseobjWSH.Run "cmd.exe /c cscript.exe //B //NoLogo "& rootPath & SCRIPTS_FOLDER &"\on_Make_Official.wsf //job:GetComponents //job:GenerateReleaseNotes //job:PostRun "&_"/pv_id:"& nPv_id & " /proj_id:"& proj_id &" /rtag_name:"""&sRtagName&"", _0, False'End IfSet objWSH = nothingPUBLIC_Run_onMakeOfficial = TRUEEnd IfEnd Function'-----------------------------------------------------------------------------------------------------------------------------' This sub is used from _make_released.asp, loaded when a user presses the btnMakeReleased action button, as well as from' internally within this file as part of the bulk release operation.' This function basically removes the PV_ID entry from the WIP/PLANNED table, and adds it to the RELEASE_CONTENT table.Function PUBLIC_MakeRelease ( NNrtag_id, NNpv_id )On Error Resume NextobjEH.ErrorRedirect = TRUEOraDatabase.Parameters.Add "PV_ID", NNpv_id, ORAPARM_INPUT, ORATYPE_NUMBEROraDatabase.Parameters.Add "RTAG_ID", NNrtag_id, ORAPARM_INPUT, ORATYPE_NUMBEROraDatabase.Parameters.Add "USER_ID", objAccessControl.UserId, ORAPARM_INPUT, ORATYPE_NUMBERobjEH.TryORA ( OraSession )OraDatabase.ExecuteSQL _"BEGIN "&_" PK_ENVIRONMENT.MAKE_RELEASE ( :PV_ID, :RTAG_ID, :USER_ID );"&_"END; "objEH.CatchORA ( OraSession )OraDatabase.Parameters.Remove "PV_ID"OraDatabase.Parameters.Remove "RTAG_ID"OraDatabase.Parameters.Remove "USER_ID"' return TRUE if operation was successful, else FALSEIf objEH.LastOraFailed ThenPUBLIC_MakeRelease = FALSEElsePUBLIC_MakeRelease = TRUEEnd IfEnd Function'=============================================================================================================================' APPROVING AUTO/MANUAL BUILD PENDING VERSIONS - Used from _make_approved.asp as well as from within this file itself'' All functions in this section originally came from _make_approved.asp and were placed here to support their use in more' than the original singular context. Being relocated here allows them to be used in the additional "Bulk Release" context.'============================================================================================================================='----------------------------------------------------------------------------------------------------------------------------------------Function PRIVATE_Get_CQ_Issues ( SSsql, OOrsCQ )'On Error Resume NextOOrsCQ.ActiveConnection = CQ_connOOrsCQ.Source = SSsqlOOrsCQ.CursorType = 0OOrsCQ.CursorLocation = 2OOrsCQ.LockType = 3OOrsCQ.Open()PRIVATE_Get_CQ_Issues = Err.NumberEnd Function'------------------------------------------------------------------------------------------------------------------------------------------' Currently, this function does not seem to be used. The call to it was commented out in the _make_approved.asp file from where it was' originally called from.'Sub PRIVATE_NotifyInterestAutoBuild( NNrtag_id, NNpv_id )On Error Resume NextDim Query_String, rsQry, myMailQuery_String = _" SELECT * FROM PACKAGE_INTEREST PI, PACKAGES PKG, PACKAGE_VERSIONS PV, USERS U,"&_" RELEASE_TAGS RT, PROJECTS PRJ WHERE PKG.PKG_ID = PI.PKG_ID AND "&_" RT.RTAG_ID = "& NNrtag_id &""&_" AND PV.PV_ID = "& NNpv_id &" AND PV.PKG_ID = PKG.PKG_ID AND "&_" PRJ.PROJ_ID = RT.PROJ_ID AND PRJ.PROJ_ID = PI.PROJ_ID AND U.USER_ID = PI.USER_ID"Set rsQry = OraDatabase.DbCreateDynaset( Query_String , cint(0) )If rsQry.RecordCount <> "" ThenWhile ((NOT rsQry.BOF) AND (NOT rsQry.EOF))If rsQry("user_email") <> "" ThenSet myMail=Server.CreateObject("Persits.MailSender")myMail.Host = SMTP_HOSTmyMail.Subject="New Version of Package "& rsQry("pkg_name") &" in Project " & rsQry("proj_name") &" on Release Branch " & rsQry("rtag_name") &" would be autobuild soon."myMail.From=ADMIN_EMAILmyMail.AddAddress rsQry("user_email")myMail.Sendset myMail=nothingEnd IfrsQry.MoveNextWendEnd IfrsQry.Close()set rsQry = nothingEnd Sub'-------------------------------------------------------------------------------------Sub PRIVATE_Get_Package_Issues(NNpv_id, SSsql)Dim sqlstr, rsTemp, DEVIiss, TDSEiss, VT5DMiss, VTSUPisssqlstr = "SELECT iss_db, iss_id, iss_state, notes FROM CQ_ISSUES WHERE pv_id="& NNpv_id &" AND iss_state = 1"Set rsTemp = OraDatabase.DbCreateDynaset( sqlstr, cint(0))DEVIiss = "-1"TDSEiss = "-1"VT5DMiss = "-1"VTSUPiss = "-1"While ((NOT rsTemp.BOF) AND (NOT rsTemp.EOF))If CInt(rsTemp("iss_db")) = CInt(enumCLEARQUEST_DEVI_ID) ThenDEVIiss = DEVIiss &","& rsTemp("iss_id")ElseIf CInt(rsTemp("iss_db")) = CInt(enumCLEARQUEST_TDSE_ID) ThenTDSEiss = TDSEiss &","& rsTemp("iss_id")ElseIf CInt(rsTemp("iss_db")) = CInt(enumCLEARQUEST_VT5DM_ID) ThenVT5DMiss = VT5DMiss &","& rsTemp("iss_id")ElseIf CInt(rsTemp("iss_db")) = CInt(enumCLEARQUEST_VTSUP_ID) ThenVTSUPiss = VTSUPiss &","& rsTemp("iss_id")End IfrsTemp.MoveNextWEnd' Construct SQL statement for CQ databaseIf Len(DEVIiss) <> 1 OR Len(TDSEiss) <> 1 ThenSSsql = ReadFile( rootPath & "queries\cq_issues.sql" )SSsql = Replace( SSsql, "/*enumCLEARQUEST_DEVI_ID*/", enumCLEARQUEST_DEVI_ID)SSsql = Replace( SSsql, "/*enumCLEARQUEST_TDSE_ID*/", enumCLEARQUEST_TDSE_ID)SSsql = Replace( SSsql, "/*enumCLEARQUEST_VT5DM_ID*/", enumCLEARQUEST_VT5DM_ID)SSsql = Replace( SSsql, "/*enumCLEARQUEST_VTSUP_ID*/", enumCLEARQUEST_VTSUP_ID)SSsql = Replace( SSsql, "/*DEVIiss*/", DEVIiss)SSsql = Replace( SSsql, "/*TDSEiss*/", TDSEiss)SSsql = Replace( SSsql, "/*VT5DMiss*/", VT5DMiss)SSsql = Replace( SSsql, "/*VTSUPiss*/", VTSUPiss)End IfrsTemp.CloseSet rsTemp = nothingEnd Sub'-------------------------------------------------------------------------------------Function PRIVATE_MakeApproved (NNrtag_id, NNpv_id)OraDatabase.Parameters.Add "PV_ID", NNpv_id, ORAPARM_INPUT, ORATYPE_NUMBEROraDatabase.Parameters.Add "RTAG_ID", NNrtag_id, ORAPARM_INPUT, ORATYPE_NUMBEROraDatabase.Parameters.Add "USER_ID", objAccessControl.UserId, ORAPARM_INPUT, ORATYPE_NUMBERobjEH.TryORA ( OraSession )On Error Resume NextOraDatabase.ExecuteSQL _"BEGIN "&_" PK_ENVIRONMENT.MAKE_APPROVED ( :PV_ID, :RTAG_ID, :USER_ID ); "&_"END; "objEH.CatchORA ( OraSession )OraDatabase.Parameters.Remove "PV_ID"OraDatabase.Parameters.Remove "RTAG_ID"OraDatabase.Parameters.Remove "USER_ID"' return TRUE if operation was successful, else FALSEIf objEH.LastOraFailed ThenPRIVATE_MakeApproved = FALSEElsePRIVATE_MakeApproved = TRUEEnd IfEnd Function'-------------------------------------------------------------------------------------' This function is called from _make_approved.asp, which is loaded when the btnApprovePackage' action button is pressed. It is also called as part of the bulk release operation.Function PUBLIC_ApproveRelease(NNrtag_id, NNpv_id, ByRef retParameters, isBulk)Dim retERRmsgDim retALRTmsgDim pkgTyperetParameters = ""pkgType = 0Set pkgInfoHash = CreateObject("Scripting.Dictionary")' default return valuePUBLIC_ApproveRelease = FALSEIf ( NNrtag_id <> "") AND (NNpv_id <> "") Then'-- Get Package detailsCall Get_Pkg_Info ( NNpv_id, NNrtag_id )If pkgInfoHash.Item("build_type") = "A" Then'Check If There Already Exists A WIP Instance Of The Package In The ReleaseIf Check_Package_WIP_Already_Exists(NNrtag_id, NNpv_id) > 0 ThenRaiseWIPExists = TRUEEnd IfIf PRIVATE_Is_Allowed_To_Approve_AutoBuild(NNrtag_id) Then'-- Approve Automatic-build packageCall CheckRequirementsForMakeApproved ( NNpv_id, NNrtag_id, pkgType, retERRmsg, retALRTmsg, retParameters )If IsNull(retERRmsg) ThenDim EmailBodyIf PRIVATE_MakeApproved (NNrtag_id, NNpv_id) = TRUE ThenIf ( RaiseWIPExists = TRUE ) AND ( isBulk = FALSE ) ThenCall RaiseMsg ( enum_MSG_PACKAGE_WIP_EXISTS&"?rtag_id="& NNrtag_id & "&pv_id="& NNpv_id & "", NNpv_id )' RaiseMsg redirects loaded web page, so no return' Deal with BulkMakeRelease elsewhereEnd If' indicate successPUBLIC_ApproveRelease = TRUEEnd IfElseCall RaiseMsg ( Eval(retERRmsg), NNrtag_id & "|" & NNpv_id & "|" & retParameters & "|" & "N" )End IfElse' Indicate an auto-build permission problem was detected in the global variable.' This is only used within the context of a bulk release.AutoBuildPermissionDenied = TRUEEnd IfElseIf PRIVATE_Is_Allowed_To_Approve_ManualBuild(NNrtag_id) Then'-- Approve a Manual Build ReleaseCall CheckRequirementsForMakeRelease ( NNpv_id, NNrtag_id, pkgType, retERRmsg, retALRTmsg, retParameters )If IsNull(retERRmsg) ThenIf PUBLIC_MakeRelease ( NNrtag_id, NNpv_id ) = TRUE Then' If all went well, initiate the generation of release notes, and email any interested partiesIf PUBLIC_Run_onMakeOfficial ( NNrtag_id, NNpv_id ) = TRUE ThenCall PUBLIC_NotifyInterestManualBuild( NNrtag_id, NNpv_id )' indicate successPUBLIC_ApproveRelease = TRUEEnd IfEnd IfElseCall RaiseMsg ( Eval(retERRmsg), NNrtag_id & "|" & NNpv_id & "|" & retParameters & "|" & "N" )End IfElse' Indicate a manual-build permission problem was detected in the global variable' This is only used within the context of a bulk release.ManualBuildPermissionDenied = TRUEEnd IfEnd IfEnd IfEnd Function'-----------------------------------------------------------------------------------------------------------------------------'=============================================================================================================================' MAKING A BULK RELEASE from a list of PV_IDs for a specified release'' This section contains the new "Bulk Release' code. This function is tied to the use of the make bulk release button.''============================================================================================================================='-----------------------------------------------------------------------------------------------------------------------------' This public function is called from the make_bulk_release.asp file, loaded when a user presses the Make Bulk Release' button when viewing items on the Pending Tab of a release area.'' The function processes a list of PV_ID's that cam from the pending tab of a release, formed from each item whose checkbox' was checked. There are 3 different types of item to deal with, and this function will deal with them in the order shown' below:' 1) Subtractive merge operations' 2) Additive merge operations' 3) Manual/Auto build items'' This order was chosen by design to ensure that in the end effect upon a release, the manual and auto build items' take precedence over merge candidates. This occurs naturally if we process manual/auto build items last.'' Parameters:' NNrtag_id The release area' NN_pv_id_list A list of PV_IDs representing pending items to be approved for release or merge.'Sub PUBLIC_MakeBulkRelease (NNrtag_id, NN_pv_id_list)Dim initialList ' holds all itemsDim remainingList1() ' To hold additive merge itemsDim remainingList2() ' To hold auto/manual build itemsDim len_remainingListDim pvIdDim retParametersDim allowedToApproveMerge' determine in advance if user is allowed to approve mergesallowedToApproveMerge = PRIVATE_Is_Allowed_To_Approve_Merge(NNrtag_id)' ready the remaining list index to extract additive merges and manual/auto build itemslen_remainingList = 0AutoBuildPermissionDenied = FALSEManualBuildPermissionDenied = FALSE' Remove any spaces and split the pv_id list into a string arrayinitialList = Split ( Replace(NN_pv_id_list, " ", "" ), "," )' Process each subtractive merge item in the string array.' We do these first to cleanup the release somewhat before we start adding new stuff inFor Each pvId In initialListIf IsNumeric(pvId) Then' Test to see if this PV_ID represents a pending SUBTRACTIVE merge operation, and proceed with it if permissions allowIf PRIVATE_Is_A_Valid_Pending_Merge(NNrtag_id, pvId, "S") ThenIf allowedToApproveMerge ThenCall PRIVATE_ApproveMerge(NNrtag_id, pvId)ElseAutoBuildPermissionDenied = TRUEManualBuildPermissionDenied = TRUEEnd IfElse' add item to the remaining list for the next loop to processlen_remainingList = len_remainingList + 1ReDim Preserve remainingList1(len_remainingList)remainingList1(len_remainingList - 1) = pvIdEnd IfEnd IfNext' ready the remaining list index to extract manual/auto build itemslen_remainingList = 0' Now process each additive merge item in the string array' We do these before finally processing any auto/manual build items so that the latter take precedence in their eventual' effect upon the release.For Each pvId In remainingList1' Test to see if this PV_ID represents a pending ADDITIVE merge operation, and proceed with it if permissions allowIf PRIVATE_Is_A_Valid_Pending_Merge(NNrtag_id, pvId, "A") ThenIf allowedToApproveMerge ThenCall PRIVATE_ApproveMerge(NNrtag_id, pvId)ElseAutoBuildPermissionDenied = TRUEManualBuildPermissionDenied = TRUEEnd IfElse' add item to the remaining list for the next loop to processlen_remainingList = len_remainingList + 1ReDim Preserve remainingList2(len_remainingList)remainingList2(len_remainingList - 1) = pvIdEnd IfNext' Now process each new Auto/Manaul build item in the string arrayRaiseWIPExists = FALSEFor Each pvId In remainingList2Call PUBLIC_ApproveRelease(NNrtag_id, pvId, retParameters, TRUE)NextIf ( RaiseWIPExists = TRUE ) ThenCall RaiseMsg ( enum_MSG_PACKAGE_WIP_EXISTS&"?rtag_id="& NNrtag_id & "&pv_id="& pvId & "", pvId )' RaiseMsg redirects loaded web page, so no returnEnd If' If any items were not approved for release due to permission errors, issue an alert to the userIf AutoBuildPermissionDenied = TRUE OR ManualBuildPermissionDenied = TRUE ThenCall RaiseMsg( enum_MSG_ERROR, "One of more items could not be approved due to missing permissions (either ApproveForAutoBuild or ApproveForManualBuild).<p>"_& "NOTE : All items that could be approved, have been.</p>" )End IfEnd Sub'-----------------------------------------------------------------------------------------------------------------------------%>