Merge: Use Smarty on creation poll first step

* Use Smarty on infos_sondage.php
* Rename infos_sondage.php => create_poll.php
* Replace __('Section\\Key') => __('Section', 'Key)

See merge request !42
This commit is contained in:
Olivier PEREZ 2015-03-31 00:11:38 +02:00
commit 97ce8ca965
43 changed files with 881 additions and 757 deletions

View File

@ -26,6 +26,6 @@ $content = ob_get_clean();
$smarty->assign('title', _('Administration'));
$smarty->assign('logs', $content);
$smarty->assign('title', __('Admin\\Logs'));
$smarty->assign('title', __('Admin', 'Logs'));
$smarty->display('admin/logs.tpl');

View File

@ -102,6 +102,6 @@ $smarty->assign('countSkipped', $countSkipped);
$smarty->assign('countTotal', $countTotal);
$smarty->assign('time', $total_time = round((microtime(true)-$_SERVER['REQUEST_TIME_FLOAT']), 4));
$smarty->assign('title', __('Admin\\Migration'));
$smarty->assign('title', __('Admin', 'Migration'));
$smarty->display('admin/migration.tpl');

View File

@ -95,6 +95,6 @@ $smarty->assign('crsf', $securityService->getToken('admin'));
$smarty->assign('search', $search);
$smarty->assign('search_query', buildSearchQuery($search));
$smarty->assign('title', __('Admin\\Polls'));
$smarty->assign('title', __('Admin', 'Polls'));
$smarty->display('admin/polls.tpl');

View File

@ -53,6 +53,6 @@ if ($action === 'purge' && $securityService->checkCsrf('admin', $_POST['csrf']))
$smarty->assign('message', $message);
$smarty->assign('crsf', $securityService->getToken('admin'));
$smarty->assign('title', __('Admin\\Purge'));
$smarty->assign('title', __('Admin', 'Purge'));
$smarty->display('admin/purge.tpl');

View File

@ -52,7 +52,7 @@ if (!empty($_GET['poll']) && strlen($_GET['poll']) === 24) {
}
if (!$poll) {
$smarty->assign('error', __('Error\\This poll doesn\'t exist !'));
$smarty->assign('error', __('Error', 'This poll doesn\'t exist !'));
$smarty->display('error.tpl');
exit;
}
@ -120,9 +120,9 @@ if (isset($_POST['update_poll_info'])) {
// Update poll in database
if ($updated && $adminPollService->updatePoll($poll)) {
$message = new Message('success', __('adminstuds\\Poll saved'));
$message = new Message('success', __('adminstuds', 'Poll saved'));
} else {
$message = new Message('danger', __('Error\\Failed to save poll'));
$message = new Message('danger', __('Error', 'Failed to save poll'));
$poll = $pollService->findById($poll_id);
}
}
@ -145,19 +145,19 @@ if (!empty($_POST['save'])) { // Save edition of an old vote
$choices = $inputService->filterArray($_POST['choices'], FILTER_VALIDATE_REGEXP, ['options' => ['regexp' => CHOICE_REGEX]]);
if (empty($editedVote)) {
$message = new Message('danger', __('Error\\Something is going wrong...'));
$message = new Message('danger', __('Error', 'Something is going wrong...'));
}
if (count($choices) != count($_POST['choices'])) {
$message = new Message('danger', __('Error\\There is a problem with your choices'));
$message = new Message('danger', __('Error', 'There is a problem with your choices'));
}
if ($message == null) {
// Update vote
$result = $pollService->updateVote($poll_id, $editedVote, $name, $choices);
if ($result) {
$message = new Message('success', __('adminstuds\\Vote updated'));
$message = new Message('success', __('adminstuds', 'Vote updated'));
} else {
$message = new Message('danger', __('Error\\Update vote failed'));
$message = new Message('danger', __('Error', 'Update vote failed'));
}
}
} elseif (isset($_POST['save'])) { // Add a new vote
@ -165,19 +165,19 @@ if (!empty($_POST['save'])) { // Save edition of an old vote
$choices = $inputService->filterArray($_POST['choices'], FILTER_VALIDATE_REGEXP, ['options' => ['regexp' => CHOICE_REGEX]]);
if (empty($name)) {
$message = new Message('danger', __('Error\\The name is invalid'));
$message = new Message('danger', __('Error', 'The name is invalid'));
}
if (count($choices) != count($_POST['choices'])) {
$message = new Message('danger', __('Error\\There is a problem with your choices'));
$message = new Message('danger', __('Error', 'There is a problem with your choices'));
}
if ($message == null) {
// Add vote
$result = $pollService->addVote($poll_id, $name, $choices);
if ($result) {
$message = new Message('success', __('adminstuds\\Vote added'));
$message = new Message('success', __('adminstuds', 'Vote added'));
} else {
$message = new Message('danger', __('Error\\Adding vote failed'));
$message = new Message('danger', __('Error', 'Adding vote failed'));
}
}
}
@ -189,9 +189,9 @@ if (!empty($_POST['save'])) { // Save edition of an old vote
if (!empty($_POST['delete_vote'])) {
$vote_id = filter_input(INPUT_POST, 'delete_vote', FILTER_VALIDATE_INT);
if ($adminPollService->deleteVote($poll_id, $vote_id)) {
$message = new Message('success', __('adminstuds\\Vote deleted'));
$message = new Message('success', __('adminstuds', 'Vote deleted'));
} else {
$message = new Message('danger', __('Error\\Failed to delete the vote'));
$message = new Message('danger', __('Error', 'Failed to delete the vote'));
}
}
@ -202,15 +202,15 @@ if (!empty($_POST['delete_vote'])) {
if (isset($_POST['remove_all_votes'])) {
$smarty->assign('poll_id', $poll_id);
$smarty->assign('admin_poll_id', $admin_poll_id);
$smarty->assign('title', __('Generic\\Poll') . ' - ' . $poll->title);
$smarty->assign('title', __('Generic', 'Poll') . ' - ' . $poll->title);
$smarty->display('confirm/delete_votes.tpl');
exit;
}
if (isset($_POST['confirm_remove_all_votes'])) {
if ($adminPollService->cleanVotes($poll_id)) {
$message = new Message('success', __('adminstuds\\All votes deleted'));
$message = new Message('success', __('adminstuds', 'All votes deleted'));
} else {
$message = new Message('danger', __('Error\\Failed to delete all votes'));
$message = new Message('danger', __('Error', 'Failed to delete all votes'));
}
}
@ -223,16 +223,16 @@ if (isset($_POST['add_comment'])) {
$comment = strip_tags($_POST['comment']);
if (empty($name)) {
$message = new Message('danger', __('Error\\The name is invalid'));
$message = new Message('danger', __('Error', 'The name is invalid'));
}
if ($message == null) {
// Add comment
$result = $pollService->addComment($poll_id, $name, $comment);
if ($result) {
$message = new Message('success', __('Comments\\Comment added'));
$message = new Message('success', __('Comments', 'Comment added'));
} else {
$message = new Message('danger', __('Error\\Comment failed'));
$message = new Message('danger', __('Error', 'Comment failed'));
}
}
@ -246,9 +246,9 @@ if (!empty($_POST['delete_comment'])) {
$comment_id = filter_input(INPUT_POST, 'delete_comment', FILTER_VALIDATE_INT);
if ($adminPollService->deleteComment($poll_id, $comment_id)) {
$message = new Message('success', __('adminstuds\\Comment deleted'));
$message = new Message('success', __('adminstuds', 'Comment deleted'));
} else {
$message = new Message('danger', __('Error\\Failed to delete the comment'));
$message = new Message('danger', __('Error', 'Failed to delete the comment'));
}
}
@ -259,15 +259,15 @@ if (!empty($_POST['delete_comment'])) {
if (isset($_POST['remove_all_comments'])) {
$smarty->assign('poll_id', $poll_id);
$smarty->assign('admin_poll_id', $admin_poll_id);
$smarty->assign('title', __('Generic\\Poll') . ' - ' . $poll->title);
$smarty->assign('title', __('Generic', 'Poll') . ' - ' . $poll->title);
$smarty->display('confirm/delete_comments.tpl');
exit;
}
if (isset($_POST['confirm_remove_all_comments'])) {
if ($adminPollService->cleanComments($poll_id)) {
$message = new Message('success', __('All comments deleted'));
$message = new Message('success', __('adminstuds', 'All comments deleted'));
} else {
$message = new Message('danger', __('Error\\Failed to delete all comments'));
$message = new Message('danger', __('Error', 'Failed to delete all comments'));
}
}
@ -278,19 +278,19 @@ if (isset($_POST['confirm_remove_all_comments'])) {
if (isset($_POST['delete_poll'])) {
$smarty->assign('poll_id', $poll_id);
$smarty->assign('admin_poll_id', $admin_poll_id);
$smarty->assign('title', __('Generic\\Poll') . ' - ' . $poll->title);
$smarty->assign('title', __('Generic', 'Poll') . ' - ' . $poll->title);
$smarty->display('confirm/delete_poll.tpl');
exit;
}
if (isset($_POST['confirm_delete_poll'])) {
if ($adminPollService->deleteEntirePoll($poll_id)) {
$message = new Message('success', __('Generic\\Poll fully deleted'));
$message = new Message('success', __('adminstuds', 'Poll fully deleted'));
} else {
$message = new Message('danger', __('Error\\Failed to delete the poll'));
$message = new Message('danger', __('Error', 'Failed to delete the poll'));
}
$smarty->assign('poll_id', $poll_id);
$smarty->assign('admin_poll_id', $admin_poll_id);
$smarty->assign('title', __('Generic\\Poll') . ' - ' . $poll->title);
$smarty->assign('title', __('Generic', 'Poll') . ' - ' . $poll->title);
$smarty->assign('message', $message);
$smarty->display('poll_deleted.tpl');
exit;
@ -316,9 +316,9 @@ if (!empty($_POST['delete_column'])) {
}
if ($result) {
$message = new Message('success', __('Column deleted'));
$message = new Message('success', __('adminstuds', 'Column deleted'));
} else {
$message = new Message('danger', __('Error\\Failed to delete the column'));
$message = new Message('danger', __('Error', 'Failed to delete the column'));
}
}
@ -330,7 +330,7 @@ if (isset($_POST['add_slot'])) {
$smarty->assign('poll_id', $poll_id);
$smarty->assign('admin_poll_id', $admin_poll_id);
$smarty->assign('format', $poll->format);
$smarty->assign('title', __('Generic\\Poll') . ' - ' . $poll->title);
$smarty->assign('title', __('Generic', 'Poll') . ' - ' . $poll->title);
$smarty->display('add_slot.tpl');
exit;
}
@ -347,9 +347,9 @@ if (isset($_POST['confirm_add_slot'])) {
}
if ($result) {
$message = new Message('success', __('adminstuds\\Choice added'));
$message = new Message('success', __('adminstuds', 'Choice added'));
} else {
$message = new Message('danger', __('Error\\Failed to add the column'));
$message = new Message('danger', __('Error', 'Failed to add the column'));
}
}
@ -363,7 +363,7 @@ $comments = $pollService->allCommentsByPollId($poll_id);
$smarty->assign('poll_id', $poll_id);
$smarty->assign('admin_poll_id', $admin_poll_id);
$smarty->assign('poll', $poll);
$smarty->assign('title', __('Generic\\Poll') . ' - ' . $poll->title);
$smarty->assign('title', __('Generic', 'Poll') . ' - ' . $poll->title);
$smarty->assign('expired', strtotime($poll->end_date) < time());
$smarty->assign('deletion_date', $poll->end_date + PURGE_DELAY * 86400);
$smarty->assign('slots', $poll->format === 'D' ? $pollService->splitSlots($slots) : $slots);

View File

@ -182,4 +182,8 @@ class Utils {
return $cleaned;
}
public static function fromPostOrDefault($postKey, $default = '') {
return !empty($_POST[$postKey]) ? Utils::htmlEscape($_POST[$postKey]) : $default;
}
}

View File

@ -81,9 +81,9 @@ $config = [
'show_what_is_that' => true, // display "how to use" section
'show_the_software' => true, // display technical information about the software
'show_cultivate_your_garden' => true, // display "developpement and administration" information
/* choix_autre.php / choix_date.php */
/* create_classic_poll.php / create_date_poll.php */
'default_poll_duration' => 180, // default values for the new poll duration (number of days).
/* choix_autre.php */
/* create_classic_poll.php */
'user_can_add_img_or_link' => true, // user can add link or URL when creating his poll.
];

View File

@ -39,11 +39,11 @@ if (isset($_POST['lang']) && is_string($_POST['lang']) && in_array($_POST['lang'
$html_lang = substr($locale, 0, 2);
/* Date Format */
$date_format['txt_full'] = __('Date\\FULL'); //summary in choix_date.php and removal date in choix_(date|autre).php
$date_format['txt_short'] = __('Date\\SHORT'); // radio title
$date_format['txt_day'] = __('Date\\DAY');
$date_format['txt_date'] = __('Date\\DATE');
$date_format['txt_month_year'] = __('Date\\MONTH_YEAR');
$date_format['txt_full'] = __('Date', 'FULL'); //summary in create_date_poll.php and removal date in choix_(date|autre).php
$date_format['txt_short'] = __('Date', 'SHORT'); // radio title
$date_format['txt_day'] = __('Date', 'DAY');
$date_format['txt_date'] = __('Date', 'DATE');
$date_format['txt_month_year'] = __('Date', 'MONTH_YEAR');
if (strtoupper(substr(PHP_OS, 0, 3)) == 'WIN') { //%e can't be used on Windows platform, use %#d instead
foreach ($date_format as $k => $v) {
$date_format[$k] = preg_replace('#(?<!%)((?:%%)*)%e#', '\1%#d', $v); //replace %e by %#d for windows

View File

@ -30,15 +30,15 @@ function bandeau_titre($titre)
if(count($ALLOWED_LANGUAGES) > 1){
echo '<form method="post" action="" class="hidden-print">
<div class="input-group input-group-sm pull-right col-md-2 col-xs-4">
<select name="lang" class="form-control" title="'. __('Language selector\\Select the language') .'" >' . liste_lang() . '</select>
<select name="lang" class="form-control" title="'. __('Language selector', 'Select the language') .'" >' . liste_lang() . '</select>
<span class="input-group-btn">
<button type="submit" class="btn btn-default btn-sm" title="'. __('Language selector\\Change the language') .'">OK</button>
<button type="submit" class="btn btn-default btn-sm" title="'. __('Language selector', 'Change the language') .'">OK</button>
</span>
</div>
</form>';
}
echo '
<h1><a href="' . Utils::get_server_name() . '" title="' . __('Generic\\Home') . ' - ' . NOMAPPLICATION . '">' . $img . '</a></h1>
<h1><a href="' . Utils::get_server_name() . '" title="' . __('Generic', 'Home') . ' - ' . NOMAPPLICATION . '">' . $img . '</a></h1>
<h2 class="lead"><i>'. $titre .'</i></h2>
<hr class="trait" role="presentation" />
</header>
@ -48,7 +48,7 @@ function bandeau_titre($titre)
$tables = $connect->allTables();
$diff = array_diff([Utils::table('comment'), Utils::table('poll'), Utils::table('slot'), Utils::table('vote')], $tables);
if (0 != count($diff)) {
echo '<div class="alert alert-danger">'. __('Error\\Framadate is not properly installed, please check the "INSTALL" to setup the database before continuing.') .'</div>';
echo '<div class="alert alert-danger">'. __('Error', 'Framadate is not properly installed, please check the "INSTALL" to setup the database before continuing.') .'</div>';
bandeau_pied();
die();
}

View File

@ -125,8 +125,8 @@ if (empty($_SESSION['form']->title) || empty($_SESSION['form']->admin_name) || (
} // Step 3/4 : Confirm poll creation and choose a removal date
else if (isset($_POST['fin_sondage_autre'])) {
Utils::print_header(__('Step 3\\Removal date and confirmation (3 on 3)'));
bandeau_titre(__('Step 3\\Removal date and confirmation (3 on 3)'));
Utils::print_header(__('Step 3', 'Removal date and confirmation (3 on 3)'));
bandeau_titre(__('Step 3', 'Removal date and confirmation (3 on 3)'));
// Store choices in $_SESSION
@ -153,17 +153,17 @@ if (empty($_SESSION['form']->title) || empty($_SESSION['form']->admin_name) || (
preg_match_all('/\[(.*?)\]\((.*?)\)/', $choice->getName(), $md_a); // Markdown [text](href)
if (isset($md_a_img[2][0]) && $md_a_img[2][0] != '' && isset($md_a_img[3][0]) && $md_a_img[3][0] != '') { // [![alt](src)](href)
$li_subject_text = (isset($md_a_img[1][0]) && $md_a_img[1][0] != '') ? stripslashes($md_a_img[1][0]) : __('Generic\\Choice') . ' ' . ($i + 1);
$li_subject_text = (isset($md_a_img[1][0]) && $md_a_img[1][0] != '') ? stripslashes($md_a_img[1][0]) : __('Generic', 'Choice') . ' ' . ($i + 1);
$li_subject_html = '<a href="' . $md_a_img[3][0] . '"><img src="' . $md_a_img[2][0] . '" class="img-responsive" alt="' . $li_subject_text . '" /></a>';
} elseif (isset($md_img[2][0]) && $md_img[2][0] != '') { // ![alt](src)
$li_subject_text = (isset($md_img[1][0]) && $md_img[1][0] != '') ? stripslashes($md_img[1][0]) : __('Generic\\Choice') . ' ' . ($i + 1);
$li_subject_text = (isset($md_img[1][0]) && $md_img[1][0] != '') ? stripslashes($md_img[1][0]) : __('Generic', 'Choice') . ' ' . ($i + 1);
$li_subject_html = '<img src="' . $md_img[2][0] . '" class="img-responsive" alt="' . $li_subject_text . '" />';
} elseif (isset($md_a[2][0]) && $md_a[2][0] != '') { // [text](href)
$li_subject_text = (isset($md_a[1][0]) && $md_a[1][0] != '') ? stripslashes($md_a[1][0]) : __('Generic\\Choice') . ' ' . ($i + 1);
$li_subject_text = (isset($md_a[1][0]) && $md_a[1][0] != '') ? stripslashes($md_a[1][0]) : __('Generic', 'Choice') . ' ' . ($i + 1);
$li_subject_html = '<a href="' . $md_a[2][0] . '">' . $li_subject_text . '</a>';
} else { // text only
@ -180,37 +180,37 @@ if (empty($_SESSION['form']->title) || empty($_SESSION['form']->admin_name) || (
$end_date_str = utf8_encode(strftime('%d/%m/%Y', $max_time)); //textual date
echo '
<form name="formulaire" action="' . Utils::get_server_name() . 'choix_autre.php" method="POST" class="form-horizontal" role="form">
<form name="formulaire" action="' . Utils::get_server_name() . 'create_classic_poll.php" method="POST" class="form-horizontal" role="form">
<div class="row">
<div class="col-md-8 col-md-offset-2">
<div class="well summary">
<h4>' . __('Step 3\\List of your choices') . '</h4>
<h4>' . __('Step 3', 'List of your choices') . '</h4>
' . $summary . '
</div>
<div class="alert alert-info">
<p>' . __('Step 3\\Your poll will be automatically removed after') . ' ' . $config['default_poll_duration'] . ' ' . __('Generic\\days') . '.<br />' . __('Step 3\\You can set a closer removal date for it.') . '</p>
<p>' . __('Step 3', 'Your poll will be automatically removed after') . ' ' . $config['default_poll_duration'] . ' ' . __('Generic', 'days') . '.<br />' . __('Step 3', 'You can set a closer removal date for it.') . '</p>
<div class="form-group">
<label for="enddate" class="col-sm-5 control-label">' . __('Step 3\\Removal date:') . '</label>
<label for="enddate" class="col-sm-5 control-label">' . __('Step 3', 'Removal date:') . '</label>
<div class="col-sm-6">
<div class="input-group date">
<span class="input-group-addon"><i class="glyphicon glyphicon-calendar text-info"></i></span>
<input type="text" class="form-control" id="enddate" data-date-format="' . __('Date\\dd/mm/yyyy') . '" aria-describedby="dateformat" name="enddate" value="' . $end_date_str . '" size="10" maxlength="10" placeholder="' . __("dd/mm/yyyy") . '" />
<input type="text" class="form-control" id="enddate" data-date-format="' . __('Date', 'dd/mm/yyyy') . '" aria-describedby="dateformat" name="enddate" value="' . $end_date_str . '" size="10" maxlength="10" placeholder="' . __("dd/mm/yyyy") . '" />
</div>
</div>
<span id="dateformat" class="sr-only">' . __('Date\\dd/mm/yyyy') . '</span>
<span id="dateformat" class="sr-only">' . __('Date', 'dd/mm/yyyy') . '</span>
</div>
</div>
<div class="alert alert-warning">
<p>' . __('Step 3\\Once you have confirmed the creation of your poll, you will be automatically redirected on the administration page of your poll.') . '</p>';
<p>' . __('Step 3', 'Once you have confirmed the creation of your poll, you will be automatically redirected on the administration page of your poll.') . '</p>';
if ($config['use_smtp'] == true) {
echo '
<p>' . __('Step 3\\Then, you will receive quickly two emails: one contening the link of your poll for sending it to the voters, the other contening the link to the administration page of your poll.') . '</p>';
<p>' . __('Step 3', 'Then, you will receive quickly two emails: one contening the link of your poll for sending it to the voters, the other contening the link to the administration page of your poll.') . '</p>';
}
echo '
</div>
<p class="text-right">
<button class="btn btn-default" onclick="javascript:window.history.back();" title="' . __('Step 3\\Back to step 2') . '">' . __('Generic\\Back') . '</button>
<button name="confirmecreation" value="confirmecreation" type="submit" class="btn btn-success">' . __('Step 3\\Create the poll') . '</button>
<button class="btn btn-default" onclick="javascript:window.history.back();" title="' . __('Step 3', 'Back to step 2') . '">' . __('Generic', 'Back') . '</button>
<button name="confirmecreation" value="confirmecreation" type="submit" class="btn btn-success">' . __('Step 3', 'Create the poll') . '</button>
</p>
</div>
</div>
@ -220,19 +220,19 @@ if (empty($_SESSION['form']->title) || empty($_SESSION['form']->admin_name) || (
// Step 2/4 : Select choices of the poll
} else {
Utils::print_header(__('Step 2 classic\\Poll subjects (2 on 3)'));
bandeau_titre(__('Step 2 classic\\Poll subjects (2 on 3)'));
Utils::print_header(__('Step 2 classic', 'Poll subjects (2 on 3)'));
bandeau_titre(__('Step 2 classic', 'Poll subjects (2 on 3)'));
echo '
<form name="formulaire" action="' . Utils::get_server_name() . 'choix_autre.php" method="POST" class="form-horizontal" role="form">
<form name="formulaire" action="' . Utils::get_server_name() . 'create_classic_poll.php" method="POST" class="form-horizontal" role="form">
<div class="row">
<div class="col-md-8 col-md-offset-2">';
echo '
<div class="alert alert-info">
<p>' . __('Step 2 classic\\To make a generic poll you need to propose at least two choices between differents subjects.') . '</p>
<p>' . __('Step 2 classic\\You can add or remove additional choices with the buttons') . ' <span class="glyphicon glyphicon-minus text-info"></span><span class="sr-only">' . __('Generic\\Remove') . '</span> <span class="glyphicon glyphicon-plus text-success"></span><span class="sr-only">' . __('Generic\\Add') . '</span></p>';
<p>' . __('Step 2 classic', 'To make a generic poll you need to propose at least two choices between differents subjects.') . '</p>
<p>' . __('Step 2 classic', 'You can add or remove additional choices with the buttons') . ' <span class="glyphicon glyphicon-minus text-info"></span><span class="sr-only">' . __('Generic', 'Remove') . '</span> <span class="glyphicon glyphicon-plus text-success"></span><span class="sr-only">' . __('Generic', 'Add') . '</span></p>';
if ($config['user_can_add_img_or_link']) {
echo ' <p>' . __('Step 2 classic\\It\'s possible to propose links or images by using') . ' <a href="http://' . $html_lang . '.wikipedia.org/wiki/Markdown">' . __('Step 2 classic\\the Markdown syntax') . '</a>.</p>';
echo ' <p>' . __('Step 2 classic', 'It\'s possible to propose links or images by using') . ' <a href="http://' . $html_lang . '.wikipedia.org/wiki/Markdown">' . __('Step 2 classic', 'the Markdown syntax') . '</a>.</p>';
}
echo ' </div>' . "\n";
@ -243,11 +243,11 @@ if (empty($_SESSION['form']->title) || empty($_SESSION['form']->admin_name) || (
$choice = isset($choices[$i]) ? $choices[$i] : new Choice();
echo '
<div class="form-group choice-field">
<label for="choice' . $i . '" class="col-sm-2 control-label">' . __('Generic\\Choice') . ' ' . ($i + 1) . '</label>
<label for="choice' . $i . '" class="col-sm-2 control-label">' . __('Generic', 'Choice') . ' ' . ($i + 1) . '</label>
<div class="col-sm-10 input-group">
<input type="text" class="form-control" name="choices[]" size="40" value="' . $choice->getName() . '" id="choice' . $i . '" />';
if ($config['user_can_add_img_or_link']) {
echo '<span class="input-group-addon btn-link md-a-img" title="' . __('Step 2 classic\\Add a link or an image') . ' - ' . __('Generic\\Choice') . ' ' . ($i + 1) . '" ><span class="glyphicon glyphicon-picture"></span> <span class="glyphicon glyphicon-link"></span></span>';
echo '<span class="input-group-addon btn-link md-a-img" title="' . __('Step 2 classic', 'Add a link or an image') . ' - ' . __('Generic', 'Choice') . ' ' . ($i + 1) . '" ><span class="glyphicon glyphicon-picture"></span> <span class="glyphicon glyphicon-link"></span></span>';
}
echo '
</div>
@ -257,13 +257,13 @@ if (empty($_SESSION['form']->title) || empty($_SESSION['form']->admin_name) || (
echo '
<div class="col-md-4">
<div class="btn-group btn-group">
<button type="button" id="remove-a-choice" class="btn btn-default" title="' . __('Step 2 classic\\Remove a choice') . '"><span class="glyphicon glyphicon-minus text-info"></span><span class="sr-only">' . __('Generic\\Remove') . '</span></button>
<button type="button" id="add-a-choice" class="btn btn-default" title="' . __('Step 2 classic\\Add a choice') . '"><span class="glyphicon glyphicon-plus text-success"></span><span class="sr-only">' . __('Generic\\Add') . '</span></button>
<button type="button" id="remove-a-choice" class="btn btn-default" title="' . __('Step 2 classic', 'Remove a choice') . '"><span class="glyphicon glyphicon-minus text-info"></span><span class="sr-only">' . __('Generic', 'Remove') . '</span></button>
<button type="button" id="add-a-choice" class="btn btn-default" title="' . __('Step 2 classic', 'Add a choice') . '"><span class="glyphicon glyphicon-plus text-success"></span><span class="sr-only">' . __('Generic', 'Add') . '</span></button>
</div>
</div>
<div class="col-md-8 text-right">
<a class="btn btn-default" href="' . Utils::get_server_name() . 'infos_sondage.php?choix_sondage=autre" title="' . __('Step 2\\Back to step 1') . '">' . __('Generic\\Back') . '</a>
<button name="fin_sondage_autre" value="' . __('Generic\\Next') . '" type="submit" class="btn btn-success disabled" title="' . __('Step 2\\Go to step 3') . '">' . __('Generic\\Next') . '</button>
<a class="btn btn-default" href="' . Utils::get_server_name() . 'create_poll.php?type=classic" title="' . __('Step 2', 'Back to step 1') . '">' . __('Generic', 'Back') . '</a>
<button name="fin_sondage_autre" value="' . __('Generic', 'Next') . '" type="submit" class="btn btn-success disabled" title="' . __('Step 2', 'Go to step 3') . '">' . __('Generic', 'Next') . '</button>
</div>
</div>
</div>
@ -271,27 +271,27 @@ if (empty($_SESSION['form']->title) || empty($_SESSION['form']->admin_name) || (
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">&times;</span><span class="sr-only">' . __('Generic\\Close') . '</span></button>
<p class="modal-title" id="md-a-imgModalLabel">' . __('Step 2 classic\\Add a link or an image') . '</p>
<button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">&times;</span><span class="sr-only">' . __('Generic', 'Close') . '</span></button>
<p class="modal-title" id="md-a-imgModalLabel">' . __('Step 2 classic', 'Add a link or an image') . '</p>
</div>
<div class="modal-body">
<p class="alert alert-info">' . __('Step 2 classic\\These fields are optional. You can add a link, an image or both.') . '</p>
<p class="alert alert-info">' . __('Step 2 classic', 'These fields are optional. You can add a link, an image or both.') . '</p>
<div class="form-group">
<label for="md-img"><span class="glyphicon glyphicon-picture"></span> ' . __('Step 2 classic\\URL of the image') . '</label>
<label for="md-img"><span class="glyphicon glyphicon-picture"></span> ' . __('Step 2 classic', 'URL of the image') . '</label>
<input id="md-img" type="text" placeholder="http://…" class="form-control" size="40" />
</div>
<div class="form-group">
<label for="md-a"><span class="glyphicon glyphicon-link"></span> ' . __('Generic\\Link') . '</label>
<label for="md-a"><span class="glyphicon glyphicon-link"></span> ' . __('Generic', 'Link') . '</label>
<input id="md-a" type="text" placeholder="http://…" class="form-control" size="40" />
</div>
<div class="form-group">
<label for="md-text">' . __('Step 2 classic\\Alternative text') . '</label>
<label for="md-text">' . __('Step 2 classic', 'Alternative text') . '</label>
<input id="md-text" type="text" class="form-control" size="40" />
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">' . __('Generic\\Cancel') . '</button>
<button type="button" class="btn btn-primary">' . __('Generic\\Add') . '</button>
<button type="button" class="btn btn-default" data-dismiss="modal">' . __('Generic', 'Cancel') . '</button>
<button type="button" class="btn btn-primary">' . __('Generic', 'Add') . '</button>
</div>
</div>
</div>

View File

@ -43,13 +43,13 @@ if (is_readable('bandeaux_local.php')) {
// Step 1/4 : error if $_SESSION from info_sondage are not valid
if (!isset($_SESSION['form']->title) || !isset($_SESSION['form']->admin_name) || ($config['use_smtp'] && !isset($_SESSION['form']->admin_mail))) {
Utils::print_header ( __('Error\\Error!') );
bandeau_titre(__('Error\\Error!'));
Utils::print_header ( __('Error', 'Error!') );
bandeau_titre(__('Error', 'Error!'));
echo '
<div class="alert alter-danger">
<h3>' . __('Error\\You haven\'t filled the first section of the poll creation.') . ' !</h3>
<p>' . __('Error\\Back to the homepage of') . ' ' . '<a href="' . Utils::get_server_name() . '">' . NOMAPPLICATION . '</a>.</p>
<h3>' . __('Error', 'You haven\'t filled the first section of the poll creation.') . ' !</h3>
<p>' . __('Error', 'Back to the homepage of') . ' ' . '<a href="' . Utils::get_server_name() . '">' . NOMAPPLICATION . '</a>.</p>
</div>';
@ -94,20 +94,20 @@ if (!isset($_SESSION['form']->title) || !isset($_SESSION['form']->admin_name) ||
// Send confirmation by mail if enabled
if ($config['use_smtp'] === true) {
$message = __("Mail\\This is the message you have to send to the people you want to poll. \nNow, you have to send this message to everyone you want to poll.");
$message = __('Mail', "This is the message you have to send to the people you want to poll. \nNow, you have to send this message to everyone you want to poll.");
$message .= "\n\n";
$message .= stripslashes(html_entity_decode($_SESSION['form']->admin_name, ENT_QUOTES, 'UTF-8')) . ' ' . __('Mail\\hast just created a poll called') . ' : "' . stripslashes(htmlspecialchars_decode($_SESSION['form']->title, ENT_QUOTES)) . "\".\n";
$message .= __('Mail\\Thanks for filling the poll at the link above') . " :\n\n%s\n\n" . __('Mail\\Thanks for your confidence.') . "\n" . NOMAPPLICATION;
$message .= stripslashes(html_entity_decode($_SESSION['form']->admin_name, ENT_QUOTES, 'UTF-8')) . ' ' . __('Mail', 'hast just created a poll called') . ' : "' . stripslashes(htmlspecialchars_decode($_SESSION['form']->title, ENT_QUOTES)) . "\".\n";
$message .= __('Mail', 'Thanks for filling the poll at the link above') . " :\n\n%s\n\n" . __('Mail', 'Thanks for your confidence.') . "\n" . NOMAPPLICATION;
$message_admin = __("Mail\\This message should NOT be sent to the polled people. It is private for the poll's creator.\n\nYou can now modify it at the link above");
$message_admin .= " :\n\n" . "%s \n\n" . __('Mail\\Thanks for your confidence.') . "\n" . NOMAPPLICATION;
$message_admin = __('Mail', "This message should NOT be sent to the polled people. It is private for the poll's creator.\n\nYou can now modify it at the link above");
$message_admin .= " :\n\n" . "%s \n\n" . __('Mail', 'Thanks for your confidence.') . "\n" . NOMAPPLICATION;
$message = sprintf($message, Utils::getUrlSondage($poll_id));
$message_admin = sprintf($message_admin, Utils::getUrlSondage($admin_poll_id, true));
if ($mailService->isValidEmail($_SESSION['form']->admin_mail)) {
$mailService->send($_SESSION['form']->admin_mail, '[' . NOMAPPLICATION . '][' . __('Mail\\Author\'s message') . '] ' . __('Generic\\Poll') . ' : ' . stripslashes(htmlspecialchars_decode($_SESSION['form']->title, ENT_QUOTES)), $message_admin);
$mailService->send($_SESSION['form']->admin_mail, '[' . NOMAPPLICATION . '][' . __('Mail\\For sending to the polled users') . '] ' . __('Generic\\Poll') . ' : ' . stripslashes(htmlspecialchars_decode($_SESSION['form']->title, ENT_QUOTES)), $message);
$mailService->send($_SESSION['form']->admin_mail, '[' . NOMAPPLICATION . '][' . __('Mail', 'Author\'s message') . '] ' . __('Generic', 'Poll') . ' : ' . stripslashes(htmlspecialchars_decode($_SESSION['form']->title, ENT_QUOTES)), $message_admin);
$mailService->send($_SESSION['form']->admin_mail, '[' . NOMAPPLICATION . '][' . __('Mail', 'For sending to the polled users') . '] ' . __('Generic', 'Poll') . ' : ' . stripslashes(htmlspecialchars_decode($_SESSION['form']->title, ENT_QUOTES)), $message);
}
}
@ -154,8 +154,8 @@ if (!isset($_SESSION['form']->title) || !isset($_SESSION['form']->admin_name) ||
// Step 3/4 : Confirm poll creation
if (!empty($_POST['choixheures']) && !isset($_SESSION['form']->totalchoixjour)) {
Utils::print_header ( __('Step 3\\Removal date and confirmation (3 on 3)') );
bandeau_titre(__('Step 3\\Removal date and confirmation (3 on 3)'));
Utils::print_header ( __('Step 3', 'Removal date and confirmation (3 on 3)') );
bandeau_titre(__('Step 3', 'Removal date and confirmation (3 on 3)'));
$_SESSION['form']->sortChoices();
$last_date = $_SESSION['form']->lastChoice()->getName();
@ -178,37 +178,37 @@ if (!isset($_SESSION['form']->title) || !isset($_SESSION['form']->admin_name) ||
$end_date_str = utf8_encode(strftime('%d/%m/%Y', $max_time)); //textual date
echo '
<form name="formulaire" action="' . Utils::get_server_name() . 'choix_date.php" method="POST" class="form-horizontal" role="form">
<form name="formulaire" action="' . Utils::get_server_name() . 'create_date_poll.php" method="POST" class="form-horizontal" role="form">
<div class="row" id="selected-days">
<div class="col-md-8 col-md-offset-2">
<h3>'. __('Step 3\\Confirm the creation of your poll') .'</h3>
<h3>'. __('Step 3', 'Confirm the creation of your poll') .'</h3>
<div class="well summary">
<h4>'. __('Step 3\\List of your choices').'</h4>
<h4>'. __('Step 3', 'List of your choices').'</h4>
'. $summary .'
</div>
<div class="alert alert-info clearfix">
<p>' . __('Step 3\\Your poll will be automatically removed after') . ' ' . $config['default_poll_duration'] . ' ' . __('Generic\\days') . ' ' .__('Step 3\\after the last date of your poll:') . '<br />' . __('Step 3\\You can set a closer removal date for it.') .'</p>
<p>' . __('Step 3', 'Your poll will be automatically removed after') . ' ' . $config['default_poll_duration'] . ' ' . __('Generic', 'days') . ' ' .__('Step 3', 'after the last date of your poll:') . '<br />' . __('Step 3', 'You can set a closer removal date for it.') .'</p>
<div class="form-group">
<label for="enddate" class="col-sm-5 control-label">'. __('Step 3\\Removal date:') .'</label>
<label for="enddate" class="col-sm-5 control-label">'. __('Step 3', 'Removal date:') .'</label>
<div class="col-sm-6">
<div class="input-group date">
<span class="input-group-addon"><i class="glyphicon glyphicon-calendar text-info"></i></span>
<input type="text" class="form-control" id="enddate" data-date-format="'. __('Date\\dd/mm/yyyy') .'" aria-describedby="dateformat" name="enddate" value="'.$end_date_str.'" size="10" maxlength="10" placeholder="'. __('dd/mm/yyyy') .'" />
<input type="text" class="form-control" id="enddate" data-date-format="'. __('Date', 'dd/mm/yyyy') .'" aria-describedby="dateformat" name="enddate" value="'.$end_date_str.'" size="10" maxlength="10" placeholder="'. __('dd/mm/yyyy') .'" />
</div>
</div>
<span id="dateformat" class="sr-only">('. __("Date\\dd/mm/yyyy") .')</span>
<span id="dateformat" class="sr-only">('. __('Date', 'dd/mm/yyyy') .')</span>
</div>
</div>
<div class="alert alert-warning">
<p>'. __('Step 3\\Once you have confirmed the creation of your poll, you will be automatically redirected on the administration page of your poll.'). '</p>';
<p>'. __('Step 3', 'Once you have confirmed the creation of your poll, you will be automatically redirected on the administration page of your poll.'). '</p>';
if($config['use_smtp'] == true) {
echo '<p>' . __('Step 3\\Then, you will receive quickly two emails: one contening the link of your poll for sending it to the voters, the other contening the link to the administration page of your poll.') .'</p>';
echo '<p>' . __('Step 3', 'Then, you will receive quickly two emails: one contening the link of your poll for sending it to the voters, the other contening the link to the administration page of your poll.') .'</p>';
}
echo '
</div>
<p class="text-right">
<button class="btn btn-default" onclick="javascript:window.history.back();" title="'. __('Step 3\\Back to step 2') . '">'. __('Generic\\Back') . '</button>
<button name="confirmation" value="confirmation" type="submit" class="btn btn-success">'. __('Step 3\\Create the poll') . '</button>
<button class="btn btn-default" onclick="javascript:window.history.back();" title="'. __('Step 3', 'Back to step 2') . '">'. __('Generic', 'Back') . '</button>
<button name="confirmation" value="confirmation" type="submit" class="btn btn-success">'. __('Step 3', 'Create the poll') . '</button>
</p>
</div>
</div>
@ -218,18 +218,18 @@ if (!isset($_SESSION['form']->title) || !isset($_SESSION['form']->admin_name) ||
// Step 2/4 : Select dates of the poll
} else {
Utils::print_header(__('Step 2 date\\Poll dates (2 on 3)'));
bandeau_titre(__('Step 2 date\\Poll dates (2 on 3)'));
Utils::print_header(__('Step 2 date', 'Poll dates (2 on 3)'));
bandeau_titre(__('Step 2 date', 'Poll dates (2 on 3)'));
echo '
<form name="formulaire" action="' . Utils::get_server_name() . 'choix_date.php" method="POST" class="form-horizontal" role="form">
<form name="formulaire" action="' . Utils::get_server_name() . 'create_date_poll.php" method="POST" class="form-horizontal" role="form">
<div class="row" id="selected-days">
<div class="col-md-10 col-md-offset-1">
<h3>'. __('Step 2 date\\Choose the dates of your poll') .'</h3>
<h3>'. __('Step 2 date', 'Choose the dates of your poll') .'</h3>
<div class="alert alert-info">
<p>'. __('Step 2 date\\To schedule an event you need to propose at least two choices (two hours for one day or two days).').'</p>
<p>'. __('Step 2 date\\You can add or remove additionnal days and hours with the buttons') .' <span class="glyphicon glyphicon-minus text-info"></span><span class="sr-only">'. __('Remove') .'</span> <span class="glyphicon glyphicon-plus text-success"></span><span class="sr-only">'. __('Add') .'</span></p>
<p>'. __('Step 2 date\\For each selected day, you can choose, or not, meeting hours (e.g.: "8h", "8:30", "8h-10h", "evening", etc.)').'</p>
<p>'. __('Step 2 date', 'To schedule an event you need to propose at least two choices (two hours for one day or two days).').'</p>
<p>'. __('Step 2 date', 'You can add or remove additionnal days and hours with the buttons') .' <span class="glyphicon glyphicon-minus text-info"></span><span class="sr-only">'. __('Remove') .'</span> <span class="glyphicon glyphicon-plus text-success"></span><span class="sr-only">'. __('Add') .'</span></p>
<p>'. __('Step 2 date', 'For each selected day, you can choose, or not, meeting hours (e.g.: "8h", "8:30", "8h-10h", "evening", etc.)').'</p>
</div>';
// Fields days : 3 by default
@ -240,12 +240,12 @@ if (!isset($_SESSION['form']->title) || !isset($_SESSION['form']->admin_name) ||
<fieldset>
<div class="form-group">
<legend>
<label class="sr-only" for="day'.$i.'">'. __('Generic\\Day') .' '. ($i+1) .'</label>
<label class="sr-only" for="day'.$i.'">'. __('Generic', 'Day') .' '. ($i+1) .'</label>
<div class="input-group date col-xs-7">
<span class="input-group-addon"><i class="glyphicon glyphicon-calendar text-info"></i></span>
<input type="text" class="form-control" id="day'.$i.'" title="'. __('Generic\\Day') .' '. ($i+1) .'" data-date-format="'. __('Date\\dd/mm/yyyy') .'" aria-describedby="dateformat'.$i.'" name="days[]" value="'.$day_value.'" size="10" maxlength="10" placeholder="'. __('Date\\dd/mm/yyyy') .'" />
<input type="text" class="form-control" id="day'.$i.'" title="'. __('Generic', 'Day') .' '. ($i+1) .'" data-date-format="'. __('Date', 'dd/mm/yyyy') .'" aria-describedby="dateformat'.$i.'" name="days[]" value="'.$day_value.'" size="10" maxlength="10" placeholder="'. __('Date', 'dd/mm/yyyy') .'" />
</div>
<span id="dateformat'.$i.'" class="sr-only">('. __('Date\\dd/mm/yyyy') .')</span>
<span id="dateformat'.$i.'" class="sr-only">('. __('Date', 'dd/mm/yyyy') .')</span>
</legend>'."\n";
// Fields hours : 3 by default
@ -254,38 +254,38 @@ if (!isset($_SESSION['form']->title) || !isset($_SESSION['form']->admin_name) ||
$hour_value = isset($_SESSION['horaires'.$i][$j]) ? $_SESSION['horaires'.$i][$j] : '';
echo '
<div class="col-sm-2">
<label for="d'.$i.'-h'.$j.'" class="sr-only control-label">'. __('Generic\\Time') .' '. ($j+1) .'</label>
<input type="text" class="form-control hours" title="'.$day_value.' - '. __('Generic\\Time') .' '. ($j+1) .'" placeholder="'. __('Generic\\Time') .' '. ($j+1) .'" id="d'.$i.'-h'.$j.'" name="horaires'.$i.'[]" value="'.$hour_value.'" />
<label for="d'.$i.'-h'.$j.'" class="sr-only control-label">'. __('Generic', 'Time') .' '. ($j+1) .'</label>
<input type="text" class="form-control hours" title="'.$day_value.' - '. __('Generic', 'Time') .' '. ($j+1) .'" placeholder="'. __('Generic', 'Time') .' '. ($j+1) .'" id="d'.$i.'-h'.$j.'" name="horaires'.$i.'[]" value="'.$hour_value.'" />
</div>'."\n";
}
echo '
<div class="col-sm-2"><div class="btn-group btn-group-xs" style="margin-top: 5px;">
<button type="button" title="'. __('Step 2 date\\Remove an hour') .'" class="remove-an-hour btn btn-default"><span class="glyphicon glyphicon-minus text-info"></span><span class="sr-only">'. __("Remove an hour") .'</span></button>
<button type="button" title="'. __('Step 2 date\\Add an hour') .'" class="add-an-hour btn btn-default"><span class="glyphicon glyphicon-plus text-success"></span><span class="sr-only">'. __("Add an hour") .'</span></button>
<button type="button" title="'. __('Step 2 date', 'Remove an hour') .'" class="remove-an-hour btn btn-default"><span class="glyphicon glyphicon-minus text-info"></span><span class="sr-only">'. __('Step 2 date', 'Remove an hour') .'</span></button>
<button type="button" title="'. __('Step 2 date', 'Add an hour') .'" class="add-an-hour btn btn-default"><span class="glyphicon glyphicon-plus text-success"></span><span class="sr-only">'. __('Step 2 date', 'Add an hour') .'</span></button>
</div></div>
</div>
</fieldset>';
}
echo '
<div class="col-md-4">
<button type="button" id="copyhours" class="btn btn-default disabled" title="'. __('Step 2 date\\Copy hours of the first day') .'"><span class="glyphicon glyphicon-sort-by-attributes-alt text-info"></span><span class="sr-only">'. __('Step 2 date\\Copy hours of the first day') .'</span></button>
<button type="button" id="copyhours" class="btn btn-default disabled" title="'. __('Step 2 date', 'Copy hours of the first day') .'"><span class="glyphicon glyphicon-sort-by-attributes-alt text-info"></span><span class="sr-only">'. __('Step 2 date', 'Copy hours of the first day') .'</span></button>
<div class="btn-group btn-group">
<button type="button" id="remove-a-day" class="btn btn-default disabled" title="'. __('Step 2 date\\Remove a day') .'"><span class="glyphicon glyphicon-minus text-info"></span><span class="sr-only">'. __('Step 2 date\\Remove a day') .'</span></button>
<button type="button" id="add-a-day" class="btn btn-default" title="'. __('Step 2 date\\Add a day') .'"><span class="glyphicon glyphicon-plus text-success"></span><span class="sr-only">'. __('Step 2 date\\Add a day') .'</span></button>
<button type="button" id="remove-a-day" class="btn btn-default disabled" title="'. __('Step 2 date', 'Remove a day') .'"><span class="glyphicon glyphicon-minus text-info"></span><span class="sr-only">'. __('Step 2 date', 'Remove a day') .'</span></button>
<button type="button" id="add-a-day" class="btn btn-default" title="'. __('Step 2 date', 'Add a day') .'"><span class="glyphicon glyphicon-plus text-success"></span><span class="sr-only">'. __('Step 2 date', 'Add a day') .'</span></button>
</div>
</div>
<div class="col-md-8 text-right">
<div class="btn-group">
<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown">
<span class="glyphicon glyphicon-remove text-danger"></span> '. __('Generic\\Remove') . ' <span class="caret"></span>
<span class="glyphicon glyphicon-remove text-danger"></span> '. __('Generic', 'Remove') . ' <span class="caret"></span>
</button>
<ul class="dropdown-menu" role="menu">
<li><a id="resetdays" href="javascript:void(0)">'. __('Step 2 date\\Remove all days') .'</a></li>
<li><a id="resethours" href="javascript:void(0)">'. __('Step 2 date\\Remove all hours') .'</a></li>
<li><a id="resetdays" href="javascript:void(0)">'. __('Step 2 date', 'Remove all days') .'</a></li>
<li><a id="resethours" href="javascript:void(0)">'. __('Step 2 date', 'Remove all hours') .'</a></li>
</ul>
</div>
<a class="btn btn-default" href="'.Utils::get_server_name().'infos_sondage.php?choix_sondage=date" title="'. __('Step 2\\Back to step 1') . '">'. __('Generic\\Back') . '</a>
<button name="choixheures" value="'. __('Generic\\Next') .'" type="submit" class="btn btn-success disabled" title="'. __('Step 2\\Go to step 3') . '">'. __('Generic\\Next') .'</button>
<a class="btn btn-default" href="'.Utils::get_server_name().'create_poll.php?type=date" title="'. __('Step 2', 'Back to step 1') . '">'. __('Generic', 'Back') . '</a>
<button name="choixheures" value="'. __('Generic', 'Next') .'" type="submit" class="btn btn-success disabled" title="'. __('Step 2', 'Go to step 3') . '">'. __('Generic', 'Next') .'</button>
</div>
</div>
</div>

209
create_poll.php Normal file
View File

@ -0,0 +1,209 @@
<?php
/**
* This software is governed by the CeCILL-B license. If a copy of this license
* is not distributed with this file, you can obtain one at
* http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.txt
*
* Authors of STUdS (initial project): Guilhem BORGHESI (borghesi@unistra.fr) and Raphaël DROZ
* Authors of Framadate/OpenSondate: Framasoft (https://github.com/framasoft)
*
* =============================
*
* 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\Form;
use Framadate\Utils;
include_once __DIR__ . '/app/inc/init.php';
const GO_TO_STEP_2 = 'gotostep2';
if (!isset($_SESSION['form'])) {
$_SESSION['form'] = new Form();
}
// Type de sondage
if (isset($_GET['type']) && $_GET['type'] == 'date' ||
isset($_POST['type']) && $_POST['type'] == 'date'
) {
$poll_type = 'date';
$_SESSION['form']->choix_sondage = $poll_type;
} else {
$poll_type = 'classic';
$_SESSION['form']->choix_sondage = $poll_type;
}
// We clean the data
$goToStep2 = filter_input(INPUT_POST, GO_TO_STEP_2, FILTER_VALIDATE_REGEXP, ['options' => ['regexp' => '/^(date|classic)$/']]);
$title = filter_input(INPUT_POST, 'title', FILTER_SANITIZE_STRING);
$name = filter_input(INPUT_POST, 'name', FILTER_VALIDATE_REGEXP, ['options' => ['regexp' => NAME_REGEX]]);
$mail = filter_input(INPUT_POST, 'mail', FILTER_VALIDATE_EMAIL);
$description = filter_input(INPUT_POST, 'description', FILTER_SANITIZE_STRING);
$editable = filter_input(INPUT_POST, 'editable', FILTER_VALIDATE_REGEXP, ['options' => ['regexp' => BOOLEAN_REGEX]]);
$receiveNewVotes = filter_input(INPUT_POST, 'receiveNewVotes', FILTER_VALIDATE_REGEXP, ['options' => ['regexp' => BOOLEAN_REGEX]]);
$receiveNewComments = filter_input(INPUT_POST, 'receiveNewComments', FILTER_VALIDATE_REGEXP, ['options' => ['regexp' => BOOLEAN_REGEX]]);
// On initialise également les autres variables
$error_on_mail = false;
$error_on_title = false;
$error_on_name = false;
$error_on_description = false;
//
if (!empty($_POST[GO_TO_STEP_2])) {
$_SESSION['form']->title = $title;
$_SESSION['form']->admin_name = $name;
$_SESSION['form']->admin_mail = $mail;
$_SESSION['form']->description = $description;
$_SESSION['form']->editable = ($editable !== null);
$_SESSION['form']->receiveNewVotes = ($receiveNewVotes !== null);
$_SESSION['form']->receiveNewComments = ($receiveNewComments !== null);
if ($config['use_smtp'] == true) {
if (empty($mail)) {
$error_on_mail = true;
}
}
if ($title !== $_POST['title']) {
$error_on_title = true;
}
if ($name !== $_POST['name']) {
$error_on_name = true;
}
if ($description !== $_POST['description']) {
$error_on_description = true;
}
// Si pas d'erreur dans l'adresse alors on change de page vers date ou autre
if ($config['use_smtp'] == true) {
$email_OK = $mail && !$error_on_mail;
} else {
$email_OK = true;
}
if ($title && $name && $email_OK && !$error_on_title && !$error_on_description && !$error_on_name) {
if ($goToStep2 == 'date') {
header('Location:create_date_poll.php');
exit();
}
if ($goToStep2 == 'classic') {
header('Location:create_classic_poll.php');
exit();
}
} else {
// Title Erreur !
$title = __('Generic', 'Error!') . ' - ' . __('Step 1', 'Poll creation (1 on 3)');
}
} else {
// Title OK (formulaire pas encore rempli)
$title = __('Step 1', 'Poll creation (1 on 3)');
}
// Prepare error messages
$errors = array(
'title' => array(
'msg' => '',
'aria' => '',
'class' => ''
),
'description' => array(
'msg' => '',
'aria' => '',
'class' => ''
),
'name' => array(
'msg' => '',
'aria' => '',
'class' => ''
),
'email' => array(
'msg' => '',
'aria' => '',
'class' => ''
)
);
if (!empty($_POST[GO_TO_STEP_2])) {
if (empty($_POST['title'])) {
$errors['title']['aria'] = 'aria-describeby="poll_title_error" ';
$errors['title']['class'] = ' has-error';
$errors['title']['msg'] = __('Error', 'Enter a title');
} elseif ($error_on_title) {
$errors['title']['aria'] = 'aria-describeby="poll_title_error" ';
$errors['title']['class'] = ' has-error';
$errors['title']['msg'] = __('Error', 'Something is wrong with the format');
}
if ($error_on_description) {
$errors['description']['aria'] = 'aria-describeby="poll_comment_error" ';
$errors['description']['class'] = ' has-error';
$errors['description']['msg'] = __('Error', 'Something is wrong with the format');
}
if (empty($_POST['name'])) {
$errors['name']['aria'] = 'aria-describeby="poll_name_error" ';
$errors['name']['class'] = ' has-error';
$errors['name']['msg'] = __('Error', 'Enter a name');
} elseif ($error_on_name) {
$errors['name']['aria'] = 'aria-describeby="poll_name_error" ';
$errors['name']['class'] = ' has-error';
$errors['name']['msg'] = __('Error', 'Something is wrong with the format');
}
if (empty($_POST['mail'])) {
$errors['email']['aria'] = 'aria-describeby="poll_name_error" ';
$errors['email']['class'] = ' has-error';
$errors['email']['msg'] = __('Error', 'Enter an email address');
} elseif ($error_on_mail) {
$errors['email']['aria'] = 'aria-describeby="poll_email_error" ';
$errors['email']['class'] = ' has-error';
$errors['email']['msg'] = __('Error', 'The address is not correct! You should enter a valid email address (like r.stallman@outlock.com) in order to receive the link to your poll.');
}
}
// Checkbox checked ?
if ($_SESSION['form']->editable) {
$editable = 'checked';
}
if ($_SESSION['form']->receiveNewVotes) {
$receiveNewVotes = 'checked';
}
if ($_SESSION['form']->receiveNewComments) {
$receiveNewComments = 'checked';
}
$useRemoteUser = USE_REMOTE_USER && isset($_SERVER['REMOTE_USER']);
$smarty->assign('title', $title);
$smarty->assign('useRemoteUser', $useRemoteUser);
$smarty->assign('errors', $errors);
$smarty->assign('use_smtp', $config['use_smtp']);
$smarty->assign('goToStep2', GO_TO_STEP_2);
$smarty->assign('poll_type', $poll_type);
$smarty->assign('poll_title', Utils::fromPostOrDefault('title', $_SESSION['form']->title));
$smarty->assign('poll_description', Utils::fromPostOrDefault('description', $_SESSION['form']->description));
$smarty->assign('poll_name', Utils::fromPostOrDefault('name', $_SESSION['form']->admin_name));
$smarty->assign('poll_mail', Utils::fromPostOrDefault('mail', $_SESSION['form']->admin_mail));
$smarty->assign('poll_editable', Utils::fromPostOrDefault('editable', $_SESSION['form']->editable));
$smarty->assign('poll_receiveNewVotes', Utils::fromPostOrDefault('receiveNewVotes', $_SESSION['form']->receiveNewVotes));
$smarty->assign('poll_receiveNewComments', Utils::fromPostOrDefault('receiveNewComments', $_SESSION['form']->receiveNewComments));
$smarty->assign('form', $_SESSION['form']);
$smarty->display('create_poll.tpl');

View File

@ -67,7 +67,7 @@ function ajouter_sondage()
}
$sondage_admin = $sondage.random(8);
$date_fin = $_SESSION["champdatefin"]; // provided by choix_autre.php or choix_date.php
$date_fin = $_SESSION["champdatefin"]; // provided by create_classic_poll.php or create_date_poll.php
$_SESSION["champdatefin"]=""; //clean param cause 2 polls created by the same user in the same session can be affected by this param during the 2nd creation.
$sql = 'INSERT INTO sondage
(id_sondage, commentaires, mail_admin, nom_admin, titre, id_sondage_admin, date_fin, format, mailsonde)

View File

@ -320,7 +320,7 @@ table.results .btn-link.btn-sm {
box-shadow: 0px 3px 5px rgba(0, 0, 0, 0.125) inset;
}
/* choix_date.php */
/* create_date_poll.php */
#selected-days .form-group {
margin-left:0;
margin-right:0;
@ -346,7 +346,7 @@ table.results .btn-link.btn-sm {
border:none;
background:transparent;
}
/* choix_autre.php */
/* create_classic_poll.php */
.md-a-img {
text-decoration:none !important;
}

View File

@ -27,11 +27,11 @@ Here are the main files and directories you need to know in order to develop on
* La page de présentation de sondage
* adminstuds.php
* La page d'administration réservée à l'auteur du sondage
* infos_sondage.php
* create_poll.php
* La page (1/2) de création de sondage récupérant les informations générales
* choix_date.php
* create_date_poll.php
* La page de création (2/2) pour un sondage pour déterminer une date
* choix_autre.php
* crete_classic_poll.php
* La page de création (2/2) pour un sondage sur un sujet quelconque
* creation_sondage.php
* Le fichier qui récupérent les informations des pages précédentes pour procéder à l'insertion du nouveau sondage dans la base PostgreSQL

View File

@ -16,85 +16,30 @@
* Auteurs de STUdS (projet initial) : Guilhem BORGHESI (borghesi@unistra.fr) et Raphaël DROZ
* Auteurs de Framadate/OpenSondage : Framasoft (https://github.com/framasoft)
*/
namespace Framadate;
use Framadate\Services\LogService;
use Framadate\Services\PollService;
use Framadate\Utils;
include_once __DIR__ . '/app/inc/init.php';
if (is_readable('bandeaux_local.php')) {
include_once('bandeaux_local.php');
} else {
include_once('bandeaux.php');
}
/* SERVICES */
/* -------- */
$logService = '\Framadate\Services\LogService';
$pollService = new PollService($connect, new $logService());
// affichage de la page
Utils::print_header( __('Generic\\Home') );
bandeau_titre(__('Generic\\Make your polls'));
echo '
<div class="row">
<div class="col-md-6 text-center">
<p class="home-choice"><a href="'.Utils::get_server_name().'infos_sondage.php?choix_sondage=date" class="opacity" role="button">
<img class="img-responsive center-block" src="'.Utils::get_server_name().'images/date.png" alt="" />
<br /><span class="btn btn-primary btn-lg"><span class="glyphicon glyphicon-calendar"></span>
'. __('Homepage\\Schedule an event') . '</span>
</a></p>
</div>
<div class="col-md-6 text-center">
<p class="home-choice"><a href="'.Utils::get_server_name().'infos_sondage.php?choix_sondage=autre" class="opacity" role="button">
<img alt="" class="img-responsive center-block" src="'.Utils::get_server_name().'images/classic.png" />
<br /><span class="btn btn-info btn-lg"><span class="glyphicon glyphicon-stats"></span>
'. __('Homepage\\Make a classic poll') . '</span>
</a></p>
</div>
</div>
<hr role="presentation" />
<div class="row">';
$nbcol = $config['show_what_is_that'] + $config['show_the_software'] + $config['show_cultivate_your_garden'];
if ($nbcol > 0){
$colmd = 12/$nbcol; // 3 =>col-md-4, 2 =>col-md-6, 1 =>col-md-12.
}
if($config['show_what_is_that'] == true){
echo '<div class="col-md-'.$colmd.'">
<h3>'. __('1st section\\What is that?') . '</h3>
<p class="text-center" role="presentation"><span class="glyphicon glyphicon-question-sign" style="font-size:50px"></span></p>
<p>'. __('1st section\\Framadate is an online service for planning an appointment or make a decision quickly and easily. No registration is required.') .'</p>
<p>'. __('1st section\\Here is how it works:') . '</p>
<ol>
<li>'. __('1st section\\Make a poll') . '</li>
<li>'. __('1st section\\Define dates or subjects to choose') . '</li>
<li>'. __('1st section\\Send the poll link to your friends or colleagues') . '</li>
<li>'. __('1st section\\Discuss and make a decision') . '</li>
</ol>
<p>'. __('1st section\\Do you want to ') . '<a href="' . Utils::getUrlSondage('aqg259dth55iuhwm').'">'. __('1st section\\view an example?') .'</a></p>
</div>';
}
/* PAGE */
/* ---- */
if($config['show_the_software'] == true){
echo '<div class="col-md-'.$colmd.'">
<h3>'. __('2nd section\\The software') .'</h3>
<p class="text-center" role="presentation"><span class="glyphicon glyphicon-cloud" style="font-size:50px"></span></p>
<p>'. __('2nd section\\Framadate was initially based on '). '<a href="https://sourcesup.cru.fr/projects/studs/">Studs</a>'. __('2nd section\\ a software developed by the University of Strasbourg. Today, it is devevoped by the association Framasoft') .'.</p>
<p>'. __('2nd section\\This software needs javascript and cookies enabled. It is compatible with the following web browsers:') .'</p>
<ul>
<li>Microsoft Internet Explorer 9+</li>
<li>Google Chrome 19+</li>
<li>Firefox 12+</li>
<li>Safari 5+</li>
<li>Opera 11+</li>
</ul>
<p>'. __('2nd section\\It is governed by the ').'<a href="http://www.cecill.info">'. __('2nd section\\CeCILL-B license').'</a>.</p>
</div>';
}
$demoPoll = $pollService->findById('aqg259dth55iuhwm');
$nbcol = $config['show_what_is_that'] + $config['show_the_software'] + $config['show_cultivate_your_garden'];
if($config['show_cultivate_your_garden'] == true){
echo '<div class="col-md-'.$colmd.'">
<h3>'. __('3rd section\\Cultivate your garden') .'</h3>
<p class="text-center" role="presentation"><span class="glyphicon glyphicon-tree-deciduous" style="font-size:50px"></span></p>
<p>'. __('3rd section\\To participate in the software development, suggest improvements or simply download it, please visit ') .'<a href="https://git.framasoft.org/framasoft/framadate">'.__('3rd section\\the development site').'</a>.</p>
<br />
<p>'. __('3rd section\\If you want to install the software for your own use and thus increase your independence, we help you on:') .'</p>
<p class="text-center"><a href="http://framacloud.org/cultiver-son-jardin/installation-de-framadate/" class="btn btn-success"><span class="glyphicon glyphicon-tree-deciduous"></span> framacloud.org</a></p>
</div>';
}
echo '</div>'."\n";
$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);
bandeau_pied();
$smarty->assign('title', __('Generic', 'Make your polls'));
$smarty->display('index.tpl');

View File

@ -1,337 +0,0 @@
<?php
/**
* This software is governed by the CeCILL-B license. If a copy of this license
* is not distributed with this file, you can obtain one at
* http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.txt
*
* Authors of STUdS (initial project): Guilhem BORGHESI (borghesi@unistra.fr) and Raphaël DROZ
* Authors of Framadate/OpenSondate: Framasoft (https://github.com/framasoft)
*
* =============================
*
* 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)
*/
namespace Framadate;
include_once __DIR__ . '/app/inc/init.php';
function fromPostOrEmpty($postKey) {
return isset($_POST[$postKey]) ? Utils::htmlEscape($_POST[$postKey]) : '';
}
if (!isset($_SESSION['form'])) {
$_SESSION['form'] = new Form();
}
if (file_exists('bandeaux_local.php')) {
include_once('bandeaux_local.php');
} else {
include_once('bandeaux.php');
}
// Type de sondage : <button value="$_SESSION['form']->choix_sondage">
if ((isset($_GET['choix_sondage']) && $_GET['choix_sondage'] == 'date') ||
(isset($_POST["choix_sondage"]) && $_POST["choix_sondage"] == 'creation_sondage_date')) {
$choix_sondage = "creation_sondage_date";
$_SESSION['form']->choix_sondage = $choix_sondage;
} else {
$choix_sondage = "creation_sondage_autre";
$_SESSION['form']->choix_sondage = $choix_sondage;
}
// We clean the data
$poursuivre = filter_input(INPUT_POST, 'poursuivre', FILTER_VALIDATE_REGEXP, ['options' => ['regexp' => '/^(creation_sondage_date|creation_sondage_autre)$/']]);
$title = filter_input(INPUT_POST, 'title', FILTER_SANITIZE_STRING);
$name = filter_input(INPUT_POST, 'name', FILTER_VALIDATE_REGEXP, ['options' => ['regexp' => NAME_REGEX]]);
$mail = filter_input(INPUT_POST, 'mail', FILTER_VALIDATE_EMAIL);
$description = filter_input(INPUT_POST, 'description', FILTER_SANITIZE_STRING);
$editable = filter_input(INPUT_POST, 'editable', FILTER_VALIDATE_REGEXP, ['options' => ['regexp' => BOOLEAN_REGEX]]);
$receiveNewVotes = filter_input(INPUT_POST, 'receiveNewVotes', FILTER_VALIDATE_REGEXP, ['options' => ['regexp' => BOOLEAN_REGEX]]);
$receiveNewComments = filter_input(INPUT_POST, 'receiveNewComments', FILTER_VALIDATE_REGEXP, ['options' => ['regexp' => BOOLEAN_REGEX]]);
// On initialise également les autres variables
$error_on_mail = false;
$error_on_title = false;
$error_on_name = false;
$error_on_description = false;
#tests
if (!empty($_POST['poursuivre'])) {
$_SESSION['form']->title = $title;
$_SESSION['form']->admin_name = $name;
$_SESSION['form']->admin_mail = $mail;
$_SESSION['form']->description = $description;
$_SESSION['form']->editable = ($editable !== null) ? true : false;
$_SESSION['form']->receiveNewVotes = ($receiveNewVotes !== null) ? true : false;
$_SESSION['form']->receiveNewComments = ($receiveNewComments !== null) ? true : false;
if ($config['use_smtp']==true) {
if (empty($mail)) {
$error_on_mail = true;
}
}
if ($title !== $_POST['title']) {
$error_on_title = true;
}
if ($name !== $_POST['name']) {
$error_on_name = true;
}
if ($description !== $_POST['description']) {
$error_on_description = true;
}
// Si pas d'erreur dans l'adresse alors on change de page vers date ou autre
if ($config['use_smtp'] == true) {
$email_OK = $mail && !$error_on_mail;
} else {
$email_OK = true;
}
if ($title && $name && $email_OK && ! $error_on_title && ! $error_on_description && ! $error_on_name) {
if ( $poursuivre == 'creation_sondage_date' ) {
header('Location:choix_date.php');
exit();
}
if ( $poursuivre == 'creation_sondage_autre' ) {
header('Location:choix_autre.php');
exit();
}
} else {
// Title Erreur !
Utils::print_header( __('Generic\\Error!').' - '.__('Step 1\\Poll creation (1 on 3)') );
}
} else {
// Title OK (formulaire pas encore rempli)
Utils::print_header( __('Step 1\\Poll creation (1 on 3)') );
}
bandeau_titre( __('Step 1\\Poll creation (1 on 3)') );
/*
* Préparation des messages d'erreur
*/
$errors = array (
'title' => array (
'msg' => '',
'aria' => '',
'class' => ''
),
'description' => array (
'msg' => '',
'aria' => '',
'class' => ''
),
'name' => array (
'msg' => '',
'aria' => '',
'class' => ''
),
'email' => array (
'msg' => '',
'aria' => '',
'class' => ''
)
);
if (!empty($_POST['poursuivre'])) {
if (empty($_POST['title'])) {
$errors['title']['aria'] = 'aria-describeby="poll_title_error" ';
$errors['title']['class'] = ' has-error';
$errors['title']['msg'] = '<div class="alert alert-danger" ><p id="poll_title_error">' . __('Error\\Enter a title') . '</p></div>';
} elseif ($error_on_title) {
$errors['title']['aria'] = 'aria-describeby="poll_title_error" ';
$errors['title']['class'] = ' has-error';
$errors['title']['msg'] = '<div class="alert alert-danger"><p id="poll_title_error">' . __('Error\\Something is wrong with the format') . '</p></div>';
}
if ($error_on_description) {
$errors['description']['aria'] = 'aria-describeby="poll_comment_error" ';
$errors['description']['class'] = ' has-error';
$errors['description']['msg'] = '<div class="alert alert-danger"><p id="poll_comment_error">' . __('Error\\Something is wrong with the format') . '</p></div>';
}
if (empty($_POST['name'])) {
$errors['name']['aria'] = 'aria-describeby="poll_name_error" ';
$errors['name']['class'] = ' has-error';
$errors['name']['msg'] = '<div class="alert alert-danger"><p id="poll_name_error">' . __('Error\\Enter a name') . '</p></div>';
} elseif ($error_on_name) {
$errors['name']['aria'] = 'aria-describeby="poll_name_error" ';
$errors['name']['class'] = ' has-error';
$errors['name']['msg'] = '<div class="alert alert-danger"><p id="poll_name_error">' . __('Error\\Something is wrong with the format') . '</p></div>';
}
if (empty($_POST['mail'])) {
$errors['email']['aria'] = 'aria-describeby="poll_name_error" ';
$errors['email']['class'] = ' has-error';
$errors['email']['msg'] = '<div class="alert alert-danger"><p id="poll_email_error">' . __('Error\\Enter an email address') . '</p></div>';
} elseif ($error_on_mail) {
$errors['email']['aria'] = 'aria-describeby="poll_email_error" ';
$errors['email']['class'] = ' has-error';
$errors['email']['msg'] = '<div class="alert alert-danger"><p id="poll_email_error">' . __('Error\\The address is not correct! You should enter a valid email address (like r.stallman@outlock.com) in order to receive the link to your poll.') . '</p></div>';
}
}
/*
* Préparation en fonction des paramètres de session
*/
// REMOTE_USER ?
/**
* @return string
*/
if (USE_REMOTE_USER && isset($_SERVER['REMOTE_USER'])) {
$input_name = '<input type="hidden" name="name" value="'.Utils::htmlEscape($_POST['name']).'" />'.$_SESSION['form']->admin_name;
$input_email = '<input type="hidden" name="mail" value="'.Utils::htmlEscape($_POST['mail']).'">'.$_SESSION['form']->admin_mail;
} else {
$input_name = '<input id="yourname" type="text" name="name" class="form-control" '.$errors['name']['aria'].' value="'. fromPostOrEmpty('name') .'" />';
$input_email = '<input id="email" type="text" name="mail" class="form-control" '.$errors['email']['aria'].' value="'. fromPostOrEmpty('mail') .'" />';
}
// Checkbox checked ?
if ($_SESSION['form']->editable) {
$editable = 'checked';
}
if ($_SESSION['form']->receiveNewVotes) {
$receiveNewVotes = 'checked';
}
if ($_SESSION['form']->receiveNewComments) {
$receiveNewComments = 'checked';
}
// Display form
echo '
<div class="row" style="display:none" id="form-block">
<div class="col-md-8 col-md-offset-2" >
<form name="formulaire" id="formulaire" action="' . Utils::get_server_name() . 'infos_sondage.php" method="POST" class="form-horizontal" role="form">
<div class="alert alert-info">
<p>'. __('Step 1\\You are in the poll creation section.').' <br /> '.__('Step 1\\Required fields cannot be left blank.') .'</p>
</div>
<div class="form-group'.$errors['title']['class'].'">
<label for="poll_title" class="col-sm-4 control-label">' . __('Step 1\\Poll title') . ' *</label>
<div class="col-sm-8">
<input id="poll_title" type="text" name="title" class="form-control" '.$errors['title']['aria'].' value="'. fromPostOrEmpty('title') .'" />
</div>
</div>
'.$errors['title']['msg'].'
<div class="form-group'.$errors['description']['class'].'">
<label for="poll_comments" class="col-sm-4 control-label">'. __('Generic\\Description') .'</label>
<div class="col-sm-8">
<textarea id="poll_comments" name="description" class="form-control" '.$errors['description']['aria'].' rows="5">'. fromPostOrEmpty('description') .'</textarea>
</div>
</div>
'.$errors['description']['msg'].'
<div class="form-group'.$errors['name']['class'].'">
<label for="yourname" class="col-sm-4 control-label">'. __('Generic\\Your name') .' *</label>
<div class="col-sm-8">
'.$input_name.'
</div>
</div>
'.$errors['name']['msg'];
if ($config['use_smtp']==true) {
echo '
<div class="form-group'.$errors['email']['class'].'">
<label for="email" class="col-sm-4 control-label">'. __('Generic\\Your email address') .' *<br /><span class="small">'. __('Generic\\(in the format name@mail.com)') .'</span></label>
<div class="col-sm-8">
'.$input_email.'
</div>
</div>
'.$errors['email']['msg'];
}
echo '
<div class="form-group">
<div class="col-sm-offset-4 col-sm-8">
<div class="checkbox">
<label>
<input type=checkbox name="editable" '.$editable.' id="editable">'. __('Step 1\\Voters can modify their vote themselves.') .'
</label>
</div>
</div>
</div>';
if ($config['use_smtp']==true) {
echo '<div class="form-group">
<div class="col-sm-offset-4 col-sm-8">
<div class="checkbox">
<label>
<input type=checkbox name="receiveNewVotes" '.$receiveNewVotes.' id="receiveNewVotes">'. __('Step 1\\To receive an email for each new vote.') .'
</label>
</div>
</div>
</div>';
echo '<div class="form-group">
<div class="col-sm-offset-4 col-sm-8">
<div class="checkbox">
<label>
<input type=checkbox name="receiveNewComments" '.$receiveNewComments.' id="receiveNewComments">'. __('Step 1\\To receive an email for each new comment.') .'
</label>
</div>
</div>
</div>';
}
echo '
<p class="text-right">
<input type="hidden" name="choix_sondage" value="'. $choix_sondage .'"/>
<button name="poursuivre" value="'. $choix_sondage .'" type="submit" class="btn btn-success" title="'. __('Step 1\\Go to step 2') . '">'. __('Generic\\Next') . '</button>
</p>
<script type="text/javascript">document.formulaire.title.focus();</script>
</form>
</div>
</div>
<noscript>
<div class="alert alert-danger">'.
__('Step 1\\Javascript is disabled on your browser. Its activation is required to create a poll.')
.'</div>
</noscript>
<div id="cookie-warning" class="alert alert-danger" style="display:none">'.
__('Step 1\\Cookies are disabled on your browser. Theirs activation is required to create a poll.')
.'</div>
';
echo '
<script>
// Check Javascript is enabled, if it is it will execute this script
(function() {
// Check cookies are enabled too
var cookieEnabled = function() {
var cookieEnabled = navigator.cookieEnabled;
// if not IE4+ nor NS6+
if (!cookieEnabled && typeof navigator.cookieEnabled === "undefined"){
document.cookie = "testcookie"
cookieEnabled = document.cookie.indexOf("testcookie") != -1;
}
return cookieEnabled;
}
if (cookieEnabled()) {
// Show the form block
document.getElementById("form-block").setAttribute("style", "");
} else {
// Show the warning about cookies
document.getElementById("cookie-warning").setAttribute("style", "");
}
})();
</script>
';
bandeau_pied();

View File

@ -62,15 +62,15 @@
"Define dates or subjects to choose": "Datum- oder Auswahlmöglichkeiten definieren",
"Send the poll link to your friends or colleagues": "Link zur Umfrage an Ihre Freunde oder Kollegen schicken",
"Discuss and make a decision": "Besprechen und Entscheidung treffen",
"Do you want to ": "Wollen Sie sich ",
"Do you want to": "Wollen Sie sich",
"view an example?": "einen Beispiel ansehen?"
},
"2nd section": {
"The software": "Die Software",
"Framadate was initially based on ": "Framadate war am Anfang auf ",
" a software developed by the University of Strasbourg. Today, it is devevoped by the association Framasoft": " basiert, eine von der Straßburg-Universität entwickelte Software. Heutzutage wird sie von der Framasoft-Vereinigung entwickelt.",
"a software developed by the University of Strasbourg. Today, it is devevoped by the association Framasoft.": "basiert, eine von der Straßburg-Universität entwickelte Software. Heutzutage wird sie von der Framasoft-Vereinigung entwickelt.",
"This software needs javascript and cookies enabled. It is compatible with the following web browsers:": "Für diese Software müssen Javascript und Cookie aktiviert sein. Sie ist mit den folgenden Browsers kompatibel:",
"It is governed by the ": "Sie ist lizenziert unter der ",
"It is governed by the": "Sie ist lizenziert unter der",
"CeCILL-B license": "CeCILL-B Lizenz"
},
"3rd section": {
@ -161,6 +161,7 @@
"Poll saved": "Umfrage gespeichert",
"Vote added": "vote hinzugefügt",
"Vote updated": "vote aktualisiert",
"Poll fully deleted": "Umfrage vollständig gelöscht",
"Vote deleted": "vote gelöscht",
"All votes deleted": "Alle Stimmen werden gelöscht",
"Back to the poll": "Zurück zur Umfrage",
@ -173,6 +174,8 @@
"Confirm removal of all comments of the poll": "Entfernen aller Kommentare der Umfrage bestätigen",
"Keep the comments": "Halten Sie die Kommentare",
"Remove the comments": "Entfernen Sie die Kommentare",
"Comment deleted": "Kommentar gelöscht",
"All comments deleted": "Alle Kommentare gelöscht",
"The poll has been deleted": "Die Umfrage wurde gelöscht",
"Keep votes": "Halten Stimmen",
"Keep comments": "Halten Sie Kommentare",

View File

@ -62,15 +62,15 @@
"Define dates or subjects to choose": "Define dates or subjects to choose",
"Send the poll link to your friends or colleagues": "Send the poll link to your friends or colleagues",
"Discuss and make a decision": "Discuss and make a decision",
"Do you want to ": "Do you want to ",
"Do you want to": "Do you want to",
"view an example?": "view an example?"
},
"2nd section": {
"The software": "The software",
"Framadate was initially based on ": "Framadate was initially based on ",
" a software developed by the University of Strasbourg. Today, it is devevoped by the association Framasoft": " a software developed by the University of Strasbourg. Today, it is devevoped by the association Framasoft",
"a software developed by the University of Strasbourg. Today, it is devevoped by the association Framasoft.": "a software developed by the University of Strasbourg. Today, it is devevoped by the association Framasoft.",
"This software needs javascript and cookies enabled. It is compatible with the following web browsers:": "This software needs javascript and cookies enabled. It is compatible with the following web browsers:",
"It is governed by the ": "It is governed by the ",
"It is governed by the": "It is governed by the",
"CeCILL-B license": "CeCILL-B license"
},
"3rd section": {
@ -160,6 +160,7 @@
"Keep the poll": "Keep the poll",
"Your poll has been removed!": "Your poll has been removed!",
"Poll saved": "Poll saved",
"Poll fully deleted": "Poll fully deleted",
"Vote added": "Vote added",
"Vote updated": "Vote updated",
"Vote deleted": "Vote deleted",
@ -172,6 +173,8 @@
"Keep the votes": "Keep the votes",
"Remove the votes": "Remove the votes",
"Confirm removal of all comments of the poll": "Confirm removal of all comments of the poll",
"Comment deleted": "Comment deleted",
"All comments deleted": "All comments deleted",
"Keep the comments": "Keep the comments",
"Remove the comments": "Remove the comments",
"The poll has been deleted": "The poll has been deleted",

View File

@ -62,15 +62,15 @@
"Define dates or subjects to choose": "ES_Déterminez les dates ou les sujets à choisir",
"Send the poll link to your friends or colleagues": "ES_Envoyez le lien du sondage à vos amis ou collègues",
"Discuss and make a decision": "ES_Discutez et prenez votre décision",
"Do you want to ": "ES_Voulez-vous ",
"Do you want to": "ES_Voulez-vous",
"view an example?": "ES_voir un exemple ?"
},
"2nd section": {
"The software": "ES_Le logiciel",
"Framadate was initially based on ": "ES_Framadate est initialement basé sur ",
" a software developed by the University of Strasbourg. Today, it is devevoped by the association Framasoft": "ES_ un logiciel développé par l'Université de Strasbourg. Aujourd'hui, son développement est assuré par lassociation Framasoft",
"a software developed by the University of Strasbourg. Today, it is devevoped by the association Framasoft.": "ES_ un logiciel développé par l'Université de Strasbourg. Aujourd'hui, son développement est assuré par lassociation Framasoft.",
"This software needs javascript and cookies enabled. It is compatible with the following web browsers:": "ES_Ce logiciel requiert lactivation du javascript et des cookies. Il est compatible avec les navigateurs web suivants :",
"It is governed by the ": "ES_Il est régi par la ",
"It is governed by the": "ES_Il est régi par la",
"CeCILL-B license": "ES_licence CeCILL-B"
},
"3rd section": {
@ -160,6 +160,7 @@
"Your poll has been removed!": "Su encuesta ha sido borrado!",
"Poll saved": "ES_Sondage sauvegardé",
"Vote added": "ES_Vote ajouté",
"Poll fully deleted": "ES_Sondage complètement supprimé",
"Vote updated": "ES_Vote mis à jour",
"Vote deleted": "ES_Vote supprimé",
"All votes deleted": "ES_Tous les votes ont été supprimés",
@ -173,6 +174,8 @@
"Confirm removal of all comments of the poll": "ES_Confirmer la suppression de tous les commentaires de ce sondage",
"Keep the comments": "ES_Garder les commentaires",
"Remove the comments": "ES_Supprimer les commentaires",
"Comment deleted": "ES_Commentaire supprimé",
"All comments deleted": "ES_Tous les commentaires ont été supprimés",
"The poll has been deleted": "ES_Le sondage a été supprimé",
"Keep votes": "ES_Garder les votes",
"Keep comments": "ES_Garder les commentaires",

View File

@ -62,15 +62,15 @@
"Define dates or subjects to choose": "Déterminez les dates ou les sujets à choisir",
"Send the poll link to your friends or colleagues": "Envoyez le lien du sondage à vos amis ou collègues",
"Discuss and make a decision": "Discutez et prenez votre décision",
"Do you want to ": "Voulez-vous ",
"Do you want to": "Voulez-vous",
"view an example?": "voir un exemple ?"
},
"2nd section": {
"The software": "Le logiciel",
"Framadate was initially based on ": "Framadate est initialement basé sur ",
" a software developed by the University of Strasbourg. Today, it is devevoped by the association Framasoft": " un logiciel développé par l'Université de Strasbourg. Aujourd'hui, son développement est assuré par lassociation Framasoft",
"a software developed by the University of Strasbourg. Today, it is devevoped by the association Framasoft.": "un logiciel développé par l'Université de Strasbourg. Aujourd'hui, son développement est assuré par lassociation Framasoft.",
"This software needs javascript and cookies enabled. It is compatible with the following web browsers:": "Ce logiciel requiert lactivation du javascript et des cookies. Il est compatible avec les navigateurs web suivants :",
"It is governed by the ": "Il est régi par la ",
"It is governed by the": "Il est régi par la",
"CeCILL-B license": "licence CeCILL-B"
},
"3rd section": {
@ -159,6 +159,7 @@
"Keep the poll": "Je garde le sondage",
"Your poll has been removed!": "Votre sondage a été supprimé !",
"Poll saved": "Sondage sauvegardé",
"Poll fully deleted": "Sondage complètement supprimé",
"Vote added": "Vote ajouté",
"Vote updated": "Vote mis à jour",
"Vote deleted": "Vote supprimé",
@ -173,6 +174,8 @@
"Confirm removal of all comments of the poll": "Confirmer la suppression de tous les commentaires de ce sondage",
"Keep the comments": "Garder les commentaires",
"Remove the comments": "Supprimer les commentaires",
"Comment deleted": "Commentaire supprimé",
"All comments deleted": "Tous les commentaires ont été supprimés",
"The poll has been deleted": "Le sondage a été supprimé",
"Keep votes": "Garder les votes",
"Keep comments": "Garder les commentaires",

View File

@ -3,5 +3,5 @@ Allow: /
Allow: /index.php
Allow: /apropos.php
Allow: /contacts.php
Allow: /infos_sondage.php
Allow: /create_poll.php
Disallow: /*

View File

@ -3,36 +3,36 @@
{block name=main}
<form action="{$admin_poll_id|poll_url:true}" method="POST">
<div class="alert alert-info text-center">
<h2>{__('adminstuds\\Column\'s adding')}</h2>
<h2>{__('adminstuds', 'Column\'s adding')}</h2>
{if $format === 'D'}
<div class="form-group">
<label for="newdate" class="col-md-4">{__('Generic\\Day')}</label>
<label for="newdate" class="col-md-4">{__('Generic', 'Day')}</label>
<div class="col-md-8">
<div class="input-group date">
<span class="input-group-addon"><i class="glyphicon glyphicon-calendar"></i></span>
<input type="text" id="newdate" data-date-format="{__('Date\\dd/mm/yyyy')}" aria-describedby="dateformat" name="newdate" class="form-control" placeholder="{__('Date\\dd/mm/yyyy')}" />
<input type="text" id="newdate" data-date-format="{__('Date', 'dd/mm/yyyy')}" aria-describedby="dateformat" name="newdate" class="form-control" placeholder="{__('Date', 'dd/mm/yyyy')}" />
</div>
<span id="dateformat" class="sr-only">({__('Date\\dd/mm/yyyy')})</span>
<span id="dateformat" class="sr-only">({__('Date', 'dd/mm/yyyy')})</span>
</div>
</div>
<div class="form-group">
<label for="newmoment" class="col-md-4">{__('Generic\\Time')}</label>
<label for="newmoment" class="col-md-4">{__('Generic', 'Time')}</label>
<div class="col-md-8">
<input type="text" id="newmoment" name="newmoment" class="form-control" />
</div>
</div>
{else}
<div class="form-group">
<label for="choice" class="col-md-4">{__('Generic\\Choice')}</label>
<label for="choice" class="col-md-4">{__('Generic', 'Choice')}</label>
<div class="col-md-8">
<input type="text" id="choice" name="choice" class="form-control" />
</div>
</div>
{/if}
<div class="form-group">
<button class="btn btn-default" type="submit" name="back">{__('adminstuds\\Back to the poll')}</button>
<button type="submit" name="confirm_add_slot" class="btn btn-success">{__('adminstuds\\Add a column')}</button>
<button class="btn btn-default" type="submit" name="back">{__('adminstuds', 'Back to the poll')}</button>
<button type="submit" name="confirm_add_slot" class="btn btn-success">{__('adminstuds', 'Add a column')}</button>
</div>
</div>
</form>

View File

@ -3,8 +3,8 @@
{block 'main'}
<div class="row">
<div class="col-xs-12">
<a href="{'admin'|resource}">{__('Admin\\Back to administration')}</a>
<a href="{'admin'|resource}">{__('Admin', 'Back to administration')}</a>
</div>
</div>
{block 'admin_main'}{/block}
{/block}
{/block}

View File

@ -3,18 +3,18 @@
{block 'main'}
<div class="row">
<div class="col-md-6 col-xs-12">
<a href="./polls.php"><h2>{__('Admin\\Polls')}</h2></a>
<a href="./polls.php"><h2>{__('Admin', 'Polls')}</h2></a>
</div>
<div class="col-md-6 col-xs-12">
<a href="./migration.php"><h2>{__('Admin\\Migration')}</h2></a>
<a href="./migration.php"><h2>{__('Admin', 'Migration')}</h2></a>
</div>
<div class="col-md-6 col-xs-12">
<a href="./purge.php"><h2>{__('Admin\\Purge')}</h2></a>
<a href="./purge.php"><h2>{__('Admin', 'Purge')}</h2></a>
</div>
{if $logsAreReadable}
<div class="col-md-6 col-xs-12">
<a href="./logs.php"><h2>{__('Admin\\Logs')}</h2></a>
<a href="./logs.php"><h2>{__('Admin', 'Logs')}</h2></a>
</div>
{/if}
</div>
{/block}
{/block}

View File

@ -3,37 +3,37 @@
{block 'admin_main'}
<div class="row">
<div class="col-xs-12 col-md-4">
<h2>{__('Admin\\Summary')}</h2>
{__('Admin\\Succeeded:')} <span class="label label-warning">{$countSucceeded|html} / {$countTotal|html}</span>
<h2>{__('Admin', 'Summary')}</h2>
{__('Admin', 'Succeeded:')} <span class="label label-warning">{$countSucceeded|html} / {$countTotal|html}</span>
<br/>
{__('Admin\\Failed:')} <span class="label label-danger">{$countFailed|html} / {$countTotal|html}</span>
{__('Admin', 'Failed:')} <span class="label label-danger">{$countFailed|html} / {$countTotal|html}</span>
<br/>
{__('Admin\\Skipped:')} <span class="label label-info">{$countSkipped|html} / {$countTotal|html}</span>
{__('Admin', 'Skipped:')} <span class="label label-info">{$countSkipped|html} / {$countTotal|html}</span>
</div>
<div class="col-xs-12 col-md-4">
<h2>{__('Admin\\Success')}</h2>
<h2>{__('Admin', 'Success')}</h2>
<ul>
{foreach $success as $s}
<li>{$s|html}</li>
{foreachelse}
<li>{__('Admin\\Nothing')}</li>
<li>{__('Admin', 'Nothing')}</li>
{/foreach}
</ul>
</div>
<div class="col-xs-12 col-md-4">
<h2>{__('Admin\\Fail')}</h2>
<h2>{__('Admin', 'Fail')}</h2>
<ul>
{foreach $fail as $f}
<li>{$f|html}</li>
{foreachelse}
<li>{__('Admin\\Nothing')}</li>
<li>{__('Admin', 'Nothing')}</li>
{/foreach}
</ul>
</div>
<div class="col-xs-12 well well-sm">
{__('Generic\\Page generated in')} {$time} {__('Generic\\seconds')}
{__('Generic', 'Page generated in')} {$time} {__('Generic', 'seconds')}
</div>
</div>
{/block}
{/block}

View File

@ -6,31 +6,31 @@
{block 'admin_main'}
<div class="panel panel-default" id="poll_search">
<div class="panel-heading">{__('Generic\\Search')}</div>
<div class="panel-heading">{__('Generic', 'Search')}</div>
<div class="panel-body" style="display: none;">
<form action="" method="GET">
<div class="row">
<div class="col-md-6">
<div class="form-group">
<label for="poll" class="control-label">{__('Admin\\Poll ID')}</label>
<label for="poll" class="control-label">{__('Admin', 'Poll ID')}</label>
<input type="text" name="poll" id="poll" class="form-control"
value="{$search['poll']|html}"/>
</div>
<div class="form-group">
<label for="name" class="control-label">{__('Admin\\Author')}</label>
<label for="name" class="control-label">{__('Admin', 'Author')}</label>
<input type="text" name="name" id="name" class="form-control"
value="{$search['name']|html}"/>
</div>
</div>
<div class="col-md-6">
<div class="form-group">
<label for="title" class="control-label">{__('Admin\\Title')}</label>
<label for="title" class="control-label">{__('Admin', 'Title')}</label>
<input type="text" name="title" id="title" class="form-control"
value="{$search['title']|html}"/>
</div>
</div>
</div>
<input type="submit" value="{__('Generic\\Search')}" class="btn btn-default"/>
<input type="submit" value="{__('Generic', 'Search')}" class="btn btn-default"/>
</form>
</div>
</div>
@ -39,13 +39,13 @@
<input type="hidden" name="csrf" value="{$crsf}"/>
{if $poll_to_delete}
<div class="alert alert-warning text-center">
<h3>{__('adminstuds\\Confirm removal of the poll')} "{$poll_to_delete->id|html}"</h3>
<h3>{__('adminstuds', 'Confirm removal of the poll')} "{$poll_to_delete->id|html}"</h3>
<p>
<button class="btn btn-default" type="submit" value="1"
name="annullesuppression">{__('adminstuds\\Keep the poll')}</button>
name="annullesuppression">{__('adminstuds', 'Keep the poll')}</button>
<button type="submit" name="delete_confirm" value="{$poll_to_delete->id|html}"
class="btn btn-danger">{__('adminstuds\\Delete the poll')}</button>
class="btn btn-danger">{__('adminstuds', 'Delete the poll')}</button>
</p>
</div>
{/if}
@ -53,31 +53,31 @@
<div class="panel panel-default">
<div class="panel-heading">
{$count} / {$total} {__('Admin\\polls in the database at this time')}
{$count} / {$total} {__('Admin', 'polls in the database at this time')}
</div>
<table class="table table-bordered table-polls">
<tr align="center">
<th scope="col"></th>
<th scope="col">{__('Admin\\Title')}</th>
<th scope="col">{__('Admin\\Author')}</th>
<th scope="col">{__('Admin\\Email')}</th>
<th scope="col">{__('Admin\\Expiration date')}</th>
<th scope="col">{__('Admin\\Votes')}</th>
<th scope="col">{__('Admin\\Poll ID')}</th>
<th scope="col" colspan="3">{__('Admin\\Actions')}</th>
<th scope="col">{__('Admin', 'Title')}</th>
<th scope="col">{__('Admin', 'Author')}</th>
<th scope="col">{__('Admin', 'Email')}</th>
<th scope="col">{__('Admin', 'Expiration date')}</th>
<th scope="col">{__('Admin', 'Votes')}</th>
<th scope="col">{__('Admin', 'Poll ID')}</th>
<th scope="col" colspan="3">{__('Admin', 'Actions')}</th>
</tr>
{foreach $polls as $poll}
<tr align="center">
<td class="cell-format">
{if $poll->format === 'D'}
<span class="glyphicon glyphicon-calendar" aria-hidden="true"
title="{__('Generic\\Date')}"></span>
<span class="sr-only">{__('Generic\\Date')}</span>
title="{__('Generic', 'Date')}"></span>
<span class="sr-only">{__('Generic', 'Date')}</span>
{else}
<span class="glyphicon glyphicon-list-alt" aria-hidden="true"
title="{__('Generic\\Classic')}"></span>
<span class="sr-only">{__('Generic\\Classic')}</span>
title="{__('Generic', 'Classic')}"></span>
<span class="sr-only">{__('Generic', 'Classic')}</span>
{/if}
</td>
<td>{$poll->title|html}</td>
@ -92,25 +92,25 @@
<td>{$poll->votes|html}</td>
<td>{$poll->id|html}</td>
<td><a href="{$poll->id|poll_url|html}" class="btn btn-link"
title="{__('Admin\\See the poll')}"><span
title="{__('Admin', 'See the poll')}"><span
class="glyphicon glyphicon-eye-open"></span><span
class="sr-only">{__('Admin\\See the poll')}</span></a></td>
class="sr-only">{__('Admin', 'See the poll')}</span></a></td>
<td><a href="{$poll->admin_id|poll_url:true|html}" class="btn btn-link"
title="{__('Admin\\Change the poll')}"><span
title="{__('Admin', 'Change the poll')}"><span
class="glyphicon glyphicon-pencil"></span><span
class="sr-only">{__('Admin\\Change the poll')}</span></a></td>
class="sr-only">{__('Admin', 'Change the poll')}</span></a></td>
<td>
<button type="submit" name="delete_poll" value="{$poll->id|html}" class="btn btn-link"
title="{__('Admin\\Deleted the poll')}"><span
title="{__('Admin', 'Deleted the poll')}"><span
class="glyphicon glyphicon-trash text-danger"></span><span
class="sr-only">{__('Admin\\Deleted the poll')}</span>
class="sr-only">{__('Admin', 'Deleted the poll')}</span>
</td>
</tr>
{/foreach}
</table>
<div class="panel-heading">
{__('Admin\\Pages:')}
{__('Admin', 'Pages:')}
{for $p=1 to $pages}
{if $p===$page}
<a href="{$SERVER_URL}admin/polls.php?page={$p}&{$search_query}" class="btn btn-danger"
@ -122,4 +122,4 @@
</div>
</div>
</form>
{/block}
{/block}

View File

@ -7,7 +7,7 @@
<form action="" method="POST">
<input type="hidden" name="csrf" value="{$crsf}"/>
<div class="text-center">
<button type="submit" name="action" value="purge" class="btn btn-warning">{__('Admin\\Purge the polls')} <span class="glyphicon glyphicon-trash text-danger"></span></button>
<button type="submit" name="action" value="purge" class="btn btn-warning">{__('Admin', 'Purge the polls')} <span class="glyphicon glyphicon-trash text-danger"></span></button>
</div>
</form>
{/block}
{/block}

View File

@ -3,9 +3,9 @@
{block name=main}
<form action="{$admin_poll_id|poll_url:true|html}" method="POST">
<div class="alert alert-danger text-center">
<h2>{__('adminstuds\\Confirm removal of all comments of the poll')}</h2>
<p><button class="btn btn-default" type="submit" name="cancel">{__('adminstuds\\Keep the comments')}</button>
<button type="submit" name="confirm_remove_all_comments" class="btn btn-danger">{__('adminstuds\\Remove the comments')}</button></p>
<h2>{__('adminstuds', 'Confirm removal of all comments of the poll')}</h2>
<p><button class="btn btn-default" type="submit" name="cancel">{__('adminstuds', 'Keep the comments')}</button>
<button type="submit" name="confirm_remove_all_comments" class="btn btn-danger">{__('adminstuds', 'Remove the comments')}</button></p>
</div>
</form>
{/block}

View File

@ -3,9 +3,9 @@
{block name=main}
<form action="{$admin_poll_id|poll_url:true|html}" method="POST">
<div class="alert alert-danger text-center">
<h2>{__('adminstuds\\Confirm removal of the poll')}</h2>
<p><button class="btn btn-default" type="submit" name="cancel">{__('adminstuds\\Keep the poll')}</button>
<button type="submit" name="confirm_delete_poll" class="btn btn-danger">{__('PollInfo\\Remove the poll')}</button></p>
<h2>{__('adminstuds', 'Confirm removal of the poll')}</h2>
<p><button class="btn btn-default" type="submit" name="cancel">{__('adminstuds', 'Keep the poll')}</button>
<button type="submit" name="confirm_delete_poll" class="btn btn-danger">{__('PollInfo', 'Remove the poll')}</button></p>
</div>
</form>
{/block}

View File

@ -3,9 +3,9 @@
{block name=main}
<form action="{$admin_poll_id|poll_url:true|html}" method="POST">
<div class="alert alert-danger text-center">
<h2>{__('adminstuds\\Confirm removal of all votes of the poll')}</h2>
<p><button class="btn btn-default" type="submit" name="cancel">{__('adminstuds\\Keep votes')}</button>
<button type="submit" name="confirm_remove_all_votes" class="btn btn-danger">{__('adminstuds\\Remove the votes')}</button></p>
<h2>{__('adminstuds', 'Confirm removal of all votes of the poll')}</h2>
<p><button class="btn btn-default" type="submit" name="cancel">{__('adminstuds', 'Keep votes')}</button>
<button type="submit" name="confirm_remove_all_votes" class="btn btn-danger">{__('adminstuds', 'Remove the votes')}</button></p>
</div>
</form>
{/block}

179
tpl/create_poll.tpl Normal file
View File

@ -0,0 +1,179 @@
{extends file='page.tpl'}
{block name=main}
<div class="row" style="display:none" id="form-block">
<div class="col-md-8 col-md-offset-2">
<form name="formulaire" id="formulaire" action="" method="POST" class="form-horizontal" role="form">
<div class="alert alert-info">
<p>
{__('Step 1', 'You are in the poll creation section.')}<br/>
{__('Step 1', 'Required fields cannot be left blank.')}
</p>
</div>
<div class="form-group '.$errors['title']['class'].'">
<label for="poll_title" class="col-sm-4 control-label">{__('Step 1', 'Poll title')} *</label>
<div class="col-sm-8">
<input id="poll_title" type="text" name="title" class="form-control" {$errors['title']['aria']}
value="{$poll_title}"/>
</div>
</div>
{if !empty($errors['title']['msg'])}
<div class="alert alert-danger">
<p id="poll_title_error">
{$errors['title']['msg']}
</p>
</div>
{/if}
<div class="form-group '.$errors['description']['class'].'">
<label for="poll_comments" class="col-sm-4 control-label">{__('Generic', 'Description')}</label>
<div class="col-sm-8">
<textarea id="poll_comments" name="description"
class="form-control" {$errors['description']['aria']}
rows="5">{$poll_description}</textarea>
</div>
</div>
{if !empty($errors['description']['msg'])}
<div class="alert alert-danger">
<p id="poll_title_error">
{$errors['description']['msg']}
</p>
</div>
{/if}
<div class="form-group '.$errors['name']['class'].'">
<label for="yourname" class="col-sm-4 control-label">{__('Generic', 'Your name')} *</label>
<div class="col-sm-8">
{if $useRemoteUser}
<input type="hidden" name="name" value="{$form->admin_name}" />{$form->admin_name}
{else}
<input id="yourname" type="text" name="name" class="form-control" {$errors['name']['aria']} value="{$poll_name}" />
{/if}
</div>
</div>
{if !empty($errors['name']['msg'])}
<div class="alert alert-danger">
<p id="poll_title_error">
{$errors['name']['msg']}
</p>
</div>
{/if}
{if $use_smtp}
<div class="form-group '.$errors['email']['class'].'">
<label for="email" class="col-sm-4 control-label">
{__('Generic', 'Your email address')} *<br/>
<span class="small">{__('Generic', '(in the format name@mail.com)')}</span>
</label>
<div class="col-sm-8">
{if $useRemoteUser}
<input type="hidden" name="mail" value="{$form->admin_mail}">{$form->admin_mail}
{else}
<input id="email" type="text" name="mail" class="form-control" {$errors['email']['aria']} value="{$poll_mail}" />
{/if}
</div>
</div>
{if !empty($errors['email']['msg'])}
<div class="alert alert-danger">
<p id="poll_title_error">
{$errors['email']['msg']}
</p>
</div>
{/if}
{/if}
<div class="form-group">
<div class="col-sm-offset-4 col-sm-8">
<div class="checkbox">
<label>
<input type=checkbox name="editable" {if $poll_editable}checked{/if} id="editable">
{__('Step 1', 'Voters can modify their vote themselves.')}
</label>
</div>
</div>
</div>
{if $use_smtp}
<div class="form-group">
<div class="col-sm-offset-4 col-sm-8">
<div class="checkbox">
<label>
<input type=checkbox name="receiveNewVotes" {if $poll_receiveNewVotes}checked{/if}
id="receiveNewVotes">
{__('Step 1', 'To receive an email for each new vote.')}
</label>
</div>
</div>
</div>
<div class="form-group">
<div class="col-sm-offset-4 col-sm-8">
<div class="checkbox">
<label>
<input type=checkbox name="receiveNewComments" {if $poll_receiveNewComments}checked{/if}
id="receiveNewComments">
{__('Step 1', 'To receive an email for each new comment.')}
</label>
</div>
</div>
</div>
{/if}
<p class="text-right">
<input type="hidden" name="type" value="$poll_type"/>
<button name="{$goToStep2}" value="{$poll_type}" type="submit"
class="btn btn-success">{__('Step 1', 'Go to step 2')}</button>
</p>
<script type="text/javascript">document.formulaire.title.focus();</script>
</form>
</div>
</div>
<noscript>
<div class="alert alert-danger">
{__('Step 1', 'Javascript is disabled on your browser. Its activation is required to create a poll.')}
</div>
</noscript>
<div id="cookie-warning" class="alert alert-danger" style="display:none">
{__('Step 1', 'Cookies are disabled on your browser. Theirs activation is required to create a poll.')}
</div>
<script>
{* TODO Put this in a JS file *}
// Check Javascript is enabled, if it is it will execute this script
(function () {
// Check cookies are enabled too
var cookieEnabled = function () {
var cookieEnabled = navigator.cookieEnabled;
// if not IE4+ nor NS6+
if (!cookieEnabled && typeof navigator.cookieEnabled === "undefined") {
document.cookie = "testcookie";
cookieEnabled = document.cookie.indexOf("testcookie") != -1;
}
return cookieEnabled;
};
if (cookieEnabled()) {
// Show the form block
document.getElementById("form-block").setAttribute("style", "");
} else {
// Show the warning about cookies
document.getElementById("cookie-warning").setAttribute("style", "");
}
})();
</script>
{/block}

View File

@ -3,6 +3,6 @@
{block name=main}
<div class="alert alert-warning text-center">
<h2>{$error|html}</h2>
<p>{__('Generic\\Back to the homepage of')} <a href="{$SERVER_URL|html}">{$APPLICATION_NAME|html}</a></p>
<p>{__('Generic', 'Back to the homepage of')} <a href="{$SERVER_URL|html}">{$APPLICATION_NAME|html}</a></p>
</div>
{/block}

View File

@ -2,19 +2,19 @@
{if count($langs)>1}
<form method="post" action="" class="hidden-print">
<div class="input-group input-group-sm pull-right col-md-2 col-xs-4">
<select name="lang" class="form-control" title="{__('Language selector\\Select the language')}" >
<select name="lang" class="form-control" title="{__('Language selector', 'Select the language')}" >
{foreach $langs as $lang_key=>$lang_value}
<option lang="{substr($lang_key, 0, 2)}" {if substr($lang_key, 0, 2)==$html_lang}selected{/if} value="{$lang_key|html}">{$lang_value|html}</option>
{/foreach}
</select>
<span class="input-group-btn">
<button type="submit" class="btn btn-default btn-sm" title="{__('Language selector\\Change the language')}">OK</button>
<button type="submit" class="btn btn-default btn-sm" title="{__('Language selector', 'Change the language')}">OK</button>
</span>
</div>
</form>
{/if}
<h1><a href="{$SERVER_URL|html}" title="{__('Generic\\Home')} - {$APPLICATION_NAME|html}"><img src="{$TITLE_IMAGE|resource}" alt="{$APPLICATION_NAME|html}"/></a></h1>
<h1><a href="{$SERVER_URL|html}" title="{__('Generic', 'Home')} - {$APPLICATION_NAME|html}"><img src="{$TITLE_IMAGE|resource}" alt="{$APPLICATION_NAME|html}"/></a></h1>
{if !empty($title)}<h2 class="lead"><i>{$title|html}</i></h2>{/if}
<hr class="trait" role="presentation" />
</header>

112
tpl/index.tpl Normal file
View File

@ -0,0 +1,112 @@
{extends file='page.tpl'}
{block name=main}
<div class="row">
<div class="col-md-6 text-center">
<p class="home-choice">
<a href="{$SERVER_URL}create_poll.php?type=date" class="opacity" role="button">
<img class="img-responsive center-block" src="{'images/date.png'|resource}" alt=""/>
<br/>
<span class="btn btn-primary btn-lg">
<span class="glyphicon glyphicon-calendar"></span>
{__('Homepage', 'Schedule an event')}
</span>
</a>
</p>
</div>
<div class="col-md-6 text-center">
<p class="home-choice">
<a href="{$SERVER_URL}create_poll.php?type=autre" class="opacity" role="button">
<img alt="" class="img-responsive center-block" src="{'images/classic.png'|resource}"/>
<br/>
<span class="btn btn-info btn-lg">
<span class="glyphicon glyphicon-stats"></span>
{__('Homepage', 'Make a classic poll')}
</span>
</a>
</p>
</div>
</div>
<hr role="presentation"/>
<div class="row">
{if $show_what_is_that}
<div class="col-md-{$col_size}">
<h3>{__('1st section', 'What is that?')}</h3>
<p class="text-center" role="presentation">
<span class="glyphicon glyphicon-question-sign" style="font-size:50px"></span>
</p>
<p>{__('1st section', 'Framadate is an online service for planning an appointment or make a decision quickly and easily. No registration is required.')}</p>
<p>{__('1st section', 'Here is how it works:')}</p>
<ol>
<li>{__('1st section', 'Make a poll')}</li>
<li>{__('1st section', 'Define dates or subjects to choose')}</li>
<li>{__('1st section', 'Send the poll link to your friends or colleagues')}</li>
<li>{__('1st section', 'Discuss and make a decision')}</li>
</ol>
{if $demo_poll != null}
<p>
{__('1st section', 'Do you want to')}
<a href="{'aqg259dth55iuhwm'|poll_url}">{__('1st section', 'view an example?')}</a>
</p>
{/if}
</div>
{/if}
{if $show_the_software}
<div class="col-md-{$col_size}">
<h3>{__('2nd section', 'The software')}</h3>
<p class="text-center" role="presentation">
<span class="glyphicon glyphicon-cloud" style="font-size:50px"></span>
</p>
<p>{__('2nd section', 'Framadate was initially based on ')}
<a href="https://sourcesup.cru.fr/projects/studs/">Studs</a>
{__('2nd section', 'a software developed by the University of Strasbourg. Today, it is devevoped by the association Framasoft.')}
</p>
<p>{__('2nd section', 'This software needs javascript and cookies enabled. It is compatible with the following web browsers:')}</p>
<ul>
<li>Microsoft Internet Explorer 9+</li>
<li>Google Chrome 19+</li>
<li>Firefox 12+</li>
<li>Safari 5+</li>
<li>Opera 11+</li>
</ul>
<p>
{__('2nd section', 'It is governed by the')}
<a href="http://www.cecill.info">{__('2nd section', 'CeCILL-B license')}</a>.
</p>
</div>
{/if}
{if $show_cultivate_your_garden}
<div class="col-md-{$col_size}">
<h3>{__('3rd section', 'Cultivate your garden')}</h3>
<p class="text-center" role="presentation">
<span class="glyphicon glyphicon-tree-deciduous" style="font-size:50px"></span>
</p>
<p>
{__('3rd section', 'To participate in the software development, suggest improvements or simply download it, please visit ')}
<a href="https://git.framasoft.org/framasoft/framadate">{__('3rd section', 'the development site')}</a>.
</p>
<br/>
<p>{__('3rd section', 'If you want to install the software for your own use and thus increase your independence, we help you on:')}</p>
<p class="text-center">
<a href="http://framacloud.org/cultiver-son-jardin/installation-de-framadate/"
class="btn btn-success">
<span class="glyphicon glyphicon-tree-deciduous"></span>
framacloud.org
</a>
</p>
</div>
{/if}
</div>
{/block}

View File

@ -4,11 +4,11 @@
{* Comment list *}
{if $comments|count > 0}
<h3>{__('Comments\\Comments of polled people')}</h3>
<h3>{__('Comments', 'Comments of polled people')}</h3>
{foreach $comments as $comment}
<div class="comment">
{if $admin && !$expired}
<button type="submit" name="delete_comment" value="{$comment->id|html}" class="btn btn-link" title="{__('Comments\\Remove the comment')}"><span class="glyphicon glyphicon-remove text-danger"></span><span class="sr-only">{__('Generic\\Remove')}</span></button>
<button type="submit" name="delete_comment" value="{$comment->id|html}" class="btn btn-link" title="{__('Comments', 'Remove the comment')}"><span class="glyphicon glyphicon-remove text-danger"></span><span class="sr-only">{__('Generic', 'Remove')}</span></button>
{/if}
<b>{$comment->name|html}</b>&nbsp;
<span class="comment">{nl2br($comment->comment|html)}</span>
@ -20,17 +20,17 @@
{if $active && !$expired}
<div class="hidden-print alert alert-info">
<div class="col-md-6 col-md-offset-3">
<fieldset id="add-comment"><legend>{__('Comments\\Add a comment to the poll')}</legend>
<fieldset id="add-comment"><legend>{__('Comments', 'Add a comment to the poll')}</legend>
<div class="form-group">
<label for="name" class="control-label">{__('Generic\\Your name')}</label>
<label for="name" class="control-label">{__('Generic', 'Your name')}</label>
<input type="text" name="name" id="name" class="form-control" />
</div>
<div class="form-group">
<label for="comment" class="control-label">{__('Comments\\Your comment')}</label>
<label for="comment" class="control-label">{__('Comments', 'Your comment')}</label>
<textarea name="comment" id="comment" class="form-control" rows="2" cols="40"></textarea>
</div>
<div class="pull-right">
<input type="submit" name="add_comment" value="{__('Comments\\Send the comment')}" class="btn btn-success">
<input type="submit" name="add_comment" value="{__('Comments', 'Send the comment')}" class="btn btn-success">
</div>
</fieldset>
</div>

View File

@ -1,11 +1,11 @@
{if $active}
<div class="alert alert-info">
<p>{__('studs\\If you want to vote in this poll, you have to give your name, choose the values that fit best for you and validate with the plus button at the end of the line.')}</p>
<p aria-hidden="true"><b>{__('Generic\\Legend:')}</b> <span class="glyphicon glyphicon-ok"></span> = {__('Generic\\Yes')}, <b>(<span class="glyphicon glyphicon-ok"></span>)</b> = {__('Generic\\Ifneedbe')}, <span class="glyphicon glyphicon-ban-circle"></span> = {_('No')}</p>
<p>{__('studs', 'If you want to vote in this poll, you have to give your name, choose the values that fit best for you and validate with the plus button at the end of the line.')}</p>
<p aria-hidden="true"><b>{__('Generic', 'Legend:')}</b> <span class="glyphicon glyphicon-ok"></span> = {__('Generic', 'Yes')}, <b>(<span class="glyphicon glyphicon-ok"></span>)</b> = {__('Generic', 'Ifneedbe')}, <span class="glyphicon glyphicon-ban-circle"></span> = {_('No')}</p>
</div>
{else}
<div class="alert alert-danger">
<p>{__('studs\\POLL_LOCKED_WARNING')}</p>
<p aria-hidden="true"><b>{__('Generic\\Legend:')}</b> <span class="glyphicon glyphicon-ok"></span> = {__('Generic\\Yes')}, <b>(<span class="glyphicon glyphicon-ok"></span>)</b> = {__('Generic\\Ifneedbe')}, <span class="glyphicon glyphicon-ban-circle"></span> = {_('No')}</p>
<p>{__('studs', 'POLL_LOCKED_WARNING')}</p>
<p aria-hidden="true"><b>{__('Generic', 'Legend:')}</b> <span class="glyphicon glyphicon-ok"></span> = {__('Generic', 'Yes')}, <b>(<span class="glyphicon glyphicon-ok"></span>)</b> = {__('Generic', 'Ifneedbe')}, <span class="glyphicon glyphicon-ban-circle"></span> = {_('No')}</p>
</div>
{/if}

View File

@ -1,7 +1,7 @@
<div class="alert alert-info">
<p>{__('adminstuds\\As poll administrator, you can change all the lines of this poll with this button')} <span class="glyphicon glyphicon-pencil"></span><span class="sr-only">{_('Edit')}</span>,
{__('adminstuds\\remove a column or a line with')} <span class="glyphicon glyphicon-remove text-danger"></span><span class="sr-only">{_('Remove')}</span>
{__('adminstuds\\and add a new column with')} <span class="glyphicon glyphicon-plus text-success"></span><span class="sr-only">{_('Add a column')}</span>.</p>
<p>{__('adminstuds\\Finally, you can change the informations of this poll like the title, the comments or your email address.')}</p>
<p aria-hidden="true"><strong>{__('Generic\\Legend:')}</strong> <span class="glyphicon glyphicon-ok"></span> = {__('Generic\\Yes')}, <b>(<span class="glyphicon glyphicon-ok"></span>)</b> = {__('Generic\\Ifneedbe')}, <span class="glyphicon glyphicon-ban-circle"></span> = {__('Generic\\No')}</p>
<p>{__('adminstuds', 'As poll administrator, you can change all the lines of this poll with this button')} <span class="glyphicon glyphicon-pencil"></span><span class="sr-only">{_('Edit')}</span>,
{__('adminstuds', 'remove a column or a line with')} <span class="glyphicon glyphicon-remove text-danger"></span><span class="sr-only">{_('Remove')}</span>
{__('adminstuds', 'and add a new column with')} <span class="glyphicon glyphicon-plus text-success"></span><span class="sr-only">{_('Add a column')}</span>.</p>
<p>{__('adminstuds', 'Finally, you can change the informations of this poll like the title, the comments or your email address.')}</p>
<p aria-hidden="true"><strong>{__('Generic', 'Legend:')}</strong> <span class="glyphicon glyphicon-ok"></span> = {__('Generic', 'Yes')}, <b>(<span class="glyphicon glyphicon-ok"></span>)</b> = {__('Generic', 'Ifneedbe')}, <span class="glyphicon glyphicon-ban-circle"></span> = {__('Generic', 'No')}</p>
</div>

View File

@ -4,15 +4,15 @@
<div class="jumbotron{if $admin} bg-danger{/if}">
<div class="row">
<div id="title-form" class="col-md-7">
<h3>{$poll->title|html}{if $admin && !$expired} <button class="btn btn-link btn-sm btn-edit" title="{__('PollInfo\\Edit the title')}"><span class="glyphicon glyphicon-pencil"></span><span class="sr-only">{__('Generic\\Edit')}</span></button>{/if}</h3>
<h3>{$poll->title|html}{if $admin && !$expired} <button class="btn btn-link btn-sm btn-edit" title="{__('PollInfo', 'Edit the title')}"><span class="glyphicon glyphicon-pencil"></span><span class="sr-only">{__('Generic', 'Edit')}</span></button>{/if}</h3>
{if $admin && !$expired}
<div class="hidden js-title">
<label class="sr-only" for="newtitle">{__('PollInfo\\Title')}</label>
<label class="sr-only" for="newtitle">{__('PollInfo', 'Title')}</label>
<div class="input-group">
<input type="text" class="form-control" id="newtitle" name="title" size="40" value="{$poll->title|html}" />
<span class="input-group-btn">
<button type="submit" class="btn btn-success" name="update_poll_info" value="title" title="{__('PollInfo\\Save the new title')}"><span class="glyphicon glyphicon-ok"></span><span class="sr-only">{__('Generic\\Save')}</span></button>
<button class="btn btn-link btn-cancel" title="{__('PollInfo\\Cancel the title edit')}"><span class="glyphicon glyphicon-remove"></span><span class="sr-only">{__('Generic\\Cancel')}</span></button>
<button type="submit" class="btn btn-success" name="update_poll_info" value="title" title="{__('PollInfo', 'Save the new title')}"><span class="glyphicon glyphicon-ok"></span><span class="sr-only">{__('Generic', 'Save')}</span></button>
<button class="btn btn-link btn-cancel" title="{__('PollInfo', 'Cancel the title edit')}"><span class="glyphicon glyphicon-remove"></span><span class="sr-only">{__('Generic', 'Cancel')}</span></button>
</span>
</div>
</div>
@ -20,17 +20,17 @@
</div>
<div class="col-md-5 hidden-print">
<div class="btn-group pull-right">
<button onclick="print(); return false;" class="btn btn-default"><span class="glyphicon glyphicon-print"></span> {__('PollInfo\\Print')}</button>
<a href="{$SERVER_URL|html}exportcsv.php?poll={$poll_id|html}" class="btn btn-default"><span class="glyphicon glyphicon-download-alt"></span> {__('PollInfo\\Export to CSV')}</a>
<button onclick="print(); return false;" class="btn btn-default"><span class="glyphicon glyphicon-print"></span> {__('PollInfo', 'Print')}</button>
<a href="{$SERVER_URL|html}exportcsv.php?poll={$poll_id|html}" class="btn btn-default"><span class="glyphicon glyphicon-download-alt"></span> {__('PollInfo', 'Export to CSV')}</a>
{if $admin && !$expired}
<button type="button" class="btn btn-danger dropdown-toggle" data-toggle="dropdown">
<span class="glyphicon glyphicon-trash"></span> <span class="sr-only">{__('Generic\\Remove')}</span> <span class="caret"></span>
<span class="glyphicon glyphicon-trash"></span> <span class="sr-only">{__('Generic', 'Remove')}</span> <span class="caret"></span>
</button>
<ul class="dropdown-menu" role="menu">
<li><button class="btn btn-link" type="submit" name="remove_all_votes">{__('PollInfo\\Remove all the votes') }</button></li>
<li><button class="btn btn-link" type="submit" name="remove_all_comments">{__('PollInfo\\Remove all the comments')}</button></li>
<li><button class="btn btn-link" type="submit" name="remove_all_votes">{__('PollInfo', 'Remove all the votes') }</button></li>
<li><button class="btn btn-link" type="submit" name="remove_all_comments">{__('PollInfo', 'Remove all the comments')}</button></li>
<li class="divider" role="presentation"></li>
<li><button class="btn btn-link" type="submit" name="delete_poll">{__('PollInfo\\Remove the poll')}</button></li>
<li><button class="btn btn-link" type="submit" name="delete_poll">{__('PollInfo', 'Remove the poll')}</button></li>
</ul>
{/if}
</div>
@ -38,16 +38,16 @@
</div>
<div class="row">
<div id="name-form" class="form-group col-md-5">
<h4 class="control-label">{__('PollInfo\\Initiator of the poll')}</h4>
<p class="form-control-static">{$poll->admin_name|html}{if $admin && !$expired} <button class="btn btn-link btn-sm btn-edit" title="{__('PollInfo\\Edit the name')}"><span class="glyphicon glyphicon-pencil"></span><span class="sr-only">{__('Generic\\Edit')}</span></button>{/if}</p>
<h4 class="control-label">{__('PollInfo', 'Initiator of the poll')}</h4>
<p class="form-control-static">{$poll->admin_name|html}{if $admin && !$expired} <button class="btn btn-link btn-sm btn-edit" title="{__('PollInfo', 'Edit the name')}"><span class="glyphicon glyphicon-pencil"></span><span class="sr-only">{__('Generic', 'Edit')}</span></button>{/if}</p>
{if $admin && !$expired}
<div class="hidden js-name">
<label class="sr-only" for="newname">{__('PollInfo\\Initiator of the poll')}</label>
<label class="sr-only" for="newname">{__('PollInfo', 'Initiator of the poll')}</label>
<div class="input-group">
<input type="text" class="form-control" id="newname" name="name" size="40" value="{$poll->admin_name|html}" />
<span class="input-group-btn">
<button type="submit" class="btn btn-success" name="update_poll_info" value="name" title="{__('PollInfo\\Save the new name')}"><span class="glyphicon glyphicon-ok"></span><span class="sr-only">{__('Generic\\Save')}</span></button>
<button class="btn btn-link btn-cancel" title="{__('PollInfo\\Cancel the name edit')}"><span class="glyphicon glyphicon-remove"></span><span class="sr-only">{__('Generic\\Cancel')}</span></button>
<button type="submit" class="btn btn-success" name="update_poll_info" value="name" title="{__('PollInfo', 'Save the new name')}"><span class="glyphicon glyphicon-ok"></span><span class="sr-only">{__('Generic', 'Save')}</span></button>
<button class="btn btn-link btn-cancel" title="{__('PollInfo', 'Cancel the name edit')}"><span class="glyphicon glyphicon-remove"></span><span class="sr-only">{__('Generic', 'Cancel')}</span></button>
</span>
</div>
</div>
@ -58,15 +58,15 @@
{if $admin}
<div class="form-group col-md-5">
<div id="email-form">
<p>{$poll->admin_mail|html}{if !$expired} <button class="btn btn-link btn-sm btn-edit" title="{__('PollInfo\\Edit the email adress')}"><span class="glyphicon glyphicon-pencil"></span><span class="sr-only">{__('Generic\\Edit')}</span></button>{/if}</p>
<p>{$poll->admin_mail|html}{if !$expired} <button class="btn btn-link btn-sm btn-edit" title="{__('PollInfo', 'Edit the email adress')}"><span class="glyphicon glyphicon-pencil"></span><span class="sr-only">{__('Generic', 'Edit')}</span></button>{/if}</p>
{if !$expired}
<div class="hidden js-email">
<label class="sr-only" for="admin_mail">{__('PollInfo\\Email')}</label>
<label class="sr-only" for="admin_mail">{__('PollInfo', 'Email')}</label>
<div class="input-group">
<input type="text" class="form-control" id="admin_mail" name="admin_mail" size="40" value="{$poll->admin_mail|html}" />
<span class="input-group-btn">
<button type="submit" name="update_poll_info" value="admin_mail" class="btn btn-success" title="{__('PollInfo\\Save the email address')}"><span class="glyphicon glyphicon-ok"></span><span class="sr-only">{__('Generic\\Save')}</span></button>
<button class="btn btn-link btn-cancel" title="{__('PollInfo\\Cancel the email address edit')}"><span class="glyphicon glyphicon-remove"></span><span class="sr-only">{__('Generic\\Cancel')}</span></button>
<button type="submit" name="update_poll_info" value="admin_mail" class="btn btn-success" title="{__('PollInfo', 'Save the email address')}"><span class="glyphicon glyphicon-ok"></span><span class="sr-only">{__('Generic', 'Save')}</span></button>
<button class="btn btn-link btn-cancel" title="{__('PollInfo', 'Cancel the email address edit')}"><span class="glyphicon glyphicon-remove"></span><span class="sr-only">{__('Generic', 'Cancel')}</span></button>
</span>
</div>
</div>
@ -75,14 +75,14 @@
</div>
{/if}
<div class="form-group col-md-7" id="description-form">
<h4 class="control-label">{__('Generic\\Description')}{if $admin && !$expired} <button class="btn btn-link btn-sm btn-edit" title="{__('PollInfo\\Edit the description')}"><span class="glyphicon glyphicon-pencil"></span><span class="sr-only">{__('Generic\\Edit')}</span></button>{/if}</h4>
<h4 class="control-label">{__('Generic', 'Description')}{if $admin && !$expired} <button class="btn btn-link btn-sm btn-edit" title="{__('PollInfo', 'Edit the description')}"><span class="glyphicon glyphicon-pencil"></span><span class="sr-only">{__('Generic', 'Edit')}</span></button>{/if}</h4>
<p class="form-control-static well">{$poll->description|html}</p>
{if $admin && !$expired}
<div class="hidden js-desc text-right">
<label class="sr-only" for="newdescription">{__('Generic\\Description')}</label>
<label class="sr-only" for="newdescription">{__('Generic', 'Description')}</label>
<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="{__('PollInfo\\Save the description')}"><span class="glyphicon glyphicon-ok"></span><span class="sr-only">{__('Generic\\Save')}</span></button>
<button class="btn btn-default btn-sm btn-cancel" title="{__('PollInfo\\Cancel the description edit')}"><span class="glyphicon glyphicon-remove"></span><span class="sr-only">{__('Generic\\Cancel')}</span></button>
<button type="submit" id="btn-new-desc" name="update_poll_info" value="description" class="btn btn-sm btn-success" title="{__('PollInfo', 'Save the description')}"><span class="glyphicon glyphicon-ok"></span><span class="sr-only">{__('Generic', 'Save')}</span></button>
<button class="btn btn-default btn-sm btn-cancel" title="{__('PollInfo', 'Cancel the description edit')}"><span class="glyphicon glyphicon-remove"></span><span class="sr-only">{__('Generic', 'Cancel')}</span></button>
</div>
{/if}
</div>
@ -90,25 +90,25 @@
<div class="row">
<div class="form-group form-group {if $admin}col-md-4{else}col-md-6{/if}">
<label for="public-link"><a class="public-link" href="{$poll_id|poll_url|html}">{__('PollInfo\\Public link of the poll')} <span class="btn-link glyphicon glyphicon-link"></span></a></label>
<label for="public-link"><a class="public-link" href="{$poll_id|poll_url|html}">{__('PollInfo', 'Public link of the poll')} <span class="btn-link glyphicon glyphicon-link"></span></a></label>
<input class="form-control" id="public-link" type="text" readonly="readonly" value="{$poll_id|poll_url}" />
</div>
{if $admin}
<div class="form-group col-md-4">
<label for="admin-link"><a class="admin-link" href="{$admin_poll_id|poll_url:true|html}">{__('PollInfo\\Admin link of the poll')} <span class="btn-link glyphicon glyphicon-link"></span></a></label>
<label for="admin-link"><a class="admin-link" href="{$admin_poll_id|poll_url:true|html}">{__('PollInfo', 'Admin link of the poll')} <span class="btn-link glyphicon glyphicon-link"></span></a></label>
<input class="form-control" id="admin-link" type="text" readonly="readonly" value="{$admin_poll_id|poll_url:true|html}" />
</div>
<div id="expiration-form" class="form-group col-md-4">
<h4 class="control-label">{__('PollInfo\\Expiration date')}</h4>
<p>{$poll->end_date|date_format:$date_format['txt_date']|html}{if !$expired} <button class="btn btn-link btn-sm btn-edit" title="{__('PollInfo\\Edit the expiration date')}"><span class="glyphicon glyphicon-pencil"></span><span class="sr-only">{__('Generic\\Edit')}</span></button>{/if}</p>
<h4 class="control-label">{__('PollInfo', 'Expiration date')}</h4>
<p>{$poll->end_date|date_format:$date_format['txt_date']|html}{if !$expired} <button class="btn btn-link btn-sm btn-edit" title="{__('PollInfo', 'Edit the expiration date')}"><span class="glyphicon glyphicon-pencil"></span><span class="sr-only">{__('Generic', 'Edit')}</span></button>{/if}</p>
{if !$expired}
<div class="hidden js-expiration">
<label class="sr-only" for="newexpirationdate">{__('PollInfo\\Expiration date')}</label>
<label class="sr-only" for="newexpirationdate">{__('PollInfo', 'Expiration date')}</label>
<div class="input-group">
<input type="text" class="form-control" id="newexpirationdate" name="expiration_date" size="40" value="{$poll->end_date|date_format:$date_format['txt_date']|html}" />
<span class="input-group-btn">
<button type="submit" class="btn btn-success" name="update_poll_info" value="expiration_date" title="{__('PollInfo\\Save the new expiration date')}"><span class="glyphicon glyphicon-ok"></span><span class="sr-only">{__('Generic\\Save')}</span></button>
<button class="btn btn-link btn-cancel" title="{__('PollInfo\\Cancel the expiration date edit')}"><span class="glyphicon glyphicon-remove"></span><span class="sr-only">{__('Generic\\Cancel')}</span></button>
<button type="submit" class="btn btn-success" name="update_poll_info" value="expiration_date" title="{__('PollInfo', 'Save the new expiration date')}"><span class="glyphicon glyphicon-ok"></span><span class="sr-only">{__('Generic', 'Save')}</span></button>
<button class="btn btn-link btn-cancel" title="{__('PollInfo', 'Cancel the expiration date edit')}"><span class="glyphicon glyphicon-remove"></span><span class="sr-only">{__('Generic', 'Cancel')}</span></button>
</span>
</div>
</div>
@ -124,30 +124,30 @@
{if $poll->editable}
{$rule_id = 2}
{$rule_icon = '<span class="glyphicon glyphicon-edit"></span>'}
{$rule_txt = __('PollInfo\\Votes are editable')}
{$rule_txt = __('PollInfo', 'Votes are editable')}
{else}
{$rule_id = 1}
{$rule_icon = '<span class="glyphicon glyphicon-check"></span>'}
{$rule_txt = __('PollInfo\\Votes and comments are open')}
{$rule_txt = __('PollInfo', 'Votes and comments are open')}
{/if}
{else}
{$rule_id = 0}
{$rule_icon = '<span class="glyphicon glyphicon-lock"></span>'}
{$rule_txt = __('PollInfo\\Votes and comments are locked')}
{$rule_txt = __('PollInfo', 'Votes and comments are locked')}
{/if}
<p class="">{$rule_icon} {$rule_txt|html}{if !$expired} <button class="btn btn-link btn-sm btn-edit" title="{__('PollInfo\\Edit the poll rules')}"><span class="glyphicon glyphicon-pencil"></span><span class="sr-only">{__('Generic\\Edit')}</span></button>{/if}</p>
<p class="">{$rule_icon} {$rule_txt|html}{if !$expired} <button class="btn btn-link btn-sm btn-edit" title="{__('PollInfo', 'Edit the poll rules')}"><span class="glyphicon glyphicon-pencil"></span><span class="sr-only">{__('Generic', 'Edit')}</span></button>{/if}</p>
{if !$expired}
<div class="hidden js-poll-rules">
<label class="sr-only" for="rules">{__('PollInfo\\Poll rules')}</label>
<label class="sr-only" for="rules">{__('PollInfo', 'Poll rules')}</label>
<div class="input-group">
<select class="form-control" id="rules" name="rules">
<option value="0"{if $rule_id==0} selected="selected"{/if}>{__('PollInfo\\Votes and comments are locked')}</option>
<option value="1"{if $rule_id==1} selected="selected"{/if}>{__('PollInfo\\Votes and comments are open')}</option>
<option value="2"{if $rule_id==2} selected="selected"{/if}>{__('PollInfo\\Votes are editable')}</option>
<option value="0"{if $rule_id==0} selected="selected"{/if}>{__('PollInfo', 'Votes and comments are locked')}</option>
<option value="1"{if $rule_id==1} selected="selected"{/if}>{__('PollInfo', 'Votes and comments are open')}</option>
<option value="2"{if $rule_id==2} selected="selected"{/if}>{__('PollInfo', 'Votes are editable')}</option>
</select>
<span class="input-group-btn">
<button type="submit" name="update_poll_info" value="rules" class="btn btn-success" title="{__('PollInfo\\Save the new rules')}"><span class="glyphicon glyphicon-ok"></span><span class="sr-only">{__('Generic\\Save')}</span></button>
<button class="btn btn-link btn-cancel" title="{__('PollInfo\\Cancel the rules edit')}"><span class="glyphicon glyphicon-remove"></span><span class="sr-only">{__('Generic\\Cancel')}</span></button>
<button type="submit" name="update_poll_info" value="rules" class="btn btn-success" title="{__('PollInfo', 'Save the new rules')}"><span class="glyphicon glyphicon-ok"></span><span class="sr-only">{__('Generic', 'Save')}</span></button>
<button class="btn btn-link btn-cancel" title="{__('PollInfo', 'Cancel the rules edit')}"><span class="glyphicon glyphicon-remove"></span><span class="sr-only">{__('Generic', 'Cancel')}</span></button>
</span>
</div>
</div>

View File

@ -2,23 +2,23 @@
{$best_choices = [0]}
{/if}
<h3>{__('Poll results\\Votes of the poll')}</h3>
<h3>{__('Poll results', 'Votes of the poll')}</h3>
<div id="tableContainer" class="tableContainer">
<form action="" method="POST" id="poll_form">
<table class="results">
<caption class="sr-only">{__('Poll results\\Votes of the poll')} {$poll->title|html}</caption>
<caption class="sr-only">{__('Poll results', 'Votes of the poll')} {$poll->title|html}</caption>
<thead>
{if $admin && !$expired}
<tr class="hidden-print">
<th role="presentation"></th>
{foreach $slots as $id=>$slot}
<td headers="C{$id}">
<button type="submit" name="delete_column" value="{$slot->title|html}" class="btn btn-link btn-sm" title="{__('adminstuds\\Remove the column')} {$slot->title|html}"><span class="glyphicon glyphicon-remove text-danger"></span><span class="sr-only">{__('Genric\\Remove')}</span></button>
<button type="submit" name="delete_column" value="{$slot->title|html}" class="btn btn-link btn-sm" title="{__('adminstuds', 'Remove the column')} {$slot->title|html}"><span class="glyphicon glyphicon-remove text-danger"></span><span class="sr-only">{__('Genric', 'Remove')}</span></button>
</td>
{/foreach}
<td>
<button type="submit" name="add_slot" class="btn btn-link btn-sm" title="{__('adminstuds\\Add a column')}"><span class="glyphicon glyphicon-plus text-success"></span><span class="sr-only">{__('Poll results\\Add a column')}</span></button>
<button type="submit" name="add_slot" class="btn btn-link btn-sm" title="{__('adminstuds', 'Add a column')}"><span class="glyphicon glyphicon-plus text-success"></span><span class="sr-only">{__('Poll results', 'Add a column')}</span></button>
</td>
</tr>
{/if}
@ -40,7 +40,7 @@
<td class="bg-info" style="padding:5px">
<div class="input-group input-group-sm">
<span class="input-group-addon"><span class="glyphicon glyphicon-user"></span></span>
<input type="text" id="name" name="name" value="{$vote->name|html}" class="form-control" title="{__('Genric\\Your name')}" placeholder="{__('Genric\\Your name')}" />
<input type="text" id="name" name="name" value="{$vote->name|html}" class="form-control" title="{__('Genric', 'Your name')}" placeholder="{__('Genric', 'Your name')}" />
</div>
</td>
@ -50,26 +50,26 @@
<ul class="list-unstyled choice">
<li class="yes">
<input type="radio" id="y-choice-{$id}" name="choices[{$id}]" value="2" {if $choice==2}checked {/if}/>
<label class="btn btn-default btn-xs" for="y-choice-{$id}" title="{__('Poll results\\Vote yes for')} {$slots[$id]->title|html}">
<span class="glyphicon glyphicon-ok"></span><span class="sr-only">{__('Genric\\Yes')}</span>
<label class="btn btn-default btn-xs" for="y-choice-{$id}" title="{__('Poll results', 'Vote yes for')} {$slots[$id]->title|html}">
<span class="glyphicon glyphicon-ok"></span><span class="sr-only">{__('Genric', 'Yes')}</span>
</label>
</li>
<li class="ifneedbe">
<input type="radio" id="i-choice-{$id}" name="choices[{$id}]" value="1" {if $choice==1}checked {/if}/>
<label class="btn btn-default btn-xs" for="i-choice-{$id}" title="{__('Poll results\\Vote ifneedbe for')} {$slots[$id]->title|html}">
(<span class="glyphicon glyphicon-ok"></span>)<span class="sr-only">{__('Genric\\Ifneedbe')}</span>
<label class="btn btn-default btn-xs" for="i-choice-{$id}" title="{__('Poll results', 'Vote ifneedbe for')} {$slots[$id]->title|html}">
(<span class="glyphicon glyphicon-ok"></span>)<span class="sr-only">{__('Genric', 'Ifneedbe')}</span>
</label>
</li>
<li class="no">
<input type="radio" id="n-choice-{$id}" name="choices[{$id}]" value="0" {if $choice==0}checked {/if}/>
<label class="btn btn-default btn-xs" for="n-choice-{$id}" title="{__('Poll results\\Vote no for')} {$slots[$id]->title|html}">
<span class="glyphicon glyphicon-ban-circle"></span><span class="sr-only">{__('Genric\\No')}</span>
<label class="btn btn-default btn-xs" for="n-choice-{$id}" title="{__('Poll results', 'Vote no for')} {$slots[$id]->title|html}">
<span class="glyphicon glyphicon-ban-circle"></span><span class="sr-only">{__('Genric', 'No')}</span>
</label>
</li>
</ul>
</td>
{/foreach}
<td style="padding:5px"><button type="submit" class="btn btn-success btn-xs check-name" name="save" value="{$vote->id|html}" title="{__('Poll results\\Save the choices')} {$vote->name|html}">{__('Generic\\Save')}</button></td>
<td style="padding:5px"><button type="submit" class="btn btn-success btn-xs check-name" name="save" value="{$vote->id|html}" title="{__('Poll results', 'Save the choices')} {$vote->name|html}">{__('Generic', 'Save')}</button></td>
{else}
{* Voted line *}
@ -79,23 +79,23 @@
{foreach $vote->choices as $id=>$choice}
{if $choice==2}
<td class="bg-success text-success" headers="C{$id}"><span class="glyphicon glyphicon-ok"></span><span class="sr-only">{__('Generic\\Yes')}</span></td>
<td class="bg-success text-success" headers="C{$id}"><span class="glyphicon glyphicon-ok"></span><span class="sr-only">{__('Generic', 'Yes')}</span></td>
{elseif $choice==1}
<td class="bg-warning text-warning" headers="C{$id}">(<span class="glyphicon glyphicon-ok"></span>)<span class="sr-only">{__('Generic\\Ifneedbe')}</span></td>
<td class="bg-warning text-warning" headers="C{$id}">(<span class="glyphicon glyphicon-ok"></span>)<span class="sr-only">{__('Generic', 'Ifneedbe')}</span></td>
{else}
<td class="bg-danger" headers="C{$id}"><span class="sr-only">{__('Generic\\No')}</span></td>
<td class="bg-danger" headers="C{$id}"><span class="sr-only">{__('Generic', 'No')}</span></td>
{/if}
{/foreach}
{if $active && $poll->editable && !$expired}
<td>
<button type="submit" class="btn btn-link btn-sm" name="edit_vote" value="{$vote->id|html}" title="{__('Poll results\\Edit the line:')} {$vote->name|html}">
<span class="glyphicon glyphicon-pencil"></span><span class="sr-only">{__('Generic\\Edit')}</span>
<button type="submit" class="btn btn-link btn-sm" name="edit_vote" value="{$vote->id|html}" title="{__('Poll results', 'Edit the line:')} {$vote->name|html}">
<span class="glyphicon glyphicon-pencil"></span><span class="sr-only">{__('Generic', 'Edit')}</span>
</button>
{if $admin}
<button type="submit" class="btn btn-link btn-sm" name="delete_vote" value="{$vote->id|html}" title="{__('Poll results\\Remove the line:')} {$vote->name|html}">
<span class="glyphicon glyphicon-remove text-danger"></span><span class="sr-only">{__('Generic\\Remove')}</span>
<button type="submit" class="btn btn-link btn-sm" name="delete_vote" value="{$vote->id|html}" title="{__('Poll results', 'Remove the line:')} {$vote->name|html}">
<span class="glyphicon glyphicon-remove text-danger"></span><span class="sr-only">{__('Generic', 'Remove')}</span>
</button>
{/if}
</td>
@ -113,7 +113,7 @@
<td class="bg-info" style="padding:5px">
<div class="input-group input-group-sm">
<span class="input-group-addon"><span class="glyphicon glyphicon-user"></span></span>
<input type="text" id="name" name="name" class="form-control" title="{__('Generic\\Your name')}" placeholder="{__('Generic\\Your name')}" />
<input type="text" id="name" name="name" class="form-control" title="{__('Generic', 'Your name')}" placeholder="{__('Generic', 'Your name')}" />
</div>
</td>
{foreach $slots as $id=>$slot}
@ -121,26 +121,26 @@
<ul class="list-unstyled choice">
<li class="yes">
<input type="radio" id="y-choice-{$id}" name="choices[{$id}]" value="2" />
<label class="btn btn-default btn-xs" for="y-choice-{$id}" title="{__('Poll results\\Vote yes for')} {$slot->title|html}">
<span class="glyphicon glyphicon-ok"></span><span class="sr-only">{__('Generic\\Yes')}</span>
<label class="btn btn-default btn-xs" for="y-choice-{$id}" title="{__('Poll results', 'Vote yes for')} {$slot->title|html}">
<span class="glyphicon glyphicon-ok"></span><span class="sr-only">{__('Generic', 'Yes')}</span>
</label>
</li>
<li class="ifneedbe">
<input type="radio" id="i-choice-{$id}" name="choices[{$id}]" value="1" />
<label class="btn btn-default btn-xs" for="i-choice-{$id}" title="{__('Poll results\\Vote ifneedbe for')} {$slot->title|html}">
(<span class="glyphicon glyphicon-ok"></span>)<span class="sr-only">{__('Generic\\Ifneedbe')}</span>
<label class="btn btn-default btn-xs" for="i-choice-{$id}" title="{__('Poll results', 'Vote ifneedbe for')} {$slot->title|html}">
(<span class="glyphicon glyphicon-ok"></span>)<span class="sr-only">{__('Generic', 'Ifneedbe')}</span>
</label>
</li>
<li class="no">
<input type="radio" id="n-choice-{$id}" name="choices[{$id}]" value="0" checked/>
<label class="btn btn-default btn-xs" for="n-choice-{$id}" title="{__('Poll results\\Vote no for')} {$slot->title|html}">
<span class="glyphicon glyphicon-ban-circle"></span><span class="sr-only">{__('Generic\\No')}</span>
<label class="btn btn-default btn-xs" for="n-choice-{$id}" title="{__('Poll results', 'Vote no for')} {$slot->title|html}">
<span class="glyphicon glyphicon-ban-circle"></span><span class="sr-only">{__('Generic', 'No')}</span>
</label>
</li>
</ul>
</td>
{/foreach}
<td><button type="submit" class="btn btn-success btn-md check-name" name="save" title="{__('Poll results\\Save the choices')}">{__('Generic\\Save')}</button></td>
<td><button type="submit" class="btn btn-success btn-md check-name" name="save" title="{__('Poll results', 'Save the choices')}">{__('Generic', 'Save')}</button></td>
</tr>
{/if}
@ -149,7 +149,7 @@
{$max = max($best_choices)}
{if $max > 0}
<tr id="addition">
<td>{__('Poll results\\Addition')}</td>
<td>{__('Poll results', 'Addition')}</td>
{foreach $best_choices as $best_choice}
{if $max == $best_choice}
{$count_bests = $count_bests +1}
@ -173,13 +173,13 @@
{if $max > 0}
<div class="row">
{if $count_bests == 1}
<div class="col-sm-12"><h3>{__('Poll results\\Best choice')}</h3></div>
<div class="col-sm-12"><h3>{__('Poll results', 'Best choice')}</h3></div>
<div class="col-sm-6 col-sm-offset-3 alert alert-success">
<p><span class="glyphicon glyphicon-star text-warning"></span>{__('Poll results\\The best choice at this time is:')}</p>
<p><span class="glyphicon glyphicon-star text-warning"></span>{__('Poll results', 'The best choice at this time is:')}</p>
{elseif $count_bests > 1}
<div class="col-sm-12"><h3>{__('Poll results\\Best choices')}</h3></div>
<div class="col-sm-12"><h3>{__('Poll results', 'Best choices')}</h3></div>
<div class="col-sm-6 col-sm-offset-3 alert alert-success">
<p><span class="glyphicon glyphicon-star text-warning"></span>{__('Poll results\\The bests choices at this time are:')}</p>
<p><span class="glyphicon glyphicon-star text-warning"></span>{__('Poll results', 'The bests choices at this time are:')}</p>
{/if}
@ -192,7 +192,7 @@
{$i = $i+1}
{/foreach}
</ul>
<p>{__('Generic\\with')} <b>{$max|html}</b> {if $max==1}{__('Generic\\vote')}{else}{__('Generic\\votes')}{/if}.</p>
<p>{__('Generic', 'with')} <b>{$max|html}</b> {if $max==1}{__('Generic', 'vote')}{else}{__('Generic', 'votes')}{/if}.</p>
</div>
</div>
{/if}

View File

@ -2,12 +2,12 @@
{$best_choices = [0]}
{/if}
<h3>{__('Poll results\\Votes of the poll')}</h3>
<h3>{__('Poll results', 'Votes of the poll')}</h3>
<div id="tableContainer" class="tableContainer">
<form action="" method="POST" id="poll_form">
<table class="results">
<caption class="sr-only">{__('Poll results\\Votes of the poll')} {$poll->title|html}</caption>
<caption class="sr-only">{__('Poll results', 'Votes of the poll')} {$poll->title|html}</caption>
<thead>
{if $admin && !$expired}
<tr class="hidden-print">
@ -16,13 +16,13 @@
{foreach $slots as $slot}
{foreach $slot->moments as $id=>$moment}
<td headers="M{$slot@key} D{$headersDCount} H{$headersDCount}">
<button type="submit" name="delete_column" value="{$slot->day|html}@{$moment|html}" class="btn btn-link btn-sm" title="{__('adminstuds\\Remove the column')} {$slot->day|date_format:$date_format.txt_short|html} - {$moment|html}"><span class="glyphicon glyphicon-remove text-danger"></span><span class="sr-only">{__('Generic\\Remove')}</span></button>
<button type="submit" name="delete_column" value="{$slot->day|html}@{$moment|html}" class="btn btn-link btn-sm" title="{__('adminstuds', 'Remove the column')} {$slot->day|date_format:$date_format.txt_short|html} - {$moment|html}"><span class="glyphicon glyphicon-remove text-danger"></span><span class="sr-only">{__('Generic', 'Remove')}</span></button>
</td>
{$headersDCount = $headersDCount+1}
{/foreach}
{/foreach}
<td>
<button type="submit" name="add_slot" class="btn btn-link btn-sm" title="{__('adminstuds\\Add a column')}"><span class="glyphicon glyphicon-plus text-success"></span><span class="sr-only">{__('Poll results\\Add a column')}</span></button>
<button type="submit" name="add_slot" class="btn btn-link btn-sm" title="{__('adminstuds', 'Add a column')}"><span class="glyphicon glyphicon-plus text-success"></span><span class="sr-only">{__('Poll results', 'Add a column')}</span></button>
</td>
</tr>
{/if}
@ -86,7 +86,7 @@
<td class="bg-info" style="padding:5px">
<div class="input-group input-group-sm">
<span class="input-group-addon"><span class="glyphicon glyphicon-user"></span></span>
<input type="text" id="name" name="name" value="{$vote->name|html}" class="form-control" title="{__('Generic\\Your name')}" placeholder="{__('Generic\\Your name')}" />
<input type="text" id="name" name="name" value="{$vote->name|html}" class="form-control" title="{__('Generic', 'Your name')}" placeholder="{__('Generic', 'Your name')}" />
</div>
</td>
@ -96,26 +96,26 @@
<ul class="list-unstyled choice">
<li class="yes">
<input type="radio" id="y-choice-{$k}" name="choices[{$k}]" value="2" {if $choice==2}checked {/if}/>
<label class="btn btn-default btn-xs" for="y-choice-{$k}" title="{__('Poll results\\Vote yes for')|html} {$slots_raw[$k]}">
<span class="glyphicon glyphicon-ok"></span><span class="sr-only">{__('Generic\\Yes')}</span>
<label class="btn btn-default btn-xs" for="y-choice-{$k}" title="{__('Poll results', 'Vote yes for')|html} {$slots_raw[$k]}">
<span class="glyphicon glyphicon-ok"></span><span class="sr-only">{__('Generic', 'Yes')}</span>
</label>
</li>
<li class="ifneedbe">
<input type="radio" id="i-choice-{$k}" name="choices[{$k}]" value="1" {if $choice==1}checked {/if}/>
<label class="btn btn-default btn-xs" for="i-choice-{$k}" title="{__('Poll results\\Vote ifneedbe for')|html} {$slots_raw[$k]}">
(<span class="glyphicon glyphicon-ok"></span>)<span class="sr-only">{__('Generic\\Ifneedbe')}</span>
<label class="btn btn-default btn-xs" for="i-choice-{$k}" title="{__('Poll results', 'Vote ifneedbe for')|html} {$slots_raw[$k]}">
(<span class="glyphicon glyphicon-ok"></span>)<span class="sr-only">{__('Generic', 'Ifneedbe')}</span>
</label>
</li>
<li class="no">
<input type="radio" id="n-choice-{$k}" name="choices[{$k}]" value="0" {if $choice==0}checked {/if}/>
<label class="btn btn-default btn-xs" for="n-choice-{$k}" title="{__('Poll results\\Vote no for')|html} {$slots_raw[$k]}">
<span class="glyphicon glyphicon-ban-circle"></span><span class="sr-only">{__('Generic\\No')}</span>
<label class="btn btn-default btn-xs" for="n-choice-{$k}" title="{__('Poll results', 'Vote no for')|html} {$slots_raw[$k]}">
<span class="glyphicon glyphicon-ban-circle"></span><span class="sr-only">{__('Generic', 'No')}</span>
</label>
</li>
</ul>
</td>
{/foreach}
<td style="padding:5px"><button type="submit" class="btn btn-success btn-xs check-name" name="save" value="{$vote->id|html}" title="{__('Poll results\\Save the choices')} {$vote->name|html}">{__('Generic\\Save')}</button></td>
<td style="padding:5px"><button type="submit" class="btn btn-success btn-xs check-name" name="save" value="{$vote->id|html}" title="{__('Poll results', 'Save the choices')} {$vote->name|html}">{__('Generic', 'Save')}</button></td>
{else}
{* Voted line *}
@ -125,23 +125,23 @@
{foreach $vote->choices as $k=>$choice}
{if $choice==2}
<td class="bg-success text-success" headers="M{$headersM[$k]} D{$headersD[$k]} H{$k}"><span class="glyphicon glyphicon-ok"></span><span class="sr-only">{__('Generic\\Yes')}</span></td>
<td class="bg-success text-success" headers="M{$headersM[$k]} D{$headersD[$k]} H{$k}"><span class="glyphicon glyphicon-ok"></span><span class="sr-only">{__('Generic', 'Yes')}</span></td>
{elseif $choice==1}
<td class="bg-warning text-warning" headers="M{$headersM[$k]} D{$headersD[$k]} H{$k}">(<span class="glyphicon glyphicon-ok"></span>)<span class="sr-only">{__('Generic\\Ifneedbe')}</span></td>
<td class="bg-warning text-warning" headers="M{$headersM[$k]} D{$headersD[$k]} H{$k}">(<span class="glyphicon glyphicon-ok"></span>)<span class="sr-only">{__('Generic', 'Ifneedbe')}</span></td>
{else}
<td class="bg-danger" headers="M{$headersM[$k]} D{$headersD[$k]} H{$k}"><span class="sr-only">{__('Generic\\No')}</span></td>
<td class="bg-danger" headers="M{$headersM[$k]} D{$headersD[$k]} H{$k}"><span class="sr-only">{__('Generic', 'No')}</span></td>
{/if}
{/foreach}
{if $active && $poll->editable && !$expired}
<td>
<button type="submit" class="btn btn-link btn-sm" name="edit_vote" value="{$vote->id|html}" title="{__('Poll results\\Edit the line:')} {$vote->name|html}">
<span class="glyphicon glyphicon-pencil"></span><span class="sr-only">{__('Generic\\Edit')}</span>
<button type="submit" class="btn btn-link btn-sm" name="edit_vote" value="{$vote->id|html}" title="{__('Poll results', 'Edit the line:')} {$vote->name|html}">
<span class="glyphicon glyphicon-pencil"></span><span class="sr-only">{__('Generic', 'Edit')}</span>
</button>
{if $admin}
<button type="submit" class="btn btn-link btn-sm" name="delete_vote" value="{$vote->id|html}" title="{__('Poll results\\Remove the line:')} {$vote->name|html}">
<span class="glyphicon glyphicon-remove text-danger"></span><span class="sr-only">{__('Generic\\Remove')}</span>
<button type="submit" class="btn btn-link btn-sm" name="delete_vote" value="{$vote->id|html}" title="{__('Poll results', 'Remove the line:')} {$vote->name|html}">
<span class="glyphicon glyphicon-remove text-danger"></span><span class="sr-only">{__('Generic', 'Remove')}</span>
</button>
{/if}
</td>
@ -159,7 +159,7 @@
<td class="bg-info" style="padding:5px">
<div class="input-group input-group-sm">
<span class="input-group-addon"><span class="glyphicon glyphicon-user"></span></span>
<input type="text" id="name" name="name" class="form-control" title="{__('Generic\\Your name')}" placeholder="{__('Generic\\Your name')}" />
<input type="text" id="name" name="name" class="form-control" title="{__('Generic', 'Your name')}" placeholder="{__('Generic', 'Your name')}" />
</div>
</td>
{$i = 0}
@ -169,20 +169,20 @@
<ul class="list-unstyled choice">
<li class="yes">
<input type="radio" id="y-choice-{$i}" name="choices[{$i}]" value="2" />
<label class="btn btn-default btn-xs" for="y-choice-{$i}" title="{__('Poll results\\Vote yes for')|html} {$slot->day|date_format:$date_format.txt_short|html} - {$moment|html}">
<span class="glyphicon glyphicon-ok"></span><span class="sr-only">{__('Generic\\Yes')}</span>
<label class="btn btn-default btn-xs" for="y-choice-{$i}" title="{__('Poll results', 'Vote yes for')|html} {$slot->day|date_format:$date_format.txt_short|html} - {$moment|html}">
<span class="glyphicon glyphicon-ok"></span><span class="sr-only">{__('Generic', 'Yes')}</span>
</label>
</li>
<li class="ifneedbe">
<input type="radio" id="i-choice-{$i}" name="choices[{$i}]" value="1" />
<label class="btn btn-default btn-xs" for="i-choice-{$i}" title="{__('Poll results\\Vote ifneedbe for')|html} {$slot->day|date_format:$date_format.txt_short|html} - {$moment|html}">
(<span class="glyphicon glyphicon-ok"></span>)<span class="sr-only">{__('Generic\\Ifneedbe')}</span>
<label class="btn btn-default btn-xs" for="i-choice-{$i}" title="{__('Poll results', 'Vote ifneedbe for')|html} {$slot->day|date_format:$date_format.txt_short|html} - {$moment|html}">
(<span class="glyphicon glyphicon-ok"></span>)<span class="sr-only">{__('Generic', 'Ifneedbe')}</span>
</label>
</li>
<li class="no">
<input type="radio" id="n-choice-{$i}" name="choices[{$i}]" value="0" checked/>
<label class="btn btn-default btn-xs" for="n-choice-{$i}" title="{__('Poll results\\Vote no for')|html} {$slot->day|date_format:$date_format.txt_short|html} - {$moment|html}">
<span class="glyphicon glyphicon-ban-circle"></span><span class="sr-only">{__('Generic\\No')}</span>
<label class="btn btn-default btn-xs" for="n-choice-{$i}" title="{__('Poll results', 'Vote no for')|html} {$slot->day|date_format:$date_format.txt_short|html} - {$moment|html}">
<span class="glyphicon glyphicon-ban-circle"></span><span class="sr-only">{__('Generic', 'No')}</span>
</label>
</li>
</ul>
@ -190,7 +190,7 @@
{$i = $i+1}
{/foreach}
{/foreach}
<td><button type="submit" class="btn btn-success btn-md check-name" name="save" title="{__('Poll results\\Save the choices')}">{__('Generic\\Save')}</button></td>
<td><button type="submit" class="btn btn-success btn-md check-name" name="save" title="{__('Poll results', 'Save the choices')}">{__('Generic', 'Save')}</button></td>
</tr>
{/if}
@ -199,7 +199,7 @@
{$max = max($best_choices)}
{if $max > 0}
<tr id="addition">
<td>{__('Poll results\\Addition')}</td>
<td>{__('Poll results', 'Addition')}</td>
{foreach $best_choices as $best_moment}
{if $max == $best_moment}
{$count_bests = $count_bests +1}
@ -223,13 +223,13 @@
{if $max > 0}
<div class="row">
{if $count_bests == 1}
<div class="col-sm-12"><h3>{__('Poll results\\Best choice')}</h3></div>
<div class="col-sm-12"><h3>{__('Poll results', 'Best choice')}</h3></div>
<div class="col-sm-6 col-sm-offset-3 alert alert-success">
<p><span class="glyphicon glyphicon-star text-warning"></span>{__('Poll results\\The best choice at this time is:')}</p>
<p><span class="glyphicon glyphicon-star text-warning"></span>{__('Poll results', 'The best choice at this time is:')}</p>
{elseif $count_bests > 1}
<div class="col-sm-12"><h3>{__('Poll results\\Best choices')}</h3></div>
<div class="col-sm-12"><h3>{__('Poll results', 'Best choices')}</h3></div>
<div class="col-sm-6 col-sm-offset-3 alert alert-success">
<p><span class="glyphicon glyphicon-star text-warning"></span>{__('Poll results\\The bests choices at this time are:')}</p>
<p><span class="glyphicon glyphicon-star text-warning"></span>{__('Poll results', 'The bests choices at this time are:')}</p>
{/if}
@ -244,7 +244,7 @@
{/foreach}
{/foreach}
</ul>
<p>{__('Generic\\with')} <b>{$max|html}</b> {if $max==1}{__('Generic\\vote')}{else}{__('Generic\\votes')}{/if}.</p>
<p>{__('Generic', 'with')} <b>{$max|html}</b> {if $max==1}{__('Generic', 'vote')}{else}{__('Generic', 'votes')}{/if}.</p>
</div>
</div>
{/if}

View File

@ -2,7 +2,7 @@
{block name=main}
<div class="alert alert-success text-center">
<h2>{__('adminstuds\\The poll has been deleted')}</h2>
<p>{__('Generic\\Back to the homepage of')} <a href="{$SERVER_URL|html}">{$APPLICATION_NAME|html}</a></p>
<h2>{__('adminstuds', 'The poll has been deleted')}</h2>
<p>{__('Generic', 'Back to the homepage of')} <a href="{$SERVER_URL|html}">{$APPLICATION_NAME|html}</a></p>
</div>
{/block}

View File

@ -12,7 +12,7 @@
<div class="alert alert-dismissible alert-{$message->type|html}" role="alert">{$message->message|html}<button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">&times;</span></button></div>
{/if}
</div>
<div id="nameErrorMessage" class="hidden alert alert-dismissible alert-danger" role="alert">{__('PollInfo\\The name is invalid.')}<button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">&times;</span></button></div>
<div id="nameErrorMessage" class="hidden alert alert-dismissible alert-danger" role="alert">{__('PollInfo', 'The name is invalid.')}<button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">&times;</span></button></div>
{* Global informations about the current poll *}
@ -22,8 +22,8 @@
{* Information about voting *}
{if $expired}
<div class="alert alert-danger">
<p>{__('studs\\The poll is expired, it will be deleted soon.')}</p>
<p>{__('studs\\Deletion date:')} {$deletion_date|date_format:$date_format['txt_short']|html}</p>
<p>{__('studs', 'The poll is expired, it will be deleted soon.')}</p>
<p>{__('studs', 'Deletion date:')} {$deletion_date|date_format:$date_format['txt_short']|html}</p>
</div>
{else}
{if $admin}
@ -37,10 +37,10 @@
<div class="hidden row scroll-buttons" aria-hidden="true">
<div class="btn-group pull-right">
<button class="btn btn-sm btn-link scroll-left" title="{__('Poll results\\Scroll to the left')}">
<button class="btn btn-sm btn-link scroll-left" title="{__('Poll results', 'Scroll to the left')}">
<span class="glyphicon glyphicon-chevron-left"></span>
</button>
<button class="btn btn-sm btn-link scroll-right" title="{__('Poll results\\Scroll to the right')}">
<button class="btn btn-sm btn-link scroll-right" title="{__('Poll results', 'Scroll to the right')}">
<span class="glyphicon glyphicon-chevron-right"></span>
</button>
</div>