| 119 |
ghuddy |
1 |
<%@LANGUAGE="VBSCRIPT"%>
|
|
|
2 |
<%
|
|
|
3 |
'=====================================================
|
| 129 |
ghuddy |
4 |
' Update Unit Tets Accepted State
|
| 119 |
ghuddy |
5 |
' --- PROCESS FORM ---
|
|
|
6 |
'=====================================================
|
|
|
7 |
%>
|
|
|
8 |
<%
|
|
|
9 |
Option explicit
|
|
|
10 |
' Good idea to set when using redirect
|
| 129 |
ghuddy |
11 |
Response.Expires = 0 ' always load the page, dont store
|
| 119 |
ghuddy |
12 |
%>
|
|
|
13 |
<!--#include file="common/conf.asp"-->
|
|
|
14 |
<!--#include file="common/globals.asp"-->
|
|
|
15 |
<!--#include file="common/formating.asp"-->
|
|
|
16 |
<!--#include file="common/qstr.asp"-->
|
|
|
17 |
<!--#include file="common/common_subs.asp"-->
|
|
|
18 |
<!--#include file="common/common_dbedit.asp"-->
|
|
|
19 |
<%
|
|
|
20 |
' Set rfile parameter. This is a return page after Login
|
|
|
21 |
Call objPMod.StoreParameter ( "rfile", "fixed_issues.asp" )
|
|
|
22 |
'------------ ACCESS CONTROL ------------------
|
|
|
23 |
%>
|
|
|
24 |
<!--#include file="_access_control_login.asp"-->
|
|
|
25 |
<!--#include file="_access_control_general.asp"-->
|
|
|
26 |
<!--#include file="_access_control_project.asp"-->
|
|
|
27 |
<%
|
|
|
28 |
'------------ Variable Definition -------------
|
|
|
29 |
Dim parPv_id
|
|
|
30 |
Dim parFRfixed
|
|
|
31 |
'------------ Constants Declaration -----------
|
|
|
32 |
'------------ Variable Init -------------------
|
|
|
33 |
parPv_id = QStrPar("pv_id")
|
|
|
34 |
parRtag_id = QStrPar("rtag_id")
|
|
|
35 |
parFRfixed = Request("FRfixed")
|
|
|
36 |
'----------------------------------------------
|
|
|
37 |
%>
|
|
|
38 |
<%
|
|
|
39 |
'-----------------------------------------------------------------------------------------------------------------------
|
|
|
40 |
Sub Update_Unit_Test_Accepted_State ( nPv_id, aTestIdList )
|
| 129 |
ghuddy |
41 |
Dim TestId, sReviewDate, nReviewedBy, sAccepted
|
|
|
42 |
|
|
|
43 |
OraDatabase.Parameters.Add "PV_ID", nPv_id, ORAPARM_INPUT, ORATYPE_NUMBER
|
|
|
44 |
OraDatabase.Parameters.Add "REVIEW_DATE", EuroDate (Date), ORAPARM_INPUT, ORATYPE_VARCHAR2
|
|
|
45 |
OraDatabase.Parameters.Add "ACCEPTED_BY", objAccessControl.UserId, ORAPARM_INPUT, ORATYPE_NUMBER
|
|
|
46 |
|
|
|
47 |
objEH.TryORA ( OraSession )
|
|
|
48 |
On Error Resume Next
|
|
|
49 |
|
|
|
50 |
For Each TestId In aTestIdList
|
|
|
51 |
sReviewDate = "'"& EuroDate (Date) &"'"
|
|
|
52 |
nReviewedBy = objAccessControl.UserId
|
|
|
53 |
sAccepted = "'"& Request( "acc"& TestId ) &"'"
|
|
|
54 |
'sReviewComments = NULL
|
|
|
55 |
|
|
|
56 |
If sAccepted = "''" Then
|
|
|
57 |
sReviewDate = "NULL"
|
|
|
58 |
nReviewedBy = "NULL"
|
|
|
59 |
sAccepted = "NULL"
|
|
|
60 |
End If
|
|
|
61 |
|
|
|
62 |
If Err.Number = 0 Then
|
|
|
63 |
OraDatabase.ExecuteSQL _
|
|
|
64 |
"BEGIN Update_Unit_Test_Acceptance ( "& TestId &","&_
|
|
|
65 |
" :PV_ID,"&_
|
|
|
66 |
" "& sAccepted &","&_
|
|
|
67 |
" "& sReviewDate &","&_
|
|
|
68 |
" "& nReviewedBy &","&_
|
|
|
69 |
" NULL,"&_
|
|
|
70 |
" 'Y'"&_
|
|
|
71 |
" ); END;"
|
|
|
72 |
End If
|
|
|
73 |
|
|
|
74 |
Next
|
|
|
75 |
|
|
|
76 |
objEH.CatchORA ( OraSession )
|
|
|
77 |
|
|
|
78 |
OraDatabase.Parameters.Remove "PV_ID"
|
|
|
79 |
OraDatabase.Parameters.Remove "REVIEW_DATE"
|
|
|
80 |
OraDatabase.Parameters.Remove "ACCEPTED_BY"
|
|
|
81 |
|
| 119 |
ghuddy |
82 |
End Sub
|
|
|
83 |
'-----------------------------------------------------------------------------------------------------------------------
|
|
|
84 |
Function GetUnitTestList ( nPv_id )
|
| 129 |
ghuddy |
85 |
Dim Query_String, oRS, arrTemp(), currDim
|
|
|
86 |
Query_String = " SELECT ut.test_id FROM UNIT_TESTS ut WHERE ut.pv_id = "& nPv_id
|
|
|
87 |
|
|
|
88 |
Set oRS = OraDatabase.CreateDynaset( Query_String, cint(0))
|
|
|
89 |
|
|
|
90 |
currDim = 0
|
|
|
91 |
While (NOT oRS.BOF) AND (NOT oRS.EOF)
|
|
|
92 |
ReDim Preserve arrTemp( currDim )
|
|
|
93 |
arrTemp ( currDim ) = oRS("test_id")
|
|
|
94 |
|
|
|
95 |
currDim = currDim + 1
|
|
|
96 |
oRS.MoveNext
|
|
|
97 |
WEnd
|
|
|
98 |
|
|
|
99 |
GetUnitTestList = arrTemp
|
|
|
100 |
|
|
|
101 |
oRS.Close
|
|
|
102 |
Set oRS = Nothing
|
| 119 |
ghuddy |
103 |
End Function
|
|
|
104 |
'-----------------------------------------------------------------------------------------------------------------------
|
|
|
105 |
%>
|
|
|
106 |
<%
|
|
|
107 |
'----------------------- MAIN LINE ---------------------------
|
|
|
108 |
'--- Process submition ---
|
|
|
109 |
If (parPv_id <> "") AND (parRtag_id <> "")Then
|
| 1376 |
dpurdie |
110 |
' All mandatory parameters FOUND
|
| 129 |
ghuddy |
111 |
|
|
|
112 |
Call Update_Unit_Test_Accepted_State ( parPv_id, GetUnitTestList(parPv_id) )
|
|
|
113 |
|
| 5957 |
dpurdie |
114 |
Call Destroy_All_Objects
|
| 129 |
ghuddy |
115 |
Response.Redirect("fixed_issues.asp?pv_id="& Request("pv_id") &"&rtag_id="& Request("rtag_id"))
|
| 119 |
ghuddy |
116 |
Else
|
| 1376 |
dpurdie |
117 |
Response.write "Some mandatory parameters are missing!" & "<br>" 'TODO
|
| 4955 |
dpurdie |
118 |
Response.write QSTR_FullQuery
|
| 119 |
ghuddy |
119 |
End If
|
|
|
120 |
%>
|
|
|
121 |
<!-- DESTRUCTOR ------->
|
| 129 |
ghuddy |
122 |
<!--#include file="common/destructor.asp"-->
|