Subversion Repositories DevTools

Rev

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

Rev Author Line No. Line
157 ghuddy 1
<%@LANGUAGE="VBSCRIPT"%>
2
<%
3
Option explicit
4
Response.Expires = 0   ' always load the page, dont store
5
%>
6
<%
7
'=====================================================
8
'              Change Group
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/daemon_instructions.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 parProj_id
28
Dim parNewRtag_id
29
Dim parRfile
30
Dim bPreventSubmit
31
'------------ Constants Declaration -----------
32
'------------ Variable Init -------------------
33
Set pkgInfoHash = CreateObject("Scripting.Dictionary")
34
parPv_id = QStrPar("pv_id")
35
parProj_id= QStrPar("proj_id")
36
parNewRtag_id = QStrPar("new_rtag_id")
37
parRfile = Request("rfile")
38
If IsNull(parProj_id) Then parProj_id = "0"
39
If IsNull(parNewRtag_id) Then parNewRtag_id = "0"
40
If IsNull(parRfile) Then parRfile = "dependencies.asp"
41
bPreventSubmit = false
42
 
43
'----------------------------------------------
44
%>
45
<%
46
Sub Get_Pkg_Info_From_Rel ( SSrtag_id, SSpv_id )
47
   Dim rsTemp, Query_String
48
 
49
   Query_String = _
50
   " SELECT pkg.pkg_name, pv.pkg_version, wip.view_id, vi.view_name"&_
51
   "  FROM packages pkg, package_versions pv, work_in_progress wip, views vi"&_
52
   " WHERE     pkg.pkg_id = pv.pkg_id"&_
53
   "        AND pv.pv_id = wip.pv_id"&_
54
   "        AND vi.view_id = wip.view_id"&_
55
   "        AND wip.rtag_id = "& SSrtag_id &_
56
   "        AND wip.pv_id = "& SSpv_id
57
 
58
   Set rsTemp = OraDatabase.DbCreateDynaset( Query_String, cint(0))
59
 
60
   If ((NOT rsTemp.BOF) AND (NOT rsTemp.EOF)) Then
61
      pkgInfoHash.Add "pkg_name", (rsTemp.Fields("pkg_name"))
62
      pkgInfoHash.Add "pkg_version", (rsTemp.Fields("pkg_version"))
63
      pkgInfoHash.Add "view_id", (rsTemp.Fields("view_id"))
64
      pkgInfoHash.Add "view_name", (rsTemp.Fields("view_name"))
65
   End If
66
 
67
   rsTemp.Close
68
   Set rsTemp = nothing
69
End Sub
70
 
71
 
72
 
73
'------------------------------------------------------------------------------------------------------------------------------------------
74
' Formulate the HTML for a combo box listing all the Projects, and select the one that matches
75
' the proj-id passed in as a parameter. If the parameter value could not be found, correct it to the first valid proj-id
76
' in the list.
77
'------------------------------------------------------------------------------------------------------------------------------------------
78
Function Get_Projects ( NNproj_id )
79
   Dim rsTemp, Query_String, projName, tempLINK, selectedFound, s
80
 
81
   selectedFound = False
82
   Query_String = "SELECT * FROM projects ORDER BY  UPPER( proj_name )"
83
 
84
   Set rsTemp = OraDatabase.DbCreateDynaset( Query_String, cint(0))
85
 
86
   s = "<td class='form_field' background='images/bg_form_lightbluedark.gif' >Project</td>"
87
   s = s + "<td background='images/bg_form_lightbluedark.gif'><select id='proj_id_list' name='proj_id_list' class='form_item' onChange=""MM_jumpMenu('parent',this,0)"">"
88
 
89
   While ((NOT rsTemp.BOF) AND (NOT rsTemp.EOF))
90
      projName = UCase(rsTemp.Fields("proj_name"))
91
 
92
      tempLINK = scriptName & "?proj_id=" & rsTemp.Fields("proj_id") &_
93
                              "&rtag_id="& parRtag_id &_
94
                              "&new_rtag_id="& parNewRtag_id &_
95
                              "&pv_id="& parPv_id &_
96
                              "&rfile="& parRfile
97
 
98
      If ((NNproj_id = Cstr(rsTemp.Fields("proj_id"))) OR (NNproj_id = "0")) AND (selectedFound = False) Then
99
         s = s + "<option value='"& tempLINK &"' selected>"& projName &"</option>"
100
         selectedFound = True
101
         NNproj_id = CStr(rsTemp.Fields("proj_id"))
102
      Else
103
         s = s + "<option value='"& tempLINK &"'>"& projName &"</option>"
104
      End If
105
 
106
      rsTemp.MoveNext
107
   WEnd
108
   s = s + "</select>"
109
 
110
   ' Correct for a situation where selectedFound is still FALSE.
