| 5357 |
dpurdie |
1 |
<%@LANGUAGE="VBSCRIPT"%>
|
|
|
2 |
<%
|
|
|
3 |
Option explicit
|
|
|
4 |
Response.Expires = 0 ' always load the page, dont store
|
|
|
5 |
%>
|
|
|
6 |
<%
|
|
|
7 |
'=====================================================
|
|
|
8 |
' Import Release
|
|
|
9 |
'=====================================================
|
|
|
10 |
%>
|
|
|
11 |
<!--#include file="common/conf.asp"-->
|
|
|
12 |
<!--#include file="common/globals.asp"-->
|
|
|
13 |
<!--#include file="common/qstr.asp"-->
|
|
|
14 |
<!--#include file="common/common_subs.asp"-->
|
|
|
15 |
<!--#include file="common/common_dbedit.asp"-->
|
|
|
16 |
<!--#include file="common/_popup_window_common.asp"-->
|
|
|
17 |
<%
|
|
|
18 |
'------------ ACCESS CONTROL ------------------
|
|
|
19 |
%>
|
|
|
20 |
<!--#include file="_access_control_login.asp"-->
|
|
|
21 |
<!--#include file="_access_control_general.asp"-->
|
|
|
22 |
<!--#include file="_access_control_project.asp"-->
|
|
|
23 |
<%
|
|
|
24 |
'------------ Variable Definition -------------
|
|
|
25 |
Dim parFRrtag_id ' Current Release
|
|
|
26 |
Dim parFRproj_id ' Selected Project
|
|
|
27 |
Dim hasDaemons ' Current Release Has daemons configured
|
|
|
28 |
Dim importHasDaemons ' Selected Import has daemons configured
|
| 5590 |
dpurdie |
29 |
Dim sMessage, sMessageType
|
|
|
30 |
Dim bCanImport
|
|
|
31 |
Dim bReleaseSelected
|
| 5357 |
dpurdie |
32 |
'------------ Constants Declaration -----------
|
|
|
33 |
'------------ Variable Init -------------------
|
|
|
34 |
parFRrtag_id = QStrPar("FRrtag_id")
|
|
|
35 |
parFRproj_id = QStrPar("FRproj_id")
|
| 5590 |
dpurdie |
36 |
sMessage = NULL
|
|
|
37 |
sMessageType = 3
|
|
|
38 |
bCanImport = TRUE
|
| 5357 |
dpurdie |
39 |
If parFRproj_id = "" Then parFRproj_id = -1
|
| 5590 |
dpurdie |
40 |
If parFRrtag_id = "" Then parFRrtag_id = -1
|
| 5357 |
dpurdie |
41 |
'----------------------------------------------
|
|
|
42 |
%>
|
|
|
43 |
<%
|
| 5590 |
dpurdie |
44 |
'------------------------------------------------------------------------------------------------------------------------------------------
|
|
|
45 |
'
|
|
|
46 |
' Add a line of text to the System Message
|
|
|
47 |
'
|
|
|
48 |
Sub sMessageAdd(eLevel, text)
|
|
|
49 |
If NOT isNull(sMessage) Then
|
|
|
50 |
sMessage = sMessage & "<br>"
|
|
|
51 |
End If
|
|
|
52 |
sMessage = sMessage & text
|
|
|
53 |
|
|
|
54 |
If eLevel < sMessageType Then
|
|
|
55 |
sMessageType = eLevel
|
|
|
56 |
End If
|
|
|
57 |
End Sub
|
| 5357 |
dpurdie |
58 |
'--------------------------------------------------------------------------------------------------------------------------
|
|
|
59 |
Sub Get_ProjectList ( nProjId )
|
|
|
60 |
Dim rsQry,tempLINK
|
|
|
61 |
|
|
|
62 |
OraDatabase.Parameters.Add "PROJ_ID", nProjId, ORAPARM_INPUT, ORATYPE_NUMBER
|
|
|
63 |
|
|
|
64 |
Set rsQry = OraDatabase.DbCreateDynaset( GetQuery("ProjectsCombo.sql"), ORADYN_DEFAULT )
|
|
|
65 |
|
|
|
66 |
If NOT ((NOT rsQry.BOF) AND (NOT rsQry.EOF) ) Then
|
|
|
67 |
If (nProjId > 0) Then
|
| 5590 |
dpurdie |
68 |
Response.write "No Projects found"
|
| 5357 |
dpurdie |
69 |
End If
|
| 5590 |
dpurdie |
70 |
Else
|
|
|
71 |
Response.write "<select name='FRproj_id' onChange=""MM_jumpMenu('window',this,0)"" class='form_item'>"
|
|
|
72 |
Response.write "<option value=''>Select Project</option>"
|
|
|
73 |
While ((NOT rsQry.BOF) AND (NOT rsQry.EOF))
|
|
|
74 |
tempLINK = scriptName &"?FRproj_id="& rsQry.Fields("proj_id") & "&"& objPMod.ComposeURL()
|
|
|
75 |
Response.write "<option value='"& tempLINK &"'" &rsQry.Fields("SELECTED") &">"& (rsQry.Fields("proj_name")) &"</option>"
|
|
|
76 |
rsQry.MoveNext
|
|
|
77 |
WEnd
|
|
|
78 |
Response.write "</select>"
|
|
|
79 |
|
|
|
80 |
OraDatabase.Parameters.Remove "PROJ_ID"
|
|
|
81 |
rsQry.Close
|
|
|
82 |
Set rsQry = Nothing
|
| 5357 |
dpurdie |
83 |
End If
|
|
|
84 |
End Sub
|
|
|
85 |
|
|
|
86 |
'--------------------------------------------------------------------------------------------------------------------------
|
|
|
87 |
Sub Get_ReleaseList ( nProjId, nRtagId )
|
|
|
88 |
Dim rsQry,tempLINK
|
|
|
89 |
|
|
|
90 |
OraDatabase.Parameters.Add "PROJ_ID", nProjId, ORAPARM_INPUT, ORATYPE_NUMBER
|
|
|
91 |
OraDatabase.Parameters.Add "RTAG_ID", nRtagId, ORAPARM_INPUT, ORATYPE_NUMBER
|
|
|
92 |
|
|
|
93 |
Set rsQry = OraDatabase.DbCreateDynaset( GetQuery("ReleasesCombo.sql"), ORADYN_DEFAULT )
|
|
|
94 |
|
| 5590 |
dpurdie |
95 |
bReleaseSelected = FALSE
|
| 5357 |
dpurdie |
96 |
If NOT ((NOT rsQry.BOF) AND (NOT rsQry.EOF) ) Then
|
|
|
97 |
If (nProjId > 0) Then
|
| 5590 |
dpurdie |
98 |
Response.write "No Releases in this project"
|
| 5357 |
dpurdie |
99 |
End If
|
| 5590 |
dpurdie |
100 |
Else
|
|
|
101 |
Response.write "<select name='FRrtag_id' onChange=""MM_jumpMenu('window',this,0)"" class='form_item'>"
|
|
|
102 |
Response.write "<option value=''>Select Release</option>"
|
|
|
103 |
While ((NOT rsQry.BOF) AND (NOT rsQry.EOF))
|
|
|
104 |
tempLINK = scriptName & "?FRproj_id="& nProjId &"&FRrtag_id="& rsQry.Fields("rtag_id") & "&"& objPMod.ComposeURL()
|
|
|
105 |
Response.write "<option value='"& tempLINK &"'" &rsQry.Fields("SELECTED") &">"& (rsQry.Fields("rtag_name")) &"</option>"
|
|
|
106 |
|
|
|
107 |
If rsQry.Fields("SELECTED") <> "" Then
|
|
|
108 |
bReleaseSelected = TRUE
|
|
|
109 |
End If
|
|
|
110 |
rsQry.MoveNext
|
|
|
111 |
WEnd
|
|
|
112 |
Response.write "</select>"
|
|
|
113 |
|
|
|
114 |
OraDatabase.Parameters.Remove "RTAG_ID"
|
|
|
115 |
OraDatabase.Parameters.Remove "PROJ_ID"
|
|
|
116 |
|
|
|
117 |
rsQry.Close
|
|
|
118 |
Set rsQry = Nothing
|
| 5357 |
dpurdie |
119 |
End If
|
|
|
120 |
End Sub
|
|
|
121 |
|
|
|
122 |
'--------------------------------------------------------------------------------------------------------------------------
|
|
|
123 |
Function check_for_daemons(nRtagId, DefVal)
|
|
|
124 |
Dim sqlStr, rsQry
|
|
|
125 |
If nRtagId <> "" Then
|
|
|
126 |
sqlStr = "SELECT RCON_ID from RELEASE_CONFIG rc WHERE rc.rtag_id = :RTAG_ID"
|
|
|
127 |
OraDatabase.Parameters.Add "RTAG_ID", nRtagId, ORAPARM_INPUT, ORATYPE_NUMBER
|
|
|
128 |
|
|
|
129 |
Set rsQry = OraDatabase.DbCreateDynaset( sqlStr, ORADYN_DEFAULT )
|
|
|
130 |
|
|
|
131 |
If rsQry.BOF OR rsQry.EOF Then
|
|
|
132 |
check_for_daemons = False
|
|
|
133 |
Else
|
|
|
134 |
check_for_daemons = True
|
|
|
135 |
End If
|
|
|
136 |
|
|
|
137 |
OraDatabase.Parameters.Remove "RTAG_ID"
|
|
|
138 |
|
|
|
139 |
rsQry.Close
|
|
|
140 |
Set rsQry = Nothing
|
|
|
141 |
Else
|
|
|
142 |
check_for_daemons = DefVal
|
|
|
143 |
End If
|
|
|
144 |
|
|
|
145 |
End Function
|
|
|
146 |
'--------------------------------------------------------------------------------------------------------------------------
|
|
|
147 |
Sub importDaemons( NSrcRtag_id, NDstRtag_id)
|
|
|
148 |
If (NSrcRtag_id <> "") AND (NDstRtag_id <> "") Then
|
|
|
149 |
' All mandatory parameters FOUND
|
|
|
150 |
' COMPLETE THE REQUEST...
|
|
|
151 |
|
|
|
152 |
On Error Resume Next
|
|
|
153 |
objEH.ErrorRedirect = TRUE
|
|
|
154 |
|
|
|
155 |
OraDatabase.Parameters.Add "FROMRTAG_ID", NSrcRtag_id, ORAPARM_INPUT, ORATYPE_NUMBER
|
|
|
156 |
OraDatabase.Parameters.Add "TORTAG_ID", NDstRtag_id, ORAPARM_INPUT, ORATYPE_NUMBER
|
|
|
157 |
OraDatabase.Parameters.Add "USER_ID", objAccessControl.UserId, ORAPARM_INPUT, ORATYPE_NUMBER
|
|
|
158 |
|
|
|
159 |
|
|
|
160 |
objEH.TryORA ( OraSession )
|
|
|
161 |
|
|
|
162 |
' Remove old Work in Progress Contents
|
|
|
163 |
OraDatabase.ExecuteSQL "BEGIN PK_BUILDAPI.IMPORT_DAEMONS (:FROMRTAG_ID, :TORTAG_ID, :USER_ID); END;"
|
|
|
164 |
|
|
|
165 |
objEH.CatchORA ( OraSession )
|
|
|
166 |
|
|
|
167 |
OraDatabase.Parameters.Remove "FROMRTAG_ID"
|
|
|
168 |
OraDatabase.Parameters.Remove "TORTAG_ID"
|
|
|
169 |
OraDatabase.Parameters.Remove "USER_ID"
|
|
|
170 |
|
|
|
171 |
|
|
|
172 |
If objEH.Finally Then
|
| 5590 |
dpurdie |
173 |
OpenInParentWindow("build_status.asp?rtag_id="& NDstRtag_id )
|
| 5957 |
dpurdie |
174 |
Call Destroy_All_Objects
|
| 5590 |
dpurdie |
175 |
Response.End
|
| 5357 |
dpurdie |
176 |
End If
|
|
|
177 |
|
|
|
178 |
Else
|
| 5590 |
dpurdie |
179 |
Call sMessageAdd( 1, "Internal: Some mandatory parameters are missing!<br>" & QSTR_FullQuery )
|
|
|
180 |
parFRproj_id = -1
|
|
|
181 |
parFRrtag_id = -1
|
| 5357 |
dpurdie |
182 |
End If
|
|
|
183 |
End Sub
|
|
|
184 |
'--------------------------------------------------------------------------------------------------------------------------
|
|
|
185 |
%>
|
|
|
186 |
<%
|
|
|
187 |
'Process submition
|
|
|
188 |
If CBool(QStrPar("action")) Then
|
|
|
189 |
Call importDaemons(Request.Form("FromRtag_id"),Request("rtag_id"))
|
|
|
190 |
End If
|
|
|
191 |
|
|
|
192 |
' Run before render
|
|
|
193 |
hasDaemons = check_for_daemons(Request("rtag_id"), False)
|
|
|
194 |
importHasDaemons = check_for_daemons(parFRrtag_id, True)
|
| 5590 |
dpurdie |
195 |
|
|
|
196 |
If hasDaemons Then
|
|
|
197 |
Call sMessageAdd( 2, "The current release already has build daemons configured. It is not possible to import a daemon configuration into this release.")
|
|
|
198 |
bCanImport = FALSE
|
|
|
199 |
ElseIf NOT importHasDaemons AND (parFRrtag_id > 0) Then
|
|
|
200 |
Call sMessageAdd(2, "No Daemons in this Release to be imported")
|
|
|
201 |
bCanImport = FALSE
|
|
|
202 |
End If
|
| 5357 |
dpurdie |
203 |
%>
|
|
|
204 |
<html>
|
|
|
205 |
<head>
|
|
|
206 |
<title>Release Manager</title>
|
|
|
207 |
<link rel="shortcut icon" href="<%=FavIcon%>"/>
|
|
|
208 |
<meta HTTP-EQUIV="Pragma" CONTENT="no-cache">
|
|
|
209 |
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
|
|
|
210 |
<link rel="stylesheet" href="images/release_manager_style.css" type="text/css">
|
|
|
211 |
<link rel="stylesheet" href="images/navigation.css" type="text/css">
|
|
|
212 |
<script language="JavaScript" src="images/common.js"></script>
|
|
|
213 |
</head>
|
|
|
214 |
<body bgcolor="#FFFFFF" text="#000000" leftmargin="0" topmargin="0" onload="self.focus();">
|
| 5590 |
dpurdie |
215 |
<form class="form_tight" name="importrel" method="post" action="<%=scriptName%>">
|
|
|
216 |
<table width="100%" border="0" cellspacing="0" cellpadding="2">
|
| 5357 |
dpurdie |
217 |
<tr>
|
|
|
218 |
<td valign="top" nowrap colspan="3" class="wform_ttl" background="images/bg_form_lightgray.gif">
|
| 5590 |
dpurdie |
219 |
<!-- LOCAL MESSAGES ++++++++++++++++++++++++++++++++++++++++++++ -->
|
|
|
220 |
<%Call Messenger ( sMessage , 3, "100%" )%>
|
|
|
221 |
<!-- MESSAGE +++++++++++++++++++++++++++++++++++++++++++++++++++ -->
|
|
|
222 |
<!--#include file="messages/_msg_inline.asp"-->
|
|
|
223 |
<table width="100%" border="0" cellspacing="1" cellpadding="2">
|
| 5357 |
dpurdie |
224 |
<tr>
|
| 5590 |
dpurdie |
225 |
<td width="100%" class="form_txt" colspan="2">
|
| 5357 |
dpurdie |
226 |
</td>
|
|
|
227 |
</tr>
|
|
|
228 |
<tr>
|
|
|
229 |
<td width="1%" nowrap class="form_field" background="images/bg_form_lightbluedark.gif">Project</td>
|
|
|
230 |
<td nowrap width="100%" background="images/bg_form_lightbluedark.gif" class="form_txt">
|
|
|
231 |
<%Call Get_ProjectList ( parFRproj_id )%>
|
|
|
232 |
</td>
|
|
|
233 |
</tr>
|
|
|
234 |
<tr>
|
|
|
235 |
<td width="1%" nowrap class="form_field" background="images/bg_form_lightbluedark.gif">Release</td>
|
|
|
236 |
<td nowrap width="100%" background="images/bg_form_lightbluedark.gif" class="form_txt">
|
|
|
237 |
<%Call Get_ReleaseList ( parFRproj_id, parFRrtag_id )%>
|
|
|
238 |
<input type="hidden" name="rtag_id" value="<%=Request("rtag_id")%>">
|
|
|
239 |
<input type="hidden" name="FromRtag_id" value="<%=parFRrtag_id%>">
|
|
|
240 |
<input type="hidden" name="action" value="true">
|
|
|
241 |
</td>
|
|
|
242 |
</tr>
|
|
|
243 |
<tr>
|
| 5590 |
dpurdie |
244 |
<td width="100%" class="form_txt" colspan="2">
|
| 5357 |
dpurdie |
245 |
<p>Import the build daemon configuration from another release.
|
|
|
246 |
</p>
|
|
|
247 |
</td>
|
|
|
248 |
</tr>
|
|
|
249 |
</table>
|
|
|
250 |
</td>
|
|
|
251 |
</tr>
|
|
|
252 |
<tr>
|
| 5590 |
dpurdie |
253 |
<td><%=ProgressBar()%></td>
|
|
|
254 |
<td align="right">
|
|
|
255 |
<%If bCanImport AND bReleaseSelected Then %>
|
|
|
256 |
<input type="submit" name="btn" value="Import" class="form_btn_comp" onClick="MM_validateForm('FRproj_id','Project','R','FRrtag_id','Release','R');return document.MM_returnValue">
|
|
|
257 |
<%Else%>
|
|
|
258 |
<input type="submit" name="btn" value="Import" class="form_btn_comp_disabled" >
|
|
|
259 |
<%End If%>
|
|
|
260 |
<input type="reset" name="btn" value="Cancel" class="form_btn_comp" onclick="parent.closeIFrame();">
|
|
|
261 |
</td>
|
| 5357 |
dpurdie |
262 |
</tr>
|
|
|
263 |
</table>
|
|
|
264 |
</form>
|
|
|
265 |
</body>
|
|
|
266 |
</html>
|
|
|
267 |
<!-- DESTRUCTOR ------->
|
| 4307 |
dpurdie |
268 |
<!--#include file="common/destructor.asp"-->
|