Subversion Repositories DevTools

Rev

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