Subversion Repositories DevTools

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
147 ghuddy 1
<%@LANGUAGE="VBSCRIPT"%>
2
<%
3
'=====================================================
4
'|                                                   |
5
'|               wAddDaemonInstruction               |
6
'|                                                   |
7
'=====================================================
8
%>
9
<%
10
Option explicit
11
Response.Expires = 0
12
%>
13
<!--#include file="common/conf.asp"-->
14
<!--#include file="common/globals.asp"-->
15
<!--#include file="common/formating.asp"-->
16
<!--#include file="common/qstr.asp"-->
17
<!--#include file="common/common_subs.asp"-->
18
<!--#include file="common/_form_window_common.asp"-->
19
<!--#include file="common/daemon_instructions.asp"-->
20
<%
21
'------------ ACCESS CONTROL ------------------
22
%>
23
<!--#include file="_access_control_general.asp"-->
24
<!--#include file="_access_control_login.asp"-->
25
<%
26
'------------ VARIABLE DEFINITION -------------
27
Dim rsQry
28
Dim sMessage
29
Dim Query_String
30
Dim parProj_id
31
Dim parPv_id
32
Dim parOp_code
33
Dim parRepeat
34
Dim parInst_id
35
Dim parSchDateTime
36
Dim parRfile
37
Dim bHideRepeat
38
'------------ CONSTANTS DECLARATION -----------
39
 
40
 
41
'------------ VARIABLE INIT -------------------
42
sMessage = NULL
43
 
44
// collect all parameters from query string
45
parOp_code = Request("op_code")
46
parProj_id = Request("proj_id")
47
parPv_id = Request("pv_id")
48
parRepeat = Request("repeat")
49
parInst_id = Request("inst_id")
50
parSchDateTime = Request("sdt")
51
parRfile = Request("rfile")
52
 
53
Set objFormCollector = CreateObject("Scripting.Dictionary")
54
 
55
' assume Repeat radio button is going to be visible
56
bHideRepeat = False
57
 
58
'------------ CONDITIONS ----------------------
59
'----------------------------------------------
60
%>
61
<%
62
'------------------------------------------------------------------------------------------------------------------------------------------
63
' For the specified project ID, get a list of all that project's releases that are not closed/archived.
64
' Return True if at least one release was found, else False
65
'------------------------------------------------------------------------------------------------------------------------------------------
66
Function ReleasesAvailable(NNproj_id)
67
   Dim rsTemp, Query_String
68
 
69
   ReleasesAvailable = True
70
   Query_String = "SELECT rtag_id, rtag_name "&_
71
                  "  FROM release_tags rt"&_
72
                  " WHERE rt.proj_id = "& NNproj_id &_
73
                  "   AND ((rt.official = 'N') OR (rt.official = 'C') OR (rt.official = 'R'))"
74
 
75
	Set rsTemp = OraDatabase.DbCreateDynaset( Query_String, cint(0))
76
   If rsTemp.RecordCount = 0 Then
77
      ReleasesAvailable = False
78
   End If
79
 
80
   rsTemp.Close
81
   Set rsTemp = nothing
82
End Function
83
'------------------------------------------------------------------------------------------------------------------------------------------
84
' For the specified Release, get a list of all that release's daemon configurations.
85
' Return True if at least one daemon configuration was found, else False
86
'------------------------------------------------------------------------------------------------------------------------------------------
87
Function DaemonsAvailable(NNrtag_id)
88
   Dim rsTemp, Query_String
89
 
90
   DaemonsAvailable = True
91
   Query_String = "SELECT * "&_
92
                  "  FROM release_config rc"&_
93
                  " WHERE rc.rtag_id = "& NNrtag_id
94
	Set rsTemp = OraDatabase.DbCreateDynaset( Query_String, cint(0))
95
   If rsTemp.RecordCount = 0 Then
96
      DaemonsAvailable = False
97
   End If
98
 
99
   rsTemp.Close
100
   Set rsTemp = nothing
101
End Function
102
'------------------------------------------------------------------------------------------------------------------------------------------
103
' 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
105
' in the list.
106
'------------------------------------------------------------------------------------------------------------------------------------------
107
Function Get_OpCodes ( NNop_code )
108
   Dim op_code_array
109
   Dim op_code
110
   Dim op_code_id
111
	Dim selectedFound
112
   Dim tempLINK
113
   Dim s
114
 
115
   selectedFound = false
116
 
117
   op_code_array = array(OP_CODE_0_STR)   ' add new strings in here when new instruction constants are defined in conf.asp
118
 
119
   s = "<td width='6%' 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)"">"
121
 
122
   op_code_id  = 0
123
   For each op_code in op_code_array
124
 
125
      tempLINK = scriptName & "?inst_id="& parInst_id &_
126
                              "&op_code="& Cstr(op_code_id) &_
127
                              "&rtag_id=" & parRtag_id &_
128
                              "&pv_id=" & parPv_id &_
129
                              "&sdt="& parSchDateTime &_
130
                              "&repeat="& parRepeat &_
131
                              "&rfile="& parRfile
132
 
133
      If ((NNop_code = cstr(op_code_id)) OR (NNop_code = "0")) AND (selectedFound = False) Then
134
         s = s + "<option value='"& tempLINK &"' selected>"& op_code &"</option>"
135
         selectedFound = True
136
         NNop_code = op_code_id
137
      Else
138
         s = s + "<option value='"& tempLINK &"'>"& op_code &"</option>"
139
      End If
140
 
141
      op_code_id = op_code_id + 1
142
   Next
143
 
144
   ' TODO - what if selectedFound is still FALSE, shouldn't we fixup NNop_code to something ?
145
 
146
   s = s + "</select></td>"
147
   Get_OpCodes = s
148
End Function
149
'------------------------------------------------------------------------------------------------------------------------------------------
150
' Formulate the HTML for a combo box listing all the Projects, and select the one that matches
151
' the proj-id passed in as a parameter. If the parameter value could not be found, correct it to the first valid proj-id
152
' in the list.
153
'------------------------------------------------------------------------------------------------------------------------------------------
154
Function Get_Projects ( NNproj_id )
155
   Dim rsTemp, Query_String, projName, tempLINK, selectedFound, s
156
 
157
   selectedFound = False
158
   Query_String = "SELECT * FROM projects ORDER BY  UPPER( proj_name )"
159
 
160
   Set rsTemp = OraDatabase.DbCreateDynaset( Query_String, cint(0))
161
 
162
   s = "<td>Project</td>"
163
   s = s + "<td><select id='proj_id_list' name='proj_id_list' class='form_item' onChange=""MM_jumpMenu('parent',this,0)"">"
164
 
165
   While ((NOT rsTemp.BOF) AND (NOT rsTemp.EOF))
166
      projName = UCase(rsTemp.Fields("proj_name"))
167
 
168
      tempLINK = scriptName & "?inst_id="& parInst_id &_
169
                              "&op_code="& parOp_code &_
170
                              "&proj_id=" & rsTemp.Fields("proj_id") &_
171
                              "&sdt="& parSchDateTime &_
172
                              "&repeat="& parRepeat &_
173
                              "&rfile="& parRfile
174
 
175
      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>"
177
         selectedFound = True
178
         NNproj_id = CStr(rsTemp.Fields("proj_id"))
179
      Else
180
         s = s + "<option value='"& tempLINK &"'>"& projName &"</option>"
181
      End If
182
 
183
      rsTemp.MoveNext
184
   WEnd
185
   s = s + "</select>"
186
 
187
   ' Correct for a situation where selectedFound is still FALSE.
188
   If NOT selectedFound Then
189
      rsTemp.MoveFirst
190
      If ((NOT rsTemp.BOF) AND (NOT rsTemp.EOF)) Then
191
         NNproj_id = CStr(rsTemp.Fields("proj_id"))
192
      Else
193
         NNproj_id = "0"
194
      End If
195
   End If
196
 
197
   rsTemp.Close
198
   Set rsTemp = nothing
