Subversion Repositories DevTools

Rev

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

<%
'=====================================================
'|                                                   |
'|                                _front_explorer                                |
'|                                                   |
'=====================================================
%>
<%
'------------ Variable Definition -------------
Dim rsProj
Dim rsTemp
Dim parListBy
'------------ Constants Declaration -----------
Const hlColor      = "#E3B62D"
'------------ Variable Init -------------------
parListBy = Request("listby")
If parListBy = "" Then parListBy = 3    ' Default visible list is Projects
'----------------------------------------------
%>
<%
'-----------------------------------------------------------------------------------------------------------------------
Function Set_Row_Style ( SSLink )
        Set_Row_Style = "onMouseOver=""this.bgColor = '"& hlColor &"'"" onMouseOut =""this.bgColor = ''"" onClick=""location.href='"& SSLink &"'"""
End Function
'-----------------------------------------------------------------------------------------------------------------------
Function Get_Projects
        Get_Projects = _
        "select unique p.* from release_tags rt, projects p where rt.PROJ_ID = p.PROJ_ID and rt.official in ('N','R','C','P') ORDER BY p.proj_name ASC"
End Function
'-----------------------------------------------------------------------------------------------------------------------
Function Get_All_Projects
        Get_All_Projects = _
        "select p.* from projects p ORDER BY p.proj_name ASC"
End Function
'-----------------------------------------------------------------------------------------------------------------------
Function Format_Full_Name ( SSfullname )
        If InStr( SSfullname, " " ) = 0 Then
                ' No space in full_name
                Format_Full_Name = SSfullname
                
        Else
                ' Proper full_name found
                
                Format_Full_Name = Left( SSfullname, InStr( SSfullname, " " )  )
                
        End If
        
End Function
'-----------------------------------------------------------------------------------------------------------------------
Sub GenerateAtoZ(idx, page,emode)
        Dim letter, LROW_ONE, LROW_TWO, LROW3, URL
        
        ' Declare array of letters for browsing
        LROW_ONE = Array("A","B","C","D","E","F","G","H","I","J","K","L","M")
        LROW_TWO = Array("N","O","P","Q","R","S","T","U","V","W","X","Y","Z")
        LROW3    = Array("1","2","3","4","5","6","7","8","9","0","*")
        
        
        Response.write "<table width='180'  border='0' cellspacing='1' cellpadding='2'>"
        
        ' Render first row
        For Each letter In LROW_ONE
                Response.write "<td width='10' bgcolor='#DDB02C' align='center'>"
        Response.Write "<a href ='"&page&"?listby="&idx&"&browse="& Server.URLEncode( letter ) &"' class='form_txt_link'>"& letter &"</a></td>"
        Next
        Response.write "</tr>"
        
        
        ' Render second row
        Response.write "<tr>"
        For Each letter In LROW_TWO
                Response.write "<td bgcolor='#DDB02C' align='center'>"
        Response.Write "<a href ='"&page&"?listby="&idx&"&browse="& Server.URLEncode( letter ) &"' class='form_txt_link'>"& letter &"</a></td>"
        Next
        Response.write "</tr>"
   
    If eMode Then
        ' Render 3rd row
        Response.write "<tr>"
        For Each letter In LROW3
                Response.write "<td bgcolor='#DDB02C' align='center'>"
            Response.Write "<a href ='"&page&"?listby="&idx&"&browse="& Server.URLEncode( letter ) &"' class='form_txt_link'>"& letter &"</a></td>"
        Next
        Response.write "</tr>"
    End If
 
        Response.write "</table>"
        
End Sub
'-----------------------------------------------------------------------------------------------------------------------
%>
        <table width="100%" border="0" cellspacing="0" cellpadding="0">
                <tr> 
                        <td>
              <table width="100%"  border="0" cellspacing="0" cellpadding="10">
                                <form name="fromlist">
                <tr>
                  <td nowrap>
                  <script type="text/javascript">
                  $(document).ready(function(){
                    // Force focus to the inputbox when the page is rendered
                    setInputFocus(<%=parListBy%>);
                  });
                  // Set required div visible and give the input box focus
                  function setDivVisible(divNum) {
                    var ii;
                    for (ii=1; ii<=5; ii++) {
                        Visible('DIVLIST' + ii, 'none')
                    }
                    Visible('DIVLIST' + divNum, 'block');
                    setInputFocus(divNum);
                  }
                  // Set focus to the input box - set cursor to end of text
                  function setInputFocus(divNum){
                    var input = $("#DIVFOCUS" + divNum );
                    input.focus();
                    var tmpStr = input.val();
                    input.val('');
                    input.val(tmpStr);
                  }
                  </script>
                                  <select name="listby" class='form_item' onChange="setDivVisible(this.value);">
                                        <option value="3" <%If parListBy = "3" Then%>selected<%End If%>>View by Projects</option>
                                        <option value="4" <%If parListBy = "4" Then%>selected<%End If%>>View by Projects - ALL</option>
                                        <option value="5" <%If parListBy = "5" Then%>selected<%End If%>>View by Releases</option>
                                        <option value="1" <%If parListBy = "1" Then%>selected<%End If%>>View by Packages</option>
                                        <option value="2" <%If parListBy = "2" Then%>selected<%End If%>>View by Files</option>
                                  </select>
                                  </td>
                </tr>
                                </form>
            </table>
                        </td>
                </tr> 
                <tr> 
          <td background="images/bg_home_orglite.gif"><img src="images/h_trsp_dot.gif" width="1" height="1"></td>
        </tr>
        </table>
