Subversion Repositories DevTools

Rev

Rev 5957 | Rev 6579 | 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
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
5607 dpurdie 33
Dim sMessage
5357 dpurdie 34
'------------ Constants Declaration -----------
35
'------------ Constants Declaration -----------
36
'------------ Variable Init -------------------
37
Set pkgInfoHash = CreateObject("Scripting.Dictionary")
38
parPv_id = QStrPar("pv_id")
39
parPPv_id = QStrPar("ppv_id")
40
parRtag_id = QStrPar("rtag_id")
41
parRfile = Request("rfile")
42
parView_id = QStrPar("view_id")
43
parBase_view_id = QStrPar("base_view_id")
44
bPreventSubmit = false
5607 dpurdie 45
sMessage = NULL
5357 dpurdie 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
 
5607 dpurdie 85
   objEH.ErrorRedirect = FALSE
86
   On Error Resume Next
5357 dpurdie 87
   objEH.TryORA ( OraSession )
88
 
89
  OraDatabase.ExecuteSQL _
5607 dpurdie 90
    "BEGIN   PK_PLANNED.REMOVE_PACKAGE ( :PV_ID, :RTAG_ID, :USER_ID );   END;"
5357 dpurdie 91
 
92
   If Err.Number = 0 Then
93
     OraDatabase.ExecuteSQL _
94
     "BEGIN   PK_RELEASE.ADD_PACKAGE ( :PV_ID, :VIEW_ID, :RTAG_ID, :USER_ID );   END;"
95
   End If
96
 
97
   objEH.CatchORA ( OraSession )
98
 
99
   OraDatabase.Parameters.Remove "RTAG_ID"
100
   OraDatabase.Parameters.Remove "PV_ID"
101
   OraDatabase.Parameters.Remove "USER_ID"
102
   OraDatabase.Parameters.Remove "VIEW_ID"
103
End Sub
104
 
105
Function Release_Groups ( SSrtag_id, SSpkg_id )
106
	Release_Groups = _
107
    "SELECT vi.view_id, vi.view_name, bv.hint"&_
108
    "  FROM views vi,"&_
109
    "  ("&_
110
    "    SELECT DISTINCT rc.BASE_VIEW_ID, '>&nbsp;' AS hint"&_
111
    "    FROM release_content rc,"&_
112
    "         package_versions pv"&_
113
    "    WHERE rc.pv_id = pv.pv_id"&_
114
    "    AND pv.pkg_id IN (" & SSpkg_id & ")"&_
115
    "  ) bv "&_
116
    "WHERE"&_
117
    "   UPPER(vi.base_view) = 'Y'"&_
118
    "   AND bv.BASE_VIEW_ID (+) = vi.VIEW_ID "&_
119
    "ORDER BY vi.view_name ASC"
120
 
121
End Function
122
 
5607 dpurdie 123
Call Get_Pkg_Information ( parPv_id)
124
 
125
' check if the package already exists in a pending or wip state
126
If PackageExists(parRtag_id,parPv_id, "planned") Then
127
     sMessage = "Package " & pkgInfoHash.Item ("pkg_name") & " " & pkgInfoHash.Item ("pkg_version") & " already exists in a pending state"
128
 
129
ElseIf PackageExists(parRtag_id,parPv_id, "work_in_progress") Then
130
     sMessage = "Package " & pkgInfoHash.Item ("pkg_name") & " " & pkgInfoHash.Item ("pkg_version") & " already exists as a WIP"
131
 
132
ElseIf CBool(QStrPar("action")) AND  objAccessControl.UserLogedIn Then
133
    'Process submition
5357 dpurdie 134
   Call Add_Missing_Dependency(parRtag_id,parPv_id,parView_id)
5607 dpurdie 135
   If objEH.Finally Then
136
    Call OpenInParentWindow ( "dependencies.asp?pv_id="& parPPv_id &"&rtag_id="& parRtag_id )
137
    Call CloseWindow
138
   End If
5357 dpurdie 139
End If
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();">
5607 dpurdie 155
<form class="form_tight" name="addmissingdep" method="post" action="<%=scriptName%>">
156
   <table width="100%" border="0" cellspacing="0" cellpadding="2">
5357 dpurdie 157
      <tr>
158
         <td valign="top" nowrap colspan="3" class="wform_ttl" background="images/bg_form_lightgray.gif">
5607 dpurdie 159
           <!-- LOCAL ERROR +++++++++++++++++++++++++++++++++++++++++++++++ -->
160
           <%Call Messenger ( sMessage , 3, "100%" )%>
161
           <!-- MESSAGE +++++++++++++++++++++++++++++++++++++++++++++++++++ -->
162
           <!--#include file="messages/_msg_inline.asp"-->
5357 dpurdie 163
            <table width="100%" border="0" cellspacing="1" cellpadding="2">
164
               <tr>
165
                  <td width="1%" nowrap class="form_group" valign="bottom">Details of Dependency that will be Added:</td>
166
                  <td nowrap width="100%">&nbsp; </td>
167
                  <td nowrap width="100%">&nbsp; </td>
168
               </tr>
169
               <tr>
170
                  <td width="1%" nowrap class="form_field" background="images/bg_form_lightbluedark.gif">Package</td>
171
                  <td nowrap width="100%" background="images/bg_form_lightbluedark.gif" class="form_txt">
172
                     <%=imgPkgLockSpacer%>
