Date poll creation: Always propose 3 choices and 3 slots when choosing dates
This commit is contained in:
parent
94f80687f3
commit
e8a1f37c98
@ -221,17 +221,15 @@ if (!isset($_SESSION['form']->title) || !isset($_SESSION['form']->admin_name) ||
|
|||||||
} else {
|
} else {
|
||||||
|
|
||||||
// Prefill form->choices
|
// Prefill form->choices
|
||||||
if (count($_SESSION['form']->getChoices()) == 0) {
|
foreach ($_SESSION['form']->getChoices() as $c) {
|
||||||
$c = new Choice('');
|
$count = 3 - count($c->getSlots());
|
||||||
$c->addSlot('');
|
for($i=0; $i< $count; $i++) {
|
||||||
$c->addSlot('');
|
$c->addSlot('');
|
||||||
$c->addSlot('');
|
}
|
||||||
$_SESSION['form']->addChoice($c);
|
}
|
||||||
$c = new Choice('');
|
|
||||||
$c->addSlot('');
|
$count = 3 - count($_SESSION['form']->getChoices());
|
||||||
$c->addSlot('');
|
for($i=0; $i< $count; $i++) {
|
||||||
$c->addSlot('');
|
|
||||||
$_SESSION['form']->addChoice($c);
|
|
||||||
$c = new Choice('');
|
$c = new Choice('');
|
||||||
$c->addSlot('');
|
$c->addSlot('');
|
||||||
$c->addSlot('');
|
$c->addSlot('');
|
||||||
|
Loading…
Reference in New Issue
Block a user