Commit ff509ab6 authored by okhin's avatar okhin 🚴
Browse files

Merge branch 'preprod' into 'master'

Preprod

See merge request !61
parents bb599f4f 0bd6723e
......@@ -82,7 +82,7 @@ cs-lint: ## Lint
translations: locales/fr_FR/LC_MESSAGES/messages.mo locales/en_US/LC_MESSAGES/messages.mo ## Generate translations
messages.pot: app/*.php templates/*/*.html
messages.pot: app/*.php app/view/*/*.html
[ -r $@ ] || touch $@
xgettext --package-name=LQDNCampaign --package-version=2016.1 --force-po -o $@ --keyword=__ --keyword=_ --from-code=UTF-8 $^
......
......@@ -7,6 +7,7 @@ use LQDN\Command\AdminChangePasswordCommand;
use LQDN\Command\DonationValidateCommand;
use LQDN\Command\DonationInvalidateCommand;
use LQDN\Command\DonationResetPdfCommand;
use LQDN\Command\DonationCreateCommand;
use LQDN\Command\UserUpdateByAdminCommand;
class Admin extends Controller
......@@ -486,7 +487,7 @@ class Admin extends Controller
WHEN 'hoodie' THEN 8
END
)=$quoi)
";
";
}
if ($status) {
$query .= " AND c.status IN (".\Utils::asl($status).") ";
......@@ -1243,7 +1244,7 @@ class Admin extends Controller
if ($result->rowCount() == 0) {
// Identifier does not exist, we must create it. We have either a pseudo or an email.
$user_field = explode("_", $identifier)[1];
$user = 'asfhjk';
$user = '';
if (strpos($user_field, '@')) {
// identifier is an email
......@@ -1271,18 +1272,36 @@ class Admin extends Controller
} else {
$emails[$email] = 1;
}
// On a besoin de l'utilisateur
$user = $f3->get('container')['user_finder']->findByEmail($email);
// Récupération de l'id du bon abonnement
$result = $db->query("SELECT d.id AS id
$stmt = $db->query("SELECT d.id AS id
FROM dons d
JOIN users u ON u.id = d.user_id
WHERE u.email='".$email. "'
WHERE u.email='".$email."'
AND d.status=101
AND d.id='".$transaction."' ");
print_r($result);
if ($result->rowCount() > 0) {
AND d.id=".$transaction);
$result = $stmt->fetch(\PDO::FETCH_ASSOC);
if (!$result) {
// don non trouvé en statut 101. On le crée (la banque à raison)
// statut = cumul
$f3->get('container')['command_handler']
->handle(new DonationCreateCommand(
$user['id'],
101,
$new_effect,
$amount,
0,
0
));
// Et on le récupère
$cumul = $db->lastInsertId();
$don = $f3->get('container')['donation_finder']->findById($cumul);
} else {
$cumul = $result->fetch(\PDO::FETCH_ASSOC);
$cumul = $result['id'];
if ($cumul!='') {
}
// On regarde si le don n'as pas déjà été ajouté (en vérifiant la datec)
$result = $db->query("SELECT COUNT(1)
FROM dons d
JOIN users u ON u.id = d.user_id
......@@ -1296,9 +1315,6 @@ class Admin extends Controller
if ($combien[0]==0) {
$update ++;
// Don récurrent non comptabilisé, on l'ajoute
$user_id = $db->query("SELECT id FROM users WHERE email='$email'");
$user_id = $user_id->fetch(\PDO::FETCH_ASSOC);
$user_id = $user_id['id'];
$query = "INSERT INTO dons (status,
datec,
somme,
......@@ -1309,7 +1325,7 @@ class Admin extends Controller
102,
'".$new_effect."',
".$amount.",
'".$user_id."',
'".$user['id']."',
'".$cumul."',
'".$identifier."')";
if (!$testing) {
......@@ -1318,16 +1334,12 @@ class Admin extends Controller
$result = $db->query("UPDATE users
SET cumul=cumul+".$amount.",
total=total+".$amount."
WHERE id='".$user_id."'");
WHERE id='".$user['id']."'");
}
} else {
$comptabilise[] = $identifier;
}
}
} else {
$sans_cumul[] = $email;
}
}
}
}
fclose($handle);
......@@ -1339,6 +1351,7 @@ class Admin extends Controller
return $datas;
}
public function stats($f3, $args)
{
$startingDay = new \DateTime('2014-11-12');
......
......@@ -70,7 +70,7 @@ class DonationSeeder extends AbstractSeed
array(
'id' => 3,
'status' => 100,
'datec' => '2016-06-10 12:34',
'datec' => '2016-06-11 12:34',
'somme' => 100,
'lang' => 'fr_FR',
'cadeau' => 1,
......
......@@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: LQDNCampaign 2016.1\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2018-07-19 07:29+0200\n"
"POT-Creation-Date: 2018-11-19 14:57+0100\n"
"PO-Revision-Date: \n"
"Last-Translator: \n"
"Language-Team: \n"
......@@ -17,211 +17,19 @@ msgstr ""
"Content-Transfer-Encoding: 8bit\n"
"X-Generator: Poedit 1.6.10\n"
#: app/Controller.php:68 app/Controller.php:69 app/Controller.php:70
#: app/Controller.php:71 app/Controller.php:76 app/Admin.php:44
#: app/Admin.php:45 app/Admin.php:46 app/Admin.php:47 app/Admin.php:52
msgid "Coupe Homme, Taille"
msgstr "Size cut man"
#: app/Controller.php:72 app/Controller.php:73 app/Controller.php:74
#: app/Controller.php:75 app/Controller.php:77 app/Admin.php:48
#: app/Admin.php:49 app/Admin.php:50 app/Admin.php:51 app/Admin.php:53
msgid "Coupe Femme, Taille"
msgstr "Size cut woman"
#: app/Perso.php:157
msgid "Mauvais identifiant ou mot de passe."
msgstr "Wrong user or password."
#: app/Perso.php:162 app/Perso.php:238 app/Perso.php:265
msgid "Merci de renseigner une adresse mail."
msgstr "Please enter an email."
#: app/Perso.php:196
msgid "Renouvellement de mot de passe"
msgstr "Reset your password."
# php-format
#: app/Perso.php:202
#, php-format
msgid ""
"Bonjour,\n"
"\n"
" Un nouveau mot de passe vient de vous être attribuer "
"pour pouvoir vous connecter à votre page d'administration pour choisir vos "
"contreparties, et nous indiquer vos coordonnées :\n"
" %%URL_ADMIN%%\n"
" Identifiant : votre adresse email\n"
" Mot de passe : %%PASSWORD%%\n"
"\n"
" Encore merci pour votre soutien,\n"
" Toute l'équipe de La Quadrature du Net\n"
" "
msgstr ""
"Hello, \n"
"\n"
"\t\t\t\tA new password has been generated for you to connect yourself to the "
"admin page and to choose your goodies and enter your personal info:\n"
"\t\t\t\t\t%%URL_ADMIN%%\n"
"\t\t\t\t\tId: your email address\n"
"\t\t\t\t\tPassword: %%PASSWORD%%\n"
"\n"
"\t\t\t\t\tThank you again for your support,\n"
"\t\t\t\t\tLa Quadrature du Net Team\n"
"\t\t\t\t\t"
#: app/Perso.php:228
msgid "Nouveau mot de passe envoyé par mail."
msgstr "New password sent by email."
#: app/Perso.php:231
msgid "Oops"
msgstr "Oops"
#: app/Perso.php:235
msgid "Vous n'avez pas encore de compte, merci de faire un don pour cela."
msgstr "You have no account yet, please make a donation."
#: app/Perso.php:262
msgid ""
"Vous avez déjà un compte associé à cette adresse mail, merci de demander un "
"nouveau mot de passe."
msgstr ""
"You have already an account associated with this email address, please renew "
"your password."
#: app/Perso.php:290
msgid "Informations personnelles modifiées."
msgstr "Personal informations modified."
#: app/Perso.php:319
msgid "Cette adresse existe déjà."
msgstr "This address already exists."
#: app/Perso.php:348
msgid ""
"Cette adresse est utilisée et il vous n'avez pas définit d'adresse par "
"défault."
msgstr ""
#: app/Perso.php:408
msgid "Merci, vos contreparties seront envoyées dès que possible !"
msgstr "Thank you, your goodies will be sent as soon as possible!"
#: app/Perso.php:455
msgid "Janvier"
msgstr "January"
#: app/Perso.php:456
msgid "Février"
msgstr "February "
#: app/Perso.php:457
msgid "Mars"
msgstr "March"
#: app/Perso.php:458
msgid "Avril"
msgstr "April"
#: app/Perso.php:459
msgid "Mai"
msgstr "May"
#: app/Perso.php:460
msgid "Juin"
msgstr "June"
#: app/Perso.php:461
msgid "Juillet"
msgstr "July"
#: app/Perso.php:462
msgid "Août"
msgstr "August "
#: app/Perso.php:463
msgid "Septembre"
msgstr "September"
#: app/Perso.php:464
msgid "Octobre"
msgstr "October"
#: app/Perso.php:465
msgid "Novembre"
msgstr "November"
#: app/Perso.php:466
msgid "Décembre"
msgstr "December"
#: app/Bank.php:175
msgid "Merci de soutenir La Quadrature du Net !"
msgstr "Thanks you for supporting La Quadrature du Net"
#: app/Bank.php:179
#, php-format
msgid ""
"\n"
"Cher·e %%NAME%%,\n"
"\n"
"Toute l'équipe de La Quadrature vous remercie du fond du cœur pour votre "
"soutien à ses actions !\n"
"\n"
"Connectez-vous à votre page d'administration pour choisir vos contreparties, "
"et nous indiquer vos coordonnées :\n"
"%%URL_ADMIN%%\n"
"Identifiant : votre adresse email\n"
"\n"
"Grâce à vous et aux nombreux bénévoles qui agissent aux côtés de "
"l'association au quotidien, La Quadrature continuera à analyser, prendre "
"position, débattre, alerter, mobiliser, pour qu'Internet reste un espace de "
"liberté et de partage accessible à tous. Quelle que soit sa forme, la "
"participation de tous est indispensable si nous voulons confirmer et "
"multiplier nos victoires citoyennes. Chacun d'entre nous peut agir au "
"quotidien en s'informant et en diffusant les informations auprès de sa "
"famille, de ses collègues de ses amis, sur les réseaux dits « sociaux » … Il "
"n'y a que de cette manière que nous arriverons à agir ensemble et à nous "
"organiser pour protéger nos droits fondamentaux, partager la culture, nous "
"réapproprier nos données…\n"
"\n"
"En vous connectant à votre page d'administration, vous pourrez télécharger "
"les mille décimales de π que nous vous adressons symboliquement pour votre "
"soutien, et sélectionner les autres contreparties que vous souhaitez "
"recevoir (en fonction de vos différents dons cumulés). Si besoin, vous y "
"trouverez également un reçu pour votre don.\n"
"\n"
"Pour rester informé des actions de La Quadrature du Net et des questions des "
"libertés individuelles sur internet, n'hésitez pas à vous abonner à sa "
"newsletter : https://laquadrature.net/cgi-bin/mailman/listinfo/actu\n"
"\n"
"Encore merci pour votre soutien,\n"
"Toute l'équipe de La Quadrature du Net\n"
msgstr ""
"\n"
"Dear %%NAME%%;\n"
"\n"
"The whole team of La Quadrature du Net thanks you deeply for your support of "
"its actions! \n"
"\n"
"Please connect to the admin page to choose your goodies and enter your "
"personal info:\n"
"%%URL_ADMIN%%\n"
#: templates/user/recurrent.html:4
#: app/view/user/recurrent.html:4
msgid "Vos dons mensuels :"
msgstr "Your monthly donations:"
#: templates/user/recurrent.html:5 templates/user/dons.html:5
#: app/view/user/recurrent.html:5 app/view/user/dons.html:5
msgid "Vos dons programmés :"
msgstr "Your programmed donations"
#: templates/user/recurrent.html:6 templates/user/dons.html:6
#: app/view/user/recurrent.html:6 app/view/user/dons.html:6
msgid "Ici sont listés vos prochains dons programmés par CB."
msgstr "Here are listed your next donations by bank card"
#: templates/user/recurrent.html:7 templates/user/dons.html:7
#: app/view/user/recurrent.html:7 app/view/user/dons.html:7
msgid ""
"Nous travaillons actuellement à une option vous permettant de modifier le "
"montant de votre don ou de l'annuler. Dès que cette possibilité sera "
......@@ -231,25 +39,24 @@ msgstr ""
"amount of the donation or to cancel it. As soon as this possibility will be "
"available, we will contact you."
#: templates/user/recurrent.html:10 templates/user/dons.html:10
#: app/view/user/recurrent.html:10 app/view/user/dons.html:10
msgid "Date de la programmation"
msgstr "Programmed date"
#: templates/user/recurrent.html:11 templates/user/dons.html:11
#: app/view/user/recurrent.html:11 app/view/user/dons.html:11
msgid "Montant du don"
msgstr "Amount"
#: templates/user/recurrent.html:12 templates/user/dons.html:12
#: templates/user/dons.html:32 templates/user/perso.html:239
#: app/view/user/recurrent.html:12 app/view/user/dons.html:12
#: app/view/user/dons.html:32
msgid "Action"
msgstr "Action"
#: templates/user/login.html:8 templates/user/login.html:16
#: templates/user/perso.html:4
#: app/view/user/login.html:8 app/view/user/login.html:16
msgid "Merci de soutenir La Quadrature du Net et ses actions !"
msgstr "Thank you for supporting La Quadrature du Net and its actions!"
#: templates/user/login.html:9
#: app/view/user/login.html:9
msgid ""
"Cette page vous permet de modifier votre pi-xel et vos informations "
"personnelles, de choisir vos contreparties, et liste vos précédents dons."
......@@ -257,67 +64,68 @@ msgstr ""
"This pages allows you to modify your personal information, to choose your "
"goodies and to list your previous donations."
#: templates/user/login.html:21 templates/user/infos.html:9
#: app/view/user/login.html:21 app/view/user/infos.html:9
msgid "Email :"
msgstr "Email:"
#: templates/user/login.html:25
#: app/view/user/login.html:25
msgid "Mot de passe :"
msgstr "Password:"
#: templates/user/infos.html:5
#: app/view/user/infos.html:5
msgid "Vos informations personnelles :"
msgstr "Your personal informations:"
#: templates/user/infos.html:27 templates/user/infos.html:59
msgid "Nom de l'adresse (livraison, principale, etc) :"
msgstr "Name of the address (delivery, principal...):"
#: templates/user/infos.html:30 templates/user/infos.html:62
#: app/view/user/infos.html:26
msgid "Nom, Prénom, Pseudo (pensez au facteur) :"
msgstr "Name, Firstname, Nickname (think about the postman):"
#: templates/user/infos.html:33 templates/user/infos.html:65
#: app/view/user/infos.html:29
msgid "Adresse postale :"
msgstr "Address:"
#: templates/user/infos.html:36 templates/user/infos.html:68
#: app/view/user/infos.html:32
msgid "Complément d'adresse :"
msgstr "Address 2:"
#: templates/user/infos.html:39 templates/user/infos.html:71
#: app/view/user/infos.html:35
msgid "Ville :"
msgstr "City:"
#: templates/user/infos.html:42 templates/user/infos.html:74
#: app/view/user/infos.html:38
#, fuzzy
msgid "Province / État :"
msgstr "Province/State"
#: app/view/user/infos.html:41
msgid "Code Postal :"
msgstr "Postal Code:"
#: templates/user/infos.html:45 templates/user/infos.html:77
#: app/view/user/infos.html:44
msgid "Pays :"
msgstr "Country:"
#: templates/user/infos.html:86
#: app/view/user/infos.html:57
msgid "Vos dons cumulés :"
msgstr "Cumulated donations:"
#: templates/user/infos.html:87
#: app/view/user/infos.html:58
#, c-format
msgid "Vous avez donné pour un total de <strong>%%SUM%% &euro;</strong>."
msgstr "You have give a total of <strong>%%SUM%% &euro;</strong>."
#: templates/user/infos.html:89
#: app/view/user/infos.html:60
#, c-format
msgid ""
"Vous pouvez obtenir des contreparties à hauteur de <strong>%%SUM%% &euro;</"
"strong>."
msgstr "You can claim your goodies to <strong>%%SUM%% &euro;</strong>."
#: templates/user/infos.html:92
#: app/view/user/infos.html:63
msgid "Si vous souhaitez obtenir des contreparties&nbsp;:"
msgstr "If you wish to claim your goodies:"
#: templates/user/infos.html:93
#: app/view/user/infos.html:64
msgid ""
"Vos différents soutiens cumulés vous permettent d'obtenir les contreparties "
"correspondantes aux montants ci-dessous. Cliquez sur l'un d'eux pour choisir "
......@@ -326,7 +134,7 @@ msgstr ""
"Your cumulated donations allow you to obtain the corresponding goodies. "
"Click on one of them to choose what you wish to receive. "
#: templates/user/infos.html:116
#: app/view/user/infos.html:87
#, c-format
msgid ""
"Je ne souhaite <strong>pas</strong> recevoir de cadeaux, afin que "
......@@ -337,21 +145,21 @@ msgstr ""
"cumulated donation (<strong>%%CUMUL%%&euro;</strong>) is entirely used to "
"reinforce La Quadrature du Net. "
#: templates/user/infos.html:121 templates/user/infos.html:129
#: templates/user/infos.html:142 templates/campaign/donation.html:55
#: app/view/user/infos.html:92 app/view/user/infos.html:100
#: app/view/user/infos.html:113 app/view/campaign/donation.html:52
msgid "Votre pi-plôme en tirage original de qualité supérieure"
msgstr "Your pi-plome in original print of superior quality"
#: templates/user/infos.html:122 templates/user/infos.html:130
#: app/view/user/infos.html:93 app/view/user/infos.html:101
msgid "Un splendide 'Pi-shirt' de La Quadrature du Net"
msgstr "A marvelous pi-shirt of La Quadrature du Net"
#: templates/user/infos.html:123
#: app/view/user/infos.html:94
msgid "Un magnifique 'hoodie' de La Quadrature du Net"
msgstr "A splendid hoodie of La Quadrature du Net"
#: templates/user/infos.html:124 templates/user/infos.html:131
#: templates/user/infos.html:137 templates/user/infos.html:143
#: app/view/user/infos.html:95 app/view/user/infos.html:102
#: app/view/user/infos.html:108 app/view/user/infos.html:114
msgid ""
"Dans ce cas, merci de remplir les champs situés sur la partie gauche. Ces "
"informations nous sont nécessaires pour l'envoi du colis."
......@@ -359,67 +167,64 @@ msgstr ""
"In this case, please fill in the form, those informations are needed to send "
"the parcel."
#: templates/user/infos.html:136
#: app/view/user/infos.html:107
msgid "Un pi-bag de qualité supérieure"
msgstr "A pi-bag of superior quality"
#: templates/user/infos.html:150
#: app/view/user/infos.html:121
msgid "Recevoir "
msgstr "Receive "
#: templates/user/infos.html:152
#: app/view/user/infos.html:123
msgid "Le pi-plôme"
msgstr "The pi-plome"
#: templates/user/infos.html:154
#: app/view/user/infos.html:125
msgid "Le pi-bag"
msgstr "The pi-bag"
#: templates/user/infos.html:156
#: app/view/user/infos.html:127
msgid "Le pishirt"
msgstr "The pi-shirt"
#: templates/user/infos.html:158
#: app/view/user/infos.html:129
msgid "Le hoodie"
msgstr "The hoodie"
#: templates/user/infos.html:161
#: app/view/user/infos.html:132
msgid "Pi-plôme à imprimer:"
msgstr "Pi-plome to print:"
#: templates/user/infos.html:167
#: app/view/user/infos.html:138
msgid "Visualiser le pi-plôme sélectionné"
msgstr "Visualise the selected pi-plome"
#: templates/user/infos.html:170
#: app/view/user/infos.html:141
msgid "Coupe et taille du pi-shirt:"
msgstr "Size and cut of the pi-shirt:"
#: templates/user/infos.html:173
#: app/view/user/infos.html:144
msgid "Coupe et taille du hoodie:"
msgstr "Size and cut of the hoodie:"
#: templates/user/infos.html:176
msgid "Adresse de livraison:"
msgstr "Delivery address:"
#: templates/user/infos.html:23
msgid "Vos adresses :) }}</h2>"
#: app/view/user/infos.html:23
#, fuzzy
msgid "Votre adresse postale :) }}</h2>"
msgstr "Your addresses :)}} </h2>"
#: templates/user/dons.html:4
#: app/view/user/dons.html:4
msgid "Vos dons&nbsp;:"
msgstr "Your donations:"
#: templates/user/dons.html:18
#: app/view/user/dons.html:18
msgid "Annuler"
msgstr "Cancel"
#: templates/user/dons.html:23
#: app/view/user/dons.html:23
msgid "Vos dons effectués&nbsp;:"
msgstr "Your past donations"
#: templates/user/dons.html:24
#: app/view/user/dons.html:24
msgid ""
"Ici sont listés les dons que nous avons effectivement perçus (prélèvements "
"mensuels et dons ponctuels)."
......@@ -427,7 +232,7 @@ msgstr ""
"Here are listed all the donation we have received (monthly donation and one-"
"time donations). "
#: templates/user/dons.html:25
#: app/view/user/dons.html:25
msgid ""
"Si vous souhaitez imprimer un reçu, n'hésitez pas à remplir <a href=\"#infos"
"\">vos informations personnelles</a> ci-dessus&nbsp;!"
......@@ -435,275 +240,267 @@ msgstr ""
"If you need to print an invoice, do not hesitate to fill <a href=\"#infos"
"\">this form</a>!"
#: templates/user/dons.html:28 templates/user/contreparties.html:8
#: app/view/user/dons.html:28 app/view/user/perso.html:139
#: app/view/user/perso.html:178 app/view/user/contreparties.html:8
msgid "Date"
msgstr "Date"
#: templates/user/dons.html:29 templates/user/perso.html:236
#: app/view/user/dons.html:29
msgid "Type"
msgstr "Type"
#: templates/user/dons.html:30 templates/user/perso.html:205
#: templates/user/perso.html:235
#: app/view/user/dons.html:30
msgid "Montant"
msgstr "Amount"
#: templates/user/dons.html:31
#: app/view/user/dons.html:31
msgid "Pi-plôme"
msgstr "Pi-plome"
#: templates/user/dons.html:48
#: app/view/user/dons.html:48
msgid "Voir le pi-plôme"
msgstr "See the pi-plome"
#: templates/user/dons.html:54
#: app/view/user/dons.html:54
msgid "Imprimer un reçu pour ce don"
msgstr "Print an invoice for this donation"
#: templates/user/perso.html:5
msgid ""