Subversion Repositories DevTools

Rev

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