. // 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) error_page("no such app version"); $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"); echo "Updated app version $id. This change will take effect when you restart the project.

"; } function show_form() { $_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 #", "Application", "Version", "Platform", "Plan Class", "minimum
client version", "maximum
client version", "deprecated?", "" ); $avs = BoincAppVersion::enum( "true order by appid, platformid, plan_class, version_num" ); foreach ($avs as $av) { // grey out deprecated versions // $f1=$f2=''; if ($av->deprecated) { $f1=""; $f2=""; } echo "

\n"; echo "id>"; echo " $f1 $av->id $f2\n"; $app = $apps[$av->appid]; echo " $f1 $app->name $f2\n"; echo " $f1 $av->version_num $f2\n"; $platform = $platforms[$av->platformid]; echo " $f1 $platform->name $f2\n"; echo " $f1 $av->plan_class $f2\n"; $v=$av->min_core_version; echo " \n"; $v=$av->max_core_version; 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(); } show_form(); admin_page_tail(); ?>