Commit 8aea91fd authored by Cecilia Vela Gurovic's avatar Cecilia Vela Gurovic Committed by Robert Lyon

Bug 1739561: remove privacy and T&C footer custom links

behatnotneeded

Change-Id: I47db01f11f2b3748663612c5684d97468be79a53
parent 42856a52
......@@ -296,20 +296,30 @@ $activeurls = get_config('footercustomlinks');
$activeurls = $activeurls ? unserialize($activeurls) : null;
$footerelements = array();
foreach ($all as $k => $v) {
$footerelements[$k] = array(
'type' => 'switchbox',
'class' => 'last with-text-input',
'title' => $v['title'],
'defaultvalue' => in_array($k, $active),
'onclick' => "jQuery('#footerlinks_{$k}_link')[0].disabled = !this.checked;",
);
$footerelements[$k . '_link'] = array(
'type' => 'text',
'size' => 60,
'description' => get_string('footercustomlink', 'admin', $v['url']),
'defaultvalue' => isset($activeurls[$k]) ? $activeurls[$k] : '',
'disabled' => !in_array($k, $active),
);
if ($k == 'termsandconditions' || $k == 'privacystatement') {
$footerelements[$k] = array(
'type' => 'switchbox',
'class' => 'last with-text-input',
'title' => $v['title'],
'defaultvalue' => in_array($k, $active),
);
}
else {
$footerelements[$k] = array(
'type' => 'switchbox',
'class' => 'last with-text-input',
'title' => $v['title'],
'defaultvalue' => in_array($k, $active),
'onclick' => "jQuery('#footerlinks_{$k}_link')[0].disabled = !this.checked;",
);
$footerelements[$k . '_link'] = array(
'type' => 'text',
'size' => 60,
'description' => get_string('footercustomlink', 'admin', $v['url']),
'defaultvalue' => isset($activeurls[$k]) ? $activeurls[$k] : '',
'disabled' => !in_array($k, $active),
);
}
}
$footerelements['submit'] = array(
'class' => 'btn-primary',
......
......@@ -1172,6 +1172,7 @@ $string['lastupdate'] = 'Last update';
$string['lastupdateorcomment'] = 'Last update or comment';
$string['Title'] = 'Title';
$string['anonymoususer'] = '(Author\'s name hidden)';
$string['removefooterlinksupgradewarning'] = 'Your site uses custom links for terms and conditions or privacy statement. The following links "%s" have now been removed. You will need to add their content directly to the site\'s "Administration → Configure site → Legal" section.';
// import related strings (maybe separated later)
$string['importedfrom'] = 'Imported from %s';
......
......@@ -5653,7 +5653,6 @@ function xmldb_core_upgrade($oldversion=0) {
foreach ($admins as $admin) {
save_user_reply_to_agreement($admin->id, $sitecontentid, 1);
}
}
if ($oldversion < 2018013001) {
......@@ -5681,5 +5680,24 @@ function xmldb_core_upgrade($oldversion=0) {
}
}
if ($oldversion < 2018021500) {
log_debug('Remove privacy statement and T&C conditions custom links from footer');
// remove custom links
if ($footercustomlinks = get_config('footercustomlinks')) {
$footercustomlinks = unserialize($footercustomlinks);
$removedlinks = array();
foreach ($footercustomlinks as $key => $customlink) {
if ($key == 'termsandconditions' || $key == 'privacystatement') {
$removedlinks[] = $customlink;
unset($footercustomlinks[$key]);
}
}
if ($removedlinks) {
$SESSION->add_error_msg(get_string('removefooterlinksupgradewarning', 'mahara', implode(', ', $removedlinks)));
}
set_config('footercustomlinks', serialize($footercustomlinks));
}
}
return $status;
}
......@@ -16,7 +16,7 @@ $config = new stdClass();
// See https://wiki.mahara.org/wiki/Developer_Area/Version_Numbering_Policy
// For upgrades on stable branches, increment the version by one. On master, use the date.
$config->version = 2018013001;
$config->version = 2018021500;
$config->series = '18.04';
$config->release = '18.04dev';
$config->minupgradefrom = 2015030409;
......
......@@ -22,6 +22,7 @@ Background:
And I set the following fields to these values:
| Create folder | folder1 |
# Pressing create folder button
And I scroll to the base of id "files_filebrowser_createfolder"
And I press "Create folder"
# Editing the folder
And I press "Edit folder \"folder1\""
......
......@@ -10,6 +10,7 @@ Scenario: Creating a page with content in it (Bug 1426983)
# Navigating to Portfolio to create a page
# This is the test for manually creating a page
And I choose "Portfolio" from main menu
And I scroll to the base of id "addview-button"
And I follow "Add"
And I click on "Page" in the dialog
And I fill in the following:
......
......@@ -8,6 +8,7 @@ Scenario: Clicking ID's (Bug 1428456)
Given I log in as "admin" with password "Kupuhipa1"
And I choose "Portfolio" from main menu
And I follow "Profile page"
And I scroll to the base of id "viewh1"
And I follow "Edit"
# Checking if we can add a block
......@@ -88,6 +89,7 @@ Scenario: Profile and dashboard pages basic settings and skins can't be edited -
# Profile page
And I choose "Portfolio" from main menu
And I follow "Profile page"
And I scroll to the base of id "viewh1"
And I follow "Edit"
And I should not see "Settings"
And I should see "Edit layout"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment