Subversion Repositories DevTools

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
5357 dpurdie 1
<%@LANGUAGE="VBSCRIPT"%>
2
<%
3
'=====================================================
4
'|                                                   |
5
'|                   wAddProjectExtension            |
6
'|                                                   |
7
'=====================================================
8
%>
9
<%
10
Option explicit
11
Response.Expires = 0
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/_form_window_common.asp"-->
19
<!-- #INCLUDE FILE="common/adovbs.inc" -->
20
 
21
 
22
<%
23
'------------ ACCESS CONTROL ------------------
24
%>
25
<!--#include file="_access_control_general.asp"-->
26
<!--#include file="_access_control_login.asp"-->
27
<%
28
'------------ VARIABLE DEFINITION -------------
29
Dim rsQry
30
Dim sMessage
31
Dim Query_String
32
 
33
'------------ CONSTANTS DECLARATION -----------
34
'------------ VARIABLE INIT -------------------
35
sMessage = NULL
36
 
37
 
38
Set objFormCollector = CreateObject("Scripting.Dictionary")
39
'------------ CONDITIONS ----------------------
40
'----------------------------------------------
41
function showCheck (val)
42
    if val = "Y" Then
43
        showCheck = "checked"
44
    Else
45
        showCheck = ""
46
    End If
47
End Function
48
 
49
function niceBool (val)
50
    if val = "Y" Then
51
        niceBool = "Y"
52
    Else
53
        niceBool = "N"
54
    End If
55
End Function
56
 
57
Sub checkExt (val)
58
   Dim objRegExpr
59
   Set objRegExpr = New regexp
60
 
61
   objRegExpr.Pattern = "^\.[a-z]{2,4}$"
62
   objRegExpr.IgnoreCase = False
63
   If NOT objRegExpr.Test(val) Then
64
        sMessage = "New project extension is not suitable. Must start with a 'dot' and must be between 2 and 4 lowercase characters"
65
   End If
66
End Sub
67
 
68
Sub performAction
69
    Dim rowCount
70
    rowCount = -1
71
 
72
    '
73
    ' Determine if the named project suffix exists
74
    ' Count the rows in the query
75
    '
76
    If Request("newext") <> "" Then
77
 
78
        checkExt(Request("newext"))
79
        If not isNull (sMessage) then Exit Sub
80
 
81
        Query_String = "SELECT EXT_NAME from PROJECT_EXTENTIONS WHERE EXT_NAME = '" & Request("newext") & "'"
82
	    Set rsQry = OraDatabase.DbCreateDynaset( Query_String, ORADYN_DEFAULT )
83
        rowCount = rsQry.RecordCount
84
		rsQry.Close()
85
		Set rsQry = nothing
86
    Else
87
        sMessage = "No Project Extension specified"
88
        Exit Sub
89
    End If
90
 
91
   If Request("ext") <> "" Then
92
    '
93
    '   Update an existing entry
94
    '
95
    If (rowCount > 0) AND ( Request("ext") <> Request("newext")) Then
96
        sMessage = "Cannot rename the project extension to an existing value"
97
    Else
98
        Query_String = "SELECT * from PROJECT_EXTENTIONS WHERE EXT_NAME = '" & Request("ext") & "'"
99
	    Set rsQry = OraDatabase.DbCreateDynaset( Query_String, ORADYN_DEFAULT )
100
        rsQry.Edit
101
        rsQry.Fields("EXT_NAME").Value = Request("newext")
102
        rsQry.Fields("UCOMMENT").Value = Request("comment")
103
        rsQry.Fields("IS_COTS").Value = niceBool(Request("isCots"))
104
        rsQry.Fields("IS_VISIBLE").Value = niceBool(Request("isVis"))
105
        rsQry.Update
106
        rsQry.Close
107
        Set rsQry = Nothing
108
        Call OpenInParentWindow ("admin_project_suffix.asp?ext="&Request("newext"))
109
        Call CloseWindow()
110
    End If
111
   Else
112
    '
113
    ' Insert a new entry into the table
114
    '
115
    If rowCount > 0 Then
116
        sMessage = "Project extension already exists"
117
    ElseIf rowCount < 0 Then
118
        sMessage = "No Project Extension specified"
119
    Else
120
        Query_String = "SELECT * from PROJECT_EXTENTIONS"
121
	    Set rsQry = OraDatabase.DbCreateDynaset( Query_String, ORADYN_DEFAULT )
122
        rsQry.AddNew
123
        rsQry.Fields("EXT_NAME").Value = Request("newext")
124
        rsQry.Fields("UCOMMENT").Value = Request("comment")
125
        rsQry.Fields("IS_COTS").Value = niceBool(Request("isCots"))
126
        rsQry.Fields("IS_VISIBLE").Value = niceBool(Request("isVis"))
127
        rsQry.Update
128
        rsQry.Close
129
        Set rsQry = Nothing
130
        Call OpenInParentWindow ("admin_project_suffix.asp?ext="&Request("newext"))
131
        Call CloseWindow()
132
    End If
133
   End If
134
 
135
End Sub
136
 
137
%>
138
<%
139
'------------ RUN BEFORE PAGE RENDER ----------
140
 
141
If CBool(Request("action")) Then
142
    performAction()
143
End If
144
 
145
 
