[TESTMAN]

- display the parameters of the initial (on load) search
- fix the local storage code, last used Source is now stored and used for the initial search
- fix searching for arbitrary revisions (blank revisions field]
- increase the maximum results for comparison to 8 (requested by Hermès)
- minor UI improvements
- dedicated to Christoph

svn path=/trunk/; revision=861
This commit is contained in:
Kamil Hornicek 2014-05-16 19:54:31 +00:00
parent 3fdb0614d7
commit cff3c80a13
5 changed files with 41 additions and 21 deletions

View File

@ -28,22 +28,19 @@
// Prepare the WHERE clause
$where = "WHERE r.finished = 1 ";
if(isset($_GET["startrev"]) || isset($_GET["source"]) || isset($_GET["platform"]))
{
if(isset($_GET["startrev"]))
$where .= "AND r.revision >= " . (int)$_GET["startrev"] . " AND r.revision <= " . (int)$_GET["endrev"] . " ";
if(isset($_GET["source"]))
$where .= "AND src.name LIKE " . $dbh->quote("%" . $_GET["source"] . "%") . " ";
if(isset($_GET["platform"]))
$where .= "AND r.platform LIKE " . $dbh->quote($_GET["platform"] . "%") . " ";
}
if(isset($_GET["startrev"]) && $_GET["startrev"])
$where .= "AND r.revision >= " . (int)$_GET["startrev"] . " AND r.revision <= " . (int)$_GET["endrev"] . " ";
if(isset($_GET["source"]) && $_GET["source"])
$where .= "AND src.name LIKE " . $dbh->quote("%" . $_GET["source"] . "%") . " ";
if(isset($_GET["platform"]) && $_GET["platform"])
$where .= "AND r.platform LIKE " . $dbh->quote($_GET["platform"] . "%") . " ";
// Prepare some clauses
$tables = "FROM winetest_runs r JOIN sources src ON r.source_id = src.id ";
if(isset($_GET["desc"]))
if(isset($_GET["desc"]) && $_GET["desc"])
$order = "ORDER BY revision DESC, r.id DESC ";
else
$order = "ORDER BY revision ASC, r.id ASC ";

View File

@ -15,7 +15,7 @@
define("DEFAULT_SEARCH_LIMIT", 10);
define("DEFAULT_SEARCH_SOURCE", "CMake_x86_GCCLin (KVM)");
define("MAX_COMPARE_RESULTS", 5);
define("MAX_COMPARE_RESULTS", 8);
define("RESULTS_PER_PAGE", 100);
?>

View File

@ -28,7 +28,7 @@ button {
}
select {
width: 200px;
width: 275px;
}
th.TestCheckbox {
@ -37,6 +37,7 @@ th.TestCheckbox {
#searchform tr td {
vertical-align: top;
padding-bottom: 10px;
}
.controlgroup {
@ -92,7 +93,7 @@ th.TestCheckbox {
.comboedit {
position: relative;
background-color: white;
width: 200px;
width: 275px;
height: 18px;
}
@ -101,7 +102,7 @@ th.TestCheckbox {
top: 0px;
left: 0px;
font-size: 14px;
width: 200px;
width: 275px;
margin: 0;
}
@ -109,7 +110,7 @@ th.TestCheckbox {
position: absolute;
top: 2px;
left: 4px;
width: 176px;
width: 251px;
padding: 1px;
font-size: 14px;
border: none !important;

View File

@ -52,8 +52,6 @@
//first hide, then fadeIn
jQuery("#js_stuff").hide();
jQuery("#js_stuff").fadeIn(500);
if(window.localStoratge)
document.getElementById('search_source').value = window.localStorage.getItem('testman_source');
});
</script>
<h2><?php echo $testman_langres["index_title"]; ?></h2>

View File

@ -12,6 +12,7 @@ var data;
var FullRange;
var inputbox_startrev;
var inputbox_endrev;
var initialSearch = 1;
var PageCount;
var ResultCount;
var SelectedResults = new Object();
@ -238,7 +239,13 @@ function Load()
data["desc"] = 1;
data["limit"] = <?php echo DEFAULT_SEARCH_LIMIT; ?>;
data["source"] = "<?php echo DEFAULT_SEARCH_SOURCE; ?>";
if(window.localStorage && window.localStorage.getItem('testman_source'))
data["source"] = window.localStorage.getItem('testman_source');
else
data["source"] = "<?php echo DEFAULT_SEARCH_SOURCE; ?>";
document.getElementById('search_source').value = data["source"];
data["page"] = CurrentPage;
data["resultlist"] = 1;
@ -267,6 +274,8 @@ function SearchCallback(HttpRequest)
}
var html = "";
var first_rev = 0;
var last_rev = 0;
if(data["resultlist"])
{
@ -417,7 +426,22 @@ function SearchCallback(HttpRequest)
SearchCall();
return;
}
if(initialSearch)
{
first_rev = HttpRequest.responseXML.getElementsByTagName("firstrev")[0].firstChild.data
last_rev = HttpRequest.responseXML.getElementsByTagName("lastrev")[0].firstChild.data
if(first_rev == last_rev)
document.getElementById('search_revision').value = first_rev;
else if(first_rev > last_rev)
document.getElementById('search_revision').value = last_rev + "-" + first_rev;
else
document.getElementById('search_revision').value = first_rev + "-" + last_rev;
initialSearch = 0;
}
document.getElementById("ajax_loading_search").style.visibility = "hidden";
}