Subversion Repositories DevTools

Rev

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

<%
'=====================================================
'   _used_by.asp
'   Core Implementation.
'   Needs to be used via a wrapper
'=====================================================
%>
<%
'------------ Variable Definition -------------
Dim rsTemp, rsState
Dim projId
Dim pkgId
Dim rsQry
Dim isDaemonEnabledRelease
'------------ Constants Declaration -----------
Const IMG_SVTREE = "<img src='images/i_vtree_small.gif' hspace='3' align='absmiddle' border='0'>"
Const IMG_WORLD = "<img src='images/i_foldero_small.gif' hspace='3' align='absmiddle' border='0'>"
Const IMG_GAP = "<img src='images/spacer.gif' width='20' height='1' border='0'>"
Const IMG_POINTER = "<img src='images/i_pointer.gif' border='0'>"
'------------ Variable Init -------------------
'----------------------------------------------
%>
<%
'-----------------------------------------------------------------------------------------------------------------------------
If pageIsEmbedded Then
    isDaemonEnabledRelease = TRUE
Else
    isDaemonEnabledRelease = is_daemon_enabled_release(parRtag_id, TRUE)
End If

If Request("action") <> "" AND NOT pageIsEmbedded Then
   %>
   <!--#include file="_access_control_login.asp"-->
   <!--#include file="_access_control_project.asp"-->
   <%
   If ( parRtag_id <> "") AND (parPv_id <> "") Then

      Dim posComma, txt, posUnderscore, dpvId, pvId, value, pvIdList, apvIdList, strList

      If isDaemonEnabledRelease = FALSE Then

         Set pvIdList = CreateObject("Scripting.Dictionary")
         'On Error Resume Next
         txt = Mid(Request("ignore_warnings"), 1, len(Request("ignore_warnings")))
         posComma = InStr(txt, ",")

         While posComma <> 0
            'Response.Write(txt)
            value = Mid(txt, 1, posComma-1)
            posUnderscore = Instr(value, "_")
            pvId = Mid(value, 1, posUnderscore - 1)
            dpvId = Mid(value, posUnderscore + 1, posComma-1)

            Call SetIgnoreWarnings(dpvId, pvId, parRtag_id)
            pvIdList.Add CStr( pvId ), Empty
            txt = Mid(txt, posComma + 1, Len(txt))
            posComma = InStr(txt, ",")
         WEnd

         If posComma = 0 And Len(txt) > 0 Then
            posUnderscore = Instr(txt, "_")
            pvId = Mid(txt, 1, posUnderscore - 1)
            dpvId = Mid(txt, posUnderscore + 1)
            Call SetIgnoreWarnings(dpvId, pvId, parRtag_id)
            pvIdList.Add CStr( pvId ), Empty
         End if

         apvIdList = pvIdList.Keys

      End If

      Call Destroy_All_Objects
      Response.Redirect("used_by.asp?pv_id="& parPv_id &"&rtag_id="& parRtag_id)
   Else
      Response.write "Some mandatory parameters are missing!" & "<br>" 'TODO
      Response.write QSTR_FullQuery
   End If
End If
%>
<script language="javascript">
<!--
function checkUncheckAll(theElement) {
   var theForm = theElement.form, z = 0;
   for(z=0; z<theForm.length;z++){
      if(theForm[z].type == 'checkbox' && theForm[z].name != 'checkall' && theForm[z].disabled != true){
         theForm[z].checked = theElement.checked;
      }
   }
}

//  Show users of this package
function showUsedBy(el){
    var url = el.value;
    var baseId = 'EXTENDED'; 
    var divel = MM_findObj(baseId);
    if (url)
    {
        // Show the DIV we are about to load
        divel.style.display = 'block';
        divel.innerHTML = '<%=enumLOADING%>';

        // Set div name for ajax loading
                ajaxdivname = baseId;

                //Create the xmlHttp object to use in the request
                //stateChangeHandler will fire when the state has changed, i.e. data is received back
                // This is non-blocking (asynchronous)
                xmlHttp = GetXmlHttpObject(stateChangeHandler);

                //Send the xmlHttp get to the specified url
                xmlHttp_Get(xmlHttp, url);
    }
    else
    {
        divel.style.display = 'none';
    }
}

