Subversion Repositories DevTools

Rev

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

Rev 153 Rev 5357
Line 1... Line 1...
1
<%@LANGUAGE="VBSCRIPT"%>
1
<%@LANGUAGE="VBSCRIPT"%>
2
<%
2
<%
3
'=====================================================
3
'=====================================================
4
'|                                                   |
4
'|                                                   |
5
'|               wAddDaemonInstruction               |
5
'|               wAddDaemonInstruction               |
6
'|                                                   |
6
'|                                                   |
7
'=====================================================
7
'=====================================================
8
%>
8
%>
9
<%
9
<%
10
Option explicit
10
Option explicit
11
Response.Expires = 0
11
Response.Expires = 0
12
%>
12
%>
13
<!--#include file="common/conf.asp"-->
13
<!--#include file="common/conf.asp"-->
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/common_dbedit.asp"-->
20
<!--#include file="common/daemon_instructions.asp"-->
20
<!--#include file="common/daemon_instructions.asp"-->
21
<%
21
<%
22
'------------ ACCESS CONTROL ------------------
22
'------------ ACCESS CONTROL ------------------
23
%>
23
%>
24
<!--#include file="_access_control_general.asp"-->
24
<!--#include file="_access_control_general.asp"-->
25
<!--#include file="_access_control_login.asp"-->
25
<!--#include file="_access_control_login.asp"-->
26
<%
26
<%
27
'------------ VARIABLE DEFINITION -------------
27
'------------ VARIABLE DEFINITION -------------
28
Dim sMessage
28
Dim sMessage
29
Dim parProj_id
29
Dim parProj_id
30
Dim parPv_id
30
Dim parPv_id
31
Dim parOp_code
31
Dim parOp_code
32
Dim parRepeat
32
Dim parRepeat
33
Dim parInst_id
33
Dim parInst_id
34
Dim parSchDateTime
34
Dim parSchDateTime
35
Dim parRfile
35
Dim parRfile
36
Dim bHideRepeat
36
Dim bHideRepeat
37
Dim bHidePackages
37
Dim bHidePackages
38
Dim bPreventSubmit
38
Dim bPreventSubmit
39
Dim parSortOrder
39
Dim parSortOrder
40
'------------ CONSTANTS DECLARATION -----------
40
'------------ CONSTANTS DECLARATION -----------
41
 
41
 
42
 
42
 
43
'------------ VARIABLE INIT -------------------
43
'------------ VARIABLE INIT -------------------
44
sMessage = NULL
44
sMessage = NULL
45
 
45
 
46
bPreventSubmit = False
46
bPreventSubmit = False
47
 
47
 
48
' collect all parameters from query string
48
' collect all parameters from query string
49
parOp_code = Request("op_code")
49
parOp_code = Request("op_code")
50
parProj_id = Request("proj_id")
50
parProj_id = Request("proj_id")
51
parPv_id = Request("pv_id")
51
parPv_id = Request("pv_id")
52
parRepeat = Request("repeat")
52
parRepeat = Request("repeat")
53
parInst_id = Request("inst_id")
53
parInst_id = Request("inst_id")
54
parSchDateTime = Request("sdt")
54
parSchDateTime = Request("sdt")
55
parRfile = Request("rfile")
55
parRfile = Request("rfile")
56
 
56
 
57
parSortOrder = Request("sort")
57
parSortOrder = Request("sort")
58
If IsNull(parSortOrder) OR parSortOrder = "" Then
58
If IsNull(parSortOrder) OR parSortOrder = "" Then
59
   parSortOrder = "0"
59
   parSortOrder = "0"
60
End If
60
End If
61
 
61
 
62
Set objFormCollector = CreateObject("Scripting.Dictionary")
62
Set objFormCollector = CreateObject("Scripting.Dictionary")
63
 
63
 
64
'------------ CONDITIONS ----------------------
64
'------------ CONDITIONS ----------------------
65
'----------------------------------------------
65
'----------------------------------------------
66
%>
66
%>
67
<%
67
<%
68
'------------------------------------------------------------------------------------------------------------------------------------------
68
'------------------------------------------------------------------------------------------------------------------------------------------
69
' For the specified project ID, get a list of all that project's releases that are not closed/archived.
69
' For the specified project ID, get a list of all that project's releases that are not closed/archived.
70
' Return True if at least one release was found, else False
70
' Return True if at least one release was found, else False
71
'------------------------------------------------------------------------------------------------------------------------------------------
71
'------------------------------------------------------------------------------------------------------------------------------------------
72
Function ReleasesAvailable(NNproj_id)
72
Function ReleasesAvailable(NNproj_id)
73
   Dim rsTemp, Query_String
73
   Dim rsTemp, Query_String
74
 
74
 
75
   ReleasesAvailable = True
75
   ReleasesAvailable = True
76
   Query_String = "SELECT rtag_id, rtag_name "&_
76
   Query_String = "SELECT rtag_id, rtag_name "&_
77
                  "  FROM release_tags rt"&_
77
                  "  FROM release_tags rt"&_
78
                  " WHERE rt.proj_id = "& NNproj_id &_
78
                  " WHERE rt.proj_id = "& NNproj_id &_
79
                  "   AND ((rt.official = 'N') OR (rt.official = 'C') OR (rt.official = 'R'))"
79
                  "   AND ((rt.official = 'N') OR (rt.official = 'C') OR (rt.official = 'R'))"
80
 
80
 
81
	Set rsTemp = OraDatabase.DbCreateDynaset( Query_String, cint(0))
81
	Set rsTemp = OraDatabase.DbCreateDynaset( Query_String, cint(0))
82
   If rsTemp.RecordCount = 0 Then
82
   If rsTemp.RecordCount = 0 Then
83
      ReleasesAvailable = False
83
      ReleasesAvailable = False
84
   End If
84
   End If
85
 
85
 
86
   rsTemp.Close
86
   rsTemp.Close
87
   Set rsTemp = nothing
87
   Set rsTemp = nothing
88
End Function
88
End Function
89
'------------------------------------------------------------------------------------------------------------------------------------------
89
'------------------------------------------------------------------------------------------------------------------------------------------
90
' For the specified Release, get a list of all that release's daemon configurations.
90
' For the specified Release, get a list of all that release's daemon configurations.
91
' Return True if at least one daemon configuration was found, else False
91
' Return True if at least one daemon configuration was found, else False
92
'------------------------------------------------------------------------------------------------------------------------------------------
92
'------------------------------------------------------------------------------------------------------------------------------------------
93
Function DaemonsAvailable(NNrtag_id)
93
Function DaemonsAvailable(NNrtag_id)
94
   Dim rsTemp, Query_String
94
   Dim rsTemp, Query_String
95
 
95
 
96
   DaemonsAvailable = True
96
   DaemonsAvailable = True
97
   Query_String = "SELECT * "&_
97
   Query_String = "SELECT * "&_
98
                  "  FROM release_config rc"&_
98
                  "  FROM release_config rc"&_
99
                  " WHERE rc.rtag_id = "& NNrtag_id
99
                  " WHERE rc.rtag_id = "& NNrtag_id
100
	Set rsTemp = OraDatabase.DbCreateDynaset( Query_String, cint(0))
100
	Set rsTemp = OraDatabase.DbCreateDynaset( Query_String, cint(0))
101
   If rsTemp.RecordCount = 0 Then
101
   If rsTemp.RecordCount = 0 Then
102
      DaemonsAvailable = False
102
      DaemonsAvailable = False
103
   End If
103
   End If
104
 
104
 
105
   rsTemp.Close
105
   rsTemp.Close
106
   Set rsTemp = nothing
106
   Set rsTemp = nothing
107
End Function
107
End Function
108
'------------------------------------------------------------------------------------------------------------------------------------------
108
'------------------------------------------------------------------------------------------------------------------------------------------
109
' 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
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
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
111
' in the list.
111
' in the list.
112
'------------------------------------------------------------------------------------------------------------------------------------------
112
'------------------------------------------------------------------------------------------------------------------------------------------
113
Function Get_OpCodes ( NNop_code )
113
Function Get_OpCodes ( NNop_code )
114
   Dim op_code_str_array
