Merge branch 'issue-choix-date' into 'master'

Issue choix date

- ajout du bandeau Gitlab dans le Readme
- fix pb sondage date sans horaire
- les meilleurs choix sont présentés sous forme de liste
- fix décalage entre l'entête du tableau et le title des radios sur les sondages date

## A11y studs/adminstuds
- ajout d'un caption au tableau
- title contextualisé : « Administration du sondage - blablabla - Framadate »
- remplacement du label sur « Auteur du sondage » (label implique forcément un input)
- liens public/admin remaniés pour avoir une ancre textuelle
- bouton de suppression de colonne uniquement si > 2

… à suivre …

See merge request !3
This commit is contained in:
JosephK 2014-09-29 16:46:43 +02:00
commit 9e8231c62c
5 changed files with 141 additions and 109 deletions

View File

@ -1,3 +1,12 @@
[![](https://git.framasoft.org/assets/logo-black-f52905a40830b30aa287f784b537c823.png)](https://git.framasoft.org)
![English:](http://upload.wikimedia.org/wikipedia/commons/thumb/a/ae/Flag_of_the_United_Kingdom.svg/20px-Flag_of_the_United_Kingdom.svg.png) **Framasoft uses GitLab** for the development of its free softwares. Our Github repositories are only mirrors.
If you want to work with us, **fork us on [git.framasoft.org](https://git.framasoft.org)**. (no registration needed, you can sign in with your Github account)
![Français :](http://upload.wikimedia.org/wikipedia/commons/thumb/c/c3/Flag_of_France.svg/20px-Flag_of_France.svg.png) **Framasoft utilise GitLab** pour le développement de ses logiciels libres. Nos dépôts Github ne sont que des mirroirs.
Si vous souhaitez travailler avec nous, **forkez-nous sur [git.framasoft.org](https://git.framasoft.org)**. (l'inscription n'est pas nécessaire, vous pouvez vous connecter avec votre compte Github)
* * *
Framadate est un fork du projet STUdS : https://sourcesup.cru.fr/projects/studs/
Framadate est le projet qui motorise framadate.org pour framasoft.org

View File

@ -149,7 +149,7 @@ $dsujet=$sujets->FetchObject(false);
$dsondage=$sondage->FetchObject(false);
if (isset($_POST["ajoutsujet"])) {
Utils::print_header('');
Utils::print_header( _("Add a column") .' - ' . stripslashes( $dsondage->titre ));
bandeau_titre(_("Make your polls"));
@ -206,7 +206,7 @@ if (isset($_POST["ajoutsujet"])) {
}
if (isset($_POST["suppressionsondage"])) {
Utils::print_header('');
Utils::print_header( _("Confirm removal of your poll") .' - ' . stripslashes( $dsondage->titre ));
bandeau_titre(_("Confirm removal of your poll"));
@ -241,7 +241,7 @@ if (isset($_POST["confirmesuppression"])) {
_("Thanks for your confidence.") . "\n" . NOMAPPLICATION );
//affichage de l'ecran de confirmation de suppression de sondage
Utils::print_header('');
Utils::print_header(_("Your poll has been removed!"));
bandeau_titre(_("Make your polls"));
@ -639,6 +639,11 @@ if (isset($erreur_ajout_date) && $erreur_ajout_date) {
$errors .= '<li>' . _("The date is not correct !") . '</li>';
}
//Poll title, description and email values
$title = (isset($_POST["boutonnouveautitre"]) && Utils::issetAndNoEmpty('nouveautitre')) ? htmlentities(html_entity_decode($_POST['nouveautitre'], ENT_QUOTES, 'UTF-8'), ENT_QUOTES, 'UTF-8') : stripslashes( $dsondage->titre );
$description = (isset($_POST["nouveauxcommentaires"])) ? stripslashes(htmlentities(html_entity_decode($_POST['nouveauxcommentaires'], ENT_QUOTES, 'UTF-8'), ENT_QUOTES, 'UTF-8')) : stripslashes( $dsondage->commentaires );
$email_admin = (isset($_POST["boutonnouvelleadresse"]) && Utils::issetAndNoEmpty('nouvelleadresse')) ? htmlentities(html_entity_decode($_POST['nouvelleadresse'], ENT_QUOTES, 'UTF-8'), ENT_QUOTES, 'UTF-8') : stripslashes( $dsondage->mail_admin );
if ($errors!='') {
Utils::print_header(_("Error!"));
bandeau_titre(_("Error!"));
@ -646,17 +651,12 @@ if ($errors!='') {
echo '<div class="alert alert-danger"><ul class="list-unstyled">'.$errors.'</ul></div>'."\n";
} else {
Utils::print_header('');
Utils::print_header(_('Poll administration').' - '.$title);
bandeau_titre(_("Make your polls"));
// session_unset();
}
//Poll title, description and email values
$title = (isset($_POST["boutonnouveautitre"]) && Utils::issetAndNoEmpty('nouveautitre')) ? htmlentities(html_entity_decode($_POST['nouveautitre'], ENT_QUOTES, 'UTF-8'), ENT_QUOTES, 'UTF-8') : stripslashes( $dsondage->titre );
$description = (isset($_POST["nouveauxcommentaires"])) ? stripslashes(htmlentities(html_entity_decode($_POST['nouveauxcommentaires'], ENT_QUOTES, 'UTF-8'), ENT_QUOTES, 'UTF-8')) : stripslashes( $dsondage->commentaires );
$email_admin = (isset($_POST["boutonnouvelleadresse"]) && Utils::issetAndNoEmpty('nouvelleadresse')) ? htmlentities(html_entity_decode($_POST['nouvelleadresse'], ENT_QUOTES, 'UTF-8'), ENT_QUOTES, 'UTF-8') : stripslashes( $dsondage->mail_admin );
echo '
<form name="formulaire4" action="' . Utils::getUrlSondage($numsondageadmin, true) . '" method="POST">
<div class="jumbotron">
@ -686,7 +686,7 @@ echo '
<div class="col-md-5">
<div class="form-group" >
<div id="author-form">
<label class="control-label">'. _("Initiator of the poll") .'</label>
<h3 class="control-label">'. _("Initiator of the poll") .'</h3>
<p> '.stripslashes($dsondage->nom_admin).'</p>
</div>
<div id="email-form">
@ -716,11 +716,11 @@ echo '
</div>
<div class="row">
<div class="form-group col-md-5">
<label for="public-link">'._("Public link of the pool") .' <a href="' . Utils::getUrlSondage($dsondage->id_sondage) . '" class="glyphicon glyphicon-link"></a></label>
<label for="public-link"><a class="public-link" href="' . Utils::getUrlSondage($dsondage->id_sondage) . '">'._("Public link of the pool") .' <span class="btn-link glyphicon glyphicon-link"></span></a></label>
<input class="form-control" id="public-link" type="text" readonly="readonly" value="' . Utils::getUrlSondage($dsondage->id_sondage) . '" />
</div>
<div class="form-group col-md-5">
<label for="admin-link">'._("Admin link of the pool") .' <a href="' . Utils::getUrlSondage($numsondageadmin, true) . '" class="glyphicon glyphicon-link"></a></label>
<label for="admin-link"><a class="admin-link" href="' . Utils::getUrlSondage($numsondageadmin, true) . '">'._("Admin link of the pool") .' <span class="btn-link glyphicon glyphicon-link"></span></a></label>
<input class="form-control" id="admin-link" type="text" readonly="readonly" value="' . Utils::getUrlSondage($numsondageadmin, true) . '" />
</div>
<div class="form-group col-md-2">
@ -763,12 +763,12 @@ if ($dsondage->format=="D"||$dsondage->format=="D+") {
for ($i = 0; $i < count($toutsujet); $i++) {
$border[$i] = false;
$radio_title[$i] = strftime("%A %e %B %Y",$current);
// Current date
$current = $toutsujet[$i];
$border[$i] = false;
$radio_title[$i] = strftime("%A %e %B %Y",$current);
// Months
$td_headers[$i] = 'M'.($i+1-$colspan_month);
@ -792,9 +792,9 @@ if ($dsondage->format=="D"||$dsondage->format=="D+") {
}
// Hours
if (strpos($dsujet->sujet,'@') !== false) {
$rbd = ($border[$i]) ? ' rbd' : '';
$hour = substr($toutsujet[$i], strpos($toutsujet[$i], '@')-count($toutsujet[$i])+2);
if (strpos($current,'@') !== false) {
$hour = substr($current, strpos($current, '@')-count($current)+2);
if ($hour != "") {
$tr_hours .= '<th class="bg-info'.$rbd.'" id="H'.$i.'">'.$hour.'</th>';
@ -803,10 +803,12 @@ if ($dsondage->format=="D"||$dsondage->format=="D+") {
} else {
$tr_hours .= '<th class="bg-info'.$rbd.'"></th>';
}
} else {
$tr_hours .= '<th class="bg-info'.$rbd.'"></th>';
}
// Remove col
$tr_add_remove_col .= '<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></button></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></button></td>' : '<td role="presentation"></td>';
}
@ -860,6 +862,7 @@ echo '
</div>
<div id="tableContainer" class="tableContainer">
<table class="results">
<caption>'._('Votes of the poll ').$title.'</caption>
<thead>'. $thead . '</thead>
<tbody>';
@ -1012,7 +1015,7 @@ if (!$testligneamodifier=="true") {
// Addition and Best choice
//affichage de la ligne contenant les sommes de chaque colonne
$tr_addition = '<tr><td align="right">'. _("Addition") .'</td>';
$tr_addition = '<tr><td>'. _("Addition") .'</td>';
$tr_bestchoice = '<tr><td></td>';
$meilleurecolonne = 0;
@ -1032,25 +1035,23 @@ $tr_addition .= '<td></td></tr>';
$toutsujet = explode(",", $dsujet->sujet);
$compteursujet = 0;
$meilleursujet = '';
$meilleursujet = '<ul style="list-style:none">';
for ($i = 0; $i < $nbcolonnes; $i++) {
if (isset($somme[$i]) && $somme[$i] > 0 && $somme[$i] == $meilleurecolonne){
$tr_bestchoice .= '<td><span class="glyphicon glyphicon-star text-warning"></span></td>';
$meilleursujet .= ', ';
if ($dsondage->format == "D" || $dsondage->format == "D+") {
$meilleursujetexport = $toutsujet[$i];
if (strpos($toutsujet[$i], '@') !== false) {
$toutsujetdate = explode("@", $toutsujet[$i]);
$meilleursujet .= strftime(_("%A, den %e. %B %Y"),$toutsujetdate[0]). ' - ' . $toutsujetdate[1];
$meilleursujet .= '<li><b>'.strftime(_("%A, den %e. %B %Y"),$toutsujetdate[0]). ' - ' . $toutsujetdate[1].'</b></li>';
} else {
$meilleursujet .= strftime(_("%A, den %e. %B %Y"),$toutsujet[$i]);
$meilleursujet .= '<li><b>'.strftime(_("%A, den %e. %B %Y"),$toutsujet[$i]).'</b></li>';
}
} else {
$meilleursujet.=$toutsujet[$i];
$meilleursujet.= '<li><b>'.$toutsujet[$i].'</b></li>';
}
$compteursujet++;
@ -1060,25 +1061,26 @@ for ($i = 0; $i < $nbcolonnes; $i++) {
}
$tr_bestchoice .= '<td></td></tr>';
$meilleursujet = str_replace("°", "'", substr("$meilleursujet", 1));
$meilleursujet = str_replace("°", "'", $meilleursujet).'</ul>';
$vote_str = ($meilleurecolonne > 1) ? $vote_str = _('votes') : _('vote');
// Print Addition and Best choice
echo $tr_addition."\n".$tr_bestchoice.'
</tbody>
</table>
</div>
<p class="affichageresultats">'."\n";
<div class="col-sm-4 col-sm-offset-4"><p>'."\n";
if ($compteursujet == 1) {
echo '<span class="glyphicon glyphicon-star text-warning"></span> ' . _("The best choice at this time is:") . ' <b>' . $meilleursujet . ' </b>' . _("with") . ' <b>' . $meilleurecolonne . '</b> ' . $vote_str . ".\n";
echo '<span class="glyphicon glyphicon-star text-warning"></span> ' . _("The best choice at this time is:") . '</p>' . $meilleursujet . '<p>' . _("with") . ' <b>' . $meilleurecolonne . '</b> ' . $vote_str . ".\n";
} elseif ($compteursujet > 1) {
echo '<span class="glyphicon glyphicon-star text-warning"></span> ' . _("The bests choices at this time are:") . ' <b>' . $meilleursujet . ' </b>' . _("with") . ' <b>' . $meilleurecolonne . '</b> ' . $vote_str . ".\n";
echo '<span class="glyphicon glyphicon-star text-warning"></span> ' . _("The bests choices at this time are:") . '</p>' . $meilleursujet . '<p>' . _("with") . ' <b>' . $meilleurecolonne . '</b> ' . $vote_str . ".\n";
}
echo '</p>
</form>
<hr />
echo '
</p></div>
</div>
<hr />
<form name="formulaire4" action="#bas" method="POST">'."\n";
// Commments
$sql = 'SELECT * FROM comments WHERE id_sondage='.$connect->Param('numsondage').' ORDER BY id_comment';

View File

@ -49,6 +49,7 @@ if (!Utils::issetAndNoEmpty('nom', $_SESSION) && !Utils::issetAndNoEmpty('adress
$choixdate='';
if (Utils::issetAndNoEmpty('totalchoixjour', $_SESSION) === true) {
for ($i = 0; $i < count($_SESSION["totalchoixjour"]); $i++) {
if(count($_SESSION['horaires'.$i])!=0) {
for ($j=0;$j< min(count($_SESSION['horaires'.$i]),12);$j++) {
if ($_SESSION['horaires'.$i][$j]!="") {
array_push($temp_results, $_SESSION["totalchoixjour"][$i].'@'.$_SESSION['horaires'.$i][$j]);
@ -56,9 +57,13 @@ if (!Utils::issetAndNoEmpty('nom', $_SESSION) && !Utils::issetAndNoEmpty('adress
array_push($temp_results, $_SESSION["totalchoixjour"][$i]);
}
}
} else {
array_push($temp_results, $_SESSION["totalchoixjour"][$i]);
}
}
}
// Sort and remove doublons
$temp_results = array_unique($temp_results);
sort($temp_results);

View File

@ -86,13 +86,6 @@ div.calendrier td.choisi {
}
/* </calendrier> */
/* Paragraphe sous le sondage */
p.affichageresultats{
text-align: center;
font-family:arial;
font-size:13px;
}
/* Commentaires */
div.comment{
margin-top: 10px;
@ -134,12 +127,32 @@ header .lead {
#admin-link, #public-link {
cursor:text;
}
.admin-link, .public-link,
.admin-link:hover, .public-link:hover {
color:#333;
text-decoration:none;
border:none;
}
.jumbotron h2, .jumbotron .js-title {
margin-bottom:20px;
margin-top:0px;
}
h3.control-label {
display: inline-block;
max-width: 100%;
margin-bottom: 5px;
font-weight: 700;
font-size: 14px;
line-height: 1.42857;
}
caption {
padding: 0 10px 10px;
font-weight:bold;
}
/* adminstuds.php */
#title-form h2 .btn-edit,
#email-form .btn-edit,

View File

@ -211,16 +211,16 @@ if($err != 0) {
die();
}
} else {
Utils::print_header($dsondage->titre);
Utils::print_header(_('Poll').' - '.$dsondage->titre);
bandeau_titre(_("Make your polls"));
}
$titre=str_replace("\\","",$dsondage->titre);
$title=stripslashes(str_replace("\\","",$dsondage->titre));
echo '
<div class="jumbotron">
<div class="row">
<div class="col-md-7">
<h2>'.stripslashes($titre).'</h2>
<h2>'.$title.'</h2>
</div>
<div class="col-md-5">
<div class="btn-group pull-right">
@ -232,11 +232,11 @@ echo '
<div class="row">
<div class="col-md-5">
<div class="form-group">
<label class="control-label">'. _("Initiator of the poll") .' :</label>
<h3 class="control-label">'. _("Initiator of the poll") .'</h3>
<p class="form-control-static"> '.stripslashes($dsondage->nom_admin).'</p>
</div>
<div class="form-group">
<label for="public-link">'._("Public link of the pool") .' <a href="' . Utils::getUrlSondage($dsondage->id_sondage) . '" class="glyphicon glyphicon-link"></a> : </label>
<label for="public-link"><a class="public-link" href="' . Utils::getUrlSondage($dsondage->id_sondage) . '">'._("Public link of the pool") .' <span class="btn-link glyphicon glyphicon-link"></a></label>
<input class="form-control" id="public-link" type="text" readonly="readonly" value="' . Utils::getUrlSondage($dsondage->id_sondage) . '" />
</div>
</div>'."\n";
@ -332,12 +332,12 @@ if ($dsondage->format=="D"||$dsondage->format=="D+") {
for ($i = 0; $i < count($toutsujet); $i++) {
$border[$i] = false;
$radio_title[$i] = strftime("%A %e %B %Y",$current);
// Current date
$current = $toutsujet[$i];
$border[$i] = false;
$radio_title[$i] = strftime("%A %e %B %Y",$current);
// Months
$td_headers[$i] = 'M'.($i+1-$colspan_month);
@ -361,9 +361,9 @@ if ($dsondage->format=="D"||$dsondage->format=="D+") {
}
// Hours
if (strpos($dsondage->sujet,'@') !== false) {
$rbd = ($border[$i]) ? ' rbd' : '';
$hour = substr($toutsujet[$i], strpos($toutsujet[$i], '@')-count($toutsujet[$i])+2);
if (strpos($current,'@') !== false) {
$hour = substr($current, strpos($current, '@')-count($current)+2);
if ($hour != "") {
$tr_hours .= '<th class="bg-info'.$rbd.'" id="H'.$i.'">'.$hour.'</th>';
@ -372,6 +372,8 @@ if ($dsondage->format=="D"||$dsondage->format=="D+") {
} else {
$tr_hours .= '<th class="bg-info'.$rbd.'"></th>';
}
} else {
$tr_hours .= '<th class="bg-info'.$rbd.'"></th>';
}
}
@ -415,6 +417,7 @@ echo '
</div>
<div id="tableContainer" class="tableContainer">
<table class="results">
<caption>'._('Votes of the poll ').$title.'</caption>
<thead>'. $thead . '</thead>
<tbody>';
@ -559,7 +562,7 @@ if (( !(USE_REMOTE_USER && isset($_SERVER['REMOTE_USER'])) || !$user_mod) && $li
// Addition and Best choice
//affichage de la ligne contenant les sommes de chaque colonne
$tr_addition = '<tr><td align="right">'. _("Addition") .'</td>';
$tr_addition = '<tr><td>'. _("Addition") .'</td>';
$tr_bestchoice = '<tr><td></td>';
$meilleurecolonne = 0;
@ -579,25 +582,23 @@ $tr_addition .= '<td></td></tr>';
$toutsujet = explode(",", $dsondage->sujet);
$compteursujet = 0;
$meilleursujet = '';
$meilleursujet = '<ul style="list-style:none">';
for ($i = 0; $i < $nbcolonnes; $i++) {
if (isset($somme[$i]) && $somme[$i] > 0 && $somme[$i] == $meilleurecolonne){
$tr_bestchoice .= '<td><span class="glyphicon glyphicon-star text-warning"></span></td>';
$meilleursujet .= ', ';
if ($dsondage->format == "D" || $dsondage->format == "D+") {
$meilleursujetexport = $toutsujet[$i];
if (strpos($toutsujet[$i], '@') !== false) {
$toutsujetdate = explode("@", $toutsujet[$i]);
$meilleursujet .= strftime(_("%A, den %e. %B %Y"),$toutsujetdate[0]). ' - ' . $toutsujetdate[1];
$meilleursujet .= '<li><b>'.strftime(_("%A, den %e. %B %Y"),$toutsujetdate[0]). ' - ' . $toutsujetdate[1].'</b></li>';
} else {
$meilleursujet .= strftime(_("%A, den %e. %B %Y"),$toutsujet[$i]);
$meilleursujet .= '<li><b>'.strftime(_("%A, den %e. %B %Y"),$toutsujet[$i]).'</b></li>';
}
} else {
$meilleursujet.=$toutsujet[$i];
$meilleursujet.= '<li><b>'.$toutsujet[$i].'</b></li>';
}
$compteursujet++;
@ -607,24 +608,26 @@ for ($i = 0; $i < $nbcolonnes; $i++) {
}
$tr_bestchoice .= '<td></td></tr>';
$meilleursujet = str_replace("°", "'", substr("$meilleursujet", 1));
$meilleursujet = str_replace("°", "'", $meilleursujet).'</ul>';
$vote_str = ($meilleurecolonne > 1) ? $vote_str = _('votes') : _('vote');
// Print Addition and Best choice
echo $tr_addition."\n".$tr_bestchoice.'
</tbody>
</table>
</div>
<p class="affichageresultats">'."\n";
<div class="col-sm-4 col-sm-offset-4"><p>'."\n";
if ($compteursujet == 1) {
echo '<span class="glyphicon glyphicon-star text-warning"></span> ' . _("The best choice at this time is:") . ' <b>' . $meilleursujet . ' </b>' . _("with") . ' <b>' . $meilleurecolonne . '</b> ' . $vote_str . ".\n";
echo '<span class="glyphicon glyphicon-star text-warning"></span> ' . _("The best choice at this time is:") . '</p>' . $meilleursujet . '<p>' . _("with") . ' <b>' . $meilleurecolonne . '</b> ' . $vote_str . ".\n";
} elseif ($compteursujet > 1) {
echo '<span class="glyphicon glyphicon-star text-warning"></span> ' . _("The bests choices at this time are:") . ' <b>' . $meilleursujet . ' </b>' . _("with") . ' <b>' . $meilleurecolonne . '</b> ' . $vote_str . ".\n";
echo '<span class="glyphicon glyphicon-star text-warning"></span> ' . _("The bests choices at this time are:") . '</p>' . $meilleursujet . '<p>' . _("with") . ' <b>' . $meilleurecolonne . '</b> ' . $vote_str . ".\n";
}
echo '</p>
<hr />';
echo '
</p></div>
</div>
<hr />';
// Comments
$sql = 'select * from comments where id_sondage='.$connect->Param('numsondage').' order by id_comment';