. // 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) { $f1=""; $f2=""; } echo "
\n"; $i = 1-$i; echo "id>"; echo " $f1 id>$av->id $f2\n"; $app = $apps[$av->appid]; echo " $f1 id>$app->name $f2\n"; echo " $f1 $av->version_num $f2\n"; $platform = $platforms[$av->platformid]; echo " $f1 $platform->name $f2\n"; echo " \n"; $v = $av->min_core_version; echo " \n"; $v=$av->max_core_version; echo " \n"; $v=''; if ($av->beta) $v=' CHECKED '; echo " \n"; $v=''; if ($av->deprecated) $v=' CHECKED '; echo " \n"; echo ""; echo "
"; } end_table(); } admin_page_head("Manage application versions"); if (post_str("submit", true)) { update(); } $all = get_str("all", true); show_form($all); admin_page_tail(); ?>