diff --git a/adminstuds.php b/adminstuds.php
index 819494c..0ea9a4c 100644
--- a/adminstuds.php
+++ b/adminstuds.php
@@ -76,24 +76,24 @@ 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. ==> two modifications (comment, title, description, ...) on differents polls in the same session will generate only one mail.
+// 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 $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($config['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;
+ }
+ }
}
@@ -109,10 +109,8 @@ if (isset($_POST["boutonnouveautitre"])) {
//Email sent to the admin
if ($connect->Execute($sql, array($nouveautitre, $numsondage))) {
- //if(config_get('use_smtp')==true){
- send_mail_admin();
- //}
- }
+ send_mail_admin();
+ }
}
}
@@ -757,9 +755,10 @@ echo '
';
$colspan_day=1;
}
@@ -956,7 +955,7 @@ echo '
' . _(' remove a column or a line with ') . '' . _('Remove') . '
' . _('and add a new column with '). ''. _('Add a column') . '
' . _('Finally, you can change the informations of this poll like the title, the comments or your email address.') . '
-
+ ';
}
diff --git a/choix_autre.php b/choix_autre.php
index b44b546..978ba66 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 || ((config_get('use_smtp')) ? Utils::issetAndNoEmpty('adresse', $_SESSION) === false : false)) {
+if (Utils::issetAndNoEmpty('titre', $_SESSION) === false || Utils::issetAndNoEmpty('nom', $_SESSION) === false || (($config['use_smtp']) ? Utils::issetAndNoEmpty('adresse', $_SESSION) === false : false)) {
Utils::print_header ( _("Error!") );
bandeau_titre(_("Error!"));
@@ -67,7 +67,7 @@ if (Utils::issetAndNoEmpty('titre', $_SESSION) === false || Utils::issetAndNoEmp
}
}
}
-
+
//format du sondage AUTRE
$_SESSION["formatsondage"]="A".$_SESSION["studsplus"];
@@ -91,15 +91,11 @@ 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)"));
- // 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
+ // 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['default_poll_duration']); //60 sec * 60 min * 24 hours * config
+
+ $removal_date= strftime($date_format['txt_full'], ($_SESSION["champdatefin"]));//textual date
- $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;$i
-
' . _("Your poll will be automatically removed after"). " " . config_get('default_poll_duration') . " " . _("days") . ' '.$removal_date.'. ' . _("You can fix another removal date for it.") .'
+
' . _("Your poll will be automatically removed after"). " " . $config['default_poll_duration'] . " " . _("days") . ': '.$removal_date.'. ' . _("You can fix another removal date for it.") .'
'. _("Once you have confirmed the creation of your poll, you will be automatically redirected on the administration page of your poll."). '
-
' . _("Then, you will receive quickly two emails: one contening the link of your poll for sending it to the voters, the other contening the link to the administration page of your poll.") .'
+
'. _("Once you have confirmed the creation of your poll, you will be automatically redirected on the administration page of your poll."). '
';
+ if($config['use_smtp']==true){
+ echo '
+
' . _("Then, you will receive quickly two emails: one contening the link of your poll for sending it to the voters, the other contening the link to the administration page of your poll.") .'
'. _("These fields are optional. You can add a link, an image or both.") .'
diff --git a/choix_date.php b/choix_date.php
index dcb9b1d..0531b4e 100644
--- a/choix_date.php
+++ b/choix_date.php
@@ -76,7 +76,7 @@ if (!Utils::issetAndNoEmpty('nom', $_SESSION) && !Utils::issetAndNoEmpty('adress
$_SESSION["toutchoix"]=substr($choixdate,1);
// Expiration date → 6 months after last day if not filled or in bad format
- $_SESSION["champdatefin"]=end($temp_results)+15552000;
+ $_SESSION["champdatefin"]=end($temp_results)+(86400 * $config['default_poll_duration']);
if (Utils::issetAndNoEmpty('champdatefin')) {
$registredate = explode("/",$_POST["champdatefin"]);
@@ -124,12 +124,12 @@ if (!Utils::issetAndNoEmpty('nom', $_SESSION) && !Utils::issetAndNoEmpty('adress
$temp_array = array_unique($_SESSION["totalchoixjour"]);
sort($temp_array);
- $removal_date=strftime(_("%A, den %e. %B %Y"), end($temp_array)+15552000);
+ $removal_date=strftime($date_format['txt_full'], end($temp_array)+ (86400 * $config['default_poll_duration']));
// Sumary
$summary = '
';
for ($i=0;$i
-
' . _("Your poll will be automatically removed 6 months after the last date of your poll:") . ' '.$removal_date.'. ' . _("You can fix another removal date for it.") .'
+
' . _("Your poll will be automatically removed "). $config['default_poll_duration'] . ' ' . _("days") ._(" after the last date of your poll:") . ' '.$removal_date.'. ' . _("You can fix another removal date for it.") .'
@@ -163,8 +163,12 @@ if (!Utils::issetAndNoEmpty('nom', $_SESSION) && !Utils::issetAndNoEmpty('adress
-
'. _("Once you have confirmed the creation of your poll, you will be automatically redirected on the administration page of your poll."). '
-
' . _("Then, you will receive quickly two emails: one contening the link of your poll for sending it to the voters, the other contening the link to the administration page of your poll.") .'
+
'. _("Once you have confirmed the creation of your poll, you will be automatically redirected on the administration page of your poll."). '
';
+ if($config['use_smtp']==true){
+ echo '
+
' . _("Then, you will receive quickly two emails: one contening the link of your poll for sending it to the voters, the other contening the link to the administration page of your poll.") .'
';
+ }
+ echo '
@@ -200,6 +204,7 @@ if (!Utils::issetAndNoEmpty('nom', $_SESSION) && !Utils::issetAndNoEmpty('adress
' . _("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.") . '