. // web interfance for managing app versions require_once('../inc/util_ops.inc'); function update() { $id = post_int("id"); $av = BoincAppVersion::lookup_id($id); if (!$av) admin_error_page("no such app version"); $n = post_str("beta", true) ? 1 : 0; $av->update("beta=$n"); $n = post_str("deprecated", true) ? 1 : 0; $av->update("deprecated=$n"); $n = post_int("min_core_version"); $av->update("min_core_version=$n"); $n = post_int("max_core_version"); $av->update("max_core_version=$n"); $n = post_str("plan_class"); $av->update("plan_class='$n'"); echo "Updated app version $id. This change will take effect when you restart the project.
";
}
function show_form($all) {
if ($all) {
echo "Don't show deprecated app versions\n";
} else {
echo "Show deprecated app versions\n";
}
$_platforms = BoincPlatform::enum("");
foreach ($_platforms as $platform) {
$platforms[$platform->id] = $platform;
}
$_apps = BoincApp::enum("");
foreach ($_apps as $app) {
$apps[$app->id] = $app;
}
start_table("");
table_header(
"ID #
click for details",
"Application
click for details",
"Version",
"Platform",
"Plan class",
"minimum
client version",
"maximum
client version",
"beta?",
"deprecated?",
""
);
$clause = $all?"true":"deprecated = 0";
$avs = BoincAppVersion::enum(
"$clause order by appid, platformid, plan_class, version_num"
);
$i = 0;
foreach ($avs as $av) {
// grey out deprecated versions
//
$f1=$f2='';
if ($av->deprecated == 1) {
$f1="";
$f2="";
}
$all_value = $all?1:0;
$app = $apps[$av->appid];
// ignore app versions of deprecated apps by default
if ($all_value == 0 && $app->deprecated == 1) {
continue;
}
echo "