//
//      Load/Hide/Show an Ajax expander
//      BaseId - Base for two IDs.
//                       IMG_BaseId - image to to toggle
//                       BaseId - Div to load data into
//      url - Url used to load subcontrol
function ToggleUsedByControl(baseId, url)
{
        var img, dmode;
        var imgel = MM_findObj("IMG_" + baseId);
        var divel = MM_findObj(baseId);
        var showing = divel.getAttribute("data-show");
        if(showing == 1)
        {
                img = "images/bt_minus.gif";
                dmode = 'block';
                showing = 2
        }
        else if(showing == 2)
        {
                img = "images/bt_plus.gif";
                dmode = 'none';
                showing = 1;
        }
        else
        {
                img = "images/bt_minus.gif";
                dmode = 'block';
                showing = 2;

                // Set div name for ajax loading
                ajaxdivname = baseId;

                //Create the xmlHttp object to use in the request
                //stateChangeHandler will fire when the state has changed, i.e. data is received back
                // This is non-blocking (asynchronous)
                xmlHttp = GetXmlHttpObject(stateChangeHandler);

                //Send the xmlHttp get to the specified url
                xmlHttp_Get(xmlHttp, url);
        }
        // Update image and attributes
        imgel.src = img;
        divel.style.display = dmode;
        divel.setAttribute("data-show", showing);
}

function matchValue(ename) {
    var el
    el = document.getElementsByName(ename);
    if (el[0] && el[0].checked) return 1;
    return 0;
} 

//-->
</script>
    <%
    If pkgInfoHash.Exists("pv_id") Then
    '-- FROM START ---------------------------------------------------------------------------------------------------------
    objFormComponent.FormName = "FormName"
    objFormComponent.Action = ScriptName&"?pv_id="&Request("pv_id")&"&rtag_id="&parRtag_id
    Call objFormComponent.FormStart()
    %>
    <%If Request("rtag_id") <> "" Then%>
     <br>
     <span class="body_sect">Used by Packages In This Release</span>
     <br>
     <!-- USED BY ------------------------------------------------>
     <table width="100%" border="0" cellspacing="1" cellpadding="3">
        <tr>
           <%If isDaemonEnabledRelease = FALSE Then%>
              <td background="images/bg_form_lightbluedark.gif" nowrap width="1" class="form_field"><INPUT type=checkbox name="checkall" value="Check All" onClick="checkUncheckAll(this);"></td>
           <%End If%>
           <td background="images/bg_form_lightbluedark.gif" nowrap width="1"></td>
           <td background="images/bg_form_lightbluedark.gif" nowrap width="1" class="form_field">Name</td>
           <td background="images/bg_form_lightbluedark.gif" nowrap width="25%" class="form_field">Version</td>
           <td background="images/bg_form_lightbluedark.gif" nowrap width="25%" class="form_field">Location</td>
           <td background="images/bg_form_lightbluedark.gif" nowrap width="1" class="form_field"></td>
           <td background="images/bg_form_lightbluedark.gif" nowrap width="25%" class="form_field">Version Used</td>
           <td background="images/bg_form_lightbluedark.gif" nowrap width="25%" class="form_field">Last Modified</td>
        </tr>
        <%
        OraDatabase.Parameters.Add "RTAG_ID", parRtag_id,                 ORAPARM_INPUT, ORATYPE_NUMBER
        OraDatabase.Parameters.Add "PKG_ID",  pkgInfoHash.Item("pkg_id"), ORAPARM_INPUT, ORATYPE_NUMBER
                OraDatabase.Parameters.Add "V_EXT",   EmptyToNull(pkgInfoHash.Item ("v_ext")), ORAPARM_INPUT, ORATYPE_VARCHAR2

        Set rsTemp = OraDatabase.DbCreateDynaset( GetQuery("UsedByPackagesInThisRelease.sql"), cint(0))

        OraDatabase.Parameters.Remove "RTAG_ID"
        OraDatabase.Parameters.Remove "PKG_ID"
        OraDatabase.Parameters.Remove "V_EXT"
        %>
        <%If rsTemp.RecordCount < 1 Then%>
           <tr>
              <%If isDaemonEnabledRelease = FALSE Then%>
                 <td background="images/bg_form_lightgray.gif" nowrap>&nbsp;</td>
              <%End If%>
              <td background="images/bg_form_lightgray.gif" nowrap>&nbsp;</td>
              <td background="images/bg_form_lightgray.gif" nowrap>&nbsp;</td>
              <td background="images/bg_form_lightgray.gif" nowrap>&nbsp;</td>
              <td background="images/bg_form_lightgray.gif" nowrap>&nbsp;</td><br>
              <td background="images/bg_form_lightgray.gif" nowrap>&nbsp;</td>
              <td background="images/bg_form_lightgray.gif" class="form_item">&nbsp;</td>
              <td background="images/bg_form_lightgray.gif" class="form_item">&nbsp;</td>
           </tr>
        <%End If%>
        <%While ((NOT rsTemp.BOF) AND (NOT rsTemp.EOF))%>
           <tr>
              <% Set rsState = OraDatabase.DbCreateDynaset( "select deprecated_state from release_content where rtag_id="&parRtag_id&" and pv_id="&rsTemp("pv_id"), cint(0))%>
              <%If isDaemonEnabledRelease = FALSE Then%>
                 <%If rsTemp("dpv_id") <> parPv_id And IsNull(rsTemp("ignore_warn")) Then%>
                    <td background="images/bg_form_lightgray.gif" nowrap><input type="checkbox" name="ignore_warnings" value="<%=rsTemp("pv_id")%>_<%=rsTemp("dpv_id")%>"></td>
                 <%ElseIf rsTemp("dpv_id") = parPv_id And IsNull(rsTemp("ignore_warn")) OR NOT isNull(rsTemp("ignore_warn")) Then%>
                    <td background="images/bg_form_lightgray.gif" nowrap><input type="checkbox" name="ignore_warnings" value="<%=rsTemp("pv_id")%>_<%=rsTemp("dpv_id")%>" disabled></td>
                 <%Else%>
                    <td background="images/bg_form_lightgray.gif" nowrap><input type="checkbox" name="ignore_warnings" value="<%=rsTemp("pv_id")%>_<%=rsTemp("dpv_id")%>" checked></td>
                 <%End If%>
              <%End If%>

              <%If rsState("deprecated_state") <> "" AND rsTemp("pkg_state") = 0 Then%>
                 <td background="images/bg_form_lightgray.gif"><%=DefineStateIcon ( rsState("deprecated_state"), rsTemp("dlocked"), NULL, NULL, pkgInfoHash.Item("build_type"), TRUE )%></td>
              <%Else%>
                 <td background="images/bg_form_lightgray.gif"><%=DefineStateIcon ( rsTemp("pkg_state"), rsTemp("dlocked"), NULL, NULL, pkgInfoHash.Item("build_type"), TRUE )%></td>
              <%End If%>

              <td background="images/bg_form_lightgray.gif" nowrap><a href="used_by.asp?pv_id=<%=rsTemp("pv_id")%>&rtag_id=<%=parRtag_id%>" class="txt_linked"><%=rsTemp("pkg_name")%></a></td>
              <td background="images/bg_form_lightgray.gif" class="form_item"><%=rsTemp("pkg_version")%></td>
              <td background="images/bg_form_lightgray.gif" class="body_txt_gray" nowrap><%=GetEnvName(rsTemp("env_area"))%></td>
              <td background="images/bg_form_lightgray.gif"><%=DefineStateIcon ( 0, "Y", rsTemp("ignore_warn"), rsTemp("is_patch_ignore"), pkgInfoHash.Item("build_type"), TRUE )%></td>
              <td background="images/bg_form_lightgray.gif" <%If rsTemp("dpv_id") <> parPv_id Then%>class="err_alert"<%Else%>class="form_item"<%End If%>><%=pkgInfoHash.Item ("pkg_name") &" "& rsTemp("dpkg_version")%></td>
              <td background="images/bg_form_lightgray.gif" class="form_item"><a href="mailto:<%=rsTemp("user_email")%>" class="txt_linked"><%=enum_imgUser%><%=rsTemp("full_name")%></a>&nbsp;<%=DisplayDate ( rsTemp("modified_stamp") )%></td>
           </tr>
           <%rsTemp.MoveNext
           rsTemp.Close()
           rsState.Close()

           Set rsState = nothing
        WEnd
        Set rsTemp = nothing
        %>
     </table>
     <%If isDaemonEnabledRelease = FALSE Then%>
        <input name="btn" type="submit" class="form_btn" value="Apply"><br>
        <SPAN class="rep_small">NOTE: Click on Apply "To Ignore Warnings" On Packages Used By</SPAN><br>
     <%End If%>
     <SPAN class="rep_small">NOTE: Versions in <SPAN class="err_alert">RED</SPAN> are different from <%=pkgInfoHash.Item("pkg_name") &" "& pkgInfoHash.Item("pkg_version")%></span>
     <input type="hidden" name="action" value="true">
    <%End If%>
    <%
    Call objFormComponent.FormEnd()
    '-- FROM END ----------------------------------------------------------------------------------------------------------------
    %>
    <!-- Extended Searching ---------------------------------------->
    <br>
    <span class=body_txt>Extended Package Usage</span>
    <select class=body_txt onChange="showUsedBy(this);">
        <option value ="">Select one</option>
        <option disabled="disabled">Projects</option>
        <option value='RequestUsedByThisProjectSummary.asp?pv_id=<%=parPv_id%>&mode=2'>Projects that use: (<%=pkgInfoHash.Item("pkg_name")%>&nbsp;<%=pkgInfoHash.Item("pkg_version")%>)</option>
        <option value='RequestUsedByThisProjectSummary.asp?pv_id=<%=parPv_id%>&mode=1'>Projects that use: (<%=pkgInfoHash.Item("pkg_name")%><%=pkgInfoHash.Item("v_ext")%>)</option>
        <option value='RequestUsedByThisProjectSummary.asp?pv_id=<%=parPv_id%>&mode=0'>Projects that use: (<%=pkgInfoHash.Item("pkg_name")%>)</option>
        <option disabled="disabled">Packages</option>
        <option value='UsedByPackageSummary.asp?pv_id=<%=parPv_id%>&mode=2'>Packages that use: (<%=pkgInfoHash.Item("pkg_name")%>&nbsp;<%=pkgInfoHash.Item("pkg_version")%>)</option>
        <option value='UsedByPackageSummary.asp?pv_id=<%=parPv_id%>&mode=1'>Packages that use: (<%=pkgInfoHash.Item("pkg_name")%><%=pkgInfoHash.Item("v_ext")%>)</option>
        <option value='UsedByPackageSummary.asp?pv_id=<%=parPv_id%>&mode=0'>Packages that use: (<%=pkgInfoHash.Item("pkg_name")%>)</option>
        <option disabled="disabled">SDKs</option>
        <option value='UsedBySDKSummary.asp?pv_id=<%=parPv_id%>&mode=2'>SDKs that use: (<%=pkgInfoHash.Item("pkg_name")%>&nbsp;<%=pkgInfoHash.Item("pkg_version")%>)</option>
        <option value='UsedBySDKSummary.asp?pv_id=<%=parPv_id%>&mode=1'>SDKs that use: (<%=pkgInfoHash.Item("pkg_name")%><%=pkgInfoHash.Item("v_ext")%>)</option>
        <option value='UsedBySDKSummary.asp?pv_id=<%=parPv_id%>&mode=0'>SDKs that use: (<%=pkgInfoHash.Item("pkg_name")%>)</option>
    </select>
    <DIV class="form_item" id="EXTENDED" style="display:none;"><%=enumLOADING%></DIV>
    <p>
    <div class="rep_small">NOTE: Versions in <SPAN class="err_alert">RED</SPAN> are different from <%=pkgInfoHash.Item("pkg_name") &" "& pkgInfoHash.Item("pkg_version")%></span>
    <br>
<%End If%>