From 0e91c25789ea7d0f652ac1d0efa7872e367e3c82 Mon Sep 17 00:00:00 2001 From: "Spanti Nicola (RyDroid)" Date: Wed, 26 Nov 2014 18:32:50 +0100 Subject: [PATCH 01/17] Clearer names for LICENSE files Licence also exists in english. https://en.wiktionary.org/wiki/licence --- LICENCE => LICENCE.fr.txt | 0 LICENSE => LICENSE.en.txt | 0 2 files changed, 0 insertions(+), 0 deletions(-) rename LICENCE => LICENCE.fr.txt (100%) rename LICENSE => LICENSE.en.txt (100%) diff --git a/LICENCE b/LICENCE.fr.txt similarity index 100% rename from LICENCE rename to LICENCE.fr.txt diff --git a/LICENSE b/LICENSE.en.txt similarity index 100% rename from LICENSE rename to LICENSE.en.txt From 8272e0db84fb65210eddf5a370e0c5a2411fea79 Mon Sep 17 00:00:00 2001 From: "Spanti Nicola (RyDroid)" Date: Wed, 26 Nov 2014 19:21:46 +0100 Subject: [PATCH 02/17] Cleaning of adminstuds.php --- adminstuds.php | 362 ++++++++++++++++++++++++++----------------------- 1 file changed, 191 insertions(+), 171 deletions(-) diff --git a/adminstuds.php b/adminstuds.php index 3c3f017..8ff8485 100644 --- a/adminstuds.php +++ b/adminstuds.php @@ -29,15 +29,50 @@ if (file_exists('bandeaux_local.php')) { include_once('bandeaux.php'); } +function getChoicesFromPOST($nbColumns) +{ + $choices = array(); + for ($i=0; $i < $nbcolonnes; ++$i) { + // radio checked 1 = Yes, 2 = Ifneedbe, 0 = No + if (isset($_POST['choix'. $i])) { + $choices[] = $_POST['choix'. $i]; + } + } + return $choices; +} + +function getNewChoiceFromChoices($choices) +{ + if(!is_array($choice)) { + throw new Exception('$choices must be a an array'); + } + + $newChoice = ''; + foreach ($choices as $choice) { + // radio checked 1 = Yes, 2 = Ifneedbe, 0 = No + switch ($choice) { + case 1: $newChoice .= '1'; break; + case 2: $newChoice .= '2'; break; + default: $newChoice .= '0'; + } + } + return $newChoice; +} + +function getNewChoiceFromPOST($nbColumns) +{ + return getNewChoiceFromChoices(getChoicesFromPOST($nbColumns)); +} + // Initialisation des variables $numsondageadmin = false; $sondage = false; // recuperation du numero de sondage admin (24 car.) dans l'URL if (Utils::issetAndNoEmpty('sondage', $_GET) && is_string($_GET['sondage']) && strlen($_GET['sondage']) === 24) { - $numsondageadmin=$_GET["sondage"]; + $numsondageadmin = $_GET['sondage']; //on découpe le résultat pour avoir le numéro de sondage (16 car.) - $numsondage=substr($numsondageadmin, 0, 16); + $numsondage = substr($numsondageadmin, 0, 16); } if (preg_match(";[\w\d]{24};i", $numsondageadmin)) { @@ -50,7 +85,7 @@ if (preg_match(";[\w\d]{24};i", $numsondageadmin)) { $sql = $connect->Prepare($sql); $sujets = $connect->Execute($sql, array($numsondage)); - $sql = 'SELECT * FROM user_studs WHERE id_sondage = '.$connect->Param('numsondage').' order by id_users'; + $sql = 'SELECT * FROM user_studs WHERE id_sondage = '.$connect->Param('numsondage').' ORDER BY id_users'; $sql = $connect->Prepare($sql); $user_studs = $connect->Execute($sql, array($numsondage)); } @@ -85,22 +120,22 @@ function send_mail_admin() { global $poll_title; global $numsondageadmin; global $smtp_allowed; - if($smtp_allowed==true){ - if(!isset($_SESSION["mail_admin_sent"])) { + if($smtp_allowed == 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") . + _('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 + _('Thanks for your confidence.') . "\n" . NOMAPPLICATION ); - $_SESSION["mail_admin_sent"]=true; + $_SESSION['mail_admin_sent']=true; } } } //si la valeur du nouveau titre est valide et que le bouton est activé -if (isset($_POST["boutonnouveautitre"])) { +if (isset($_POST['boutonnouveautitre'])) { if (Utils::issetAndNoEmpty('nouveautitre') === false) { $err |= TITLE_EMPTY; } else { @@ -155,12 +190,9 @@ if (isset($_POST["boutonnouvelleadresse"])) { //New poll rules if (isset($_POST["btn_poll_rules"])) { echo ''; - if($_POST['poll_rules'] == '+') { - $new_poll_rules = substr($dsondage->format, 0, 1).'+'; - } elseif($_POST['poll_rules'] == '-') { - $new_poll_rules = substr($dsondage->format, 0, 1).'-'; - } else { - $new_poll_rules = substr($dsondage->format, 0, 1); + $new_poll_rules = substr($dsondage->format, 0, 1); + if($_POST['poll_rules'] == '+' || $_POST['poll_rules'] == '-') { + $new_poll_rules .= $_POST['poll_rules']; } //Update SQL database with new rules @@ -177,10 +209,10 @@ if (isset($_POST["btn_poll_rules"])) { $dsujet=$sujets->FetchObject(false); $dsondage=$sondage->FetchObject(false); -if (isset($_POST["ajoutsujet"])) { - Utils::print_header( _("Add a column") .' - ' . stripslashes( $dsondage->titre )); +if (isset($_POST['ajoutsujet'])) { + Utils::print_header( _('Add a column') .' - ' . stripslashes( $dsondage->titre )); - bandeau_titre(_("Make your polls")); + bandeau_titre(_('Make your polls')); //on recupere les données et les sujets du sondage @@ -201,14 +233,14 @@ if (isset($_POST["ajoutsujet"])) { } else { //ajout d'une date avec creneau horaire echo ' -

'. _("You can add a new scheduling date to your poll.").'
'._("If you just want to add a new hour to an existant date, put the same date and choose a new hour.") .'

+

'. _('You can add a new scheduling date to your poll.').'
'._('If you just want to add a new hour to an existant date, put the same date and choose a new hour.') .'

- +
'. _("(dd/mm/yyyy)") .'
@@ -243,8 +275,8 @@ if (isset($_POST["suppressionsondage"])) {

' . _("Confirm removal of your poll") . '

-

-

+

+

'; @@ -281,11 +313,11 @@ if (isset($_POST["confirmesuppression"])) { //affichage de l'ecran de confirmation de suppression de sondage Utils::print_header(_("Your poll has been removed!")); - bandeau_titre(_("Make your polls")); + bandeau_titre(_('Make your polls')); echo '
-

' . _("Your poll has been removed!") . '

+

' . _('Your poll has been removed!') . '

' . _('Back to the homepage of ') . ' ' . NOMAPPLICATION . '

'."\n"; @@ -320,7 +352,7 @@ if (isset($_POST['ajoutcomment'])) { while ( $dcomment_user_doublon=$comment_user_doublon->FetchNextObject(false)) { if($dcomment_user_doublon->comment == $comment && $dcomment_user_doublon->usercomment == $comment_user) { $comment_doublon = true; - }; + } } } @@ -342,31 +374,20 @@ if (isset($_POST['ajoutcomment'])) { $nbcolonnes = substr_count($dsujet->sujet, ',') + 1; $nblignes = $user_studs->RecordCount(); -//si il n'y a pas suppression alors on peut afficher normalement le tableau +//s'il n'y a pas suppression alors on peut afficher normalement le tableau //action si le bouton participer est cliqué if (isset($_POST["boutonp"])) { //si on a un nom dans la case texte if (Utils::issetAndNoEmpty('nom')){ - $nouveauchoix = ''; + $nouveauchoix = getNewChoiceFromPOST($nbcolonnes); $erreur_prenom = false; - for ($i=0;$i<$nbcolonnes;$i++){ - // radio checked 1 = Yes, 2 = Ifneedbe, 0 = No - if (isset($_POST["choix$i"])) { - switch ($_POST["choix$i"]) { - case 1: $nouveauchoix .= "1";break; - case 2: $nouveauchoix .= "2";break; - default: $nouveauchoix .= "0";break; - } - } - } - - $nom = htmlentities(html_entity_decode($_POST["nom"], ENT_QUOTES, 'UTF-8'), ENT_QUOTES, 'UTF-8'); + $nom = htmlentities(html_entity_decode($_POST['nom'], ENT_QUOTES, 'UTF-8'), ENT_QUOTES, 'UTF-8'); while($user = $user_studs->FetchNextObject(false)) { - if ($nom == $user->nom){ - $erreur_prenom="yes"; + if ($nom == $user->nom) { + $erreur_prenom = 'yes'; } } @@ -385,12 +406,12 @@ if (isset($_POST["boutonp"])) { //action quand on ajoute une colonne au format AUTRE -if (isset($_POST["ajoutercolonne"]) && Utils::issetAndNoEmpty('nouvellecolonne') && (substr($dsondage->format, 0, 1) == "A" )) { +if (isset($_POST['ajoutercolonne']) && Utils::issetAndNoEmpty('nouvellecolonne') && (substr($dsondage->format, 0, 1) == 'A' )) { $nouveauxsujets=$dsujet->sujet; //on rajoute la valeur a la fin de tous les sujets deja entrés - $nouveauxsujets.=","; - $nouveauxsujets.=str_replace(","," ",$_POST["nouvellecolonne"]); + $nouveauxsujets .= ','; + $nouveauxsujets .= str_replace(',', ' ', $_POST['nouvellecolonne']); $nouveauxsujets = htmlentities(html_entity_decode($nouveauxsujets, ENT_QUOTES, 'UTF-8'), ENT_QUOTES, 'UTF-8'); //mise a jour avec les nouveaux sujets dans la base @@ -403,19 +424,18 @@ if (isset($_POST["ajoutercolonne"]) && Utils::issetAndNoEmpty('nouvellecolonne') //action quand on ajoute une colonne au format DATE -if (isset($_POST["ajoutercolonne"]) && (substr($dsondage->format, 0, 1) == "D")) { +if (isset($_POST['ajoutercolonne']) && (substr($dsondage->format, 0, 1) == 'D')) { $nouveauxsujets=$dsujet->sujet; - if (isset($_POST["newdate"]) && $_POST["newdate"] != "vide") { - $nouvelledate=mktime(0, 0, 0, substr($_POST["newdate"],3,2), substr($_POST["newdate"],0,2), substr($_POST["newdate"],6,4)); + if (isset($_POST['newdate']) && $_POST['newdate'] != 'vide') { + $nouvelledate = mktime(0, 0, 0, substr($_POST['newdate'],3,2), substr($_POST['newdate'],0,2), substr($_POST['newdate'],6,4)); - if (isset($_POST["newhour"]) && $_POST["newhour"]!="vide"){ - $nouvelledate.="@"; - $nouvelledate.=$_POST["newhour"]; + if (isset($_POST['newhour']) && $_POST['newhour'] != 'vide') { + $nouvelledate .= '@' . $_POST['newhour']; } //on rajoute la valeur dans les valeurs - $datesbase = explode(",",$dsujet->sujet); + $datesbase = explode(',', $dsujet->sujet); $taillebase = sizeof($datesbase); //recherche de l'endroit de l'insertion de la nouvelle date dans les dates deja entrées dans le tableau @@ -424,7 +444,7 @@ if (isset($_POST["ajoutercolonne"]) && (substr($dsondage->format, 0, 1) == "D")) } elseif ($nouvelledate > $datesbase[$taillebase-1]) { $cleinsertion = count($datesbase); } else { - for ($i = 0; $i < count($datesbase); $i++) { + for ($i = 0; $i < count($datesbase); ++$i) { $j = $i + 1; if ($nouvelledate > $datesbase[$i] && $nouvelledate < $datesbase[$j]) { $cleinsertion = $j; @@ -435,12 +455,11 @@ if (isset($_POST["ajoutercolonne"]) && (substr($dsondage->format, 0, 1) == "D")) array_splice($datesbase, $cleinsertion, 0, $nouvelledate); $cle = array_search($nouvelledate, $datesbase); $dateinsertion = ''; - for ($i = 0; $i < count($datesbase); $i++) { - $dateinsertion.=","; - $dateinsertion.=$datesbase[$i]; + for ($i = 0; $i < count($datesbase); ++$i) { + $dateinsertion .= ',' . $datesbase[$i]; } - $dateinsertion = substr("$dateinsertion", 1); + $dateinsertion = substr($dateinsertion, 1); //mise a jour avec les nouveaux sujets dans la base //if (isset($erreur_ajout_date) && !$erreur_ajout_date){ @@ -464,19 +483,19 @@ if (isset($_POST["ajoutercolonne"]) && (substr($dsondage->format, 0, 1) == "D")) $newcar = ''; //parcours de toutes les réponses actuelles - for ($j = 0; $j < $nbcolonnes; $j++) { - $car=substr($ensemblereponses,$j,1); + for ($j = 0; $j < $nbcolonnes; ++$j) { + $car = substr($ensemblereponses,$j,1); //si les reponses ne concerne pas la colonne ajoutée, on concatene - if ($j==$cle) { - $newcar.="0"; + if ($j == $cle) { + $newcar.='0'; } - $newcar.=$car; + $newcar .= $car; } //mise a jour des reponses utilisateurs dans la base - if (isset($erreur_ajout_date) && !$erreur_ajout_date){ + if (isset($erreur_ajout_date) && !$erreur_ajout_date) { $connect->Execute($sql, array($newcar, $data->nom, $data->id_users)); } } @@ -485,24 +504,24 @@ if (isset($_POST["ajoutercolonne"]) && (substr($dsondage->format, 0, 1) == "D")) send_mail_admin(); } else { - $erreur_ajout_date="yes"; + $erreur_ajout_date = 'yes'; } } //suppression de ligne dans la base -for ($i = 0; $i < $nblignes; $i++) { - if (isset($_POST["effaceligne$i"])) { - $compteur=0; +for ($i = 0; $i < $nblignes; ++$i) { + if (isset($_POST['effaceligne'. $i])) { + $compteur = 0; $sql = 'DELETE FROM user_studs WHERE nom = '.$connect->Param('nom').' AND id_users = '.$connect->Param('id_users'); $sql = $connect->Prepare($sql); while ($data=$user_studs->FetchNextObject(false)) { - if ($compteur==$i){ + if ($compteur == $i) { $connect->Execute($sql, array($data->nom, $data->id_users)); } - $compteur++; + ++$compteur; } } } @@ -520,7 +539,7 @@ while ($dcomment = $comment_user->FetchNextObject(false)) { $connect->Execute($sql, array($dcomment->id_comment)); } - $i++; + ++$i; } @@ -528,53 +547,43 @@ while ($dcomment = $comment_user->FetchNextObject(false)) { $testmodifier = false; $testligneamodifier = false; -for ($i = 0; $i < $nblignes; $i++) { - if (isset($_POST["modifierligne$i"])) { - $ligneamodifier=$i; - $testligneamodifier="true"; +for ($i = 0; $i < $nblignes; ++$i) { + if (isset($_POST['modifierligne'. $i])) { + $ligneamodifier = $i; + $testligneamodifier = 'true'; } - //test pour voir si une ligne est a modifier - if (isset($_POST["validermodifier$i"])) { - $modifier=$i; - $testmodifier="true"; + //test pour voir si une ligne est à modifier + if (isset($_POST['validermodifier'. $i])) { + $modifier = $i; + $testmodifier = 'true'; } } //si le test est valide alors on affiche des checkbox pour entrer de nouvelles valeurs if ($testmodifier) { - $nouveauchoix = ''; - for ($i = 0; $i < $nbcolonnes; $i++) { - // radio checked 1 = Yes, 2 = Ifneedbe, 0 = No - if (isset($_POST["choix$i"])) { - switch ($_POST["choix$i"]) { - case 1: $nouveauchoix .= "1";break; - case 2: $nouveauchoix .= "2";break; - default: $nouveauchoix .= "0";break; - } - } - } + $nouveauchoix = getNewChoiceFromPOST($nbcolonnes); - $compteur=0; + $compteur = 0; - while ($data=$user_studs->FetchNextObject(false)) { - //mise a jour des données de l'utilisateur dans la base SQL + while ($data = $user_studs->FetchNextObject(false)) { + //mise à jour des données de l'utilisateur dans la base SQL if ($compteur==$modifier) { $sql = 'UPDATE user_studs SET reponses = '.$connect->Param('reponses').' WHERE nom = '.$connect->Param('nom').' AND id_users = '.$connect->Param('id_users'); $sql = $connect->Prepare($sql); $connect->Execute($sql, array($nouveauchoix, $data->nom, $data->id_users)); } - $compteur++; + ++$compteur; } } //suppression de colonnes dans la base -for ($i = 0; $i < $nbcolonnes; $i++) { - if ((isset($_POST["effacecolonne$i"])) && $nbcolonnes > 1){ - $toutsujet = explode(",",$dsujet->sujet); +for ($i = 0; $i < $nbcolonnes; ++$i) { + if ((isset($_POST['effacecolonne' .$i])) && $nbcolonnes > 1) { + $toutsujet = explode(',', $dsujet->sujet); //sort($toutsujet, SORT_NUMERIC); $j = 0; $nouveauxsujets = ''; @@ -583,17 +592,16 @@ for ($i = 0; $i < $nbcolonnes; $i++) { while (isset($toutsujet[$j])) { //si le sujet n'est pas celui qui a été effacé alors on concatene if ($i != $j) { - $nouveauxsujets .= ','; - $nouveauxsujets .= $toutsujet[$j]; + $nouveauxsujets .= ',' . $toutsujet[$j]; } - $j++; + ++$j; } - //on enleve la virgule au début - $nouveauxsujets = substr("$nouveauxsujets", 1); + //on enlève la virgule au début + $nouveauxsujets = substr($nouveauxsujets, 1); - //nettoyage des reponses actuelles correspondant au sujet effacé + //nettoyage des réponses actuelles correspondant au sujet effacé $compteur = 0; $sql = 'UPDATE user_studs SET reponses = '.$connect->Param('reponses').' WHERE nom = '.$connect->Param('nom').' AND id_users = '.$connect->Param('id_users'); $sql = $connect->Prepare($sql); @@ -603,7 +611,7 @@ for ($i = 0; $i < $nbcolonnes; $i++) { $ensemblereponses = $data->reponses; //parcours de toutes les réponses actuelles - for ($j = 0; $j < $nbcolonnes; $j++) { + for ($j = 0; $j < $nbcolonnes; ++$j) { $car=substr($ensemblereponses, $j, 1); //si les reponses ne concerne pas la colonne effacée, on concatene if ($i != $j) { @@ -611,13 +619,13 @@ for ($i = 0; $i < $nbcolonnes; $i++) { } } - $compteur++; + ++$compteur; - //mise a jour des reponses utilisateurs dans la base + //mise à jour des reponses utilisateurs dans la base $connect->Execute($sql, array($newcar, $data->nom, $data->id_users)); } - //mise a jour des sujets dans la base + //mise à jour des sujets dans la base $sql = 'UPDATE sujet_studs SET sujet = '.$connect->Param('nouveauxsujets').' WHERE id_sondage = '.$connect->Param('numsondage'); $sql = $connect->Prepare($sql); $connect->Execute($sql, array($nouveauxsujets, $numsondage)); @@ -639,13 +647,12 @@ if ($sondage !== false) { $sql = $connect->Prepare($sql); $user_studs = $connect->Execute($sql, array($numsondage)); } else { - Utils::print_header(_("Error!")); bandeau_titre(_("Error!")); echo '
-

' . _("This poll doesn't exist !") . '

+

' . _('This poll doesn\'t exist !') . '

