Exemple #1
0
include_once __DIR__ . '/app/inc/init.php';
/* Constants */
/* --------- */
const UPDATE_POLL = 1;
const DELETED_POLL = 2;
/* Variables */
/* --------- */
$admin_poll_id = null;
$poll_id = null;
$poll = null;
$message = null;
$editingVoteId = 0;
/* Services */
/*----------*/
$logService = new LogService();
$pollService = new PollService($connect, $logService);
$adminPollService = new AdminPollService($connect, $pollService, $logService);
$inputService = new InputService();
$mailService = new MailService($config['use_smtp']);
/* Functions */
/*-----------*/
/**
 * Send a notification to the poll admin to notify him about an update.
 *
 * @param stdClass $poll The poll
 * @param MailService $mailService The mail service
 * @param int $type cf: Constants on the top of this page
 */
function sendUpdateNotification($poll, $mailService, $type)
{
    if (!isset($_SESSION['mail_sent'])) {
 * http://www.cecill.info/licences/Licence_CeCILL-B_V1-fr.txt
 *
 * Auteurs de STUdS (projet initial) : Guilhem BORGHESI (borghesi@unistra.fr) et Raphaël DROZ
 * Auteurs de Framadate/OpenSondage : Framasoft (https://github.com/framasoft)
 */
use Framadate\Services\LogService;
use Framadate\Services\PollService;
use Framadate\Services\MailService;
use Framadate\Services\PurgeService;
use Framadate\Utils;
use Framadate\Choice;
include_once __DIR__ . '/app/inc/init.php';
/* Service */
/*---------*/
$logService = new LogService();
$pollService = new PollService($connect, $logService);
$mailService = new MailService($config['use_smtp']);
$purgeService = new PurgeService($connect, $logService);
if (is_file('bandeaux_local.php')) {
    include_once 'bandeaux_local.php';
} else {
    include_once 'bandeaux.php';
}
// Step 1/4 : error if $_SESSION from info_sondage are not valid
if (empty($_SESSION['form']->title) || empty($_SESSION['form']->admin_name) || ($config['use_smtp'] ? empty($_SESSION['form']->admin_mail) : false)) {
    Utils::print_header(__('Error', 'Error!'));
    bandeau_titre(__('Error', 'Error!'));
    echo '
    <div class="alert alert-danger">
        <h3>' . __('Error', 'You haven\'t filled the first section of the poll creation.') . ' !</h3>
        <p>' . __('Generic', 'Back to the homepage of') . ' <a href="' . Utils::get_server_name() . '"> ' . NOMAPPLICATION . '</a></p>
 * http://www.cecill.info/licences/Licence_CeCILL-B_V1-fr.txt
 *
 * Auteurs de STUdS (projet initial) : Guilhem BORGHESI (borghesi@unistra.fr) et Raphaël DROZ
 * Auteurs de Framadate/OpenSondage : Framasoft (https://github.com/framasoft)
 */
use Framadate\Services\LogService;
use Framadate\Services\PollService;
use Framadate\Services\MailService;
use Framadate\Services\PurgeService;
use Framadate\Utils;
use Framadate\Choice;
include_once __DIR__ . '/app/inc/init.php';
/* Service */
/*---------*/
$logService = new LogService();
$pollService = new PollService($connect, $logService);
$mailService = new MailService($config['use_smtp']);
$purgeService = new PurgeService($connect, $logService);
if (is_file('bandeaux_local.php')) {
    include_once 'bandeaux_local.php';
} else {
    include_once 'bandeaux.php';
}
// Step 1/4 : error if $_SESSION from info_sondage are not valid
if (empty($_SESSION['form']->title) || empty($_SESSION['form']->admin_name) || ($config['use_smtp'] ? empty($_SESSION['form']->admin_mail) : false)) {
    Utils::print_header(__('Error', 'Error!'));
    bandeau_titre(__('Error', 'Error!'));
    echo '
    <div class="alert alert-danger">
        <h3>' . __('Error', 'You haven\'t filled the first section of the poll creation.') . ' !</h3>
        <p>' . __('Generic', 'Back to the homepage of') . ' <a href="' . Utils::get_server_name() . '"> ' . NOMAPPLICATION . '</a></p>
Exemple #4
0
 * =============================
 *
 * Ce logiciel est régi par la licence CeCILL-B. Si une copie de cette licence
 * ne se trouve pas avec ce fichier vous pouvez l'obtenir sur
 * http://www.cecill.info/licences/Licence_CeCILL-B_V1-fr.txt
 *
 * Auteurs de STUdS (projet initial) : Guilhem BORGHESI (borghesi@unistra.fr) et Raphaël DROZ
 * Auteurs de Framadate/OpenSondage : Framasoft (https://github.com/framasoft)
 */
use Framadate\Services\PollService;
use Framadate\Utils;
include_once __DIR__ . '/app/inc/init.php';
if (!is_file(CONF_FILENAME)) {
    header('Location: ' . Utils::get_server_name() . 'admin/install.php');
    exit;
}
/* SERVICES */
/* -------- */
$logService = '\\Framadate\\Services\\LogService';
$pollService = new PollService($connect, new $logService());
/* PAGE */
/* ---- */
$demoPoll = $pollService->findById('aqg259dth55iuhwm');
$nbcol = $config['show_what_is_that'] + $config['show_the_software'] + $config['show_cultivate_your_garden'];
$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('title', __('Generic', 'Make your polls'));
$smarty->display('index.tpl');
Exemple #5
0
 * Ce logiciel est régi par la licence CeCILL-B. Si une copie de cette licence
 * ne se trouve pas avec ce fichier vous pouvez l'obtenir sur
 * http://www.cecill.info/licences/Licence_CeCILL-B_V1-fr.txt
 *
 * Auteurs de STUdS (projet initial) : Guilhem BORGHESI (borghesi@unistra.fr) et Raphaël DROZ
 * Auteurs de Framadate/OpenSondage : Framasoft (https://github.com/framasoft)
 */
use Framadate\Message;
use Framadate\Services\LogService;
use Framadate\Services\MailService;
use Framadate\Services\PollService;
include_once __DIR__ . '/app/inc/init.php';
/* SERVICES */
/* -------- */
$logService = new LogService();
$pollService = new PollService($connect, $logService);
$mailService = new MailService($config['use_smtp']);
/* PAGE */
/* ---- */
$message = null;
if (!empty($_POST['mail'])) {
    $mail = filter_input(INPUT_POST, 'mail', FILTER_VALIDATE_EMAIL);
    if ($mail) {
        $polls = $pollService->findAllByAdminMail($mail);
        if (count($polls) > 0) {
            $smarty->assign('polls', $polls);
            $body = $smarty->fetch('mail/find_polls.tpl');
            $mailService->send($mail, __('Homepage', 'Where are my polls'), $body, 'SEND_POLLS');
            $message = new Message('success', __('FindPolls', 'Polls sent'));
        } else {
            $message = new Message('warning', __('Error', 'No polls found'));
Exemple #6
0
 * Auteurs de STUdS (projet initial) : Guilhem BORGHESI (borghesi@unistra.fr) et Raphaël DROZ
 * Auteurs de Framadate/OpenSondage : Framasoft (https://github.com/framasoft)
 */
use Framadate\Services\LogService;
use Framadate\Services\PollService;
use Framadate\Utils;
include_once __DIR__ . '/app/inc/init.php';
ob_start();
/* Variables */
/* --------- */
$poll_id = null;
$poll = null;
/* Services */
/*----------*/
$logService = new LogService();
$pollService = new PollService($connect, $logService);
/* PAGE */
/* ---- */
if (!empty($_GET['poll'])) {
    $poll_id = filter_input(INPUT_GET, 'poll', FILTER_VALIDATE_REGEXP, ['options' => ['regexp' => POLL_REGEX]]);
    $poll = $pollService->findById($poll_id);
}
if (!$poll) {
    $smarty->assign('error', __('Error', 'This poll doesn\'t exist !'));
    $smarty->display('error.tpl');
    exit;
}
$slots = $pollService->allSlotsByPoll($poll);
$votes = $pollService->allVotesByPollId($poll_id);
// CSV header
if ($poll->format === 'D') {