| 119 |
ghuddy |
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 |
<%
|
|
|
18 |
'------------ ACCESS CONTROL ------------------
|
|
|
19 |
%>
|
|
|
20 |
<!--#include file="_access_control_login.asp"-->
|
|
|
21 |
<!--#include file="_access_control_general.asp"-->
|
|
|
22 |
<!--#include file="_access_control_project.asp"-->
|
|
|
23 |
<%
|
|
|
24 |
'------------ Variable Definition -------------
|
|
|
25 |
Dim parPv_id
|
|
|
26 |
'------------ Constants Declaration -----------
|
|
|
27 |
'------------ Variable Init -------------------
|
|
|
28 |
Set pkgInfoHash = CreateObject("Scripting.Dictionary")
|
|
|
29 |
parPv_id = QStrPar("pv_id")
|
|
|
30 |
'----------------------------------------------
|
|
|
31 |
%>
|
|
|
32 |
<%
|
|
|
33 |
Sub Get_Pkg_Info_With_Owner ( NNpv_id )
|
|
|
34 |
Dim rsTemp, Query_String
|
|
|
35 |
|
|
|
36 |
Query_String = _
|
|
|
37 |
" SELECT pkg.pkg_name, pv.pkg_version, pv.owner_id"&_
|
|
|
38 |
" FROM packages pkg, package_versions pv"&_
|
|
|
39 |
" WHERE pkg.pkg_id = pv.pkg_id"&_
|
|
|
40 |
" AND pv.pv_id = "& NNpv_id
|
|
|
41 |
|
|
|
42 |
Set rsTemp = OraDatabase.DbCreateDynaset( Query_String, cint(0))
|
|
|
43 |
|
|
|
44 |
If ((NOT rsTemp.BOF) AND (NOT rsTemp.EOF)) Then
|
|
|
45 |
pkgInfoHash.Add "pkg_name", (rsTemp.Fields("pkg_name"))
|
|
|
46 |
pkgInfoHash.Add "pkg_version", (rsTemp.Fields("pkg_version"))
|
|
|
47 |
pkgInfoHash.Add "owner_id", (rsTemp.Fields("owner_id"))
|
|
|
48 |
End If
|
|
|
49 |
|
|
|
50 |
rsTemp.Close
|
|
|
51 |
Set rsTemp = nothing
|
|
|
52 |
End Sub
|
|
|
53 |
|
|
|
54 |
|
|
|
55 |
Function Users_List ( )
|
|
|
56 |
Users_List = _
|
|
|
57 |
" SELECT usr.user_id, usr.full_name"&_
|
|
|
58 |
" FROM users usr"&_
|
|
|
59 |
" WHERE usr.IS_DISABLED IS NULL"&_
|
|
|
60 |
" ORDER BY UPPER(usr.full_name)"
|
|
|
61 |
End Function
|
|
|
62 |
|
|
|
63 |
Sub Update_Owner ( NNpv_id, NNown_id )
|
|
|
64 |
Dim rsTemp, Query_String, sComments, previousOwner, isOfficial
|
|
|
65 |
Dim objWSH, sPackage
|
|
|
66 |
|
|
|
67 |
|
|
|
68 |
'-- Get package details
|
|
|
69 |
Query_String = _
|
|
|
70 |
" SELECT pv.owner_id, pv.dlocked, pkg.pkg_name, pv.pkg_version"&_
|
|
|
71 |
" FROM package_versions pv, packages pkg"&_
|
|
|
72 |
" WHERE pv.pv_id = "& NNpv_id &_
|
|
|
73 |
" AND pv.pkg_id = pkg.pkg_id"
|
|
|
74 |
|
|
|
75 |
Set rsTemp = OraDatabase.CreateDynaset( Query_String, cint(0))
|
|
|
76 |
previousOwner = rsTemp.Fields("owner_id").Value
|
|
|
77 |
|
|
|
78 |
isOfficial = rsTemp("dlocked")
|
|
|
79 |
sPackage = rsTemp("pkg_name") &" "& rsTemp("pkg_version")
|
|
|
80 |
|
|
|
81 |
rsTemp.Close
|
|
|
82 |
Set rsTemp = nothing
|
|
|
83 |
|
|
|
84 |
|
|
|
85 |
'-- Update database to change the owner
|
|
|
86 |
OraSession.BeginTrans
|
|
|
87 |
|
|
|
88 |
OraDatabase.ExecuteSQL _
|
|
|
89 |
" UPDATE PACKAGE_VERSIONS pv SET "&_
|
|
|
90 |
" pv.owner_id = "& NNown_id &_
|
|
|
91 |
" WHERE pv.pv_id = "& NNpv_id
|
|
|
92 |
|
|
|
93 |
OraSession.CommitTrans
|
|
|
94 |
|
|
|
95 |
|
|
|
96 |
'-- Make dpkg_archive folder writable by all if Unofficial
|
|
|
97 |
If UCase(isOfficial) = "N" Then
|
|
|
98 |
|
|
|
99 |
Set objWSH = Server.CreateObject("WScript.Shell")
|
|
|
100 |
|
|
|
101 |
objWSH.Run "cmd.exe /c cscript.exe //B //NoLogo "& rootPath & SCRIPTS_FOLDER &"\Admin_Tools.wsf //job:onMakeUnofficial "&_
|
|
|
102 |
"/pv_id:"& NNpv_id , _
|
|
|
103 |
0, FALSE
|
|
|
104 |
|
|
|
105 |
End If
|
|
|
106 |
|
|
|
107 |
|
|
|
108 |
'-- Notify new owner
|
|
|
109 |
Call Send_Email ( "Release Manager Notification", adminEmail, GetUserEmail( NNown_id ), "You are now the owner of """& sPackage &"""", Empty, NULL )
|
|
|
110 |
|
|
|
111 |
|
|
|
112 |
|
|
|
113 |
'-- Log the change
|
|
|
114 |
sComments = "Changed from "& GetUsername(previousOwner) &" to "& GetUsername(NNown_id)
|
|
|
115 |
call Log_Action ( NNpv_id, "owner_change", sComments )
|
|
|
116 |
|
|
|
117 |
|
|
|
118 |
End Sub
|
|
|
119 |
%>
|
|
|
120 |
<%
|
|
|
121 |
'Process submition
|
|
|
122 |
If CBool(QStrPar("action")) AND objAccessControl.UserLogedIn Then
|
|
|
123 |
Call Update_Owner ( parPv_id, Request("own_id") )
|
|
|
124 |
|
|
|
125 |
Call OpenInParentWindow ( "dependencies.asp?pv_id="& parPv_id &"&rtag_id="& parRtag_id )
|
|
|
126 |
Call CloseWindow
|
|
|
127 |
|
|
|
128 |
End If
|
|
|
129 |
%>
|
|
|
130 |
<%
|
|
|
131 |
Call Get_Pkg_Info_With_Owner ( parPv_id )
|
|
|
132 |
%>
|
|
|
133 |
<html>
|
|
|
134 |
<head>
|
|
|
135 |
<title>Release Manager</title>
|
|
|
136 |
<meta HTTP-EQUIV="Pragma" CONTENT="no-cache">
|
|
|
137 |
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
|
|
|
138 |
<link rel="stylesheet" href="images/release_manager_style.css" type="text/css">
|
|
|
139 |
<link rel="stylesheet" href="images/navigation.css" type="text/css">
|
|
|
140 |
<script language="JavaScript" src="images/tipster.js"></script>
|
|
|
141 |
<script language="JavaScript" src="images/_help_tips.js"></script>
|
|
|
142 |
<script language="JavaScript" src="images/common.js"></script>
|
|
|
143 |
</head>
|
|
|
144 |
|
|
|
145 |
<body bgcolor="#FFFFFF" text="#000000" leftmargin="0" topmargin="0" onload="self.focus();">
|
|
|
146 |
<form name="chowner" method="post" action="<%=scriptName%>">
|
|
|
147 |
<table width="100%" border="0" cellspacing="0" cellpadding="2" height="100%">
|
|
|
148 |
<tr>
|
|
|
149 |
<td background="images/lbox_bg_orange.gif" width="1%" height="1%"><img src="images/i_owner.gif" width="20" height="29" hspace="5"></td>
|
|
|
150 |
<td background="images/lbox_bg_blue.gif" nowrap width="50%" class="wform_ttl"> Change Owner</td>
|
|
|
151 |
<td background="images/lbox_bg_blue.gif" align="right" width="50%">
|
|
|
152 |
<input type="submit" name="btn" value="Update" class="form_btn_comp">
|
|
|
153 |
<input type="reset" name="btn" value="Cancel" class="form_btn_comp" onclick="self.close()">
|
|
|
154 |
</td>
|
|
|
155 |
<td background="images/lbox_bg_blue.gif" align="right" width="1%%" nowrap>
|
|
|
156 |
<img src="images/h_trsp_dot.gif" width="5" height="22"> </td>
|
|
|
157 |
</tr>
|
|
|
158 |
<tr>
|
|
|
159 |
<td height="100%" width="1%"> </td>
|
|
|
160 |
<td valign="top" nowrap colspan="3" class="wform_ttl" background="images/bg_form_lightgray.gif">
|
|
|
161 |
<table width="100%" border="0" cellspacing="1" cellpadding="2">
|
|
|
162 |
<tr>
|
|
|
163 |
<td width="1%"><img src="images/h_trsp_dot.gif" width="10" height="30"></td>
|
|
|
164 |
<td width="1%" nowrap class="form_group" valign="bottom"></td>
|
|
|
165 |
<td nowrap width="100%"> </td>
|
|
|
166 |
</tr>
|
|
|
167 |
<tr>
|
|
|
168 |
<td width="1%"> </td>
|
|
|
169 |
<td width="1%" nowrap class="form_field" background="images/bg_form_lightbluedark.gif">Package</td>
|
|
|
170 |
<td nowrap width="100%" background="images/bg_form_lightbluedark.gif" class="form_txt">
|
|
|
171 |
<%=pkgInfoHash.Item ("pkg_name") &" "& pkgInfoHash.Item ("pkg_version")%></td>
|
|
|
172 |
</tr>
|
|
|
173 |
<tr>
|
|
|
174 |
<td width="1%"> </td>
|
|
|
175 |
<td width="1%" nowrap class="form_field" background="images/bg_form_lightbluedark.gif">Owner</td>
|
|
|
176 |
<td nowrap width="100%" background="images/bg_form_lightbluedark.gif">
|
|
|
177 |
<select name="own_id" class="form_item">
|
|
|
178 |
<%
|
|
|
179 |
Dim rsUsers
|
|
|
180 |
Set rsUsers = OraDatabase.DbCreateDynaset( Users_List( ), cint(0))
|
|
|
181 |
While ((NOT rsUsers.BOF) AND (NOT rsUsers.EOF))%>
|
|
|
182 |
<option <%If CInt(rsUsers("user_id")) = CInt(pkgInfoHash.Item("owner_id")) Then%>selected<%End If%> value="<%=rsUsers.Fields("user_id")%>"><%=rsUsers.Fields("full_name")%></option>
|
|
|
183 |
<% rsUsers.MoveNext
|
|
|
184 |
WEnd
|
|
|
185 |
rsUsers.Close
|
|
|
186 |
set rsUsers = nothing
|
|
|
187 |
%>
|
|
|
188 |
</select>
|
|
|
189 |
<input type="hidden" name="pv_id" value="<%=parPv_id%>">
|
|
|
190 |
<input type="hidden" name="rtag_id" value="<%=parRtag_id%>">
|
|
|
191 |
<input type="hidden" name="action" value="true">
|
|
|
192 |
</td>
|
|
|
193 |
</tr>
|
|
|
194 |
<tr>
|
|
|
195 |
<td width="1%"> </td>
|
|
|
196 |
<td width="1%" nowrap class="form_field"><img src="images/h_trsp_dot.gif" width="100" height="10"></td>
|
|
|
197 |
<td nowrap width="100%">
|
|
|
198 |
<p> </p>
|
|
|
199 |
</td>
|
|
|
200 |
</tr>
|
|
|
201 |
</table>
|
|
|
202 |
</td>
|
|
|
203 |
</tr>
|
|
|
204 |
<tr>
|
|
|
205 |
<td height="1%" width="1%"><img src="images/h_trsp_dot.gif" width="5" height="5"></td>
|
|
|
206 |
<td valign="top" nowrap colspan="3" class="wform_ttl" background="images/lbox_bg_blue.gif"></td>
|
|
|
207 |
</tr>
|
|
|
208 |
</table>
|
|
|
209 |
</form>
|
|
|
210 |
<!-- TIPS LAYERS -------------------------------------->
|
|
|
211 |
<div id="formTipsLayer" style="position: absolute; z-index: 1000; visibility: hidden; left:0; top: 0; width: 10"> </div>
|
|
|
212 |
<!----------------------------------------------------->
|
|
|
213 |
</body>
|
|
|
214 |
</html>
|
|
|
215 |
|
|
|
216 |
|
|
|
217 |
<!-- DESTRUCTOR ------->
|
|
|
218 |
<!--#include file="common/destructor.asp"-->
|