Entangle the required and editable properties of Profile fields.

Add tests.  Update i18n for required property hover help.
Upgrade script to set editable=1 on all required fields.
fixes #10781
This commit is contained in:
Colin Kuskie 2009-08-17 19:28:04 +00:00
parent 5baf75bb19
commit 0762ce1730
5 changed files with 53 additions and 11 deletions

View file

@ -877,13 +877,15 @@ sub set {
my $db = $session->db;
# Set the defaults
$properties->{visible} = 0 unless ($properties->{visible} == 1);
$properties->{editable} = 0 unless ($properties->{editable} == 1);
$properties->{protected} = 0 unless ($properties->{protected} == 1);
$properties->{required} = 0 unless ($properties->{required} == 1);
$properties->{label} = 'Undefined' if ($properties->{label} =~ /^[\"\']*$/);
$properties->{fieldType} = 'text' unless ($properties->{fieldType});
$properties->{extras} = '' unless ($properties->{extras});
$properties->{visible} = 0 unless ($properties->{visible} == 1);
$properties->{protected} = 0 unless ($properties->{protected} == 1);
$properties->{required} = 0 unless ($properties->{required} == 1);
$properties->{editable} = $properties->{required} == 1 ? 1
: $properties->{editable} == 1 ? 1
: 0;
$properties->{label} = 'Undefined' if ($properties->{label} =~ /^[\"\']*$/);
$properties->{fieldType} = 'text' unless ($properties->{fieldType});
$properties->{extras} = '' unless ($properties->{extras});
if ($properties->{dataDefault} && $properties->{fieldType}=~/List$/) {
unless ($properties->{dataDefault} =~ /^\[/) {
$properties->{dataDefault} = "[".$properties->{dataDefault};

View file

@ -69,8 +69,8 @@ Internationalization system if labels need to be localized.|,
},
'474 description' => {
message => q|Should the user be required to fill out this field?|,
lastUpdated => 1122316558,
message => q|Should the user be required to fill out this field? If this option is set to yes, then the field will automatically be set to be editable as well.|,
lastUpdated => 1250537322,
},
'486 description' => {