Subversion Repositories DevTools

Rev

Rev 6707 | Rev 6827 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
6699 dpurdie 1
<%@LANGUAGE="VBSCRIPT"%>
2
<%
3
'=====================================================
6789 dpurdie 4
'   form_view_release_licencing.asp
6699 dpurdie 5
'|                                                   |
6
'=====================================================
7
%>
8
<%
9
Option explicit
10
' Good idea to set when using redirect
11
Response.Expires = 0   ' always load the page, dont store
12
%>
13
<!--#include file="common/conf.asp"-->
14
<!--#include file="common/globals.asp"-->
15
<!--#include file="common/formating.asp"-->
16
<!--#include file="common/qstr.asp"-->
17
<!--#include file="common/common_subs.asp"-->
18
<!--#include file="common/_form_window_common.asp"-->
19
<%
20
' Make sure rtag_id is always present
21
If Request("rtag_id") = "" Then
22
    Call Destroy_All_Objects
23
	Response.Redirect("index.asp")
24
End If
25
 
26
' Set rfile parameter. This is a return page after Login
27
Call objPMod.StoreParameter ( "rfile", "form_view_release_licencing.asp" )
28
'------------ ACCESS CONTROL ------------------
29
%>
30
<!--#include file="_access_control_login.asp"-->
31
<!--#include file="_access_control_general.asp"-->
32
<%
33
'------------ Variable Definition -------------
34
Dim bShowAll
35
Dim bShowAny
6701 dpurdie 36
Dim bAllCots
6699 dpurdie 37
Dim sAllCheck
38
Dim sAnyCheck
6701 dpurdie 39
Dim sAllCots
6699 dpurdie 40
'------------ Constants Declaration -----------
41
'------------ Variable Init -------------------
42
bShowAll = Request("ShowAll")
43
bShowAny = Request("ShowAny")
6701 dpurdie 44
bAllCots = Request("allCots")
45
 
46
If bAllCots <> "" Then sAllCots = " Checked "
6699 dpurdie 47
If bShowAny <> "" Then sAnyCheck = " Checked "
48
If bShowAll <> "" Then sAllCheck = " Checked "
49
 
50
'--------------------------------------------------------------------------------------------------------------------------
51
'  release_licencing_query_string
52
'
53
'  DESCRIPTION
54
'     Constructs a query string using the provided release tag, designed to elicit
55
'     a list of PV_ID's, thier package names, versions and extensions, and licencing
56
'     associations from the release. Only those PV_IDs with one or more licencing
57
'     associations are returned.
58
'
59
'  INPUTS
60
'     NNrtag_id : The release tag to be used in the query string
61
'
62
Function release_licencing_query_string(NNrtag_id)
63
 
64
   release_licencing_query_string = _
65
                    "WITH AllPkgLic AS " &_
66
                    "  (SELECT pkg_id, " &_
67
                    "    listagg(name, ',') within GROUP ( " &_
68
                    "  ORDER BY name) AS Name " &_
69
                    "  FROM " &_
70
                    "    (SELECT pv.pkg_id, " &_
71
                    "      ld.name, " &_
72
                    "      row_number() over (partition BY pv.pkg_id, ld.name order by pv.pkg_id) AS rn " &_
73
                    "    FROM LICENCING lg, " &_
74
                    "      LICENCES ld , " &_
75
                    "      package_versions pv " &_
76
                    "    WHERE lg.pv_id = pv.pv_id " &_
77
                    "    AND lg.LICENCE = ld.LICENCE " &_
78
                    "    ) " &_
79
                    "  WHERE rn = 1 " &_
80
                    "  GROUP BY pkg_id " &_
81
                    "  ), " &_
82
                    "  AllPvIDs AS " &_
83
                    "  ( SELECT DISTINCT * " &_
84
                    "  FROM " &_
85
                    "    ( SELECT pv_id FROM RELEASE_CONTENT rc WHERE rc.rtag_id = :rtag_id " &_
86
                    "    UNION " &_
87
                    "    SELECT pv_id FROM work_in_progress wip WHERE wip.rtag_id = :rtag_id " &_
88
                    "    UNION " &_
89
                    "    SELECT pv_id " &_
90
                    "    FROM planned pl " &_
91
                    "    WHERE pl.rtag_id   = :rtag_id " &_
92
                    "    AND (pl.operation IS NULL " &_
93
                    "    OR pl.operation    = 'R') " &_
94
                    "    ) " &_
95
                    "  ) " &_
96
                    "SELECT DISTINCT pv.pv_id, " &_
6707 dpurdie 97
                    "  pv.pkg_id, " &_
6699 dpurdie 98
                    "  pkg.pkg_name, " &_
99
                    "  pv.pkg_version, " &_
100
                    "  pv.v_ext, " &_
101
                    "  pv.pv_description, " &_
102
                    "  lcs.name AS licenceName , " &_
103
                    "  CASE " &_
104
                    "    WHEN al.NAME  IS NOT NULL " &_
105
                    "    AND lcs.name  IS NOT NULL " &_
106
                    "    AND ( lcs.name = al.NAME ) " &_
107
                    "    THEN NULL " &_
108
                    "    ELSE al.NAME " &_
109
                    "  END AS OTHERLICENSES " &_
110
                    "FROM AllPvIDs rc, " &_
111
                    "  package_versions pv, " &_
112
                    "  packages pkg, " &_
113
                    "  licencing lcng, " &_
114
                    "  licences lcs, " &_
115
                    "  AllPkgLic al " &_
116
                    "WHERE pv.pv_id   = rc.pv_id " &_
117
                    "AND pkg.pkg_id   = pv.pkg_id " &_
118
                    "AND pv.pv_id     = lcng.pv_id (+) " &_
119
                    "AND lcng.licence = lcs.licence (+) " &_
120
                    "AND pv.pkg_id    = al.pkg_id(+) " &_
6701 dpurdie 121
                    "AND ( " &_
122
                        "(lcng.licence is not null) OR ('" & bShowAll & "' is not null)" &_
123
                        " OR ( (al.name is not null) AND ('" & bShowAny & "' is not null) )" &_
124
                        " OR ((UPPER(pv.v_ext) = '.COTS') AND ('" & bAllCots & "' is not null))" &_
125
                    ") " &_
6699 dpurdie 126
                    "ORDER BY Upper( pkg.pkg_name), " &_
127
                    "  Upper(pv.pkg_version) "
128
End Function
129
 
130
 
131
'--------------------------------------------------------------------------------------------------------------------------
132
'  PV_ID_ListHTML
133
'
134
'  DESCRIPTION
135
'     Constructs the HTML to render the rows of package names, versions and extensions, and licences
136
'
6701 dpurdie 137
Sub PV_ID_ListHTML
6699 dpurdie 138
   Dim rsQry
6707 dpurdie 139
   Dim hRef
140
   Dim pkgVer
6699 dpurdie 141
 
142
   OraDatabase.Parameters.Add "RTAG_ID", parRtag_Id, ORAPARM_INPUT, ORATYPE_NUMBER
143
   Set rsQry = OraDatabase.DbCreateDynaset( release_licencing_query_string(parRtag_Id), cint(0) )
144
   OraDatabase.Parameters.Remove "PV_ID"
145
 
146
   '--- Render rows ---
147
   Do While (NOT rsQry.BOF) AND (NOT rsQry.EOF)
148
 
149
      ' BEGIN ROW
6701 dpurdie 150
      Response.Write "<tr class='csvData body_rowg top'>"
6699 dpurdie 151
 
152
      ' PACKAGE NAME
6707 dpurdie 153
      hRef = "view_by_version.asp?pkg_id=" & rsQry("pkg_id")
6701 dpurdie 154
      Response.Write "<td>"
6707 dpurdie 155
      Response.Write "<a href=" & hRef & ">" & rsQry("pkg_name")&"</a>"
6701 dpurdie 156
      Response.Write "</td>"
6699 dpurdie 157
 
158
      ' PACKAGE VERSION
6707 dpurdie 159
      hRef = "dependencies.asp?pv_id=" & rsQry("pv_id") & "&rtag_id=" & parRtag_Id
6699 dpurdie 160
      If IsNull(rsQry("v_ext")) Then
6707 dpurdie 161
         pkgVer = rsQry("pkg_version")
6699 dpurdie 162
      Else
6707 dpurdie 163
         pkgVer = Left(rsQry("pkg_version"), Len(rsQry("pkg_version")) - Len(rsQry("v_ext")) )
6699 dpurdie 164
      End If
6707 dpurdie 165
      Response.Write "<td><a href=" & hRef & ">" & pkgVer & "</a></td>"
6699 dpurdie 166
 
167
      ' PACKAGE EXTENSION
6701 dpurdie 168
      Response.Write "<td>" & rsQry("v_ext") & "</td>"
6699 dpurdie 169
 
170
      ' PACKAGE Short Description
6701 dpurdie 171
      Response.Write "<td>" & rsQry("pv_description") & "</td>"
6699 dpurdie 172
 
173
      ' LICENCE NAME
6701 dpurdie 174
      Response.Write "<td>" & rsQry("licenceName") & "</td>"
6699 dpurdie 175
 
176
      ' Other Licences
6701 dpurdie 177
      Response.Write "<td>" & rsQry("otherlicenses") & "</td>"
6699 dpurdie 178
 
179
      ' Edit License
180
      Dim sonclick
181
      sonclick="""MM_openVixIFrame('_wform_change_licence.asp?pv_id="& rsQry("pv_id") &"&rtag_id="& parRtag_id &"','Change License')"""
182
      Dim data
183
 
184
      If canActionControlInProject ("EditPackageLicence") OR canActionControl("MSMaintainer") Then
185
        data = "<a href='javascript:;' onClick=" & sonclick & " class='body_txt'>" &_
186
               "<img src='images/i_edit.gif' width='12' height='12' border='0'>" &_
187
               "</a>"
188
     Else
189
        data = "<img src='images/i_edit_disable.gif' width='12' height='12' border='0'>"
190
     End If
191
 
6701 dpurdie 192
      Response.Write "<td>" & data & "</td>"
6699 dpurdie 193
 
194
      ' END ROW
6701 dpurdie 195
      Response.Write "</tr>"
6699 dpurdie 196
 
197
      rsQry.MoveNext
198
   Loop
199
 
200
   ' destroy objects
201
   rsQry.Close()
202
   Set rsQry = nothing
203
 
6701 dpurdie 204
End Sub
6699 dpurdie 205
 
206
'--------------------------------------------------------------------------------------------------------------------------
207
Sub LeftPanelContent
208
   objFormComponent.FormName = "FormName"
209
   objFormComponent.Method = "get"
210
   objFormComponent.Action = ScriptName
211
   Call objFormComponent.FormStart()
212
%>
213
 
214
<fieldset class="body_rowg fset">
215
    <legend>Options</legend>
6701 dpurdie 216
        <input name="showAny" type="checkbox" class="form_btn" <%=sAnyCheck%> value=1 onChange="this.form.submit()">Show Any<%=Quick_Help("h_showAny")%>
217
    <br><input name="allCots" type="checkbox" class="form_btn" <%=sAllCots%>  value=1 onChange="this.form.submit()">Show All COTS<%=Quick_Help("h_allCots")%>
218
    <br><input name="showAll" type="checkbox" class="form_btn" <%=sAllCheck%> value=1 onChange="this.form.submit()">Show All<%=Quick_Help("h_showAll")%>
219
    <br><input name="rtag_id" type="hidden" value=<%=parRtag_Id%>
6699 dpurdie 220
</fieldset>
221
   <%
222
   Call objFormComponent.FormEnd()
223
   '-- FROM END ----------------------------------------------------------------------------------------------------------------
224
   %>
225
<%
226
End Sub
227
'----------------------------------------------
228
Sub MainPanelContent
229
%>
230
   <table class="embedded_table" style="margin-bottom:20px" width="90%">
231
      <tr>
232
         <td>
233
            <!-- Box Title -->
234
            <div class="form_ttl nowrap" align="left">
235
                 VIEW RELEASE LICENCING DETAILS
236
            </div>
237
         </td>
238
      </tr>
239
      <tr>
240
         <td>
241
            <!-- Box Content -->
242
            <div class="rounded_box">
243
               <div style="background-color: white;border-left: white solid 10px;border-right: white solid 10px;">
244
                    <!-- MESSAGE +++++++++++++++++++++++++++++++++++++++++++++++++++ -->
245
                    <!--#include file="messages/_msg_inline.asp"-->
246
                    <!-- +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
6701 dpurdie 247
                    <table width="100%" class="embedded_table etable underline" id='pkgLicences'>
248
                        <thead class="body_hcol">
249
                            <tr>
250
                              <th valign="top" nowrap >Package Name</th>
251
                              <th valign="top" nowrap >Package Version</th>
252
                              <th valign="top" nowrap >Package Extension</th>
253
                              <th valign="top"        >Short Description</th>
254
                              <th valign="top" nowrap >Licences<%=Quick_Help("h_licences")%></th>
255
                              <th valign="top" nowrap >Other Licences<%=Quick_Help("h_other")%></th>
256
                              <th valign="top" nowrap class="noCsv">Edit</th>
6699 dpurdie 257
                           </tr>
6701 dpurdie 258
                        </thead>
259
                        <tbody>
260
                           <%Call PV_ID_ListHTML%>
261
                        </tbody>
6699 dpurdie 262
                    </table>
263
               </div>
264
            </div>
265
         </td>