114
   Dim op_code_str_array
115
   Dim op_code_str
115
   Dim op_code_str
116
   Dim op_code_val
116
   Dim op_code_val
117
	Dim selectedFound
117
	Dim selectedFound
118
   Dim tempLINK
118
   Dim tempLINK
119
   Dim s
119
   Dim s
120
 
120
 
121
   selectedFound = False
121
   selectedFound = False
122
 
122
 
123
   ' Get the op-codes in terms of human readable string names - these will be used in the drop down select list
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)
124
   Call GetDaemonInstructionOperationNameArray(op_code_str_array)
125
 
125
 
126
   s = "<td width='20%' align='left'>Operation</td>"
126
   s = "<td width='20%' align='left'>Operation</td>"
127
   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)"">"
128
 
128
 
129
   For each op_code_str in op_code_str_array
129
   For each op_code_str in op_code_str_array
130
 
130
 
131
      ' get equivalent op-code value for this op-code string
131
      ' get equivalent op-code value for this op-code string
132
      op_code_val = DaemonInstructionOperationValue(op_code_str)
132
      op_code_val = DaemonInstructionOperationValue(op_code_str)
133
 
133
 
134
      tempLINK = scriptName & "?inst_id="& parInst_id &_
134
      tempLINK = scriptName & "?inst_id="& parInst_id &_
135
                              "&op_code="& op_code_val &_
135
                              "&op_code="& op_code_val &_
136
                              "&rtag_id=" & parRtag_id &_
136
                              "&rtag_id=" & parRtag_id &_
137
                              "&pv_id=" & parPv_id &_
137
                              "&pv_id=" & parPv_id &_
138
                              "&sort=" & parSortOrder &_
138
                              "&sort=" & parSortOrder &_
139
                              "&sdt="& parSchDateTime &_
139
                              "&sdt="& parSchDateTime &_
140
                              "&repeat="& parRepeat &_
140
                              "&repeat="& parRepeat &_
141
                              "&rfile="& parRfile
141
                              "&rfile="& parRfile
142
 
142
 
143
      If ((NNop_code = op_code_val) OR (NNop_code = "0")) AND (selectedFound = False) Then
143
      If ((NNop_code = op_code_val) OR (NNop_code = "0")) AND (selectedFound = False) Then
144
         s = s + "<option value='"& tempLINK &"' selected>"& op_code_str &"</option>"
144
         s = s + "<option value='"& tempLINK &"' selected>"& op_code_str &"</option>"
145
         selectedFound = True
145
         selectedFound = True
146
         NNop_code = op_code_val
146
         NNop_code = op_code_val
147
      Else
147
      Else
148
         s = s + "<option value='"& tempLINK &"'>"& op_code_str &"</option>"
148
         s = s + "<option value='"& tempLINK &"'>"& op_code_str &"</option>"
149
      End If
149
      End If
150
   Next
150
   Next
151
 
151
 
152
   s = s + "</select></td>"
152
   s = s + "</select></td>"
153
   Get_OpCodes = s
153
   Get_OpCodes = s
154
End Function
154
End Function
155
'------------------------------------------------------------------------------------------------------------------------------------------
155
'------------------------------------------------------------------------------------------------------------------------------------------
156
' 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
157
' the proj-id passed in as a parameter. If the parameter value could not be found, correct it to the first valid proj-id
157
' the proj-id passed in as a parameter. If the parameter value could not be found, correct it to the first valid proj-id
158
' in the list.
158
' in the list.
159
'------------------------------------------------------------------------------------------------------------------------------------------
159
'------------------------------------------------------------------------------------------------------------------------------------------
160
Function Get_Projects ( NNproj_id )
160
Function Get_Projects ( NNproj_id )
161
   Dim rsTemp, Query_String, projName, tempLINK, selectedFound, s
161
   Dim rsTemp, Query_String, projName, tempLINK, selectedFound, s
162
 
162
 
163
   selectedFound = False
163
   selectedFound = False
164
   Query_String = "SELECT * FROM projects ORDER BY  UPPER( proj_name )"
164
   Query_String = "SELECT * FROM projects ORDER BY  UPPER( proj_name )"
165
 
165
 
166
   Set rsTemp = OraDatabase.DbCreateDynaset( Query_String, cint(0))
166
   Set rsTemp = OraDatabase.DbCreateDynaset( Query_String, cint(0))
167
 
167
 
168
   s = "<td>Project</td>"
168
   s = "<td>Project</td>"
169
   s = s + "<td><select id='proj_id_list' name='proj_id_list' class='form_item' onChange=""MM_jumpMenu('parent',this,0)"">"
169
   s = s + "<td><select id='proj_id_list' name='proj_id_list' class='form_item' onChange=""MM_jumpMenu('parent',this,0)"">"
170
 
170
 
171
   While ((NOT rsTemp.BOF) AND (NOT rsTemp.EOF))
171
   While ((NOT rsTemp.BOF) AND (NOT rsTemp.EOF))
172
      projName = UCase(rsTemp.Fields("proj_name"))
172
      projName = UCase(rsTemp.Fields("proj_name"))
173
 
173
 
174
      tempLINK = scriptName & "?inst_id="& parInst_id &_
174
      tempLINK = scriptName & "?inst_id="& parInst_id &_
175
                              "&op_code="& parOp_code &_
175
                              "&op_code="& parOp_code &_
176
                              "&proj_id=" & rsTemp.Fields("proj_id") &_
176
                              "&proj_id=" & rsTemp.Fields("proj_id") &_
177
                              "&sdt="& parSchDateTime &_
177
                              "&sdt="& parSchDateTime &_
178
                              "&repeat="& parRepeat &_
178
                              "&repeat="& parRepeat &_
179
                              "&sort=" & parSortOrder &_
179
                              "&sort=" & parSortOrder &_
180
                              "&rfile="& parRfile
180
                              "&rfile="& parRfile
181
 
181
 
182
      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
183
         s = s + "<option value='"& tempLINK &"' selected>"& projName &"</option>"
183
         s = s + "<option value='"& tempLINK &"' selected>"& projName &"</option>"
184
         selectedFound = True
184
         selectedFound = True
185
         NNproj_id = CStr(rsTemp.Fields("proj_id"))
185
         NNproj_id = CStr(rsTemp.Fields("proj_id"))
186
      Else
186
      Else
187
         s = s + "<option value='"& tempLINK &"'>"& projName &"</option>"
187
         s = s + "<option value='"& tempLINK &"'>"& projName &"</option>"
188
      End If
188
      End If
189
 
189
 
190
      rsTemp.MoveNext
190
      rsTemp.MoveNext
191
   WEnd
191
   WEnd
192
   s = s + "</select>"
192
   s = s + "</select>"
193
 
193
 
194
   ' Correct for a situation where selectedFound is still FALSE.
194
   ' Correct for a situation where selectedFound is still FALSE.
195
   If NOT selectedFound Then
195
   If NOT selectedFound Then
196
      rsTemp.MoveFirst
196
      rsTemp.MoveFirst
197
      If ((NOT rsTemp.BOF) AND (NOT rsTemp.EOF)) Then
197
      If ((NOT rsTemp.BOF) AND (NOT rsTemp.EOF)) Then
198
         NNproj_id = CStr(rsTemp.Fields("proj_id"))
198
         NNproj_id = CStr(rsTemp.Fields("proj_id"))
199
      Else
199
      Else
200
         NNproj_id = "0"
200
         NNproj_id = "0"
201
      End If
201
      End If
202
   End If
202
   End If
203
 
203
 
204
   rsTemp.Close
204
   rsTemp.Close
205
   Set rsTemp = nothing
205
   Set rsTemp = nothing
206
 
206
 
207
   s = s + "</td>"
207
   s = s + "</td>"
208
 
208
 
