Subversion Repositories DevTools

Rev

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

<%@LANGUAGE="VBSCRIPT"%>
<%
'=====================================================
'|
'|  wAddDaemonInstructionSimple.asp
'|      Either ripple or terstbuild the current package
'|      This window has few options
'|
'=====================================================
%>
<%
Option explicit
Response.Expires = 0
%>
<!--#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"-->
<!--#include file="common/common_dbedit.asp"-->
<!--#include file="common/daemon_instructions.asp"-->
<%
'------------ ACCESS CONTROL ------------------
%>
<!--#include file="_access_control_general.asp"-->
<!--#include file="_access_control_login.asp"-->
<%
'------------ VARIABLE DEFINITION -------------
Dim sMessage
Dim parPv_id
Dim parOp_code
Dim parRfile
Dim bPreventSubmit
Dim ripplePresent, rippleDisable, rippleChecked
Dim testPresent, testDisable, testChecked

'------------ CONSTANTS DECLARATION -----------


'------------ VARIABLE INIT -------------------
sMessage = NULL
bPreventSubmit = False

' collect all parameters from query string
parPv_id = Request("pv_id")
parOp_code = Request("op_code")
parRfile = Request("rfile")
Set objFormCollector = CreateObject("Scripting.Dictionary")

'------------ CONDITIONS ----------------------
'----------------------------------------------
%>
<%
'------------------------------------------------------------------------------------------------------------------------------------------
' For the specified Release, get a list of all that release's daemon configurations.
' Return True if at least one daemon configuration was found, else False
'------------------------------------------------------------------------------------------------------------------------------------------
Function DaemonsAvailable(NNrtag_id)
   Dim rsTemp, Query_String

   DaemonsAvailable = True
   Query_String = "SELECT * "&_
                  "  FROM release_config rc"&_
                  " WHERE rc.rtag_id = "& NNrtag_id
        Set rsTemp = OraDatabase.DbCreateDynaset( Query_String, cint(0))
   If rsTemp.RecordCount = 0 Then
      DaemonsAvailable = False
   End If

   rsTemp.Close
   Set rsTemp = nothing
End Function
%>
<%
'------------ RUN BEFORE PAGE RENDER ----------

' Make sure we dont have any null strings or empty strings for our parameters
If IsNull(parOp_code) OR parOp_code = "" Then
   parOp_code = "-1"
End If
If IsNull(parRtag_id) OR parRtag_id = "" Then
   parRtag_id = "0"
End If
If IsNull(parRfile) OR parRfile = "" Then
   parRfile = "dependencies.asp"
End If


' Check if form submit is happening
If CBool(Request("action")) Then
     If CInt(parOp_code) >= 0 Then

       Dim RepeatSeconds
       Dim ScheduledDateTime
       Dim ReleaseMode

       ReleaseMode = GetReleaseMode(parRtag_id)

       ' determine if insert/update is enabled by permissions
       if NOT UserCanAddOrEditThisDaemonInst(DB_PROJ_ID, ReleaseMode, parOp_code) Then
          ' redirect to an error message
          Call RaiseMsg(enum_MSG_ERROR, "You have been denied permission to add/update daemon instructions for the specified release.")
       End If

       ' do daemon instruction validation, continuing only if it passes
       If ValidateDaemonInstruction(parOp_code, parRtag_id, parPv_id) = True Then

         RepeatSeconds = 0
         ScheduledDateTime = ORA_SYSDATETIME

        ' We are adding a new record
         objEH.TryORA ( OraSession )
         On Error Resume Next

         OraDatabase.ExecuteSQL "BEGIN PK_BUILDAPI.insert_daemon_inst( "& parOp_code & ", " &_
                                                                        parRtag_id & ", " &_
                                                                        parPv_id & ", " &_
                                                                        ScheduledDateTime & ", " &_
                                                                        CStr(RepeatSeconds) & ", " &_
                                                                        ORA_SYSDATETIME & ", " &_
                                                                        objAccessControl.UserId & "); END;"
         objEH.CatchORA ( OraSession )
         If objEH.Finally Then
            Call OpenInParentWindow (parRfile & "?rtag_id=" & parRtag_id & "&pv_id=" & parPv_id)
            Call CloseWindow()
         End If
       Else
        sMessage = "Invalid Request. "
       End If
    Else
        sMessage = "No action selected. "
    End If
End If

' Prevent editing if build instruction is already present
testPresent   = DaemonInstructionPresent(parRtag_id, parPv_id, 1 )
ripplePresent = DaemonInstructionPresent(parRtag_id, parPv_id, 0 )

If ripplePresent Then
    rippleDisable = " disabled"
Else
    rippleChecked = " checked"
End If

If testPresent Then
    testDisable = " disabled"
End If

If ripplePresent OR testPresent Then
    sMessage = sMessage & "Build Instruction already present"
End If

If ripplePresent AND testPresent Then
    bPreventSubmit = true
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 href="images/release_manager_style.css" rel="stylesheet" type="text/css">
      <script language="JavaScript" src="scripts/common.js"></script>
   </head>

   <body background="images/bg_bage_0.gif" leftmargin="0" topmargin="0" >
      <table width="100%"  border="0" cellspacing="0" cellpadding="10">
         <tr>
            <td bgcolor="#FFFFFF" class="body_txt">
                <span class="body_h1">
                    <img src="icons/i_linkarrow_black.gif" width="11" height="11" align="absmiddle">
                        &nbsp;Ripple or Test Build current Package
                </span>
                <br>Add a new Daemon Instruction to Ripple or Test Build current Package
            </td>
         </tr>
         <%
         '-- FROM START --------------------------------------------------------------------------------------------------------------
         objFormComponent.FormName = "DaemonInstruction"
         objFormComponent.Action = ScriptName &_
                                   "?proj_id="& DB_PROJ_ID &_
                                   "&rtag_id="& parRtag_id &_
                                   "&pv_id="  & parPv_id &_
                                   "&rfile="  & parRfile
         objFormComponent.OnSubmit = "ShowProgress();"
         Call objFormComponent.FormStart()


         %>
         <tr>
            <td background="images/bg_login.gif">
               <table class="embedded_table">
                  <tr>
                     <td><%=ProgressBar()%></td>
                  </tr>
               </table>
            </td>
         </tr>
         <tr>
            <td>
               <!-- NEW PRODUCT ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
               <%Call Messenger ( sMessage , 3, "100%" )%>
               <!-- MESSAGE +++++++++++++++++++++++++++++++++++++++++++++++++++ -->
               <!--#include file="messages/_msg_inline.asp"-->
               <table class="embedded_table form_item">
                  <tr>
                      <td class="nowrap form_align" >
                        <input type="radio" name="op_code" value="0" <%=rippleChecked%><%=rippleDisable%>>
                            Ripple the current package. 
                            <td>This will cause a new package version to be created.<br>All packages that depend on this package will also be rippled.
                      <tr>
                      <td class="nowrap form_align">
                        <input type="radio" name="op_code" value="1" <%=testChecked%><%=testDisable%>>
                            Test Build the current package. 
                            <td>No new version will be created, nor will a build ripple be propagated.<br>This will simply ensure that the current package can be built with<br>the current build machine configuration.

                      </td>
                  </tr>
                     <td align="right" colspan=2 class=top_border background="images/bg_login.gif">
                      <p>&nbsp;<p>
                        <%If DaemonsAvailable(parRtag_id) AND NOT bPreventSubmit Then%>
                           <input name="btn" type="submit" class="form_btn" value="Add/Update">
                        <%Else%>
                           <input name="btn" type="submit" class="form_btn_disabled" value="Add/Update" disabled="disabled" >
                        <%End If%>

                        <input name="btn" type="reset" class="form_btn" value="Cancel" onClick="self.close();">
                  <tr>
                  </tr>
                  <tr>
                     <td>
                        <input type="hidden" id="rtag_id"     name="rtag_id"      value="<%=parRtag_id%>">
                        <input type="hidden" id="pv_id"       name="pv_id"        value="<%=parPv_id%>">
                        <input type="hidden" id="rfile"       name="rfile"        value="<%=parRfile%>">
                     </td>
                  </tr>
               </table>
            </td>
         </tr>
         <%=objPMod.ComposeHiddenTags()%>
         <input type="hidden" name="action" value="true">

         <%
         Call objFormComponent.FormEnd()
         '-- FROM END ----------------------------------------------------------------------------------------------------------------
         %>
      </table>
   </body>
</html>
<%
'------------ RUN AFTER PAGE RENDER -----------
Set objFormCollector = Nothing
'----------------------------------------------
Call Destroy_All_Objects
%>