266
      </tr>
267
   </table>
268
<%
269
End Sub
270
'------------------------------------------------------------------------------
271
%>
272
<html>
273
   <head>
274
      <title>Release Manager</title>
275
      <link rel="shortcut icon" href="<%=FavIcon%>"/>
276
      <meta http-equiv="Pragma" content="no-cache">
277
      <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
278
      <link rel="stylesheet" href="images/release_manager_style.css?ver=<%=VixVerNum%>" type="text/css">
279
      <link rel="stylesheet" href="images/navigation.css?ver=<%=VixVerNum%>" type="text/css">
280
      <script language="JavaScript" src="images/common.js?ver=<%=VixVerNum%>"></script>
6701 dpurdie 281
      <script language="JavaScript" src="scripts/remote_scripting.js?ver=<%=VixVerNum%>"></script>
6699 dpurdie 282
      <!-- DROPDOWN MENUS -->
6701 dpurdie 283
      <%bJqueryDataTables = TRUE%>
284
      <%bCsvExport = True%>
6699 dpurdie 285
      <!--#include file="_jquery_includes.asp"-->
286
      <!--#include file="_menu_def.asp"-->
287
      <script language="JavaScript1.2" src="images/popup_menu.js?ver=<%=VixVerNum%>"></script>
288
<!-- TIPS -->
289
<script language="JavaScript" src="images/tipster.js?ver=<%=VixVerNum%>"></script>
290
<script language="JavaScript" src="images/_help_tips.js?ver=<%=VixVerNum%>"></script>
291
<script language="JavaScript" type="text/javascript">
292
<!--
293
formTips.tips.h_licences       = stdTip(300, 'License', 'A list of licences found on this version of this package' +
294
                                                          '<p>Licences are specified for a specific version of a package.' + 
295
                                                          '<p>A package may have several licences and the packages licences may change over time.' 
296
                                                          );
297
formTips.tips.h_other       = stdTip(300, 'Other License', 'A list of licences found in others versions of this package, if they differ from the one specified' +
298
                                                          'for this package.' +
299
                                                          '<p>Licences are specified for a specific version of a package.' + 
300
                                                          '<p>A package may have several licences and the packages licences may change over time.' 
301
                                                          );
302
 
303
formTips.tips.h_showAny       = stdTip(300, 'Show Any', 'Show packages, in this Release, that have a licence in any release, not just this release.');
304
formTips.tips.h_showAll       = stdTip(300, 'Show All', 'Show all packages in this Release, not just those with a licence.');
6701 dpurdie 305
formTips.tips.h_allCots       = stdTip(300, 'All COTS', 'Force the inclusion of COTS packages as these should have licencing information.');
306
</script>
307
<script language="JavaScript" type="text/javascript">
308
	$(document).ready(function() {
309
		/* Init DataTables */
6699 dpurdie 310
 
6701 dpurdie 311
        table = $("#pkgLicences").DataTable({
312
            "paging":   false,
313
            "info":     true,
314
            dom: "frti",
315
            ordering: true,
316
            order: [[ 0, "asc" ]],
317
            lengthChange : false,
318
 
319
            columns: [
320
               { width: "5%", className: "dt-nowrap"},
321
               { width: "5%", className: "dt-nowrap"},
322
               { width: "1%", className: "dt-nowrap"  },
323
               { orderable: false, searchable: false },
324
               { className: "dt-nowrap" },
325
               { width: "1%", orderable: true, className: "dt-nowrap" },
326
               { width: "40px", orderable: false, searchable: false },
327
           ],
328
        });
329
    });
6699 dpurdie 330
</script>
331
   </head>
332
   <body bgcolor="#FFFFFF" text="#000000" leftmargin="0" topmargin="0">
333
      <!-- HEADER -->
334
      <!--#include file="_header.asp"-->
335
      <!-- BODY ---->
336
      <table class="full_table">
337
         <tr>
338
            <td width="146px" class="panel_bg" valign="top">
339
                <%Call LeftPanelContent%>
340
            </td>
341
            <td width="100%" rowspan="2" align="center" valign="top" bgcolor="#EEEFEF">
342
                <%Call MainPanelContent%>
343
            </td>
344
         </tr>
345
         <tr>
346
            <td class="panel_bg" valign="bottom" align="center" height="350">
6701 dpurdie 347
                <img src="images/img_padlock.png" vspace="20" hspace="30"></td>
6699 dpurdie 348
         </tr>
349
      </table>
350
      <!-- FOOTER -->
351
      <!--#include file="_footer.asp"-->
352
   </body>
353
</html>
354