Fix missing keys

This commit is contained in:
Olivier PEREZ 2015-04-07 20:06:24 +02:00
parent e26af38b35
commit 593d39c9cb
15 changed files with 65 additions and 164 deletions

Binary file not shown.

View File

@ -19,6 +19,6 @@
require_once '../app/inc/init.php';
$smarty->assign('title', _('Administration'));
$smarty->assign('title', __('Admin', 'Administration'));
$smarty->assign('logsAreReadable', is_readable('../' . LOG_FILE));
$smarty->display('admin/index.tpl');

View File

@ -23,9 +23,7 @@ ob_start();
is_readable('../' . LOG_FILE) ? readfile('../' . LOG_FILE) : null;
$content = ob_get_clean();
$smarty->assign('title', _('Administration'));
$smarty->assign('logs', $content);
$smarty->assign('title', __('Admin', 'Logs'));
$smarty->display('admin/logs.tpl');

View File

@ -46,7 +46,7 @@ $action = filter_input(INPUT_POST, 'action', FILTER_VALIDATE_REGEXP, ['options'
if ($action === 'purge' && $securityService->checkCsrf('admin', $_POST['csrf'])) {
$count = $purgeService->purgeOldPolls();
$message = _('Purged:') . ' ' . $count;
$message = __('Admin', 'Purged:') . ' ' . $count;
}
// Assign data to template

View File

@ -39,7 +39,7 @@ class MailService {
$headers .= "Auto-Submitted:auto-generated\n";
$headers .= 'Return-Path: <>';
$body = html_entity_decode($body, ENT_QUOTES, 'UTF-8') . _("\n--\n\n« La route est longue, mais la voie est libre… »\nFramasoft ne vit que par vos dons (déductibles des impôts).\nMerci d'avance pour votre soutien http://soutenir.framasoft.org.");
$body = html_entity_decode($body, ENT_QUOTES, 'UTF-8') . __('Mail', "\n--\n\n« La route est longue, mais la voie est libre… »\nFramasoft ne vit que par vos dons (déductibles des impôts).\nMerci d'avance pour votre soutien http://soutenir.framasoft.org.");
mail($to, $subject, $body, $headers, $param);
}

View File

@ -1,122 +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;
if (session_id() == "") {
session_start();
}
include_once __DIR__ . '/app/inc/init.php';
//Generer une chaine de caractere unique et aleatoire
function random($car)
{
$string = "";
$chaine = "abcdefghijklmnopqrstuvwxyz123456789";
srand((double)microtime()*1000000);
for($i=0; $i<$car; $i++) {
$string .= $chaine[rand()%strlen($chaine)];
}
return $string;
}
// Like function get_sondage_from_id()
function check_poll_id($id)
{
global $connect;
$sql = 'SELECT `id_sondage` FROM sondage`id_sondage` = ' . $connect->Param('id_sondage') ;
$sql = $connect->Prepare($sql);
$poll = $connect->Execute($sql, [$id]);
if ($poll === false) {
return false;
}
$dbpoll = $poll->FetchObject(false);
return $dbpoll->id_sondage;
}
function ajouter_sondage()
{
global $connect;
global $config;
$sondage = random(16);
while(check_poll_id($sondage) == $sondage) {
$sondage = random(16);
}
$sondage_admin = $sondage.random(8);
$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)
VALUES (
'.$connect->Param('id_sondage').',
'.$connect->Param('commentaires').',
'.$connect->Param('mail_admin').',
'.$connect->Param('nom_admin').',
'.$connect->Param('titre').',
'.$connect->Param('id_sondage_admin').',
FROM_UNIXTIME('.$date_fin.'),
'.$connect->Param('format').',
'.$connect->Param('mailsonde').'
)';
$sql = $connect->Prepare($sql);
$res = $connect->Execute($sql, array($sondage, $_SESSION['commentaires'], $_SESSION['adresse'], $_SESSION['nom'], $_SESSION['titre'], $sondage_admin, $_SESSION['formatsondage'], $_SESSION['mailsonde']));
$sql = 'INSERT INTO sujet_studs values ('.$connect->Param('sondage').', '.$connect->Param('choix').')';
$sql = $connect->Prepare($sql);
$connect->Execute($sql, array($sondage, $_SESSION['toutchoix']));
if($config['use_smtp']==true){
$message = _("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["nom"],ENT_QUOTES,"UTF-8"))." " . _("hast just created a poll called") . " : \"".stripslashes(htmlspecialchars_decode($_SESSION["titre"],ENT_QUOTES))."\".\n";
$message .= _("Thanks for filling the poll at the link above") . " :\n\n%s\n\n" . _("Thanks for your confidence.") . "\n".NOMAPPLICATION;
$message_admin = _("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" . _("Thanks for your confidence.") . "\n".NOMAPPLICATION;
$message = sprintf($message, Utils::getUrlSondage($sondage));
$message_admin = sprintf($message_admin, Utils::getUrlSondage($sondage_admin, true));
if (Utils::isValidEmail($_SESSION['adresse'])) {
Utils::sendEmail( "$_SESSION[adresse]", "[".NOMAPPLICATION."][" . _("Author's message") . "] " . _("Poll") . " : ".stripslashes(htmlspecialchars_decode($_SESSION["titre"],ENT_QUOTES)), $message_admin, $_SESSION['adresse'] );
Utils::sendEmail( "$_SESSION[adresse]", "[".NOMAPPLICATION."][" . _("For sending to the polled users") . "] " . _("Poll") . " : ".stripslashes(htmlspecialchars_decode($_SESSION["titre"],ENT_QUOTES)), $message, $_SESSION['adresse'] );
}
}
error_log(date('H:i:s d/m/Y:') . ' CREATION: '.$sondage."\t".$_SESSION[formatsondage]."\t".$_SESSION[nom]."\t".$_SESSION[adresse]."\t \t".$_SESSION[toutchoix]."\n", 3, 'admin/logs_studs.txt');
//Utils::cleaning_polls($connect, 'admin/logs_studs.txt');
// Don't keep days, hours and choices in memory (in order to make new polls)
for ($i = 0; $i < count($_SESSION["totalchoixjour"]); $i++) {
unset($_SESSION['horaires'.$i]);
}
unset($_SESSION["totalchoixjour"]);
unset($_SESSION['choices']);
header("Location:".Utils::getUrlSondage($sondage_admin, true));
exit();
}

View File

@ -33,8 +33,6 @@ Here are the main files and directories you need to know in order to develop on
* La page de création (2/2) pour un sondage pour déterminer une date
* 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
* bandeaux.php
* Le fichier contenant tous les bandeaux des pages PHP de l'application
* favicon.ico

View File

@ -48,7 +48,7 @@ if (!empty($_GET['poll'])) {
}
if (!$poll) {
$smarty->assign('error', _('This poll doesn\'t exist !'));
$smarty->assign('error', __('Error', 'This poll doesn\'t exist !'));
$smarty->display('error.tpl');
exit;
}
@ -86,13 +86,13 @@ foreach ($votes as $vote) {
foreach ($choices as $choice) {
switch ($choice) {
case 0:
$text = _('No');
$text = __('Generic', 'No');
break;
case 1:
$text = _('Ifneedbe');
$text = __('Generic', 'Ifneedbe');
break;
case 2:
$text = _('Yes');
$text = __('Generic', 'Yes');
break;
default:
$text = 'unkown';

View File

@ -148,7 +148,8 @@
"POLL_LOCKED_WARNING": "Die Administration gesperrt diese Umfrage. Bewertungen und Kommentare werden eingefroren, es ist nicht mehr möglich, teilzunehmen",
"The poll is expired, it will be deleted soon.": "Die Umfrage ist abgelaufen, es wird bald gelöscht werden.",
"Deletion date:": "Löschdatum:",
"Your vote has been registered successfully, but be careful: regarding this poll options, you need to keep this personal link to edit your own vote:": "DE_Votre vote a bien été pris en compte, mais faites attention : ce sondage n'autorise l'édition de votre vote qu'avec le lien personnalisé suivant ; conservez le précieusement ! "
"Your vote has been registered successfully, but be careful: regarding this poll options, you need to keep this personal link to edit your own vote:": "DE_Votre vote a bien été pris en compte, mais faites attention : ce sondage n'autorise l'édition de votre vote qu'avec le lien personnalisé suivant ; conservez le précieusement ! ",
"Update vote succeeded": "Update Abstimmung gelungen"
},
"adminstuds": {
"As poll administrator, you can change all the lines of this poll with this button": "Als Administrator der Umfrage, können Sie alle Zeilen der Umfrage über diesen Button ändern",
@ -244,6 +245,7 @@
},
"Admin": {
"Back to administration": "Zurück zur Verwaltung",
"Administration": "Verwaltung",
"Polls": "Umfragen",
"Migration": "Migration",
"Purge": "Säuberung",
@ -267,6 +269,7 @@
"Failed:": "fehlgeschlagen:",
"Skipped:": "übersprungene:",
"Pages:": "Seiten:",
"Purged:": "gespült :",
"Confirm removal of the poll": "Bestätigen Sie die Löschung ihrer Umfrage",
"polls in the database at this time": "Umfragen derzeit in der Datenbank",
"Purge the polls": "TRANSLATE_ Purge the polls"
@ -290,14 +293,17 @@
"Error": {
"Error!": "Fehler!",
"Enter a title": "Titel eingeben",
"Something is going wrong...": "Etwas falsch läuft...",
"Something is wrong with the format": "Something is wrong with the format",
"Enter an email address": "Sie müssen eine E-Mail-Adresse eingeben",
"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.": "Die Adresse ist nicht korrekt! Sie sollten eine funktionierende E-Mail-Adresse angeben, um den Link zu ihrer Umfrage zu erhalten",
"There is a problem with your choices": "Es gibt ein Problem mit der Auswahl",
"You haven't filled the first section of the poll creation.": "Sie haben den ersten Teil der Umfrageerstellung nicht ausgefüllt.",
"Javascript is disabled on your browser. Its activation is required to create a poll.": "Javascript ist in Ihrem Browser deaktiviert. Seine Aktivierung ist erforderlich, um eine Umfrage zu erstellen.",
"Cookies are disabled on your browser. Theirs activation is required to create a poll.": "Cookies werden auf Ihrem Browser deaktiviert. Deren Aktivierung ist erforderlich, um eine Umfrage zu erstellen.",
"This poll doesn't exist !": "Diese Umfrage existiert nicht!",
"Enter a name": "Geben Sie einen Namen ein",
"Name is incorrect": "Name ist falsch",
"The name you've chosen already exist in this poll!": "Der von Ihnen eingegebenen Name existiert bereits in dieser Umfrage",
"Enter a name and a comment!": "Geben Sie einen Namen und ein Kommentar ein!",
"Failed to insert the comment!": "Einfügen des Kommentars gescheitert!",
@ -305,6 +311,7 @@
"Failed to save poll": "Fehlgeschlagen Umfrage sparen",
"Update vote failed": "Update vote failed",
"Adding vote failed": "Adding vote failed",
"Comment failed": "Kommentar gescheitert",
"You can't create a poll with hidden results with the following edition option:": "DE_Vous ne pouvez pas créer de sondage avec résulats cachés avec les options d'éditions suivantes : "
}
}
}

View File

@ -85,7 +85,6 @@
"Remove all the votes": "Remove all the votes",
"Print": "Print",
"Export to CSV": "Export to CSV",
"Remove the poll": "Remove the poll",
"Title": "Title of the poll",
"Edit the title": "Edit the title",
"Save the new title": "Save the new title",
@ -149,7 +148,8 @@
"POLL_LOCKED_WARNING": "The administration locked this poll. Votes and comments are frozen, it is no longer possible to participate",
"The poll is expired, it will be deleted soon.": "The poll is expired, it will be deleted soon.",
"Deletion date:": "Deletion date:",
"Your vote has been registered successfully, but be careful: regarding this poll options, you need to keep this personal link to edit your own vote:": "Your vote has been registered successfully, but be careful: regarding this poll options, you need to keep this personal link to edit your own vote."
"Your vote has been registered successfully, but be careful: regarding this poll options, you need to keep this personal link to edit your own vote:": "Your vote has been registered successfully, but be careful: regarding this poll options, you need to keep this personal link to edit your own vote.",
"Update vote succeeded": "Update vote succeeded"
},
"adminstuds": {
"As poll administrator, you can change all the lines of this poll with this button": "As poll administrator, you can change all the lines of this poll with this button",
@ -245,6 +245,7 @@
},
"Admin": {
"Back to administration": "Back to administration",
"Administration": "Administration",
"Polls": "Polls",
"Migration": "Migration",
"Purge": "Purge",
@ -268,6 +269,7 @@
"Failed:": "Failed:",
"Skipped:": "Skipped:",
"Pages:": "Pages:",
"Purged:": "Purged:",
"Confirm removal of the poll": "Confirm removal of the poll ",
"polls in the database at this time": "polls in the database at this time",
"Purge the polls": "Purge the polls"
@ -291,14 +293,17 @@
"Error": {
"Error!": "Error!",
"Enter a title": "Enter a title",
"Something is going wrong...": "Something is going wrong...",
"Something is wrong with the format": "Something is wrong with the format",
"Enter an email address": "Enter an email address",
"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.": "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.",
"There is a problem with your choices": "There is a problem with your choices",
"You haven't filled the first section of the poll creation.": "You haven't filled the first section of the poll creation.",
"Javascript is disabled on your browser. Its activation is required to create a poll.": "Javascript is disabled on your browser. Its activation is required to create a poll.",
"Cookies are disabled on your browser. Theirs activation is required to create a poll.": "Cookies are disabled on your browser. Theirs activation is required to create a poll.",
"This poll doesn't exist !": "This poll doesn't exist !",
"Enter a name": "Enter a name",
"Name is incorrect": "Name is incorrect",
"The name you've chosen already exist in this poll!": "The name you've chosen already exist in this poll!",
"Enter a name and a comment!": "Enter a name and a comment!",
"Failed to insert the comment!": "Failed to insert the comment!",
@ -306,6 +311,7 @@
"Failed to save poll": "Failed to save poll",
"Update vote failed": "Update vote failed",
"Adding vote failed": "Adding vote failed",
"Comment failed": "Comment failed",
"You can't create a poll with hidden results with the following edition option:": "You can't create a poll with hidden results with the following edition option: "
}
}
}

View File

@ -148,7 +148,8 @@
"POLL_LOCKED_WARNING": "ES_L'administrateur a verrouillé ce sondage. Les votes et commentaires sont gelés, il n'est plus possible de participer",
"The poll is expired, it will be deleted soon.": "ES_Le sondage a expiré, il sera bientôt supprimé.",
"Deletion date:": "ES_Date de suppression :",
"Your vote has been registered successfully, but be careful: regarding this poll options, you need to keep this personal link to edit your own vote:": "ES_Votre vote a bien été pris en compte, mais faites attention : ce sondage n'autorise l'édition de votre vote qu'avec le lien personnalisé suivant ; conservez le précieusement ! "
"Your vote has been registered successfully, but be careful: regarding this poll options, you need to keep this personal link to edit your own vote:": "ES_Votre vote a bien été pris en compte, mais faites attention : ce sondage n'autorise l'édition de votre vote qu'avec le lien personnalisé suivant ; conservez le précieusement ! ",
"Update vote succeeded": "ES_Mise à jour du vote réussi"
},
"adminstuds": {
"As poll administrator, you can change all the lines of this poll with this button": "En calidad de administrador, Usted puede cambiar todas la líneas de este encuesta con este botón",
@ -244,6 +245,7 @@
},
"Admin": {
"Back to administration": "ES_Retour à l'administration",
"Administration": "ES_Administration",
"Polls": "ES_Sondages",
"Migration": "ES_Migration",
"Purge": "ES_Purge",
@ -267,6 +269,7 @@
"Failed:": "ES_Échoué:",
"Skipped:": "ES_Passé:",
"Pages:": "ES_Pages :",
"Purged:": "ES_Purgés :",
"Confirm removal of the poll": "Confirmar el borrado dela encuesta",
"polls in the database at this time": "encuestas en la basa por el momento",
"Purge the polls": "ES_Purger les sondages"
@ -290,14 +293,17 @@
"Error": {
"Error!": "Error!",
"Enter a title": "Introducza un título",
"Something is going wrong...": "ES_Quelque chose ne va pas...",
"Something is wrong with the format": "Something is wrong with the format",
"Enter an email address": "Introduzca una dirección electrónica",
"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.": "ES_L'adresse saisie n'est pas correcte ! Il faut une adresse électronique valide (par exemple r.stallman@outlock.com) pour recevoir le lien vers le sondage.",
"There is a problem with your choices": "ES_Il y a un problème avec vos choix",
"You haven't filled the first section of the poll creation.": "Usted no habia llenado la primera pagina dela encuesta",
"Javascript is disabled on your browser. Its activation is required to create a poll.": "ES_Javascript est désactivé sur votre navigateur. Son activation est requise pour la création d'un sondage.",
"Cookies are disabled on your browser. Theirs activation is required to create a poll.": "ES_Les cookies sont désactivés sur votre navigateur. Leur activation est requise pour la création d'un sondage.",
"This poll doesn't exist !": "Este encuesta no existe!",
"Enter a name": "Introduzca un nombre",
"Name is incorrect": "ES_Le nom est pas correct",
"The name you've chosen already exist in this poll!": "El nombre entrado existe ya!",
"Enter a name and a comment!": "Introduzca su nombre y un comentario!",
"Failed to insert the comment!": "ES_Échec à l'insertion du commentaire !",
@ -305,6 +311,7 @@
"Failed to save poll": "ES_Echèc de la sauvegarde du sondage",
"Update vote failed": "ES_Mise à jour du vote échoué",
"Adding vote failed": "ES_Ajout d'un vote échoué",
"Comment failed": "ES_Commentaire échoué",
"You can't create a poll with hidden results with the following edition option:": "ES_Vous ne pouvez pas créer de sondage avec résulats cachés avec les options d'éditions suivantes : "
}
}
}

