Subversion Repositories DevTools

Rev

Rev 5506 | Rev 6048 | 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
'|                                                   |
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
   <tr>
174
      <td>
175
         <!-- NEW PRODUCT ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
176
         <%Call Messenger ( sMessage , 1, "100%" )%>
177
         <!-- MESSAGE +++++++++++++++++++++++++++++++++++++++++++++++++++ -->
178
         <!--#include file="messages/_msg_inline.asp"-->
179
         <br>
180
         <%
181
        Dim extName
182
        Dim comment
183
        Dim isaCots
184
        Dim isVis
185
 
186
        If Request("ext") <> "" Then
187
            %>
188
            <input type="hidden" name="ext" value="<%=Request("ext")%>">
189
            <%
190
            Dim rsTemp
191
 
192
            Query_String = "select * FROM PROJECT_EXTENTIONS " &_
193
                          " where ext_name = '"& Request("ext") & "'"
194
 
195
            Set rsTemp = OraDatabase.DbCreateDynaset( Query_String, cint(0))
196
 
197
    		extName = rsTemp("EXT_NAME")
198
		    comment = rsTemp("UCOMMENT")
199
            isaCots = niceBool(rsTemp("IS_COTS"))
200
            isVis   = niceBool(rsTemp("IS_VISIBLE"))
201
 
202
            rsTemp.Close()
203
            Set rsTemp = Nothing      
204
          Else
205
            isaCots = "N"
206
            isVis = "Y"
207
          End If
208
          %>
209
 
5590 dpurdie 210
         <table border="0" class="body_txt">
5357 dpurdie 211
            <tr>
5590 dpurdie 212
               <td class="nowrap">Project Extension</td>
5357 dpurdie 213
               <td><input name="newext" type="text" class="body_txt" value="<%=extName%>" size=7 maxlength=5></td>
214
            </tr>
215
 
216
            <tr>
217
               <td></td>
218
               <td>The project suffix must start with a '.' and contain 2 to 4 lower case characters.</td>
219
            </tr>
220
 
221
            <tr>
5590 dpurdie 222
               <td class="nowrap">Comment</td>
5357 dpurdie 223
               <td><input name="comment" type="text" class="body_txt" value="<%=comment%>" size=80 maxlength=80></td>
224
            </tr>
225
 
226
            <tr>
227
               <td></td>
228
               <td>The comment field will be displayed during the project suffix selection process</td>
229
            </tr>
230
 
231
 
232
            <tr>
5590 dpurdie 233
               <td class="nowrap">Enable Selection</td>
5357 dpurdie 234
               <td><input name="isVis" type="checkbox" value="Y" <%=showCheck(isVis)%>></td>
235
            </tr>
236
 
237
            <tr>
238
               <td></td>
239
               <td>If selection is not enabled then the Suffix will not be shown and cannot be selected.
240
               This is useful for legacy projects where multiple extensions have been used. </td>
241
            </tr>
242
 
243
            <tr>
5590 dpurdie 244
               <td class="nowrap">Free Form Version</td>
5357 dpurdie 245
               <td><input name="isCots" type="checkbox" value="Y" <%=showCheck(isaCots)%>></td>
246
            </tr>
247
 
248
            <tr>
249
               <td></td>
250
               <td>Free Form Versioning flags packages are allowed to have non-standard version numbers.
251
               If the version number is in the standard major.minor.patch-build form then the package can be auto-versioned.
252
               If the version number has only a patch-build field then it can rippled.
253
               </td>
254
            </tr>
255
 
256
 
257
         </table>
258
      </td>
259
   </tr>
5590 dpurdie 260
   <tr>
261
      <td bgcolor=#FFFFFF>
262
         <table width="100%"  border="0" cellspacing="0" cellpadding="0">
263
            <tr>
264
               <td><%=ProgressBar()%></td>
265
               <td align="right"><input name="btn" type="submit" class="form_btn" value="Add/Update">
266
                  <input name="btn" type="reset" class="form_btn" value="Cancel" onclick="parent.closeIFrame();">
267
               </td>
268
            </tr>
269
         </table>
270
      </td>
271
   </tr>
5357 dpurdie 272
   <%=objPMod.ComposeHiddenTags()%>
273
   <input type="hidden" name="action" value="true">
274
   <%
275
   Call objFormComponent.FormEnd()
276
   '-- FROM END ----------------------------------------------------------------------------------------------------------------
277
   %>
278
</table>
279
</body>
280
</html>
281
<%
282
'------------ RUN AFTER PAGE RENDER -----------
283
Set objFormCollector = Nothing
284
'----------------------------------------------
285
Call Destroy_All_Objects
286
%>
287
 
288