199
 
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>"
205
 
206
   Get_Projects = s
207
End Function
208
 
209
'------------------------------------------------------------------------------------------------------------------------------------------
210
' 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
212
' in the list.
213
'------------------------------------------------------------------------------------------------------------------------------------------
214
Function Get_Releases ( NNproj_id, NNrtag_id )
215
   Dim rsTemp, Query_String, releaseName, tempLINK, selectedFound, s
216
 
217
   selectedFound = False
218
   Query_String = "SELECT rtag_id, rtag_name "&_
219
                  "  FROM release_tags rt"&_
220
                  " WHERE rt.proj_id = "& NNproj_id &_
221
                  "   AND ((rt.official = 'N') OR (rt.official = 'C') OR (rt.official = 'R'))"&_
222
                  " ORDER BY UPPER(rtag_name)"
223
	Set rsTemp = OraDatabase.DbCreateDynaset( Query_String, cint(0))
224
 
225
   s = "<td>Release</td>"
226
   s = s + "<td><select id='rtag_id_list' name='rtag_id_list' class='form_item' onChange=""MM_jumpMenu('parent',this,0)"">"
227
 
228
   While ((NOT rsTemp.BOF) AND (NOT rsTemp.EOF))
229
      releaseName = rsTemp.Fields("rtag_name")
230
 
231
      tempLINK = scriptName & "?inst_id="& parInst_id &_
232
                              "&op_code="& parOp_code &_
233
                              "&proj_id="& NNproj_id &_
234
                              "&rtag_id="& rsTemp.Fields("rtag_id") &_
235
                              "&sdt="& parSchDateTime &_
236
                              "&repeat="& parRepeat &_
237
                              "&rfile="& parRfile
238
 
239
      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>"
241
         selectedFound = True
242
         NNrtag_id = Cstr(rsTemp.Fields("rtag_id"))
243
      Else
244
         s = s + "<option value='"& tempLINK &"'>"& releaseName &"</option>"
245
      End If
246
 
247
      rsTemp.MoveNext
248
   WEnd
249
   s = s + "</select>"
250
 
251
   ' Correct for a situation where selectedFound is still FALSE.
252
   If NOT selectedFound Then
253
      rsTemp.MoveFirst
254
      If ((NOT rsTemp.BOF) AND (NOT rsTemp.EOF)) Then
255
         NNrtag_id = CStr(rsTemp.Fields("rtag_id"))
256
      Else
257
         NNrtag_id = "0"
258
      End If
259
   End If
260
 
261
   rsTemp.Close
262
   Set rsTemp = nothing
263
 
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>"
269
 
270
   Get_Releases = s
271
End Function
272
'------------------------------------------------------------------------------------------------------------------------------------------
273
' 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
275
' in the list.
276
'------------------------------------------------------------------------------------------------------------------------------------------
277
Function Get_Packages ( NNrtag_id, NNpv_id )
278
   Dim rsTemp, Query_String, pkgName, tempLINK, selectedFound, s
279
 
280
   selectedFound = False
281
   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 "&_
283
                  " WHERE rc.rtag_id = "& Cstr(NNrtag_id) &_
284
                  "   AND rc.rtag_id = rt.rtag_id"&_
285
                  "   AND ((rt.official = 'N') OR (rt.official = 'C') OR (rt.official = 'R'))"&_
286
                  "   AND rc.pv_id = pv.pv_id"&_
287
                  "   AND pk.pkg_id = pv.pkg_id"&_
288
                  " ORDER BY UPPER(pkg_name)"
289
 
290
	Set rsTemp = OraDatabase.DbCreateDynaset( Query_String, cint(0))
291
 
292
   s = "<td>Package</td>"
293
   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))
295
      pkgName = rsTemp.Fields("pkg_name") & " " & rsTemp.Fields("pkg_version")
296
 
297
      tempLINK = scriptName & "?inst_id="& parInst_id &_
298
                              "&op_code="& parOp_code &_
299
                              "&proj_id="& parProj_id &_
300
                              "&rtag_id="& NNrtag_id &_
