mirror of
https://framagit.org/framasoft/framadate/framadate
synced 2026-07-28 12:04:23 +00:00
Issue #22 Enable vote name modification
This commit is contained in:
parent
c67a4c7c14
commit
afd6079420
6 changed files with 30 additions and 13 deletions
|
|
@ -126,6 +126,7 @@ if (!empty($_POST['edit_vote'])) {
|
|||
// -------------------------------
|
||||
|
||||
if (!empty($_POST['save'])) { // Save edition of an old vote
|
||||
$name = filter_input(INPUT_POST, 'name', FILTER_VALIDATE_REGEXP, ['options' => ['regexp' => NAME_REGEX]]);
|
||||
$editedVote = filter_input(INPUT_POST, 'save', FILTER_VALIDATE_INT);
|
||||
$choices = $inputService->filterArray($_POST['choices'], FILTER_VALIDATE_REGEXP, ['options' => ['regexp' => CHOICE_REGEX]]);
|
||||
|
||||
|
|
@ -138,7 +139,7 @@ if (!empty($_POST['save'])) { // Save edition of an old vote
|
|||
|
||||
if ($message == null) {
|
||||
// Update vote
|
||||
$result = $pollService->updateVote($poll_id, $editedVote, $choices);
|
||||
$result = $pollService->updateVote($poll_id, $editedVote, $name, $choices);
|
||||
if ($result) {
|
||||
$message = new Message('success', _('Update vote successfully.'));
|
||||
} else {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue