Subversion Repositories DevTools

Rev

Rev 7493 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
5357 dpurdie 1
<%@LANGUAGE="VBSCRIPT"%>
2
<%
3
'=====================================================
4
'|                                                   |
5472 dpurdie 5
'|                      Add Release                  |
5357 dpurdie 6
'|                                                   |
7
'=====================================================
8
%>
9
<%
10
Option explicit
11
' Good idea to set when using redirect
5472 dpurdie 12
Response.Expires = 0    ' always load the page, dont store
5357 dpurdie 13
%>
14
<!--#include file="common/conf.asp"-->
15
<!--#include file="common/globals.asp"-->
16
<!--#include file="common/formating.asp"-->
17
<!--#include file="common/qstr.asp"-->
18
<!--#include file="common/common_subs.asp"-->
19
<!--#include file="common/_form_window_common.asp"-->
20
<%
21
' Set rfile parameter. This is a return page after Login
22
Call objPMod.StoreParameter ( "rfile", "rtree.asp" )
23
objPMod.PersistInQryString("proj_id")
24
'------------ ACCESS CONTROL ------------------
25
%>
26
<!--#include file="_access_control_login.asp"-->
27
<!--#include file="_access_control_general.asp"-->
28
<!--#include file="_access_control_project.asp"-->
29
<%
30
'------------ Variable Definition -------------
31
Dim rsQry
32
Dim parSourceRtagId
7493 dpurdie 33
Dim isSnapshot
34
Dim isBranch
7572 dpurdie 35
Dim newRtagId
36
 
5357 dpurdie 37
'------------ Constants Declaration -----------
38
'------------ Variable Init -------------------
39
parSourceRtagId = Request("source_rtag_id")
40
objPMod.PersistInQryString("proj_id")
7493 dpurdie 41
isSnapshot = RequestBool("snapshot", FALSE)
42
isBranch = RequestBool("branch", FALSE)
5357 dpurdie 43
'----------------------------------------------
44
%>
45
<%
46
'--------------------------------------------------------------------------------------------------------------------------
47
Sub GetFormDetails ( nSourceRtagId, ByRef outobjDetails )
5472 dpurdie 48
    Dim rsQry, query
49
 
50
    ' Exit if nSourceRtagId is empty
51
    If nSourceRtagId = "" Then Exit Sub 
52
 
53
 
54
    OraDatabase.Parameters.Add "SOURCE_RTAG_ID",    nSourceRtagId,      ORAPARM_INPUT, ORATYPE_NUMBER 
55
 
56
    query = _
6881 dpurdie 57
    " SELECT pr.PROJ_NAME ||' > '|| rt.RTAG_NAME ||' ['|| rt.RTAG_VERSION ||'.'|| rt.RTAG_LIFE_CYCLE ||']'  AS LOCATION, "&_
58
    " rt.RTAG_NAME," &_
59
    " rt.DESCRIPTION" &_
5472 dpurdie 60
    "  FROM RELEASE_TAGS rt,"&_
61
    "      PROJECTS pr"&_
62
    " WHERE rt.PROJ_ID = pr.PROJ_ID"&_
63
    "   AND rt.RTAG_ID = :SOURCE_RTAG_ID"
64
 
65
    Set rsQry = OraDatabase.DbCreateDynaset( query, ORADYN_DEFAULT )
66
 
67
    OraDatabase.Parameters.Remove "SOURCE_RTAG_ID"
68
 
69
    If rsQry.RecordCount > 0 Then
70
        outobjDetails.Item ("location") = rsQry("location")
6881 dpurdie 71
        outobjDetails.Item ("rtag_name") = rsQry("rtag_name")
72
        outobjDetails.Item ("description") = rsQry("description")
5472 dpurdie 73
 
74
    Else
75
        Err.Raise 8, "Sub GetFormDetails in "& ScriptName, "Empty record set returned. nSourceRtagId="& nSourceRtagId
76
 
77
    End If
78
 
79
 
80
    rsQry.Close