111
   If NOT selectedFound Then
112
      rsTemp.MoveFirst
113
      If ((NOT rsTemp.BOF) AND (NOT rsTemp.EOF)) Then
114
         NNproj_id = CStr(rsTemp.Fields("proj_id"))
115
      Else
116
         NNproj_id = "0"
117
      End If
118
   End If
119
 
120
   rsTemp.Close
121
   Set rsTemp = nothing
122
 
123
   s = s + "</td>"
124
 
125
   Get_Projects = s
126
End Function
127
 
128
 
129
'------------------------------------------------------------------------------------------------------------------------------------------
130
' Formulate the HTML for a combo box listing all the Release for a specified project, and select the one that matches
131
' the release-tag passed in as a parameter. If the parameter value could not be found, correct it to the first valid release-tag
132
' in the list.
133
'------------------------------------------------------------------------------------------------------------------------------------------
134
Function Get_Releases ( NNproj_id, NNrtag_id )
135
   Dim rsTemp, Query_String, releaseName, tempLINK, selectedFound, s, numReleases
136
 
137
   selectedFound = False
138
 
139
   numReleases = 0
140
 
141
   Query_String = "SELECT rtag_id, rtag_name "&_
142
                  "  FROM release_tags rt"&_
143
                  " WHERE rt.proj_id = "& NNproj_id &_
144
                  "   AND ((rt.official = 'N') OR (rt.official = 'C') OR (rt.official = 'R'))"&_
145
                  " ORDER BY UPPER(rtag_name)"
146
   Set rsTemp = OraDatabase.DbCreateDynaset( Query_String, cint(0))
147
 
148
   s = "<td class='form_field'  background='images/bg_form_lightbluedark.gif' >Release</td>"
149
   s = s + "<td background='images/bg_form_lightbluedark.gif' ><select id='rtag_id_list' name='rtag_id_list' class='form_item' onChange=""MM_jumpMenu('parent',this,0)"">"
150
 
151
   While ((NOT rsTemp.BOF) AND (NOT rsTemp.EOF))
152
      releaseName = rsTemp.Fields("rtag_name")
153
 
154
      tempLINK = scriptName & "?proj_id="& NNproj_id &_
155
                              "&rtag_id="& parRtag_id &_
156
                              "&new_rtag_id="& rsTemp.Fields("rtag_id") &_
157
                              "&pv_id="& parPv_id &_
158
                              "&rfile="& parRfile
159
 
160
      If ((NNrtag_id = CStr(rsTemp.Fields("rtag_id"))) OR (NNrtag_id = "0")) AND (selectedFound = False) Then
161
            s = s + "<option value='"& tempLINK &"' selected>"& releaseName &"</option>"
162
         selectedFound = True
163
         NNrtag_id = Cstr(rsTemp.Fields("rtag_id"))
164
      Else
165
         s = s + "<option value='"& tempLINK &"'>"& releaseName &"</option>"
166
      End If
167
 
168
      numReleases = numReleases + 1
169
 
170
      rsTemp.MoveNext
171
   WEnd
172
   s = s + "</select>"
173
 
174
   ' Correct for a situation where selectedFound is still FALSE.
175
   If NOT selectedFound Then
176
      rsTemp.MoveFirst
177
      If ((NOT rsTemp.BOF) AND (NOT rsTemp.EOF)) Then
178
         NNrtag_id = CStr(rsTemp.Fields("rtag_id"))
179
      Else
180
         NNrtag_id = "0"
181
      End If
182
   End If
183
 
184
   ' If no releases were found then replace drop down list with some warning text and disable form submission
185
   If numReleases = 0 Then
186
      bPreventSubmit = True
187
      s = "<td>Release</td><td><a style=color:Red>WARNING: No active releases found. The operation cannot be performed.</a></td>"
188
   End If
189
 
190
   rsTemp.Close
191
   Set rsTemp = nothing
192
 
193
   s = s + "</td>"
194
 
195
   Get_Releases = s
196
End Function
197
 
198
'-------------------------------------------------------------------------------------------------------
199
' Call stored procedures to move the WIP from the source release to the destination release
200
'-------------------------------------------------------------------------------------------------------
201
Sub MoveWip(source_RtagId, destination_RtagId, pvId, viewId)
202
 
203
   OraDatabase.Parameters.Add "RTAG_ID", source_RtagId,           ORAPARM_INPUT, ORATYPE_NUMBER
204
   OraDatabase.Parameters.Add "PV_ID",   pvId,                    ORAPARM_INPUT, ORATYPE_VARCHAR2
205
   OraDatabase.Parameters.Add "USER_ID", objAccessControl.UserId, ORAPARM_INPUT, ORATYPE_NUMBER
206
   OraDatabase.Parameters.Add "VIEW_ID", viewId,                  ORAPARM_INPUT, ORATYPE_NUMBER
