Merge branch 'develop' into 'master'

Version 1.1.0-beta.2

See merge request framasoft/framadate!265
This commit is contained in:
Thomas Citharel 2018-03-29 13:50:18 +02:00
commit 6855cf4a47
21 changed files with 109 additions and 64 deletions

View File

@ -2,6 +2,7 @@ image: framasoft/framadate-ci
stages:
- test
- deploy
- beta
- funky
# Run php-cs-fixer and phpunit on all branches
@ -37,6 +38,26 @@ pages:
only:
- master
# Deploy on develop
beta:
stage: beta
script:
- git checkout develop
- composer install -o --no-interaction --no-progress --prefer-dist --no-dev
- composer dump-autoload --optimize --no-dev --classmap-authoritative
- mkdir tpl_c
- mkdir .public
- cp -r * .public
- mv .public public
- mkdir "${HOME}/.ssh"
- chmod 700 "${HOME}/.ssh"
- if [ ! -z ${DEPLOYEMENT_KNOWN_HOSTS+x} ]; then echo -e "${DEPLOYEMENT_KNOWN_HOSTS}" > ${HOME}/.ssh/known_hosts; fi
- eval `ssh-agent -s`
- if [ ! -z ${BETA_KEY+x} ]; then ssh-add <(echo "${BETA_KEY}" | base64 --decode -i); fi
- if [ ! -z ${BETA_KEY+x} ]; then rsync -a --delete --exclude admin/.stdout.log --exclude admin/.htpasswd --exclude app/inc/config.php --exclude stats/ --exclude error/ public/ ${BETA_USER}@${DEPLOYEMENT_HOST}:../../web/; fi
only:
- develop
# Deploy on funky
funky:
stage: funky

View File

