migrated user level profile functions to new backend

This commit is contained in:
JT Smith 2005-12-07 17:20:11 +00:00
parent 1bb6033539
commit 5941f6d3f8
2 changed files with 95 additions and 144 deletions

View file

@ -22,6 +22,7 @@ use WebGUI::SQL;
use WebGUI::Form;
use WebGUI::FormProcessor;
use WebGUI::Operation::Shared;
use WebGUI::Macro;
=head1 NAME
@ -150,7 +151,7 @@ Returns the value retrieved from a form post.
sub formProcess {
my $self = shift;
return WebGUI::FormProcessor::process($self->getId,$self->get("fieldType"),WebGUI::Operation::Shared::secureEval($self->get("possibleValues")));
return WebGUI::Macro::negate(WebGUI::FormProcessor::process($self->getId,$self->get("fieldType"),WebGUI::Operation::Shared::secureEval($self->get("possibleValues"))));
}
#-------------------------------------------------------------------
@ -188,6 +189,40 @@ sub getCategory {
}
#-------------------------------------------------------------------
=head2 getEditableFields ()
Returns an array reference of WebGUI::ProfileField objects that are marked "editable" or "required". This is a class method.
=cut
sub getEditableFields {
my $self = shift;
my @fields = ();
foreach my $fieldName (WebGUI::SQL->buildArray("select fieldName from userProfileField where required=1 or editable=1 order by sequenceNumber")) {
push(@fields,WebGUI::ProfileField->new($fieldName));
}
return \@fields;
}
#-------------------------------------------------------------------
=head2 getFields ()
Returns an array reference of WebGUI::ProfileField objects. This is a class method.
=cut
sub getFields {
my $self = shift;
my @fields = ();
foreach my $fieldName (WebGUI::SQL->buildArray("select fieldName from userProfileField order by sequenceNumber")) {
push(@fields,WebGUI::ProfileField->new($fieldName));
}
return \@fields;
}
#-------------------------------------------------------------------
=head2 getId ()
@ -218,6 +253,23 @@ sub getLabel {
#-------------------------------------------------------------------
=head2 getRequiredFields ()
Returns an array reference of WebGUI::ProfileField objects that are marked "required". This is a class method.
=cut
sub getRequiredFields {
my $self = shift;
my @fields = ();
foreach my $fieldName (WebGUI::SQL->buildArray("select fieldName from userProfileField where required=1 order by sequenceNumber")) {
push(@fields,WebGUI::ProfileField->new($fieldName));
}
return \@fields;
}
#-------------------------------------------------------------------
=head2 moveDown ()
Moves this field down one position within it's category.