207
 
208
   objEH.TryORA ( OraSession )
209
 
210
   OraDatabase.ExecuteSQL _
211
   "BEGIN   PK_WORK_IN_PROGRESS.REMOVE_PACKAGE ( :PV_ID, :RTAG_ID, :USER_ID );   END;"
212
 
213
   If Err.Number = 0 Then
214
      OraDatabase.Parameters.Remove "RTAG_ID"
215
      OraDatabase.Parameters.Add "RTAG_ID", destination_RtagId, ORAPARM_INPUT, ORATYPE_NUMBER
216
 
217
      OraDatabase.ExecuteSQL _
218
      "BEGIN   PK_WORK_IN_PROGRESS.ADD_PACKAGE ( :PV_ID, :VIEW_ID, :RTAG_ID, :USER_ID );   END;"
219
   End If
220
 
221
   objEH.CatchORA ( OraSession )
222
 
223
   OraDatabase.Parameters.Remove "RTAG_ID"
224
   OraDatabase.Parameters.Remove "PV_ID"
225
   OraDatabase.Parameters.Remove "USER_ID"
226
   OraDatabase.Parameters.Remove "VIEW_ID"
227
 
228
End Sub
229
 
230
%>
231
<%
232
' get pkgInfoHash items for the source WIP
233
Call Get_Pkg_Info_From_Rel ( parRtag_id, parPv_id )
234
 
235
' Make sure this WIP can be moved - prevent if it has a pending test build instruction, etc
236
If (DaemonInstructionPreventsEditing(Request("rtag_id"), Request("pv_id"))) Then
237
   Call RaiseMsgInParent(enum_MSG_ERROR, "This WIP has one or more daemon instructions present.<br><br>"&_
238
                                         "Please delete them or allow them to be consumed before attempting to move the WIP.")
239
   Call CloseWindow
240
Else
241
   ' check for form submission
242
   If CBool(QStrPar("action")) AND (QStrPar("btn") = "Move") AND objAccessControl.UserLogedIn Then
243
      'Process submition
244
      Call MoveWip(parRtag_id, parNewRtag_id, parPv_id, pkgInfoHash.Item("view_id"))
245
      Call OpenInParentWindow (parRfile &"?pv_id="& parPv_id &"&rtag_id="& parNewRtag_id )
246
      Call CloseWindow
247
   Else
248
      ' Call HTML rendering functions, but throw away the strings returned since we only want to ensure that
249
      ' the current state of the bPreventSubmit flag has been acquired in order to show/hide the submit button
250
      Call Get_Projects(parProj_id)
251
      Call Get_Releases(parProj_id, parNewRtag_id)
252
   End If
253
End If
254
 
255
%>
256
 
257
<html>
258
<head>
259
<title>Release Manager</title>
260
<meta HTTP-EQUIV="Pragma" CONTENT="no-cache">
261
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
262
<link rel="stylesheet" href="images/release_manager_style.css" type="text/css">
263
<link rel="stylesheet" href="images/navigation.css" type="text/css">
264
<script language="JavaScript" src="images/tipster.js"></script>
265
<script language="JavaScript" src="images/_help_tips.js"></script>
266
<script language="JavaScript" src="images/common.js"></script>
267
</head>
268
 
269
<body bgcolor="#FFFFFF" text="#000000" leftmargin="0" topmargin="0" onload="self.focus();">
270
<form name="chgroup" method="post" action="<%=scriptName%>">
271
   <table width="100%" border="0" cellspacing="0" cellpadding="2" height="100%">
272
      <tr>
273
         <td background="images/lbox_bg_orange.gif" width="1%" height="1%"><img src="images/i_change_group_off.gif" width="22" height="25" hspace="5"></td>
274
         <td background="images/lbox_bg_blue.gif" nowrap width="50%" class="wform_ttl">&nbsp;Move WIP To Another Release</td>
275
         <td background="images/lbox_bg_blue.gif" align="right" width="50%">
276
            <%If NOT bPreventSubmit Then%>
277
               <input type="submit" name="btn" value="Move" class="form_btn_comp">
278
            <%End If%>
279
            <input type="reset" name="btn" value="Cancel" class="form_btn_comp" onclick="self.close()">
280
         </td>
281
         <td background="images/lbox_bg_blue.gif" align="right" width="1%%" nowrap>
282
            <img src="images/h_trsp_dot.gif" width="5" height="22">
283
         </td>
284
      </tr>
285
      <tr>
286
         <td height="100%" width="1%">&nbsp;</td>
287
         <td valign="top" nowrap colspan="3" class="wform_ttl" background="images/bg_form_lightgray.gif">
288
            <table width="100%" border="0" cellspacing="1" cellpadding="2">
289
               <tr>
