Commit 0bd4f465 authored by Thomas Citharel's avatar Thomas Citharel
Browse files

Merge branch 'develop' into 'master'

Release 1.1.0-alpha.1

See merge request framasoft/framadate!236
parents 0951a89c 72e0791e
......@@ -10,6 +10,7 @@ vendor
cache/
tpl_c/
.php_cs.cache
.zanata-cache/
# Temp files
*~
......
......@@ -8,12 +8,12 @@ stages:
before_script:
- apt-get update -yqq
- apt-get install zip unzip git -yqq
- curl --silent --show-error https://getcomposer.org/installer | php
# Run php-cs-fixer and phpunit on all branches
test:
stage: test
script:
- curl --silent --show-error https://getcomposer.org/installer | php
- php composer.phar install -o --no-interaction --no-progress --prefer-dist
- mkdir tpl_c
- php vendor/bin/php-cs-fixer fix --verbose --dry-run
......@@ -28,10 +28,14 @@ pages:
script:
- latesttag=$(git describe --tags)
- git checkout ${latesttag}
- curl --silent --show-error https://getcomposer.org/installer | php
- php composer.phar install -o --no-interaction --no-progress --prefer-dist --no-dev
- php composer.phar dump-autoload --optimize --no-dev --classmap-authoritative
- rm -rf composer.phar
- mkdir tpl_c
- zip -r latest.zip .
- mkdir framadate
- mv * framadate
- zip -r latest.zip framadate
- mkdir .public
- cp latest.zip .public
- mv .public public
......@@ -46,6 +50,7 @@ funky:
stage: funky
script:
- git checkout funky
- curl --silent --show-error https://getcomposer.org/installer | php
- php composer.phar install
- mkdir tpl_c
- mkdir .public
......@@ -56,6 +61,16 @@ funky:
- if [ ! -z ${DEPLOYEMENT_KNOWN_HOSTS+x} ]; then echo -e "${DEPLOYEMENT_KNOWN_HOSTS}" > ${HOME}/.ssh/known_hosts; fi
- eval `ssh-agent -s`
- if [ ! -z ${DEPLOYEMENT_KEY+x} ]; then ssh-add <(echo "${DEPLOYEMENT_KEY}" | base64 --decode -i); fi
- if [ ! -z ${DEPLOYEMENT_KEY+x} ]; then rsync -a --delete --exclude admin/.stdout.log --exclude admin/.htpasswd --exclude app/inc/config.php --exclude stats/ --exclude errors/ public/ ${DEPLOYEMENT_USER}@${DEPLOYEMENT_HOST}:../../web/; fi
- if [ ! -z ${DEPLOYEMENT_KEY+x} ]; then rsync -a --delete --exclude admin/.stdout.log --exclude admin/.htpasswd --exclude app/inc/config.php --exclude stats/ --exclude error/ public/ ${DEPLOYEMENT_USER}@${DEPLOYEMENT_HOST}:../../web/; fi
only:
- funky
# Push new translations strings to https://trad.framasoft.org
trads:
stage: deploy
image: framasoft/push-trad:latest
script:
- if [ ! -z ${ZANATA_CONFIG_FRAMABOT+x} ]; then mkdir -p ${HOME}/.config; echo -e "${ZANATA_CONFIG_FRAMABOT}" > ${HOME}/.config/zanata.ini; fi
- if [ ! -z ${ZANATA_CONFIG_FRAMABOT+x} ]; then make push-locales; fi
only:
- develop
#!/bin/bash
for i in po/*.po
do
j=$(echo $i | cut -d '.' -f 1 | cut -d '/' -f 2)
po2json -i $i -t locale/en.json --progress none | ./.renest_json.pl > po/$j.json
done
mv po/*.json locale/
#!/usr/bin/perl
use strict;
use warnings;
use JSON;
#use Hash::Merge::Simple qw(merge);
my $json = JSON->new->utf8->space_before(0)->space_after(1)->indent(4)->canonical(1);
my $new_json = {};
my $old_json = '';
while (defined(my $line = <STDIN>)) {
$old_json .= $line;
}
$old_json = $json->decode($old_json);
for my $key (keys %{$old_json}) {
my $index = index($key, '.');
my $real_key = substr($key, 0, $index++);
my $trad_key = substr($key, $index);
$new_json->{$real_key}->{$trad_key} = $old_json->{$key} if $old_json->{$key};
}
print $json->encode($new_json);
push-locales:
json2po -P -i locale/en.json -t locale/en.json -o po/framadate.pot
zanata-cli -q -B push
pull-locales:
zanata-cli -q -B pull
./.po2json.sh
stats-locales:
zanata-cli -q stats
......@@ -13,7 +13,7 @@ Si vous souhaitez travailler avec nous, **forkez-nous sur [framagit.org](https:/
Un fichier est dédié à l'installation de framadate : [INSTALL.md](INSTALL.md).
# Comment contribuer
# Comment contribuer avec du code
## De votre côté
......@@ -45,6 +45,11 @@ Un fichier est dédié à l'appréhension du code de framadate : [Document techn
Les traductions se trouvent dans le dossier `locale`. Chaque langue est dans un fichier JSON différent organisé par section.
Ne modifiez pas directement les fichiers !
Si vous avez des modifications à y apporter (voire ajouter une nouvelle traduction), allez sur <https://trad.framasoft.org> (tout y est expliqué sur la page d'accueil).
La page de traduction du projet Framadate est <https://trad.framasoft.org/zanata/iteration/view/framadate/master>.
# Synthèses des librairies utilisées
[Smarty](http://www.smarty.net/),
......
......@@ -296,7 +296,7 @@ class PollService {
$best_choices = $this->computeBestChoices($votes);
foreach ($best_choices['y'] as $i => $nb_choice) {
// if for this option we have reached maximum value and user wants to add itself too
if ($nb_choice >= $poll->ValueMax && $user_choice[$i] === "2") {
if ($poll->ValueMax !== null && $nb_choice >= $poll->ValueMax && $user_choice[$i] === "2") {
throw new ConcurrentVoteException();
}
}
......
......@@ -26,7 +26,7 @@ class Utils {
*/
public static function get_server_name() {
$scheme = ((isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] === 'on') || (isset($_SERVER['HTTP_X_FORWARDED_PROTO']) && $_SERVER['HTTP_X_FORWARDED_PROTO'] === 'https')) ? 'https' : 'http';
$port = in_array($_SERVER['SERVER_PORT'], [80, 443], true) ? '' : ':' . $_SERVER['SERVER_PORT'];
$port = in_array($_SERVER['SERVER_PORT'], ['80', '443'], true) ? '' : ':' . $_SERVER['SERVER_PORT'];
$dirname = dirname($_SERVER['SCRIPT_NAME']);
$dirname = $dirname === '\\' ? '/' : $dirname . '/';
$dirname = str_replace('/admin', '', $dirname);
......@@ -88,7 +88,7 @@ class Utils {
*/
public static function getUrlSondage($id, $admin = false, $vote_id = '', $action = null, $action_value = null) {
// URL-Encode $action_value
$action_value = $action_value === null ? null : Utils::base64url_encode($action_value);
$action_value = $action_value ? null : Utils::base64url_encode($action_value);
if (URL_PROPRE) {
if ($admin === true) {
......@@ -98,8 +98,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 . '/' . $action_value;
} else {
$url .= '/action/' . $action;
......
......@@ -18,7 +18,7 @@
*/
// FRAMADATE version
const VERSION = '1.0';
const VERSION = '1.1.0-alpha.1';
// PHP Needed version
const PHP_NEEDED_VERSION = '5.6';
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
*
!.gitignore
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment