diff --git a/checkin_notes b/checkin_notes index 3d385f61a0..2e0af01707 100644 --- a/checkin_notes +++ b/checkin_notes @@ -6474,4 +6474,12 @@ 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 diff --git a/html/inc/result.inc b/html/inc/result.inc index f5518f7508..fc703d2a7f 100644 --- a/html/inc/result.inc +++ b/html/inc/result.inc @@ -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 "".$state_name[$i].""; } } + + $apps = BoincApp::enum('deprecated=0 ORDER BY user_friendly_name'); + if (count($apps) > 1) { + $i2 = clone $info; + echo '
'; + if ($info->appid) { + $i2->appid = 0; + $url = result_page_url($i2); + echo 'All'; + } 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 ''.$app->user_friendly_name.''; + } + } + } + echo "
"; } diff --git a/html/user/results.php b/html/user/results.php index 2b22190eef..3c7b0b384d 100644 --- a/html/user/results.php +++ b/html/user/results.php @@ -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);