Add edit link with vote update
This commit is contained in:
parent
fbf448c415
commit
84e3a93645
|
@ -133,7 +133,13 @@ if (!empty($_POST['save'])) { // Save edition of an old vote
|
|||
// Update vote
|
||||
$result = $pollService->updateVote($poll_id, $editedVote, $name, $choices);
|
||||
if ($result) {
|
||||
$message = new Message('success', _('Update vote successfully.'));
|
||||
if ($poll->editable == Editable::EDITABLE_BY_OWN) {
|
||||
$editedVoteUniqId = filter_input(INPUT_POST, 'edited_vote', FILTER_VALIDATE_REGEXP, ['options' => ['regexp' => POLL_REGEX]]);
|
||||
$urlEditVote = Utils::getUrlSondage($poll_id, false, $editedVoteUniqId);
|
||||
$message = new Message('success', __('studs', "Your vote has been registered successfully, but be careful: regarding this poll options, you need to keep this personal link to edit your own vote:"), $urlEditVote);
|
||||
} else {
|
||||
$message = new Message('success', _('Update vote successfully.'));
|
||||
}
|
||||
sendUpdateNotification($poll, $mailService, $name, UPDATE_VOTE);
|
||||
} else {
|
||||
$message = new Message('danger', _('Update vote failed.'));
|
||||
|
|
|
@ -39,6 +39,7 @@
|
|||
<td class="bg-info" style="padding:5px">
|
||||
<div class="input-group input-group-sm" id="edit">
|
||||
<span class="input-group-addon"><span class="glyphicon glyphicon-user"></span></span>
|
||||
<input type="hidden" name="edited_vote" value="{$vote->uniqId}"/>
|
||||
<input type="text" id="name" name="name" value="{$vote->name|html}" class="form-control" title="{__('Genric', 'Your name')}" placeholder="{__('Genric', 'Your name')}" />
|
||||
</div>
|
||||
</td>
|
||||
|
|
|
@ -85,6 +85,7 @@
|
|||
<td class="bg-info" style="padding:5px">
|
||||
<div class="input-group input-group-sm" id="edit">
|
||||
<span class="input-group-addon"><span class="glyphicon glyphicon-user"></span></span>
|
||||
<input type="hidden" name="edited_vote" value="{$vote->uniqId}"/>
|
||||
<input type="text" id="name" name="name" value="{$vote->name|html}" class="form-control" title="{__('Generic', 'Your name')}" placeholder="{__('Generic', 'Your name')}" />
|
||||
</div>
|
||||
</td>
|
||||
|
|
Loading…
Reference in New Issue