301
                              "&pv_id="&   rsTemp.Fields("pv_id") &_
302
                              "&sdt="& parSchDateTime &_
303
                              "&repeat="& parRepeat &_
304
                              "&rfile="& parRfile
305
 
306
      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>"
308
         selectedFound = True
309
         NNpv_id = CStr(rsTemp.Fields("pv_id"))
310
      Else
311
         s = s + "<option value='"& tempLINK &"'>"& pkgName &"</option>"
312
      End If
313
 
314
      rsTemp.MoveNext
315
   WEnd
316
   s = s + "</select></td>"
317
 
318
   ' Correct for a situation where selectedFound is still FALSE.
319
   If NOT selectedFound Then
320
      rsTemp.MoveFirst
321
      If ((NOT rsTemp.BOF) AND (NOT rsTemp.EOF)) Then
322
         NNpv_id = Cstr(rsTemp.Fields("pv_id"))
323
      Else
324
         NNpv_id = "0"
325
      End If
326
   End If
327
 
328
   rsTemp.Close
329
   Set rsTemp = nothing
330
 
331
   Get_Packages = s
332
End Function
333
 
334
'------------------------------------------------------------------------------------------------------------------------------------------
335
' This function will be called if and only if the form is first opened in circumstances where the user is editing an existing record
336
' 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
337
' and the relevant parameters assigned from the record fields
338
'------------------------------------------------------------------------------------------------------------------------------------------
339
Sub Get_All_Params_From_Inst_Id(NNInstId)
340
   Dim rsTemp, Query_String
341
 
342
   Query_String = "SELECT op_code, rtag_id, pv_id, repeat_secs, "&_
343
                  "  TO_CHAR(scheduled_datetime, 'DD-MM-YYYY HH24:MI:SS') AS schedDate "&_
344
                  "  FROM DAEMON_INSTRUCTIONS "&_
345
                  " WHERE DAEMON_INSTRUCTIONS_ID = " & NNInstId
346
	Set rsTemp = OraDatabase.DbCreateDynaset( Query_String, cint(0))
347
   If rstemp.RecordCount = 0 Then
348
      Call RaiseMsg(enum_MSG_ERROR, "Attempt to Edit a non-existent record")
349
   End If
350
 
351
   ' assign record fields to global parameters
352
   parOp_code = rsTemp("op_code")
353
   parRtag_id = rsTemp("rtag_id")
354
   parPv_id   = rsTemp("pv_id")
355
   parRepeat  = rsTemp("repeat_secs")
356
   parSchDateTime = rsTemp("schedDate")
357
 
358
   ' derive project id since that is not stored in the table
359
   If NOT IsNull(parRtag_id) AND parRtag_id <> "" Then
360
      parProj_id = Get_Proj_ID(parRtag_id)
361
   Else
362
      parProj_id = "0"
363
   End If
364
 
365
   rsTemp.Close
366
   Set rsTemp = nothing
367
End Sub
368
'------------------------------------------------------------------------------------------------------------------------------------------
369
%>
370
<%
371
'------------ RUN BEFORE PAGE RENDER ----------
372
 
373
' Are we in edit mode? If so, populate all parameters from the record being edited
374
If (NOT IsNull(parInst_id)) AND (parInst_id <> "") AND (Request("edit") = "true") Then
375
   If NOT DaemonInstructionInProgress(Request("inst_id")) Then
376
      Call Get_All_Params_From_Inst_Id(parInst_id)
377
   Else
378
      CloseWindow   ' close the form we were opening
379
      ' redirect to an error message in the parent form
380
      Call RaiseMsgInParent(enum_MSG_ERROR, "Cannot edit an instruction that is currently being processed by a Daemon")
381
   End If
382
End If
383
 
384
' Make sure we dont have any null strings or empty strings for our parameters
385
If IsNull(parOp_code) OR parOp_code = "" Then
386
   parOp_code = "0"
387
End If
388
If IsNull(parProj_id) OR parProj_id = "" Then
389
   parProj_id = "0"