209
   Get_Projects = s
209
   Get_Projects = s
210
End Function
210
End Function
211
 
211
 
212
'------------------------------------------------------------------------------------------------------------------------------------------
212
'------------------------------------------------------------------------------------------------------------------------------------------
213
' 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
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
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
215
' in the list.
215
' in the list.
216
'------------------------------------------------------------------------------------------------------------------------------------------
216
'------------------------------------------------------------------------------------------------------------------------------------------
217
Function Get_Releases ( NNproj_id, NNrtag_id )
217
Function Get_Releases ( NNproj_id, NNrtag_id )
218
   Dim rsTemp, Query_String, releaseName, tempLINK, selectedFound, s, numReleases
218
   Dim rsTemp, Query_String, releaseName, tempLINK, selectedFound, s, numReleases
219
 
219
 
220
   selectedFound = False
220
   selectedFound = False
221
 
221
 
222
   numReleases = 0
222
   numReleases = 0
223
 
223
 
224
   Query_String = "SELECT rtag_id, rtag_name "&_
224
   Query_String = "SELECT rtag_id, rtag_name "&_
225
                  "  FROM release_tags rt"&_
225
                  "  FROM release_tags rt"&_
226
                  " WHERE rt.proj_id = "& NNproj_id &_
226
                  " WHERE rt.proj_id = "& NNproj_id &_
227
                  "   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'))"&_
228
                  " ORDER BY UPPER(rtag_name)"
228
                  " ORDER BY UPPER(rtag_name)"
229
	Set rsTemp = OraDatabase.DbCreateDynaset( Query_String, cint(0))
229
	Set rsTemp = OraDatabase.DbCreateDynaset( Query_String, cint(0))
230
 
230
 
231
   s = "<td>Release</td>"
231
   s = "<td>Release</td>"
232
   s = s + "<td><select id='rtag_id_list' name='rtag_id_list' class='form_item' onChange=""MM_jumpMenu('parent',this,0)"">"
232
   s = s + "<td><select id='rtag_id_list' name='rtag_id_list' class='form_item' onChange=""MM_jumpMenu('parent',this,0)"">"
233
 
233
 
234
   While ((NOT rsTemp.BOF) AND (NOT rsTemp.EOF))
234
   While ((NOT rsTemp.BOF) AND (NOT rsTemp.EOF))
235
      releaseName = rsTemp.Fields("rtag_name")
235
      releaseName = rsTemp.Fields("rtag_name")
236
 
236
 
237
      tempLINK = scriptName & "?inst_id="& parInst_id &_
237
      tempLINK = scriptName & "?inst_id="& parInst_id &_
238
                              "&op_code="& parOp_code &_
238
                              "&op_code="& parOp_code &_
239
                              "&proj_id="& NNproj_id &_
239
                              "&proj_id="& NNproj_id &_
240
                              "&rtag_id="& rsTemp.Fields("rtag_id") &_
240
                              "&rtag_id="& rsTemp.Fields("rtag_id") &_
241
                              "&sdt="& parSchDateTime &_
241
                              "&sdt="& parSchDateTime &_
242
                              "&repeat="& parRepeat &_
242
                              "&repeat="& parRepeat &_
243
                              "&sort=" & parSortOrder &_
243
                              "&sort=" & parSortOrder &_
244
                              "&rfile="& parRfile
244
                              "&rfile="& parRfile
245
 
245
 
246
      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
247
            s = s + "<option value='"& tempLINK &"' selected>"& releaseName &"</option>"
247
            s = s + "<option value='"& tempLINK &"' selected>"& releaseName &"</option>"
248
         selectedFound = True
248
         selectedFound = True
249
         NNrtag_id = Cstr(rsTemp.Fields("rtag_id"))
249
         NNrtag_id = Cstr(rsTemp.Fields("rtag_id"))
250
      Else
250
      Else
251
         s = s + "<option value='"& tempLINK &"'>"& releaseName &"</option>"
251
         s = s + "<option value='"& tempLINK &"'>"& releaseName &"</option>"
252
      End If
252
      End If
253
 
253
 
254
      numReleases = numReleases + 1
254
      numReleases = numReleases + 1
255
 
255
 
256
      rsTemp.MoveNext
256
      rsTemp.MoveNext
257
   WEnd
257
   WEnd
258
   s = s + "</select>"
258
   s = s + "</select>"
259
 
259
 
260
   ' Correct for a situation where selectedFound is still FALSE.
260
   ' Correct for a situation where selectedFound is still FALSE.
261
   If NOT selectedFound Then
261
   If NOT selectedFound Then
262
      rsTemp.MoveFirst
262
      rsTemp.MoveFirst
263
      If ((NOT rsTemp.BOF) AND (NOT rsTemp.EOF)) Then
263
      If ((NOT rsTemp.BOF) AND (NOT rsTemp.EOF)) Then
264
         NNrtag_id = CStr(rsTemp.Fields("rtag_id"))
264
         NNrtag_id = CStr(rsTemp.Fields("rtag_id"))
265
      Else
265
      Else
266
         NNrtag_id = "0"
266
         NNrtag_id = "0"
267
      End If
267
      End If
268
   End If
268
   End If
269
 
269
 
270
   ' If no releases were found then replace drop down list with some warning text and disable form submission
270
   ' If no releases were found then replace drop down list with some warning text and disable form submission
271
   If numReleases = 0 Then
271
   If numReleases = 0 Then
272
      bPreventSubmit = True
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>"
273
      s = "<td>Release</td><td><a style=color:Red>WARNING: No active releases found. The operation cannot be performed.</a></td>"
274
   Else
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.
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
276
      If DaemonsAvailable(NNrtag_id) = False Then
277
         s = s + "<a style=color:Red>WARNING: Release has no build daemon(s)</a>"
277
         s = s + "<a style=color:Red>WARNING: Release has no build daemon(s)</a>"
278
      End If
278
      End If
279
   End If
279
   End If
280
 
280
 
281
   rsTemp.Close
281
   rsTemp.Close
282
   Set rsTemp = nothing
282
   Set rsTemp = nothing
283
 
283
 
284
   s = s + "</td>"
284
   s = s + "</td>"
285
 
285
 
286
   Get_Releases = s
286
   Get_Releases = s
287
End Function
287
End Function
288
'------------------------------------------------------------------------------------------------------------------------------------------
288
'------------------------------------------------------------------------------------------------------------------------------------------
289
' 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
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
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
291
' 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
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.
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.
294
' The function should only be called if a package versions drop down list is required for the form.
295
'------------------------------------------------------------------------------------------------------------------------------------------
295
'------------------------------------------------------------------------------------------------------------------------------------------
296
Function Get_Packages ( NNrtag_id, NNpv_id, NNop_code )
296
Function Get_Packages ( NNrtag_id, NNpv_id, NNop_code )
297
   Dim rsTemp, Query_String, pkgName, tempLINK, selectedFound, s, numPackages
297
   Dim rsTemp, Query_String, pkgName, tempLINK, selectedFound, s, numPackages
298
 
298
 
299
   selectedFound = False
299
   selectedFound = False
300
 
300
 
301
   numPackages = 0
301
   numPackages = 0
302
 
302
 
303
   If (NNop_code = OP_CODE_1_TEST_BUILD_PACKAGE) Then
303
   If (NNop_code = OP_CODE_1_TEST_BUILD_PACKAGE) Then
304
      ' Get list of packages from from work_in_progress table
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 "&_
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 "&_
306
                     "  FROM work_in_progress wip, release_tags rt, packages pk, package_versions pv "&_
307
                     " WHERE wip.rtag_id = "& Cstr(NNrtag_id) &_
307
                     " WHERE wip.rtag_id = "& Cstr(NNrtag_id) &_
308
                     "   AND wip.rtag_id = rt.rtag_id"&_
308
                     "   AND wip.rtag_id = rt.rtag_id"&_
309
                     "   AND ((rt.official = 'N') OR (rt.official = 'C') OR (rt.official = 'R'))"&_