@ -78,10 +78,12 @@ class InputService {
}
public function filterInteger($int) {
if (filter_var($int, FILTER_VALIDATE_INT)) {
return $int;
return filter_var($int, FILTER_VALIDATE_INT);
}
return null;
public function filterValueMax($int)
{
return $this->filterInteger($int) >= 1;
}
public function filterBoolean($boolean) {

View File

@ -115,8 +115,8 @@ class Utils {
}
if ($vote_id !== '') {
$url .= '&vote=' . $vote_id . "#edit";
} elseif ($action !== null) {
if ($action_value !== null) {
} elseif ($action) {
if ($action_value) {
$url .= '&' . $action . "=" . $action_value;
} else {
$url .= '&' . $action . "=";

View File

@ -57,7 +57,7 @@ if ($goToStep2) {
$title = $inputService->filterTitle($_POST['title']);
$use_ValueMax = isset($_POST['use_ValueMax']) ? $inputService->filterBoolean($_POST['use_ValueMax']) : false;
$ValueMax = $use_ValueMax === true ? $inputService->filterInteger($_POST['ValueMax']) : null;
$ValueMax = $use_ValueMax === true ? $inputService->filterValueMax($_POST['ValueMax']) : null;
$use_customized_url = isset($_POST['use_customized_url']) ? $inputService->filterBoolean($_POST['use_customized_url']) : false;
$customized_url = $use_customized_url === true ? $inputService->filterId($_POST['customized_url']) : null;
@ -98,11 +98,9 @@ if ($goToStep2) {
$_SESSION['form']->use_password = ($use_password !== null);
$_SESSION['form']->results_publicly_visible = ($results_publicly_visible !== null);
if ($config['use_smtp'] === true) {
if (empty($mail)) {
if ($config['use_smtp'] === true && empty($mail)) {
$error_on_mail = true;
}
}
if ($title !== $_POST['title']) {
$error_on_title = true;
@ -117,11 +115,8 @@ if ($goToStep2) {
}
}
if ($use_ValueMax) {
if ($use_ValueMax === false) {
if ($use_ValueMax && $ValueMax === false) {
$error_on_ValueMax = true;
$error_on_customized_url_msg = __('Error', 'Mauvaise valeur');
}
}
if ($name !== $_POST['name']) {
@ -234,7 +229,7 @@ if (!empty($_POST[GO_TO_STEP_2])) {
if ($error_on_customized_url) {
$errors['customized_url']['aria'] = 'aria-describeby="customized_url" ';
$errors['customized_url']['class'] = ' has-error';
$errors['customized_url']['msg'] = isset($error_on_customized_url_msg) ? $error_on_customized_url_msg : __('Error', 'Something is wrong with the format');
$errors['customized_url']['msg'] = isset($error_on_customized_url_msg) ? $error_on_customized_url_msg : __('Error', "Something is wrong with the format: customized urls should only consist of alphanumeric characters and hyphens.");
}
if ($error_on_description) {
@ -250,7 +245,7 @@ if (!empty($_POST[GO_TO_STEP_2])) {
} elseif ($error_on_name) {
$errors['name']['aria'] = 'aria-describeby="poll_name_error" ';
$errors['name']['class'] = ' has-error';
$errors['name']['msg'] = __('Error', 'Something is wrong with the format');
$errors['name']['msg'] = __('Error', "Something is wrong with the format: name shouldn't have any spaces before or after");
}
if (empty($_POST['mail'])) {
@ -276,7 +271,7 @@ if (!empty($_POST[GO_TO_STEP_2])) {
if ($error_on_ValueMax) {
$errors['ValueMax']['aria'] = 'aria-describeby="poll_ValueMax" ';
$errors['ValueMax']['class'] = ' has-error';
$errors['ValueMax']['msg'] = __('Error', 'error on ValueMax');
$errors['ValueMax']['msg'] = __('Error', 'Error on amount of voters limitation : value must be an integer greater than 0');
}
}
@ -285,6 +280,7 @@ $useRemoteUser = USE_REMOTE_USER && isset($_SERVER['REMOTE_USER']);
$smarty->assign('title', $title);
$smarty->assign('useRemoteUser', $useRemoteUser);
$smarty->assign('errors', $errors);
$smarty->assign('advanced_errors', $goToStep2 && ($error_on_ValueMax || $error_on_customized_url || $error_on_password || $error_on_password_repeat));
$smarty->assign('use_smtp', $config['use_smtp']);
$smarty->assign('default_to_marldown_editor', $config['markdown_editor_by_default']);
$smarty->assign('goToStep2', GO_TO_STEP_2);

File diff suppressed because one or more lines are too long

View File

@ -163,8 +163,12 @@ header form .input-group .input-group-btn {
.editor-toolbar {
margin-top: 10px;
background-color: #eee;
}
#poll_comments {
margin-top: 10px;
}
h4.control-label {
display: inline-block;
@ -274,6 +278,10 @@ table.results thead th {
text-overflow:ellipsis;
}
table.results thead th img {
max-width: 100%;
}
table.results thead .btn {
margin: 0 auto;
display: block;
@ -353,11 +361,11 @@ table.results .btn-link.btn-sm {
position: absolute;
width: 1px;
height: 1px;
padding: 0px;
padding: 0;
margin: -1px;
overflow: hidden;
clip: rect(0px, 0px, 0px, 0px);
border: 0px none;
border: 0 none;
}
.choice input:focus + label {
@ -365,7 +373,7 @@ table.results .btn-link.btn-sm {
outline-offset: -2px;
}
.choice {
width:32px;
width: 35px;
margin:0 auto !important;
}
@ -382,8 +390,8 @@ span.edit-username-left {
}
.yes .btn, .ifneedbe .btn, .no .btn {
width:32px;
color:#555;
width: 35px;
color: #555;
}
.yes .btn,.yes .btn:hover {

19
js/simplemde.min.js vendored

File diff suppressed because one or more lines are too long

View File

@ -328,7 +328,7 @@
"All voters can modify any vote": "All voters can modify any vote",
"Customize the URL": "Customize the URL",
"Go to step 2": "الإنتقال إلى الخطوة 2",
"Limit the ammount of voters per option": "Limit the amount of voters per option",
"Limit the amount of voters per option": "Limit the amount of voters per option",
"More informations here:": "المزيد من التفاصيل هنا :",
"Only the poll maker can see the poll's results": "Only the poll maker can see the poll results",
"Optional parameters": "Optional parameters",

View File

@ -328,7 +328,7 @@
"All voters can modify any vote": "An holl vouezhierien a c'hall kemmañ an holl vouezhioù",
"Customize the URL": "Personelaat an ere",
"Go to step 2": "Mont d'ar bazenn 2",
"Limit the ammount of voters per option": "Limit the amount of voters per option",
"Limit the amount of voters per option": "Limit the amount of voters per option",
"More informations here:": "Titouroù ouzhpenn amañ:",
"Only the poll maker can see the poll's results": "N'eus nemet krouer ar sontadeg a c'hell gwelet an disoc'hoù",
"Optional parameters": "Arventennoù diret",

View File

@ -328,7 +328,7 @@
"All voters can modify any vote": "Jeder Teilnehmer kann jede abgegebene Wertung ändern",
"Customize the URL": "Link anpassen",
"Go to step 2": "Weiter zum 2. Schritt",
"Limit the ammount of voters per option": "Begrenzung der anzahl der aähler pro option",
"Limit the amount of voters per option": "Begrenzung der anzahl der aähler pro option",
"More informations here:": "DE_Plus d'informations ici :",
"Only the poll maker can see the poll's results": "Einzig der Autor der Abstimmung kann die Ergebnisse einsehen",
"Optional parameters": "Optionale Einstellungen",

View File

@ -142,7 +142,10 @@
"Poll id already used": "Identifier is already used",
"Something is going wrong...": "Something has gone wrong...",
"Something is wrong with the format": "Something is wrong with the format",
"Something is wrong with the format: customized urls should only consist of alphanumeric characters and hyphens.": "Something is wrong with the format: customized urls should only consist of alphanumeric characters and hyphens.",
"Something is wrong with the format: name shouldn't have any spaces before or after": "Something is wrong with the format: name shouldn't have any spaces before or after",
"The address is not correct! You should enter a valid email address (like r.stallman@outlock.com) in order to receive the link to your poll.": "The address is not correct! You should enter a valid email address (like r.stallman@outlock.com) in order to receive the link to your poll.",
"Error on amount of voters limitation : value must be an integer greater than 0": "Error on amount of voters limitation : value must be an integer greater than 0",
"The column already exists": "The column already exists",
"The name is invalid.": "The name is invalid.",
"The name you've chosen already exist in this poll!": "The name you've chosen already exists in this poll!",
@ -182,7 +185,7 @@
"Edit": "Edit",
"Framadate is an online service for planning an appointment or make a decision quickly and easily.": "Framadate is an online service for planning an appointment or make a decision quickly and easily.",
"Home": "Home",
"Ifneedbe": "Ifneedbe",
"Ifneedbe": "If need be",
"Legend:": "Legend:",
"Link": "Link",
"Make your polls": "Make your polls",
@ -328,7 +331,7 @@
"All voters can modify any vote": "All voters can modify any vote",
"Customize the URL": "Customize the URL",
"Go to step 2": "Go to step 2",
"Limit the ammount of voters per option": "Limit the amount of voters per option",
"Limit the amount of voters per option": "Limit the amount of voters per option",
"More informations here:": "More informations here:",
"Only the poll maker can see the poll's results": "Only the poll maker can see the poll results",
"Optional parameters": "Optional parameters",

View File

@ -328,7 +328,7 @@
"All voters can modify any vote": "Los votos pueden ser modificados por cualquiera",
"Customize the URL": "ES_Personnaliser le lien",
"Go to step 2": "Ir al paso número 2",
"Limit the ammount of voters per option": "Limitar el número de votantes por opción",
"Limit the amount of voters per option": "Limitar el número de votantes por opción",
"More informations here:": "ES_Plus d'informations ici :",
"Only the poll maker can see the poll's results": "Solo el creador de la encuesta puede ver los resultados",
"Optional parameters": "ES_Paramètres optionnels",

View File

@ -142,7 +142,10 @@
"Poll id already used": "L'identifiant est déjà utilisé",
"Something is going wrong...": "Quelque chose ne va pas...",
"Something is wrong with the format": "Quelque chose ne va pas avec le format",
"Something is wrong with the format: customized urls should only consist of alphanumeric characters and hyphens.": "Quelque chose ne va pas avec le format: les urls personalisées devraient contenir uniquement des caractères alphanumériques et des tirets.",
"Something is wrong with the format: name shouldn't have any spaces before or after": "Quelque chose ne va pas avec le format : le nom ne devrait pas contenir d'espaces avant ou après",
"The address is not correct! You should enter a valid email address (like r.stallman@outlock.com) in order to receive the link to your poll.": "L'adresse saisie n'est pas correcte ! Il faut une adresse électronique valide (par exemple r.stallman@outlock.com) pour recevoir le lien vers le sondage.",
"Error on amount of voters limitation : value must be an integer greater than 0": "Erreur sur le nombre maximum de votants : la valeur doit être un entier supérieur à 0",
"The column already exists": "La colonne existe déjà",
"The name is invalid.": "Le nom n'est pas valide.",
"The name you've chosen already exist in this poll!": "Le nom que vous avez choisi existe déjà !",
@ -328,9 +331,9 @@
"All voters can modify any vote": "Tou·te·s les sondé·e·s peuvent modifier tous les votes",
"Customize the URL": "Personnaliser le lien",
"Go to step 2": "Aller à l'étape 2",
"Limit the ammount of voters per option": "limiter le nombre de votants par option",
"Limit the amount of voters per option": "Limiter le nombre de votant·e·s par option",
"More informations here:": "Plus d'informations ici :",
"Only the poll maker can see the poll's results": "Seul le ou la créateur·rice du sondage peut voir les résultats",
"Only the poll maker can see the poll's results": "Seul·e le ou la créateur·rice du sondage peut voir les résultats",
"Optional parameters": "Paramètres facultatifs",
"Password choice": "Choix",
"Password confirmation": "Confirmation",

View File

@ -142,7 +142,10 @@
"Poll id already used": "L'identifiant est déjà utilisé",
"Something is going wrong...": "Quelque chose ne va pas...",
"Something is wrong with the format": "Quelque chose ne va pas avec le format",
"Something is wrong with the format: customized urls should only consist of alphanumeric characters and hyphens.": "Quelque chose ne va pas avec le format : les urls personalisées devraient contenir uniquement des caractères alphanumériques et des tirets.",
"Something is wrong with the format: name shouldn't have any spaces before or after": "Quelque chose ne va pas avec le format : le nom ne devrait pas contenir d'espaces avant ou après",
"The address is not correct! You should enter a valid email address (like r.stallman@outlock.com) in order to receive the link to your poll.": "L'adresse saisie n'est pas correcte ! Il faut une adresse électronique valide (par exemple r.stallman@outlock.com) pour recevoir le lien vers le sondage.",
"Error on amount of voters limitation : value must be an integer greater than 0": "Erreur sur le nombre maximum de votants : la valeur doit être un entier supérieur à 0",
"The column already exists": "La colonne existe déjà",
"The name is invalid.": "Le nom n'est pas valide.",
"The name you've chosen already exist in this poll!": "Le nom que vous avez choisi existe déjà !",
@ -328,7 +331,7 @@
"All voters can modify any vote": "Tou·te·s les sondé·e·s peuvent modifier tous les votes",
"Customize the URL": "Personnaliser le lien",
"Go to step 2": "Aller à l'étape 2",
"Limit the ammount of voters per option": "limiter le nombre de votants par option",
"Limit the amount of voters per option": "limiter le nombre de votants par option",
"More informations here:": "Plus d'informations ici :",
"Only the poll maker can see the poll's results": "Seul le ou la créateur·rice du sondage peut voir les résultats",
"Optional parameters": "Paramètres facultatifs",

View File

@ -328,7 +328,7 @@
"All voters can modify any vote": "Tutti i votanti possono cambiare tutti i voti",
"Customize the URL": "Personalizzare il link",
"Go to step 2": "Andare al punto 2",
"Limit the ammount of voters per option": "Limitare la quantità di elettori per opzione",
"Limit the amount of voters per option": "Limitare la quantità di elettori per opzione",
"More informations here:": "IT_Plus d'informations ici :",
"Only the poll maker can see the poll's results": "Solo il creatore sondaggio possono vedere i risultati",
"Optional parameters": "Parametri opzionali",

View File

@ -328,7 +328,7 @@
"All voters can modify any vote": "Alle stemmers kunnen elke stem aanpassen",
"Customize the URL": "Link verpersoonlijken",
"Go to step 2": "Ga naar stap 2",
"Limit the ammount of voters per option": "Limit the amount of voters per option",
"Limit the amount of voters per option": "Limit the amount of voters per option",
"More informations here:": "More informations here:",
"Only the poll maker can see the poll's results": "Alleen degene die de poll aangemaakt heeft kan de resultaten zien",
"Optional parameters": "Optionele parameters",

View File

@ -328,7 +328,7 @@
"All voters can modify any vote": "Totes los votants pòdon modificar sos vòtes",
"Customize the URL": "Personalizar lo ligam",
"Go to step 2": "Anar a letapa 2",
"Limit the ammount of voters per option": "Limitar lo nombre de votants per opcion",
"Limit the amount of voters per option": "Limitar lo nombre de votants per opcion",
"More informations here:": "Mai dinformacion aquí :",
"Only the poll maker can see the poll's results": "Solament lo creator del sondatge pòt veire los resultats",
"Optional parameters": "Paramètres opcionals",

View File

@ -53,7 +53,7 @@
<span class="input-group-addon"><i class="glyphicon glyphicon-calendar text-info"></i></span>
<input type="text" class="form-control" id="day{$i}" title="{__('Generic', 'Day')} {$i+1}"
data-date-format="{__('Date', 'dd/mm/yyyy')}" aria-describedby="dateformat{$i}" name="days[]" value="{$day_value}"
size="10" maxlength="10" placeholder="{__('Date', 'dd/mm/yyyy')}" autocomplete="nope"/>
size="10" maxlength="10" placeholder="{__('Date', 'dd/mm/yyyy')}" autocomplete="off"/>
</div>
</div>
<div class="col-xs-2 col-sm-1">

View File

@ -28,7 +28,7 @@
{if $useRemoteUser}
<input type="hidden" name="name" value="{$form->admin_name}" />{$form->admin_name}
{else}
<input id="yourname" type="text" name="name" class="form-control" {$errors['name']['aria']} value="{$poll_name|html}" />
<input id="yourname" type="text" required name="name" class="form-control" {$errors['name']['aria']} value="{$poll_name|html}" />
{/if}
</div>
</div>
@ -51,7 +51,7 @@
{if $useRemoteUser}
<input type="hidden" name="mail" value="{$form->admin_mail}">{$form->admin_mail}
{else}
<input id="email" type="text" name="mail" class="form-control" {$errors['email']['aria']} value="{$poll_mail|html}" />
<input id="email" required type="email" name="mail" class="form-control" {$errors['email']['aria']} value="{$poll_mail|html}" />
{/if}
</div>
</div>
@ -69,7 +69,7 @@
<label for="poll_title" class="col-sm-4 control-label">{__('Step 1', 'Poll title')} *</label>
<div class="col-sm-8">
<input id="poll_title" type="text" name="title" class="form-control" {$errors['title']['aria']}
<input id="poll_title" type="text" name="title" class="form-control" required {$errors['title']['aria']}
value="{$poll_title|html}"/>
</div>
</div>
@ -111,7 +111,7 @@
<span class="lead visible-xs-inline">
<i class="glyphicon glyphicon-cog" aria-hidden="true"></i>
</span>
<a class="optionnal-parameters collapsed lead" role="button" data-toggle="collapse" href="#optionnal" aria-expanded="false" aria-controls="optionnal">
<a class="optionnal-parameters {if !$advanced_errors}collapsed{/if} lead" role="button" data-toggle="collapse" href="#optionnal" aria-expanded="{if $advanced_errors}false{else}true{/if}" aria-controls="optionnal">
{__('Step 1', "Optional parameters")}
<i class="caret" aria-hidden="true"></i>
<i class="caret caret-up" aria-hidden="true"></i>
@ -121,32 +121,32 @@
<div class="clearfix"></div>
<div class="collapse" id="optionnal">
<div class="collapse{if $advanced_errors} in{/if}" id="optionnal" {if $advanced_errors}aria-expanded="true"{/if}>
{* Poll identifier *}
<div class="form-group {$errors['customized_url']['class']}">
{* Value MAX *}
<div class="form-group">
<div class="form-group {$errors['ValueMax']['class']}">
<label for="use_valueMax" class="col-sm-4 control-label">
{__('Step 1', 'Value Max')}<br/>
</label>
<div class="col-sm-8">
<div class="checkbox">
<label>
<input id="use_ValueMax" name="use_ValueMax" type="checkbox" >
{__('Step 1', "Limit the ammount of voters per option")}
<input id="use_ValueMax" name="use_ValueMax" type="checkbox" {if $use_ValueMax}checked{/if}>
{__('Step 1', "Limit the amount of voters per option")}
</label>
</div>
</div>
</div>
<div class="form-group">
<div id="ValueMax"{if !$use_ValueMax} class="hidden"{/if}>
<div class="form-group {$errors['ValueMax']['class']}">
<div id="ValueMax" {if !$use_ValueMax}class="hidden"{/if}>
<div class="col-sm-offset-4 col-sm-8">
<label>
<input id="ValueMax" type="number" min= "0" name="ValueMax">
<input id="ValueMax" type="number" min="0" name="ValueMax" value="{$ValueMax|html}" {$errors['ValueMax']['aria']}>
{__('Step 1', "ValueMax instructions")}
</label>
@ -155,6 +155,14 @@
</div>
</div>
{if !empty($errors['ValueMax']['msg'])}
<div class="alert alert-danger">
<p id="poll_customized_url_error">
{$errors['ValueMax']['msg']}
</p>
</div>
{/if}
{* Poll identifier *}
<div class="form-group {$errors['customized_url']['class']}">

View File

@ -16,7 +16,7 @@
<fieldset id="add-comment"><legend>{__('Comments', 'Add a comment to the poll')}</legend>
<div class="form-group">
<label for="comment_name" class="control-label">{__('Generic', 'Your name')}</label>
<input type="text" name="name" id="comment_name" class="form-control" />
<input type="text" name="name" id="comment_name" class="form-control" maxlength="60" />
</div>
<div class="form-group">
<label for="comment" class="control-label">{__('Comments', 'Your comment')}</label>

View File

@ -184,7 +184,7 @@
<li class="ifneedbe">
<input type="radio" id="i-choice-{$id}" name="choices[{$id}]" value="1" />
<label class="btn btn-default btn-xs" for="i-choice-{$id}" title="{__('Poll results', 'Vote ifneedbe for')|html} {$slot->title|html}">
<i class="glyphicon glyphicon-ok"></i>)<span class="sr-only">{__('Generic', 'Ifneedbe')}</span>
(<i class="glyphicon glyphicon-ok"></i>)<span class="sr-only">{__('Generic', 'Ifneedbe')}</span>
</label>
</li>
{/if}