Subversion Repositories DevTools

Rev

Go to most recent revision | Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
5357 dpurdie 1
<%@LANGUAGE="VBSCRIPT"%>
2
<%
3
'=====================================================
4
'|                                                   |
5
'|                   wAddLicence                     |
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
<%
20
'------------ ACCESS CONTROL ------------------
21
%>
22
<!--#include file="_access_control_general.asp"-->
23
<!--#include file="_access_control_login.asp"-->
24
<%
25
'------------ VARIABLE DEFINITION -------------
26
Dim rsQry
27
Dim sMessage
28
Dim LICENCE_NAME
29
Dim Query_String
30
Dim dual
31
Dim LICENCE_ID
32
Dim Query_Stringx
33
'------------ CONSTANTS DECLARATION -----------
34
Const LIMG_PRODUCT = "<img src='icons/i_product.gif' width='19' height='19' hspace='2' align='absmiddle'>"
35
Const LIMG_PRODUCT_UNPACKAGED = "<img src='icons/i_product_unpackaged.gif' width='19' height='19' hspace='2' align='absmiddle' title='Product is unofficial'>"
36
Const LIMG_PRODUCT_PATCH = "<img src='icons/i_patch_small.gif' hspace='2' align='absmiddle'>"
37
'------------ VARIABLE INIT -------------------
38
sMessage = NULL
39
Set objFormCollector = CreateObject("Scripting.Dictionary")
40
'------------ CONDITIONS ----------------------
41
'----------------------------------------------
42
%>
43
<%
44
 
45
%>
46
<%
47
'------------ RUN BEFORE PAGE RENDER ----------
48
 
49
If CBool(Request("action")) Then
50
 
51
   If Request("LICENCE_NAME") = "" Then
52
 
53
      Call RaiseMsg ( enum_MSG_ERROR, "Cannot add an empty string as a licence name" )
54
 
55
   Else
56
      Query_String = _
57
      "   SELECT * FROM licences WHERE name = '"& Request("LICENCE_NAME") &"'"
58
 
59
      Set rsQry = OraDatabase.DbCreateDynaset( Query_String, cint(0))
60
 
61
      If rsQry.RecordCount = 0 Then
62
 
63
         Query_Stringx = _
64
         "   SELECT seq_gbe_id.NEXTVAL FROM DUAL"
65
 
66
         Set dual = OraDatabase.DbCreateDynaset(Query_Stringx,cint(0))
67
         LICENCE_ID = dual("NEXTVAL")
68
         dual.Close()
69
         Set dual = Nothing
70
 
71
         OraDatabase.Parameters.Add "LICENCE", LICENCE_ID, ORAPARM_INPUT, ORATYPE_NUMBER
72
         OraDatabase.Parameters.Add "NAME",    Request("LICENCE_NAME"),   ORAPARM_INPUT, ORATYPE_VARCHAR2
73
 
74
         objEH.TryORA ( OraSession )
75
         On Error Resume Next
76
         OraDatabase.ExecuteSQL ("begin INSERT INTO licences (licence, name) VALUES (:LICENCE, :NAME); end;")
77
         objEH.CatchORA ( OraSession )
78
 
79
         OraDatabase.Parameters.Remove "LICENCE"
80
         OraDatabase.Parameters.Remove "NAME"
81
 
82
         If objEH.Finally Then
83
            Call OpenInParentWindow ("admin_licences.asp")
84
            Call CloseWindow()
85
         End If
86
 
87
      Else
88
         Call RaiseMsg ( enum_MSG_LICENCE_EXISTS, Request("LICENCE_ID") )
89
      End If
90
 
91
      rsQry.Close
92
      Set rsQry = nothing
93
   End If
94
 
95
End If
96
 
97
 
98
'----------------------------------------------
99
%>
100
<html>
101
<head>
102
<title>Release Manager</title>
103
<link rel="shortcut icon" href="<%=FavIcon%>"/>
104
<meta HTTP-EQUIV="Pragma" CONTENT="no-cache">
105
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
106
<link href="images/release_manager_style.css" rel="stylesheet" type="text/css">
107
<script language="JavaScript" src="scripts/common.js"></script>
108
</head>
109
 
110
<body background="images/bg_bage_0.gif" leftmargin="0" topmargin="0" onLoad="self.focus();FormName.LICENCE_NAME.focus();">
111
<table width="100%"  border="0" cellspacing="0" cellpadding="10">
112
   <tr>
113
      <td bgcolor="#FFFFFF" class="body_txt">
114
         <span class="body_h1">
115
            <img src="icons/i_linkarrow_black.gif" width="11" height="11" align="absmiddle">&nbsp;Add Licence
116
         </span>
117
         <br>
118
         Add a new licence.
119
      </td>
120
   </tr>
121
 
122
   <%
123
   '-- FROM START --------------------------------------------------------------------------------------------------------------
124
   objFormComponent.FormName = "FormName"
125
   objFormComponent.Action = ScriptName
126
   objFormComponent.OnSubmit = "ShowProgress();"
127
   Call objFormComponent.FormStart()
128
 
129
   %>
130
   <tr>
131
      <td background="images/bg_login.gif">
132
         <table width="50%"  border="0" cellspacing="0" cellpadding="0">
133
            <tr>
134
               <td><%=ProgressBar()%></td>
135
               <td align="right"><input name="btn" type="submit" class="form_btn" value="Add">
136
                  <input name="btn" type="reset" class="form_btn" value="Cancel" onClick="self.close();">
137
               </td>
138
            </tr>
139
         </table>
140
      </td>
141
   </tr>
142
   <tr>
143
      <td>
144
         <!-- NEW PRODUCT ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
145
         <%Call Messenger ( sMessage , 3, "100%" )%>
146
         <!-- MESSAGE +++++++++++++++++++++++++++++++++++++++++++++++++++ -->
147
         <!--#include file="messages/_msg_inline.asp"-->
148
         <table width="70%" border="0">
149
            <tr>
150
               <td><span class="body_txt">Licence Name</span></td>
151
               <td><input name="LICENCE_NAME" type="text" class="body_txt" value="<%=LICENCE_NAME%>" size=70 maxlength=50></td>
152
            </tr>
153
            <tr>
154
               <td>&nbsp;</td>
155
               <td>&nbsp;</td>
156
            </tr>
157
         </table>
158
      </td>
159
   </tr>
160
   <%=objPMod.ComposeHiddenTags()%>
161
   <input type="hidden" name="action" value="true">
162
 
163
   <%
164
   Call objFormComponent.FormEnd()
165
   '-- FROM END ----------------------------------------------------------------------------------------------------------------
166
   %>
167
</table>
168
</body>
169
</html>
170
<%
171
'------------ RUN AFTER PAGE RENDER -----------
172
Set objFormCollector = Nothing
173
'----------------------------------------------
174
Call Destroy_All_Objects
175
%>
176
 
177