81
    Set rsQry = Nothing
5357 dpurdie 82
End Sub
83
'--------------------------------------------------------------------------------------------------------------------------
84
Sub AddRelease ()
5472 dpurdie 85
 
6881 dpurdie 86
    OraDatabase.Parameters.Add "SOURCE_RTAG_ID",    Request("source_rtag_id"),          ORAPARM_INPUT, ORATYPE_NUMBER 
87
    OraDatabase.Parameters.Add "PROJ_ID",           Request("proj_id"),                 ORAPARM_INPUT, ORATYPE_NUMBER 
88
    OraDatabase.Parameters.Add "RTAG_NAME",         Trim(Request("rtag_name")),         ORAPARM_INPUT, ORATYPE_VARCHAR2
89
    OraDatabase.Parameters.Add "RTAG_DESCRIPTION",  Trim(Request("rtag_description")),  ORAPARM_INPUT, ORATYPE_VARCHAR2
90
    OraDatabase.Parameters.Add "USER_ID",           objAccessControl.UserId,            ORAPARM_INPUT, ORATYPE_NUMBER 
7493 dpurdie 91
    OraDatabase.Parameters.Add "IS_BRANCH",         Iif(isBranch, "Y", "N"),            ORAPARM_INPUT, ORATYPE_CHAR
6881 dpurdie 92
    OraDatabase.Parameters.Add "OMODE",             Request("mode"),                    ORAPARM_INPUT, ORATYPE_CHAR
7493 dpurdie 93
    OraDatabase.Parameters.Add "ORTAGID",           NULL,                               ORAPARM_OUTPUT,ORATYPE_NUMBER
5472 dpurdie 94
 
6881 dpurdie 95
    objEH.ErrorRedirect = FALSE
96
    On Error Resume Next
5472 dpurdie 97
    objEH.TryORA ( OraSession )
98
 
7493 dpurdie 99
    OraDatabase.ExecuteSQL "BEGIN PK_RELEASE.NEW_RELEASE ( :RTAG_NAME, :RTAG_DESCRIPTION, :PROJ_ID, :SOURCE_RTAG_ID, :IS_BRANCH, :USER_ID, :OMODE, :ORTAGID);   END;"
7572 dpurdie 100
    newRtagId = OraDatabase.Parameters("ORTAGID").Value
5472 dpurdie 101
 
102
    objEH.CatchORA ( OraSession )
103
 
5952 dpurdie 104
    OraDatabase.Parameters.Remove "SOURCE_RTAG_ID"
105
    OraDatabase.Parameters.Remove "PROJ_ID"
106
    OraDatabase.Parameters.Remove "RTAG_NAME"
107
    OraDatabase.Parameters.Remove "RTAG_DESCRIPTION"
108
    OraDatabase.Parameters.Remove "USER_ID"
109
    OraDatabase.Parameters.Remove "IS_BRANCH"
110
    OraDatabase.Parameters.Remove "OMODE"
7493 dpurdie 111
    OraDatabase.Parameters.Remove "ORTAGID"
5357 dpurdie 112
End Sub
113
'--------------------------------------------------------------------------------------------------------------------------
114
%>
115
<%
116
'------------ RUN BEFORE PAGE RENDER ----------
117
' --- Get Form details from DB ---
118
Call GetFormDetails ( parSourceRtagId, objFormCollector )
119
 
120
' --- Load Validation Rules ---
6543 dpurdie 121
objForm.UpdateRules ("id='rtag_name' IsRequired='Y' IsName='Y' MinStringLength='2' MaxStringLength='150'")
5658 dpurdie 122
objForm.UpdateRules ("id='rtag_description' IsRequired='Y' MaxStringLength='4000' MinStringLength='10'")
5357 dpurdie 123
 
124
' --- Enter Form Validation Rule Changes here... ----
125
'----------------------------------------------------
126
 
127
' --- RUN onPostBack ---
128
If Request("action") <> "" Then
5472 dpurdie 129
    If objForm.IsValidOnPostBack Then
