Subversion Repositories DevTools

Rev

Blame | Last modification | View Log | RSS feed

<%@LANGUAGE="VBSCRIPT"%>
<%
Option explicit
Response.Expires = 0    ' always load the page, dont store
%>
<%
'=====================================================
'                                       Obsolete Patch
'=====================================================
%>
<!--#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/common_dbedit.asp"-->
<!--#include file="controls/ERGFormComponent/classFormComponent.asp"-->
<!--#include file="common/_popup_window_common.asp"-->
<%
'------------ ACCESS CONTROL ------------------
%>
<!--#include file="_access_control_login.asp"-->
<!--#include file="_access_control_general.asp"-->
<!--#include file="_access_control_project.asp"-->
<%
'------------ Variable Definition -------------
Dim parPv_id
Dim objFormComponent
'------------ Constants Declaration -----------
'------------ Variable Init -------------------
parPv_id = QStrPar("pv_id")
Set objFormComponent = New FormComponent
'----------------------------------------------
%>
<%
Function Get_Comments( NNPv_id )
        Dim rsTemp, Query_String
        Query_String = _
        " SELECT obsolete_comments"&_
        "  FROM package_versions"&_
        " WHERE pv_id = "& NNPv_id
        Set rsTemp = OraDatabase.DbCreateDynaset( Query_String, cint(0))
        If ((NOT rsTemp.BOF) AND (NOT rsTemp.EOF)) Then
                Get_Comments = rsTemp.Fields("obsolete_comments")
        End If
        rsTemp.Close
        Set rsTemp = nothing
End Function

Sub SubmitObsoleteComments ( NNPv_id )
        Dim isPatchObsolete
        
        isPatchObsolete = "Y"
        If Request("unobsolete") <> "" Then
                isPatchObsolete = NULL
        End If
        
        If Request("FRpatch_id") <> "" Then
                OraDatabase.ExecuteSQL _
                "       UPDATE PACKAGE_PATCHES SET"&_
                "       PATCH_OBSOLETED_BY =" & Request("FRpatch_id")&_
                "       WHERE PATCH_ID = "& Request("pv_id") 
        Else
                
                OraDatabase.ExecuteSQL _
                "       UPDATE PACKAGE_PATCHES SET"&_
                "       PATCH_OBSOLETED_BY = NULL"&_
                "       WHERE PATCH_ID = "& Request("pv_id")    
                
        
        End If
        
        OraDatabase.Parameters.Add "PATCH_ID",                  Request("pv_id"),       ORAPARM_INPUT, ORATYPE_NUMBER 
        OraDatabase.Parameters.Add "IS_OBSOLETE",               isPatchObsolete,        ORAPARM_INPUT, ORATYPE_CHAR
        OraDatabase.Parameters.Add "OBSOLETE_COMMENTS", Request("obsolete_comments"),   ORAPARM_INPUT, ORATYPE_VARCHAR2
        OraDatabase.Parameters.Add "USER_ID",                   objAccessControl.UserId,        ORAPARM_INPUT, ORATYPE_NUMBER 
        
        'OraDatabase.ExecuteSQL _
        '" UPDATE PACKAGE_VERSIONS pv SET"&_
        '"      pv.IS_OBSOLETE = :IS_OBSOLETE,"&_
        '"      pv.OBSOLETE_COMMENTS = :OBSOLETE_COMMENTS"&_
        '" WHERE pv.PV_ID = :PV_ID"
        OraSession.BeginTrans
        
        OraDatabase.ExecuteSQL _
        " BEGIN  PK_PACKAGE.OBSOLETE_PATCH ( :PATCH_ID, :IS_OBSOLETE, :OBSOLETE_COMMENTS, :USER_ID );   END;"
        
        OraSession.CommitTrans
        
        OraDatabase.Parameters.Remove "PATCH_ID"
        OraDatabase.Parameters.Remove "USER_ID"
        OraDatabase.Parameters.Remove "IS_OBSOLETE"
        OraDatabase.Parameters.Remove "OBSOLETE_COMMENTS"
        
End Sub
%>
<%
'Process submition
'------------ Action Requirements -------------------
If CBool(QStrPar("action"))   AND  objAccessControl.UserLogedIn  Then
        Call SubmitObsoleteComments ( Request("pv_id") )
        Call OpenInParentWindow ( Request("rfile") &"?pv_id="& Request("pv_id") &"&rtag_id="& Request("rtag_id") )
        Call CloseWindow
        