290
                  <td width="1%"><img src="images/h_trsp_dot.gif" width="10" height="30"></td>
291
                  <td width="1%" nowrap class="form_group" valign="bottom">WIP Details</td>
292
                  <td nowrap width="100%">&nbsp; </td>
293
               </tr>
294
               <tr>
295
                  <td width="1%">&nbsp;</td>
296
                  <td width="1%" nowrap class="form_field" background="images/bg_form_lightbluedark.gif">Package<a href="#" onMouseOver="formTips.show('group')" onMouseOut="formTips.hide()"></a></td>
297
                  <td nowrap width="100%" background="images/bg_form_lightbluedark.gif" class="form_txt">
298
                     <%=pkgInfoHash.Item("pkg_name")%>
299
                  </td>
300
               </tr>
301
               <tr>
302
                  <td width="1%">&nbsp;</td>
303
                  <td width="1%" nowrap class="form_field" background="images/bg_form_lightbluedark.gif">Version<a href="#" onMouseOver="formTips.show('group')" onMouseOut="formTips.hide()"></a></td>
304
                  <td nowrap width="100%" background="images/bg_form_lightbluedark.gif" class="form_txt">
305
                     <%=pkgInfoHash.Item("pkg_version")%>
306
                  </td>
307
               </tr>
308
               <tr>
309
                  <td width="1%">&nbsp;</td>
310
                  <td width="1%" nowrap class="form_field" background="images/bg_form_lightbluedark.gif">View<a href="#" onMouseOver="formTips.show('group')" onMouseOut="formTips.hide()"></a></td>
311
                  <td nowrap width="100%" background="images/bg_form_lightbluedark.gif" class="form_txt">
312
                     <%=pkgInfoHash.Item("view_name")%>
313
                  </td>
314
               </tr>
315
 
316
               <tr>
317
                  <td width="1%"><img src="images/h_trsp_dot.gif" width="10" height="30"></td>
318
                  <td width="1%" nowrap class="form_group" valign="bottom">Select Destination Release</td>
319
                  <td nowrap width="100%">&nbsp; </td>
320
               </tr>
321
               <tr>
322
                  <td width="1%">&nbsp;</td>
323
                  <%=Get_Projects(parProj_id)%>
324
                  <td nowrap width="100%">&nbsp; </td>
325
               </tr>
326
               <tr>
327
                  <td width="1%">&nbsp;</td>
328
                  <%=Get_Releases(parProj_id, parNewRtag_id)%>
329
                  <td nowrap width="100%">&nbsp; </td>
330
               </tr>
331
 
332
               <tr>
333
                  <td width="1%">&nbsp;</td>
334
                  <td width="1%" nowrap class="form_field"><img src="images/h_trsp_dot.gif" width="100" height="10"></td>
335
                  <td nowrap width="100%">&nbsp; </td>
336
                  <input type="hidden" name="pv_id" value="<%=parPv_id%>">
337
                  <input type="hidden" name="rtag_id" value="<%=parRtag_id%>">
338
                  <input type="hidden" name="new_rtag_id" value="<%=parNewRtag_id%>">
339
                  <input type="hidden" name="view_id" value="<%=pkgInfoHash.Item("view_id")%>">
340
                  <input type="hidden" name="rfile" value="<%=parRfile%>">
341
                  <input type="hidden" name="action" value="true">
342
               </tr>
343
            </table>
344
         </td>
345
      </tr>
346
      <tr>
347
         <td height="100%" width="1%">&nbsp;</td>
348
         <td valign="top" nowrap colspan="3" class="wform_ttl" background="images/bg_form_lightgray.gif">
349
            <table width="100%" border="0" cellspacing="1" cellpadding="2">
350
               <tr>
351
                  <td width="1%" wrap class="form_group" valign="bottom">
352
                     WARNING:<br>
353
                     The destination release may not satisfy any or all the dependencies that come with
354
                     the WIP you are about to move. It is your responsibility to rectify this in the
355
                     destination release.
356
                  </td>
357
               </tr>
358
            </table>
359
         </td>
360
      </tr>
361
 
362
      <tr>
363
         <td height="1%" width="1%"><img src="images/h_trsp_dot.gif" width="5" height="5"></td>
364
         <td valign="top" nowrap colspan="3" class="wform_ttl" background="images/lbox_bg_blue.gif"></td>
365
      </tr>
366
   </table>
367
</form>
368
<!-- TIPS LAYERS -------------------------------------->
369
<div id="formTipsLayer" style="position: absolute; z-index: 1000; visibility: hidden; left:0; top: 0; width: 10">&nbsp;</div>
370
<!----------------------------------------------------->
371
</body>
372
</html>
373
 
374
 
375
<!-- DESTRUCTOR ------->
376
<!--#include file="common/destructor.asp"-->