Subversion Repositories DevTools

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
5357 dpurdie 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_id, 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_id", (rsTemp.Fields("pkg_id"))
64
      pkgInfoHash.Add "pkg_name", (rsTemp.Fields("pkg_name"))
65
      pkgInfoHash.Add "pkg_version", (rsTemp.Fields("pkg_version"))
66
      pkgInfoHash.Add "dlocked", (rsTemp.Fields("dlocked"))
67
      pkgInfoHash.Add "modified_stamp", (rsTemp.Fields("modified_stamp"))
68
      pkgInfoHash.Add "modifier", (rsTemp.Fields("modifier"))
69
      pkgInfoHash.Add "created_stamp", (rsTemp.Fields("created_stamp"))
70
      pkgInfoHash.Add "creator", (rsTemp.Fields("creator"))
71
   End If
72
 
73
   rsTemp.Close
74
   Set rsTemp = nothing
75
End Sub
76
 
77
'----------------------------------------------
78
Sub Add_Missing_Dependency(RtagId, pvId, viewId)
79
 
80
   OraDatabase.Parameters.Add "RTAG_ID", RtagId,                  ORAPARM_INPUT, ORATYPE_NUMBER
81
   OraDatabase.Parameters.Add "PV_ID",   pvId,                    ORAPARM_INPUT, ORATYPE_VARCHAR2
82
   OraDatabase.Parameters.Add "USER_ID", objAccessControl.UserId, ORAPARM_INPUT, ORATYPE_NUMBER
83
   OraDatabase.Parameters.Add "VIEW_ID", viewId,                  ORAPARM_INPUT, ORATYPE_NUMBER
84
 
85
   objEH.TryORA ( OraSession )
86
 
87
   ' check if the package already exists in a pending or wip state
88
   If PackageExists(RtagId, pvId, "planned") Then
89
     Call RaiseMsg ( enum_WMSG_ERROR, "Package " & pkgInfoHash.Item ("pkg_name") & " " & pkgInfoHash.Item ("pkg_version") & " already exists in a pending state")
90
   ElseIf PackageExists(RtagId, pvId, "work_in_progress") Then
91
     Call RaiseMsg ( enum_WMSG_ERROR, "Package " & pkgInfoHash.Item ("pkg_name") & " " & pkgInfoHash.Item ("pkg_version") & " already exists as a WIP")
92
   End If
93
 
94
  OraDatabase.ExecuteSQL _
95
  "BEGIN   PK_PLANNED.REMOVE_PACKAGE ( :PV_ID, :RTAG_ID, :USER_ID );   END;"
96
 
97
   If Err.Number = 0 Then
98
     OraDatabase.ExecuteSQL _
99
     "BEGIN   PK_RELEASE.ADD_PACKAGE ( :PV_ID, :VIEW_ID, :RTAG_ID, :USER_ID );   END;"
100
   End If
101
 
102
   objEH.CatchORA ( OraSession )
103
 
104
   OraDatabase.Parameters.Remove "RTAG_ID"
105
   OraDatabase.Parameters.Remove "PV_ID"
106
   OraDatabase.Parameters.Remove "USER_ID"
107
   OraDatabase.Parameters.Remove "VIEW_ID"
108
End Sub
109
 
110
Function Release_Groups ( SSrtag_id, SSpkg_id )
111
	Release_Groups = _
112
    "SELECT vi.view_id, vi.view_name, bv.hint"&_
113
    "  FROM views vi,"&_
114
    "  ("&_
115
    "    SELECT DISTINCT rc.BASE_VIEW_ID, '>&nbsp;' AS hint"&_
116
    "    FROM release_content rc,"&_
117
    "         package_versions pv"&_
118
    "    WHERE rc.pv_id = pv.pv_id"&_
119
    "    AND pv.pkg_id IN (" & SSpkg_id & ")"&_
120
    "  ) bv "&_
121
    "WHERE"&_
122
    "   UPPER(vi.base_view) = 'Y'"&_
123
    "   AND bv.BASE_VIEW_ID (+) = vi.VIEW_ID "&_
124
    "ORDER BY vi.view_name ASC"
125
 
126
End Function
127
 
128
%>
129
<%
130
'Process submition
131
If CBool(QStrPar("action")) AND  objAccessControl.UserLogedIn Then
132
   Call Add_Missing_Dependency(parRtag_id,parPv_id,parView_id)
133
   Call OpenInParentWindow ( "dependencies.asp?pv_id="& parPPv_id &"&rtag_id="& parRtag_id )
134
   Call CloseWindow
135
 
136
End If
137
%>
138
<%
139
Call Get_Pkg_Information ( parPv_id)
140
%>
141
<html>
142
<head>
143
<title>Release Manager</title>
144
<link rel="shortcut icon" href="<%=FavIcon%>"/>
145
<meta HTTP-EQUIV="Pragma" CONTENT="no-cache">
146
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
147
<link rel="stylesheet" href="images/release_manager_style.css" type="text/css">
148
<link rel="stylesheet" href="images/navigation.css" type="text/css">
149
<script language="JavaScript" src="images/tipster.js"></script>
150
<script language="JavaScript" src="images/_help_tips.js"></script>
151
<script language="JavaScript" src="images/common.js"></script>
152
</head>
153
 
154
<body bgcolor="#FFFFFF" text="#000000" leftmargin="0" topmargin="0" onload="self.focus();">
155
<form name="addmissingdep" method="post" action="<%=scriptName%>">
156
   <table width="100%" border="0" cellspacing="0" cellpadding="2" height="100%">
157
      <tr>
158
         <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>
159
         <td background="images/lbox_bg_blue.gif" nowrap width="50%" class="wform_ttl">&nbsp;Add Missing Dependency</td>
160
         <td background="images/lbox_bg_blue.gif" align="right" width="50%">
161
            <input type="submit" name="btn" value="Add" style="width:50" class="form_btn_comp">
162
            <input type="reset" name="btn" value="Cancel" style="width:50" class="form_btn_comp" onclick="self.close()">
163
         </td>
164
         <td background="images/lbox_bg_blue.gif" align="right" width="1%%" nowrap>
165
            <img src="images/h_trsp_dot.gif" width="5" height="22">
166
         </td>
167
      </tr>
168
      <tr>
169
         <td height="100%" width="1%">&nbsp;</td>
170
         <td valign="top" nowrap colspan="3" class="wform_ttl" background="images/bg_form_lightgray.gif">
171
            <table width="100%" border="0" cellspacing="1" cellpadding="2">
172
               <tr>
173
                  <td width="1%"><img src="images/h_trsp_dot.gif" width="10" height="30"></td>
174
                  <td width="1%" nowrap class="form_group" valign="bottom">Details of Dependency that will be Added:</td>
175
                  <td nowrap width="100%">&nbsp; </td>
176
                  <td nowrap width="100%">&nbsp; </td>
177
               </tr>
178
               <tr>
179
                  <td width="1%">&nbsp;</td>
180
                  <td width="1%" nowrap class="form_field" background="images/bg_form_lightbluedark.gif">Package</td>
181
                  <td nowrap width="100%" background="images/bg_form_lightbluedark.gif" class="form_txt">
182
                     <%=imgPkgLockSpacer%>
183
                     <%=pkgInfoHash.Item("pkg_name")%>
184
                  </td>
185
               </tr>
186
               <tr>
187
                  <td width="1%">&nbsp;</td>
188
                  <td width="1%" nowrap class="form_field" background="images/bg_form_lightbluedark.gif">Version</td>
189
                  <td nowrap width="100%" background="images/bg_form_lightbluedark.gif" class="form_txt">
190
                     <%If pkgInfoHash.Item("dlocked") = "Y" Then%><%=imgPkgLocked%><%Else%><%=imgPkgLockSpacer%><%End If%>
191
                     <%=pkgInfoHash.Item("pkg_version")%>
192
                  </td>
193
               </tr>
194
               <tr>
195
                  <td width="1%">&nbsp;</td>
196
                  <td width="1%" nowrap class="form_field" background="images/bg_form_lightbluedark.gif">Last Modified</td>
197
                  <td nowrap width="100%" background="images/bg_form_lightbluedark.gif" class="form_txt">
198
                     <%=imgPkgLockSpacer%>
199
                     <%=EuroDateTime(pkgInfoHash.Item ("modified_stamp")) & " by " & pkgInfoHash.Item ("modifier")%>
200
                  </td>
201
               </tr>
202
               <tr>
203
                  <td width="1%">&nbsp;</td>
204
                  <td width="1%" nowrap class="form_field" background="images/bg_form_lightbluedark.gif">Created</td>
205
                  <td nowrap width="100%" background="images/bg_form_lightbluedark.gif" class="form_txt">
206
                     <%=imgPkgLockSpacer%>
207
                     <%=EuroDateTime(pkgInfoHash.Item ("created_stamp")) & " by " & pkgInfoHash.Item ("creator")%>
208
                  </td>
209
               </tr>
210
               <tr>
211
                  <td width="1%"><img src="images/h_trsp_dot.gif" width="10" height="30"></td>
212
                  <td width="1%" nowrap class="form_group" valign="bottom">Select Destination View</td>
213
                  <td nowrap width="100%">&nbsp; </td>
214
               </tr>
215
               <tr> 
216
                 <td width="1%">&nbsp;</td>
217
                 <td width="1%" nowrap class="form_field" background="images/bg_form_lightbluedark.gif" valign=top>Base View</td>
218
                 <td nowrap width="100%" background="images/bg_form_lightbluedark.gif">
219
                   <table border=0 cellpadding=0 cellspacing=0 class="rep_small">
220
                     <tr>
221
                       <td>
222
      			         <select name="view_id" class="form_item">
223
                           <option></option>
224
                 <%
225
                   Dim iDefault_View_id: iDefault_View_id = -1
226
                   If Not IsNull(parBase_view_id) Then iDefault_View_id = parBase_view_id
227
   			       Dim rsRelGroups
228
                   Dim bSelected: bSelected=False
229
			       Set rsRelGroups = OraDatabase.DbCreateDynaset( Release_Groups( parRtag_id,pkgInfoHash.Item ("pkg_id")), cint(0))
230
			       While ((NOT rsRelGroups.BOF) AND (NOT rsRelGroups.EOF))
231
                     If (NOT IsNull(rsRelGroups("hint"))) AND (NOT bSelected) Then
232
                       Response.write "<option selected value='"& rsRelGroups("view_id") &"'>"& rsRelGroups("hint") & rsRelGroups("view_name") &"</option>"
233
                       bSelected=True
234
                     Else
235
                       Response.write "<option value='"& rsRelGroups("view_id") &"'>"& rsRelGroups("hint") & rsRelGroups("view_name") &"</option>"
236
                     End If
237
                     rsRelGroups.MoveNext
238
			       WEnd
239
 			       rsRelGroups.Close
240
			       set rsRelGroups = nothing
241
			     %>
242
			             </select>
243
                       </td>
244
                     </tr>
245
                     <tr>
246
                       <td>
247
                         NOTE: '>' is a suggestion of where to place this dependency.
248
                         It denotes views where it has been placed in other releases.
249
                       </td>
250
                     </tr>
251
                   </table>
252
                 </td>
253
               </tr>
254
               <tr>
255
                  <input type="hidden" name="pv_id" value="<%=parPv_id%>">
256
                  <input type="hidden" name="rtag_id" value="<%=parRtag_id%>">
257
                  <input type="hidden" name="ppv_id" value="<%=parPPv_id%>">
258
                  <input type="hidden" name="rfile" value="<%=parRfile%>">
259
                  <input type="hidden" name="action" value="true">
260
               </tr>
261
            </table>
262
         </td>
263
      </tr>
264
      <tr>
265
         <td height="100%" width="1%">&nbsp;</td>
266
         <td valign="top" nowrap colspan="3" class="wform_ttl" background="images/bg_form_lightgray.gif">
267
            <table width="100%" border="0" cellspacing="1" cellpadding="2">
268
               <tr>
269
                  <td width="1%" wrap class="form_group" valign="bottom">
270
                     WARNING:<br>
271
                     The destination release may not satisfy any or all the dependencies that come with
272
                     this dependency you are about to add. It is your responsibility to rectify this in the
273
                     destination release.
274
                  </td>
275
               </tr>
276
            </table>
277
         </td>
278
      </tr>
279
      <tr>
280
         <td height="1%" width="1%"><img src="images/h_trsp_dot.gif" width="5" height="5"></td>
281
         <td valign="top" nowrap colspan="3" class="wform_ttl" background="images/lbox_bg_blue.gif"></td>
282
      </tr>
283
   </table>
284
</form>
285
<!-- TIPS LAYERS -------------------------------------->
286
<div id="formTipsLayer" style="position: absolute; z-index: 1000; visibility: hidden; left:0; top: 0; width: 10">&nbsp;</div>
287
<!----------------------------------------------------->
288
</body>
289
</html>
290
 
291
 
292
<!-- DESTRUCTOR ------->
293
<!--#include file="common/destructor.asp"-->