~ubuntu-branches/ubuntu/precise/boinc/precise

« back to all changes in this revision

Viewing changes to html/user/apps.php

Tags: 6.12.8+dfsg-1
* New upstream release.
* Simplified debian/rules

Show diffs side-by-side

added added

removed removed

Lines of Context:
22
22
 
23
23
$platforms = BoincPlatform::enum("deprecated=0");
24
24
 
25
 
$xml = $_GET['xml'];
 
25
$xml = get_str('xml', true);
26
26
if ($xml) {
27
27
    require_once('../inc/xml.inc');
28
28
    xml_header();
40
40
    if ($xml) {
41
41
        echo "<application>\n";
42
42
        echo "    <name>$app->user_friendly_name</name>\n";
 
43
        echo "    <id>$app->id</id>\n";
43
44
    } else {
44
45
        echo "
45
 
            <tr><th colspan=3>$app->user_friendly_name</th></tr>
46
 
            <tr><th>".tra("Platform")."</th><th>".tra("Current version")."</th><th>".tra("Installation time")."</th></tr>\n
 
46
            <tr><th colspan=4>$app->user_friendly_name</th></tr>
 
47
            <tr>
 
48
                <th>".tra("Platform")."</th>
 
49
                <th>".tra("Version")."</th>
 
50
                <th>".tra("Installation time")."</th>
 
51
            </tr>
47
52
        ";
48
53
    }
49
 
    for ($i=0; $i<sizeof($platforms); $i++) {
50
 
        $platform = $platforms[$i];
51
 
        $newest = null;
52
 
        $avs = BoincAppVersion::enum("appid=$app->id and platformid = $platform->id and deprecated=0");
 
54
    foreach ($platforms as $platform) {
 
55
        $avs = BoincAppVersion::enum(
 
56
            "appid=$app->id and platformid = $platform->id and deprecated=0"
 
57
        );
53
58
        foreach($avs as $av) {
54
 
            if (!$newest || $av->version_num>$newest->version_num) {
55
 
                $newest = $av;
 
59
            foreach ($avs as $av2) {
 
60
                if ($av->id == $av2->id) continue;
 
61
                if ($av->plan_class == $av2->plan_class && $av->version_num > $av2->version_num) {
 
62
                    $av2->deprecated = 1;
 
63
                }
56
64
            }
57
65
        }
58
 
        if ($newest) {
59
 
            $y = pretty_time_str($newest->create_time);
 
66
        foreach($avs as $av) {
 
67
            if ($av->deprecated) continue;
 
68
            $create_time_f = pretty_time_str($av->create_time);
60
69
            if ($xml) {
61
70
                echo "    <version>\n";
62
71
                echo "        <platform_short>$platform->name</platform_short>\n";
63
72
                echo "        <platform_long>$platform->user_friendly_name</platform_long>\n";
64
 
                echo "        <version_num>$newest->version_num</version_num>\n";
65
 
                echo "        <date>$y</date>\n";
66
 
                echo "        <date_unix>$newest->create_time</date_unix>\n";
 
73
                echo "        <version_num>$av->version_num</version_num>\n";
 
74
                echo "        <plan_class>$av->plan_class</plan_class>\n";
 
75
                echo "        <date>$create_time_f</date>\n";
 
76
                echo "        <date_unix>$av->create_time</date_unix>\n";
67
77
                echo "    </version>\n";
68
78
            } else {
69
 
                $x = sprintf("%0.2f", $newest->version_num/100);
 
79
                $version_num_f = sprintf("%0.2f", $av->version_num/100);
 
80
                if ($av->plan_class) {
 
81
                    $version_num_f .= " ($av->plan_class)";
 
82
                }
70
83
                echo "<tr>
71
84
                    <td>$platform->user_friendly_name</td>
72
 
                    <td>$x</td>
73
 
                    <td>$y</td>
 
85
                    <td>$version_num_f</td>
 
86
                    <td>$create_time_f</td>
74
87
                    </tr>
75
88
                ";
76
89
            }