Rev 5590 | Rev 6048 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | RSS feed
<%@LANGUAGE="VBSCRIPT"%><%Option explicitResponse.Expires = 0 ' always load the page, dont store%><%'=====================================================' Change Group'=====================================================%><!--#include file="common/conf.asp"--><!--#include file="common/globals.asp"--><!--#include file="common/qstr.asp"--><!--#include file="common/common_subs.asp"--><!--#include file="common/common_dbedit.asp"--><!--#include file="common/_popup_window_common.asp"--><!--#include file="common/daemon_instructions.asp"--><%'------------ ACCESS CONTROL ------------------%><!--#include file="_access_control_general.asp"--><!--#include file="_access_control_project.asp"--><%'------------ Variable Definition -------------Dim sMessage, sMessageTypeDim parPv_idDim parProj_idDim parNewRtag_idDim parRfileDim bPreventSubmit'------------ Constants Declaration -----------'------------ Variable Init -------------------sMessage = NULLsMessageType = 3Set pkgInfoHash = CreateObject("Scripting.Dictionary")parPv_id = QStrPar("pv_id")parProj_id= QStrParDefault("proj_id",DB_PROJ_ID)parNewRtag_id = QStrParDefault("new_rtag_id", parRtag_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'----------------------------------------------%><%'------------------------------------------------------------------------------------------------------------------------------------------' Add a line of text to the System Message'Sub sMessageAdd(eLevel, text)If NOT isNull(sMessage) ThensMessage = sMessage & "<br>"End IfsMessage = sMessage & textIf eLevel < sMessageType ThensMessageType = eLevelEnd IfEnd Sub'------------------------------------------------------------------------------------------------------------------------------------------Sub Get_Pkg_Info_From_Rel ( SSrtag_id, SSpv_id )Dim rsTemp, Query_StringQuery_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_idSet rsTemp = OraDatabase.DbCreateDynaset( Query_String, cint(0))If ((NOT rsTemp.BOF) AND (NOT rsTemp.EOF)) ThenpkgInfoHash.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 IfrsTemp.CloseSet rsTemp = nothingEnd 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, sselectedFound = FalseQuery_String = "SELECT * FROM projects ORDER BY UPPER( proj_name )"Set rsTemp = OraDatabase.DbCreateDynaset( Query_String, cint(0))s = "<td class='form_field' background='images/bg_form_lightbluedark.gif' >Project</td>"s = s + "<td background='images/bg_form_lightbluedark.gif'><select id='proj_id_list' name='proj_id_list' class='form_item' onChange=""MM_jumpMenu('window',this,0)"">"While ((NOT rsTemp.BOF) AND (NOT rsTemp.EOF))projName = UCase(rsTemp.Fields("proj_name"))tempLINK = scriptName & "?proj_id=" & rsTemp.Fields("proj_id") &_"&rtag_id="& parRtag_id &_"&new_rtag_id="& parNewRtag_id &_"&pv_id="& parPv_id &_"&rfile="& parRfileIf ((CStr(NNproj_id) = Cstr(rsTemp.Fields("proj_id"))) OR (NNproj_id = "0")) AND (selectedFound = False) Thens = s + "<option value='"& tempLINK &"' selected>"& projName &"</option>"selectedFound = TrueNNproj_id = CStr(rsTemp.Fields("proj_id"))Elses = s + "<option value='"& tempLINK &"'>"& projName &"</option>"End IfrsTemp.MoveNextWEnds = s + "</select>"' Correct for a situation where selectedFound is still FALSE.If NOT selectedFound ThenrsTemp.MoveFirstIf ((NOT rsTemp.BOF) AND (NOT rsTemp.EOF)) ThenNNproj_id = CStr(rsTemp.Fields("proj_id"))ElseNNproj_id = "0"End IfEnd IfrsTemp.CloseSet rsTemp = nothings = s + "</td>"Get_Projects = sEnd 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, numReleasesselectedFound = FalsenumReleases = 0Query_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 = "<select id='rtag_id_list' name='rtag_id_list' class='form_item' onChange=""MM_jumpMenu('window',this,0)"">"While ((NOT rsTemp.BOF) AND (NOT rsTemp.EOF))releaseName = rsTemp.Fields("rtag_name")tempLINK = scriptName & "?proj_id="& NNproj_id &_"&rtag_id="& parRtag_id &_"&new_rtag_id="& rsTemp.Fields("rtag_id") &_"&pv_id="& parPv_id &_"&rfile="& parRfileIf ((CStr(NNrtag_id) = CStr(rsTemp.Fields("rtag_id"))) OR (NNrtag_id = "0")) AND (selectedFound = False) Thens = s + "<option value='"& tempLINK &"' selected>"& releaseName &"</option>"selectedFound = TrueNNrtag_id = Cstr(rsTemp.Fields("rtag_id"))Elses = s + "<option value='"& tempLINK &"'>"& releaseName &"</option>"End IfnumReleases = numReleases + 1rsTemp.MoveNextWEnds = s + "</select>"' Correct for a situation where selectedFound is still FALSE.If NOT selectedFound ThenrsTemp.MoveFirstIf ((NOT rsTemp.BOF) AND (NOT rsTemp.EOF)) ThenNNrtag_id = CStr(rsTemp.Fields("rtag_id"))ElseNNrtag_id = "0"End IfEnd If' If no releases were found then replace drop down list with some warning text and disable form submissionIf numReleases = 0 ThenbPreventSubmit = Trues = "<a class=err_alert>No active releases</a>"Call sMessageAdd( 1, "No active releases found. The operation cannot be performed")End IfrsTemp.CloseSet rsTemp = nothings = "<td class='form_field' background='images/bg_form_lightbluedark.gif' >Release</td>" + "<td background='images/bg_form_lightbluedark.gif' >" + s + "<td>"Get_Releases = sEnd Function'-------------------------------------------------------------------------------------------------------' Call stored procedures to move the WIP from the source release to the destination release' Return false on failure'-------------------------------------------------------------------------------------------------------Function MoveWip(source_RtagId, destination_RtagId, pvId, viewId)MoveWip = FalseOraDatabase.Parameters.Add "RTAG_ID", source_RtagId, ORAPARM_INPUT, ORATYPE_NUMBEROraDatabase.Parameters.Add "PV_ID", pvId, ORAPARM_INPUT, ORATYPE_VARCHAR2OraDatabase.Parameters.Add "USER_ID", objAccessControl.UserId, ORAPARM_INPUT, ORATYPE_NUMBEROraDatabase.Parameters.Add "VIEW_ID", viewId, ORAPARM_INPUT, ORATYPE_NUMBERobjEH.ErrorRedirect = FALSEobjEH.TryORA ( OraSession )On Error Resume NextOraDatabase.ExecuteSQL _"BEGIN PK_WORK_IN_PROGRESS.REMOVE_PACKAGE ( :PV_ID, :RTAG_ID, :USER_ID ); END;"If Err.Number = 0 Then' First step is OKOraDatabase.Parameters.Remove "RTAG_ID"OraDatabase.Parameters.Add "RTAG_ID", destination_RtagId, ORAPARM_INPUT, ORATYPE_NUMBERobjEH.ErrorRedirect = FALSEobjEH.TryORA ( OraSession )On Error Resume NextOraDatabase.ExecuteSQL _"BEGIN PK_WORK_IN_PROGRESS.ADD_PACKAGE ( :PV_ID, :VIEW_ID, :RTAG_ID, :USER_ID ); END;"End IfobjEH.CatchORA ( OraSession )If objEH.Finally ThenMoveWip = TrueEnd IFOraDatabase.Parameters.Remove "RTAG_ID"OraDatabase.Parameters.Remove "PV_ID"OraDatabase.Parameters.Remove "USER_ID"OraDatabase.Parameters.Remove "VIEW_ID"End Function%><%' get pkgInfoHash items for the source WIPCall Get_Pkg_Info_From_Rel ( parRtag_id, parPv_id )' Access controlIf NOT objAccessControl.UserLogedIn ThenCall sMessageAdd (1,"User is no longer logged in")bPreventSubmit = TrueElseIf NOT canActionInProject() ThenCall sMessageAdd (1, "You have been denied permission to modify the source release")bPreventSubmit = True' Make sure this WIP can be moved - prevent if it has a pending test build instruction, etcElseIf (DaemonInstructionPreventsEditing(Request("rtag_id"), Request("pv_id"))) ThenbPreventSubmit = TrueCall sMessageAdd (1, "This WIP has one or more daemon instructions present.<br>"&_"Please delete them or allow them to complete before moving WIPs.")Else' check for form submissionIf CBool(QStrPar("action")) AND (QStrPar("btn") = "Move") AND objAccessControl.UserLogedIn Then'Process submitionIf MoveWip(parRtag_id, parNewRtag_id, parPv_id, pkgInfoHash.Item("view_id")) ThenCall OpenInParentWindow (parRfile &"?pv_id="& parPv_id &"&rtag_id="& parNewRtag_id )Call CloseWindowEnd IfElse' 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 buttonCall Get_Projects(parProj_id)Call Get_Releases(parProj_id, parNewRtag_id)End IfEnd If' Prevent moving to myselfIf (parNewRtag_id = parRtag_id) ThenCall sMessageAdd (3,"Select a release")bPreventSubmit = TrueEnd 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" type="text/css"><link rel="stylesheet" href="images/navigation.css" type="text/css"><script language="JavaScript" src="images/tipster.js"></script><script language="JavaScript" src="images/_help_tips.js"></script><script language="JavaScript" src="images/common.js"></script></head><body bgcolor="#FFFFFF" text="#000000" leftmargin="0" topmargin="0" onload="self.focus();"><form name="chgroup" method="post" action="<%=scriptName%>" class="form_tight"><table border="0" cellspacing="0" cellpadding="2"><tr><td><!-- MESSAGE ++++++++++++++++++++++++++++++++++++++++++++++ --><%Call Messenger ( sMessage , sMessageType, "100%" )%><!-- MESSAGE +++++++++++++++++++++++++++++++++++++++++++++++++++ --><!--#include file="messages/_msg_inline.asp"--></td><tr><td valign="top" nowrap class="wform_ttl" background="images/bg_form_lightgray.gif"><table width="100%" border="0" cellspacing="1" cellpadding="2"><tr><td width="1%"><img src="images/h_trsp_dot.gif" width="10" height="30"></td><td width="1%" nowrap class="form_group" valign="bottom" colspan="2">WIP Details</td></tr><tr><td width="1%"> </td><td width="1%" nowrap class="form_field" background="images/bg_form_lightbluedark.gif">Package</td><td nowrap width="100%" background="images/bg_form_lightbluedark.gif" class="form_txt"><%=pkgInfoHash.Item("pkg_name")%></td></tr><tr><td width="1%"> </td><td width="1%" nowrap class="form_field" background="images/bg_form_lightbluedark.gif">Version</td><td nowrap width="100%" background="images/bg_form_lightbluedark.gif" class="form_txt"><%=pkgInfoHash.Item("pkg_version")%></td></tr><tr><td width="1%"> </td><td width="1%" nowrap class="form_field" background="images/bg_form_lightbluedark.gif">View<a href="#" onMouseOver="formTips.show('group')" onMouseOut="formTips.hide()"></a></td><td nowrap width="100%" background="images/bg_form_lightbluedark.gif" class="form_txt"><%=pkgInfoHash.Item("view_name")%></td></tr><tr><td width="1%"><img src="images/h_trsp_dot.gif" width="10" height="30"></td><td width="1%" nowrap class="form_group" valign="bottom" colspan="2">Select Destination Release</td></tr><tr><td width="1%"> </td><%=Get_Projects(parProj_id)%><td nowrap width="100%"> </td></tr><tr><td width="1%"> </td><%=Get_Releases(parProj_id, parNewRtag_id)%><td nowrap width="100%"> </td></tr></table></td></tr><tr><td valign="top" nowrap class="wform_ttl" background="images/bg_form_lightgray.gif"><table width="100%" border="0" cellspacing="1" cellpadding="2"><tr><td width="1%" wrap class="form_group" valign="bottom"><img src="images/i_warning.gif" width="16" height="16">The destination release may not satisfy any or all the dependencies that come withthe WIP you are about to move. It is your responsibility to rectify this in thedestination release.</td></tr></table></td></tr><tr><td align="right"><input type="submit" name="btn" value="Move" <%=Iif(bPreventSubmit, "disabled", "")%> class="form_btn_comp form_btn"><input type="reset" name="btn" value="Cancel" class="form_btn_comp" onclick="parent.closeIFrame();"></td></tr></table><input type="hidden" name="pv_id" value="<%=parPv_id%>"><input type="hidden" name="rtag_id" value="<%=parRtag_id%>"><input type="hidden" name="new_rtag_id" value="<%=parNewRtag_id%>"><input type="hidden" name="view_id" value="<%=pkgInfoHash.Item("view_id")%>"><input type="hidden" name="rfile" value="<%=parRfile%>"><input type="hidden" name="action" value="true"></form><!-- TIPS LAYERS --------------------------------------><div id="formTipsLayer" style="position: absolute; z-index: 1000; visibility: hidden; left:0; top: 0; width: 10"> </div><!-----------------------------------------------------></body></html><!-- DESTRUCTOR -------><!--#include file="common/destructor.asp"-->