146
'----------------------------------------------
147
%>
148
<html>
149
<head>
150
<title>Release Manager</title>
151
<link rel="shortcut icon" href="<%=FavIcon%>"/>
152
<meta HTTP-EQUIV="Pragma" CONTENT="no-cache">
153
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
154
<link href="images/release_manager_style.css" rel="stylesheet" type="text/css">
155
<script language="JavaScript" src="scripts/common.js"></script>
156
</head>
157
 
158
<body background="images/bg_bage_0.gif" leftmargin="0" topmargin="0" onLoad="self.focus();FormName.display_name.focus();">
159
<table width="100%"  border="0" cellspacing="0" cellpadding="10">
160
   <tr>
161
      <td bgcolor="#FFFFFF" class="body_txt"><span class="body_h1"><img src="icons/i_linkarrow_black.gif" width="11" height="11" align="absmiddle">&nbsp;Add/Update Project Extension</span> <br>
162
         Add a new Project Extension or edit an existing Project Extension.
163
      </td>
164
   </tr>
165
 
166
   <%
167
   '-- FORM START --------------------------------------------------------------------------------------------------------------
168
   objFormComponent.FormName = "FormName"
169
   objFormComponent.Action = ScriptName
170
   objFormComponent.OnSubmit = "ShowProgress();"
171
   Call objFormComponent.FormStart()
172
 
173
   %>
174
   <tr>
175
      <td background="images/bg_login.gif">
176
         <table width="50%"  border="0" cellspacing="0" cellpadding="0">
177
            <tr>
178
               <td><%=ProgressBar()%></td>
179
               <td align="right"><input name="btn" type="submit" class="form_btn" value="Add/Update">
180
                  <input name="btn" type="reset" class="form_btn" value="Cancel" onClick="self.close();">
181
               </td>
182
            </tr>
183
         </table>
184
      </td>
185
   </tr>
186
   <tr>
187
      <td>
188
         <!-- NEW PRODUCT ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
189
         <%Call Messenger ( sMessage , 1, "100%" )%>
190
         <!-- MESSAGE +++++++++++++++++++++++++++++++++++++++++++++++++++ -->
191
         <!--#include file="messages/_msg_inline.asp"-->
192
         <br>
193
         <%
194
        Dim extName
195
        Dim comment
196
        Dim isaCots
197
        Dim isVis
198
 
199
        If Request("ext") <> "" Then
200
            %>
201
            <input type="hidden" name="ext" value="<%=Request("ext")%>">
202
            <%
203
            Dim rsTemp
204
 
205
            Query_String = "select * FROM PROJECT_EXTENTIONS " &_
206
                          " where ext_name = '"& Request("ext") & "'"
207
 
208
            Set rsTemp = OraDatabase.DbCreateDynaset( Query_String, cint(0))
209
 
210
    		extName = rsTemp("EXT_NAME")
211
		    comment = rsTemp("UCOMMENT")
212
            isaCots = niceBool(rsTemp("IS_COTS"))
213
            isVis   = niceBool(rsTemp("IS_VISIBLE"))
214
 
215
            rsTemp.Close()
216
            Set rsTemp = Nothing      
217
          Else
218
            isaCots = "N"
219
            isVis = "Y"
220
          End If
221
          %>
222
 
223
         <table width="50%" border="0"  class="body_txt">
224
            <tr>
225
               <td>Project Extension</td>
226
               <td><input name="newext" type="text" class="body_txt" value="<%=extName%>" size=7 maxlength=5></td>
227
            </tr>
228
 
229
            <tr>
230
               <td></td>
231
               <td>The project suffix must start with a '.' and contain 2 to 4 lower case characters.</td>
232
            </tr>
233
 
234
            <tr>
235
               <td>Comment</td>
236
               <td><input name="comment" type="text" class="body_txt" value="<%=comment%>" size=80 maxlength=80></td>
237
            </tr>
238
 
239
            <tr>
240
               <td></td>
241
               <td>The comment field will be displayed during the project suffix selection process</td>
242
            </tr>
243
 
244
 
245
            <tr>
246
               <td>Enable Selection</td>
247
               <td><input name="isVis" type="checkbox" value="Y" <%=showCheck(isVis)%>></td>
248
            </tr>
249
 
250
            <tr>
251
               <td></td>
252
               <td>If selection is not enabled then the Suffix will not be shown and cannot be selected.
253
               This is useful for legacy projects where multiple extensions have been used. </td>
254
            </tr>
255
 
256
            <tr>
257
               <td>Free Form Version</td>
258
               <td><input name="isCots" type="checkbox" value="Y" <%=showCheck(isaCots)%>></td>
259
            </tr>
260
 
261
            <tr>
262
               <td></td>
263
               <td>Free Form Versioning flags packages are allowed to have non-standard version numbers.
264
               If the version number is in the standard major.minor.patch-build form then the package can be auto-versioned.
265
               If the version number has only a patch-build field then it can rippled.
266
               </td>
267
            </tr>
268
 
269
 
270
         </table>
271
      </td>
272
   </tr>
273
   <%=objPMod.ComposeHiddenTags()%>
274
   <input type="hidden" name="action" value="true">
275
 
276
   <%
277
   Call objFormComponent.FormEnd()
278
   '-- FROM END ----------------------------------------------------------------------------------------------------------------
279
   %>
280
</table>
281
</body>
282
</html>
283
<%
284
'------------ RUN AFTER PAGE RENDER -----------
285
Set objFormCollector = Nothing
286
'----------------------------------------------
287
Call Destroy_All_Objects
288
%>
289
 
290