Ignore:
Timestamp:
04/15/09 03:51:26 (15 years ago)
Author:
nanardon
Message:
  • use new commit() and rollback()
  • add add standalone create_poll function
File:
1 edited

Legend:

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

    r190 r198  
    2424sub begin : Private { 
    2525    my ( $self, $c, @args ) = @_; 
    26     $c->model('Vote')->db->rollback; 
     26    $c->model('Vote')->rollback; 
    2727} 
    2828 
     
    4343        if ($c->req->param('addch')) { 
    4444            $vote->vote_add_choice($id, $c->req->param('addch')) 
    45                 and $vote->db->commit; 
     45                and $vote->commit; 
    4646        } elsif ($c->req->param('delch')) { 
    4747            $vote->delete_choice($c->req->param('delch')) 
    48                 and $vote->db->commit; 
     48                and $vote->commit; 
    4949        } elsif ($c->req->param('pollparam')) { 
    5050            if ($c->req->param('dstart')) { 
     
    7777                grep { exists($c->req->params->{$_}) } 
    7878                qw(label description start end choice_count free_choice) 
    79             ) and $vote->db->commit; 
     79            ) and $vote->commit; 
    8080        } elsif ($c->req->param('encrypted')) { 
    8181            my $passphrase = $c->req->param('passphrase') || 
    8282                $c->session->{'vpass' . $c->stash->{voteid}}; 
    8383            $poll->gen_poll_keys($passphrase) 
    84                 and $vote->db->commit; 
     84                and $vote->commit; 
    8585        } elsif ($c->req->param('notcrypted')) { 
    8686            $poll->param(public_key => undef, private_key => undef) 
    87                 and $vote->db->commit; 
     87                and $vote->commit; 
    8888        } 
    8989    }; 
     
    9595                $upload->fh, 
    9696                $c->req->param('delete'), 
    97             ) and $vote->db->commit; 
     97            ) and $vote->commit; 
    9898        } elsif($c->req->param('delvoting')) { 
    9999            $vote->delete_voting($c->req->param('delvoting')) 
    100                 and $vote->db->commit; 
     100                and $vote->commit; 
    101101        } elsif ($c->req->param('mail')) { 
    102102            $vote->addupd_voting($id, $c->req->param('mail'), $c->req->param('id')) 
    103                 and $vote->db->commit; 
     103                and $vote->commit; 
    104104        } elsif($c->req->param('mailpasswd')) { 
    105105            # TODO 
     
    137137            } elsif($c->req->param($bid) eq 'invalid') { 
    138138                $vote->mark_ballot_invalid($bid, 1); 
    139                 $vote->db->commit; 
     139                $vote->commit; 
    140140            } elsif($c->req->param($bid) eq 'valid') { 
    141141                $vote->mark_ballot_invalid($bid, 0); 
    142                 $vote->db->commit; 
     142                $vote->commit; 
    143143            } 
    144144        } 
Note: See TracChangeset for help on using the changeset viewer.