1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/opensondage_ynh.git synced 2024-09-03 19:46:28 +02:00

[enh] Update source to 2c49a9f0ac

[enh] Remove legal question in setup
This commit is contained in:
zamentur 2014-12-15 23:35:45 +01:00
parent a9f8ac95cd
commit 1542a044df
13 changed files with 1533 additions and 450 deletions

View file

@ -5,7 +5,7 @@ OpenSondage for YunoHost
OpenSondage is used to poll people invite for a meeting. OpenSondage is used to poll people invite for a meeting.
This package contains a custom version of Framadate (fork of OpenSondage and Studs), the sources are here: https://git.framasoft.org/framasoft/framadate/tree/514369387bc27d8ad7e831d2e1fb34ba2b4c9c41. You can see change in the history of the depot. This package contains a custom version of Framadate (fork of OpenSondage and Studs), the sources are here: https://git.framasoft.org/framasoft/framadate/commit/2c49a9f0acdc6ee1164d3d533a35b273af30c263. You can see change in the history of the depot.
<img src="/sources/images/date.png" style="max-width:100%;" alt="Screen containing a meeting poll"/> <img src="/sources/images/date.png" style="max-width:100%;" alt="Screen containing a meeting poll"/>
<img src="/sources/images/classic.png" style="max-width:100%;" alt="Screen containing a vote poll to choose a restaurant"/> <img src="/sources/images/classic.png" style="max-width:100%;" alt="Screen containing a vote poll to choose a restaurant"/>

View file

@ -49,17 +49,6 @@
}, },
"example": "homer" "example": "homer"
}, },
{
"name": "legal",
"optional" : "true",
"ask": {
"en": "Indicate a web page with legal information",
"fr": "Indiquez la page où figure les mentions légales",
"de": "Tragen Sie bitte die Website ein, wo man den Impressum finden kann."
},
"example": "http://example.com",
"default": "no"
},
{ {
"name": "language", "name": "language",
"ask": { "ask": {

View file

@ -4,9 +4,9 @@
domain=$1 domain=$1
path=$2 path=$2
admin=$3 admin=$3
legal=$4 language=$4
language=$5 public_site=$5
public_site=$6 legal='no'
# Check if admin exists # Check if admin exists
sudo yunohost user list --json | grep -q "\"username\": \"$admin\"" sudo yunohost user list --json | grep -q "\"username\": \"$admin\""

519
sources/LICENCE.fr.txt Normal file
View file

@ -0,0 +1,519 @@
CONTRAT DE LICENCE DE LOGICIEL LIBRE CeCILL-B
Avertissement
Ce contrat est une licence de logiciel libre issue d'une concertation
entre ses auteurs afin que le respect de deux grands principes préside à
sa rédaction:
* d'une part, le respect des principes de diffusion des logiciels
libres: accès au code source, droits étendus conférés aux
utilisateurs,
* d'autre part, la désignation d'un droit applicable, le droit
français, auquel elle est conforme, tant au regard du droit de la
responsabilité civile que du droit de la propriété intellectuelle
et de la protection qu'il offre aux auteurs et titulaires des
droits patrimoniaux sur un logiciel.
Les auteurs de la licence CeCILL-B (pour Ce[a] C[nrs] I[nria] L[ogiciel]
L[ibre]) sont:
Commissariat à l'Energie Atomique - CEA, établissement public de
recherche à caractère scientifique, technique et industriel, dont le
siège est situé 25 rue Leblanc, immeuble Le Ponant D, 75015 Paris.
Centre National de la Recherche Scientifique - CNRS, établissement
public à caractère scientifique et technologique, dont le siège est
situé 3 rue Michel-Ange, 75794 Paris cedex 16.
Institut National de Recherche en Informatique et en Automatique -
INRIA, établissement public à caractère scientifique et technologique,
dont le siège est situé Domaine de Voluceau, Rocquencourt, BP 105, 78153
Le Chesnay cedex.
Préambule
Ce contrat est une licence de logiciel libre dont l'objectif est de
conférer aux utilisateurs une très large liberté de modification et de
redistribution du logiciel régi par cette licence.
L'exercice de cette liberté est assorti d'une obligation forte de
citation à la charge de ceux qui distribueraient un logiciel incorporant
un logiciel régi par la présente licence afin d'assurer que les
contributions de tous soient correctement identifiées et reconnues.
L'accessibilité au code source et les droits de copie, de modification
et de redistribution qui découlent de ce contrat ont pour contrepartie
de n'offrir aux utilisateurs qu'une garantie limitée et de ne faire
peser sur l'auteur du logiciel, le titulaire des droits patrimoniaux et
les concédants successifs qu'une responsabilité restreinte.
A cet égard l'attention de l'utilisateur est attirée sur les risques
associés au chargement, à l'utilisation, à la modification et/ou au
développement et à la reproduction du logiciel par l'utilisateur étant
donné sa spécificité de logiciel libre, qui peut le rendre complexe à
manipuler et qui le réserve donc à des développeurs ou des
professionnels avertis possédant des connaissances informatiques
approfondies. Les utilisateurs sont donc invités à charger et tester
l'adéquation du logiciel à leurs besoins dans des conditions permettant
d'assurer la sécurité de leurs systèmes et/ou de leurs données et, plus
généralement, à l'utiliser et l'exploiter dans les mêmes conditions de
sécurité. Ce contrat peut être reproduit et diffusé librement, sous
réserve de le conserver en l'état, sans ajout ni suppression de clauses.
Ce contrat est susceptible de s'appliquer à tout logiciel dont le
titulaire des droits patrimoniaux décide de soumettre l'exploitation aux
dispositions qu'il contient.
Article 1 - DEFINITIONS
Dans ce contrat, les termes suivants, lorsqu'ils seront écrits avec une
lettre capitale, auront la signification suivante:
Contrat: désigne le présent contrat de licence, ses éventuelles versions
postérieures et annexes.
Logiciel: désigne le logiciel sous sa forme de Code Objet et/ou de Code
Source et le cas échéant sa documentation, dans leur état au moment de
l'acceptation du Contrat par le Licencié.
Logiciel Initial: désigne le Logiciel sous sa forme de Code Source et
éventuellement de Code Objet et le cas échéant sa documentation, dans
leur état au moment de leur première diffusion sous les termes du Contrat.
Logiciel Modifié: désigne le Logiciel modifié par au moins une
Contribution.
Code Source: désigne l'ensemble des instructions et des lignes de
programme du Logiciel et auquel l'accès est nécessaire en vue de
modifier le Logiciel.
Code Objet: désigne les fichiers binaires issus de la compilation du
Code Source.
Titulaire: désigne le ou les détenteurs des droits patrimoniaux d'auteur
sur le Logiciel Initial.
Licencié: désigne le ou les utilisateurs du Logiciel ayant accepté le
Contrat.
Contributeur: désigne le Licencié auteur d'au moins une Contribution.
Concédant: désigne le Titulaire ou toute personne physique ou morale
distribuant le Logiciel sous le Contrat.
Contribution: désigne l'ensemble des modifications, corrections,
traductions, adaptations et/ou nouvelles fonctionnalités intégrées dans
le Logiciel par tout Contributeur, ainsi que tout Module Interne.
Module: désigne un ensemble de fichiers sources y compris leur
documentation qui permet de réaliser des fonctionnalités ou services
supplémentaires à ceux fournis par le Logiciel.
Module Externe: désigne tout Module, non dérivé du Logiciel, tel que ce
Module et le Logiciel s'exécutent dans des espaces d'adressage
différents, l'un appelant l'autre au moment de leur exécution.
Module Interne: désigne tout Module lié au Logiciel de telle sorte
qu'ils s'exécutent dans le même espace d'adressage.
Parties: désigne collectivement le Licencié et le Concédant.
Ces termes s'entendent au singulier comme au pluriel.
Article 2 - OBJET
Le Contrat a pour objet la concession par le Concédant au Licencié d'une
licence non exclusive, cessible et mondiale du Logiciel telle que
définie ci-après à l'article 5 pour toute la durée de protection des droits
portant sur ce Logiciel.
Article 3 - ACCEPTATION
3.1 L'acceptation par le Licencié des termes du Contrat est réputée
acquise du fait du premier des faits suivants:
* (i) le chargement du Logiciel par tout moyen notamment par
téléchargement à partir d'un serveur distant ou par chargement à
partir d'un support physique;
* (ii) le premier exercice par le Licencié de l'un quelconque des
droits concédés par le Contrat.
3.2 Un exemplaire du Contrat, contenant notamment un avertissement
relatif aux spécificités du Logiciel, à la restriction de garantie et à
la limitation à un usage par des utilisateurs expérimentés a été mis à
disposition du Licencié préalablement à son acceptation telle que
définie à l'article 3.1 ci dessus et le Licencié reconnaît en avoir pris
connaissance.
Article 4 - ENTREE EN VIGUEUR ET DUREE
4.1 ENTREE EN VIGUEUR
Le Contrat entre en vigueur à la date de son acceptation par le Licencié
telle que définie en 3.1.
4.2 DUREE
Le Contrat produira ses effets pendant toute la durée légale de
protection des droits patrimoniaux portant sur le Logiciel.
Article 5 - ETENDUE DES DROITS CONCEDES
Le Concédant concède au Licencié, qui accepte, les droits suivants sur
le Logiciel pour toutes destinations et pour la durée du Contrat dans
les conditions ci-après détaillées.
Par ailleurs, si le Concédant détient ou venait à détenir un ou
plusieurs brevets d'invention protégeant tout ou partie des
fonctionnalités du Logiciel ou de ses composants, il s'engage à ne pas
opposer les éventuels droits conférés par ces brevets aux Licenciés
successifs qui utiliseraient, exploiteraient ou modifieraient le
Logiciel. En cas de cession de ces brevets, le Concédant s'engage à
faire reprendre les obligations du présent alinéa aux cessionnaires.
5.1 DROIT D'UTILISATION
Le Licencié est autorisé à utiliser le Logiciel, sans restriction quant
aux domaines d'application, étant ci-après précisé que cela comporte:
1. la reproduction permanente ou provisoire du Logiciel en tout ou
partie par tout moyen et sous toute forme.
2. le chargement, l'affichage, l'exécution, ou le stockage du
Logiciel sur tout support.
3. la possibilité d'en observer, d'en étudier, ou d'en tester le
fonctionnement afin de déterminer les idées et principes qui sont
à la base de n'importe quel élément de ce Logiciel; et ceci,
lorsque le Licencié effectue toute opération de chargement,
d'affichage, d'exécution, de transmission ou de stockage du
Logiciel qu'il est en droit d'effectuer en vertu du Contrat.
5.2 DROIT D'APPORTER DES CONTRIBUTIONS
Le droit d'apporter des Contributions comporte le droit de traduire,
d'adapter, d'arranger ou d'apporter toute autre modification au Logiciel
et le droit de reproduire le logiciel en résultant.
Le Licencié est autorisé à apporter toute Contribution au Logiciel sous
réserve de mentionner, de façon explicite, son nom en tant qu'auteur de
cette Contribution et la date de création de celle-ci.
5.3 DROIT DE DISTRIBUTION
Le droit de distribution comporte notamment le droit de diffuser, de
transmettre et de communiquer le Logiciel au public sur tout support et
par tout moyen ainsi que le droit de mettre sur le marché à titre
onéreux ou gratuit, un ou des exemplaires du Logiciel par tout procédé.
Le Licencié est autorisé à distribuer des copies du Logiciel, modifié ou
non, à des tiers dans les conditions ci-après détaillées.
5.3.1 DISTRIBUTION DU LOGICIEL SANS MODIFICATION
Le Licencié est autorisé à distribuer des copies conformes du Logiciel,
sous forme de Code Source ou de Code Objet, à condition que cette
distribution respecte les dispositions du Contrat dans leur totalité et
soit accompagnée:
1. d'un exemplaire du Contrat,
2. d'un avertissement relatif à la restriction de garantie et de
responsabilité du Concédant telle que prévue aux articles 8
et 9,
et que, dans le cas où seul le Code Objet du Logiciel est redistribué,
le Licencié permette un accès effectif au Code Source complet du
Logiciel pendant au moins toute la durée de sa distribution du Logiciel,
étant entendu que le coût additionnel d'acquisition du Code Source ne
devra pas excéder le simple coût de transfert des données.
5.3.2 DISTRIBUTION DU LOGICIEL MODIFIE
Lorsque le Licencié apporte une Contribution au Logiciel, le Logiciel
Modifié peut être distribué sous un contrat de licence autre que le
présent Contrat sous réserve du respect des dispositions de l'article
5.3.4.
5.3.3 DISTRIBUTION DES MODULES EXTERNES
Lorsque le Licencié a développé un Module Externe les conditions du
Contrat ne s'appliquent pas à ce Module Externe, qui peut être distribué
sous un contrat de licence différent.
5.3.4 CITATIONS
Le Licencié qui distribue un Logiciel Modifié s'engage expressément:
1. à indiquer dans sa documentation qu'il a été réalisé à partir du
Logiciel régi par le Contrat, en reproduisant les mentions de
propriété intellectuelle du Logiciel,
2. à faire en sorte que l'utilisation du Logiciel, ses mentions de
propriété intellectuelle et le fait qu'il est régi par le Contrat
soient indiqués dans un texte facilement accessible depuis
l'interface du Logiciel Modifié,
3. à mentionner, sur un site Web librement accessible décrivant le
Logiciel Modifié, et pendant au moins toute la durée de sa
distribution, qu'il a été réalisé à partir du Logiciel régi par le
Contrat, en reproduisant les mentions de propriété intellectuelle
du Logiciel,
4. lorsqu'il le distribue à un tiers susceptible de distribuer
lui-même un Logiciel Modifié, sans avoir à en distribuer le code
source, à faire ses meilleurs efforts pour que les obligations du
présent article 5.3.4 soient reprises par le dit tiers.
Lorsque le Logiciel modifié ou non est distribué avec un Module Externe
qui a été conçu pour l'utiliser, le Licencié doit soumettre le dit
Module Externe aux obligations précédentes.
5.3.5 COMPATIBILITE AVEC LES LICENCES CeCILL et CeCILL-C
Lorsqu'un Logiciel Modifié contient une Contribution soumise au contrat
de licence CeCILL, les stipulations prévues à l'article 5.3.4 sont
facultatives.
Un Logiciel Modifié peut être distribué sous le contrat de licence
CeCILL-C. Les stipulations prévues à l'article 5.3.4 sont alors
facultatives.
Article 6 - PROPRIETE INTELLECTUELLE
6.1 SUR LE LOGICIEL INITIAL
Le Titulaire est détenteur des droits patrimoniaux sur le Logiciel
Initial. Toute utilisation du Logiciel Initial est soumise au respect
des conditions dans lesquelles le Titulaire a choisi de diffuser son
oeuvre et nul autre n'a la faculté de modifier les conditions de
diffusion de ce Logiciel Initial.
Le Titulaire s'engage à ce que le Logiciel Initial reste au moins régi
par le Contrat et ce, pour la durée visée à l'article 4.2.
6.2 SUR LES CONTRIBUTIONS
Le Licencié qui a développé une Contribution est titulaire sur celle-ci
des droits de propriété intellectuelle dans les conditions définies par
la législation applicable.
6.3 SUR LES MODULES EXTERNES
Le Licencié qui a développé un Module Externe est titulaire sur celui-ci
des droits de propriété intellectuelle dans les conditions définies par
la législation applicable et reste libre du choix du contrat régissant
sa diffusion.
6.4 DISPOSITIONS COMMUNES
Le Licencié s'engage expressément:
1. à ne pas supprimer ou modifier de quelque manière que ce soit les
mentions de propriété intellectuelle apposées sur le Logiciel;
2. à reproduire à l'identique lesdites mentions de propriété
intellectuelle sur les copies du Logiciel modifié ou non.
Le Licencié s'engage à ne pas porter atteinte, directement ou
indirectement, aux droits de propriété intellectuelle du Titulaire et/ou
des Contributeurs sur le Logiciel et à prendre, le cas échéant, à
l'égard de son personnel toutes les mesures nécessaires pour assurer le
respect des dits droits de propriété intellectuelle du Titulaire et/ou
des Contributeurs.
Article 7 - SERVICES ASSOCIES
7.1 Le Contrat n'oblige en aucun cas le Concédant à la réalisation de
prestations d'assistance technique ou de maintenance du Logiciel.
Cependant le Concédant reste libre de proposer ce type de services. Les
termes et conditions d'une telle assistance technique et/ou d'une telle
maintenance seront alors déterminés dans un acte séparé. Ces actes de
maintenance et/ou assistance technique n'engageront que la seule
responsabilité du Concédant qui les propose.
7.2 De même, tout Concédant est libre de proposer, sous sa seule
responsabilité, à ses licenciés une garantie, qui n'engagera que lui,
lors de la redistribution du Logiciel et/ou du Logiciel Modifié et ce,
dans les conditions qu'il souhaite. Cette garantie et les modalités
financières de son application feront l'objet d'un acte séparé entre le
Concédant et le Licencié.
Article 8 - RESPONSABILITE
8.1 Sous réserve des dispositions de l'article 8.2, le Licencié a la
faculté, sous réserve de prouver la faute du Concédant concerné, de
solliciter la réparation du préjudice direct qu'il subirait du fait du
Logiciel et dont il apportera la preuve.
8.2 La responsabilité du Concédant est limitée aux engagements pris en
application du Contrat et ne saurait être engagée en raison notamment:
(i) des dommages dus à l'inexécution, totale ou partielle, de ses
obligations par le Licencié, (ii) des dommages directs ou indirects
découlant de l'utilisation ou des performances du Logiciel subis par le
Licencié et (iii) plus généralement d'un quelconque dommage indirect. En
particulier, les Parties conviennent expressément que tout préjudice
financier ou commercial (par exemple perte de données, perte de
bénéfices, perte d'exploitation, perte de clientèle ou de commandes,
manque à gagner, trouble commercial quelconque) ou toute action dirigée
contre le Licencié par un tiers, constitue un dommage indirect et
n'ouvre pas droit à réparation par le Concédant.
Article 9 - GARANTIE
9.1 Le Licencié reconnaît que l'état actuel des connaissances
scientifiques et techniques au moment de la mise en circulation du
Logiciel ne permet pas d'en tester et d'en vérifier toutes les
utilisations ni de détecter l'existence d'éventuels défauts. L'attention
du Licencié a été attirée sur ce point sur les risques associés au
chargement, à l'utilisation, la modification et/ou au développement et à
la reproduction du Logiciel qui sont réservés à des utilisateurs avertis.
Il relève de la responsabilité du Licencié de contrôler, par tous
moyens, l'adéquation du produit à ses besoins, son bon fonctionnement et
de s'assurer qu'il ne causera pas de dommages aux personnes et aux biens.
9.2 Le Concédant déclare de bonne foi être en droit de concéder
l'ensemble des droits attachés au Logiciel (comprenant notamment les
droits visés à l'article 5).
9.3 Le Licencié reconnaît que le Logiciel est fourni "en l'état" par le
Concédant sans autre garantie, expresse ou tacite, que celle prévue à
l'article 9.2 et notamment sans aucune garantie sur sa valeur commerciale,
son caractère sécurisé, innovant ou pertinent.
En particulier, le Concédant ne garantit pas que le Logiciel est exempt
d'erreur, qu'il fonctionnera sans interruption, qu'il sera compatible
avec l'équipement du Licencié et sa configuration logicielle ni qu'il
remplira les besoins du Licencié.
9.4 Le Concédant ne garantit pas, de manière expresse ou tacite, que le
Logiciel ne porte pas atteinte à un quelconque droit de propriété
intellectuelle d'un tiers portant sur un brevet, un logiciel ou sur tout
autre droit de propriété. Ainsi, le Concédant exclut toute garantie au
profit du Licencié contre les actions en contrefaçon qui pourraient être
diligentées au titre de l'utilisation, de la modification, et de la
redistribution du Logiciel. Néanmoins, si de telles actions sont
exercées contre le Licencié, le Concédant lui apportera son aide
technique et juridique pour sa défense. Cette aide technique et
juridique est déterminée au cas par cas entre le Concédant concerné et
le Licencié dans le cadre d'un protocole d'accord. Le Concédant dégage
toute responsabilité quant à l'utilisation de la dénomination du
Logiciel par le Licencié. Aucune garantie n'est apportée quant à
l'existence de droits antérieurs sur le nom du Logiciel et sur
l'existence d'une marque.
Article 10 - RESILIATION
10.1 En cas de manquement par le Licencié aux obligations mises à sa
charge par le Contrat, le Concédant pourra résilier de plein droit le
Contrat trente (30) jours après notification adressée au Licencié et
restée sans effet.
10.2 Le Licencié dont le Contrat est résilié n'est plus autorisé à
utiliser, modifier ou distribuer le Logiciel. Cependant, toutes les
licences qu'il aura concédées antérieurement à la résiliation du Contrat
resteront valides sous réserve qu'elles aient été effectuées en
conformité avec le Contrat.
Article 11 - DISPOSITIONS DIVERSES
11.1 CAUSE EXTERIEURE
Aucune des Parties ne sera responsable d'un retard ou d'une défaillance
d'exécution du Contrat qui serait dû à un cas de force majeure, un cas
fortuit ou une cause extérieure, telle que, notamment, le mauvais
fonctionnement ou les interruptions du réseau électrique ou de
télécommunication, la paralysie du réseau liée à une attaque
informatique, l'intervention des autorités gouvernementales, les
catastrophes naturelles, les dégâts des eaux, les tremblements de terre,
le feu, les explosions, les grèves et les conflits sociaux, l'état de
guerre...
11.2 Le fait, par l'une ou l'autre des Parties, d'omettre en une ou
plusieurs occasions de se prévaloir d'une ou plusieurs dispositions du
Contrat, ne pourra en aucun cas impliquer renonciation par la Partie
intéressée à s'en prévaloir ultérieurement.
11.3 Le Contrat annule et remplace toute convention antérieure, écrite
ou orale, entre les Parties sur le même objet et constitue l'accord
entier entre les Parties sur cet objet. Aucune addition ou modification
aux termes du Contrat n'aura d'effet à l'égard des Parties à moins
d'être faite par écrit et signée par leurs représentants dûment habilités.
11.4 Dans l'hypothèse où une ou plusieurs des dispositions du Contrat
s'avèrerait contraire à une loi ou à un texte applicable, existants ou
futurs, cette loi ou ce texte prévaudrait, et les Parties feraient les
amendements nécessaires pour se conformer à cette loi ou à ce texte.
Toutes les autres dispositions resteront en vigueur. De même, la
nullité, pour quelque raison que ce soit, d'une des dispositions du
Contrat ne saurait entraîner la nullité de l'ensemble du Contrat.
11.5 LANGUE
Le Contrat est rédigé en langue française et en langue anglaise, ces
deux versions faisant également foi.
Article 12 - NOUVELLES VERSIONS DU CONTRAT
12.1 Toute personne est autorisée à copier et distribuer des copies de
ce Contrat.
12.2 Afin d'en préserver la cohérence, le texte du Contrat est protégé
et ne peut être modifié que par les auteurs de la licence, lesquels se
réservent le droit de publier périodiquement des mises à jour ou de
nouvelles versions du Contrat, qui posséderont chacune un numéro
distinct. Ces versions ultérieures seront susceptibles de prendre en
compte de nouvelles problématiques rencontrées par les logiciels libres.
12.3 Tout Logiciel diffusé sous une version donnée du Contrat ne pourra
faire l'objet d'une diffusion ultérieure que sous la même version du
Contrat ou une version postérieure.
Article 13 - LOI APPLICABLE ET COMPETENCE TERRITORIALE
13.1 Le Contrat est régi par la loi française. Les Parties conviennent
de tenter de régler à l'amiable les différends ou litiges qui
viendraient à se produire par suite ou à l'occasion du Contrat.
13.2 A défaut d'accord amiable dans un délai de deux (2) mois à compter
de leur survenance et sauf situation relevant d'une procédure d'urgence,
les différends ou litiges seront portés par la Partie la plus diligente
devant les Tribunaux compétents de Paris.
Version 1.0 du 2006-09-05.

515
sources/LICENSE.en.txt Normal file
View file

@ -0,0 +1,515 @@
CeCILL-B FREE SOFTWARE LICENSE AGREEMENT
Notice
This Agreement is a Free Software license agreement that is the result
of discussions between its authors in order to ensure compliance with
the two main principles guiding its drafting:
* firstly, compliance with the principles governing the distribution
of Free Software: access to source code, broad rights granted to
users,
* secondly, the election of a governing law, French law, with which
it is conformant, both as regards the law of torts and
intellectual property law, and the protection that it offers to
both authors and holders of the economic rights over software.
The authors of the CeCILL-B (for Ce[a] C[nrs] I[nria] L[ogiciel] L[ibre])
license are:
Commissariat à l'Energie Atomique - CEA, a public scientific, technical
and industrial research establishment, having its principal place of
business at 25 rue Leblanc, immeuble Le Ponant D, 75015 Paris, France.
Centre National de la Recherche Scientifique - CNRS, a public scientific
and technological establishment, having its principal place of business
at 3 rue Michel-Ange, 75794 Paris cedex 16, France.
Institut National de Recherche en Informatique et en Automatique -
INRIA, a public scientific and technological establishment, having its
principal place of business at Domaine de Voluceau, Rocquencourt, BP
105, 78153 Le Chesnay cedex, France.
Preamble
This Agreement is an open source software license intended to give users
significant freedom to modify and redistribute the software licensed
hereunder.
The exercising of this freedom is conditional upon a strong obligation
of giving credits for everybody that distributes a software
incorporating a software ruled by the current license so as all
contributions to be properly identified and acknowledged.
In consideration of access to the source code and the rights to copy,
modify and redistribute granted by the license, users are provided only
with a limited warranty and the software's author, the holder of the
economic rights, and the successive licensors only have limited liability.
In this respect, the risks associated with loading, using, modifying
and/or developing or reproducing the software by the user are brought to
the user's attention, given its Free Software status, which may make it
complicated to use, with the result that its use is reserved for
developers and experienced professionals having in-depth computer
knowledge. Users are therefore encouraged to load and test the
suitability of the software as regards their requirements in conditions
enabling the security of their systems and/or data to be ensured and,
more generally, to use and operate it in the same conditions of
security. This Agreement may be freely reproduced and published,
provided it is not altered, and that no provisions are either added or
removed herefrom.
This Agreement may apply to any or all software for which the holder of
the economic rights decides to submit the use thereof to its provisions.
Article 1 - DEFINITIONS
For the purpose of this Agreement, when the following expressions
commence with a capital letter, they shall have the following meaning:
Agreement: means this license agreement, and its possible subsequent
versions and annexes.
Software: means the software in its Object Code and/or Source Code form
and, where applicable, its documentation, "as is" when the Licensee
accepts the Agreement.
Initial Software: means the Software in its Source Code and possibly its
Object Code form and, where applicable, its documentation, "as is" when
it is first distributed under the terms and conditions of the Agreement.
Modified Software: means the Software modified by at least one
Contribution.
Source Code: means all the Software's instructions and program lines to
which access is required so as to modify the Software.
Object Code: means the binary files originating from the compilation of
the Source Code.
Holder: means the holder(s) of the economic rights over the Initial
Software.
Licensee: means the Software user(s) having accepted the Agreement.
Contributor: means a Licensee having made at least one Contribution.
Licensor: means the Holder, or any other individual or legal entity, who
distributes the Software under the Agreement.
Contribution: means any or all modifications, corrections, translations,
adaptations and/or new functions integrated into the Software by any or
all Contributors, as well as any or all Internal Modules.
Module: means a set of sources files including their documentation that
enables supplementary functions or services in addition to those offered
by the Software.
External Module: means any or all Modules, not derived from the
Software, so that this Module and the Software run in separate address
spaces, with one calling the other when they are run.
Internal Module: means any or all Module, connected to the Software so
that they both execute in the same address space.
Parties: mean both the Licensee and the Licensor.
These expressions may be used both in singular and plural form.
Article 2 - PURPOSE
The purpose of the Agreement is the grant by the Licensor to the
Licensee of a non-exclusive, transferable and worldwide license for the
Software as set forth in Article 5 hereinafter for the whole term of the
protection granted by the rights over said Software.
Article 3 - ACCEPTANCE
3.1 The Licensee shall be deemed as having accepted the terms and
conditions of this Agreement upon the occurrence of the first of the
following events:
* (i) loading the Software by any or all means, notably, by
downloading from a remote server, or by loading from a physical
medium;
* (ii) the first time the Licensee exercises any of the rights
granted hereunder.
3.2 One copy of the Agreement, containing a notice relating to the
characteristics of the Software, to the limited warranty, and to the
fact that its use is restricted to experienced users has been provided
to the Licensee prior to its acceptance as set forth in Article 3.1
hereinabove, and the Licensee hereby acknowledges that it has read and
understood it.
Article 4 - EFFECTIVE DATE AND TERM
4.1 EFFECTIVE DATE
The Agreement shall become effective on the date when it is accepted by
the Licensee as set forth in Article 3.1.
4.2 TERM
The Agreement shall remain in force for the entire legal term of
protection of the economic rights over the Software.
Article 5 - SCOPE OF RIGHTS GRANTED
The Licensor hereby grants to the Licensee, who accepts, the following
rights over the Software for any or all use, and for the term of the
Agreement, on the basis of the terms and conditions set forth hereinafter.
Besides, if the Licensor owns or comes to own one or more patents
protecting all or part of the functions of the Software or of its
components, the Licensor undertakes not to enforce the rights granted by
these patents against successive Licensees using, exploiting or
modifying the Software. If these patents are transferred, the Licensor
undertakes to have the transferees subscribe to the obligations set
forth in this paragraph.
5.1 RIGHT OF USE
The Licensee is authorized to use the Software, without any limitation
as to its fields of application, with it being hereinafter specified
that this comprises:
1. permanent or temporary reproduction of all or part of the Software
by any or all means and in any or all form.
2. loading, displaying, running, or storing the Software on any or
all medium.
3. entitlement to observe, study or test its operation so as to
determine the ideas and principles behind any or all constituent
elements of said Software. This shall apply when the Licensee
carries out any or all loading, displaying, running, transmission
or storage operation as regards the Software, that it is entitled
to carry out hereunder.
5.2 ENTITLEMENT TO MAKE CONTRIBUTIONS
The right to make Contributions includes the right to translate, adapt,
arrange, or make any or all modifications to the Software, and the right
to reproduce the resulting software.
The Licensee is authorized to make any or all Contributions to the
Software provided that it includes an explicit notice that it is the
author of said Contribution and indicates the date of the creation thereof.
5.3 RIGHT OF DISTRIBUTION
In particular, the right of distribution includes the right to publish,
transmit and communicate the Software to the general public on any or
all medium, and by any or all means, and the right to market, either in
consideration of a fee, or free of charge, one or more copies of the
Software by any means.
The Licensee is further authorized to distribute copies of the modified
or unmodified Software to third parties according to the terms and
conditions set forth hereinafter.
5.3.1 DISTRIBUTION OF SOFTWARE WITHOUT MODIFICATION
The Licensee is authorized to distribute true copies of the Software in
Source Code or Object Code form, provided that said distribution
complies with all the provisions of the Agreement and is accompanied by:
1. a copy of the Agreement,
2. a notice relating to the limitation of both the Licensor's
warranty and liability as set forth in Articles 8 and 9,
and that, in the event that only the Object Code of the Software is
redistributed, the Licensee allows effective access to the full Source
Code of the Software at a minimum during the entire period of its
distribution of the Software, it being understood that the additional
cost of acquiring the Source Code shall not exceed the cost of
transferring the data.
5.3.2 DISTRIBUTION OF MODIFIED SOFTWARE
If the Licensee makes any Contribution to the Software, the resulting
Modified Software may be distributed under a license agreement other
than this Agreement subject to compliance with the provisions of Article
5.3.4.
5.3.3 DISTRIBUTION OF EXTERNAL MODULES
When the Licensee has developed an External Module, the terms and
conditions of this Agreement do not apply to said External Module, that
may be distributed under a separate license agreement.
5.3.4 CREDITS
Any Licensee who may distribute a Modified Software hereby expressly
agrees to:
1. indicate in the related documentation that it is based on the
Software licensed hereunder, and reproduce the intellectual
property notice for the Software,
2. ensure that written indications of the Software intended use,
intellectual property notice and license hereunder are included in
easily accessible format from the Modified Software interface,
3. mention, on a freely accessible website describing the Modified
Software, at least throughout the distribution term thereof, that
it is based on the Software licensed hereunder, and reproduce the
Software intellectual property notice,
4. where it is distributed to a third party that may distribute a
Modified Software without having to make its source code
available, make its best efforts to ensure that said third party
agrees to comply with the obligations set forth in this Article .
If the Software, whether or not modified, is distributed with an
External Module designed for use in connection with the Software, the
Licensee shall submit said External Module to the foregoing obligations.
5.3.5 COMPATIBILITY WITH THE CeCILL AND CeCILL-C LICENSES
Where a Modified Software contains a Contribution subject to the CeCILL
license, the provisions set forth in Article 5.3.4 shall be optional.
A Modified Software may be distributed under the CeCILL-C license. In
such a case the provisions set forth in Article 5.3.4 shall be optional.
Article 6 - INTELLECTUAL PROPERTY
6.1 OVER THE INITIAL SOFTWARE
The Holder owns the economic rights over the Initial Software. Any or
all use of the Initial Software is subject to compliance with the terms
and conditions under which the Holder has elected to distribute its work
and no one shall be entitled to modify the terms and conditions for the
distribution of said Initial Software.
The Holder undertakes that the Initial Software will remain ruled at
least by this Agreement, for the duration set forth in Article 4.2.
6.2 OVER THE CONTRIBUTIONS
The Licensee who develops a Contribution is the owner of the
intellectual property rights over this Contribution as defined by
applicable law.
6.3 OVER THE EXTERNAL MODULES
The Licensee who develops an External Module is the owner of the
intellectual property rights over this External Module as defined by
applicable law and is free to choose the type of agreement that shall
govern its distribution.
6.4 JOINT PROVISIONS
The Licensee expressly undertakes:
1. not to remove, or modify, in any manner, the intellectual property
notices attached to the Software;
2. to reproduce said notices, in an identical manner, in the copies
of the Software modified or not.
The Licensee undertakes not to directly or indirectly infringe the
intellectual property rights of the Holder and/or Contributors on the
Software and to take, where applicable, vis-à-vis its staff, any and all
measures required to ensure respect of said intellectual property rights
of the Holder and/or Contributors.
Article 7 - RELATED SERVICES
7.1 Under no circumstances shall the Agreement oblige the Licensor to
provide technical assistance or maintenance services for the Software.
However, the Licensor is entitled to offer this type of services. The
terms and conditions of such technical assistance, and/or such
maintenance, shall be set forth in a separate instrument. Only the
Licensor offering said maintenance and/or technical assistance services
shall incur liability therefor.
7.2 Similarly, any Licensor is entitled to offer to its licensees, under
its sole responsibility, a warranty, that shall only be binding upon
itself, for the redistribution of the Software and/or the Modified
Software, under terms and conditions that it is free to decide. Said
warranty, and the financial terms and conditions of its application,
shall be subject of a separate instrument executed between the Licensor
and the Licensee.
Article 8 - LIABILITY
8.1 Subject to the provisions of Article 8.2, the Licensee shall be
entitled to claim compensation for any direct loss it may have suffered
from the Software as a result of a fault on the part of the relevant
Licensor, subject to providing evidence thereof.
8.2 The Licensor's liability is limited to the commitments made under
this Agreement and shall not be incurred as a result of in particular:
(i) loss due the Licensee's total or partial failure to fulfill its
obligations, (ii) direct or consequential loss that is suffered by the
Licensee due to the use or performance of the Software, and (iii) more
generally, any consequential loss. In particular the Parties expressly
agree that any or all pecuniary or business loss (i.e. loss of data,
loss of profits, operating loss, loss of customers or orders,
opportunity cost, any disturbance to business activities) or any or all
legal proceedings instituted against the Licensee by a third party,
shall constitute consequential loss and shall not provide entitlement to
any or all compensation from the Licensor.
Article 9 - WARRANTY
9.1 The Licensee acknowledges that the scientific and technical
state-of-the-art when the Software was distributed did not enable all
possible uses to be tested and verified, nor for the presence of
possible defects to be detected. In this respect, the Licensee's
attention has been drawn to the risks associated with loading, using,
modifying and/or developing and reproducing the Software which are
reserved for experienced users.
The Licensee shall be responsible for verifying, by any or all means,
the suitability of the product for its requirements, its good working
order, and for ensuring that it shall not cause damage to either persons
or properties.
9.2 The Licensor hereby represents, in good faith, that it is entitled
to grant all the rights over the Software (including in particular the
rights set forth in Article 5).
9.3 The Licensee acknowledges that the Software is supplied "as is" by
the Licensor without any other express or tacit warranty, other than
that provided for in Article 9.2 and, in particular, without any warranty
as to its commercial value, its secured, safe, innovative or relevant
nature.
Specifically, the Licensor does not warrant that the Software is free
from any error, that it will operate without interruption, that it will
be compatible with the Licensee's own equipment and software
configuration, nor that it will meet the Licensee's requirements.
9.4 The Licensor does not either expressly or tacitly warrant that the
Software does not infringe any third party intellectual property right
relating to a patent, software or any other property right. Therefore,
the Licensor disclaims any and all liability towards the Licensee
arising out of any or all proceedings for infringement that may be
instituted in respect of the use, modification and redistribution of the
Software. Nevertheless, should such proceedings be instituted against
the Licensee, the Licensor shall provide it with technical and legal
assistance for its defense. Such technical and legal assistance shall be
decided on a case-by-case basis between the relevant Licensor and the
Licensee pursuant to a memorandum of understanding. The Licensor
disclaims any and all liability as regards the Licensee's use of the
name of the Software. No warranty is given as regards the existence of
prior rights over the name of the Software or as regards the existence
of a trademark.
Article 10 - TERMINATION
10.1 In the event of a breach by the Licensee of its obligations
hereunder, the Licensor may automatically terminate this Agreement
thirty (30) days after notice has been sent to the Licensee and has
remained ineffective.
10.2 A Licensee whose Agreement is terminated shall no longer be
authorized to use, modify or distribute the Software. However, any
licenses that it may have granted prior to termination of the Agreement
shall remain valid subject to their having been granted in compliance
with the terms and conditions hereof.
Article 11 - MISCELLANEOUS
11.1 EXCUSABLE EVENTS
Neither Party shall be liable for any or all delay, or failure to
perform the Agreement, that may be attributable to an event of force
majeure, an act of God or an outside cause, such as defective
functioning or interruptions of the electricity or telecommunications
networks, network paralysis following a virus attack, intervention by
government authorities, natural disasters, water damage, earthquakes,
fire, explosions, strikes and labor unrest, war, etc.
11.2 Any failure by either Party, on one or more occasions, to invoke
one or more of the provisions hereof, shall under no circumstances be
interpreted as being a waiver by the interested Party of its right to
invoke said provision(s) subsequently.
11.3 The Agreement cancels and replaces any or all previous agreements,
whether written or oral, between the Parties and having the same
purpose, and constitutes the entirety of the agreement between said
Parties concerning said purpose. No supplement or modification to the
terms and conditions hereof shall be effective as between the Parties
unless it is made in writing and signed by their duly authorized
representatives.
11.4 In the event that one or more of the provisions hereof were to
conflict with a current or future applicable act or legislative text,
said act or legislative text shall prevail, and the Parties shall make
the necessary amendments so as to comply with said act or legislative
text. All other provisions shall remain effective. Similarly, invalidity
of a provision of the Agreement, for any reason whatsoever, shall not
cause the Agreement as a whole to be invalid.
11.5 LANGUAGE
The Agreement is drafted in both French and English and both versions
are deemed authentic.
Article 12 - NEW VERSIONS OF THE AGREEMENT
12.1 Any person is authorized to duplicate and distribute copies of this
Agreement.
12.2 So as to ensure coherence, the wording of this Agreement is
protected and may only be modified by the authors of the License, who
reserve the right to periodically publish updates or new versions of the
Agreement, each with a separate number. These subsequent versions may
address new issues encountered by Free Software.
12.3 Any Software distributed under a given version of the Agreement may
only be subsequently distributed under the same version of the Agreement
or a subsequent version.
Article 13 - GOVERNING LAW AND JURISDICTION
13.1 The Agreement is governed by French law. The Parties agree to
endeavor to seek an amicable solution to any disagreements or disputes
that may arise during the performance of the Agreement.
13.2 Failing an amicable solution within two (2) months as from their
occurrence, and unless emergency proceedings are necessary, the
disagreements or disputes shall be referred to the Paris Courts having
jurisdiction, by the more diligent Party.
Version 1.0 dated 2006-09-05.

View file

@ -27,10 +27,10 @@ include_once __DIR__ . '/../bandeaux.php';
// de l'application. // de l'application.
// Affichage des balises standards // Affichage des balises standards
Utils::print_header( _("Polls administrator") ); Utils::print_header( _('Polls administrator') );
bandeau_titre(_("Polls administrator")); bandeau_titre(_('Polls administrator'));
$sondage=$connect->Execute("select * from sondage"); $sondage=$connect->Execute('SELECT * FROM sondage');
echo' echo'
<form action="' . Utils::get_server_name() . 'admin/index.php" method="POST">'."\n"; <form action="' . Utils::get_server_name() . 'admin/index.php" method="POST">'."\n";
@ -40,8 +40,8 @@ while($dsondage = $sondage->FetchNextObject(false)) {
echo ' echo '
<div class="alert alert-warning text-center"> <div class="alert alert-warning text-center">
<h3>'. _("Confirm removal of the poll ") .'"'.$dsondage->id_sondage.'</h3> <h3>'. _("Confirm removal of the poll ") .'"'.$dsondage->id_sondage.'</h3>
<p><button class="btn btn-default" type="submit" value="1" name="annullesuppression">'._("Keep this poll!").'</button> <p><button class="btn btn-default" type="submit" value="1" name="annullesuppression">'._('Keep this poll!').'</button>
<button type="submit" name="confirmesuppression'.$dsondage->id_sondage.'" value="1" class="btn btn-danger">'._("Remove this poll!").'</button></p> <button type="submit" name="confirmesuppression'.$dsondage->id_sondage.'" value="1" class="btn btn-danger">'._('Remove this poll!').'</button></p>
</div>'; </div>';
} }
@ -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(); $nbsondages=$sondage->RecordCount();
$btn_logs = (is_readable('logs_studs.txt')) ? '<a role="button" class="btn btn-default btn-xs pull-right" href="'.str_replace('/admin','', Utils::get_server_name()).'admin/logs_studs.txt">'. _("Logs") .'</a>' : ''; $btn_logs = (is_readable('logs_studs.txt')) ? '<a role="button" class="btn btn-default btn-xs pull-right" href="'.str_replace('/admin','', Utils::get_server_name()).'admin/logs_studs.txt">'. _("Logs") .'</a>' : '';
@ -67,24 +67,24 @@ echo '<p>' . $nbsondages. ' ' . _("polls in the database at this time") . $btn_l
// tableau qui affiche tous les sondages de la base // tableau qui affiche tous les sondages de la base
echo '<table class="table table-bordered"> echo '<table class="table table-bordered">
<tr align="center"> <tr align="center">
<th scope="col">'. _("Poll ID") .'</th> <th scope="col">'. _('Poll ID') .'</th>
<th scope="col">'. _("Format") .'</th> <th scope="col">'. _('Format') .'</th>
<th scope="col">'. _("Title") .'</th> <th scope="col">'. _('Title') .'</th>
<th scope="col">'. _("Author") .'</th> <th scope="col">'. _('Author') .'</th>
<th scope="col">'. _("Email") .'</th> <th scope="col">'. _('Email') .'</th>
<th scope="col">'. _("Expiration's date") .'</th> <th scope="col">'. _('Expiration\'s date') .'</th>
<th scope="col">'. _("Users") .'</th> <th scope="col">'. _('Users') .'</th>
<th scope="col" colspan="3">'. _("Actions") .'</th> <th scope="col" colspan="3">'. _('Actions') .'</th>
</tr>'."\n"; </tr>'."\n";
$i = 0; $i = 0;
while($dsondage = $sondage->FetchNextObject(false)) { while($dsondage = $sondage->FetchNextObject(false)) {
/* possible en 1 bonne requête dans $sondage */ /* possible en 1 bonne requête dans $sondage */
$sujets=$connect->Execute( "select * from sujet_studs where id_sondage='$dsondage->id_sondage'"); $subjects = $connect->Execute("SELECT * FROM sujet_studs WHERE id_sondage='$dsondage->id_sondage'");
$dsujets=$sujets->FetchObject(false); $dsujets = $subjects->FetchObject(false);
$user_studs=$connect->Execute( "select * from user_studs where id_sondage='$dsondage->id_sondage'"); $user_studs = $connect->Execute("SELECT * from user_studs WHERE id_sondage='$dsondage->id_sondage'");
$nbuser=$user_studs->RecordCount(); $nb_users = $user_studs->RecordCount();
echo ' echo '
<tr align="center"> <tr align="center">
@ -95,19 +95,19 @@ while($dsondage = $sondage->FetchNextObject(false)) {
<td>'.stripslashes($dsondage->mail_admin).'</td>'; <td>'.stripslashes($dsondage->mail_admin).'</td>';
if (strtotime($dsondage->date_fin) > time()) { if (strtotime($dsondage->date_fin) > time()) {
echo ' echo '<td>'.date('d/m/y', strtotime($dsondage->date_fin)).'</td>';
<td>'.date("d/m/y",strtotime($dsondage->date_fin)).'</td>';
} else { } else {
echo ' echo '<td><span class="text-danger">'
<td><span class="text-danger">'.date("d/m/y",strtotime($dsondage->date_fin)).'</span></td>'; . date('d/m/y', strtotime($dsondage->date_fin))
. '</span></td>';
} }
echo ' echo '
<td>'.$nbuser.'</td> <td>'.$nb_users.'</td>
<td><a href="' . Utils::getUrlSondage($dsondage->id_sondage) . '" class="btn btn-link" title="'. _("See the poll") .'"><span class="glyphicon glyphicon-eye-open"></span><span class="sr-only">' . _("See the poll") . '</span></a></td> <td><a href="' . Utils::getUrlSondage($dsondage->id_sondage) . '" class="btn btn-link" title="'. _('See the poll') .'"><span class="glyphicon glyphicon-eye-open"></span><span class="sr-only">' . _('See the poll') . '</span></a></td>
<td><a href="' . Utils::getUrlSondage($dsondage->id_sondage_admin, true) . '" class="btn btn-link" title="'. _("Change the poll") .'"><span class="glyphicon glyphicon-pencil"></span><span class="sr-only">' . _("Change the poll") . '</span></a></td> <td><a href="' . Utils::getUrlSondage($dsondage->id_sondage_admin, true) . '" class="btn btn-link" title="'. _('Change the poll') .'"><span class="glyphicon glyphicon-pencil"></span><span class="sr-only">' . _("Change the poll") . '</span></a></td>
<td><button type="submit" name="supprimersondage'.$dsondage->id_sondage.'" value="'. _("Remove the poll") .'" class="btn btn-link" title="'. _("Remove the poll") .'"><span class="glyphicon glyphicon-trash text-danger"></span><span class="sr-only">' . _("Remove the poll") . '</span></td> <td><button type="submit" name="supprimersondage'.$dsondage->id_sondage.'" value="'. _('Remove the poll') .'" class="btn btn-link" title="'. _("Remove the poll") .'"><span class="glyphicon glyphicon-trash text-danger"></span><span class="sr-only">' . _('Remove the poll') . '</span></td>
</tr>'."\n"; </tr>'."\n";
$i++; ++$i;
} }
echo '</table></form>'."\n"; echo '</table></form>'."\n";
@ -115,5 +115,6 @@ echo '</table></form>'."\n";
bandeau_pied(true); bandeau_pied(true);
// si on annule la suppression, rafraichissement de la page // si on annule la suppression, rafraichissement de la page
if (Utils::issetAndNoEmpty('annulesuppression') === true) { /*if (Utils::issetAndNoEmpty('annulesuppression') === true) {
} // TODO
}*/

View file

@ -29,13 +29,49 @@ if (file_exists('bandeaux_local.php')) {
include_once('bandeaux.php'); include_once('bandeaux.php');
} }
function getChoicesFromPOST($nbColumns)
{
$choices = array();
for ($i=0; $i < $nbColumns; ++$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');
PHP Fatal error: Class 'Framadate\Exception' not found */
}
$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 // Initialisation des variables
$numsondageadmin = false; $numsondageadmin = false;
$sondage = false; $sondage = false;
// recuperation du numero de sondage admin (24 car.) dans l'URL // recuperation du numero de sondage admin (24 car.) dans l'URL
if (Utils::issetAndNoEmpty('sondage', $_GET) && is_string($_GET['sondage']) && strlen($_GET['sondage']) === 24) { 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.) //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);
} }
@ -50,7 +86,7 @@ if (preg_match(";[\w\d]{24};i", $numsondageadmin)) {
$sql = $connect->Prepare($sql); $sql = $connect->Prepare($sql);
$sujets = $connect->Execute($sql, array($numsondage)); $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); $sql = $connect->Prepare($sql);
$user_studs = $connect->Execute($sql, array($numsondage)); $user_studs = $connect->Execute($sql, array($numsondage));
} }
@ -86,21 +122,21 @@ function send_mail_admin() {
global $numsondageadmin; global $numsondageadmin;
global $smtp_allowed; global $smtp_allowed;
if($smtp_allowed == true) { if($smtp_allowed == true) {
if(!isset($_SESSION["mail_admin_sent"])) { if(!isset($_SESSION['mail_admin_sent'])) {
Utils::sendEmail( $email_admin, Utils::sendEmail( $email_admin,
_("[ADMINISTRATOR] New settings for your poll") . ' ' . stripslashes( $poll_title ), _("[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" . " :\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é //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) { if (Utils::issetAndNoEmpty('nouveautitre') === false) {
$err |= TITLE_EMPTY; $err |= TITLE_EMPTY;
} else { } else {
@ -155,12 +191,9 @@ if (isset($_POST["boutonnouvelleadresse"])) {
//New poll rules //New poll rules
if (isset($_POST["btn_poll_rules"])) { if (isset($_POST["btn_poll_rules"])) {
echo '<!-- '; print_r($_POST); echo ' -->'; echo '<!-- '; print_r($_POST); 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 //Update SQL database with new rules
@ -177,10 +210,10 @@ if (isset($_POST["btn_poll_rules"])) {
$dsujet=$sujets->FetchObject(false); $dsujet=$sujets->FetchObject(false);
$dsondage=$sondage->FetchObject(false); $dsondage=$sondage->FetchObject(false);
if (isset($_POST["ajoutsujet"])) { if (isset($_POST['ajoutsujet'])) {
Utils::print_header( _("Add a column") .' - ' . stripslashes( $dsondage->titre )); 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 //on recupere les données et les sujets du sondage
@ -201,14 +234,14 @@ if (isset($_POST["ajoutsujet"])) {
} else { } else {
//ajout d'une date avec creneau horaire //ajout d'une date avec creneau horaire
echo ' echo '
<p>'. _("You can add a new scheduling date to your poll.").'<br />'._("If you just want to add a new hour to an existant date, put the same date and choose a new hour.") .'</p> <p>'. _('You can add a new scheduling date to your poll.').'<br />'._('If you just want to add a new hour to an existant date, put the same date and choose a new hour.') .'</p>
<div class="form-group"> <div class="form-group">
<label for="newdate" class="col-md-4">'. _("Day") .'</label> <label for="newdate" class="col-md-4">'. _("Day") .'</label>
<div class="col-md-8"> <div class="col-md-8">
<div class="input-group date"> <div class="input-group date">
<span class="input-group-addon"><i class="glyphicon glyphicon-calendar"></i></span> <span class="input-group-addon"><i class="glyphicon glyphicon-calendar"></i></span>
<input type="text" id="newdate" data-date-format="'. _("dd/mm/yyyy") .'" aria-describedby="dateformat" name="newdate" class="form-control" placeholder="'. _("dd/mm/yyyy") .'" /> <input type="text" id="newdate" data-date-format="'. _('dd/mm/yyyy') .'" aria-describedby="dateformat" name="newdate" class="form-control" placeholder="'. _("dd/mm/yyyy") .'" />
</div> </div>
<span id="dateformat" class="sr-only">'. _("(dd/mm/yyyy)") .'</span> <span id="dateformat" class="sr-only">'. _("(dd/mm/yyyy)") .'</span>
</div> </div>
@ -243,8 +276,8 @@ if (isset($_POST["suppressionsondage"])) {
<form name="formulaire" action="' . Utils::getUrlSondage($numsondageadmin, true) . '" method="POST"> <form name="formulaire" action="' . Utils::getUrlSondage($numsondageadmin, true) . '" method="POST">
<div class="alert alert-warning text-center"> <div class="alert alert-warning text-center">
<h2>' . _("Confirm removal of your poll") . '</h2> <h2>' . _("Confirm removal of your poll") . '</h2>
<p><button class="btn btn-default" type="submit" value="" name="annullesuppression">'._("Keep this poll!").'</button> <p><button class="btn btn-default" type="submit" value="" name="annullesuppression">'._('Keep this poll!').'</button>
<button type="submit" name="confirmesuppression" value="" class="btn btn-danger">'._("Remove this poll!").'</button></p> <button type="submit" name="confirmesuppression" value="" class="btn btn-danger">'._('Remove this poll!').'</button></p>
</div> </div>
</form>'; </form>';
@ -281,11 +314,11 @@ if (isset($_POST["confirmesuppression"])) {
//affichage de l'ecran de confirmation de suppression de sondage //affichage de l'ecran de confirmation de suppression de sondage
Utils::print_header(_("Your poll has been removed!")); Utils::print_header(_("Your poll has been removed!"));
bandeau_titre(_("Make your polls")); bandeau_titre(_('Make your polls'));
echo ' echo '
<div class="alert alert-success text-center"> <div class="alert alert-success text-center">
<h2>' . _("Your poll has been removed!") . '</h2> <h2>' . _('Your poll has been removed!') . '</h2>
<p>' . _('Back to the homepage of ') . ' <a href="' . Utils::get_server_name() . '"> ' . NOMAPPLICATION . '</a></p> <p>' . _('Back to the homepage of ') . ' <a href="' . Utils::get_server_name() . '"> ' . NOMAPPLICATION . '</a></p>
</div> </div>
</form>'."\n"; </form>'."\n";
@ -320,7 +353,7 @@ if (isset($_POST['ajoutcomment'])) {
while ( $dcomment_user_doublon=$comment_user_doublon->FetchNextObject(false)) { while ( $dcomment_user_doublon=$comment_user_doublon->FetchNextObject(false)) {
if($dcomment_user_doublon->comment == $comment && $dcomment_user_doublon->usercomment == $comment_user) { if($dcomment_user_doublon->comment == $comment && $dcomment_user_doublon->usercomment == $comment_user) {
$comment_doublon = true; $comment_doublon = true;
}; }
} }
} }
@ -342,31 +375,20 @@ if (isset($_POST['ajoutcomment'])) {
$nbcolonnes = substr_count($dsujet->sujet, ',') + 1; $nbcolonnes = substr_count($dsujet->sujet, ',') + 1;
$nblignes = $user_studs->RecordCount(); $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é //action si le bouton participer est cliqué
if (isset($_POST["boutonp"])) { if (isset($_POST["boutonp"])) {
//si on a un nom dans la case texte //si on a un nom dans la case texte
if (Utils::issetAndNoEmpty('nom')){ if (Utils::issetAndNoEmpty('nom')){
$nouveauchoix = ''; $nouveauchoix = getNewChoiceFromPOST($nbcolonnes);
$erreur_prenom = false; $erreur_prenom = false;
for ($i=0;$i<$nbcolonnes;$i++){ $nom = htmlentities(html_entity_decode($_POST['nom'], ENT_QUOTES, 'UTF-8'), ENT_QUOTES, 'UTF-8');
// 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');
while($user = $user_studs->FetchNextObject(false)) { while($user = $user_studs->FetchNextObject(false)) {
if ($nom == $user->nom) { if ($nom == $user->nom) {
$erreur_prenom="yes"; $erreur_prenom = 'yes';
} }
} }
@ -385,12 +407,12 @@ if (isset($_POST["boutonp"])) {
//action quand on ajoute une colonne au format AUTRE //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; $nouveauxsujets=$dsujet->sujet;
//on rajoute la valeur a la fin de tous les sujets deja entrés //on rajoute la valeur a la fin de tous les sujets deja entrés
$nouveauxsujets.=","; $nouveauxsujets .= ',';
$nouveauxsujets.=str_replace(","," ",$_POST["nouvellecolonne"]); $nouveauxsujets .= str_replace(',', ' ', $_POST['nouvellecolonne']);
$nouveauxsujets = htmlentities(html_entity_decode($nouveauxsujets, ENT_QUOTES, 'UTF-8'), ENT_QUOTES, 'UTF-8'); $nouveauxsujets = htmlentities(html_entity_decode($nouveauxsujets, ENT_QUOTES, 'UTF-8'), ENT_QUOTES, 'UTF-8');
//mise a jour avec les nouveaux sujets dans la base //mise a jour avec les nouveaux sujets dans la base
@ -403,19 +425,18 @@ if (isset($_POST["ajoutercolonne"]) && Utils::issetAndNoEmpty('nouvellecolonne')
//action quand on ajoute une colonne au format DATE //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; $nouveauxsujets=$dsujet->sujet;
if (isset($_POST["newdate"]) && $_POST["newdate"] != "vide") { 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)); $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"){ if (isset($_POST['newhour']) && $_POST['newhour'] != 'vide') {
$nouvelledate.="@"; $nouvelledate .= '@' . $_POST['newhour'];
$nouvelledate.=$_POST["newhour"];
} }
//on rajoute la valeur dans les valeurs //on rajoute la valeur dans les valeurs
$datesbase = explode(",",$dsujet->sujet); $datesbase = explode(',', $dsujet->sujet);
$taillebase = sizeof($datesbase); $taillebase = sizeof($datesbase);
//recherche de l'endroit de l'insertion de la nouvelle date dans les dates deja entrées dans le tableau //recherche de l'endroit de l'insertion de la nouvelle date dans les dates deja entrées dans le tableau
@ -424,7 +445,7 @@ if (isset($_POST["ajoutercolonne"]) && (substr($dsondage->format, 0, 1) == "D"))
} elseif ($nouvelledate > $datesbase[$taillebase-1]) { } elseif ($nouvelledate > $datesbase[$taillebase-1]) {
$cleinsertion = count($datesbase); $cleinsertion = count($datesbase);
} else { } else {
for ($i = 0; $i < count($datesbase); $i++) { for ($i = 0; $i < count($datesbase); ++$i) {
$j = $i + 1; $j = $i + 1;
if ($nouvelledate > $datesbase[$i] && $nouvelledate < $datesbase[$j]) { if ($nouvelledate > $datesbase[$i] && $nouvelledate < $datesbase[$j]) {
$cleinsertion = $j; $cleinsertion = $j;
@ -435,12 +456,11 @@ if (isset($_POST["ajoutercolonne"]) && (substr($dsondage->format, 0, 1) == "D"))
array_splice($datesbase, $cleinsertion, 0, $nouvelledate); array_splice($datesbase, $cleinsertion, 0, $nouvelledate);
$cle = array_search($nouvelledate, $datesbase); $cle = array_search($nouvelledate, $datesbase);
$dateinsertion = ''; $dateinsertion = '';
for ($i = 0; $i < count($datesbase); $i++) { for ($i = 0; $i < count($datesbase); ++$i) {
$dateinsertion.=","; $dateinsertion .= ',' . $datesbase[$i];
$dateinsertion.=$datesbase[$i];
} }
$dateinsertion = substr("$dateinsertion", 1); $dateinsertion = substr($dateinsertion, 1);
//mise a jour avec les nouveaux sujets dans la base //mise a jour avec les nouveaux sujets dans la base
//if (isset($erreur_ajout_date) && !$erreur_ajout_date){ //if (isset($erreur_ajout_date) && !$erreur_ajout_date){
@ -464,12 +484,12 @@ if (isset($_POST["ajoutercolonne"]) && (substr($dsondage->format, 0, 1) == "D"))
$newcar = ''; $newcar = '';
//parcours de toutes les réponses actuelles //parcours de toutes les réponses actuelles
for ($j = 0; $j < $nbcolonnes; $j++) { for ($j = 0; $j < $nbcolonnes; ++$j) {
$car = substr($ensemblereponses,$j,1); $car = substr($ensemblereponses,$j,1);
//si les reponses ne concerne pas la colonne ajoutée, on concatene //si les reponses ne concerne pas la colonne ajoutée, on concatene
if ($j == $cle) { if ($j == $cle) {
$newcar.="0"; $newcar.='0';
} }
$newcar .= $car; $newcar .= $car;
@ -485,14 +505,14 @@ if (isset($_POST["ajoutercolonne"]) && (substr($dsondage->format, 0, 1) == "D"))
send_mail_admin(); send_mail_admin();
} else { } else {
$erreur_ajout_date="yes"; $erreur_ajout_date = 'yes';
} }
} }
//suppression de ligne dans la base //suppression de ligne dans la base
for ($i = 0; $i < $nblignes; $i++) { for ($i = 0; $i < $nblignes; ++$i) {
if (isset($_POST["effaceligne$i"])) { if (isset($_POST['effaceligne'. $i])) {
$compteur = 0; $compteur = 0;
$sql = 'DELETE FROM user_studs WHERE nom = '.$connect->Param('nom').' AND id_users = '.$connect->Param('id_users'); $sql = 'DELETE FROM user_studs WHERE nom = '.$connect->Param('nom').' AND id_users = '.$connect->Param('id_users');
$sql = $connect->Prepare($sql); $sql = $connect->Prepare($sql);
@ -502,7 +522,7 @@ for ($i = 0; $i < $nblignes; $i++) {
$connect->Execute($sql, array($data->nom, $data->id_users)); $connect->Execute($sql, array($data->nom, $data->id_users));
} }
$compteur++; ++$compteur;
} }
} }
} }
@ -520,7 +540,7 @@ while ($dcomment = $comment_user->FetchNextObject(false)) {
$connect->Execute($sql, array($dcomment->id_comment)); $connect->Execute($sql, array($dcomment->id_comment));
} }
$i++; ++$i;
} }
@ -528,53 +548,43 @@ while ($dcomment = $comment_user->FetchNextObject(false)) {
$testmodifier = false; $testmodifier = false;
$testligneamodifier = false; $testligneamodifier = false;
for ($i = 0; $i < $nblignes; $i++) { for ($i = 0; $i < $nblignes; ++$i) {
if (isset($_POST["modifierligne$i"])) { if (isset($_POST['modifierligne'. $i])) {
$ligneamodifier = $i; $ligneamodifier = $i;
$testligneamodifier="true"; $testligneamodifier = 'true';
} }
//test pour voir si une ligne est a modifier //test pour voir si une ligne est à modifier
if (isset($_POST["validermodifier$i"])) { if (isset($_POST['validermodifier'. $i])) {
$modifier = $i; $modifier = $i;
$testmodifier="true"; $testmodifier = 'true';
} }
} }
//si le test est valide alors on affiche des checkbox pour entrer de nouvelles valeurs //si le test est valide alors on affiche des checkbox pour entrer de nouvelles valeurs
if ($testmodifier) { if ($testmodifier) {
$nouveauchoix = ''; $nouveauchoix = getNewChoiceFromPOST($nbcolonnes);
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;
}
}
}
$compteur = 0; $compteur = 0;
while ($data = $user_studs->FetchNextObject(false)) { while ($data = $user_studs->FetchNextObject(false)) {
//mise a jour des données de l'utilisateur dans la base SQL //mise à jour des données de l'utilisateur dans la base SQL
if ($compteur==$modifier) { 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 = 'UPDATE user_studs SET reponses = '.$connect->Param('reponses').' WHERE nom = '.$connect->Param('nom').' AND id_users = '.$connect->Param('id_users');
$sql = $connect->Prepare($sql); $sql = $connect->Prepare($sql);
$connect->Execute($sql, array($nouveauchoix, $data->nom, $data->id_users)); $connect->Execute($sql, array($nouveauchoix, $data->nom, $data->id_users));
} }
$compteur++; ++$compteur;
} }
} }
//suppression de colonnes dans la base //suppression de colonnes dans la base
for ($i = 0; $i < $nbcolonnes; $i++) { for ($i = 0; $i < $nbcolonnes; ++$i) {
if ((isset($_POST["effacecolonne$i"])) && $nbcolonnes > 1){ if ((isset($_POST['effacecolonne' .$i])) && $nbcolonnes > 1) {
$toutsujet = explode(",",$dsujet->sujet); $toutsujet = explode(',', $dsujet->sujet);
//sort($toutsujet, SORT_NUMERIC); //sort($toutsujet, SORT_NUMERIC);
$j = 0; $j = 0;
$nouveauxsujets = ''; $nouveauxsujets = '';
@ -583,17 +593,16 @@ for ($i = 0; $i < $nbcolonnes; $i++) {
while (isset($toutsujet[$j])) { while (isset($toutsujet[$j])) {
//si le sujet n'est pas celui qui a été effacé alors on concatene //si le sujet n'est pas celui qui a été effacé alors on concatene
if ($i != $j) { if ($i != $j) {
$nouveauxsujets .= ','; $nouveauxsujets .= ',' . $toutsujet[$j];
$nouveauxsujets .= $toutsujet[$j];
} }
$j++; ++$j;
} }
//on enleve la virgule au début //on enlève la virgule au début
$nouveauxsujets = substr("$nouveauxsujets", 1); $nouveauxsujets = substr($nouveauxsujets, 1);
//nettoyage des reponses actuelles correspondant au sujet effacé //nettoyage des réponses actuelles correspondant au sujet effacé
$compteur = 0; $compteur = 0;
$sql = 'UPDATE user_studs SET reponses = '.$connect->Param('reponses').' WHERE nom = '.$connect->Param('nom').' AND id_users = '.$connect->Param('id_users'); $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); $sql = $connect->Prepare($sql);
@ -603,7 +612,7 @@ for ($i = 0; $i < $nbcolonnes; $i++) {
$ensemblereponses = $data->reponses; $ensemblereponses = $data->reponses;
//parcours de toutes les réponses actuelles //parcours de toutes les réponses actuelles
for ($j = 0; $j < $nbcolonnes; $j++) { for ($j = 0; $j < $nbcolonnes; ++$j) {
$car=substr($ensemblereponses, $j, 1); $car=substr($ensemblereponses, $j, 1);
//si les reponses ne concerne pas la colonne effacée, on concatene //si les reponses ne concerne pas la colonne effacée, on concatene
if ($i != $j) { if ($i != $j) {
@ -611,13 +620,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)); $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 = 'UPDATE sujet_studs SET sujet = '.$connect->Param('nouveauxsujets').' WHERE id_sondage = '.$connect->Param('numsondage');
$sql = $connect->Prepare($sql); $sql = $connect->Prepare($sql);
$connect->Execute($sql, array($nouveauxsujets, $numsondage)); $connect->Execute($sql, array($nouveauxsujets, $numsondage));
@ -639,13 +648,12 @@ if ($sondage !== false) {
$sql = $connect->Prepare($sql); $sql = $connect->Prepare($sql);
$user_studs = $connect->Execute($sql, array($numsondage)); $user_studs = $connect->Execute($sql, array($numsondage));
} else { } else {
Utils::print_header(_("Error!")); Utils::print_header(_("Error!"));
bandeau_titre(_("Error!")); bandeau_titre(_("Error!"));
echo ' echo '
<div class="alert alert-warning"> <div class="alert alert-warning">
<h2>' . _("This poll doesn't exist !") . '</h2> <h2>' . _('This poll doesn\'t exist !') . '</h2>
<p>' . _('Back to the homepage of ') . ' <a href="' . Utils::get_server_name() . '"> ' . NOMAPPLICATION . '</a></p> <p>' . _('Back to the homepage of ') . ' <a href="' . Utils::get_server_name() . '"> ' . NOMAPPLICATION . '</a></p>
</div>'."\n"; </div>'."\n";
@ -656,35 +664,44 @@ if ($sondage !== false) {
// Errors // Errors
$errors = ''; $errors = '';
if ((isset($_POST["boutonp"])) && $_POST["nom"] == "") { if ((isset($_POST['boutonp'])) && $_POST['nom'] == '') {
$errors .= '<li>' . _("Enter a name") . '</li>'; $errors .= '<li>' . _('Enter a name') . '</li>';
} }
if (isset($erreur_prenom) && $erreur_prenom) { if (isset($erreur_prenom) && $erreur_prenom) {
$errors .= '<li>' . _("The name you've chosen already exist in this poll!") . '</li>'; $errors .= '<li>' . _('The name you\'ve chosen already exist in this poll!') . '</li>';
} }
if (isset($erreur_injection) && $erreur_injection) { if (isset($erreur_injection) && $erreur_injection) {
$errors .= '<li>' . _("Characters \" ' < et > are not permitted") . '</li>'; $errors .= '<li>' . _("Characters \" ' < et > are not permitted") . '</li>';
} }
if (isset($erreur_ajout_date) && $erreur_ajout_date) { if (isset($erreur_ajout_date) && $erreur_ajout_date) {
$errors .= '<li>' . _("The date is not correct !") . '</li>'; $errors .= '<li>' . _('The date is not correct!') . '</li>';
} }
//Poll title, description and email values //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 ); $title = (isset($_POST['boutonnouveautitre']) && Utils::issetAndNoEmpty('nouveautitre'))
$description = (isset($_POST["nouveauxcommentaires"])) ? stripslashes(htmlentities(html_entity_decode($_POST['nouveauxcommentaires'], ENT_QUOTES, 'UTF-8'), ENT_QUOTES, 'UTF-8')) : stripslashes( $dsondage->commentaires ); ? htmlentities(html_entity_decode($_POST['nouveautitre'], ENT_QUOTES, 'UTF-8'), ENT_QUOTES, 'UTF-8')
$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 ); : 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 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 = (isset($_POST['poll_rules']) && Utils::issetAndNoEmpty('btn_poll_rules'))
$poll_rules_opt1 = '';$poll_rules_opt2 = '';$poll_rules_opt3 = ''; ? $_POST['poll_rules'] : substr($dsondage->format, 1, 1);
$poll_rules_opt1 = '';
$poll_rules_opt2 = '';
$poll_rules_opt3 = '';
if($poll_rules == '+') { if($poll_rules == '+') {
$poll_rules_text = '<span class="glyphicon glyphicon-edit"></span> '. _("Votes are editable"); $poll_rules_text = '<span class="glyphicon glyphicon-edit"></span> '. _('Votes are editable');
$poll_rules_opt3 = 'selected'; $poll_rules_opt3 = 'selected';
} elseif($poll_rules == '-') { } elseif($poll_rules == '-') {
$poll_rules_text = '<span class="glyphicon glyphicon-lock"></span> '. _("Votes and comments are locked"); $poll_rules_text = '<span class="glyphicon glyphicon-lock"></span> '. _('Votes and comments are locked');
$poll_rules_opt1 = 'selected'; $poll_rules_opt1 = 'selected';
} else { } else {
$poll_rules_text = '<span class="glyphicon glyphicon-check"></span> '. _("Votes and comments are open"); $poll_rules_text = '<span class="glyphicon glyphicon-check"></span> '. _('Votes and comments are open');
$poll_rules_opt2 = 'selected'; $poll_rules_opt2 = 'selected';
} }
@ -693,7 +710,6 @@ if ($errors!='') {
bandeau_titre(_("Error!")); bandeau_titre(_("Error!"));
echo '<div class="alert alert-danger"><ul class="list-unstyled">'.$errors.'</ul></div>'."\n"; echo '<div class="alert alert-danger"><ul class="list-unstyled">'.$errors.'</ul></div>'."\n";
} else { } else {
Utils::print_header(_('Poll administration').' - '.$title); Utils::print_header(_('Poll administration').' - '.$title);
bandeau_titre(_('Poll administration').' - '.$title); bandeau_titre(_('Poll administration').' - '.$title);
@ -723,13 +739,13 @@ echo '
<button onclick="javascript:print(); return false;" class="btn btn-default"><span class="glyphicon glyphicon-print"></span> ' . _('Print') . '</button> <button onclick="javascript:print(); return false;" class="btn btn-default"><span class="glyphicon glyphicon-print"></span> ' . _('Print') . '</button>
<button onclick="window.location.href=\'' . Utils::get_server_name() . 'exportcsv.php?numsondage=' . $numsondage . '\';return false;" class="btn btn-default"><span class="glyphicon glyphicon-download-alt"></span> ' . _('Export to CSV') . '</button> <button onclick="window.location.href=\'' . Utils::get_server_name() . 'exportcsv.php?numsondage=' . $numsondage . '\';return false;" class="btn btn-default"><span class="glyphicon glyphicon-download-alt"></span> ' . _('Export to CSV') . '</button>
<button type="button" class="btn btn-danger dropdown-toggle" data-toggle="dropdown"> <button type="button" class="btn btn-danger dropdown-toggle" data-toggle="dropdown">
<span class="glyphicon glyphicon-trash"></span> <span class="sr-only">' . _("Remove") . '</span> <span class="caret"></span> <span class="glyphicon glyphicon-trash"></span> <span class="sr-only">' . _('Remove') . '</span> <span class="caret"></span>
</button> </button>
<ul class="dropdown-menu" role="menu"> <ul class="dropdown-menu" role="menu">
<li><button class="btn btn-link" type="submit" name="removevotes">' . _('Remove all the votes') . '</button></li> <li><button class="btn btn-link" type="submit" name="removevotes">' . _('Remove all the votes') . '</button></li>
<li><button class="btn btn-link" type="submit" name="removecomments">' . _('Remove all the comments') . '</button></li> <li><button class="btn btn-link" type="submit" name="removecomments">' . _('Remove all the comments') . '</button></li>
<li class="divider" role="presentation"></li> <li class="divider" role="presentation"></li>
<li><button class="btn btn-link" type="submit" id="suppressionsondage" name="suppressionsondage" value="" >'. _("Remove the poll") .'</button></li> <li><button class="btn btn-link" type="submit" id="suppressionsondage" name="suppressionsondage" value="" >'. _('Remove the poll') .'</button></li>
</ul> </ul>
</div> </div>
</div> </div>
@ -810,8 +826,8 @@ $dsujet=$sujets->FetchObject(false);
$dsondage=$sondage->FetchObject(false); $dsondage=$sondage->FetchObject(false);
//reformatage des données des sujets du sondage //reformatage des données des sujets du sondage
$toutsujet=explode(",",$dsujet->sujet); $toutsujet = explode(',', $dsujet->sujet);
$toutsujet=str_replace("°","'",$toutsujet); $toutsujet = str_replace('°', '\'',$toutsujet);
$nbcolonnes = substr_count($dsujet->sujet,',') +1; $nbcolonnes = substr_count($dsujet->sujet,',') +1;
// Table headers // Table headers
@ -825,7 +841,7 @@ $td_headers = array(); // for a11y, headers="M1 D4 H5" on each td
$radio_title = array(); // date for $radio_title = array(); // date for
// Dates poll // Dates poll
if (substr($dsondage->format, 0, 1)=="D") { if (substr($dsondage->format, 0, 1) == 'D') {
$tr_months = '<tr><th role="presentation"></th>'; $tr_months = '<tr><th role="presentation"></th>';
$tr_days = '<tr><th role="presentation"></th>'; $tr_days = '<tr><th role="presentation"></th>';
@ -835,14 +851,14 @@ if (substr($dsondage->format, 0, 1)=="D") {
$colspan_month = 1; $colspan_month = 1;
$colspan_day = 1; $colspan_day = 1;
for ($i = 0; $i < count($toutsujet); $i++) { for ($i = 0; $i < count($toutsujet); ++$i) {
// Current date // Current date
$current = $toutsujet[$i];//format date@hour. ex : 2020292820@10:00 $current = $toutsujet[$i];//format date@hour. ex : 2020292820@10:00
$horoCur = explode("@",$current); //horoCur[0] = date, horoCur[1] = hour $horoCur = explode("@",$current); //horoCur[0] = date, horoCur[1] = hour
if (isset($toutsujet[$i+1])){ if (isset($toutsujet[$i+1])){
$next = $toutsujet[$i+1]; $next = $toutsujet[$i+1];
$horoNext = explode("@",$next); $horoNext = explode('@', $next);
} }
$border[$i] = false; $border[$i] = false;
$radio_title[$i] = strftime($date_format['txt_short'],$horoCur[0]); $radio_title[$i] = strftime($date_format['txt_short'],$horoCur[0]);
@ -862,7 +878,7 @@ if (substr($dsondage->format, 0, 1)=="D") {
$td_headers[$i] .= ' D'.($i+1-$colspan_day); $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])){ 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 { } else {
$rbd = ($border[$i]) ? ' rbd' : ''; $rbd = ($border[$i]) ? ' rbd' : '';
$tr_days .= '<th colspan="'.$colspan_day.'" class="bg-primary day'.$rbd.'" id="D'.($i+1-$colspan_day).'">'.strftime($date_format['txt_day'],$horoCur[0]).'</th>'; $tr_days .= '<th colspan="'.$colspan_day.'" class="bg-primary day'.$rbd.'" id="D'.($i+1-$colspan_day).'">'.strftime($date_format['txt_day'],$horoCur[0]).'</th>';
@ -871,7 +887,7 @@ if (substr($dsondage->format, 0, 1)=="D") {
// Hours // Hours
$rbd = ($border[$i]) ? ' rbd' : ''; $rbd = ($border[$i]) ? ' rbd' : '';
if ($horoCur[1] !== "") { if (isset($horoCur[1]) && $horoCur[1] !== '') {
$tr_hours .= '<th class="bg-info'.$rbd.'" id="H'.$i.'" title="'.$horoCur[1].'">'.$horoCur[1].'</th>'; $tr_hours .= '<th class="bg-info'.$rbd.'" id="H'.$i.'" title="'.$horoCur[1].'">'.$horoCur[1].'</th>';
$radio_title[$i] .= ' - '.$horoCur[1]; $radio_title[$i] .= ' - '.$horoCur[1];
$td_headers[$i] .= ' H'.$i; $td_headers[$i] .= ' H'.$i;
@ -880,7 +896,9 @@ if (substr($dsondage->format, 0, 1)=="D") {
} }
// Remove col // Remove col
$tr_add_remove_col .= (count($toutsujet) > 2 ) ? '<td headers="'.$td_headers[$i].'"><button type="submit" name="effacecolonne'.$i.'" class="btn btn-link btn-sm" title="' . _('Remove the column') . ' ' .$radio_title[$i]. '"><span class="glyphicon glyphicon-remove text-danger"></span><span class="sr-only">'. _("Remove") .'</span></button></td>' : '<td role="presentation"></td>'; $tr_add_remove_col .= (count($toutsujet) > 2 )
? '<td headers="'.$td_headers[$i].'"><button type="submit" name="effacecolonne'.$i.'" class="btn btn-link btn-sm" title="' . _('Remove the column') . ' ' .$radio_title[$i]. '"><span class="glyphicon glyphicon-remove text-danger"></span><span class="sr-only">'. _("Remove") .'</span></button></td>'
: '<td role="presentation"></td>';
} }
@ -891,19 +909,20 @@ if (substr($dsondage->format, 0, 1)=="D") {
$tr_hours .= '<th></th></tr>'; $tr_hours .= '<th></th></tr>';
// Add col // Add col
$tr_add_remove_col .= '<td><button type="submit" name="ajoutsujet" class="btn btn-link btn-sm" title="'. _('Add a column') . '"><span class="glyphicon glyphicon-plus text-success"></span><span class="sr-only">'. _("Add a column") .'</span></button></td></tr>'; $tr_add_remove_col .= '<td><button type="submit" name="ajoutsujet" class="btn btn-link btn-sm" title="'. _('Add a column') . '"><span class="glyphicon glyphicon-plus text-success"></span><span class="sr-only">'. _('Add a column') .'</span></button></td></tr>';
$thead = "\n".$tr_add_remove_col."\n".$tr_months."\n".$tr_days."\n".$tr_hours."\n"; $thead = "\n".$tr_add_remove_col."\n".$tr_months."\n".$tr_days."\n".$tr_hours."\n";
// Subjects poll // Subjects poll
} else { } else {
$toutsujet=str_replace("@","<br />",$toutsujet); $toutsujet=str_replace('@', '<br />', $toutsujet);
$tr_subjects = '<tr><th role="presentation"></th>'; $tr_subjects = '<tr><th role="presentation"></th>';
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 // Subjects
preg_match_all('/\[!\[(.*?)\]\((.*?)\)\]\((.*?)\)/',$toutsujet[$i],$md_a_img); // Markdown [![alt](src)](href) preg_match_all('/\[!\[(.*?)\]\((.*?)\)\]\((.*?)\)/',$toutsujet[$i],$md_a_img); // Markdown [![alt](src)](href)
@ -985,7 +1004,7 @@ while ($data = $user_studs->FetchNextObject(false)) {
$ensemblereponses = $data->reponses; $ensemblereponses = $data->reponses;
// Print name // Print name
$nombase=str_replace("°","'",$data->nom); $nombase=str_replace('°', '\'',$data->nom);
echo '<tr> echo '<tr>
<th class="bg-info">'.stripslashes($nombase).'</th>'."\n"; <th class="bg-info">'.stripslashes($nombase).'</th>'."\n";
@ -995,28 +1014,30 @@ while ($data = $user_studs->FetchNextObject(false)) {
$rbd = ($border[$k]) ? ' rbd' : ''; $rbd = ($border[$k]) ? ' rbd' : '';
$car = substr($ensemblereponses, $k, 1); $car = substr($ensemblereponses, $k, 1);
switch ($car) { switch ($car) {
case "1": echo '<td class="bg-success text-success'.$rbd.'" headers="'.$td_headers[$k].'"><span class="glyphicon glyphicon-ok"></span><span class="sr-only"> ' . _('Yes') . '</span></td>'."\n"; case '1': echo '<td class="bg-success text-success'.$rbd.'" headers="'.$td_headers[$k].'"><span class="glyphicon glyphicon-ok"></span><span class="sr-only"> ' . _('Yes') . '</span></td>'."\n";
if (isset($somme[$k]) === false) { if (isset($somme[$k]) === false) {
$somme[$k] = 0; $somme[$k] = 0;
} }
$somme[$k]++; break; ++$somme[$k]; break;
case "2": echo '<td class="bg-warning text-warning'.$rbd.'" headers="'.$td_headers[$k].'">(<span class="glyphicon glyphicon-ok"></span>)<span class="sr-only"> ' . _('Yes') . _(', ifneedbe') . '</span></td>'."\n"; break; case '2': echo '<td class="bg-warning text-warning'.$rbd.'" headers="'.$td_headers[$k].'">(<span class="glyphicon glyphicon-ok"></span>)<span class="sr-only"> ' . _('Yes') . _(', ifneedbe') . '</span></td>'."\n"; break;
default: echo '<td class="bg-danger'.$rbd.'" headers="'.$td_headers[$k].'"><span class="sr-only">' . _('No') . '</span></td>'."\n";break; default: echo '<td class="bg-danger'.$rbd.'" headers="'.$td_headers[$k].'"><span class="sr-only">' . _('No') . '</span></td>'."\n";break;
} }
} }
} else { // sinon on remplace les choix de l'utilisateur par une ligne de radio pour recuperer de nouvelles valeurs } 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 // si c'est bien la ligne a modifier on met les radios
if ($compteur == "$ligneamodifier") { if ($compteur == $ligneamodifier) {
for ($j = 0; $j < $nbcolonnes; $j++) { for ($j = 0; $j < $nbcolonnes; ++$j) {
$car = substr($ensemblereponses, $j, 1); $car = substr($ensemblereponses, $j, 1);
// variable pour afficher la valeur cochée // 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) { switch ($car) {
case "1": $car_html[1]='value="1" checked';break; case '1': $car_html[1]='value="1" checked'; break;
case "2": $car_html[2]='value="2" checked';break; case '2': $car_html[2]='value="2" checked'; break;
default: $car_html[0]='value="0" checked';break; default: $car_html[0]='value="0" checked';
} }
echo ' echo '
@ -1045,24 +1066,24 @@ while ($data = $user_studs->FetchNextObject(false)) {
} }
} else { //sinon on affiche les lignes normales } else { //sinon on affiche les lignes normales
for ($k = 0; $k < $nbcolonnes; $k++) { for ($k = 0; $k < $nbcolonnes; ++$k) {
$rbd = ($border[$k]) ? ' rbd' : ''; $rbd = ($border[$k]) ? ' rbd' : '';
$car = substr($ensemblereponses, $k, 1); $car = substr($ensemblereponses, $k, 1);
switch ($car) { switch ($car) {
case "1": echo '<td class="bg-success text-success'.$rbd.'" headers="'.$td_headers[$k].'"><span class="glyphicon glyphicon-ok"></span><span class="sr-only"> ' . _('Yes') . '</span></td>'."\n"; case '1': echo '<td class="bg-success text-success'.$rbd.'" headers="'.$td_headers[$k].'"><span class="glyphicon glyphicon-ok"></span><span class="sr-only"> ' . _('Yes') . '</span></td>'."\n";
if (isset($somme[$k]) === false) { if (isset($somme[$k]) === false) {
$somme[$k] = 0; $somme[$k] = 0;
} }
$somme[$k]++; break; ++$somme[$k]; break;
case "2": echo '<td class="bg-warning text-warning'.$rbd.'" headers="'.$td_headers[$k].'">(<span class="glyphicon glyphicon-ok"></span>)<span class="sr-only"> ' . _('Yes') . _(', ifneedbe') . '</span></td>'."\n"; break; case '2': echo '<td class="bg-warning text-warning'.$rbd.'" headers="'.$td_headers[$k].'">(<span class="glyphicon glyphicon-ok"></span>)<span class="sr-only"> ' . _('Yes') . _(', ifneedbe') . '</span></td>'."\n"; break;
default: echo '<td class="bg-danger'.$rbd.'" headers="'.$td_headers[$k].'"><span class="sr-only">' . _('No') . '</span></td>'."\n";break; default: echo '<td class="bg-danger'.$rbd.'" headers="'.$td_headers[$k].'"><span class="sr-only">' . _('No') . '</span></td>'."\n";
} }
} }
} }
} }
//a la fin de chaque ligne se trouve les boutons modifier //a la fin de chaque ligne se trouve les boutons modifier
if (!$testligneamodifier=="true") { if (!$testligneamodifier == 'true') {
echo ' echo '
<td> <td>
<button type="submit" class="btn btn-link btn-sm" name="modifierligne'.$compteur.'" title="'. _('Edit the line:') .' '.stripslashes($nombase).'"> <button type="submit" class="btn btn-link btn-sm" name="modifierligne'.$compteur.'" title="'. _('Edit the line:') .' '.stripslashes($nombase).'">
@ -1075,19 +1096,19 @@ while ($data = $user_studs->FetchNextObject(false)) {
} }
//demande de confirmation pour modification de ligne //demande de confirmation pour modification de ligne
for ($i = 0; $i < $nblignes; $i++) { for ($i = 0; $i < $nblignes; ++$i) {
if (isset($_POST["modifierligne$i"])) { if (isset($_POST['modifierligne'. $i])) {
if ($compteur == $i) { if ($compteur == $i) {
echo '<td style="padding:5px"><button type="submit" class="btn btn-success btn-xs" name="validermodifier'.$compteur.'" title="'. _('Save the choices') .' '.stripslashes($nombase).'">'. _('Save') .'</button></td>'."\n"; echo '<td style="padding:5px"><button type="submit" class="btn btn-success btn-xs" name="validermodifier'.$compteur.'" title="'. _('Save the choices') .' '.stripslashes($nombase).'">'. _('Save') .'</button></td>'."\n";
} }
} }
} }
$compteur++; ++$compteur;
echo '</tr>'."\n"; echo '</tr>'."\n";
} }
if (!$testligneamodifier=="true") { if (!$testligneamodifier == 'true') {
//affichage de la case vide de texte pour un nouvel utilisateur //affichage de la case vide de texte pour un nouvel utilisateur
echo '<tr id="vote-form"> echo '<tr id="vote-form">
<td class="bg-info" style="padding:5px"> <td class="bg-info" style="padding:5px">
@ -1098,7 +1119,7 @@ if (!$testligneamodifier=="true") {
</td>'."\n"; </td>'."\n";
//une ligne de checkbox pour le choix du nouvel utilisateur //une ligne de checkbox pour le choix du nouvel utilisateur
for ($i = 0; $i < $nbcolonnes; $i++) { for ($i = 0; $i < $nbcolonnes; ++$i) {
echo ' echo '
<td class="bg-info" headers="'.$td_headers[$i].'"> <td class="bg-info" headers="'.$td_headers[$i].'">
<ul class="list-unstyled choice"> <ul class="list-unstyled choice">
@ -1143,7 +1164,7 @@ for ($i = 0; $i < $nbcolonnes; $i++) {
$tr_addition .= '<td><span class="glyphicon glyphicon-star text-warning"></span><span>'.$somme[$i].'</span></td>'; $tr_addition .= '<td><span class="glyphicon glyphicon-star text-warning"></span><span>'.$somme[$i].'</span></td>';
$meilleursujet.= '<li><b>'.$radio_title[$i].'</b></li>'; $meilleursujet.= '<li><b>'.$radio_title[$i].'</b></li>';
$compteursujet++; ++$compteursujet;
} else { } else {
$tr_addition .= '<td>'.$somme[$i].'</td>'; $tr_addition .= '<td>'.$somme[$i].'</td>';
@ -1155,9 +1176,9 @@ for ($i = 0; $i < $nbcolonnes; $i++) {
$tr_addition .= '<td></td></tr>'; $tr_addition .= '<td></td></tr>';
//recuperation des valeurs des sujets et adaptation pour affichage //recuperation des valeurs des sujets et adaptation pour affichage
$toutsujet = explode(",", $dsujet->sujet); $toutsujet = explode(',', $dsujet->sujet);
$meilleursujet = str_replace("°", "'", $meilleursujet).'</ul>'; $meilleursujet = str_replace('°', '\'', $meilleursujet).'</ul>';
$vote_str = ($meilleurecolonne > 1) ? $vote_str = _('votes') : _('vote'); $vote_str = ($meilleurecolonne > 1) ? $vote_str = _('votes') : _('vote');
// Print Addition and Best choice // Print Addition and Best choice
@ -1194,7 +1215,7 @@ $sql = $connect->Prepare($sql);
$comment_user = $connect->Execute($sql, array($numsondage)); $comment_user = $connect->Execute($sql, array($numsondage));
if ($comment_user->RecordCount() != 0) { if ($comment_user->RecordCount() != 0) {
echo '<div><h3>' . _("Comments of polled people") . '</h3>'."\n"; echo '<div><h3>' . _('Comments of polled people') . '</h3>'."\n";
$i = 0; $i = 0;
while ( $dcomment=$comment_user->FetchNextObject(false)) { while ( $dcomment=$comment_user->FetchNextObject(false)) {
@ -1211,15 +1232,15 @@ if ($comment_user->RecordCount() != 0) {
echo ' echo '
<div class="hidden-print alert alert-info"> <div class="hidden-print alert alert-info">
<div class="col-md-6 col-md-offset-3"> <div class="col-md-6 col-md-offset-3">
<fieldset id="add-comment"><legend>' . _("Add a comment in the poll") . '</legend> <fieldset id="add-comment"><legend>' . _('Add a comment in the poll') . '</legend>
<div class="form-group"> <div class="form-group">
<p><label for="commentuser">'. _("Your name") .'</label><input type=text name="commentuser" class="form-control" id="commentuser" /></p> <p><label for="commentuser">'. _('Your name') .'</label><input type=text name="commentuser" class="form-control" id="commentuser" /></p>
</div> </div>
<div class="form-group"> <div class="form-group">
<p><label for="comment">'. _("Your comment") .'</label><br /> <p><label for="comment">'. _('Your comment') .'</label><br />
<textarea name="comment" id="comment" class="form-control" rows="2" cols="40"></textarea></p> <textarea name="comment" id="comment" class="form-control" rows="2" cols="40"></textarea></p>
</div> </div>
<p class="text-center"><input type="submit" name="ajoutcomment" value="'. _("Send the comment") .'" class="btn btn-success"></p> <p class="text-center"><input type="submit" name="ajoutcomment" value="'. _('Send the comment') .'" class="btn btn-success"></p>
</fieldset> </fieldset>
</div> </div>
<div class="clearfix"></div> <div class="clearfix"></div>

View file

@ -20,16 +20,22 @@ namespace Framadate;
class Utils class Utils
{ {
/**
* @return string Server name
*/
public static function get_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'] . '/'; $port = in_array($_SERVER['SERVER_PORT'], [80, 443]) ? '/' : ':' . $_SERVER['SERVER_PORT'] . '/';
$server_name = $_SERVER['SERVER_NAME'] . $port . dirname($_SERVER['SCRIPT_NAME']) . '/'; $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; global $connect;
@ -40,13 +46,13 @@ class Utils
WHERE sondage.id_sondage = ' . $connect->Param('id_sondage'); WHERE sondage.id_sondage = ' . $connect->Param('id_sondage');
$sql = $connect->Prepare($sql); $sql = $connect->Prepare($sql);
$sondage = $connect->Execute($sql, [$id]); $poll = $connect->Execute($sql, [$id]);
if ($sondage === false) { if ($poll === false) {
return false; return false;
} }
$psondage = $sondage->FetchObject(false); $psondage = $poll->FetchObject(false);
$psondage->date_fin = strtotime($psondage->date_fin); $psondage->date_fin = strtotime($psondage->date_fin);
return $psondage; return $psondage;
@ -55,6 +61,15 @@ class Utils
return false; return false;
} }
/**
* Use get_poll_from_id that is fully english name
* @deprecated
*/
public static function get_sondage_from_id($id)
{
return self::get_poll_from_id($id);
}
public static function is_error($cerr) public static function is_error($cerr)
{ {
global $err; global $err;
@ -77,20 +92,20 @@ class Utils
echo '<!DOCTYPE html> echo '<!DOCTYPE html>
<html lang="'.$lang.'"> <html lang="'.$lang.'">
<head> <head>
<meta charset="utf-8">'; <meta charset="utf-8" />';
echo '<title>';
if (! empty($title)) { if (! empty($title)) {
echo '<title>' . stripslashes($title) . ' - ' . NOMAPPLICATION . '</title>'; echo stripslashes($title) . ' - ';
} else {
echo '<title>' . NOMAPPLICATION . '</title>';
} }
echo NOMAPPLICATION . '</title>';
echo ' echo '
<link rel="stylesheet" href="' . self::get_server_name() . 'css/bootstrap.min.css"> <link rel="stylesheet" href="' . self::get_server_name() . 'css/bootstrap.min.css" />
<link rel="stylesheet" href="' . self::get_server_name() . 'css/datepicker3.css"> <link rel="stylesheet" href="' . self::get_server_name() . 'css/datepicker3.css" />
<link rel="stylesheet" href="' . self::get_server_name() . 'css/style.css"> <link rel="stylesheet" href="' . self::get_server_name() . 'css/style.css" />
<link rel="stylesheet" href="' . self::get_server_name() . 'css/frama.css"> <link rel="stylesheet" href="' . self::get_server_name() . 'css/frama.css" />
<link rel="stylesheet" href="' . self::get_server_name() . 'css/print.css" media="print"> <link rel="stylesheet" href="' . self::get_server_name() . 'css/print.css" media="print" />
<script type="text/javascript" src="' . self::get_server_name() . 'js/jquery-1.11.1.min.js"></script> <script type="text/javascript" src="' . self::get_server_name() . 'js/jquery-1.11.1.min.js"></script>
<script type="text/javascript" src="' . self::get_server_name() . 'js/bootstrap.min.js"></script> <script type="text/javascript" src="' . self::get_server_name() . 'js/bootstrap.min.js"></script>
<script type="text/javascript" src="' . self::get_server_name() . 'js/bootstrap-datepicker.js"></script> <script type="text/javascript" src="' . self::get_server_name() . 'js/bootstrap-datepicker.js"></script>
@ -104,18 +119,12 @@ class Utils
</head> </head>
<body> <body>
<div class="container ombre">'; <div class="container ombre">';
} }
public static function check_table_sondage() public static function check_table_sondage()
{ {
global $connect; global $connect;
return in_array('sondage', $connect->MetaTables('TABLES'));
if (in_array('sondage', $connect->MetaTables('TABLES'))) {
return true;
}
return false;
} }
/** /**
@ -132,11 +141,9 @@ class Utils
/** /**
* Envoi un courrier avec un codage correct de To et Subject * Envoi un courrier avec un codage correct de To et Subject
* Les en-têtes complémentaires ne sont pas gérés * Les en-têtes complémentaires ne sont pas gérés
*
*/ */
public static function sendEmail( $to, $subject, $body, $headers='', $param='') public static function sendEmail( $to, $subject, $body, $headers='', $param='')
{ {
mb_internal_encoding('UTF-8'); mb_internal_encoding('UTF-8');
$subject = mb_encode_mimeheader(html_entity_decode($subject, ENT_QUOTES, 'UTF-8'), 'UTF-8', 'B', "\n", 9); $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-Type: text/plain; charset=UTF-8\n";
$headers .= "Content-Transfer-Encoding: 8bit\n"; $headers .= "Content-Transfer-Encoding: 8bit\n";
$headers .= "Auto-Submitted:auto-generated\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 davance pour votre soutien http://soutenir.framasoft.org.');
mail($to, $subject, $body, $headers, $param); 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 * Fonction vérifiant l'existance et la valeur non vide d'une clé d'un tableau
* @param string $name La clé à tester * @param string $name La clé à tester
* @param array $tableau Le tableau rechercher la clé ($_POST par défaut) * @param array $table Le tableau rechercher la clé ($_POST par défaut)
* @return bool Vrai si la clé existe et renvoie une valeur non vide * @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)) { if (is_null($table)) {
$tableau = $_POST; $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 (URL_PROPRE) {
if ($admin === true) { if ($admin === true) {
$url = str_replace('/admin', '', self::get_server_name()) . $id . '/admin'; return str_replace('/admin', '', self::get_server_name()) . $id . '/admin';
} else { } else {
$url = str_replace('/admin', '', self::get_server_name()) . $id; return str_replace('/admin', '', self::get_server_name()) . $id;
} }
} else { } else {
if ($admin === true) { 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 { } 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) public static function remove_sondage($connect, $numsondage)
@ -248,9 +253,14 @@ class Utils
return $suppression_OK ; return $suppression_OK ;
} }
/**
* @param $connect
* @param $log_txt
* @return void
*/
public static function cleaning_polls($connect, $log_txt) { public static function cleaning_polls($connect, $log_txt) {
$connect->StartTrans(); $connect->StartTrans();
$req = 'SELECT * FROM sondage WHERE date_fin < NOW() LIMIT 20'; $req = 'SELECT * FROM sondage WHERE date_fin < NOW() AND date_fin != 0 LIMIT 20';
$sql = $connect->Prepare($req); $sql = $connect->Prepare($req);
$cleaning = $connect->Execute($sql); $cleaning = $connect->Execute($sql);

View file

@ -23,9 +23,16 @@ if (ini_get('date.timezone') == '') {
// Autoloading of dependencies with Composer // Autoloading of dependencies with Composer
require_once __DIR__ . '/../../vendor/autoload.php'; require_once __DIR__ . '/../../vendor/autoload.php';
include_once __DIR__ . '/constants.php'; require_once __DIR__ . '/constants.php';
include_once __DIR__ . '/i18n.php'; require_once __DIR__ . '/i18n.php';
$connect = NewADOConnection(BASE_TYPE); $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; $err = 0;

View file

@ -18,7 +18,7 @@
*/ */
namespace Framadate; namespace Framadate;
if (session_id() == "") { if (session_id() == '') {
session_start(); session_start();
} }
@ -26,27 +26,35 @@ include_once __DIR__ . '/app/inc/init.php';
//Generer une chaine de caractere unique et aleatoire //Generer une chaine de caractere unique et aleatoire
function random($car) function random_string($length)
{ {
$string = ""; $string = '';
$chaine = "abcdefghijklmnopqrstuvwxyz123456789"; $chaine = 'abcdefghijklmnopqrstuvwxyz123456789';
srand((double)microtime()*1000000); srand((double)microtime()*1000000);
for($i=0; $i<$car; $i++) { for($i=0; $i < $length; ++$i) {
$string .= $chaine[rand()%strlen($chaine)]; $string .= $chaine[rand()%strlen($chaine)];
} }
return $string; return $string;
} }
/**
* @deprecated
*/
function random($car)
{
return random_string($car);
}
function ajouter_sondage() function ajouter_sondage()
{ {
global $connect; global $connect;
global $config;
$sondage=random(16); $poll = random(16);
$sondage_admin=$sondage.random(8); $poll_admin = $poll . random(8);
$date_fin = $_SESSION["champdatefin"]; // provided by choix_autre.php or choix_date.php $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. $_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 $sql = 'INSERT INTO sondage
(id_sondage, commentaires, mail_admin, nom_admin, titre, id_sondage_admin, date_fin, format, mailsonde) (id_sondage, commentaires, mail_admin, nom_admin, titre, id_sondage_admin, date_fin, format, mailsonde)
VALUES ( VALUES (
@ -61,40 +69,50 @@ function ajouter_sondage()
'.$connect->Param('mailsonde').' '.$connect->Param('mailsonde').'
)'; )';
$sql = $connect->Prepare($sql); $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); $sql = $connect->Prepare($sql);
$connect->Execute($sql, array($sondage, $_SESSION['toutchoix'])); $connect->Execute($sql, array($poll, $_SESSION['toutchoix']));
if($config['use_smtp']==true) { 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 .= "\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 .= 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 .= _('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 = _("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 .= " :\n\n%s \n\n" . _('Thanks for your confidence.') . "\n". NOMAPPLICATION;
$message = sprintf($message, Utils::getUrlSondage($sondage)); $message = sprintf($message, Utils::getUrlSondage($poll));
$message_admin = sprintf($message_admin, Utils::getUrlSondage($sondage_admin, true)); $message_admin = sprintf($message_admin, Utils::getUrlSondage($poll_admin, true));
if (Utils::isValidEmail($_SESSION['adresse'])) { 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(
Utils::sendEmail( "$_SESSION[adresse]", "[".NOMAPPLICATION."][" . _("For sending to the polled users") . "] " . _("Poll") . " : ".stripslashes(htmlspecialchars_decode($_SESSION["titre"],ENT_QUOTES)), $message, $_SESSION['adresse'] ); "$_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'); Utils::cleaning_polls($connect, 'admin/logs_studs.txt');
// Don't keep days, hours and choices in memory (in order to make new polls) // 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['horaires'.$i]);
} }
unset($_SESSION["totalchoixjour"]); unset($_SESSION['totalchoixjour']);
unset($_SESSION['choices']); unset($_SESSION['choices']);
header("Location:".Utils::getUrlSondage($sondage_admin, true)); header('Location:'. Utils::getUrlSondage($poll_admin, true));
exit(); exit();
} }

View file

@ -19,7 +19,7 @@ msgstr ""
########### Generic ########### ########### Generic ###########
msgid "Make your polls" msgid "Make your polls"
msgstr "Erstelle Umfragen für dich" msgstr "Eigene Umfragen erstellen"
msgid "Home" msgid "Home"
msgstr "Home" msgstr "Home"
@ -49,19 +49,19 @@ msgid "Next"
msgstr "Weiter" msgstr "Weiter"
msgid "Back" msgid "Back"
msgstr "Back" msgstr "Zurück"
msgid "Close" msgid "Close"
msgstr "Close" msgstr "Schließen"
msgid "Your name" msgid "Your name"
msgstr "Ihr Name" msgstr "Ihr Name"
msgid "Your email address" msgid "Your email address"
msgstr "Ihre E-Mail Addresse" msgstr "Ihre E-Mail Adresse"
msgid "(in the format name@mail.com)" msgid "(in the format name@mail.com)"
msgstr "(in the format name@mail.com)" msgstr "(Format: name@mail.com)"
msgid "Description" msgid "Description"
msgstr "Beschreibung" msgstr "Beschreibung"
@ -93,77 +93,77 @@ msgstr "Sprache wählen"
############ Homepage ############ ############ Homepage ############
msgid "Schedule an event" msgid "Schedule an event"
msgstr "Erweiterte Umfrage" msgstr "Termin finden"
msgid "Make a classic poll" msgid "Make a classic poll"
msgstr "Umfrage" msgstr "Klassische Umfrage"
# 1st section # 1st section
msgid "What is that?" msgid "What is that?"
msgstr "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." msgid "Framadate is an online service for planning an appointment or make a decision quickly and easily. No registration is required."
msgstr "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:" msgid "Here is how it works:"
msgstr "Here is how it works:" msgstr "So geht es:"
msgid "Make a poll" msgid "Make a poll"
msgstr "Make a poll" msgstr "Umfrage erstellen"
msgid "Define dates or subjects to choose" msgid "Define dates or subjects to choose"
msgstr "Define dates or subjects to choose" msgstr "Datum- oder Auswahlmöglichkeiten definieren"
msgid "Send the poll link to your friends or colleagues" msgid "Send the poll link to your friends or colleagues"
msgstr "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" msgid "Discuss and make a decision"
msgstr "Discuss and make a decision" msgstr "Besprechen und Entscheidung treffen"
msgid "Do you want to " msgid "Do you want to "
msgstr "Do you want to " msgstr "Wollen Sie sich "
msgid "view an example?" msgid "view an example?"
msgstr "schaue ein Beispiel an?" msgstr "einen Beispiel ansehen?"
# 2nd section # 2nd section
msgid "The software" msgid "The software"
msgstr "The software" msgstr "Die Software"
msgid "Framadate was initially based on " msgid "Framadate was initially based on "
msgstr "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" msgid " a software developed by the University of Strasbourg. Today, it is devevoped by the association Framasoft"
msgstr " 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:" msgid "This software needs javascript and cookies enabled. It is compatible with the following web browsers:"
msgstr "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 " msgid "It is governed by the "
msgstr "It is governed by the " msgstr "Sie ist lizenziert unter der "
msgid "CeCILL-B license" msgid "CeCILL-B license"
msgstr "CeCILL-B license" msgstr "CeCILL-B Lizenz"
# 3rd section # 3rd section
msgid "Cultivate your garden" msgid "Cultivate your garden"
msgstr "Cultivate your garden" msgstr "Bestellen Sie ihren Garten"
msgid "To participate in the software development, suggest improvements or simply download it, please visit " msgid "To participate in the software development, suggest improvements or simply download it, please visit "
msgstr "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" msgid "the development site"
msgstr "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:" msgid "If you want to install the software for your own use and thus increase your independence, we help you on:"
msgstr "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 ############## ############## Poll ##############
msgid "Poll administration" msgid "Poll administration"
msgstr "Poll administration" msgstr "Umfrage-Verwaltung"
msgid "Legend:" msgid "Legend:"
msgstr "Legend:" msgstr "Legende:"
# Jumbotron adminstuds.php (+ studs.php) # Jumbotron adminstuds.php (+ studs.php)
msgid "Back to the poll" msgid "Back to the poll"
@ -173,25 +173,25 @@ msgid "Print"
msgstr "Drucken" msgstr "Drucken"
msgid "Export to CSV" msgid "Export to CSV"
msgstr "Exportieren nach CSV" msgstr "CSV-Export"
msgid "Remove the poll" msgid "Remove the poll"
msgstr "Lösche die Umfrage" msgstr "Umfrage löschen"
msgid "Title of the poll" msgid "Title of the poll"
msgstr "Titel der Umfrage" msgstr "Titel der Umfrage"
msgid "Edit the title" msgid "Edit the title"
msgstr "Bearbeite den Titel" msgstr "Titel bearbeiten"
msgid "Save the new title" msgid "Save the new title"
msgstr "Den neuen Titel speichern" msgstr "Den neuen Titel speichern"
msgid "Cancel the title edit" msgid "Cancel the title edit"
msgstr "Die Änderung des Titels abbrechen" msgstr "Änderung des Titels abbrechen"
msgid "Initiator of the poll" msgid "Initiator of the poll"
msgstr "Inititator der Umfrage" msgstr "Ersteller der Umfrage"
msgid "Email" msgid "Email"
msgstr "E-Mail Adresse" msgstr "E-Mail Adresse"
@ -203,70 +203,70 @@ msgid "Save the adress email"
msgstr "E-Mail Adresse speichern" msgstr "E-Mail Adresse speichern"
msgid "Cancel the adress email edit" msgid "Cancel the adress email edit"
msgstr "Änderung der E-Mail Adresse ändern" msgstr "Änderung der E-Mail Adresse abbrechen"
msgid "Edit the description" msgid "Edit the description"
msgstr "Die Beschreibung bearbeiten" msgstr "Beschreibung bearbeiten"
msgid "Save the description" msgid "Save the description"
msgstr "Die Beschreibung speichern" msgstr "Beschreibung speichern"
msgid "Cancel the description edit" msgid "Cancel the description edit"
msgstr "Die Änderung der Beschreibung verwerfen" msgstr "Änderung der Beschreibung verwerfen"
msgid "Public link of the poll" msgid "Public link of the poll"
msgstr "Öffentlicher Link zur Umfrage" msgstr "Öffentlicher Link zur Umfrage"
msgid "Admin link of the poll" msgid "Admin link of the poll"
msgstr "Administrator Link zur Umfrage" msgstr "Administrator-Link der Umfrage"
msgid "Poll rules" msgid "Poll rules"
msgstr "Poll rules" msgstr "Regeln der Umfrage"
msgid "Edit the poll rules" msgid "Edit the poll rules"
msgstr "Edit the poll rules" msgstr "Regeln der Umfrage bearbeiten"
msgid "Votes and comments are locked" msgid "Votes and comments are locked"
msgstr "Votes and comments are locked" msgstr "Abstimmungen und Kommentare sind gesperrt"
msgid "Votes and comments are open" msgid "Votes and comments are open"
msgstr "Votes and comments are open" msgstr "Abstimmungen und Kommentare sind möglich"
msgid "Votes are editable" msgid "Votes are editable"
msgstr "Votes are editable" msgstr "Die Abstimmungen können geändert werden"
msgid "Save the new rules" msgid "Save the new rules"
msgstr "Save the new rules" msgstr "Neue Regeln speichern"
msgid "Cancel the rules edit" msgid "Cancel the rules edit"
msgstr "Cancel the rules edit" msgstr "Neue Regeln nicht speichern"
# Help text adminstuds.php # Help text adminstuds.php
msgid "As poll administrator, you can change all the lines of this poll with this button " 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 " msgstr "Als Administrator der Umfrage, können Sie alle Zeilen der Umfrage über diesen Button ändern "
msgid " remove a column or a line with " msgid " remove a column or a line with "
msgstr " entfernen Sie eine Zeile oder eine Spalte " msgstr " Zeile oder Spalte entfernen mit "
msgid "and add a new column with " msgid "and add a new column with "
msgstr "und fügen Sie eine neue Spalte hinzu " 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." 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 über diese Umfrage wie den Titel, Kommentare oder ihre E-Mail Adresse ändern" msgstr "Sie können auch die Informationen dieser Umfrage wie Titel, Kommentare oder E-Mail Adresse ändern."
# Help text studs.php # 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." 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 Daten, die für Sie am besten passen und bestätigen Sie diese über den Plus-Button am Ende der Zeile." 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 # Poll results
msgid "Votes of the poll " msgid "Votes of the poll "
msgstr "Votes of the poll " msgstr "Abstimmungen der Umfrage "
msgid "Remove the column" msgid "Remove the column"
msgstr "Spalte entfernen" msgstr "Spalte entfernen"
msgid "Add a column" msgid "Add a column"
msgstr "Eine Spalte hinzufügen" msgstr "Spalte hinzufügen"
msgid "Edit the line:" msgid "Edit the line:"
msgstr "Zeile bearbeiten:" msgstr "Zeile bearbeiten:"
@ -287,31 +287,31 @@ msgid "No"
msgstr "Nein" msgstr "Nein"
msgid "Vote \"no\" for " msgid "Vote \"no\" for "
msgstr "Stimme « nein » für " msgstr "Stimme « nein » für "
msgid "Vote \"yes\" for " msgid "Vote \"yes\" for "
msgstr "Stimme « ja » für " msgstr "Stimme « ja » für "
msgid "Vote \"ifneedbe\" for " msgid "Vote \"ifneedbe\" for "
msgstr "Stimme « Wenn notwendig » für " msgstr "Stimme « Wenn notwendig » für "
msgid "Save the choices" msgid "Save the choices"
msgstr "Die Wahl speichern" msgstr "Wahl speichern"
msgid "Addition" msgid "Addition"
msgstr "Hinzufügen" msgstr "Hinzufügen"
msgid "Best choice" msgid "Best choice"
msgstr "Bste Wahl" msgstr "Bste Option"
msgid "Best choices" msgid "Best choices"
msgstr "Besten Wahlen" msgstr "Besten Optionen"
msgid "The best choice at this time is:" msgid "The best choice at this time is:"
msgstr "Die beste Wahl ist derzeit:" msgstr "Die beste Option ist derzeit:"
msgid "The bests choices at this time are:" msgid "The bests choices at this time are:"
msgstr "Die besten Wahlen sind derzeit:" msgstr "Die beste Optionen sind derzeit:"
msgid "with" msgid "with"
msgstr "mit" msgstr "mit"
@ -326,45 +326,45 @@ msgid "for"
msgstr "für" msgstr "für"
msgid "Remove all the votes" msgid "Remove all the votes"
msgstr "Remove all the votes" msgstr "Alle Stimmungen löschen"
msgid "Scroll to the left" msgid "Scroll to the left"
msgstr "Scroll to the left" msgstr "Links scrollen"
msgid "Scroll to the right" msgid "Scroll to the right"
msgstr "Scroll to the right" msgstr "Rechts scrollen"
# Comments # Comments
msgid "Comments of polled people" msgid "Comments of polled people"
msgstr "Kommentare von befragten Personen" msgstr "Kommentare von Teilnehmer"
msgid "Remove the comment" msgid "Remove the comment"
msgstr "Kommentar entfernen" msgstr "Kommentar entfernen"
msgid "Add a comment in the poll" msgid "Add a comment in the poll"
msgstr "Ein Kommentar zur Umfrage hinzufügen" msgstr "Kommentar zur Umfrage hinzufügen"
msgid "Your comment" msgid "Your comment"
msgstr "Ihr Kommentar" msgstr "Ihr Kommentar"
msgid "Send the comment" msgid "Send the comment"
msgstr "Den Kommentar senden" msgstr "Kommentar senden"
msgid "anonyme" msgid "anonyme"
msgstr "anonym" msgstr "anonym"
msgid "Remove all the comments" msgid "Remove all the comments"
msgstr "Remove all the comments" msgstr "Alle Kommentare löschen"
# Add a colum adminstuds.php # Add a colum adminstuds.php
msgid "Column's adding" msgid "Column's adding"
msgstr "Eine Spalte hinzufügen" msgstr "Spalte hinzufügen"
msgid "You can add a new scheduling date to your poll." msgid "You can add a new scheduling date to your poll."
msgstr "Sie können ihrer Umfrage ein Datum geben." 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." 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 Zeit zu einem existierenden Datum hinzufügen wollen, wählen Sie das selbe Datum und wählen Sie eine neue Zeit aus." 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 # Remove poll adminstuds.php
msgid "Confirm removal of your poll" msgid "Confirm removal of your poll"
@ -387,16 +387,16 @@ msgid "Enter a name"
msgstr "Geben Sie einen Namen ein" msgstr "Geben Sie einen Namen ein"
msgid "The name you've chosen already exist in this poll!" msgid "The name you've chosen already exist in this poll!"
msgstr "Ihr eingegebener Name existiert bereits in dieser Umfrage" msgstr "Der von Ihnen eingegebenen Name existiert bereits in dieser Umfrage"
msgid "Enter a name and a comment!" msgid "Enter a name and a comment!"
msgstr "Geben Sie ein Namen und ein Kommentar ein!" msgstr "Geben Sie einen Namen und ein Kommentar ein!"
msgid "Failed to insert the comment!" msgid "Failed to insert the comment!"
msgstr "Einfügen des Kommentars gescheitert!" msgstr "Einfügen des Kommentars gescheitert!"
msgid "Characters \" ' < et > are not permitted" msgid "Characters \" ' < et > are not permitted"
msgstr "Die Zeichen \" ' < et > sind nicht erlaubt !" msgstr "Die Zeichen \" ' < und > sind nicht erlaubt !"
msgid "The date is not correct !" msgid "The date is not correct !"
msgstr "Das Datum ist nicht korrekt!" msgstr "Das Datum ist nicht korrekt!"
@ -404,7 +404,7 @@ msgstr "Das Datum ist nicht korrekt !"
########### Step 1 ########### ########### Step 1 ###########
# Step 1 info_sondage.php # Step 1 info_sondage.php
msgid "Poll creation (1 on 3)" msgid "Poll creation (1 on 3)"
msgstr "Erstellen der Umfrage (1 von 3)" msgstr "Umfrage erstellen (1 von 3)"
msgid "Framadate is not properly installed, please check the 'INSTALL' to setup the database before continuing." 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." msgstr "Framadate ist nicht richtig installiert, lesen Sie 'INSTALL' um die Datenbank aufzusetzen bevor es weiter geht."
@ -422,14 +422,14 @@ msgid "Voters can modify their vote themselves."
msgstr "Teilnehmer können ihre Antworten verändern" msgstr "Teilnehmer können ihre Antworten verändern"
msgid "To receive an email for each new vote." msgid "To receive an email for each new vote."
msgstr "Bei jeder neuen Stimme eine E-Mail erhalten." msgstr "Bei jeder neuen Abstimmung eine E-Mail erhalten."
msgid "Go to step 2" msgid "Go to step 2"
msgstr "Go to step 2" msgstr "Weiter zum 2. Schritt"
# Errors info_sondage.php # Errors info_sondage.php
msgid "Enter a title" msgid "Enter a title"
msgstr "Einen Titel eingeben" msgstr "Titel eingeben"
msgid "Characters < > and \" are not permitted" msgid "Characters < > and \" are not permitted"
msgstr "Die Zeichen < > und \" sind nicht erlaubt !" msgstr "Die Zeichen < > und \" sind nicht erlaubt !"
@ -445,7 +445,7 @@ msgid "You haven't filled the first section of the poll creation."
msgstr "Sie haben den ersten Teil der Umfrageerstellung nicht ausgefüllt." msgstr "Sie haben den ersten Teil der Umfrageerstellung nicht ausgefüllt."
msgid "Back to step 1" msgid "Back to step 1"
msgstr "Back to step 1" msgstr "Zurück zum 1. Schritt"
########### Step 2 ########### ########### Step 2 ###########
# Step 2 choix_date.php # Step 2 choix_date.php
@ -453,16 +453,16 @@ msgid "Poll dates (2 on 3)"
msgstr "Umfragedaten (2 von 3)" msgstr "Umfragedaten (2 von 3)"
msgid "Choose the dates of your poll" msgid "Choose the dates of your poll"
msgstr "Wählen Sie das Daturm ihrer Umfrage" 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)." 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)." 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" 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" 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.)" 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." 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" msgid "Day"
msgstr "Tag" msgstr "Tag"
@ -477,23 +477,23 @@ msgid "Add an hour"
msgstr "Eine Uhrzeit hinzufügen" msgstr "Eine Uhrzeit hinzufügen"
msgid "Copy hours of the first day" msgid "Copy hours of the first day"
msgstr "Die (Uhr)Zeiten des ersten Tags kopieren" msgstr "Uhrzeiten des ersten Tags kopieren"
msgid "Remove a day" msgid "Remove a day"
msgstr "Ein Tag entfernen" msgstr "Einen Tag entfernen"
msgid "Add a day" msgid "Add a day"
msgstr "Ein Tag hinzufügen" msgstr "Einen Tag hinzufügen"
msgid "Remove all days" msgid "Remove all days"
msgstr "Alle Tage entfernen" msgstr "Alle Tage entfernen"
msgid "Remove all hours" msgid "Remove all hours"
msgstr "Alle (Uhr)Zeiten löschen" msgstr "Alle Uhrzeiten entfernen"
# Step 2 choix_autre.php # Step 2 choix_autre.php
msgid "Poll subjects (2 on 3)" msgid "Poll subjects (2 on 3)"
msgstr "Umfragethema (2 von 3)" msgstr "Umfragethemen (2 von 3)"
msgid "To make a generic poll you need to propose at least two choices between differents subjects." 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." msgstr "Um eine allgemeine Umfrage zu erstellen, benötigen Sie mindestens zwei Auswahlmöglichkeiten zwischen verschiedenen Themen."
@ -502,40 +502,40 @@ 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" 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 " msgid "It's possible to propose links or images by using "
msgstr "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" msgid "the Markdown syntax"
msgstr "the Markdown syntax" msgstr "Markdown"
msgid "Choice" msgid "Choice"
msgstr "Wahl" msgstr "Wahl"
msgid "Add a link or an image" msgid "Add a link or an image"
msgstr "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." 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." msgstr "Diese Felder sind optional. Sie können einen Link, ein Bild oder beide hinzufügen."
msgid "URL of the image" msgid "URL of the image"
msgstr "URL of the image" msgstr "URL des Bilds"
msgid "Link" msgid "Link"
msgstr "Link" msgstr "Link"
msgid "Alternative text" msgid "Alternative text"
msgstr "Alternative text" msgstr "Alternativer Text"
msgid "Remove a choice" msgid "Remove a choice"
msgstr "Eine Auswahl entfernen" msgstr "Eine Auswahlmöglichkeit entfernen"
msgid "Add a choice" msgid "Add a choice"
msgstr "Eine Auswahl hinzufügen" msgstr "Eine Auswahlmöglichkeit hinzufügen"
msgid "Back to step 2" msgid "Back to step 2"
msgstr "Back to step 2" msgstr "Zurück zum 2. Schritt"
msgid "Go to step 3" msgid "Go to step 3"
msgstr "Go to step 3" msgstr "Weiter zum 3. Schritt"
########### Step 3 ########### ########### Step 3 ###########
msgid "Removal date and confirmation (3 on 3)" msgid "Removal date and confirmation (3 on 3)"
@ -545,7 +545,7 @@ msgid "Confirm the creation of your poll"
msgstr "Bestätigen Sie die Erstellung ihrer Umfrage" msgstr "Bestätigen Sie die Erstellung ihrer Umfrage"
msgid "List of your choices" msgid "List of your choices"
msgstr "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." 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." msgstr "Wenn Sie die Erstellung ihrer Umfrage bestätigt haben, werden sie automatisch zur Administrationsseite ihrer Umfrage weitergeleitet."
@ -568,7 +568,7 @@ msgid "Your poll will be automatically removed after 6 months."
msgstr "Ihre Umfrage wird automatisch nach 6 Monaten gelöscht." msgstr "Ihre Umfrage wird automatisch nach 6 Monaten gelöscht."
msgid "You can fix another removal date for it." msgid "You can fix another removal date for it."
msgstr "Sie können jedoch auch ein anderes Löschdatum festlegen." msgstr "Sie können auch ein anderes Löschdatum festlegen."
msgid "Removal date (optional)" msgid "Removal date (optional)"
msgstr "Löschdatum (optional)" msgstr "Löschdatum (optional)"
@ -584,7 +584,7 @@ msgid "polls in the database at this time"
msgstr "Umfragen derzeit in der Datenbank" msgstr "Umfragen derzeit in der Datenbank"
msgid "Poll ID" msgid "Poll ID"
msgstr "Umfrage ID" msgstr "Umfrage-ID"
msgid "Format" msgid "Format"
msgstr "Format" msgstr "Format"
@ -596,16 +596,16 @@ msgid "Author"
msgstr "Autor" msgstr "Autor"
msgid "Users" msgid "Users"
msgstr "Benutzer" msgstr "Nutzer"
msgid "Actions" msgid "Actions"
msgstr "Aktionen" msgstr "Aktionen"
msgid "See the poll" msgid "See the poll"
msgstr "Betrachte die Umfrage" msgstr "Umfrage sehen"
msgid "Change the poll" msgid "Change the poll"
msgstr "Ändere die Umfrage" msgstr "Umfrage ändern"
msgid "Logs" msgid "Logs"
msgstr "Verlauf" msgstr "Verlauf"
@ -620,14 +620,14 @@ msgid ""
"You can find your poll at the link" "You can find your poll at the link"
msgstr "" msgstr ""
" hat eine Zeile ausgefüllt.\n" " hat eine Zeile ausgefüllt.\n"
"Sie finden Ihre Umfrage unter folgendem Link" "Sie finden Ihre Umfrage unter dem folgenden Link:"
msgid "Thanks for your confidence." msgid "Thanks for your confidence."
msgstr "Danke für Ihr Vertrauen." msgstr "Danke für Ihr Vertrauen."
msgid "\n" msgid "\n"
"--\n\n" "--\n\n"
 La route est longue, mais la voie est libre… »\n" La route est longue, mais la voie est libre… »\n"
"Framasoft ne vit que par vos dons (déductibles des impôts).\n" "Framasoft ne vit que par vos dons (déductibles des impôts).\n"
"Merci d'avance pour votre soutien http://soutenir.framasoft.org." "Merci d'avance pour votre soutien http://soutenir.framasoft.org."
msgstr "\n" msgstr "\n"
@ -638,13 +638,13 @@ msgstr "\n"
# Mails adminstuds.php # Mails adminstuds.php
msgid "[ADMINISTRATOR] New settings for your poll" msgid "[ADMINISTRATOR] New settings for your poll"
msgstr "[ADMINISTRATOR] Neuer Einstellungen für Ihre Umfrage " msgstr "[ADMINISTRATOR] Neue Einstellungen für Ihre Umfrage "
msgid "" msgid ""
"You have changed the settings of your poll. \n" "You have changed the settings of your poll. \n"
"You can modify this poll with this link" "You can modify this poll with this link"
msgstr "" msgstr ""
"Sie haben den Einstellungen Ihrer Umfrage geändert. \n" "Sie haben die Einstellungen Ihrer Umfrage geändert. \n"
"Sie können Ihre Umfrage unter diesem Link ändern" "Sie können Ihre Umfrage unter diesem Link ändern"
# Mails creation_sondage.php # Mails creation_sondage.php
@ -652,26 +652,26 @@ msgid ""
"This is the message you have to send to the people you want to poll. \n" "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." "Now, you have to send this message to everyone you want to poll."
msgstr "" msgstr ""
"Dies ist die Nachricht, diese den Personen gesendet haben, die an der Umfrage teilnehmen sollen. \n" "Dies ist die Nachricht, die Sie an die Personen, die Sie zur Umfrage einladen möchten, schicken sollen. \n"
"Sie haben die Nachricht an alle Personen, die Sie befragen wollen, gesendet." "Schicken Sie jetzt bitte diese Nachricht an alle Personen, die Sie zur Umfrage einladen möchten."
msgid "hast just created a poll called" msgid "hast just created a poll called"
msgstr " hat eine Umfrage erstellt (Name folgt) " msgstr " hat eine Umfrage erstellt - Name folgt: "
msgid "Thanks for filling the poll at the link above" msgid "Thanks for filling the poll at the link above"
msgstr "Dankeschön, dass Sie die Umfrage unter dem obrigen Link ausgefüllt haben" msgstr "Danke, dass Sie die Umfrage unter dem obrigen Link ausgefüllt haben"
msgid "" msgid ""
"This message should NOT be sent to the polled people. It is private for the poll's creator.\n" "This message should NOT be sent to the polled people. It is private for the poll's creator.\n"
"\n" "\n"
"You can now modify it at the link above" "You can now modify it at the link above"
msgstr "" msgstr ""
"Diese Nachricht sollte NICHT an die befragten Personen gesendet werden. Sie ist dem Umfrageautor vorbehalten.\n" "Diese Nachricht sollte NICHT an die befragten Personen gesendet werden. Sie nur für den Autor der Umfrage gemeint.\n"
"\n" "\n"
"Sie können die Umfrage unter dem oberen Link bearbeiten " "Sie können die Umfrage unter dem oberen Link bearbeiten "
msgid "Author's message" msgid "Author's message"
msgstr "Nachricht für den Autor " msgstr "Nachricht vom Autor "
msgid "For sending to the polled users" msgid "For sending to the polled users"
msgstr "Nachricht für die Teilnehmer" msgstr "Nachricht für die Teilnehmer"

View file

@ -34,28 +34,28 @@ $numsondage = false;
//On récupère le numéro de sondage par le lien web. //On récupère le numéro de sondage par le lien web.
if(Utils::issetAndNoEmpty('sondage', $_GET) === true) { if(Utils::issetAndNoEmpty('sondage', $_GET) === true) {
$numsondage = $_GET["sondage"]; $numsondage = $_GET['sondage'];
$_SESSION["numsondage"] = $numsondage; $_SESSION['numsondage'] = $numsondage;
} }
if(Utils::issetAndNoEmpty('sondage') === true) { if(Utils::issetAndNoEmpty('sondage') === true) {
$numsondage = $_POST["sondage"]; $numsondage = $_POST['sondage'];
$_SESSION["numsondage"] = $numsondage; $_SESSION['numsondage'] = $numsondage;
} elseif(Utils::issetAndNoEmpty('sondage', $_COOKIE) === true) { } elseif(Utils::issetAndNoEmpty('sondage', $_COOKIE) === true) {
$numsondage = $_COOKIE["sondage"]; $numsondage = $_COOKIE['sondage'];
} elseif(Utils::issetAndNoEmpty('numsondage', $_SESSION) === true) { } elseif(Utils::issetAndNoEmpty('numsondage', $_SESSION) === true) {
$numsondage = $_SESSION["numsondage"]; $numsondage = $_SESSION['numsondage'];
} }
$dsondage = ($numsondage != false) ? Utils::get_sondage_from_id($numsondage) : false; $dsondage = ($numsondage != false) ? Utils::get_sondage_from_id($numsondage) : false;
if (!$dsondage || $dsondage->id_sondage == '') { if (!$dsondage || $dsondage->id_sondage == '') {
Utils::print_header( _("Error!")); Utils::print_header( _('Error!'));
bandeau_titre(_("Error!")); bandeau_titre(_('Error!'));
echo ' echo '
<div class="alert alert-warning"> <div class="alert alert-warning">
<h2>' . _("This poll doesn't exist !") . '</h2> <h2>' . _('This poll doesn\'t exist !') . '</h2>
<p>' . _('Back to the homepage of ') . ' <a href="' . Utils::get_server_name() . '"> ' . NOMAPPLICATION . '</a></p> <p>' . _('Back to the homepage of ') . ' <a href="' . Utils::get_server_name() . '"> ' . NOMAPPLICATION . '</a></p>
</div>'."\n"; </div>'."\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 = 'SELECT * FROM user_studs WHERE id_sondage='.$connect->Param('numsondage').' ORDER BY id_users';
$sql = $connect->Prepare($sql); $sql = $connect->Prepare($sql);
$user_studs = $connect->Execute($sql, array($numsondage)); $user_studs = $connect->Execute($sql, array($numsondage));
@ -136,20 +136,21 @@ if (!Utils::is_error(NO_POLL) && (isset($_POST["boutonp"]))) {
$err |= NAME_EMPTY; $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 = ''; $nouveauchoix = '';
for ($i=0;$i<$nbcolonnes;$i++) { for ($i=0;$i<$nbcolonnes;$i++) {
// radio checked 1 = Yes, 2 = Ifneedbe, 0 = No // radio checked 1 = Yes, 2 = Ifneedbe, 0 = No
if (isset($_POST["choix$i"])) { // TODO reuse getNewChoiceFromPOST of adminstuds.php see 8272e0db84fb65210eddf5a370e0c5a2411fea79
switch ($_POST["choix$i"]) { if (isset($_POST['choix'. $i])) {
case 1: $nouveauchoix .= "1";break; switch ($_POST['choix'. $i]) {
case 2: $nouveauchoix .= "2";break; case 1: $nouveauchoix .= '1'; break;
default: $nouveauchoix .= "0";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 // protection contre les XSS : htmlentities
$nom = htmlentities($nom, ENT_QUOTES, 'UTF-8'); $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 // Todo : Il faudrait lever une erreur en cas d'erreur d'insertion
$connect->Execute($sql, array($nom, $numsondage, $nouveauchoix)); $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){ if($config['use_smtp']==true){
Utils::sendEmail( "$dsondage->mail_admin", Utils::sendEmail( $dsondage->mail_admin,
"[".NOMAPPLICATION."] "._("Poll's participation")." : ".html_entity_decode($dsondage->titre, ENT_QUOTES, 'UTF-8')."", '['.NOMAPPLICATION.'] '._('Poll\'s participation').' : '.html_entity_decode($dsondage->titre, ENT_QUOTES, 'UTF-8'),
html_entity_decode("\"$nom\" ", 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" . 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) { if($err != 0) {
Utils::print_header(_("Error!").' - '.$dsondage->titre); Utils::print_header(_('Error!').' - '.$dsondage->titre);
bandeau_titre(_("Error!")); bandeau_titre(_('Error!'));
echo '<div class="alert alert-danger"><ul class="list-unstyled">'."\n"; echo '<div class="alert alert-danger"><ul class="list-unstyled">'."\n";
if(Utils::is_error(NAME_EMPTY)) { if(Utils::is_error(NAME_EMPTY)) {
echo '<li>' . _("Enter a name") . "</li>\n"; echo '<li>' . _('Enter a name') . "</li>\n";
} }
if(Utils::is_error(NAME_TAKEN)) { if(Utils::is_error(NAME_TAKEN)) {
echo '<li>' . _("The name you've chosen already exist in this poll!") . "</li>\n"; echo '<li>' . _('The name you\'ve chosen already exist in this poll!') . "</li>\n";
} }
if(Utils::is_error(COMMENT_EMPTY) || Utils::is_error(COMMENT_USER_EMPTY)) { if(Utils::is_error(COMMENT_EMPTY) || Utils::is_error(COMMENT_USER_EMPTY)) {
echo '<li>' . _("Enter a name and a comment!") . "</li>\n"; echo '<li>' . _('Enter a name and a comment!') . "</li>\n";
} }
if(Utils::is_error(COMMENT_INSERT_FAILED) ) { if(Utils::is_error(COMMENT_INSERT_FAILED) ) {
echo '<li>' . _("Failed to insert the comment!") . "</li>\n"; echo '<li>' . _('Failed to insert the comment!') . "</li>\n";
} }
echo '</ul></div>'; echo '</ul></div>';
@ -243,7 +244,7 @@ echo '
//affichage de la description du sondage //affichage de la description du sondage
if ($dsondage->commentaires) { if ($dsondage->commentaires) {
$commentaires = $dsondage->commentaires; $commentaires = $dsondage->commentaires;
$commentaires=nl2br(str_replace("\\","",$commentaires)); $commentaires=nl2br(str_replace('\\', '', $commentaires));
echo ' echo '
<div class="form-group col-md-7"> <div class="form-group col-md-7">
<h4 class="control-label">'._("Description") .'</h4><br /> <h4 class="control-label">'._("Description") .'</h4><br />
@ -260,12 +261,12 @@ $nblignes = $user_studs->RecordCount();
//on teste pour voir si une ligne doit etre modifiée //on teste pour voir si une ligne doit etre modifiée
$testmodifier = false; $testmodifier = false;
$ligneamodifier = -1; $ligneamodifier = -1;
for ($i=0;$i<$nblignes;$i++) { for ($i=0; $i < $nblignes; ++$i) {
if (isset($_POST["modifierligne$i"])) { if (isset($_POST['modifierligne'. $i])) {
$ligneamodifier = $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])) { if (isset($_POST['validermodifier'.$i])) {
$modifier = $i; $modifier = $i;
$testmodifier = true; $testmodifier = true;
@ -274,6 +275,7 @@ for ($i=0;$i<$nblignes;$i++) {
//si le test est valide alors on affiche des checkbox pour entrer de nouvelles valeurs //si le test est valide alors on affiche des checkbox pour entrer de nouvelles valeurs
if ($testmodifier) { if ($testmodifier) {
// TODO reuse getNewChoiceFromPOST of adminstuds.php see 8272e0db84fb65210eddf5a370e0c5a2411fea79
$nouveauchoix = ''; $nouveauchoix = '';
for ($i=0;$i<$nbcolonnes;$i++) { for ($i=0;$i<$nbcolonnes;$i++) {
// radio checked 1 = Yes, 2 = Ifneedbe, 0 = No // radio checked 1 = Yes, 2 = Ifneedbe, 0 = No
@ -281,7 +283,7 @@ if ($testmodifier) {
switch ($_POST["choix$i"]) { switch ($_POST["choix$i"]) {
case 1: $nouveauchoix .= "1"; break; case 1: $nouveauchoix .= "1"; break;
case 2: $nouveauchoix .= "2"; break; case 2: $nouveauchoix .= "2"; break;
default: $nouveauchoix .= "0";break; default: $nouveauchoix .= "0";
} }
} }
} }
@ -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 ); 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;
} }
} }
@ -366,7 +368,7 @@ if ($dsondage->format=="D"||$dsondage->format=="D+"||$dsondage->format=="D-") {
// Hours // Hours
$rbd = ($border[$i]) ? ' rbd' : ''; $rbd = ($border[$i]) ? ' rbd' : '';
if ($horoCur[1] !== "") { if (isset($horoCur[1]) && $horoCur[1] !== '') {
$tr_hours .= '<th class="bg-info'.$rbd.'" id="H'.$i.'" title="'.$horoCur[1].'">'.$horoCur[1].'</th>'; $tr_hours .= '<th class="bg-info'.$rbd.'" id="H'.$i.'" title="'.$horoCur[1].'">'.$horoCur[1].'</th>';
$radio_title[$i] .= ' - '.$horoCur[1]; $radio_title[$i] .= ' - '.$horoCur[1];
$td_headers[$i] .= ' H'.$i; $td_headers[$i] .= ' H'.$i;
@ -385,13 +387,14 @@ if ($dsondage->format=="D"||$dsondage->format=="D+"||$dsondage->format=="D-") {
// Subjects poll // Subjects poll
} else { } else {
$toutsujet=str_replace("@","<br />",$toutsujet); $toutsujet=str_replace('@','<br />', $toutsujet);
$tr_subjects = '<tr><th role="presentation"></th>'; $tr_subjects = '<tr><th role="presentation"></th>';
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 // Subjects
preg_match_all('/\[!\[(.*?)\]\((.*?)\)\]\((.*?)\)/',$toutsujet[$i],$md_a_img); // Markdown [![alt](src)](href) 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 // 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) { switch ($car) {
case "1": $car_html[1]='value="1" checked';break; case '1': $car_html[1]='value="1" checked'; break;
case "2": $car_html[2]='value="2" checked';break; case '2': $car_html[2]='value="2" checked'; break;
default: $car_html[0]='value="0" checked';break; default: $car_html[0]='value="0" checked';
} }
echo ' echo '
@ -535,7 +538,7 @@ while ($data = $user_studs->FetchNextObject(false)) {
if (isset($somme[$k]) === false) { if (isset($somme[$k]) === false) {
$somme[$k] = 0; $somme[$k] = 0;
} }
$somme[$k]++; break; ++$somme[$k]; break;
case "2": echo '<td class="bg-warning text-warning'.$rbd.'" headers="'.$td_headers[$k].'">(<span class="glyphicon glyphicon-ok"></span>)<span class="sr-only"> ' . _('Yes') . _(', ifneedbe') . '</span></td>'."\n"; break; case "2": echo '<td class="bg-warning text-warning'.$rbd.'" headers="'.$td_headers[$k].'">(<span class="glyphicon glyphicon-ok"></span>)<span class="sr-only"> ' . _('Yes') . _(', ifneedbe') . '</span></td>'."\n"; break;
default: echo '<td class="bg-danger'.$rbd.'" headers="'.$td_headers[$k].'"><span class="sr-only">' . _('No') . '</span></td>'."\n"; default: echo '<td class="bg-danger'.$rbd.'" headers="'.$td_headers[$k].'"><span class="sr-only">' . _('No') . '</span></td>'."\n";
} }
@ -553,8 +556,8 @@ while ($data = $user_studs->FetchNextObject(false)) {
} }
//demande de confirmation pour modification de ligne //demande de confirmation pour modification de ligne
for ($i=0;$i<$nblignes;$i++) { for ($i=0; $i < $nblignes; ++$i) {
if (isset($_POST["modifierligne$i"])) { if (isset($_POST['modifierligne'. $i])) {
if ($compteur == $i) { if ($compteur == $i) {
echo '<td style="padding:5px"><button type="submit" class="btn btn-success btn-xs" name="validermodifier'.$compteur.'" title="'. _('Save the choices') .' '.stripslashes($nombase).'">'. _('Save') .'</button></td>'."\n"; echo '<td style="padding:5px"><button type="submit" class="btn btn-success btn-xs" name="validermodifier'.$compteur.'" title="'. _('Save the choices') .' '.stripslashes($nombase).'">'. _('Save') .'</button></td>'."\n";
} }
@ -633,7 +636,7 @@ for ($i = 0; $i < $nbcolonnes; $i++) {
} }
$tr_addition .= '<td></td></tr>'; $tr_addition .= '<td></td></tr>';
$meilleursujet = str_replace("°", "'", $meilleursujet).'</ul>'; $meilleursujet = str_replace('°', '\'', $meilleursujet).'</ul>';
$vote_str = ($meilleurecolonne > 1) ? $vote_str = _('votes') : _('vote'); $vote_str = ($meilleurecolonne > 1) ? $vote_str = _('votes') : _('vote');
// Print Addition and Best choice // Print Addition and Best choice
@ -671,7 +674,7 @@ $sql = $connect->Prepare($sql);
$comment_user=$connect->Execute($sql, array($numsondage)); $comment_user=$connect->Execute($sql, array($numsondage));
if ($comment_user->RecordCount() != 0) { if ($comment_user->RecordCount() != 0) {
echo '<div><h3>' . _("Comments of polled people") . '</h3>'."\n"; echo '<div><h3>' . _('Comments of polled people') . '</h3>'."\n";
while($dcomment = $comment_user->FetchNextObject(false)) { while($dcomment = $comment_user->FetchNextObject(false)) {
echo ' echo '
@ -684,7 +687,7 @@ if ($comment_user->RecordCount() != 0) {
echo '</div>'; echo '</div>';
} }
if ($dsondage->format!="A-" && $dsondage->format!="D-") { if ($dsondage->format != 'A-' && $dsondage->format != 'D-') {
echo ' echo '
<div class="hidden-print alert alert-info"> <div class="hidden-print alert alert-info">
<div class="col-md-6 col-md-offset-3"> <div class="col-md-6 col-md-offset-3">