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