390
End If
391
If IsNull(parRtag_id) OR parRtag_id = "" Then
392
   parRtag_id = "0"
393
End If
394
If IsNull(parPv_id) OR parPv_id = "" Then
395
   parPv_id = "0"
396
End If
397
If IsNull(parRepeat) OR parRepeat = "" Then
398
   parRepeat = "0"
399
End If
400
If IsNull(parRfile) OR parRfile = "" Then
401
   parRfile = "admin_daemon_instructions.asp"
402
End If
403
 
404
If IsNull(parSchDateTime) OR parSchDateTime = "" Then
405
   parSchDateTime = EuroDateTimeForCalendarControl(Now())
406
End If
407
 
408
' If this form is opened with an OP_CODE, RTAG_ID and PV_ID only, then we need to derive the PROJ_ID before
409
' 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
411
   parProj_id = Get_Proj_ID(parRtag_id)
412
End If
413
 
414
' Clear pv_id if the Daemon Instruction does not require one
415
If parOp_code <> OP_CODE_0_RIPPLE_BUILD_PACKAGE Then
416
   parPv_id = "0"
417
End If
418
 
419
' Hide the Repeat buttons if the Daemon Instruction does not require them
420
If parOp_code = OP_CODE_0_RIPPLE_BUILD_PACKAGE Then
421
   bHideRepeat = True
422
End If
423
 
424
' 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
426
' 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
428
' 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
430
' when the edit form was just opened.
431
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
433
 
434
' PV_IDs are only relevant for certain op-codes
435
If parOp_code = OP_CODE_0_RIPPLE_BUILD_PACKAGE Then
436
   Call Get_Packages (parRtag_id, parPv_id )
437
End If
438
 
439
' Check if form submit is happening
440
If CBool(Request("action")) Then
441
 
442
   Dim RepeatSeconds
443
   Dim ScheduledDateTime
444
   Dim bEditEnabled
445
   Dim ReleaseMode
446
 
447
   ' determine if insert/update is enabled by permissions
448
   bEditEnabled = True
449
   ReleaseMode = GetReleaseMode(parRtag_id)
450
   If NOT objAccessControl.IsDataActive ("PROJECTS", parProj_id, "EditProjects") OR NOT objAccessControl.IsDataVisible ("PROJECTS", parProj_id, "EditProjects")  Then
451
      bEditEnabled = False
452
   ElseIf NOT objAccessControl.IsDataActive ("PROJECTS", parProj_id, enumDB_PERMISSION_TYPE_ACTIVE) Then
453
      bEditEnabled = False
454
   ElseIf ( ReleaseMode <> enumDB_RELEASE_IN_OPEN_MODE ) Then
455
      If NOT objAccessControl.IsActive("ApproveForAutoBuild") Then
456
         bEditEnabled = False
457
      End If
458
   End If
459
 
460
   If NOT bEditEnabled Then
461
      ' 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.")
463
   End If
464
 
465
   ' Setup the repeat seconds count according to the radio button value
466
   If IsNull(Request("repeat_inst")) OR Request("repeat_inst") = "" OR Request("repeat_inst") = "No" Then
467
      RepeatSeconds = 0
468
   Else
469
      RepeatSeconds = 86400
470
   End If
471
 
472
   ' If user has not entered a scheduled time, set the scheduled date/time to now
473
   ScheduledDateTime = Request("scheduled_time")
474
   If IsNull(ScheduledDateTime) OR ScheduledDateTime = "" Then
475
      ScheduledDateTime = ORA_SYSDATETIME
476
   Else
477
      ScheduledDateTime = "TO_DATE( '"& ScheduledDateTime &"','DD-MM-YYYY HH24:MI:SS' )"
478
   End If
479
 
480
   If parOp_code <> OP_CODE_0_RIPPLE_BUILD_PACKAGE Then
481
      parPv_id = "NULL"
482
   End If
483
 
484
   ' if the page has been provided an inst_id, we must be editing an existing record so we do an update
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
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()
507
      End If
508
   Else ' We are adding a new record