<!-- LIST BY RELEASES ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
        <DIV name="DIVLIST5" id="DIVLIST5" style="display:none;">
        <table width="100%" border="0" cellspacing="0" cellpadding="0">
                <tr> 
                   <td>
              <table width="100%"  border="0" cellspacing="0" cellpadding="10">
                <tr>
                  <td nowrap>
                                    <table width="100" border="0" cellspacing="0" cellpadding="0">
                      <form name="release_search" method="get" action="view_by_release.asp" onSubmit="MM_validateForm('releasename','Release keyword','R');return document.MM_returnValue">
                        <tr>
                          <td colspan="2" class="form_item">Find Release</td>
                        </tr>
                        <tr>
                          <td valign="top" class="form_txt"><input id="DIVFOCUS5" name="releasename" type="text" class="form_item" size="25" value="<%=Request("releasename")%>">
                          </td>
                          <td class="form_txt"><input type="submit" name="btn" value="Go" class="form_btn_comp"></td>
                        </tr>
                                                <tr>
                          <td colspan="2" class="form_item">Browse</td>
                        </tr>
                                                <tr> 
                              <td colspan="2"><%Call GenerateAtoZ(5,"view_by_release.asp", true)%></td>
                            </tr>
                                                <input type="hidden" name="listby" value="5">
                      </form>
                          </table>
                                  
                                  </td>
                </tr>
            </table>            
                </td>
                <tr> 
          <td background="images/bg_home_orglite.gif"><img src="images/h_trsp_dot.gif" width="1" height="1"></td>
        </tr>
        </table>
        </DIV>
        
<!-- LIST BY PACKAGE ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
        <DIV name="DIVLIST1" id="DIVLIST1" style="display:none;">
        <table width="100%" border="0" cellspacing="0" cellpadding="0">
                <tr> 
                   <td>
              <table width="100%"  border="0" cellspacing="0" cellpadding="10">
                <tr>
                  <td nowrap>
                                    <table width="100" border="0" cellspacing="0" cellpadding="0">
                      <form name="pkg_search" method="get" action="view_by_package.asp" onSubmit="MM_validateForm('pkgname','Package keyword','R');return document.MM_returnValue">
                        <tr>
                          <td colspan="2" class="form_item">Find Package</td>
                        </tr>
                        <tr>
                          <td valign="top" class="form_txt"><input id="DIVFOCUS1" name="pkgname" type="text" class="form_item" size="25" value="<%=Request("pkgname")%>">
                          </td>
                          <td class="form_txt"><input type="submit" name="btn" value="Go" class="form_btn_comp"></td>
                        </tr>
                                                <tr>
                          <td colspan="2" class="form_item">Browse</td>
                        </tr>
                                                <tr> 
                              <td colspan="2"><%Call GenerateAtoZ(1,"view_by_package.asp",false)%></td>
                            </tr>
                                                <input type="hidden" name="listby" value="1">
                      </form>
                          </table>
                                  
                                  </td>
                </tr>
            </table>            
                </td>
                <tr> 
          <td background="images/bg_home_orglite.gif"><img src="images/h_trsp_dot.gif" width="1" height="1"></td>
        </tr>
        </table>
        </DIV>
<!-- LIST BY FILES AND FOLDERS ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
        <DIV name="DIVLIST2" id="DIVLIST2" style="display:none;">
        <table width="100%" border="0" cellspacing="0" cellpadding="0">
                <tr> 
                        <td>
              <table width="100%"  border="0" cellspacing="0" cellpadding="10">
                <tr>
                  <td nowrap>
                                    <table width="100" border="0" cellspacing="0" cellpadding="0">
                      <form name="pkg_search" method="get" action="view_by_file.asp" onSubmit="MM_validateForm('filename','File keyword','R');return document.MM_returnValue">
                        <tr>
                          <td colspan="2" class="form_item">Find File</td>
                        </tr>
                        <tr>
                          <td valign="top" class="form_txt"><input id="DIVFOCUS2" name="filename" type="text" class="form_item" size="25" value="<%=Request("filename")%>">
                          </td>
                          <td class="form_txt"><input type="submit" name="btn" value="Go" class="form_btn_comp"></td>
                        </tr>
                                                <tr>
                          <td colspan="2" class="form_item">HINTS:<br>- You can use * wildcard. e.g. *0123 or 0123* or *0123*<br></td>
                        </tr>                        
                                                <input type="hidden" name="listby" value="2">
                      </form>
                          </table>
                                  
                                  </td>
                </tr>
            </table>            
                </td>
                <tr> 
          <td background="images/bg_home_orglite.gif"><img src="images/h_trsp_dot.gif" width="1" height="1"></td>
        </tr>           
        </table>
        </DIV>