View File

@ -148,7 +148,8 @@
"POLL_LOCKED_WARNING": "L'administrateur a verrouillé ce sondage. Les votes et commentaires sont gelés, il n'est plus possible de participer",
"The poll is expired, it will be deleted soon.": "Le sondage a expiré, il sera bientôt supprimé.",
"Deletion date:": "Date de suppression :",
"Your vote has been registered successfully, but be careful: regarding this poll options, you need to keep this personal link to edit your own vote:": "Votre vote a bien été pris en compte, mais faites attention : ce sondage n'autorise l'édition de votre vote qu'avec le lien personnalisé suivant ; conservez le précieusement ! "
"Your vote has been registered successfully, but be careful: regarding this poll options, you need to keep this personal link to edit your own vote:": "Votre vote a bien été pris en compte, mais faites attention : ce sondage n'autorise l'édition de votre vote qu'avec le lien personnalisé suivant ; conservez le précieusement ! ",
"Update vote succeeded": "Mise à jour du vote réussi"
},
"adminstuds": {
"As poll administrator, you can change all the lines of this poll with this button": "En tant qu'administrateur, vous pouvez modifier toutes les lignes de ce sondage avec ce bouton",
@ -244,6 +245,7 @@
},
"Admin": {
"Back to administration": "Retour à l'administration",
"Administration": "Administration",
"Polls": "Sondages",
"Migration": "Migration",
"Purge": "Purge",
@ -267,6 +269,7 @@
"Failed:": "Échoué:",
"Skipped:": "Passé:",
"Pages:": "Pages :",
"Purged:": "Purgés :",
"Confirm removal of the poll": "Confirmer la suppression du sondage",
"polls in the database at this time": "sondages dans la base actuellement",
"Purge the polls": "Purger les sondages"
@ -290,14 +293,17 @@
"Error": {
"Error!": "Erreur !",
"Enter a title": "Il faut saisir un titre !",
"Something is going wrong...": "Quelque chose ne va pas...",
"Something is wrong with the format": "Quelque chose ne va pas avec le format",
"Enter an email address": "Il faut saisir une adresse électronique !",
"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.": "L'adresse saisie n'est pas correcte ! Il faut une adresse électronique valide (par exemple r.stallman@outlock.com) pour recevoir le lien vers le sondage.",
"There is a problem with your choices": "Il y a un problème avec vos choix",
"You haven't filled the first section of the poll creation.": "Vous n'avez pas renseigné la première page du sondage",
"Javascript is disabled on your browser. Its activation is required to create a poll.": "Javascript est désactivé sur votre navigateur. Son activation est requise pour la création d'un sondage.",
"Cookies are disabled on your browser. Theirs activation is required to create a poll.": "Les cookies sont désactivés sur votre navigateur. Leur activation est requise pour la création d'un sondage.",
"This poll doesn't exist !": "Ce sondage n'existe pas !",
"Enter a name": "Vous n'avez pas saisi de nom !",
"Name is incorrect": "Le nom est pas correct",
"The name you've chosen already exist in this poll!": "Le nom que vous avez choisi existe déjà !",
"Enter a name and a comment!": "Merci de remplir les deux champs !",
"Failed to insert the comment!": "Échec à l'insertion du commentaire !",
@ -305,6 +311,7 @@
"Failed to save poll": "Echèc de la sauvegarde du sondage",
"Update vote failed": "Mise à jour du vote échoué",
"Adding vote failed": "Ajout d'un vote échoué",
"Comment failed": "Commentaire échoué",
"You can't create a poll with hidden results with the following edition option:": "Vous ne pouvez pas créer de sondage avec résulats cachés avec les options d'éditions suivantes : "
}
}

View File

@ -66,22 +66,22 @@ function sendUpdateNotification($poll, $mailService, $name, $type) {
if ($poll->receiveNewVotes && (!isset($_SESSION['mail_sent'][$poll->id]) || $_SESSION['mail_sent'][$poll->id] !== true)) {
$subject = '[' . NOMAPPLICATION . '] ' . _('Poll\'s participation') . ' : ' . $poll->title;
$subject = '[' . NOMAPPLICATION . '] ' . __('Mail', 'Poll\'s participation') . ' : ' . $poll->title;
$message = $name . ' ';
switch ($type) {
case UPDATE_VOTE:
$message .= _('updated a vote.\nYou can find your poll at the link') . " :\n\n";
$message .= __('Mail', "updated a vote.\nYou can find your poll at the link") . " :\n\n";
break;
case ADD_VOTE:
$message .= _('filled a vote.\nYou can find your poll at the link') . " :\n\n";
$message .= __('Mail', "filled a vote.\nYou can find your poll at the link") . " :\n\n";
break;
case ADD_COMMENT:
$message .= _('wrote a comment.\nYou can find your poll at the link') . " :\n\n";
$message .= __('Mail', "wrote a comment.\nYou can find your poll at the link") . " :\n\n";
break;
}
$message .= Utils::getUrlSondage($poll->admin_id, true) . "\n\n";
$message .= _('Thanks for your confidence.') . "\n" . NOMAPPLICATION;
$message .= __('Mail', 'Thanks for your confidence.') . "\n" . NOMAPPLICATION;
$mailService->send($poll->admin_mail, $subject, $message);
@ -100,7 +100,7 @@ if (!empty($_GET['poll'])) {
}
if (!$poll) {
$smarty->assign('error', _('This poll doesn\'t exist !'));
$smarty->assign('error', __('Error', 'This poll doesn\'t exist !'));
$smarty->display('error.tpl');
exit;
}
@ -123,10 +123,10 @@ 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', _('Something is going wrong...'));
$message = new Message('danger', __('Error', 'Something is going wrong...'));
}
if (count($choices) != count($_POST['choices'])) {
$message = new Message('danger', _('There is a problem with your choices.'));
$message = new Message('danger', __('Error', 'There is a problem with your choices'));
}
if ($message == null) {
@ -138,11 +138,11 @@ if (!empty($_POST['save'])) { // Save edition of an old vote
$urlEditVote = Utils::getUrlSondage($poll_id, false, $editedVoteUniqId);
$message = new Message('success', __('studs', "Your vote has been registered successfully, but be careful: regarding this poll options, you need to keep this personal link to edit your own vote:"), $urlEditVote);
} else {
$message = new Message('success', _('Update vote successfully.'));
$message = new Message('success', __('studs', 'Update vote succeeded'));
}
sendUpdateNotification($poll, $mailService, $name, UPDATE_VOTE);
} else {
$message = new Message('danger', _('Update vote failed.'));
$message = new Message('danger', __('Error', 'Update vote failed'));
}
}
} elseif (isset($_POST['save'])) { // Add a new vote
@ -150,10 +150,10 @@ 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', _('Name is incorrect.'));
$message = new Message('danger', __('Error', 'Name is incorrect'));
}
if (count($choices) != count($_POST['choices'])) {
$message = new Message('danger', _('There is a problem with your choices.'));
$message = new Message('danger', __('There is a problem with your choices'));
}
if ($message == null) {
@ -164,11 +164,11 @@ if (!empty($_POST['save'])) { // Save edition of an old vote
$urlEditVote = Utils::getUrlSondage($poll_id, false, $result->uniqId);
$message = new Message('success', __('studs', "Your vote has been registered successfully, but be careful: regarding this poll options, you need to keep this personal link to edit your own vote:"), $urlEditVote);
} else {
$message = new Message('success', _('Update vote successfully.'));
$message = new Message('success', __('studs', 'Update vote succeeded'));
}
sendUpdateNotification($poll, $mailService, $name, ADD_VOTE);
} else {
$message = new Message('danger', _('Update vote failed.'));
$message = new Message('danger', __('Error', 'Update vote failed'));
}
}
}
@ -182,17 +182,17 @@ if (isset($_POST['add_comment'])) {
$comment = strip_tags($_POST['comment']);
if (empty($name)) {
$message = new Message('danger', _('Name is incorrect.'));
$message = new Message('danger', __('Error', 'Name is incorrect'));
}
if ($message == null) {
// Add comment
$result = $pollService->addComment($poll_id, $name, $comment);
if ($result) {
$message = new Message('success', _('Comment added.'));
$message = new Message('success', __('Comments', 'Comment added'));
sendUpdateNotification($poll, $mailService, $name, ADD_COMMENT);
} else {
$message = new Message('danger', _('Comment failed.'));
$message = new Message('danger', __('Error', 'Comment failed'));
}
}
@ -206,7 +206,7 @@ $comments = $pollService->allCommentsByPollId($poll_id);
// Assign data to template
$smarty->assign('poll_id', $poll_id);
$smarty->assign('poll', $poll);
$smarty->assign('title', _('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

@ -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 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> = {__('Generic', '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 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> = {__('Generic', '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', '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">{__('Generic', 'Edit')}</span>,
{__('adminstuds', 'remove a column or a line with')} <span class="glyphicon glyphicon-remove text-danger"></span><span class="sr-only">{__('Generic', 'Remove')}</span>
{__('adminstuds', 'and add a new column with')} <span class="glyphicon glyphicon-plus text-success"></span><span class="sr-only">{__('adminstuds', '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>