Subversion Repositories DevTools

Rev

Rev 6579 | Rev 6701 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | RSS feed

<%@LANGUAGE="VBSCRIPT"%>
<%
'=====================================================
'|                                                   |
'|          Edit/View Build Configuration            |
'|                                                   |
'=====================================================
%>
<%
Option explicit
' Good idea to set when using redirect
Response.Expires = 0   ' always load the page, dont store
%>
<!--#include file="common/conf.asp"-->
<!--#include file="common/globals.asp"-->
<!--#include file="common/formating.asp"-->
<!--#include file="common/qstr.asp"-->
<!--#include file="common/common_subs.asp"-->
<!--#include file="common/_form_window_common.asp"-->
<%
' Make sure rtag_id is always present
If Request("rtag_id") = "" Then
    Call Destroy_All_Objects
        Response.Redirect("index.asp")
End If

' Set rfile parameter. This is a return page after Login
Call objPMod.StoreParameter ( "rfile", "form_view_release_licencing.asp" )
'------------ ACCESS CONTROL ------------------
%>
<!--#include file="_access_control_login.asp"-->
<!--#include file="_access_control_general.asp"-->
<!--#include file="_access_control_project.asp"-->
<%
'------------ Variable Definition -------------
Dim bShowAll
Dim bShowAny
Dim sPrevPage
Dim bOrdered
Dim sOrderCheck
Dim sAllCheck
Dim sAnyCheck
'------------ Constants Declaration -----------
'------------ Variable Init -------------------
bShowAll = Request("ShowAll")
bShowAny = Request("ShowAny")
bOrdered = Request("ordered") <> ""
 
If bOrdered       Then sOrderCheck = " Checked "
If bShowAny <> "" Then sAnyCheck = " Checked "
If bShowAll <> "" Then sAllCheck = " Checked "

'--------------------------------------------------------------------------------------------------------------------------
'  release_licencing_query_string
'
'  DESCRIPTION
'     Constructs a query string using the provided release tag, designed to elicit
'     a list of PV_ID's, thier package names, versions and extensions, and licencing
'     associations from the release. Only those PV_IDs with one or more licencing
'     associations are returned.
'
'  INPUTS
'     NNrtag_id : The release tag to be used in the query string
'
Function release_licencing_query_string(NNrtag_id)

   release_licencing_query_string = _
                    "WITH AllPkgLic AS " &_
                    "  (SELECT pkg_id, " &_
                    "    listagg(name, ',') within GROUP ( " &_
                    "  ORDER BY name) AS Name " &_
                    "  FROM " &_
                    "    (SELECT pv.pkg_id, " &_
                    "      ld.name, " &_
                    "      row_number() over (partition BY pv.pkg_id, ld.name order by pv.pkg_id) AS rn " &_
                    "    FROM LICENCING lg, " &_
                    "      LICENCES ld , " &_
                    "      package_versions pv " &_
                    "    WHERE lg.pv_id = pv.pv_id " &_
                    "    AND lg.LICENCE = ld.LICENCE " &_
                    "    ) " &_
                    "  WHERE rn = 1 " &_
                    "  GROUP BY pkg_id " &_
                    "  ), " &_
                    "  AllPvIDs AS " &_
                    "  ( SELECT DISTINCT * " &_
                    "  FROM " &_
                    "    ( SELECT pv_id FROM RELEASE_CONTENT rc WHERE rc.rtag_id = :rtag_id " &_
                    "    UNION " &_
                    "    SELECT pv_id FROM work_in_progress wip WHERE wip.rtag_id = :rtag_id " &_
                    "    UNION " &_
                    "    SELECT pv_id " &_
                    "    FROM planned pl " &_
                    "    WHERE pl.rtag_id   = :rtag_id " &_
                    "    AND (pl.operation IS NULL " &_
                    "    OR pl.operation    = 'R') " &_
                    "    ) " &_
                    "  ) " &_
                    "SELECT DISTINCT pv.pv_id, " &_
                    "  pkg.pkg_name, " &_
                    "  pv.pkg_version, " &_
                    "  pv.v_ext, " &_
                    "  pv.pv_description, " &_
                    "  lcs.name AS licenceName , " &_
                    "  CASE " &_
                    "    WHEN al.NAME  IS NOT NULL " &_
                    "    AND lcs.name  IS NOT NULL " &_
                    "    AND ( lcs.name = al.NAME ) " &_
                    "    THEN NULL " &_
                    "    ELSE al.NAME " &_
                    "  END AS OTHERLICENSES " &_
                    "FROM AllPvIDs rc, " &_
                    "  package_versions pv, " &_
                    "  packages pkg, " &_
                    "  licencing lcng, " &_
                    "  licences lcs, " &_
                    "  AllPkgLic al " &_
                    "WHERE pv.pv_id   = rc.pv_id " &_
                    "AND pkg.pkg_id   = pv.pkg_id " &_
                    "AND pv.pv_id     = lcng.pv_id (+) " &_
                    "AND lcng.licence = lcs.licence (+) " &_
                    "AND pv.pkg_id    = al.pkg_id(+) " &_
                    "AND ((lcng.licence is not null) OR ('" & bShowAll & "' is not null) OR ( (al.name is not null) AND ('" & bShowAny & "' is not null) )) "

    If bOrdered Then
        release_licencing_query_string = release_licencing_query_string &_
                    "ORDER BY Upper(licenceName), Upper( pkg.pkg_name), " &_
                    "  Upper(pv.pkg_version) "
    Else        

        release_licencing_query_string = release_licencing_query_string &_
                    "ORDER BY Upper( pkg.pkg_name), " &_
                    "  Upper(pv.pkg_version) "
    End If
End Function


'--------------------------------------------------------------------------------------------------------------------------
'  PV_ID_ListHTML
'
'  DESCRIPTION
'     Constructs the HTML to render the rows of package names, versions and extensions, and licences
'
Function PV_ID_ListHTML
   Dim rsQry
   Dim html_string


   OraDatabase.Parameters.Add "RTAG_ID", parRtag_Id, ORAPARM_INPUT, ORATYPE_NUMBER
   Set rsQry = OraDatabase.DbCreateDynaset( release_licencing_query_string(parRtag_Id), cint(0) )
   OraDatabase.Parameters.Remove "PV_ID"

   '--- Render rows ---
   Do While (NOT rsQry.BOF) AND (NOT rsQry.EOF)

      ' BEGIN ROW
      html_string = html_string & "<tr class='csvData'>"

      ' PACKAGE NAME
      html_string = html_string & "<td nowrap class='body_rowg'>"
      html_string = html_string & "<a href=dependencies.asp?pv_id=" & rsQry("pv_id") & "&rtag_id=" & parRtag_Id & ">" & rsQry("pkg_name") & "</a>"
      html_string = html_string & "</td>"

      ' PACKAGE VERSION
      If IsNull(rsQry("v_ext")) Then
         html_string = html_string & "<td nowrap class='body_rowg'>" & rsQry("pkg_version") & "</td>"
      Else
         html_string = html_string & "<td nowrap class='body_rowg'>" & Left(rsQry("pkg_version"), Len(rsQry("pkg_version")) - Len(rsQry("v_ext")) ) & "</td>"
      End If

      ' PACKAGE EXTENSION
      html_string = html_string & "<td nowrap class='body_rowg'>" & rsQry("v_ext") & "</td>"

      ' PACKAGE Short Description
      html_string = html_string & "<td class='body_rowg'>" & rsQry("pv_description") & "</td>"

      ' LICENCE NAME
      html_string = html_string & "<td nowrap class='body_rowg'>" & rsQry("licenceName") & "</td>"

      ' Other Licences
      html_string = html_string & "<td nowrap class='body_rowg'>" & rsQry("otherlicenses") & "</td>"

      ' Edit License
      Dim sonclick
      sonclick="""MM_openVixIFrame('_wform_change_licence.asp?pv_id="& rsQry("pv_id") &"&rtag_id="& parRtag_id &"','Change License')"""
      Dim data

      If canActionControlInProject ("EditPackageLicence") OR canActionControl("MSMaintainer") Then
        data = "<a href='javascript:;' onClick=" & sonclick & " class='body_txt'>" &_
               "<img src='images/i_edit.gif' width='12' height='12' border='0'>" &_
               "</a>"
     Else
        data = "<img src='images/i_edit_disable.gif' width='12' height='12' border='0'>"
     End If

      html_string = html_string & "<td nowrap class='body_rowg'>" & data & "</td>"

      ' END ROW
      html_string = html_string & "</tr>"

      rsQry.MoveNext

      ' ROW SEPERATOR
      If (NOT rsQry.BOF) AND (NOT rsQry.EOF) Then
         html_string = html_string & "<tr><td colspan='8' style='border-bottom: 1pt solid #dad7c8;'></td></tr>"
      End If
   Loop

   ' destroy objects
   rsQry.Close()
   Set rsQry = nothing

   ' return result
   PV_ID_ListHTML = html_string
End Function

'--------------------------------------------------------------------------------------------------------------------------

'----------------------------------------------
Sub LeftPanelContent
   objFormComponent.FormName = "FormName"
   objFormComponent.Method = "get"
   objFormComponent.Action = ScriptName
   Call objFormComponent.FormStart()
%>

<fieldset class="body_rowg fset">
    <legend>Options</legend>
    <input     name="ordered" type="checkbox" class="form_btn" <%=sOrderCheck%> value=1 onChange="this.form.submit()">Ordered
    <br><input name="showAny" type="checkbox" class="form_btn" <%=sAnyCheck%>   value=1 onChange="this.form.submit()">Show Any<%=Quick_Help("h_showAny")%>
    <br><input name="showAll" type="checkbox" class="form_btn" <%=sAllCheck%>   value=1 onChange="this.form.submit()">Show All<%=Quick_Help("h_showAll")%>
    <br><input name="rtag_id" type="hidden" value=<%=parRtag_Id%> 
