Subversion Repositories DevTools

Rev

Rev 147 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 147 Rev 149
Line 14... Line 14...
14
<!--#include file="common/globals.asp"-->
14
<!--#include file="common/globals.asp"-->
15
<!--#include file="common/formating.asp"-->
15
<!--#include file="common/formating.asp"-->
16
<!--#include file="common/qstr.asp"-->
16
<!--#include file="common/qstr.asp"-->
17
<!--#include file="common/common_subs.asp"-->
17
<!--#include file="common/common_subs.asp"-->
18
<!--#include file="common/_form_window_common.asp"-->
18
<!--#include file="common/_form_window_common.asp"-->
-
 
19
<!--#include file="common/common_dbedit.asp"-->
19
<!--#include file="common/daemon_instructions.asp"-->
20
<!--#include file="common/daemon_instructions.asp"-->
20
<%
21
<%
21
'------------ ACCESS CONTROL ------------------
22
'------------ ACCESS CONTROL ------------------
22
%>
23
%>
23
<!--#include file="_access_control_general.asp"-->
24
<!--#include file="_access_control_general.asp"-->
24
<!--#include file="_access_control_login.asp"-->
25
<!--#include file="_access_control_login.asp"-->
25
<%
26
<%
26
'------------ VARIABLE DEFINITION -------------
27
'------------ VARIABLE DEFINITION -------------
27
Dim rsQry
-
 
28
Dim sMessage
28
Dim sMessage
29
Dim Query_String
-
 
30
Dim parProj_id
29
Dim parProj_id
31
Dim parPv_id
30
Dim parPv_id
32
Dim parOp_code
31
Dim parOp_code
33
Dim parRepeat
32
Dim parRepeat
34
Dim parInst_id
33
Dim parInst_id
35
Dim parSchDateTime
34
Dim parSchDateTime
36
Dim parRfile
35
Dim parRfile
37
Dim bHideRepeat
36
Dim bHideRepeat
-
 
37
Dim bHidePackages
-
 
38
Dim bPreventSubmit
-
 
39
Dim parSortOrder
38
'------------ CONSTANTS DECLARATION -----------
40
'------------ CONSTANTS DECLARATION -----------
39
 
41
 
40
 
42
 
41
'------------ VARIABLE INIT -------------------
43
'------------ VARIABLE INIT -------------------
42
sMessage = NULL
44
sMessage = NULL
43
 
45
 
-
 
46
bPreventSubmit = False
-
 
47
 
44
// collect all parameters from query string
48
' collect all parameters from query string
45
parOp_code = Request("op_code")
49
parOp_code = Request("op_code")
46
parProj_id = Request("proj_id")
50
parProj_id = Request("proj_id")
47
parPv_id = Request("pv_id")
51
parPv_id = Request("pv_id")
48
parRepeat = Request("repeat")
52
parRepeat = Request("repeat")
49
parInst_id = Request("inst_id")
53
parInst_id = Request("inst_id")
50
parSchDateTime = Request("sdt")
54
parSchDateTime = Request("sdt")
51
parRfile = Request("rfile")
55
parRfile = Request("rfile")
52
 
56
 
-
 
57
parSortOrder = Request("sort")
53
Set objFormCollector = CreateObject("Scripting.Dictionary")
58
If IsNull(parSortOrder) OR parSortOrder = "" Then
-
 
59
   parSortOrder = "0"
-
 
60
End If
54
 
61
 
55
' assume Repeat radio button is going to be visible
62
Set objFormCollector = CreateObject("Scripting.Dictionary")
56
bHideRepeat = False
-
 
57
 
63
 
58
'------------ CONDITIONS ----------------------
64
'------------ CONDITIONS ----------------------
59
'----------------------------------------------
65
'----------------------------------------------
60
%>
66
%>
61
<%
67
<%
Line 103... Line 109...
103
' Formulate the HTML for a combo box listing all the daemon instruction operations, and select the one that matches
109
' Formulate the HTML for a combo box listing all the daemon instruction operations, and select the one that matches
104
' the op-code passed in as a parameter. If the parameter value could not be found, correct it to the first valid op-code
110
' the op-code passed in as a parameter. If the parameter value could not be found, correct it to the first valid op-code
105
' in the list.
111
' in the list.
106
'------------------------------------------------------------------------------------------------------------------------------------------
112
'------------------------------------------------------------------------------------------------------------------------------------------
107
Function Get_OpCodes ( NNop_code )
113
Function Get_OpCodes ( NNop_code )
108
   Dim op_code_array
114
   Dim op_code_str_array
109
   Dim op_code
115
   Dim op_code_str
110
   Dim op_code_id
116
   Dim op_code_val
111
	Dim selectedFound
117
	Dim selectedFound
112
   Dim tempLINK
118
   Dim tempLINK
113
   Dim s
119
   Dim s
114
 
120
 
115
   selectedFound = false
121
   selectedFound = False
116
 
122
 
117
   op_code_array = array(OP_CODE_0_STR)   ' add new strings in here when new instruction constants are defined in conf.asp
123
   ' Get the op-codes in terms of human readable string names - these will be used in the drop down select list
-
 
124
   Call GetDaemonInstructionOperationNameArray(op_code_str_array)
118
 
125
 
119
   s = "<td width='6%' align='left'>Operation</td>"
126
   s = "<td width='20%' align='left'>Operation</td>"
120
   s = s + "<td align='left'><select name='op_code_list' id='op_code_list' class='form_item' onchange=""MM_jumpMenu('parent',this,0)"">"
