- Timestamp:
- 03/07/09 18:44:50 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/lib/Vote/Controller/Ballot.pm
r16 r17 59 59 $c->stash->{choices} = { %choices }; 60 60 $c->stash->{sbal} = { map { $_ => 1 } $c->req->param('sbal') }; 61 $c->stash->{fsbal} = [ map { 62 s/^\s+//; 63 s/\s+$//; 64 s/\s+/ /g; 65 $_ 66 } ($c->req->param('fsbal')) ]; 67 68 my @torecord = grep { $_ } ( 69 (map { $choices{$_} } $c->req->param('sbal')), 70 @{ $c->stash->{fsbal} } 71 ); 72 73 warn $vote->vote_info($id)->{choice_count}; 74 warn scalar(@torecord); 75 warn $_ foreach(@torecord); 76 if (scalar(@torecord) > $vote->vote_info($id)->{choice_count}) { 77 $c->req->param('ballot', ''); 78 $c->stash->{vote_error} = 'Seulement ' . 79 $vote->vote_info($id)->{choice_count} . ' choix possible'; 80 return; 81 } 61 82 62 83 if ($c->req->param('confirm')) { … … 64 85 $uid, 65 86 $id, 66 [ grep { $_ } ( 67 map { $choices{$_} } $c->req->param('sbal'), 68 $c->req->param('fsbal'), 69 ) ], 87 [ @torecord ], 70 88 $c->req->address, 71 89 ); # TODO trap error
Note: See TracChangeset
for help on using the changeset viewer.