</fieldset>
   <%
   Call objFormComponent.FormEnd()
   '-- FROM END ----------------------------------------------------------------------------------------------------------------
   %>
<%
End Sub
'----------------------------------------------
Sub MainPanelContent
%>
   <table class="embedded_table" style="margin-bottom:20px" width="90%">
      <tr>
         <td>
            <!-- Box Title -->
            <div class="form_ttl nowrap" align="left">
                 VIEW RELEASE LICENCING DETAILS
            </div>
         </td>
      </tr>
      <tr>
         <td>
            <!-- Box Content -->
            <div class="rounded_box">
               <div style="background-color: white;border-left: white solid 10px;border-right: white solid 10px;">
                    <!-- MESSAGE +++++++++++++++++++++++++++++++++++++++++++++++++++ -->
                    <!--#include file="messages/_msg_inline.asp"-->
                    <!-- +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
                    <table width="100%" class="embedded_table etable">
                        <tr>
                           <td valign="top"></td>
                           <tr>
                              <th valign="top" nowrap class="body_hcol">Package Name</th>
                              <th valign="top" nowrap class="body_hcol">Package Version</th>
                              <th valign="top" nowrap class="body_hcol">Package Extension</th>
                              <th valign="top"        class="body_hcol">Short Description</th>
                              <th valign="top" nowrap class="body_hcol">Licences<%=Quick_Help("h_licences")%></th>
                              <th valign="top" nowrap class="body_hcol">Other Licences<%=Quick_Help("h_other")%></th>
                              <th valign="top" nowrap class="body_hcol noCsv">Edit</th>
                           </tr>
                           <%=PV_ID_ListHTML()%>
                        </tr>
                    </table>
               </div>
            </div>
         </td>
      </tr>
   </table>
<%
End Sub
'------------------------------------------------------------------------------
%>
<html>
   <head>
      <title>Release Manager</title>
      <link rel="shortcut icon" href="<%=FavIcon%>"/>
      <meta http-equiv="Pragma" content="no-cache">
      <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
      <link rel="stylesheet" href="images/release_manager_style.css?ver=<%=VixVerNum%>" type="text/css">
      <link rel="stylesheet" href="images/navigation.css?ver=<%=VixVerNum%>" type="text/css">
      <script language="JavaScript" src="images/common.js?ver=<%=VixVerNum%>"></script>
<script language="JavaScript" src="scripts/remote_scripting.js?ver=<%=VixVerNum%>"></script>
      <!-- DROPDOWN MENUS -->
<%bCsvExport = True%>
      <!--#include file="_jquery_includes.asp"-->
      <!--#include file="_menu_def.asp"-->
      <script language="JavaScript1.2" src="images/popup_menu.js?ver=<%=VixVerNum%>"></script>
<!-- TIPS -->
<script language="JavaScript" src="images/tipster.js?ver=<%=VixVerNum%>"></script>
<script language="JavaScript" src="images/_help_tips.js?ver=<%=VixVerNum%>"></script>
<script language="JavaScript" type="text/javascript">
<!--
formTips.tips.h_licences       = stdTip(300, 'License', 'A list of licences found on this version of this package' +
                                                          '<p>Licences are specified for a specific version of a package.' + 
                                                          '<p>A package may have several licences and the packages licences may change over time.' 
                                                          );
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' +
                                                          'for this package.' +
                                                          '<p>Licences are specified for a specific version of a package.' + 
                                                          '<p>A package may have several licences and the packages licences may change over time.' 
                                                          );

formTips.tips.h_showAny       = stdTip(300, 'Show Any', 'Show packages, in this Release, that have a licence in any release, not just this release.');
formTips.tips.h_showAll       = stdTip(300, 'Show All', 'Show all packages in this Release, not just those with a licence.');

</script>
   </head>
   <body bgcolor="#FFFFFF" text="#000000" leftmargin="0" topmargin="0">
      <!-- HEADER -->
      <!--#include file="_header.asp"-->
      <!-- BODY ---->
      <table class="full_table">
         <tr>
            <td width="146px" class="panel_bg" valign="top">
                <%Call LeftPanelContent%>
            </td>
            <td width="100%" rowspan="2" align="center" valign="top" bgcolor="#EEEFEF">
                <%Call MainPanelContent%>
            </td>
         </tr>
         <tr>
            <td class="panel_bg" valign="bottom" align="center" height="350">
                <img src="images/img_gears.png" vspace="20" hspace="30"></td>
         </tr>
      </table>
      <!-- FOOTER -->
      <!--#include file="_footer.asp"-->
   </body>
</html>