127
   s = s + "<td align='left'><select name='op_code_list' id='op_code_list' class='form_item' onchange=""MM_jumpMenu('parent',this,0)"">"
121
 
128
 
122
   op_code_id  = 0
129
   For each op_code_str in op_code_str_array
-
 
130
 
123
   For each op_code in op_code_array
131
      ' get equivalent op-code value for this op-code string
-
 
132
      op_code_val = DaemonInstructionOperationValue(op_code_str)
124
 
133
 
125
      tempLINK = scriptName & "?inst_id="& parInst_id &_
134
      tempLINK = scriptName & "?inst_id="& parInst_id &_
126
                              "&op_code="& Cstr(op_code_id) &_
135
                              "&op_code="& op_code_val &_
127
                              "&rtag_id=" & parRtag_id &_
136
                              "&rtag_id=" & parRtag_id &_
128
                              "&pv_id=" & parPv_id &_
137
                              "&pv_id=" & parPv_id &_
-
 
138
                              "&sort=" & parSortOrder &_
129
                              "&sdt="& parSchDateTime &_
139
                              "&sdt="& parSchDateTime &_
130
                              "&repeat="& parRepeat &_
140
                              "&repeat="& parRepeat &_
131
                              "&rfile="& parRfile
141
                              "&rfile="& parRfile
132
 
142
 
133
      If ((NNop_code = cstr(op_code_id)) OR (NNop_code = "0")) AND (selectedFound = False) Then
143
      If ((NNop_code = op_code_val) OR (NNop_code = "0")) AND (selectedFound = False) Then
134
         s = s + "<option value='"& tempLINK &"' selected>"& op_code &"</option>"
144
         s = s + "<option value='"& tempLINK &"' selected>"& op_code_str &"</option>"
135
         selectedFound = True
145
         selectedFound = True
136
         NNop_code = op_code_id
146
         NNop_code = op_code_val
137
      Else
147
      Else
138
         s = s + "<option value='"& tempLINK &"'>"& op_code &"</option>"
148
         s = s + "<option value='"& tempLINK &"'>"& op_code_str &"</option>"
139
      End If
149
      End If
140
 
-
 
141
      op_code_id = op_code_id + 1
-
 
142
   Next
150
   Next
143
 
151
 
144
   ' TODO - what if selectedFound is still FALSE, shouldn't we fixup NNop_code to something ?
-
 
145
 
-
 
146
   s = s + "</select></td>"
152
   s = s + "</select></td>"
147
   Get_OpCodes = s
153
   Get_OpCodes = s
148
End Function
154
End Function
149
'------------------------------------------------------------------------------------------------------------------------------------------
155
'------------------------------------------------------------------------------------------------------------------------------------------
150
' Formulate the HTML for a combo box listing all the Projects, and select the one that matches
156
' Formulate the HTML for a combo box listing all the Projects, and select the one that matches
Line 168... Line 174...
168
      tempLINK = scriptName & "?inst_id="& parInst_id &_
174
      tempLINK = scriptName & "?inst_id="& parInst_id &_
169
                              "&op_code="& parOp_code &_
175
                              "&op_code="& parOp_code &_
170
                              "&proj_id=" & rsTemp.Fields("proj_id") &_
176
                              "&proj_id=" & rsTemp.Fields("proj_id") &_
171
                              "&sdt="& parSchDateTime &_
177
                              "&sdt="& parSchDateTime &_
172
                              "&repeat="& parRepeat &_
178
                              "&repeat="& parRepeat &_
-
 
179
                              "&sort=" & parSortOrder &_
173
                              "&rfile="& parRfile
180
                              "&rfile="& parRfile
174
 
181
 
175
      If ((NNproj_id = Cstr(rsTemp.Fields("proj_id"))) OR (NNproj_id = "0")) AND (selectedFound = False) Then
182
      If ((NNproj_id = Cstr(rsTemp.Fields("proj_id"))) OR (NNproj_id = "0")) AND (selectedFound = False) Then
176
         s = s + "<option value='"& tempLINK &"' selected>"& projName &"</option>"
183
         s = s + "<option value='"& tempLINK &"' selected>"& projName &"</option>"
177
         selectedFound = True
184
         selectedFound = True
Line 195... Line 202...
195
   End If
202
   End If
196
 
203
 
197
   rsTemp.Close
204
   rsTemp.Close
198
   Set rsTemp = nothing
205
   Set rsTemp = nothing
199
 
206
 
200
   If ReleasesAvailable(NNproj_id) = False Then
-
 
201
      s = s + "<a style=color:Red>WARNING: Project has no active release(s)</a>"
-
 
202
   End If
-
 
203
 
-
 
204
   s = s + "</td>"
207
   s = s + "</td>"
205
 
208
 
206
   Get_Projects = s
209
   Get_Projects = s
207
End Function
210
End Function
208
 
211
 
Line 210... Line 213...
210
' Formulate the HTML for a combo box listing all the Release for a specified project, and select the one that matches
213
' Formulate the HTML for a combo box listing all the Release for a specified project, and select the one that matches
211
' the release-tag passed in as a parameter. If the parameter value could not be found, correct it to the first valid release-tag
214
' the release-tag passed in as a parameter. If the parameter value could not be found, correct it to the first valid release-tag
212
' in the list.
215
' in the list.
213
'------------------------------------------------------------------------------------------------------------------------------------------
216
'------------------------------------------------------------------------------------------------------------------------------------------
214
Function Get_Releases ( NNproj_id, NNrtag_id )
217
Function Get_Releases ( NNproj_id, NNrtag_id )
215
   Dim rsTemp, Query_String, releaseName, tempLINK, selectedFound, s
218
   Dim rsTemp, Query_String, releaseName, tempLINK, selectedFound, s, numReleases
216
 
219
 
217
   selectedFound = False
220
   selectedFound = False
-
 
221
 
-
 
222
   numReleases = 0
-
 
223
 
218
   Query_String = "SELECT rtag_id, rtag_name "&_
224
   Query_String = "SELECT rtag_id, rtag_name "&_
219
                  "  FROM release_tags rt"&_
225
                  "  FROM release_tags rt"&_
220
                  " WHERE rt.proj_id = "& NNproj_id &_
226
                  " WHERE rt.proj_id = "& NNproj_id &_
221
                  "   AND ((rt.official = 'N') OR (rt.official = 'C') OR (rt.official = 'R'))"&_
227
                  "   AND ((rt.official = 'N') OR (rt.official = 'C') OR (rt.official = 'R'))"&_
222
                  " ORDER BY UPPER(rtag_name)"
228
                  " ORDER BY UPPER(rtag_name)"
Line 232... Line 238...
232
                              "&op_code="& parOp_code &_
238
                              "&op_code="& parOp_code &_
233
                              "&proj_id="& NNproj_id &_
239
                              "&proj_id="& NNproj_id &_
234
                              "&rtag_id="& rsTemp.Fields("rtag_id") &_
240
                              "&rtag_id="& rsTemp.Fields("rtag_id") &_
235
                              "&sdt="& parSchDateTime &_
241
                              "&sdt="& parSchDateTime &_
236
                              "&repeat="& parRepeat &_
242
                              "&repeat="& parRepeat &_
-
 
243
                              "&sort=" & parSortOrder &_
237
                              "&rfile="& parRfile
244
                              "&rfile="& parRfile
238
 
245
 
239
      If ((NNrtag_id = CStr(rsTemp.Fields("rtag_id"))) OR (NNrtag_id = "0")) AND (selectedFound = False) Then
246
      If ((NNrtag_id = CStr(rsTemp.Fields("rtag_id"))) OR (NNrtag_id = "0")) AND (selectedFound = False) Then
240
            s = s + "<option value='"& tempLINK &"' selected>"& releaseName &"</option>"
247
            s = s + "<option value='"& tempLINK &"' selected>"& releaseName &"</option>"
241
         selectedFound = True
248
         selectedFound = True
242
         NNrtag_id = Cstr(rsTemp.Fields("rtag_id"))
249
         NNrtag_id = Cstr(rsTemp.Fields("rtag_id"))
243
      Else
250
      Else
244
         s = s + "<option value='"& tempLINK &"'>"& releaseName &"</option>"
251
         s = s + "<option value='"& tempLINK &"'>"& releaseName &"</option>"
245
      End If
252
      End If
246
 
253
 
-
 
254
      numReleases = numReleases + 1
-
 
255
 
247
      rsTemp.MoveNext
256
      rsTemp.MoveNext
248
   WEnd
257
   WEnd
249
   s = s + "</select>"
258
   s = s + "</select>"
250
 
259
 
251
   ' Correct for a situation where selectedFound is still FALSE.
260
   ' Correct for a situation where selectedFound is still FALSE.
Line 256... Line 265...
256
      Else
265
      Else
257
         NNrtag_id = "0"
266
         NNrtag_id = "0"
258
      End If
267
      End If
259
   End If
268
   End If
260
 
269
 
-
 
270
   ' If no releases were found then replace drop down list with some warning text and disable form submission
-
 
271
   If numReleases = 0 Then
-
 
272
      bPreventSubmit = True
-
 
273
      s = "<td>Release</td><td><a style=color:Red>WARNING: No active releases found. The operation cannot be performed.</a></td>"
-
 
274
   Else
-
 
275
      ' If the selected release does not have a daemon configuration, append some warning text to the right of the drop down list.
-
 
276
      If DaemonsAvailable(NNrtag_id) = False Then
-
 
277
         s = s + "<a style=color:Red>WARNING: Release has no build daemon(s)</a>"
-
 
278
      End If
-
 
279
   End If
-
 
280
 
261
   rsTemp.Close
281
   rsTemp.Close
262
   Set rsTemp = nothing
282
   Set rsTemp = nothing
263
 
283
 
264
   If DaemonsAvailable(NNrtag_id) = False Then
-
 
265
      s = s + "<a style=color:Red>WARNING: Release has no build daemon(s)</a>"
-
 
266
   End If
-
 
267
 
-
 
268
   s = s + "</td>"
284
   s = s + "</td>"
269
 
285
 
270
   Get_Releases = s
286
   Get_Releases = s
271
End Function
287
End Function
272
'------------------------------------------------------------------------------------------------------------------------------------------
288
'------------------------------------------------------------------------------------------------------------------------------------------
273
' Formulate the HTML for a combo box listing all the Package Versions in a specified release, and select the one that matches
289
' Formulate the HTML for a combo box listing all the Package Versions in a specified release, and select the one that matches
274
' the pv_id passed in as a parameter. If the parameter value could not be found, correct it to the first valid pv_id
290
' the pv_id passed in as a parameter. If the parameter value could not be found, correct it to the first valid pv_id
275
' in the list.
291
' in the list.
-
 
292
' This function must deal with op-codes that want to read package versions from the work_in_progress table, and op-codes
-
 
293
' that need to read package versions from the release_content table.
-
 
294
' The function should only be called if a package versions drop down list is required for the form.
276
'------------------------------------------------------------------------------------------------------------------------------------------
295
'------------------------------------------------------------------------------------------------------------------------------------------
277
Function Get_Packages ( NNrtag_id, NNpv_id )
296
Function Get_Packages ( NNrtag_id, NNpv_id, NNop_code )
278
   Dim rsTemp, Query_String, pkgName, tempLINK, selectedFound, s
297
   Dim rsTemp, Query_String, pkgName, tempLINK, selectedFound, s, numPackages
279
 
298
 
280
   selectedFound = False
299
   selectedFound = False
-
 
300
 
-
 
301
   numPackages = 0
-
 
302
 
-
 
303
   If (NNop_code = OP_CODE_1_TEST_BUILD_PACKAGE) Then
-
 
304
      ' Get list of packages from from work_in_progress table
-
 
305
      Query_String = "SELECT pk.pkg_id, pk.pkg_name, pv.pkg_version, wip.pv_id "&_
-
 
306
                     "  FROM work_in_progress wip, release_tags rt, packages pk, package_versions pv "&_
-
 
307
                     " WHERE wip.rtag_id = "& Cstr(NNrtag_id) &_
-
 
308
                     "   AND wip.rtag_id = rt.rtag_id"&_
-
 
309
                     "   AND ((rt.official = 'N') OR (rt.official = 'C') OR (rt.official = 'R'))"&_
-
 
310
                     "   AND wip.pv_id = pv.pv_id"&_
-
 
311
                     "   AND pk.pkg_id = pv.pkg_id"&_
-
 
312
                     " ORDER BY UPPER(pkg_name)"
-
 
313
 
-
 
314
   Else
-
 
315
      ' Get list of packages from from release_content table
281
   Query_String = "SELECT pk.pkg_id, pk.pkg_name, pv.pkg_version, rc.pv_id "&_
316
      Query_String = "SELECT pk.pkg_id, pk.pkg_name, pv.pkg_version, rc.pv_id "&_
282
                  "  FROM release_content rc, release_tags rt, packages pk, package_versions pv "&_
317
                     "  FROM release_content rc, release_tags rt, packages pk, package_versions pv "&_
283
                  " WHERE rc.rtag_id = "& Cstr(NNrtag_id) &_
318
                     " WHERE rc.rtag_id = "& Cstr(NNrtag_id) &_
284
                  "   AND rc.rtag_id = rt.rtag_id"&_
319
                     "   AND rc.rtag_id = rt.rtag_id"&_
285
                  "   AND ((rt.official = 'N') OR (rt.official = 'C') OR (rt.official = 'R'))"&_
320
                     "   AND ((rt.official = 'N') OR (rt.official = 'C') OR (rt.official = 'R'))"&_
286
                  "   AND rc.pv_id = pv.pv_id"&_
321
                     "   AND rc.pv_id = pv.pv_id"&_
287
                  "   AND pk.pkg_id = pv.pkg_id"&_
322
                     "   AND pk.pkg_id = pv.pkg_id"&_
288
                  " ORDER BY UPPER(pkg_name)"
323
                     " ORDER BY UPPER(pkg_name)"
-
 
324
   End If
289
 
325
 
290
	Set rsTemp = OraDatabase.DbCreateDynaset( Query_String, cint(0))
326
	Set rsTemp = OraDatabase.DbCreateDynaset( Query_String, cint(0))
291
 
327
 
-
 
328
   ' modify the control heading to indicate the source of the package version list
-
 
329
   If (NNop_code = OP_CODE_1_TEST_BUILD_PACKAGE) Then
292
   s = "<td>Package</td>"
330
      s = "<td>WIP Package</td>"
-
 
331
   Else
-
 
332
      s = "<td>Released Package</td>"
-
 
333
   End If
-
 
334
 
293
   s = s + "<td><select id='pv_id_list' name='pv_id_list' class='form_item' onChange=""MM_jumpMenu('parent',this,0)"">"
335
   s = s + "<td><select id='pv_id_list' name='pv_id_list' class='form_item' onChange=""MM_jumpMenu('parent',this,0)"">"
294
   While ((NOT rsTemp.BOF) AND (NOT rsTemp.EOF))
336
   While ((NOT rsTemp.BOF) AND (NOT rsTemp.EOF))
295
      pkgName = rsTemp.Fields("pkg_name") & " " & rsTemp.Fields("pkg_version")
337
      pkgName = rsTemp.Fields("pkg_name") & " " & rsTemp.Fields("pkg_version")
296
 
338
 
297
      tempLINK = scriptName & "?inst_id="& parInst_id &_
339
      tempLINK = scriptName & "?inst_id="& parInst_id &_
298
                              "&op_code="& parOp_code &_
340
                              "&op_code="& NNop_code &_
299
                              "&proj_id="& parProj_id &_
341
                              "&proj_id="& parProj_id &_
300
                              "&rtag_id="& NNrtag_id &_
342
                              "&rtag_id="& NNrtag_id &_
301
                              "&pv_id="&   rsTemp.Fields("pv_id") &_
343
                              "&pv_id="&   rsTemp.Fields("pv_id") &_
302
                              "&sdt="& parSchDateTime &_
344
                              "&sdt="& parSchDateTime &_
303
                              "&repeat="& parRepeat &_
345
                              "&repeat="& parRepeat &_
-
 
346
                              "&sort=" & parSortOrder &_
304
                              "&rfile="& parRfile
347
                              "&rfile="& parRfile
305
 
348
 
306
      If ((NNpv_id = Cstr(rsTemp.Fields("pv_id"))) OR (NNpv_id = "0")) AND (selectedFound = False) Then
349
      If ((NNpv_id = Cstr(rsTemp.Fields("pv_id"))) OR (NNpv_id = "0")) AND (selectedFound = False) Then
307
         s = s + "<option value='"& tempLINK &"' selected>"& pkgName &"</option>"
350
         s = s + "<option value='"& tempLINK &"' selected>"& pkgName &"</option>"
308
         selectedFound = True
351
         selectedFound = True
309
         NNpv_id = CStr(rsTemp.Fields("pv_id"))
352
         NNpv_id = CStr(rsTemp.Fields("pv_id"))
310
      Else
353
      Else
311
         s = s + "<option value='"& tempLINK &"'>"& pkgName &"</option>"
354
         s = s + "<option value='"& tempLINK &"'>"& pkgName &"</option>"
312
      End If
355
      End If
313
 
356
 
-
 
357
      numPackages = numPackages + 1
-
 
358
 
314
      rsTemp.MoveNext
359
      rsTemp.MoveNext
315
   WEnd
360
   WEnd
316
   s = s + "</select></td>"
361
   s = s + "</select></td>"
317
 
362
 
318
   ' Correct for a situation where selectedFound is still FALSE.
363
   ' Correct for a situation where selectedFound is still FALSE.
Line 323... Line 368...
323
      Else
368
      Else
324
         NNpv_id = "0"
369
         NNpv_id = "0"
325
      End If
370
      End If
326
   End If
371
   End If
327
 
372
 
-
 
373
   ' replace drop down list with a warning if no package versions were found, and ensure that the user cannot submit the form
-
 
374
   If numPackages = 0 Then
-
 
375
      bPreventSubmit = True
-
 
376
      If (NNop_code = OP_CODE_1_TEST_BUILD_PACKAGE) Then
-
 
377
         s = "<td>Package</td><td><a style=color:Red>WARNING: No WIP package versions found. The operation cannot be performed.</a></td>"
-
 
378
      Else
-
 
379
         s = "<td>Package</td><td><a style=color:Red>WARNING: No released package versions found. The operation cannot be performed.</a></td>"
-
 
380
      End If
-
 
381
   End If
-
 
382
 
328
   rsTemp.Close
383
   rsTemp.Close
329
   Set rsTemp = nothing
384
   Set rsTemp = nothing
330
 
385
 
331
   Get_Packages = s
386
   Get_Packages = s
332
End Function
387
End Function
Line 409... Line 464...
409
' calling Get_Projects() to generate the project drop down list.
464
' calling Get_Projects() to generate the project drop down list.
410
If parProj_id = "0" AND NOT IsNull(parRtag_id) AND parRtag_id <> "" AND parRtag_id <> "0" Then
465
If parProj_id = "0" AND NOT IsNull(parRtag_id) AND parRtag_id <> "" AND parRtag_id <> "0" Then
411
   parProj_id = Get_Proj_ID(parRtag_id)
466
   parProj_id = Get_Proj_ID(parRtag_id)
412
End If
467
End If
413
 
468
 
414
' Clear pv_id if the Daemon Instruction does not require one
469
' Hide the Package drop-down list if the Daemon Instruction does not require it
415
If parOp_code <> OP_CODE_0_RIPPLE_BUILD_PACKAGE Then
470
If DaemonInstructionNeedsPV_ID(parOp_code) Then
-
 
471
   bHidePackages = False
-
 
472
Else
-
 
473
   bHidePackages = True
416
   parPv_id = "0"
474
   parPv_id = "0"
417
End If
475
End If
-
 
476
' NOTE: from this moment on, any real use of parPv_id has to be guarded by examination of bHidePackages
-
 
477
 
418
 
478
 
419
' Hide the Repeat buttons if the Daemon Instruction does not require them
479
' Hide the Repeat buttons if the Daemon Instruction does not require them
420
If parOp_code = OP_CODE_0_RIPPLE_BUILD_PACKAGE Then
480
If DaemonInstructionNeedsRepeat(parOp_code) Then
-
 
481
   bHideRepeat = False
-
 
482
Else
421
   bHideRepeat = True
483
   bHideRepeat = True
422
End If
484
End If
423
 
485
 
-
 
486
 
-
 
487
 
424
' Call some 'Get' procedures without HTML generation to determine the values of parProj_id, par_Rtag_id, and parPv_id
488
' Call some 'Get' procedures without HTML generation to determine the values of parProj_id, par_Rtag_id, and parPv_id
425
' in case they are not currently present in the query string. This will then allow the use of the ReleasesAvailable() and
489
' in case they are not currently present in the query string. This will then allow the use of the ReleasesAvailable() and
426
' DaemonsAvailable() functions further below to hide the form submit button.
490
' DaemonsAvailable() functions further below to hide the form submit button.
427
' It will also support the submit action itself when it takes place during the editing of an existing record where
491
' It will also support the submit action itself when it takes place during the editing of an existing record where
428
' the user changes (for example) the project without making any changes to release or package and so those items
492
' the user changes (for example) the project without making any changes to release or package and so those items
429
' are nullified and must be reset to something other than their original values that came through the query string
493
' are nullified and must be reset to something other than their original values that came through the query string
430
' when the edit form was just opened.
494
' when the edit form was just opened.
431
Call Get_Projects(parProj_id)                  ' Ensures parProj_id has a good value
495
Call Get_Projects(parProj_id)                  ' Ensures parProj_id has a good value
432
Call Get_Releases(parProj_id, parRtag_id)      ' Ensures parRtag_id has a good value
496
Call Get_Releases(parProj_id, parRtag_id)      ' Ensures parRtag_id has a good value
433
 
497
 
434
' PV_IDs are only relevant for certain op-codes
-
 
435
If parOp_code = OP_CODE_0_RIPPLE_BUILD_PACKAGE Then
498
If NOT bHidePackages Then
436
   Call Get_Packages (parRtag_id, parPv_id )
499
   Call Get_Packages (parRtag_id, parPv_id, parOp_code)
437
End If
500
End If
438
 
501
 
439
' Check if form submit is happening
502
' Check if form submit is happening
440
If CBool(Request("action")) Then
503
If CBool(Request("action")) Then
441
 
504
 
Line 460... Line 523...
460
   If NOT bEditEnabled Then
523
   If NOT bEditEnabled Then
461
      ' redirect to an error message
524
      ' redirect to an error message
462
      Call RaiseMsg(enum_MSG_ERROR, "You have been denied permission to add/update daemon instructions for the specified release.")
525
      Call RaiseMsg(enum_MSG_ERROR, "You have been denied permission to add/update daemon instructions for the specified release.")
463
   End If
526
   End If
464
 
527
 
465
   ' Setup the repeat seconds count according to the radio button value
528
   ' do daemon instruction validation, continuing only if it passes
466
   If IsNull(Request("repeat_inst")) OR Request("repeat_inst") = "" OR Request("repeat_inst") = "No" Then
529
   If ValidateDaemonInstruction(parOp_code, parRtag_id, parPv_id) = True Then
467
      RepeatSeconds = 0
-
 
468
   Else
-
 
469
      RepeatSeconds = 86400
-
 
470
   End If
-
 
471
 
530
 
472
   ' If user has not entered a scheduled time, set the scheduled date/time to now
531
      ' Setup the repeat seconds count according to the radio button value
473
   ScheduledDateTime = Request("scheduled_time")
-
 
474
   If IsNull(ScheduledDateTime) OR ScheduledDateTime = "" Then
532
      If IsNull(Request("repeat_inst")) OR Request("repeat_inst") = "" OR Request("repeat_inst") = "No" Then
475
      ScheduledDateTime = ORA_SYSDATETIME
533
         RepeatSeconds = 0
476
   Else
534
      Else
477
      ScheduledDateTime = "TO_DATE( '"& ScheduledDateTime &"','DD-MM-YYYY HH24:MI:SS' )"
535
         RepeatSeconds = 86400
478
   End If
536
      End If
479
 
537
 
-
 
538
      ' If user has not entered a scheduled time, set the scheduled date/time to now
-
 
539
      ScheduledDateTime = Request("scheduled_time")
480
   If parOp_code <> OP_CODE_0_RIPPLE_BUILD_PACKAGE Then
540
      If IsNull(ScheduledDateTime) OR ScheduledDateTime = "" Then
-
 
541
         ScheduledDateTime = ORA_SYSDATETIME
481
      parPv_id = "NULL"
542
      Else
-
 
543
         ScheduledDateTime = "TO_DATE( '"& ScheduledDateTime &"','DD-MM-YYYY HH24:MI:SS' )"
482
   End If
544
      End If
483
 
545
 
484
   ' if the page has been provided an inst_id, we must be editing an existing record so we do an update
546
      ' nullify parPv_id for the SQL, if the instruction op-code does not require one
485
   If (NOT IsNull(parInst_id)) AND (parInst_id <> "") Then
-
 
486
      ' We are updating an existing record
-
 
487
      objEH.TryORA ( OraSession )
-
 
488
      On Error Resume Next
-
 
489
 
-
 
490
      OraDatabase.ExecuteSQL "BEGIN PK_BUILDAPI.update_daemon_inst( "& parInst_id & ", " &_
-
 
491
                                                                       parOp_code & ", " &_
-
 
492
                                                                       parRtag_id & ", " &_
-
 
493
                                                                       parPv_id & ", " &_
-
 
494
                                                                       ScheduledDateTime & ", " &_
-
 
495
                                                                       CStr(RepeatSeconds) & ", " &_
-
 
496
                                                                       ORA_SYSDATETIME & ", " &_
-
 
497
                                                                       objAccessControl.UserId & "); END;"
-
 
498
      objEH.CatchORA ( OraSession )
-
 
499
 
-
 
500
      If objEH.Finally Then
547
      If bHidePackages Then
501
         If parRfile = "admin_daemon_instructions.asp" Then
-
 
502
            Call OpenInParentWindow (parRfile)
-
 
503
         Else
-
 
504
            Call OpenInParentWindow (parRfile & "?rtag_id=" & parRtag_id & "&pv_id=" & parPv_id)
-
 
505
         End If
-
 
506
         Call CloseWindow()
548
         parPv_id = "NULL"
507
      End If
549
      End If
-
 
550
 
-
 
551
      ' if the page has been provided an inst_id, we must be editing an existing record so we do an update
-
 
552
      If (NOT IsNull(parInst_id)) AND (parInst_id <> "") Then
-
 
