| 119 |
ghuddy |
1 |
<%
|
|
|
2 |
'=====================================================
|
| 129 |
ghuddy |
3 |
' COMMON SUBs Part 1
|
| 119 |
ghuddy |
4 |
'=====================================================
|
| 5098 |
dpurdie |
5 |
Const haveCommonSubs = 1
|
| 119 |
ghuddy |
6 |
%>
|
|
|
7 |
<%
|
|
|
8 |
'-----------------------------------------------------------------------------------------------------------------------------
|
|
|
9 |
Sub CloseWindow
|
|
|
10 |
%>
|
|
|
11 |
<SCRIPT language="JavaScript" type="text/javascript">
|
|
|
12 |
<!--
|
|
|
13 |
self.close();
|
|
|
14 |
//-->
|
|
|
15 |
</SCRIPT>
|
|
|
16 |
<%
|
| 5957 |
dpurdie |
17 |
Call Destroy_All_Objects
|
| 5590 |
dpurdie |
18 |
Response.End
|
| 119 |
ghuddy |
19 |
End Sub
|
|
|
20 |
'-----------------------------------------------------------------------------------------------------------------------------
|
|
|
21 |
Sub OpenChildWindow ( SStitle, SSurl, SSH, SSW, BBscroll )
|
| 129 |
ghuddy |
22 |
Dim scrlBar
|
|
|
23 |
If BBscroll Then
|
|
|
24 |
scrlBar = "yes"
|
|
|
25 |
Else
|
|
|
26 |
scrlBar = "no"
|
|
|
27 |
End If
|
| 119 |
ghuddy |
28 |
%>
|
| 129 |
ghuddy |
29 |
<script language="JavaScript" type="text/javascript">
|
|
|
30 |
<!--
|
|
|
31 |
window.open('<%=SSurl%>','<%=SStitle%>','scrollbars=<%=scrlBar%>,resizable=yes,width=<%=SSW%>,height=<%=SSH%>')
|
|
|
32 |
//-->
|
|
|
33 |
</script>
|
| 119 |
ghuddy |
34 |
<%
|
|
|
35 |
End Sub
|
|
|
36 |
'-----------------------------------------------------------------------------------------------------------------------------
|
| 5590 |
dpurdie |
37 |
' Iframes do not have a window.opener
|
| 119 |
ghuddy |
38 |
Sub OpenInParentWindow ( SSurl )
|
|
|
39 |
%>
|
| 129 |
ghuddy |
40 |
<script language="JavaScript" type="text/javascript">
|
|
|
41 |
<!--
|
| 5590 |
dpurdie |
42 |
if (window.opener) {
|
|
|
43 |
window.opener.document.location='<%=SSurl%>';
|
|
|
44 |
} else {
|
|
|
45 |
window.parent.location.href='<%=SSurl%>';
|
|
|
46 |
}
|
| 129 |
ghuddy |
47 |
//-->
|
|
|
48 |
</script>
|
| 119 |
ghuddy |
49 |
<%
|
|
|
50 |
End Sub
|
|
|
51 |
'-----------------------------------------------------------------------------------------------------------------------------
|
| 5590 |
dpurdie |
52 |
' Iframes do not have a window.opener
|
|
|
53 |
Sub ReloadParentWindow ()
|
| 5549 |
dpurdie |
54 |
%>
|
|
|
55 |
<script language="JavaScript" type="text/javascript">
|
|
|
56 |
<!--
|
| 5590 |
dpurdie |
57 |
if (window.opener) {
|
|
|
58 |
window.opener.location.reload(false);
|
|
|
59 |
} else {
|
|
|
60 |
window.parent.location.reload(false);
|
|
|
61 |
}
|
| 5549 |
dpurdie |
62 |
//-->
|
|
|
63 |
</script>
|
|
|
64 |
<%
|
|
|
65 |
End Sub
|
|
|
66 |
'-----------------------------------------------------------------------------------------------------------------------------
|
| 119 |
ghuddy |
67 |
Sub OpenInWindow ( SSurl )
|
| 5957 |
dpurdie |
68 |
Call Destroy_All_Objects
|
| 129 |
ghuddy |
69 |
Response.Redirect ( SSurl )
|
| 119 |
ghuddy |
70 |
End Sub
|
|
|
71 |
'-----------------------------------------------------------------------------------------------------------------------------
|
|
|
72 |
Function GetQuery ( sQryName )
|
| 129 |
ghuddy |
73 |
GetQuery = ReadFile( QUERIES_PATH &"\"& sQryName )
|
| 119 |
ghuddy |
74 |
End Function
|
|
|
75 |
'-----------------------------------------------------------------------------------------------------------------------------
|
|
|
76 |
Sub RaiseMsg ( SSerrFile, SSerrDesc )
|
| 129 |
ghuddy |
77 |
' Usage: enumERROR, parval1 &"|"& parval2 &"|"& parval3 ...
|
|
|
78 |
Session( enum_RELMGR_ERRDESCRIPTION ) = SSerrDesc
|
| 5957 |
dpurdie |
79 |
Call Destroy_All_Objects
|
| 129 |
ghuddy |
80 |
Response.Redirect ("messages/"& SSerrFile )
|
| 119 |
ghuddy |
81 |
End Sub
|
|
|
82 |
'-----------------------------------------------------------------------------------------------------------------------------
|
|
|
83 |
Sub RaiseMsgInParent ( SSerrFile, SSerrDesc )
|
| 129 |
ghuddy |
84 |
Session( enum_RELMGR_ERRDESCRIPTION ) = SSerrDesc
|
|
|
85 |
Call OpenInParentWindow ("messages/"& SSerrFile )
|
| 119 |
ghuddy |
86 |
End Sub
|
|
|
87 |
'-----------------------------------------------------------------------------------------------------------------------------
|
|
|
88 |
Function ReadFile( SSpath )
|
| 129 |
ghuddy |
89 |
Dim filesys, rfile
|
|
|
90 |
Set filesys = CreateObject("Scripting.FileSystemObject")
|
|
|
91 |
Set rfile = filesys.OpenTextFile( SSpath, 1, false)
|
|
|
92 |
ReadFile = rfile.ReadAll
|
|
|
93 |
rfile.close
|
|
|
94 |
Set filesys = nothing
|
| 119 |
ghuddy |
95 |
End Function
|
|
|
96 |
'-----------------------------------------------------------------------------------------------------------------------------
|
|
|
97 |
Function HighlightSubstring ( SSstr, SSsubstr )
|
| 129 |
ghuddy |
98 |
Dim leftSTR, startPos
|
|
|
99 |
startPos = InStr( 1, SSstr, SSsubstr, 1 )
|
| 119 |
ghuddy |
100 |
|
| 129 |
ghuddy |
101 |
If startPos > 0 Then
|
|
|
102 |
leftSTR = Left ( SSstr, startPos - 1 )
|
|
|
103 |
HighlightSubstring = leftSTR &"<SPAN style='background:#ffff99;'>"& Mid( SSstr, startPos, Len(SSsubstr) ) &"</SPAN>"& Right ( SSstr, Len(SSstr) - Len(leftSTR) - Len(SSsubstr) )
|
|
|
104 |
Else
|
|
|
105 |
' Subtring not found
|
|
|
106 |
HighlightSubstring = SSstr
|
|
|
107 |
End If
|
| 119 |
ghuddy |
108 |
|
|
|
109 |
End Function
|
|
|
110 |
'-----------------------------------------------------------------------------------------------------------------------------
|
|
|
111 |
Sub DeleteFile( SSpath )
|
| 129 |
ghuddy |
112 |
Dim filesys
|
|
|
113 |
Set filesys = CreateObject("Scripting.FileSystemObject")
|
|
|
114 |
If filesys.FileExists(SSpath) Then
|
|
|
115 |
filesys.DeleteFile SSpath, TRUE
|
|
|
116 |
End If
|
|
|
117 |
Set filesys = nothing
|
| 119 |
ghuddy |
118 |
End Sub
|
|
|
119 |
'-----------------------------------------------------------------------------------------------------------------------------
|
|
|
120 |
Sub DeleteFolder( SSpath )
|
| 129 |
ghuddy |
121 |
Dim filesys
|
|
|
122 |
Set filesys = CreateObject ("Scripting.FileSystemObject")
|
|
|
123 |
If filesys.FolderExists( SSpath ) Then
|
|
|
124 |
'Set oFolder = filesys.GetFolder( SSpath )
|
|
|
125 |
filesys.DeleteFolder SSpath ,TRUE
|
|
|
126 |
End If
|
| 119 |
ghuddy |
127 |
End Sub
|
|
|
128 |
'-----------------------------------------------------------------------------------------------------------------------------
|
|
|
129 |
Sub Create_Folder ( sCreateIn, sFolderName )
|
| 129 |
ghuddy |
130 |
Dim filesys, currfolder, folcoll, subfol
|
|
|
131 |
Set filesys = CreateObject("Scripting.FileSystemObject")
|
|
|
132 |
If filesys.FolderExists( sCreateIn ) Then
|
|
|
133 |
Set currfolder = filesys.GetFolder( sCreateIn )
|
|
|
134 |
Set folcoll = currfolder.SubFolders
|
|
|
135 |
If NOT filesys.FolderExists( sCreateIn &"\"& sFolderName ) Then
|
|
|
136 |
folcoll.Add( sFolderName )
|
|
|
137 |
End If
|
|
|
138 |
End If
|
| 119 |
ghuddy |
139 |
End Sub
|
|
|
140 |
'-----------------------------------------------------------------------------------------------------------------------------
|
|
|
141 |
Function Folder_Is_Empty ( sPath )
|
| 129 |
ghuddy |
142 |
Dim filesys, oFolder
|
|
|
143 |
Set filesys = CreateObject("Scripting.FileSystemObject")
|
| 119 |
ghuddy |
144 |
|
| 129 |
ghuddy |
145 |
If filesys.FolderExists( sPath ) Then
|
|
|
146 |
Set oFolder = filesys.GetFolder( sPath )
|
|
|
147 |
If ( oFolder.Files.Count + oFolder.SubFolders.Count ) > 0 Then
|
|
|
148 |
Folder_Is_Empty = FALSE
|
|
|
149 |
Else
|
|
|
150 |
Folder_Is_Empty = TRUE
|
|
|
151 |
End If
|
|
|
152 |
Else
|
|
|
153 |
Folder_Is_Empty = TRUE
|
|
|
154 |
End If
|
| 119 |
ghuddy |
155 |
|
|
|
156 |
End Function
|
|
|
157 |
'-----------------------------------------------------------------------------------------------------------------------------
|
|
|
158 |
Function InStrPipes ( SSstr, SSsubstr )
|
| 129 |
ghuddy |
159 |
If InStr( SSstr, "|"& SSsubstr &"|") > 0 Then
|
|
|
160 |
InStrPipes = true
|
|
|
161 |
Else
|
|
|
162 |
InStrPipes = false
|
|
|
163 |
End If
|
| 119 |
ghuddy |
164 |
End Function
|
|
|
165 |
'-----------------------------------------------------------------------------------------------------------------------------
|
|
|
166 |
Function RemoveFromStrPipes ( SSstr, SSsubstr )
|
| 129 |
ghuddy |
167 |
RemoveFromStrPipes = Replace( SSstr, "|"& SSsubstr &"|", "" )
|
| 119 |
ghuddy |
168 |
End Function
|
|
|
169 |
'-----------------------------------------------------------------------------------------------------------------------------
|
|
|
170 |
Function View_Name_Exists ( SSviewname, NNused_id )
|
| 129 |
ghuddy |
171 |
Dim rsTemp, Query_String
|
|
|
172 |
Query_String = _
|
|
|
173 |
" SELECT view_name"&_
|
|
|
174 |
" FROM views"&_
|
|
|
175 |
" WHERE UPPER(view_name) = UPPER('"& UCase(SSviewname) &"') AND owner_id = "& NNused_id
|
|
|
176 |
Set rsTemp = OraDatabase.DbCreateDynaset( Query_String, cint(0))
|
|
|
177 |
If rsTemp.RecordCount > 0 Then
|
|
|
178 |
View_Name_Exists = TRUE
|
|
|
179 |
Else
|
|
|
180 |
View_Name_Exists = FALSE
|
|
|
181 |
End If
|
|
|
182 |
rsTemp.Close
|
|
|
183 |
Set rsTemp = nothing
|
| 119 |
ghuddy |
184 |
End Function
|
|
|
185 |
'-----------------------------------------------------------------------------------------------------------------------------
|
|
|
186 |
Function User_Name_Exists ( SSusername )
|
| 129 |
ghuddy |
187 |
Dim rsTemp, Query_String
|
|
|
188 |
Query_String = _
|
|
|
189 |
" SELECT user_name"&_
|
|
|
190 |
" FROM users"&_
|
|
|
191 |
" WHERE user_name = '"& SSusername &"'"
|
|
|
192 |
Set rsTemp = OraDatabase.DbCreateDynaset( Query_String, cint(0))
|
|
|
193 |
If rsTemp.RecordCount > 0 Then
|
|
|
194 |
User_Name_Exists = TRUE
|
|
|
195 |
Else
|
|
|
196 |
User_Name_Exists = FALSE
|
|
|
197 |
End If
|
|
|
198 |
rsTemp.Close
|
|
|
199 |
Set rsTemp = nothing
|
| 119 |
ghuddy |
200 |
End Function
|
|
|
201 |
'-----------------------------------------------------------------------------------------------------------------------------
|
|
|
202 |
Function This_View_Owner( NNview_id, NNuser_id )
|
| 129 |
ghuddy |
203 |
Dim rsTemp, Query_String
|
|
|
204 |
Query_String = _
|
|
|
205 |
" SELECT owner_id"&_
|
|
|
206 |
" FROM views"&_
|
|
|
207 |
" WHERE view_id = "& NNview_id
|
|
|
208 |
Set rsTemp = OraDatabase.DbCreateDynaset( Query_String, cint(0))
|
|
|
209 |
If rsTemp.RecordCount > 0 Then
|
|
|
210 |
If CInt(rsTemp.Fields("owner_id")) = CInt(NNuser_id) Then
|
|
|
211 |
This_View_Owner = TRUE
|
|
|
212 |
Else
|
|
|
213 |
This_View_Owner = FALSE
|
|
|
214 |
End If
|
|
|
215 |
Else
|
|
|
216 |
' view not found
|
| 5357 |
dpurdie |
217 |
Session("AdditionalParams") = "$ADMINEMAIL$,"& ADMIN_EMAIL
|
| 5957 |
dpurdie |
218 |
Call Destroy_All_Objects
|
| 129 |
ghuddy |
219 |
Response.Redirect("message.asp?msg=400-2")
|
|
|
220 |
End If
|
|
|
221 |
rsTemp.Close
|
|
|
222 |
Set rsTemp = nothing
|
| 119 |
ghuddy |
223 |
End Function
|
|
|
224 |
'-----------------------------------------------------------------------------------------------------------------------------
|
|
|
225 |
Function GetReleaseMode ( NNrtag_id )
|
| 5207 |
dpurdie |
226 |
GetReleaseInfo NNrtag_id
|
|
|
227 |
GetReleaseMode = releaseInfoHash("official")
|
|
|
228 |
End Function
|
|
|
229 |
'-----------------------------------------------------------------------------------------------------------------------------
|
| 5251 |
dpurdie |
230 |
' Get basic Release Info on global releaseInfoHash
|
| 5207 |
dpurdie |
231 |
' List of fields may be extended as required (could use *)
|
| 6971 |
dpurdie |
232 |
'
|
|
|
233 |
' Cache the results
|
|
|
234 |
' Largely to simplify a code refactor
|
|
|
235 |
' Data will be read early, but may need to be changed
|
|
|
236 |
'
|
| 5207 |
dpurdie |
237 |
Sub GetReleaseInfo ( NNrtag_id )
|
| 7381 |
dpurdie |
238 |
Dim rsTemp, Query_String, item
|
|
|
239 |
If NNrtag_id = "" Then NNrtag_id = "-1"
|
| 119 |
ghuddy |
240 |
|
| 7381 |
dpurdie |
241 |
' Do we already have the data
|
|
|
242 |
If NOT (releaseInfoHash is Nothing) Then
|
| 6971 |
dpurdie |
243 |
If Cdbl(releaseInfoHash("rtag_id") ) = CDbl(NNrtag_id) Then
|
| 7381 |
dpurdie |
244 |
Exit Sub
|
|
|
245 |
End If
|
| 6971 |
dpurdie |
246 |
End If
|
|
|
247 |
|
| 7380 |
dpurdie |
248 |
' Create with case insensitive keys
|
| 5207 |
dpurdie |
249 |
Set releaseInfoHash = CreateObject("Scripting.Dictionary")
|
| 7380 |
dpurdie |
250 |
releaseInfoHash.CompareMode = VBTextCompare
|
| 5251 |
dpurdie |
251 |
|
| 7381 |
dpurdie |
252 |
' Handle not logged in
|
|
|
253 |
Dim UserId : UserId = -1
|
|
|
254 |
If objAccessControl.UserLogedIn Then UserId = objAccessControl.UserId
|
| 7380 |
dpurdie |
255 |
|
| 7395 |
dpurdie |
256 |
Query_String = "SELECT rt.RTAG_ID ,rt.rtag_name, proj.proj_id, proj.proj_name,rt.lxr, rt.official, NVL(lx.lxrserver, 'N') as lxrserver, NVL(rt.s3Sync, 'N') as s3Sync," &_
|
| 7381 |
dpurdie |
257 |
" CASE when (TRUNC(SYSDATE - rt.created_stamp) <= 20) AND rt.creator_id = "& UserId & " THEN 1 ELSE 0 END as userCanDelete" &_
|
| 7382 |
dpurdie |
258 |
" FROM Release_tags rt, projects proj, lxr_state lx" &_
|
|
|
259 |
" WHERE rt.RTAG_ID = lx.RTAG_ID(+)" &_
|
|
|
260 |
" AND rt.proj_id = proj.proj_id" &_
|
|
|
261 |
" AND rt.RTAG_ID = " & NNrtag_id
|
| 119 |
ghuddy |
262 |
|
| 7381 |
dpurdie |
263 |
Set rsTemp = OraDatabase.DbCreateDynaset( Query_String, cint(0))
|
|
|
264 |
If ((NOT rsTemp.BOF) AND (NOT rsTemp.EOF)) Then
|
|
|
265 |
For Each item In rsTemp.Fields
|
|
|
266 |
'Response.Write("<br><pre> item:" & item.name & ":" & item & "</pre>")
|
|
|
267 |
releaseInfoHash.Add item.name, item.value
|
|
|
268 |
Next
|
|
|
269 |
End If
|
|
|
270 |
|
|
|
271 |
rsTemp.Close
|
|
|
272 |
Set rsTemp = nothing
|
| 5207 |
dpurdie |
273 |
End Sub
|
|
|
274 |
|
| 119 |
ghuddy |
275 |
'-----------------------------------------------------------------------------------------------------------------------------
|
| 5020 |
dpurdie |
276 |
Function Get_Devl_Environment
|
|
|
277 |
If Request.Cookies(COOKIE_RELEASEMANAGER_MEMORY)("devl_environment") <> "" Then
|
|
|
278 |
If Request.Cookies(COOKIE_RELEASEMANAGER_MEMORY)("devl_environment") = "clearcase" Then
|
|
|
279 |
Get_Devl_Environment = "jats" 'clear case does not have import
|
| 129 |
ghuddy |
280 |
Else
|
| 5020 |
dpurdie |
281 |
Get_Devl_Environment = Request.Cookies(COOKIE_RELEASEMANAGER_MEMORY)("devl_environment")
|
| 129 |
ghuddy |
282 |
End If
|
|
|
283 |
Else
|
| 5020 |
dpurdie |
284 |
Get_Devl_Environment = "jats" 'JATS devl enviroment is set by default
|
| 129 |
ghuddy |
285 |
End If
|
| 119 |
ghuddy |
286 |
End Function
|
|
|
287 |
'-----------------------------------------------------------------------------------------------------------------------------
|
|
|
288 |
Function Get_From_DUAL ( SSclm )
|
| 129 |
ghuddy |
289 |
Dim rsTemp, Query_String, OraSession2, OraDatabase2
|
|
|
290 |
Set OraSession2 = CreateObject("OracleInProcServer.XOraSession")
|
|
|
291 |
Set OraDatabase2 = OraSession2.OpenDatabase( TNS_NAME, DB_AUTHENTICATION, Cint(0))
|
| 119 |
ghuddy |
292 |
|
| 129 |
ghuddy |
293 |
Query_String = _
|
|
|
294 |
" SELECT "& SSclm &" AS result FROM DUAL"
|
|
|
295 |
Set rsTemp = OraDatabase2.DbCreateDynaset( Query_String, cint(0))
|
| 119 |
ghuddy |
296 |
|
| 129 |
ghuddy |
297 |
If ((NOT rsTemp.BOF) AND (NOT rsTemp.EOF)) Then
|
|
|
298 |
Get_From_DUAL = (rsTemp.Fields("result"))
|
|
|
299 |
End If
|
| 119 |
ghuddy |
300 |
|
| 129 |
ghuddy |
301 |
rsTemp.Close
|
|
|
302 |
Set rsTemp = nothing
|
|
|
303 |
Set OraDatabase2 = nothing
|
|
|
304 |
Set OraSession2 = nothing
|
| 119 |
ghuddy |
305 |
End Function
|
|
|
306 |
'-----------------------------------------------------------------------------------------------------------------------------
|
| 6694 |
dpurdie |
307 |
' Try to replace usage with : DB_PROJ_ID
|
| 119 |
ghuddy |
308 |
Function Get_Proj_ID ( SSrtag_id )
|
| 129 |
ghuddy |
309 |
Dim rsTemp, Query_String
|
| 119 |
ghuddy |
310 |
|
| 129 |
ghuddy |
311 |
Query_String = _
|
|
|
312 |
" SELECT projects.proj_id"&_
|
|
|
313 |
" FROM projects projects, release_tags rel"&_
|
|
|
314 |
" WHERE projects.proj_id = rel.proj_id"&_
|
|
|
315 |
" AND rel.rtag_id = "& SSrtag_id
|
| 119 |
ghuddy |
316 |
|
| 129 |
ghuddy |
317 |
Set rsTemp = OraDatabase.DbCreateDynaset( Query_String, cint(0))
|
| 119 |
ghuddy |
318 |
|
| 129 |
ghuddy |
319 |
If ((NOT rsTemp.BOF) AND (NOT rsTemp.EOF)) Then
|
|
|
320 |
Get_Proj_ID = (rsTemp.Fields("proj_id"))
|
|
|
321 |
End If
|
| 119 |
ghuddy |
322 |
|
| 129 |
ghuddy |
323 |
rsTemp.Close
|
|
|
324 |
Set rsTemp = nothing
|
| 119 |
ghuddy |
325 |
End Function
|
|
|
326 |
'-----------------------------------------------------------------------------------------------------------------------------
|
| 6694 |
dpurdie |
327 |
' Try to replace usage with : DB_PROJ_NAME
|
| 119 |
ghuddy |
328 |
Function Get_Proj_Name ( NNproj_id )
|
| 129 |
ghuddy |
329 |
Dim rsTemp, Query_String
|
| 119 |
ghuddy |
330 |
|
| 159 |
ghuddy |
331 |
Get_Proj_Name = ""
|
|
|
332 |
|
| 129 |
ghuddy |
333 |
Query_String = _
|
|
|
334 |
" SELECT proj_name "&_
|
|
|
335 |
" FROM projects pr "&_
|
| 119 |
ghuddy |
336 |
" WHERE pr.proj_id = "& NNproj_id
|
|
|
337 |
|
| 129 |
ghuddy |
338 |
Set rsTemp = OraDatabase.DbCreateDynaset( Query_String, cint(0))
|
| 119 |
ghuddy |
339 |
|
| 129 |
ghuddy |
340 |
If ((NOT rsTemp.BOF) AND (NOT rsTemp.EOF)) Then
|
|
|
341 |
Get_Proj_Name = (rsTemp.Fields("proj_name"))
|
|
|
342 |
End If
|
| 119 |
ghuddy |
343 |
|
| 129 |
ghuddy |
344 |
rsTemp.Close
|
|
|
345 |
Set rsTemp = nothing
|
| 119 |
ghuddy |
346 |
End Function
|
|
|
347 |
'-----------------------------------------------------------------------------------------------------------------------------
|
| 159 |
ghuddy |
348 |
Function Get_Release_Name ( NNrtag_id )
|
|
|
349 |
Dim rsTemp, Query_String
|
|
|
350 |
|
|
|
351 |
Get_Release_Name = ""
|
|
|
352 |
|
|
|
353 |
Query_String = _
|
|
|
354 |
" SELECT rtag_name "&_
|
|
|
355 |
" FROM release_tags rt "&_
|
|
|
356 |
" WHERE rt.rtag_id = "& NNrtag_id
|
|
|
357 |
|
|
|
358 |
Set rsTemp = OraDatabase.DbCreateDynaset( Query_String, cint(0))
|
|
|
359 |
|
|
|
360 |
If ((NOT rsTemp.BOF) AND (NOT rsTemp.EOF)) Then
|
|
|
361 |
Get_Release_Name = (rsTemp.Fields("rtag_name"))
|
|
|
362 |
End If
|
|
|
363 |
|
|
|
364 |
rsTemp.Close
|
|
|
365 |
Set rsTemp = nothing
|
|
|
366 |
End Function
|
|
|
367 |
'-----------------------------------------------------------------------------------------------------------------------------
|
| 119 |
ghuddy |
368 |
Function Get_Base_URL ( NNproj_id )
|
| 129 |
ghuddy |
369 |
Dim rsTemp, Query_String
|
| 119 |
ghuddy |
370 |
|
| 129 |
ghuddy |
371 |
Query_String = _
|
|
|
372 |
" SELECT base_url "&_
|
|
|
373 |
" FROM projects pr "&_
|
| 119 |
ghuddy |
374 |
" WHERE pr.proj_id = "& NNproj_id
|
|
|
375 |
|
| 129 |
ghuddy |
376 |
Set rsTemp = OraDatabase.DbCreateDynaset( Query_String, cint(0))
|
| 119 |
ghuddy |
377 |
|
| 129 |
ghuddy |
378 |
Get_Base_URL = rsTemp("base_url")
|
| 119 |
ghuddy |
379 |
|
| 129 |
ghuddy |
380 |
rsTemp.Close()
|
|
|
381 |
Set rsTemp = nothing
|
| 119 |
ghuddy |
382 |
End Function
|
|
|
383 |
'-----------------------------------------------------------------------------------------------------------------------------
|
|
|
384 |
Function Get_Categories ( NNrtag_id )
|
| 129 |
ghuddy |
385 |
Get_Categories = _
|
|
|
386 |
" SELECT vi.view_id, vi.view_name"&_
|
|
|
387 |
" FROM release_content rel,"&_
|
|
|
388 |
" views vi"&_
|
|
|
389 |
" WHERE rel.base_view_id = vi.view_id"&_
|
|
|
390 |
" AND rtag_id = "& NNrtag_id &_
|
|
|
391 |
" GROUP BY vi.view_id, vi.view_name "&_
|
|
|
392 |
" ORDER BY vi.view_name ASC "
|
| 119 |
ghuddy |
393 |
End Function
|
|
|
394 |
'-----------------------------------------------------------------------------------------------------------------------------
|
|
|
395 |
Function Get_PV_IDs_In_Release ( NNrtag_id )
|
|
|
396 |
Dim rsTemp, Query_String, tempSTR
|
| 129 |
ghuddy |
397 |
tempSTR = "-1"
|
|
|
398 |
Query_String = _
|
|
|
399 |
"SELECT pv_id FROM release_content WHERE rtag_id = "& NNrtag_id
|
| 119 |
ghuddy |
400 |
|
| 129 |
ghuddy |
401 |
Set rsTemp = OraDatabase.DbCreateDynaset( Query_String, cint(0))
|
| 119 |
ghuddy |
402 |
|
| 129 |
ghuddy |
403 |
While ((NOT rsTemp.BOF) AND (NOT rsTemp.EOF))
|
|
|
404 |
tempSTR = tempSTR &","& rsTemp.Fields("pv_id")
|
|
|
405 |
rsTemp.MoveNext
|
|
|
406 |
WEnd
|
|
|
407 |
Get_PV_IDs_In_Release = tempSTR
|
|
|
408 |
rsTemp.Close
|
|
|
409 |
Set rsTemp = nothing
|
| 119 |
ghuddy |
410 |
End Function
|
|
|
411 |
'-----------------------------------------------------------------------------------------------------------------------------
|
|
|
412 |
Sub Get_Pkg_Info ( SSpv_id, NNrtag )
|
| 7357 |
dpurdie |
413 |
Dim rsTemp, Query_String, isaRelease, isaValidPvId
|
|
|
414 |
Dim opCodeListString, opCodeList, opCodeStr
|
| 6184 |
dpurdie |
415 |
|
| 7357 |
dpurdie |
416 |
OraDatabase.Parameters.Add "PV_ID", SSpv_id, ORAPARM_INPUT, ORATYPE_NUMBER
|
|
|
417 |
OraDatabase.Parameters.Add "RTAG_ID", NNrtag, ORAPARM_INPUT, ORATYPE_NUMBER
|
|
|
418 |
OraDatabase.Parameters.Add "RETURN_NUMBER", NULL, ORAPARM_OUTPUT, ORATYPE_NUMBER
|
|
|
419 |
OraDatabase.Parameters.Add "OP_CODE_LIST", NULL, ORAPARM_OUTPUT, ORATYPE_VARCHAR2
|
| 119 |
ghuddy |
420 |
|
| 7357 |
dpurdie |
421 |
isaRelease = NOT ((NNrtag = "") or (IsNull(NNrtag)))
|
|
|
422 |
pkgInfoHash.Add "isaRelease", isaRelease
|
| 6176 |
dpurdie |
423 |
|
| 7357 |
dpurdie |
424 |
'-- can_unofficial
|
|
|
425 |
' Limits the ability to unrelease a package version
|
|
|
426 |
pkgInfoHash.Item ("can_unofficial") = "false"
|
| 119 |
ghuddy |
427 |
|
| 7357 |
dpurdie |
428 |
'-- can_edit_in_project
|
|
|
429 |
' Property of the release, the user and the package
|
|
|
430 |
' Limits the ability to add a package to a release
|
|
|
431 |
'
|
|
|
432 |
pkgInfoHash.Item ("can_edit_in_project") = "0"
|
| 119 |
ghuddy |
433 |
|
| 7357 |
dpurdie |
434 |
'-- Get Package Details
|
|
|
435 |
Set rsTemp = OraDatabase.DbCreateDynaset( GetQuery("PackageDetails.sql"), cint(0))
|
|
|
436 |
isaValidPvId = (NOT rsTemp.BOF) AND (NOT rsTemp.EOF)
|
|
|
437 |
pkgInfoHash.Add "isaValidPvId" , isaValidPvId
|
|
|
438 |
|
|
|
439 |
If isaValidPvId Then
|
|
|
440 |
pkgInfoHash.Add "pv_id", (rsTemp.Fields("pv_id"))
|
|
|
441 |
pkgInfoHash.Add "pkg_id", (rsTemp.Fields("pkg_id"))
|
|
|
442 |
pkgInfoHash.Add "pkg_name", (rsTemp.Fields("pkg_name"))
|
|
|
443 |
pkgInfoHash.Add "pkg_version", (rsTemp.Fields("pkg_version"))
|
|
|
444 |
pkgInfoHash.Add "v_ext", (rsTemp.Fields("v_ext"))
|
|
|
445 |
pkgInfoHash.Add "comments", (rsTemp.Fields("comments"))
|
| 119 |
ghuddy |
446 |
|
| 7357 |
dpurdie |
447 |
pkgInfoHash.Add "modified_stamp", (rsTemp.Fields("modified_stamp"))
|
|
|
448 |
pkgInfoHash.Add "modifier", (rsTemp.Fields("modifier"))
|
|
|
449 |
pkgInfoHash.Add "modifier_id", (rsTemp.Fields("modifier_id"))
|
|
|
450 |
pkgInfoHash.Add "modifier_email", (rsTemp.Fields("modifier_email"))
|
| 119 |
ghuddy |
451 |
|
| 7357 |
dpurdie |
452 |
pkgInfoHash.Add "created_stamp", (rsTemp.Fields("created_stamp"))
|
|
|
453 |
pkgInfoHash.Add "creator", (rsTemp.Fields("creator"))
|
|
|
454 |
pkgInfoHash.Add "creator_id", (rsTemp.Fields("creator_id"))
|
|
|
455 |
pkgInfoHash.Add "creator_email", (rsTemp.Fields("creator_email"))
|
| 119 |
ghuddy |
456 |
|
| 7357 |
dpurdie |
457 |
pkgInfoHash.Add "owner", (rsTemp.Fields("owner"))
|
|
|
458 |
pkgInfoHash.Add "owner_id", (rsTemp.Fields("owner_id"))
|
|
|
459 |
pkgInfoHash.Add "owner_email", (rsTemp.Fields("owner_email"))
|
| 119 |
ghuddy |
460 |
|
| 7357 |
dpurdie |
461 |
pkgInfoHash.Add "dlocked", (rsTemp.Fields("dlocked"))
|
| 4687 |
dpurdie |
462 |
|
| 7357 |
dpurdie |
463 |
pkgInfoHash.Add "pkg_label", (rsTemp.Fields("pkg_label"))
|
|
|
464 |
pkgInfoHash.Add "src_path", (rsTemp.Fields("src_path"))
|
|
|
465 |
pkgInfoHash.Add "pv_description", (rsTemp.Fields("pv_description"))
|
|
|
466 |
pkgInfoHash.Add "last_pv_id", (rsTemp.Fields("last_pv_id"))
|
|
|
467 |
pkgInfoHash.Add "previous_version", (rsTemp.Fields("previous_version"))
|
|
|
468 |
pkgInfoHash.Add "release_notes_info", (rsTemp.Fields("release_notes_info"))
|
| 119 |
ghuddy |
469 |
|
| 7357 |
dpurdie |
470 |
pkgInfoHash.Add "is_patch", (rsTemp.Fields("is_patch"))
|
|
|
471 |
pkgInfoHash.Add "is_obsolete", (rsTemp.Fields("is_obsolete"))
|
|
|
472 |
pkgInfoHash.Add "obsolete_comments", (rsTemp.Fields("obsolete_comments"))
|
| 119 |
ghuddy |
473 |
|
| 7357 |
dpurdie |
474 |
pkgInfoHash.Add "build_type", (rsTemp.Fields("build_type"))
|
|
|
475 |
pkgInfoHash.Add "change_type", (rsTemp.Fields("change_type"))
|
|
|
476 |
pkgInfoHash.Add "bs_id", (rsTemp.Fields("bs_id"))
|
|
|
477 |
pkgInfoHash.Add "is_deployable", (rsTemp.Fields("is_deployable"))
|
|
|
478 |
pkgInfoHash.Add "sbom_priority", (rsTemp.Fields("sbom_priority"))
|
|
|
479 |
pkgInfoHash.Add "ripple_field", (rsTemp.Fields("ripple_field"))
|
| 119 |
ghuddy |
480 |
|
| 7357 |
dpurdie |
481 |
If (pkgInfoHash.Item ("dlocked") = "Y") OR pkgInfoHash.Item("build_type") = "M" Then
|
|
|
482 |
pkgInfoHash.Add "isInArchive", testArchiveAccessPkg(pkgInfoHash.Item ("pkg_name"), pkgInfoHash.Item ("pkg_version"))
|
|
|
483 |
End If
|
| 6176 |
dpurdie |
484 |
|
| 7357 |
dpurdie |
485 |
If isaRelease Then
|
|
|
486 |
'-- Find if package is editable in this project
|
|
|
487 |
' Not editable if
|
|
|
488 |
' Imported via a Reference Package
|
|
|
489 |
' Imported via an SDK
|
|
|
490 |
' Release is not in Open or Restricted Mode
|
|
|
491 |
' Project extenstion is project specific - and not within the allowed project
|
|
|
492 |
'
|
|
|
493 |
OraDatabase.ExecuteSQL "BEGIN :RETURN_NUMBER := CAN_EDIT_PKG_IN_PROJECT( :PV_ID, :RTAG_ID ); END;"
|
|
|
494 |
pkgInfoHash.Item ("can_edit_in_project") = CStr( OraDatabase.Parameters("RETURN_NUMBER").Value )
|
| 119 |
ghuddy |
495 |
|
| 7357 |
dpurdie |
496 |
'-- Get Package Release Details
|
|
|
497 |
Set rsTemp = OraDatabase.DbCreateDynaset( GetQuery("PackageReleaseDetails.sql"), cint(0))
|
| 119 |
ghuddy |
498 |
|
| 7357 |
dpurdie |
499 |
If ((NOT rsTemp.BOF) AND (NOT rsTemp.EOF)) Then
|
|
|
500 |
pkgInfoHash.Add "insert_stamp", (rsTemp.Fields("insert_stamp"))
|
|
|
501 |
pkgInfoHash.Add "insertor", (rsTemp.Fields("insertor"))
|
|
|
502 |
pkgInfoHash.Add "insertor_email", (rsTemp.Fields("insertor_email"))
|
|
|
503 |
pkgInfoHash.Add "used_count", (rsTemp.Fields("used_count"))
|
| 119 |
ghuddy |
504 |
|
| 7357 |
dpurdie |
505 |
pkgInfoHash.Item ("base_view_id") = (rsTemp.Fields("base_view_id"))
|
|
|
506 |
pkgInfoHash.Item ("view_name") = (rsTemp.Fields("view_name"))
|
|
|
507 |
pkgInfoHash.Item ("pkg_state") = (rsTemp.Fields("pkg_state"))
|
|
|
508 |
pkgInfoHash.Item ("deprecated_state") = (rsTemp.Fields("deprecated_state"))
|
|
|
509 |
pkgInfoHash.Item ("product_state") = (rsTemp.Fields("product_state"))
|
| 119 |
ghuddy |
510 |
|
| 7357 |
dpurdie |
511 |
pkgInfoHash.Add "proj_id", (rsTemp.Fields("proj_id"))
|
|
|
512 |
pkgInfoHash.Add "rtag_id", (rsTemp.Fields("rtag_id"))
|
|
|
513 |
pkgInfoHash.Add "rtag_name", (rsTemp.Fields("rtag_name"))
|
|
|
514 |
pkgInfoHash.Add "product_state_used", (rsTemp.Fields("product_state_used"))
|
|
|
515 |
pkgInfoHash.Add "sdktag_id", (rsTemp.Fields("sdktag_id"))
|
|
|
516 |
pkgInfoHash.Add "is_sdkpkg", (NOT IsNull(rsTemp.Fields("sdktag_id")))
|
|
|
517 |
pkgInfoHash.Add "is_pegged", (rsTemp.Fields("pegged") <> 0)
|
|
|
518 |
pkgInfoHash.Add "ripple_stop", rsTemp.Fields("ripple_stop")
|
|
|
519 |
pkgInfoHash.Add "persist_ripple_stop", rsTemp.Fields("persist_ripple_stop")
|
|
|
520 |
pkgInfoHash.Add "advisory_ripple", rsTemp.Fields("advisory_ripple") <> 0
|
| 5080 |
dpurdie |
521 |
|
| 7357 |
dpurdie |
522 |
Else
|
|
|
523 |
' -- Package Version is not a released member of the specified release
|
|
|
524 |
' Get Basic Release and Project Details
|
|
|
525 |
Query_String = " select pj.PROJ_ID, rt.RTAG_ID,rt.rtag_name " &_
|
|
|
526 |
" from projects pj, release_tags rt" &_
|
|
|
527 |
" where rt.rtag_id=:RTAG_ID" &_
|
|
|
528 |
" and rt.PROJ_ID = pj.PROJ_ID"
|
|
|
529 |
|
|
|
530 |
Set rsTemp = OraDatabase.DbCreateDynaset( Query_String, cint(0))
|
|
|
531 |
|
|
|
532 |
If ((NOT rsTemp.BOF) AND (NOT rsTemp.EOF)) Then
|
|
|
533 |
pkgInfoHash.Add "proj_id", (rsTemp.Fields("proj_id"))
|
|
|
534 |
pkgInfoHash.Add "rtag_id", (rsTemp.Fields("rtag_id"))
|
|
|
535 |
pkgInfoHash.Add "rtag_name", (rsTemp.Fields("rtag_name"))
|
|
|
536 |
End If
|
| 4764 |
dpurdie |
537 |
|
| 7357 |
dpurdie |
538 |
' -- Determine if package is a member of this release and determine base view
|
|
|
539 |
' May be a WIP or PENDIND or not in the release ( Won't get here if its releases)
|
|
|
540 |
' Mark as Not in Release
|
|
|
541 |
Query_String = "select wip.pv_id, wip.view_id as view_id, vi.view_name, 0 as env_area from work_in_progress wip, views vi where rtag_id=:RTAG_ID and pv_id=:PV_ID and vi.view_id = wip.view_id" &_
|
|
|
542 |
" union" &_
|
|
|
543 |
" select pp.pv_id, pp.view_id as view_id, vi.view_name, 1 as env_area from planned pp, views vi where rtag_id=:RTAG_ID and pv_id=:PV_ID and vi.view_id = pp.view_id" &_
|
|
|
544 |
" union" &_
|
|
|
545 |
" select rc.pv_id, rc.base_view_id as view_id, vi.view_name, 2 as env_area from RELEASE_CONTENT rc, views vi where rtag_id=:RTAG_ID and pv_id=:PV_ID and vi.view_id = rc.base_view_id"
|
|
|
546 |
Set rsTemp = OraDatabase.DbCreateDynaset( Query_String, cint(0))
|
|
|
547 |
If rsTemp.RecordCount < 1 Then
|
|
|
548 |
pkgInfoHash.Item ("notInRelease") = true
|
|
|
549 |
Else
|
|
|
550 |
pkgInfoHash.Item ("base_view_id") = (rsTemp.Fields("view_id"))
|
|
|
551 |
pkgInfoHash.Item ("view_name") = (rsTemp.Fields("view_name"))
|
|
|
552 |
If rsTemp("env_area") = 0 Then pkgInfoHash.Item ("is_wip") = True
|
|
|
553 |
If rsTemp("env_area") = 1 Then pkgInfoHash.Item ("is_pending") = True
|
|
|
554 |
End If
|
| 4764 |
dpurdie |
555 |
|
| 7357 |
dpurdie |
556 |
'
|
|
|
557 |
' -- Determine related package that is in the release
|
|
|
558 |
' Use pkg_id and v_ext to locate package
|
|
|
559 |
If pkgInfoHash.Item ("pkg_id") <> "" Then
|
|
|
560 |
Query_String = "SELECT pv.PV_ID, vi.view_name" &_
|
|
|
561 |
" FROM RELEASE_CONTENT rc, package_versions pv, views vi" &_
|
|
|
562 |
" WHERE rc.rtag_id = :RTAG_ID" &_
|
|
|
563 |
" and rc.PV_ID = pv.pv_id" &_
|
|
|
564 |
" and vi.view_id = rc.base_view_id" &_
|
|
|
565 |
" and pv.pkg_id = " & pkgInfoHash.Item ("pkg_id") &_
|
|
|
566 |
" and NVL(pv.v_ext,'') = NVL('"&pkgInfoHash.Item ("v_ext")&"', '')"
|
|
|
567 |
Set rsTemp = OraDatabase.DbCreateDynaset( Query_String, cint(0))
|
|
|
568 |
If rsTemp.RecordCount > 0 Then
|
|
|
569 |
pkgInfoHash.Item ("pv_id_InRelease") = (rsTemp.Fields("pv_id"))
|
|
|
570 |
'pkgInfoHash.Remove ("base_view_id")
|
|
|
571 |
pkgInfoHash.Item ("release_view_name") = (rsTemp.Fields("view_name"))
|
|
|
572 |
End If
|
|
|
573 |
End If
|
| 7349 |
dpurdie |
574 |
|
| 7357 |
dpurdie |
575 |
End If
|
| 119 |
ghuddy |
576 |
|
| 7357 |
dpurdie |
577 |
' Determine if user can make the the package 'unofficial'
|
|
|
578 |
If (pkgInfoHash.Item ("dlocked") = "Y") _
|
|
|
579 |
AND (pkgInfoHash.Item ("build_type") = "M") _
|
|
|
580 |
AND (CDate( FormatDateTime(pkgInfoHash.Item ("modified_stamp"), 2) ) = Date) _
|
|
|
581 |
AND (pkgInfoHash.Item("can_edit_in_project") = "1" ) _
|
|
|
582 |
Then
|
|
|
583 |
pkgInfoHash.Item ("can_unofficial") = "true"
|
|
|
584 |
End If
|
| 6188 |
dpurdie |
585 |
|
| 7357 |
dpurdie |
586 |
'
|
|
|
587 |
' Determine if there is a deamon instruction on this package in this release
|
|
|
588 |
' Also: OraDatabase.ExecuteSQL "BEGIN :OP_CODE_LIST := PK_BUILDAPI.daemon_ops_for_rtag("& nRtag_id & "); END;"
|
|
|
589 |
objEH.TryORA ( OraSession )
|
|
|
590 |
ON ERROR RESUME NEXT
|
|
|
591 |
OraDatabase.ExecuteSQL "BEGIN :OP_CODE_LIST := PK_BUILDAPI.daemon_ops_for_rtag_pvid(:RTAG_ID,:PV_ID); END;"
|
|
|
592 |
objEH.CatchORA ( OraSession )
|
|
|
593 |
ON ERROR GOTO 0
|
|
|
594 |
opCodeListString = OraDatabase.Parameters("OP_CODE_LIST").Value
|
| 6188 |
dpurdie |
595 |
|
| 7357 |
dpurdie |
596 |
If NOT IsNull(opCodeListString) AND opCodeListString <> "" Then
|
|
|
597 |
opCodeList = Split(opCodeListString, ",")
|
|
|
598 |
For Each opCodeStr In opCodeList
|
|
|
599 |
If opCodeStr = OP_CODE_0_RIPPLE_BUILD_PACKAGE Then
|
|
|
600 |
pkgInfoHash.Add "hasRippleInstr", 1
|
|
|
601 |
End If
|
|
|
602 |
If opCodeStr = OP_CODE_1_TEST_BUILD_PACKAGE Then
|
|
|
603 |
pkgInfoHash.Add "hasTestInstr", 1
|
|
|
604 |
End If
|
|
|
605 |
If opCodeStr = OP_CODE_2_FUTURE_BUILD Then
|
|
|
606 |
pkgInfoHash.Add "hasFutureBuild", 1
|
|
|
607 |
End If
|
|
|
608 |
Next
|
|
|
609 |
End If
|
| 119 |
ghuddy |
610 |
|
| 7357 |
dpurdie |
611 |
Else ' NOT isaRelease
|
|
|
612 |
If pkgInfoHash.Exists ("modified_stamp") Then
|
|
|
613 |
If NOT IsNull(pkgInfoHash.Item ("modified_stamp").Value) Then
|
|
|
614 |
If (CDate( FormatDateTime(pkgInfoHash.Item ("modified_stamp"), 2) ) = Date) Then
|
|
|
615 |
' Must be not older then a day
|
|
|
616 |
If (pkgInfoHash.Item ("dlocked") = "A") OR NOT IsNull(pkgInfoHash.Item("is_patch")) Then
|
|
|
617 |
pkgInfoHash.Item ("can_unofficial") = "true"
|
|
|
618 |
End If
|
|
|
619 |
End If
|
| 5951 |
dpurdie |
620 |
End If
|
| 7357 |
dpurdie |
621 |
End If
|
|
|
622 |
End If ' End isaRelease
|
| 119 |
ghuddy |
623 |
|
| 7357 |
dpurdie |
624 |
'-- Get Patch Parent
|
|
|
625 |
If pkgInfoHash.Item ("is_patch") = "Y" Then
|
|
|
626 |
Set rsTemp = OraDatabase.DbCreateDynaset( GetQuery("PatchParent.sql"), cint(0))
|
| 119 |
ghuddy |
627 |
|
| 7357 |
dpurdie |
628 |
If ((NOT rsTemp.BOF) AND (NOT rsTemp.EOF)) Then
|
|
|
629 |
pkgInfoHash.Add "patch_parent_id", (rsTemp.Fields("pv_id"))
|
|
|
630 |
End If
|
|
|
631 |
End If
|
| 119 |
ghuddy |
632 |
|
| 7357 |
dpurdie |
633 |
' DEVI-45275 - Check if version is in the planned table and if so get its planned operation type
|
|
|
634 |
' which denotes whether it is an existing version being added to a release, an existing version
|
|
|
635 |
' being removed from a release, or a new version being prepared for a release.
|
|
|
636 |
Set rsTemp = OraDatabase.DbCreateDynaset( GetQuery("PlannedPackageVersionDetails.sql"), cint(0))
|
| 119 |
ghuddy |
637 |
|
| 7357 |
dpurdie |
638 |
If ((NOT rsTemp.BOF) AND (NOT rsTemp.EOF)) Then
|
|
|
639 |
pkgInfoHash.Add "planned_operation", (rsTemp.Fields("operation"))
|
|
|
640 |
Else
|
|
|
641 |
pkgInfoHash.Add "planned_operation", " "
|
|
|
642 |
End If
|
| 119 |
ghuddy |
643 |
|
| 7357 |
dpurdie |
644 |
' Determine if we are building this package on any build machine
|
|
|
645 |
'
|
|
|
646 |
pkgInfoHash.Add "isBuilding", isBuilding(SSpv_id)
|
| 7022 |
dpurdie |
647 |
|
| 7357 |
dpurdie |
648 |
'On Error Resume Next
|
|
|
649 |
'On Error Goto 0
|
| 119 |
ghuddy |
650 |
|
| 7357 |
dpurdie |
651 |
' check if package is released
|
|
|
652 |
If NOT isaRelease Then
|
|
|
653 |
pkgInfoHash.Add "is_released", False
|
|
|
654 |
Else
|
|
|
655 |
Set rsTemp = OraDatabase.DbCreateDynaset( "SELECT rc.pv_id FROM release_content rc WHERE rc.rtag_id = :RTAG_ID AND rc.pv_id = :PV_ID", cint(0))
|
|
|
656 |
pkgInfoHash.Add "is_released", rsTemp.RecordCount <> 0
|
|
|
657 |
End If
|
| 183 |
brianf |
658 |
|
| 7357 |
dpurdie |
659 |
' check if package is excluded from build
|
|
|
660 |
pkgInfoHash.Add "is_excluded", False
|
|
|
661 |
pkgInfoHash.Add "has_build_failure", False
|
|
|
662 |
If isaRelease Then
|
|
|
663 |
Set rsTemp = OraDatabase.DbCreateDynaset( "SELECT dnr.pv_id,dnr.root_pv_id FROM do_not_ripple dnr WHERE dnr.rtag_id = :RTAG_ID AND dnr.pv_id = :PV_ID", cint(0))
|
|
|
664 |
If rsTemp.RecordCount <> 0 Then
|
|
|
665 |
pkgInfoHash("is_excluded") = True
|
|
|
666 |
pkgInfoHash("has_build_failure") = IsNull(rsTemp("root_pv_id"))
|
|
|
667 |
End If
|
|
|
668 |
End If
|
| 183 |
brianf |
669 |
|
| 7357 |
dpurdie |
670 |
' Check if Package is deprecated
|
|
|
671 |
If isaRelease Then
|
|
|
672 |
Set rsTemp = OraDatabase.DbCreateDynaset( "SELECT * FROM DEPRECATED_PACKAGES WHERE RTAG_ID = :RTAG_ID AND "& EmptyToNullString("V_EXT", pkgInfoHash.Item ("v_ext")) &" AND PKG_ID = "& pkgInfoHash.Item ("pkg_id") &"", cint(0))
|
|
|
673 |
If rsTemp.RecordCount > 0 Then
|
|
|
674 |
pkgInfoHash.Add "is_deprecated", True
|
|
|
675 |
End If
|
|
|
676 |
End If
|
| 5964 |
dpurdie |
677 |
|
| 7357 |
dpurdie |
678 |
' Check if package is a NEW package - only one version in existence
|
|
|
679 |
If pkgInfoHash.Item ("pkg_id") <> "" Then
|
|
|
680 |
Set rsTemp = OraDatabase.DbCreateDynaset( "select count(*) as count from package_versions pv where pkg_id = " & pkgInfoHash.Item ("pkg_id"), cint(0))
|
|
|
681 |
pkgInfoHash.Add "pkg_count" , rsTemp("count")
|
|
|
682 |
End If
|
| 6497 |
dpurdie |
683 |
|
| 7357 |
dpurdie |
684 |
' Does this package have any dependencies
|
|
|
685 |
Set rsTemp = OraDatabase.DbCreateDynaset( "select count(*) as depCount from package_dependencies where pv_id = :PV_ID", cint(0))
|
|
|
686 |
pkgInfoHash.Add "depCount" , rsTemp("depCount")
|
|
|
687 |
End If
|
| 7289 |
dpurdie |
688 |
|
| 129 |
ghuddy |
689 |
rsTemp.Close
|
|
|
690 |
Set rsTemp = nothing
|
| 183 |
brianf |
691 |
|
| 7349 |
dpurdie |
692 |
OraDatabase.Parameters.Remove "PV_ID"
|
|
|
693 |
OraDatabase.Parameters.Remove "RTAG_ID"
|
|
|
694 |
OraDatabase.Parameters.Remove "RETURN_NUMBER"
|
|
|
695 |
OraDatabase.Parameters.Remove "OP_CODE_LIST"
|
|
|
696 |
|
| 119 |
ghuddy |
697 |
End Sub
|
| 7395 |
dpurdie |
698 |
|
| 119 |
ghuddy |
699 |
'-----------------------------------------------------------------------------------------------------------------------------
|
| 7395 |
dpurdie |
700 |
' Add information to the pkgInfoHash describing the S3 Sync
|
|
|
701 |
' Added only when required
|
|
|
702 |
' Assumes that Get_Pkg_Info has already been called
|
|
|
703 |
' Calculate:
|
|
|
704 |
' s3Sync - This package in this release is marked for S3Sync
|
|
|
705 |
' s3SyncEnabled - This Release has s3 sync enabled
|
|
|
706 |
' s3SyncContent - This version of the package appears to have S3Sync content
|
|
|
707 |
Sub Get_Pkg_Info_s3Sync ()
|
|
|
708 |
Dim Query_String, rsTemp, pvidInRelease
|
|
|
709 |
|
|
|
710 |
pkgInfoHash.Add "s3Sync", "N"
|
|
|
711 |
pkgInfoHash.Add "s3SyncEnabled", "N"
|
|
|
712 |
pkgInfoHash.Add "s3SyncContent", "N"
|
|
|
713 |
|
|
|
714 |
If pkgInfoHash.Item ("isaRelease") Then
|
|
|
715 |
|
|
|
716 |
' Use the base package in a Release if this is a WIP or in Pending
|
|
|
717 |
' as the property will be inherited when the package is updated
|
|
|
718 |
'
|
|
|
719 |
pvidInRelease = pkgInfoHash.Item ("pv_id_InRelease")
|
|
|
720 |
If pvidInRelease = "" Then
|
|
|
721 |
pvidInRelease = pkgInfoHash.Item ("pv_id")
|
|
|
722 |
End If
|
|
|
723 |
|
|
|
724 |
OraDatabase.Parameters.Add "PV_ID", pvidInRelease, ORAPARM_INPUT, ORATYPE_NUMBER
|
|
|
725 |
OraDatabase.Parameters.Add "RTAG_ID", pkgInfoHash.Item ("rtag_id"), ORAPARM_INPUT, ORATYPE_NUMBER
|
|
|
726 |
|
|
|
727 |
Query_String = _
|
|
|
728 |
" SELECT NVL(rc.s3sync, 'N') as s3sync, NVL(rt.s3sync, 'N') AS s3syncenabled, nvl2(s3.file_path, 'Y', 'N') AS s3synccontent" &_
|
|
|
729 |
" FROM release_content rc, release_tags rt, (" &_
|
|
|
730 |
" SELECT rcp.* FROM release_components rcp, release_content rc WHERE rc.rtag_id = :RTAG_ID" &_
|
|
|
731 |
" AND rc.pv_id = rcp.pv_id" &_
|
|
|
732 |
" AND rcp.file_name IS NULL" &_
|
|
|
733 |
" AND rcp.file_path LIKE 'pkg/S3TRANSFER'" &_
|
|
|
734 |
" ) s3" &_
|
|
|
735 |
" WHERE rc.rtag_id = rt.rtag_id" &_
|
|
|
736 |
" AND rc.pv_id = :PV_ID" &_
|
|
|
737 |
" AND rt.rtag_id = :RTAG_ID" &_
|
|
|
738 |
" AND s3.pv_id (+) = rc.pv_id"
|
|
|
739 |
|
|
|
740 |
Set rsTemp = OraDatabase.DbCreateDynaset( Query_String, cint(0))
|
|
|
741 |
If rsTemp.RecordCount > 0 Then
|
|
|
742 |
pkgInfoHash.Item ("s3Sync") = (rsTemp.Fields("s3Sync"))
|
|
|
743 |
pkgInfoHash.Item ("s3SyncEnabled") = (rsTemp.Fields("s3SyncEnabled"))
|
|
|
744 |
pkgInfoHash.Item ("s3SyncContent") = (rsTemp.Fields("s3SyncContent"))
|
|
|
745 |
End If
|
|
|
746 |
|
|
|
747 |
OraDatabase.Parameters.Remove "PV_ID"
|
|
|
748 |
OraDatabase.Parameters.Remove "RTAG_ID"
|
|
|
749 |
|
|
|
750 |
rsTemp.Close
|
|
|
751 |
Set rsTemp = nothing
|
|
|
752 |
End If
|
|
|
753 |
|
|
|
754 |
End Sub
|
|
|
755 |
|
|
|
756 |
'-----------------------------------------------------------------------------------------------------------------------------
|
| 4703 |
dpurdie |
757 |
' Get Package Info - when we don't have a package
|
|
|
758 |
Sub Get_NoPkg_Info(NNrtag)
|
|
|
759 |
Dim rsTemp, Query_String
|
|
|
760 |
OraDatabase.Parameters.Add "RTAG_ID", NNrtag, ORAPARM_INPUT, ORATYPE_NUMBER
|
|
|
761 |
|
|
|
762 |
pkgInfoHash.Item ("can_unofficial") = "false"
|
|
|
763 |
pkgInfoHash.Item ("noPackage") = true
|
|
|
764 |
|
|
|
765 |
'/* Get Basic Details */
|
|
|
766 |
Query_String = " select pj.PROJ_ID, rt.RTAG_ID,rt.rtag_name " &_
|
|
|
767 |
" from projects pj, release_tags rt" &_
|
|
|
768 |
" where rt.rtag_id=:RTAG_ID" &_
|
|
|
769 |
" and rt.PROJ_ID = pj.PROJ_ID"
|
|
|
770 |
|
|
|
771 |
Set rsTemp = OraDatabase.DbCreateDynaset( Query_String, cint(0))
|
|
|
772 |
|
|
|
773 |
If ((NOT rsTemp.BOF) AND (NOT rsTemp.EOF)) Then
|
|
|
774 |
pkgInfoHash.Add "proj_id", (rsTemp.Fields("proj_id"))
|
|
|
775 |
pkgInfoHash.Add "rtag_id", (rsTemp.Fields("rtag_id"))
|
|
|
776 |
pkgInfoHash.Add "rtag_name", (rsTemp.Fields("rtag_name"))
|
|
|
777 |
End If
|
|
|
778 |
|
|
|
779 |
OraDatabase.Parameters.Remove "RTAG_ID"
|
|
|
780 |
End Sub
|
|
|
781 |
|
|
|
782 |
'-----------------------------------------------------------------------------------------------------------------------------
|
| 119 |
ghuddy |
783 |
Sub Get_Pkg_Short_Info( SSparPv_id, SSpkgID, SSpkgName, SSpkgVersion, SSsrc_path, SSpkgDesc, BBdlocked )
|
| 129 |
ghuddy |
784 |
Dim rsTemp, Query_String
|
|
|
785 |
If IsEmpty(SSparPv_id) Then Exit Sub
|
| 119 |
ghuddy |
786 |
|
| 129 |
ghuddy |
787 |
Query_String = _
|
|
|
788 |
" SELECT pkg.pkg_id, pkg.pkg_name, pv.pkg_version, pv.src_path, pv.pv_description, pv.dlocked"&_
|
|
|
789 |
" FROM packages pkg, package_versions pv"&_
|
|
|
790 |
" WHERE pkg.pkg_id = pv.pkg_id AND pv.pv_id ="& SSparPv_id
|
| 119 |
ghuddy |
791 |
|
| 129 |
ghuddy |
792 |
Set rsTemp = OraDatabase.DbCreateDynaset( Query_String, cint(0))
|
| 119 |
ghuddy |
793 |
|
| 129 |
ghuddy |
794 |
If ((NOT rsTemp.BOF) AND (NOT rsTemp.EOF)) Then
|
|
|
795 |
SSpkgID = rsTemp.Fields("pkg_id")
|
|
|
796 |
SSpkgName = rsTemp.Fields("pkg_name")
|
|
|
797 |
SSpkgVersion = rsTemp.Fields("pkg_version")
|
|
|
798 |
SSsrc_path = rsTemp.Fields("src_path")
|
|
|
799 |
SSpkgDesc = rsTemp.Fields("pv_description")
|
|
|
800 |
BBdlocked = rsTemp.Fields("dlocked")
|
|
|
801 |
End If
|
| 119 |
ghuddy |
802 |
|
| 129 |
ghuddy |
803 |
rsTemp.Close
|
|
|
804 |
Set rsTemp = nothing
|
| 119 |
ghuddy |
805 |
End Sub
|
|
|
806 |
'-----------------------------------------------------------------------------------------------------------------------------
|
|
|
807 |
Private Function IsDomainAuthOK( SSusername, SSpassword, SSdomainName )
|
| 129 |
ghuddy |
808 |
Dim objLoginAuth, return, tempSTR
|
| 119 |
ghuddy |
809 |
|
| 129 |
ghuddy |
810 |
Set objLoginAuth = Server.CreateObject("LoginAdmin.ImpersonateUser")
|
|
|
811 |
return = objLoginAuth.AuthenticateUser ( SSusername, SSpassword, SSdomainName )
|
| 119 |
ghuddy |
812 |
|
| 129 |
ghuddy |
813 |
'Response.write "LOGIN"& SSusername &"-"& SSpassword &"-"& SSdomainName &"-"& return
|
| 119 |
ghuddy |
814 |
|
| 129 |
ghuddy |
815 |
If (return = 0) OR (return = 1385) Then
|
|
|
816 |
' From MSDN System Error Codes
|
|
|
817 |
' 0 - The operation completed successfully.
|
|
|
818 |
' 1326 - Logon failure: unknown user name or bad password.
|
|
|
819 |
' 1385 - Logon failure: the user has not been granted the requested logon type at this computer.
|
|
|
820 |
' 1909 - The referenced account is currently locked out and may not be used to log on.
|
| 119 |
ghuddy |
821 |
|
| 129 |
ghuddy |
822 |
'Login ok
|
|
|
823 |
IsDomainAuthOK = True
|
|
|
824 |
Else
|
|
|
825 |
IsDomainAuthOK = False
|
|
|
826 |
End If
|
| 119 |
ghuddy |
827 |
|
| 129 |
ghuddy |
828 |
Set objLoginAuth = Nothing
|
| 119 |
ghuddy |
829 |
End Function
|
|
|
830 |
'-----------------------------------------------------------------------------------------------------------------------------
|
|
|
831 |
Function ReadUserPreferences ( SSitem )
|
| 129 |
ghuddy |
832 |
'ReadUserPreferences = Request.Cookies("RELEASEMANAGER_USER_PREFERENCES")( SSitem )
|
|
|
833 |
ReadUserPreferences = "0"
|
| 119 |
ghuddy |
834 |
End Function
|
|
|
835 |
'-----------------------------------------------------------------------------------------------------------------------------
|
|
|
836 |
Function Requred_Parameters_String ( SScurrent, SSstr )
|
| 129 |
ghuddy |
837 |
'returns "&par1=val1&&parn=valn&" must use & as it will not be used on parameter name or value
|
|
|
838 |
Dim tempARR, parameter, tempSTR
|
|
|
839 |
tempARR = Split( SSstr, "," )
|
|
|
840 |
tempSTR = SScurrent
|
| 119 |
ghuddy |
841 |
|
| 129 |
ghuddy |
842 |
For Each parameter In tempARR
|
|
|
843 |
tempSTR = tempSTR &"&"& parameter &"="& QStrPar( parameter ) &"&"
|
|
|
844 |
Next
|
| 119 |
ghuddy |
845 |
|
| 129 |
ghuddy |
846 |
Requred_Parameters_String = tempSTR
|
| 119 |
ghuddy |
847 |
End Function
|
|
|
848 |
'-----------------------------------------------------------------------------------------------------------------------------
|
|
|
849 |
Function Quick_Help ( SStipname )
|
| 6827 |
dpurdie |
850 |
Quick_Help = "<span onMouseOver=""formTips.show('"& SStipname &"')"" onMouseOut=""formTips.hide()""><img src='images/i_help.gif' width='12' height='12' hspace='2' align='absmiddle' border='0' ></span>"
|
| 119 |
ghuddy |
851 |
End Function
|
| 6623 |
dpurdie |
852 |
Function Quick_HelpImg ( SStipname, SSimage )
|
| 6827 |
dpurdie |
853 |
Quick_HelpImg = "<span onMouseOver=""formTips.show('"& SStipname &"')"" onMouseOut=""formTips.hide()""><img src='"&SSimage&"' width='12' height='12' hspace='2' align='absmiddle' border='0' ></span>"
|
| 6623 |
dpurdie |
854 |
End Function
|
|
|
855 |
|
| 119 |
ghuddy |
856 |
'-----------------------------------------------------------------------------------------------------------------------------
|
|
|
857 |
Function LogError ( SSlog, SSstr )
|
| 129 |
ghuddy |
858 |
'|errstr1||errstr2||errstr3|...
|
|
|
859 |
LogError = SSlog &"|"& SSstr &"|"
|
| 119 |
ghuddy |
860 |
End Function
|
|
|
861 |
'-----------------------------------------------------------------------------------------------------------------------------
|
| 5168 |
dpurdie |
862 |
' Send an email
|
|
|
863 |
' Args: SSfromName - Text Name of sender
|
|
|
864 |
' SSfrom - email address of sender
|
| 6624 |
dpurdie |
865 |
' SSto - email address of receipient. May be comma sep list or a some type of object
|
| 5168 |
dpurdie |
866 |
' SSsubject - email subject
|
|
|
867 |
' SSbody - Body of the email. Email is sent as html.
|
|
|
868 |
' oAttachments - email attachments. May be empty, a file or a HashRef of files
|
|
|
869 |
'
|
| 119 |
ghuddy |
870 |
Sub Send_Email ( SSfromName, SSfrom, SSto, SSsubject, SSbody, oAttachments )
|
| 129 |
ghuddy |
871 |
Dim Mail, Keys, Key, canSend
|
| 4028 |
dpurdie |
872 |
'Response.write "<pre>Send_Email:SSfromName:" & SSfromName
|
|
|
873 |
'Response.write "<br>Send_Email:SSfrom:" & SSfrom
|
|
|
874 |
'Response.write "<br>Send_Email:SSto:" & SSto
|
|
|
875 |
'Response.write "<br>Send_Email:SSsubject:" & SSsubject
|
|
|
876 |
'Response.write "<br>Send_Email:SSbody:" & SSbody
|
| 119 |
ghuddy |
877 |
|
| 129 |
ghuddy |
878 |
canSend = FALSE
|
|
|
879 |
Set Mail = Server.CreateObject("Persits.MailSender")
|
| 3959 |
dpurdie |
880 |
Mail.Host = MAIL_SERVER
|
| 129 |
ghuddy |
881 |
Mail.From = SSfrom
|
|
|
882 |
Mail.FromName = SSfromName
|
| 119 |
ghuddy |
883 |
|
| 129 |
ghuddy |
884 |
' Send TO:
|
| 4028 |
dpurdie |
885 |
' Handle a Dictionary of names
|
|
|
886 |
If IsObject(SSto) AND (TypeName(SSto) <> "IOraField") Then
|
| 129 |
ghuddy |
887 |
Keys = SSto.Keys
|
|
|
888 |
For Each Key In Keys
|
|
|
889 |
Mail.AddAddress Key, SSto.Item( Key )
|
|
|
890 |
Next
|
| 119 |
ghuddy |
891 |
|
| 129 |
ghuddy |
892 |
If SSto.Count > 0 Then canSend = TRUE
|
|
|
893 |
Else
|
| 119 |
ghuddy |
894 |
|
| 129 |
ghuddy |
895 |
Mail.AddAddress SSto
|
|
|
896 |
If SSto <> "" Then canSend = TRUE
|
|
|
897 |
End If
|
| 119 |
ghuddy |
898 |
|
| 129 |
ghuddy |
899 |
Mail.Subject = SSsubject
|
|
|
900 |
Mail.IsHTML = True
|
|
|
901 |
Mail.Body = SSbody
|
| 119 |
ghuddy |
902 |
|
| 4028 |
dpurdie |
903 |
If NOT IsEmpty(oAttachments) AND NOT IsNull(oAttachments) Then
|
|
|
904 |
' Add Attachments DDDDDDD Sash,
|
|
|
905 |
' It appears as if AddEmbededImage is premium functionality that costs money, can we just do a normal add attachment?
|
|
|
906 |
If IsObject( oAttachments ) Then
|
|
|
907 |
Keys = oAttachments.Keys
|
|
|
908 |
For Each Key In Keys
|
|
|
909 |
' Mail.AddEmbeddedImage rootPath & Key, oAttachments.Item( Key )
|
|
|
910 |
Mail.AddAttachment oAttachments.Item( Key )
|
|
|
911 |
Next
|
|
|
912 |
Else
|
|
|
913 |
Mail.AddAttachment oAttachments
|
|
|
914 |
End If
|
|
|
915 |
End If
|
| 119 |
ghuddy |
916 |
|
| 129 |
ghuddy |
917 |
On Error Resume Next
|
|
|
918 |
If canSend Then Mail.Send ' send message
|
| 119 |
ghuddy |
919 |
|
|
|
920 |
End Sub
|
| 5168 |
dpurdie |
921 |
|
|
|
922 |
'-----------------------------------------------------------------------------------------------------------------
|
|
|
923 |
' Record and Report a Release Manager event
|
|
|
924 |
' Record in the machines Event Log
|
|
|
925 |
' Report via email
|
|
|
926 |
' Used to report error conditions that need to be bought to the attention of some sys admin
|
|
|
927 |
' Args: eventType - one of enumEVENT_* ( ie:enumEVENT_ERROR)
|
|
|
928 |
' SSlocation - Indication of location/operation
|
|
|
929 |
' SSvalues - Values. Will be added into the message
|
|
|
930 |
' SSerror_message - Error message
|
|
|
931 |
'
|
|
|
932 |
Sub Report_Event ( eventType, SSlocation, SSvalues, SSerror_message )
|
|
|
933 |
On Error Resume Next
|
|
|
934 |
Dim WshNetwork, SSmsg
|
|
|
935 |
Set WshNetwork = Server.CreateObject("WScript.Network")
|
|
|
936 |
|
|
|
937 |
' Compose Message
|
|
|
938 |
SSmsg = _
|
|
|
939 |
"-- User Info --"& VBNewLine &_
|
|
|
940 |
"Logged In: " & objAccessControl.UserLogedIn & VBNewLine &_
|
|
|
941 |
"Domain: " & objAccessControl.Domain & VBNewLine &_
|
|
|
942 |
"UserName: " & objAccessControl.UserName & VBNewLine &_
|
|
|
943 |
"FullName: " & objAccessControl.FullName & VBNewLine &_
|
|
|
944 |
"UserEmail: " & objAccessControl.UserEmail & VBNewLine &_
|
|
|
945 |
"UserId: " & objAccessControl.UserId & VBNewLine &_
|
|
|
946 |
VBNewLine &_
|
|
|
947 |
"-- Script Info --"& VBNewLine &_
|
|
|
948 |
"Host Name: "& Request.ServerVariables("SERVER_NAME") & ":" & Request.ServerVariables("SERVER_PORT") & VBNewLine &_
|
|
|
949 |
"Script Name: "& Request.ServerVariables("SCRIPT_NAME") & VBNewLine &_
|
|
|
950 |
VBNewLine &_
|
|
|
951 |
"-- Error Location --"& VBNewLine &_
|
|
|
952 |
SSlocation & VBNewLine &_
|
|
|
953 |
VBNewLine &_
|
|
|
954 |
"-- Values --"& VBNewLine &_
|
|
|
955 |
SSvalues & VBNewLine &_
|
|
|
956 |
VBNewLine &_
|
|
|
957 |
"-- Error Message --"& VBNewLine &_
|
|
|
958 |
SSerror_message & VBNewLine
|
|
|
959 |
|
|
|
960 |
'-- Raise this message at these places...
|
|
|
961 |
'-- Create an event in the system event log
|
|
|
962 |
'-- Send out an email
|
|
|
963 |
Call Send_Event( eventType, SSmsg )
|
|
|
964 |
Call Send_Email ( "Release Manager Notification", _
|
| 5357 |
dpurdie |
965 |
ADMIN_EMAIL, _
|
| 5168 |
dpurdie |
966 |
FAULT_EMAIL_LIST, _
|
|
|
967 |
"Release Manager Error", _
|
|
|
968 |
Replace(SSmsg,VBNewLine, "<br>"), _
|
|
|
969 |
null )
|
|
|
970 |
|
|
|
971 |
'----------------------------------------
|
|
|
972 |
Set WshNetwork = Nothing
|
|
|
973 |
End Sub
|
|
|
974 |
|
| 119 |
ghuddy |
975 |
'-----------------------------------------------------------------------------------------------------------------------------
|
| 5168 |
dpurdie |
976 |
' Record Event in OS log
|
|
|
977 |
' Create an event in the system event log
|
|
|
978 |
'
|
|
|
979 |
' Args: eventType - one of enumEVENT_* ( ie:enumEVENT_ERROR)
|
|
|
980 |
' SSmsg - Message Body
|
|
|
981 |
Sub Send_Event( eventType, SSmsg )
|
|
|
982 |
On Error Resume Next
|
|
|
983 |
Dim WshShell
|
|
|
984 |
Set WshShell = Server.CreateObject("WScript.Shell")
|
|
|
985 |
WshShell.LogEvent eventType, SSmsg
|
|
|
986 |
Set WshShell = Nothing
|
|
|
987 |
End Sub
|
|
|
988 |
|
|
|
989 |
'-----------------------------------------------------------------------------------------------------------------------------
|
| 119 |
ghuddy |
990 |
Sub Iterate_UP_the_tree ( NNrtag_id, HHstart_with, HHresult )
|
| 129 |
ghuddy |
991 |
Dim rsTemp, Query_String
|
|
|
992 |
Dim seekPKGs, seekNOTpkgs
|
| 119 |
ghuddy |
993 |
|
| 129 |
ghuddy |
994 |
seekPKGs = Join(HHstart_with.Keys, ",")
|
|
|
995 |
If seekPKGs = "" Then seekPKGs = "-1"
|
|
|
996 |
seekNOTpkgs = "-1"
|
| 119 |
ghuddy |
997 |
|
| 129 |
ghuddy |
998 |
Do While seekPKGs <> "-1"
|
|
|
999 |
Query_String = _
|
|
|
1000 |
" SELECT DISTINCT dep.pkg_id"&_
|
|
|
1001 |
" FROM package_dependencies dep, release_content rel"&_
|
|
|
1002 |
" WHERE rel.pv_id = dep.pv_id"&_
|
|
|
1003 |
" AND rel.rtag_id = "& NNrtag_id &_
|
|
|
1004 |
" AND dpkg_id IN ( "& seekPKGs &" ) "&_
|
|
|
1005 |
" AND pkg_id NOT IN ( "& seekNOTpkgs &" )"
|
|
|
1006 |
'" AND dep.dpv_id NOT IN ( SELECT iw.iw_id FROM ignore_warnings iw WHERE iw.rtag_id = "& NNrtag_id &" )"
|
|
|
1007 |
Set rsTemp = OraDatabase.DbCreateDynaset( Query_String, cint(0))
|
| 119 |
ghuddy |
1008 |
|
| 129 |
ghuddy |
1009 |
If rsTemp.RecordCount < 1 Then Exit Do
|
| 119 |
ghuddy |
1010 |
|
| 129 |
ghuddy |
1011 |
seekPKGs = "-1"
|
|
|
1012 |
While ((NOT rsTemp.BOF) AND (NOT rsTemp.EOF))
|
|
|
1013 |
If NOT HHresult.Exists(Cstr(rsTemp.Fields("pkg_id"))) Then HHresult.Add Cstr(rsTemp.Fields("pkg_id")), ""
|
|
|
1014 |
seekPKGs = seekPKGs &","& rsTemp.Fields("pkg_id")
|
|
|
1015 |
rsTemp.MoveNext
|
|
|
1016 |
WEnd
|
| 119 |
ghuddy |
1017 |
|
| 129 |
ghuddy |
1018 |
seekNOTpkgs = seekNOTpkgs &","& seekPKGs
|
|
|
1019 |
Loop
|
| 119 |
ghuddy |
1020 |
|
|
|
1021 |
End Sub
|
|
|
1022 |
'-----------------------------------------------------------------------------------------------------------------------------
|
| 129 |
ghuddy |
1023 |
Sub Iterate_DOWN_the_tree ( NNrtag_id, HHstart_with, HHresult )
|
|
|
1024 |
Dim rsTemp, Query_String
|
|
|
1025 |
Dim seekPKGs, seekNOTpkgs
|
| 119 |
ghuddy |
1026 |
|
| 129 |
ghuddy |
1027 |
seekPKGs = Join(HHstart_with.Keys, ",")
|
|
|
1028 |
If seekPKGs = "" Then seekPKGs = "-1"
|
|
|
1029 |
seekNOTpkgs = "-1"
|
| 119 |
ghuddy |
1030 |
|
| 129 |
ghuddy |
1031 |
Do While seekPKGs <> "-1"
|
|
|
1032 |
Query_String = _
|
|
|
1033 |
" SELECT DISTINCT dep.dpkg_id"&_
|
|
|
1034 |
" FROM package_dependencies dep, release_content rel"&_
|
|
|
1035 |
" WHERE rel.pv_id = dep.pv_id"&_
|
|
|
1036 |
" AND rel.rtag_id = "& NNrtag_id &_
|
|
|
1037 |
" AND pkg_id IN ( "& seekPKGs &" ) "&_
|
|
|
1038 |
" AND dpkg_id NOT IN ( "& seekNOTpkgs &" )"
|
|
|
1039 |
Set rsTemp = OraDatabase.DbCreateDynaset( Query_String, cint(0))
|
| 119 |
ghuddy |
1040 |
|
| 129 |
ghuddy |
1041 |
If rsTemp.RecordCount < 1 Then Exit Do
|
| 119 |
ghuddy |
1042 |
|
| 129 |
ghuddy |
1043 |
seekPKGs = "-1"
|
|
|
1044 |
While ((NOT rsTemp.BOF) AND (NOT rsTemp.EOF))
|
|
|
1045 |
If NOT HHresult.Exists(Cstr(rsTemp.Fields("dpkg_id"))) Then HHresult.Add Cstr(rsTemp.Fields("dpkg_id")), ""
|
|
|
1046 |
seekPKGs = seekPKGs &","& rsTemp.Fields("dpkg_id")
|
|
|
1047 |
rsTemp.MoveNext
|
|
|
1048 |
WEnd
|
| 119 |
ghuddy |
1049 |
|
| 129 |
ghuddy |
1050 |
seekNOTpkgs = seekNOTpkgs &","& seekPKGs
|
|
|
1051 |
Loop
|
| 119 |
ghuddy |
1052 |
|
|
|
1053 |
End Sub
|
|
|
1054 |
'-----------------------------------------------------------------------------------------------------------------------------
|
|
|
1055 |
Class TempSession
|
| 129 |
ghuddy |
1056 |
Function Value ()
|
|
|
1057 |
Value = Session("RELEASEMANAGER_temp")
|
|
|
1058 |
End Function
|
| 119 |
ghuddy |
1059 |
|
| 129 |
ghuddy |
1060 |
Sub Add ( SSstr )
|
|
|
1061 |
Session("RELEASEMANAGER_temp") = Session("RELEASEMANAGER_temp") & SSstr
|
|
|
1062 |
End Sub
|
| 119 |
ghuddy |
1063 |
|
| 129 |
ghuddy |
1064 |
Sub Clean ()
|
|
|
1065 |
Session("RELEASEMANAGER_temp") = NULL
|
|
|
1066 |
End Sub
|
| 119 |
ghuddy |
1067 |
End Class
|
|
|
1068 |
'-----------------------------------------------------------------------------------------------------------------------------
|
|
|
1069 |
Sub DisplayInfo ( SSmsg, SSwidth )
|
| 129 |
ghuddy |
1070 |
Dim msg
|
|
|
1071 |
If SSmsg = "" Then Exit Sub
|
| 119 |
ghuddy |
1072 |
|
| 129 |
ghuddy |
1073 |
Select Case UCase( SSmsg )
|
|
|
1074 |
Case "ISSUES_IMPORTED"
|
|
|
1075 |
msg = "Import is complete. <br>Click on Close button if you are finished."
|
|
|
1076 |
Case "MAKE_OFFICIAL_WARNING"
|
|
|
1077 |
msg = "Note that making a package official will prevent any further change to it."
|
|
|
1078 |
Case "APPLY_LABEL_TO_ALL_WARNING"
|
|
|
1079 |
msg = "This will overwrite any existing labels on selected packages."
|
|
|
1080 |
Case "BLANK_LABEL_WARNING"
|
|
|
1081 |
msg = "Some dependencies in the export list above, do not have a label!"
|
|
|
1082 |
Case "PERSONAL_VIEW_NOT_SETUP"
|
|
|
1083 |
msg = "<span class='err_alert'><b>Your View is not setup!</b></span><span class='sublbox_txt'><br><br>Either set your view using My Account > Views menu<br><br>OR<br><br>switch to Base view (Full view) by clicking on <img src='images/abtn_personal_view.gif' width='25' height='25' border='0'> icon above.</span>"
|
|
|
1084 |
Case "EMPTY_RELEASE_CONTENTS"
|
|
|
1085 |
msg = "<span class='err_alert'><b>Release content is empty!</b></span><span class='sublbox_txt'><br><br>Use + button to add packages to a release.</span>"
|
|
|
1086 |
Case "PKG_NAME_REQUIRED"
|
|
|
1087 |
msg = "<span class='err_alert'><b>Package Name required!</b></span><span class='sublbox_txt'><br>You are required to select at least one package name.</span>"
|
|
|
1088 |
Case "ADD_PATCH_WARNING"
|
|
|
1089 |
msg = "Note that patches cannot be used in your build dependencies."
|
|
|
1090 |
Case "NEW_PATCH_AVAILABLE"
|
|
|
1091 |
msg = "<b>New Patch is Required</b><br>One or more Build Dependencies have been patched.<br>Please click Add button to create patch for this package."
|
| 119 |
ghuddy |
1092 |
|
| 129 |
ghuddy |
1093 |
Case "NOT_FOUND_IN_PKG_ARCHIVE_RELEASE_NOTES"
|
| 5142 |
dpurdie |
1094 |
msg = "<b>Regenerating release notes...</b><br>It may take a minute. Please try refreshing this page a bit later."
|
| 129 |
ghuddy |
1095 |
Case "FAILED_GENERATING_RELEASE_NOTES"
|
| 6610 |
dpurdie |
1096 |
msg = "<span class='err_alert'><b>Failed generating release notes!</b></span>"
|
| 129 |
ghuddy |
1097 |
Case "GENERATING_RELEASE_NOTES"
|
|
|
1098 |
msg = "<b>Generating release notes...</b><br>It may take a minute. Please try refreshing this page a bit later."
|
|
|
1099 |
Case "NO_PREVIOUS_VERSION_RELEASE_NOTES"
|
|
|
1100 |
msg = "<b>Previous Version is Unknown</b>!<br>Please specify previous version by clicking on 'Show Details...' above.<br>Release notes are not generated."
|
| 4705 |
dpurdie |
1101 |
Case "RELEASE_NOTES_PLACEHOLDER_PACKAGE"
|
| 5751 |
dpurdie |
1102 |
msg = "<b>Place Holding Package</b>!<br>This package is manually built, does not have a build standard and does not exist in dpkg_archive. It is used as a placeholder.<br>Release notes are not generated."
|
| 119 |
ghuddy |
1103 |
|
| 129 |
ghuddy |
1104 |
Case "PACKAGE_FOUND_IN_OTHER_LOCATIONS"
|
|
|
1105 |
msg = "This package is also found in other locations."
|
|
|
1106 |
Case "DOC_NUMBER_NOTFOUND"
|
|
|
1107 |
msg = "<span class='err_alert'>Document number "& Request("doc_num") &" does not correspond to any document!</span>"
|
|
|
1108 |
Case "DOC_NUMBER_FOUND"
|
|
|
1109 |
msg = "Document found. Click "Import" to link the document."
|
|
|
1110 |
Case "UNIT_TEST_NOT_DONE"
|
| 6873 |
dpurdie |
1111 |
msg = "<b>Unit test is Not Done!</b><br><span href='_wform_reason_for_unit_test_not_done.asp?pv_id="& Request("pv_id") &"&rtag_id="& Request("rtag_id") &"'class='pointer txt_linked vixIframeDialog' title='Edit Reason'>Click here</span> to supply/edit reason."
|
| 129 |
ghuddy |
1112 |
Case "PACKAGE_NOT_PART_OF_RELEASE"
|
|
|
1113 |
msg = "<b>Package is Not Part of This Release Anymore!</b><br>This package cannot be found in the list on the left-hand side.<br>You can use 'lookup:' on the left-hand side to find the package inside this release. "
|
| 119 |
ghuddy |
1114 |
|
| 129 |
ghuddy |
1115 |
Case "NOT_FOUND_IN_PKG_ARCHIVE_FILE_GENERATE"
|
| 5172 |
dpurdie |
1116 |
msg = "<b>This package is not found in dpkg_archive!</b><br>Files and folders are not captured."
|
| 129 |
ghuddy |
1117 |
Case "NO_PRODUCT_FILES_CAPTURED"
|
|
|
1118 |
msg = "<b>Files and Folders not found for this product!</b><br>Capture of product components can only be done during the build time."
|
| 119 |
ghuddy |
1119 |
|
| 129 |
ghuddy |
1120 |
Case "MASS REF REFERENCE"
|
|
|
1121 |
msg = "<span class='err_alert'><b>New Version can only be created in the Release's associated MASS REF: <a href=""dependencies.asp?pv_id="& pkgInfoHash.Item("pv_id") &"&rtag_id="& AssocMASSREFValue &""">"& pkgInfoHash.Item("pkg_name") &" "& pkgInfoHash.Item("pkg_version") &"</a></b></span>"
|
| 119 |
ghuddy |
1122 |
|
| 129 |
ghuddy |
1123 |
Case "REPEAT_SCHEDULE_NOT_SELECTED"
|
|
|
1124 |
msg = "<span class='err_alert'><b>YOU MUST SELECT A VALUE FOR REPEAT SCHEDULED DOWNTIME</b></span>"
|
| 119 |
ghuddy |
1125 |
|
| 129 |
ghuddy |
1126 |
Case "PKG_NAME_INVALID"
|
|
|
1127 |
msg = "<span class='err_alert'><b>Package Name Invalid!</b></span><span class='sublbox_txt'><br>This package name is invalid. Package names must only consist of alpha-numeric characters, underscores and dashes (A-Z 0-9 _ -), and cannot include spaces or any other symbols.</span>"
|
| 119 |
ghuddy |
1128 |
|
| 129 |
ghuddy |
1129 |
Case "PKG_NAME_EXISTS"
|
|
|
1130 |
msg = "<span class='err_alert'><b>Package Name Already Exists!</b></span><span class='sublbox_txt'><br>This package name already exists, please try again.</span>"
|
| 119 |
ghuddy |
1131 |
|
| 129 |
ghuddy |
1132 |
End Select
|
| 119 |
ghuddy |
1133 |
%>
|
|
|
1134 |
<table width="<%=SSwidth%>" border="0" cellspacing="0" cellpadding="1">
|
|
|
1135 |
<tr>
|
|
|
1136 |
<td background="images/bg_bage_dark.gif">
|
| 129 |
ghuddy |
1137 |
<table width="100%" border="0" cellspacing="0" cellpadding="3">
|
| 6874 |
dpurdie |
1138 |
<tr class='bg_help'>
|
|
|
1139 |
<td width="1%" valign="top"><img src="images/i_qhelp.gif" width="16" height="16"></td>
|
|
|
1140 |
<td width="100%" class="form_txt"><%=msg%></td>
|
| 119 |
ghuddy |
1141 |
</tr>
|
|
|
1142 |
</table></td>
|
|
|
1143 |
</tr>
|
|
|
1144 |
</table>
|
|
|
1145 |
<br>
|
|
|
1146 |
<%
|
|
|
1147 |
|
|
|
1148 |
End Sub
|
|
|
1149 |
'-----------------------------------------------------------------------------------------------------------------------------
|
|
|
1150 |
Sub Messenger ( sMessage, nMessageType, sWidth )
|
| 129 |
ghuddy |
1151 |
Dim msgTemplate, Img
|
| 119 |
ghuddy |
1152 |
|
| 129 |
ghuddy |
1153 |
If (sMessage = "") OR IsNull(sMessage) Then Exit Sub
|
| 119 |
ghuddy |
1154 |
|
| 129 |
ghuddy |
1155 |
Select Case CStr(nMessageType)
|
|
|
1156 |
Case "1"
|
|
|
1157 |
Img = "s_critical.gif"
|
|
|
1158 |
Case "2"
|
|
|
1159 |
Img = "s_warning.gif"
|
|
|
1160 |
Case "3"
|
|
|
1161 |
Img = "s_note.gif"
|
|
|
1162 |
Case Else
|
|
|
1163 |
Img = nMessageType
|
|
|
1164 |
End Select
|
| 119 |
ghuddy |
1165 |
|
|
|
1166 |
|
| 129 |
ghuddy |
1167 |
msgTemplate = ReadFile( APP_ROOT &"\scripts\message_style.html" )
|
|
|
1168 |
msgTemplate = Replace( msgTemplate, "%WIDTH%", sWidth )
|
|
|
1169 |
msgTemplate = Replace( msgTemplate, "%IMAGE%", Img )
|
|
|
1170 |
msgTemplate = Replace( msgTemplate, "%MESSAGE%", sMessage )
|
| 119 |
ghuddy |
1171 |
|
| 129 |
ghuddy |
1172 |
Response.write msgTemplate
|
| 119 |
ghuddy |
1173 |
End Sub
|
|
|
1174 |
'-----------------------------------------------------------------------------------------------------------------------------
|
| 4203 |
dpurdie |
1175 |
Function Default_Label ( SSpv_id, SSbuild_type, SSchange_type, SSpkg_name, SSpkg_version, SSv_ext )
|
| 3959 |
dpurdie |
1176 |
If SSbuild_type = "A" Then
|
| 4203 |
dpurdie |
1177 |
If SSchange_type = "F" Then
|
|
|
1178 |
Default_Label = SSpkg_name & "_" & SSpkg_version & ".WIP"
|
|
|
1179 |
else
|
|
|
1180 |
Default_Label = UCase(SSpkg_name & "." & SSpv_id & SSv_ext) & ".WIP"
|
|
|
1181 |
End If
|
| 3959 |
dpurdie |
1182 |
Else
|
| 4203 |
dpurdie |
1183 |
Default_Label = SSpkg_name & "_" & SSpkg_version
|
| 3959 |
dpurdie |
1184 |
End If
|
| 119 |
ghuddy |
1185 |
End Function
|
|
|
1186 |
'-----------------------------------------------------------------------------------------------------------------------------
|
|
|
1187 |
Function Format_Version ( SSpkg_version, SSv_ext )
|
| 129 |
ghuddy |
1188 |
Dim tempArr, tempVersion, patchArr, seg, myVersion
|
|
|
1189 |
myVersion = SSpkg_version
|
| 119 |
ghuddy |
1190 |
|
| 129 |
ghuddy |
1191 |
If NOT IsNull(SSv_ext) Then
|
|
|
1192 |
myVersion = Left ( myVersion, Len(myVersion) - Len(SSv_ext) )
|
|
|
1193 |
End If
|
| 119 |
ghuddy |
1194 |
|
| 129 |
ghuddy |
1195 |
tempArr = Split (myVersion, ".")
|
|
|
1196 |
For Each seg In tempArr
|
|
|
1197 |
If Len(seg) < 2 Then
|
|
|
1198 |
' single digit number
|
|
|
1199 |
tempVersion = tempVersion &"0"& seg
|
| 119 |
ghuddy |
1200 |
|
| 129 |
ghuddy |
1201 |
Else
|
|
|
1202 |
seg = Replace(seg, "_", "-") ' make sure that there is no _ in segment
|
|
|
1203 |
If InStr( seg, "-" ) > 0 Then
|
|
|
1204 |
' patch version supplied
|
|
|
1205 |
patchArr = Split(seg, "-")
|
|
|
1206 |
If Len(patchArr(0)) < 2 Then
|
|
|
1207 |
' single digit number
|
|
|
1208 |
tempVersion = tempVersion &"0"& patchArr(0) &"_0"& patchArr(1)
|
|
|
1209 |
Else
|
|
|
1210 |
' double digit number
|
|
|
1211 |
tempVersion = tempVersion & patchArr(0) &"_0"& patchArr(1)
|
|
|
1212 |
End If
|
| 119 |
ghuddy |
1213 |
|
| 129 |
ghuddy |
1214 |
Else
|
|
|
1215 |
' double digit no patch
|
|
|
1216 |
tempVersion = tempVersion & seg
|
|
|
1217 |
End If
|
| 119 |
ghuddy |
1218 |
|
| 129 |
ghuddy |
1219 |
End If
|
| 119 |
ghuddy |
1220 |
|
| 129 |
ghuddy |
1221 |
Next
|
| 119 |
ghuddy |
1222 |
|
| 129 |
ghuddy |
1223 |
Format_Version = tempVersion
|
| 119 |
ghuddy |
1224 |
End Function
|
|
|
1225 |
'-----------------------------------------------------------------------------------------------------------------------------
|
|
|
1226 |
Function DefineStateIcon ( NNpkg_state, CCdlocked, sIgnoreWarnings, cIsPatchIgnore, cBuildType, bForEnvironment )
|
| 5175 |
dpurdie |
1227 |
|
|
|
1228 |
If IsNull(NNpkg_state) Then
|
|
|
1229 |
DefineStateIcon = ""
|
|
|
1230 |
Exit Function
|
|
|
1231 |
End If
|
| 119 |
ghuddy |
1232 |
|
| 129 |
ghuddy |
1233 |
If NOT IsNull(sIgnoreWarnings) Then
|
|
|
1234 |
'-- Ignore Warning is on
|
|
|
1235 |
If IsNull(cIsPatchIgnore) Then
|
|
|
1236 |
DefineStateIcon = enum_imgIgnoring
|
|
|
1237 |
Else
|
|
|
1238 |
DefineStateIcon = enum_imgPatchIgnoring
|
|
|
1239 |
End If
|
| 119 |
ghuddy |
1240 |
|
| 129 |
ghuddy |
1241 |
Else
|
|
|
1242 |
Select Case CInt( NNpkg_state )
|
|
|
1243 |
Case enumPKG_STATE_OK
|
| 183 |
brianf |
1244 |
If (CCdlocked = "N") OR (CCdlocked = "R") Then
|
| 129 |
ghuddy |
1245 |
DefineStateIcon = enum_imgBuilding
|
| 183 |
brianf |
1246 |
ElseIf (CCdlocked = "P") Then
|
|
|
1247 |
DefineStateIcon = enum_imgPending
|
| 7029 |
dpurdie |
1248 |
ElseIf (CCdlocked = "A") Then
|
|
|
1249 |
DefineStateIcon = enum_imgApproved
|
| 129 |
ghuddy |
1250 |
Else
|
|
|
1251 |
DefineStateIcon = enum_imgBlank
|
|
|
1252 |
End If
|
| 119 |
ghuddy |
1253 |
|
| 129 |
ghuddy |
1254 |
Case enumPKG_STATE_MAJOR
|
|
|
1255 |
DefineStateIcon = enum_imgCritical
|
| 119 |
ghuddy |
1256 |
|
| 129 |
ghuddy |
1257 |
Case enumPKG_STATE_MINOR
|
|
|
1258 |
DefineStateIcon = enum_imgWarning
|
| 119 |
ghuddy |
1259 |
|
| 129 |
ghuddy |
1260 |
Case enumPKG_STATE_MAJOR_READY
|
|
|
1261 |
DefineStateIcon = enum_imgCReady
|
| 119 |
ghuddy |
1262 |
|
| 129 |
ghuddy |
1263 |
Case enumPKG_STATE_MINOR_READY
|
|
|
1264 |
DefineStateIcon = enum_imgWReady
|
| 119 |
ghuddy |
1265 |
|
| 129 |
ghuddy |
1266 |
Case enumPKG_NOT_FOUND
|
|
|
1267 |
DefineStateIcon = enum_imgNotFound
|
| 119 |
ghuddy |
1268 |
|
| 129 |
ghuddy |
1269 |
Case enumPKG_STATE_NEW_PATCH
|
|
|
1270 |
DefineStateIcon = enum_imgPatchAvailable
|
| 119 |
ghuddy |
1271 |
|
| 129 |
ghuddy |
1272 |
Case enumPKG_STATE_DEPRECATED
|
|
|
1273 |
DefineStateIcon = enum_imgDeprecated
|
| 119 |
ghuddy |
1274 |
|
| 129 |
ghuddy |
1275 |
Case enumPKG_STATE_DEPRECATED_DEPENDENT
|
|
|
1276 |
DefineStateIcon = enum_imgDeprecatedDependent
|
| 119 |
ghuddy |
1277 |
|
| 129 |
ghuddy |
1278 |
Case enumPKG_ADVISORY_RIPPLE
|
|
|
1279 |
DefineStateIcon = enum_imgAR
|
| 119 |
ghuddy |
1280 |
|
| 129 |
ghuddy |
1281 |
Case enumPKG_ADVISORY_RIPPLE_DEPENDENT
|
|
|
1282 |
DefineStateIcon = enum_imgARD
|
| 119 |
ghuddy |
1283 |
|
| 131 |
ghuddy |
1284 |
Case enumPKG_PEGGED_VERSION
|
|
|
1285 |
DefineStateIcon = enum_imgGreenPin
|
| 5080 |
dpurdie |
1286 |
|
|
|
1287 |
Case enumPKG_SDK_IMPORT
|
|
|
1288 |
DefineStateIcon = enum_imgSdkImport
|
|
|
1289 |
|
|
|
1290 |
Case enumPKG_SDK_DEPENDENCY
|
|
|
1291 |
DefineStateIcon = enum_imgSdkDep
|
|
|
1292 |
|
| 5899 |
dpurdie |
1293 |
Case enumPKG_UNBUILDABLE
|
|
|
1294 |
DefineStateIcon = enum_imgUnBuildable
|
|
|
1295 |
|
| 7029 |
dpurdie |
1296 |
Case enumPKG_BUILDING
|
|
|
1297 |
DefineStateIcon = enum_imgCompiling
|
|
|
1298 |
|
|
|
1299 |
Case enumPKG_SCHEDULED
|
|
|
1300 |
DefineStateIcon = enum_imgScheduled
|
|
|
1301 |
|
|
|
1302 |
Case enumPKG_BUILDFAIL
|
|
|
1303 |
DefineStateIcon = enum_imgBuildFail
|
|
|
1304 |
|
|
|
1305 |
Case enumPKG_BUILDEXCLUDE
|
|
|
1306 |
DefineStateIcon = enum_imgBuildExclude
|
|
|
1307 |
|
| 129 |
ghuddy |
1308 |
End Select
|
| 119 |
ghuddy |
1309 |
|
| 129 |
ghuddy |
1310 |
If (NOT bForEnvironment) AND _
|
|
|
1311 |
(cBuildType = "A") AND _
|
|
|
1312 |
(CCdlocked <> "Y") AND _
|
|
|
1313 |
(DefineStateIcon <> enum_imgBlank) AND _
|
|
|
1314 |
(DefineStateIcon <> enum_imgBuilding) AND _
|
|
|
1315 |
(DefineStateIcon <> enum_imgNotFound) OR _
|
|
|
1316 |
( Request("rtag_id") = "" AND Request("FRrtag_id") = "") _
|
|
|
1317 |
Then
|
| 119 |
ghuddy |
1318 |
|
| 129 |
ghuddy |
1319 |
DefineStateIcon = ""
|
| 119 |
ghuddy |
1320 |
|
| 129 |
ghuddy |
1321 |
End If
|
| 4390 |
dpurdie |
1322 |
End If
|
|
|
1323 |
End Function
|
|
|
1324 |
'-----------------------------------------------------------------------------------------------------------------------------
|
|
|
1325 |
Function DefineStateIconSimple ( NNpkg_state, CCdlocked)
|
| 119 |
ghuddy |
1326 |
|
| 4390 |
dpurdie |
1327 |
DefineStateIconSimple = ""
|
|
|
1328 |
Select Case CInt( NNpkg_state )
|
|
|
1329 |
Case enumPKG_STATE_OK
|
|
|
1330 |
If (CCdlocked = "R") OR (CCdlocked = "A") Then
|
|
|
1331 |
DefineStateIconSimple = enum_imgBuilding
|
|
|
1332 |
ElseIf (CCdlocked = "P") Then
|
|
|
1333 |
DefineStateIconSimple = enum_imgPending
|
|
|
1334 |
ElseIf (CCdlocked = "Y") Then
|
|
|
1335 |
DefineStateIconSimple = enum_imgReleasedLocked
|
|
|
1336 |
ElseIf (CCdlocked = "N") Then
|
|
|
1337 |
DefineStateIconSimple = enum_imgReleasedUnlocked
|
|
|
1338 |
Else
|
|
|
1339 |
DefineStateIconSimple = enum_imgBlank
|
|
|
1340 |
End If
|
| 119 |
ghuddy |
1341 |
|
| 4390 |
dpurdie |
1342 |
Case enumPKG_STATE_MAJOR
|
|
|
1343 |
DefineStateIconSimple = enum_imgCritical
|
| 119 |
ghuddy |
1344 |
|
| 4390 |
dpurdie |
1345 |
Case enumPKG_STATE_MINOR
|
|
|
1346 |
DefineStateIconSimple = enum_imgWarning
|
| 119 |
ghuddy |
1347 |
|
| 4390 |
dpurdie |
1348 |
Case enumPKG_STATE_MAJOR_READY
|
|
|
1349 |
DefineStateIconSimple = enum_imgCReady
|
|
|
1350 |
|
|
|
1351 |
Case enumPKG_STATE_MINOR_READY
|
|
|
1352 |
DefineStateIconSimple = enum_imgWReady
|
|
|
1353 |
|
|
|
1354 |
Case enumPKG_NOT_FOUND
|
|
|
1355 |
DefineStateIconSimple = enum_imgNotFound
|
|
|
1356 |
|
|
|
1357 |
Case enumPKG_STATE_NEW_PATCH
|
|
|
1358 |
DefineStateIconSimple = enum_imgPatchAvailable
|
|
|
1359 |
|
|
|
1360 |
Case enumPKG_STATE_DEPRECATED
|
|
|
1361 |
DefineStateIconSimple = enum_imgDeprecated
|
|
|
1362 |
|
|
|
1363 |
Case enumPKG_STATE_DEPRECATED_DEPENDENT
|
|
|
1364 |
DefineStateIconSimple = enum_imgDeprecatedDependent
|
|
|
1365 |
|
|
|
1366 |
Case enumPKG_ADVISORY_RIPPLE
|
|
|
1367 |
DefineStateIconSimple = enum_imgAR
|
|
|
1368 |
|
|
|
1369 |
Case enumPKG_ADVISORY_RIPPLE_DEPENDENT
|
|
|
1370 |
DefineStateIconSimple = enum_imgARD
|
|
|
1371 |
|
|
|
1372 |
Case enumPKG_PEGGED_VERSION
|
|
|
1373 |
DefineStateIconSimple = enum_imgGreenPin
|
| 5080 |
dpurdie |
1374 |
|
|
|
1375 |
Case enumPKG_SDK_IMPORT
|
| 5085 |
dpurdie |
1376 |
DefineStateIconSimple = enum_imgSdkImport
|
| 5080 |
dpurdie |
1377 |
|
|
|
1378 |
Case enumPKG_SDK_DEPENDENCY
|
| 5085 |
dpurdie |
1379 |
DefineStateIconSimple = enum_imgSdkDep
|
| 5080 |
dpurdie |
1380 |
|
| 4390 |
dpurdie |
1381 |
End Select
|
| 119 |
ghuddy |
1382 |
End Function
|
|
|
1383 |
'-----------------------------------------------------------------------------------------------------------------------------
|
|
|
1384 |
Function DefineStateSmallIcon ( NNpkg_state, CCdlocked )
|
| 129 |
ghuddy |
1385 |
Select Case CInt( NNpkg_state )
|
|
|
1386 |
Case enumPKG_STATE_OK
|
|
|
1387 |
If CCdlocked = "N" Then
|
|
|
1388 |
DefineStateSmallIcon = enum_SMALL_imgBuilding
|
|
|
1389 |
Else
|
|
|
1390 |
DefineStateSmallIcon = enum_SMALL_imgOK
|
|
|
1391 |
End If
|
| 119 |
ghuddy |
1392 |
|
| 129 |
ghuddy |
1393 |
Case enumPKG_STATE_MAJOR
|
|
|
1394 |
DefineStateSmallIcon = enum_SMALL_imgCritical
|
| 119 |
ghuddy |
1395 |
|
| 129 |
ghuddy |
1396 |
Case enumPKG_STATE_MINOR
|
|
|
1397 |
DefineStateSmallIcon = enum_SMALL_imgWarning
|
| 119 |
ghuddy |
1398 |
|
| 129 |
ghuddy |
1399 |
Case enumPKG_STATE_MAJOR_READY
|
|
|
1400 |
DefineStateSmallIcon = enum_SMALL_imgCReady
|
| 119 |
ghuddy |
1401 |
|
| 129 |
ghuddy |
1402 |
Case enumPKG_STATE_MINOR_READY
|
|
|
1403 |
DefineStateSmallIcon = enum_SMALL_imgWReady
|
| 119 |
ghuddy |
1404 |
|
| 129 |
ghuddy |
1405 |
End Select
|
| 119 |
ghuddy |
1406 |
End Function
|
|
|
1407 |
'-----------------------------------------------------------------------------------------------------------------------------
|
|
|
1408 |
Function PatchIcon ( cIsPatch, cIsPatchObsolete )
|
| 129 |
ghuddy |
1409 |
If IsNull(cIsPatch) Then
|
|
|
1410 |
PatchIcon = "<img src='images/rex_images/ext_blank.gif' width='16' height='16' border='0' align='absmiddle'>"
|
|
|
1411 |
Else
|
|
|
1412 |
If IsNull(cIsPatchObsolete) Then
|
|
|
1413 |
PatchIcon = "<img src='images/i_patch_small.gif' width='16' height='16' border='0' align='absmiddle' >"
|
|
|
1414 |
Else
|
|
|
1415 |
PatchIcon = "<img src='images/i_patch_small_obsolete.gif' width='16' height='16' border='0' align='absmiddle' title='Patch is obsolete'>"
|
|
|
1416 |
End If
|
|
|
1417 |
End If
|
| 119 |
ghuddy |
1418 |
End Function
|
|
|
1419 |
'-----------------------------------------------------------------------------------------------------------------------------
|
|
|
1420 |
' Function that returns true of false if the item exists in the array
|
|
|
1421 |
'-----------------------------------------------------------------------------------------------------------------------------
|
|
|
1422 |
Function inArray(item, aItems)
|
| 129 |
ghuddy |
1423 |
Dim element
|
|
|
1424 |
inArray = false
|
|
|
1425 |
for each element in aItems
|
|
|
1426 |
If element = item Then
|
|
|
1427 |
inArray=true
|
|
|
1428 |
End If
|
|
|
1429 |
next
|
| 119 |
ghuddy |
1430 |
End Function
|
|
|
1431 |
'-----------------------------------------------------------------------------------------------------------------------------
|
| 5268 |
dpurdie |
1432 |
' Function: GetCurrentParameters
|
|
|
1433 |
' Description: Setup some very basic data that is common to (almost) pages
|
|
|
1434 |
' Uses Request("proj_id"), Request("rtag_id") and Request("pv_id")
|
|
|
1435 |
'
|
|
|
1436 |
' Given an rtag_id it will determine the enclosing project
|
|
|
1437 |
'
|
| 6971 |
dpurdie |
1438 |
' If a valid Release will also fill in releaseInfoHash
|
|
|
1439 |
' Done here as its info we will need any way and its better to have
|
|
|
1440 |
' one database access than two ( or three )
|
|
|
1441 |
'
|
| 6577 |
dpurdie |
1442 |
' Returns: nProjId proj_id of rtag_id
|
|
|
1443 |
' sProjName
|
| 5268 |
dpurdie |
1444 |
' nRtagId rtag_id
|
| 6577 |
dpurdie |
1445 |
' sRtagName
|
| 5268 |
dpurdie |
1446 |
' nPvid pv_id
|
|
|
1447 |
'
|
| 6971 |
dpurdie |
1448 |
' releaseInfoHash - Populates
|
| 5268 |
dpurdie |
1449 |
'
|
| 6577 |
dpurdie |
1450 |
Function GetCurrentParameters( nProjId, sProjName, nRtagId, sRtagName, nPvId )
|
| 129 |
ghuddy |
1451 |
Dim rsQry,query
|
| 119 |
ghuddy |
1452 |
|
| 129 |
ghuddy |
1453 |
' Set defaults
|
|
|
1454 |
nProjId = -1
|
| 6577 |
dpurdie |
1455 |
sProjName = ""
|
| 129 |
ghuddy |
1456 |
nRtagId = -1
|
| 6577 |
dpurdie |
1457 |
sRtagName = ""
|
| 5177 |
dpurdie |
1458 |
nPvId = -1
|
| 119 |
ghuddy |
1459 |
|
| 6577 |
dpurdie |
1460 |
' Set the ID values from the url
|
|
|
1461 |
If Request("pv_id") <> "" Then nPvId = CDbl(Request("pv_id"))
|
|
|
1462 |
If Request("proj_id") <> "" Then nProjId = CDbl(Request("proj_id"))
|
|
|
1463 |
If Request("rtag_id") <> "" Then nRtagId = CDbl(Request("rtag_id"))
|
|
|
1464 |
|
|
|
1465 |
|
| 129 |
ghuddy |
1466 |
' Get parameters from database
|
| 119 |
ghuddy |
1467 |
|
| 6577 |
dpurdie |
1468 |
If Request("rtag_id") <> "" Then
|
| 6971 |
dpurdie |
1469 |
GetReleaseInfo (nRtagId)
|
|
|
1470 |
sProjName = UCase(releaseInfoHash("proj_name"))
|
|
|
1471 |
nProjId = CDbl(releaseInfoHash("proj_id"))
|
|
|
1472 |
sRtagName = releaseInfoHash("rtag_name")
|
| 119 |
ghuddy |
1473 |
|
| 6971 |
dpurdie |
1474 |
ElseIf Request("proj_id") <> "" Then
|
|
|
1475 |
OraDatabase.Parameters.Add "PROJ_ID", Request("proj_id"), ORAPARM_INPUT, ORATYPE_VARCHAR2
|
| 119 |
ghuddy |
1476 |
|
| 6577 |
dpurdie |
1477 |
query = _
|
|
|
1478 |
" SELECT proj.proj_name, proj.proj_id"&_
|
|
|
1479 |
" FROM projects proj"&_
|
|
|
1480 |
" WHERE proj.proj_id = :PROJ_ID"
|
| 119 |
ghuddy |
1481 |
|
| 6577 |
dpurdie |
1482 |
Set rsQry = OraDatabase.DbCreateDynaset( query, cint(0))
|
|
|
1483 |
If ((NOT rsQry.BOF) AND (NOT rsQry.EOF)) Then
|
|
|
1484 |
sProjName = UCase(rsQry.Fields("proj_name"))
|
|
|
1485 |
End If
|
|
|
1486 |
rsQry.Close()
|
|
|
1487 |
Set rsQry = nothing
|
| 6971 |
dpurdie |
1488 |
OraDatabase.Parameters.Remove "PROJ_ID"
|
| 6577 |
dpurdie |
1489 |
|
| 129 |
ghuddy |
1490 |
End If
|
| 119 |
ghuddy |
1491 |
|
|
|
1492 |
|
|
|
1493 |
End Function
|
|
|
1494 |
'-----------------------------------------------------------------------------------------------------------------------------
|
|
|
1495 |
Function GetEnvName ( nEnvTab )
|
| 129 |
ghuddy |
1496 |
Select Case CInt( nEnvTab )
|
|
|
1497 |
Case enumENVTAB_WORK_IN_PROGRESS
|
|
|
1498 |
GetEnvName = "Work In Progress"
|
| 119 |
ghuddy |
1499 |
|
| 129 |
ghuddy |
1500 |
Case enumENVTAB_PLANNED
|
|
|
1501 |
GetEnvName = "Pending"
|
| 119 |
ghuddy |
1502 |
|
| 129 |
ghuddy |
1503 |
Case enumENVTAB_RELEASED
|
|
|
1504 |
GetEnvName = "Released"
|
| 119 |
ghuddy |
1505 |
|
| 129 |
ghuddy |
1506 |
End Select
|
| 119 |
ghuddy |
1507 |
|
|
|
1508 |
End Function
|
|
|
1509 |
'-----------------------------------------------------------------------------------------------------------------------------
|
|
|
1510 |
Function Title (rtagId)
|
| 6770 |
dpurdie |
1511 |
Dim rsQry
|
| 119 |
ghuddy |
1512 |
|
| 129 |
ghuddy |
1513 |
If rtagId = "" Then
|
|
|
1514 |
Title = "Release Manager"
|
|
|
1515 |
Else
|
|
|
1516 |
Set rsQry = OraDatabase.DbCreateDynaset( "SELECT RT.RTAG_NAME, P.PROJ_NAME FROM PROJECTS P, RELEASE_TAGS RT WHERE RT.PROJ_ID = P.PROJ_ID AND RT.RTAG_ID="& rtagId, ORADYN_DEFAULT )
|
|
|
1517 |
Title = rsQry("proj_name")&">"&rsQry("rtag_name")
|
|
|
1518 |
rsQry.Close()
|
|
|
1519 |
Set rsQry = Nothing
|
|
|
1520 |
End If
|
| 119 |
ghuddy |
1521 |
|
|
|
1522 |
End Function
|
|
|
1523 |
'-------------------------------------------------------------------------------------
|
|
|
1524 |
Function Check_Package_WIP_Already_Exists(NNrtag_id, NNpv_id)
|
| 129 |
ghuddy |
1525 |
Dim Query_String, rsQry
|
| 119 |
ghuddy |
1526 |
|
| 129 |
ghuddy |
1527 |
Query_String = _
|
|
|
1528 |
" SELECT * "&_
|
|
|
1529 |
" FROM planned pl, package_versions pv "&_
|
|
|
1530 |
" WHERE pl.rtag_id = "& NNrtag_id &_
|
|
|
1531 |
" AND pv.pv_id = pl.pv_id "&_
|
|
|
1532 |
" AND pv.dlocked = 'A' "&_
|
|
|
1533 |
" AND pv.pkg_id = (SELECT pkg_id "&_
|
|
|
1534 |
" FROM package_versions "&_
|
|
|
1535 |
" WHERE pv_id = "& NNpv_id &") "&_
|
|
|
1536 |
" AND pv.v_ext = (SELECT v_ext "&_
|
|
|
1537 |
" FROM package_versions "&_
|
|
|
1538 |
" WHERE pv_id = "& NNpv_id &")"
|
| 119 |
ghuddy |
1539 |
|
|
|
1540 |
|
| 129 |
ghuddy |
1541 |
Set rsQry = OraDatabase.DbCreateDynaset( Query_String , cint(0) )
|
| 119 |
ghuddy |
1542 |
|
| 129 |
ghuddy |
1543 |
Check_Package_WIP_Already_Exists = rsQry.RecordCount
|
| 119 |
ghuddy |
1544 |
|
| 129 |
ghuddy |
1545 |
rsQry.Close()
|
|
|
1546 |
Set rsQry = Nothing
|
| 119 |
ghuddy |
1547 |
End Function
|
|
|
1548 |
'-----------------------------------------------------------------------------------------------------------------------------
|
|
|
1549 |
Function ValidateCodeReviewURL ( sCodeReviewURL )
|
|
|
1550 |
Dim isValid
|
|
|
1551 |
Dim sTempBaseURL
|
|
|
1552 |
Dim httpRegEx
|
| 129 |
ghuddy |
1553 |
Set httpRegEx = new RegExp
|
| 119 |
ghuddy |
1554 |
|
| 129 |
ghuddy |
1555 |
httpRegEx.Pattern = "^https?:\/\/"
|
| 119 |
ghuddy |
1556 |
|
| 129 |
ghuddy |
1557 |
' Removes ending slash from project's base URL for ease of comparison.
|
|
|
1558 |
sTempBaseURL = Left(baseURL, Len(baseURL)-1)
|
|
|
1559 |
' Removes the project's base URL from the URL specified (if it's present).
|
|
|
1560 |
codeReviewURL = Replace(sCodeReviewURL, sTempBaseURL, "")
|
|
|
1561 |
' Removes the slash from the beginning of the resulting URL (if it's present).
|
|
|
1562 |
If InStr(codeReviewURL, "/") = 1 Then
|
|
|
1563 |
codeReviewURL = Replace(codeReviewURL, "/", "", 1, 1)
|
|
|
1564 |
End If
|
| 119 |
ghuddy |
1565 |
|
| 129 |
ghuddy |
1566 |
' If the URL doesn't contain the http:// prefix, assume that it's correct.
|
|
|
1567 |
If NOT httpRegEx.Test(codeReviewURL) AND Len(codeReviewURL) > 0 Then
|
|
|
1568 |
isValid = True
|
|
|
1569 |
Else
|
|
|
1570 |
' If the URL still contains the http:// prefix and is longer than the base
|
|
|
1571 |
' URL, assume that it is an invalid URL because of a differing base URL.
|
|
|
1572 |
If Len(sCodeReviewURL) > Len(baseURL) Then
|
|
|
1573 |
Response.Write("<script type='text/javascript'>alert('Incorrect Base URL\n\nMust start with project\'s base url (" & baseURL &") if full URL specified.')</script>")
|
|
|
1574 |
Else
|
|
|
1575 |
' If the URL still contains the http:// prefix and is shorter than the base
|
|
|
1576 |
' URL, assume that it is incomplete.
|
|
|
1577 |
Response.Write("<script type='text/javascript'>alert('Incomplete Code Review URL')</script>")
|
|
|
1578 |
End If
|
|
|
1579 |
' Otherwise, the URL matches the base URL exactly, which is also invalid.
|
|
|
1580 |
codeReviewURL = sCodeReviewURL
|
|
|
1581 |
isValid = False
|
|
|
1582 |
End If
|
|
|
1583 |
ValidateCodeReviewURL = isValid
|
| 119 |
ghuddy |
1584 |
End Function
|
|
|
1585 |
'----------------------------------------------------------------------------------------------------------------------------------------
|
|
|
1586 |
Function Is_Page_Editable ( cDlocked )
|
| 129 |
ghuddy |
1587 |
' Editable if ( (unlocked OR rejected)
|
|
|
1588 |
' OR ( NOT released/locked AND EditReleaseNotesInPending allowed)
|
|
|
1589 |
' OR (released/locked AND EditNonCriticalInfoForLockedPackage allowed)
|
|
|
1590 |
' )
|
|
|
1591 |
' AND user logged in
|
| 5061 |
dpurdie |
1592 |
If (((cDlocked = "N") OR (cDlocked = "R")) OR ((cDlocked <> "Y") AND (canActionControlInProject("EditReleaseNotesInPending"))) OR ((cDlocked = "Y") AND (canActionControlInProject("EditNonCriticalInfoForLockedPackage")))) AND objAccessControl.UserLogedIn Then
|
| 129 |
ghuddy |
1593 |
Is_Page_Editable = TRUE
|
|
|
1594 |
Else
|
|
|
1595 |
Is_Page_Editable = FALSE
|
|
|
1596 |
End If
|
| 119 |
ghuddy |
1597 |
End Function
|
|
|
1598 |
'----------------------------------------------------------------------------------------------------------------------------------------
|
|
|
1599 |
Function Is_Section_Editable ( )
|
| 129 |
ghuddy |
1600 |
If scriptName = "fixed_issues.asp" AND objAccessControl.UserLogedIn Then
|
|
|
1601 |
Is_Section_Editable = TRUE
|
|
|
1602 |
Else
|
|
|
1603 |
Is_Section_Editable = FALSE
|
|
|
1604 |
End If
|
| 119 |
ghuddy |
1605 |
End Function
|
|
|
1606 |
'----------------------------------------------------------------------------------------------------------------------------------------
|
|
|
1607 |
Function Is_Critical_Section_Editable ( cDlocked )
|
| 129 |
ghuddy |
1608 |
' Editable if ( (unlocked OR rejected)
|
|
|
1609 |
' OR ( NOT released/locked AND EditReleaseNotesInPending allowed)
|
|
|
1610 |
' OR (released/locked AND EditCriticalInfoForLockedPackage allowed)
|
|
|
1611 |
' )
|
|
|
1612 |
' AND user logged in
|
| 5061 |
dpurdie |
1613 |
If (((cDlocked = "N") OR (cDlocked = "R")) OR ((cDlocked <> "Y") AND (canActionControlInProject("EditReleaseNotesInPending"))) OR ((cDlocked = "Y") AND (canActionControlInProject("EditCriticalInfoForLockedPackage")))) AND objAccessControl.UserLogedIn Then
|
| 129 |
ghuddy |
1614 |
Is_Critical_Section_Editable = TRUE
|
|
|
1615 |
Else
|
|
|
1616 |
Is_Critical_Section_Editable = FALSE
|
|
|
1617 |
End If
|
| 119 |
ghuddy |
1618 |
End Function
|
|
|
1619 |
|
|
|
1620 |
'---------------------------------------------------------------
|
|
|
1621 |
' Function: getLastNonRippleVersionPVID
|
|
|
1622 |
'
|
|
|
1623 |
' Purpose: returns the last non-ripple version of the package
|
|
|
1624 |
'
|
|
|
1625 |
' Arguments: this_pv_id : string
|
|
|
1626 |
'
|
|
|
1627 |
' Notes: In the past, users used to manually perform ripple builds.
|
|
|
1628 |
' This function does not detect those as ripples. It could be
|
|
|
1629 |
' made to do so but it would not be reliable. For example, it
|
|
|
1630 |
' could check to see if the word "ripple" appears in the
|
|
|
1631 |
' comments field of the record set of the SWL query. That
|
|
|
1632 |
' might catch some of those records, but assumes the user
|
|
|
1633 |
' wrote the wor ripple into the comments (reason for version).
|
|
|
1634 |
'
|
| 6480 |
dpurdie |
1635 |
Function getLastNonRippleVersionPVID( this_pv_id, ByRef rippleBasePvid, ByRef lastNonRipplePvid )
|
| 129 |
ghuddy |
1636 |
Dim queryResult
|
|
|
1637 |
Dim queryString
|
| 6480 |
dpurdie |
1638 |
Dim lastNonRipple
|
| 119 |
ghuddy |
1639 |
|
| 5442 |
dpurdie |
1640 |
' default return value in case don't find anything
|
|
|
1641 |
getLastNonRippleVersionPVID = this_pv_id
|
| 6480 |
dpurdie |
1642 |
lastNonRipple = this_pv_id
|
| 119 |
ghuddy |
1643 |
|
| 5503 |
dpurdie |
1644 |
' Get a list of all previous non-ripple builds starting with the current pvid
|
| 5442 |
dpurdie |
1645 |
' The first entry will be the base entry of the current ripple
|
|
|
1646 |
' The second entry will be the previous significant entry
|
|
|
1647 |
queryString = _
|
| 5503 |
dpurdie |
1648 |
"SELECT pv_id,last_pv_id,pkg_version,v_ext,build_type " &_
|
|
|
1649 |
"FROM " &_
|
|
|
1650 |
" (SELECT build_type,last_pv_id,pv_id,pkg_version,v_ext " &_
|
|
|
1651 |
" FROM " &_
|
|
|
1652 |
" (SELECT pv.build_type,pv.last_pv_id AS raw_last_pvid ,pv_id,pv.pkg_version,pv.v_ext,DECODE(pv.pv_id, pv.last_pv_id, NULL, pv.last_pv_id) AS last_pv_id " &_
|
|
|
1653 |
" FROM release_manager.package_versions pv " &_
|
|
|
1654 |
" WHERE pv.PKG_ID IN " &_
|
|
|
1655 |
" (SELECT pkg_id " &_
|
|
|
1656 |
" FROM release_manager.package_versions pv " &_
|
|
|
1657 |
" WHERE pv.pv_id = " & this_pv_id &_
|
|
|
1658 |
" ) " &_
|
|
|
1659 |
" ) " &_
|
|
|
1660 |
" START WITH pv_id = " & this_pv_id &_
|
|
|
1661 |
" CONNECT BY nocycle prior last_pv_id = pv_id " &_
|
|
|
1662 |
" ) " &_
|
|
|
1663 |
"WHERE build_type != 'Y' "
|
| 119 |
ghuddy |
1664 |
|
| 5503 |
dpurdie |
1665 |
|
| 129 |
ghuddy |
1666 |
Set queryResult = OraDatabase.DbCreateDynaset( queryString, cint(0))
|
| 119 |
ghuddy |
1667 |
|
| 5442 |
dpurdie |
1668 |
' First entry - Base of the current ripple (may be myself)
|
|
|
1669 |
If ((NOT queryResult.BOF) AND (NOT queryResult.EOF)) Then
|
|
|
1670 |
getLastNonRippleVersionPVID = queryResult("pv_id")
|
| 6480 |
dpurdie |
1671 |
lastNonRipple = queryResult("pv_id")
|
| 119 |
ghuddy |
1672 |
|
| 5442 |
dpurdie |
1673 |
' Second entry - Previous Non Ripple Entry
|
|
|
1674 |
queryResult.MoveNext
|
|
|
1675 |
If ((NOT queryResult.BOF) AND (NOT queryResult.EOF)) Then
|
|
|
1676 |
getLastNonRippleVersionPVID = queryResult("pv_id")
|
|
|
1677 |
End If
|
| 129 |
ghuddy |
1678 |
End If
|
| 119 |
ghuddy |
1679 |
|
| 129 |
ghuddy |
1680 |
queryResult.Close()
|
|
|
1681 |
Set queryResult = nothing
|
| 6480 |
dpurdie |
1682 |
|
|
|
1683 |
If Not isNull(rippleBasePvid) Then rippleBasePvid = lastNonRipple
|
|
|
1684 |
If Not isNull(lastNonRipplePvid) Then lastNonRipplePvid = getLastNonRippleVersionPVID
|
|
|
1685 |
|
| 119 |
ghuddy |
1686 |
End Function
|
|
|
1687 |
|
| 5442 |
dpurdie |
1688 |
|
| 159 |
ghuddy |
1689 |
Function getLastNonRippleVersionPVIDLimitedByDate( this_pv_id, limitDate )
|
|
|
1690 |
Dim queryResult
|
|
|
1691 |
Dim queryString
|
|
|
1692 |
|
| 5442 |
dpurdie |
1693 |
' default return value in case don't find anything
|
|
|
1694 |
getLastNonRippleVersionPVIDLimitedByDate = this_pv_id
|
| 159 |
ghuddy |
1695 |
|
| 5442 |
dpurdie |
1696 |
' Get a list of all previous non-ripple builds starting with the cuurent pvid
|
|
|
1697 |
' The first entry will be the base entry of the current ripple
|
|
|
1698 |
' The second entry will be the previous significant entry
|
|
|
1699 |
queryString = _
|
|
|
1700 |
"SELECT last_pv_id, pv_id, pkg_version, v_ext,MODIFIED_STAMP " &_
|
|
|
1701 |
"FROM " &_
|
|
|
1702 |
" (SELECT pv.build_type, pv.last_pv_id, pv_id, pv.pkg_version, pv.v_ext, pv.MODIFIED_STAMP" &_
|
|
|
1703 |
" FROM release_manager.package_versions pv" &_
|
|
|
1704 |
" START WITH pv.pv_id = " + this_pv_id &_
|
|
|
1705 |
" CONNECT BY nocycle prior pv.last_pv_id = pv.pv_id" &_
|
|
|
1706 |
" ) where build_type != 'Y' " &_
|
| 5639 |
dpurdie |
1707 |
" AND MODIFIED_STAMP >= TO_DATE('" & limitDate & "','DY DD-MON-YYYY')"
|
| 159 |
ghuddy |
1708 |
|
|
|
1709 |
Set queryResult = OraDatabase.DbCreateDynaset( queryString, cint(0))
|
|
|
1710 |
|
| 5442 |
dpurdie |
1711 |
' First entry - Base of the current ripple (may be myself)
|
| 159 |
ghuddy |
1712 |
If ((NOT queryResult.BOF) AND (NOT queryResult.EOF)) Then
|
| 5442 |
dpurdie |
1713 |
getLastNonRippleVersionPVIDLimitedByDate = queryResult("pv_id")
|
| 159 |
ghuddy |
1714 |
|
| 5442 |
dpurdie |
1715 |
' Second entry - Previous Non Ripple Entry
|
|
|
1716 |
queryResult.MoveNext
|
|
|
1717 |
If ((NOT queryResult.BOF) AND (NOT queryResult.EOF)) Then
|
|
|
1718 |
getLastNonRippleVersionPVIDLimitedByDate = queryResult("pv_id")
|
|
|
1719 |
End If
|
| 159 |
ghuddy |
1720 |
End If
|
|
|
1721 |
|
|
|
1722 |
queryResult.Close()
|
|
|
1723 |
Set queryResult = nothing
|
|
|
1724 |
End Function
|
|
|
1725 |
|
| 119 |
ghuddy |
1726 |
'---------------------------------------------------------------
|
|
|
1727 |
' Function: getPreviousVersionPVID
|
|
|
1728 |
'
|
|
|
1729 |
' Purpose: returns the immediate predecssor version of the given
|
|
|
1730 |
' package version
|
|
|
1731 |
'
|
|
|
1732 |
' Arguments: this_pv_id : string
|
|
|
1733 |
'
|
|
|
1734 |
' Notes:
|
|
|
1735 |
'
|
|
|
1736 |
Function getPreviousVersionPVID( this_pv_id )
|
| 129 |
ghuddy |
1737 |
Dim queryResult
|
|
|
1738 |
Dim queryString
|
| 119 |
ghuddy |
1739 |
|
| 129 |
ghuddy |
1740 |
getPreviousVersionPVID = ""
|
| 119 |
ghuddy |
1741 |
|
| 157 |
ghuddy |
1742 |
queryString = "SELECT last_pv_id FROM package_versions WHERE pv_id = " & this_pv_id
|
| 119 |
ghuddy |
1743 |
|
| 129 |
ghuddy |
1744 |
Set queryResult = OraDatabase.DbCreateDynaset( queryString, cint(0))
|
| 119 |
ghuddy |
1745 |
|
| 129 |
ghuddy |
1746 |
If ((NOT queryResult.BOF) AND (NOT queryResult.EOF)) Then
|
|
|
1747 |
getPreviousVersionPVID = queryResult("last_pv_id")
|
|
|
1748 |
End If
|
| 119 |
ghuddy |
1749 |
|
| 129 |
ghuddy |
1750 |
queryResult.Close()
|
|
|
1751 |
Set queryResult = nothing
|
| 119 |
ghuddy |
1752 |
|
|
|
1753 |
End Function
|
|
|
1754 |
|
|
|
1755 |
'---------------------------------------------------------------
|
| 129 |
ghuddy |
1756 |
' Function: getLastSignificantPVID
|
|
|
1757 |
'
|
|
|
1758 |
' Purpose: Returns the last significant (man-made) version (PV_ID) that
|
|
|
1759 |
' is a predecessor to the specified pv_id
|
|
|
1760 |
'
|
|
|
1761 |
' Arguments: pv_id : Uniquely identifies this package version
|
|
|
1762 |
' last_pv_id : Uniquely identifies the predecssor of this package version
|
|
|
1763 |
' Notes:
|
|
|
1764 |
'
|
|
|
1765 |
Function getLastSignificantPVID (pv_id, last_pv_id)
|
|
|
1766 |
|
|
|
1767 |
getLastSignificantPVID = ""
|
|
|
1768 |
|
|
|
1769 |
If( (NOT IsNull(last_pv_id)) AND (last_pv_id <> pv_id) ) Then
|
|
|
1770 |
|
|
|
1771 |
' Get the pv_id for the current version, and if necessary, work back through any ripple versions as necessary
|
|
|
1772 |
' to get a non-ripple version ancestor
|
| 6480 |
dpurdie |
1773 |
pv_id = getLastNonRippleVersionPVID( pv_id , NULL, NULL)
|
| 5442 |
dpurdie |
1774 |
If (pv_id <> "") Then
|
| 129 |
ghuddy |
1775 |
getLastSignificantPVID = pv_id
|
| 5442 |
dpurdie |
1776 |
End If
|
| 129 |
ghuddy |
1777 |
End If
|
|
|
1778 |
|
|
|
1779 |
End Function
|
| 6480 |
dpurdie |
1780 |
|
| 129 |
ghuddy |
1781 |
'---------------------------------------------------------------
|
| 6480 |
dpurdie |
1782 |
' Function: getLastSignificantVersions
|
|
|
1783 |
'
|
|
|
1784 |
' Purpose: Returns the last significant (man-made) version (PV_ID) that
|
|
|
1785 |
' is a predecessor to the specified pv_id
|
|
|
1786 |
'
|
|
|
1787 |
' Arguments: pv_id : Uniquely identifies this package version
|
|
|
1788 |
' RefRippleBase : Ref to store riple base PVID
|
|
|
1789 |
' RefPrevNonRipple : Ref to store previous non ripple PVID
|
|
|
1790 |
' Notes:
|
|
|
1791 |
'
|
|
|
1792 |
Sub getLastSignificantVersions (pv_id, ByRef RefRippleBase, ByRef RefPrevNonRipple)
|
|
|
1793 |
Dim rv
|
|
|
1794 |
rv = getLastNonRippleVersionPVID( pv_id , RefRippleBase, RefPrevNonRipple)
|
|
|
1795 |
End Sub
|
|
|
1796 |
|
|
|
1797 |
'---------------------------------------------------------------
|
| 129 |
ghuddy |
1798 |
' Function: get_Pkg_Label
|
|
|
1799 |
'
|
|
|
1800 |
' Purpose: Returns the package label for the specified pv_id
|
|
|
1801 |
'
|
|
|
1802 |
' Arguments: pv_id : Uniquely identifies this package version
|
|
|
1803 |
'
|
|
|
1804 |
Function get_Pkg_Label (pv_id)
|
|
|
1805 |
Dim queryResult
|
|
|
1806 |
Dim queryString
|
|
|
1807 |
|
|
|
1808 |
get_Pkg_Label = ""
|
|
|
1809 |
|
|
|
1810 |
' Get the package label from the package versions table
|
|
|
1811 |
queryString = "SELECT pkg_label FROM package_versions WHERE pv_id = " & pv_id
|
|
|
1812 |
Set queryResult = OraDatabase.DbCreateDynaset( queryString, cint(0))
|
|
|
1813 |
If ((NOT queryResult.BOF) AND (NOT queryResult.EOF)) Then
|
|
|
1814 |
get_Pkg_Label = queryResult("pkg_label")
|
|
|
1815 |
End If
|
|
|
1816 |
queryResult.Close()
|
|
|
1817 |
Set queryResult = nothing
|
|
|
1818 |
End Function
|
|
|
1819 |
'---------------------------------------------------------------
|
|
|
1820 |
' Function: get_Src_Path
|
|
|
1821 |
'
|
|
|
1822 |
' Purpose: Returns the source path for the specified pv_id
|
|
|
1823 |
'
|
|
|
1824 |
' Arguments: pv_id : Uniquely identifies this package version
|
|
|
1825 |
'
|
|
|
1826 |
Function get_Src_Path (pv_id)
|
|
|
1827 |
Dim queryResult
|
|
|
1828 |
Dim queryString
|
|
|
1829 |
|
|
|
1830 |
get_Src_Path = ""
|
|
|
1831 |
|
|
|
1832 |
' Get the source path from package versions table
|
|
|
1833 |
queryString = "SELECT src_path FROM package_versions WHERE pv_id = " & pv_id
|
|
|
1834 |
Set queryResult = OraDatabase.DbCreateDynaset( queryString, cint(0))
|
|
|
1835 |
If ((NOT queryResult.BOF) AND (NOT queryResult.EOF)) Then
|
|
|
1836 |
get_Src_Path = queryResult("src_path")
|
|
|
1837 |
End If
|
|
|
1838 |
queryResult.Close()
|
|
|
1839 |
Set queryResult = nothing
|
|
|
1840 |
End Function
|
|
|
1841 |
|
|
|
1842 |
'---------------------------------------------------------------
|
| 119 |
ghuddy |
1843 |
' Function: getOldLabel
|
|
|
1844 |
'
|
|
|
1845 |
' Purpose: Returns the previous label; if none then returns empty string
|
|
|
1846 |
'
|
|
|
1847 |
' Since this operation is designed to fulfil the generation of
|
|
|
1848 |
' diff commands, there is no point in considering ripple
|
|
|
1849 |
' versions, since the only differences we find there are in
|
|
|
1850 |
' the build.pl files (for example). So, this function uses
|
|
|
1851 |
' some underlying methods that ignore ripple built versions
|
|
|
1852 |
' therefore concentrating on versions that someone has manually
|
|
|
1853 |
' gone and labelled, presumably because they changed some
|
|
|
1854 |
' source file other than build.pl.
|
|
|
1855 |
'
|
|
|
1856 |
' Arguments: pv_id : Uniquely identifies this package version
|
|
|
1857 |
' last_pv_id : Uniquely identifies the predecssor of this package version
|
|
|
1858 |
' Notes:
|
|
|
1859 |
'
|
|
|
1860 |
Function getOldLabel (pv_id, last_pv_id)
|
| 129 |
ghuddy |
1861 |
Dim lastSignificantPVID
|
| 119 |
ghuddy |
1862 |
|
| 129 |
ghuddy |
1863 |
getOldLabel = ""
|
| 119 |
ghuddy |
1864 |
|
| 129 |
ghuddy |
1865 |
lastSignificantPVID = getLastSignificantPVID(pv_id, last_pv_id)
|
|
|
1866 |
If (lastSignificantPVID <> "") Then
|
|
|
1867 |
getOldLabel = get_Pkg_Label(lastSignificantPVID)
|
|
|
1868 |
End If
|
|
|
1869 |
End Function
|
|
|
1870 |
'---------------------------------------------------------------
|
|
|
1871 |
' Function: getOldSrcPath
|
|
|
1872 |
'
|
|
|
1873 |
' Purpose: Returns the previous src path; if none then returns empty string
|
|
|
1874 |
'
|
|
|
1875 |
' Since this operation is designed to fulfil the generation of
|
|
|
1876 |
' diff commands, there is no point in considering ripple
|
|
|
1877 |
' versions, since the only differences we find there are in
|
|
|
1878 |
' the build.pl files (for example). So, this function uses
|
|
|
1879 |
' some underlying methods that ignore ripple built versions
|
|
|
1880 |
' therefore concentrating on versions that someone has manually
|
|
|
1881 |
' gone and labelled, presumably because they changed some
|
|
|
1882 |
' source file other than build.pl.
|
|
|
1883 |
'
|
|
|
1884 |
' NOTE: With SubVersion, the src_path column in the package_versions
|
|
|
1885 |
' table will be used to hold the Subversion tag. This function
|
|
|
1886 |
' will therefore be used mostly when a package version is
|
|
|
1887 |
' controlled under subversion.
|
|
|
1888 |
'
|
|
|
1889 |
' Arguments: pv_id : Uniquely identifies this package version
|
|
|
1890 |
' last_pv_id : Uniquely identifies the predecssor of this package version
|
|
|
1891 |
' Notes:
|
|
|
1892 |
'
|
|
|
1893 |
Function getOldSrcPath (pv_id, last_pv_id)
|
|
|
1894 |
Dim lastSignificantPVID
|
| 119 |
ghuddy |
1895 |
|
| 129 |
ghuddy |
1896 |
getOldSrcPath = ""
|
| 119 |
ghuddy |
1897 |
|
| 129 |
ghuddy |
1898 |
lastSignificantPVID = getLastSignificantPVID(pv_id, last_pv_id)
|
|
|
1899 |
If (lastSignificantPVID <> "") Then
|
|
|
1900 |
getOldSrcPath = get_Src_Path(lastSignificantPVID)
|
|
|
1901 |
End If
|
|
|
1902 |
End Function
|
|
|
1903 |
'----------------------------------------------------------------------------------------------------------------------
|
|
|
1904 |
Sub vcs_info_from_vcs_tag( nVcs_tag, ByRef objDetails )
|
|
|
1905 |
Dim rsTemp, Query_String
|
| 119 |
ghuddy |
1906 |
|
| 129 |
ghuddy |
1907 |
Query_String = " SELECT * FROM vcs_type WHERE tag = '"& nVcs_tag &"'"
|
|
|
1908 |
Set rsTemp = OraDatabase.DbCreateDynaset( Query_String, cint(0))
|
|
|
1909 |
If (NOT rsTemp.BOF ) AND (NOT rsTemp.EOF) Then
|
|
|
1910 |
objDetails.Item("vcs_type_id") = rsTemp("vcs_type_id")
|
|
|
1911 |
objDetails.Item("vcs_name") = rsTemp("name")
|
|
|
1912 |
objDetails.Item("vcs_tag") = rsTemp("tag")
|
|
|
1913 |
Else
|
| 141 |
ghuddy |
1914 |
Call RaiseMsg(enum_MSG_ERROR, "Database does not contain a record of the VCS tag : " & nVcs_tag )
|
| 129 |
ghuddy |
1915 |
End If
|
|
|
1916 |
rsTemp.Close()
|
|
|
1917 |
set rsTemp = nothing
|
|
|
1918 |
End Sub
|
|
|
1919 |
'----------------------------------------------------------------------------------------------------------------------
|
|
|
1920 |
Sub vcs_info_from_vcs_type_id( nVcs_type_id, ByRef objDetails )
|
|
|
1921 |
Dim rsTemp, Query_String
|
|
|
1922 |
|
|
|
1923 |
If NOT IsNull(nVcs_type_id) Then
|
|
|
1924 |
Query_String = " SELECT * FROM vcs_type WHERE vcs_type_id = "& nVcs_type_id
|
|
|
1925 |
Set rsTemp = OraDatabase.DbCreateDynaset( Query_String, cint(0))
|
|
|
1926 |
If (NOT rsTemp.BOF ) AND (NOT rsTemp.EOF) Then
|
|
|
1927 |
objDetails.Item("vcs_type_id") = rsTemp("vcs_type_id")
|
|
|
1928 |
objDetails.Item("vcs_name") = rsTemp("name")
|
|
|
1929 |
objDetails.Item("vcs_tag") = rsTemp("tag")
|
|
|
1930 |
Else
|
| 141 |
ghuddy |
1931 |
Call RaiseMsg(enum_MSG_ERROR, "Database does not contain a record of the VCS type ID : " & nVcs_type_id )
|
| 129 |
ghuddy |
1932 |
End If
|
|
|
1933 |
rsTemp.Close()
|
|
|
1934 |
set rsTemp = nothing
|
|
|
1935 |
Else
|
| 3616 |
dpurdie |
1936 |
' default to returning Subversion info, assuming it exists in the data
|
|
|
1937 |
Call vcs_info_from_vcs_tag( enum_VCS_SUBVERSION_TAG, objDetails )
|
| 129 |
ghuddy |
1938 |
End If
|
|
|
1939 |
End Sub
|
|
|
1940 |
'----------------------------------------------------------------------------------------------------------------------
|
| 137 |
ghuddy |
1941 |
Sub get_vcs_info_for_package( nPkgLabel, nBuildType, nVcsTypeId, nDLocked, ByRef objDetails )
|
| 129 |
ghuddy |
1942 |
' lots of patch versions exist with N/A as their pkg_label and null as vcs_type_id. These are all uncontrolled
|
|
|
1943 |
' packages published directly into dpkg_archive with no controlled source under clearcase, so we want to treat
|
|
|
1944 |
' them as uncontrolled if possible.
|
| 137 |
ghuddy |
1945 |
If nDLocked = "Y" AND ((nPkgLabel = "N/A") OR IsNull(nPkgLabel)) AND nBuildType = "M" AND IsNull(nVcsTypeId) Then
|
| 129 |
ghuddy |
1946 |
Call vcs_info_from_vcs_tag( enum_VCS_UNCONTROLLED_TAG, objDetails )
|
|
|
1947 |
Else
|
|
|
1948 |
' Otherwise, try and decode the VCS from the package's vcs_type_id entry from the package version table
|
|
|
1949 |
' NOTE: A null vcs_type_id entry will default to ClearCase. That is all we have been using up til now so
|
|
|
1950 |
' it should be safe.
|
|
|
1951 |
Call vcs_info_from_vcs_type_id( nVcsTypeId, objDetails )
|
|
|
1952 |
End If
|
|
|
1953 |
End Sub
|
|
|
1954 |
'----------------------------------------------------------------------------------------------------------------------
|
|
|
1955 |
Sub get_vcs_info_for_pv_id( nPv_id, ByRef objDetails )
|
|
|
1956 |
Dim rsTemp, Query_String
|
|
|
1957 |
|
|
|
1958 |
Query_String = _
|
| 137 |
ghuddy |
1959 |
" SELECT pv.pkg_label, pv.build_type, pv.vcs_type_id, pv.dlocked "&_
|
| 129 |
ghuddy |
1960 |
" FROM PACKAGE_VERSIONS pv"&_
|
|
|
1961 |
" WHERE pv.pv_id = "& nPv_id
|
|
|
1962 |
|
|
|
1963 |
Set rsTemp = OraDatabase.DbCreateDynaset( Query_String, cint(0))
|
|
|
1964 |
If (NOT rsTemp.BOF ) AND (NOT rsTemp.EOF) Then
|
| 137 |
ghuddy |
1965 |
Call get_vcs_info_for_package( rsTemp("pkg_label"), rsTemp("build_type"), rsTemp("vcs_type_id"), rsTemp("dlocked"), objDetails )
|
| 129 |
ghuddy |
1966 |
Else
|
|
|
1967 |
Call RaiseMsg(enum_MSG_ERROR, "PV_ID (" & nPv_id & ") Not Found")
|
|
|
1968 |
End If
|
|
|
1969 |
rsTemp.Close()
|
|
|
1970 |
set rsTemp = nothing
|
|
|
1971 |
End Sub
|
|
|
1972 |
'----------------------------------------------------------------------------------------------------------------------
|
|
|
1973 |
Function get_vcs_tag( nPv_id )
|
|
|
1974 |
Dim tempVcsInfoCollector
|
|
|
1975 |
Set tempVcsInfoCollector = CreateObject("Scripting.Dictionary")
|
|
|
1976 |
|
|
|
1977 |
Call get_vcs_info_for_pv_id( nPv_id, tempVcsInfoCollector )
|
|
|
1978 |
get_vcs_tag = tempVcsInfoCollector.Item("vcs_tag")
|
|
|
1979 |
|
|
|
1980 |
Set tempVcsInfoCollector = nothing
|
| 119 |
ghuddy |
1981 |
End Function
|
| 129 |
ghuddy |
1982 |
'----------------------------------------------------------------------------------------------------------------------
|
| 143 |
ghuddy |
1983 |
Function isInDoNotRippleTable( NNrtag_id, NNpv_id )
|
|
|
1984 |
Dim rsTemp, Query_String
|
| 119 |
ghuddy |
1985 |
|
| 143 |
ghuddy |
1986 |
isInDoNotRippleTable = FALSE
|
|
|
1987 |
|
|
|
1988 |
If NNrtag_id <> "" AND NNpv_id <> "" Then
|
|
|
1989 |
Query_String = " SELECT dnr.pv_id FROM DO_NOT_RIPPLE dnr WHERE dnr.RTAG_ID ="& NNrtag_id &" AND dnr.PV_ID ="& NNpv_id
|
|
|
1990 |
|
|
|
1991 |
Set rsTemp = OraDatabase.DbCreateDynaset(Query_String, cint(0))
|
|
|
1992 |
If rsTemp.RecordCount <> 0 Then
|
|
|
1993 |
isInDoNotRippleTable = TRUE
|
|
|
1994 |
End If
|
|
|
1995 |
rsTemp.Close()
|
|
|
1996 |
set rsTemp = nothing
|
|
|
1997 |
End If
|
|
|
1998 |
End Function
|
| 145 |
ghuddy |
1999 |
'----------------------------------------------------------------------------------------------------------------------
|
| 6176 |
dpurdie |
2000 |
' Number of active (Not paused, Not Disabled) daemon configured for a given Release
|
|
|
2001 |
Function activeDaemonCount ( NNrtag_id )
|
|
|
2002 |
Dim rsTemp, Query_String
|
|
|
2003 |
|
|
|
2004 |
activeDaemonCount = 0
|
|
|
2005 |
|
|
|
2006 |
If NNrtag_id <> "" Then
|
| 6873 |
dpurdie |
2007 |
Query_String = "SELECT count(*) as Count FROM release_config rc, run_level rl WHERE rc.rtag_id = " & NNrtag_id & " AND rc.RCON_ID = rl.rcon_id(+) AND NVL(rl.pause, 0 ) = 0"
|
| 6176 |
dpurdie |
2008 |
|
|
|
2009 |
Set rsTemp = OraDatabase.DbCreateDynaset(Query_String, cint(0))
|
|
|
2010 |
If rsTemp.RecordCount <> 0 Then
|
|
|
2011 |
activeDaemonCount = rsTemp("Count")
|
|
|
2012 |
End If
|
|
|
2013 |
rsTemp.Close()
|
|
|
2014 |
set rsTemp = nothing
|
|
|
2015 |
End If
|
| 7022 |
dpurdie |
2016 |
End Function
|
|
|
2017 |
'----------------------------------------------------------------------------------------------------------------------
|
|
|
2018 |
Function hasFutureBuild( NNrtag_id, NNpv_id )
|
|
|
2019 |
Dim rsTemp, Query_String
|
| 6176 |
dpurdie |
2020 |
|
| 7022 |
dpurdie |
2021 |
hasFutureBuild = FALSE
|
|
|
2022 |
|
|
|
2023 |
If NNrtag_id <> "" AND NNpv_id <> "" Then
|
|
|
2024 |
|
|
|
2025 |
Query_String = " SELECT * FROM DAEMON_INSTRUCTIONS di WHERE di.RTAG_ID ="& NNrtag_id &" AND di.PV_ID ="& NNpv_id & " AND OP_CODE = " & OP_CODE_2_FUTURE_BUILD
|
|
|
2026 |
|
|
|
2027 |
Set rsTemp = OraDatabase.DbCreateDynaset(Query_String, cint(0))
|
|
|
2028 |
If rsTemp.RecordCount <> 0 Then
|
|
|
2029 |
hasFutureBuild = TRUE
|
|
|
2030 |
End If
|
|
|
2031 |
rsTemp.Close()
|
|
|
2032 |
set rsTemp = nothing
|
|
|
2033 |
End If
|
| 6176 |
dpurdie |
2034 |
End Function
|
| 7022 |
dpurdie |
2035 |
|
| 6176 |
dpurdie |
2036 |
'----------------------------------------------------------------------------------------------------------------------
|
| 7022 |
dpurdie |
2037 |
Function isBuilding( NNpv_id )
|
|
|
2038 |
Dim rsTemp, Query_String
|
|
|
2039 |
|
|
|
2040 |
isBuilding = FALSE
|
|
|
2041 |
|
|
|
2042 |
If NNpv_id <> "" Then
|
|
|
2043 |
Query_String = _
|
|
|
2044 |
"SELECT unique rl.CURRENT_PV_ID" &_
|
|
|
2045 |
" FROM RELEASE_CONFIG rc, RELEASE_TAGS rt, RUN_LEVEL rl " &_
|
|
|
2046 |
" WHERE rt.RTAG_ID = rc.RTAG_ID " &_
|
|
|
2047 |
" AND rc.bmcon_id is not null" &_
|
|
|
2048 |
" AND rt.OFFICIAL in ( 'N', 'R', 'C')" &_
|
|
|
2049 |
" AND rl.RCON_ID(+) = rc.RCON_ID" &_
|
|
|
2050 |
" AND rl.CURRENT_PKG_ID_BEING_BUILT is not null" &_
|
|
|
2051 |
" AND NVL(rl.PAUSE,0) < 2" &_
|
|
|
2052 |
" AND rl.CURRENT_PV_ID = " & NNpv_id
|
|
|
2053 |
|
|
|
2054 |
Set rsTemp = OraDatabase.DbCreateDynaset(Query_String, cint(0))
|
|
|
2055 |
If rsTemp.RecordCount <> 0 Then
|
|
|
2056 |
isBuilding = TRUE
|
|
|
2057 |
End If
|
|
|
2058 |
rsTemp.Close()
|
|
|
2059 |
set rsTemp = nothing
|
|
|
2060 |
End If
|
|
|
2061 |
End Function
|
|
|
2062 |
|
|
|
2063 |
'----------------------------------------------------------------------------------------------------------------------
|
| 145 |
ghuddy |
2064 |
Function pv_id_exists( nPv_id )
|
|
|
2065 |
Dim rsTemp, Query_String
|
| 143 |
ghuddy |
2066 |
|
| 145 |
ghuddy |
2067 |
If NOT IsNull( nPv_id ) AND nPv_id <> "" Then
|
|
|
2068 |
Query_String = _
|
|
|
2069 |
" SELECT pv.pv_id "&_
|
|
|
2070 |
" FROM PACKAGE_VERSIONS pv"&_
|
|
|
2071 |
" WHERE pv.pv_id = "& nPv_id
|
|
|
2072 |
Set rsTemp = OraDatabase.DbCreateDynaset( Query_String, cint(0))
|
|
|
2073 |
If (NOT rsTemp.BOF ) AND (NOT rsTemp.EOF) Then
|
|
|
2074 |
pv_id_exists = TRUE
|
|
|
2075 |
Else
|
|
|
2076 |
pv_id_exists = FALSE
|
|
|
2077 |
End If
|
|
|
2078 |
rsTemp.Close()
|
|
|
2079 |
set rsTemp = nothing
|
|
|
2080 |
Else
|
|
|
2081 |
pv_id_exists = FALSE
|
|
|
2082 |
End If
|
|
|
2083 |
End Function
|
|
|
2084 |
'----------------------------------------------------------------------------------------------------------------------
|
|
|
2085 |
Function is_daemon_enabled_release( NNrtag_id, defaultReturnValue )
|
|
|
2086 |
Dim rsTemp, Query_String
|
| 143 |
ghuddy |
2087 |
|
| 145 |
ghuddy |
2088 |
If NOT IsNull( NNrtag_id ) AND NNrtag_id <> "" Then
|
| 143 |
ghuddy |
2089 |
|
| 145 |
ghuddy |
2090 |
Query_String = _
|
| 4293 |
dpurdie |
2091 |
" SELECT rc.bmcon_id "&_
|
| 145 |
ghuddy |
2092 |
" FROM RELEASE_CONFIG rc"&_
|
|
|
2093 |
" WHERE rc.rtag_id = "& NNrtag_id
|
|
|
2094 |
Set rsTemp = OraDatabase.DbCreateDynaset( Query_String, cint(0))
|
|
|
2095 |
|
|
|
2096 |
is_daemon_enabled_release = FALSE
|
|
|
2097 |
While ((NOT rsTemp.BOF) AND (NOT rsTemp.EOF) AND (is_daemon_enabled_release = FALSE))
|
| 4293 |
dpurdie |
2098 |
If (NOT IsNull(rsTemp("bmcon_id"))) AND (rsTemp("bmcon_id") <> "") Then
|
| 145 |
ghuddy |
2099 |
is_daemon_enabled_release = TRUE
|
|
|
2100 |
End If
|
|
|
2101 |
rsTemp.MoveNext
|
|
|
2102 |
WEnd
|
|
|
2103 |
|
|
|
2104 |
rsTemp.Close()
|
|
|
2105 |
set rsTemp = nothing
|
|
|
2106 |
Else
|
|
|
2107 |
is_daemon_enabled_release = defaultReturnValue
|
|
|
2108 |
End If
|
|
|
2109 |
End Function
|
| 147 |
ghuddy |
2110 |
'--------------------------------------------------------------------------------------------------------------------------
|
|
|
2111 |
' Convert release state into a meaningful string
|
|
|
2112 |
Function Get_Official( nOfficial )
|
|
|
2113 |
If nOfficial = "N" Then
|
|
|
2114 |
Get_Official = "Open"
|
|
|
2115 |
ElseIf nOfficial = "A" Then
|
|
|
2116 |
Get_Official = "Archive"
|
|
|
2117 |
ElseIf nOfficial = "C" Then
|
|
|
2118 |
Get_Official = "CCB"
|
|
|
2119 |
ElseIf nOfficial = "R" Then
|
|
|
2120 |
Get_Official = "Restricted"
|
|
|
2121 |
ElseIf nOfficial = "Y" Then
|
|
|
2122 |
Get_Official = "Closed"
|
| 5623 |
dpurdie |
2123 |
ElseIf nOfficial = "P" Then
|
|
|
2124 |
Get_Official = "Preserved"
|
| 147 |
ghuddy |
2125 |
Else
|
|
|
2126 |
Get_Official = "?"
|
|
|
2127 |
End If
|
|
|
2128 |
End Function
|
| 151 |
ghuddy |
2129 |
'-----------------------------------------------------------------------------------------------------------------------------
|
|
|
2130 |
Function Get_Pkg_Id_For_Pv_Id ( NNpv_id )
|
|
|
2131 |
Dim rsTemp, Query_String
|
| 145 |
ghuddy |
2132 |
|
| 151 |
ghuddy |
2133 |
Get_Pkg_Id_For_Pv_Id = ""
|
| 145 |
ghuddy |
2134 |
|
| 151 |
ghuddy |
2135 |
If NOT IsNull(NNpv_id) AND NNpv_id <> "" Then
|
|
|
2136 |
Query_String = _
|
|
|
2137 |
"SELECT pkg_id FROM package_versions WHERE pv_id = "& NNpv_id
|
|
|
2138 |
|
|
|
2139 |
Set rsTemp = OraDatabase.DbCreateDynaset( Query_String, cint(0))
|
|
|
2140 |
|
|
|
2141 |
If ((NOT rsTemp.BOF) AND (NOT rsTemp.EOF)) Then
|
|
|
2142 |
Get_Pkg_Id_For_Pv_Id = rsTemp("pkg_id")
|
|
|
2143 |
End If
|
|
|
2144 |
rsTemp.Close
|
|
|
2145 |
Set rsTemp = nothing
|
|
|
2146 |
End If
|
|
|
2147 |
|
|
|
2148 |
End Function
|
|
|
2149 |
|
| 171 |
brianf |
2150 |
'-----------------------------------------------------------------------------------------------------------------------------
|
| 161 |
iaugusti |
2151 |
Function iif(bFlag, sTrueStr, sFalseStr)
|
|
|
2152 |
if bFlag then
|
|
|
2153 |
iif = sTrueStr
|
|
|
2154 |
else
|
|
|
2155 |
iif = sFalseStr
|
|
|
2156 |
end if
|
|
|
2157 |
End Function
|
| 151 |
ghuddy |
2158 |
|
| 5939 |
dpurdie |
2159 |
'-----------------------------------------------------------------------------------------------------------------------------
|
|
|
2160 |
Function EmptyToNull (sVal)
|
| 5952 |
dpurdie |
2161 |
If isNull(sVal) Then
|
|
|
2162 |
EmptyToNull = NULL
|
|
|
2163 |
ElseIf sval <> "" Then
|
| 5939 |
dpurdie |
2164 |
EmptyToNull = sVal
|
|
|
2165 |
Else
|
|
|
2166 |
EmptyToNull = NULL
|
|
|
2167 |
End If
|
|
|
2168 |
End Function
|
|
|
2169 |
|
| 5964 |
dpurdie |
2170 |
'-----------------------------------------------------------------------------------------------------------------------------
|
|
|
2171 |
Function EmptyToNullString ( sName, sVal)
|
|
|
2172 |
If isNull(sVal) Then
|
|
|
2173 |
EmptyToNullString = sName & " is NULL"
|
|
|
2174 |
ElseIf sval <> "" Then
|
|
|
2175 |
EmptyToNullString = sName & "='" & sVal & "'"
|
|
|
2176 |
Else
|
|
|
2177 |
EmptyToNullString = sName & " is NULL"
|
|
|
2178 |
End If
|
|
|
2179 |
End Function
|
|
|
2180 |
|
| 171 |
brianf |
2181 |
'--------------------------------------------------------------------------------------------------------------------------
|
|
|
2182 |
' Sets the state of all build daemons of the specified release
|
|
|
2183 |
Sub SetDaemonStates (artag_id,astate)
|
|
|
2184 |
On Error Resume Next
|
|
|
2185 |
OraDatabase.Parameters.Add "RTAG_ID", artag_id, ORAPARM_INPUT, ORATYPE_NUMBER
|
|
|
2186 |
OraDatabase.Parameters.Add "NSTATE", astate, ORAPARM_INPUT, ORATYPE_NUMBER
|
|
|
2187 |
|
|
|
2188 |
objEH.TryORA ( OraSession )
|
|
|
2189 |
|
|
|
2190 |
OraDatabase.ExecuteSQL _
|
|
|
2191 |
"BEGIN PK_BUILDAPI.SET_DAEMON_STATES(:RTAG_ID,:NSTATE); END;"
|
|
|
2192 |
|
|
|
2193 |
objEH.CatchORA ( OraSession )
|
|
|
2194 |
|
| 5952 |
dpurdie |
2195 |
OraDatabase.Parameters.Remove "RTAG_ID"
|
| 171 |
brianf |
2196 |
OraDatabase.Parameters.Remove "NSTATE"
|
|
|
2197 |
End Sub
|
|
|
2198 |
|
| 183 |
brianf |
2199 |
'----------------------------------------------
|
|
|
2200 |
'Returns true if the specified package version exists in the specified table
|
|
|
2201 |
Function PackageExists(RtagId, pvId, stable)
|
|
|
2202 |
Dim rsTemp
|
|
|
2203 |
Dim sqry
|
| 185 |
brianf |
2204 |
If RtagId = "" Then
|
|
|
2205 |
PackageExists = False
|
|
|
2206 |
Else
|
|
|
2207 |
sqry = "SELECT * FROM " & stable & " WHERE rtag_id = " & RtagId & " AND pv_id = " & pvId
|
|
|
2208 |
Set rsTemp = OraDatabase.DbCreateDynaset(sqry,CInt(0))
|
|
|
2209 |
PackageExists = rsTemp.RecordCount > 0
|
|
|
2210 |
rsTemp.Close()
|
|
|
2211 |
Set rsTemp = Nothing
|
|
|
2212 |
End If
|
| 183 |
brianf |
2213 |
End Function
|
|
|
2214 |
|
| 4710 |
dpurdie |
2215 |
'----------------------------------------------
|
|
|
2216 |
' Test that specified package/version exists in dpkg_archive
|
| 5245 |
dpurdie |
2217 |
' Can also test presence of the archive
|
| 4710 |
dpurdie |
2218 |
' Use http interface as it does not require authetication
|
|
|
2219 |
Function testArchiveAccessPkg(pkgName, pkgVersion)
|
|
|
2220 |
Dim oXMLHTTP
|
|
|
2221 |
Dim testUrl
|
|
|
2222 |
|
|
|
2223 |
testArchiveAccessPkg = False
|
| 6146 |
dpurdie |
2224 |
testUrl = HTTP_PKG_ARCHIVE
|
|
|
2225 |
|
|
|
2226 |
testUrl = testUrl & "/cgi-bin/testPackage.pl"
|
| 4710 |
dpurdie |
2227 |
If pkgName <> "" Then
|
| 6146 |
dpurdie |
2228 |
testUrl = testUrl & "?path=" & pkgName & "/" & pkgVersion
|
| 4710 |
dpurdie |
2229 |
End If
|
|
|
2230 |
Set oXMLHTTP = CreateObject("MSXML2.ServerXMLHTTP.3.0")
|
|
|
2231 |
|
| 4756 |
dpurdie |
2232 |
' Use error handling in case dpkg_archive is not available
|
| 4710 |
dpurdie |
2233 |
' Use HEAD to test existence
|
| 4756 |
dpurdie |
2234 |
Err.Clear
|
|
|
2235 |
On Error Resume Next
|
| 6146 |
dpurdie |
2236 |
oXMLHTTP.Open "GET", testUrl, False
|
| 4710 |
dpurdie |
2237 |
oXMLHTTP.Send
|
|
|
2238 |
|
| 4756 |
dpurdie |
2239 |
' Do not combine the next two If statments - it will not work
|
|
|
2240 |
If Err.Number = 0 Then
|
|
|
2241 |
If oXMLHTTP.Status = 200 Then
|
| 6146 |
dpurdie |
2242 |
If InStr(1,oXMLHTTP.responseText, "::FOUND::", 1) = 1 Then
|
|
|
2243 |
testArchiveAccessPkg = True
|
|
|
2244 |
End If
|
| 4756 |
dpurdie |
2245 |
End If
|
| 4710 |
dpurdie |
2246 |
End If
|
| 6146 |
dpurdie |
2247 |
|
| 4756 |
dpurdie |
2248 |
On Error Goto 0
|
| 4710 |
dpurdie |
2249 |
End Function
|
| 5008 |
dpurdie |
2250 |
|
|
|
2251 |
'--------------------------------------------------------------------------------------------------------------------------
|
|
|
2252 |
' Like Cint, but handles NULL by replacing it with a default value
|
|
|
2253 |
Function NiceInt( val, def)
|
| 5045 |
dpurdie |
2254 |
If val <> "" AND IsNumeric(val) Then
|
| 5008 |
dpurdie |
2255 |
NiceInt = CInt(val)
|
|
|
2256 |
Else
|
|
|
2257 |
NiceInt = def
|
|
|
2258 |
End If
|
|
|
2259 |
End Function
|
| 5143 |
dpurdie |
2260 |
|
|
|
2261 |
'--------------------------------------------------------------------------------------------------------------------------
|
| 6627 |
dpurdie |
2262 |
' Like CLng, but handles NULL by replacing it with a default value
|
|
|
2263 |
Function NiceCLng( val, def)
|
|
|
2264 |
If val <> "" AND IsNumeric(val) Then
|
|
|
2265 |
NiceCLng = CLng(val)
|
|
|
2266 |
Else
|
|
|
2267 |
NiceCLng = def
|
|
|
2268 |
End If
|
|
|
2269 |
End Function
|
| 6786 |
dpurdie |
2270 |
|
| 6627 |
dpurdie |
2271 |
'--------------------------------------------------------------------------------------------------------------------------
|
| 7277 |
dpurdie |
2272 |
' Like CStr, but handles NULL by replacing it with a default value
|
|
|
2273 |
Function NiceCStr( val, def)
|
|
|
2274 |
If IsNull(val) Then
|
|
|
2275 |
NiceCStr = def
|
|
|
2276 |
ElseIf IsEmpty(val) Then
|
|
|
2277 |
NiceCStr = def
|
|
|
2278 |
Else
|
|
|
2279 |
NiceCStr = CStr(val)
|
|
|
2280 |
End If
|
|
|
2281 |
End Function
|
|
|
2282 |
|
|
|
2283 |
'--------------------------------------------------------------------------------------------------------------------------
|
| 6786 |
dpurdie |
2284 |
' Convert a duration(seconds) into days,hours and seconds. eg 10d 3h 13m 15s
|
| 7240 |
dpurdie |
2285 |
Function NiceDuration(nDuration)
|
| 6786 |
dpurdie |
2286 |
NiceDuration = ""
|
|
|
2287 |
Dim joiner : joiner = ""
|
|
|
2288 |
Dim unit
|
| 7240 |
dpurdie |
2289 |
Dim duration : duration = nDuration
|
| 6786 |
dpurdie |
2290 |
If duration > (60 * 60 * 24) Then
|
|
|
2291 |
unit = Int(duration / (60 * 60 * 24))
|
|
|
2292 |
duration = duration MOD (60 * 60 * 24)
|
|
|
2293 |
NiceDuration = NiceDuration & joiner & unit & "d"
|
| 7240 |
dpurdie |
2294 |
joiner = " "
|
| 6786 |
dpurdie |
2295 |
End If
|
|
|
2296 |
|
|
|
2297 |
If duration > (60 * 60) Then
|
|
|
2298 |
unit = Int(duration / (60 * 60))
|
|
|
2299 |
duration = duration MOD (60 * 60)
|
|
|
2300 |
NiceDuration = NiceDuration & joiner & unit & "h"
|
| 7240 |
dpurdie |
2301 |
joiner = " "
|
| 6786 |
dpurdie |
2302 |
End If
|
|
|
2303 |
|
|
|
2304 |
If duration > (60) Then
|
|
|
2305 |
unit = Int(duration / (60))
|
|
|
2306 |
duration = duration MOD (60)
|
|
|
2307 |
NiceDuration = NiceDuration & joiner & unit & "m"
|
| 7240 |
dpurdie |
2308 |
joiner = " "
|
| 6786 |
dpurdie |
2309 |
End If
|
|
|
2310 |
|
|
|
2311 |
NiceDuration = NiceDuration & joiner & duration & "s"
|
|
|
2312 |
End Function
|
|
|
2313 |
|
|
|
2314 |
'--------------------------------------------------------------------------------------------------------------------------
|
| 7250 |
dpurdie |
2315 |
' Quick and ugly code to attempt to remove nasty characters from strings
|
|
|
2316 |
' In particular some unicode characters that mess with the json decoder
|
|
|
2317 |
Function CleanUpJson (input)
|
|
|
2318 |
Dim objRegExp, outputStr
|
|
|
2319 |
Set objRegExp = New Regexp
|
|
|
2320 |
|
|
|
2321 |
objRegExp.IgnoreCase = True
|
|
|
2322 |
objRegExp.Global = True
|
|
|
2323 |
objRegExp.Pattern = "((?![\[\]\(\)\{\}\$-_?/""';:.,a-zA-Z0-9]).)+"
|
|
|
2324 |
outputStr = objRegExp.Replace(input, " ")
|
|
|
2325 |
|
|
|
2326 |
CleanUpJson = outputStr
|
|
|
2327 |
End Function
|
|
|
2328 |
|
|
|
2329 |
'--------------------------------------------------------------------------------------------------------------------------
|
| 5143 |
dpurdie |
2330 |
' Test if package can be added to a release
|
|
|
2331 |
' Really tests if a a package of this packages alias can be
|
|
|
2332 |
' manipulated in this release
|
|
|
2333 |
' True: Package alias can be added/replaced in release
|
|
|
2334 |
Function canAddToRelease ( nRtagId, nPvId )
|
| 5156 |
dpurdie |
2335 |
|
|
|
2336 |
' If we don't enough parameters then assume we can add package
|
|
|
2337 |
If nRtagId = "" OR nPvId = "" Then
|
|
|
2338 |
canAddToRelease = TRUE
|
|
|
2339 |
Exit Function
|
|
|
2340 |
End If
|
|
|
2341 |
|
| 5143 |
dpurdie |
2342 |
On Error Resume Next
|
|
|
2343 |
OraDatabase.Parameters.Add "RTAG_ID", nRtagId, ORAPARM_INPUT, ORATYPE_NUMBER
|
|
|
2344 |
OraDatabase.Parameters.Add "PV_ID", nPvId, ORAPARM_INPUT, ORATYPE_NUMBER
|
|
|
2345 |
OraDatabase.Parameters.Add "RETURN_CODE", null, ORAPARM_OUTPUT, ORATYPE_NUMBER
|
|
|
2346 |
|
|
|
2347 |
objEH.TryORA ( OraSession )
|
|
|
2348 |
|
|
|
2349 |
OraDatabase.ExecuteSQL _
|
|
|
2350 |
"BEGIN :RETURN_CODE := PK_RELEASE.CAN_ADD_PKG_TO_RELEASE(:RTAG_ID,:PV_ID); END;"
|
|
|
2351 |
|
|
|
2352 |
If CInt(OraDatabase.Parameters("RETURN_CODE").Value) = 0 Then
|
|
|
2353 |
canAddToRelease = FALSE
|
|
|
2354 |
Else
|
|
|
2355 |
canAddToRelease = TRUE
|
|
|
2356 |
End If
|
|
|
2357 |
|
|
|
2358 |
objEH.CatchORA ( OraSession )
|
|
|
2359 |
|
|
|
2360 |
OraDatabase.Parameters.Remove "RETURN_CODE"
|
|
|
2361 |
OraDatabase.Parameters.Remove "RTAG_ID"
|
|
|
2362 |
OraDatabase.Parameters.Remove "PV_ID"
|
|
|
2363 |
End Function
|
| 5177 |
dpurdie |
2364 |
'--------------------------------------------------------------------------------------------------------------------------
|
|
|
2365 |
' Returns either the value of the Request('tag') or the default value
|
|
|
2366 |
Function RequestDefault(stag, sdefault)
|
|
|
2367 |
If Request(stag) <> "" Then
|
|
|
2368 |
RequestDefault = Request(stag)
|
|
|
2369 |
Else
|
|
|
2370 |
RequestDefault = sdefault
|
|
|
2371 |
End If
|
|
|
2372 |
End Function
|
| 5178 |
dpurdie |
2373 |
'--------------------------------------------------------------------------------------------------------------------------
|
| 6879 |
dpurdie |
2374 |
' Returns either the value of the Request('tag') or the default value
|
|
|
2375 |
Function RequestBool(stag, sdefault)
|
|
|
2376 |
Dim val
|
|
|
2377 |
If Request(stag) <> "" Then
|
|
|
2378 |
RequestBool = FALSE
|
|
|
2379 |
val = UCase( Request(stag))
|
|
|
2380 |
If val = "Y" or val = "TRUE" Then
|
|
|
2381 |
RequestBool = TRUE
|
|
|
2382 |
ElseIf IsNumeric(val) Then
|
|
|
2383 |
If val > 0 Then
|
|
|
2384 |
RequestBool = TRUE
|
|
|
2385 |
End If
|
|
|
2386 |
End If
|
|
|
2387 |
Else
|
|
|
2388 |
RequestBool = sdefault
|
|
|
2389 |
End If
|
|
|
2390 |
End Function
|
|
|
2391 |
|
|
|
2392 |
'--------------------------------------------------------------------------------------------------------------------------
|
| 5178 |
dpurdie |
2393 |
' Data structure to assist in the Release Mode Transition Check
|
|
|
2394 |
' Tuples (FromCondition, ToCondition) '-' == Always
|
|
|
2395 |
' Order matches ReleaseModeAccessCheck
|
|
|
2396 |
'
|
|
|
2397 |
Dim RMTD_Data
|
|
|
2398 |
RMTD_Data = Array(Array("-" ,"-"), _
|
|
|
2399 |
Array("ChangeModeFromRestrictive","-"), _
|
|
|
2400 |
Array("ChangeModeFromRestrictive","-"), _
|
|
|
2401 |
Array("ChangeModeFromClosed" ,"ChangeModeToClosed"), _
|
|
|
2402 |
Array("ChangeModeFromClosed" ,"ChangeModeToPreserved"), _
|
|
|
2403 |
Array("ChangeModeFromArchived" ,"ChangeModeToArchived") _
|
|
|
2404 |
)
|
|
|
2405 |
'-------------------------------------------------
|
|
|
2406 |
' Function: ReleaseMode2Index
|
|
|
2407 |
' Description: Convert a enumDB_RELEASE_IN_*** into an index into the above array
|
|
|
2408 |
'
|
|
|
2409 |
Function ReleaseMode2Index( eReleaseMode )
|
|
|
2410 |
If eReleaseMode = enumDB_RELEASE_IN_OPEN_MODE Then
|
|
|
2411 |
ReleaseMode2Index = 0
|
|
|
2412 |
ElseIf eReleaseMode = enumDB_RELEASE_IN_RESTRICTIVE_MODE Then
|
|
|
2413 |
ReleaseMode2Index = 1
|
|
|
2414 |
ElseIf eReleaseMode = enumDB_RELEASE_IN_CCB_MODE Then
|
|
|
2415 |
ReleaseMode2Index = 2
|
|
|
2416 |
ElseIf eReleaseMode = enumDB_RELEASE_IN_CLOSED_MODE Then
|
|
|
2417 |
ReleaseMode2Index = 3
|
|
|
2418 |
ElseIf eReleaseMode = enumDB_RELEASE_IN_PRESERVE_MODE Then
|
|
|
2419 |
ReleaseMode2Index = 4
|
|
|
2420 |
ElseIf eReleaseMode = enumDB_RELEASE_IN_ARCHIVE_MODE Then
|
|
|
2421 |
ReleaseMode2Index = 5
|
|
|
2422 |
Else
|
|
|
2423 |
ReleaseMode2Index = -1
|
|
|
2424 |
End If
|
|
|
2425 |
End Function
|
|
|
2426 |
|
|
|
2427 |
'-------------------------------------------------
|
|
|
2428 |
' Function: ReleaseModeAccessCheck
|
|
|
2429 |
' Description: Determine if the user can change the Release Mode
|
|
|
2430 |
' from - Start at this Release Mode
|
|
|
2431 |
' to - Can the user transition to this mode
|
|
|
2432 |
' Returns: True - yes they can
|
|
|
2433 |
'
|
|
|
2434 |
Function ReleaseModeAccessCheck( from, toMode )
|
|
|
2435 |
Dim fromIndex : fromIndex = ReleaseMode2Index(from)
|
|
|
2436 |
Dim toIndex : toIndex = ReleaseMode2Index(toMode)
|
|
|
2437 |
ReleaseModeAccessCheck = False
|
|
|
2438 |
|
|
|
2439 |
' Can't Change to same mode
|
|
|
2440 |
If from = toMode Then
|
|
|
2441 |
Exit Function
|
|
|
2442 |
End If
|
|
|
2443 |
|
|
|
2444 |
On Error Resume Next
|
|
|
2445 |
Dim fromAccess : fromAccess = ""
|
|
|
2446 |
Dim toAccess : toAccess = ""
|
|
|
2447 |
|
|
|
2448 |
' Get access type from table
|
|
|
2449 |
' "" - No access (internal error)
|
|
|
2450 |
' "-" - All Access allowed (if user is logged in )
|
|
|
2451 |
' Else - Name of a canActionControlInProject
|
|
|
2452 |
fromAccess = RMTD_Data(fromIndex)(0)
|
|
|
2453 |
toAccess = RMTD_Data(toIndex)(1)
|
|
|
2454 |
|
|
|
2455 |
' Check From Condition
|
|
|
2456 |
If fromAccess = "-" Then
|
|
|
2457 |
ReleaseModeAccessCheck = canActionInProject()
|
|
|
2458 |
ElseIf fromAccess <> "" Then
|
|
|
2459 |
ReleaseModeAccessCheck = canActionControlInProject(fromAccess)
|
|
|
2460 |
End If
|
|
|
2461 |
|
|
|
2462 |
If NOT ReleaseModeAccessCheck Then
|
|
|
2463 |
Exit Function
|
|
|
2464 |
End If
|
|
|
2465 |
|
|
|
2466 |
' Check to Condition
|
|
|
2467 |
If toAccess = "-" Then
|
|
|
2468 |
ReleaseModeAccessCheck = canActionInProject()
|
|
|
2469 |
ElseIf toAccess <> "" Then
|
|
|
2470 |
ReleaseModeAccessCheck = canActionControlInProject(toAccess)
|
|
|
2471 |
End If
|
|
|
2472 |
|
|
|
2473 |
End Function
|
|
|
2474 |
|
|
|
2475 |
'-------------------------------------------------
|
|
|
2476 |
' Function: releaseIsClosed
|
|
|
2477 |
' Description: Determine if a release can be modified at all
|
|
|
2478 |
' Returns: True: Release cannot be modified
|
|
|
2479 |
' ie: it is NOT in a state that allows modification
|
|
|
2480 |
'
|
|
|
2481 |
Function releaseIsClosed(eReleaseMode)
|
|
|
2482 |
If eReleaseMode = enumDB_RELEASE_IN_OPEN_MODE Then
|
|
|
2483 |
releaseIsClosed = False
|
|
|
2484 |
ElseIf eReleaseMode = enumDB_RELEASE_IN_RESTRICTIVE_MODE Then
|
|
|
2485 |
releaseIsClosed = False
|
|
|
2486 |
ElseIf eReleaseMode = enumDB_RELEASE_IN_CCB_MODE Then
|
|
|
2487 |
releaseIsClosed = False
|
|
|
2488 |
ElseIf eReleaseMode = enumDB_RELEASE_IN_CLOSED_MODE Then
|
|
|
2489 |
releaseIsClosed = True
|
|
|
2490 |
ElseIf eReleaseMode = enumDB_RELEASE_IN_PRESERVE_MODE Then
|
|
|
2491 |
releaseIsClosed = True
|
|
|
2492 |
ElseIf eReleaseMode = enumDB_RELEASE_IN_ARCHIVE_MODE Then
|
|
|
2493 |
releaseIsClosed = True
|
|
|
2494 |
Else
|
|
|
2495 |
releaseIsClosed = True
|
|
|
2496 |
End If
|
|
|
2497 |
End Function
|
|
|
2498 |
|
|
|
2499 |
'-------------------------------------------------
|
|
|
2500 |
' Function: releaseIsWritable
|
|
|
2501 |
' Description: Determine if a release can be modified
|
|
|
2502 |
' Returns: True: Release can be modified
|
|
|
2503 |
' ie: it is in a state that allows modification
|
|
|
2504 |
'
|
|
|
2505 |
Function releaseIsWritable(eReleaseMode)
|
|
|
2506 |
If eReleaseMode = enumDB_RELEASE_IN_OPEN_MODE AND canActionInProject() Then
|
|
|
2507 |
releaseIsWritable = True
|
|
|
2508 |
ElseIf eReleaseMode = enumDB_RELEASE_IN_RESTRICTIVE_MODE AND canActionControlInProject("AlterReleaseContentsInRestrictiveMode") Then
|
|
|
2509 |
releaseIsWritable = True
|
|
|
2510 |
ElseIf eReleaseMode = enumDB_RELEASE_IN_CCB_MODE AND canActionControlInProject("AlterReleaseContentsInRestrictiveMode")Then
|
|
|
2511 |
releaseIsWritable = True
|
|
|
2512 |
ElseIf eReleaseMode = enumDB_RELEASE_IN_CLOSED_MODE Then
|
|
|
2513 |
releaseIsWritable = False
|
|
|
2514 |
ElseIf eReleaseMode = enumDB_RELEASE_IN_PRESERVE_MODE Then
|
|
|
2515 |
releaseIsWritable = False
|
|
|
2516 |
ElseIf eReleaseMode = enumDB_RELEASE_IN_ARCHIVE_MODE Then
|
|
|
2517 |
releaseIsWritable = False
|
|
|
2518 |
Else
|
|
|
2519 |
releaseIsWritable = False
|
|
|
2520 |
End If
|
|
|
2521 |
End Function
|
|
|
2522 |
|
|
|
2523 |
'-------------------------------------------------
|
|
|
2524 |
' Function: releaseIsMergable
|
|
|
2525 |
' Description: Determine if the user can 'Merge' into the release
|
|
|
2526 |
' Returns: True: Release can be modified
|
|
|
2527 |
' ie: it is in a state that allows modification
|
|
|
2528 |
'
|
|
|
2529 |
Function releaseIsMergable(eReleaseMode)
|
| 5294 |
dpurdie |
2530 |
If eReleaseMode = enumDB_RELEASE_IN_OPEN_MODE AND canActionInProject() Then
|
| 5178 |
dpurdie |
2531 |
releaseIsMergable = True
|
|
|
2532 |
ElseIf eReleaseMode = enumDB_RELEASE_IN_RESTRICTIVE_MODE AND canActionControlInProject("MergeRelease") Then
|
|
|
2533 |
releaseIsMergable = True
|
|
|
2534 |
ElseIf eReleaseMode = enumDB_RELEASE_IN_CCB_MODE AND canActionControlInProject("MergeReleaseForCCB") Then
|
|
|
2535 |
releaseIsMergable = True
|
|
|
2536 |
Else
|
|
|
2537 |
releaseIsMergable = False
|
|
|
2538 |
End If
|
|
|
2539 |
End Function
|
| 5251 |
dpurdie |
2540 |
'-------------------------------------------------
|
|
|
2541 |
' Function: RenderLxrStateString
|
|
|
2542 |
' Description: Return a string to show the current LXR state
|
| 5328 |
dpurdie |
2543 |
Function RenderLxrStateString(rtagid, lxr, lxrState, official, txt)
|
| 5251 |
dpurdie |
2544 |
If lxr = "N" AND lxrState = "N" Then
|
|
|
2545 |
RenderLxrStateString = ""
|
|
|
2546 |
Else
|
|
|
2547 |
Dim lxrUrl : lxrUrl = LXR_URL & "/" & rtagid
|
| 5328 |
dpurdie |
2548 |
Dim image, hover, isClosed
|
|
|
2549 |
|
|
|
2550 |
If lxrState = "N" Then
|
|
|
2551 |
If releaseIsClosed(official) Then lxrState = "A"
|
|
|
2552 |
End If
|
|
|
2553 |
|
| 5251 |
dpurdie |
2554 |
Select Case lxrState
|
|
|
2555 |
Case "I"
|
|
|
2556 |
image = "LXRlogo64.jpeg"
|
|
|
2557 |
hover = "LXR Index available"
|
|
|
2558 |
Case "C"
|
|
|
2559 |
image = "LXRlogo64_off.jpeg"
|
|
|
2560 |
hover = "LXR Index available, but no longer updated"
|
|
|
2561 |
Case "N"
|
|
|
2562 |
image = "LXRlogo64_progress.jpeg"
|
|
|
2563 |
hover = "LXR Requested, but not yet available"
|
| 5328 |
dpurdie |
2564 |
Case "A"
|
|
|
2565 |
image = "LXRlogo64_off.jpeg"
|
|
|
2566 |
hover = "LXR no longer available. Release is no longer open"
|
| 5251 |
dpurdie |
2567 |
Case Else
|
|
|
2568 |
image = "LXRlogo64_progress.jpeg"
|
|
|
2569 |
hover = "LXR Requested, unknown State:(" & lxrState &")"
|
|
|
2570 |
End Select
|
| 7395 |
dpurdie |
2571 |
RenderLxrStateString = "<a class=mmItem href='"&lxrUrl&"' title='"&hover&"'><img src=""images/"&image&""" height=16 border=0 vspace=0 hspace=0 style='vertical-align : bottom'>" & txt &"</a>"
|
| 5251 |
dpurdie |
2572 |
End If
|
| 7395 |
dpurdie |
2573 |
End Function
|
|
|
2574 |
|
|
|
2575 |
'-------------------------------------------------
|
|
|
2576 |
' Function: RenderS3SyncStateString
|
|
|
2577 |
' Description: Return a string to show the current S3 Sync state
|
|
|
2578 |
Function RenderS3SyncStateString(rtagid, s3Sync, official, txt)
|
|
|
2579 |
If s3Sync = "N" Then
|
|
|
2580 |
RenderS3SyncStateString = ""
|
|
|
2581 |
Else
|
|
|
2582 |
Dim image, hover, iClass
|
|
|
2583 |
iClass = ""
|
|
|
2584 |
If releaseIsClosed(official) Then s3Sync = "A"
|
|
|
2585 |
|
|
|
2586 |
Select Case s3Sync
|
|
|
2587 |
Case "Y"
|
|
|
2588 |
image = "AmazonS3.png"
|
|
|
2589 |
hover = "S3 Sync Active"
|
|
|
2590 |
Case "N"
|
|
|
2591 |
image = "AmazonS3.png"
|
|
|
2592 |
hover = "S3 Sync not enabled"
|
|
|
2593 |
Case "A"
|
|
|
2594 |
image = "AmazonS3.png"
|
|
|
2595 |
hover = "S3 Sync not active. Release is no longer open"
|
|
|
2596 |
iClass = "class=lessOpacity"
|
|
|
2597 |
Case Else
|
|
|
2598 |
image = "LXRlogo64_progress.jpeg"
|
|
|
2599 |
hover = "S3Sync unknown State:(" & s3Sync &")"
|
|
|
2600 |
End Select
|
|
|
2601 |
RenderS3SyncStateString = "<span title='"&hover&"'><img "& iClass &" src=""images/"&image&""" height=16 border=0 vspace=0 hspace=0 style='vertical-align : bottom'>" & txt & "</span>"
|
|
|
2602 |
End If
|
| 5251 |
dpurdie |
2603 |
End Function
|
| 7395 |
dpurdie |
2604 |
|
| 5178 |
dpurdie |
2605 |
|
| 5648 |
dpurdie |
2606 |
'-------------------------------------------------
|
|
|
2607 |
' Function: rippleFieldName
|
|
|
2608 |
' Description: Return a string to convert a ripple field state to a text name
|
|
|
2609 |
' bFlag is set to false if the state is unknown.
|
| 5671 |
dpurdie |
2610 |
Dim rippleFieldValues
|
|
|
2611 |
rippleFieldValues = Array ("M", "m", "p", "b", "L")
|
| 5648 |
dpurdie |
2612 |
Function rippleFieldName ( rstate, ByRef bFlag )
|
| 6121 |
dpurdie |
2613 |
If isNULL(rstate) Then
|
|
|
2614 |
rstate = "b"
|
|
|
2615 |
End If
|
|
|
2616 |
|
| 5648 |
dpurdie |
2617 |
bFlag = TRUE
|
|
|
2618 |
Select Case rstate
|
|
|
2619 |
Case "M"
|
|
|
2620 |
rippleFieldName = "Major Number"
|
|
|
2621 |
Case "m"
|
|
|
2622 |
rippleFieldName = "Minor Number"
|
|
|
2623 |
Case "p"
|
|
|
2624 |
rippleFieldName = "Patch Number"
|
|
|
2625 |
Case "b"
|
|
|
2626 |
rippleFieldName = "Build Number"
|
|
|
2627 |
Case "L"
|
|
|
2628 |
rippleFieldName = "Limited"
|
|
|
2629 |
Case Else
|
|
|
2630 |
rippleFieldName = "Invalid State"
|
|
|
2631 |
bFlag = FALSE
|
|
|
2632 |
End Select
|
|
|
2633 |
End Function
|
| 6610 |
dpurdie |
2634 |
'----------------------------------------------------
|
|
|
2635 |
' Function: emailField
|
|
|
2636 |
' Description: Generate a 'span' with email information
|
|
|
2637 |
' The mailto class is picked up the jquery for processing
|
|
|
2638 |
Function emailField(sName, sEmail)
|
|
|
2639 |
emailField = "<span title='Select Email Options' class='mailto txt_linked' data-email='" & sEmail & "'>" & sName & "</span>"
|
|
|
2640 |
End Function
|
| 6623 |
dpurdie |
2641 |
Function emailField3(sName, sEmail,sUname)
|
|
|
2642 |
emailField3 = "<span title='Select Email Options' class='mailto txt_linked' data-email='" & sEmail & "' data-uname='" & sUname & "'>" & sName & "</span>"
|
|
|
2643 |
End Function
|
|
|
2644 |
|
| 5952 |
dpurdie |
2645 |
'-----------------------------------------------------------------------------------------------------------------------------
|
| 6615 |
dpurdie |
2646 |
|
|
|
2647 |
Function ReleaseIcon ( cOfficial )
|
|
|
2648 |
|
|
|
2649 |
If cOfficial = "N" Then
|
|
|
2650 |
' Open Mode
|
|
|
2651 |
ReleaseIcon = LIMG_OPEN_MODE
|
|
|
2652 |
|
|
|
2653 |
ElseIf cOfficial = "R" Then
|
|
|
2654 |
' Restrictive Mode
|
|
|
2655 |
ReleaseIcon = LIMG_RESTRICTIVE_MODE
|
|
|
2656 |
|
|
|
2657 |
ElseIf cOfficial = "C" Then
|
|
|
2658 |
'CCB Mode
|
|
|
2659 |
ReleaseIcon = LIMG_CCB_MODE
|
|
|
2660 |
|
|
|
2661 |
ElseIf cOfficial = "Y" Then
|
|
|
2662 |
'Closed Mode
|
|
|
2663 |
ReleaseIcon = LIMG_CLOSED_MODE
|
|
|
2664 |
|
|
|
2665 |
ElseIf cOfficial = "O" Then
|
|
|
2666 |
'Closed Mode - With warning (aged)
|
|
|
2667 |
ReleaseIcon = LIMG_CLOSED_MODE_WARN
|
|
|
2668 |
|
|
|
2669 |
ElseIf cOfficial = "P" Then
|
|
|
2670 |
'Closed Mode - Archived, but don't purge
|
|
|
2671 |
ReleaseIcon = LIMG_PRESERVE_MODE
|
|
|
2672 |
|
|
|
2673 |
ElseIf cOfficial = "A" Then
|
|
|
2674 |
'Archive Mode
|
|
|
2675 |
ReleaseIcon = LIMG_ARCHIVE_MODE
|
|
|
2676 |
End If
|
|
|
2677 |
|
|
|
2678 |
End Function
|
|
|
2679 |
'-----------------------------------------------------------------------------------------------------------------
|
|
|
2680 |
Function SdkIcon (cState)
|
|
|
2681 |
If cState = "R" Then
|
|
|
2682 |
' Released - available for use
|
|
|
2683 |
SdkIcon = LIMG_CLOSED_MODE
|
|
|
2684 |
ElseIf cState = "D" Then
|
|
|
2685 |
' Deprecated - Cannot be added to a Release any more
|
|
|
2686 |
SdkIcon = LIMG_ARCHIVE_MODE
|
|
|
2687 |
ElseIf cState = "U" Then
|
|
|
2688 |
' Work in progress - Still being constructed. Cannot be added to a Release yet
|
|
|
2689 |
SdkIcon = LIMG_OPEN_MODE
|
|
|
2690 |
End If
|
|
|
2691 |
End Function
|
|
|
2692 |
'-----------------------------------------------------------------------------------------------------------------
|
| 7244 |
dpurdie |
2693 |
'
|
|
|
2694 |
' Helper rountien to create a button that will be wired into JavaScript
|
|
|
2695 |
'
|
|
|
2696 |
Sub BuildJsButton (bState, sClass, sTitle, sImage)%>
|
|
|
2697 |
<%If bState Then%>
|
|
|
2698 |
<span class="<%=sClass%>" title="<%=sTitle%>"><img <%=sImage%>></span>
|
|
|
2699 |
<%Else%>
|
|
|
2700 |
<span class="abtnItemDis" title="<%=sTitle%>"><img <%=sImage%> class="lessOpacity"></span>
|
|
|
2701 |
<%End If%>
|
|
|
2702 |
<%End Sub
|
| 6827 |
dpurdie |
2703 |
'------------------------------------------------------------------------------
|
|
|
2704 |
' Helper routine to create buttons and disabled buttons
|
|
|
2705 |
' Treat the action an href - link the user can see and potentially open in another tab
|
|
|
2706 |
'
|
|
|
2707 |
Sub BuildActionButtonLink(bState, sText, sTitle, sImage, sRef)
|
|
|
2708 |
%>
|
|
|
2709 |
<td align="center" nowrap valign="bottom" title="<%=sTitle%>">
|
|
|
2710 |
<%If bState Then%>
|
|
|
2711 |
<a href="<%=sRef%>" class="abtnItem"><img <%=sImage%> ><%=sText%></a>
|
|
|
2712 |
<%Else%>
|
|
|
2713 |
<span class="abtnItemDis"><img <%=sImage%> class="lessOpacity"><%=sText%></span>
|
|
|
2714 |
<%End If%>
|
|
|
2715 |
</td>
|
|
|
2716 |
<%End Sub
|
|
|
2717 |
'------------------------------------------------------------------------------
|
|
|
2718 |
' Helper routine to create buttons and disabled buttons
|
|
|
2719 |
' Treat the ref as a page to goto, but don't use href
|
|
|
2720 |
'
|
|
|
2721 |
Sub BuildActionButton(bState, sText, sTitle, sImage, sRef)
|
|
|
2722 |
%>
|
|
|
2723 |
<td align="center" nowrap valign="bottom" title="<%=sTitle%>">
|
|
|
2724 |
<%If bState Then%>
|
|
|
2725 |
<span onClick="location.href='<%=sRef%>'" class="pointer abtnItem"><img <%=sImage%> ><%=sText%></span>
|
|
|
2726 |
<%Else%>
|
|
|
2727 |
<span class="abtnItemDis"><img <%=sImage%> class="lessOpacity"><%=sText%></span>
|
|
|
2728 |
<%End If%>
|
|
|
2729 |
</td>
|
|
|
2730 |
<%End Sub
|
|
|
2731 |
'------------------------------------------------------------------------------
|
|
|
2732 |
' Helper routine to create buttons and disabled buttons
|
|
|
2733 |
' Tack a onClick operation
|
|
|
2734 |
'
|
|
|
2735 |
Sub BuildActionButtonClickRaw(bState, sText, sTitle, isBlue, sImage, sClick)
|
|
|
2736 |
Dim sStyle : sStyle = ""
|
|
|
2737 |
If Left(sImage,4) = "<img" Then sImage = Mid(sImage, 5, Len(sImage)-5)
|
|
|
2738 |
If bState Then
|
|
|
2739 |
If isBlue Then sStyle = "color:#0000ee; text-decoration:underline"%>
|
| 6879 |
dpurdie |
2740 |
<span onClick="<%=sClick%>" class="pointer abtnItem" title="<%=sTitle%>" style="<%=sStyle%>"><img <%=sImage%> ><%=sText%></span>
|
| 6827 |
dpurdie |
2741 |
<%Else%>
|
|
|
2742 |
<%If isBlue Then sStyle = "color:#0000ee66; text-decoration:none"%>
|
|
|
2743 |
<span class="abtnItemDis" style="<%=sStyle%>"><img <%=sImage%> class="lessOpacity"><%=sText%></span>
|
|
|
2744 |
<%End If
|
|
|
2745 |
End Sub
|
| 6615 |
dpurdie |
2746 |
|
| 6827 |
dpurdie |
2747 |
Sub BuildActionButtonClick(bState, sText, sTitle, isBlue, sImage, sClick)%>
|
|
|
2748 |
<td align="right" nowrap valign="center" title="<%=sTitle%>">
|
|
|
2749 |
<%BuildActionButtonClickRaw bState, sText, sTitle, isBlue, sImage, sClick %>
|
|
|
2750 |
</td>
|
|
|
2751 |
<%End Sub
|
|
|
2752 |
|
|
|
2753 |
'------------------------------------------------------------------------------
|
|
|
2754 |
' Helper routine to create Text with a button that follows
|
|
|
2755 |
' Tack a onClick operation
|
|
|
2756 |
'
|
|
|
2757 |
Sub BuildEditButtonRaw(bState, sText, sTitle, isBlue, sImage, sClick)
|
|
|
2758 |
Dim sStyle : sStyle = "font-weight:bold;"
|
|
|
2759 |
Dim sClass : sClass = ""
|
|
|
2760 |
If Left(sImage,4) = "<img" Then sImage = Mid(sImage, 5, Len(sImage)-5)
|
|
|
2761 |
If bState Then
|
|
|
2762 |
If isBlue Then sClass = "txt_linked" : sStyle = ""%>
|
| 7244 |
dpurdie |
2763 |
<span onClick="<%=sClick%>" class="<%=sClass%> pointer" style="<%=sStyle%>" title="<%=sTitle%>"><%=sText%> <img <%=sImage%>></span>
|
| 6827 |
dpurdie |
2764 |
<%Else%>
|
|
|
2765 |
<%If isBlue Then sClass = "txt_linked_dis" : sStyle = ""%>
|
| 7244 |
dpurdie |
2766 |
<span style="<%=sStyle%>" class="<%=sClass%>" title="<%=sTitle%>"><%=sText%> <img <%=sImage%> class="lessOpacity"></span>
|
| 6827 |
dpurdie |
2767 |
<%End If
|
|
|
2768 |
End Sub%>
|
|
|
2769 |
|