Subversion Repositories DevTools

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
183 brianf 1
<%@LANGUAGE="VBSCRIPT"%>
2
<%
3
Option explicit
4
Response.Expires = 0   ' always load the page, dont store
5
%>
6
<%
7
'=====================================================
8
'               Change Owner
9
'=====================================================
10
%>
11
<!--#include file="common/conf.asp"-->
12
<!--#include file="common/globals.asp"-->
13
<!--#include file="common/qstr.asp"-->
14
<!--#include file="common/common_subs.asp"-->
15
<!--#include file="common/common_dbedit.asp"-->
16
<!--#include file="common/_popup_window_common.asp"-->
17
<!--#include file="common/formating.asp"-->
18
<%
19
'------------ ACCESS CONTROL ------------------
20
%>
21
<!--#include file="_access_control_login.asp"-->
22
<!--#include file="_access_control_general.asp"-->
23
<!--#include file="_access_control_project.asp"-->
24
<%
25
'------------ Variable Definition -------------
26
Dim parPv_id
27
Dim parPPv_id ' pv_id of parent
28
'Dim parRtag_id
29
Dim parRfile
30
Dim parView_id
31
Dim parBase_view_id
32
Dim bPreventSubmit
33
'------------ Constants Declaration -----------
34
'------------ Constants Declaration -----------
35
Const imgPkgLocked = "<img src='images/i_locked.gif' width='7' height='10' hspace='4' align='absmiddle'>"
36
Const imgPkgLockSpacer = "<img src='images/spacer.gif' width='7' height='10' hspace='4' align='absmiddle'>"
37
'------------ Variable Init -------------------
38
Set pkgInfoHash = CreateObject("Scripting.Dictionary")
39
parPv_id = QStrPar("pv_id")
40
parPPv_id = QStrPar("ppv_id")
41
parRtag_id = QStrPar("rtag_id")
42
parRfile = Request("rfile")
43
parView_id = QStrPar("view_id")
44
parBase_view_id = QStrPar("base_view_id")
45
bPreventSubmit = false
46
'----------------------------------------------
47
%>
48
<%
49
Sub Get_Pkg_Information ( NNpv_id)
50
   Dim rsTemp, Query_String
51
 
52
   Query_String = _
53
   " SELECT pkg.pkg_name, pv.pkg_version, pv.dlocked,pv.modified_stamp,um.full_name as modifier,pv.created_stamp,uc.full_name as creator"&_
54
   "   FROM packages pkg, package_versions pv, users um, users uc"&_
55
   "  WHERE pkg.pkg_id = pv.pkg_id"&_
56
   "    AND pv.modifier_id = um.user_id (+)" &_
57
   "    AND pv.creator_id = uc.user_id (+)" &_
58
   "    AND pv.pv_id = "& NNpv_id
59
 
60
   Set rsTemp = OraDatabase.DbCreateDynaset( Query_String, cint(0))
61
 
62
   If ((NOT rsTemp.BOF) AND (NOT rsTemp.EOF)) Then
63
      pkgInfoHash.Add "pkg_name", (rsTemp.Fields("pkg_name"))
64
      pkgInfoHash.Add "pkg_version", (rsTemp.Fields("pkg_version"))
65
      pkgInfoHash.Add "dlocked", (rsTemp.Fields("dlocked"))
66
      pkgInfoHash.Add "modified_stamp", (rsTemp.Fields("modified_stamp"))
67
      pkgInfoHash.Add "modifier", (rsTemp.Fields("modifier"))
68
      pkgInfoHash.Add "created_stamp", (rsTemp.Fields("created_stamp"))
69
      pkgInfoHash.Add "creator", (rsTemp.Fields("creator"))
70
   End If
71
 
72
   rsTemp.Close
73
   Set rsTemp = nothing
74
End Sub
75
 
76
'----------------------------------------------
77
Sub Add_Missing_Dependency(RtagId, pvId, viewId)
78
 
79
   OraDatabase.Parameters.Add "RTAG_ID", RtagId,                  ORAPARM_INPUT, ORATYPE_NUMBER
80
   OraDatabase.Parameters.Add "PV_ID",   pvId,                    ORAPARM_INPUT, ORATYPE_VARCHAR2
81
   OraDatabase.Parameters.Add "USER_ID", objAccessControl.UserId, ORAPARM_INPUT, ORATYPE_NUMBER
82
   OraDatabase.Parameters.Add "VIEW_ID", viewId,                  ORAPARM_INPUT, ORATYPE_NUMBER
83
 
84
   objEH.TryORA ( OraSession )
85
 
86
   ' check if the package already exists in a pending or wip state
87
   If PackageExists(RtagId, pvId, "planned") Then
88
     Call RaiseMsg ( enum_WMSG_ERROR, "Package " & pkgInfoHash.Item ("pkg_name") & " " & pkgInfoHash.Item ("pkg_version") & " already exists in a pending state")
89
   ElseIf PackageExists(RtagId, pvId, "work_in_progress") Then
90
     Call RaiseMsg ( enum_WMSG_ERROR, "Package " & pkgInfoHash.Item ("pkg_name") & " " & pkgInfoHash.Item ("pkg_version") & " already exists as a WIP")
