Ignore:
Timestamp:
04/19/09 20:06:03 (15 years ago)
Author:
nanardon
Message:
  • add specific object to manage ballot data
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/lib/Vote/Controller/Ballot.pm

    r207 r219  
    8888    my @sbalval = grep { $_ } map { lc($choices{$_} || '') } $c->req->param('sbal'); 
    8989 
    90     if (scalar(@sbalval) + scalar(@{$c->stash->{fsbal} || []}) 
    91         > $poll->info('choice_count')) { 
     90    my @ballot = grep { $_ } (@sbalval, @{$c->stash->{fsbal} || []}); 
     91    if (scalar(@ballot) > $poll->info('choice_count')) { 
    9292        $c->req->parameters->{'ballot'} = ''; 
    9393        $c->stash->{vote_error} = 'Seulement ' . 
     
    9797    { 
    9898        my %uniq; 
    99         foreach(@sbalval, @{$c->stash->{fsbal} || []}) { 
     99        foreach(@ballot) { 
    100100            $uniq{lc($_)} ||= 0; # avoid undef 
    101101            $uniq{lc($_)}++; 
     
    113113        $c->stash->{ballotid} = $poll->register_ballot( 
    114114            $mail, 
    115             [ @sbalval ], 
    116             [ @{ $c->stash->{fsbal} } ], 
     115            [ @ballot ], 
    117116            $c->req->address, 
    118117        ); # TODO trap error 
Note: See TracChangeset for help on using the changeset viewer.