Ticket #1332: app_version_num_fix.diff

File app_version_num_fix.diff, 2.1 KB (added by Christian Beer, 11 years ago)
  • html/inc/db_ops.inc

    diff --git a/html/inc/db_ops.inc b/html/inc/db_ops.inc
    index 78cf490..30bd2b7 100644
    a b function show_result_ops($result) { 
    10181018    row("claimed credit", $result->claimed_credit);
    10191019    row("Granted credit", $result->granted_credit);
    10201020    row("Application", "<a href=\"db_action.php?table=app&id=$result->appid\">".app_name_by_id($result->appid)."</a>");
    1021     row("App version", "<a href=\"db_action.php?table=app_version&appid=$result->appid&clauses=version_num%3D$result->app_version_num\">".$result->app_version_num."</a>");
     1021    if($result->app_version_num == 0) {
     1022        $av = BoincAppVersion::lookup_id($result->app_version_id);
     1023        row("App version", "<a href=\"db_action.php?table=app_version&appid=$result->appid&clauses=version_num%3D$av->version_num\">".$av->version_num."</a>");
     1024    } else {
     1025        row("App version", "<a href=\"db_action.php?table=app_version&appid=$result->appid&clauses=version_num%3D$result->app_version_num\">".$result->app_version_num."</a>");
     1026    }
    10221027    row("App version ID", $result->app_version_id);
    10231028    row("Estimated GFLOPS", number_format($result->flops_estimate/1e9, 2));
    10241029    row("Random",$result->random);
    function show_result_short($result) { 
    10841089            $received = "<font color=\"#ff3333\">". time_str($result->report_deadline) . "</font>";
    10851090        }
    10861091    }
    1087     $version = sprintf("%.2f", $result->app_version_num/100);
    1088     $av = BoincAppVersion::lookup_id($result->app_version_id);
    1089     if ($av) {
    1090         $version .= " [$av->plan_class]";
     1092    if($result->app_version_num <> 0) {
     1093        $version = sprintf("%.2f", $result->app_version_num/100);
     1094        $av = BoincAppVersion::lookup_id($result->app_version_id);
     1095        if ($av) {
     1096            $version .= " [$av->plan_class]";
     1097        }
     1098    } else {
     1099        $av = BoincAppVersion::lookup_id($result->app_version_id);
     1100        if ($av) {
     1101            $version = sprintf("%.2f", $av->version_num/100);
     1102            $version .= " [$av->plan_class]";
     1103        }
    10911104    }
    10921105    $outcome_color = outcome_color($result->outcome);
    10931106    $validate_color = validate_color($result->validate_state);