Subversion Repositories DevTools

Rev

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