Subversion Repositories DevTools

Rev

Rev 6694 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | RSS feed

<%@LANGUAGE="VBSCRIPT"%>
<%
'=====================================================
'|                                                   |
'|                   Edit Project View Details    |
'|                                                   |
'=====================================================
%>
<%
Option explicit
' Good idea to set when using redirect
Response.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 Login
Call objPMod.StoreParameter ( "rfile", RequestDefault("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 rsQry
Dim parProjId
Dim parModeCode
Dim pvIdList, pvIds, PVS, i, aFullList
Dim ProblemsString
Dim ProblemInfo
Dim rfile
'------------ Constants Declaration -----------
'Const imgPkgLocked                = "<img src='images/i_locked.gif' width='7' height='10' hspace='4' align='absmiddle' title='Package Locked'>"
'------------ Variable Init -------------------
parProjId = Request("proj_id")
parModeCode = Request("mode_code")
objPMod.PersistInQryString("proj_id")
rfile = RequestDefault("rfile", "dependencies.asp")
Set ProblemInfo =   Server.CreateObject("Scripting.Dictionary")
'----------------------------------------------
Sub DestroyPackage ( nPvId, cOverrideWarnings, outProblemsString )

   OraDatabase.Parameters.Add "PV_ID",             nPvId,             ORAPARM_INPUT,  ORATYPE_NUMBER
   OraDatabase.Parameters.Add "OVERRIDE_WARNINGS", cOverrideWarnings, ORAPARM_INPUT,  ORATYPE_CHAR
   OraDatabase.Parameters.Add "PROBLEM_STRING",    NULL,              ORAPARM_OUTPUT, ORATYPE_VARCHAR2
   OraDatabase.Parameters("PROBLEM_STRING").MinimumSize = 1000

   'Response.write nPvId &"-"& cOverrideWarnings &"-"& Request("btn")

   objEH.TryORA ( OraSession )
   On Error Resume Next
   OraDatabase.ExecuteSQL _
   "BEGIN "&_
   " PK_PACKAGE.DESTROY_PACKAGE ( :PV_ID, :OVERRIDE_WARNINGS, :PROBLEM_STRING ); "&_
   "END; "

   objEH.CatchORA ( OraSession )

   outProblemsString = OraDatabase.Parameters("PROBLEM_STRING").Value

   OraDatabase.Parameters.Remove "PV_ID"
   OraDatabase.Parameters.Remove "OVERRIDE_WARNINGS"
   OraDatabase.Parameters.Remove "PROBLEM_STRING"
End Sub
'----------------------------------------------
Sub RemovePackage ( nPvId, cOverrideWarnings, outProblemsString )
    Dim ReturnCode

    'Response.Write "<br>RemovePackage:" & nPvId & "<br>"

    OraDatabase.Parameters.Add "PV_ID",       nPvId,                  ORAPARM_INPUT, ORATYPE_NUMBER
    OraDatabase.Parameters.Add "RTAG_ID",     DB_RTAG_ID,             ORAPARM_INPUT, ORATYPE_NUMBER
    OraDatabase.Parameters.Add "USER_ID",     objAccessControl.UserId,ORAPARM_INPUT, ORATYPE_NUMBER
    OraDatabase.Parameters.Add "FORCE_REMOVE", cOverrideWarnings,     ORAPARM_INPUT, ORATYPE_NUMBER
    OraDatabase.Parameters.Add "RETURN_CODE", NULL,                   ORAPARM_OUTPUT, ORATYPE_NUMBER

    objEH.TryORA ( OraSession )
    On Error Resume Next

    OraDatabase.ExecuteSQL _
    "BEGIN "&_
    "   :RETURN_CODE := PK_ENVIRONMENT.REMOVE_PACKAGE ( :PV_ID, :RTAG_ID, :USER_ID, :FORCE_REMOVE );"&_
    "END; "

    objEH.CatchORA ( OraSession )

    ReturnCode = OraDatabase.Parameters("RETURN_CODE").Value

    If ( ReturnCode <> 0 ) Then
       outProblemsString = "- Unexpected error"
    End If

    OraDatabase.Parameters.Remove "PV_ID"
    OraDatabase.Parameters.Remove "RTAG_ID"
    OraDatabase.Parameters.Remove "USER_ID"
    OraDatabase.Parameters.Remove "FORCE_REMOVE"
    OraDatabase.Parameters.Remove "RETURN_CODE"
    
End Sub
'----------------------------------------------
Sub MovePackage(nPvId, newRtagId)

   OraDatabase.Parameters.Add "PV_ID",          nPvId,    ORAPARM_INPUT, ORATYPE_NUMBER
   OraDatabase.Parameters.Add "CURRENT_RTAG_ID",    DB_RTAG_ID,    ORAPARM_INPUT, ORATYPE_NUMBER
   OraDatabase.Parameters.Add "NEW_RTAG_ID",       newRtagId,    ORAPARM_INPUT, ORATYPE_NUMBER
   OraDatabase.Parameters.Add "USER_ID",          objAccessControl.UserId,    ORAPARM_INPUT, ORATYPE_NUMBER

   'Response.write nPvId &"-"& cOverrideWarnings &"-"& Request("btn")

   objEH.TryORA ( OraSession )
   On Error Resume Next

   OraDatabase.ExecuteSQL _
   "BEGIN "&_
   " PK_PACKAGE.MOVE_PACKAGE ( :PV_ID, :CURRENT_RTAG_ID, :NEW_RTAG_ID, :USER_ID ); "&_
   "END; "

   objEH.CatchORA ( OraSession )

   OraDatabase.Parameters.Remove "PV_ID"
   OraDatabase.Parameters.Remove "CURRENT_RTAG_ID"
   OraDatabase.Parameters.Remove "NEW_RTAG_ID"
   OraDatabase.Parameters.Remove "USER_ID"

End Sub
'------------ RUN BEFORE PAGE RENDER ----------
' --- Enter Form Validation Rule Changes here... ----
'----------------------------------------------------

' --- RUN onPostBack ---
If Request("action") <> "" Then
   Dim decision
   Dim problem : problem = false
   Dim mode, pvid

   decision = Left(Request("decision"), 1) 'Gets the decision based on the combo box selection

   aFullList = Split ( Replace( Request("pvIds"), " ", "" ), "," )

   If decision = 0 Then
      Call OpenInWindow ( rfile & "?rtag_id="&DB_RTAG_ID )
   ElseIf decision = 1 Then
    '   Destroy or Remove-from-release
    '   If the package is 'locked' then it will be removed from the release
    '   Otherwise the package will be destroyed
      For Each PVS In aFullList
          If PVS <> "" Then
             mode = Mid(PVS,1,1)
             pvid = Mid(PVS,2) 
             If mode = "U" Then Call DestroyPackage(pvid, "N", ProblemsString)
             If mode = "L" Then Call RemovePackage (pvid, "N", ProblemsString)

             If ProblemsString <> "" Then
                ProblemInfo.Add pvid, ProblemsString
                problem = true
             End If
         End If
      Next
   ElseIf decision = 2 Then
      For Each PVS In aFullList
        If PVS <> "" Then
            mode = Mid(PVS,1,1)
            pvid = Mid(PVS,2) 
            Call MovePackage(pvid,Request("FRrtag_id"))
        End If
      Next
   End If

   If objEH.Finally AND NOT problem Then
      Call OpenInWindow ( "_change_release_mode.asp?mode_code=" & parModeCode & "&rtag_id="&DB_RTAG_ID )
   End If

End 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="scripts/remote_scripting.js?ver=<%=VixVerNum%>"></script>
<script language="JavaScript" src="images/common.js?ver=<%=VixVerNum%>"></script>
<script language="JavaScript" type="text/javascript">
<!--

function RequestDetails( option, paramString, rowId){

   // Drive the OK button.
   // Enable it if user has selected an option
   var okBtn = MM_findObj( 'FormOk' );
   if (okBtn ) {
    okBtn.disabled  = option == 0;
    }

   if ( option == 2 )
   {
      var requestURL = 'RequestReleaseMoveCombo.asp';

      // Set ajax divname
      ajaxdivname = rowId;

      //Append the name to search for to the requestURL
      var url = requestURL + paramString;

      //Progress
      rowId.options[0] = new Option('Loading...','');
      rowId.selectedIndex = 0;


      //Create the xmlHttp object to use in the request
      //stateChangeHandler will fire when the state has changed, i.e. data is received back
      // This is non-blocking (asynchronous)
      xmlHttp = GetXmlHttpObject(stateComboChangeHandler);

      //Send the xmlHttp get to the specified url
      xmlHttp_Get(xmlHttp, url);

   }
   else
   {
      var requestURL = 'RequestReleaseMoveCombo.asp';
      // Set ajax divname
      ajaxdivname = rowId;

      //Append the name to search for to the requestURL
      var url = requestURL + '?proj_id=0';

      //Progress

      //Create the xmlHttp object to use in the request
      //stateChangeHandler will fire when the state has changed, i.e. data is received back
      // This is non-blocking (asynchronous)
      xmlHttp = GetXmlHttpObject(stateComboChangeHandler);

      //Send the xmlHttp get to the specified url
      xmlHttp_Get(xmlHttp, url);
   }
}

//-->
</script>
<!-- DROPDOWN MENUS -->
<!--#include file="_jquery_includes.asp"-->
<!--#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.proj_name.focus();">
<!-- HEADER -->
<!--#include file="_header.asp"-->
<!-- BODY ---->

<table width="100%" border="0" cellspacing="0" cellpadding="0">
   <%
   '-- FROM START ---------------------------------------------------------------------------------------------------------
   objFormComponent.FormName = "FormName"
   objFormComponent.Action = ScriptName
   Call objFormComponent.FormStart()
   %>
   <tr>
      <td class='bg_panel'></td>
      <td width="100%" rowspan="2" align="center" valign="top" bgcolor="#EEEFEF">
         <table width="10" border="0" cellspacing="0" cellpadding="0">
            <tr>
               <td width="1%"></td>
               <td width="100%">
                  <table width="100%"  border="0" cellspacing="0" cellpadding="0">
                     <tr>
                        <td nowrap class="body_txt">
                        </td>
                     </tr>
                  </table>
                  <table width="100%" border="0" cellspacing="0" cellpadding="0">
                     <tr>
                        <td nowrap class="form_ttl"><p>&nbsp;</p>
                        <%If parModeCode = 5 Then%>
                           <p>EDIT RELEASE BEFORE ARCHIVING</p>
                        <%ElseIf parModeCode = 6 Then%>
                           <p>EDIT RELEASE BEFORE PRESERVING</p>
                        <%Else%>
                           <p>EDIT RELEASE BEFORE CLOSING</p>
                        <%End If%>
                        </td>
                        <td align="right" valign="bottom"></td>
                     </tr>
                  </table>
               </td>
               <td width="1%"></td>
            </tr>
            <tr>
               <td align="left" valign="top" background="images/lbox_bg_blue.gif"><img src="images/lbox_tl_cnr_b.gif" width="13" height="13"></td>
               <td background="images/lbox_bg_blue.gif" class="lbox_ttl_w"><img src="images/h_trsp_dot.gif" width="600" height="15"></td>
               <td align="right" valign="top"  background="images/lbox_bg_blue.gif"><img src="images/lbox_tr_cnr_b.gif" width="13" height="13"></td>
            </tr>
            <tr>
               <td bgcolor="#FFFFFF"><img src="images/h_trsp_dot.gif" width="10" height="100"></td>
               <td bgcolor="#FFFFFF" valign="top">
                  <%If ProblemInfo.Count > 0 Then%>
                  <span class=err_alert>Problems encountered</span>
                  <%End If%>
                  <!-- MESSAGE +++++++++++++++++++++++++++++++++++++++++++++++++++ -->
                  <!--#include file="messages/_msg_inline.asp"-->
                  <!-- +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
                  <br>

                  <table width="100%"  border="0" cellspacing="2" cellpadding="0">

                     <tr>
                        <td valign="top" nowrap background="images/bg_table_col.gif" class="body_col">State</td>

                        <td valign="top" nowrap background="images/bg_table_col.gif" class="body_col">Package</td>
                        <td valign="top" nowrap background="images/bg_table_col.gif" class="body_col">Version</td>
                        <td valign="top" nowrap background="images/bg_table_col.gif" class="body_col" width="1%">Lck</td>
                        <%If ProblemInfo.Count > 0 Then%>
                        <td valign="top" wrap background="images/bg_table_col.gif" class="body_col">Problem</td>
                        <%End If%>
                        <td valign="top">
                     </tr>
                     <%
                     Dim currState
                     currState = ""
                     OraDatabase.Parameters.Add "RTAG_ID", DB_RTAG_ID, ORAPARM_INPUT, ORATYPE_NUMBER
                     Set rsQry = OraDatabase.DbCreateDynaset( GetQuery("CheckWIPS.sql") , cint(0) )
                     OraDatabase.Parameters.Remove "RTAG_ID"

                     '--- Render rows ---
                     Do While (NOT rsQry.BOF) AND (NOT rsQry.EOF)
                        Dim vlink, pvidFlag

                        pvid = CStr(rsQry("pv_id"))
                        vlink = "dependencies.asp?rtag_id=" & DB_RTAG_ID & "&pv_id=" & pvid  

                        'Add   the   pv_ids   to   the   Array
                        pvidFlag = "U"
                        If rsQry("dlocked") = "Y" Then
                            pvidFlag = "L"
                        End If

                        PVS = PVS + pvidFlag + pvid +  ","
                        
                        ' -------- GROUP BY BASE VIEW  -----------------
                        If CStr(currState) <> CStr(rsQry("state")) Then
                        %>
                           <tr>
                              <td colspan="5" background="images/bg_rep_line.gif"><img src="images/spacer.gif" width="1" height="1"></td>
                           </tr>
                           <tr>
                              <td nowrap class="body_scol"><%=rsQry("state")%></td>
                              <td nowrap class="body_scol"></td>
                              <td nowrap class="body_scol"></td>
                           </tr>
                           <%
                           currState = CStr(rsQry("state"))
                        End If
                        %>

                        <tr>
                           <td nowrap class="body_rowg"></td>
                           <td nowrap class="body_rowg"><%=rsQry("pkg_name")%></td>
                           <td nowrap class="body_rowg"><a href=<%=vlink%>><%=rsQry("pkg_version")%></a></td>
                           <td nowrap class="body_rowg">
                           <%If pvidFlag = "L" Then
                                Response.Write imgPkgLocked
                            End If     
                           %> 
                           </td>
                        <%If ProblemInfo.Count > 0 Then%>
                           <td nowrap class="body_rowg err_alert"><%=NewLine_To_BR(ProblemInfo.Item(pvid))%></td>
                        <%End If%>
                        </tr>
                        <%
                        rsQry.MoveNext

                        If (NOT rsQry.BOF) AND (NOT rsQry.EOF) Then%>
                           <tr>
                              <td colspan="8" background="images/bg_table_border.gif"><img src="images/spacer.gif" width="1" height="1"></td>
                           </tr>
                        <%End If
                     Loop
                     rsQry.Close()
                     Set rsQry = nothing
                     %>
                     <tr>
                        <td class="form_iname">&nbsp;</td>
                        <td>&nbsp;</td>
                        <td class="val_err"></td>
                     </tr>
                  </table>
               </td>
               <td background="images/lbox_bgside_white.gif">&nbsp;</td>
            </tr>
            <tr>
               <td background="images/bg_action_norm.gif" ></td>
               <td align="right" background="images/bg_action_norm.gif" >
                  <a class="body_col">Select Decision: </a>
                  <select name="decision" id="decision" onChange="RequestDetails( this.value, '?proj_id=<%=DB_PROJ_ID%>&rtag_id=<%=DB_RTAG_ID%>', FormName.FRrtag_id );" class="form_item">
                     <option value='0' selected>--None--</option>
                     <option value='1' >Delete All</option>
                     <option value='2' >Move All</option>
                  </select>

                  <a class="body_col">Select Destination: </a>
                  <select name="FRrtag_id" id="FRrtag_id" class="form_item">
                  </select>

                  <%=objFormComponent.SubmitButton ( "OK", "class='form_btn' id='FormOk' disabled" )%>&nbsp;
                  <%=objFormComponent.CancelButton ( "Cancel", "class='form_btn'", rfile&"?rtag_id="&DB_RTAG_ID )%>
                  <%=objPMod.ComposeHiddenTags()%>
                  <input type="hidden" name="decision" value="decision.value">
                  <%If Request("FRrtag_id") <> "" Then%>
                     <input type="hidden" name="FRrtag_id" value="FRrtag_id.value">
                  <%End If%>
                  <input type="hidden" name="action" value="true">
                  <input type="hidden" name="pvIds" value=<%=PVS%>>
                  <input type="hidden" name="mode_code" value=<%=parModeCode%>>
               </td>
               <td background="images/bg_action_norm.gif" ><img src="images/h_trsp_dot.gif" width="5" height="30"></td>
            </tr>
            <tr>
               <td background="images/lbox_bg_blue.gif" valign="bottom"><img src="images/lbox_bl_cnr_b.gif" width="13" height="13"></td>
               <td background="images/lbox_bg_blue.gif"></td>
               <td background="images/lbox_bg_blue.gif" valign="bottom" align="right"><img src="images/lbox_br_cnr_b.gif" width="13" height="13"></td>
            </tr>
         </table>

         <!-- ACTION BUTTONS ---------------------------------------------->
         <!-- ACTION BUTTONS END  ------------------------------------------>
      </td>
      <td width="1" valign="top"><img src="images/h_trsp_dot.gif" width="1" height="1"></td>
   </tr>
   <tr>
      <td class='bg_panel_btm'><img src="images/img_vtree.gif" width="86" height="99" vspace="20" hspace="30"></td>
      <td background="images/bg_lght_gray.gif" valign="top"><img src="images/h_trsp_dot.gif" width="1" height="500"></td>
   </tr>
   <%
   Call objFormComponent.FormEnd()
   '-- FROM END ----------------------------------------------------------------------------------------------------------------
   %>
</table>
<!-- FOOTER -->
<!--#include file="_footer.asp"-->
</body>
</html>