Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

1550 lines
50 KiB

  1. <%
  2. /*
  3. Modification History: 3/15 - Added IfColIDIsNull code
  4. 6/3/02 - Added davidgaz to the admins array per SandyWe Request.
  5. */
  6. var Admins = new Array(
  7. "solson", "gabea", "derekmo", "erikt", "sandywe", "toddc", "v-wsugg", "andreva", "sbeer", "a-mattk", "llau", "davidgaz"
  8. )
  9. var Testers = new Array(
  10. "sbeer", "kiranrk", "alokkar", "solson", "llau"
  11. )
  12. var PMs = new Array (
  13. "derekmo", "andreva" , "solson"
  14. )
  15. var CompareOperators = {
  16. "EQ" : {Text:"Equal to", Sign:"=" },
  17. "GT" : { Text:"Greater Than", Sign:">" },
  18. "LT" : { Text:"Less Than", Sign:"<" },
  19. "GTET" : { Text:"Greater than/Equal to", Sign:">=" },
  20. "LTET" : { Text:"Less than/Equal to", Sign:"<=" },
  21. "NE" : { Text:"Not Equal to", Sign:"<>" },
  22. "IS" : { Text:"Is Null", Sign:"IS NULL" },
  23. "ISN" : { Text:"Is Not Null", Sign:"IS NOT NULL"},
  24. "LK" : { Text:"Like", Sign:"LIKE " },
  25. "CONT" : { Text:"Contains", Sign:"CONTAINS" },
  26. "DNCONT" : { Text:"Does Not Contain", Sign:"DNCONTAINS" }
  27. }
  28. var SearchFields = {
  29. "1" : { Text:"Bucket ID", Value:"BucketID", ValType: "String" },
  30. "2" : { Text:"Has a Full Dump", Value:"bHasFullDump", ValType: "Number" },
  31. "3" : { Text:"Follow Up", Value:"FollowUp", ValType: "String" },
  32. "4" : { Text:"Response ID", Value:"SolutionID", ValType: "Number" },
  33. "5" : { Text:"Bug ID" , Value:"BugID" , ValType: "Number" },
  34. "6" : { Text:"Crash Count" , Value:"CrashCount", ValType: "Number" },
  35. "7" : { Text:"Driver Name" , Value:"DriverName", ValType: "String" },
  36. "8" : { Text:"iBucket" , Value:"iBucket", ValType: "Number" }
  37. }
  38. var CrashSearchFields = {
  39. "1" : { Text:"BucketID" , Value:"BucketID", ValType: "String" },
  40. "2" : { Text:"Build", Value:"BuildNo", ValType: "Number" },
  41. "3" : { Text:"Entry Date", Value:"EntryDate", ValType: "String" },
  42. "4" : { Text:"Email" , Value:"Email" , ValType: "String" },
  43. "5" : { Text:"Description" , Value:"Description", ValType: "String" },
  44. "6" : { Text:"FullDump" , Value:"bFullDump", ValType: "Number" },
  45. "7" : { Text:"Source" , Value:"Source", ValType: "Number" },
  46. "8" : { Text:"SKU" , Value:"sku", ValType: "Number" },
  47. "9" : { Text:"Crash Path", Value:"FilePath", ValType: "String" },
  48. "10" : { Text:"iBucket", Value:"iBucket", ValType: "Number" }
  49. }
  50. //set this to taket the site down
  51. var SiteDown = 0
  52. if ( SiteDown == 0 )
  53. {
  54. if ( Application("SiteDown") == 1 )
  55. SiteDown = 1
  56. else
  57. SiteDown = 0
  58. }
  59. //Server name
  60. var g_ServerName = Request.ServerVariables( "SERVER_NAME" )
  61. function trim ( src )
  62. {
  63. var temp = new String( src )
  64. var rep = /^( *)/
  65. var rep2 = /( )*$/
  66. var rep3 = /\n/
  67. var temp = temp.replace( rep3, "" )
  68. temp = temp.replace( rep2, "" )
  69. return ( temp.replace( rep, "" ) )
  70. }
  71. function SendMail ( Recipients, Subject, MessageText )
  72. {
  73. var StrBody
  74. var MailObject
  75. //MailObject = Server.CreateObject("CDONTS.NewMail")
  76. //MailObject.BodyFormat=0
  77. //MailObject.MailFormat=0
  78. //MailObject.Body = "HTML"
  79. //MailObject.To = "[email protected];" + Recipients
  80. //MailObject.From = "OCA/SCP_Build_Lab"
  81. //MailObject.subject = subject
  82. MessageText=MessageText + "\n"
  83. MessageText=MessageText + "\n"
  84. MessageText=MessageText + "\n" + "Do not respond to this email, it is automatically generated"
  85. MessageText=MessageText + "\n"
  86. var CDoObject = Server.CreateObject("CDO.Message")
  87. CDoObject.From = "DBGPortal"
  88. CDoObject.To = Recipients
  89. CDoObject.Cc = ""
  90. CDoObject.Subject = Subject
  91. CDoObject.TextBody = MessageText
  92. CDoObject.Send()
  93. }
  94. function GetUserAlias()
  95. {
  96. return Request.ServerVariables( "AUTH_USER" )
  97. }
  98. function GetShortUserAlias()
  99. {
  100. try
  101. {
  102. var FullAlias = new String( GetUserAlias() )
  103. FullAlias = FullAlias.split( "\\" )
  104. return FullAlias[1].toString()
  105. }
  106. catch( err )
  107. {
  108. return "unknown"
  109. }
  110. }
  111. function isAdmin( sUserAlias )
  112. {
  113. return( Admins.find( sUserAlias ) )
  114. }
  115. function isTester( sUserAlias )
  116. {
  117. return( Testers.find( sUserAlias ) )
  118. }
  119. function isPM( sUserAlias )
  120. {
  121. return( PMs.find( sUserAlias ) )
  122. }
  123. function BuildDropDown(SP, Value, SelectName )
  124. {
  125. Response.Write("<SELECT style='text-size:100%' ID='" + SelectName + "' NAME='" + SelectName + "'>\n" )
  126. DropDown( SP, Value )
  127. Response.Write("</SELECT>")
  128. }
  129. function BuildSingleValueDropDown(SP, Value, SelectName, FirstValue )
  130. {
  131. Response.Write("<SELECT style='text-size:100%' ID='" + SelectName + "' NAME='" + SelectName + "'>\n" )
  132. if ( String( FirstValue ) != "undefined" )
  133. Response.Write("<OPTION VALUE=" + FirstValue + ">" + FirstValue + "</OPTION>" )
  134. SingleValueDropDown( SP, Value )
  135. Response.Write("</SELECT>")
  136. }
  137. function DropDown(SP, Value)
  138. {
  139. //if ( g_DBConn == null )
  140. //DB_GetConnectionObject( "CRASHDB" )
  141. var g_DBConn = GetDBConnection( Application("SOLUTIONS3") )
  142. //var g_DBConn = GetDBConnection( Application("CRASHDB3") )
  143. try
  144. {
  145. var List = g_DBConn.Execute( SP )
  146. var dbFields = GetRecordsetFields( List )
  147. if ( !List.BOF )
  148. {
  149. while ( !List.EOF )
  150. {
  151. if( String(List(dbFields[1])) != String( "null") )
  152. {
  153. if ( String(List(dbFields[0])) == String( Value ) )
  154. Response.Write ( "<OPTION SELECTED VALUE='" + List(dbFields[0]) + "'>" + List(dbFields[1]) + "</OPTION>\n" )
  155. else
  156. Response.Write ( "<OPTION VALUE='" + List(dbFields[0]) + "'>" + List(dbFields[1]) + "</OPTION>\n" )
  157. }
  158. List.MoveNext()
  159. }
  160. }
  161. }
  162. catch ( err )
  163. {
  164. Response.Write( "</SELECT><BR>" )
  165. Response.Write ("An error occured try to create the drop down list: \n<BR>" )
  166. Response.Write ("Query: " + SP + "<BR>" )
  167. Response.Write( "[" + err.number + "] " + err.description )
  168. }
  169. }
  170. function SingleValueDropDown(SP, Value)
  171. {
  172. if ( g_DBConn == null )
  173. //DB_GetConnectionObject( "CRASHDB" )
  174. DB_GetConnectionObject( "SEP_DB" )
  175. try
  176. {
  177. var List = g_DBConn.Execute( SP )
  178. var dbFields = GetRecordsetFields( List )
  179. if ( !List.BOF )
  180. {
  181. while ( !List.EOF )
  182. {
  183. if( String(List(dbFields[0])) != String( "null") )
  184. {
  185. if ( String(List(dbFields[0])) == String( Value ) )
  186. Response.Write ( "<OPTION SELECTED VALUE='" + List(dbFields[0]) + "'>" + List(dbFields[0]) + "</OPTION>\n" )
  187. else
  188. Response.Write ( "<OPTION VALUE='" + List(dbFields[0]) + "'>" + List(dbFields[0]) + "</OPTION>\n" )
  189. }
  190. List.MoveNext()
  191. }
  192. }
  193. }
  194. catch ( err )
  195. {
  196. Response.Write( "</SELECT><BR>" )
  197. Response.Write ("An error occured try to create the drop down list: \n<BR>" )
  198. Response.Write ("Query: " + SP + "<BR>" )
  199. Response.Write( "[" + err.number + "] " + err.description )
  200. }
  201. }
  202. /*
  203. * GetDefaultTableFormat
  204. * Ok, the syntax is as follows:
  205. * The numbers represent the column order, 1-5 will be displayed in order 1-5
  206. * Column : is hte name of the column from the recordset.
  207. * InnerText : What you want to display it like, use %VALUE% to use the value of this column
  208. * use %1% to use the value from column 1 etc . . . If you want to use values
  209. * from other columsn, you must specify the ReplaceColumn entry
  210. * ReplaceColumn : The column to get data from, use just the number
  211. * NumberOfColumns : is pretty obvious, you must specify the numbered entries exactly thouhg
  212. * TRParams : Anything you want added to the TR tags
  213. * NoHeader : If true, won't display the column name at the top
  214. * IfNone : If the column is null, then display this instead of NONE
  215. * TableParams : Formatting you want on the table tag
  216. * AltColor : Color to use if alternating the table cells, default is white with your color
  217. * MaxRows : Maximum number of rows to display
  218. * THParams : Extra goodies to pu in on the TH line of this column
  219. * GlobalTHParams : TH parameters that are global
  220. *
  221. * eg: "5" : { Column: "Modules", InnerText : "<HREF='http://%1%'>%VALUE%</>", ReplaceColumn : "1" },
  222. * This will print a link with the value of modules from the recordset as the text
  223. * and the value of the #1 column as the href.
  224. */
  225. function GetDefaultTableFormat()
  226. {
  227. var TableFormat = {
  228. TableParams : "CELLSPACING=0 CELLPADDING=0",
  229. GlobalTHParams : "",
  230. NoHeader : false,
  231. AltColor : "white",
  232. MaxRows : 2000,
  233. DisplayRowCount : false,
  234. "1" : { Column: "*"},
  235. "2" : { Column: "" } ,
  236. "3" : { Column: "" },
  237. "4" : { Column: "" },
  238. "5" : { Column: "" },
  239. "6" : { Column: "" },
  240. "7" : { Column: "" },
  241. "8" : { Column: "" },
  242. "9" : { Column: "" },
  243. "10" : { Column: "" },
  244. "11" : { Column: "" },
  245. "12" : { Column: "", InnerText : "", ReplaceColumn : "", TDParams : "", THParams : "", IfNull : "", IfColIDIsNull : "", IFColIDIsNullCode : "" },
  246. NumberOfColumns : 1,
  247. "TRParams" : ""
  248. }
  249. return TableFormat
  250. }
  251. function printTD( str )
  252. {
  253. prints( "<TD>" + str + "</TD>" )
  254. }
  255. function prints( str )
  256. {
  257. Response.Write( str + "\n" )
  258. }
  259. function Trim( )
  260. {
  261. return 1
  262. }
  263. function find( strToFind )
  264. {
  265. try
  266. {
  267. var strToFind = new String( strToFind.toLowerCase() )
  268. for ( var element in this )
  269. {
  270. var CurrentString = new String( this[element] )
  271. CurrentString = CurrentString.toLowerCase()
  272. //if ( String(strToFind).toLowerCase() == String( this[element] ).toLowerCase() )
  273. if ( strToFind == CurrentString )
  274. return true
  275. }
  276. return false
  277. }
  278. catch ( err )
  279. {
  280. Response.Write("Find Failed")
  281. }
  282. }
  283. //add a find method to the Array object.
  284. Array.prototype.find = find
  285. function findRemoveColumn( column )
  286. {
  287. var tmp = new String( this.RemoveColumns )
  288. var tmp = tmp.split( ";" )
  289. for ( var i=0 ; i < tmp.length ; i++ )
  290. {
  291. if ( tmp[i] == column )
  292. return true
  293. }
  294. return false
  295. }
  296. function GetRecordsetFields( rs )
  297. {
  298. var Fields = new Array()
  299. for( var i=0 ; i< rs.fields.count ; i++ )
  300. Fields[i] = rs.fields(i).Name
  301. return Fields
  302. }
  303. function BuildTableFromRecordset( rs, TableFormat )
  304. {
  305. var altColor = TableFormat.AltColor;
  306. var counter = new Number( 0 )
  307. if ( TableFormat["1"].Column=="*" )
  308. {
  309. var rsFields = GetRecordsetFields( rs )
  310. for( var i=1 ; i <= rsFields.length ; i++ )
  311. {
  312. TableFormat[String(i)].Column = rsFields[i-1]
  313. }
  314. TableFormat.NumberOfColumns = i
  315. }
  316. prints( "<TABLE " + TableFormat.TableParams + ">" )
  317. if ( !TableFormat.NoHeader )
  318. {
  319. for( var i=1 ; i < TableFormat.NumberOfColumns ; i++ )
  320. {
  321. var Index = new String(i)
  322. if ( TableFormat[Index].Column == "" )
  323. prints( "<TH " + TableFormat[Index].THParams + " " + TableFormat.GlobalTHParams + "></TH>" )
  324. else
  325. {
  326. if ( typeof( TableFormat[Index].THName) == "undefined" )
  327. prints( "<TH " + TableFormat[Index].THParams + " " + TableFormat.GlobalTHParams + ">" + TableFormat[Index].Column + "</TH>" )
  328. else
  329. prints( "<TH " + TableFormat[Index].THParams + " " + TableFormat.GlobalTHParams + ">" + TableFormat[Index].THName + "</TH>" )
  330. }
  331. }
  332. }
  333. if ( rs.EOF )
  334. prints("<TR><TD COLSPAN=" + TableFormat.NumberOfColumns + "> No records to display </TD></TR>" )
  335. while( !rs.EOF && Number(counter) < Number(TableFormat.MaxRows) )
  336. {
  337. if ( altColor == TableFormat.AltColor )
  338. altColor = "white"
  339. else
  340. altColor = TableFormat.AltColor
  341. if ( typeof(TableFormat["TRParams"].ReplaceColumn) == "undefined" )
  342. prints( "<TR " + TableFormat["TRParams"].Value + ">" )
  343. else
  344. {
  345. prints ( "<TR " + String( ReplaceDataColumn( TableFormat["TRParams"].Value, rs( TableFormat[TableFormat["TRParams"].ReplaceColumn].Column ), TableFormat["TRParams"].ReplaceColumn), "" ) + ">")
  346. }
  347. for( var i=1 ; i < TableFormat.NumberOfColumns ; i++ )
  348. {
  349. var Index=new String(i)
  350. var TDInnerText = new String()
  351. try
  352. {
  353. var rsVal = new String( rs(TableFormat[Index].Column) )
  354. }
  355. catch( err )
  356. {
  357. var rsVal = new String( TableFormat[Index].Column )
  358. }
  359. if ( TableFormat[Index].Column != "" )
  360. {
  361. if ( typeof(TableFormat[Index].TDParams ) != "undefined" )
  362. TDInnerText = "<TD " + TableFormat[Index].TDParams + " BGCOLOR='" + altColor + "'>"
  363. else
  364. TDInnerText = "<TD BGCOLOR='" + altColor + "'>"
  365. if ( rsVal != "null" )
  366. {
  367. if ( typeof( TableFormat[Index].InnerText ) != "undefined" )
  368. {
  369. if ( typeof(TableFormat[Index].ReplaceColumn) != "undefined" )
  370. {
  371. TDInnerText += ReplaceDataColumn( TableFormat[Index].InnerText, rs( TableFormat[TableFormat[Index].ReplaceColumn].Column ), TableFormat[Index].ReplaceColumn, rs(TableFormat[String(i)].Column ) )
  372. }
  373. else
  374. TDInnerText += TableFormat[String(i)].InnerText
  375. }
  376. else
  377. {
  378. TDInnerText +=rs(TableFormat[String(i)].Column)
  379. }
  380. }
  381. else
  382. {
  383. if ( typeof( TableFormat[Index].IfNull ) == "undefined" )
  384. {
  385. TDInnerText += "none"
  386. }
  387. else
  388. {
  389. if ( typeof( TableFormat[Index].IfColIDIsNull ) == "undefined" )
  390. {
  391. if ( typeof(TableFormat[Index].ReplaceColumn) == "undefined" )
  392. TDInnerText += TableFormat[Index].IfNull
  393. else
  394. TDInnerText += String( ReplaceDataColumn(
  395. TableFormat[Index].IfNull,
  396. rs( TableFormat[TableFormat[Index].ReplaceColumn].Column ),
  397. TableFormat[Index].ReplaceColumn,
  398. rs( TableFormat[TableFormat[Index].ReplaceColumn].Column )
  399. ))
  400. }
  401. else
  402. {
  403. var tmp = new String( rs( TableFormat[TableFormat[Index].IfColIDIsNull].Column ))
  404. if ( "null" == tmp )
  405. TDInnerText += TableFormat[Index].IfColIDIsNullCode
  406. else
  407. {
  408. //this chunk of code is the same as above
  409. if ( typeof(TableFormat[Index].ReplaceColumn) == "undefined" )
  410. TDInnerText += TableFormat[Index].IfNull
  411. else
  412. TDInnerText += String( ReplaceDataColumn(
  413. TableFormat[Index].IfNull,
  414. rs( TableFormat[TableFormat[Index].ReplaceColumn].Column ),
  415. TableFormat[Index].ReplaceColumn,
  416. rs( TableFormat[TableFormat[Index].ReplaceColumn].Column )
  417. ))
  418. }
  419. }
  420. }
  421. }
  422. }
  423. else
  424. {
  425. TDInnerText = "<TD>"
  426. }
  427. prints( TDInnerText + "</TD>" )
  428. }
  429. rs.MoveNext()
  430. counter++
  431. prints("</TR>")
  432. }
  433. if ( TableFormat.DisplayRowCount )
  434. Response.Write( "<TR><TD COLSPAN=" + String(Number(TableFormat.NumberOfColumns) - 2 ) + "><HR> Number of Records: " + String(counter) + "<TD></TR>" )
  435. prints("</TABLE>")
  436. }
  437. function ReplaceDataColumn( dest, src, column, orig )
  438. {
  439. var tmp = new String(dest)
  440. var tmp2 = new String(orig)
  441. if ( tmp2.substr(0,7) == "http://" )
  442. {
  443. tmp = "<a href=" + tmp2 + " target=_blank>" + TextBreak(tmp2,35) + "</a>"
  444. return tmp
  445. }
  446. else
  447. {
  448. var regexp=new RegExp( "%" + String(column) + "%" , "g" )
  449. var regexp2=new RegExp( "%VALUE%" , "g" )
  450. tmp = tmp.replace( regexp, Server.URLEncode(String(src)) )
  451. tmp = tmp.replace( regexp2, TextBreak(orig,40) )
  452. }
  453. return tmp
  454. }
  455. function TextBreak( aStrParam, aLength )
  456. {
  457. var curPos = 0
  458. var retval = new String("")
  459. var aStr = new String(aStrParam)
  460. if ( aStr.length < aLength )
  461. retval = aStr
  462. else
  463. while ( curPos < aStr.length )
  464. {
  465. retval += aStr.substr( curPos, aLength ) + "<br>"
  466. curPos += aLength
  467. }
  468. return retval
  469. }
  470. function BuildTableFromRecordset2( rs, TableFormat )
  471. {
  472. prints( "<TABLE " + TableFormat.TableParams + ">" )
  473. if ( !TableFormat.NoHeader )
  474. {
  475. //first dump all the fields into a TH
  476. for( var i = 0 ; i < rs.fields.count ; i++ )
  477. {
  478. if ( TableFormat[rs.fields(i).Name] )
  479. {
  480. if( !TableFormat[rs.fields(i).Name].Remove )
  481. {
  482. if ( typeof( TableFormat[rs.fields(i).Name].InnerText) != "undefined" )
  483. prints ( "<TH>" + TableFormat[rs.fields(i).Name].InnerText + "</TH>" )
  484. else
  485. prints ( "<TH>" + rs.fields(i).Name + "</TH>" )
  486. }
  487. }
  488. else
  489. prints ( "<TH>" + rs.fields(i).Name + "</TH>" )
  490. }
  491. }
  492. while( !rs.EOF )
  493. {
  494. prints( "<TR " + TableFormat["TRParams"] + ">" )
  495. for( var i=0 ; i < rs.fields.count ; i++ )
  496. {
  497. if ( TableFormat[rs.fields(i).Name] )
  498. {
  499. if( !TableFormat[rs.fields(i).Name].Remove )
  500. if ( typeof( TableFormat[rs.fields(i).Name].InnerText) != "undefined" )
  501. prints( "<TD " + TableFormat[rs.fields(i).Name]["TDParams"] + ">" + TableFormat[rs.fields(i).Name].InnerText + "</TD>" )
  502. else
  503. prints( "<TD " + TableFormat[rs.fields(i).Name]["TDParams"] + ">" + rs.fields(i).Value + "</TD>" )
  504. }
  505. else
  506. prints( "<TD>" + rs.fields(i).Value + "</TD>" )
  507. }
  508. rs.MoveNext()
  509. prints("</TR>" )
  510. }
  511. prints( "</TABLE>" )
  512. }
  513. function CreateClauseTable()
  514. {
  515. var sI
  516. var Field
  517. var sField //submitted field name, requested from the form post
  518. var FieldSelected //the selected field
  519. var sConjunction
  520. var display
  521. var sCompare
  522. var op
  523. var sValue
  524. for ( var i=1 ; i < 9 ; i++ )
  525. {
  526. //sField=Request("sField" & sI )
  527. //sCompare=Request("sCompare" & sI )
  528. //sValue=Request("tbSearchValue" & sI )
  529. //sConjunction=Request("sConjunction" & sI )
  530. //if sField <> "" then Display="Block" else Display="none"
  531. var Display="none"
  532. sI = new String(i)
  533. Response.Write( " <TABLE Class=Plain BORDER=0 ID=tDivClause" + sI + " NAME=tDivClause" + sI + " STYLE='text-decoration:none;display:" + Display + "'>" + "\n" )
  534. Response.Write( " <TR BORDER=0>" + "\n" )
  535. Response.Write( " <TD class=Plain>" + "\n" )
  536. Response.Write( " <SELECT STYLE='width:70px' NAME=sConjunction" + sI + " >" + "\n" )
  537. if ( sConjunction == "AND" || sConjunction=="" )
  538. {
  539. Response.Write( " <OPTION VALUE='AND' SELECTED >AND</OPTION>" + "\n" )
  540. Response.Write( " <OPTION VALUE='OR'>OR</OPTION>" + "\n" )
  541. } else {
  542. Response.Write( " <OPTION VALUE='AND' >AND</OPTION>" + "\n" )
  543. Response.Write( " <OPTION VALUE='OR' SELECTED>OR</OPTION>" + "\n" )
  544. }
  545. Response.Write( " </SELECT>" + "\n" )
  546. Response.Write( " </TD>" + "\n" )
  547. Response.Write( " <TD class=Plain>" + "\n" )
  548. Response.Write( " <SELECT STYLE='width:175px' NAME=sField" + sI + " onChange='FillInCompareField(" + sI + ", this)'>" + "\n" )
  549. Response.Write( " <OPTION VALUE='' ></OPTION>" + "\n" )
  550. for ( Field in SearchFields )
  551. {
  552. FieldSelected=""
  553. //if sField <> "" and g_AdvFields( Field )("Value") = sField then FieldSelected=" SELECTED "
  554. //Response.Write( "<OPTION VALUE='" + g_AdvFields( Field )("Value") + "' " + FieldSelected + ">" + g_AdvFields( Field )("Text") + "</OPTION>" + "\n" )
  555. Response.Write( "<OPTION VALUE='" + SearchFields[Field].Value + "' " + FieldSelected + ">" + SearchFields[Field].Text + "</OPTION>" + "\n" )
  556. }
  557. Response.Write( " </SELECT>" + "\n" )
  558. Response.Write( " </TD>" + "\n" )
  559. Response.Write( " <TD class=plain>" + "\n" )
  560. Response.Write( " <SELECT STYLE='width:175px' NAME=sCompare" + sI + " OnClick='ClearValueTB(" + sI + ")' OnChange='ValidateCompare( " + sI + ", this.value )'>" + "\n" )
  561. if ( sCompare != "" )
  562. {
  563. for ( Op in CompareOperators )
  564. {
  565. FieldSelected=""
  566. //if( sCompare != "" && sCompare == Operators(op) )
  567. //FieldSelected=" SELECTED "
  568. Response.Write( "<OPTION VALUE='" + CompareOperators[Op].Sign + "' " + FieldSelected + ">" + CompareOperators[Op].Text + "</OPTION>" + "\n" )
  569. }
  570. }
  571. Response.Write( " </SELECT>" + "\n" )
  572. Response.Write( " </TD>" + "\n" )
  573. Response.Write( " <TD Class=Plain>" + "\n" )
  574. //if ( sValue != "" )
  575. //Response.Write( " <INPUT STYLE='width:175px;visibility:visible' TYPE=TextBox NAME='tbSearchValue" + sI + "' VALUE='" + sValue + "'>" + "\n" )
  576. //else
  577. Response.Write( " <INPUT STYLE='width:175px;visibility:visible' TYPE=TextBox NAME='tbSearchValue" + sI + "'>" + "\n" )
  578. Response.Write( " </TD>" + "\n" )
  579. Response.Write( " <TD Class=Plain>" + "\n" )
  580. Response.Write( " <INPUT TYPE=Button VALUE='Remove Clause' NAME=btnRemoveClause" + sI + " OnClick='RemoveClause(" + sI + ")' >" + "\n" )
  581. Response.Write( " </TD>" + "\n" )
  582. Response.Write( " </TR>" + "\n" )
  583. Response.Write( " </TABLE>" + "\n" )
  584. }
  585. }
  586. function BuildBucketTable( Query, PageSize, Sortable )
  587. {
  588. if ( PageSize == "undefined" || isNaN( PageSize ) )
  589. PageSize=25
  590. try
  591. {
  592. var rsRecordSet = g_DBConn.Execute( Query )
  593. }
  594. catch ( err )
  595. {
  596. Response.Write("Could not get get recordset (BuildBucketTable(...):<BR>")
  597. Response.Write( "Query: " + Query + "<BR>" )
  598. Response.Write( "[" + err.number + "] " + err.description )
  599. Response.End
  600. }
  601. try
  602. {
  603. var TableFormat = GetDefaultTableFormat()
  604. TableFormat.MaxRows=PageSize
  605. TableFormat.DisplayRowCount = true
  606. TableFormat.TableParams = " CELLSPACING=0 CELLPADDING=0 WIDTH=100% NAME=BucketTable ID=BucketTable "
  607. TableFormat["1"].ReplaceColumn = "2"
  608. TableFormat["1"].InnerText = "<IMG SRC='images/ButtonViewBucket.bmp' ALT='Bucket ID %VALUE%' onMouseOut=\"style.cursor='default';\" onMouseOver=\"style.cursor='hand';\" Onclick=\"javascript:window.navigate(\'DBGPortal_ViewBucket.asp?BucketID=%2%')\">"
  609. TableFormat["2"].ReplaceColumn = "2"
  610. TableFormat["2"].InnerText = "<A HREF='DBGPortal_ViewBucket.asp?BucketID=%2%' >%VALUE%"
  611. TableFormat["3"].TDParams="ALIGN=Center"
  612. TableFormat["3"].ReplaceColumn = "3"
  613. TableFormat["3"].InnerText = "<A HREF='DBGPortal_DisplayQuery.asp?SP=DBGP_GetBucketsByAlias&Param1=All&Param2=All&Param3=CrashCount&Param4=DESC&Param5=%VALUE%' >%VALUE%</A>"
  614. //SP=DBGP_GetBucketsBySpecificBuildNumber&Platform=2600&QueryType=1
  615. TableFormat["5"].ReplaceColumn = "5"
  616. TableFormat["5"].InnerText = "<A HREF='#RightHere' OnClick='OpenBug( %VALUE% )'>%VALUE%</A>"
  617. TableFormat["4"].TDParams="ALIGN=Center"
  618. if ( Sortable != false )
  619. {
  620. TableFormat["1"].THParams = "OnClick=\"SortColumn( 'iBucket')\" OnMouseOver=\"this.style.backgroundColor='#0099ff'\" OnMouseOut=\"this.style.backgroundColor='#eeeeee'\" "
  621. TableFormat["2"].THParams = "OnClick=\"SortColumn( 'BucketID')\" OnMouseOver=\"this.style.backgroundColor='#0099ff'\" OnMouseOut=\"this.style.backgroundColor='#eeeeee'\" "
  622. TableFormat["3"].THParams = "OnClick=\"SortColumn( 'FollowUp')\" OnMouseOver=\"this.style.backgroundColor='#0099ff'\" OnMouseOut=\"this.style.backgroundColor='#eeeeee'\" "
  623. TableFormat["4"].THParams = "OnClick=\"SortColumn( 'CrashCount')\" OnMouseOver=\"this.style.backgroundColor='#0099ff'\" OnMouseOut=\"this.style.backgroundColor='#eeeeee'\" "
  624. TableFormat["5"].THParams = "OnClick=\"SortColumn( 'BugID')\" OnMouseOver=\"this.style.backgroundColor='#0099ff'\" OnMouseOut=\"this.style.backgroundColor='#eeeeee'\" "
  625. TableFormat["6"].THParams = "OnClick=\"SortColumn( 'SolutionID')\" OnMouseOver=\"this.style.backgroundColor='#0099ff'\" OnMouseOut=\"this.style.backgroundColor='#eeeeee'\" "
  626. }
  627. BuildTableFromRecordset( rsRecordSet, TableFormat )
  628. }
  629. catch ( err )
  630. {
  631. Response.Write("Could not build table from recordset (BuildBucketTable(...):<BR>")
  632. Response.Write( "Query: " + Query + "<BR>" )
  633. Response.Write( "[" + err.number + "] " + err.description )
  634. Response.End
  635. }
  636. }
  637. function BuildTableFromRecord( rs, TableFormat )
  638. {
  639. var altColor = TableFormat.AltColor;
  640. if ( TableFormat["1"].Column=="*" )
  641. {
  642. var rsFields = GetRecordsetFields( rs )
  643. for( var i=1 ; i <= rsFields.length ; i++ )
  644. {
  645. TableFormat[String(i)].Column = rsFields[i-1]
  646. }
  647. TableFormat.NumberOfColumns = i
  648. }
  649. prints( "<TABLE " + TableFormat.TableParams + ">" )
  650. if ( !TableFormat.NoHeader )
  651. {
  652. for( var i=1 ; i < TableFormat.NumberOfColumns ; i++ )
  653. {
  654. var Index = new String(i)
  655. if ( TableFormat[Index].Column == "" )
  656. prints( "<TH></TH>" )
  657. else
  658. {
  659. if ( typeof( TableFormat[Index].THName) == "undefined" )
  660. prints( "<TH>" + TableFormat[Index].Column + "</TH>" )
  661. else
  662. prints( "<TH>" + TableFormat[Index].THName + "</TH>" )
  663. }
  664. }
  665. }
  666. if ( rs.EOF )
  667. prints("<TR><TD COLSPAN=" + TableFormat.NumberOfColumns + "> No records to display </TD></TR>" )
  668. //while( !rs.EOF )
  669. {
  670. if ( altColor == TableFormat.AltColor )
  671. altColor = "white"
  672. else
  673. altColor = TableFormat.AltColor
  674. if ( typeof(TableFormat["TRParams"].ReplaceColumn) == "undefined" )
  675. prints( "<TR " + TableFormat["TRParams"].Value + ">" )
  676. else
  677. {
  678. prints ( "<TR " + String( ReplaceDataColumn( TableFormat["TRParams"].Value, rs( TableFormat[TableFormat["TRParams"].ReplaceColumn].Column ), TableFormat["TRParams"].ReplaceColumn), "" ) + ">")
  679. }
  680. for( var i=1 ; i < TableFormat.NumberOfColumns ; i++ )
  681. {
  682. var Index=new String(i)
  683. var TDInnerText = new String()
  684. var rsVal = new String( rs(TableFormat[Index].Column) )
  685. if ( TableFormat[Index].Column != "" )
  686. {
  687. if ( typeof(TableFormat[Index].TDParams ) != "undefined" )
  688. TDInnerText = "<TD " + TableFormat[Index].TDParams + " BGCOLOR='" + altColor + "'>"
  689. else
  690. TDInnerText = "<TD BGCOLOR='" + altColor + "'>"
  691. if ( rsVal != "null" )
  692. {
  693. if ( typeof( TableFormat[Index].InnerText ) != "undefined" )
  694. {
  695. if ( typeof(TableFormat[Index].ReplaceColumn) != "undefined" )
  696. {
  697. TDInnerText += ReplaceDataColumn( TableFormat[Index].InnerText, rs( TableFormat[TableFormat[Index].ReplaceColumn].Column ), TableFormat[Index].ReplaceColumn, rs(TableFormat[String(i)].Column ) )
  698. }
  699. else
  700. TDInnerText += TableFormat[String(i)].InnerText
  701. }
  702. else
  703. {
  704. TDInnerText +=rs(TableFormat[String(i)].Column)
  705. }
  706. }
  707. else
  708. {
  709. TDInnerText += "none"
  710. }
  711. }
  712. else
  713. {
  714. TDInnerText = "<TD>"
  715. }
  716. prints( TDInnerText + "</TD>" )
  717. }
  718. //rs.MoveNext()
  719. prints("</TR>")
  720. }
  721. prints("</TABLE>")
  722. }
  723. function CreateClauseTable2( SearchFields, CompareOperators, TableName )
  724. {
  725. var sI
  726. var Field
  727. var sField //submitted field name, requested from the form post
  728. var FieldSelected //the selected field
  729. var sConjunction
  730. var display
  731. var sCompare
  732. var op
  733. var sValue
  734. for ( var i=1 ; i < 9 ; i++ )
  735. {
  736. var Display="none"
  737. sI = new String(i)
  738. Response.Write( " <TABLE border='0' class='clsTableInfoPlain' ID=" + TableName + sI + " NAME=" + TableName + sI + " STYLE='display:" + Display + "'>" + "\n" )
  739. Response.Write( " <TR>" + "\n" )
  740. Response.Write( " <TD class='sys-table-cell-bgcolor1' nowrap style='width:100px'>" + "\n" )
  741. Response.Write( " <SELECT class='clsSEPSelect2' style='width:75px' NAME=" + TableName + "sConjunction" + sI + " >" + "\n" )
  742. if ( sConjunction == "AND" || sConjunction=="" )
  743. {
  744. Response.Write( " <OPTION VALUE='AND' SELECTED >AND</OPTION>" + "\n" )
  745. Response.Write( " <OPTION VALUE='OR'>OR</OPTION>" + "\n" )
  746. } else {
  747. Response.Write( " <OPTION VALUE='AND' >AND</OPTION>" + "\n" )
  748. Response.Write( " <OPTION VALUE='OR' SELECTED>OR</OPTION>" + "\n" )
  749. }
  750. Response.Write( " </SELECT>" + "\n" )
  751. Response.Write( " </TD>" + "\n" )
  752. Response.Write( " <TD class='sys-table-cell-bgcolor1' nowrap style='width:175px'>" + "\n" )
  753. Response.Write( " <SELECT style='width:160px' class='clsSEPSelect2' NAME=" + TableName + "sField" + sI + " onChange=\"FillInCompareField('" + TableName + "'," + sI + ", this)\">" + "\n" )
  754. Response.Write( " <OPTION VALUE='' ></OPTION>" + "\n" )
  755. for ( Field in SearchFields )
  756. {
  757. FieldSelected=""
  758. Response.Write( "<OPTION VALUE='" + SearchFields[Field].Value + "' " + FieldSelected + ">" + SearchFields[Field].Text + "</OPTION>" + "\n" )
  759. }
  760. Response.Write( " </SELECT>" + "\n" )
  761. Response.Write( " </TD>" + "\n" )
  762. Response.Write( " <TD class='sys-table-cell-bgcolor1' nowrap style='width:175px'>" + "\n" )
  763. Response.Write( " <SELECT class='clsSEPSelect2' style='width:160px' NAME=" + TableName + "sCompare" + sI + " OnChange=\"ValidateCompare( '" + TableName + "'," + sI + ", this.value )\">" + "\n" )
  764. if ( sCompare != "" )
  765. {
  766. for ( Op in CompareOperators )
  767. {
  768. FieldSelected=""
  769. Response.Write( "<OPTION VALUE='" + CompareOperators[Op].Sign + "' " + FieldSelected + ">" + CompareOperators[Op].Text + "</OPTION>" + "\n" )
  770. }
  771. }
  772. Response.Write( " </SELECT>" + "\n" )
  773. Response.Write( " </TD>" + "\n" )
  774. Response.Write( " <TD nowrap style='width:175px' >" + "\n" )
  775. Response.Write( " <INPUT STYLE='width:165px;visibility:visible' OnChange=\"VerifySearchData( '" + TableName + "', this.value, " + sI + " )\" TYPE=TextBox NAME='" + TableName + "tbSearchValue" + sI + "'>" + "\n" )
  776. Response.Write( " </TD>" + "\n" )
  777. Response.Write( " <TD nowrap style='width:175px'>" + "\n" )
  778. Response.Write( " <INPUT class='clsButton' TYPE=Button VALUE='Remove' NAME=" + TableName + "btnRemoveClause" + sI + " OnClick=\"RemoveClause('" + TableName + "'," + sI + ")\" >" + "\n" )
  779. Response.Write( " </TD>" + "\n" )
  780. Response.Write( " </TR>" + "\n" )
  781. Response.Write( " </TABLE>" + "\n" )
  782. }
  783. }
  784. function BuildPageJump( TotalPages, PageSpace, SubmitForm )
  785. {
  786. Response.Write( "Jump to page: " )
  787. var PageIncrement = parseInt ( TotalPages / 18, 10 )
  788. if ( Number(PageIncrement) == 0 ) PageIncrement=1
  789. for ( var i=1 ; i< TotalPages ; i+= PageIncrement )
  790. Response.Write("<A HREF=\"javascript:document.all.Page.value=" + i + ";" + SubmitForm + ".submit()\">" + i + "</A>&nbsp&nbsp\n" )
  791. //Response.Write("<A HREF=\"javascript:document.all.Page.value=" + i + ";frmPageCrashes.submit()\">" + i + "</A>&nbsp&nbsp\n" )
  792. }
  793. function DisplayError( err, msg )
  794. {
  795. Prints( "<TABLE CELLSPACING=0 Class=ContentArea><TR><TD>" )
  796. Prints( "<H2>An error has occured:</H2>" )
  797. Prints( "Please notify the <A href='mailto:[email protected];[email protected]'>Debug Portal Team</A><BR>" )
  798. Prints( "please also paste the error message into the mail. Thank you.<BR>" )
  799. if ( String( msg ) != "undefined" )
  800. {
  801. Response.Write( msg + "<BR>\n" )
  802. }
  803. if ( err != null )
  804. {
  805. Response.Write( "[" + err.number + "] " + err.description + "<BR>")
  806. if ( DebugBuild )
  807. throw( err )
  808. }
  809. Response.Write("Page: " + Request.ServerVariables("SCRIPT_NAME") + "<BR>" )
  810. Response.Write("<BR><a HREF='javascript:history.back()'>Back</a><BR>\n" )
  811. Prints( "</TD></TR></TABLE>" )
  812. }
  813. function Prints( text )
  814. {
  815. Response.Write( text + "\n" )
  816. }
  817. function LinkSolutionToBucket( SolutionID, BucketID, iBucket, BucketType )
  818. {
  819. var g_DBConn = GetDBConnection( Application("SOLUTIONS3" ) )
  820. Query = "SEP_SetSolvedBucket '" + BucketID + "'," + SolutionID + "," + BucketType
  821. try
  822. {
  823. g_DBConn.Execute( Query )
  824. }
  825. catch ( err )
  826. {
  827. Response.Write ("Could not execute query SEP_SetSolvedBucket(...)" )
  828. Response.Write( "Query: " + Query + "<BR>" )
  829. Response.Write( "[" + err.number + "] " + err.description )
  830. throw( err )
  831. Response.End
  832. }
  833. try
  834. {
  835. var g_DBConn = GetDBConnection( Application("CRASHDB3") )
  836. Query = "DBGPortal_UpdateStaticDataSolutionID '" + BucketID + "'," + SolutionID
  837. g_DBConn.Execute( Query )
  838. }
  839. catch ( err )
  840. {
  841. Response.Write ("Could not execute query DBGP_UpdateStaticDataSolutionID(...)" )
  842. Response.Write( "Query: " + Query + "<BR>" )
  843. Response.Write( "[" + err.number + "] " + err.description )
  844. throw ( err )
  845. Response.End
  846. }
  847. try
  848. {
  849. //DB_GetConnectionObject( "CRASHDB" )
  850. Query = "DBGPortal_SetComment '" + GetShortUserAlias() + "', 9, 'Solution linked by " + GetShortUserAlias() + "','" + BucketID + "'," + iBucket
  851. g_DBConn.Execute( Query )
  852. //Response.Write("Attempting to Change comment: " + Query + "<BR>")
  853. }
  854. catch ( err )
  855. {
  856. Response.Write ("Could not execute query DBGP_SetComment(...). <BR> The solution queue/comment could not be updated for this bucket.<BR><BR>" )
  857. Response.Write( "Query: " + Query + "<BR>" )
  858. Response.Write( "[" + err.number + "] " + err.description )
  859. Response.End
  860. }
  861. try
  862. {
  863. Query = "DBGPortal_SetResponseStatus '" + GetShortUserAlias() + "', 1,'" + BucketID + "'"
  864. g_DBConn.Execute( Query )
  865. }
  866. catch ( err )
  867. {
  868. Response.Write ("Could not execute query DBGP_SetComment(...). <BR> The solution queue/comment could not be updated for this bucket.<BR><BR>" )
  869. Response.Write( "Query: " + Query + "<BR>" )
  870. Response.Write( "[" + err.number + "] " + err.description )
  871. Response.End
  872. }
  873. }
  874. function BuildQuickQuery()
  875. {
  876. %>
  877. Currently viewing
  878. <SELECT NAME=PageSize>
  879. <OPTION VALUE=10 <% if ( PageSize == "10" ) Response.Write("SELECTED")%>>10</OPTION>
  880. <OPTION VALUE=25 <% if ( PageSize == "25" ) Response.Write("SELECTED")%>>25</OPTION>
  881. <OPTION VALUE=50 <% if ( PageSize == "50" ) Response.Write("SELECTED")%>>50</OPTION>
  882. <OPTION VALUE=100 <% if ( PageSize == "100" ) Response.Write("SELECTED")%>>100</OPTION>
  883. <OPTION VALUE=500 <% if ( PageSize == "500" ) Response.Write("SELECTED")%>>500</OPTION>
  884. </SELECT>
  885. buckets per page that are
  886. <SELECT NAME=Param1>
  887. <OPTION VALUE="Solved" <% if ( Param1 == "Solved" ) Response.Write("SELECTED")%>>Solved</OPTION>
  888. <OPTION VALUE="UnSolved" <% if ( Param1 == "UnSolved" ) Response.Write("SELECTED")%>>UnSolved</OPTION>
  889. <OPTION VALUE="All" <% if ( Param1 == "All" ) Response.Write("SELECTED")%>>solved or not solved</OPTION>
  890. </SELECT>
  891. and have
  892. <SELECT NAME=Param2>
  893. <OPTION VALUE="Raided" <% if ( Param2 == "Raided" ) Response.Write("SELECTED")%>>RAID bugs</OPTION>
  894. <OPTION VALUE="NotRaided" <% if ( Param2 == "NotRaided" ) Response.Write("SELECTED")%>>no RAID bug</OPTION>
  895. <OPTION VALUE="All" <% if ( Param2 == "All" ) Response.Write("SELECTED")%>>a RAID bug or not</OPTION>
  896. </SELECT>
  897. <%
  898. if ( Param5 != "undefined" & Param5 != "" )
  899. {
  900. if ( Param5 != "none" )
  901. Response.Write("and are assigned to")
  902. %>
  903. <SELECT NAME=Param5 <%if ( Param5 == 'none') Response.Write("STYLE='display:none'")%> >
  904. <OPTION VALUE="<%=Param5%>" SELECTED><%=Param5%></OPTION>
  905. <OPTION VALUE="">anyone</OPTION>
  906. </SELECT>
  907. <%
  908. }
  909. else
  910. {
  911. //Response.Write( "<INPUT TYPE=HIDDEN NAME=SP VALUE='" + StoredProc + "'>" )
  912. //Response.Write( "<INPUT TYPE=HIDDEN NAME=Param5 VALUE='" + Param5 + "'>" )
  913. }
  914. if ( Param6 != "undefined" & Param6 != "" & Param6 != 0 )
  915. {
  916. %>
  917. for the last
  918. <SELECT NAME=Param6>
  919. <OPTION VALUE=0>anytime</OPTION>
  920. <OPTION VALUE=2 <% if ( Param6 == "2" ) Response.Write("SELECTED")%> >2</OPTION>
  921. <OPTION VALUE=7 <% if ( Param6 == "7" ) Response.Write("SELECTED")%> >7</OPTION>
  922. <OPTION VALUE=14 <% if ( Param6 == "14" ) Response.Write("SELECTED")%> >14</OPTION>
  923. </SELECT>
  924. days.
  925. <%
  926. }
  927. %>
  928. &nbsp&nbsp&nbsp|&nbsp&nbsp&nbsp
  929. <INPUT TYPE=SUBMIT OnClick="document.all.Page.value=1;document.all.TotalRows.value=0" VALUE="Apply Changes" id=SUBMIT1 name=SUBMIT1>
  930. <%
  931. }
  932. function BuildRSNavigationButtons()
  933. {
  934. %>
  935. <td COLSPAN=3>
  936. <INPUT TYPE=HIDDEN NAME=Page VALUE="<%=Page%>">
  937. <!--<INPUT TYPE=HIDDEN NAME=PageSize VALUE="<%=PageSize%>"> -->
  938. <!--<INPUT TYPE=HIDDEN NAME=Param1 VALUE="<%=Param1%>">-->
  939. <!--<INPUT TYPE=HIDDEN NAME=Param2 VALUE="<%=Param2%>">-->
  940. <INPUT TYPE=HIDDEN NAME=Param3 VALUE="<%=Param3%>">
  941. <INPUT TYPE=HIDDEN NAME=Param4 VALUE="<%=Param4%>">
  942. <INPUT TYPE=HIDDEN NAME=Param7 VALUE="<%=Param7%>">
  943. <!-- <INPUT TYPE=HIDDEN NAME=Param6 VALUE="<%=Param6%>"> -->
  944. <INPUT TYPE=HIDDEN NAME=TotalRows VALUE="<%=TotalRows%>">
  945. <INPUT TYPE=HIDDEN NAME=SP VALUE='<%=StoredProc%>'>
  946. <INPUT TYPE=HIDDEN NAME=NoFormat VALUE='<%=NoFormat%>'>
  947. <!--<INPUT TYPE=HIDDEN NAME=Param5 VALUE="<%=Param5%>">-->
  948. <CENTER>
  949. Total Records: <%=TotalRows%>
  950. <BR>
  951. <img ID="DblBackButton" SRC="images/dblBackArrow.jpg" OnClick="MovePage( -9999 )" onMouseOut="style.cursor='default';" onMouseOver="style.cursor='hand';" WIDTH="25" HEIGHT="16" ALT="Move to first page.">
  952. <img ID="BackButtonStop" SRC="images/BackArrowStop.bmp" OnClick="MovePage(-10)" onMouseOut="style.cursor='default';" onMouseOver="style.cursor='hand';" WIDTH="20" HEIGHT="16" ALT="Move 10 Pages back.">
  953. <img ID="BackButton" SRC="images/BackArrow.jpg" OnClick="MovePage(-1)" onMouseOut="style.cursor='default';" onMouseOver="style.cursor='hand';" WIDTH="13" HEIGHT="16" ALT="Move 1 page back.">
  954. Page <%=Page%> of <%=TotalPages%>
  955. <img ID="FwdButton" SRC="images/fwdArrow.jpg" OnClick="MovePage( 1 )" onMouseOut="style.cursor='default';" onMouseOver="style.cursor='hand';" WIDTH="13" HEIGHT="16" ALT="Move 1 page forward.">
  956. <img ID="FwdButtonStop" SRC="images/fwdArrowStop.bmp" OnClick="MovePage( 10 )" onMouseOut="style.cursor='default';" onMouseOver="style.cursor='hand';" WIDTH="20" HEIGHT="16" ALT="Move 10 pages forward.">
  957. <img ID="DblFwdButton" SRC="images/dblFwdArrow.jpg" OnClick="MovePage(<%=TotalPages%>)" onMouseOut="style.cursor='default';" onMouseOver="style.cursor='hand';" WIDTH="25" HEIGHT="16" ALT="Move to last page.">
  958. </CENTER>
  959. </TD>
  960. <%
  961. }
  962. %>
  963. <%
  964. function fnBuildRSResults( rsResults, iMode )
  965. {
  966. //iMode is whether or not it is kernel or user
  967. // an iMode of 1 is user mode
  968. // an iMode of 0 is kernel mode.
  969. if( typeof( iMode ) == "undefined" )
  970. iMode = 0
  971. var Fields = GetRecordsetFields( rsResults )
  972. var DisplayedFieldValue //use this if you want to change an item column heading
  973. Response.Write( "<tr>" )
  974. for ( var i = 0 ; i < Fields.length; i++ )
  975. {
  976. switch( Fields[i] )
  977. {
  978. case "SolutionID":
  979. DisplayedFieldValue = "Response ID"
  980. break;
  981. case "CrashCount":
  982. DisplayedFieldValue = "Crash Count"
  983. break;
  984. case "iIndex":
  985. DisplayedFieldValue = ""
  986. break;
  987. case "bHasFullDump":
  988. DisplayedFieldValue = "FD"
  989. break;
  990. case "ResponseType":
  991. DisplayedFieldValue = "Type"
  992. break;
  993. case "QueueIndex":
  994. DisplayedFieldValue = "&nbsp;"
  995. break;
  996. case "RequestedBy":
  997. DisplayedFieldValue = "By"
  998. break;
  999. case "BuildNo":
  1000. Response.Write( "<td style='border-left:white 1px solid' align='left' nowrap class='clsTDInfo'>Build</td>" )
  1001. DisplayedFieldValue = "SP"
  1002. break;
  1003. default:
  1004. DisplayedFieldValue = Fields[i]
  1005. }
  1006. if ( DisplayedFieldValue != "" )
  1007. {
  1008. if ( i == 0 )
  1009. Response.Write( "<td align='left' class='clsTDInfo'>" + DisplayedFieldValue + "</td>" )
  1010. else
  1011. Response.Write( "<td style='border-left:white 1px solid' align='left' class='clsTDInfo'>" + DisplayedFieldValue + "</td>" )
  1012. }
  1013. }
  1014. Response.Write( "</tr>" )
  1015. //try
  1016. //{
  1017. var altColor = "sys-table-cell-bgcolor2"
  1018. if ( rsResults.EOF )
  1019. {
  1020. Response.Write("<tr><td colspan='" + Fields.length + "' class='sys-table-cell-bgcolor1'>There are no Buckets that fit the selected criteria.</td></tr>\n" )
  1021. }
  1022. while ( !rsResults.EOF )
  1023. {
  1024. if ( altColor == "sys-table-cell-bgcolor1" )
  1025. altColor = "sys-table-cell-bgcolor2"
  1026. else
  1027. altColor = "sys-table-cell-bgcolor1"
  1028. Response.Write("<tr>\n")
  1029. for ( var i = 0 ; i < Fields.length ; i++ )
  1030. {
  1031. switch ( Fields[i] )
  1032. {
  1033. case "CrashTotal":
  1034. Response.Write("<td class='" + altColor + "'>" + rsResults("CrashTotal") + "</td>\n" )
  1035. break;
  1036. case "DriverName":
  1037. Response.Write("<td class='" + altColor + "'><a class='clsALinkNormal' href='dbgportal_displayquery.asp?SP=DBGPortal_GetBucketsByDriverName&Param0=" + rsResults("DriverName") + "&FrameID=" + Request.QueryString("FrameID" ) + "'>" + rsResults("DriverName") + "</a></td>\n" )
  1038. break;
  1039. case "FilePath":
  1040. Response.Write("<td class='" + altColor + "'><a class='clsALinkNormal' href='dbgportal_displayquery.asp?SP=DBGPortal_GetBucketsByDriverName&Param0=" + rsResults("FilePath") + "'>" + rsResults("FilePath") + "</a></td>\n" )
  1041. break;
  1042. case "BucketID":
  1043. Response.Write("<td class='" + altColor + "'><a class='clsALinkNormal' href=\"DBGPortal_ViewBucket.asp?BucketID=" + Server.URLEncode( rsResults("BucketID") ) + "&FrameID=" + Request.QueryString("FrameID" ) + "\">" + rsResults("BucketID") + "</a></td>\n" )
  1044. break;
  1045. case "bHasFullDump":
  1046. if ( rsResults("bHasFullDump") == "1" )
  1047. Response.Write("<td class='" + altColor + "'>Yes</td>\n" )
  1048. else
  1049. Response.Write("<td class='" + altColor + "'>&nbsp;</td>" )
  1050. break;
  1051. case "FollowUp":
  1052. case "FollowUP":
  1053. Response.Write("<td class='" + altColor + "'><a class='clsALinkNormal' href=\"DBGPortal_Main.asp?SP=DBGPortal_GetBucketsByAlias&Page=0&Alias=" + rsResults("FollowUp") + "&FrameID=" + Request.QueryString("FrameID" ) + "\">" + rsResults("FollowUp") + "</a></td>\n" )
  1054. break;
  1055. case "iBucket":
  1056. Response.Write("<td class='" + altColor + "'><a class='clsALinkNormal' href=\"http://watson/ViewBucket.aspx?Database=4&iBucket=" + rsResults("iBucket") + "\" target=_blank>" + rsResults("iBucket") + "</a></td>" )
  1057. break;
  1058. case "BugID":
  1059. if ( String(rsResults("BugID" )).toString() != "null" )
  1060. {
  1061. if( iMode == 0 )
  1062. Response.Write( "<td class='" + altColor + "'><a class='clsALinkNormal' href=\"javascript:fnShowBug(" + rsResults("BugID") + ",'" + Server.URLEncode( rsResults("BucketID") ) + "')\">" + rsResults("BugID") + "</a></td>\n" )
  1063. else
  1064. Response.Write( "<td class='" + altColor + "'><a class='clsALinkNormal' href=\"javascript:fnShowBug(" + rsResults("BugID") + ",'OCA Debug Portal')\">" + rsResults("BugID") + "</a></td>\n" )
  1065. }
  1066. else
  1067. Response.Write("<td class='" + altColor + "'>None</td>\n" )
  1068. break;
  1069. case "BuildNo":
  1070. var BuildNumber = new String( rsResults("BuildNo" ) )
  1071. var SP = BuildNumber.substr( 4, 4 )
  1072. var BuildNumber = BuildNumber.substr( 0, 4 )
  1073. Response.Write("<td valign='center' nowrap class='" + altColor + "'>" + BuildNumber + "</td>")
  1074. Response.Write("<td valign='center' nowrap class='" + altColor + "'>" + SP + "</td>")
  1075. break;
  1076. case "SolutionID":
  1077. if ( String(rsResults("SolutionID" )).toString() != "null" )
  1078. Response.Write("<td class='" + altColor + "'><a class='clsALinkNormal' href='#none' onclick=\"window.open('http://oca.microsoft.com/en/Response.asp?SID=" + rsResults("SolutionID") + "')\">" + rsResults("SolutionID") + "</a></td>\n" )
  1079. else
  1080. Response.Write("<td class='" + altColor + "'>None</td>\n" )
  1081. break;
  1082. case "Source":
  1083. var Source = new String( rsResults("Source") )
  1084. if ( Source == "1" )
  1085. Response.Write("<td valign='center' nowrap class='" + altColor + "'>Web Site</td>")
  1086. else if ( Source == "2" )
  1087. Response.Write("<td valign='center' nowrap class='" + altColor + "'>CER Report</td>")
  1088. else if ( Source == "0" )
  1089. Response.Write("<td valign='center' nowrap class='" + altColor + "'>CMD DBG</td>")
  1090. else if ( Source == "5" )
  1091. Response.Write("<td valign='center' nowrap class='" + altColor + "'>Manual Upload</td>")
  1092. else if ( Source == "6" )
  1093. Response.Write("<td valign='center' nowrap class='" + altColor + "'>Stress Upload</td>")
  1094. else
  1095. Response.Write("<td valign='center' nowrap class='" + altColor + "'>Unknown[" + Source + "]</td>")
  1096. break;
  1097. case "iIndex":
  1098. LastIndex = new String( rsResults("iIndex" ) )
  1099. break;
  1100. case "Link to Solution":
  1101. Response.Write("<td class='" + altColor + "'><input style='font-size:85%;width:85px' type='button' value='Link as Solution' onclick=\"window.parent.frames('sepTopBody').window.location='SEP_BodyTop.asp?SolutionType=1&Mode=kernel&iBucket=" + Server.URLEncode(rsResults("BucketID")) + "'\"><br>")
  1102. Response.Write("<input style='font-size:85%;width:85px' type='button' value='Link as Response' onclick=\"window.parent.frames('sepTopBody').window.location='SEP_BodyTop.asp?SolutionType=0&Mode=kernel&iBucket=" + Server.URLEncode(rsResults("BucketID")) + "'\" id='button'1 name='button'1></td>")
  1103. break;
  1104. case "Reject Solution":
  1105. Response.Write("<td class='" + altColor + "'><input style='font-size:85%' type='button' value='Reject' onclick=\"window.parent.frames('sepTopBody').window.location='SEP_BodyTop.asp?Mode=kernel&RejectID=" + Server.URLEncode(rsResults("QueueIndex")) + "'\" ></td>")
  1106. break;
  1107. case "Create Response":
  1108. case "CreateResponse":
  1109. Response.Write("<td class='" + altColor + "'><input style='font-size:85%' type='button' value='Create Response' onclick=\"window.parent.frames('sepTopBody').window.location='SEP_BodyTop.asp?Mode=user&iBucket=" + rsResults("iBucket") + "'\" id='button'1 name='button'1></td>")
  1110. break;
  1111. case "szResponse":
  1112. Response.Write("<td class='" + altColor + "'><a class='clsALinkNormal' href=\"" + rsResults("szResponse") + "\">" + rsResults("szResponse") + "</a></td>\n" )
  1113. break;
  1114. case "szAltResponse":
  1115. Response.Write("<td class='" + altColor + "'><a class='clsALinkNormal' href=\"" + rsResults("szAltResponse") + "\">" + rsResults("szAltResponse") + "</a></td>\n" )
  1116. break;
  1117. case "Status":
  1118. var ResType = rsResults("Status")
  1119. if( ResType == "0" )
  1120. Response.Write("<td class='" + altColor + "'>Awaiting review</td>\n" )
  1121. else if ( ResType == "1" )
  1122. Response.Write("<td class='" + altColor + "'>Response created</td>\n" )
  1123. else if ( ResType == "2" )
  1124. Response.Write("<td class='" + altColor + "'>Rejected</td>\n" )
  1125. else
  1126. Response.Write("<td class='" + altColor + "'>" + ResType + "</td>\n" )
  1127. break;
  1128. case "ResponseType":
  1129. var ResType = rsResults("ResponseType")
  1130. if( ResType == "1" )
  1131. Response.Write("<td class='" + altColor + "'>Solution</td>\n" )
  1132. else if ( ResType == "2" )
  1133. Response.Write("<td class='" + altColor + "'>Response</td>\n" )
  1134. else
  1135. Response.Write("<td class='" + altColor + "'>" + ResType + "</td>\n" )
  1136. break;
  1137. default:
  1138. Response.Write("<td class='" + altColor + "'>" + rsResults(Fields[i] ) + "</td>\n" )
  1139. }
  1140. }
  1141. Response.Write("</tr>" )
  1142. rsResults.MoveNext()
  1143. }
  1144. }
  1145. function CreateQueryBuilder( BlockName, RunFunction, SaveFunction, BlockFields, Title, RedirASPPage, RedirASPParams )
  1146. {
  1147. %>
  1148. <form NAME=frm<%=BlockName%> METHOD="POST" ACTION="Global_SaveAdvancedQuery.asp">
  1149. <table cellspacing=0 cellpadding=0>
  1150. <tr>
  1151. <td>
  1152. <p Class='clsPSubTitle'><%=Title%></p>
  1153. </td>
  1154. </tr>
  1155. <tr>
  1156. <td style='padding-left:16px'>
  1157. <INPUT class='clsButton' TYPE=Button NAME=btnAddClause<%=BlockName%> VALUE="Add Clause" OnClick="AddClause( '<%=BlockName%>' )">
  1158. </td>
  1159. <td>
  1160. <p>Select number of records to display: </p>
  1161. </td>
  1162. <td>
  1163. <select class='clsSEPselect' name="<%=BlockName%>Top">
  1164. <option value="10">10
  1165. <option value="20">20
  1166. <option value="40">40
  1167. <option value="50">50
  1168. <option value="70">70
  1169. <option value="90">90
  1170. <option value="100">100
  1171. <option value="150">150
  1172. <option value="200">200
  1173. <option value="250" selected>250
  1174. <option value="300">300
  1175. <option value="350">350
  1176. <option value="400">400
  1177. <option value="500">500
  1178. <option value="1000">1000
  1179. <option value="2000">2000
  1180. <!-- <option value="100 percent" selected>all -->
  1181. </select>
  1182. </td>
  1183. </tr>
  1184. </table>
  1185. <table class="clsTableInfo" border="0" cellpadding="2" cellspacing="1">
  1186. <tr>
  1187. <td style='width:100px' nowrap class='clsTDInfo'>&nbsp;</td>
  1188. <td style='border-left:white 1px solid;width:175px' align='left' nowrap class='clsTDInfo'>Field</td>
  1189. <td style='border-left:white 1px solid;width:175px' align='left' nowrap class='clsTDInfo'>Comparison</td>
  1190. <td style='border-left:white 1px solid;width:175px' align='left' nowrap class='clsTDInfo'>Value</td>
  1191. <td style='border-left:white 1px solid;width:175px' align='left' nowrap class='clsTDInfo'>Remove Clause</td>
  1192. </tr>
  1193. </table>
  1194. <%
  1195. CreateClauseTable2( BlockFields, CompareOperators, BlockName )
  1196. %>
  1197. <table>
  1198. <tr>
  1199. <td>
  1200. <p>Order by:</p>
  1201. </td>
  1202. <td>
  1203. <SELECT class='clsSEPSelect' STYLE="width:200px" NAME="<%=BlockName%>OrderBy">
  1204. <%
  1205. for ( Field in BlockFields )
  1206. Response.Write( "<OPTION VALUE='" + BlockFields[Field].Value + "'>" + BlockFields[Field].Text + "</OPTION>" + "\n" )
  1207. %>
  1208. </SELECT>
  1209. </td>
  1210. <td>
  1211. <SELECT class='clsSEPSelect' STYLE="width:100px" NAME="<%=BlockName%>SortDirection">
  1212. <OPTION VALUE=DESC>Descending</OPTION>
  1213. <OPTION VALUE=ASC>Ascending</OPTION>
  1214. </SELECT>
  1215. </td>
  1216. </tr>
  1217. <tr>
  1218. <td style='padding-left:16px' colspan='3'>
  1219. <input class='clsButton' TYPE=button VALUE="Run Query" OnClick="<%=RunFunction%>( '<%=BlockName%>', false, '<%=RedirASPPage%>', '<%=RedirASPParams%>' )" id=button1 name=button1>
  1220. <input class='clsButton' TYPE=button VALUE="Run In New Window" OnClick="<%=RunFunction%>( '<%=BlockName%>', true, '<%=RedirASPPage%>', '<%=RedirASPParams%>' )" id=button1 name=button1>
  1221. </td>
  1222. <td>
  1223. <p>Description:</p>
  1224. </td>
  1225. <td>
  1226. <input type='text' class='clsButton' id='<%=BlockName%>SaveDescription' maxLength='30' value='Custom Query' OnClick="javascript:this.value=''">
  1227. </td>
  1228. <td>
  1229. <img src='include/images/go.gif'>
  1230. </td>
  1231. <td>
  1232. <input class='clsButton' TYPE=button VALUE="Save Query" OnClick="<%=SaveFunction%>( '<%=BlockName%>', '<%=RedirASPPage%>', '<%=RedirASPParams%>' )" id=button2 name=button2>
  1233. </td>
  1234. </tr>
  1235. </table>
  1236. </form>
  1237. <SCRIPT LANGUAGE="javascript">
  1238. <%
  1239. Response.Write( BlockName + "Fields = { \n" )
  1240. for( op in BlockFields )
  1241. {
  1242. Response.Write( op + " : { \t\tText:\"" + BlockFields[op].Text + "\"\t,\t\tValue:\"" + BlockFields[op].Value + "\", ValType: \"" + BlockFields[op].ValType + "\" },\n" )
  1243. }
  1244. Response.Write( "NONE : { Text: \"\", Sign:\"\" }\n}" )
  1245. %>
  1246. AddClause( '<%=BlockName%>' )
  1247. </SCRIPT>
  1248. <%
  1249. }
  1250. %>