Merge branch 'master' into 'master'
Création fichier config + prise en compte paramètres config + correction bugs * Correction de bugs. Mauvais formalisme de date sur Windows (e53043b2
) ; Objet du message lors de la notification par email (eb5677e4
) * Ajout d'un fichier de config (config.inc.php) * Prise en compte des quelques paramètres du fichier de config dans le code ==> permet à l'admin de paramétrer plus finement le comportement de l'outil. Je compte continuer à rendre plus paramétrable framadate mais seulement si vous partagez la même vision que moi : je ne compte pas faire un fork dans mon coin ;-) See merge request !12
This commit is contained in:
commit
db7d21b326
@ -76,21 +76,25 @@ if (!$sondage || $sondage->RecordCount() != 1){
|
||||
$dsujet=$sujets->FetchObject(false);
|
||||
$dsondage=$sondage->FetchObject(false);
|
||||
|
||||
// Send email (only once during the session) to alert admin of the change he made
|
||||
// Send email (only once during the session) to alert admin of the change he made. ==> two modifications (comment, title, description, ...) on differents polls in the same session will generate only one mail.
|
||||
$email_admin = $dsondage->mail_admin;
|
||||
$poll_title = $dsondage->titre;
|
||||
function send_mail_admin() {
|
||||
global $email_admin;
|
||||
global $poll_title;
|
||||
global $numsondageadmin;
|
||||
if(config_get('use_smtp')==true){
|
||||
if(!isset($_SESSION["mail_admin_sent"])) {
|
||||
Utils::sendEmail( $email_admin,
|
||||
_("[ADMINISTRATOR] New settings for your poll") . ' ' . stripslashes( $poll_title ),
|
||||
_("You have changed the settings of your poll. \nYou can modify this poll with this link") .
|
||||
" :\n\n" . Utils::getUrlSondage($numsondageadmin, true) . "\n\n" .
|
||||
_("Thanks for your confidence.") . "\n" . NOMAPPLICATION
|
||||
);
|
||||
$_SESSION["mail_admin_sent"]=true;
|
||||
}
|
||||
}
|
||||
|
||||
if(!isset($_SESSION["mail_admin_sent"])) {
|
||||
Utils::sendEmail( $email_admin,
|
||||
_("[ADMINISTRATOR] New settings for your poll") . ' ' . stripslashes( $dsondage->titre ),
|
||||
_("You have changed the settings of your poll. \nYou can modify this poll with this link") .
|
||||
" :\n\n" . Utils::getUrlSondage($numsondageadmin, true) . "\n\n" .
|
||||
_("Thanks for your confidence.") . "\n" . NOMAPPLICATION
|
||||
);
|
||||
$_SESSION["mail_admin_sent"]=true;
|
||||
}
|
||||
}
|
||||
|
||||
//si la valeur du nouveau titre est valide et que le bouton est activé
|
||||
@ -105,8 +109,10 @@ if (isset($_POST["boutonnouveautitre"])) {
|
||||
|
||||
//Email sent to the admin
|
||||
if ($connect->Execute($sql, array($nouveautitre, $numsondage))) {
|
||||
send_mail_admin();
|
||||
}
|
||||
//if(config_get('use_smtp')==true){
|
||||
send_mail_admin();
|
||||
//}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
49
app/inc/config.inc.php
Normal file
49
app/inc/config.inc.php
Normal file
@ -0,0 +1,49 @@
|
||||
<?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://git.framasoft.org/framasoft/framadate)
|
||||
*
|
||||
* =============================
|
||||
*
|
||||
* 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://git.framasoft.org/framasoft/framadate)
|
||||
*/
|
||||
|
||||
/**
|
||||
* general configuration
|
||||
*/
|
||||
|
||||
//use email for polls creation/modification/responses notification
|
||||
$use_smtp = true;
|
||||
|
||||
/**
|
||||
* index.php
|
||||
*/
|
||||
|
||||
//display "how to use" section
|
||||
$show_what_is_that = true;
|
||||
|
||||
//display technical information about the software
|
||||
$show_the_software = true;
|
||||
|
||||
//display "developpement and administration" information
|
||||
$show_cultivate_your_garden = true;
|
||||
|
||||
/**
|
||||
* choix_autre.php
|
||||
*/
|
||||
//default values for the new poll duration (number of days).
|
||||
$default_poll_duration = 30;
|
||||
|
||||
//user can add link or URL when creating his poll.
|
||||
$user_can_add_link_or_url = false;
|
||||
|
||||
|
24
app/inc/functions.inc.php
Normal file
24
app/inc/functions.inc.php
Normal file
@ -0,0 +1,24 @@
|
||||
<?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://git.framasoft.org/framasoft/framadate)
|
||||
*
|
||||
* =============================
|
||||
*
|
||||
* 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://git.framasoft.org/framasoft/framadate)
|
||||
*/
|
||||
function config_get($p_option){
|
||||
include('config.inc.php');
|
||||
if (isset(${$p_option})){
|
||||
return ${$p_option};
|
||||
}
|
||||
}
|
@ -25,7 +25,7 @@ require_once __DIR__ . '/../../vendor/autoload.php';
|
||||
|
||||
include_once __DIR__ . '/constants.php';
|
||||
include_once __DIR__ . '/i18n.php';
|
||||
|
||||
include_once __DIR__ . '/functions.inc.php';
|
||||
|
||||
$connect = NewADOConnection(BASE_TYPE);
|
||||
$connect->Connect(SERVEURBASE, USERBASE, USERPASSWD, BASE);
|
||||
|
12
bandeaux.php
12
bandeaux.php
@ -23,18 +23,22 @@ include_once __DIR__ . '/app/inc/init.php';
|
||||
// bandeaux de titre
|
||||
function bandeau_titre($titre)
|
||||
{
|
||||
global $ALLOWED_LANGUAGES;
|
||||
$img = ( IMAGE_TITRE ) ? '<img src="'. Utils::get_server_name(). IMAGE_TITRE. '" alt="'.NOMAPPLICATION.'">' : '';
|
||||
echo '
|
||||
<header role="banner">
|
||||
<form method="post" action="#">
|
||||
<header role="banner">';
|
||||
if(count($ALLOWED_LANGUAGES)>1){
|
||||
echo '<form method="post" action="#">
|
||||
<div class="input-group input-group-sm pull-right col-md-2 col-xs-4">
|
||||
<select name="lang" class="form-control" title="'. _("Select the language") .'" >' . liste_lang() . '</select>
|
||||
<span class="input-group-btn">
|
||||
<button type="submit" class="btn btn-default btn-sm" title="'. _("Change the language") .'">OK</button>
|
||||
</span>
|
||||
</div>
|
||||
</form>
|
||||
<h1><a href="'.str_replace('/admin','', Utils::get_server_name()).'" title="'._("Home").' - '.NOMAPPLICATION.'">'.$img.'</a></h1>
|
||||
</form>';
|
||||
}
|
||||
echo '
|
||||
<h1><a href="'.str_replace('/admin','', Utils::get_server_name()).'" title="'._("Home").' - '.NOMAPPLICATION.'">'.$img.'</a></h1>
|
||||
<h2 class="lead"><i>'. $titre .'</i></h2>
|
||||
<hr class="trait" />
|
||||
</header>
|
||||
|
@ -28,7 +28,7 @@ if (file_exists('bandeaux_local.php')) {
|
||||
}
|
||||
|
||||
// Step 1/3 : error if $_SESSION from info_sondage are not valid
|
||||
if (Utils::issetAndNoEmpty('titre', $_SESSION) === false || Utils::issetAndNoEmpty('nom', $_SESSION) === false || Utils::issetAndNoEmpty('adresse', $_SESSION) === false) {
|
||||
if (Utils::issetAndNoEmpty('titre', $_SESSION) === false || Utils::issetAndNoEmpty('nom', $_SESSION) === false || ((config_get('use_smtp')) ? Utils::issetAndNoEmpty('adresse', $_SESSION) === false : false)) {
|
||||
|
||||
Utils::print_header ( _("Error!") );
|
||||
bandeau_titre(_("Error!"));
|
||||
@ -57,8 +57,6 @@ if (Utils::issetAndNoEmpty('titre', $_SESSION) === false || Utils::issetAndNoEmp
|
||||
$temp_results=substr($temp_results,1);
|
||||
$_SESSION["toutchoix"]=$temp_results;
|
||||
|
||||
// Expiration date → after 6 months if not filled or in bad format
|
||||
$_SESSION["champdatefin"]=time()+15552000;
|
||||
|
||||
if (Utils::issetAndNoEmpty('champdatefin')) {
|
||||
$registredate = explode("/",$_POST["champdatefin"]);
|
||||
@ -69,7 +67,7 @@ if (Utils::issetAndNoEmpty('titre', $_SESSION) === false || Utils::issetAndNoEmp
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//format du sondage AUTRE
|
||||
$_SESSION["formatsondage"]="A".$_SESSION["studsplus"];
|
||||
|
||||
@ -93,9 +91,16 @@ if (Utils::issetAndNoEmpty('titre', $_SESSION) === false || Utils::issetAndNoEmp
|
||||
Utils::print_header ( _("Removal date and confirmation (3 on 3)") );
|
||||
bandeau_titre(_("Removal date and confirmation (3 on 3)"));
|
||||
|
||||
$removal_date=strftime(_("%A, den %e. %B %Y"), time()+15552000);
|
||||
// Expiration date is initialised with config parameter. Value will be modified in step 4 if user has defined an other date
|
||||
$_SESSION["champdatefin"]= time()+ (86400 * config_get('default_poll_duration')); //60 secondes * 60 minutes * 24 heures * config
|
||||
|
||||
// Sumary
|
||||
$date_format = _("%A, den %e. %B %Y"); //locale replacement
|
||||
if (strtoupper(substr(PHP_OS,0,3))=='WIN'){ //%e can't be used on Windows platform, use %#d instead
|
||||
$date_format = preg_replace('#(?<!%)((?:%%)*)%e#','\1%#d', $date_format); //replace %e by %#d for windows
|
||||
}
|
||||
$removal_date="(".strftime($date_format, ($_SESSION["champdatefin"])).")";//textual date
|
||||
|
||||
// Summary
|
||||
$summary = '<ol>';
|
||||
for ($i=0;$i<count($_SESSION['choices']);$i++) {
|
||||
|
||||
@ -137,7 +142,7 @@ if (Utils::issetAndNoEmpty('titre', $_SESSION) === false || Utils::issetAndNoEmp
|
||||
'. $summary .'
|
||||
</div>
|
||||
<div class="alert alert-info">
|
||||
<p>' . _("Your poll will be automatically removed after 6 months:") . ' <strong>'.$removal_date.'</strong>.<br />' . _("You can fix another removal date for it.") .'</p>
|
||||
<p>' . _("Your poll will be automatically removed after"). " " . config_get('default_poll_duration') . " " . _("days") . ' <strong>'.$removal_date.'</strong>.<br />' . _("You can fix another removal date for it.") .'</p>
|
||||
<div class="form-group">
|
||||
<label for="champdatefin" class="col-sm-5 control-label">'. _("Removal date (optional)") .'</label>
|
||||
<div class="col-sm-6">
|
||||
@ -175,9 +180,11 @@ if (Utils::issetAndNoEmpty('titre', $_SESSION) === false || Utils::issetAndNoEmp
|
||||
echo '
|
||||
<div class="alert alert-info">
|
||||
<p>'. _("To make a generic poll you need to propose at least two choices between differents subjects.") .'</p>
|
||||
<p>'. _("You can add or remove additional choices 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>'. _("It's possible to propose links or images by using "). '<a href="http://'.$lang.'.wikipedia.org/wiki/Markdown">'. _("the Markdown syntax") .'</a>.</p>
|
||||
</div>'."\n";
|
||||
<p>'. _("You can add or remove additional choices 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>';
|
||||
if(config_get('user_can_add_link_or_url')){
|
||||
echo ' <p>'. _("It's possible to propose links or images by using "). '<a href="http://'.$lang.'.wikipedia.org/wiki/Markdown">'. _("the Markdown syntax") .'</a>.</p>';
|
||||
}
|
||||
echo ' </div>'."\n";
|
||||
|
||||
// Fields choices : 5 by default
|
||||
$nb_choices = (isset($_SESSION['choices'])) ? max(count($_SESSION['choices']), 5) : 5;
|
||||
@ -187,9 +194,12 @@ if (Utils::issetAndNoEmpty('titre', $_SESSION) === false || Utils::issetAndNoEmp
|
||||
<div class="form-group choice-field">
|
||||
<label for="choice'.$i.'" class="col-sm-2 control-label">'. _("Choice") .' '.($i+1).'</label>
|
||||
<div class="col-sm-10 input-group">
|
||||
<input type="text" class="form-control" name="choices[]" size="40" value="'.$choice_value.'" id="choice'.$i.'" />
|
||||
<span class="input-group-addon btn-link md-a-img" title="'. _("Add a link or an image") .' - '. _("Choice") .' '.($i+1).'" ><span class="glyphicon glyphicon-picture"></span> <span class="glyphicon glyphicon-link"></span></span>
|
||||
</div>
|
||||
<input type="text" class="form-control" name="choices[]" size="40" value="'.$choice_value.'" id="choice'.$i.'" />';
|
||||
if(config_get('user_can_add_link_or_url')){
|
||||
echo '<span class="input-group-addon btn-link md-a-img" title="'. _("Add a link or an image") .' - '. _("Choice") .' '.($i+1).'" ><span class="glyphicon glyphicon-picture"></span> <span class="glyphicon glyphicon-link"></span></span>';
|
||||
}
|
||||
echo '
|
||||
</div>
|
||||
</div>'."\n";
|
||||
}
|
||||
|
||||
|
@ -45,8 +45,9 @@ function ajouter_sondage()
|
||||
$sondage=random(16);
|
||||
$sondage_admin=$sondage.random(8);
|
||||
|
||||
$date_fin = ($_SESSION["champdatefin"]) ? $_SESSION["champdatefin"] : $date_fin=time()+15552000;
|
||||
|
||||
//$date_fin = ($_SESSION["champdatefin"]) ? $_SESSION["champdatefin"] : $date_fin=time()+ (86400 * config_get('default_poll_duration'));
|
||||
$date_fin = $_SESSION["champdatefin"]; //always provided by choix_autre.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 (
|
||||
@ -67,22 +68,23 @@ function ajouter_sondage()
|
||||
$sql = $connect->Prepare($sql);
|
||||
$connect->Execute($sql, array($sondage, $_SESSION['toutchoix']));
|
||||
|
||||
$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;
|
||||
if(config_get('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_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'] );
|
||||
}
|
||||
$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');
|
||||
|
||||
|
30
index.php
30
index.php
@ -33,6 +33,7 @@ session_start();
|
||||
// affichage de la page
|
||||
Utils::print_header( _("Home") );
|
||||
bandeau_titre(_("Make your polls"));
|
||||
|
||||
echo '
|
||||
<div class="row">
|
||||
<div class="col-md-6 text-center">
|
||||
@ -51,8 +52,14 @@ echo '
|
||||
</div>
|
||||
</div>
|
||||
<hr />
|
||||
<div class="row">
|
||||
<div class="col-md-4">
|
||||
<div class="row">';
|
||||
$nbcol = config_get('show_what_is_that') + config_get('show_the_software') + config_get('show_cultivate_your_garden');
|
||||
if ($nbcol > 0){
|
||||
$colmd = 12/$nbcol; // 3 =>col-md-4, 2 =>col-md-6, 1 =>col-md-12.
|
||||
//echo "mon test : ".$nbActivation;
|
||||
}
|
||||
if(config_get('show_what_is_that') == true){
|
||||
echo '<div class="col-md-'.$colmd.'">
|
||||
<h3>'. _('What is that?') . '</h3>
|
||||
<p class="text-center"><span class="glyphicon glyphicon-question-sign" style="font-size:50px"></span></p>
|
||||
<p>'. _('Framadate is an online service for planning an appointment or make a decision quickly and easily. No registration is required.') .'</p>
|
||||
@ -64,8 +71,11 @@ echo '
|
||||
<li>'. _('Discuss and make a decision') . '</li>
|
||||
</ol>
|
||||
<p>'. _('Do you want to ') . '<a href="' . Utils::getUrlSondage('aqg259dth55iuhwm').'">'. _("view an example?") .'</a></p>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
</div>';
|
||||
}
|
||||
|
||||
if(config_get('show_the_software') == true){
|
||||
echo '<div class="col-md-'.$colmd.'">
|
||||
<h3>'. _('The software') .'</h3>
|
||||
<p class="text-center"><span class="glyphicon glyphicon-cloud" style="font-size:50px"></span></p>
|
||||
<p>'. _('Framadate was initially based on '). '<a href="https://sourcesup.cru.fr/projects/studs/">Studs</a>'. _(' a software developed by the University of Strasbourg. Today, it is devevoped by the association Framasoft') .'.</p>
|
||||
@ -78,15 +88,19 @@ echo '
|
||||
<li>Opera 11+</li>
|
||||
</ul>
|
||||
<p>'. _('It is governed by the ').'<a href="http://www.cecill.info">'. _('CeCILL-B license').'</a>.</p>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
</div>';
|
||||
}
|
||||
|
||||
if(config_get('show_cultivate_your_garden') == true){
|
||||
echo '<div class="col-md-'.$colmd.'">
|
||||
<h3>'. _('Cultivate your garden') .'</h3>
|
||||
<p class="text-center"><span class="glyphicon glyphicon-tree-deciduous" style="font-size:50px"></span></p>
|
||||
<p>'. _('To participate in the software development, suggest improvements or simply download it, please visit ') .'<a href="https://git.framasoft.org/framasoft/framadate">'._('the development site').'</a>.</p>
|
||||
<br />
|
||||
<p>'. _('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>
|
||||
</div>'."\n";
|
||||
</div>';
|
||||
}
|
||||
echo '</div>'."\n";
|
||||
|
||||
bandeau_pied();
|
||||
|
@ -77,9 +77,11 @@ if (Utils::issetAndNoEmpty("poursuivre")){
|
||||
unset($_SESSION["mailsonde"]);
|
||||
$_SESSION["mailsonde"] = ($mailsonde !== null) ? true : false;
|
||||
|
||||
if (Utils::isValidEmail($adresse) === false) {
|
||||
$erreur_adresse = true;
|
||||
}
|
||||
if (config_get('use_smtp')==true){
|
||||
if (Utils::isValidEmail($adresse) === false) {
|
||||
$erreur_adresse = true;
|
||||
}
|
||||
}
|
||||
|
||||
if (preg_match(';<|>|";',$titre)) {
|
||||
$erreur_injection_titre = true;
|
||||
@ -94,7 +96,14 @@ if (Utils::issetAndNoEmpty("poursuivre")){
|
||||
}
|
||||
|
||||
// Si pas d'erreur dans l'adresse alors on change de page vers date ou autre
|
||||
if ($titre && $nom && $adresse && !$erreur_adresse && ! $erreur_injection_titre && ! $erreur_injection_commentaires && ! $erreur_injection_nom) {
|
||||
if(config_get('use_smtp')==true){
|
||||
$email_OK = $adresse && !$erreur_adresse;
|
||||
}
|
||||
else{
|
||||
$email_OK = true;
|
||||
}
|
||||
|
||||
if ($titre && $nom && $email_OK && ! $erreur_injection_titre && ! $erreur_injection_commentaires && ! $erreur_injection_nom) {
|
||||
|
||||
if ( $poursuivre == "creation_sondage_date" ) {
|
||||
header("Location:choix_date.php");
|
||||
@ -242,16 +251,19 @@ echo '
|
||||
'.$input_name.'
|
||||
</div>
|
||||
</div>
|
||||
'.$errors['name']['msg'].'
|
||||
<div class="form-group'.$errors['email']['class'].'">
|
||||
<label for="email" class="col-sm-4 control-label">'. _("Your email address") .' *</label>
|
||||
<div class="col-sm-8">
|
||||
'.$input_email.'
|
||||
</div>
|
||||
</div>
|
||||
'.$errors['email']['msg'].'
|
||||
'.$errors['name']['msg'];
|
||||
if(config_get('use_smtp')==true){
|
||||
echo '
|
||||
<div class="form-group'.$errors['email']['class'].'">
|
||||
<label for="email" class="col-sm-4 control-label">'. _("Your email address") .' *</label>
|
||||
<div class="col-sm-8">
|
||||
'.$input_email.'
|
||||
</div>
|
||||
</div>
|
||||
'.$errors['email']['msg'];
|
||||
}
|
||||
|
||||
<div class="form-group">
|
||||
echo '<div class="form-group">
|
||||
<div class="col-sm-offset-1 col-sm-11">
|
||||
<div class="checkbox">
|
||||
<label>
|
||||
@ -259,18 +271,20 @@ echo '
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="col-sm-offset-1 col-sm-11">
|
||||
<div class="checkbox">
|
||||
<label>
|
||||
<input type=checkbox name=mailsonde '.$cochemail.' id="mailsonde">'. _("To receive an email for each new vote.") .'
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>';
|
||||
if(config_get('use_smtp')==true){
|
||||
echo '<div class="form-group">
|
||||
<div class="col-sm-offset-1 col-sm-11">
|
||||
<div class="checkbox">
|
||||
<label>
|
||||
<input type=checkbox name=mailsonde '.$cochemail.' id="mailsonde">'. _("To receive an email for each new vote.") .'
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>';
|
||||
}
|
||||
|
||||
<p class="text-right">
|
||||
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="'. _('Go to step 2') . '">'. _('Next') . '</button>
|
||||
</p>
|
||||
|
Binary file not shown.
@ -3,8 +3,8 @@ msgstr ""
|
||||
"Project-Id-Version: Framadate 0.8\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2014-10-23 20:52+0100\n"
|
||||
"PO-Revision-Date: 2014-10-23 20:52+0100\n"
|
||||
"Last-Translator: JosephK\n"
|
||||
"PO-Revision-Date: 2014-11-11 20:12+0100\n"
|
||||
"Last-Translator: mrB <mr.bricodage@gmail.com>\n"
|
||||
"Language-Team: JosephK\n"
|
||||
"Language: English\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
@ -81,6 +81,12 @@ msgstr "%A, den %e. %B %Y"
|
||||
msgid "Expiration's date"
|
||||
msgstr "Expiration's date"
|
||||
|
||||
msgid "days"
|
||||
msgstr "days"
|
||||
|
||||
msgid "months"
|
||||
msgstr "months"
|
||||
|
||||
########### Language selector ###########
|
||||
msgid "Change the language"
|
||||
msgstr "Change the language"
|
||||
@ -555,8 +561,8 @@ msgid "Removal date:"
|
||||
msgstr "Removal date:"
|
||||
|
||||
# Step 3 choix_autre.php
|
||||
msgid "Your poll will be automatically removed after 6 months:"
|
||||
msgstr "Your poll will be automatically removed after 6 months:"
|
||||
msgid "Your poll will be automatically removed after"
|
||||
msgstr "Your poll will be automatically removed after"
|
||||
|
||||
msgid "You can fix another removal date for it."
|
||||
msgstr "You can fix another removal date for it."
|
||||
@ -616,12 +622,15 @@ msgstr ""
|
||||
msgid "Thanks for your confidence."
|
||||
msgstr "Thanks for your confidence."
|
||||
|
||||
msgid "\n"
|
||||
"--\n\n"
|
||||
msgid ""
|
||||
"\n"
|
||||
"--\n"
|
||||
"\n"
|
||||
"« La route est longue, mais la voie est libre… »\n"
|
||||
"Framasoft ne vit que par vos dons (déductibles des impôts).\n"
|
||||
"Merci d'avance pour votre soutien http://soutenir.framasoft.org."
|
||||
msgstr "\n"
|
||||
msgstr ""
|
||||
"\n"
|
||||
"\n"
|
||||
"\n"
|
||||
"\n"
|
||||
@ -666,3 +675,4 @@ msgstr "Author's message"
|
||||
|
||||
msgid "For sending to the polled users"
|
||||
msgstr "For sending to the polled users"
|
||||
|
||||
|
Binary file not shown.
@ -3,8 +3,8 @@ msgstr ""
|
||||
"Project-Id-Version: Framadate 0.8\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2014-10-23 20:52+0100\n"
|
||||
"PO-Revision-Date: 2014-10-23 20:52+0100\n"
|
||||
"Last-Translator: JosephK\n"
|
||||
"PO-Revision-Date: 2014-11-11 13:19+0100\n"
|
||||
"Last-Translator: mrB <mr.bricodage@gmail.com>\n"
|
||||
"Language-Team: JosephK\n"
|
||||
"Language: French\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
@ -81,6 +81,12 @@ msgstr "%A %e %B %Y"
|
||||
msgid "Expiration's date"
|
||||
msgstr "Date d'expiration"
|
||||
|
||||
msgid "days"
|
||||
msgstr "jours"
|
||||
|
||||
msgid "months"
|
||||
msgstr "mois"
|
||||
|
||||
########### Language selector ###########
|
||||
msgid "Change the language"
|
||||
msgstr "Changer la langue"
|
||||
@ -555,8 +561,8 @@ msgid "Removal date:"
|
||||
msgstr "Date de suppression :"
|
||||
|
||||
# Step 3 choix_autre.php
|
||||
msgid "Your poll will be automatically removed after 6 months:"
|
||||
msgstr "Votre sondage sera automatiquement effacé dans 6 mois :"
|
||||
msgid "Your poll will be automatically removed after"
|
||||
msgstr "Votre sondage sera automatiquement effacé dans"
|
||||
|
||||
msgid "You can fix another removal date for it."
|
||||
msgstr "Néanmoins vous pouvez décider ci-dessous d'une date plus rapprochée pour la suppression de votre sondage."
|
||||
|
16
studs.php
16
studs.php
@ -173,13 +173,15 @@ if (!Utils::is_error(NO_POLL) && (isset($_POST["boutonp"]))) {
|
||||
$connect->Execute($sql, array($nom, $numsondage, $nouveauchoix));
|
||||
|
||||
if ($dsondage->mailsonde || /* compatibility for non boolean DB */ $dsondage->mailsonde=="yes" || $dsondage->mailsonde=="true") {
|
||||
Utils::sendEmail( "$dsondage->mail_admin",
|
||||
"[".NOMAPPLICATION."] "._("Poll's participation")." : ".html_entity_decode($dsondage->titre, ENT_QUOTES, 'UTF-8')."",
|
||||
html_entity_decode("\"$nom\" ", ENT_QUOTES, 'UTF-8').
|
||||
_("has filled a line.\nYou can find your poll at the link") . " :\n\n".
|
||||
Utils::getUrlSondage($numsondage) . " \n\n" .
|
||||
_("Thanks for your confidence.") . "\n". NOMAPPLICATION );
|
||||
}
|
||||
if(config_get('use_smtp')==true){
|
||||
Utils::sendEmail( "$dsondage->mail_admin",
|
||||
"[".NOMAPPLICATION."] "._("Poll's participation")." : ".html_entity_decode($dsondage->titre, ENT_QUOTES, 'UTF-8')."",
|
||||
html_entity_decode("\"$nom\" ", ENT_QUOTES, 'UTF-8').
|
||||
_("has filled a line.\nYou can find your poll at the link") . " :\n\n".
|
||||
Utils::getUrlSondage($numsondage) . " \n\n" .
|
||||
_("Thanks for your confidence.") . "\n". NOMAPPLICATION );
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
$err |= NAME_EMPTY;
|
||||
|
Loading…
Reference in New Issue
Block a user