' . _('Back to the homepage of ') . ' ' . NOMAPPLICATION . '

'."\n"; @@ -656,35 +663,44 @@ if ($sondage !== false) { // Errors $errors = ''; -if ((isset($_POST["boutonp"])) && $_POST["nom"] == "") { - $errors .= '
  • ' . _("Enter a name") . '
  • '; +if ((isset($_POST['boutonp'])) && $_POST['nom'] == '') { + $errors .= '
  • ' . _('Enter a name') . '
  • '; } if (isset($erreur_prenom) && $erreur_prenom) { - $errors .= '
  • ' . _("The name you've chosen already exist in this poll!") . '
  • '; + $errors .= '
  • ' . _('The name you\'ve chosen already exist in this poll!') . '
  • '; } if (isset($erreur_injection) && $erreur_injection) { $errors .= '
  • ' . _("Characters \" ' < et > are not permitted") . '
  • '; } if (isset($erreur_ajout_date) && $erreur_ajout_date) { - $errors .= '
  • ' . _("The date is not correct !") . '
  • '; + $errors .= '
  • ' . _('The date is not correct!') . '
  • '; } //Poll title, description and email values -$title = (isset($_POST["boutonnouveautitre"]) && Utils::issetAndNoEmpty('nouveautitre')) ? htmlentities(html_entity_decode($_POST['nouveautitre'], ENT_QUOTES, 'UTF-8'), ENT_QUOTES, 'UTF-8') : stripslashes( $dsondage->titre ); -$description = (isset($_POST["nouveauxcommentaires"])) ? stripslashes(htmlentities(html_entity_decode($_POST['nouveauxcommentaires'], ENT_QUOTES, 'UTF-8'), ENT_QUOTES, 'UTF-8')) : stripslashes( $dsondage->commentaires ); -$email_admin = (isset($_POST["boutonnouvelleadresse"]) && Utils::issetAndNoEmpty('nouvelleadresse')) ? htmlentities(html_entity_decode($_POST['nouvelleadresse'], ENT_QUOTES, 'UTF-8'), ENT_QUOTES, 'UTF-8') : stripslashes( $dsondage->mail_admin ); +$title = (isset($_POST['boutonnouveautitre']) && Utils::issetAndNoEmpty('nouveautitre')) + ? htmlentities(html_entity_decode($_POST['nouveautitre'], ENT_QUOTES, 'UTF-8'), ENT_QUOTES, 'UTF-8') + : stripslashes( $dsondage->titre ); +$description = (isset($_POST['nouveauxcommentaires'])) + ? stripslashes(htmlentities(html_entity_decode($_POST['nouveauxcommentaires'], ENT_QUOTES, 'UTF-8'), ENT_QUOTES, 'UTF-8')) + : stripslashes( $dsondage->commentaires ); +$email_admin = (isset($_POST['boutonnouvelleadresse']) && Utils::issetAndNoEmpty('nouvelleadresse')) + ? htmlentities(html_entity_decode($_POST['nouvelleadresse'], ENT_QUOTES, 'UTF-8'), ENT_QUOTES, 'UTF-8') + : stripslashes( $dsondage->mail_admin ); //Poll format (locked A-/D-, open A/D, editable A+/D+) -$poll_rules = (isset($_POST["poll_rules"]) && Utils::issetAndNoEmpty('btn_poll_rules')) ? $_POST["poll_rules"] : substr($dsondage->format, 1, 1); -$poll_rules_opt1 = '';$poll_rules_opt2 = '';$poll_rules_opt3 = ''; +$poll_rules = (isset($_POST['poll_rules']) && Utils::issetAndNoEmpty('btn_poll_rules')) + ? $_POST['poll_rules'] : substr($dsondage->format, 1, 1); +$poll_rules_opt1 = ''; +$poll_rules_opt2 = ''; +$poll_rules_opt3 = ''; if($poll_rules == '+') { - $poll_rules_text = ' '. _("Votes are editable"); + $poll_rules_text = ' '. _('Votes are editable'); $poll_rules_opt3 = 'selected'; } elseif($poll_rules == '-') { - $poll_rules_text = ' '. _("Votes and comments are locked"); + $poll_rules_text = ' '. _('Votes and comments are locked'); $poll_rules_opt1 = 'selected'; } else { - $poll_rules_text = ' '. _("Votes and comments are open"); + $poll_rules_text = ' '. _('Votes and comments are open'); $poll_rules_opt2 = 'selected'; } @@ -693,7 +709,6 @@ if ($errors!='') { bandeau_titre(_("Error!")); echo '
      '.$errors.'
    '."\n"; - } else { Utils::print_header(_('Poll administration').' - '.$title); bandeau_titre(_('Poll administration').' - '.$title); @@ -723,13 +738,13 @@ echo '
    @@ -810,9 +825,9 @@ $dsujet=$sujets->FetchObject(false); $dsondage=$sondage->FetchObject(false); //reformatage des données des sujets du sondage -$toutsujet=explode(",",$dsujet->sujet); -$toutsujet=str_replace("°","'",$toutsujet); -$nbcolonnes=substr_count($dsujet->sujet,',')+1; +$toutsujet = explode(',', $dsujet->sujet); +$toutsujet = str_replace('°', '\'',$toutsujet); +$nbcolonnes = substr_count($dsujet->sujet,',') +1; // Table headers $thead = ''; @@ -825,24 +840,24 @@ $td_headers = array(); // for a11y, headers="M1 D4 H5" on each td $radio_title = array(); // date for // Dates poll -if (substr($dsondage->format, 0, 1)=="D") { +if (substr($dsondage->format, 0, 1) == 'D') { $tr_months = ''; - $tr_days = ''; - $tr_hours = ''; + $tr_days = ''; + $tr_hours = ''; // Headers $colspan_month = 1; $colspan_day = 1; - for ($i = 0; $i < count($toutsujet); $i++) { + for ($i = 0; $i < count($toutsujet); ++$i) { // Current date $current = $toutsujet[$i];//format date@hour. ex : 2020292820@10:00 $horoCur = explode("@",$current); //horoCur[0] = date, horoCur[1] = hour if (isset($toutsujet[$i+1])){ $next = $toutsujet[$i+1]; - $horoNext = explode("@",$next); + $horoNext = explode('@', $next); } $border[$i] = false; $radio_title[$i] = strftime($date_format['txt_short'],$horoCur[0]); @@ -855,23 +870,23 @@ if (substr($dsondage->format, 0, 1)=="D") { } else { $border[$i] = true; $tr_months .= ''.strftime("%B",$horoCur[0]).' '.strftime("%Y", $horoCur[0]).''; - $colspan_month=1; + $colspan_month = 1; } // Days $td_headers[$i] .= ' D'.($i+1-$colspan_day); if (isset($toutsujet[$i+1]) && strftime($date_format['txt_day'],$horoCur[0])==strftime($date_format['txt_day'],$horoNext[0]) && strftime("%B",$horoCur[0])==strftime("%B",$horoNext[0])){ - $colspan_day++; + ++$colspan_day; } else { $rbd = ($border[$i]) ? ' rbd' : ''; $tr_days .= ''.strftime($date_format['txt_day'],$horoCur[0]).''; - $colspan_day=1; + $colspan_day = 1; } // Hours $rbd = ($border[$i]) ? ' rbd' : ''; - if ($horoCur[1] !== "") { + if ($horoCur[1] !== '') { $tr_hours .= ''.$horoCur[1].''; $radio_title[$i] .= ' - '.$horoCur[1]; $td_headers[$i] .= ' H'.$i; @@ -880,30 +895,33 @@ if (substr($dsondage->format, 0, 1)=="D") { } // Remove col - $tr_add_remove_col .= (count($toutsujet) > 2 ) ? '' : ''; + $tr_add_remove_col .= (count($toutsujet) > 2 ) + ? '' + : ''; } $border[count($border)-1] = false; // suppression de la bordure droite du dernier mois $tr_months .= ''; - $tr_days .= ''; - $tr_hours .= ''; + $tr_days .= ''; + $tr_hours .= ''; // Add col - $tr_add_remove_col .= ''; + $tr_add_remove_col .= ''; $thead = "\n".$tr_add_remove_col."\n".$tr_months."\n".$tr_days."\n".$tr_hours."\n"; // Subjects poll } else { - $toutsujet=str_replace("@","
    ",$toutsujet); + $toutsujet=str_replace('@', '
    ', $toutsujet); $tr_subjects = ''; - for ($i = 0; isset($toutsujet[$i]); $i++) { + for ($i = 0; isset($toutsujet[$i]); ++$i) { - $td_headers[$i]='';$radio_title[$i]=''; // init before concatenate + $td_headers[$i]=''; + $radio_title[$i]=''; // init before concatenate // Subjects preg_match_all('/\[!\[(.*?)\]\((.*?)\)\]\((.*?)\)/',$toutsujet[$i],$md_a_img); // Markdown [![alt](src)](href) @@ -943,7 +961,7 @@ if (substr($dsondage->format, 0, 1)=="D") { // Add col $tr_add_remove_col .= ''; - $thead = $tr_add_remove_col.$tr_subjects.''; + $thead = $tr_add_remove_col . $tr_subjects . ''; } // Print headers @@ -985,7 +1003,7 @@ while ($data = $user_studs->FetchNextObject(false)) { $ensemblereponses = $data->reponses; // Print name - $nombase=str_replace("°","'",$data->nom); + $nombase=str_replace('°', '\'',$data->nom); echo ' '.stripslashes($nombase).''."\n"; @@ -995,28 +1013,30 @@ while ($data = $user_studs->FetchNextObject(false)) { $rbd = ($border[$k]) ? ' rbd' : ''; $car = substr($ensemblereponses, $k, 1); switch ($car) { - case "1": echo ' ' . _('Yes') . ''."\n"; + case '1': echo ' ' . _('Yes') . ''."\n"; if (isset($somme[$k]) === false) { $somme[$k] = 0; } - $somme[$k]++; break; - case "2": echo '() ' . _('Yes') . _(', ifneedbe') . ''."\n"; break; + ++$somme[$k]; break; + case '2': echo '() ' . _('Yes') . _(', ifneedbe') . ''."\n"; break; default: echo '' . _('No') . ''."\n";break; } } } else { // sinon on remplace les choix de l'utilisateur par une ligne de radio pour recuperer de nouvelles valeurs // si c'est bien la ligne a modifier on met les radios - if ($compteur == "$ligneamodifier") { - for ($j = 0; $j < $nbcolonnes; $j++) { + if ($compteur == $ligneamodifier) { + for ($j = 0; $j < $nbcolonnes; ++$j) { $car = substr($ensemblereponses, $j, 1); // variable pour afficher la valeur cochée - $car_html[0]='value="0"';$car_html[1]='value="1"';$car_html[2]='value="2"'; + $car_html[0] = 'value="0"'; + $car_html[1] = 'value="1"'; + $car_html[2] = 'value="2"'; switch ($car) { - case "1": $car_html[1]='value="1" checked';break; - case "2": $car_html[2]='value="2" checked';break; - default: $car_html[0]='value="0" checked';break; + case '1': $car_html[1]='value="1" checked'; break; + case '2': $car_html[2]='value="2" checked'; break; + default: $car_html[0]='value="0" checked'; } echo ' @@ -1045,24 +1065,24 @@ while ($data = $user_studs->FetchNextObject(false)) { } } else { //sinon on affiche les lignes normales - for ($k = 0; $k < $nbcolonnes; $k++) { + for ($k = 0; $k < $nbcolonnes; ++$k) { $rbd = ($border[$k]) ? ' rbd' : ''; $car = substr($ensemblereponses, $k, 1); switch ($car) { - case "1": echo ' ' . _('Yes') . ''."\n"; + case '1': echo ' ' . _('Yes') . ''."\n"; if (isset($somme[$k]) === false) { $somme[$k] = 0; } - $somme[$k]++; break; - case "2": echo '() ' . _('Yes') . _(', ifneedbe') . ''."\n"; break; - default: echo '' . _('No') . ''."\n";break; + ++$somme[$k]; break; + case '2': echo '() ' . _('Yes') . _(', ifneedbe') . ''."\n"; break; + default: echo '' . _('No') . ''."\n"; } } } } //a la fin de chaque ligne se trouve les boutons modifier - if (!$testligneamodifier=="true") { + if (!$testligneamodifier == 'true') { echo ' '."\n"; } } } - $compteur++; + ++$compteur; echo ''."\n"; } -if (!$testligneamodifier=="true") { +if (!$testligneamodifier == 'true') { //affichage de la case vide de texte pour un nouvel utilisateur echo ' @@ -1098,7 +1118,7 @@ if (!$testligneamodifier=="true") { '."\n"; //une ligne de checkbox pour le choix du nouvel utilisateur - for ($i = 0; $i < $nbcolonnes; $i++) { + for ($i = 0; $i < $nbcolonnes; ++$i) { echo ' '; +$meilleursujet = str_replace('°', '\'', $meilleursujet).''; $vote_str = ($meilleurecolonne > 1) ? $vote_str = _('votes') : _('vote'); // Print Addition and Best choice @@ -1194,7 +1214,7 @@ $sql = $connect->Prepare($sql); $comment_user = $connect->Execute($sql, array($numsondage)); if ($comment_user->RecordCount() != 0) { - echo '

    ' . _("Comments of polled people") . '

    '."\n"; + echo '

    ' . _('Comments of polled people') . '

    '."\n"; $i = 0; while ( $dcomment=$comment_user->FetchNextObject(false)) { @@ -1211,15 +1231,15 @@ if ($comment_user->RecordCount() != 0) { echo '
    -
    ' . _("Add a comment in the poll") . ' +
    ' . _('Add a comment in the poll') . '
    -

    +

    -


    +


    -

    +

    From 151f18bd96ef9ea9c5ea231c3359e2129e29d97a Mon Sep 17 00:00:00 2001 From: "Spanti Nicola (RyDroid)" Date: Wed, 26 Nov 2014 20:11:20 +0100 Subject: [PATCH 03/17] Updating .gitignore --- .gitignore | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.gitignore b/.gitignore index f6e467c..3baa1e0 100644 --- a/.gitignore +++ b/.gitignore @@ -8,3 +8,11 @@ framanav nav app/inc/constants.php vendor + +# Temp files +*~ +\#*\# + +# Cache +Thumbs.db + From 9017676f70a59a0676be92d33794a48147a34e80 Mon Sep 17 00:00:00 2001 From: "Spanti Nicola (RyDroid)" Date: Wed, 26 Nov 2014 23:47:40 +0100 Subject: [PATCH 04/17] Small cleaning of choix_date.php --- choix_date.php | 93 +++++++++++++++++++++++++++----------------------- 1 file changed, 50 insertions(+), 43 deletions(-) diff --git a/choix_date.php b/choix_date.php index b9f6314..5e4624c 100644 --- a/choix_date.php +++ b/choix_date.php @@ -5,7 +5,7 @@ * 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) + * Authors of Framadate/OpenSondate: Framasoft (https://github.com/framasoft https://git.framasoft.org/framasoft/framadate/) * * ============================= * @@ -14,7 +14,7 @@ * 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) + * Auteurs de Framadate/OpenSondage : Framasoft (https://github.com/framasoft https://git.framasoft.org/framasoft/framadate/) */ namespace Framadate; @@ -31,13 +31,13 @@ if (is_readable('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 || (($config['use_smtp']) ? Utils::issetAndNoEmpty('adresse', $_SESSION) === false : false)) { - Utils::print_header ( _("Error!") ); - bandeau_titre(_("Error!")); + Utils::print_header ( _('Error!') ); + bandeau_titre(_('Error!')); echo '
    -

    ' . _("You haven't filled the first section of the poll creation.") . ' !

    -

    ' . _("Back to the homepage of ") . ' ' . '' . NOMAPPLICATION . '.

    +

    ' . _('You haven\'t filled the first section of the poll creation.') . ' !

    +

    ' . _('Back to the homepage of ') . ' ' . '' . NOMAPPLICATION . '.

    '; bandeau_pied(); @@ -46,19 +46,19 @@ if (Utils::issetAndNoEmpty('titre', $_SESSION) === false || Utils::issetAndNoEmp // Step 4 : Data prepare before insert in DB if (Utils::issetAndNoEmpty('confirmation')) { $temp_results = array(); - $choixdate=''; + $choixdate = ''; if (Utils::issetAndNoEmpty('totalchoixjour', $_SESSION) === true) { - for ($i = 0; $i < count($_SESSION["totalchoixjour"]); $i++) { + for ($i = 0; $i < count($_SESSION["totalchoixjour"]); ++$i) { if(count($_SESSION['horaires'.$i])!=0) { - for ($j=0;$j< min(count($_SESSION['horaires'.$i]),12);$j++) { - if ($_SESSION['horaires'.$i][$j]!="") { + for ($j=0; $j< min(count($_SESSION['horaires'.$i]),12); ++$j) { + if ($_SESSION['horaires'.$i][$j] != '') { array_push($temp_results, $_SESSION["totalchoixjour"][$i].'@'.$_SESSION['horaires'.$i][$j]); } else { array_push($temp_results, $_SESSION["totalchoixjour"][$i]); } } } else { - array_push($temp_results, $_SESSION["totalchoixjour"][$i]); + array_push($temp_results, $_SESSION['totalchoixjour'][$i]); } } @@ -67,23 +67,24 @@ if (Utils::issetAndNoEmpty('titre', $_SESSION) === false || Utils::issetAndNoEmp // Sort and remove doublons $temp_results = array_unique($temp_results); sort($temp_results); - for ($i=0;$i time() + (24*60*60)) { - $_SESSION["champdatefin"]=$time; + if ($time > time() + 86400) { + $_SESSION['champdatefin'] = $time; } } } @@ -92,16 +93,20 @@ if (Utils::issetAndNoEmpty('titre', $_SESSION) === false || Utils::issetAndNoEmp } else { if (Utils::issetAndNoEmpty('days')) { - if (!isset($_SESSION["totalchoixjour"])) { - $_SESSION["totalchoixjour"]=array(); + if (!isset($_SESSION['totalchoixjour'])) { + $_SESSION['totalchoixjour'] = array(); } $k = 0; - for ($i = 0; $i < count($_POST["days"]); $i++) { - if (isset($_POST["days"][$i]) && $_POST["days"][$i] !='') { - $_SESSION['totalchoixjour'][$k] = mktime(0, 0, 0, substr($_POST["days"][$i],3,2),substr($_POST["days"][$i],0,2),substr($_POST["days"][$i],6,4)); + for ($i = 0; $i < count($_POST['days']); ++$i) { + if (isset($_POST['days'][$i]) && $_POST['days'][$i] !='') { + $_SESSION['totalchoixjour'][$k] = mktime( + 0, 0, 0, + substr($_POST["days"][$i], 3, 2), + substr($_POST['days'][$i], 0, 2), + substr($_POST['days'][$i], 6, 4)); $l = 0; - for($j = 0; $j < count($_POST['horaires'.$i]); $j++) { + for($j = 0; $j < count($_POST['horaires'.$i]); ++$j) { if (isset($_POST['horaires'.$i][$j]) && $_POST['horaires'.$i][$j] != '') { $_SESSION['horaires'.$k][$l] = $_POST['horaires'.$i][$j]; $l++; @@ -114,23 +119,26 @@ if (Utils::issetAndNoEmpty('titre', $_SESSION) === false || Utils::issetAndNoEmp } //le format du sondage est DATE - $_SESSION["formatsondage"] = "D".$_SESSION["studsplus"]; + $_SESSION['formatsondage'] = 'D'. $_SESSION['studsplus']; // Step 3/3 : Confirm poll creation if (Utils::issetAndNoEmpty('choixheures') && Utils::issetAndNoEmpty('totalchoixjour', $_SESSION)) { - Utils::print_header ( _("Removal date and confirmation (3 on 3)") ); - bandeau_titre(_("Removal date and confirmation (3 on 3)")); + Utils::print_header ( _('Removal date and confirmation (3 on 3)') ); + bandeau_titre(_('Removal date and confirmation (3 on 3)')); - $temp_array = array_unique($_SESSION["totalchoixjour"]); + $temp_array = array_unique($_SESSION['totalchoixjour']); sort($temp_array); - $removal_date=utf8_encode(strftime($date_format['txt_full'], end($temp_array)+ (86400 * $config['default_poll_duration']))); + $removal_date = utf8_encode( + strftime($date_format['txt_full'], + end($temp_array) + (86400 * $config['default_poll_duration'])) + ); // Sumary $summary = '
      '; - for ($i=0;$i

      '. _("Confirm the creation of your poll") .'

      -

      '. _("List of your choices").'

      +

      '. _('List of your choices').'

      '. $summary .'
      @@ -164,9 +172,9 @@ if (Utils::issetAndNoEmpty('titre', $_SESSION) === false || Utils::issetAndNoEmp

      '. _("Once you have confirmed the creation of your poll, you will be automatically redirected on the administration page of your poll."). '

      '; - if($config['use_smtp']==true){ + if($config['use_smtp'] == true) { echo ' -

      ' . _("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.") .'

      '; +

      ' . _('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.') .'

      '; } echo '
      @@ -182,24 +190,24 @@ if (Utils::issetAndNoEmpty('titre', $_SESSION) === false || Utils::issetAndNoEmp // Step 2/3 : Select dates of the poll } else { - Utils::print_header ( _("Poll dates (2 on 3)") ); - bandeau_titre(_("Poll dates (2 on 3)")); + Utils::print_header ( _('Poll dates (2 on 3)') ); + bandeau_titre(_('Poll dates (2 on 3)')); echo '
      -

      '. _("Choose the dates of your poll") .'

      +

      '. _('Choose the dates of your poll') .'

      '. _("To schedule an event you need to propose at least two choices (two hours for one day or two days).").'

      -

      '. _("You can add or remove additionnal days and hours with the buttons") .' '. _("Remove") .' '. _("Add") .'

      +

      '. _("You can add or remove additionnal days and hours with the buttons") .' '. _('Remove') .' '. _("Add") .'

      '. _("For each selected day, you can choose, or not, meeting hours (e.g.: \"8h\", \"8:30\", \"8h-10h\", \"evening\", etc.)").'

      '; // Fields days : 3 by default $nb_days = (isset($_SESSION["totalchoixjour"])) ? count($_SESSION["totalchoixjour"]) : 3; - for ($i=0;$i<$nb_days;$i++) { - $day_value = isset($_SESSION["totalchoixjour"][$i]) ? strftime( "%d/%m/%Y", $_SESSION["totalchoixjour"][$i]) : ''; + for ($i=0; $i < $nb_days; ++$i) { + $day_value = isset($_SESSION['totalchoixjour'][$i]) ? strftime( "%d/%m/%Y", $_SESSION['totalchoixjour'][$i]) : ''; echo '
      @@ -213,8 +221,8 @@ if (Utils::issetAndNoEmpty('titre', $_SESSION) === false || Utils::issetAndNoEmp '."\n"; // Fields hours : 3 by default - for ($j=0;$j @@ -255,6 +263,5 @@ if (Utils::issetAndNoEmpty('titre', $_SESSION) === false || Utils::issetAndNoEmp '."\n"; bandeau_pied(); - } } From b680220ec9c6ed4e5d34a935af6b6f23570bf2ac Mon Sep 17 00:00:00 2001 From: "Spanti Nicola (RyDroid)" Date: Thu, 27 Nov 2014 00:10:49 +0100 Subject: [PATCH 05/17] Small cleaning of studs.php --- studs.php | 109 ++++++++++++++++++++++++++++-------------------------- 1 file changed, 56 insertions(+), 53 deletions(-) diff --git a/studs.php b/studs.php index 6ec461a..9f3d044 100644 --- a/studs.php +++ b/studs.php @@ -34,28 +34,28 @@ $numsondage = false; //On récupère le numéro de sondage par le lien web. if(Utils::issetAndNoEmpty('sondage', $_GET) === true) { - $numsondage = $_GET["sondage"]; - $_SESSION["numsondage"] = $numsondage; + $numsondage = $_GET['sondage']; + $_SESSION['numsondage'] = $numsondage; } if(Utils::issetAndNoEmpty('sondage') === true) { - $numsondage = $_POST["sondage"]; - $_SESSION["numsondage"] = $numsondage; + $numsondage = $_POST['sondage']; + $_SESSION['numsondage'] = $numsondage; } elseif(Utils::issetAndNoEmpty('sondage', $_COOKIE) === true) { - $numsondage = $_COOKIE["sondage"]; + $numsondage = $_COOKIE['sondage']; } elseif(Utils::issetAndNoEmpty('numsondage', $_SESSION) === true) { - $numsondage = $_SESSION["numsondage"]; + $numsondage = $_SESSION['numsondage']; } $dsondage = ($numsondage != false) ? Utils::get_sondage_from_id($numsondage) : false; -if (!$dsondage || $dsondage->id_sondage == ''){ - Utils::print_header( _("Error!")); +if (!$dsondage || $dsondage->id_sondage == '') { + Utils::print_header( _('Error!')); - bandeau_titre(_("Error!")); + bandeau_titre(_('Error!')); echo '
      -

      ' . _("This poll doesn't exist !") . '

      +

      ' . _('This poll doesn\'t exist !') . '

      ' . _('Back to the homepage of ') . ' ' . NOMAPPLICATION . '

      '."\n"; @@ -124,7 +124,7 @@ if(isset($_POST['ajoutcomment'])) { } -// Action quand on clique le bouton participer +// Action quand on clique sur le bouton participer $sql = 'SELECT * FROM user_studs WHERE id_sondage='.$connect->Param('numsondage').' ORDER BY id_users'; $sql = $connect->Prepare($sql); $user_studs = $connect->Execute($sql, array($numsondage)); @@ -136,20 +136,21 @@ if (!Utils::is_error(NO_POLL) && (isset($_POST["boutonp"]))) { $err |= NAME_EMPTY; } - if(!Utils::is_error(NAME_EMPTY) && (! ( USE_REMOTE_USER && isset($_SERVER['REMOTE_USER']) ) || $_POST["nom"] == $_SESSION["nom"])) { + if(!Utils::is_error(NAME_EMPTY) && (! ( USE_REMOTE_USER && isset($_SERVER['REMOTE_USER']) ) || $_POST['nom'] == $_SESSION['nom'])) { $nouveauchoix = ''; for ($i=0;$i<$nbcolonnes;$i++) { // radio checked 1 = Yes, 2 = Ifneedbe, 0 = No - if (isset($_POST["choix$i"])) { - switch ($_POST["choix$i"]) { - case 1: $nouveauchoix .= "1";break; - case 2: $nouveauchoix .= "2";break; - default: $nouveauchoix .= "0";break; + // TODO reuse getNewChoiceFromPOST of adminstuds.php see 8272e0db84fb65210eddf5a370e0c5a2411fea79 + if (isset($_POST['choix'. $i])) { + switch ($_POST['choix'. $i]) { + case 1: $nouveauchoix .= '1'; break; + case 2: $nouveauchoix .= '2'; break; + default: $nouveauchoix .= '0'; } } } - $nom=substr($_POST["nom"],0,64); + $nom = substr($_POST['nom'], 0, 64); // protection contre les XSS : htmlentities $nom = htmlentities($nom, ENT_QUOTES, 'UTF-8'); @@ -172,14 +173,14 @@ if (!Utils::is_error(NO_POLL) && (isset($_POST["boutonp"]))) { // Todo : Il faudrait lever une erreur en cas d'erreur d'insertion $connect->Execute($sql, array($nom, $numsondage, $nouveauchoix)); - if ($dsondage->mailsonde || /* compatibility for non boolean DB */ $dsondage->mailsonde=="yes" || $dsondage->mailsonde=="true") { + if ($dsondage->mailsonde || /* compatibility for non boolean DB */ $dsondage->mailsonde=='yes' || $dsondage->mailsonde=='true') { if($config['use_smtp']==true){ - Utils::sendEmail( "$dsondage->mail_admin", - "[".NOMAPPLICATION."] "._("Poll's participation")." : ".html_entity_decode($dsondage->titre, ENT_QUOTES, 'UTF-8')."", + 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". + _('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 ); + _('Thanks for your confidence.') . "\n". NOMAPPLICATION ); } } } @@ -189,22 +190,22 @@ if (!Utils::is_error(NO_POLL) && (isset($_POST["boutonp"]))) { } if($err != 0) { - Utils::print_header(_("Error!").' - '.$dsondage->titre); - bandeau_titre(_("Error!")); + Utils::print_header(_('Error!').' - '.$dsondage->titre); + bandeau_titre(_('Error!')); echo '
        '."\n"; if(Utils::is_error(NAME_EMPTY)) { - echo '
      • ' . _("Enter a name") . "
      • \n"; + echo '
      • ' . _('Enter a name') . "
      • \n"; } if(Utils::is_error(NAME_TAKEN)) { - echo '
      • ' . _("The name you've chosen already exist in this poll!") . "
      • \n"; + echo '
      • ' . _('The name you\'ve chosen already exist in this poll!') . "
      • \n"; } if(Utils::is_error(COMMENT_EMPTY) || Utils::is_error(COMMENT_USER_EMPTY)) { - echo '
      • ' . _("Enter a name and a comment!") . "
      • \n"; + echo '
      • ' . _('Enter a name and a comment!') . "
      • \n"; } if(Utils::is_error(COMMENT_INSERT_FAILED) ) { - echo '
      • ' . _("Failed to insert the comment!") . "
      • \n"; + echo '
      • ' . _('Failed to insert the comment!') . "
      • \n"; } echo '
      '; @@ -243,7 +244,7 @@ echo ' //affichage de la description du sondage if ($dsondage->commentaires) { $commentaires = $dsondage->commentaires; - $commentaires=nl2br(str_replace("\\","",$commentaires)); + $commentaires=nl2br(str_replace('\\', '', $commentaires)); echo '

      '._("Description") .'


      @@ -260,12 +261,12 @@ $nblignes = $user_studs->RecordCount(); //on teste pour voir si une ligne doit etre modifiée $testmodifier = false; $ligneamodifier = -1; -for ($i=0;$i<$nblignes;$i++) { - if (isset($_POST["modifierligne$i"])) { +for ($i=0; $i < $nblignes; ++$i) { + if (isset($_POST['modifierligne'. $i])) { $ligneamodifier = $i; } - //test pour voir si une ligne est a modifier + //test pour voir si une ligne est à modifier if (isset($_POST['validermodifier'.$i])) { $modifier = $i; $testmodifier = true; @@ -274,19 +275,20 @@ for ($i=0;$i<$nblignes;$i++) { //si le test est valide alors on affiche des checkbox pour entrer de nouvelles valeurs if ($testmodifier) { + // TODO reuse getNewChoiceFromPOST of adminstuds.php see 8272e0db84fb65210eddf5a370e0c5a2411fea79 $nouveauchoix = ''; for ($i=0;$i<$nbcolonnes;$i++) { // radio checked 1 = Yes, 2 = Ifneedbe, 0 = No if (isset($_POST["choix$i"])) { switch ($_POST["choix$i"]) { - case 1: $nouveauchoix .= "1";break; - case 2: $nouveauchoix .= "2";break; - default: $nouveauchoix .= "0";break; + case 1: $nouveauchoix .= "1"; break; + case 2: $nouveauchoix .= "2"; break; + default: $nouveauchoix .= "0"; } } } - $compteur=0; + $compteur = 0; while ($data = $user_studs->FetchNextObject(false) ) { //mise a jour des données de l'utilisateur dans la base SQL if ($compteur == $modifier) { @@ -298,7 +300,7 @@ if ($testmodifier) { Utils::sendEmail( "$dsondage->mail_admin", "[".NOMAPPLICATION."] " . _("Poll's participation") . " : ".html_entity_decode($dsondage->titre, ENT_QUOTES, 'UTF-8'), "\"".html_entity_decode($data->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 ); } } - $compteur++; + ++$compteur; } } @@ -350,7 +352,7 @@ if ($dsondage->format=="D"||$dsondage->format=="D+"||$dsondage->format=="D-") { } else { $border[$i] = true; $tr_months .= ''.strftime("%B",$horoCur[0]).' '.strftime("%Y", $horoCur[0]).''; - $colspan_month=1; + $colspan_month = 1; } // Days @@ -361,12 +363,12 @@ if ($dsondage->format=="D"||$dsondage->format=="D+"||$dsondage->format=="D-") { } else { $rbd = ($border[$i]) ? ' rbd' : ''; $tr_days .= ''.strftime($date_format['txt_day'],$horoCur[0]).''; - $colspan_day=1; + $colspan_day = 1; } // Hours $rbd = ($border[$i]) ? ' rbd' : ''; - if ($horoCur[1] !== "") { + if ($horoCur[1] !== '') { $tr_hours .= ''.$horoCur[1].''; $radio_title[$i] .= ' - '.$horoCur[1]; $td_headers[$i] .= ' H'.$i; @@ -385,13 +387,14 @@ if ($dsondage->format=="D"||$dsondage->format=="D+"||$dsondage->format=="D-") { // Subjects poll } else { - $toutsujet=str_replace("@","
      ",$toutsujet); + $toutsujet=str_replace('@','
      ', $toutsujet); $tr_subjects = ''; - for ($i = 0; isset($toutsujet[$i]); $i++) { + for ($i = 0; isset($toutsujet[$i]); ++$i) { - $td_headers[$i]='';$radio_title[$i]=''; // init before concatenate + $td_headers[$i] = ''; + $radio_title[$i] = ''; // init before concatenate // Subjects preg_match_all('/\[!\[(.*?)\]\((.*?)\)\]\((.*?)\)/',$toutsujet[$i],$md_a_img); // Markdown [![alt](src)](href) @@ -498,9 +501,9 @@ while ($data = $user_studs->FetchNextObject(false)) { // variable pour afficher la valeur cochée $car_html[0]='value="0"';$car_html[1]='value="1"';$car_html[2]='value="2"'; switch ($car) { - case "1": $car_html[1]='value="1" checked';break; - case "2": $car_html[2]='value="2" checked';break; - default: $car_html[0]='value="0" checked';break; + case '1': $car_html[1]='value="1" checked'; break; + case '2': $car_html[2]='value="2" checked'; break; + default: $car_html[0]='value="0" checked'; } echo ' @@ -535,7 +538,7 @@ while ($data = $user_studs->FetchNextObject(false)) { if (isset($somme[$k]) === false) { $somme[$k] = 0; } - $somme[$k]++; break; + ++$somme[$k]; break; case "2": echo '() ' . _('Yes') . _(', ifneedbe') . ''."\n"; break; default: echo '' . _('No') . ''."\n"; } @@ -553,8 +556,8 @@ while ($data = $user_studs->FetchNextObject(false)) { } //demande de confirmation pour modification de ligne - for ($i=0;$i<$nblignes;$i++) { - if (isset($_POST["modifierligne$i"])) { + for ($i=0; $i < $nblignes; ++$i) { + if (isset($_POST['modifierligne'. $i])) { if ($compteur == $i) { echo ''."\n"; } @@ -633,7 +636,7 @@ for ($i = 0; $i < $nbcolonnes; $i++) { } $tr_addition .= ''; -$meilleursujet = str_replace("°", "'", $meilleursujet).'
    '; +$meilleursujet = str_replace('°', '\'', $meilleursujet).''; $vote_str = ($meilleurecolonne > 1) ? $vote_str = _('votes') : _('vote'); // Print Addition and Best choice @@ -671,7 +674,7 @@ $sql = $connect->Prepare($sql); $comment_user=$connect->Execute($sql, array($numsondage)); if ($comment_user->RecordCount() != 0) { - echo '

    ' . _("Comments of polled people") . '

    '."\n"; + echo '

    ' . _('Comments of polled people') . '

    '."\n"; while($dcomment = $comment_user->FetchNextObject(false)) { echo ' @@ -684,7 +687,7 @@ if ($comment_user->RecordCount() != 0) { echo '
    '; } -if ($dsondage->format!="A-" && $dsondage->format!="D-") { +if ($dsondage->format != 'A-' && $dsondage->format != 'D-') { echo '
    From 4235e1697a71c02dfb1ba56f934dc28416805b45 Mon Sep 17 00:00:00 2001 From: "Spanti Nicola (RyDroid)" Date: Thu, 27 Nov 2014 00:39:15 +0100 Subject: [PATCH 06/17] Small cleaning of creation_sondage.php --- creation_sondage.php | 73 +++++++++++++++++++++++++++----------------- 1 file changed, 45 insertions(+), 28 deletions(-) diff --git a/creation_sondage.php b/creation_sondage.php index 1e7f982..b5c7758 100644 --- a/creation_sondage.php +++ b/creation_sondage.php @@ -18,7 +18,7 @@ */ namespace Framadate; -if (session_id() == "") { +if (session_id() == '') { session_start(); } @@ -26,27 +26,34 @@ include_once __DIR__ . '/app/inc/init.php'; //Generer une chaine de caractere unique et aleatoire -function random($car) +function random_string($length) { - $string = ""; - $chaine = "abcdefghijklmnopqrstuvwxyz123456789"; + $string = ''; + $chaine = 'abcdefghijklmnopqrstuvwxyz123456789'; srand((double)microtime()*1000000); - for($i=0; $i<$car; $i++) { + for($i=0; $i < $length; ++$i) { $string .= $chaine[rand()%strlen($chaine)]; } - return $string; } +/** + * @deprecated + */ +function random($car) +{ + return random_string($car); +} + function ajouter_sondage() { global $connect; - $sondage=random(16); - $sondage_admin=$sondage.random(8); + $poll = random(16); + $poll_admin = $poll . random(8); - $date_fin = $_SESSION["champdatefin"]; // provided by choix_autre.php or choix_date.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. + $date_fin = $_SESSION['champdatefin']; // provided by choix_autre.php or choix_date.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 ( @@ -56,45 +63,55 @@ function ajouter_sondage() '.$connect->Param('nom_admin').', '.$connect->Param('titre').', '.$connect->Param('id_sondage_admin').', - FROM_UNIXTIME('.$date_fin.'), + 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'])); + $res = $connect->Execute($sql, array($poll, $_SESSION['commentaires'], $_SESSION['adresse'], $_SESSION['nom'], $_SESSION['titre'], $poll_admin, $_SESSION['formatsondage'], $_SESSION['mailsonde'])); - $sql = 'INSERT INTO sujet_studs values ('.$connect->Param('sondage').', '.$connect->Param('choix').')'; + $sql = 'INSERT INTO sujet_studs VALUES ('.$connect->Param('sondage').', '.$connect->Param('choix').')'; $sql = $connect->Prepare($sql); - $connect->Execute($sql, array($sondage, $_SESSION['toutchoix'])); + $connect->Execute($sql, array($poll, $_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."); + 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 .= 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\n" ._('You 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)); + $message = sprintf($message, Utils::getUrlSondage($poll)); + $message_admin = sprintf($message_admin, Utils::getUrlSondage($poll_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'] ); + 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'); + error_log(date('H:i:s d/m/Y:') . ' CREATION: '.$poll."\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++) { + for ($i = 0; $i < count($_SESSION['totalchoixjour']); ++$i) { unset($_SESSION['horaires'.$i]); } - unset($_SESSION["totalchoixjour"]); + unset($_SESSION['totalchoixjour']); unset($_SESSION['choices']); - header("Location:".Utils::getUrlSondage($sondage_admin, true)); + header('Location:'. Utils::getUrlSondage($poll_admin, true)); exit(); } From 18505484ef5df550d3fea67198b4a452b587e67c Mon Sep 17 00:00:00 2001 From: "Spanti Nicola (RyDroid)" Date: Thu, 27 Nov 2014 00:52:47 +0100 Subject: [PATCH 07/17] Small cleaning of admin/index.php --- admin/index.php | 57 +++++++++++++++++++++++++------------------------ 1 file changed, 29 insertions(+), 28 deletions(-) diff --git a/admin/index.php b/admin/index.php index bb3078b..3004813 100644 --- a/admin/index.php +++ b/admin/index.php @@ -27,10 +27,10 @@ include_once __DIR__ . '/../bandeaux.php'; // de l'application. // Affichage des balises standards -Utils::print_header( _("Polls administrator") ); -bandeau_titre(_("Polls administrator")); +Utils::print_header( _('Polls administrator') ); +bandeau_titre(_('Polls administrator')); -$sondage=$connect->Execute("select * from sondage"); +$sondage=$connect->Execute('SELECT * FROM sondage'); echo'
    '."\n"; @@ -40,15 +40,15 @@ while($dsondage = $sondage->FetchNextObject(false)) { echo '

    '. _("Confirm removal of the poll ") .'"'.$dsondage->id_sondage.'

    -

    -

    +

    +

    '; } // Traitement de la confirmation de suppression if (Utils::issetAndNoEmpty('confirmesuppression'.$dsondage->id_sondage) === true) { // On inclut la routine de suppression - $date=date('H:i:s d/m/Y'); + $date = date('H:i:s d/m/Y'); if (Utils::remove_sondage($connect, $dsondage->id_sondage)) { // ecriture des traces dans le fichier de logs @@ -57,7 +57,7 @@ while($dsondage = $sondage->FetchNextObject(false)) { } } -$sondage=$connect->Execute("select * from sondage WHERE date_fin > DATE_SUB(now(), INTERVAL 3 MONTH) ORDER BY date_fin ASC"); +$sondage=$connect->Execute('SELECT * FROM sondage WHERE date_fin > DATE_SUB(now(), INTERVAL 3 MONTH) ORDER BY date_fin ASC'); $nbsondages=$sondage->RecordCount(); $btn_logs = (is_readable('logs_studs.txt')) ? ''. _("Logs") .'' : ''; @@ -67,24 +67,24 @@ echo '

    ' . $nbsondages. ' ' . _("polls in the database at this time") . $btn_l // tableau qui affiche tous les sondages de la base echo ' - - - - - - - - + + + + + + + + '."\n"; $i = 0; while($dsondage = $sondage->FetchNextObject(false)) { /* possible en 1 bonne requête dans $sondage */ - $sujets=$connect->Execute( "select * from sujet_studs where id_sondage='$dsondage->id_sondage'"); - $dsujets=$sujets->FetchObject(false); + $subjects = $connect->Execute("SELECT * FROM sujet_studs WHERE id_sondage='$dsondage->id_sondage'"); + $dsujets = $subjects->FetchObject(false); - $user_studs=$connect->Execute( "select * from user_studs where id_sondage='$dsondage->id_sondage'"); - $nbuser=$user_studs->RecordCount(); + $user_studs = $connect->Execute("SELECT * from user_studs WHERE id_sondage='$dsondage->id_sondage'"); + $nb_users = $user_studs->RecordCount(); echo ' @@ -95,19 +95,19 @@ while($dsondage = $sondage->FetchNextObject(false)) { '; if (strtotime($dsondage->date_fin) > time()) { - echo ' - '; + echo ''; } else { - echo ' - '; + echo ''; } echo ' - - - - + + + + '."\n"; - $i++; + ++$i; } echo '
    '. _("Poll ID") .''. _("Format") .''. _("Title") .''. _("Author") .''. _("Email") .''. _("Expiration's date") .''. _("Users") .''. _("Actions") .''. _('Poll ID') .''. _('Format') .''. _('Title') .''. _('Author') .''. _('Email') .''. _('Expiration\'s date') .''. _('Users') .''. _('Actions') .'
    '.stripslashes($dsondage->mail_admin).''.date("d/m/y",strtotime($dsondage->date_fin)).''.date('d/m/y', strtotime($dsondage->date_fin)).''.date("d/m/y",strtotime($dsondage->date_fin)).'' + . date('d/m/y', strtotime($dsondage->date_fin)) + . ''.$nbuser.'' . _("See the poll") . '' . _("Change the poll") . ''.$nb_users.'' . _('See the poll') . '' . _("Change the poll") . '

    '."\n"; @@ -116,4 +116,5 @@ bandeau_pied(true); // si on annule la suppression, rafraichissement de la page if (Utils::issetAndNoEmpty('annulesuppression') === true) { + // TODO } From e6d171a4b033aabe525f39dd463b5a686fb2d247 Mon Sep 17 00:00:00 2001 From: "Spanti Nicola (RyDroid)" Date: Thu, 27 Nov 2014 01:15:01 +0100 Subject: [PATCH 08/17] Minor modifications to Utils.php --- app/classes/Framadate/Utils.php | 86 ++++++++++++++++++--------------- 1 file changed, 48 insertions(+), 38 deletions(-) diff --git a/app/classes/Framadate/Utils.php b/app/classes/Framadate/Utils.php index 7dfd953..03efeb0 100644 --- a/app/classes/Framadate/Utils.php +++ b/app/classes/Framadate/Utils.php @@ -20,16 +20,22 @@ namespace Framadate; class Utils { + /** + * @return string Server name + */ public static function get_server_name() { - $scheme = (isset($_SERVER["HTTPS"]) && $_SERVER["HTTPS"] == 'on') ? 'https' : 'http'; + $scheme = (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on') ? 'https' : 'http'; $port = in_array($_SERVER['SERVER_PORT'], [80, 443]) ? '/' : ':' . $_SERVER['SERVER_PORT'] . '/'; $server_name = $_SERVER['SERVER_NAME'] . $port . dirname($_SERVER['SCRIPT_NAME']) . '/'; - return $scheme . '://' . str_replace('/admin','',str_replace('//','/',str_replace('///','/',$server_name))); + return $scheme . '://' . str_replace('/admin', '', str_replace('//', '/', str_replace('///', '/', $server_name))); } - public static function get_sondage_from_id($id) + /** + * Returns a poll or false if it fails + */ + public static function get_poll_from_id($id) { global $connect; @@ -40,13 +46,13 @@ class Utils WHERE sondage.id_sondage = ' . $connect->Param('id_sondage'); $sql = $connect->Prepare($sql); - $sondage = $connect->Execute($sql, [$id]); + $poll = $connect->Execute($sql, [$id]); - if ($sondage === false) { + if ($poll === false) { return false; } - $psondage = $sondage->FetchObject(false); + $psondage = $poll->FetchObject(false); $psondage->date_fin = strtotime($psondage->date_fin); return $psondage; @@ -54,6 +60,15 @@ class Utils return false; } + + /** + * Use get_poll_from_id that is fully english name + * @deprecated + */ + public static function get_sondage_from_id($id) + { + return get_poll_from_id($id); + } public static function is_error($cerr) { @@ -77,20 +92,20 @@ class Utils echo ' - '; + '; + echo ''; if (! empty($title)) { - echo '<title>' . stripslashes($title) . ' - ' . NOMAPPLICATION . ''; - } else { - echo '' . NOMAPPLICATION . ''; + echo stripslashes($title) . ' - '; } + echo NOMAPPLICATION . ''; echo ' - - - - - + + + + + @@ -104,18 +119,12 @@ class Utils
    '; - } public static function check_table_sondage() { global $connect; - - if (in_array('sondage', $connect->MetaTables('TABLES'))) { - return true; - } - - return false; + return in_array('sondage', $connect->MetaTables('TABLES')); } /** @@ -132,11 +141,9 @@ class Utils /** * Envoi un courrier avec un codage correct de To et Subject * Les en-têtes complémentaires ne sont pas gérés - * */ public static function sendEmail( $to, $subject, $body, $headers='', $param='') { - mb_internal_encoding('UTF-8'); $subject = mb_encode_mimeheader(html_entity_decode($subject, ENT_QUOTES, 'UTF-8'), 'UTF-8', 'B', "\n", 9); @@ -175,9 +182,9 @@ class Utils $headers .= "Content-Type: text/plain; charset=UTF-8\n"; $headers .= "Content-Transfer-Encoding: 8bit\n"; $headers .= "Auto-Submitted:auto-generated\n"; - $headers .= "Return-Path: <>"; + $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'). "\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.'); mail($to, $subject, $body, $headers, $param); } @@ -185,16 +192,16 @@ class Utils /** * Fonction vérifiant l'existance et la valeur non vide d'une clé d'un tableau * @param string $name La clé à tester - * @param array $tableau Le tableau où rechercher la clé ($_POST par défaut) + * @param array $table Le tableau où rechercher la clé ($_POST par défaut) * @return bool Vrai si la clé existe et renvoie une valeur non vide */ - public static function issetAndNoEmpty($name, $tableau = null) + public static function issetAndNoEmpty($name, $table = null) { - if (is_null($tableau)) { - $tableau = $_POST; + if (is_null($table)) { + $table = $_POST; } - return isset($tableau[$name]) && ! empty($tableau[$name]); + return isset($table[$name]) && ! empty($table[$name]); } /** @@ -207,19 +214,17 @@ class Utils { if (URL_PROPRE) { if ($admin === true) { - $url = str_replace('/admin', '', self::get_server_name()) . $id . '/admin'; + return str_replace('/admin', '', self::get_server_name()) . $id . '/admin'; } else { - $url = str_replace('/admin', '', self::get_server_name()) . $id; + return str_replace('/admin', '', self::get_server_name()) . $id; } } else { if ($admin === true) { - $url = str_replace('/admin', '', self::get_server_name()) . 'adminstuds.php?sondage=' . $id; + return str_replace('/admin', '', self::get_server_name()) . 'adminstuds.php?sondage=' . $id; } else { - $url = str_replace('/admin', '', self::get_server_name()) . 'studs.php?sondage=' . $id; + return str_replace('/admin', '', self::get_server_name()) . 'studs.php?sondage=' . $id; } } - - return $url; } public static function remove_sondage($connect, $numsondage) @@ -247,7 +252,12 @@ class Utils return $suppression_OK ; } - + + /** + * @param $connect + * @param $log_txt + * @return void + */ public static function cleaning_polls($connect, $log_txt) { $connect->StartTrans(); $req = 'SELECT * FROM sondage WHERE date_fin < NOW() LIMIT 20'; From b9e669a757ed6ea0e5539a6509d1858482025fc4 Mon Sep 17 00:00:00 2001 From: Simon Leblanc Date: Thu, 27 Nov 2014 23:42:57 +0100 Subject: [PATCH 09/17] complete composer.json file --- composer.json | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/composer.json b/composer.json index ab0c2e6..9f168da 100644 --- a/composer.json +++ b/composer.json @@ -1,4 +1,12 @@ { + "name": "framasoft/framadate", + "description": "Application to facilitate the schedule of events or classic polls", + "keywords": "poll", + "version": "0.8.0", + "license": "CeCILL-B", + + "type": "project", + "require": { "adodb/adodb-php": "5.19" }, From 0468fb6d8cb3b4a73cf5457af11dd8fc97acf56f Mon Sep 17 00:00:00 2001 From: Simon Leblanc Date: Thu, 27 Nov 2014 23:44:21 +0100 Subject: [PATCH 10/17] Add the composer.lock into the repository Adding the composer.lock in the repository is a best practice : https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file --- .gitignore | 1 - composer.lock | 63 +++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 63 insertions(+), 1 deletion(-) create mode 100644 composer.lock diff --git a/.gitignore b/.gitignore index f6e467c..b580503 100644 --- a/.gitignore +++ b/.gitignore @@ -2,7 +2,6 @@ admin/.htaccess admin/.htpasswd admin/logs_studs.txt -composer.lock composer.phar framanav nav diff --git a/composer.lock b/composer.lock new file mode 100644 index 0000000..babc223 --- /dev/null +++ b/composer.lock @@ -0,0 +1,63 @@ +{ + "_readme": [ + "This file locks the dependencies of your project to a known state", + "Read more about it at http://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", + "This file is @generated automatically" + ], + "hash": "09409801c18d04caaf9f8a4f8c7a67b1", + "packages": [ + { + "name": "adodb/adodb-php", + "version": "v5.19", + "source": { + "type": "git", + "url": "https://github.com/ADOdb/ADOdb.git", + "reference": "773bb9b7ccd81b403bf75f7ef476c3f2d7ee04de" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/ADOdb/ADOdb/zipball/773bb9b7ccd81b403bf75f7ef476c3f2d7ee04de", + "reference": "773bb9b7ccd81b403bf75f7ef476c3f2d7ee04de", + "shasum": "" + }, + "require": { + "php": ">=5.3.2" + }, + "type": "library", + "autoload": { + "files": [ + "adodb.inc.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "LGPL-2.1", + " BSD-2-Clause" + ], + "authors": [ + { + "name": "John Lim", + "email": "jlim@natsoft.com", + "role": "Author" + }, + { + "name": "Damien Regad", + "role": "Current maintainer" + } + ], + "description": "ADOdb is a PHP database abstraction layer library", + "homepage": "http://adodb.sourceforge.net/", + "keywords": [ + "database" + ], + "time": "2014-04-23 14:37:03" + } + ], + "packages-dev": [], + "aliases": [], + "minimum-stability": "stable", + "stability-flags": [], + "prefer-stable": false, + "platform": [], + "platform-dev": [] +} From 16da53707f58789e682c411b417847aeb74ba681 Mon Sep 17 00:00:00 2001 From: Simon Leblanc Date: Fri, 28 Nov 2014 05:12:21 +0100 Subject: [PATCH 11/17] First implementation of the installer --- app/inc/constants.php.template | 7 +- app/inc/init.php | 13 ++- install.mysql.auto.sql | 8 ++ install.php | 187 +++++++++++++++++++++++++++++++++ 4 files changed, 207 insertions(+), 8 deletions(-) create mode 100644 install.mysql.auto.sql create mode 100644 install.php diff --git a/app/inc/constants.php.template b/app/inc/constants.php.template index 82567d6..da74053 100644 --- a/app/inc/constants.php.template +++ b/app/inc/constants.php.template @@ -20,11 +20,8 @@ // FRAMADATE version const VERSION = 0.8; -// Server name -const STUDS_URL = ''; - // Application name -const NOMAPPLICATION = ""; +const NOMAPPLICATION = ''; // Database administrator email const ADRESSEMAILADMIN = ''; @@ -36,7 +33,7 @@ const ADRESSEMAILREPONSEAUTO = ''; const BASE = ''; // Database user -const USERBASE = ""; +const USERBASE = ''; // Database password const USERPASSWD = ''; diff --git a/app/inc/init.php b/app/inc/init.php index 2a13d2b..912d6e5 100644 --- a/app/inc/init.php +++ b/app/inc/init.php @@ -23,9 +23,16 @@ if (ini_get('date.timezone') == '') { // Autoloading of dependencies with Composer require_once __DIR__ . '/../../vendor/autoload.php'; -include_once __DIR__ . '/constants.php'; -include_once __DIR__ . '/i18n.php'; +require_once __DIR__ . '/constants.php'; +require_once __DIR__ . '/i18n.php'; $connect = NewADOConnection(BASE_TYPE); -$connect->Connect(SERVEURBASE, USERBASE, USERPASSWD, BASE); + +if ('pdo' === BASE_TYPE) { + $database_host = 'mysql:host='.SERVEURBASE; +} else { + $database_host = SERVEURBASE; +} + +$connect->Connect($database_host, USERBASE, USERPASSWD, BASE); $err = 0; diff --git a/install.mysql.auto.sql b/install.mysql.auto.sql new file mode 100644 index 0000000..a42245e --- /dev/null +++ b/install.mysql.auto.sql @@ -0,0 +1,8 @@ +CREATE TABLE IF NOT EXISTS `comments` (`id_comment` int(11) unsigned NOT NULL AUTO_INCREMENT, `id_sondage` char(16) NOT NULL, `comment` text NOT NULL, `usercomment` text, PRIMARY KEY (`id_comment`), KEY `id_sondage` (`id_sondage`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; +CREATE TABLE IF NOT EXISTS `sondage` (`id_sondage` char(16) NOT NULL, `commentaires` text, `mail_admin` varchar(128) DEFAULT NULL, `nom_admin` varchar(64) DEFAULT NULL, `titre` text, `id_sondage_admin` char(24) DEFAULT NULL, `date_creation` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, `date_fin` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00', `format` varchar(2) DEFAULT NULL, `mailsonde` tinyint(1) DEFAULT '0', `statut` int(11) NOT NULL DEFAULT '1' COMMENT '1 = actif ; 0 = inactif ; ', UNIQUE KEY `id_sondage` (`id_sondage`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; +CREATE TABLE IF NOT EXISTS `sujet_studs` (`id_sondage` char(16) NOT NULL, `sujet` text, KEY `id_sondage` (`id_sondage`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; +CREATE TABLE IF NOT EXISTS `user_studs` (`id_users` int(11) unsigned NOT NULL AUTO_INCREMENT, `nom` varchar(64) NOT NULL, `id_sondage` char(16) NOT NULL, `reponses` text NOT NULL, PRIMARY KEY (`id_users`), KEY `id_sondage` (`id_sondage`)) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=0 ; + +INSERT INTO `sondage` (`id_sondage`, `commentaires`, `mail_admin`, `nom_admin`, `titre`, `id_sondage_admin`, `date_fin`, `format`) VALUES ('aqg259dth55iuhwm','Repas de Noel du service','Stephanie@retaillard.com','Stephanie', 'Repas de Noel','aqg259dth55iuhwmy9d8jlwk', FROM_UNIXTIME('1627100361'),'D+'); +INSERT INTO `sujet_studs` (`id_sondage`, `sujet`) VALUES ('aqg259dth55iuhwm','1225839600@12h,1225839600@19h,1226012400@12h,1226012400@19h,1226876400@12h,1226876400@19h,1227049200@12h,1227049200@19h,1227826800@12h,1227826800@19h'); +INSERT INTO `user_studs` (`nom`, `id_sondage`, `reponses`, `id_users`) VALUES ('marcel','aqg259dth55iuhwm','0110111101','933'), ('paul','aqg259dth55iuhwm','1011010111','935'), ('sophie','aqg259dth55iuhwm','1110110000','945'), ('barack','aqg259dth55iuhwm','0110000','948'), ('takashi','aqg259dth55iuhwm','0000110100','951'), ('albert','aqg259dth55iuhwm','1010110','975'), ('alfred','aqg259dth55iuhwm','0110010','1135'), ('marcs','aqg259dth55iuhwm','0100001010','1143'), ('laure','aqg259dth55iuhwm','0011000','1347'), ('benda','aqg259dth55iuhwm','1101101100','1667'), ('Albert','aqg259dth55iuhwm','1111110011','1668'); diff --git a/install.php b/install.php new file mode 100644 index 0000000..0e12bad --- /dev/null +++ b/install.php @@ -0,0 +1,187 @@ +'; + ob_flush(); + flush(); + + require_once 'phar://'.$composer.'/src/bootstrap.php'; + ob_flush(); + flush(); + + $composer_home = getenv('COMPOSER_HOME'); + $personal_home = getenv('HOME'); + if (empty($composer_home) === true && empty($personal_home) === true) { + putenv('COMPOSER_HOME='.sys_get_temp_dir()); + } + + $application = new \Composer\Console\Application(); + $application->setAutoExit(false); + $command = $application->find('install'); + $input = new \Symfony\Component\Console\Input\ArrayInput(array( + 'command' => 'install', + '-d' => __DIR__, + '-vvv', + '--optimize-autoloader', + )); + $fhandle = fopen('php://output', 'wb'); + $output = new \Symfony\Component\Console\Output\StreamOutput($fhandle); + + $application->run($input, $output); + fclose($fhandle); + ob_flush(); + flush(); + + // Save configuration + $configuration = file_get_contents($configuration_file.'.template'); + if (false === $configuration) { + throw new \Exception('Impossible to read template configuration'); + } + + $configuration = str_replace( + array( + '\'\'', + '\'\'', + '\'\'', + '\'\'', + '\'\'', + '\'\'', + '\'\'', + '\'\'', + ), + array( + var_export($_POST['title'], true), + var_export($_POST['email'], true), + var_export($_POST['no-reply-email'], true), + var_export($_POST['db-name'], true), + var_export($_POST['db-user'], true), + var_export($_POST['db-pass'], true), + var_export($_POST['db-host'], true), + var_export($_POST['db-type'], true), + ), + $configuration + ); + + if (file_put_contents($configuration_file, $configuration) === false) { + throw new \Exception('Impossible to save configuration'); + } + + // Inject database + require_once __DIR__.'/app/inc/init.php'; + + $sqls = explode("\n", file_get_contents(__DIR__.'/install.mysql.auto.sql')); + foreach ($sqls as $sql) { + $sql = trim($sql); + if (empty($sql) === true) { + continue; + } + + $query = $connect->Prepare($sql); + $cleaning = $connect->Execute($query); + } + + ob_flush(); + flush(); + ob_end_clean(); + } catch (Exception $e) { + echo '
    '.$e->getMessage().'
    '; + echo "
    ".$e->getTraceAsString()."
    "; + die('installation failed'); + } +} +?> + + + + OpenSondage Installation + + + +
    +

    OpenSondage Installation

    +
    +
    + General + +
    + + +
    +
    + + +
    +
    + + +
    +
    +
    + Database + +
    + + +
    +
    + + +
    +
    + + +
    +
    + + +
    +
    + + +
    +
    + + +
    +
    + + + From 1a5846a156f797849842c63244fe737c5a632b9f Mon Sep 17 00:00:00 2001 From: Simon Leblanc Date: Sun, 30 Nov 2014 01:02:11 +0100 Subject: [PATCH 12/17] move install into his own folder and split code into class --- install.php | 187 ------------------ install/InstallComposer.php | 90 +++++++++ install/InstallConfiguration.php | 73 +++++++ install/InstallSql.php | 24 +++ install/error.html | 33 ++++ install/install.css | 11 ++ install/install.html | 72 +++++++ .../install.mysql.auto.sql | 0 .../install.mysql.sql | 0 install/install.php | 43 ++++ 10 files changed, 346 insertions(+), 187 deletions(-) delete mode 100644 install.php create mode 100644 install/InstallComposer.php create mode 100644 install/InstallConfiguration.php create mode 100644 install/InstallSql.php create mode 100644 install/error.html create mode 100644 install/install.css create mode 100644 install/install.html rename install.mysql.auto.sql => install/install.mysql.auto.sql (100%) rename install.mysql.sql => install/install.mysql.sql (100%) create mode 100644 install/install.php diff --git a/install.php b/install.php deleted file mode 100644 index 0e12bad..0000000 --- a/install.php +++ /dev/null @@ -1,187 +0,0 @@ -'; - ob_flush(); - flush(); - - require_once 'phar://'.$composer.'/src/bootstrap.php'; - ob_flush(); - flush(); - - $composer_home = getenv('COMPOSER_HOME'); - $personal_home = getenv('HOME'); - if (empty($composer_home) === true && empty($personal_home) === true) { - putenv('COMPOSER_HOME='.sys_get_temp_dir()); - } - - $application = new \Composer\Console\Application(); - $application->setAutoExit(false); - $command = $application->find('install'); - $input = new \Symfony\Component\Console\Input\ArrayInput(array( - 'command' => 'install', - '-d' => __DIR__, - '-vvv', - '--optimize-autoloader', - )); - $fhandle = fopen('php://output', 'wb'); - $output = new \Symfony\Component\Console\Output\StreamOutput($fhandle); - - $application->run($input, $output); - fclose($fhandle); - ob_flush(); - flush(); - - // Save configuration - $configuration = file_get_contents($configuration_file.'.template'); - if (false === $configuration) { - throw new \Exception('Impossible to read template configuration'); - } - - $configuration = str_replace( - array( - '\'\'', - '\'\'', - '\'\'', - '\'\'', - '\'\'', - '\'\'', - '\'\'', - '\'\'', - ), - array( - var_export($_POST['title'], true), - var_export($_POST['email'], true), - var_export($_POST['no-reply-email'], true), - var_export($_POST['db-name'], true), - var_export($_POST['db-user'], true), - var_export($_POST['db-pass'], true), - var_export($_POST['db-host'], true), - var_export($_POST['db-type'], true), - ), - $configuration - ); - - if (file_put_contents($configuration_file, $configuration) === false) { - throw new \Exception('Impossible to save configuration'); - } - - // Inject database - require_once __DIR__.'/app/inc/init.php'; - - $sqls = explode("\n", file_get_contents(__DIR__.'/install.mysql.auto.sql')); - foreach ($sqls as $sql) { - $sql = trim($sql); - if (empty($sql) === true) { - continue; - } - - $query = $connect->Prepare($sql); - $cleaning = $connect->Execute($query); - } - - ob_flush(); - flush(); - ob_end_clean(); - } catch (Exception $e) { - echo '
    '.$e->getMessage().'
    '; - echo "
    ".$e->getTraceAsString()."
    "; - die('installation failed'); - } -} -?> - - - - OpenSondage Installation - - - -
    -

    OpenSondage Installation

    -
    -
    - General - -
    - - -
    -
    - - -
    -
    - - -
    -
    -
    - Database - -
    - - -
    -
    - - -
    -
    - - -
    -
    - - -
    -
    - - -
    -
    - - -
    -
    - - - diff --git a/install/InstallComposer.php b/install/InstallComposer.php new file mode 100644 index 0000000..a370f95 --- /dev/null +++ b/install/InstallComposer.php @@ -0,0 +1,90 @@ +getComposer().'/src/bootstrap.php'; + + $this->initEnv(); + + $application = new \Composer\Console\Application(); + $application->setAutoExit(false); + + $input = new \Symfony\Component\Console\Input\ArrayInput(array( + 'command' => 'install', + '-d' => __DIR__.'/..', + '-vvv', + '--optimize-autoloader', + )); + $output = new \Symfony\Component\Console\Output\NullOutput(); + + $application->run($input, $output); + } + + /** + * @return string + */ + private function getComposer() + { + if (null === $this->composer) { + $this->initComposer(); + } + + return $this->composer; + } + + private function initComposer() + { + // Composer exist ? + $locations = array( + __DIR__.'/../composer.phar', + '/usr/bin/composer.phar', + '/usr/local/bin/composer.phar', + ); + + $this->composer = null; + foreach ($locations as $location) { + if (file_exists($location) === true) { + $this->composer = $location; + break; + } + } + + // If composer not found, download it ! + if (null === $this->composer) { + if (!file_put_contents( + __DIR__.'/../composer.phar', + file_get_contents('https://getcomposer.org/composer.phar') + ) + ) { + throw new \Exception('Impossible to download composer'); + } + + $this->composer = __DIR__.'/../composer.phar'; + } + } + + private function initEnv() + { + $composer_home = getenv('COMPOSER_HOME'); + $personal_home = getenv('HOME'); + if (empty($composer_home) === true && empty($personal_home) === true) { + putenv('COMPOSER_HOME='.sys_get_temp_dir()); + } + } + +} diff --git a/install/InstallConfiguration.php b/install/InstallConfiguration.php new file mode 100644 index 0000000..3595312 --- /dev/null +++ b/install/InstallConfiguration.php @@ -0,0 +1,73 @@ + 'Application name', + 'email' => 'email address', + 'no-reply-email' => 'no-reply@mydomain.com', + 'db-name' => 'database name', + 'db-user' => 'database user', + 'db-pass' => 'database password', + 'db-host' => 'database server', + 'db-type' => 'database type', + ); + + /** + * @param array $datas + */ + public function __construct(array $datas) + { + $this->datas = $datas; + } + + /** + * @return bool + */ + public function checkValues() + { + foreach (array_keys($this->checks) as $key) { + if (isset($this->datas[$key]) === false) { + return false; + } + } + + return true; + } + + public function copy($template, $destination) + { + $configuration = file_get_contents($template); + if (false === $configuration) { + throw new \Exception('Impossible to read template configuration'); + } + + $configuration = $this->convertConfigurationFile($configuration); + + if (file_put_contents($destination, $configuration) === false) { + throw new \Exception('Impossible to save configuration'); + } + } + + + private function convertConfigurationFile($content) + { + foreach ($this->checks as $replace => $search) { + $content = str_replace( + '\'<'.$search.'>\'', + var_export($this->datas[$replace], true), + $content + ); + } + + return $content; + } +} diff --git a/install/InstallSql.php b/install/InstallSql.php new file mode 100644 index 0000000..749767b --- /dev/null +++ b/install/InstallSql.php @@ -0,0 +1,24 @@ +ErrorMsg() !== '') { + throw new \Exception('Bad database configuration : '.$connect->ErrorMsg()); + } + + $sqls = explode("\n", file_get_contents(__DIR__.'/install.mysql.auto.sql')); + foreach ($sqls as $sql) { + $sql = trim($sql); + if (empty($sql) === true) { + continue; + } + + $query = $connect->Prepare($sql); + $cleaning = $connect->Execute($query); + } + } +} diff --git a/install/error.html b/install/error.html new file mode 100644 index 0000000..a758055 --- /dev/null +++ b/install/error.html @@ -0,0 +1,33 @@ + + + + + OpenSondage Installation + + + + + + +
    +
    +

    + OpenSondage +

    +

    Make your polls

    + +
    +
    +

    OpenSondage Installation

    + + +
    +
    + + diff --git a/install/install.css b/install/install.css new file mode 100644 index 0000000..18f3dc5 --- /dev/null +++ b/install/install.css @@ -0,0 +1,11 @@ +header { + padding-bottom: 0; +} + +main { + padding-top: 0; +} + +fieldset { + margin: 1.5em 0; +} \ No newline at end of file diff --git a/install/install.html b/install/install.html new file mode 100644 index 0000000..004097a --- /dev/null +++ b/install/install.html @@ -0,0 +1,72 @@ + + + + + OpenSondage Installation + + + + + + +
    +
    +

    + OpenSondage +

    +

    Make your polls

    + +
    +
    +

    OpenSondage Installation

    +
    +
    + General + +
    + + +
    +
    + + +
    +
    + + +
    +
    +
    + Database + +
    + + +
    +
    + + +
    +
    + + +
    +
    + + +
    +
    + + +
    +
    + + +
    +
    +
    + + diff --git a/install.mysql.auto.sql b/install/install.mysql.auto.sql similarity index 100% rename from install.mysql.auto.sql rename to install/install.mysql.auto.sql diff --git a/install.mysql.sql b/install/install.mysql.sql similarity index 100% rename from install.mysql.sql rename to install/install.mysql.sql diff --git a/install/install.php b/install/install.php new file mode 100644 index 0000000..8cf9f3f --- /dev/null +++ b/install/install.php @@ -0,0 +1,43 @@ +check() === false) { + ini_set('max_execution_time', 0); + $composer->install(); + } + + // Save configuration + $configuration = new InstallConfiguration($_POST); + if ($configuration->checkValues() === false) { + throw new \Exception('Bad value for configuration'); + } + + $configuration->copy($configuration_file.'.template', $configuration_file); + + // Inject database + $sql = new InstallSql(); + $sql->inject(); + + header('Location: ../index.php'); + die(); + } catch (Exception $e) { + require_once __DIR__.'/error.html'; + die(); + } +} + +require_once __DIR__.'/install.html'; From 2c49a9f0acdc6ee1164d3d533a35b273af30c263 Mon Sep 17 00:00:00 2001 From: FramaJosephK Date: Tue, 2 Dec 2014 18:15:15 +0100 Subject: [PATCH 13/17] Fix horaires vides + fix mails qui partent pas + de_DE --- adminstuds.php | 2 +- creation_sondage.php | 1 + locale/de_DE/LC_MESSAGES/Studs.mo | Bin 17977 -> 18245 bytes locale/de_DE/LC_MESSAGES/Studs.po | 1354 ++++++++++++++--------------- studs.php | 2 +- 5 files changed, 680 insertions(+), 679 deletions(-) diff --git a/adminstuds.php b/adminstuds.php index 3c3f017..b9288ac 100644 --- a/adminstuds.php +++ b/adminstuds.php @@ -871,7 +871,7 @@ if (substr($dsondage->format, 0, 1)=="D") { // Hours $rbd = ($border[$i]) ? ' rbd' : ''; - if ($horoCur[1] !== "") { + if (isset($horoCur[1]) && $horoCur[1] !== "") { $tr_hours .= ''.$horoCur[1].''; $radio_title[$i] .= ' - '.$horoCur[1]; $td_headers[$i] .= ' H'.$i; diff --git a/creation_sondage.php b/creation_sondage.php index 1e7f982..1c31134 100644 --- a/creation_sondage.php +++ b/creation_sondage.php @@ -41,6 +41,7 @@ function random($car) function ajouter_sondage() { global $connect; + global $config; $sondage=random(16); $sondage_admin=$sondage.random(8); diff --git a/locale/de_DE/LC_MESSAGES/Studs.mo b/locale/de_DE/LC_MESSAGES/Studs.mo index d225d64f535a56e20d67dac5655325fcadafb7f5..0c358de6e43b1db87a50b2075fe770528fc4b9d2 100644 GIT binary patch delta 6416 zcmai%4{%*ooySk;AE1TO|LH&JN&kdW^3tYFTN(;&(xjy=jY`r+D=II2C&_KzyD!{( z(_$8Q?hYV}F0$N;qjf~FGD1yA59@;T?cbAIQX@9)pKeB&cE&)idU?~2OTjWMsyH0BU|WR@`&&YNuvO|ubR1h0i} zgZtn#7{c@6ZEzC26KdYw89xpe(mxI_gx`kq;rHQmcotp&e>2-uk{@1YfHRosbBwtj zE`d{F8EX76oD4q%XTXnSJO&rge*|jYDAWc&gF4VTC_AsfCGd5)7|xo@C1GxEC2eeH zKnC6onPU#YOWcos^Lm*5mQ8Ecw94eI8Lpf+sI_)b_y--kNDy-@QX zti1B&i#qq-=pYVJnn$@67t|g9=g~%1{Mr zqmM)R{!u8`orWZo`61N&b5QnP%YLu9)R>j@=fH|2+e||eUjwzE8_KYQGBlF$@1QpL zOx8aMb;D<%4*K(~{}Pm)Kf<+eI)RddTOi_^L-51!&ZYR@(wNPk<#0X3{iX-X$2UP4 zJ`PX9$Kf_uAhPa+pNF@@22w`r9)}J-3w5z3j7s{APzT=vZ-AXp^G+;B|9Tp;Rv6O@ zuY@}JF{p))LRG4hP>P&}lKKpkq-WtO_&bQYX2Htzh8v-jyFR0Xa`DY@61)@g&)i+% z?;09khMVCz*a{bMDjB{3cEdYh3w$0*k$IP;8!Uq=u^XVI-3m9s_rU953|GT*ki;?5 zF?v3%hYH?GBMqHsGu!~LhPcOs5EV@f<>OOO3j6>{p|fx@d=*ZCZ)E*9;fpm4P&PIG zFYNv|@ZTWbGNmihH2f&!A{BFthNAfkP=>z)FMvOR)8X?Fbk|#AZwt;Z-9h@8H7^!D7+Yc3TmH6n$Vws zH(zC-0AGL~h1Z8ofhv*2nd7j1z$ z_9)&XaFjTZZ z4(G!&P(k@CsC6?aE(+GgP%*L+DyS>hW{n%*0tSXM{%ytwp$wje^7&7p7QUGE|B&&5 zmh_+tAz@*fpf>DB%4*icoNj`O3T1aL<`F<|E1=hm=ehx~B`K`u$7Vd<);LA|4@dr4a{mq|f z)WK;)o_yT^6_o8z>2v^I4nLIf@r*A(-FOPuk&lO$K!1$vaa87Qw0X*Fj0W8BT(&JL7L&)LAq2i3=}2TT^4= zmuJK^UyEl#gg-Pl!H<} zYKb4YqOGAcdaA$Z9UK^RUStP6e`L6C^vQnbo33QeUYP4Mk2LdmO-ZH%I{~8YLwdIl)q;r=w1p`1_Mylt`=-r>(S=+q?Z%(V zt**((pUKt6=W?}6I^D3d*SmgK^sSFhkqw6&4{cN02MXGir~xg99Ox zO?Fp1dfeygzG=siIEOjDU1sfN)^4%Gej&c4v3p&&3re0}?FuI0hrsR{2;8`AC{Xm= z=mU5se!X$ov~GOuyMdAm;#F(@YVy8;U?l$Hnx@sdkSi9k(Z!}7CVaayA4IIfb*4QZ z4VQ9>!{W!b)xN9X`iLbWDv<(}o!3iXNtdC3>#&-G+73So>39VNT@<*!J{I(p$M*@j zn`Kcx=p~kP#)E5HmuJ#ddEfR7lv+3>BiWu>za}%8sD<6Zfa|<^9y18 z;JWPCeo>AKSESth7|+$JoSZz?GaI|7g>h z#nqKzqMmaM-^C}cyu2fGIyW9K_S9J3fj#9CHX>dYTO2*5Tlwh^U6EHRaVnOK{SeRF z+&OdXkmG}gHPk6LBiq@*r-t%sDA%jzr)id@SmKqCqzaOP zVy>s|L|MN=B^wjPhE8`FuePJd2lVUsJ^5W3o0ubg#tXj9`)L&K2pkcey^wpfnKa-+ zdWxyid4JF)H6ctQSwR>7spYv9X&fgBjIWepElEjFqI2x&c;l*uC3U7f2}JFuqCy$y zXAg=H&TQVYdJ6GqyW)dePFB*$+~JDyen_dY<>W=m7s+mB4UV4jGZPq6+$NtEHhE=} znnb1LE>&-IV-oJ^F|p7|RSKvxDs$SF{}4jWcevoaVHxWazf{Y`sf&4)zOg#cFs_je z6BjkwX)-YlO~#Y1>8$thQS#Dhv-AU?Di^41C5{rs zH(hg}QfGGPNtE%ba#k9BlH%{%-TA|L!p9p@{V3S&Mu-Qr8{; delta 4911 zcmY+`3vdZO$;wp5f;wboLpb*K(BPK8m+LoJcfp;RliTE|W;SQ+WGwZ6;P&h-D?-5|^`_jk_j zp0nTi&bKF=yeH|`yOQoLi62o)eVC!tdOSEuDUG?AO3_sHn1(mtR9uVWFot7r8;-`E zD9`QkeF*dD@5ig~13v3h}*CX@5Nbo z1ZBdrC>ePlQ!tg;r;17@IPVlMJ-RgXNPmZM~*2W0`S-`{}};Qc5Wc^GBB$1xq_FVf(jI>V2w>;lT( z{~P6jQMukqGcZWM5<~bSEW#A>FXLw79axS5Jb<#|Y|{i zrtb$hi}$NBRFb5+5+#)lC=s@zq^`s7--=SCgD4Yy8|6h0q3rz-%GMo6J}C7n%Jb(? z=KI*cKYAM5MSn8JC1nd~NQ#?K2CPAuxF2Prt-iZaUht^jKa8@%mrw$I+wZ@RGS7dp z3ezc+3T#A@t3vpF+*!o_YZ}@7%)oib_N$vv_Betv@qT;?4`CDbQCU0i7q}fO`DA3= zA++&#C<~j*q>}o2l)xMDW?YH#+%IR4|5-G$N|frx1t^j4MHx7Ra#9^e$;fe(RG&df z=~*nr50UJu{F&Yg>oJplr*A*X7H`JUxD)xOcE$OfP2(w?kLR!%3yDf5UWc7{7cRg* zqhuuaYVQRlC`W7^N@|<24!?oR@P51o&mkXVFmA3eKg39`XNdn&!bHEB1)teP*(l{Qt)aF1w#^48ERaOEJ|%e3E<}_)qWZ! zkiVd8@h2z&{Rh*qpo;uU(Uj7dh;29yJ5jFRf|A-TC=>2MiTp9&XK@1k($`m)L@ByQP%?J_CGeL}#=U~y#Xq3TcN5>JWZH_;$f6O#BHV^KxX*v!8NYu5 zWup1su4L*)3jot)9Xw!cMWe;l>d7ozkN-A4$D|Vth_ZpUCU6WEj!(NmO zrZ#&ATrQ4}b3xOP@3I^vRX3ufJb*Gm93}FDm{<`?rq26bMER`JTD{`ScpzsCjH(~BrYG-0tf(JYiySKw%zx7Zv>Tah&C z&{gU0BqgPq3log_Bt66Ins_Yf8M7qg$x$cvnTr{faHw?BaGp6ZX+xRqMEh*lu^rtJ zw6z^{Y~5uCL$(h0+OF5{7_>rB+x+0#LbE2b$eg&gDpLo7&gNL(@Uec|QSCCw6wl5| zrlrla@|jobPOJZlXPSF^wWUKrXM+yA+H!Po!0NZnVENo4y-codj=6gEK%dK1)y(T$ z$BG6w+B#~6%cB!{ldF3PvN;xIyxEaeGNmi#4j=3BMt&tcU=K1>Zwx!;zKZ;ewN@ac zTI@)aG14~AS6pL`SB*_>W0mIPikbPXmeXU0bTnXVHx{xZ+U^ZTRpNF{Woc_D*kd~p zTXhV&Ru9i?vU>s%JLIV0?GBl-buSZ*1T3S-8qYa;y4F`~-JtELdAPE(q}Ph*HY*x) z2XrvtlG2eet)Vc}kK}H8X16Vimv~p&ZY0c(nB}v#jFYKLR|nj(E^~VJoV?aph_qNy zTYoc5#`-OntSGW={y4cLjRp7cl3;ht={Lza6%$)*%k8#<%<8S|fvRRRn3J7#>3Slm zojedSDRb&fQz^{c3jDGD`xY;f`ZI;cayx< zrC3Ii_N!^73tDWJ*c0F?`!{mu%Q_!^ED(}%Vau0>2L@P=iok&IT#7 z;inxFUHD#d;_JGlAve|k(7x4Bo~4V`l0f40=(qcA_S<&N$%boEI*Bo2K52N$^cFXp zFRm--pnjP6QpxLnDvDP{bwJ9bJP{(N#bq0>qa06;9Uw9tVc%@0Qje3fD=~rr<~xnE z^1QE!M>ZuMDZezaIoY^Ev&&35FtT_naj0wz^Qi>nsB_HxMP26Q=|Pj)wAUP%(U;R= z2laYeqHydOvvx#-q{dV=AFl}aB~qU_&p2_MSah@PCXSxr$D%^9| jww4>wGV|u*67zIv* are not permitted" -msgstr "Die Zeichen \" ' < et > sind nicht erlaubt !" - -msgid "The date is not correct !" -msgstr "Das Datum ist nicht korrekt !" - -########### Step 1 ########### -# Step 1 info_sondage.php -msgid "Poll creation (1 on 3)" -msgstr "Erstellen der Umfrage (1 von 3)" - -msgid "Framadate is not properly installed, please check the 'INSTALL' to setup the database before continuing." -msgstr "Framadate ist nicht richtig installiert, lesen Sie 'INSTALL' um die Datenbank aufzusetzen bevor es weiter geht." - -msgid "You are in the poll creation section." -msgstr "Sie können hier Umfragen erstellen" - -msgid "Required fields cannot be left blank." -msgstr "Mit * markierte Felder müssen ausgefüllt sein." - -msgid "Poll title" -msgstr "Umfragetitel" - -msgid "Voters can modify their vote themselves." -msgstr "Teilnehmer können ihre Antworten verändern" - -msgid "To receive an email for each new vote." -msgstr "Bei jeder neuen Stimme eine E-Mail erhalten." - -msgid "Go to step 2" -msgstr "Go to step 2" - -# Errors info_sondage.php -msgid "Enter a title" -msgstr "Einen Titel eingeben" - -msgid "Characters < > and \" are not permitted" -msgstr "Die Zeichen < > und \" sind nicht erlaubt !" - -msgid "Enter an email address" -msgstr "Sie müssen eine E-Mail Adresse eingeben" - -msgid "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." -msgstr "Die Adresse ist nicht korrekt! Sie sollten eine funktionierende E-Mail Adresse angeben, um den Link zu ihrer Umfrage zu erhalten" - -# Error choix_date.php/choix_autre.php -msgid "You haven't filled the first section of the poll creation." -msgstr "Sie haben den ersten Teil der Umfrageerstellung nicht ausgefüllt." - -msgid "Back to step 1" -msgstr "Back to step 1" - -########### Step 2 ########### -# Step 2 choix_date.php -msgid "Poll dates (2 on 3)" -msgstr "Umfragedaten (2 von 3)" - -msgid "Choose the dates of your poll" -msgstr "Wählen Sie das Daturm ihrer Umfrage" - -msgid "To schedule an event you need to propose at least two choices (two hours for one day or two days)." -msgstr "Um eine Umfrage für einen Termin zu erstellen, müssen Sie mindestens zwei Auswahlmöglichkeiten angeben (zwei verschiedene Zeiten an einem Tag oder zwei Tage)." - -msgid "You can add or remove additionnal days and hours with the buttons" -msgstr "Sie können weitere Tage und Zeiten über diesen Button hinzufügen oder entfernen" - -msgid "For each selected day, you can choose, or not, meeting hours (e.g.: \"8h\", \"8:30\", \"8h-10h\", \"evening\", etc.)" -msgstr "Sie können (müssen aber nicht), für jeden ausgewählten Tage, Zeiten für den Treffpunkt (z.B. \"8h\", \"8:30\", \"8-10Uhr\", \"abend\", etc.) angeben." - -msgid "Day" -msgstr "Tag" - -msgid "Time" -msgstr "Uhrzeit" - -msgid "Remove an hour" -msgstr "Eine Uhrzeit entfernen" - -msgid "Add an hour" -msgstr "Eine Uhrzeit hinzufügen" - -msgid "Copy hours of the first day" -msgstr "Die (Uhr)Zeiten des ersten Tags kopieren" - -msgid "Remove a day" -msgstr "Ein Tag entfernen" - -msgid "Add a day" -msgstr "Ein Tag hinzufügen" - -msgid "Remove all days" -msgstr "Alle Tage entfernen" - -msgid "Remove all hours" -msgstr "Alle (Uhr)Zeiten löschen" - -# Step 2 choix_autre.php -msgid "Poll subjects (2 on 3)" -msgstr "Umfragethema (2 von 3)" - -msgid "To make a generic poll you need to propose at least two choices between differents subjects." -msgstr "Um eine allgemeine Umfrage zu erstellen, benötigen Sie mindestens zwei Auswahlmöglichkeiten zwischen verschiedenen Themen." - -msgid "You can add or remove additional choices with the buttons" -msgstr "Sie können über den Button zusätzliche Auswahlmöglichkeiten hinzufügen oder entfernen" - -msgid "It's possible to propose links or images by using " -msgstr "It's possible to propose links or images by using " - -msgid "the Markdown syntax" -msgstr "the Markdown syntax" - -msgid "Choice" -msgstr "Wahl" - -msgid "Add a link or an image" -msgstr "Add a link or an image" - -msgid "These fields are optional. You can add a link, an image or both." -msgstr "These fields are optional. You can add a link, an image or both." - -msgid "URL of the image" -msgstr "URL of the image" - -msgid "Link" -msgstr "Link" - -msgid "Alternative text" -msgstr "Alternative text" - -msgid "Remove a choice" -msgstr "Eine Auswahl entfernen" - -msgid "Add a choice" -msgstr "Eine Auswahl hinzufügen" - -msgid "Back to step 2" -msgstr "Back to step 2" - -msgid "Go to step 3" -msgstr "Go to step 3" - -########### Step 3 ########### -msgid "Removal date and confirmation (3 on 3)" -msgstr "Löschdatum und Bestätigung (3 von 3)" - -msgid "Confirm the creation of your poll" -msgstr "Bestätigen Sie die Erstellung ihrer Umfrage" - -msgid "List of your choices" -msgstr "List of your choices" - -msgid "Once you have confirmed the creation of your poll, you will be automatically redirected on the administration page of your poll." -msgstr "Wenn Sie die Erstellung ihrer Umfrage bestätigt haben, werden sie automatisch zur Administrationsseite ihrer Umfrage weitergeleitet." - -msgid "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." -msgstr "Danach werden Sie zwei E-Mails erhalten: die Eine enthält den Link zur Umfrage für die Teilnehmer, die Andere enthält den Link zur Administrationsseite ihrer Umfrage." - -msgid "Create the poll" -msgstr "Umfrage erstellen" - -# Step 3 choix_date.php -msgid "Your poll will expire automatically 2 days after the last date of your poll." -msgstr "Ihre Umfrage wird automatisch zwei Tage nach dem letzten Datum ihrer Umfrage auslaufen." - -msgid "Removal date:" -msgstr "Löschdatum:" - -# Step 3 choix_autre.php -msgid "Your poll will be automatically removed after 6 months." -msgstr "Ihre Umfrage wird automatisch nach 6 Monaten gelöscht." - -msgid "You can fix another removal date for it." -msgstr "Sie können jedoch auch ein anderes Löschdatum festlegen." - -msgid "Removal date (optional)" -msgstr "Löschdatum (optional)" - -############# Admin ############# -msgid "Polls administrator" -msgstr "Umfrageadministrator" - -msgid "Confirm removal of the poll " -msgstr "Bestätigen Sie die Löschung ihrer Umfrage" - -msgid "polls in the database at this time" -msgstr "Umfragen derzeit in der Datenbank" - -msgid "Poll ID" -msgstr "Umfrage ID" - -msgid "Format" -msgstr "Format" - -msgid "Title" -msgstr "Titel" - -msgid "Author" -msgstr "Autor" - -msgid "Users" -msgstr "Benutzer" - -msgid "Actions" -msgstr "Aktionen" - -msgid "See the poll" -msgstr "Betrachte die Umfrage" - -msgid "Change the poll" -msgstr "Ändere die Umfrage" - -msgid "Logs" -msgstr "Verlauf" - -########### Mails ########### -# Mails studs.php -msgid "Poll's participation" -msgstr "Beteiligung an der Umfrage" - -msgid "" -"has filled a line.\n" -"You can find your poll at the link" -msgstr "" -" hat eine Zeile ausgefüllt.\n" -"Sie finden Ihre Umfrage unter folgendem Link" - -msgid "Thanks for your confidence." -msgstr "Danke für Ihr Vertrauen." - -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" -"\n" -"\n" -"\n" -" " - -# Mails adminstuds.php -msgid "[ADMINISTRATOR] New settings for your poll" -msgstr "[ADMINISTRATOR] Neuer Einstellungen für Ihre Umfrage " - -msgid "" -"You have changed the settings of your poll. \n" -"You can modify this poll with this link" -msgstr "" -"Sie haben den Einstellungen Ihrer Umfrage geändert. \n" -"Sie können Ihre Umfrage unter diesem Link ändern" - -# Mails creation_sondage.php -msgid "" -"This is the message you have to send to the people you want to poll. \n" -"Now, you have to send this message to everyone you want to poll." -msgstr "" -"Dies ist die Nachricht, diese den Personen gesendet haben, die an der Umfrage teilnehmen sollen. \n" -"Sie haben die Nachricht an alle Personen, die Sie befragen wollen, gesendet." - -msgid "hast just created a poll called" -msgstr " hat eine Umfrage erstellt (Name folgt) " - -msgid "Thanks for filling the poll at the link above" -msgstr "Dankeschön, dass Sie die Umfrage unter dem obrigen Link ausgefüllt haben" - -msgid "" -"This message should NOT be sent to the polled people. It is private for the poll's creator.\n" -"\n" -"You can now modify it at the link above" -msgstr "" -"Diese Nachricht sollte NICHT an die befragten Personen gesendet werden. Sie ist dem Umfrageautor vorbehalten.\n" -"\n" -"Sie können die Umfrage unter dem oberen Link bearbeiten " - -msgid "Author's message" -msgstr "Nachricht für den Autor " - -msgid "For sending to the polled users" -msgstr "Nachricht für die Teilnehmer" +msgid "" +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: Jonathan Brielmaier\n" +"Language-Team: Jonathan Brielmaier\n" +"Language: German\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Poedit-Language: German\n" +"X-Poedit-Country: GERMANY\n" +"X-Poedit-SourceCharset: utf-8\n" +"X-Poedit-KeywordsList: _\n" +"X-Poedit-Basepath: /var/www/studs\n" +"X-Poedit-SearchPath-0: .\n" + +########### Generic ########### +msgid "Make your polls" +msgstr "Eigene Umfragen erstellen" + +msgid "Home" +msgstr "Home" + +msgid "Poll" +msgstr "Umfrage" + +msgid "Save" +msgstr "Speichern" + +msgid "Cancel" +msgstr "Abbrechen" + +msgid "Add" +msgstr "Hinzufügen" + +msgid "Remove" +msgstr "Entfernen" + +msgid "Validate" +msgstr "Bestätigen" + +msgid "Edit" +msgstr "Bearbeiten" + +msgid "Next" +msgstr "Weiter" + +msgid "Back" +msgstr "Zurück" + +msgid "Close" +msgstr "Schließen" + +msgid "Your name" +msgstr "Ihr Name" + +msgid "Your email address" +msgstr "Ihre E-Mail Adresse" + +msgid "(in the format name@mail.com)" +msgstr "(Format: name@mail.com)" + +msgid "Description" +msgstr "Beschreibung" + +msgid "Back to the homepage of " +msgstr "Zurück zur Homepage von " + +msgid "Error!" +msgstr "Fehler!" + +msgid "(dd/mm/yyyy)" +msgstr "(tt/mm/jjjj)" + +msgid "dd/mm/yyyy" +msgstr "tt/mm/jjjj" + +msgid "%A, den %e. %B %Y" +msgstr "%A %e %B %Y" + +msgid "Expiration's date" +msgstr "Verfallsdatum" + +########### Language selector ########### +msgid "Change the language" +msgstr "Sprache wechseln" + +msgid "Select the language" +msgstr "Sprache wählen" + +############ Homepage ############ +msgid "Schedule an event" +msgstr "Termin finden" + +msgid "Make a classic poll" +msgstr "Klassische Umfrage" + +# 1st section +msgid "What is that?" +msgstr "Was ist das?" + +msgid "Framadate is an online service for planning an appointment or make a decision quickly and easily. No registration is required." +msgstr "Framadate ist ein Online-Dienst, das Ihnen hilft, Termine zu finden oder Entscheidungen schnell und einfach zu treffen. Keine Registrierung ist erforderlich. " + +msgid "Here is how it works:" +msgstr "So geht es:" + +msgid "Make a poll" +msgstr "Umfrage erstellen" + +msgid "Define dates or subjects to choose" +msgstr "Datum- oder Auswahlmöglichkeiten definieren" + +msgid "Send the poll link to your friends or colleagues" +msgstr "Link zur Umfrage an Ihre Freunde oder Kollegen schicken" + +msgid "Discuss and make a decision" +msgstr "Besprechen und Entscheidung treffen" + +msgid "Do you want to " +msgstr "Wollen Sie sich " + +msgid "view an example?" +msgstr "einen Beispiel ansehen?" + +# 2nd section +msgid "The software" +msgstr "Die Software" + +msgid "Framadate was initially based on " +msgstr "Framadate war am Anfang auf " + +msgid " a software developed by the University of Strasbourg. Today, it is devevoped by the association Framasoft" +msgstr " basiert, eine von der Straßburg-Universität entwickelte Software. Heutzutage wird sie von der Framasoft-Vereinigung entwickelt." + +msgid "This software needs javascript and cookies enabled. It is compatible with the following web browsers:" +msgstr "Für diese Software müssen Javascript und Cookie aktiviert sein. Sie ist mit den folgenden Browsers kompatibel:" + +msgid "It is governed by the " +msgstr "Sie ist lizenziert unter der " + +msgid "CeCILL-B license" +msgstr "CeCILL-B Lizenz" + +# 3rd section +msgid "Cultivate your garden" +msgstr "Bestellen Sie ihren Garten" + +msgid "To participate in the software development, suggest improvements or simply download it, please visit " +msgstr "Um zur Software-Entwicklung teilzunehmen, Verbesserungen vorzuschlagen oder um sie herunterzuladen, gehen Sie auf " + +msgid "the development site" +msgstr "die Entwicklung-Seite" + +msgid "If you want to install the software for your own use and thus increase your independence, we help you on:" +msgstr "Wenn Sie die Software für Ihre eigene Nutzung installieren möchten und Ihre Eigenständigkeit erhöhen, helfen wir Sie auf:" + +############## Poll ############## +msgid "Poll administration" +msgstr "Umfrage-Verwaltung" + +msgid "Legend:" +msgstr "Legende:" + +# Jumbotron adminstuds.php (+ studs.php) +msgid "Back to the poll" +msgstr "Zurück zur Umfrage" + +msgid "Print" +msgstr "Drucken" + +msgid "Export to CSV" +msgstr "CSV-Export" + +msgid "Remove the poll" +msgstr "Umfrage löschen" + +msgid "Title of the poll" +msgstr "Titel der Umfrage" + +msgid "Edit the title" +msgstr "Titel bearbeiten" + +msgid "Save the new title" +msgstr "Den neuen Titel speichern" + +msgid "Cancel the title edit" +msgstr "Änderung des Titels abbrechen" + +msgid "Initiator of the poll" +msgstr "Ersteller der Umfrage" + +msgid "Email" +msgstr "E-Mail Adresse" + +msgid "Edit the email adress" +msgstr "E-Mail Adresse ändern" + +msgid "Save the adress email" +msgstr "E-Mail Adresse speichern" + +msgid "Cancel the adress email edit" +msgstr "Änderung der E-Mail Adresse abbrechen" + +msgid "Edit the description" +msgstr "Beschreibung bearbeiten" + +msgid "Save the description" +msgstr "Beschreibung speichern" + +msgid "Cancel the description edit" +msgstr "Änderung der Beschreibung verwerfen" + +msgid "Public link of the poll" +msgstr "Öffentlicher Link zur Umfrage" + +msgid "Admin link of the poll" +msgstr "Administrator-Link der Umfrage" + +msgid "Poll rules" +msgstr "Regeln der Umfrage" + +msgid "Edit the poll rules" +msgstr "Regeln der Umfrage bearbeiten" + +msgid "Votes and comments are locked" +msgstr "Abstimmungen und Kommentare sind gesperrt" + +msgid "Votes and comments are open" +msgstr "Abstimmungen und Kommentare sind möglich" + +msgid "Votes are editable" +msgstr "Die Abstimmungen können geändert werden" + +msgid "Save the new rules" +msgstr "Neue Regeln speichern" + +msgid "Cancel the rules edit" +msgstr "Neue Regeln nicht speichern" + +# Help text adminstuds.php +msgid "As poll administrator, you can change all the lines of this poll with this button " +msgstr "Als Administrator der Umfrage, können Sie alle Zeilen der Umfrage über diesen Button ändern " + +msgid " remove a column or a line with " +msgstr " Zeile oder Spalte entfernen mit " + +msgid "and add a new column with " +msgstr "und neue Spalte hinzufügen mit " + +msgid "Finally, you can change the informations of this poll like the title, the comments or your email address." +msgstr "Sie können auch die Informationen dieser Umfrage wie Titel, Kommentare oder E-Mail Adresse ändern." + +# Help text studs.php +msgid "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." +msgstr "Wenn Sie bei dieser Umfrage abstimmen möchten, müssen Sie ihren Namen angeben. Wählen Sie die Optionen, die für Sie am besten passen und bestätigen Sie diese über den Plus-Button am Ende der Zeile." + +# Poll results +msgid "Votes of the poll " +msgstr "Abstimmungen der Umfrage " + +msgid "Remove the column" +msgstr "Spalte entfernen" + +msgid "Add a column" +msgstr "Spalte hinzufügen" + +msgid "Edit the line:" +msgstr "Zeile bearbeiten:" + +msgid "Remove the line:" +msgstr "Zeile entfernen:" + +msgid "Yes" +msgstr "Ja" + +msgid "Ifneedbe" +msgstr "Wenn notwendig" + +msgid ", ifneedbe" +msgstr ", wenn notwendig" + +msgid "No" +msgstr "Nein" + +msgid "Vote \"no\" for " +msgstr "Stimme « nein » für " + +msgid "Vote \"yes\" for " +msgstr "Stimme « ja » für " + +msgid "Vote \"ifneedbe\" for " +msgstr "Stimme « Wenn notwendig » für " + +msgid "Save the choices" +msgstr "Wahl speichern" + +msgid "Addition" +msgstr "Hinzufügen" + +msgid "Best choice" +msgstr "Bste Option" + +msgid "Best choices" +msgstr "Besten Optionen" + +msgid "The best choice at this time is:" +msgstr "Die beste Option ist derzeit:" + +msgid "The bests choices at this time are:" +msgstr "Die beste Optionen sind derzeit:" + +msgid "with" +msgstr "mit" + +msgid "vote" +msgstr "Stimme" + +msgid "votes" +msgstr "Stimmen" + +msgid "for" +msgstr "für" + +msgid "Remove all the votes" +msgstr "Alle Stimmungen löschen" + +msgid "Scroll to the left" +msgstr "Links scrollen" + +msgid "Scroll to the right" +msgstr "Rechts scrollen" + +# Comments +msgid "Comments of polled people" +msgstr "Kommentare von Teilnehmer" + +msgid "Remove the comment" +msgstr "Kommentar entfernen" + +msgid "Add a comment in the poll" +msgstr "Kommentar zur Umfrage hinzufügen" + +msgid "Your comment" +msgstr "Ihr Kommentar" + +msgid "Send the comment" +msgstr "Kommentar senden" + +msgid "anonyme" +msgstr "anonym" + +msgid "Remove all the comments" +msgstr "Alle Kommentare löschen" + +# Add a colum adminstuds.php +msgid "Column's adding" +msgstr "Spalte hinzufügen" + +msgid "You can add a new scheduling date to your poll." +msgstr "Sie können zur Umfrage ein neues Datum hinzufügen." + +msgid "If you just want to add a new hour to an existant date, put the same date and choose a new hour." +msgstr "Wenn Sie nur eine neue Uhrzeiteit zu einem existierenden Datum hinzufügen wollen, wählen Sie das selbe Datum und wählen Sie eine neue Zeit aus." + +# Remove poll adminstuds.php +msgid "Confirm removal of your poll" +msgstr "Löschen der Umfrage bestätigen" + +msgid "Remove this poll!" +msgstr "Diese Umfrage löschen!" + +msgid "Keep this poll!" +msgstr "Diese Umfrage nicht löschen!" + +msgid "Your poll has been removed!" +msgstr "Ihre Umfrage wurde gelöscht!" + +# Errors adminstuds.php/studs +msgid "This poll doesn't exist !" +msgstr "Diese Umfrage existiert nicht!" + +msgid "Enter a name" +msgstr "Geben Sie einen Namen ein" + +msgid "The name you've chosen already exist in this poll!" +msgstr "Der von Ihnen eingegebenen Name existiert bereits in dieser Umfrage" + +msgid "Enter a name and a comment!" +msgstr "Geben Sie einen Namen und ein Kommentar ein!" + +msgid "Failed to insert the comment!" +msgstr "Einfügen des Kommentars gescheitert!" + +msgid "Characters \" ' < et > are not permitted" +msgstr "Die Zeichen \" ' < und > sind nicht erlaubt !" + +msgid "The date is not correct !" +msgstr "Das Datum ist nicht korrekt!" + +########### Step 1 ########### +# Step 1 info_sondage.php +msgid "Poll creation (1 on 3)" +msgstr "Umfrage erstellen (1 von 3)" + +msgid "Framadate is not properly installed, please check the 'INSTALL' to setup the database before continuing." +msgstr "Framadate ist nicht richtig installiert, lesen Sie 'INSTALL' um die Datenbank aufzusetzen bevor es weiter geht." + +msgid "You are in the poll creation section." +msgstr "Sie können hier Umfragen erstellen" + +msgid "Required fields cannot be left blank." +msgstr "Mit * markierte Felder müssen ausgefüllt sein." + +msgid "Poll title" +msgstr "Umfragetitel" + +msgid "Voters can modify their vote themselves." +msgstr "Teilnehmer können ihre Antworten verändern" + +msgid "To receive an email for each new vote." +msgstr "Bei jeder neuen Abstimmung eine E-Mail erhalten." + +msgid "Go to step 2" +msgstr "Weiter zum 2. Schritt" + +# Errors info_sondage.php +msgid "Enter a title" +msgstr "Titel eingeben" + +msgid "Characters < > and \" are not permitted" +msgstr "Die Zeichen < > und \" sind nicht erlaubt !" + +msgid "Enter an email address" +msgstr "Sie müssen eine E-Mail Adresse eingeben" + +msgid "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." +msgstr "Die Adresse ist nicht korrekt! Sie sollten eine funktionierende E-Mail Adresse angeben, um den Link zu ihrer Umfrage zu erhalten" + +# Error choix_date.php/choix_autre.php +msgid "You haven't filled the first section of the poll creation." +msgstr "Sie haben den ersten Teil der Umfrageerstellung nicht ausgefüllt." + +msgid "Back to step 1" +msgstr "Zurück zum 1. Schritt" + +########### Step 2 ########### +# Step 2 choix_date.php +msgid "Poll dates (2 on 3)" +msgstr "Umfragedaten (2 von 3)" + +msgid "Choose the dates of your poll" +msgstr "Wählen Sie Terminmöglichkeiten für Ihre Umfrage" + +msgid "To schedule an event you need to propose at least two choices (two hours for one day or two days)." +msgstr "Um eine Umfrage für einen Termin zu erstellen, müssen Sie mindestens zwei Auswahlmöglichkeiten angeben (zwei verschiedene Zeiten an einem Tag oder zwei Tage)." + +msgid "You can add or remove additionnal days and hours with the buttons" +msgstr "Sie können weitere Tage und Uhrzeiten über diesen Button hinzufügen oder entfernen" + +msgid "For each selected day, you can choose, or not, meeting hours (e.g.: \"8h\", \"8:30\", \"8h-10h\", \"evening\", etc.)" +msgstr "Sie können (müssen aber nicht), für jeden ausgewählten Tage, Zeiten für den Termin (z.B. \"8h\", \"8:30\", \"8-10Uhr\", \"Abends\", etc.) angeben." + +msgid "Day" +msgstr "Tag" + +msgid "Time" +msgstr "Uhrzeit" + +msgid "Remove an hour" +msgstr "Eine Uhrzeit entfernen" + +msgid "Add an hour" +msgstr "Eine Uhrzeit hinzufügen" + +msgid "Copy hours of the first day" +msgstr "Uhrzeiten des ersten Tags kopieren" + +msgid "Remove a day" +msgstr "Einen Tag entfernen" + +msgid "Add a day" +msgstr "Einen Tag hinzufügen" + +msgid "Remove all days" +msgstr "Alle Tage entfernen" + +msgid "Remove all hours" +msgstr "Alle Uhrzeiten entfernen" + +# Step 2 choix_autre.php +msgid "Poll subjects (2 on 3)" +msgstr "Umfragethemen (2 von 3)" + +msgid "To make a generic poll you need to propose at least two choices between differents subjects." +msgstr "Um eine allgemeine Umfrage zu erstellen, benötigen Sie mindestens zwei Auswahlmöglichkeiten zwischen verschiedenen Themen." + +msgid "You can add or remove additional choices with the buttons" +msgstr "Sie können über den Button zusätzliche Auswahlmöglichkeiten hinzufügen oder entfernen" + +msgid "It's possible to propose links or images by using " +msgstr "Es besteht die Möglichkeit, Links oder Bilder vorszuschlagen mit " + +msgid "the Markdown syntax" +msgstr "Markdown" + +msgid "Choice" +msgstr "Wahl" + +msgid "Add a link or an image" +msgstr "Link oder Bild hinzufügen" + +msgid "These fields are optional. You can add a link, an image or both." +msgstr "Diese Felder sind optional. Sie können einen Link, ein Bild oder beide hinzufügen." + +msgid "URL of the image" +msgstr "URL des Bilds" + +msgid "Link" +msgstr "Link" + +msgid "Alternative text" +msgstr "Alternativer Text" + +msgid "Remove a choice" +msgstr "Eine Auswahlmöglichkeit entfernen" + +msgid "Add a choice" +msgstr "Eine Auswahlmöglichkeit hinzufügen" + +msgid "Back to step 2" +msgstr "Zurück zum 2. Schritt" + +msgid "Go to step 3" +msgstr "Weiter zum 3. Schritt" + +########### Step 3 ########### +msgid "Removal date and confirmation (3 on 3)" +msgstr "Löschdatum und Bestätigung (3 von 3)" + +msgid "Confirm the creation of your poll" +msgstr "Bestätigen Sie die Erstellung ihrer Umfrage" + +msgid "List of your choices" +msgstr "Liste Ihrer Auswahlmöglichkeiten" + +msgid "Once you have confirmed the creation of your poll, you will be automatically redirected on the administration page of your poll." +msgstr "Wenn Sie die Erstellung ihrer Umfrage bestätigt haben, werden sie automatisch zur Administrationsseite ihrer Umfrage weitergeleitet." + +msgid "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." +msgstr "Danach werden Sie zwei E-Mails erhalten: die Eine enthält den Link zur Umfrage für die Teilnehmer, die Andere enthält den Link zur Administrationsseite ihrer Umfrage." + +msgid "Create the poll" +msgstr "Umfrage erstellen" + +# Step 3 choix_date.php +msgid "Your poll will expire automatically 2 days after the last date of your poll." +msgstr "Ihre Umfrage wird automatisch zwei Tage nach dem letzten Datum ihrer Umfrage auslaufen." + +msgid "Removal date:" +msgstr "Löschdatum:" + +# Step 3 choix_autre.php +msgid "Your poll will be automatically removed after 6 months." +msgstr "Ihre Umfrage wird automatisch nach 6 Monaten gelöscht." + +msgid "You can fix another removal date for it." +msgstr "Sie können auch ein anderes Löschdatum festlegen." + +msgid "Removal date (optional)" +msgstr "Löschdatum (optional)" + +############# Admin ############# +msgid "Polls administrator" +msgstr "Umfrageadministrator" + +msgid "Confirm removal of the poll " +msgstr "Bestätigen Sie die Löschung ihrer Umfrage" + +msgid "polls in the database at this time" +msgstr "Umfragen derzeit in der Datenbank" + +msgid "Poll ID" +msgstr "Umfrage-ID" + +msgid "Format" +msgstr "Format" + +msgid "Title" +msgstr "Titel" + +msgid "Author" +msgstr "Autor" + +msgid "Users" +msgstr "Nutzer" + +msgid "Actions" +msgstr "Aktionen" + +msgid "See the poll" +msgstr "Umfrage sehen" + +msgid "Change the poll" +msgstr "Umfrage ändern" + +msgid "Logs" +msgstr "Verlauf" + +########### Mails ########### +# Mails studs.php +msgid "Poll's participation" +msgstr "Beteiligung an der Umfrage" + +msgid "" +"has filled a line.\n" +"You can find your poll at the link" +msgstr "" +" hat eine Zeile ausgefüllt.\n" +"Sie finden Ihre Umfrage unter dem folgenden Link:" + +msgid "Thanks for your confidence." +msgstr "Danke für Ihr Vertrauen." + +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" +"\n" +"\n" +"\n" +" " + +# Mails adminstuds.php +msgid "[ADMINISTRATOR] New settings for your poll" +msgstr "[ADMINISTRATOR] Neue Einstellungen für Ihre Umfrage " + +msgid "" +"You have changed the settings of your poll. \n" +"You can modify this poll with this link" +msgstr "" +"Sie haben die Einstellungen Ihrer Umfrage geändert. \n" +"Sie können Ihre Umfrage unter diesem Link ändern" + +# Mails creation_sondage.php +msgid "" +"This is the message you have to send to the people you want to poll. \n" +"Now, you have to send this message to everyone you want to poll." +msgstr "" +"Dies ist die Nachricht, die Sie an die Personen, die Sie zur Umfrage einladen möchten, schicken sollen. \n" +"Schicken Sie jetzt bitte diese Nachricht an alle Personen, die Sie zur Umfrage einladen möchten." + +msgid "hast just created a poll called" +msgstr " hat eine Umfrage erstellt - Name folgt: " + +msgid "Thanks for filling the poll at the link above" +msgstr "Danke, dass Sie die Umfrage unter dem obrigen Link ausgefüllt haben" + +msgid "" +"This message should NOT be sent to the polled people. It is private for the poll's creator.\n" +"\n" +"You can now modify it at the link above" +msgstr "" +"Diese Nachricht sollte NICHT an die befragten Personen gesendet werden. Sie nur für den Autor der Umfrage gemeint.\n" +"\n" +"Sie können die Umfrage unter dem oberen Link bearbeiten " + +msgid "Author's message" +msgstr "Nachricht vom Autor " + +msgid "For sending to the polled users" +msgstr "Nachricht für die Teilnehmer" diff --git a/studs.php b/studs.php index 6ec461a..b108e69 100644 --- a/studs.php +++ b/studs.php @@ -366,7 +366,7 @@ if ($dsondage->format=="D"||$dsondage->format=="D+"||$dsondage->format=="D-") { // Hours $rbd = ($border[$i]) ? ' rbd' : ''; - if ($horoCur[1] !== "") { + if (isset($horoCur[1]) && $horoCur[1] !== "") { $tr_hours .= ''.$horoCur[1].''; $radio_title[$i] .= ' - '.$horoCur[1]; $td_headers[$i] .= ' H'.$i; From 6751a8a9cfc84f2a49d46ccd2aec2ad0bcd72485 Mon Sep 17 00:00:00 2001 From: FramaJosephK Date: Wed, 3 Dec 2014 14:30:25 +0100 Subject: [PATCH 14/17] =?UTF-8?q?Retouches=20apr=C3=A8s=20s=C3=A9rie=20de?= =?UTF-8?q?=20merges?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- adminstuds.php | 5 +++-- app/classes/Framadate/Utils.php | 34 ++++++++++++++++----------------- creation_sondage.php | 4 ++-- install/error.html | 4 ++-- install/install.html | 4 ++-- 5 files changed, 26 insertions(+), 25 deletions(-) diff --git a/adminstuds.php b/adminstuds.php index a738cec..724e15c 100644 --- a/adminstuds.php +++ b/adminstuds.php @@ -44,7 +44,8 @@ function getChoicesFromPOST($nbColumns) function getNewChoiceFromChoices($choices) { if(!is_array($choice)) { - throw new Exception('$choices must be a an array'); + /* throw new Exception('$choices must be a an array'); + PHP Fatal error: Class 'Framadate\Exception' not found */ } $newChoice = ''; @@ -886,7 +887,7 @@ if (substr($dsondage->format, 0, 1) == 'D') { // Hours $rbd = ($border[$i]) ? ' rbd' : ''; - if (isset($horoCur[1]) && $horoCur[1] !== "") { + if (isset($horoCur[1]) && $horoCur[1] !== '') { $tr_hours .= ''.$horoCur[1].''; $radio_title[$i] .= ' - '.$horoCur[1]; $td_headers[$i] .= ' H'.$i; diff --git a/app/classes/Framadate/Utils.php b/app/classes/Framadate/Utils.php index 03efeb0..ca333c2 100644 --- a/app/classes/Framadate/Utils.php +++ b/app/classes/Framadate/Utils.php @@ -20,9 +20,9 @@ namespace Framadate; class Utils { - /** - * @return string Server name - */ + /** + * @return string Server name + */ public static function get_server_name() { $scheme = (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on') ? 'https' : 'http'; @@ -32,9 +32,9 @@ class Utils return $scheme . '://' . str_replace('/admin', '', str_replace('//', '/', str_replace('///', '/', $server_name))); } - /** - * Returns a poll or false if it fails - */ + /** + * Returns a poll or false if it fails + */ public static function get_poll_from_id($id) { global $connect; @@ -60,15 +60,15 @@ class Utils return false; } - + /** * Use get_poll_from_id that is fully english name * @deprecated */ public static function get_sondage_from_id($id) { - return get_poll_from_id($id); - } + return self::get_poll_from_id($id); + } public static function is_error($cerr) { @@ -94,7 +94,7 @@ class Utils '; - echo ''; + echo '<title>'; if (! empty($title)) { echo stripslashes($title) . ' - '; } @@ -184,7 +184,7 @@ class Utils $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… »') ."\n" . _('Framasoft ne vit que par vos dons (déductibles des impôts).') ."\n". _('Merci d\'avance pour votre soutien http://soutenir.framasoft.org.'); + $body = html_entity_decode($body, ENT_QUOTES, 'UTF-8'). "\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.'); mail($to, $subject, $body, $headers, $param); } @@ -252,12 +252,12 @@ class Utils return $suppression_OK ; } - - /** - * @param $connect - * @param $log_txt - * @return void - */ + + /** + * @param $connect + * @param $log_txt + * @return void + */ public static function cleaning_polls($connect, $log_txt) { $connect->StartTrans(); $req = 'SELECT * FROM sondage WHERE date_fin < NOW() LIMIT 20'; diff --git a/creation_sondage.php b/creation_sondage.php index 2ed214e..08a7fb8 100644 --- a/creation_sondage.php +++ b/creation_sondage.php @@ -76,12 +76,12 @@ function ajouter_sondage() $connect->Execute($sql, array($poll, $_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 = _("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\n" ._('You can now modify it at the link above'); + $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($poll)); diff --git a/install/error.html b/install/error.html index a758055..c6dc5ba 100644 --- a/install/error.html +++ b/install/error.html @@ -12,13 +12,13 @@ <div class="container ombre"> <header role="banner"> <h1> - <img src="../images/logo-framadate.png" width="360" height="50" alt="OpenSondage" /> + <img src="../images/logo-framadate.png" width="360" height="50" alt="Framadate" /> </h1> <h2>Make your polls</h2> <hr class="trait" role="presentation"> </header> <main role="main"> - <h3>OpenSondage Installation</h3> + <h3>Framadate Installation</h3> <div class="alert alert-danger" role="alert"> <?php echo htmlspecialchars($e->getMessage(), ENT_COMPAT | ENT_HTML401, 'UTF-8') ?> </div> diff --git a/install/install.html b/install/install.html index 004097a..1caa3af 100644 --- a/install/install.html +++ b/install/install.html @@ -12,13 +12,13 @@ <div class="container ombre"> <header role="banner"> <h1> - <img src="../images/logo-framadate.png" width="360" height="50" alt="OpenSondage" /> + <img src="../images/logo-framadate.png" width="360" height="50" alt="Framadate" /> </h1> <h2>Make your polls</h2> <hr class="trait" role="presentation"> </header> <main role="main"> - <h3>OpenSondage Installation</h3> + <h3>Framadate Installation</h3> <form action="" method="post" role="form"> <fieldset> <legend>General</legend> From dcee9d4cd69151d105473163407a61a24703bc9e Mon Sep 17 00:00:00 2001 From: JosephK <josephk@framasoft.org> Date: Wed, 3 Dec 2014 15:04:12 +0100 Subject: [PATCH 15/17] =?UTF-8?q?Produit=20l'erreur=20=C2=AB=20PHP=20Parse?= =?UTF-8?q?=20error:=20=20syntax=20error,=20unexpected=20'')=20=3D=3D=3D?= =?UTF-8?q?=20true=20=C2=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- admin/index.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/admin/index.php b/admin/index.php index 3004813..7cba06d 100644 --- a/admin/index.php +++ b/admin/index.php @@ -115,6 +115,6 @@ echo '</table></form>'."\n"; bandeau_pied(true); // si on annule la suppression, rafraichissement de la page -if (Utils::issetAndNoEmpty('annulesuppression') === true) { +/*if (Utils::issetAndNoEmpty('annulesuppression') === true) { // TODO -} +}*/ From c15ce049ad12d8aeb08623c1936fa17e6f81941f Mon Sep 17 00:00:00 2001 From: FramaJosephK <josephk@framasoft.org> Date: Wed, 3 Dec 2014 18:39:01 +0100 Subject: [PATCH 16/17] Keep polls with bad expiration date in database --- app/classes/Framadate/Utils.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/classes/Framadate/Utils.php b/app/classes/Framadate/Utils.php index ca333c2..4986732 100644 --- a/app/classes/Framadate/Utils.php +++ b/app/classes/Framadate/Utils.php @@ -260,7 +260,7 @@ class Utils */ public static function cleaning_polls($connect, $log_txt) { $connect->StartTrans(); - $req = 'SELECT * FROM sondage WHERE date_fin < NOW() LIMIT 20'; + $req = 'SELECT * FROM sondage WHERE date_fin < NOW() && date_fin != 0 LIMIT 20'; $sql = $connect->Prepare($req); $cleaning = $connect->Execute($sql); From 54ae3e3b9d80739cd53a8607714d6937ff7cb1e8 Mon Sep 17 00:00:00 2001 From: JosephK <josephk@framasoft.org> Date: Wed, 3 Dec 2014 19:00:33 +0100 Subject: [PATCH 17/17] =?UTF-8?q?&&=20=E2=86=92=20AND?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/classes/Framadate/Utils.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/classes/Framadate/Utils.php b/app/classes/Framadate/Utils.php index 4986732..6aeed8a 100644 --- a/app/classes/Framadate/Utils.php +++ b/app/classes/Framadate/Utils.php @@ -260,7 +260,7 @@ class Utils */ public static function cleaning_polls($connect, $log_txt) { $connect->StartTrans(); - $req = 'SELECT * FROM sondage WHERE date_fin < NOW() && date_fin != 0 LIMIT 20'; + $req = 'SELECT * FROM sondage WHERE date_fin < NOW() AND date_fin != 0 LIMIT 20'; $sql = $connect->Prepare($req); $cleaning = $connect->Execute($sql);