Subversion Repositories DevTools

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
5048 dpurdie 1
<%@LANGUAGE="VBSCRIPT"%>
2
<%
3
'=====================================================
4
'|
5
'|  wAddDaemonInstructionSimple.asp
6
'|      Either ripple or terstbuild the current package
7
'|      This window has few options
8
'|
9
'=====================================================
10
%>
11
<%
12
Option explicit
13
Response.Expires = 0
14
%>
15
<!--#include file="common/conf.asp"-->
16
<!--#include file="common/globals.asp"-->
17
<!--#include file="common/formating.asp"-->
18
<!--#include file="common/qstr.asp"-->
19
<!--#include file="common/common_subs.asp"-->
20
<!--#include file="common/_form_window_common.asp"-->
21
<!--#include file="common/common_dbedit.asp"-->
22
<!--#include file="common/daemon_instructions.asp"-->
23
<%
24
'------------ ACCESS CONTROL ------------------
25
%>
26
<!--#include file="_access_control_general.asp"-->
27
<!--#include file="_access_control_login.asp"-->
28
<%
29
'------------ VARIABLE DEFINITION -------------
30
Dim sMessage
31
Dim parPv_id
32
Dim parOp_code
33
Dim parRfile
34
Dim bPreventSubmit
35
Dim ripplePresent, rippleDisable, rippleChecked
36
Dim testPresent, testDisable, testChecked
37
 
38
'------------ CONSTANTS DECLARATION -----------
39
 
40
 
41
'------------ VARIABLE INIT -------------------
42
sMessage = NULL
43
bPreventSubmit = False
44
 
45
' collect all parameters from query string
46
parPv_id = Request("pv_id")
47
parOp_code = Request("op_code")
48
parRfile = Request("rfile")
49
Set objFormCollector = CreateObject("Scripting.Dictionary")
50
 
51
'------------ CONDITIONS ----------------------
52
'----------------------------------------------
53
%>
54
<%
55
'------------------------------------------------------------------------------------------------------------------------------------------
56
' For the specified Release, get a list of all that release's daemon configurations.
57
' Return True if at least one daemon configuration was found, else False
58
'------------------------------------------------------------------------------------------------------------------------------------------
59
Function DaemonsAvailable(NNrtag_id)
60
   Dim rsTemp, Query_String
61
 
62
   DaemonsAvailable = True
63
   Query_String = "SELECT * "&_
64
                  "  FROM release_config rc"&_
65
                  " WHERE rc.rtag_id = "& NNrtag_id
66
	Set rsTemp = OraDatabase.DbCreateDynaset( Query_String, cint(0))
67
   If rsTemp.RecordCount = 0 Then
68
      DaemonsAvailable = False
69
   End If
70
 
71
   rsTemp.Close
72
   Set rsTemp = nothing
73
End Function
74
%>
75
<%
76
'------------ RUN BEFORE PAGE RENDER ----------
77
 
78
' Make sure we dont have any null strings or empty strings for our parameters
79
If IsNull(parOp_code) OR parOp_code = "" Then
80
   parOp_code = "-1"
81
End If
82
If IsNull(parRtag_id) OR parRtag_id = "" Then
83
   parRtag_id = "0"
84
End If
85
If IsNull(parRfile) OR parRfile = "" Then
86
   parRfile = "dependencies.asp"
87
End If
88
 
89
 
90
' Check if form submit is happening
91
If CBool(Request("action")) Then
92
     If CInt(parOp_code) >= 0 Then
93
 
94
       Dim RepeatSeconds
95
       Dim ScheduledDateTime
96
       Dim ReleaseMode
97
 
98
       ReleaseMode = GetReleaseMode(parRtag_id)
99
 
100
       ' determine if insert/update is enabled by permissions
5061 dpurdie 101
       if NOT UserCanAddOrEditThisDaemonInst(DB_PROJ_ID, ReleaseMode, parOp_code) Then
5048 dpurdie 102
          ' redirect to an error message
103
          Call RaiseMsg(enum_MSG_ERROR, "You have been denied permission to add/update daemon instructions for the specified release.")
104
       End If
105
 
106
       ' do daemon instruction validation, continuing only if it passes
107
       If ValidateDaemonInstruction(parOp_code, parRtag_id, parPv_id) = True Then
108
 
109
         RepeatSeconds = 0
110
         ScheduledDateTime = ORA_SYSDATETIME
111
 
112
        ' We are adding a new record
113
         objEH.TryORA ( OraSession )
114
         On Error Resume Next
115
 
116
         OraDatabase.ExecuteSQL "BEGIN PK_BUILDAPI.insert_daemon_inst( "& parOp_code & ", " &_
117
                                                                        parRtag_id & ", " &_
118
                                                                        parPv_id & ", " &_
119
                                                                        ScheduledDateTime & ", " &_
120
                                                                        CStr(RepeatSeconds) & ", " &_
121
                                                                        ORA_SYSDATETIME & ", " &_
122
                                                                        objAccessControl.UserId & "); END;"
123
         objEH.CatchORA ( OraSession )
124
         If objEH.Finally Then
125
            Call OpenInParentWindow (parRfile & "?rtag_id=" & parRtag_id & "&pv_id=" & parPv_id)
126
            Call CloseWindow()
127
         End If
128
       Else
129
        sMessage = "Invalid Request. "
130
       End If
131
    Else
132
        sMessage = "No action selected. "
133
    End If
134
End If
135
 
136
' Prevent editing if build instruction is already present
137
testPresent   = DaemonInstructionPresent(parRtag_id, parPv_id, 1 )
138
ripplePresent = DaemonInstructionPresent(parRtag_id, parPv_id, 0 )
139
 
140
If ripplePresent Then
141
    rippleDisable = " disabled"
142
Else
143
    rippleChecked = " checked"
144
End If
145
 
146
If testPresent Then
147
    testDisable = " disabled"
148
End If
149
 
150
If ripplePresent OR testPresent Then
151
    sMessage = sMessage & "Build Instruction already present"
152
End If
153
 
154
If ripplePresent AND testPresent Then
155
    bPreventSubmit = true
156
End If
157
 
158
 
159
'----------------------------------------------
160
%>
161
<html>
162
   <head>
163
      <title>Release Manager</title>
164
      <meta HTTP-EQUIV="Pragma" CONTENT="no-cache">
165
      <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
166
      <link href="images/release_manager_style.css" rel="stylesheet" type="text/css">
167
      <script language="JavaScript" src="scripts/common.js"></script>
168
   </head>
169
 
170
   <body background="images/bg_bage_0.gif" leftmargin="0" topmargin="0" >
171
      <table width="100%"  border="0" cellspacing="0" cellpadding="10">
172
         <tr>
173
            <td bgcolor="#FFFFFF" class="body_txt">
174
                <span class="body_h1">
175
                    <img src="icons/i_linkarrow_black.gif" width="11" height="11" align="absmiddle">
176
                        &nbsp;Ripple or Test Build current Package
177
                </span>
178
                <br>Add a new Daemon Instruction to Ripple or Test Build current Package
179
            </td>
180
         </tr>
181
         <%
182
         '-- FROM START --------------------------------------------------------------------------------------------------------------
183
         objFormComponent.FormName = "DaemonInstruction"
184
         objFormComponent.Action = ScriptName &_
5061 dpurdie 185
                                   "?proj_id="& DB_PROJ_ID &_
5048 dpurdie 186
                                   "&rtag_id="& parRtag_id &_
187
                                   "&pv_id="  & parPv_id &_
188
                                   "&rfile="  & parRfile
189
         objFormComponent.OnSubmit = "ShowProgress();"
190
         Call objFormComponent.FormStart()
191
 
192
 
193
         %>
194
         <tr>
195
            <td background="images/bg_login.gif">
196
               <table class="embedded_table">
197
                  <tr>
198
                     <td><%=ProgressBar()%></td>
199
                  </tr>
200
               </table>
201
            </td>
202
         </tr>
203
         <tr>
204
            <td>
205
               <!-- NEW PRODUCT ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
206
               <%Call Messenger ( sMessage , 3, "100%" )%>
207
               <!-- MESSAGE +++++++++++++++++++++++++++++++++++++++++++++++++++ -->
208
               <!--#include file="messages/_msg_inline.asp"-->
209
               <table class="embedded_table form_item">
210
                  <tr>
211
                      <td class="nowrap form_align" >
212
                        <input type="radio" name="op_code" value="0" <%=rippleChecked%><%=rippleDisable%>>
213
                            Ripple the current package. 
214
                            <td>This will cause a new package version to be created.<br>All packages that depend on this package will also be rippled.
215
                      <tr>
216
                      <td class="nowrap form_align">
217
                        <input type="radio" name="op_code" value="1" <%=testChecked%><%=testDisable%>>
218
                            Test Build the current package. 
219
                            <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 the current build machine configuration.
220
 
221
                      </td>
222
                  </tr>
223
                     <td align="right" colspan=2 class=top_border background="images/bg_login.gif">
224
                      <p>&nbsp;<p>
225
                        <%If DaemonsAvailable(parRtag_id) AND NOT bPreventSubmit Then%>
226
                           <input name="btn" type="submit" class="form_btn" value="Add/Update">
227
                        <%Else%>
228
                           <input name="btn" type="submit" class="form_btn_disabled" value="Add/Update" disabled="disabled" >
229
                        <%End If%>
230
 
231
                        <input name="btn" type="reset" class="form_btn" value="Cancel" onClick="self.close();">
232
                  <tr>
233
                  </tr>
234
                  <tr>
235
                     <td>
236
                        <input type="hidden" id="rtag_id"     name="rtag_id"      value="<%=parRtag_id%>">
237
                        <input type="hidden" id="pv_id"       name="pv_id"        value="<%=parPv_id%>">
238
                        <input type="hidden" id="rfile"       name="rfile"        value="<%=parRfile%>">
239
                     </td>
240
                  </tr>
241
               </table>
242
            </td>
243
         </tr>
244
         <%=objPMod.ComposeHiddenTags()%>
245
         <input type="hidden" name="action" value="true">
246
 
247
         <%
248
         Call objFormComponent.FormEnd()
249
         '-- FROM END ----------------------------------------------------------------------------------------------------------------
250
         %>
251
      </table>
252
   </body>
253
</html>
254
<%
255
'------------ RUN AFTER PAGE RENDER -----------
256
Set objFormCollector = Nothing
257
'----------------------------------------------
258
Call Destroy_All_Objects
259
%>
260
 
261