End If
%>
<html>
<head>
<title>Release Manager</title>
<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/common.js"></script>
</head>
<body bgcolor="#FFFFFF" text="#000000" leftmargin="0" topmargin="0" onload="self.focus();document.FormSearch.obsolete_comments.focus();">
<%
'-- FROM START ---------------------------------------------------------------------------------------------------------------
objFormComponent.FormName = "FormSearch"
objFormComponent.Action = scriptName
Call objFormComponent.FormStart()
%>  
  <table width="100%" border="0" cellspacing="0" cellpadding="2" height="100%">
    <tr> 
      <td background="images/lbox_bg_orange.gif" width="1%" height="1%"><img src="images/i_new_pkg_off.gif" width="21" height="23" hspace="5" border="0"></td>
      <td background="images/lbox_bg_blue.gif" nowrap width="50%" class="wform_ttl">&nbsp;Make Patch Obsolete</td>
      <td background="images/lbox_bg_blue.gif" align="right" width="50%"> 
        <input type="submit" name="btn" value="Submit" class="form_btn_comp">
        <input type="reset" name="btn" value="Cancel" class="form_btn_comp" onclick="self.close()">
      </td>
      <td background="images/lbox_bg_blue.gif" align="right" width="1%%" nowrap> 
        <img src="images/h_trsp_dot.gif" width="5" height="22"> </td>
    </tr>
    <tr> 
      <td height="100%" width="1%">&nbsp;</td>
      <td valign="top" nowrap colspan="3" 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 nowrap width="100%">&nbsp; </td>
          </tr>
          <tr> 
            <td width="1%">&nbsp;</td>
            <td nowrap width="100%" background="images/bg_form_lightbluedark.gif" class="form_txt"> 
              <textarea name="obsolete_comments" class="form_item" cols="60" rows="10"><%=Format4HTML(Get_Comments( parPv_id ))%></textarea>
                          
                          <input type="hidden" name="pv_id" value="<%=parPv_id%>">
                          <input type="hidden" name="rtag_id" value="<%=parRtag_id%>">
                          <input type="hidden" name="rfile" value="<%=Request("rfile")%>">
              <input type="hidden" name="action" value="true">
            </td>
          </tr>
                  <tr>
                        <td width="1%"></td>
                        <td nowrap width="100%" background="images/bg_form_lightbluedark.gif" class="form_txt"> 
                        Patch Obsoleted By: 
                        <%
                          
                        Dim rsQry
                
                        OraDatabase.Parameters.Add "PV_ID",                     Request("pv_id"),       ORAPARM_INPUT, ORATYPE_NUMBER     
                        Set rsQry = OraDatabase.DbCreateDynaset( GetQuery("ObsoletedBy.sql") , cint(0) )
                
                        
                        Response.write "<select name='FRpatch_id' class='form_item'>"
                        Response.write "<option value='' selected>--NONE--</option>"
                          %>
        
                                <%While (NOT rsQry.BOF) AND (NOT rsQry.EOF)
                                
                        If CDbl(Request("patch_id")) = CDbl(rsQry.Fields("patch_id")) Then
                        Response.write "<option value='"& rsQry.Fields("patch_id") &"' selected>"& (rsQry.Fields("pkg_name")) & (rsQry.Fields("pkg_version")) &"</option>"
                Else
                                
                                Response.write "<option value='"& rsQry.Fields("patch_id") &"'>"& (rsQry.Fields("pkg_name")) & " " & (rsQry.Fields("pkg_version")) &"</option>"
                        End If          
                                        rsQry.MoveNext
                                WEnd
                                OraDatabase.Parameters.Remove "PV_ID"
                                rsQry.Close()
                                Set rsQry = nothing
                                %>
                                </select>                       
                        </td>
                        
                  </tr>
          <tr> 
            <td width="1%">&nbsp;</td>
            <td nowrap width="100%"> 
              <p>&nbsp;</p>
            </td>
          </tr>
        </table>
      </td>
    </tr>
    <tr>
      <td height="1%" width="1%"><img src="images/h_trsp_dot.gif" width="5" height="5"></td>
      <td valign="top" nowrap colspan="3" class="wform_ttl" background="images/lbox_bg_blue.gif"></td>
    </tr>
  </table>
<%
Call objFormComponent.FormEnd()
'-- FROM END ----------------------------------------------------------------------------------------------------------------
%>
</body>
</html>


<!-- DESTRUCTOR ------->
<!--#include file="common/destructor.asp"-->