diff --git a/adminstuds.php b/adminstuds.php index f8501dda804dbbf391b019ab942ff4636db24edc..25c5bf8c9cc66433865c825fd245d8eb33145ef0 100644 --- a/adminstuds.php +++ b/adminstuds.php @@ -63,7 +63,7 @@ if (!$poll) { if (isset($_POST['update_poll_info'])) { $updated = false; - $field = $inputService->filterAllowedValues($_POST['update_poll_info'], ['title', 'admin_mail', 'comment', 'rules', 'expiration_date', 'name']); + $field = $inputService->filterAllowedValues($_POST['update_poll_info'], ['title', 'admin_mail', 'description', 'rules', 'expiration_date', 'name']); // Update the right poll field if ($field == 'title') { @@ -78,10 +78,10 @@ if (isset($_POST['update_poll_info'])) { $poll->admin_mail = $admin_mail; $updated = true; } - } elseif ($field == 'comment') { - $comment = strip_tags($_POST['comment']); - if ($comment) { - $poll->comment = $comment; + } elseif ($field == 'description') { + $description = strip_tags($_POST['description']); + if ($description) { + $poll->description = $description; $updated = true; } } elseif ($field == 'rules') { diff --git a/app/classes/Framadate/FramaDB.php b/app/classes/Framadate/FramaDB.php index 6b7c4c37f2b61171903bca8b206364eaa400cb6f..d4a198f95c48b5815c5d41a265fa41a6157ac499 100644 --- a/app/classes/Framadate/FramaDB.php +++ b/app/classes/Framadate/FramaDB.php @@ -90,7 +90,7 @@ class FramaDB { } function updatePoll($poll) { - $prepared = $this->prepare('UPDATE `' . Utils::table('poll') . '` SET title=?, admin_name=?, admin_mail=?, description=?, end_date=FROM_UNIXTIME(?), active=?, editable=? WHERE id = ?'); + $prepared = $this->prepare('UPDATE `' . Utils::table('poll') . '` SET title=?, admin_name=?, admin_mail=?, description=?, end_date=?, active=?, editable=? WHERE id = ?'); return $prepared->execute([$poll->title, $poll->admin_name, $poll->admin_mail, $poll->description, $poll->end_date, $poll->active, $poll->editable, $poll->id]); } diff --git a/tpl/part/poll_info.tpl b/tpl/part/poll_info.tpl index 360e09aa350a7b3405b92b4a5efbab8f6fb66d16..75060875ce8dea7fb2038c00dda41a5a8149b0f4 100644 --- a/tpl/part/poll_info.tpl +++ b/tpl/part/poll_info.tpl @@ -80,8 +80,8 @@ {if $admin && !$expired} <div class="hidden js-desc text-right"> <label class="sr-only" for="newdescription">{_('Description')}</label> - <textarea class="form-control" id="newdescription" name="comment" rows="2" cols="40">{$poll->description|html}</textarea> - <button type="submit" id="btn-new-desc" name="update_poll_info" value="comment" class="btn btn-sm btn-success" title="{_('Save the description')}"><span class="glyphicon glyphicon-ok"></span><span class="sr-only">{_('Save')}</span></button> + <textarea class="form-control" id="newdescription" name="description" rows="2" cols="40">{$poll->description|html}</textarea> + <button type="submit" id="btn-new-desc" name="update_poll_info" value="description" class="btn btn-sm btn-success" title="{_('Save the description')}"><span class="glyphicon glyphicon-ok"></span><span class="sr-only">{_('Save')}</span></button> <button class="btn btn-default btn-sm btn-cancel" title="{_('Cancel the description edit')}"><span class="glyphicon glyphicon-remove"></span><span class="sr-only">{_('Cancel')}</span></button> </div> {/if}