Commit 55c9edbb authored by Richard Mansfield's avatar Richard Mansfield

In institution settings, disable profile fields locked at the site level and add note (bug #547632)

Signed-off-by: default avatarRichard Mansfield <richardm@catalyst.net.nz>
parent 53bfaeaa
......@@ -141,6 +141,8 @@ if ($institution || $add) {
$c = count($authinstances);
$inuse = '';
$sitelockedfields = (array) get_column('institution_locked_profile_field', 'profilefield', 'name', 'mahara');
if (!$add) {
$data = get_record('institution', 'name', $institution);
$lockedprofilefields = (array) get_column('institution_locked_profile_field', 'profilefield', 'name', $institution);
......@@ -307,11 +309,18 @@ if ($institution || $add) {
'collapsed' => true,
'elements' => array(),
);
if ($institution != 'mahara') {
$elements['lockedfields']['elements']['description'] = array(
'type' => 'html',
'value' => get_string('disabledlockedfieldhelp', 'admin', get_field('institution', 'displayname', 'name', 'mahara')),
);
}
foreach (ArtefactTypeProfile::get_all_fields() as $field => $type) {
$elements['lockedfields']['elements'][$field] = array(
'type' => 'checkbox',
'title' => get_string($field, 'artefact.internal'),
'defaultvalue' => in_array($field, $lockedprofilefields)
'defaultvalue' => in_array($field, $lockedprofilefields) || ($institution != 'mahara' && in_array($field, $sitelockedfields)),
'disabled' => $institution != 'mahara' && in_array($field, $sitelockedfields)
);
}
$elements['lockedfieldshelp'] = array(
......
......@@ -561,6 +561,7 @@ $string['registrationallowed'] = 'Registration allowed?';
$string['registrationalloweddescription2'] = 'Whether users can register for your site for this institution using the registration form. If registration is off, non-members cannot request membership of the institution, and members cannot leave the institution or delete their user accounts voluntarily.';
$string['defaultmembershipperiod'] = 'Default membership period';
$string['defaultmembershipperioddescription'] = 'How long new members remain associated with the institution';
$string['authenticatedby'] = 'Authentication Method';
$string['authenticatedbydescription'] = 'How this user authenticates to Mahara';
$string['remoteusername'] = 'Username for external authentication';
......@@ -632,6 +633,7 @@ $string['noinstitutions'] = 'No Institutions';
$string['noinstitutionsdescription'] = 'If you would like to associate users with an institution, you should create the institution first.';
$string['Lockedfields'] = 'Locked fields';
$string['disabledlockedfieldhelp'] = 'Note: Disabled check boxes are for profile fields which are locked in the in the institution settings for "%s". These profile fields are locked at the site level and cannot be unlocked here.';
// Suspend Institutions
$string['errorwhileunsuspending'] = 'An error occured while trying to unsuspend';
......
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