web: Renamed database field 'protect' to 'project_specific'.

Boolean is inverse of what it was before.

Conflicts:
	html/ops/db_update.php
This commit is contained in:
Shawn Kwang 2018-09-17 12:54:34 -05:00
parent b44a8c8455
commit 992ceced0d
3 changed files with 10 additions and 10 deletions

View File

@ -141,7 +141,7 @@ $privacy_pref_descs = array (
// table and extract those consent types with enabled=1 and
// privacypref=1.
$privacy_consent_descs = array();
$_consenttypes = BoincConsentType::enum("enabled=1 AND privacypref=1", "ORDER BY protect DESC");
$_consenttypes = BoincConsentType::enum("enabled=1 AND privacypref=1", "ORDER BY project_specific ASC");
foreach ($_consenttypes as $ct) {
$privacy_consent_descs[] = new PREF_CONSENT(
tra($ct->description),

View File

@ -1190,7 +1190,7 @@ function update_9_12_2018() {
shortname varchar(255) not null,
description varchar(255) not null,
enabled integer not null,
protect integer not null,
project_specific integer not null,
privacypref integer not null,
primary key (id),
index consent_name (shortname)

View File

@ -44,7 +44,7 @@ function add_consenttype() {
}
BoincConsentType::insert(
"(shortname, description) VALUES ('$shortname', '$description')"
"(shortname, description, project_specific) VALUES ('$shortname', '$description', 1)"
);
echo "<h2>Consent Type added.</h2>";
@ -73,17 +73,17 @@ function mct_toggle_field($field) {
// Builds the form for managing consent types
function mct_show_form() {
$_consenttypes = BoincConsentType::enum(null, "ORDER BY protect DESC");
$_consenttypes = BoincConsentType::enum(null, "ORDER BY project_specific ASC");
if (!in_rops()) {
echo "<b>'Protected' consent types are defined by BOINC. You may add project-specific consent types using this form. (Unprotected consent types are defined here by this project.)</b>";
echo "<b>ProjectSpecific=0 consent types are defined by BOINC. You may add and remove project-specific consent types using this form.</b>";
}
start_table("");
table_header(
"Name",
"Description",
"Enabled",
"Protected",
"ProjectSpecific",
"PrivacyPrefs",
""
);
@ -111,8 +111,8 @@ function mct_show_form() {
echo " <td>$ct->enabled</td>";
}
// Protect(ed) consent type
echo " <td>$ct->protect</td>";
// Project_specific) consent type
echo " <td>$ct->project_specific</td>";
// Privacypref toggle
if (!in_rops()) {
@ -127,8 +127,8 @@ function mct_show_form() {
echo " <td>$ct->privacypref</td>";
}
// Delete (if not protected)
if (!in_rops() and !($ct->protect)) {
// Delete (if project_specific)
if (!in_rops() and ($ct->project_specific)) {
echo "<td><input class=\"btn btn-default\" name=delete type=submit value=Delete>";
}
else {