Subversion Repositories DevTools

Rev

Rev 119 | Blame | Last modification | View Log | RSS feed

<%@LANGUAGE="VBSCRIPT"%>
<%
Option explicit
Response.Expires = 0   ' always load the page, dont store
%>
<%
'=====================================================
'               Ripple Properties
'=====================================================
%>
<!--#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="common/_popup_window_common.asp"-->
<%
' Set rfile parameter. This is a return page after Login
Call objPMod.StoreParameter ( "rfile", "fixed_issues.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 query
Dim rsQry, rsTemp
Dim checked
Dim FRripplebuildYES, FRripplebuildNO
Dim objFormCollector
Dim Query_String
Dim isDLocked
'------------ Constants Declaration -----------
'------------ Variable Init -------------------
Set objFormCollector = CreateObject("Scripting.Dictionary")
parPv_id = QStrPar("pv_id")
'----------------------------------------------
%>
<%
'------------------------------------------------------------------------------------------------------------------------------------
Sub UpdateRippleType ( )
   Dim rsTemp, Query_String
   Query_String = _
   " SELECT ripple_field"&_
   " FROM package_versions"&_
   " WHERE pv_id = "& Request("pv_id")
   Set rsTemp = OraDatabase.CreateDynaset( Query_String, cint(0))

   If (rsTemp("ripple_field").Value <> Request("ripple_type_combo")) OR IsNull(rsTemp("ripple_field").Value) Then

      'update fields
      rsTemp.Edit()
      rsTemp.Fields("ripple_field").Value = Request("ripple_type_combo")
      rsTemp.Update()



      '/* Log Action */
      If Request("ripple_type_combo") = "M" Then
         Call Log_Action ( Request("pv_id"), "ripple_type_update", "Major Number" )

      ElseIf Request("ripple_type_combo") = "m" Then
         Call Log_Action ( Request("pv_id"), "ripple_type_update", "Minor Number" )

      ElseIf Request("ripple_type_combo") = "p" Then
         Call Log_Action ( Request("pv_id"), "ripple_type_update", "Patch Number" )

      ElseIf Request("ripple_type_combo") = "z" Then
         Call Log_Action ( Request("pv_id"), "ripple_type_update", "Do not ripple build" )

      Else
         Call Log_Action ( Request("pv_id"), "ripple_type_update", "Build Number" )

      End If

   End If

   rsTemp.Close()
   Set rsTemp = nothing
End Sub
'------------------------------------------------------------------------------------------------------------------------------------
Sub RipplePackage (flag)

   OraDatabase.Parameters.Add "PV_ID",   parPv_id,                  ORAPARM_INPUT, ORATYPE_NUMBER
   OraDatabase.Parameters.Add "RTAG_ID", parRtag_id,                ORAPARM_INPUT, ORATYPE_NUMBER
   OraDatabase.Parameters.Add "USER_ID", objAccessControl.UserId,   ORAPARM_INPUT, ORATYPE_NUMBER


   OraSession.BeginTrans

   If flag Then
      OraDatabase.ExecuteSQL _
      "BEGIN  Ripple_Package( :PV_ID, :RTAG_ID, :USER_ID );  END;"
   Else
      OraDatabase.ExecuteSQL _
      "BEGIN  UnRipple_Package( :PV_ID, :RTAG_ID, :USER_ID );  END;"
   End If

    OraSession.CommitTrans


   OraDatabase.Parameters.Remove "PV_ID"
   OraDatabase.Parameters.Remove "RTAG_ID"
   OraDatabase.Parameters.Remove "USER_ID"

End Sub
'------------------------------------------------------------------------------------------------------------------------------------
Sub Get_Form_Details( nPv_id, ByRef objDetails )
   Dim rsTemp, Query_String
   Query_String = _
   " SELECT * "&_
   "  FROM package_versions pv, packages pkg"&_
   " WHERE pv.pkg_id = pkg.pkg_id"&_
   "   AND pv_id = "& nPv_id

   Set rsTemp = OraDatabase.DbCreateDynaset( Query_String, cint(0))
   If (NOT rsTemp.BOF ) AND (NOT rsTemp.EOF) Then
      objDetails.Item("pkg_name")              = rsTemp("pkg_name")
      objDetails.Item("pkg_version")           = rsTemp("pkg_version")
      objDetails.Item("pkg_label")             = rsTemp("pkg_label")
      objDetails.Item("src_path")              = rsTemp("src_path")
      objDetails.Item("pv_description")        = rsTemp("pv_description")
      objDetails.Item("pv_overview")           = rsTemp("pv_overview")
      objDetails.Item("v_ext")                 = rsTemp("v_ext")
      objDetails.Item("is_deployable")         = rsTemp("is_deployable")
      objDetails.Item("is_build_env_required") = rsTemp("is_build_env_required")
      objDetails.Item("build_type")            = rsTemp("build_type")
      objDetails.Item("bs_id")                 = rsTemp("bs_id")
      objDetails.Item("ripple_field")          = rsTemp("ripple_field")
   End If

   rsTemp.Close()
   Set rsTemp = Nothing
End Sub
'----------------------------------------------------------------------------------------------------------------------
Sub RenderRippleTypeCombo( cRippleType, cDLocked )

   Dim isEditable

   ' DEVI-49267 - ripple type needs to be changeable by team leaders post release so the permission constraint on
   ' this is relaxed to non-critical info level (See definition of Is_Page_Editable() in common_subs.asp)
   isEditable = Is_Page_Editable ( isDLocked )

   Query_String = "select * from ripple_field_states"

   If (isEditable) Then
      Response.Write "<select name='ripple_type_combo' class='form_item'>"
   Else
      Response.Write "<select name='ripple_type_combo' class='form_item' disabled>"
   End If

   Set rsTemp = OraDatabase.CreateDynaset( Query_String, cint(0))

   While (NOT rsTemp.BOF) AND (NOT rsTemp.EOF)
      If cRippleType = rsTemp.Fields("state_acronym") Then
         Response.write "<option value='"& rsTemp.Fields("state_acronym") &"' selected>"& rsTemp.Fields("state_name") &"</option>"
      ElseIf IsNull(cRippleType) AND rsTemp.Fields("state_acronym") = "b" Then 'If nothing selected, select Build Number
         Response.write "<option value='"& rsTemp.Fields("state_acronym") &"' selected>"& rsTemp.Fields("state_name") & "</option>"
      Else
         Response.write "<option value='"& rsTemp.Fields("state_acronym") &"'>"& rsTemp.Fields("state_name") & "</option>"
      End If
      rsTemp.MoveNext
   WEnd

   rsTemp.Close()
   Set rsTemp = nothing

   Response.Write "</select>"

End Sub
'----------------------------------------------------------------------------------------------------------------------
%>
<%
'------------------------------- RUN BEFORE PAGE RENDER ----------------------------

Call Get_Form_Details( parPv_id, objFormCollector )

Call Get_Pkg_Short_Info( parPv_id, NULL, NULL, NULL, NULL, NULL, isDLocked )

'-------------------------------------
'Start Process Submission
If CBool(QStrPar("action"))  AND  objAccessControl.UserLogedIn Then

   Call UpdateRippleType()


   If NOT CBool(QStrPar("rippleFlag")) AND Request("FRripplebuild") = "1" Then
      Call RipplePackage(True)
   End If

   If CBool(QStrPar("rippleFlag")) AND Request("FRripplebuild") = "0" Then
      Call RipplePackage(False)
   End If


   Call OpenInParentWindow ( "fixed_issues.asp?pv_id="& parPv_id &"&rtag_id="& parRtag_id &"&hidenv=true" )
   Call CloseWindow

End If
'End Process Submission
'--------------------------------------------------------------------------------------------
%>
<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>
<!-- TIPS -->
<script language="JavaScript" src="images/tipster.js"></script>
<script language="JavaScript" src="images/_help_tips.js"></script>
<script language="JavaScript" type="text/JavaScript">
<!--
function MM_reloadPage(init) {  //reloads the window if Nav4 resized
   if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
      document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
   else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);
//-->
</script>
</head>
<body bgcolor="#FFFFFF" text="#000000" leftmargin="0" topmargin="0" onload="self.focus();">
<!-- TIPS LAYERS -------------------------------------->
<div id="formTipsLayer" style="position: absolute; z-index: 1000; visibility: hidden; left:0; top: 0; width: 10">&nbsp;</div>
<!----------------------------------------------------->
<form name="rippleproperties" method="post" action="<%=scriptName%>">
   <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="icons/i_pkg_ripple_type.gif" width="21" height="21" hspace="5" border="0"></td>
         <td background="images/lbox_bg_blue.gif" nowrap width="50%" class="wform_ttl">&nbsp;Ripple Properties </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 width="1%" nowrap class="form_group" valign="bottom"></td>
                  <td nowrap width="1%">&nbsp; </td>
                  <td nowrap width="100%">&nbsp;</td>
               </tr>
               <tr>
                  <td>&nbsp;</td>
                  <td nowrap class="form_field" background="images/bg_form_lightbluedark.gif">Build Inclusion?<%=Quick_Help ( "ripple_build" )%></td>
                  <%
                  FRripplebuildYES = ""
                  FRripplebuildNO = ""
                  ' disabled="disabled" indicates the pv has been excluded indirectly
                  ' this is due to another pv (the root_pv_id) being excluded directly
                  ' allowing it to be included is somewhat pointless
                  ' fixing the root cause is a somewhat better approach
                  Dim disabled
                  disabled="disabled"

                  Dim rsQryRipple, rippleFlag
                  Set rsQryRipple = OraDatabase.DbCreateDynaset( "SELECT root_pv_id FROM DO_NOT_RIPPLE WHERE RTAG_ID ="& parRtag_id &"AND PV_ID ="& parPv_id, cint(0))

                  If rsQryRipple.RecordCount = 0  Then
                     FRripplebuildYES = "checked"
                     rippleFlag = True
                     ' do not disable the default
                     disabled=""
                  Else
                     If isNull(rsQryRipple("root_pv_id")) Then
                        ' pv has been excluded directly
                        ' ie has a null pv_id
                        ' once fixed, pv should be included ie do not disable
                        disabled=""
                     End If
                     FRripplebuildNO = "checked"
                     rippleFlag = False
                  End If

                  rsQryRipple.Close()
                  Set rsQryRipple = nothing

                  %>
                  <td nowrap background="images/bg_form_lightbluedark.gif" class="form_txt">Yes
                     <input name="FRripplebuild" type="radio" value="1" <%=FRripplebuildYES%>  <%=disabled%>>
                     &nbsp;&nbsp;No<input name="FRripplebuild" type="radio" value="0" <%=FRripplebuildNO%>>
                  </td>
                  <td background="images/bg_form_lightbluedark.gif">
                     <span class='err_alert'><b>WARNING!</span>
                     <font size='1'>
                        When set to No, this package and <u>all</u> packages which depend on this package, either directly or indirectly,
                        will be excluded from the build. When the Yes option is disabled, indicates this package has been excluded indirectly.
                     </font></b>
                  </td>
               </tr>
               <tr>
                  <td>&nbsp;</td>
                  <td valign="top" nowrap background="images/bg_form_lightbluedark.gif" class="form_field">Ripple Type?<%=Quick_Help ( "ripple_type" )%></td>
                  <td nowrap background="images/bg_form_lightbluedark.gif" class="form_txt">

                     <table width="100%" border="0" cellspacing="0" cellpadding="0">
                        <tr>
                           <td bgcolor="#FFFFFF">
                              <table width="100" border="0" cellpadding="3" cellspacing="0" background="images/bg_form_lightbluedark.gif">
                                 <tr>
                                    <td nowrap background="images/bg_form_lightbluedark.gif" bgcolor="#F5F5F5" class="form_txt">
                                       <% Call RenderRippleTypeCombo( objFormCollector.Item("ripple_field"), isDLocked )%>
                                    </td>
                                 </tr>
                                 <tr>
                                    <td width="1" background="images/bg_form_lightbluedark.gif"></td>
                                    <td width="1"></td>
                                    <td width="100%"></td>
                                 </tr>
                              </table>
                           </td>
                        </tr>
                     </table>
                  </td>

                  <td background="images/bg_form_lightbluedark.gif">
                     <span class='err_alert'><b>WARNING!</span>
                     <font size='1'> This enables a package to advertise how it will be numbered when rippled.
                        THIS IS PRIMARILY INTENDED TO CATER FOR PACKAGES WHICH DO NOT SUPPORT A NON ZERO PATCH/BUILD NUMBER,
                        AND FOR PRODUCTS WHERE CONSTANTLY RIPPLING A PATCH/BUILD NUMBER IS DISLIKED BY A CUSTOMER.
                     </font></b>
                  </td>
               </tr>
               <tr>
                  <td>&nbsp;</td>
                  <td nowrap class="form_field"><img src="images/h_trsp_dot.gif" width="100" height="10"></td>
                  <td nowrap> <p>&nbsp;</p></td>
                  <td nowrap>&nbsp;</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>
<input type="hidden" name="pv_id" value="<%=parPv_id%>">
<input type="hidden" name="rtag_id" value="<%=parRtag_id%>">
<input type="hidden" name="rippleFlag" value="<%=rippleFlag%>">
<input type="hidden" name="action" value="true">
</form>
</body>
</html>
<%
'------------- RUN AFTER PAGE RENDER ---------------
Set objFormCollector = Nothing
'---------------------------------------------------
%>

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