Merge branch 'bugfix' into 'master'
Nettoyage - j'ai remis les double quote pour le texte envoyé par email (il y a des sauts de ligne) - les fonctions dans Utils doivent être appelées avec `self::` en préfixe - `throw new Exception` dans adminstuds produit une erreur - j'ai remplacé les « OpenSondage » par « Framadate » dans install ; on garde un nom unique pour le service en ligne et pour le logiciel. See merge request !28
This commit is contained in:
commit
887f48699a
@ -44,7 +44,8 @@ function getChoicesFromPOST($nbColumns)
|
|||||||
function getNewChoiceFromChoices($choices)
|
function getNewChoiceFromChoices($choices)
|
||||||
{
|
{
|
||||||
if(!is_array($choice)) {
|
if(!is_array($choice)) {
|
||||||
throw new Exception('$choices must be a an array');
|
/* throw new Exception('$choices must be a an array');
|
||||||
|
PHP Fatal error: Class 'Framadate\Exception' not found */
|
||||||
}
|
}
|
||||||
|
|
||||||
$newChoice = '';
|
$newChoice = '';
|
||||||
@ -886,7 +887,7 @@ if (substr($dsondage->format, 0, 1) == 'D') {
|
|||||||
|
|
||||||
// Hours
|
// Hours
|
||||||
$rbd = ($border[$i]) ? ' rbd' : '';
|
$rbd = ($border[$i]) ? ' rbd' : '';
|
||||||
if (isset($horoCur[1]) && $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;
|
||||||
|
@ -20,9 +20,9 @@ namespace Framadate;
|
|||||||
|
|
||||||
class Utils
|
class Utils
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* @return string Server name
|
* @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';
|
||||||
@ -32,9 +32,9 @@ class Utils
|
|||||||
return $scheme . '://' . str_replace('/admin', '', str_replace('//', '/', str_replace('///', '/', $server_name)));
|
return $scheme . '://' . str_replace('/admin', '', str_replace('//', '/', str_replace('///', '/', $server_name)));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns a poll or false if it fails
|
* Returns a poll or false if it fails
|
||||||
*/
|
*/
|
||||||
public static function get_poll_from_id($id)
|
public static function get_poll_from_id($id)
|
||||||
{
|
{
|
||||||
global $connect;
|
global $connect;
|
||||||
@ -60,15 +60,15 @@ class Utils
|
|||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Use get_poll_from_id that is fully english name
|
* Use get_poll_from_id that is fully english name
|
||||||
* @deprecated
|
* @deprecated
|
||||||
*/
|
*/
|
||||||
public static function get_sondage_from_id($id)
|
public static function get_sondage_from_id($id)
|
||||||
{
|
{
|
||||||
return get_poll_from_id($id);
|
return self::get_poll_from_id($id);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function is_error($cerr)
|
public static function is_error($cerr)
|
||||||
{
|
{
|
||||||
@ -94,7 +94,7 @@ class Utils
|
|||||||
<head>
|
<head>
|
||||||
<meta charset="utf-8" />';
|
<meta charset="utf-8" />';
|
||||||
|
|
||||||
echo '<title>';
|
echo '<title>';
|
||||||
if (! empty($title)) {
|
if (! empty($title)) {
|
||||||
echo stripslashes($title) . ' - ';
|
echo stripslashes($title) . ' - ';
|
||||||
}
|
}
|
||||||
@ -184,7 +184,7 @@ class Utils
|
|||||||
$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… »') ."\n" . _('Framasoft ne vit que par vos dons (déductibles des impôts).') ."\n". _('Merci d\'avance pour votre soutien http://soutenir.framasoft.org.');
|
$body = html_entity_decode($body, ENT_QUOTES, 'UTF-8'). "\n--\n\n" . _('« La route est longue, mais la voie est libre… »') ."\n" . _('Framasoft ne vit que par vos dons (déductibles des impôts).') ."\n". _('Merci d’avance pour votre soutien http://soutenir.framasoft.org.');
|
||||||
|
|
||||||
mail($to, $subject, $body, $headers, $param);
|
mail($to, $subject, $body, $headers, $param);
|
||||||
}
|
}
|
||||||
@ -252,12 +252,12 @@ class Utils
|
|||||||
|
|
||||||
return $suppression_OK ;
|
return $suppression_OK ;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param $connect
|
* @param $connect
|
||||||
* @param $log_txt
|
* @param $log_txt
|
||||||
* @return void
|
* @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() LIMIT 20';
|
||||||
|
@ -76,12 +76,12 @@ function ajouter_sondage()
|
|||||||
$connect->Execute($sql, array($poll, $_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\n" ._('You can now modify it at the link above');
|
$message_admin = _("This message should NOT be sent to the polled people. It is private for the poll's creator.\n\nYou can now modify it at the link above");
|
||||||
$message_admin .= " :\n\n%s \n\n" . _('Thanks for your confidence.') . "\n". NOMAPPLICATION;
|
$message_admin .= " :\n\n%s \n\n" . _('Thanks for your confidence.') . "\n". NOMAPPLICATION;
|
||||||
|
|
||||||
$message = sprintf($message, Utils::getUrlSondage($poll));
|
$message = sprintf($message, Utils::getUrlSondage($poll));
|
||||||
|
@ -12,13 +12,13 @@
|
|||||||
<div class="container ombre">
|
<div class="container ombre">
|
||||||
<header role="banner">
|
<header role="banner">
|
||||||
<h1>
|
<h1>
|
||||||
<img src="../images/logo-framadate.png" width="360" height="50" alt="OpenSondage" />
|
<img src="../images/logo-framadate.png" width="360" height="50" alt="Framadate" />
|
||||||
</h1>
|
</h1>
|
||||||
<h2>Make your polls</h2>
|
<h2>Make your polls</h2>
|
||||||
<hr class="trait" role="presentation">
|
<hr class="trait" role="presentation">
|
||||||
</header>
|
</header>
|
||||||
<main role="main">
|
<main role="main">
|
||||||
<h3>OpenSondage Installation</h3>
|
<h3>Framadate Installation</h3>
|
||||||
<div class="alert alert-danger" role="alert">
|
<div class="alert alert-danger" role="alert">
|
||||||
<?php echo htmlspecialchars($e->getMessage(), ENT_COMPAT | ENT_HTML401, 'UTF-8') ?>
|
<?php echo htmlspecialchars($e->getMessage(), ENT_COMPAT | ENT_HTML401, 'UTF-8') ?>
|
||||||
</div>
|
</div>
|
||||||
|
@ -12,13 +12,13 @@
|
|||||||
<div class="container ombre">
|
<div class="container ombre">
|
||||||
<header role="banner">
|
<header role="banner">
|
||||||
<h1>
|
<h1>
|
||||||
<img src="../images/logo-framadate.png" width="360" height="50" alt="OpenSondage" />
|
<img src="../images/logo-framadate.png" width="360" height="50" alt="Framadate" />
|
||||||
</h1>
|
</h1>
|
||||||
<h2>Make your polls</h2>
|
<h2>Make your polls</h2>
|
||||||
<hr class="trait" role="presentation">
|
<hr class="trait" role="presentation">
|
||||||
</header>
|
</header>
|
||||||
<main role="main">
|
<main role="main">
|
||||||
<h3>OpenSondage Installation</h3>
|
<h3>Framadate Installation</h3>
|
||||||
<form action="" method="post" role="form">
|
<form action="" method="post" role="form">
|
||||||
<fieldset>
|
<fieldset>
|
||||||
<legend>General</legend>
|
<legend>General</legend>
|
||||||
|
Loading…
Reference in New Issue
Block a user