undoing matt's fuck up because he's a big dirty bitch and i told him i'd be saying so in the cvs commit logs

This commit is contained in:
JT Smith 2005-12-07 15:13:40 +00:00
parent 40c5b2419e
commit c83b4b385c

View file

@ -83,7 +83,7 @@ sub create {
my $id = WebGUI::SQL->setRow("userProfileField","fieldName",{fieldName=>"new"},undef,$fieldName);
my $self = $class->new($id);
$self->setCategory($categoryId || "1");
$self->set($properties);
$self->update($properties);
return $self;
}
@ -312,17 +312,17 @@ sub set {
$properties->{editable} = 0 unless ($properties->{editable} == 1);
$properties->{protected} = 0 unless ($properties->{protected} == 1);
$properties->{required} = 0 unless ($properties->{required} == 1);
$properties->{fieldLabel} = 'Undefined' if ($properties->{fieldLabel} =~ /^[\"\']*$/);
$properties->{dataType} = 'text' unless ($properties->{dataType});
if ($properties->{defaultValues} && $properties->{dataType}=~/List$/) {
unless ($properties->{dataValues} =~ /^\[/) {
$properties->{dataValues} = "[".$properties->{defaultValues};
$properties->{label} = 'Undefined' if ($properties->{label} =~ /^[\"\']*$/);
$properties->{fieldType} = 'text' unless ($properties->{fieldType});
if ($properties->{defaultValues} && $properties->{fieldType}=~/List$/) {
unless ($properties->{defaultValues} =~ /^\[/) {
$properties->{defaultValues} = "[".$properties->{defaultValues};
}
unless ($properties->{dataValues} =~ /\]$/) {
$properties->{dataValues} .= "]";
unless ($properties->{defaultValues} =~ /\]$/) {
$properties->{defaultValues} .= "]";
}
}
WebGUI::SQL->setRow("userProfileField","profileCategoryId",$properties);
WebGUI::SQL->setRow("userProfileCategory","profileCategoryId",$properties);
foreach my $key (keys %{$properties}) {
$self->{_property}{$key} = $properties->{$key};
}