fixing bugs

This commit is contained in:
JT Smith 2005-12-07 17:43:01 +00:00
parent a20aa5f587
commit bfffdae8a9
4 changed files with 12 additions and 31 deletions

View file

@ -155,11 +155,11 @@ sub www_viewProfile {
my @array = ();
foreach my $category (@{WebGUI::ProfileCategory->getCategories}) {
next unless ($category->get("visible");
next unless ($category->get("visible"));
push(@array, {'profile.category' => $category->getLabel});
foreach my $field (@{$category->getFields}) {
next unless ($field->get("visible"));
next if ($field->get("fieldName") eq "email" && !$u->profileField("publicEmail")
next if ($field->get("fieldName") eq "email" && !$u->profileField("publicEmail"));
push(@array, {
'profile.label' => $field->getLabel,
'profile.value' => $u->profileField($field->getId)

View file

@ -23,28 +23,8 @@ use WebGUI::Session;
use WebGUI::SQL;
use WebGUI::Operation::Shared;
use WebGUI::Form::FieldType;
#-------------------------------------------------------------------
sub _reorderCategories {
my ($sth, $i, $id);
$sth = WebGUI::SQL->read("select profileCategoryId from userProfileCategory order by sequenceNumber");
while (($id) = $sth->array) {
$i++;
WebGUI::SQL->write("update userProfileCategory set sequenceNumber='$i' where profileCategoryId=".quote($id));
}
$sth->finish;
}
#-------------------------------------------------------------------
sub _reorderFields {
my ($sth, $i, $id);
$sth = WebGUI::SQL->read("select fieldName from userProfileField where profileCategoryId=".quote($_[0])." order by sequenceNumber");
while (($id) = $sth->array) {
$i++;
WebGUI::SQL->write("update userProfileField set sequenceNumber='$i' where fieldName=".quote($id));
}
$sth->finish;
}
use WebGUI::ProfileField;
use WebGUI::ProfileCategory;
#-------------------------------------------------------------------
sub _submenu {
@ -75,6 +55,7 @@ sub _submenu {
sub www_deleteProfileCategoryConfirm {
return WebGUI::Privilege::adminOnly() unless (WebGUI::Grouping::isInGroup(3));
return WebGUI::AdminConsole->new("userProfiling")->render(WebGUI::Privilege::vitalComponent()) if (length($session{form}{cid}) != 22 && $session{form}{cid} < 1000 && $session{form}{cid} > 0);
WebGUI::SQL->write("delete from userProfileCategory where profileCategoryId=".quote($session{form}{cid}));
WebGUI::SQL->write("update userProfileField set profileCategoryId='1' where profileCategoryId=".quote($session{form}{cid}));
return www_editProfileSettings();

View file

@ -400,7 +400,7 @@ A scalar indicating the type of field this will be when generated as a form elem
A scalar containing a hash reference declaration of possible values. Only used for list type fields.
=head4 defaultValues
=head4 defaultValue
A scalar containing an array reference or scalar declaration of defaultly selected value(s).
@ -415,12 +415,12 @@ sub set {
$properties->{required} = 0 unless ($properties->{required} == 1);
$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};
if ($properties->{defaultValue} && $properties->{fieldType}=~/List$/) {
unless ($properties->{defaultValue} =~ /^\[/) {
$properties->{defaultValue} = "[".$properties->{defaultValue};
}
unless ($properties->{defaultValues} =~ /\]$/) {
$properties->{defaultValues} .= "]";
unless ($properties->{defaultValue} =~ /\]$/) {
$properties->{defaultValue} .= "]";
}
}
$properties->{fieldName} = $self->getId;