Merge branch 'master' into WebGUI8

This commit is contained in:
Graham Knop 2010-04-13 07:50:02 -05:00
commit 2400f19099
797 changed files with 33894 additions and 27196 deletions

View file

@ -25,7 +25,6 @@ use WebGUI::Utility;
use WebGUI::Pluggable;
use Tie::IxHash;
=head1 NAME
Package WebGUI::ProfileField
@ -152,6 +151,7 @@ sub create {
$properties->{fieldType} ||= "ReadOnly";
return undef if $class->exists($session,$fieldName);
return undef if $class->isReservedFieldName($fieldName);
return undef if $fieldName =~ m{\s};
### Data okay, create the field
# Add the record
@ -282,17 +282,23 @@ A WebGUI::User object reference to use instead of the currently logged in user.
=head3 skipDefault
If true, this causes the default value set up for the form field to be ignored.
If true, this causes the default value set up for the form field to be ignored. In choosing default,
skipDefault has the highest priority.
=head3 assignedValue
If assignedValue is defined, it will be used to override the default value set up for the
form.
form. assignedValue has the next highest priority.
=head3 returnObject
If true, it returns a WebGUI::Form object, instead of returning HTML.
=head3 useFieldDefault
If true, it uses the default setup for the ProfileField, instead of the user's default. useFieldDefault
has the lowest priority.
=cut
# FIXME This would be better if it returned an OBJECT not the HTML
@ -300,14 +306,15 @@ If true, it returns a WebGUI::Form object, instead of returning HTML.
# And refactor to not require all these arguments HERE but rather in the
# constructor or something...
sub formField {
my $self = shift;
my $session = $self->session;
my $properties = $self->formProperties(shift);
my $withWrapper = shift;
my $u = shift || $session->user;
my $skipDefault = shift;
my $assignedValue = shift;
my $returnObject = shift;
my $self = shift;
my $session = $self->session;
my $properties = $self->formProperties(shift);
my $withWrapper = shift;
my $u = shift || $session->user;
my $skipDefault = shift;
my $assignedValue = shift;
my $returnObject = shift;
my $useFieldDefault = shift;
if ($skipDefault) {
$properties->{value} = undef;
@ -315,6 +322,9 @@ sub formField {
elsif (defined $assignedValue) {
$properties->{value} = $assignedValue;
}
elsif ($useFieldDefault) {
$properties->{value} = WebGUI::Operation::Shared::secureEval($session,$properties->{dataDefault});
}
else {
# start with specified (or current) user's data. previous data needed by some form types as well (file).
$properties->{value} = $u->profileField($self->getId);