509
      objEH.TryORA ( OraSession )
510
      On Error Resume Next
511
 
512
      OraDatabase.ExecuteSQL "BEGIN PK_BUILDAPI.insert_daemon_inst( "& parOp_code & ", " &_
513
                                                                       parRtag_id & ", " &_
514
                                                                       parPv_id & ", " &_
515
                                                                       ScheduledDateTime & ", " &_
516
                                                                       CStr(RepeatSeconds) & ", " &_
517
                                                                       ORA_SYSDATETIME & ", " &_
518
                                                                       objAccessControl.UserId & "); END;"
519
      objEH.CatchORA ( OraSession )
520
      If objEH.Finally Then
521
         If parRfile = "admin_daemon_instructions.asp" Then
522
            Call OpenInParentWindow (parRfile)
523
         Else
524
            Call OpenInParentWindow (parRfile & "?rtag_id=" & parRtag_id & "&pv_id=" & parPv_id)
525
         End If
526
         Call CloseWindow()
527
      End If
528
   End If
529
End If
530
 
531
'----------------------------------------------
532
%>
533
<script language="JavaScript" type="text/javascript">
534
<!--
535
 
536
// This function is designed to be called when a repeat radio button is pressed. It reloads the page with an updated query string
537
// to reflect the new setting of the radio button set
538
function Refresh_Repeat(newRepeat)
539
{
540
   var s;
541
   s  = '<%=scriptName%>';
542
   s += '?inst_id=' + document.getElementById('inst_id').value;
543
   s += '&op_code=' + document.getElementById('op_code').value;
544
   s += '&proj_id=' + document.getElementById('proj_id').value;
545
   s += '&rtag_id=' + document.getElementById('rtag_id').value;
546
   s += '&pv_id='   + document.getElementById('pv_id').value;
547
   s += '&sdt='     + document.getElementById('scheduled_time').value;
548
   s += '&repeat='  + newRepeat;
549
   s += '&rfile='   + document.getElementById('rfile').value;
550
 
551
   document.location = s;
552
}
553
 
554
//-->
555
</script>
556
 
557
<html>
558
   <head>
559
      <title>Release Manager</title>
560
      <meta HTTP-EQUIV="Pragma" CONTENT="no-cache">
561
      <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
562
      <link href="images/release_manager_style.css" rel="stylesheet" type="text/css">
563
      <script language="JavaScript" src="scripts/common.js"></script>
564
      <script language="JavaScript" src="images/ts_picker.js"></script>
565
   </head>
566
 
567
   <body background="images/bg_bage_0.gif" leftmargin="0" topmargin="0" >
568
      <table width="100%"  border="0" cellspacing="0" cellpadding="10">
569
         <tr>
570
            <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>
571
               Add a new Daemon Instruction or edit an existing Daemon Instruction.
572
            </td>
573
         </tr>
574
 
575
 
576
         <%
577
         '-- FROM START --------------------------------------------------------------------------------------------------------------
578
         objFormComponent.FormName = "DaemonInstruction"
579
         objFormComponent.Action = ScriptName &_
580
                                   "?inst_id="& parInst_id &_
581
                                   "&op_code="& parOp_code &_
582
                                   "&proj_id="& parProj_id &_
583
                                   "&rtag_id="& parRtag_id &_
584
                                   "&pv_id="&   parPv_id &_
585
                                   "&rfile="& parRfile
586
         objFormComponent.OnSubmit = "ShowProgress();"
587
         Call objFormComponent.FormStart()
588
 
589
 
590
         %>
591
         <tr>
592
            <td background="images/bg_login.gif">
593
               <table width="50%"  border="0" cellspacing="0" cellpadding="0">
594
                  <tr>
595
                     <td><%=ProgressBar()%></td>
596
                     <td align="right">
597
                        <%If ReleasesAvailable(parProj_id) AND DaemonsAvailable(parRtag_id) Then%>
598
                           <input name="btn" type="submit" class="form_btn" value="Add/Update">
599
                        <%Else%>
