Changeset 43 for trunk/lib


Ignore:
Timestamp:
03/16/09 23:01:09 (15 years ago)
Author:
nanardon
Message:
  • add map ballot feature
Location:
trunk/lib/Vote
Files:
2 edited

Legend:

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

    r42 r43  
    7171        } 
    7272    } elsif ($vote->vote_status($id) eq 'AFTER') { 
     73        if ($c->req->param('mapfrom') && $c->req->param('mapto')) { 
     74            $vote->vote_map_value( 
     75                $id, 
     76                $c->req->param('mapfrom'), 
     77                $c->req->param('mapto'), 
     78            ); 
     79        } 
    7380        foreach my $bid ($vote->list_vote_ballot_needvalid($id)) { 
    7481            if (!$c->req->param($bid)) { 
  • trunk/lib/Vote/Model/Vote.pm

    r42 r43  
    631631        select value from ballot join ballot_item 
    632632        on ballot.id = ballot_item.id 
    633         where poll = ? and fromlist = false 
     633        where poll = ? and fromlist = false and corrected is null 
    634634        group by value order by value 
    635635        } 
     
    648648    my $getval = $self->db->prepare_cached( 
    649649        q{ 
    650         select value from ballot join ballot_item 
     650        select coalesce(corrected, value) as value from ballot join ballot_item 
    651651        on ballot.id = ballot_item.id 
    652652        where poll = ? 
    653         group by value order by value 
     653        group by coalesce(corrected, value) order by coalesce(corrected, value) 
    654654        } 
    655655    ); 
Note: See TracChangeset for help on using the changeset viewer.