553
         ' We are updating an existing record
-
 
554
         objEH.TryORA ( OraSession )
-
 
555
         On Error Resume Next
-
 
556
 
-
 
557
         OraDatabase.ExecuteSQL "BEGIN PK_BUILDAPI.update_daemon_inst( "& parInst_id & ", " &_
-
 
558
                                                                        parOp_code & ", " &_
-
 
559
                                                                        parRtag_id & ", " &_
-
 
560
                                                                        parPv_id & ", " &_
-
 
561
                                                                        ScheduledDateTime & ", " &_
-
 
562
                                                                        CStr(RepeatSeconds) & ", " &_
-
 
563
                                                                        ORA_SYSDATETIME & ", " &_
-
 
564
                                                                        objAccessControl.UserId & "); END;"
-
 
565
         objEH.CatchORA ( OraSession )
-
 
566
 
-
 
567
         If objEH.Finally Then
-
 
568
            If parRfile = "admin_daemon_instructions.asp" Then
-
 
569
               Call OpenInParentWindow (parRfile & "?sort=" & parSortOrder)
-
 
570
            Else
-
 
571
               Call OpenInParentWindow (parRfile & "?rtag_id=" & parRtag_id & "&pv_id=" & parPv_id)
-
 
572
            End If
-
 
573
            Call CloseWindow()
-
 
574
         End If
508
   Else ' We are adding a new record
575
      Else ' We are adding a new record
509
      objEH.TryORA ( OraSession )
576
         objEH.TryORA ( OraSession )
510
      On Error Resume Next
577
         On Error Resume Next
511
 
578
 
512
      OraDatabase.ExecuteSQL "BEGIN PK_BUILDAPI.insert_daemon_inst( "& parOp_code & ", " &_
579
         OraDatabase.ExecuteSQL "BEGIN PK_BUILDAPI.insert_daemon_inst( "& parOp_code & ", " &_
513
                                                                       parRtag_id & ", " &_
580
                                                                        parRtag_id & ", " &_
514
                                                                       parPv_id & ", " &_
581
                                                                        parPv_id & ", " &_
515
                                                                       ScheduledDateTime & ", " &_
582
                                                                        ScheduledDateTime & ", " &_
516
                                                                       CStr(RepeatSeconds) & ", " &_
583
                                                                        CStr(RepeatSeconds) & ", " &_
517
                                                                       ORA_SYSDATETIME & ", " &_
584
                                                                        ORA_SYSDATETIME & ", " &_
518
                                                                       objAccessControl.UserId & "); END;"
585
                                                                        objAccessControl.UserId & "); END;"
519
      objEH.CatchORA ( OraSession )
586
         objEH.CatchORA ( OraSession )
520
      If objEH.Finally Then
587
         If objEH.Finally Then
521
         If parRfile = "admin_daemon_instructions.asp" Then
588
            If parRfile = "admin_daemon_instructions.asp" Then
522
            Call OpenInParentWindow (parRfile)
589
               Call OpenInParentWindow (parRfile & "?sort=" & parSortOrder)
523
         Else
590
            Else
524
            Call OpenInParentWindow (parRfile & "?rtag_id=" & parRtag_id & "&pv_id=" & parPv_id)
591
               Call OpenInParentWindow (parRfile & "?rtag_id=" & parRtag_id & "&pv_id=" & parPv_id)
-
 
592
            End If
-
 
593
            Call CloseWindow()
525
         End If
594
         End If
526
         Call CloseWindow()
-
 
527
      End If
595
      End If
528
   End If
596
   End If
529
End If
597
End If
530
 
598
 
531
'----------------------------------------------
599
'----------------------------------------------
Line 542... Line 610...
542
   s += '?inst_id=' + document.getElementById('inst_id').value;
610
   s += '?inst_id=' + document.getElementById('inst_id').value;
543
   s += '&op_code=' + document.getElementById('op_code').value;
611
   s += '&op_code=' + document.getElementById('op_code').value;
544
   s += '&proj_id=' + document.getElementById('proj_id').value;
612
   s += '&proj_id=' + document.getElementById('proj_id').value;
545
   s += '&rtag_id=' + document.getElementById('rtag_id').value;
613
   s += '&rtag_id=' + document.getElementById('rtag_id').value;
546
   s += '&pv_id='   + document.getElementById('pv_id').value;
614
   s += '&pv_id='   + document.getElementById('pv_id').value;
-
 
615
   s += '&sort='    + document.getElementById('sortOrder').value;
547
   s += '&sdt='     + document.getElementById('scheduled_time').value;
616
   s += '&sdt='     + document.getElementById('scheduled_time').value;
548
   s += '&repeat='  + newRepeat;
617
   s += '&repeat='  + newRepeat;
549
   s += '&rfile='   + document.getElementById('rfile').value;
618
   s += '&rfile='   + document.getElementById('rfile').value;
550
 
619
 
551
   document.location = s;
620
   document.location = s;
Line 580... Line 649...
580
                                   "?inst_id="& parInst_id &_
649
                                   "?inst_id="& parInst_id &_
581
                                   "&op_code="& parOp_code &_
650
                                   "&op_code="& parOp_code &_
582
                                   "&proj_id="& parProj_id &_
651
                                   "&proj_id="& parProj_id &_
583
                                   "&rtag_id="& parRtag_id &_
652
                                   "&rtag_id="& parRtag_id &_
584
                                   "&pv_id="&   parPv_id &_
653
                                   "&pv_id="&   parPv_id &_
-
 
654
                                   "&sort="&    parSortOrder &_
585
                                   "&rfile="& parRfile
655
                                   "&rfile="& parRfile
586
         objFormComponent.OnSubmit = "ShowProgress();"
656
         objFormComponent.OnSubmit = "ShowProgress();"
587
         Call objFormComponent.FormStart()
657
         Call objFormComponent.FormStart()
588
 
658
 
589
 
659
 
Line 592... Line 662...
592
            <td background="images/bg_login.gif">
662
            <td background="images/bg_login.gif">
593
               <table width="50%"  border="0" cellspacing="0" cellpadding="0">
663
               <table width="50%"  border="0" cellspacing="0" cellpadding="0">
594
                  <tr>
664
                  <tr>
595
                     <td><%=ProgressBar()%></td>
665
                     <td><%=ProgressBar()%></td>
596
                     <td align="right">
666
                     <td align="right">
597
                        <%If ReleasesAvailable(parProj_id) AND DaemonsAvailable(parRtag_id) Then%>
667
                        <%If ReleasesAvailable(parProj_id) AND DaemonsAvailable(parRtag_id) AND NOT bPreventSubmit Then%>
598
                           <input name="btn" type="submit" class="form_btn" value="Add/Update">
668
                           <input name="btn" type="submit" class="form_btn" value="Add/Update">
599
                        <%Else%>
669
                        <%Else%>
600
                           <input name="btn" type="submit" class="form_btn_disabled" value="Add/Update D" disabled="disabled" >
670
                           <input name="btn" type="submit" class="form_btn_disabled" value="Add/Update" disabled="disabled" >
601
                        <%End If%>
671
                        <%End If%>
602
 
672
 
603
                        <input name="btn" type="reset" class="form_btn" value="Cancel" onClick="self.close();">
673
                        <input name="btn" type="reset" class="form_btn" value="Cancel" onClick="self.close();">
604
                     </td>
674
                     </td>
605
                  </tr>
675
                  </tr>
Line 611... Line 681...
611
               <!-- NEW PRODUCT ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
681
               <!-- NEW PRODUCT ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
612
               <%Call Messenger ( sMessage , 3, "100%" )%>
682
               <%Call Messenger ( sMessage , 3, "100%" )%>
613
               <!-- MESSAGE +++++++++++++++++++++++++++++++++++++++++++++++++++ -->
683
               <!-- MESSAGE +++++++++++++++++++++++++++++++++++++++++++++++++++ -->
614
               <!--#include file="messages/_msg_inline.asp"-->
684
               <!--#include file="messages/_msg_inline.asp"-->
615
               <table width="100%" border="0">
685
               <table width="100%" border="0">
616
 
-
 
617
                  <tr>
686
                  <tr>
618
                     <td width="1%">
687
                     <td width="1%">
619
                        <%=Get_OpCodes(parOp_code)%>
688
                        <%=Get_OpCodes(parOp_code)%>
620
                     </td>
689
                     </td>
621
                  </tr>
690
                  </tr>
Line 633... Line 702...
633
                           <%=Get_Releases(parProj_id, parRtag_id)%>
702
                           <%=Get_Releases(parProj_id, parRtag_id)%>
634
                        </div>
703
                        </div>
635
                     </td>
704
                     </td>
636
                  </tr>
705
                  </tr>
637
 
706
 
638
                  <%If parOp_code = "0" Then%>
707
                  <%If NOT bHidePackages Then%>
639
                  <tr>
708
                  <tr>
640
                     <td>
709
                     <td>
641
                        <div id="SelectPackageVersion" style="visibility:visible">
710
                        <div id="SelectPackageVersion" style="visibility:visible">
642
                           <%=Get_Packages ( parRtag_id, parPv_id )%>
711
                           <%=Get_Packages ( parRtag_id, parPv_id, parOp_code )%>
643
                        </div>
712
                        </div>
644
                     </td>
713
                     </td>
645
                  </tr>
714
                  </tr>
646
                  <%End If%>
715
                  <%End If%>
647
 
716
 
Line 677... Line 746...
677
                        <input type="hidden" id="proj_id"     name="proj_id"      value="<%=parProj_id%>">
746
                        <input type="hidden" id="proj_id"     name="proj_id"      value="<%=parProj_id%>">
678
                        <input type="hidden" id="rtag_id"     name="rtag_id"      value="<%=parRtag_id%>">
747
                        <input type="hidden" id="rtag_id"     name="rtag_id"      value="<%=parRtag_id%>">
679
                        <input type="hidden" id="pv_id"       name="pv_id"        value="<%=parPv_id%>">
748
                        <input type="hidden" id="pv_id"       name="pv_id"        value="<%=parPv_id%>">
680
                        <input type="hidden" id="repeat_secs" name="repeat_secs"  value="<%=parRepeat%>">
749
                        <input type="hidden" id="repeat_secs" name="repeat_secs"  value="<%=parRepeat%>">
681
                        <input type="hidden" id="rfile"       name="rfile"        value="<%=parRfile%>">
750
                        <input type="hidden" id="rfile"       name="rfile"        value="<%=parRfile%>">
-
 
751
                        <input type="hidden" id="sortOrder"   name="sortOrder"    value="<%=parSortOrder%>">
682
                     </td>
752
                     </td>
683
                  </tr>
753
                  </tr>
684
               </table>
754
               </table>
685
            </td>
755
            </td>
686
         </tr>
756
         </tr>