600
                           <input name="btn" type="submit" class="form_btn_disabled" value="Add/Update D" disabled="disabled" >
601
                        <%End If%>
602
 
603
                        <input name="btn" type="reset" class="form_btn" value="Cancel" onClick="self.close();">
604
                     </td>
605
                  </tr>
606
               </table>
607
            </td>
608
         </tr>
609
         <tr>
610
            <td>
611
               <!-- NEW PRODUCT ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
612
               <%Call Messenger ( sMessage , 3, "100%" )%>
613
               <!-- MESSAGE +++++++++++++++++++++++++++++++++++++++++++++++++++ -->
614
               <!--#include file="messages/_msg_inline.asp"-->
615
               <table width="100%" border="0">
616
 
617
                  <tr>
618
                     <td width="1%">
619
                        <%=Get_OpCodes(parOp_code)%>
620
                     </td>
621
                  </tr>
622
                  <tr><td>&nbsp;</td></tr>
623
                  <tr>
624
                     <td>
625
                        <div id="SelectProject" style="visibility:visible">
626
                           <%=Get_Projects(parProj_id)%>
627
                        </div>
628
                     </td>
629
                  </tr>
630
                  <tr>
631
                     <td>
632
                        <div id="SelectRelease" style="visibility:visible">
633
                           <%=Get_Releases(parProj_id, parRtag_id)%>
634
                        </div>
635
                     </td>
636
                  </tr>
637
 
638
                  <%If parOp_code = "0" Then%>
639
                  <tr>
640
                     <td>
641
                        <div id="SelectPackageVersion" style="visibility:visible">
642
                           <%=Get_Packages ( parRtag_id, parPv_id )%>
643
                        </div>
644
                     </td>
645
                  </tr>
646
                  <%End If%>
647
 
648
                  <tr><td>&nbsp;</td></tr>
649
                  <tr>
650
                     <td>
651
                        <td nowrap>Scheduled Time</td>
652
                        <td>
653
                           <input type="text" id="scheduled_time" name="scheduled_time" size="20" class="form_ivalue" value="<%=parSchDateTime%>">
654
                           <a href="javascript:show_calendar('document.DaemonInstruction.scheduled_time', document.DaemonInstruction.scheduled_time.value);">
655
                              <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">
656
                           </a>
657
                        </td>
658
                     </td>
659
                  </tr>
660
 
661
                  <%If NOT bHideRepeat Then%>
662
                     <tr>
663
                        <td>
664
                           <td>Repeat</td>
665
                           <td>
666
                              <input type="radio" name="repeat_inst" id="repeat_inst_no"     value="No"   <%If parRepeat =     "0" Then%>checked<%End If%> onchange='Refresh_Repeat(0)'     >No
667
                              <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
668
                           </td>
669
                        </td>
670
                     </tr>
671
                  <%End If%>
672
 
673
                  <tr>
674
                     <td>
675
                        <input type="hidden" id="inst_id"     name="inst_id"      value="<%=parInst_id%>">
676
                        <input type="hidden" id="op_code"     name="op_code"      value="<%=parOp_code%>">
677
                        <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%>">
679
                        <input type="hidden" id="pv_id"       name="pv_id"        value="<%=parPv_id%>">
680
                        <input type="hidden" id="repeat_secs" name="repeat_secs"  value="<%=parRepeat%>">
681
                        <input type="hidden" id="rfile"       name="rfile"        value="<%=parRfile%>">
682
                     </td>
683
                  </tr>
684
               </table>
685
            </td>
686
         </tr>
687
         <%=objPMod.ComposeHiddenTags()%>
688
         <input type="hidden" name="action" value="true">
689
 
690
         <%
691
         Call objFormComponent.FormEnd()
692
         '-- FROM END ----------------------------------------------------------------------------------------------------------------
693
         %>
694
      </table>
695
   </body>
696
</html>
697
<%
698
'------------ RUN AFTER PAGE RENDER -----------
699
Set objFormCollector = Nothing
700
'----------------------------------------------
701
Call Destroy_All_Objects
702
%>
703
 
704