130
        ' --- Form is Valid ---
131
        Call AddRelease()
132
 
133
        If objEH.Finally Then
7572 dpurdie 134
            If Request("mode") = "S" Then
135
                Call OpenInWindow ( "dependencies.asp?rtag_id="& Request("source_rtag_id") )
136
            Else
137
                If newRtagId <> "" Then
138
                    Call OpenInWindow ( "dependencies.asp?rtag_id="& newRtagId )
139
                Else
140
                    Call OpenInWindow ( "rtree.asp?DONE=OK&"& objPMod.ComposeURL() )
141
                End If
142
            End If
5472 dpurdie 143
        End If
144
 
145
    End If
146
 
5357 dpurdie 147
End If
148
 
149
'----------------------------------------------
150
%>
151
 
152
<html>
153
<head>
154
<title>Release Manager</title>
155
<link rel="shortcut icon" href="<%=FavIcon%>"/>
156
<meta HTTP-EQUIV="Pragma" CONTENT="no-cache">
157
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
6579 dpurdie 158
<link rel="stylesheet" href="images/release_manager_style.css?ver=<%=VixVerNum%>" type="text/css">
159
<link rel="stylesheet" href="images/navigation.css?ver=<%=VixVerNum%>" type="text/css">
160
<script language="JavaScript" src="images/common.js?ver=<%=VixVerNum%>"></script>
5983 dpurdie 161
<!--#include file="_jquery_includes.asp"-->
5357 dpurdie 162
<!-- DROPDOWN MENUS -->
163
<!--#include file="_menu_def.asp"-->
6579 dpurdie 164
<script language="JavaScript1.2" src="images/popup_menu.js?ver=<%=VixVerNum%>"></script>
5357 dpurdie 165
 
166
</head>
167
<body bgcolor="#FFFFFF" text="#000000" leftmargin="0" topmargin="0" onLoad="FormName.rtag_name.focus();">
168
<!-- HEADER -->
169
<!--#include file="_header.asp"-->
170
<!-- BODY ---->
171
<%
172
'-- FROM START ---------------------------------------------------------------------------------------------------------
173
objFormComponent.FormName = "FormName"
174
objFormComponent.Action = ScriptName
175
Call objFormComponent.FormStart()
6881 dpurdie 176
Dim fName : fName = objFormCollector.Item("rtag_name") 
7493 dpurdie 177
Dim cmtPrefix : cmtPrefix = iif(isSnapshot, "Snapshot of ", "Cloned from ") 
6881 dpurdie 178
Dim Comment
179
Comment = Request("rtag_description") 
180
If Comment = "" Then
181
    Comment = objFormCollector.Item("description")
7493 dpurdie 182
    If fName <> "" AND NOT isSnapshot Then
6881 dpurdie 183
        If Comment <> "" Then Comment = Comment & vbCrLf 
7493 dpurdie 184
        Comment = Comment & cmtPrefix & "'" & fName & "'"
6881 dpurdie 185
    End If
186
End If
187
Dim  rtagName
188
rtagName = Request("rtag_name") 
189
If rtagName = "" Then
7493 dpurdie 190
    If fName <> "" Then rtagName = cmtPrefix & fName
6881 dpurdie 191
End If
192
 
5357 dpurdie 193
%>
6881 dpurdie 194
<table width="100%" border="0" cellspacing="0" cellpadding="0">
5357 dpurdie 195
  <tr> 
6881 dpurdie 196
    <td class='bg_panel'></td>
197
    <td width="100%" rowspan="2" align="center" bgcolor="#EEEFEF">
198
        <div>
199
            <div class=panel>
200
                <div class='rounded_box_caption'>
7493 dpurdie 201
                    <%=Iif(isSnapshot, "Create Snapshot", "New Release")%>
6881 dpurdie 202
                <div>
203
                <div class = "rounded_box">
204
                    <div>
205
                        <%
7493 dpurdie 206
                        If isSnapshot Then
