Cleaned the pollution from the forms system.
This commit is contained in:
parent
53b81b36d0
commit
8500c4d506
81 changed files with 2675 additions and 1570 deletions
|
|
@ -69,9 +69,6 @@ sub definition {
|
|||
my $definition = shift || [];
|
||||
my $i18n = WebGUI::International->new($session, "WebGUI");
|
||||
push(@{$definition}, {
|
||||
formName=>{
|
||||
defaultValue=>$i18n->get("user"),
|
||||
},
|
||||
label=>{
|
||||
defaultValue=>$i18n->get("user"),
|
||||
},
|
||||
|
|
@ -81,15 +78,67 @@ sub definition {
|
|||
readOnly=>{
|
||||
defaultValue=>0,
|
||||
},
|
||||
dbDataType => {
|
||||
defaultValue => "VARCHAR(22) BINARY",
|
||||
},
|
||||
});
|
||||
return $class->SUPER::definition($session, $definition);
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
=head2 getDatabaseFieldType ( )
|
||||
|
||||
Returns "VARCHAR(22) BINARY".
|
||||
|
||||
=cut
|
||||
|
||||
sub getDatabaseFieldType {
|
||||
return "VARCHAR(22) BINARY";
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
=head2 getName ( session )
|
||||
|
||||
Returns the human readable name of this control.
|
||||
|
||||
=cut
|
||||
|
||||
sub getName {
|
||||
my ($self, $session) = @_;
|
||||
return WebGUI::International->new($session, 'WebGUI')->get('user');
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
=head2 getValueAsHtml ( )
|
||||
|
||||
Formats as a name.
|
||||
|
||||
=cut
|
||||
|
||||
sub getValueAsHtml {
|
||||
my $self = shift;
|
||||
my $user = WebGUI::User->new($self->session, $self->getValue);
|
||||
if (defined $user) {
|
||||
return $user->username;
|
||||
}
|
||||
return undef;
|
||||
}
|
||||
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
=head2 isDynamicCompatible ( )
|
||||
|
||||
A class method that returns a boolean indicating whether this control is compatible with the DynamicField control.
|
||||
|
||||
=cut
|
||||
|
||||
sub isDynamicCompatible {
|
||||
return 1;
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
=head2 toHtml ( )
|
||||
|
||||
Renders a user selector.
|
||||
|
|
@ -98,7 +147,7 @@ Renders a user selector.
|
|||
|
||||
sub toHtml {
|
||||
my $self = shift;
|
||||
my $user = WebGUI::User->new($self->session, $self->get("value"));
|
||||
my $user = WebGUI::User->new($self->session, $self->getDefaultValue);
|
||||
my $manage = undef;
|
||||
if ($self->session->user->isInGroup(3)) {
|
||||
$manage = " ".$self->session->icon->manage('op=listUsers');
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue