#-----------------------------------------------------------------
# $self->form( $row )
#-----------------------------------------------------------------
sub form {
    my ( $self, $row ) = @_;

    # the basic form is generated
    my $form = $self->SUPER::form( $row );

    # we need to add the skill selector to it

    # first, go get all possible skills

    my @skill_options;
    my @all_skills = $SKILL->gsearch( $self, undef, { order_by => 'ident' } );

    foreach my $skill ( @all_skills ) {
        push @skill_options, {
            value => $skill->id,
            label => $skill->ident,
        };
    }

    # then, find the ones associated with our row (if there are any)
    my %selected;

    # push a new field into the form hash
    my $skill_field = {
        name     => 'skill',
        type     => 'select_multiple',
        label    => 'Skills',
        options  => \@skill_options,
        selected => \%selected,
    };

    push @{ $form->{ fields } }, $skill_field;

    # form is a hash, push your multiple select onto the array
    # in its fields key
    #use Data::Dumper; warn Dumper( $form );

    return $form;
}

sub add_pre_action {
    my ( $self, $params ) = @_;

    my $skills = delete $params->{ skill };
    my @skills = split /\0/, $skills;

    warn "skills: @skills\n";

    use Data::Dumper; warn Dumper( $params );
}