309
                     "   AND ((rt.official = 'N') OR (rt.official = 'C') OR (rt.official = 'R'))"&_
310
                     "   AND wip.pv_id = pv.pv_id"&_
310
                     "   AND wip.pv_id = pv.pv_id"&_
311
                     "   AND pk.pkg_id = pv.pkg_id"&_
311
                     "   AND pk.pkg_id = pv.pkg_id"&_
312
                     " ORDER BY UPPER(pkg_name)"
312
                     " ORDER BY UPPER(pkg_name)"
313
 
313
 
314
   Else
314
   Else
315
      ' Get list of packages from from release_content table
315
      ' Get list of packages from from release_content table
316
      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 "&_
317
                     "  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 "&_
318
                     " WHERE rc.rtag_id = "& Cstr(NNrtag_id) &_
318
                     " WHERE rc.rtag_id = "& Cstr(NNrtag_id) &_
319
                     "   AND rc.rtag_id = rt.rtag_id"&_
319
                     "   AND rc.rtag_id = rt.rtag_id"&_
320
                     "   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'))"&_
321
                     "   AND rc.pv_id = pv.pv_id"&_
321
                     "   AND rc.pv_id = pv.pv_id"&_
322
                     "   AND pk.pkg_id = pv.pkg_id"&_
322
                     "   AND pk.pkg_id = pv.pkg_id"&_
323
                     " ORDER BY UPPER(pkg_name)"
323
                     " ORDER BY UPPER(pkg_name)"
324
   End If
324
   End If
325
 
325
 
326
	Set rsTemp = OraDatabase.DbCreateDynaset( Query_String, cint(0))
326
	Set rsTemp = OraDatabase.DbCreateDynaset( Query_String, cint(0))
327
 
327
 
328
   ' modify the control heading to indicate the source of the package version list
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
329
   If (NNop_code = OP_CODE_1_TEST_BUILD_PACKAGE) Then
330
      s = "<td>WIP Package</td>"
330
      s = "<td>WIP Package</td>"
331
   Else
331
   Else
332
      s = "<td>Released Package</td>"
332
      s = "<td>Released Package</td>"
333
   End If
333
   End If
334
 
334
 
335
   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)"">"
336
   While ((NOT rsTemp.BOF) AND (NOT rsTemp.EOF))
336
   While ((NOT rsTemp.BOF) AND (NOT rsTemp.EOF))
337
      pkgName = rsTemp.Fields("pkg_name") & " " & rsTemp.Fields("pkg_version")
337
      pkgName = rsTemp.Fields("pkg_name") & " " & rsTemp.Fields("pkg_version")
338
 
338
 
339
      tempLINK = scriptName & "?inst_id="& parInst_id &_
339
      tempLINK = scriptName & "?inst_id="& parInst_id &_
340
                              "&op_code="& NNop_code &_
340
                              "&op_code="& NNop_code &_
341
                              "&proj_id="& parProj_id &_
341
                              "&proj_id="& parProj_id &_
342
                              "&rtag_id="& NNrtag_id &_
342
                              "&rtag_id="& NNrtag_id &_
343
                              "&pv_id="&   rsTemp.Fields("pv_id") &_
343
                              "&pv_id="&   rsTemp.Fields("pv_id") &_
344
                              "&sdt="& parSchDateTime &_
344
                              "&sdt="& parSchDateTime &_
345
                              "&repeat="& parRepeat &_
345
                              "&repeat="& parRepeat &_
346
                              "&sort=" & parSortOrder &_
346
                              "&sort=" & parSortOrder &_
347
                              "&rfile="& parRfile
347
                              "&rfile="& parRfile
348
 
348
 
349
      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
350
         s = s + "<option value='"& tempLINK &"' selected>"& pkgName &"</option>"
350
         s = s + "<option value='"& tempLINK &"' selected>"& pkgName &"</option>"
351
         selectedFound = True
351
         selectedFound = True
352
         NNpv_id = CStr(rsTemp.Fields("pv_id"))
352
         NNpv_id = CStr(rsTemp.Fields("pv_id"))
353
      Else
353
      Else
354
         s = s + "<option value='"& tempLINK &"'>"& pkgName &"</option>"
354
         s = s + "<option value='"& tempLINK &"'>"& pkgName &"</option>"
355
      End If
355
      End If
356
 
356
 
357
      numPackages = numPackages + 1
357
      numPackages = numPackages + 1
358
 
358
 
359
      rsTemp.MoveNext
359
      rsTemp.MoveNext
360
   WEnd
360
   WEnd
361
   s = s + "</select></td>"
361
   s = s + "</select></td>"
362
 
362
 
363
   ' Correct for a situation where selectedFound is still FALSE.
363
   ' Correct for a situation where selectedFound is still FALSE.
364
   If NOT selectedFound Then
364
   If NOT selectedFound Then
365
      rsTemp.MoveFirst
365
      rsTemp.MoveFirst
366
      If ((NOT rsTemp.BOF) AND (NOT rsTemp.EOF)) Then
366
      If ((NOT rsTemp.BOF) AND (NOT rsTemp.EOF)) Then
367
         NNpv_id = Cstr(rsTemp.Fields("pv_id"))
367
         NNpv_id = Cstr(rsTemp.Fields("pv_id"))
368
      Else
368
      Else
369
         NNpv_id = "0"
369
         NNpv_id = "0"
370
      End If
370
      End If
371
   End If
371
   End If
372
 
372
 
373
   ' replace drop down list with a warning if no package versions were found, and ensure that the user cannot submit the form
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
374
   If numPackages = 0 Then
375
      bPreventSubmit = True
375
      bPreventSubmit = True
376
      If (NNop_code = OP_CODE_1_TEST_BUILD_PACKAGE) Then
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>"
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
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>"
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
380
      End If
381
   End If
381
   End If
382
 
382
 
383
   rsTemp.Close
383
   rsTemp.Close
384
   Set rsTemp = nothing
384
   Set rsTemp = nothing
385
 
385
 
386
   Get_Packages = s
386
   Get_Packages = s
387
End Function
387
End Function
388
 
388
 
389
'------------------------------------------------------------------------------------------------------------------------------------------
389
'------------------------------------------------------------------------------------------------------------------------------------------
390
' This function will be called if and only if the form is first opened in circumstances where the user is editing an existing record
390
' This function will be called if and only if the form is first opened in circumstances where the user is editing an existing record
391
' and all of the form's parameters must be set to the values found in that record. The database record must be obtained using a query
391
' and all of the form's parameters must be set to the values found in that record. The database record must be obtained using a query
392
' and the relevant parameters assigned from the record fields
392
' and the relevant parameters assigned from the record fields
393
'------------------------------------------------------------------------------------------------------------------------------------------
393
'------------------------------------------------------------------------------------------------------------------------------------------
394
Sub Get_All_Params_From_Inst_Id(NNInstId)
394
Sub Get_All_Params_From_Inst_Id(NNInstId)
395
   Dim rsTemp, Query_String
395
   Dim rsTemp, Query_String
396
 
396
 
397
   Query_String = "SELECT op_code, rtag_id, pv_id, repeat_secs, "&_
397
   Query_String = "SELECT op_code, rtag_id, pv_id, repeat_secs, "&_
398
                  "  TO_CHAR(scheduled_datetime, 'DD-MM-YYYY HH24:MI:SS') AS schedDate "&_
398
                  "  TO_CHAR(scheduled_datetime, 'DD-MM-YYYY HH24:MI:SS') AS schedDate "&_
399
                  "  FROM DAEMON_INSTRUCTIONS "&_
399
                  "  FROM DAEMON_INSTRUCTIONS "&_
400
                  " WHERE DAEMON_INSTRUCTIONS_ID = " & NNInstId
400
                  " WHERE DAEMON_INSTRUCTIONS_ID = " & NNInstId
401
	Set rsTemp = OraDatabase.DbCreateDynaset( Query_String, cint(0))
401
	Set rsTemp = OraDatabase.DbCreateDynaset( Query_String, cint(0))
402
   If rstemp.RecordCount = 0 Then
402
   If rstemp.RecordCount = 0 Then
403
      Call RaiseMsg(enum_MSG_ERROR, "Attempt to Edit a non-existent record")
403
      Call RaiseMsg(enum_MSG_ERROR, "Attempt to Edit a non-existent record")
404
   End If
404
   End If
405
 
405
 
406
   ' assign record fields to global parameters
406
   ' assign record fields to global parameters
407
   parOp_code = rsTemp("op_code")
407
   parOp_code = rsTemp("op_code")
408
   parRtag_id = rsTemp("rtag_id")
408
   parRtag_id = rsTemp("rtag_id")
409
   parPv_id   = rsTemp("pv_id")
409
   parPv_id   = rsTemp("pv_id")
410
   parRepeat  = rsTemp("repeat_secs")
410
   parRepeat  = rsTemp("repeat_secs")
411
   parSchDateTime = rsTemp("schedDate")
411
   parSchDateTime = rsTemp("schedDate")
412
 
412
 
413
   ' derive project id since that is not stored in the table
413
   ' derive project id since that is not stored in the table
414
   If NOT IsNull(parRtag_id) AND parRtag_id <> "" Then
414
   If NOT IsNull(parRtag_id) AND parRtag_id <> "" Then
415
      parProj_id = Get_Proj_ID(parRtag_id)
415
      parProj_id = Get_Proj_ID(parRtag_id)
416
   Else
416
   Else
417
      parProj_id = "0"
417
      parProj_id = "0"
418
   End If
418
   End If
419
 
419
 
420
   rsTemp.Close
420
   rsTemp.Close
421
   Set rsTemp = nothing
421
   Set rsTemp = nothing
422
End Sub
422
End Sub
423
'------------------------------------------------------------------------------------------------------------------------------------------
423
'------------------------------------------------------------------------------------------------------------------------------------------
424
%>
424
%>
425
<%
425
<%
426
'------------ RUN BEFORE PAGE RENDER ----------
426
'------------ RUN BEFORE PAGE RENDER ----------
427
 
427
 
428
' Are we in edit mode? If so, populate all parameters from the record being edited
428
' Are we in edit mode? If so, populate all parameters from the record being edited
429
If (NOT IsNull(parInst_id)) AND (parInst_id <> "") AND (Request("edit") = "true") Then
429
If (NOT IsNull(parInst_id)) AND (parInst_id <> "") AND (Request("edit") = "true") Then
430
   If NOT DaemonInstructionInProgress(Request("inst_id")) Then
430
   If NOT DaemonInstructionInProgress(Request("inst_id")) Then
431
      Call Get_All_Params_From_Inst_Id(parInst_id)
431
      Call Get_All_Params_From_Inst_Id(parInst_id)
432
   Else
432
   Else
433
      CloseWindow   ' close the form we were opening
433
      CloseWindow   ' close the form we were opening
434
      ' redirect to an error message in the parent form
434
      ' redirect to an error message in the parent form
435
      Call RaiseMsgInParent(enum_MSG_ERROR, "Cannot edit an instruction that is currently being processed by a Daemon")
435
      Call RaiseMsgInParent(enum_MSG_ERROR, "Cannot edit an instruction that is currently being processed by a Daemon")
436
   End If
436
   End If
437
End If
437
End If
438
 
438
 
439
' Make sure we dont have any null strings or empty strings for our parameters
439
' Make sure we dont have any null strings or empty strings for our parameters
440
If IsNull(parOp_code) OR parOp_code = "" Then
440
If IsNull(parOp_code) OR parOp_code = "" Then
441
   parOp_code = "0"
441
   parOp_code = "0"
442
End If
442
End If
443
If IsNull(parProj_id) OR parProj_id = "" Then
443
If IsNull(parProj_id) OR parProj_id = "" Then
444
   parProj_id = "0"
444
   parProj_id = "0"
445
End If
445
End If
446
If IsNull(parRtag_id) OR parRtag_id = "" Then
446
If IsNull(parRtag_id) OR parRtag_id = "" Then
447
   parRtag_id = "0"
447
   parRtag_id = "0"
448
End If
448
End If
449
If IsNull(parPv_id) OR parPv_id = "" Then
449
If IsNull(parPv_id) OR parPv_id = "" Then
450
   parPv_id = "0"
450
   parPv_id = "0"
451
End If
451
End If
452
If IsNull(parRepeat) OR parRepeat = "" Then
452
If IsNull(parRepeat) OR parRepeat = "" Then
453
   parRepeat = "0"
453
   parRepeat = "0"
454
End If
454
End If
455
If IsNull(parRfile) OR parRfile = "" Then
455
If IsNull(parRfile) OR parRfile = "" Then
456
   parRfile = "admin_daemon_instructions.asp"
456
   parRfile = "admin_daemon_instructions.asp"
457
End If
457
End If
458
 
458
 
459
If IsNull(parSchDateTime) OR parSchDateTime = "" Then
459
If IsNull(parSchDateTime) OR parSchDateTime = "" Then
460
   parSchDateTime = EuroDateTimeForCalendarControl(Now())
460
   parSchDateTime = EuroDateTimeForCalendarControl(Now())
461
End If
461
End If
462
 
462
 
463
' If this form is opened with an OP_CODE, RTAG_ID and PV_ID only, then we need to derive the PROJ_ID before
463
' If this form is opened with an OP_CODE, RTAG_ID and PV_ID only, then we need to derive the PROJ_ID before
464
' calling Get_Projects() to generate the project drop down list.
464
' calling Get_Projects() to generate the project drop down list.
465
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
466
   parProj_id = Get_Proj_ID(parRtag_id)
466
   parProj_id = Get_Proj_ID(parRtag_id)
467
End If
467
End If
468
 
468
 
469
' Hide the Package drop-down list if the Daemon Instruction does not require it
469
' Hide the Package drop-down list if the Daemon Instruction does not require it
470
If DaemonInstructionNeedsPV_ID(parOp_code) Then
470
If DaemonInstructionNeedsPV_ID(parOp_code) Then
471
   bHidePackages = False
471
   bHidePackages = False
472
Else
472
Else
473
   bHidePackages = True
473
   bHidePackages = True
474
   parPv_id = "0"
474
   parPv_id = "0"
475
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
476
' NOTE: from this moment on, any real use of parPv_id has to be guarded by examination of bHidePackages
477
 
477
 
478
 
478
 
479
' 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
480
If DaemonInstructionNeedsRepeat(parOp_code) Then
480
If DaemonInstructionNeedsRepeat(parOp_code) Then
481
   bHideRepeat = False
481
   bHideRepeat = False
482
Else
482
Else
483
   bHideRepeat = True
483
   bHideRepeat = True
484
End If
484
End If
485
 
485
 
486
 
486
 
487
 
487
 
488
' 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
489
' 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
490
' DaemonsAvailable() functions further below to hide the form submit button.
490
' DaemonsAvailable() functions further below to hide the form submit button.
491
' 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
492
' 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
493
' 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
494
' when the edit form was just opened.
494
' when the edit form was just opened.
495
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
496
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
497
 
497
 
498
If NOT bHidePackages Then
498
If NOT bHidePackages Then
499
   Call Get_Packages (parRtag_id, parPv_id, parOp_code)
499
   Call Get_Packages (parRtag_id, parPv_id, parOp_code)
500
End If
500
End If
501
 
501
 
502
' Check if form submit is happening
502
' Check if form submit is happening
503
If CBool(Request("action")) Then
503
If CBool(Request("action")) Then
504
 
504
 
505
   Dim RepeatSeconds
505
   Dim RepeatSeconds
506
   Dim ScheduledDateTime
506
   Dim ScheduledDateTime
507
   Dim ReleaseMode
507
   Dim ReleaseMode
508
 
508
 
509
   ReleaseMode = GetReleaseMode(parRtag_id)
