Subversion Repositories DevTools

Rev

Rev 6879 | Rev 7022 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 6879 Rev 6971
Line 227... Line 227...
227
   GetReleaseMode = releaseInfoHash("official")
227
   GetReleaseMode = releaseInfoHash("official")
228
End Function
228
End Function
229
'-----------------------------------------------------------------------------------------------------------------------------
229
'-----------------------------------------------------------------------------------------------------------------------------
230
'   Get basic Release Info on global releaseInfoHash
230
'   Get basic Release Info on global releaseInfoHash
231
'   List of fields may be extended as required (could use *)
231
'   List of fields may be extended as required (could use *)
-
 
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
'
232
Sub GetReleaseInfo ( NNrtag_id )
237
Sub GetReleaseInfo ( NNrtag_id )
233
   Dim rsTemp, Query_String, item
238
   Dim rsTemp, Query_String, item
234
   If NNrtag_id = "" Then NNrtag_id = "-1"
239
   If NNrtag_id = "" Then NNrtag_id = "-1"
235
 
240
 
-
 
241
   ' Do we already have the data
-
 
242
   If NOT (releaseInfoHash is Nothing) Then
236
   Set releaseInfoHash = CreateObject("Scripting.Dictionary")
243
       If Cdbl(releaseInfoHash("rtag_id") ) = CDbl(NNrtag_id) Then
-
 
244
           Exit Sub
-
 
245
        End If
-
 
246
    End If
237
 
247
 
-
 
248
 
-
 
249
   Set releaseInfoHash = CreateObject("Scripting.Dictionary")
238
   Query_String = " SELECT rt.RTAG_ID ,rt.lxr, rt.official," &_
250
   Query_String = " SELECT rt.RTAG_ID ,rt.rtag_name, proj.proj_id, proj.proj_name,rt.lxr, rt.official," &_
239
                  "   NVL(lx.lxrserver, 'N') as lxrserver" &_
251
                  "   NVL(lx.lxrserver, 'N') as lxrserver" &_
240
                  " FROM Release_tags rt,"&_
252
                  " FROM Release_tags rt, projects proj, lxr_state lx"&_
241
                  "   lxr_state lx"&_
-
 
242
                  " WHERE rt.RTAG_ID = lx.RTAG_ID(+)"&_
253
                  " WHERE rt.RTAG_ID = lx.RTAG_ID(+)"&_
-
 
254
                  " AND rt.proj_id = proj.proj_id" &_
243
                  " AND rt.RTAG_ID = " & NNrtag_id
255
                  " AND rt.RTAG_ID = " & NNrtag_id
244
 
256
 
245
   Set rsTemp = OraDatabase.DbCreateDynaset( Query_String, cint(0))
257
   Set rsTemp = OraDatabase.DbCreateDynaset( Query_String, cint(0))
246
   If ((NOT rsTemp.BOF) AND (NOT rsTemp.EOF)) Then
258
   If ((NOT rsTemp.BOF) AND (NOT rsTemp.EOF)) Then
247
      For Each item In rsTemp.Fields 
259
      For Each item In rsTemp.Fields 
Line 1326... Line 1338...
1326
' Description:  Setup some very basic data that is common to (almost) pages
1338
' Description:  Setup some very basic data that is common to (almost) pages
1327
'               Uses Request("proj_id"), Request("rtag_id") and Request("pv_id")
1339
'               Uses Request("proj_id"), Request("rtag_id") and Request("pv_id")
1328
'
1340
'
1329
'               Given an rtag_id it will determine the enclosing project
1341
'               Given an rtag_id it will determine the enclosing project
1330
'
1342
'
-
 
1343
'               If a valid Release will also fill in releaseInfoHash
-
 
1344
'                   Done here as its info we will need any way and its better to have
-
 
1345
'                   one database access than two ( or three )
-
 
1346
'
1331
' Returns:      nProjId     proj_id of rtag_id
1347
' Returns:      nProjId     proj_id of rtag_id
1332
'               sProjName
1348
'               sProjName
1333
'               nRtagId     rtag_id
1349
'               nRtagId     rtag_id
1334
'               sRtagName
1350
'               sRtagName
1335
'               nPvid       pv_id
1351
'               nPvid       pv_id
1336
'   
-
 
1337
'
1352
'
-
 
1353
'               releaseInfoHash - Populates
1338
'
1354
'
1339
Function GetCurrentParameters( nProjId, sProjName, nRtagId, sRtagName, nPvId )
1355
Function GetCurrentParameters( nProjId, sProjName, nRtagId, sRtagName, nPvId )
1340
   Dim rsQry,query
1356
   Dim rsQry,query
1341
 
1357
 
1342
   ' Set defaults
1358
   ' Set defaults
Line 1351... Line 1367...
1351
   If Request("proj_id") <> "" Then nProjId = CDbl(Request("proj_id"))
1367
   If Request("proj_id") <> "" Then nProjId = CDbl(Request("proj_id"))
1352
   If Request("rtag_id") <> "" Then nRtagId = CDbl(Request("rtag_id"))
1368
   If Request("rtag_id") <> "" Then nRtagId = CDbl(Request("rtag_id"))
1353
 
1369
 
1354
 
1370
 
1355
   ' Get parameters from database
1371
   ' Get parameters from database
1356
   OraDatabase.Parameters.Add "PROJ_ID",       Request("proj_id"),   ORAPARM_INPUT, ORATYPE_VARCHAR2
-
 
1357
   OraDatabase.Parameters.Add "RTAG_ID",       Request("rtag_id"),   ORAPARM_INPUT, ORATYPE_VARCHAR2
-
 
1358
 
1372
 
1359
   If Request("rtag_id") <> "" Then
1373
   If Request("rtag_id") <> "" Then
1360
 
-
 
1361
      query = _
-
 
1362
      " SELECT rel.rtag_id, rel.rtag_name, proj.proj_id, proj.proj_name" &_
-
 
1363
      " FROM release_tags rel, projects proj"&_
1374
       GetReleaseInfo (nRtagId)
1364
      " WHERE rel.proj_id = proj.proj_id AND rel.rtag_id = :RTAG_ID"
-
 
1365
 
-
 
1366
      Set rsQry = OraDatabase.DbCreateDynaset( query, cint(0))
-
 
1367
      If ((NOT rsQry.BOF) AND (NOT rsQry.EOF)) Then
-
 
1368
         sProjName = UCase(rsQry.Fields("proj_name"))
1375
       sProjName = UCase(releaseInfoHash("proj_name"))
1369
         nProjId = CDbl(rsQry.Fields("proj_id")) 
1376
       nProjId = CDbl(releaseInfoHash("proj_id")) 
1370
         sRtagName = rsQry.Fields("rtag_name")
1377
       sRtagName = releaseInfoHash("rtag_name")
1371
      End If
-
 
1372
      rsQry.Close()
-
 
1373
      Set rsQry = nothing
-
 
1374
 
1378
 
1375
   ElseIf Request("proj_id") <> "" Then
1379
   ElseIf Request("proj_id") <> "" Then
-
 
1380
      OraDatabase.Parameters.Add "PROJ_ID",       Request("proj_id"),   ORAPARM_INPUT, ORATYPE_VARCHAR2
-
 
1381
 
1376
      query = _
1382
      query = _
1377
      " SELECT proj.proj_name, proj.proj_id"&_
1383
      " SELECT proj.proj_name, proj.proj_id"&_
1378
      " FROM projects proj"&_
1384
      " FROM projects proj"&_
1379
      " WHERE proj.proj_id = :PROJ_ID"
1385
      " WHERE proj.proj_id = :PROJ_ID"
1380
 
1386
 
Line 1382... Line 1388...
1382
      If ((NOT rsQry.BOF) AND (NOT rsQry.EOF)) Then
1388
      If ((NOT rsQry.BOF) AND (NOT rsQry.EOF)) Then
1383
         sProjName = UCase(rsQry.Fields("proj_name"))
1389
         sProjName = UCase(rsQry.Fields("proj_name"))
1384
      End If
1390
      End If
1385
      rsQry.Close()
1391
      rsQry.Close()
1386
      Set rsQry = nothing
1392
      Set rsQry = nothing
-
 
1393
      OraDatabase.Parameters.Remove "PROJ_ID"
1387
    
1394
    
1388
   End If
1395
   End If
1389
 
1396
 
1390
   OraDatabase.Parameters.Remove "PROJ_ID"
-
 
1391
   OraDatabase.Parameters.Remove "RTAG_ID"
-
 
1392
 
1397
 
1393
End Function
1398
End Function
1394
'-----------------------------------------------------------------------------------------------------------------------------
1399
'-----------------------------------------------------------------------------------------------------------------------------
1395
Function GetEnvName ( nEnvTab )
1400
Function GetEnvName ( nEnvTab )
1396
   Select Case CInt( nEnvTab )
1401
   Select Case CInt( nEnvTab )