Commit info for scoop/lib/Scoop/Polls:
Modified Files:
Forms.pm Utils.pm
Log Message:
Hulver's "multi-choice" poll patch.
-janra
Index: Forms.pm
===================================================================
RCS file: /cvs/scoop/scoop/lib/Scoop/Polls/Forms.pm,v
retrieving revision 1.9
retrieving revision 1.10
diff -r1.9 -r1.10
128a129
> my $is_multiple_choice_checked;
134a136
> $is_multiple_choice_checked = $S->{CGI}->param('is_multiple_choice') ? ' CHECKED' : '';
144c146
< WHAT => qq|qid, question, voters, post_date|,
---
> WHAT => qq|qid, question, voters, post_date, is_multiple_choice|,
155a158
> $is_multiple_choice_checked = $rowhash->{'is_multiple_choice'} ? ' CHECKED' : '';
185a189
>
198c202
< <br>
---
> <br><br>
202a207,214
>
> if ($S->{UI}->{VARS}->{allow_multiple_choice}) {
> $content .=qq|
> <INPUT type="checkbox" name="is_multiple_choice" value="1"$is_multiple_choice_checked>
> Allow multiple selections in poll<br>
> |;
> }
>
Index: Utils.pm
===================================================================
RCS file: /cvs/scoop/scoop/lib/Scoop/Polls/Utils.pm,v
retrieving revision 1.12
retrieving revision 1.13
diff -r1.12 -r1.13
107d106
<
587a587,613
>
> sub _is_poll_multiple_choice {
> my $S = shift;
> my $qid = shift;
>
> # Always false if the admin disables it, else check the DB
> return 0 unless $S->{UI}->{VARS}->{allow_multiple_choice};
>
> my $multiple_choice;
>
> $qid = $S->{DBH}->quote($qid);
>
> my $where = "qid=$qid";
>
> my ($rv, $sth) = $S->db_select({
> DEBUG => 0,
> WHAT => 'is_multiple_choice',
> FROM => 'pollquestions',
> WHERE => $where,
> });
>
> $multiple_choice = $sth->fetchrow();
> $sth->finish();
>
> return $multiple_choice;
> }
>