509
   ReleaseMode = GetReleaseMode(parRtag_id)
510
 
510
 
511
   ' determine if insert/update is enabled by permissions
511
   ' determine if insert/update is enabled by permissions
512
   if NOT UserCanAddOrEditThisDaemonInst(parProj_id, ReleaseMode, parOp_code) Then
512
   if NOT UserCanAddOrEditThisDaemonInst(parProj_id, ReleaseMode, parOp_code) Then
513
      ' redirect to an error message
513
      ' redirect to an error message
514
      Call RaiseMsg(enum_MSG_ERROR, "You have been denied permission to add/update daemon instructions for the specified release.")
514
      Call RaiseMsg(enum_MSG_ERROR, "You have been denied permission to add/update daemon instructions for the specified release.")
515
   End If
515
   End If
516
 
516
 
517
   ' do daemon instruction validation, continuing only if it passes
517
   ' do daemon instruction validation, continuing only if it passes
518
   If ValidateDaemonInstruction(parOp_code, parRtag_id, parPv_id) = True Then
518
   If ValidateDaemonInstruction(parOp_code, parRtag_id, parPv_id) = True Then
519
 
519
 
520
      ' Setup the repeat seconds count according to the radio button value
520
      ' Setup the repeat seconds count according to the radio button value
521
      If IsNull(Request("repeat_inst")) OR Request("repeat_inst") = "" OR Request("repeat_inst") = "No" Then
521
      If IsNull(Request("repeat_inst")) OR Request("repeat_inst") = "" OR Request("repeat_inst") = "No" Then
522
         RepeatSeconds = 0
522
         RepeatSeconds = 0
523
      Else
523
      Else
524
         RepeatSeconds = 86400
524
         RepeatSeconds = 86400
525
      End If
525
      End If
526
 
526
 
527
      ' If user has not entered a scheduled time, set the scheduled date/time to now
527
      ' If user has not entered a scheduled time, set the scheduled date/time to now
528
      ScheduledDateTime = Request("scheduled_time")
528
      ScheduledDateTime = Request("scheduled_time")
529
      If IsNull(ScheduledDateTime) OR ScheduledDateTime = "" Then
529
      If IsNull(ScheduledDateTime) OR ScheduledDateTime = "" Then
530
         ScheduledDateTime = ORA_SYSDATETIME
530
         ScheduledDateTime = ORA_SYSDATETIME
531
      Else
531
      Else
532
         ScheduledDateTime = "TO_DATE( '"& ScheduledDateTime &"','DD-MM-YYYY HH24:MI:SS' )"
532
         ScheduledDateTime = "TO_DATE( '"& ScheduledDateTime &"','DD-MM-YYYY HH24:MI:SS' )"
533
      End If
533
      End If
534
 
534
 
535
      ' nullify parPv_id for the SQL, if the instruction op-code does not require one
535
      ' nullify parPv_id for the SQL, if the instruction op-code does not require one
536
      If bHidePackages Then
536
      If bHidePackages Then
537
         parPv_id = "NULL"
537
         parPv_id = "NULL"
538
      End If
538
      End If
539
 
539
 
540
      ' if the page has been provided an inst_id, we must be editing an existing record so we do an update
540
      ' if the page has been provided an inst_id, we must be editing an existing record so we do an update
541
      If (NOT IsNull(parInst_id)) AND (parInst_id <> "") Then
541
      If (NOT IsNull(parInst_id)) AND (parInst_id <> "") Then
542
         ' We are updating an existing record
542
         ' We are updating an existing record
543
         objEH.TryORA ( OraSession )
543
         objEH.TryORA ( OraSession )
544
         On Error Resume Next
544
         On Error Resume Next
545
 
545
 
546
         OraDatabase.ExecuteSQL "BEGIN PK_BUILDAPI.update_daemon_inst( "& parInst_id & ", " &_
546
         OraDatabase.ExecuteSQL "BEGIN PK_BUILDAPI.update_daemon_inst( "& parInst_id & ", " &_
547
                                                                        parOp_code & ", " &_
547
                                                                        parOp_code & ", " &_
548
                                                                        parRtag_id & ", " &_
548
                                                                        parRtag_id & ", " &_
549
                                                                        parPv_id & ", " &_
549
                                                                        parPv_id & ", " &_
550
                                                                        ScheduledDateTime & ", " &_
550
                                                                        ScheduledDateTime & ", " &_
551
                                                                        CStr(RepeatSeconds) & ", " &_
551
                                                                        CStr(RepeatSeconds) & ", " &_
552
                                                                        ORA_SYSDATETIME & ", " &_
552
                                                                        ORA_SYSDATETIME & ", " &_
553
                                                                        objAccessControl.UserId & "); END;"
553
                                                                        objAccessControl.UserId & "); END;"
554
         objEH.CatchORA ( OraSession )
554
         objEH.CatchORA ( OraSession )
555
 
555
 
556
         If objEH.Finally Then
556
         If objEH.Finally Then
557
            If parRfile = "admin_daemon_instructions.asp" Then
557
            If parRfile = "admin_daemon_instructions.asp" Then
558
               Call OpenInParentWindow (parRfile & "?sort=" & parSortOrder)
558
               Call OpenInParentWindow (parRfile & "?sort=" & parSortOrder)
559
            Else
559
            Else
560
               Call OpenInParentWindow (parRfile & "?rtag_id=" & parRtag_id & "&pv_id=" & parPv_id)
560
               Call OpenInParentWindow (parRfile & "?rtag_id=" & parRtag_id & "&pv_id=" & parPv_id)
561
            End If
561
            End If
562
            Call CloseWindow()
562
            Call CloseWindow()
563
         End If
563
         End If
564
      Else ' We are adding a new record
564
      Else ' We are adding a new record
565
         objEH.TryORA ( OraSession )
565
         objEH.TryORA ( OraSession )
566
         On Error Resume Next
566
         On Error Resume Next
567
 
567
 
568
         OraDatabase.ExecuteSQL "BEGIN PK_BUILDAPI.insert_daemon_inst( "& parOp_code & ", " &_
568
         OraDatabase.ExecuteSQL "BEGIN PK_BUILDAPI.insert_daemon_inst( "& parOp_code & ", " &_
569
                                                                        parRtag_id & ", " &_
569
                                                                        parRtag_id & ", " &_
570
                                                                        parPv_id & ", " &_
570
                                                                        parPv_id & ", " &_
571
                                                                        ScheduledDateTime & ", " &_
571
                                                                        ScheduledDateTime & ", " &_
572
                                                                        CStr(RepeatSeconds) & ", " &_
572
                                                                        CStr(RepeatSeconds) & ", " &_
573
                                                                        ORA_SYSDATETIME & ", " &_
573
                                                                        ORA_SYSDATETIME & ", " &_
574
                                                                        objAccessControl.UserId & "); END;"
574
                                                                        objAccessControl.UserId & "); END;"
575
         objEH.CatchORA ( OraSession )
575
         objEH.CatchORA ( OraSession )
576
         If objEH.Finally Then
576
         If objEH.Finally Then
577
            If parRfile = "admin_daemon_instructions.asp" Then
577
            If parRfile = "admin_daemon_instructions.asp" Then
578
               Call OpenInParentWindow (parRfile & "?sort=" & parSortOrder)
578
               Call OpenInParentWindow (parRfile & "?sort=" & parSortOrder)
579
            Else
579
            Else
580
               Call OpenInParentWindow (parRfile & "?rtag_id=" & parRtag_id & "&pv_id=" & parPv_id)
580
               Call OpenInParentWindow (parRfile & "?rtag_id=" & parRtag_id & "&pv_id=" & parPv_id)
581
            End If
581
            End If
582
            Call CloseWindow()
582
            Call CloseWindow()
583
         End If
583
         End If
584
      End If
584
      End If
585
   End If
585
   End If
586
End If
586
End If
587
 
587
 