91
   End If
92
 
93
  OraDatabase.ExecuteSQL _
94
  "BEGIN   PK_PLANNED.REMOVE_PACKAGE ( :PV_ID, :RTAG_ID, :USER_ID );   END;"
95
 
96
   If Err.Number = 0 Then
97
     OraDatabase.ExecuteSQL _
98
     "BEGIN   PK_RELEASE.ADD_PACKAGE ( :PV_ID, :VIEW_ID, :RTAG_ID, :USER_ID );   END;"
99
   End If
100
 
101
   objEH.CatchORA ( OraSession )
102
 
103
   OraDatabase.Parameters.Remove "RTAG_ID"
104
   OraDatabase.Parameters.Remove "PV_ID"
105
   OraDatabase.Parameters.Remove "USER_ID"
106
   OraDatabase.Parameters.Remove "VIEW_ID"
107
End Sub
108
 
109
Function Release_Groups ( SSrtag_id )
110
	Release_Groups = _
111
	"SELECT view_id, view_name"&_
112
	"  FROM views "&_
113
	" WHERE base_view='Y'"&_
114
	"ORDER BY UPPER(view_name)"
115
End Function
116
 
117
%>
118
<%
119
'Process submition
120
If CBool(QStrPar("action")) AND  objAccessControl.UserLogedIn Then
121
   Call Add_Missing_Dependency(parRtag_id,parPv_id,parView_id)
122
   Call OpenInParentWindow ( "dependencies.asp?pv_id="& parPPv_id &"&rtag_id="& parRtag_id )
123
   Call CloseWindow
124
 
125
End If
126
%>
127
<%
128
Call Get_Pkg_Information ( parPv_id)
129
%>
130
<html>
131
<head>
132
<title>Release Manager</title>
133
<meta HTTP-EQUIV="Pragma" CONTENT="no-cache">
134
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
135
<link rel="stylesheet" href="images/release_manager_style.css" type="text/css">
136
<link rel="stylesheet" href="images/navigation.css" type="text/css">
137
<script language="JavaScript" src="images/tipster.js"></script>
138
<script language="JavaScript" src="images/_help_tips.js"></script>
139
<script language="JavaScript" src="images/common.js"></script>
140
</head>
141
 
142
<body bgcolor="#FFFFFF" text="#000000" leftmargin="0" topmargin="0" onload="self.focus();">
143
<form name="addmissingdep" method="post" action="<%=scriptName%>">
144
   <table width="100%" border="0" cellspacing="0" cellpadding="2" height="100%">
145
      <tr>
146
         <td background="images/lbox_bg_orange.gif" width="1%" height="1%"><img src="images/i_add_deps.gif" width="22" height="25" hspace="5"></td>
147
         <td background="images/lbox_bg_blue.gif" nowrap width="50%" class="wform_ttl">&nbsp;Add missing Dependency</td>
148
         <td background="images/lbox_bg_blue.gif" align="right" width="50%">
149
            <input type="submit" name="btn" value="Add" style="width:50" class="form_btn_comp">
150
            <input type="reset" name="btn" value="Cancel" style="width:50" class="form_btn_comp" onclick="self.close()">
151
         </td>
152
         <td background="images/lbox_bg_blue.gif" align="right" width="1%%" nowrap>
153
            <img src="images/h_trsp_dot.gif" width="5" height="22">
154
         </td>
155
      </tr>
156
      <tr>
157
         <td height="100%" width="1%">&nbsp;</td>
158
         <td valign="top" nowrap colspan="3" class="wform_ttl" background="images/bg_form_lightgray.gif">
159
            <table width="100%" border="0" cellspacing="1" cellpadding="2">
160
               <tr>
161
                  <td width="1%"><img src="images/h_trsp_dot.gif" width="10" height="30"></td>
162
                  <td width="1%" nowrap class="form_group" valign="bottom">Dependency Details</td>
163
                  <td nowrap width="100%">&nbsp; </td>
164
                  <td nowrap width="100%">&nbsp; </td>
165
               </tr>
166
               <tr>
167
                  <td width="1%">&nbsp;</td>
168
                  <td width="1%" nowrap class="form_field" background="images/bg_form_lightbluedark.gif">Package</td>
169
                  <td nowrap width="100%" background="images/bg_form_lightbluedark.gif" class="form_txt">
170
                     <%=imgPkgLockSpacer%>
171
                     <%=pkgInfoHash.Item("pkg_name")%>
172
                  </td>
173
               </tr>
174
               <tr>
175
                  <td width="1%">&nbsp;</td>
176
                  <td width="1%" nowrap class="form_field" background="images/bg_form_lightbluedark.gif">Version</td>
177
                  <td nowrap width="100%" background="images/bg_form_lightbluedark.gif" class="form_txt">
178
                     <%If pkgInfoHash.Item("dlocked") = "Y" Then%><%=imgPkgLocked%><%Else%><%=imgPkgLockSpacer%><%End If%>
179
                     <%=pkgInfoHash.Item("pkg_version")%>
180
                  </td>
181
               </tr>
182
               <tr>
183
                  <td width="1%">&nbsp;</td>
184
                  <td width="1%" nowrap class="form_field" background="images/bg_form_lightbluedark.gif">Last Modified</td>
185
                  <td nowrap width="100%" background="images/bg_form_lightbluedark.gif" class="form_txt">
186
                     <%=imgPkgLockSpacer%>
187
                     <%=EuroDateTime(pkgInfoHash.Item ("modified_stamp")) & " by " & pkgInfoHash.Item ("modifier")%>
188
                  </td>
189
               </tr>
190
               <tr>
191
                  <td width="1%">&nbsp;</td>
192
                  <td width="1%" nowrap class="form_field" background="images/bg_form_lightbluedark.gif">Created</td>
193
                  <td nowrap width="100%" background="images/bg_form_lightbluedark.gif" class="form_txt">
194
                     <%=imgPkgLockSpacer%>
195
                     <%=EuroDateTime(pkgInfoHash.Item ("created_stamp")) & " by " & pkgInfoHash.Item ("creator")%>
196
                  </td>
197
               </tr>
198
               <tr>
199
                  <td width="1%"><img src="images/h_trsp_dot.gif" width="10" height="30"></td>
200
                  <td width="1%" nowrap class="form_group" valign="bottom">Select Destination view</td>
201
                  <td nowrap width="100%">&nbsp; </td>
202
               </tr>
203
               <tr> 
204
                 <td width="1%">&nbsp;</td>
205
                 <td width="1%" nowrap class="form_field" background="images/bg_form_lightbluedark.gif">Base View</td>
206
                 <td nowrap width="100%" background="images/bg_form_lightbluedark.gif">
207
      			 <select name="view_id" class="form_item">
208
                 <%
209
                   Dim iDefault_View_id: iDefault_View_id = -1
210
                   If Not IsNull(parBase_view_id) Then iDefault_View_id = parBase_view_id
211
   			       Dim rsRelGroups
212
			       Set rsRelGroups = OraDatabase.DbCreateDynaset( Release_Groups( parRtag_id), cint(0))
213
			       While ((NOT rsRelGroups.BOF) AND (NOT rsRelGroups.EOF))
214
                 %>
215
                     <option <%  If CInt(rsRelGroups.Fields("view_id")) = CInt(iDefault_View_id) Then%>selected<%End If%> value="<%=rsRelGroups.Fields("view_id")%>"><%=UCase(rsRelGroups.Fields("view_name"))%></option>
216
                 <%
217
                     rsRelGroups.MoveNext
218
			       WEnd
219
 			       rsRelGroups.Close
220
			       set rsRelGroups = nothing
221
			     %>
222
			     </select>
223
                 <%
224
                   Dim sonclick
225
                   Dim surl
226
                   surl = "_wform_new_group.asp?pv_id=" & parPv_id & "&rtag_id=" & parRtag_id & "&rfile=" & scriptName & "&ppv_id=" & parPPv_id
227
                   sonclick = "MM_openBrWindow('" & surl & "','NewGroup','resizable=yes,width=450,height=300');"
228
                 %>
229
                 <img onclick="<%=sonclick%>" src="images/i_new_group.gif" width="20" height="20" align="absmiddle" border="0" alt="Create NEW group" title="Create NEW group"></a> 
230
                 </td>
231
               </tr>
232
               <tr>
233
                  <input type="hidden" name="pv_id" value="<%=parPv_id%>">
234
                  <input type="hidden" name="rtag_id" value="<%=parRtag_id%>">
235
                  <input type="hidden" name="ppv_id" value="<%=parPPv_id%>">
236
                  <input type="hidden" name="rfile" value="<%=parRfile%>">
237
                  <input type="hidden" name="action" value="true">
238
               </tr>
239
            </table>
240
         </td>
241
      </tr>
242
      <tr>
243
         <td height="100%" width="1%">&nbsp;</td>
244
         <td valign="top" nowrap colspan="3" class="wform_ttl" background="images/bg_form_lightgray.gif">
245
            <table width="100%" border="0" cellspacing="1" cellpadding="2">
246
               <tr>
247
                  <td width="1%" wrap class="form_group" valign="bottom">
248
                     WARNING:<br>
249
                     The destination release may not satisfy any or all the dependencies that come with
250
                     this dependency you are about to add. It is your responsibility to rectify this in the
251
                     destination release.
252
                  </td>
253
               </tr>
254
            </table>
255
         </td>
256
      </tr>
257
      <tr>
258
         <td height="1%" width="1%"><img src="images/h_trsp_dot.gif" width="5" height="5"></td>
259
         <td valign="top" nowrap colspan="3" class="wform_ttl" background="images/lbox_bg_blue.gif"></td>
260
      </tr>
261
   </table>
262
</form>
263
<!-- TIPS LAYERS -------------------------------------->
264
<div id="formTipsLayer" style="position: absolute; z-index: 1000; visibility: hidden; left:0; top: 0; width: 10">&nbsp;</div>
265
<!----------------------------------------------------->
266
</body>
267
</html>
268
 
269
 
270
<!-- DESTRUCTOR ------->
271
<!--#include file="common/destructor.asp"-->