Subversion Repositories DevTools

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
3863 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
<meta HTTP-EQUIV="Pragma" CONTENT="no-cache">
152
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
153
<link href="images/release_manager_style.css" rel="stylesheet" type="text/css">
154
<script language="JavaScript" src="scripts/common.js"></script>
155
</head>
156
 
157
<body background="images/bg_bage_0.gif" leftmargin="0" topmargin="0" onLoad="self.focus();FormName.display_name.focus();">
158
<table width="100%"  border="0" cellspacing="0" cellpadding="10">
159
   <tr>
160
      <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>
161
         Add a new Project Extension or edit an existing Project Extension.
162
      </td>
163
   </tr>
164
 
165
   <%
166
   '-- FORM START --------------------------------------------------------------------------------------------------------------
167
   objFormComponent.FormName = "FormName"
168
   objFormComponent.Action = ScriptName
169
   objFormComponent.OnSubmit = "ShowProgress();"
170
   Call objFormComponent.FormStart()
171
 
172
   %>
173
   <tr>
174
      <td background="images/bg_login.gif">
175
         <table width="50%"  border="0" cellspacing="0" cellpadding="0">
176
            <tr>
177
               <td><%=ProgressBar()%></td>
178
               <td align="right"><input name="btn" type="submit" class="form_btn" value="Add/Update">
179
                  <input name="btn" type="reset" class="form_btn" value="Cancel" onClick="self.close();">
180
               </td>
181
            </tr>
182
         </table>
183
      </td>
184
   </tr>
185
   <tr>
186
      <td>
187
         <!-- NEW PRODUCT ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
188
         <%Call Messenger ( sMessage , 1, "100%" )%>
189
         <!-- MESSAGE +++++++++++++++++++++++++++++++++++++++++++++++++++ -->
190
         <!--#include file="messages/_msg_inline.asp"-->
191
         <br>
192
         <%
193
        Dim extName
194
        Dim comment
195
        Dim isaCots
196
        Dim isVis
197
 
198
        If Request("ext") <> "" Then
199
            %>
200
            <input type="hidden" name="ext" value="<%=Request("ext")%>">
201
            <%
202
            Dim rsTemp
203
 
204
            Query_String = "select * FROM PROJECT_EXTENTIONS " &_
205
                          " where ext_name = '"& Request("ext") & "'"
206
 
207
            Set rsTemp = OraDatabase.DbCreateDynaset( Query_String, cint(0))
208
 
209
    		extName = rsTemp("EXT_NAME")
210
		    comment = rsTemp("UCOMMENT")
211
            isaCots = niceBool(rsTemp("IS_COTS"))
212
            isVis   = niceBool(rsTemp("IS_VISIBLE"))
213
 
214
            rsTemp.Close()
215
            Set rsTemp = Nothing      
216
          Else
217
            isaCots = "N"
218
            isVis = "Y"
219
          End If
220
          %>
221
 
222
         <table width="50%" border="0"  class="body_txt">
223
            <tr>
224
               <td>Project Extension</td>
225
               <td><input name="newext" type="text" class="body_txt" value="<%=extName%>" size=7 maxlength=5></td>
226
            </tr>
227
 
228
            <tr>
229
               <td></td>
230
               <td>The project suffix must start with a '.' and contain 2 to 4 lower case characters.</td>
231
            </tr>
232
 
233
            <tr>
234
               <td>Comment</td>
235
               <td><input name="comment" type="text" class="body_txt" value="<%=comment%>" size=80 maxlength=80></td>
236
            </tr>
237
 
238
            <tr>
239
               <td></td>
240
               <td>The comment field will be displayed during the project suffix selection process</td>
241
            </tr>
242
 
243
 
244
            <tr>
245
               <td>Enable Selection</td>
246
               <td><input name="isVis" type="checkbox" value="Y" <%=showCheck(isVis)%>></td>
247
            </tr>
248
 
249
            <tr>
250
               <td></td>
251
               <td>If selection is not enabled then the Suffix will not be shown and cannot be selected.
252
               This is useful for legacy projects where multiple extensions have been used. </td>
253
            </tr>
254
 
255
            <tr>
256
               <td>Free Form Version</td>
257
               <td><input name="isCots" type="checkbox" value="Y" <%=showCheck(isaCots)%>></td>
258
            </tr>
259
 
260
            <tr>
261
               <td></td>
262
               <td>Free Form Versioning flags packages are allowed to have non-standard version numbers.
263
               If the version number is in the standard major.minor.patch-build form then the package can be auto-versioned.
264
               If the version number has only a patch-build field then it can rippled.
265
               </td>
266
            </tr>
267
 
268
 
269
         </table>
270
      </td>
271
   </tr>
272
   <%=objPMod.ComposeHiddenTags()%>
273
   <input type="hidden" name="action" value="true">
274
 
275
   <%
276
   Call objFormComponent.FormEnd()
277
   '-- FROM END ----------------------------------------------------------------------------------------------------------------
278
   %>
279
</table>
280
</body>
281
</html>
282
<%
283
'------------ RUN AFTER PAGE RENDER -----------
284
Set objFormCollector = Nothing
285
'----------------------------------------------
286
Call Destroy_All_Objects
287
%>
288
 
289