mirror of
https://framagit.org/framasoft/framadate/framadate
synced 2026-07-22 17:46:36 +00:00
New edition possibility is taken into account
- Also added Framadate\Message à link attribute - Added local anchor #edit with vote edition - For now, when the poll owner check the new edit option (ie: "Votes are editable solely by their owner"), users get their update link on vote creation
This commit is contained in:
parent
1f55167e2c
commit
a3f5763edd
14 changed files with 42 additions and 20 deletions
|
|
@ -22,6 +22,7 @@ use Framadate\Services\InputService;
|
|||
use Framadate\Services\MailService;
|
||||
use Framadate\Message;
|
||||
use Framadate\Utils;
|
||||
use Framadate\Editable;
|
||||
|
||||
include_once __DIR__ . '/app/inc/init.php';
|
||||
|
||||
|
|
@ -155,7 +156,12 @@ if (!empty($_POST['save'])) { // Save edition of an old vote
|
|||
// Add vote
|
||||
$result = $pollService->addVote($poll_id, $name, $choices);
|
||||
if ($result) {
|
||||
$message = new Message('success', _('Update vote successfully.'));
|
||||
if ($poll->editable == Editable::EDITABLE_BY_OWN) {
|
||||
$urlEditVote = Utils::getUrlSondage($poll_id, false, $result->uniqId);
|
||||
$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, ADD_VOTE);
|
||||
} else {
|
||||
$message = new Message('danger', _('Update vote failed.'));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue