Subversion Repositories DevTools

Rev

Go to most recent revision | Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
119 ghuddy 1
<%@LANGUAGE="VBSCRIPT"%>
2
<%
3
'=====================================================
129 ghuddy 4
'                  Change release Mode
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", "dependencies.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 rsQry
30
'------------ Constants Declaration -----------
31
'------------ Variable Init -------------------
32
'----------------------------------------------
33
%>
34
<%
35
Sub CheckWIPS ()
36
 
129 ghuddy 37
   OraDatabase.Parameters.Add "RTAG_ID",  Request("rtag_id"), ORAPARM_INPUT, ORATYPE_NUMBER
119 ghuddy 38
 
129 ghuddy 39
   Set rsQry = OraDatabase.DbCreateDynaset( GetQuery("CheckWIPS.sql"), cint(0))
40
 
41
   OraDatabase.Parameters.Remove "RTAG_ID"
42
 
43
   If rsQry.RecordCount > 0 Then
5176 dpurdie 44
      Call OpenInWindow( "form_check_closed_mode.asp?rtag_id="& Request("rtag_id") & "&mode_code=" &Request("mode_code") )
129 ghuddy 45
   Else
46
      'COMPLETE THE REQUEST...
47
      Call ChangeReleaseMode ()
48
   End If
49
 
50
   rsQry.Close()
51
   Set rsQry = Nothing
52
 
119 ghuddy 53
End Sub
54
'----------------------------------------------------------------------------------------------------------
55
Sub ChangeReleaseMode ( )
129 ghuddy 56
 
57
   OraDatabase.Parameters.Add "RTAG_ID",  Request("rtag_id"),      ORAPARM_INPUT, ORATYPE_NUMBER
58
   OraDatabase.Parameters.Add "MODECODE", Request("mode_code"),    ORAPARM_INPUT, ORATYPE_NUMBER
59
   OraDatabase.Parameters.Add "USER_ID",  objAccessControl.UserId, ORAPARM_INPUT, ORATYPE_NUMBER
60
 
61
   objEH.TryORA ( OraSession )
62
   On Error Resume Next
63
 
64
   OraDatabase.ExecuteSQL _
65
      " BEGIN   CHANGE_RELEASE_MODE ( :MODECODE, :RTAG_ID, :USER_ID );  END;"
66
 
67
   objEH.CatchORA ( OraSession )
68
 
69
   OraDatabase.Parameters.Remove "RTAG_ID"
70
   OraDatabase.Parameters.Remove "MODECODE"
71
   OraDatabase.Parameters.Remove "USER_ID"
72
 
119 ghuddy 73
End Sub
74
%>
75
<%
76
'-----------------------  MAIN LINE  ---------------------------
129 ghuddy 77
On Error Resume Next
78
 
79
objEH.Try()
119 ghuddy 80
'--- Process submission ---
81
If (Request("rtag_id") <> "")  AND  (Request("mode_code") <> "") Then
129 ghuddy 82
 
83
   ' mode_code values are:
4079 dpurdie 84
   '    1   Open
85
   '    2   Restrictive
86
   '    3   Closed
87
   '    4   CCB
88
   '    5   Archive
129 ghuddy 89
 
4079 dpurdie 90
   If Request("mode_code") = 3  OR Request("mode_code") = 5 Then
91
      ' only allow change to closed or archived mode if release has no wips or planned items.
129 ghuddy 92
      Call CheckWIPS ()
93
   Else
94
      'COMPLETE THE REQUEST...
95
      Call ChangeReleaseMode ()
96
   End If
97
 
98
   Call OpenInWindow( "dependencies.asp?rtag_id="& Request("rtag_id") )
99
 
119 ghuddy 100
Else
129 ghuddy 101
   Err.Raise 8, "Request not accepted here."
102
   'Response.write "Some mandatory parameters are missing!" & "<br>" 'TODO
4955 dpurdie 103
   'Response.write QSTR_FullQuery
119 ghuddy 104
End If
129 ghuddy 105
objEH.Catch()
119 ghuddy 106
%>
107
 
108
<!-- DESTRUCTOR ------->
129 ghuddy 109
<!--#include file="common/destructor.asp"-->