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 ...@@ -82,7 +82,7 @@ cs-lint: ## Lint
translations: locales/fr_FR/LC_MESSAGES/messages.mo locales/en_US/LC_MESSAGES/messages.mo ## Generate translations 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 $@ [ -r $@ ] || touch $@
xgettext --package-name=LQDNCampaign --package-version=2016.1 --force-po -o $@ --keyword=__ --keyword=_ --from-code=UTF-8 $^ 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; ...@@ -7,6 +7,7 @@ use LQDN\Command\AdminChangePasswordCommand;
use LQDN\Command\DonationValidateCommand; use LQDN\Command\DonationValidateCommand;
use LQDN\Command\DonationInvalidateCommand; use LQDN\Command\DonationInvalidateCommand;
use LQDN\Command\DonationResetPdfCommand; use LQDN\Command\DonationResetPdfCommand;
use LQDN\Command\DonationCreateCommand;
use LQDN\Command\UserUpdateByAdminCommand; use LQDN\Command\UserUpdateByAdminCommand;
class Admin extends Controller class Admin extends Controller
...@@ -486,7 +487,7 @@ class Admin extends Controller ...@@ -486,7 +487,7 @@ class Admin extends Controller
WHEN 'hoodie' THEN 8 WHEN 'hoodie' THEN 8
END END
)=$quoi) )=$quoi)
"; ";
} }
if ($status) { if ($status) {
$query .= " AND c.status IN (".\Utils::asl($status).") "; $query .= " AND c.status IN (".\Utils::asl($status).") ";
...@@ -1243,7 +1244,7 @@ class Admin extends Controller ...@@ -1243,7 +1244,7 @@ class Admin extends Controller
if ($result->rowCount() == 0) { if ($result->rowCount() == 0) {
// Identifier does not exist, we must create it. We have either a pseudo or an email. // Identifier does not exist, we must create it. We have either a pseudo or an email.
$user_field = explode("_", $identifier)[1]; $user_field = explode("_", $identifier)[1];
$user = 'asfhjk'; $user = '';
if (strpos($user_field, '@')) { if (strpos($user_field, '@')) {
// identifier is an email // identifier is an email
...@@ -1271,18 +1272,36 @@ class Admin extends Controller ...@@ -1271,18 +1272,36 @@ class Admin extends Controller
} else { } else {
$emails[$email] = 1; $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 // 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 FROM dons d
JOIN users u ON u.id = d.user_id JOIN users u ON u.id = d.user_id
WHERE u.email='".$email. "' WHERE u.email='".$email."'
AND d.status=101 AND d.status=101
AND d.id='".$transaction."' "); AND d.id=".$transaction);
print_r($result); $result = $stmt->fetch(\PDO::FETCH_ASSOC);
if ($result->rowCount() > 0) { 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->fetch(\PDO::FETCH_ASSOC);
$cumul = $result['id']; $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) $result = $db->query("SELECT COUNT(1)
FROM dons d FROM dons d
JOIN users u ON u.id = d.user_id JOIN users u ON u.id = d.user_id
...@@ -1296,9 +1315,6 @@ class Admin extends Controller ...@@ -1296,9 +1315,6 @@ class Admin extends Controller
if ($combien[0]==0) { if ($combien[0]==0) {
$update ++; $update ++;
// Don récurrent non comptabilisé, on l'ajoute // 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, $query = "INSERT INTO dons (status,
datec, datec,
somme, somme,
...@@ -1309,7 +1325,7 @@ class Admin extends Controller ...@@ -1309,7 +1325,7 @@ class Admin extends Controller
102, 102,
'".$new_effect."', '".$new_effect."',
".$amount.", ".$amount.",
'".$user_id."', '".$user['id']."',
'".$cumul."', '".$cumul."',
'".$identifier."')"; '".$identifier."')";
if (!$testing) { if (!$testing) {
...@@ -1318,16 +1334,12 @@ class Admin extends Controller ...@@ -1318,16 +1334,12 @@ class Admin extends Controller
$result = $db->query("UPDATE users $result = $db->query("UPDATE users
SET cumul=cumul+".$amount.", SET cumul=cumul+".$amount.",
total=total+".$amount." total=total+".$amount."
WHERE id='".$user_id."'"); WHERE id='".$user['id']."'");
} }
} else { } else {
$comptabilise[] = $identifier; $comptabilise[] = $identifier;
} }
} }
} else {
$sans_cumul[] = $email;
}
}
} }
} }
fclose($handle); fclose($handle);
...@@ -1339,6 +1351,7 @@ class Admin extends Controller ...@@ -1339,6 +1351,7 @@ class Admin extends Controller
return $datas; return $datas;
} }
public function stats($f3, $args) public function stats($f3, $args)
{ {
$startingDay = new \DateTime('2014-11-12'); $startingDay = new \DateTime('2014-11-12');
......
...@@ -70,7 +70,7 @@ class DonationSeeder extends AbstractSeed ...@@ -70,7 +70,7 @@ class DonationSeeder extends AbstractSeed
array( array(
'id' => 3, 'id' => 3,
'status' => 100, 'status' => 100,
'datec' => '2016-06-10 12:34', 'datec' => '2016-06-11 12:34',
'somme' => 100, 'somme' => 100,
'lang' => 'fr_FR', 'lang' => 'fr_FR',
'cadeau' => 1, 'cadeau' => 1,
......
...@@ -7,7 +7,7 @@ msgid "" ...@@ -7,7 +7,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: LQDNCampaign 2016.1\n" "Project-Id-Version: LQDNCampaign 2016.1\n"
"Report-Msgid-Bugs-To: \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" "PO-Revision-Date: \n"
"Last-Translator: \n" "Last-Translator: \n"
"Language-Team: \n" "Language-Team: \n"
...@@ -17,211 +17,19 @@ msgstr "" ...@@ -17,211 +17,19 @@ msgstr ""
"Content-Transfer-Encoding: 8bit\n" "Content-Transfer-Encoding: 8bit\n"
"X-Generator: Poedit 1.6.10\n" "X-Generator: Poedit 1.6.10\n"
#: app/Controller.php:68 app/Controller.php:69 app/Controller.php:70 #: app/view/user/recurrent.html:4
#: 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
msgid "Vos dons mensuels :" msgid "Vos dons mensuels :"
msgstr "Your monthly donations:" 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 :" msgid "Vos dons programmés :"
msgstr "Your programmed donations" 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." msgid "Ici sont listés vos prochains dons programmés par CB."
msgstr "Here are listed your next donations by bank card" 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 "" msgid ""
"Nous travaillons actuellement à une option vous permettant de modifier le " "Nous travaillons actuellement à une option vous permettant de modifier le "
"montant de votre don ou de l'annuler. Dès que cette possibilité sera " "montant de votre don ou de l'annuler. Dès que cette possibilité sera "
...@@ -231,25 +39,24 @@ msgstr "" ...@@ -231,25 +39,24 @@ msgstr ""
"amount of the donation or to cancel it. As soon as this possibility will be " "amount of the donation or to cancel it. As soon as this possibility will be "
"available, we will contact you." "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" msgid "Date de la programmation"
msgstr "Programmed date" 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" msgid "Montant du don"
msgstr "Amount" msgstr "Amount"
#: templates/user/recurrent.html:12 templates/user/dons.html:12 #: app/view/user/recurrent.html:12 app/view/user/dons.html:12
#: templates/user/dons.html:32 templates/user/perso.html:239 #: app/view/user/dons.html:32
msgid "Action" msgid "Action"
msgstr "Action" msgstr "Action"
#: templates/user/login.html:8 templates/user/login.html:16 #: app/view/user/login.html:8 app/view/user/login.html:16
#: templates/user/perso.html:4
msgid "Merci de soutenir La Quadrature du Net et ses actions !" msgid "Merci de soutenir La Quadrature du Net et ses actions !"
msgstr "Thank you for supporting La Quadrature du Net and its 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 "" msgid ""
"Cette page vous permet de modifier votre pi-xel et vos informations " "Cette page vous permet de modifier votre pi-xel et vos informations "
"personnelles, de choisir vos contreparties, et liste vos précédents dons." "personnelles, de choisir vos contreparties, et liste vos précédents dons."
...@@ -257,67 +64,68 @@ msgstr "" ...@@ -257,67 +64,68 @@ msgstr ""
"This pages allows you to modify your personal information, to choose your " "This pages allows you to modify your personal information, to choose your "
"goodies and to list your previous donations." "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 :" msgid "Email :"
msgstr "Email:" msgstr "Email:"
#: templates/user/login.html:25 #: app/view/user/login.html:25
msgid "Mot de passe :" msgid "Mot de passe :"
msgstr "Password:" msgstr "Password:"
#: templates/user/infos.html:5 #: app/view/user/infos.html:5
msgid "Vos informations personnelles :" msgid "Vos informations personnelles :"
msgstr "Your personal informations:" msgstr "Your personal informations:"
#: templates/user/infos.html:27 templates/user/infos.html:59 #: app/view/user/infos.html:26
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
msgid "Nom, Prénom, Pseudo (pensez au facteur) :" msgid "Nom, Prénom, Pseudo (pensez au facteur) :"
msgstr "Name, Firstname, Nickname (think about the postman):" 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 :" msgid "Adresse postale :"
msgstr "Address:" msgstr "Address:"
#: templates/user/infos.html:36 templates/user/infos.html:68 #: app/view/user/infos.html:32
msgid "Complément d'adresse :" msgid "Complément d'adresse :"
msgstr "Address 2:" msgstr "Address 2:"
#: templates/user/infos.html:39 templates/user/infos.html:71 #: app/view/user/infos.html:35
msgid "Ville :" msgid "Ville :"
msgstr "City:" 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 :" msgid "Code Postal :"
msgstr "Postal Code:" msgstr "Postal Code:"
#: templates/user/infos.html:45 templates/user/infos.html:77 #: app/view/user/infos.html:44
msgid "Pays :" msgid "Pays :"
msgstr "Country:" msgstr "Country:"
#: templates/user/infos.html:86 #: app/view/user/infos.html:57
msgid "Vos dons cumulés :" msgid "Vos dons cumulés :"
msgstr "Cumulated donations:" msgstr "Cumulated donations:"
#: templates/user/infos.html:87 #: app/view/user/infos.html:58
#, c-format #, c-format
msgid "Vous avez donné pour un total de <strong>%%SUM%% &euro;</strong>." msgid "Vous avez donné pour un total de <strong>%%SUM%% &euro;</strong>."
msgstr "You have give a total of <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 #, c-format
msgid "" msgid ""
"Vous pouvez obtenir des contreparties à hauteur de <strong>%%SUM%% &euro;</" "Vous pouvez obtenir des contreparties à hauteur de <strong>%%SUM%% &euro;</"
"strong>." "strong>."
msgstr "You can claim your goodies to <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;:" msgid "Si vous souhaitez obtenir des contreparties&nbsp;:"
msgstr "If you wish to claim your goodies:" msgstr "If you wish to claim your goodies:"
#: templates/user/infos.html:93 #: app/view/user/infos.html:64
msgid "" msgid ""
"Vos différents soutiens cumulés vous permettent d'obtenir les contreparties " "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 " "correspondantes aux montants ci-dessous. Cliquez sur l'un d'eux pour choisir "
...@@ -326,7 +134,7 @@ msgstr "" ...@@ -326,7 +134,7 @@ msgstr ""
"Your cumulated donations allow you to obtain the corresponding goodies. " "Your cumulated donations allow you to obtain the corresponding goodies. "
"Click on one of them to choose what you wish to receive. " "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 #, c-format
msgid "" msgid ""
"Je ne souhaite <strong>pas</strong> recevoir de cadeaux, afin que " "Je ne souhaite <strong>pas</strong> recevoir de cadeaux, afin que "
...@@ -337,21 +145,21 @@ msgstr "" ...@@ -337,21 +145,21 @@ msgstr ""
"cumulated donation (<strong>%%CUMUL%%&euro;</strong>) is entirely used to " "cumulated donation (<strong>%%CUMUL%%&euro;</strong>) is entirely used to "
"reinforce La Quadrature du Net. " "reinforce La Quadrature du Net. "
#: templates/user/infos.html:121 templates/user/infos.html:129 #: app/view/user/infos.html:92 app/view/user/infos.html:100
#: templates/user/infos.html:142 templates/campaign/donation.html:55 #: app/view/user/infos.html:113 app/view/campaign/donation.html:52
msgid "Votre pi-plôme en tirage original de qualité supérieure" msgid "Votre pi-plôme en tirage original de qualité supérieure"
msgstr "Your pi-plome in original print of superior quality" 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" msgid "Un splendide 'Pi-shirt' de La Quadrature du Net"
msgstr "A marvelous pi-shirt of 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" msgid "Un magnifique 'hoodie' de La Quadrature du Net"
msgstr "A splendid hoodie of La Quadrature du Net" msgstr "A splendid hoodie of La Quadrature du Net"