Ignore:
Timestamp:
12/10/09 09:29:20 (15 years ago)
Author:
nanardon
Message:
  • review validation page, fixing #12
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/lib/Epoll/Controller/Admin.pm

    r264 r266  
    129129            ); 
    130130        } 
    131         foreach my $bid ($poll->list_ballot_needvalid) { 
     131        foreach my $bid ($c->req->param('bsubvalid')) { 
    132132            if (!$c->req->param($bid)) { 
    133133                next; 
     
    156156} 
    157157 
     158sub ballotfilter : Private { 
     159    my ($self, $c) = @_; 
     160 
     161    my $poll = $c->model('Vote')->poll($c->stash->{voteid}); 
     162    $c->req->params->{ballotvalue} = 's:needvalid' 
     163        if (!$c->req->param('ballotvalue')); 
     164 
     165    for ($c->req->param('ballotvalue') || '') { 
     166        /^v:(.*)/ and $c->stash->{ballotfilter} = 
     167            [ $poll->ballot_by_value($1) ]; 
     168        /^s:invalid$/ and $c->stash->{ballotfilter} = 
     169            [ $poll->list_ballot_invalid ]; 
     170        /^s:valid$/ and $c->stash->{ballotfilter} = 
     171            [ $poll->list_ballot_valid ]; 
     172        /^s:needvalid$/ and $c->stash->{ballotfilter} = 
     173            [ $poll->list_ballot_needvalid ]; 
     174    } 
     175} 
     176 
    158177sub auth : Private { 
    159178    my ($self, $c) = @_; 
     
    259278 
    260279    $c->forward('auth') or return; 
     280    $c->forward('modify_poll'); 
    261281    $c->stash->{page}{title} = $poll->info('label') . ': Administration: Validation'; 
     282 
     283    $c->forward('ballotfilter'); 
    262284} 
    263285 
Note: See TracChangeset for help on using the changeset viewer.