Skip to content
Snippets Groups Projects
Commit 00b871df authored by m's avatar m
Browse files

nettoyage du sondage de démonstration

https://framagit.org/framasoft/framadate/issues/316
parent 3b54590b
No related branches found
No related tags found
No related merge requests found
......@@ -23,6 +23,11 @@ class PurgeService {
$this->commentRepository = RepositoryFactory::commentRepository();
}
public function repeatedCleanings() {
$this->purgeOldPolls();
$this->cleanDemoPoll();
}
/**
* This methode purges all old polls (the ones with end_date in past).
*
......
......@@ -107,8 +107,7 @@ if (empty($_SESSION['form']->title) || empty($_SESSION['form']->admin_name) || (
// Clean Form data in $_SESSION
unset($_SESSION['form']);
// Delete old polls
$purgeService->purgeOldPolls();
$purgeService->repeatedCleanings();
// creation message
$sessionService->set("Framadate", "messagePollCreated", TRUE);
......
......@@ -231,8 +231,7 @@ switch ($step) {
// Clean Form data in $_SESSION
unset($_SESSION['form']);
// Delete old polls
$purgeService->purgeOldPolls();
$purgeService->repeatedCleanings();
// creation message
$sessionService->set("Framadate", "messagePollCreated", TRUE);
......
......@@ -35,14 +35,19 @@ $pollService = new PollService($connect, new $logService());
/* PAGE */
/* ---- */
$demoPoll = $pollService->findById('aqg259dth55iuhwm');
$demoPollURL = "";
if (defined("DEMO_POLL_ID")) {
$demoPollURL = Utils::getUrlSondage(DEMO_POLL_ID);
}
$nbcol = max( $config['show_what_is_that'] + $config['show_the_software'] + $config['show_cultivate_your_garden'], 1 );
$smarty->assign('show_what_is_that', $config['show_what_is_that']);
$smarty->assign('show_the_software', $config['show_the_software']);
$smarty->assign('show_cultivate_your_garden', $config['show_cultivate_your_garden']);
$smarty->assign('col_size', 12 / $nbcol);
$smarty->assign('demo_poll', $demoPoll);
$smarty->assign('demo_poll_url', $demoPollURL);
$smarty->assign('title', __('Generic', 'Make your polls'));
......
......@@ -82,6 +82,13 @@ const MAX_SLOTS_PER_POLL = 366;
// Number of seconds before we allow to resend an "Remember Edit Link" email.
const TIME_EDIT_LINK_EMAIL = 60;
// uncomment to display a link to the demo poll at the home page
//const DEMO_POLL_ID = "aqg259dth55iuhwm";
// number of recent votes that are not deleted
const DEMO_POLL_NUMBER_VOTES = 10;
// Config
$config = [
/* general config */
......
......@@ -58,10 +58,10 @@
<li>{__('1st section', 'Discuss and make a decision')}</li>
</ol>
{if $demo_poll != null}
{if $demo_poll_url}
<p>
{__('1st section', 'Do you want to')}
<a href="{poll_url id='aqg259dth55iuhwm'}">{__('1st section', 'view an example?')}</a>
<a href="{$demo_poll_url|html}">{__('1st section', 'view an example?')}</a>
</p>
{/if}
</div>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment