From 22689ac87d8aeffe09540ad19f1490b1b4553da0 Mon Sep 17 00:00:00 2001 From: Bob Le Bricodeur Date: Mon, 10 Nov 2014 19:22:57 +0100 Subject: [PATCH 01/12] ajout fichier de configuration --- config.inc.php | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 config.inc.php diff --git a/config.inc.php b/config.inc.php new file mode 100644 index 0000000..a537d56 --- /dev/null +++ b/config.inc.php @@ -0,0 +1,21 @@ + Date: Mon, 10 Nov 2014 19:27:18 +0100 Subject: [PATCH 02/12] =?UTF-8?q?ajout=20fonction=20pour=20r=C3=A9cup?= =?UTF-8?q?=C3=A9rer=20des=20options=20dans=20un=20fichier=20de=20configur?= =?UTF-8?q?ation?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/inc/functions.inc.php | 24 ++++++++++++++++++++++++ index.php | 1 + 2 files changed, 25 insertions(+) create mode 100644 app/inc/functions.inc.php diff --git a/app/inc/functions.inc.php b/app/inc/functions.inc.php new file mode 100644 index 0000000..f7b57c3 --- /dev/null +++ b/app/inc/functions.inc.php @@ -0,0 +1,24 @@ +
From a596436548fe8cbca9a1b5a17d06feab41755d3c Mon Sep 17 00:00:00 2001 From: Bob Le Bricodeur Date: Mon, 10 Nov 2014 20:09:47 +0100 Subject: [PATCH 03/12] use config options in index.php file --- config.inc.php | 8 ++++++-- index.php | 32 +++++++++++++++++++++++--------- 2 files changed, 29 insertions(+), 11 deletions(-) diff --git a/config.inc.php b/config.inc.php index a537d56..508c1a9 100644 --- a/config.inc.php +++ b/config.inc.php @@ -17,5 +17,9 @@ * Auteurs de Framadate/OpenSondage : Framasoft (https://github.com/framasoft) */ - $my_option = "test"; - $your_option = "test2"; \ No newline at end of file + /** + * index.php + */ + $show_what_is_that = true; + $show_the_software = true; + $show_cultivate_your_garden = true; \ No newline at end of file diff --git a/index.php b/index.php index 228a842..fce10cc 100644 --- a/index.php +++ b/index.php @@ -21,6 +21,7 @@ namespace Framadate; use Framadate\Utils; include_once __DIR__ . '/app/inc/init.php'; +include_once __DIR__ . '/app/inc/functions.inc.php'; if (is_readable('bandeaux_local.php')) { include_once('bandeaux_local.php'); @@ -33,7 +34,7 @@ session_start(); // affichage de la page Utils::print_header( _("Home") ); bandeau_titre(_("Make your polls")); -echo "test"; + echo '
@@ -52,8 +53,14 @@ echo '

-
-
+
'; + $nbcol = config_get('show_what_is_that') + config_get('show_the_software') + config_get('show_cultivate_your_garden'); + if ($nbcol > 0){ + $colmd = 12/$nbcol; // 3 =>col-md-4, 2 =>col-md-6, 1 =>col-md-12. + //echo "mon test : ".$nbActivation; + } + if(config_get('show_what_is_that') == true){ + echo '

'. _('What is that?') . '

'. _('Framadate is an online service for planning an appointment or make a decision quickly and easily. No registration is required.') .'

@@ -65,8 +72,11 @@ echo '
  • '. _('Discuss and make a decision') . '
  • '. _('Do you want to ') . ''. _("view an example?") .'

    -
    -
    +
    '; + } + + if(config_get('show_the_software') == true){ + echo '

    '. _('The software') .'

    '. _('Framadate was initially based on '). 'Studs'. _(' a software developed by the University of Strasbourg. Today, it is devevoped by the association Framasoft') .'.

    @@ -79,15 +89,19 @@ echo '
  • Opera 11+
  • '. _('It is governed by the ').''. _('CeCILL-B license').'.

    -
    -
    +
    '; + } + + if(config_get('show_cultivate_your_garden') == true){ + echo '

    '. _('Cultivate your garden') .'

    '. _('To participate in the software development, suggest improvements or simply download it, please visit ') .''._('the development site').'.


    '. _('If you want to install the software for your own use and thus increase your independence, we help you on:') .'

    framacloud.org

    -
    -
    '."\n"; +
    '; + } + echo '
    '."\n"; bandeau_pied(); From 4edf3b308ffded867fe4bd91214497b859e2e873 Mon Sep 17 00:00:00 2001 From: Bob Le Bricodeur Date: Tue, 11 Nov 2014 12:31:52 +0100 Subject: [PATCH 04/12] =?UTF-8?q?Modification=20des=20appels=20de=20functi?= =?UTF-8?q?on.inc.php=20(ajout=20dans=20init)=20pour=20=C3=AAtre=20accessi?= =?UTF-8?q?ble=20par=20toutes=20les=20pages?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/inc/init.php | 2 +- index.php | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/app/inc/init.php b/app/inc/init.php index fde0576..62890bd 100644 --- a/app/inc/init.php +++ b/app/inc/init.php @@ -25,7 +25,7 @@ require_once __DIR__ . '/../../vendor/autoload.php'; include_once __DIR__ . '/constants.php'; include_once __DIR__ . '/i18n.php'; - +include_once __DIR__ . '/functions.inc.php'; $connect = NewADOConnection(BASE_TYPE); $connect->Connect(SERVEURBASE, USERBASE, USERPASSWD, BASE); diff --git a/index.php b/index.php index fce10cc..14361fc 100644 --- a/index.php +++ b/index.php @@ -21,7 +21,6 @@ namespace Framadate; use Framadate\Utils; include_once __DIR__ . '/app/inc/init.php'; -include_once __DIR__ . '/app/inc/functions.inc.php'; if (is_readable('bandeaux_local.php')) { include_once('bandeaux_local.php'); From 8ce89a4321b7402a8cac9c511cd114ac2c64dcf2 Mon Sep 17 00:00:00 2001 From: Bob Le Bricodeur Date: Tue, 11 Nov 2014 20:19:12 +0100 Subject: [PATCH 05/12] $default_poll_duration variable creation dynamic usage of the $default_poll_duration variable to display coherent information to user. --- choix_autre.php | 6 +++--- config.inc.php | 27 ++++++++++++++++++++++++--- locale/en_GB/LC_MESSAGES/Studs.mo | Bin 16748 -> 16805 bytes locale/en_GB/LC_MESSAGES/Studs.po | 24 +++++++++++++++++------- locale/fr_FR/LC_MESSAGES/Studs.mo | Bin 18523 -> 18579 bytes locale/fr_FR/LC_MESSAGES/Studs.po | 14 ++++++++++---- 6 files changed, 54 insertions(+), 17 deletions(-) diff --git a/choix_autre.php b/choix_autre.php index 54b45b3..8c0b268 100644 --- a/choix_autre.php +++ b/choix_autre.php @@ -57,8 +57,8 @@ if (Utils::issetAndNoEmpty('titre', $_SESSION) === false || Utils::issetAndNoEmp $temp_results=substr($temp_results,1); $_SESSION["toutchoix"]=$temp_results; - // Expiration date → after 6 months if not filled or in bad format - $_SESSION["champdatefin"]=time()+15552000; + // Expiration date → the configuration value is used if not filled or in bad format + $_SESSION["champdatefin"]= time()+ (86400 * config_get('default_poll_duration')); //60 secondes * 60 minutes * 24 heures * config if (Utils::issetAndNoEmpty('champdatefin')) { $registredate = explode("/",$_POST["champdatefin"]); @@ -137,7 +137,7 @@ if (Utils::issetAndNoEmpty('titre', $_SESSION) === false || Utils::issetAndNoEmp '. $summary .'
    -

    ' . _("Your poll will be automatically removed after 6 months:") . ' '.$removal_date.'.
    ' . _("You can fix another removal date for it.") .'

    +

    ' . _("Your poll will be automatically removed after"). " " . config_get('default_poll_duration') . " " . _("days") . ' '.$removal_date.'.
    ' . _("You can fix another removal date for it.") .'

    diff --git a/config.inc.php b/config.inc.php index 508c1a9..4f16d7e 100644 --- a/config.inc.php +++ b/config.inc.php @@ -17,9 +17,30 @@ * Auteurs de Framadate/OpenSondage : Framasoft (https://github.com/framasoft) */ + /** + * general configuration + */ + + //is a smtp server is configured to send e-mail ? + //$use_smtp = true; + /** * index.php */ - $show_what_is_that = true; - $show_the_software = true; - $show_cultivate_your_garden = true; \ No newline at end of file + + //display "how to use" section + $show_what_is_that = true; + + //display technical information about the software + $show_the_software = true; + + //display "developpement and administration" information + $show_cultivate_your_garden = true; + + /** + * choix_autre.php + */ + //default values for the new poll duration (number of days). + $default_poll_duration = 180; + + \ No newline at end of file diff --git a/locale/en_GB/LC_MESSAGES/Studs.mo b/locale/en_GB/LC_MESSAGES/Studs.mo index ed66bf3a3526d170e6127f6711e2b91e12b3291a..9532f8e64f01172b23be6b990310515e19fe3e52 100644 GIT binary patch delta 3513 zcmYk-d2miw9LDkU%0^@%#Mx%A60KUY6})3!7(2OY+@7YP#s2v`X(xr4^R_)f(l(E z@mIbT>X3Fqb<`6z&~Vh=7ofIoI`Y7n1*rOKQ0=$c`+@x=;wd{CZS>yD=3{U<%eDK@6BgPEIie1JR3B*dEUz+iw0r z?Qx9P?f3=UK|U9K7{bY#hc99!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}nTd@aTL4xNu!JM2*3R2OB4tBvk$hMoy zs6Bp!>bR@Vm|d8IMff|ez%)+SGTe@8m&2no1xKJ3whI;deW-~a!ZJPo=SZkx7Ncql z)?zsxK+U{Us@t#!>Ja9lA~OIL>M^L0PQrAoLV{*KMOJ9`p|;?H^%iQ2|H8J6Z-R(F zKNHHoUf3J^;$$qw4XBQroQ(~t+k ztVO?0^>z|Ey?e1OHenw;jzrx&L4srwnT7Va02P5Ts0dBPb~qmcu-fKp@JEj^D{Xlh zqtD=eIr{KycjB+TxKDvrVlv%{gkuodc+`Y^sQanb-l#n;M6I|K_1KkTC@#ccTyD!h zKuvTDDk6;-i0!k8zixQ5+!b_2?P;2|5Atp@gHiP+pc+=9LOc((*B_x?WIL@VQ1yR7 zMeHu>jOgfRfEU>n)6Y*r9Zp7dRDlZN3RHvDsFiL+9(mJfy?`8a^8huG=$>xO*R`AH?1396ZU@V4V5~{;=49CH! ztr&}1*mTquSK0eDsD*xryyE?42Z@;!#AmyQZ8@sp7F>*9VFhOPc31o{YT!m|Git&u zsD<3ZNq7etz>LUozafpNGchjLt^Yd4>G_{Wf_r8)M&c3F;X8-w@F!GcuG;)Vj3NIR z71EFw+;(xO`f1n(GjR#_wBkGIZ79jcY6t=NHz%D2ydDz7Kq$V090WzA zYmtL*nox)DK2~DLi|&hMA$B4E8S3ddjN0PMsD49vz3#&JzQn(X#J3czz%bsc%g{kJ zjPLJ$8*)%9TaOBT9V#-Lu?+X(6pS9=ZovX9Ctr`6c$)&ZT@30FCZHmd;wPa{=c7XU z5~kxgOh(;L!a7uh4p_fK?eTTgbAAuC1rM#=1 U-IFpBI{v@zP$#yy6ZL2P3kX|xga7~l diff --git a/locale/en_GB/LC_MESSAGES/Studs.po b/locale/en_GB/LC_MESSAGES/Studs.po index 7b4a345..c239848 100644 --- a/locale/en_GB/LC_MESSAGES/Studs.po +++ b/locale/en_GB/LC_MESSAGES/Studs.po @@ -3,8 +3,8 @@ msgstr "" "Project-Id-Version: Framadate 0.8\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2014-10-23 20:52+0100\n" -"PO-Revision-Date: 2014-10-23 20:52+0100\n" -"Last-Translator: JosephK\n" +"PO-Revision-Date: 2014-11-11 20:12+0100\n" +"Last-Translator: mrB \n" "Language-Team: JosephK\n" "Language: English\n" "MIME-Version: 1.0\n" @@ -81,6 +81,12 @@ msgstr "%A, den %e. %B %Y" msgid "Expiration's date" msgstr "Expiration's date" +msgid "days" +msgstr "days" + +msgid "months" +msgstr "months" + ########### Language selector ########### msgid "Change the language" msgstr "Change the language" @@ -555,8 +561,8 @@ msgid "Removal date:" msgstr "Removal date:" # Step 3 choix_autre.php -msgid "Your poll will be automatically removed after 6 months:" -msgstr "Your poll will be automatically removed after 6 months:" +msgid "Your poll will be automatically removed after" +msgstr "Your poll will be automatically removed after" msgid "You can fix another removal date for it." msgstr "You can fix another removal date for it." @@ -616,12 +622,15 @@ msgstr "" msgid "Thanks for your confidence." msgstr "Thanks for your confidence." -msgid "\n" -"--\n\n" +msgid "" +"\n" +"--\n" +"\n" "« La route est longue, mais la voie est libre… »\n" "Framasoft ne vit que par vos dons (déductibles des impôts).\n" "Merci d'avance pour votre soutien http://soutenir.framasoft.org." -msgstr "\n" +msgstr "" +"\n" "\n" "\n" "\n" @@ -666,3 +675,4 @@ msgstr "Author's message" msgid "For sending to the polled users" msgstr "For sending to the polled users" + diff --git a/locale/fr_FR/LC_MESSAGES/Studs.mo b/locale/fr_FR/LC_MESSAGES/Studs.mo index 95ecc918e15b01882872e5d1bb4bed4458eaf67e..3053598a8a96ef2f5cad3cb99b80e471babd507b 100644 GIT binary patch delta 3520 zcmXZd2~gB!7{~EvVL^~%RfN0+O+4`6@Ptr6&1xLS3r&p-6aj%nL8lzjjgf9sn!g>I zrBT_KjXF4u<&jsEnyEGA7)sh@Hf3IonbTO`U;Ag+{k-qH|Mz{L_j%uU_iTg5dC?R2 zu7md_iG7H47`EW%J+ z=zi{Zt;No?KZB8G0c)g?K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Kn}WN?{A1Jy8lOGg+vP)1CGOPWxKNa;N9nv zDl=PC$-g2zPs35Xf?4?C0Ase`L$q-HKzraWgN#`~Jq?x0N({mp)YhEDu~>(TuoqDc z#obtp^%#naIAFSMEBq8R(AyY?n^0SE#PK2yr+x<&amrKnZJCNnYqbKBS*XA~UW S?6YpBZMI5=udrg%3;zdWrju*{ diff --git a/locale/fr_FR/LC_MESSAGES/Studs.po b/locale/fr_FR/LC_MESSAGES/Studs.po index 5de3587..c647757 100644 --- a/locale/fr_FR/LC_MESSAGES/Studs.po +++ b/locale/fr_FR/LC_MESSAGES/Studs.po @@ -3,8 +3,8 @@ msgstr "" "Project-Id-Version: Framadate 0.8\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2014-10-23 20:52+0100\n" -"PO-Revision-Date: 2014-10-23 20:52+0100\n" -"Last-Translator: JosephK\n" +"PO-Revision-Date: 2014-11-11 13:19+0100\n" +"Last-Translator: mrB \n" "Language-Team: JosephK\n" "Language: French\n" "MIME-Version: 1.0\n" @@ -81,6 +81,12 @@ msgstr "%A %e %B %Y" msgid "Expiration's date" msgstr "Date d'expiration" +msgid "days" +msgstr "jours" + +msgid "months" +msgstr "mois" + ########### Language selector ########### msgid "Change the language" msgstr "Changer la langue" @@ -555,8 +561,8 @@ msgid "Removal date:" msgstr "Date de suppression :" # Step 3 choix_autre.php -msgid "Your poll will be automatically removed after 6 months:" -msgstr "Votre sondage sera automatiquement effacé dans 6 mois :" +msgid "Your poll will be automatically removed after" +msgstr "Votre sondage sera automatiquement effacé dans" msgid "You can fix another removal date for it." msgstr "Néanmoins vous pouvez décider ci-dessous d'une date plus rapprochée pour la suppression de votre sondage." From 221848e62aa84547861e299c0988b0a7f47209c0 Mon Sep 17 00:00:00 2001 From: Bob Le Bricodeur Date: Tue, 11 Nov 2014 20:28:14 +0100 Subject: [PATCH 06/12] variable $show_language_bar_selection to display the language bar in the header --- bandeaux.php | 11 +++++++---- config.inc.php | 3 +++ 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/bandeaux.php b/bandeaux.php index 0eb77f1..b3c0249 100644 --- a/bandeaux.php +++ b/bandeaux.php @@ -25,16 +25,19 @@ function bandeau_titre($titre) { $img = ( IMAGE_TITRE ) ? ''.NOMAPPLICATION.'' : ''; echo ' -
    -
    +
    '; + if(config_get('show_language_bar_selection')){ + echo '
    - -

    '.$img.'

    + '; + } + echo ' +

    '.$img.'

    '. $titre .'


    diff --git a/config.inc.php b/config.inc.php index 4f16d7e..b9ef90d 100644 --- a/config.inc.php +++ b/config.inc.php @@ -24,6 +24,9 @@ //is a smtp server is configured to send e-mail ? //$use_smtp = true; + //if only one language is allowed in constants.php, $ALLOWED_LANGUAGES, the language selection bar is useless + $show_language_bar_selection = true; + /** * index.php */ From 09991be2aad94becefee58547cf8691044dd5333 Mon Sep 17 00:00:00 2001 From: Bob Le Bricodeur Date: Tue, 11 Nov 2014 20:56:03 +0100 Subject: [PATCH 07/12] new variable $user_can_add_link_or_url to choose if the http link can be displayed during poll creation --- choix_autre.php | 17 +++++++++++------ config.inc.php | 3 +++ 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/choix_autre.php b/choix_autre.php index 8c0b268..0ec091a 100644 --- a/choix_autre.php +++ b/choix_autre.php @@ -175,9 +175,11 @@ if (Utils::issetAndNoEmpty('titre', $_SESSION) === false || Utils::issetAndNoEmp echo '

    '. _("To make a generic poll you need to propose at least two choices between differents subjects.") .'

    -

    '. _("You can add or remove additional choices with the buttons") .' '. _("Remove") .' '. _("Add") .'

    -

    '. _("It's possible to propose links or images by using "). ''. _("the Markdown syntax") .'.

    -
    '."\n"; +

    '. _("You can add or remove additional choices with the buttons") .' '. _("Remove") .' '. _("Add") .'

    '; + if(config_get('user_can_add_link_or_url')){ + echo '

    '. _("It's possible to propose links or images by using "). ''. _("the Markdown syntax") .'.

    '; + } + echo '
    '."\n"; // Fields choices : 5 by default $nb_choices = (isset($_SESSION['choices'])) ? max(count($_SESSION['choices']), 5) : 5; @@ -187,9 +189,12 @@ if (Utils::issetAndNoEmpty('titre', $_SESSION) === false || Utils::issetAndNoEmp
    - -   -
    + '; + if(config_get('user_can_add_link_or_url')){ + echo ' '; + } + echo ' +
    '."\n"; } diff --git a/config.inc.php b/config.inc.php index b9ef90d..824e92c 100644 --- a/config.inc.php +++ b/config.inc.php @@ -46,4 +46,7 @@ //default values for the new poll duration (number of days). $default_poll_duration = 180; + //user can add link or URL when creating his poll. + $user_can_add_link_or_url = false; + \ No newline at end of file From e24c74c93b9cc26db8c2536a864a390d4b19bc8e Mon Sep 17 00:00:00 2001 From: Bob Le Bricodeur Date: Wed, 12 Nov 2014 11:10:36 +0100 Subject: [PATCH 08/12] deplace config.inc.php file from root to app/inc dir. Allow access from anywhere and not only from a file present in root dir. --- config.inc.php => app/inc/config.inc.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) rename config.inc.php => app/inc/config.inc.php (94%) diff --git a/config.inc.php b/app/inc/config.inc.php similarity index 94% rename from config.inc.php rename to app/inc/config.inc.php index 824e92c..78b1a54 100644 --- a/config.inc.php +++ b/app/inc/config.inc.php @@ -44,7 +44,7 @@ * choix_autre.php */ //default values for the new poll duration (number of days). - $default_poll_duration = 180; + $default_poll_duration = 10; //user can add link or URL when creating his poll. $user_can_add_link_or_url = false; From 52a783fba200bc45cb17077d8e843549100acdcb Mon Sep 17 00:00:00 2001 From: Bob Le Bricodeur Date: Wed, 12 Nov 2014 11:44:57 +0100 Subject: [PATCH 09/12] MAJ https://github.com/framasoft ==> https://git.framasoft.org/framasoft/framadate --- app/inc/config.inc.php | 4 ++-- app/inc/functions.inc.php | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/app/inc/config.inc.php b/app/inc/config.inc.php index 78b1a54..e38bfb4 100644 --- a/app/inc/config.inc.php +++ b/app/inc/config.inc.php @@ -5,7 +5,7 @@ * http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.txt * * Authors of STUdS (initial project): Guilhem BORGHESI (borghesi@unistra.fr) and Raphaël DROZ - * Authors of Framadate/OpenSondate: Framasoft (https://github.com/framasoft) + * Authors of Framadate/OpenSondate: Framasoft (https://git.framasoft.org/framasoft/framadate) * * ============================= * @@ -14,7 +14,7 @@ * http://www.cecill.info/licences/Licence_CeCILL-B_V1-fr.txt * * Auteurs de STUdS (projet initial) : Guilhem BORGHESI (borghesi@unistra.fr) et Raphaël DROZ - * Auteurs de Framadate/OpenSondage : Framasoft (https://github.com/framasoft) + * Auteurs de Framadate/OpenSondage : Framasoft (https://git.framasoft.org/framasoft/framadate) */ /** diff --git a/app/inc/functions.inc.php b/app/inc/functions.inc.php index f7b57c3..28c5025 100644 --- a/app/inc/functions.inc.php +++ b/app/inc/functions.inc.php @@ -5,7 +5,7 @@ * http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.txt * * Authors of STUdS (initial project): Guilhem BORGHESI (borghesi@unistra.fr) and Raphaël DROZ - * Authors of Framadate/OpenSondate: Framasoft (https://github.com/framasoft) + * Authors of Framadate/OpenSondate: Framasoft (https://git.framasoft.org/framasoft/framadate) * * ============================= * @@ -14,7 +14,7 @@ * http://www.cecill.info/licences/Licence_CeCILL-B_V1-fr.txt * * Auteurs de STUdS (projet initial) : Guilhem BORGHESI (borghesi@unistra.fr) et Raphaël DROZ - * Auteurs de Framadate/OpenSondage : Framasoft (https://github.com/framasoft) + * Auteurs de Framadate/OpenSondage : Framasoft (https://git.framasoft.org/framasoft/framadate) */ function config_get($p_option){ include('config.inc.php'); From e53043b232dfda2d36a91a150e476e8a51a945a1 Mon Sep 17 00:00:00 2001 From: Bob Le Bricodeur Date: Wed, 12 Nov 2014 16:35:13 +0100 Subject: [PATCH 10/12] $_SESSION["champdatefin"] modification (created in step 3 and only modified in needed in step 4) handle date format for windows platform --- choix_autre.php | 15 ++++++++++----- creation_sondage.php | 5 +++-- 2 files changed, 13 insertions(+), 7 deletions(-) diff --git a/choix_autre.php b/choix_autre.php index 0ec091a..09cc5d4 100644 --- a/choix_autre.php +++ b/choix_autre.php @@ -57,8 +57,6 @@ if (Utils::issetAndNoEmpty('titre', $_SESSION) === false || Utils::issetAndNoEmp $temp_results=substr($temp_results,1); $_SESSION["toutchoix"]=$temp_results; - // Expiration date → the configuration value is used if not filled or in bad format - $_SESSION["champdatefin"]= time()+ (86400 * config_get('default_poll_duration')); //60 secondes * 60 minutes * 24 heures * config if (Utils::issetAndNoEmpty('champdatefin')) { $registredate = explode("/",$_POST["champdatefin"]); @@ -69,7 +67,7 @@ if (Utils::issetAndNoEmpty('titre', $_SESSION) === false || Utils::issetAndNoEmp } } } - + //format du sondage AUTRE $_SESSION["formatsondage"]="A".$_SESSION["studsplus"]; @@ -93,9 +91,16 @@ if (Utils::issetAndNoEmpty('titre', $_SESSION) === false || Utils::issetAndNoEmp Utils::print_header ( _("Removal date and confirmation (3 on 3)") ); bandeau_titre(_("Removal date and confirmation (3 on 3)")); - $removal_date=strftime(_("%A, den %e. %B %Y"), time()+15552000); + // Expiration date is initialised with config parameter. Value will be modified in step 4 if user has defined an other date + $_SESSION["champdatefin"]= time()+ (86400 * config_get('default_poll_duration')); //60 secondes * 60 minutes * 24 heures * config - // Sumary + $date_format = _("%A, den %e. %B %Y"); //locale replacement + if (strtoupper(substr(PHP_OS,0,3))=='WIN'){ //%e can't be used on Windows platform, use %#d instead + $date_format = preg_replace('#(?'; for ($i=0;$ititre' in adminstuds.php) --- adminstuds.php | 30 ++++++++++++-------- app/inc/config.inc.php | 6 ++-- choix_autre.php | 2 +- creation_sondage.php | 27 +++++++++--------- infos_sondage.php | 62 ++++++++++++++++++++++++++---------------- studs.php | 16 ++++++----- 6 files changed, 83 insertions(+), 60 deletions(-) diff --git a/adminstuds.php b/adminstuds.php index 827d51e..819494c 100644 --- a/adminstuds.php +++ b/adminstuds.php @@ -76,21 +76,25 @@ if (!$sondage || $sondage->RecordCount() != 1){ $dsujet=$sujets->FetchObject(false); $dsondage=$sondage->FetchObject(false); -// Send email (only once during the session) to alert admin of the change he made +// Send email (only once during the session) to alert admin of the change he made. ==> two modifications (comment, title, description, ...) on differents polls in the same session will generate only one mail. $email_admin = $dsondage->mail_admin; +$poll_title = $dsondage->titre; function send_mail_admin() { global $email_admin; + global $poll_title; global $numsondageadmin; + if(config_get('use_smtp')==true){ + if(!isset($_SESSION["mail_admin_sent"])) { + Utils::sendEmail( $email_admin, + _("[ADMINISTRATOR] New settings for your poll") . ' ' . stripslashes( $poll_title ), + _("You have changed the settings of your poll. \nYou can modify this poll with this link") . + " :\n\n" . Utils::getUrlSondage($numsondageadmin, true) . "\n\n" . + _("Thanks for your confidence.") . "\n" . NOMAPPLICATION + ); + $_SESSION["mail_admin_sent"]=true; + } + } - if(!isset($_SESSION["mail_admin_sent"])) { - Utils::sendEmail( $email_admin, - _("[ADMINISTRATOR] New settings for your poll") . ' ' . stripslashes( $dsondage->titre ), - _("You have changed the settings of your poll. \nYou can modify this poll with this link") . - " :\n\n" . Utils::getUrlSondage($numsondageadmin, true) . "\n\n" . - _("Thanks for your confidence.") . "\n" . NOMAPPLICATION - ); - $_SESSION["mail_admin_sent"]=true; - } } //si la valeur du nouveau titre est valide et que le bouton est activé @@ -105,8 +109,10 @@ if (isset($_POST["boutonnouveautitre"])) { //Email sent to the admin if ($connect->Execute($sql, array($nouveautitre, $numsondage))) { - send_mail_admin(); - } + //if(config_get('use_smtp')==true){ + send_mail_admin(); + //} + } } } diff --git a/app/inc/config.inc.php b/app/inc/config.inc.php index e38bfb4..f702747 100644 --- a/app/inc/config.inc.php +++ b/app/inc/config.inc.php @@ -21,8 +21,8 @@ * general configuration */ - //is a smtp server is configured to send e-mail ? - //$use_smtp = true; + //use email for polls creation/modification/responses notification + $use_smtp = true; //if only one language is allowed in constants.php, $ALLOWED_LANGUAGES, the language selection bar is useless $show_language_bar_selection = true; @@ -44,7 +44,7 @@ * choix_autre.php */ //default values for the new poll duration (number of days). - $default_poll_duration = 10; + $default_poll_duration = 30; //user can add link or URL when creating his poll. $user_can_add_link_or_url = false; diff --git a/choix_autre.php b/choix_autre.php index 09cc5d4..b44b546 100644 --- a/choix_autre.php +++ b/choix_autre.php @@ -28,7 +28,7 @@ if (file_exists('bandeaux_local.php')) { } // Step 1/3 : error if $_SESSION from info_sondage are not valid -if (Utils::issetAndNoEmpty('titre', $_SESSION) === false || Utils::issetAndNoEmpty('nom', $_SESSION) === false || Utils::issetAndNoEmpty('adresse', $_SESSION) === false) { +if (Utils::issetAndNoEmpty('titre', $_SESSION) === false || Utils::issetAndNoEmpty('nom', $_SESSION) === false || ((config_get('use_smtp')) ? Utils::issetAndNoEmpty('adresse', $_SESSION) === false : false)) { Utils::print_header ( _("Error!") ); bandeau_titre(_("Error!")); diff --git a/creation_sondage.php b/creation_sondage.php index 449999e..6d9921c 100644 --- a/creation_sondage.php +++ b/creation_sondage.php @@ -68,22 +68,23 @@ function ajouter_sondage() $sql = $connect->Prepare($sql); $connect->Execute($sql, array($sondage, $_SESSION['toutchoix'])); - $message = _("This is the message you have to send to the people you want to poll. \nNow, you have to send this message to everyone you want to poll."); - $message .= "\n\n"; - $message .= stripslashes(html_entity_decode($_SESSION["nom"],ENT_QUOTES,"UTF-8"))." " . _("hast just created a poll called") . " : \"".stripslashes(htmlspecialchars_decode($_SESSION["titre"],ENT_QUOTES))."\".\n"; - $message .= _("Thanks for filling the poll at the link above") . " :\n\n%s\n\n" . _("Thanks for your confidence.") . "\n".NOMAPPLICATION; + if(config_get('use_smtp')==true){ + $message = _("This is the message you have to send to the people you want to poll. \nNow, you have to send this message to everyone you want to poll."); + $message .= "\n\n"; + $message .= stripslashes(html_entity_decode($_SESSION["nom"],ENT_QUOTES,"UTF-8"))." " . _("hast just created a poll called") . " : \"".stripslashes(htmlspecialchars_decode($_SESSION["titre"],ENT_QUOTES))."\".\n"; + $message .= _("Thanks for filling the poll at the link above") . " :\n\n%s\n\n" . _("Thanks for your confidence.") . "\n".NOMAPPLICATION; - $message_admin = _("This message should NOT be sent to the polled people. It is private for the poll's creator.\n\nYou can now modify it at the link above"); - $message_admin .= " :\n\n"."%s \n\n" . _("Thanks for your confidence.") . "\n".NOMAPPLICATION; + $message_admin = _("This message should NOT be sent to the polled people. It is private for the poll's creator.\n\nYou can now modify it at the link above"); + $message_admin .= " :\n\n"."%s \n\n" . _("Thanks for your confidence.") . "\n".NOMAPPLICATION; - $message = sprintf($message, Utils::getUrlSondage($sondage)); - $message_admin = sprintf($message_admin, Utils::getUrlSondage($sondage_admin, true)); - - if (Utils::isValidEmail($_SESSION['adresse'])) { - Utils::sendEmail( "$_SESSION[adresse]", "[".NOMAPPLICATION."][" . _("Author's message") . "] " . _("Poll") . " : ".stripslashes(htmlspecialchars_decode($_SESSION["titre"],ENT_QUOTES)), $message_admin, $_SESSION['adresse'] ); - Utils::sendEmail( "$_SESSION[adresse]", "[".NOMAPPLICATION."][" . _("For sending to the polled users") . "] " . _("Poll") . " : ".stripslashes(htmlspecialchars_decode($_SESSION["titre"],ENT_QUOTES)), $message, $_SESSION['adresse'] ); - } + $message = sprintf($message, Utils::getUrlSondage($sondage)); + $message_admin = sprintf($message_admin, Utils::getUrlSondage($sondage_admin, true)); + if (Utils::isValidEmail($_SESSION['adresse'])) { + Utils::sendEmail( "$_SESSION[adresse]", "[".NOMAPPLICATION."][" . _("Author's message") . "] " . _("Poll") . " : ".stripslashes(htmlspecialchars_decode($_SESSION["titre"],ENT_QUOTES)), $message_admin, $_SESSION['adresse'] ); + Utils::sendEmail( "$_SESSION[adresse]", "[".NOMAPPLICATION."][" . _("For sending to the polled users") . "] " . _("Poll") . " : ".stripslashes(htmlspecialchars_decode($_SESSION["titre"],ENT_QUOTES)), $message, $_SESSION['adresse'] ); + } + } error_log(date('H:i:s d/m/Y:') . ' CREATION: '.$sondage."\t".$_SESSION[formatsondage]."\t".$_SESSION[nom]."\t".$_SESSION[adresse]."\t \t".$_SESSION[toutchoix]."\n", 3, 'admin/logs_studs.txt'); Utils::cleaning_polls($connect, 'admin/logs_studs.txt'); diff --git a/infos_sondage.php b/infos_sondage.php index dc65d4d..2bb36fe 100644 --- a/infos_sondage.php +++ b/infos_sondage.php @@ -77,9 +77,11 @@ if (Utils::issetAndNoEmpty("poursuivre")){ unset($_SESSION["mailsonde"]); $_SESSION["mailsonde"] = ($mailsonde !== null) ? true : false; - if (Utils::isValidEmail($adresse) === false) { - $erreur_adresse = true; - } + if (config_get('use_smtp')==true){ + if (Utils::isValidEmail($adresse) === false) { + $erreur_adresse = true; + } + } if (preg_match(';<|>|";',$titre)) { $erreur_injection_titre = true; @@ -94,7 +96,14 @@ if (Utils::issetAndNoEmpty("poursuivre")){ } // Si pas d'erreur dans l'adresse alors on change de page vers date ou autre - if ($titre && $nom && $adresse && !$erreur_adresse && ! $erreur_injection_titre && ! $erreur_injection_commentaires && ! $erreur_injection_nom) { + if(config_get('use_smtp')==true){ + $email_OK = $adresse && !$erreur_adresse; + } + else{ + $email_OK = true; + } + + if ($titre && $nom && $email_OK && ! $erreur_injection_titre && ! $erreur_injection_commentaires && ! $erreur_injection_nom) { if ( $poursuivre == "creation_sondage_date" ) { header("Location:choix_date.php"); @@ -242,16 +251,19 @@ echo ' '.$input_name.'
    - '.$errors['name']['msg'].' -
    - -
    - '.$input_email.' -
    -
    - '.$errors['email']['msg'].' + '.$errors['name']['msg']; + if(config_get('use_smtp')==true){ + echo ' +
    + +
    + '.$input_email.' +
    +
    + '.$errors['email']['msg']; + } -
    + echo '
    -
    -
    -
    -
    - -
    -
    -
    +
    '; + if(config_get('use_smtp')==true){ + echo '
    +
    +
    + +
    +
    +
    '; + } -

    + echo '

    diff --git a/studs.php b/studs.php index dcd5081..cd999ae 100644 --- a/studs.php +++ b/studs.php @@ -173,13 +173,15 @@ if (!Utils::is_error(NO_POLL) && (isset($_POST["boutonp"]))) { $connect->Execute($sql, array($nom, $numsondage, $nouveauchoix)); if ($dsondage->mailsonde || /* compatibility for non boolean DB */ $dsondage->mailsonde=="yes" || $dsondage->mailsonde=="true") { - Utils::sendEmail( "$dsondage->mail_admin", - "[".NOMAPPLICATION."] "._("Poll's participation")." : ".html_entity_decode($dsondage->titre, ENT_QUOTES, 'UTF-8')."", - html_entity_decode("\"$nom\" ", ENT_QUOTES, 'UTF-8'). - _("has filled a line.\nYou can find your poll at the link") . " :\n\n". - Utils::getUrlSondage($numsondage) . " \n\n" . - _("Thanks for your confidence.") . "\n". NOMAPPLICATION ); - } + if(config_get('use_smtp')==true){ + Utils::sendEmail( "$dsondage->mail_admin", + "[".NOMAPPLICATION."] "._("Poll's participation")." : ".html_entity_decode($dsondage->titre, ENT_QUOTES, 'UTF-8')."", + html_entity_decode("\"$nom\" ", ENT_QUOTES, 'UTF-8'). + _("has filled a line.\nYou can find your poll at the link") . " :\n\n". + Utils::getUrlSondage($numsondage) . " \n\n" . + _("Thanks for your confidence.") . "\n". NOMAPPLICATION ); + } + } } } else { $err |= NAME_EMPTY; From a716ef8c47d3311f1c3fd483f3275ef781e94b42 Mon Sep 17 00:00:00 2001 From: Bob Le Bricodeur Date: Wed, 12 Nov 2014 21:28:27 +0100 Subject: [PATCH 12/12] delete configuration option $show_language_bar_selection condition is based on the number of languages configured --- app/inc/config.inc.php | 3 --- bandeaux.php | 3 ++- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/app/inc/config.inc.php b/app/inc/config.inc.php index f702747..07488aa 100644 --- a/app/inc/config.inc.php +++ b/app/inc/config.inc.php @@ -24,9 +24,6 @@ //use email for polls creation/modification/responses notification $use_smtp = true; - //if only one language is allowed in constants.php, $ALLOWED_LANGUAGES, the language selection bar is useless - $show_language_bar_selection = true; - /** * index.php */ diff --git a/bandeaux.php b/bandeaux.php index b3c0249..dd2e1d3 100644 --- a/bandeaux.php +++ b/bandeaux.php @@ -23,10 +23,11 @@ include_once __DIR__ . '/app/inc/init.php'; // bandeaux de titre function bandeau_titre($titre) { + global $ALLOWED_LANGUAGES; $img = ( IMAGE_TITRE ) ? ''.NOMAPPLICATION.'' : ''; echo '
    '; - if(config_get('show_language_bar_selection')){ + if(count($ALLOWED_LANGUAGES)>1){ echo '