mirror of https://github.com/BOINC/boinc.git
user web: filter results by application.
svn path=/trunk/boinc/; revision=22339
This commit is contained in:
parent
6df96d612a
commit
4c1dfc6701
|
@ -6475,3 +6475,11 @@ David 11 Sept 2010
|
|||
client/
|
||||
boinc_cmd.cpp
|
||||
|
||||
Rytis 12 Sept 2010
|
||||
- user web: filter results by application.
|
||||
|
||||
html/
|
||||
inc/
|
||||
result.inc
|
||||
user/
|
||||
results.php
|
||||
|
|
|
@ -250,7 +250,8 @@ function result_page_url($info) {
|
|||
$o = $info->offset;
|
||||
$sn = $info->show_names;
|
||||
$st = $info->state;
|
||||
return "results.php?$c&offset=$o&show_names=$sn&state=$st";
|
||||
$appid = $info->appid;
|
||||
return "results.php?$c&offset=$o&show_names=$sn&state=$st&appid=$appid";
|
||||
}
|
||||
|
||||
function result_table_start($show_wu_link, $show_host_link, $info) {
|
||||
|
@ -429,6 +430,31 @@ function show_result_navigation($info) {
|
|||
echo "<a href=$url>".$state_name[$i]."</a>";
|
||||
}
|
||||
}
|
||||
|
||||
$apps = BoincApp::enum('deprecated=0 ORDER BY user_friendly_name');
|
||||
if (count($apps) > 1) {
|
||||
$i2 = clone $info;
|
||||
echo '<br />';
|
||||
if ($info->appid) {
|
||||
$i2->appid = 0;
|
||||
$url = result_page_url($i2);
|
||||
echo '<a href="'.$url.'">All</a>';
|
||||
} else {
|
||||
echo 'All';
|
||||
}
|
||||
|
||||
foreach ($apps as $app) {
|
||||
$i2->appid = $app->id;
|
||||
$url = result_page_url($i2);
|
||||
echo ' | ';
|
||||
if ($info->appid == $app->id) {
|
||||
echo $app->user_friendly_name;
|
||||
} else {
|
||||
echo '<a href="'.$url.'">'.$app->user_friendly_name.'</a>';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
echo "</center><br>";
|
||||
}
|
||||
|
||||
|
|
|
@ -34,6 +34,7 @@ $results_per_page = 20;
|
|||
$hostid = get_int("hostid", true);
|
||||
$userid = get_int("userid", true);
|
||||
$offset = get_int("offset", true);
|
||||
$appid = get_int("appid", true);
|
||||
if (!$offset) $offset=0;
|
||||
$state = get_int("state", true);
|
||||
if (!$state) $state=0;
|
||||
|
@ -60,6 +61,9 @@ if ($hostid) {
|
|||
}
|
||||
|
||||
$clause2 = $clause. $state_clause[$state];
|
||||
if ($appid) {
|
||||
$clause2 .= ' AND appid='.$appid;
|
||||
}
|
||||
|
||||
$query = "$clause2 order by id desc limit $offset,".($results_per_page+1);
|
||||
$results = BoincResult::enum($query);
|
||||
|
@ -71,6 +75,7 @@ $info->results_per_page = $results_per_page;
|
|||
$info->offset = $offset;
|
||||
$info->show_names = $show_names;
|
||||
$info->state = $state;
|
||||
$info->appid = $appid;
|
||||
|
||||
if (count($results)) {
|
||||
echo show_result_navigation($info);
|
||||
|
|
Loading…
Reference in New Issue