2006-11-17 19:52:09 +00:00
|
|
|
<?php
|
2008-08-05 22:43:14 +00:00
|
|
|
// This file is part of BOINC.
|
|
|
|
// http://boinc.berkeley.edu
|
2017-09-26 20:52:14 +00:00
|
|
|
// Copyright (C) 2017 University of California
|
2008-08-05 22:43:14 +00:00
|
|
|
//
|
|
|
|
// BOINC is free software; you can redistribute it and/or modify it
|
|
|
|
// under the terms of the GNU Lesser General Public License
|
|
|
|
// as published by the Free Software Foundation,
|
|
|
|
// either version 3 of the License, or (at your option) any later version.
|
|
|
|
//
|
|
|
|
// BOINC is distributed in the hope that it will be useful,
|
|
|
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
|
|
|
// See the GNU Lesser General Public License for more details.
|
|
|
|
//
|
|
|
|
// You should have received a copy of the GNU Lesser General Public License
|
|
|
|
// along with BOINC. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
|
2013-07-02 21:51:19 +00:00
|
|
|
// web interfance for managing app versions
|
2008-03-18 21:22:44 +00:00
|
|
|
|
2006-11-17 19:52:09 +00:00
|
|
|
require_once('../inc/util_ops.inc');
|
|
|
|
|
2013-07-02 21:51:19 +00:00
|
|
|
function update() {
|
|
|
|
$id = post_int("id");
|
|
|
|
$av = BoincAppVersion::lookup_id($id);
|
2014-10-29 19:25:35 +00:00
|
|
|
if (!$av) admin_error_page("no such app version");
|
2006-11-17 19:52:09 +00:00
|
|
|
|
2014-06-05 16:51:01 +00:00
|
|
|
$n = post_str("beta", true) ? 1 : 0;
|
|
|
|
$av->update("beta=$n");
|
|
|
|
|
2013-07-02 21:51:19 +00:00
|
|
|
$n = post_str("deprecated", true) ? 1 : 0;
|
|
|
|
$av->update("deprecated=$n");
|
2006-11-17 19:52:09 +00:00
|
|
|
|
2013-07-02 21:51:19 +00:00
|
|
|
$n = post_int("min_core_version");
|
|
|
|
$av->update("min_core_version=$n");
|
2006-11-17 19:52:09 +00:00
|
|
|
|
2013-07-02 21:51:19 +00:00
|
|
|
$n = post_int("max_core_version");
|
|
|
|
$av->update("max_core_version=$n");
|
2006-11-17 19:52:09 +00:00
|
|
|
|
2014-07-25 19:11:23 +00:00
|
|
|
$n = post_str("plan_class");
|
|
|
|
$av->update("plan_class='$n'");
|
|
|
|
|
2013-07-02 21:51:19 +00:00
|
|
|
echo "<b>Updated app version $id. This change will take effect when you restart the project.</b><p>";
|
2008-03-18 21:22:44 +00:00
|
|
|
}
|
2006-11-17 19:52:09 +00:00
|
|
|
|
2014-09-22 04:06:31 +00:00
|
|
|
function show_form($all) {
|
|
|
|
if ($all) {
|
|
|
|
echo "<a href=manage_app_versions.php>Don't show deprecated app versions</a>\n";
|
|
|
|
} else {
|
|
|
|
echo "<a href=manage_app_versions.php?all=1>Show deprecated app versions</a>\n";
|
|
|
|
}
|
2013-07-02 21:51:19 +00:00
|
|
|
$_platforms = BoincPlatform::enum("");
|
|
|
|
foreach ($_platforms as $platform) {
|
|
|
|
$platforms[$platform->id] = $platform;
|
2006-11-17 19:52:09 +00:00
|
|
|
}
|
|
|
|
|
2013-07-02 21:51:19 +00:00
|
|
|
$_apps = BoincApp::enum("");
|
|
|
|
foreach ($_apps as $app) {
|
|
|
|
$apps[$app->id] = $app;
|
|
|
|
}
|
2006-11-17 19:52:09 +00:00
|
|
|
|
2013-07-02 21:51:19 +00:00
|
|
|
start_table("");
|
|
|
|
table_header(
|
2017-09-26 20:52:14 +00:00
|
|
|
"ID #<br><small>click for details</small>",
|
|
|
|
"Application<br><small>click for details</small>",
|
2013-07-02 21:51:19 +00:00
|
|
|
"Version",
|
|
|
|
"Platform",
|
2014-07-25 19:11:23 +00:00
|
|
|
"Plan class",
|
2013-07-02 21:51:19 +00:00
|
|
|
"minimum<br>client version",
|
|
|
|
"maximum<br>client version",
|
2014-06-05 16:51:01 +00:00
|
|
|
"beta?",
|
2013-07-02 21:51:19 +00:00
|
|
|
"deprecated?",
|
|
|
|
""
|
|
|
|
);
|
2014-09-22 04:06:31 +00:00
|
|
|
$clause = $all?"true":"deprecated = 0";
|
2013-07-02 21:51:19 +00:00
|
|
|
$avs = BoincAppVersion::enum(
|
2014-09-22 04:06:31 +00:00
|
|
|
"$clause order by appid, platformid, plan_class, version_num"
|
2013-07-02 21:51:19 +00:00
|
|
|
);
|
2013-12-24 05:02:55 +00:00
|
|
|
$i = 0;
|
2013-07-02 21:51:19 +00:00
|
|
|
foreach ($avs as $av) {
|
2023-05-05 18:05:20 +00:00
|
|
|
// grey out deprecated versions
|
2013-07-02 21:51:19 +00:00
|
|
|
//
|
|
|
|
$f1=$f2='';
|
2016-07-27 09:58:43 +00:00
|
|
|
if ($av->deprecated == 1) {
|
2013-07-02 21:51:19 +00:00
|
|
|
$f1="<font color='GREY'>";
|
|
|
|
$f2="</font>";
|
|
|
|
}
|
2006-11-17 19:52:09 +00:00
|
|
|
|
2015-08-11 10:15:17 +00:00
|
|
|
$all_value = $all?1:0;
|
2016-07-27 09:58:43 +00:00
|
|
|
$app = $apps[$av->appid];
|
|
|
|
// ignore app versions of deprecated apps by default
|
|
|
|
if ($all_value == 0 && $app->deprecated == 1) {
|
|
|
|
continue;
|
|
|
|
}
|
2015-08-11 10:15:17 +00:00
|
|
|
echo "<tr class=row$i><form action=manage_app_versions.php?all=$all_value#av_$av->id method=POST>\n";
|
2013-12-24 05:02:55 +00:00
|
|
|
$i = 1-$i;
|
2013-07-02 21:51:19 +00:00
|
|
|
echo "<input type=hidden name=id value=$av->id>";
|
2015-08-11 09:48:06 +00:00
|
|
|
echo " <TD>$f1 <a id='av_$av->id' href=db_action.php?table=app_version&id=$av->id>$av->id</a> $f2</TD>\n";
|
2006-11-17 19:52:09 +00:00
|
|
|
|
2013-07-02 21:51:19 +00:00
|
|
|
$app = $apps[$av->appid];
|
2014-06-05 16:51:01 +00:00
|
|
|
echo " <TD>$f1 <a href=app_details.php?appid=$app->id>$app->name</a> $f2</TD>\n";
|
2006-11-17 19:52:09 +00:00
|
|
|
|
2013-07-02 21:51:19 +00:00
|
|
|
echo " <TD>$f1 $av->version_num $f2</TD>\n";
|
2006-11-17 19:52:09 +00:00
|
|
|
|
2013-07-02 21:51:19 +00:00
|
|
|
$platform = $platforms[$av->platformid];
|
|
|
|
echo " <TD>$f1 $platform->name $f2</TD>\n";
|
2006-11-17 19:52:09 +00:00
|
|
|
|
2014-07-25 19:11:23 +00:00
|
|
|
echo " <td><input type=text name=plan_class size=12 value='$av->plan_class'></td>\n";
|
2006-11-17 19:52:09 +00:00
|
|
|
|
2014-06-05 16:51:01 +00:00
|
|
|
$v = $av->min_core_version;
|
2013-07-02 21:51:19 +00:00
|
|
|
echo " <TD><input type='text' size='4' name=min_core_version value='$v'></TD>\n";
|
2006-11-17 19:52:09 +00:00
|
|
|
|
2013-07-02 21:51:19 +00:00
|
|
|
$v=$av->max_core_version;
|
|
|
|
echo " <TD><input type='text' size='4' name=max_core_version value='$v'></TD>\n";
|
2006-11-17 19:52:09 +00:00
|
|
|
|
2013-07-02 21:51:19 +00:00
|
|
|
$v='';
|
2014-06-05 16:51:01 +00:00
|
|
|
if ($av->beta) $v=' CHECKED ';
|
|
|
|
echo " <TD> <input name=beta type='checkbox' $v></TD>\n";
|
|
|
|
|
|
|
|
$v='';
|
|
|
|
if ($av->deprecated) $v=' CHECKED ';
|
2013-07-02 21:51:19 +00:00
|
|
|
echo " <TD> <input name=deprecated type='checkbox' $v></TD>\n";
|
2014-06-05 16:51:01 +00:00
|
|
|
|
2016-07-27 09:58:43 +00:00
|
|
|
if (!in_rops()) {
|
|
|
|
echo "<td><input class=\"btn btn-default\" name=submit type=submit value=Update>";
|
|
|
|
} else {
|
|
|
|
echo "<td> </td>";
|
|
|
|
}
|
2006-11-17 19:52:09 +00:00
|
|
|
|
2023-05-05 18:05:20 +00:00
|
|
|
echo "</tr></form>";
|
2006-11-17 19:52:09 +00:00
|
|
|
}
|
2013-07-02 21:51:19 +00:00
|
|
|
end_table();
|
2008-03-18 21:22:44 +00:00
|
|
|
}
|
2006-11-17 19:52:09 +00:00
|
|
|
|
|
|
|
|
2013-07-02 21:51:19 +00:00
|
|
|
admin_page_head("Manage application versions");
|
2006-11-17 19:52:09 +00:00
|
|
|
|
2013-07-02 21:51:19 +00:00
|
|
|
if (post_str("submit", true)) {
|
|
|
|
update();
|
|
|
|
}
|
2014-09-22 04:06:31 +00:00
|
|
|
$all = get_str("all", true);
|
|
|
|
show_form($all);
|
2006-11-17 19:52:09 +00:00
|
|
|
admin_page_tail();
|
|
|
|
?>
|