<% Option explicit Response.Expires = 0 Dim Conn,Comm,RS,BugID,addfn,FldLinks %> <% ' EnumLinks: enumerate links in FldLinks array ' title: array of titles ' fld: array of field indexes in FldLinks ' onlick: client function for onclick event SUB EnumLinks(title,ondblclick,fld,ondelete) Dim i,j,mx,n Response.Write "" Response.Write "" for i = 0 to UBound(title) Response.Write "" next Response.Write "" if vbNull <> VarType(FldLinks) then mx = UBound(FldLinks,2) for i = 0 to mx Response.Write "" for j = 0 to UBound(fld) Response.Write "" next j = 0 for each n in RS.Fields Response.Write "" j = j + 1 next Response.Write "" next end if END SUB Set Conn = Server.CreateObject("ADODB.Connection") Set Comm = Server.CreateObject("ADODB.Command") Set RS = Server.CreateObject("ADODB.Recordset") Conn.Open Session("DSN") Set Comm.ActiveConnection = Conn rem RS.CursorType = adOpenStatic Set RS.Source = Comm Response.Write "" BugID = Request.QueryString("bugid") Comm.CommandText = "Select LinkID,FileName,OriginalName,LinkedBugID,TokenID from links where BugID=" & BugID & " AND fDeleted=0 AND Type=" & Request.QueryString("type") rem Response.Write Comm.CommandText RS.Open if NOT RS.EOF then FldLinks = RS.GetRows() else FldLinks = NULL end if Response.Write "
" & title(i) & "
Delete" & FldLinks(fld(j),i) & "
" Response.Write "" Select case Request.QueryString("type") case 3 EnumLinks Array("Attached Files"), "download()", Array(2), "delattach()" addfn = "upload()" case 1 EnumLinks Array("Related bugs"), "showbug()", Array(3), "dellinkedbug()" addfn = "addlinkedbug('Related')" case 0 EnumLinks Array("Duplicate bugs"), "showbug()", Array(3), "dellinkedbug()" addfn = "addlinkedbug('Duplicate')" case 6 EnumLinks Array("Dependent bugs"), "showbug()", Array(3), "dellinkedbug()" addfn = "addlinkedbug('Dependent')" end select Response.Write "
" RS.Close Conn.Close %>

" type=hidden> " type=hidden>