173
                     <%=pkgInfoHash.Item("pkg_name")%>
174
                  </td>
175
               </tr>
176
               <tr>
177
                  <td width="1%" nowrap class="form_field" background="images/bg_form_lightbluedark.gif">Version</td>
178
                  <td nowrap width="100%" background="images/bg_form_lightbluedark.gif" class="form_txt">
179
                     <%If pkgInfoHash.Item("dlocked") = "Y" Then%><%=imgPkgLocked%><%Else%><%=imgPkgLockSpacer%><%End If%>
180
                     <%=pkgInfoHash.Item("pkg_version")%>
181
                  </td>
182
               </tr>
183
               <tr>
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%>
5632 dpurdie 187
                     <%=DisplayDateTime(pkgInfoHash.Item ("modified_stamp")) & " by " & pkgInfoHash.Item ("modifier")%>
5357 dpurdie 188
                  </td>
189
               </tr>
190
               <tr>
191
                  <td width="1%" nowrap class="form_field" background="images/bg_form_lightbluedark.gif">Created</td>
192
                  <td nowrap width="100%" background="images/bg_form_lightbluedark.gif" class="form_txt">
193
                     <%=imgPkgLockSpacer%>
5632 dpurdie 194
                     <%=DisplayDateTime(pkgInfoHash.Item ("created_stamp")) & " by " & pkgInfoHash.Item ("creator")%>
5357 dpurdie 195
                  </td>
196
               </tr>
197
               <tr>
198
                  <td width="1%" nowrap class="form_group" valign="bottom">Select Destination View</td>
199
                  <td nowrap width="100%">&nbsp; </td>
200
               </tr>
201
               <tr> 
202
                 <td width="1%" nowrap class="form_field" background="images/bg_form_lightbluedark.gif" valign=top>Base View</td>
203
                 <td nowrap width="100%" background="images/bg_form_lightbluedark.gif">
204
                   <table border=0 cellpadding=0 cellspacing=0 class="rep_small">
205
                     <tr>
206
                       <td>
207
      			         <select name="view_id" class="form_item">
208
                           <option></option>
209
                 <%
210
                   Dim iDefault_View_id: iDefault_View_id = -1
211
                   If Not IsNull(parBase_view_id) Then iDefault_View_id = parBase_view_id
212
   			       Dim rsRelGroups
213
                   Dim bSelected: bSelected=False
214
			       Set rsRelGroups = OraDatabase.DbCreateDynaset( Release_Groups( parRtag_id,pkgInfoHash.Item ("pkg_id")), cint(0))
215
			       While ((NOT rsRelGroups.BOF) AND (NOT rsRelGroups.EOF))
216
                     If (NOT IsNull(rsRelGroups("hint"))) AND (NOT bSelected) Then
217
                       Response.write "<option selected value='"& rsRelGroups("view_id") &"'>"& rsRelGroups("hint") & rsRelGroups("view_name") &"</option>"
218
                       bSelected=True
219
                     Else
220
                       Response.write "<option value='"& rsRelGroups("view_id") &"'>"& rsRelGroups("hint") & rsRelGroups("view_name") &"</option>"
221
                     End If
222
                     rsRelGroups.MoveNext
223
			       WEnd
224
 			       rsRelGroups.Close
225
			       set rsRelGroups = nothing
226
			     %>
227
			             </select>
228
                       </td>
229
                     </tr>
230
                     <tr>
231
                       <td>
232
                         NOTE: '>' is a suggestion of where to place this dependency.
233
                         It denotes views where it has been placed in other releases.
234
                       </td>
235
                     </tr>
236
                   </table>
237
                 </td>
238
               </tr>
239
               <tr>
240
                  <input type="hidden" name="pv_id" value="<%=parPv_id%>">
241
                  <input type="hidden" name="rtag_id" value="<%=parRtag_id%>">
242
                  <input type="hidden" name="ppv_id" value="<%=parPPv_id%>">
243
                  <input type="hidden" name="rfile" value="<%=parRfile%>">
244
                  <input type="hidden" name="action" value="true">
245
               </tr>
246
            </table>
247
         </td>
248
      </tr>
249
      <tr>
250
         <td valign="top" nowrap colspan="3" class="wform_ttl" background="images/bg_form_lightgray.gif">
251
            <table width="100%" border="0" cellspacing="1" cellpadding="2">
252
               <tr>
253
                  <td width="1%" wrap class="form_group" valign="bottom">
254
                     WARNING:<br>
255
                     The destination release may not satisfy any or all the dependencies that come with
256
                     this dependency you are about to add. It is your responsibility to rectify this in the
257
                     destination release.
258
                  </td>
259
               </tr>
260
            </table>
261
         </td>
262
      </tr>
263
      <tr>
5607 dpurdie 264
         <td align="right" width="50%">
265
            <input type="submit" name="btn" value="Add" style="width:50" <%=iif(isNull(sMessage), "", "disabled")%> class="<%=iif(isNull(sMessage), "form_btn_comp", "form_btn_comp_disabled")%>">
266
            <input type="reset" name="btn" value="Cancel" style="width:50" class="form_btn_comp" onclick="parent.closeIFrame();">
267
         </td>
5357 dpurdie 268
      </tr>
269
   </table>
270
</form>
271
</body>
272
</html>
273
<!-- DESTRUCTOR ------->
274
<!--#include file="common/destructor.asp"-->