<!-- LIST BY PROJECT ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
        <DIV name="DIVLIST3" id="DIVLIST3" style="display:none;">
        <table width="100%" border="0" cellspacing="0" cellpadding="0">
        
                <%Set rsProj = OraDatabase.DbCreateDynaset( Get_Projects, cint(0))
                While ((NOT rsProj.BOF) AND (NOT rsProj.EOF))%>
        <tr <%=Set_Row_Style( "rtree.asp?proj_id="&  rsProj.Fields("proj_id") )%>> 
          <td nowrap><img src="images/h_trsp_dot.gif" width="16" height="16" align="absmiddle" vspace="4"><a href="rtree.asp?proj_id=<%=rsProj.Fields("proj_id")%>" class="form_txt_link"><%=UCase(rsProj.Fields("proj_name"))%></a></td>
        </tr>
        <tr> 
          <td background="images/bg_home_orglite.gif"><img src="images/h_trsp_dot.gif" width="1" height="1"></td>
        </tr>
                <%rsProj.MoveNext
            WEnd%>
                <%If rsProj.RecordCount < 1 Then%>
                        <tr> 
                  <td nowrap class="err_alert"><img src="images/h_trsp_dot.gif" width="16" height="16" align="absmiddle" vspace="4"><b>No projects available!</b></td>
                </tr>
                <tr> 
                  <td background="images/bg_home_orglite.gif"><img src="images/h_trsp_dot.gif" width="1" height="1"></td>
                </tr>
                <%End If%>
                <tr> 
                <%If (canActionControl("CreateNewProject")) Then%>
          <td align="right"><a href="#" onClick="MM_openVixIFrame('_wform_new_project.asp','Create a New Project')"><img src="images/bt_new_project.gif" width="16" height="16" border="0" vspace="5" hspace="5" align="absmiddle" alt="Create new Project" title="Create new Project"></a></td>
        </tr>
                <%End If%>
        </table>
        </DIV>  
<!-- LIST BY PROJECT ALL ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
        <DIV name="DIVLIST4" id="DIVLIST4" style="display:none;">
        <table width="100%" border="0" cellspacing="0" cellpadding="0">
        
                <%Set rsProj = OraDatabase.DbCreateDynaset( Get_All_Projects, cint(0))
                While ((NOT rsProj.BOF) AND (NOT rsProj.EOF))%>
        <tr <%=Set_Row_Style( "rtree.asp?proj_id="&  rsProj.Fields("proj_id") )%>> 
          <td nowrap><img src="images/h_trsp_dot.gif" width="16" height="16" align="absmiddle" vspace="4"><a href="rtree.asp?proj_id=<%=rsProj.Fields("proj_id")%>" class="form_txt_link"><%=UCase(rsProj.Fields("proj_name"))%></a></td>
        </tr>
        <tr> 
          <td background="images/bg_home_orglite.gif"><img src="images/h_trsp_dot.gif" width="1" height="1"></td>
        </tr>
                <%rsProj.MoveNext
            WEnd%>
                <%If rsProj.RecordCount < 1 Then%>
                        <tr> 
                  <td nowrap class="err_alert"><img src="images/h_trsp_dot.gif" width="16" height="16" align="absmiddle" vspace="4"><b>No projects available!</b></td>
                </tr>
                <tr> 
                  <td background="images/bg_home_orglite.gif"><img src="images/h_trsp_dot.gif" width="1" height="1"></td>
                </tr>
                <%End If%>
                <tr> 
                <%If (canActionControl("CreateNewProject")) Then%>
          <td align="right"><a href="#" onClick="MM_openVixIFrame('_wform_new_project.asp','Create a New Project')"><img src="images/bt_new_project.gif" width="16" height="16" border="0" vspace="5" hspace="5" align="absmiddle" alt="Create new Project" title="Create new Project"></a></td>
        </tr>
                <%End If%>
        </table>
        </DIV>  

<!-- END OF LIST BY ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->

<script language="JavaScript" type="text/javascript">
<!-- 

// Set List visibility
Visible ("DIVLIST1","none","DIVLIST2","none","DIVLIST3","none","DIVLIST4","none");
Visible ("DIVLIST<%=parListBy%>","block");

//-->
</script>