588
'----------------------------------------------
588
'----------------------------------------------
589
%>
589
%>
590
<script language="JavaScript" type="text/javascript">
590
<script language="JavaScript" type="text/javascript">
591
<!--
591
<!--
592
 
592
 
593
// This function is designed to be called when a repeat radio button is pressed. It reloads the page with an updated query string
593
// This function is designed to be called when a repeat radio button is pressed. It reloads the page with an updated query string
594
// to reflect the new setting of the radio button set
594
// to reflect the new setting of the radio button set
595
function Refresh_Repeat(newRepeat)
595
function Refresh_Repeat(newRepeat)
596
{
596
{
597
   var s;
597
   var s;
598
   s  = '<%=scriptName%>';
598
   s  = '<%=scriptName%>';
599
   s += '?inst_id=' + document.getElementById('inst_id').value;
599
   s += '?inst_id=' + document.getElementById('inst_id').value;
600
   s += '&op_code=' + document.getElementById('op_code').value;
600
   s += '&op_code=' + document.getElementById('op_code').value;
601
   s += '&proj_id=' + document.getElementById('proj_id').value;
601
   s += '&proj_id=' + document.getElementById('proj_id').value;
602
   s += '&rtag_id=' + document.getElementById('rtag_id').value;
602
   s += '&rtag_id=' + document.getElementById('rtag_id').value;
603
   s += '&pv_id='   + document.getElementById('pv_id').value;
603
   s += '&pv_id='   + document.getElementById('pv_id').value;
604
   s += '&sort='    + document.getElementById('sortOrder').value;
604
   s += '&sort='    + document.getElementById('sortOrder').value;
605
   s += '&sdt='     + document.getElementById('scheduled_time').value;
605
   s += '&sdt='     + document.getElementById('scheduled_time').value;
606
   s += '&repeat='  + newRepeat;
606
   s += '&repeat='  + newRepeat;
607
   s += '&rfile='   + document.getElementById('rfile').value;
607
   s += '&rfile='   + document.getElementById('rfile').value;
608
 
608
 
609
   document.location = s;
609
   document.location = s;
610
}
610
}
611
 
611
 
612
//-->
612
//-->
613
</script>
613
</script>
614
 
614
 
615
<html>
615
<html>
616
   <head>
616
   <head>
617
      <title>Release Manager</title>
617
      <title>Release Manager</title>
618
      <meta HTTP-EQUIV="Pragma" CONTENT="no-cache">
618
      <link rel="shortcut icon" href="<%=FavIcon%>"/>
619
      <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
619
      <meta HTTP-EQUIV="Pragma" CONTENT="no-cache">
620
      <link href="images/release_manager_style.css" rel="stylesheet" type="text/css">
620
      <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
621
      <script language="JavaScript" src="scripts/common.js"></script>
621
      <link href="images/release_manager_style.css" rel="stylesheet" type="text/css">
622
      <script language="JavaScript" src="images/ts_picker.js"></script>
622
      <script language="JavaScript" src="scripts/common.js"></script>
623
   </head>
623
      <script language="JavaScript" src="images/ts_picker.js"></script>
624
 
624
   </head>
625
   <body background="images/bg_bage_0.gif" leftmargin="0" topmargin="0" >
625
 
626
      <table width="100%"  border="0" cellspacing="0" cellpadding="10">
626
   <body background="images/bg_bage_0.gif" leftmargin="0" topmargin="0" >
627
         <tr>
627
      <table width="100%"  border="0" cellspacing="0" cellpadding="10">
628
            <td bgcolor="#FFFFFF" class="body_txt"><span class="body_h1"><img src="icons/i_linkarrow_black.gif" width="11" height="11" align="absmiddle">&nbsp;Add/Update Daemon Instruction</span> <br>
628
         <tr>
629
               Add a new Daemon Instruction or edit an existing Daemon Instruction.
629
            <td bgcolor="#FFFFFF" class="body_txt"><span class="body_h1"><img src="icons/i_linkarrow_black.gif" width="11" height="11" align="absmiddle">&nbsp;Add/Update Daemon Instruction</span> <br>
630
            </td>
630
               Add a new Daemon Instruction or edit an existing Daemon Instruction.
631
         </tr>
631
            </td>
632
 
632
         </tr>
633
 
633
 
634
         <%
634
 
635
         '-- FROM START --------------------------------------------------------------------------------------------------------------
635
         <%
636
         objFormComponent.FormName = "DaemonInstruction"
636
         '-- FROM START --------------------------------------------------------------------------------------------------------------
637
         objFormComponent.Action = ScriptName &_
637
         objFormComponent.FormName = "DaemonInstruction"
638
                                   "?inst_id="& parInst_id &_
638
         objFormComponent.Action = ScriptName &_
639
                                   "&op_code="& parOp_code &_
639
                                   "?inst_id="& parInst_id &_
640
                                   "&proj_id="& parProj_id &_
640
                                   "&op_code="& parOp_code &_
641
                                   "&rtag_id="& parRtag_id &_
641
                                   "&proj_id="& parProj_id &_
642
                                   "&pv_id="&   parPv_id &_
642
                                   "&rtag_id="& parRtag_id &_
643
                                   "&sort="&    parSortOrder &_
643
                                   "&pv_id="&   parPv_id &_
644
                                   "&rfile="& parRfile
644
                                   "&sort="&    parSortOrder &_
645
         objFormComponent.OnSubmit = "ShowProgress();"
645
                                   "&rfile="& parRfile
646
         Call objFormComponent.FormStart()
646
         objFormComponent.OnSubmit = "ShowProgress();"
647
 
647
         Call objFormComponent.FormStart()
648
 
648
 
649
         %>
649
 
650
         <tr>
650
         %>
651
            <td background="images/bg_login.gif">
651
         <tr>
652
               <table width="50%"  border="0" cellspacing="0" cellpadding="0">
652
            <td background="images/bg_login.gif">
653
                  <tr>
653
               <table width="50%"  border="0" cellspacing="0" cellpadding="0">
654
                     <td><%=ProgressBar()%></td>
654
                  <tr>
655
                     <td align="right">
655
                     <td><%=ProgressBar()%></td>
656
                        <%If ReleasesAvailable(parProj_id) AND DaemonsAvailable(parRtag_id) AND NOT bPreventSubmit Then%>
656
                     <td align="right">
657
                           <input name="btn" type="submit" class="form_btn" value="Add/Update">
657
                        <%If ReleasesAvailable(parProj_id) AND DaemonsAvailable(parRtag_id) AND NOT bPreventSubmit Then%>
658
                        <%Else%>
658
                           <input name="btn" type="submit" class="form_btn" value="Add/Update">
659
                           <input name="btn" type="submit" class="form_btn_disabled" value="Add/Update" disabled="disabled" >
659
                        <%Else%>
660
                        <%End If%>
660
                           <input name="btn" type="submit" class="form_btn_disabled" value="Add/Update" disabled="disabled" >
661
 
661
                        <%End If%>
662
                        <input name="btn" type="reset" class="form_btn" value="Cancel" onClick="self.close();">
662
 
663
                     </td>
663
                        <input name="btn" type="reset" class="form_btn" value="Cancel" onClick="self.close();">
664
                  </tr>
664
                     </td>
665
               </table>
665
                  </tr>
666
            </td>
666
               </table>
667
         </tr>
667
            </td>
668
         <tr>
668
         </tr>
669
            <td>
669
         <tr>
670
               <!-- NEW PRODUCT ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
670
            <td>
671
               <%Call Messenger ( sMessage , 3, "100%" )%>
671
               <!-- NEW PRODUCT ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
672
               <!-- MESSAGE +++++++++++++++++++++++++++++++++++++++++++++++++++ -->
672
               <%Call Messenger ( sMessage , 3, "100%" )%>
673
               <!--#include file="messages/_msg_inline.asp"-->
673
               <!-- MESSAGE +++++++++++++++++++++++++++++++++++++++++++++++++++ -->
674
               <table width="100%" border="0">
674
               <!--#include file="messages/_msg_inline.asp"-->
