Subversion Repositories DevTools

Rev

Rev 6676 | Rev 7288 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

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