207
                            Call Messenger ( "A snapshot will be created from <br>"& objFormCollector.Item("location"), 3, "100%" )
208
                        ElseIf parSourceRtagId <> "" Then
6881 dpurdie 209
                            Call Messenger ( "New release will be created from <br>"& objFormCollector.Item("location"), 3, "100%" )
210
                        End If
211
                        %>
212
                        <!-- MESSAGE +++++++++++++++++++++++++++++++++++++++++++++++++++ -->    
213
                        <!--#include file="messages/_msg_inline.asp"-->
214
                        <!-- +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
215
                    </div>
216
                    <div class='PanelFrame'>
217
                        <table width="100%"  border="0" cellspacing="2" cellpadding="0">
218
                          <tr>
219
                            <td nowrap class="form_iname">Release Name </td>
220
                            <td nowrap>
221
                            <%=objFormComponent.TextBox ( "rtag_name", objForm.GetValue( "rtag_name", rtagName ), "class='form_ivalue' size='60'" )%>
222
                            </td>
223
                            <td><%=objForm.Validate ("rtag_name")%></td>
224
                          </tr>
7493 dpurdie 225
                          <%If NOT isSnapshot Then%>
6881 dpurdie 226
                          <tr>
227
                            <td nowrap class="form_iname">Branch Release</td>
228
                            <td nowrap class="form_iname">
229
                              <input name="branch" type="radio" value="N" checked>No
7493 dpurdie 230
                              <input name="branch" type="radio" value="Y" <%=iif(isBranch, " checked","")%>>Yes</td>
6881 dpurdie 231
                            <td></td>
232
                          </tr>
7493 dpurdie 233
                          <%End If%>
6881 dpurdie 234
                          <tr>
235
                            <td nowrap class="form_iname">Release Mode</td>
236
                            <td nowrap class="form_iname">
7493 dpurdie 237
                              <%If isSnapshot Then%>
238
                              <input name="mode" type="radio" value="S" checked>Snapshot
239
                              <%Else%>
6881 dpurdie 240
                              <input name="mode" type="radio" value="N" checked>Open
241
                              <input name="mode" type="radio" value="Y" <%=iif(Request("mode") = "Y", " checked","")%>>Closed
7468 dpurdie 242
                              <input name="mode" type="radio" value="A" <%=iif(Request("mode") = "A", " checked","")%>>Archived
7493 dpurdie 243
                              <%End If%>
244
                            </td>
6881 dpurdie 245
                          </tr>
246
                          <tr>
247
                            <td nowrap class="form_iname top">Comments</td>
248
                            <td><%=objFormComponent.TextArea ( "rtag_description", objForm.GetValue("rtag_description", Comment ), 10, 60, "class='form_ivalue'" )%></td>
249
                            <td><%=objForm.Validate ("rtag_description")%></td>
250
                          </tr>
251
                        </table>
252
                    </div>
253
                    <div class='buttonPanel'>
254
                        <!-- ACTION BUTTONS ---------------------------------------------->
255
                        <%=objFormComponent.SubmitButton ( "Submit", "class='form_btn'" )%>&nbsp;
256
                        <%=objFormComponent.CancelButton ( "Cancel", "class='form_btn'", "rtree.asp?CANCEL=OK&"& objPMod.ComposeURL() )%>
257
                        <%=objPMod.ComposeHiddenTags()%>
258
                        <input type="hidden" name="source_rtag_id" value="<%=parSourceRtagId%>">
259
                        <input type="hidden" name="action" value="true">
260
                        <!-- ACTION BUTTONS END  ------------------------------------------>
261
                    </div>
262
                </div>
263
            </div>
264
        </div>
5472 dpurdie 265
    </td>
5357 dpurdie 266
  </tr>
6881 dpurdie 267
  <%
268
  Call objFormComponent.FormEnd()
269
  '-- FROM END -------------
270
  %>   
5357 dpurdie 271
</table>
272
<!-- FOOTER -->
273
<!--#include file="_footer.asp"-->
274
</body>
275
</html>