675
                  <tr>
675
               <table width="100%" border="0">
676
                     <td width="1%">
676
                  <tr>
677
                        <%=Get_OpCodes(parOp_code)%>
677
                     <td width="1%">
678
                     </td>
678
                        <%=Get_OpCodes(parOp_code)%>
679
                  </tr>
679
                     </td>
680
                  <tr><td>&nbsp;</td></tr>
680
                  </tr>
681
                  <tr>
681
                  <tr><td>&nbsp;</td></tr>
682
                     <td>
682
                  <tr>
683
                        <div id="SelectProject" style="visibility:visible">
683
                     <td>
684
                           <%=Get_Projects(parProj_id)%>
684
                        <div id="SelectProject" style="visibility:visible">
685
                        </div>
685
                           <%=Get_Projects(parProj_id)%>
686
                     </td>
686
                        </div>
687
                  </tr>
687
                     </td>
688
                  <tr>
688
                  </tr>
689
                     <td>
689
                  <tr>
690
                        <div id="SelectRelease" style="visibility:visible">
690
                     <td>
691
                           <%=Get_Releases(parProj_id, parRtag_id)%>
691
                        <div id="SelectRelease" style="visibility:visible">
692
                        </div>
692
                           <%=Get_Releases(parProj_id, parRtag_id)%>
693
                     </td>
693
                        </div>
694
                  </tr>
694
                     </td>
695
 
695
                  </tr>
696
                  <%If NOT bHidePackages Then%>
696
 
697
                  <tr>
697
                  <%If NOT bHidePackages Then%>
698
                     <td>
698
                  <tr>
699
                        <div id="SelectPackageVersion" style="visibility:visible">
699
                     <td>
700
                           <%=Get_Packages ( parRtag_id, parPv_id, parOp_code )%>
700
                        <div id="SelectPackageVersion" style="visibility:visible">
701
                        </div>
701
                           <%=Get_Packages ( parRtag_id, parPv_id, parOp_code )%>
702
                     </td>
702
                        </div>
703
                  </tr>
703
                     </td>
704
                  <%End If%>
704
                  </tr>
705
 
705
                  <%End If%>
706
                  <tr><td>&nbsp;</td></tr>
706
 
707
                  <tr>
707
                  <tr><td>&nbsp;</td></tr>
708
                     <td>
708
                  <tr>
709
                        <td nowrap>Scheduled Time</td>
709
                     <td>
710
                        <td>
710
                        <td nowrap>Scheduled Time</td>
711
                           <input type="text" id="scheduled_time" name="scheduled_time" size="20" class="form_ivalue" value="<%=parSchDateTime%>">
711
                        <td>
712
                           <a href="javascript:show_calendar('document.DaemonInstruction.scheduled_time', document.DaemonInstruction.scheduled_time.value);">
712
                           <input type="text" id="scheduled_time" name="scheduled_time" size="20" class="form_ivalue" value="<%=parSchDateTime%>">
713
                              <img src="images/cal.gif" width="16" height="16" border="0" alt="Click Here to select the (future) time at which to carry out the instruction">
713
                           <a href="javascript:show_calendar('document.DaemonInstruction.scheduled_time', document.DaemonInstruction.scheduled_time.value);">
714
                           </a>
714
                              <img src="images/cal.gif" width="16" height="16" border="0" alt="Click Here to select the (future) time at which to carry out the instruction">
715
                        </td>
715
                           </a>
716
                     </td>
716
                        </td>
717
                  </tr>
717
                     </td>
718
 
718
                  </tr>
719
                  <%If NOT bHideRepeat Then%>
719
 
720
                     <tr>
720
                  <%If NOT bHideRepeat Then%>
721
                        <td>
721
                     <tr>
722
                           <td>Repeat</td>
722
                        <td>
723
                           <td>
723
                           <td>Repeat</td>
724
                              <input type="radio" name="repeat_inst" id="repeat_inst_no"     value="No"   <%If parRepeat =     "0" Then%>checked<%End If%> onchange='Refresh_Repeat(0)'     >No
724
                           <td>
725
                              <input type="radio" name="repeat_inst" id="repeat_inst_24hrs"  value="24Hrs"<%If parRepeat = "86400" Then%>checked<%End If%> onchange='Refresh_Repeat(86400)' >24 Hrs
725
                              <input type="radio" name="repeat_inst" id="repeat_inst_no"     value="No"   <%If parRepeat =     "0" Then%>checked<%End If%> onchange='Refresh_Repeat(0)'     >No
726
                           </td>
726
                              <input type="radio" name="repeat_inst" id="repeat_inst_24hrs"  value="24Hrs"<%If parRepeat = "86400" Then%>checked<%End If%> onchange='Refresh_Repeat(86400)' >24 Hrs
727
                        </td>
727
                           </td>
728
                     </tr>
728
                        </td>
729
                  <%End If%>
729
                     </tr>
730
 
730
                  <%End If%>
731
                  <tr>
731
 
732
                     <td>
732
                  <tr>
733
                        <input type="hidden" id="inst_id"     name="inst_id"      value="<%=parInst_id%>">
733
                     <td>
734
                        <input type="hidden" id="op_code"     name="op_code"      value="<%=parOp_code%>">
734
                        <input type="hidden" id="inst_id"     name="inst_id"      value="<%=parInst_id%>">
735
                        <input type="hidden" id="proj_id"     name="proj_id"      value="<%=parProj_id%>">
735
                        <input type="hidden" id="op_code"     name="op_code"      value="<%=parOp_code%>">
736
                        <input type="hidden" id="rtag_id"     name="rtag_id"      value="<%=parRtag_id%>">
736
                        <input type="hidden" id="proj_id"     name="proj_id"      value="<%=parProj_id%>">
737
                        <input type="hidden" id="pv_id"       name="pv_id"        value="<%=parPv_id%>">
737
                        <input type="hidden" id="rtag_id"     name="rtag_id"      value="<%=parRtag_id%>">
738
                        <input type="hidden" id="repeat_secs" name="repeat_secs"  value="<%=parRepeat%>">
738
                        <input type="hidden" id="pv_id"       name="pv_id"        value="<%=parPv_id%>">
739
                        <input type="hidden" id="rfile"       name="rfile"        value="<%=parRfile%>">
739
                        <input type="hidden" id="repeat_secs" name="repeat_secs"  value="<%=parRepeat%>">
740
                        <input type="hidden" id="sortOrder"   name="sortOrder"    value="<%=parSortOrder%>">
740
                        <input type="hidden" id="rfile"       name="rfile"        value="<%=parRfile%>">
741
                     </td>
741
                        <input type="hidden" id="sortOrder"   name="sortOrder"    value="<%=parSortOrder%>">
742
                  </tr>
742
                     </td>
743
               </table>
743
                  </tr>
744
            </td>
744
               </table>
745
         </tr>
745
            </td>
746
         <%=objPMod.ComposeHiddenTags()%>
746
         </tr>
747
         <input type="hidden" name="action" value="true">
747
         <%=objPMod.ComposeHiddenTags()%>
748
 
748
         <input type="hidden" name="action" value="true">
749
         <%
749
 
750
         Call objFormComponent.FormEnd()
750
         <%
751
         '-- FROM END ----------------------------------------------------------------------------------------------------------------
751
         Call objFormComponent.FormEnd()
752
         %>
752
         '-- FROM END ----------------------------------------------------------------------------------------------------------------
753
      </table>
753
         %>
754
   </body>
754
      </table>
755
</html>
755
   </body>
756
<%
756
</html>
757
'------------ RUN AFTER PAGE RENDER -----------
757
<%
758
Set objFormCollector = Nothing
758
'------------ RUN AFTER PAGE RENDER -----------
759
'----------------------------------------------
759
Set objFormCollector = Nothing
760
Call Destroy_All_Objects
760
'----------------------------------------------
761
%>
761
Call Destroy_All_Objects
762
 
762
%>
763
 
763
 
-
 
764